app.js 2.3 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776587775877858779587805878158782587835878458785587865878758788587895879058791587925879358794587955879658797587985879958800588015880258803588045880558806588075880858809588105881158812588135881458815588165881758818588195882058821588225882358824588255882658827588285882958830588315883258833588345883558836588375883858839588405884158842588435884458845588465884758848588495885058851588525885358854588555885658857588585885958860588615886258863588645886558866588675886858869588705887158872588735887458875588765887758878588795888058881588825888358884588855888658887588885888958890588915889258893588945889558896588975889858899589005890158902589035890458905589065890758908589095891058911589125891358914589155891658917589185891958920589215892258923589245892558926589275892858929589305893158932589335893458935589365893758938589395894058941589425894358944589455894658947589485894958950589515895258953589545895558956589575895858959589605896158962589635896458965589665896758968589695897058971589725897358974589755897658977589785897958980589815898258983589845898558986589875898858989589905899158992589935899458995589965899758998589995900059001590025900359004590055900659007590085900959010590115901259013590145901559016590175901859019590205902159022590235902459025590265902759028590295903059031590325903359034590355903659037590385903959040590415904259043590445904559046590475904859049590505905159052590535905459055590565905759058590595906059061590625906359064590655906659067590685906959070590715907259073590745907559076590775907859079590805908159082590835908459085590865908759088590895909059091590925909359094590955909659097590985909959100591015910259103591045910559106591075910859109591105911159112591135911459115591165911759118591195912059121591225912359124591255912659127591285912959130591315913259133591345913559136591375913859139591405914159142591435914459145591465914759148591495915059151591525915359154591555915659157591585915959160591615916259163591645916559166591675916859169591705917159172591735917459175591765917759178591795918059181591825918359184591855918659187591885918959190591915919259193591945919559196591975919859199592005920159202592035920459205592065920759208592095921059211592125921359214592155921659217592185921959220592215922259223592245922559226592275922859229592305923159232592335923459235592365923759238592395924059241592425924359244592455924659247592485924959250592515925259253592545925559256592575925859259592605926159262592635926459265592665926759268592695927059271592725927359274592755927659277592785927959280592815928259283592845928559286592875928859289592905929159292592935929459295592965929759298592995930059301593025930359304593055930659307593085930959310593115931259313593145931559316593175931859319593205932159322593235932459325593265932759328593295933059331593325933359334593355933659337593385933959340593415934259343593445934559346593475934859349593505935159352593535935459355593565935759358593595936059361593625936359364593655936659367593685936959370593715937259373593745937559376593775937859379593805938159382593835938459385593865938759388593895939059391593925939359394593955939659397593985939959400594015940259403594045940559406594075940859409594105941159412594135941459415594165941759418594195942059421594225942359424594255942659427594285942959430594315943259433594345943559436594375943859439594405944159442594435944459445594465944759448594495945059451594525945359454594555945659457594585945959460594615946259463594645946559466594675946859469594705947159472594735947459475594765947759478594795948059481594825948359484594855948659487594885948959490594915949259493594945949559496594975949859499595005950159502595035950459505595065950759508595095951059511595125951359514595155951659517595185951959520595215952259523595245952559526595275952859529595305953159532595335953459535595365953759538595395954059541595425954359544595455954659547595485954959550595515955259553595545955559556595575955859559595605956159562595635956459565595665956759568595695957059571595725957359574595755957659577595785957959580595815958259583595845958559586595875958859589595905959159592595935959459595595965959759598595995960059601596025960359604596055960659607596085960959610596115961259613596145961559616596175961859619596205962159622596235962459625596265962759628596295963059631596325963359634596355963659637596385963959640596415964259643596445964559646596475964859649596505965159652596535965459655596565965759658596595966059661596625966359664596655966659667596685966959670596715967259673596745967559676596775967859679596805968159682596835968459685596865968759688596895969059691596925969359694596955969659697596985969959700597015970259703597045970559706597075970859709597105971159712597135971459715597165971759718597195972059721597225972359724597255972659727597285972959730597315973259733597345973559736597375973859739597405974159742597435974459745597465974759748597495975059751597525975359754597555975659757597585975959760597615976259763597645976559766597675976859769597705977159772597735977459775597765977759778597795978059781597825978359784597855978659787597885978959790597915979259793597945979559796597975979859799598005980159802598035980459805598065980759808598095981059811598125981359814598155981659817598185981959820598215982259823598245982559826598275982859829598305983159832598335983459835598365983759838598395984059841598425984359844598455984659847598485984959850598515985259853598545985559856598575985859859598605986159862598635986459865598665986759868598695987059871598725987359874598755987659877598785987959880598815988259883598845988559886598875988859889598905989159892598935989459895598965989759898598995990059901599025990359904599055990659907599085990959910599115991259913599145991559916599175991859919599205992159922599235992459925599265992759928599295993059931599325993359934599355993659937599385993959940599415994259943599445994559946599475994859949599505995159952599535995459955599565995759958599595996059961599625996359964599655996659967599685996959970599715997259973599745997559976599775997859979599805998159982599835998459985599865998759988599895999059991599925999359994599955999659997599985999960000600016000260003600046000560006600076000860009600106001160012600136001460015600166001760018600196002060021600226002360024600256002660027600286002960030600316003260033600346003560036600376003860039600406004160042600436004460045600466004760048600496005060051600526005360054600556005660057600586005960060600616006260063600646006560066600676006860069600706007160072600736007460075600766007760078600796008060081600826008360084600856008660087600886008960090600916009260093600946009560096600976009860099601006010160102601036010460105601066010760108601096011060111601126011360114601156011660117601186011960120601216012260123601246012560126601276012860129601306013160132601336013460135601366013760138601396014060141601426014360144601456014660147601486014960150601516015260153601546015560156601576015860159601606016160162601636016460165601666016760168601696017060171601726017360174601756017660177601786017960180601816018260183601846018560186601876018860189601906019160192601936019460195601966019760198601996020060201602026020360204602056020660207602086020960210602116021260213602146021560216602176021860219602206022160222602236022460225602266022760228602296023060231602326023360234602356023660237602386023960240602416024260243602446024560246602476024860249602506025160252602536025460255602566025760258602596026060261602626026360264602656026660267602686026960270602716027260273602746027560276602776027860279602806028160282602836028460285602866028760288602896029060291602926029360294602956029660297602986029960300603016030260303603046030560306603076030860309603106031160312603136031460315603166031760318603196032060321603226032360324603256032660327603286032960330603316033260333603346033560336603376033860339603406034160342603436034460345603466034760348603496035060351603526035360354603556035660357603586035960360603616036260363603646036560366603676036860369603706037160372603736037460375603766037760378603796038060381603826038360384603856038660387603886038960390603916039260393603946039560396603976039860399604006040160402604036040460405604066040760408604096041060411604126041360414604156041660417604186041960420604216042260423604246042560426604276042860429604306043160432604336043460435604366043760438604396044060441604426044360444604456044660447604486044960450604516045260453604546045560456604576045860459604606046160462604636046460465604666046760468604696047060471604726047360474604756047660477604786047960480604816048260483604846048560486604876048860489604906049160492604936049460495604966049760498604996050060501605026050360504605056050660507605086050960510605116051260513605146051560516605176051860519605206052160522605236052460525605266052760528605296053060531605326053360534605356053660537605386053960540605416054260543605446054560546605476054860549605506055160552605536055460555605566055760558605596056060561605626056360564605656056660567605686056960570605716057260573605746057560576605776057860579605806058160582605836058460585605866058760588605896059060591605926059360594605956059660597605986059960600606016060260603606046060560606606076060860609606106061160612606136061460615606166061760618606196062060621606226062360624606256062660627606286062960630606316063260633606346063560636606376063860639606406064160642606436064460645606466064760648606496065060651606526065360654606556065660657606586065960660606616066260663606646066560666606676066860669606706067160672606736067460675606766067760678606796068060681606826068360684606856068660687606886068960690606916069260693606946069560696606976069860699607006070160702607036070460705607066070760708607096071060711607126071360714607156071660717607186071960720607216072260723607246072560726607276072860729607306073160732607336073460735607366073760738607396074060741607426074360744607456074660747607486074960750607516075260753607546075560756607576075860759607606076160762607636076460765607666076760768607696077060771607726077360774607756077660777607786077960780607816078260783607846078560786607876078860789607906079160792607936079460795607966079760798607996080060801608026080360804608056080660807608086080960810608116081260813608146081560816608176081860819608206082160822608236082460825608266082760828608296083060831608326083360834608356083660837608386083960840608416084260843608446084560846608476084860849608506085160852608536085460855608566085760858608596086060861608626086360864608656086660867608686086960870608716087260873608746087560876608776087860879608806088160882608836088460885608866088760888608896089060891608926089360894608956089660897608986089960900609016090260903609046090560906609076090860909609106091160912609136091460915609166091760918609196092060921609226092360924609256092660927609286092960930609316093260933609346093560936609376093860939609406094160942609436094460945609466094760948609496095060951609526095360954609556095660957609586095960960609616096260963609646096560966609676096860969609706097160972609736097460975609766097760978609796098060981609826098360984609856098660987609886098960990609916099260993609946099560996609976099860999610006100161002610036100461005610066100761008610096101061011610126101361014610156101661017610186101961020610216102261023610246102561026610276102861029610306103161032610336103461035610366103761038610396104061041610426104361044610456104661047610486104961050610516105261053610546105561056610576105861059610606106161062610636106461065610666106761068610696107061071610726107361074610756107661077610786107961080610816108261083610846108561086610876108861089610906109161092610936109461095610966109761098610996110061101611026110361104611056110661107611086110961110611116111261113611146111561116611176111861119611206112161122611236112461125611266112761128611296113061131611326113361134611356113661137611386113961140611416114261143611446114561146611476114861149611506115161152611536115461155611566115761158611596116061161611626116361164611656116661167611686116961170611716117261173611746117561176611776117861179611806118161182611836118461185611866118761188611896119061191611926119361194611956119661197611986119961200612016120261203612046120561206612076120861209612106121161212612136121461215612166121761218612196122061221612226122361224612256122661227612286122961230612316123261233612346123561236612376123861239612406124161242612436124461245612466124761248612496125061251612526125361254612556125661257612586125961260612616126261263612646126561266612676126861269612706127161272612736127461275612766127761278612796128061281612826128361284612856128661287612886128961290612916129261293612946129561296612976129861299613006130161302613036130461305613066130761308613096131061311613126131361314613156131661317613186131961320613216132261323613246132561326613276132861329613306133161332613336133461335613366133761338613396134061341613426134361344613456134661347613486134961350613516135261353613546135561356613576135861359613606136161362613636136461365613666136761368613696137061371613726137361374613756137661377613786137961380613816138261383613846138561386613876138861389613906139161392613936139461395613966139761398613996140061401614026140361404614056140661407614086140961410614116141261413614146141561416614176141861419614206142161422614236142461425614266142761428614296143061431614326143361434614356143661437614386143961440614416144261443614446144561446614476144861449614506145161452614536145461455614566145761458614596146061461614626146361464614656146661467614686146961470614716147261473614746147561476614776147861479614806148161482614836148461485614866148761488614896149061491614926149361494614956149661497614986149961500615016150261503615046150561506615076150861509615106151161512615136151461515615166151761518615196152061521615226152361524615256152661527615286152961530615316153261533615346153561536615376153861539615406154161542615436154461545615466154761548615496155061551615526155361554615556155661557615586155961560615616156261563615646156561566615676156861569615706157161572615736157461575615766157761578615796158061581615826158361584615856158661587615886158961590615916159261593615946159561596615976159861599616006160161602616036160461605616066160761608616096161061611616126161361614616156161661617616186161961620616216162261623616246162561626616276162861629616306163161632616336163461635616366163761638616396164061641616426164361644616456164661647616486164961650616516165261653616546165561656616576165861659616606166161662616636166461665616666166761668616696167061671616726167361674616756167661677616786167961680616816168261683616846168561686616876168861689616906169161692616936169461695616966169761698616996170061701617026170361704617056170661707617086170961710617116171261713617146171561716617176171861719617206172161722617236172461725617266172761728617296173061731617326173361734617356173661737617386173961740617416174261743617446174561746617476174861749617506175161752617536175461755617566175761758617596176061761617626176361764617656176661767617686176961770617716177261773617746177561776617776177861779617806178161782617836178461785617866178761788617896179061791617926179361794617956179661797617986179961800618016180261803618046180561806618076180861809618106181161812618136181461815618166181761818618196182061821618226182361824618256182661827618286182961830618316183261833618346183561836618376183861839618406184161842618436184461845618466184761848618496185061851618526185361854618556185661857618586185961860618616186261863618646186561866618676186861869618706187161872618736187461875618766187761878618796188061881618826188361884618856188661887618886188961890618916189261893618946189561896618976189861899619006190161902619036190461905619066190761908619096191061911619126191361914619156191661917619186191961920619216192261923619246192561926619276192861929619306193161932619336193461935619366193761938619396194061941619426194361944619456194661947619486194961950619516195261953619546195561956619576195861959619606196161962619636196461965619666196761968619696197061971619726197361974619756197661977619786197961980619816198261983619846198561986619876198861989619906199161992619936199461995619966199761998619996200062001620026200362004620056200662007620086200962010620116201262013620146201562016620176201862019620206202162022620236202462025620266202762028620296203062031620326203362034620356203662037620386203962040620416204262043620446204562046620476204862049620506205162052620536205462055620566205762058620596206062061620626206362064620656206662067620686206962070620716207262073620746207562076620776207862079620806208162082620836208462085620866208762088620896209062091620926209362094620956209662097620986209962100621016210262103621046210562106621076210862109621106211162112621136211462115621166211762118621196212062121621226212362124621256212662127621286212962130621316213262133621346213562136621376213862139621406214162142621436214462145621466214762148621496215062151621526215362154621556215662157621586215962160621616216262163621646216562166621676216862169621706217162172621736217462175621766217762178621796218062181621826218362184621856218662187621886218962190621916219262193621946219562196621976219862199622006220162202622036220462205622066220762208622096221062211622126221362214622156221662217622186221962220622216222262223622246222562226622276222862229622306223162232622336223462235622366223762238622396224062241622426224362244622456224662247622486224962250622516225262253622546225562256622576225862259622606226162262622636226462265622666226762268622696227062271622726227362274622756227662277622786227962280622816228262283622846228562286622876228862289622906229162292622936229462295622966229762298622996230062301623026230362304623056230662307623086230962310623116231262313623146231562316623176231862319623206232162322623236232462325623266232762328623296233062331623326233362334623356233662337623386233962340623416234262343623446234562346623476234862349623506235162352623536235462355623566235762358623596236062361623626236362364623656236662367623686236962370623716237262373623746237562376623776237862379623806238162382623836238462385623866238762388623896239062391623926239362394623956239662397623986239962400624016240262403624046240562406624076240862409624106241162412624136241462415624166241762418624196242062421624226242362424624256242662427624286242962430624316243262433624346243562436624376243862439624406244162442624436244462445624466244762448624496245062451624526245362454624556245662457624586245962460624616246262463624646246562466624676246862469624706247162472624736247462475624766247762478624796248062481624826248362484624856248662487624886248962490624916249262493624946249562496624976249862499625006250162502625036250462505625066250762508625096251062511625126251362514625156251662517625186251962520625216252262523625246252562526625276252862529625306253162532625336253462535625366253762538625396254062541625426254362544625456254662547625486254962550625516255262553625546255562556625576255862559625606256162562625636256462565625666256762568625696257062571625726257362574625756257662577625786257962580625816258262583625846258562586625876258862589625906259162592625936259462595625966259762598625996260062601626026260362604626056260662607626086260962610626116261262613626146261562616626176261862619626206262162622626236262462625626266262762628626296263062631626326263362634626356263662637626386263962640626416264262643626446264562646626476264862649626506265162652626536265462655626566265762658626596266062661626626266362664626656266662667626686266962670626716267262673626746267562676626776267862679626806268162682626836268462685626866268762688626896269062691626926269362694626956269662697626986269962700627016270262703627046270562706627076270862709627106271162712627136271462715627166271762718627196272062721627226272362724627256272662727627286272962730627316273262733627346273562736627376273862739627406274162742627436274462745627466274762748627496275062751627526275362754627556275662757627586275962760627616276262763627646276562766627676276862769627706277162772627736277462775627766277762778627796278062781627826278362784627856278662787627886278962790627916279262793627946279562796627976279862799628006280162802628036280462805628066280762808628096281062811628126281362814628156281662817628186281962820628216282262823628246282562826628276282862829628306283162832628336283462835628366283762838628396284062841628426284362844628456284662847628486284962850628516285262853628546285562856628576285862859628606286162862628636286462865628666286762868628696287062871628726287362874628756287662877628786287962880628816288262883628846288562886628876288862889628906289162892628936289462895628966289762898628996290062901629026290362904629056290662907629086290962910629116291262913629146291562916629176291862919629206292162922629236292462925629266292762928629296293062931629326293362934629356293662937629386293962940629416294262943629446294562946629476294862949629506295162952629536295462955629566295762958629596296062961629626296362964629656296662967629686296962970629716297262973629746297562976629776297862979629806298162982629836298462985629866298762988629896299062991629926299362994629956299662997629986299963000630016300263003630046300563006630076300863009630106301163012630136301463015630166301763018630196302063021630226302363024630256302663027630286302963030630316303263033630346303563036630376303863039630406304163042630436304463045630466304763048630496305063051630526305363054630556305663057630586305963060630616306263063630646306563066630676306863069630706307163072630736307463075630766307763078630796308063081630826308363084630856308663087630886308963090630916309263093630946309563096630976309863099631006310163102631036310463105631066310763108631096311063111631126311363114631156311663117631186311963120631216312263123631246312563126631276312863129631306313163132631336313463135631366313763138631396314063141631426314363144631456314663147631486314963150631516315263153631546315563156631576315863159631606316163162631636316463165631666316763168631696317063171631726317363174631756317663177631786317963180631816318263183631846318563186631876318863189631906319163192631936319463195631966319763198631996320063201632026320363204632056320663207632086320963210632116321263213632146321563216632176321863219632206322163222632236322463225632266322763228632296323063231632326323363234632356323663237632386323963240632416324263243632446324563246632476324863249632506325163252632536325463255632566325763258632596326063261632626326363264632656326663267632686326963270632716327263273632746327563276632776327863279632806328163282632836328463285632866328763288632896329063291632926329363294632956329663297632986329963300633016330263303633046330563306633076330863309633106331163312633136331463315633166331763318633196332063321633226332363324633256332663327633286332963330633316333263333633346333563336633376333863339633406334163342633436334463345633466334763348633496335063351633526335363354633556335663357633586335963360633616336263363633646336563366633676336863369633706337163372633736337463375633766337763378633796338063381633826338363384633856338663387633886338963390633916339263393633946339563396633976339863399634006340163402634036340463405634066340763408634096341063411634126341363414634156341663417634186341963420634216342263423634246342563426634276342863429634306343163432634336343463435634366343763438634396344063441634426344363444634456344663447634486344963450634516345263453634546345563456634576345863459634606346163462634636346463465634666346763468634696347063471634726347363474634756347663477634786347963480634816348263483634846348563486634876348863489634906349163492634936349463495634966349763498634996350063501635026350363504635056350663507635086350963510635116351263513635146351563516635176351863519635206352163522635236352463525635266352763528635296353063531635326353363534635356353663537635386353963540635416354263543635446354563546635476354863549635506355163552635536355463555635566355763558635596356063561635626356363564635656356663567635686356963570635716357263573635746357563576635776357863579635806358163582635836358463585635866358763588635896359063591635926359363594635956359663597635986359963600636016360263603636046360563606636076360863609636106361163612636136361463615636166361763618636196362063621636226362363624636256362663627636286362963630636316363263633636346363563636636376363863639636406364163642636436364463645636466364763648636496365063651636526365363654636556365663657636586365963660636616366263663636646366563666636676366863669636706367163672636736367463675636766367763678636796368063681636826368363684636856368663687636886368963690636916369263693636946369563696636976369863699637006370163702637036370463705637066370763708637096371063711637126371363714637156371663717637186371963720637216372263723637246372563726637276372863729637306373163732637336373463735637366373763738637396374063741637426374363744637456374663747637486374963750637516375263753637546375563756637576375863759637606376163762637636376463765637666376763768637696377063771637726377363774637756377663777637786377963780637816378263783637846378563786637876378863789637906379163792637936379463795637966379763798637996380063801638026380363804638056380663807638086380963810638116381263813638146381563816638176381863819638206382163822638236382463825638266382763828638296383063831638326383363834638356383663837638386383963840638416384263843638446384563846638476384863849638506385163852638536385463855638566385763858638596386063861638626386363864638656386663867638686386963870638716387263873638746387563876638776387863879638806388163882638836388463885638866388763888638896389063891638926389363894638956389663897638986389963900639016390263903639046390563906639076390863909639106391163912639136391463915639166391763918639196392063921639226392363924639256392663927639286392963930639316393263933639346393563936639376393863939639406394163942639436394463945639466394763948639496395063951639526395363954639556395663957639586395963960639616396263963639646396563966639676396863969639706397163972639736397463975639766397763978639796398063981639826398363984639856398663987639886398963990639916399263993639946399563996639976399863999640006400164002640036400464005640066400764008640096401064011640126401364014640156401664017640186401964020640216402264023640246402564026640276402864029640306403164032640336403464035640366403764038640396404064041640426404364044640456404664047640486404964050640516405264053640546405564056640576405864059640606406164062640636406464065640666406764068640696407064071640726407364074640756407664077640786407964080640816408264083640846408564086640876408864089640906409164092640936409464095640966409764098640996410064101641026410364104641056410664107641086410964110641116411264113641146411564116641176411864119641206412164122641236412464125641266412764128641296413064131641326413364134641356413664137641386413964140641416414264143641446414564146641476414864149641506415164152641536415464155641566415764158641596416064161641626416364164641656416664167641686416964170641716417264173641746417564176641776417864179641806418164182641836418464185641866418764188641896419064191641926419364194641956419664197641986419964200642016420264203642046420564206642076420864209642106421164212642136421464215642166421764218642196422064221642226422364224642256422664227642286422964230642316423264233642346423564236642376423864239642406424164242642436424464245642466424764248642496425064251642526425364254642556425664257642586425964260642616426264263642646426564266642676426864269642706427164272642736427464275642766427764278642796428064281642826428364284642856428664287642886428964290642916429264293642946429564296642976429864299643006430164302643036430464305643066430764308643096431064311643126431364314643156431664317643186431964320643216432264323643246432564326643276432864329643306433164332643336433464335643366433764338643396434064341643426434364344643456434664347643486434964350643516435264353643546435564356643576435864359643606436164362643636436464365643666436764368643696437064371643726437364374643756437664377643786437964380643816438264383643846438564386643876438864389643906439164392643936439464395643966439764398643996440064401644026440364404644056440664407644086440964410644116441264413644146441564416644176441864419644206442164422644236442464425644266442764428644296443064431644326443364434644356443664437644386443964440644416444264443644446444564446644476444864449644506445164452644536445464455644566445764458644596446064461644626446364464644656446664467644686446964470644716447264473644746447564476644776447864479644806448164482644836448464485644866448764488644896449064491644926449364494644956449664497644986449964500645016450264503645046450564506645076450864509645106451164512645136451464515645166451764518645196452064521645226452364524645256452664527645286452964530645316453264533645346453564536645376453864539645406454164542645436454464545645466454764548645496455064551645526455364554645556455664557645586455964560645616456264563645646456564566645676456864569645706457164572645736457464575645766457764578645796458064581645826458364584645856458664587645886458964590645916459264593645946459564596645976459864599646006460164602646036460464605646066460764608646096461064611646126461364614646156461664617646186461964620646216462264623646246462564626646276462864629646306463164632646336463464635646366463764638646396464064641646426464364644646456464664647646486464964650646516465264653646546465564656646576465864659646606466164662646636466464665646666466764668646696467064671646726467364674646756467664677646786467964680646816468264683646846468564686646876468864689646906469164692646936469464695646966469764698646996470064701647026470364704647056470664707647086470964710647116471264713647146471564716647176471864719647206472164722647236472464725647266472764728647296473064731647326473364734647356473664737647386473964740647416474264743647446474564746647476474864749647506475164752647536475464755647566475764758647596476064761647626476364764647656476664767647686476964770647716477264773647746477564776647776477864779647806478164782647836478464785647866478764788647896479064791647926479364794647956479664797647986479964800648016480264803648046480564806648076480864809648106481164812648136481464815648166481764818648196482064821648226482364824648256482664827648286482964830648316483264833648346483564836648376483864839648406484164842648436484464845648466484764848648496485064851648526485364854648556485664857648586485964860648616486264863648646486564866648676486864869648706487164872648736487464875648766487764878648796488064881648826488364884648856488664887648886488964890648916489264893648946489564896648976489864899649006490164902649036490464905649066490764908649096491064911649126491364914649156491664917649186491964920649216492264923649246492564926649276492864929649306493164932649336493464935649366493764938649396494064941649426494364944649456494664947649486494964950649516495264953649546495564956649576495864959649606496164962649636496464965649666496764968649696497064971649726497364974649756497664977649786497964980649816498264983649846498564986649876498864989649906499164992649936499464995649966499764998649996500065001650026500365004650056500665007650086500965010650116501265013650146501565016650176501865019650206502165022650236502465025650266502765028650296503065031650326503365034650356503665037650386503965040650416504265043650446504565046650476504865049650506505165052650536505465055650566505765058650596506065061650626506365064650656506665067650686506965070650716507265073650746507565076650776507865079650806508165082650836508465085650866508765088650896509065091650926509365094650956509665097650986509965100651016510265103651046510565106651076510865109651106511165112651136511465115651166511765118651196512065121651226512365124651256512665127651286512965130651316513265133651346513565136651376513865139651406514165142651436514465145651466514765148651496515065151651526515365154651556515665157651586515965160651616516265163651646516565166651676516865169651706517165172651736517465175651766517765178651796518065181651826518365184651856518665187651886518965190651916519265193651946519565196651976519865199652006520165202652036520465205652066520765208652096521065211652126521365214652156521665217652186521965220652216522265223652246522565226652276522865229652306523165232652336523465235652366523765238652396524065241652426524365244652456524665247652486524965250652516525265253652546525565256652576525865259652606526165262652636526465265652666526765268652696527065271652726527365274652756527665277652786527965280652816528265283652846528565286652876528865289652906529165292652936529465295652966529765298652996530065301653026530365304653056530665307653086530965310653116531265313653146531565316653176531865319653206532165322653236532465325653266532765328653296533065331653326533365334653356533665337653386533965340653416534265343653446534565346653476534865349653506535165352653536535465355653566535765358653596536065361653626536365364653656536665367653686536965370653716537265373653746537565376653776537865379653806538165382653836538465385653866538765388653896539065391653926539365394653956539665397653986539965400654016540265403654046540565406654076540865409654106541165412654136541465415654166541765418654196542065421654226542365424654256542665427654286542965430654316543265433654346543565436654376543865439654406544165442654436544465445654466544765448654496545065451654526545365454654556545665457654586545965460654616546265463654646546565466654676546865469654706547165472654736547465475654766547765478654796548065481654826548365484654856548665487654886548965490654916549265493654946549565496654976549865499655006550165502655036550465505655066550765508655096551065511655126551365514655156551665517655186551965520655216552265523655246552565526655276552865529655306553165532655336553465535655366553765538655396554065541655426554365544655456554665547655486554965550655516555265553655546555565556655576555865559655606556165562655636556465565655666556765568655696557065571655726557365574655756557665577655786557965580655816558265583655846558565586655876558865589655906559165592655936559465595655966559765598655996560065601656026560365604656056560665607656086560965610656116561265613656146561565616656176561865619656206562165622656236562465625656266562765628656296563065631656326563365634656356563665637656386563965640656416564265643656446564565646656476564865649656506565165652656536565465655656566565765658656596566065661656626566365664656656566665667656686566965670656716567265673656746567565676656776567865679656806568165682656836568465685656866568765688656896569065691656926569365694656956569665697656986569965700657016570265703657046570565706657076570865709657106571165712657136571465715657166571765718657196572065721657226572365724657256572665727657286572965730657316573265733657346573565736657376573865739657406574165742657436574465745657466574765748657496575065751657526575365754657556575665757657586575965760657616576265763657646576565766657676576865769657706577165772657736577465775657766577765778657796578065781657826578365784657856578665787657886578965790657916579265793657946579565796657976579865799658006580165802658036580465805658066580765808658096581065811658126581365814658156581665817658186581965820658216582265823658246582565826658276582865829658306583165832658336583465835658366583765838658396584065841658426584365844658456584665847658486584965850658516585265853658546585565856658576585865859658606586165862658636586465865658666586765868658696587065871658726587365874658756587665877658786587965880658816588265883658846588565886658876588865889658906589165892658936589465895658966589765898658996590065901659026590365904659056590665907659086590965910659116591265913659146591565916659176591865919659206592165922659236592465925659266592765928659296593065931659326593365934659356593665937659386593965940659416594265943659446594565946659476594865949659506595165952659536595465955659566595765958659596596065961659626596365964659656596665967659686596965970659716597265973659746597565976659776597865979659806598165982659836598465985659866598765988659896599065991659926599365994659956599665997659986599966000660016600266003660046600566006660076600866009660106601166012660136601466015660166601766018660196602066021660226602366024660256602666027660286602966030660316603266033660346603566036660376603866039660406604166042660436604466045660466604766048660496605066051660526605366054660556605666057660586605966060660616606266063660646606566066660676606866069660706607166072660736607466075660766607766078660796608066081660826608366084660856608666087660886608966090660916609266093660946609566096660976609866099661006610166102661036610466105661066610766108661096611066111661126611366114661156611666117661186611966120661216612266123661246612566126661276612866129661306613166132661336613466135661366613766138661396614066141661426614366144661456614666147661486614966150661516615266153661546615566156661576615866159661606616166162661636616466165661666616766168661696617066171661726617366174661756617666177661786617966180661816618266183661846618566186661876618866189661906619166192661936619466195661966619766198661996620066201662026620366204662056620666207662086620966210662116621266213662146621566216662176621866219662206622166222662236622466225662266622766228662296623066231662326623366234662356623666237662386623966240662416624266243662446624566246662476624866249662506625166252662536625466255662566625766258662596626066261662626626366264662656626666267662686626966270662716627266273662746627566276662776627866279662806628166282662836628466285662866628766288662896629066291662926629366294662956629666297662986629966300663016630266303663046630566306663076630866309663106631166312663136631466315663166631766318663196632066321663226632366324663256632666327663286632966330663316633266333663346633566336663376633866339663406634166342663436634466345663466634766348663496635066351663526635366354663556635666357663586635966360663616636266363663646636566366663676636866369663706637166372663736637466375663766637766378663796638066381663826638366384663856638666387663886638966390663916639266393663946639566396663976639866399664006640166402664036640466405664066640766408664096641066411664126641366414664156641666417664186641966420664216642266423664246642566426664276642866429664306643166432664336643466435664366643766438664396644066441664426644366444664456644666447664486644966450664516645266453664546645566456664576645866459664606646166462664636646466465664666646766468664696647066471664726647366474664756647666477664786647966480664816648266483664846648566486664876648866489664906649166492664936649466495664966649766498664996650066501665026650366504665056650666507665086650966510665116651266513665146651566516665176651866519665206652166522665236652466525665266652766528665296653066531665326653366534665356653666537665386653966540665416654266543665446654566546665476654866549665506655166552665536655466555665566655766558665596656066561665626656366564665656656666567665686656966570665716657266573665746657566576665776657866579665806658166582665836658466585665866658766588665896659066591665926659366594665956659666597665986659966600666016660266603666046660566606666076660866609666106661166612666136661466615666166661766618666196662066621666226662366624666256662666627666286662966630666316663266633666346663566636666376663866639666406664166642666436664466645666466664766648666496665066651666526665366654666556665666657666586665966660666616666266663666646666566666666676666866669666706667166672666736667466675666766667766678666796668066681666826668366684666856668666687666886668966690666916669266693666946669566696666976669866699667006670166702667036670466705667066670766708667096671066711667126671366714667156671666717667186671966720667216672266723667246672566726667276672866729667306673166732667336673466735667366673766738667396674066741667426674366744667456674666747667486674966750667516675266753667546675566756667576675866759667606676166762667636676466765667666676766768667696677066771667726677366774667756677666777667786677966780667816678266783667846678566786667876678866789667906679166792667936679466795667966679766798667996680066801668026680366804668056680666807668086680966810668116681266813668146681566816668176681866819668206682166822668236682466825668266682766828668296683066831668326683366834668356683666837668386683966840668416684266843668446684566846668476684866849668506685166852668536685466855668566685766858668596686066861668626686366864668656686666867668686686966870668716687266873668746687566876668776687866879668806688166882668836688466885668866688766888668896689066891668926689366894668956689666897668986689966900669016690266903669046690566906669076690866909669106691166912669136691466915669166691766918669196692066921669226692366924669256692666927669286692966930669316693266933669346693566936669376693866939669406694166942669436694466945669466694766948669496695066951669526695366954669556695666957669586695966960669616696266963669646696566966669676696866969669706697166972669736697466975669766697766978669796698066981669826698366984669856698666987669886698966990669916699266993669946699566996669976699866999670006700167002670036700467005670066700767008670096701067011670126701367014670156701667017670186701967020670216702267023670246702567026670276702867029670306703167032670336703467035670366703767038670396704067041670426704367044670456704667047670486704967050670516705267053670546705567056670576705867059670606706167062670636706467065670666706767068670696707067071670726707367074670756707667077670786707967080670816708267083670846708567086670876708867089670906709167092670936709467095670966709767098670996710067101671026710367104671056710667107671086710967110671116711267113671146711567116671176711867119671206712167122671236712467125671266712767128671296713067131671326713367134671356713667137671386713967140671416714267143671446714567146671476714867149671506715167152671536715467155671566715767158671596716067161671626716367164671656716667167671686716967170671716717267173671746717567176671776717867179671806718167182671836718467185671866718767188671896719067191671926719367194671956719667197671986719967200672016720267203672046720567206672076720867209672106721167212672136721467215672166721767218672196722067221672226722367224672256722667227672286722967230672316723267233672346723567236672376723867239672406724167242672436724467245672466724767248672496725067251672526725367254672556725667257672586725967260672616726267263672646726567266672676726867269672706727167272672736727467275672766727767278672796728067281672826728367284672856728667287672886728967290672916729267293672946729567296672976729867299673006730167302673036730467305673066730767308673096731067311673126731367314673156731667317673186731967320673216732267323673246732567326673276732867329673306733167332673336733467335673366733767338673396734067341673426734367344673456734667347673486734967350673516735267353673546735567356673576735867359673606736167362673636736467365673666736767368673696737067371673726737367374673756737667377673786737967380673816738267383673846738567386673876738867389673906739167392673936739467395673966739767398673996740067401674026740367404674056740667407674086740967410674116741267413674146741567416674176741867419674206742167422674236742467425674266742767428674296743067431674326743367434674356743667437674386743967440674416744267443674446744567446674476744867449674506745167452674536745467455674566745767458674596746067461674626746367464674656746667467674686746967470674716747267473674746747567476674776747867479674806748167482674836748467485674866748767488674896749067491674926749367494674956749667497674986749967500675016750267503675046750567506675076750867509675106751167512675136751467515675166751767518675196752067521675226752367524675256752667527675286752967530675316753267533675346753567536675376753867539675406754167542675436754467545675466754767548675496755067551675526755367554675556755667557675586755967560675616756267563675646756567566675676756867569675706757167572675736757467575675766757767578675796758067581675826758367584675856758667587675886758967590675916759267593675946759567596675976759867599676006760167602676036760467605676066760767608676096761067611676126761367614676156761667617676186761967620676216762267623676246762567626676276762867629676306763167632676336763467635676366763767638676396764067641676426764367644676456764667647676486764967650676516765267653676546765567656676576765867659676606766167662676636766467665676666766767668676696767067671676726767367674676756767667677676786767967680676816768267683676846768567686676876768867689676906769167692676936769467695676966769767698676996770067701677026770367704677056770667707677086770967710677116771267713677146771567716677176771867719677206772167722677236772467725677266772767728677296773067731677326773367734677356773667737677386773967740677416774267743677446774567746677476774867749677506775167752677536775467755677566775767758677596776067761677626776367764677656776667767677686776967770677716777267773677746777567776677776777867779677806778167782677836778467785677866778767788677896779067791677926779367794677956779667797677986779967800678016780267803678046780567806678076780867809678106781167812678136781467815678166781767818678196782067821678226782367824678256782667827678286782967830678316783267833678346783567836678376783867839678406784167842678436784467845678466784767848678496785067851678526785367854678556785667857678586785967860678616786267863678646786567866678676786867869678706787167872678736787467875678766787767878678796788067881678826788367884678856788667887678886788967890678916789267893678946789567896678976789867899679006790167902679036790467905679066790767908679096791067911679126791367914679156791667917679186791967920679216792267923679246792567926679276792867929679306793167932679336793467935679366793767938679396794067941679426794367944679456794667947679486794967950679516795267953679546795567956679576795867959679606796167962679636796467965679666796767968679696797067971679726797367974679756797667977679786797967980679816798267983679846798567986679876798867989679906799167992679936799467995679966799767998679996800068001680026800368004680056800668007680086800968010680116801268013680146801568016680176801868019680206802168022680236802468025680266802768028680296803068031680326803368034680356803668037680386803968040680416804268043680446804568046680476804868049680506805168052680536805468055680566805768058680596806068061680626806368064680656806668067680686806968070680716807268073680746807568076680776807868079680806808168082680836808468085680866808768088680896809068091680926809368094680956809668097680986809968100681016810268103681046810568106681076810868109681106811168112681136811468115681166811768118681196812068121681226812368124681256812668127681286812968130681316813268133681346813568136681376813868139681406814168142681436814468145681466814768148681496815068151681526815368154681556815668157681586815968160681616816268163681646816568166681676816868169681706817168172681736817468175681766817768178681796818068181681826818368184681856818668187681886818968190681916819268193681946819568196681976819868199682006820168202682036820468205682066820768208682096821068211682126821368214682156821668217682186821968220682216822268223682246822568226682276822868229682306823168232682336823468235682366823768238682396824068241682426824368244682456824668247682486824968250682516825268253682546825568256682576825868259682606826168262682636826468265682666826768268682696827068271682726827368274682756827668277682786827968280682816828268283682846828568286682876828868289682906829168292682936829468295682966829768298682996830068301683026830368304683056830668307683086830968310683116831268313683146831568316683176831868319683206832168322683236832468325683266832768328683296833068331683326833368334683356833668337683386833968340683416834268343683446834568346683476834868349683506835168352683536835468355683566835768358683596836068361683626836368364683656836668367683686836968370683716837268373683746837568376683776837868379683806838168382683836838468385683866838768388683896839068391683926839368394683956839668397683986839968400684016840268403684046840568406684076840868409684106841168412684136841468415684166841768418684196842068421684226842368424684256842668427684286842968430684316843268433684346843568436684376843868439684406844168442684436844468445684466844768448684496845068451684526845368454684556845668457684586845968460684616846268463684646846568466684676846868469684706847168472684736847468475684766847768478684796848068481684826848368484684856848668487684886848968490684916849268493684946849568496684976849868499685006850168502685036850468505685066850768508685096851068511685126851368514685156851668517685186851968520685216852268523685246852568526685276852868529685306853168532685336853468535685366853768538685396854068541685426854368544685456854668547685486854968550685516855268553685546855568556685576855868559685606856168562685636856468565685666856768568685696857068571685726857368574685756857668577685786857968580685816858268583685846858568586685876858868589685906859168592685936859468595685966859768598685996860068601686026860368604686056860668607686086860968610686116861268613686146861568616686176861868619686206862168622686236862468625686266862768628686296863068631686326863368634686356863668637686386863968640686416864268643686446864568646686476864868649686506865168652686536865468655686566865768658686596866068661686626866368664686656866668667686686866968670686716867268673686746867568676686776867868679686806868168682686836868468685686866868768688686896869068691686926869368694686956869668697686986869968700687016870268703687046870568706687076870868709687106871168712687136871468715687166871768718687196872068721687226872368724687256872668727687286872968730687316873268733687346873568736687376873868739687406874168742687436874468745687466874768748687496875068751687526875368754687556875668757687586875968760687616876268763687646876568766687676876868769687706877168772687736877468775687766877768778687796878068781687826878368784687856878668787687886878968790687916879268793687946879568796687976879868799688006880168802688036880468805688066880768808688096881068811688126881368814688156881668817688186881968820688216882268823688246882568826688276882868829688306883168832688336883468835688366883768838688396884068841688426884368844688456884668847688486884968850688516885268853688546885568856688576885868859688606886168862688636886468865688666886768868688696887068871688726887368874688756887668877688786887968880688816888268883688846888568886688876888868889688906889168892688936889468895688966889768898688996890068901689026890368904689056890668907689086890968910689116891268913689146891568916689176891868919689206892168922689236892468925689266892768928689296893068931689326893368934689356893668937689386893968940689416894268943689446894568946689476894868949689506895168952689536895468955689566895768958689596896068961689626896368964689656896668967689686896968970689716897268973689746897568976689776897868979689806898168982689836898468985689866898768988689896899068991689926899368994689956899668997689986899969000690016900269003690046900569006690076900869009690106901169012690136901469015690166901769018690196902069021690226902369024690256902669027690286902969030690316903269033690346903569036690376903869039690406904169042690436904469045690466904769048690496905069051690526905369054690556905669057690586905969060690616906269063690646906569066690676906869069690706907169072690736907469075690766907769078690796908069081690826908369084690856908669087690886908969090690916909269093690946909569096690976909869099691006910169102691036910469105691066910769108691096911069111691126911369114691156911669117691186911969120691216912269123691246912569126691276912869129691306913169132691336913469135691366913769138691396914069141691426914369144691456914669147691486914969150691516915269153691546915569156691576915869159691606916169162691636916469165691666916769168691696917069171691726917369174691756917669177691786917969180691816918269183691846918569186691876918869189691906919169192691936919469195691966919769198691996920069201692026920369204692056920669207692086920969210692116921269213692146921569216692176921869219692206922169222692236922469225692266922769228692296923069231692326923369234692356923669237692386923969240692416924269243692446924569246692476924869249692506925169252692536925469255692566925769258692596926069261692626926369264692656926669267692686926969270692716927269273692746927569276692776927869279692806928169282692836928469285692866928769288692896929069291692926929369294692956929669297692986929969300693016930269303693046930569306693076930869309693106931169312693136931469315693166931769318693196932069321693226932369324693256932669327693286932969330693316933269333693346933569336693376933869339693406934169342693436934469345693466934769348693496935069351693526935369354693556935669357693586935969360693616936269363693646936569366693676936869369693706937169372693736937469375693766937769378693796938069381693826938369384693856938669387693886938969390693916939269393693946939569396693976939869399694006940169402694036940469405694066940769408694096941069411694126941369414694156941669417694186941969420694216942269423694246942569426694276942869429694306943169432694336943469435694366943769438694396944069441694426944369444694456944669447694486944969450694516945269453694546945569456694576945869459694606946169462694636946469465694666946769468694696947069471694726947369474694756947669477694786947969480694816948269483694846948569486694876948869489694906949169492694936949469495694966949769498694996950069501695026950369504695056950669507695086950969510695116951269513695146951569516695176951869519695206952169522695236952469525695266952769528695296953069531695326953369534695356953669537695386953969540695416954269543695446954569546695476954869549695506955169552695536955469555695566955769558695596956069561695626956369564695656956669567695686956969570695716957269573695746957569576695776957869579695806958169582695836958469585695866958769588695896959069591695926959369594695956959669597695986959969600696016960269603696046960569606696076960869609696106961169612696136961469615696166961769618696196962069621696226962369624696256962669627696286962969630696316963269633696346963569636696376963869639696406964169642696436964469645696466964769648696496965069651696526965369654696556965669657696586965969660696616966269663696646966569666696676966869669696706967169672696736967469675696766967769678696796968069681696826968369684696856968669687696886968969690696916969269693696946969569696696976969869699697006970169702697036970469705697066970769708697096971069711697126971369714697156971669717697186971969720697216972269723697246972569726697276972869729697306973169732697336973469735697366973769738697396974069741697426974369744697456974669747697486974969750697516975269753697546975569756697576975869759697606976169762697636976469765697666976769768697696977069771697726977369774697756977669777697786977969780697816978269783697846978569786697876978869789697906979169792697936979469795697966979769798697996980069801698026980369804698056980669807698086980969810698116981269813698146981569816698176981869819698206982169822698236982469825698266982769828698296983069831698326983369834698356983669837698386983969840698416984269843698446984569846698476984869849698506985169852698536985469855698566985769858698596986069861698626986369864698656986669867698686986969870698716987269873698746987569876698776987869879698806988169882698836988469885698866988769888698896989069891698926989369894698956989669897698986989969900699016990269903699046990569906699076990869909699106991169912699136991469915699166991769918699196992069921699226992369924699256992669927699286992969930699316993269933699346993569936699376993869939699406994169942699436994469945699466994769948699496995069951699526995369954699556995669957699586995969960699616996269963699646996569966699676996869969699706997169972699736997469975699766997769978699796998069981699826998369984699856998669987699886998969990699916999269993699946999569996699976999869999700007000170002700037000470005700067000770008700097001070011700127001370014700157001670017700187001970020700217002270023700247002570026700277002870029700307003170032700337003470035700367003770038700397004070041700427004370044700457004670047700487004970050700517005270053700547005570056700577005870059700607006170062700637006470065700667006770068700697007070071700727007370074700757007670077700787007970080700817008270083700847008570086700877008870089700907009170092700937009470095700967009770098700997010070101701027010370104701057010670107701087010970110701117011270113701147011570116701177011870119701207012170122701237012470125701267012770128701297013070131701327013370134701357013670137701387013970140701417014270143701447014570146701477014870149701507015170152701537015470155701567015770158701597016070161701627016370164701657016670167701687016970170701717017270173701747017570176701777017870179701807018170182701837018470185701867018770188701897019070191701927019370194701957019670197701987019970200702017020270203702047020570206702077020870209702107021170212702137021470215702167021770218702197022070221702227022370224702257022670227702287022970230702317023270233702347023570236702377023870239702407024170242702437024470245702467024770248702497025070251702527025370254702557025670257702587025970260702617026270263702647026570266702677026870269702707027170272702737027470275702767027770278702797028070281702827028370284702857028670287702887028970290702917029270293702947029570296702977029870299703007030170302703037030470305703067030770308703097031070311703127031370314703157031670317703187031970320703217032270323703247032570326703277032870329703307033170332703337033470335703367033770338703397034070341703427034370344703457034670347703487034970350703517035270353703547035570356703577035870359703607036170362703637036470365703667036770368703697037070371703727037370374703757037670377703787037970380703817038270383703847038570386703877038870389703907039170392703937039470395703967039770398703997040070401704027040370404704057040670407704087040970410704117041270413704147041570416704177041870419704207042170422704237042470425704267042770428704297043070431704327043370434704357043670437704387043970440704417044270443704447044570446704477044870449704507045170452704537045470455704567045770458704597046070461704627046370464704657046670467704687046970470704717047270473704747047570476704777047870479704807048170482704837048470485704867048770488704897049070491704927049370494704957049670497704987049970500705017050270503705047050570506705077050870509705107051170512705137051470515705167051770518705197052070521705227052370524705257052670527705287052970530705317053270533705347053570536705377053870539705407054170542705437054470545705467054770548705497055070551705527055370554705557055670557705587055970560705617056270563705647056570566705677056870569705707057170572705737057470575705767057770578705797058070581705827058370584705857058670587705887058970590705917059270593705947059570596705977059870599706007060170602706037060470605706067060770608706097061070611706127061370614706157061670617706187061970620706217062270623706247062570626706277062870629706307063170632706337063470635706367063770638706397064070641706427064370644706457064670647706487064970650706517065270653706547065570656706577065870659706607066170662706637066470665706667066770668706697067070671706727067370674706757067670677706787067970680706817068270683706847068570686706877068870689706907069170692706937069470695706967069770698706997070070701707027070370704707057070670707707087070970710707117071270713707147071570716707177071870719707207072170722707237072470725707267072770728707297073070731707327073370734707357073670737707387073970740707417074270743707447074570746707477074870749707507075170752707537075470755707567075770758707597076070761707627076370764707657076670767707687076970770707717077270773707747077570776707777077870779707807078170782707837078470785707867078770788707897079070791707927079370794707957079670797707987079970800708017080270803708047080570806708077080870809708107081170812708137081470815708167081770818708197082070821708227082370824708257082670827708287082970830708317083270833708347083570836708377083870839708407084170842708437084470845708467084770848708497085070851708527085370854708557085670857708587085970860708617086270863708647086570866708677086870869708707087170872708737087470875708767087770878708797088070881708827088370884708857088670887708887088970890708917089270893708947089570896708977089870899709007090170902709037090470905709067090770908709097091070911709127091370914709157091670917709187091970920709217092270923709247092570926709277092870929709307093170932709337093470935709367093770938709397094070941709427094370944709457094670947709487094970950709517095270953709547095570956709577095870959709607096170962709637096470965709667096770968709697097070971709727097370974709757097670977709787097970980709817098270983709847098570986709877098870989709907099170992709937099470995709967099770998709997100071001710027100371004710057100671007710087100971010710117101271013710147101571016710177101871019710207102171022710237102471025710267102771028710297103071031710327103371034710357103671037710387103971040710417104271043710447104571046710477104871049710507105171052710537105471055710567105771058710597106071061710627106371064710657106671067710687106971070710717107271073710747107571076710777107871079710807108171082710837108471085710867108771088710897109071091710927109371094710957109671097710987109971100711017110271103711047110571106711077110871109711107111171112711137111471115711167111771118711197112071121711227112371124711257112671127711287112971130711317113271133711347113571136711377113871139711407114171142711437114471145711467114771148711497115071151711527115371154711557115671157711587115971160711617116271163711647116571166711677116871169711707117171172711737117471175711767117771178711797118071181711827118371184711857118671187711887118971190711917119271193711947119571196711977119871199712007120171202712037120471205712067120771208712097121071211712127121371214712157121671217712187121971220712217122271223712247122571226712277122871229712307123171232712337123471235712367123771238712397124071241712427124371244712457124671247712487124971250712517125271253712547125571256712577125871259712607126171262712637126471265712667126771268712697127071271712727127371274712757127671277712787127971280712817128271283712847128571286712877128871289712907129171292712937129471295712967129771298712997130071301713027130371304713057130671307713087130971310713117131271313713147131571316713177131871319713207132171322713237132471325713267132771328713297133071331713327133371334713357133671337713387133971340713417134271343713447134571346713477134871349713507135171352713537135471355713567135771358713597136071361713627136371364713657136671367713687136971370713717137271373713747137571376713777137871379713807138171382713837138471385713867138771388713897139071391713927139371394713957139671397713987139971400714017140271403714047140571406714077140871409714107141171412714137141471415714167141771418714197142071421714227142371424714257142671427714287142971430714317143271433714347143571436714377143871439714407144171442714437144471445714467144771448714497145071451714527145371454714557145671457714587145971460714617146271463714647146571466714677146871469714707147171472714737147471475714767147771478714797148071481714827148371484714857148671487714887148971490714917149271493714947149571496714977149871499715007150171502715037150471505715067150771508715097151071511715127151371514715157151671517715187151971520715217152271523715247152571526715277152871529715307153171532715337153471535715367153771538715397154071541715427154371544715457154671547715487154971550715517155271553715547155571556715577155871559715607156171562715637156471565715667156771568715697157071571715727157371574715757157671577715787157971580715817158271583715847158571586715877158871589715907159171592715937159471595715967159771598715997160071601716027160371604716057160671607716087160971610716117161271613716147161571616716177161871619716207162171622716237162471625716267162771628716297163071631716327163371634716357163671637716387163971640716417164271643716447164571646716477164871649716507165171652716537165471655716567165771658716597166071661716627166371664716657166671667716687166971670716717167271673716747167571676716777167871679716807168171682716837168471685716867168771688716897169071691716927169371694716957169671697716987169971700717017170271703717047170571706717077170871709717107171171712717137171471715717167171771718717197172071721717227172371724717257172671727717287172971730717317173271733717347173571736717377173871739717407174171742717437174471745717467174771748717497175071751717527175371754717557175671757717587175971760717617176271763717647176571766717677176871769717707177171772717737177471775717767177771778717797178071781717827178371784717857178671787717887178971790717917179271793717947179571796717977179871799718007180171802718037180471805718067180771808718097181071811718127181371814718157181671817718187181971820718217182271823718247182571826718277182871829718307183171832718337183471835718367183771838718397184071841718427184371844718457184671847718487184971850718517185271853718547185571856718577185871859718607186171862718637186471865718667186771868718697187071871718727187371874718757187671877718787187971880718817188271883718847188571886718877188871889718907189171892718937189471895718967189771898718997190071901719027190371904719057190671907719087190971910719117191271913719147191571916719177191871919719207192171922719237192471925719267192771928719297193071931719327193371934719357193671937719387193971940719417194271943719447194571946719477194871949719507195171952719537195471955719567195771958719597196071961719627196371964719657196671967719687196971970719717197271973719747197571976719777197871979719807198171982719837198471985719867198771988719897199071991719927199371994719957199671997719987199972000720017200272003720047200572006720077200872009720107201172012720137201472015720167201772018720197202072021720227202372024720257202672027720287202972030720317203272033720347203572036720377203872039720407204172042720437204472045720467204772048720497205072051720527205372054720557205672057720587205972060720617206272063720647206572066720677206872069720707207172072720737207472075720767207772078720797208072081720827208372084720857208672087720887208972090720917209272093720947209572096720977209872099721007210172102721037210472105721067210772108721097211072111721127211372114721157211672117721187211972120721217212272123721247212572126721277212872129721307213172132721337213472135721367213772138721397214072141721427214372144721457214672147721487214972150721517215272153721547215572156721577215872159721607216172162721637216472165721667216772168721697217072171721727217372174721757217672177721787217972180721817218272183721847218572186721877218872189721907219172192721937219472195721967219772198721997220072201722027220372204722057220672207722087220972210722117221272213722147221572216722177221872219722207222172222722237222472225722267222772228722297223072231722327223372234722357223672237722387223972240722417224272243722447224572246722477224872249722507225172252722537225472255722567225772258722597226072261722627226372264722657226672267722687226972270722717227272273722747227572276722777227872279722807228172282722837228472285722867228772288722897229072291722927229372294722957229672297722987229972300723017230272303723047230572306723077230872309723107231172312723137231472315723167231772318723197232072321723227232372324723257232672327723287232972330723317233272333723347233572336723377233872339723407234172342723437234472345723467234772348723497235072351723527235372354723557235672357723587235972360723617236272363723647236572366723677236872369723707237172372723737237472375723767237772378723797238072381723827238372384723857238672387723887238972390723917239272393723947239572396723977239872399724007240172402724037240472405724067240772408724097241072411724127241372414724157241672417724187241972420724217242272423724247242572426724277242872429724307243172432724337243472435724367243772438724397244072441724427244372444724457244672447724487244972450724517245272453724547245572456724577245872459724607246172462724637246472465724667246772468724697247072471724727247372474724757247672477724787247972480724817248272483724847248572486724877248872489724907249172492724937249472495724967249772498724997250072501725027250372504725057250672507725087250972510725117251272513725147251572516725177251872519725207252172522725237252472525725267252772528725297253072531725327253372534725357253672537725387253972540725417254272543725447254572546725477254872549725507255172552725537255472555725567255772558725597256072561725627256372564725657256672567725687256972570725717257272573725747257572576725777257872579725807258172582725837258472585725867258772588725897259072591725927259372594725957259672597725987259972600726017260272603726047260572606726077260872609726107261172612726137261472615726167261772618726197262072621726227262372624726257262672627726287262972630726317263272633726347263572636726377263872639726407264172642726437264472645726467264772648726497265072651726527265372654726557265672657726587265972660726617266272663726647266572666726677266872669726707267172672726737267472675726767267772678726797268072681726827268372684726857268672687726887268972690726917269272693726947269572696726977269872699727007270172702727037270472705727067270772708727097271072711727127271372714727157271672717727187271972720727217272272723727247272572726727277272872729727307273172732727337273472735727367273772738727397274072741727427274372744727457274672747727487274972750727517275272753727547275572756727577275872759727607276172762727637276472765727667276772768727697277072771727727277372774727757277672777727787277972780727817278272783727847278572786727877278872789727907279172792727937279472795727967279772798727997280072801728027280372804728057280672807728087280972810728117281272813728147281572816728177281872819728207282172822728237282472825728267282772828728297283072831728327283372834728357283672837728387283972840728417284272843728447284572846728477284872849728507285172852728537285472855728567285772858728597286072861728627286372864728657286672867728687286972870728717287272873728747287572876728777287872879728807288172882728837288472885728867288772888728897289072891728927289372894728957289672897728987289972900729017290272903729047290572906729077290872909729107291172912729137291472915729167291772918729197292072921729227292372924729257292672927729287292972930729317293272933729347293572936729377293872939729407294172942729437294472945729467294772948729497295072951729527295372954729557295672957729587295972960729617296272963729647296572966729677296872969729707297172972729737297472975729767297772978729797298072981729827298372984729857298672987729887298972990729917299272993729947299572996729977299872999730007300173002730037300473005730067300773008730097301073011730127301373014730157301673017730187301973020730217302273023730247302573026730277302873029730307303173032730337303473035730367303773038730397304073041730427304373044730457304673047730487304973050730517305273053730547305573056730577305873059730607306173062730637306473065730667306773068730697307073071730727307373074730757307673077730787307973080730817308273083730847308573086730877308873089730907309173092730937309473095730967309773098730997310073101731027310373104731057310673107731087310973110731117311273113731147311573116731177311873119731207312173122731237312473125731267312773128731297313073131731327313373134731357313673137731387313973140731417314273143731447314573146731477314873149731507315173152731537315473155731567315773158731597316073161731627316373164731657316673167731687316973170731717317273173731747317573176731777317873179731807318173182731837318473185731867318773188731897319073191731927319373194731957319673197731987319973200732017320273203732047320573206732077320873209732107321173212732137321473215732167321773218732197322073221732227322373224732257322673227732287322973230732317323273233732347323573236732377323873239732407324173242732437324473245732467324773248732497325073251732527325373254732557325673257732587325973260732617326273263732647326573266732677326873269732707327173272732737327473275732767327773278732797328073281732827328373284732857328673287732887328973290732917329273293732947329573296732977329873299733007330173302733037330473305733067330773308733097331073311733127331373314733157331673317733187331973320733217332273323733247332573326733277332873329733307333173332733337333473335733367333773338733397334073341733427334373344733457334673347733487334973350733517335273353733547335573356733577335873359733607336173362733637336473365733667336773368733697337073371733727337373374733757337673377733787337973380733817338273383733847338573386733877338873389733907339173392733937339473395733967339773398733997340073401734027340373404734057340673407734087340973410734117341273413734147341573416734177341873419734207342173422734237342473425734267342773428734297343073431734327343373434734357343673437734387343973440734417344273443734447344573446734477344873449734507345173452734537345473455734567345773458734597346073461734627346373464734657346673467734687346973470734717347273473734747347573476734777347873479734807348173482734837348473485734867348773488734897349073491734927349373494734957349673497734987349973500735017350273503735047350573506735077350873509735107351173512735137351473515735167351773518735197352073521735227352373524735257352673527735287352973530735317353273533735347353573536735377353873539735407354173542735437354473545735467354773548735497355073551735527355373554735557355673557735587355973560735617356273563735647356573566735677356873569735707357173572735737357473575735767357773578735797358073581735827358373584735857358673587735887358973590735917359273593735947359573596735977359873599736007360173602736037360473605736067360773608736097361073611736127361373614736157361673617736187361973620736217362273623736247362573626736277362873629736307363173632736337363473635736367363773638736397364073641736427364373644736457364673647736487364973650736517365273653736547365573656736577365873659736607366173662736637366473665736667366773668736697367073671736727367373674736757367673677736787367973680736817368273683736847368573686736877368873689736907369173692736937369473695736967369773698736997370073701737027370373704737057370673707737087370973710737117371273713737147371573716737177371873719737207372173722737237372473725737267372773728737297373073731737327373373734737357373673737737387373973740737417374273743737447374573746737477374873749737507375173752737537375473755737567375773758737597376073761737627376373764737657376673767737687376973770737717377273773737747377573776737777377873779737807378173782737837378473785737867378773788737897379073791737927379373794737957379673797737987379973800738017380273803738047380573806738077380873809738107381173812738137381473815738167381773818738197382073821738227382373824738257382673827738287382973830738317383273833738347383573836738377383873839738407384173842738437384473845738467384773848738497385073851738527385373854738557385673857738587385973860738617386273863738647386573866738677386873869738707387173872738737387473875738767387773878738797388073881738827388373884738857388673887738887388973890738917389273893738947389573896738977389873899739007390173902739037390473905739067390773908739097391073911739127391373914739157391673917739187391973920739217392273923739247392573926739277392873929739307393173932739337393473935739367393773938739397394073941739427394373944739457394673947739487394973950739517395273953739547395573956739577395873959739607396173962739637396473965739667396773968739697397073971739727397373974739757397673977739787397973980739817398273983739847398573986739877398873989739907399173992739937399473995739967399773998739997400074001740027400374004740057400674007740087400974010740117401274013740147401574016740177401874019740207402174022740237402474025740267402774028740297403074031740327403374034740357403674037740387403974040740417404274043740447404574046740477404874049740507405174052740537405474055740567405774058740597406074061740627406374064740657406674067740687406974070740717407274073740747407574076740777407874079740807408174082740837408474085740867408774088740897409074091740927409374094740957409674097740987409974100741017410274103741047410574106741077410874109741107411174112741137411474115741167411774118741197412074121741227412374124741257412674127741287412974130741317413274133741347413574136741377413874139741407414174142741437414474145741467414774148741497415074151741527415374154741557415674157741587415974160741617416274163741647416574166741677416874169741707417174172741737417474175741767417774178741797418074181741827418374184741857418674187741887418974190741917419274193741947419574196741977419874199742007420174202742037420474205742067420774208742097421074211742127421374214742157421674217742187421974220742217422274223742247422574226742277422874229742307423174232742337423474235742367423774238742397424074241742427424374244742457424674247742487424974250742517425274253742547425574256742577425874259742607426174262742637426474265742667426774268742697427074271742727427374274742757427674277742787427974280742817428274283742847428574286742877428874289742907429174292742937429474295742967429774298742997430074301743027430374304743057430674307743087430974310743117431274313743147431574316743177431874319743207432174322743237432474325743267432774328743297433074331743327433374334743357433674337743387433974340743417434274343743447434574346743477434874349743507435174352743537435474355743567435774358743597436074361743627436374364743657436674367743687436974370743717437274373743747437574376743777437874379743807438174382743837438474385743867438774388743897439074391743927439374394743957439674397743987439974400744017440274403744047440574406744077440874409744107441174412744137441474415744167441774418744197442074421744227442374424744257442674427744287442974430744317443274433744347443574436744377443874439744407444174442744437444474445744467444774448744497445074451744527445374454744557445674457744587445974460744617446274463744647446574466744677446874469744707447174472744737447474475744767447774478744797448074481744827448374484744857448674487744887448974490744917449274493744947449574496744977449874499745007450174502745037450474505745067450774508745097451074511745127451374514745157451674517745187451974520745217452274523745247452574526745277452874529745307453174532745337453474535745367453774538745397454074541745427454374544745457454674547745487454974550745517455274553745547455574556745577455874559745607456174562745637456474565745667456774568745697457074571745727457374574745757457674577745787457974580745817458274583745847458574586745877458874589745907459174592745937459474595745967459774598745997460074601746027460374604746057460674607746087460974610746117461274613746147461574616746177461874619746207462174622746237462474625746267462774628746297463074631746327463374634746357463674637746387463974640746417464274643746447464574646746477464874649746507465174652746537465474655746567465774658746597466074661746627466374664746657466674667746687466974670746717467274673746747467574676746777467874679746807468174682746837468474685746867468774688746897469074691746927469374694746957469674697746987469974700747017470274703747047470574706747077470874709747107471174712747137471474715747167471774718747197472074721747227472374724747257472674727747287472974730747317473274733747347473574736747377473874739747407474174742747437474474745747467474774748747497475074751747527475374754747557475674757747587475974760747617476274763747647476574766747677476874769747707477174772747737477474775747767477774778747797478074781747827478374784747857478674787747887478974790747917479274793747947479574796747977479874799748007480174802748037480474805748067480774808748097481074811748127481374814748157481674817748187481974820748217482274823748247482574826748277482874829748307483174832748337483474835748367483774838748397484074841748427484374844748457484674847748487484974850748517485274853748547485574856748577485874859748607486174862748637486474865748667486774868748697487074871748727487374874748757487674877748787487974880748817488274883748847488574886748877488874889748907489174892748937489474895748967489774898748997490074901749027490374904749057490674907749087490974910749117491274913749147491574916749177491874919749207492174922749237492474925749267492774928749297493074931749327493374934749357493674937749387493974940749417494274943749447494574946749477494874949749507495174952749537495474955749567495774958749597496074961749627496374964749657496674967749687496974970749717497274973749747497574976749777497874979749807498174982749837498474985749867498774988749897499074991749927499374994749957499674997749987499975000750017500275003750047500575006750077500875009750107501175012750137501475015750167501775018750197502075021750227502375024750257502675027750287502975030750317503275033750347503575036750377503875039750407504175042750437504475045750467504775048750497505075051750527505375054750557505675057750587505975060750617506275063750647506575066750677506875069750707507175072750737507475075750767507775078750797508075081750827508375084750857508675087750887508975090750917509275093750947509575096750977509875099751007510175102751037510475105751067510775108751097511075111751127511375114751157511675117751187511975120751217512275123751247512575126751277512875129751307513175132751337513475135751367513775138751397514075141751427514375144751457514675147751487514975150751517515275153751547515575156751577515875159751607516175162751637516475165751667516775168751697517075171751727517375174751757517675177751787517975180751817518275183751847518575186751877518875189751907519175192751937519475195751967519775198751997520075201752027520375204752057520675207752087520975210752117521275213752147521575216752177521875219752207522175222752237522475225752267522775228752297523075231752327523375234752357523675237752387523975240752417524275243752447524575246752477524875249752507525175252752537525475255752567525775258752597526075261752627526375264752657526675267752687526975270752717527275273752747527575276752777527875279752807528175282752837528475285752867528775288752897529075291752927529375294752957529675297752987529975300753017530275303753047530575306753077530875309753107531175312753137531475315753167531775318753197532075321753227532375324753257532675327753287532975330753317533275333753347533575336753377533875339753407534175342753437534475345753467534775348753497535075351753527535375354753557535675357753587535975360753617536275363753647536575366753677536875369753707537175372753737537475375753767537775378753797538075381753827538375384753857538675387753887538975390753917539275393753947539575396753977539875399754007540175402754037540475405754067540775408754097541075411754127541375414754157541675417754187541975420754217542275423754247542575426754277542875429754307543175432754337543475435754367543775438754397544075441754427544375444754457544675447754487544975450754517545275453754547545575456754577545875459754607546175462754637546475465754667546775468754697547075471754727547375474754757547675477754787547975480754817548275483754847548575486754877548875489754907549175492754937549475495754967549775498754997550075501755027550375504755057550675507755087550975510755117551275513755147551575516755177551875519755207552175522755237552475525755267552775528755297553075531755327553375534755357553675537755387553975540755417554275543755447554575546755477554875549755507555175552755537555475555755567555775558755597556075561755627556375564755657556675567755687556975570755717557275573755747557575576755777557875579755807558175582755837558475585755867558775588755897559075591755927559375594755957559675597755987559975600756017560275603756047560575606756077560875609756107561175612756137561475615756167561775618756197562075621756227562375624756257562675627756287562975630756317563275633756347563575636756377563875639756407564175642756437564475645756467564775648756497565075651756527565375654756557565675657756587565975660756617566275663756647566575666756677566875669756707567175672756737567475675756767567775678756797568075681756827568375684756857568675687756887568975690756917569275693756947569575696756977569875699757007570175702757037570475705757067570775708757097571075711757127571375714757157571675717757187571975720757217572275723757247572575726757277572875729757307573175732757337573475735757367573775738757397574075741757427574375744757457574675747757487574975750757517575275753757547575575756757577575875759757607576175762757637576475765757667576775768757697577075771757727577375774757757577675777757787577975780757817578275783757847578575786757877578875789757907579175792757937579475795757967579775798757997580075801758027580375804758057580675807758087580975810758117581275813758147581575816758177581875819758207582175822758237582475825758267582775828758297583075831758327583375834758357583675837758387583975840758417584275843758447584575846758477584875849758507585175852758537585475855758567585775858758597586075861758627586375864758657586675867758687586975870758717587275873758747587575876758777587875879758807588175882758837588475885758867588775888758897589075891758927589375894758957589675897758987589975900759017590275903759047590575906759077590875909759107591175912759137591475915759167591775918759197592075921759227592375924759257592675927759287592975930759317593275933759347593575936759377593875939759407594175942759437594475945759467594775948759497595075951759527595375954759557595675957759587595975960759617596275963759647596575966759677596875969759707597175972759737597475975759767597775978759797598075981759827598375984759857598675987759887598975990759917599275993759947599575996759977599875999760007600176002760037600476005760067600776008760097601076011760127601376014760157601676017760187601976020760217602276023760247602576026760277602876029760307603176032760337603476035760367603776038760397604076041760427604376044760457604676047760487604976050760517605276053760547605576056760577605876059760607606176062760637606476065760667606776068760697607076071760727607376074760757607676077760787607976080760817608276083760847608576086760877608876089760907609176092760937609476095760967609776098760997610076101761027610376104761057610676107761087610976110761117611276113761147611576116761177611876119761207612176122761237612476125761267612776128761297613076131761327613376134761357613676137761387613976140761417614276143761447614576146761477614876149761507615176152761537615476155761567615776158761597616076161761627616376164761657616676167761687616976170761717617276173761747617576176761777617876179761807618176182761837618476185761867618776188761897619076191761927619376194761957619676197761987619976200762017620276203762047620576206762077620876209762107621176212762137621476215762167621776218762197622076221762227622376224762257622676227762287622976230762317623276233762347623576236762377623876239762407624176242762437624476245762467624776248762497625076251762527625376254762557625676257762587625976260762617626276263762647626576266762677626876269762707627176272762737627476275762767627776278762797628076281762827628376284762857628676287762887628976290762917629276293762947629576296762977629876299763007630176302763037630476305763067630776308763097631076311763127631376314763157631676317763187631976320763217632276323763247632576326763277632876329763307633176332763337633476335763367633776338763397634076341763427634376344763457634676347763487634976350763517635276353763547635576356763577635876359763607636176362763637636476365763667636776368763697637076371763727637376374763757637676377763787637976380763817638276383763847638576386763877638876389763907639176392763937639476395763967639776398763997640076401764027640376404764057640676407764087640976410764117641276413764147641576416764177641876419764207642176422764237642476425764267642776428764297643076431764327643376434764357643676437764387643976440764417644276443764447644576446764477644876449764507645176452764537645476455764567645776458764597646076461764627646376464764657646676467764687646976470764717647276473764747647576476764777647876479764807648176482764837648476485764867648776488764897649076491764927649376494764957649676497764987649976500765017650276503765047650576506765077650876509765107651176512765137651476515765167651776518765197652076521765227652376524765257652676527765287652976530765317653276533765347653576536765377653876539765407654176542765437654476545765467654776548765497655076551765527655376554765557655676557765587655976560765617656276563765647656576566765677656876569765707657176572765737657476575765767657776578765797658076581765827658376584765857658676587765887658976590765917659276593765947659576596765977659876599766007660176602766037660476605766067660776608766097661076611766127661376614766157661676617766187661976620766217662276623766247662576626766277662876629766307663176632766337663476635766367663776638766397664076641766427664376644766457664676647766487664976650766517665276653766547665576656766577665876659766607666176662766637666476665766667666776668766697667076671766727667376674766757667676677766787667976680766817668276683766847668576686766877668876689766907669176692766937669476695766967669776698766997670076701767027670376704767057670676707767087670976710767117671276713767147671576716767177671876719767207672176722767237672476725767267672776728767297673076731767327673376734767357673676737767387673976740767417674276743767447674576746767477674876749767507675176752767537675476755767567675776758767597676076761767627676376764767657676676767767687676976770767717677276773767747677576776767777677876779767807678176782767837678476785767867678776788767897679076791767927679376794767957679676797767987679976800768017680276803768047680576806768077680876809768107681176812768137681476815768167681776818768197682076821768227682376824768257682676827768287682976830768317683276833768347683576836768377683876839768407684176842768437684476845768467684776848768497685076851768527685376854768557685676857768587685976860768617686276863768647686576866768677686876869768707687176872768737687476875768767687776878768797688076881768827688376884768857688676887768887688976890768917689276893768947689576896768977689876899769007690176902769037690476905769067690776908769097691076911769127691376914769157691676917769187691976920769217692276923769247692576926769277692876929769307693176932769337693476935769367693776938769397694076941769427694376944769457694676947769487694976950769517695276953769547695576956769577695876959769607696176962769637696476965769667696776968769697697076971769727697376974769757697676977769787697976980769817698276983769847698576986769877698876989769907699176992769937699476995769967699776998769997700077001770027700377004770057700677007770087700977010770117701277013770147701577016770177701877019770207702177022770237702477025770267702777028770297703077031770327703377034770357703677037770387703977040770417704277043770447704577046770477704877049770507705177052770537705477055770567705777058770597706077061770627706377064770657706677067770687706977070770717707277073770747707577076770777707877079770807708177082770837708477085770867708777088770897709077091770927709377094770957709677097770987709977100771017710277103771047710577106771077710877109771107711177112771137711477115771167711777118771197712077121771227712377124771257712677127771287712977130771317713277133771347713577136771377713877139771407714177142771437714477145771467714777148771497715077151771527715377154771557715677157771587715977160771617716277163771647716577166771677716877169771707717177172771737717477175771767717777178771797718077181771827718377184771857718677187771887718977190771917719277193771947719577196771977719877199772007720177202772037720477205772067720777208772097721077211772127721377214772157721677217772187721977220772217722277223772247722577226772277722877229772307723177232772337723477235772367723777238772397724077241772427724377244772457724677247772487724977250772517725277253772547725577256772577725877259772607726177262772637726477265772667726777268772697727077271772727727377274772757727677277772787727977280772817728277283772847728577286772877728877289772907729177292772937729477295772967729777298772997730077301773027730377304773057730677307773087730977310773117731277313773147731577316773177731877319773207732177322773237732477325773267732777328773297733077331773327733377334773357733677337773387733977340773417734277343773447734577346773477734877349773507735177352773537735477355773567735777358773597736077361773627736377364773657736677367773687736977370773717737277373773747737577376773777737877379773807738177382773837738477385773867738777388773897739077391773927739377394773957739677397773987739977400774017740277403774047740577406774077740877409774107741177412774137741477415774167741777418774197742077421774227742377424774257742677427774287742977430774317743277433774347743577436774377743877439774407744177442774437744477445774467744777448774497745077451774527745377454774557745677457774587745977460774617746277463774647746577466774677746877469774707747177472774737747477475774767747777478774797748077481774827748377484774857748677487774887748977490774917749277493774947749577496774977749877499775007750177502775037750477505775067750777508775097751077511775127751377514775157751677517775187751977520775217752277523775247752577526775277752877529775307753177532775337753477535775367753777538775397754077541775427754377544775457754677547775487754977550775517755277553775547755577556775577755877559775607756177562775637756477565775667756777568775697757077571775727757377574775757757677577775787757977580775817758277583775847758577586775877758877589775907759177592775937759477595775967759777598775997760077601776027760377604776057760677607776087760977610776117761277613776147761577616776177761877619776207762177622776237762477625776267762777628776297763077631776327763377634776357763677637776387763977640776417764277643776447764577646776477764877649776507765177652776537765477655776567765777658776597766077661776627766377664776657766677667776687766977670776717767277673776747767577676776777767877679776807768177682776837768477685776867768777688776897769077691776927769377694776957769677697776987769977700777017770277703777047770577706777077770877709777107771177712777137771477715777167771777718777197772077721777227772377724777257772677727777287772977730777317773277733777347773577736777377773877739777407774177742777437774477745777467774777748777497775077751777527775377754777557775677757777587775977760777617776277763777647776577766777677776877769777707777177772777737777477775777767777777778777797778077781777827778377784777857778677787777887778977790777917779277793777947779577796777977779877799778007780177802778037780477805778067780777808778097781077811778127781377814778157781677817778187781977820778217782277823778247782577826778277782877829778307783177832778337783477835778367783777838778397784077841778427784377844778457784677847778487784977850778517785277853778547785577856778577785877859778607786177862778637786477865778667786777868778697787077871778727787377874778757787677877778787787977880778817788277883778847788577886778877788877889778907789177892778937789477895778967789777898778997790077901779027790377904779057790677907779087790977910779117791277913779147791577916779177791877919779207792177922779237792477925779267792777928779297793077931779327793377934779357793677937779387793977940779417794277943779447794577946779477794877949779507795177952779537795477955779567795777958779597796077961779627796377964779657796677967779687796977970779717797277973779747797577976779777797877979779807798177982779837798477985779867798777988779897799077991779927799377994779957799677997779987799978000780017800278003780047800578006780077800878009780107801178012780137801478015780167801778018780197802078021780227802378024780257802678027780287802978030780317803278033780347803578036780377803878039780407804178042780437804478045780467804778048780497805078051780527805378054780557805678057780587805978060780617806278063780647806578066780677806878069780707807178072780737807478075780767807778078780797808078081780827808378084780857808678087780887808978090780917809278093780947809578096780977809878099781007810178102781037810478105781067810778108781097811078111781127811378114781157811678117781187811978120781217812278123781247812578126781277812878129781307813178132781337813478135781367813778138781397814078141781427814378144781457814678147781487814978150781517815278153781547815578156781577815878159781607816178162781637816478165781667816778168781697817078171781727817378174781757817678177781787817978180781817818278183781847818578186781877818878189781907819178192781937819478195781967819778198781997820078201782027820378204782057820678207782087820978210782117821278213782147821578216782177821878219782207822178222782237822478225782267822778228782297823078231782327823378234782357823678237782387823978240782417824278243782447824578246782477824878249782507825178252782537825478255782567825778258782597826078261782627826378264782657826678267782687826978270782717827278273782747827578276782777827878279782807828178282782837828478285782867828778288782897829078291782927829378294782957829678297782987829978300783017830278303783047830578306783077830878309783107831178312783137831478315783167831778318783197832078321783227832378324783257832678327783287832978330783317833278333783347833578336783377833878339783407834178342783437834478345783467834778348783497835078351783527835378354783557835678357783587835978360783617836278363783647836578366783677836878369783707837178372783737837478375783767837778378783797838078381783827838378384783857838678387783887838978390783917839278393783947839578396783977839878399784007840178402784037840478405784067840778408784097841078411784127841378414784157841678417784187841978420784217842278423784247842578426784277842878429784307843178432784337843478435784367843778438784397844078441784427844378444784457844678447784487844978450784517845278453784547845578456784577845878459784607846178462784637846478465784667846778468784697847078471784727847378474784757847678477784787847978480784817848278483784847848578486784877848878489784907849178492784937849478495784967849778498784997850078501785027850378504785057850678507785087850978510785117851278513785147851578516785177851878519785207852178522785237852478525785267852778528785297853078531785327853378534785357853678537785387853978540785417854278543785447854578546785477854878549785507855178552785537855478555785567855778558785597856078561785627856378564785657856678567785687856978570785717857278573785747857578576785777857878579785807858178582785837858478585785867858778588785897859078591785927859378594785957859678597785987859978600786017860278603786047860578606786077860878609786107861178612786137861478615786167861778618786197862078621786227862378624786257862678627786287862978630786317863278633786347863578636786377863878639786407864178642786437864478645786467864778648786497865078651786527865378654786557865678657786587865978660786617866278663786647866578666786677866878669786707867178672786737867478675786767867778678786797868078681786827868378684786857868678687786887868978690786917869278693786947869578696786977869878699787007870178702787037870478705787067870778708787097871078711787127871378714787157871678717787187871978720787217872278723787247872578726787277872878729787307873178732787337873478735787367873778738787397874078741787427874378744787457874678747787487874978750787517875278753787547875578756787577875878759787607876178762787637876478765787667876778768787697877078771787727877378774787757877678777787787877978780787817878278783787847878578786787877878878789787907879178792787937879478795787967879778798787997880078801788027880378804788057880678807788087880978810788117881278813788147881578816788177881878819788207882178822788237882478825788267882778828788297883078831788327883378834788357883678837788387883978840788417884278843788447884578846788477884878849788507885178852788537885478855788567885778858788597886078861788627886378864788657886678867788687886978870788717887278873788747887578876788777887878879788807888178882788837888478885788867888778888788897889078891788927889378894788957889678897788987889978900789017890278903789047890578906789077890878909789107891178912789137891478915789167891778918789197892078921789227892378924789257892678927789287892978930789317893278933789347893578936789377893878939789407894178942789437894478945789467894778948789497895078951789527895378954789557895678957789587895978960789617896278963789647896578966789677896878969789707897178972789737897478975789767897778978789797898078981789827898378984789857898678987789887898978990789917899278993789947899578996789977899878999790007900179002790037900479005790067900779008790097901079011790127901379014790157901679017790187901979020790217902279023790247902579026790277902879029790307903179032790337903479035790367903779038790397904079041790427904379044790457904679047790487904979050790517905279053790547905579056790577905879059790607906179062790637906479065790667906779068790697907079071790727907379074790757907679077790787907979080790817908279083790847908579086790877908879089790907909179092790937909479095790967909779098790997910079101791027910379104791057910679107791087910979110791117911279113791147911579116791177911879119791207912179122791237912479125791267912779128791297913079131791327913379134791357913679137791387913979140791417914279143791447914579146791477914879149791507915179152791537915479155791567915779158791597916079161791627916379164791657916679167791687916979170791717917279173791747917579176791777917879179791807918179182791837918479185791867918779188791897919079191791927919379194791957919679197791987919979200792017920279203792047920579206792077920879209792107921179212792137921479215792167921779218792197922079221792227922379224792257922679227792287922979230792317923279233792347923579236792377923879239792407924179242792437924479245792467924779248792497925079251792527925379254792557925679257792587925979260792617926279263792647926579266792677926879269792707927179272792737927479275792767927779278792797928079281792827928379284792857928679287792887928979290792917929279293792947929579296792977929879299793007930179302793037930479305793067930779308793097931079311793127931379314793157931679317793187931979320793217932279323793247932579326793277932879329793307933179332793337933479335793367933779338793397934079341793427934379344793457934679347793487934979350793517935279353793547935579356793577935879359793607936179362793637936479365793667936779368793697937079371793727937379374793757937679377793787937979380793817938279383793847938579386793877938879389793907939179392793937939479395793967939779398793997940079401794027940379404794057940679407794087940979410794117941279413794147941579416794177941879419794207942179422794237942479425794267942779428794297943079431794327943379434794357943679437794387943979440794417944279443794447944579446794477944879449794507945179452794537945479455794567945779458794597946079461794627946379464794657946679467794687946979470794717947279473794747947579476794777947879479794807948179482794837948479485794867948779488794897949079491794927949379494794957949679497794987949979500795017950279503795047950579506795077950879509795107951179512795137951479515795167951779518795197952079521795227952379524795257952679527795287952979530795317953279533795347953579536795377953879539795407954179542795437954479545795467954779548795497955079551795527955379554795557955679557795587955979560795617956279563795647956579566795677956879569795707957179572795737957479575795767957779578795797958079581795827958379584795857958679587795887958979590795917959279593795947959579596795977959879599796007960179602796037960479605796067960779608796097961079611796127961379614796157961679617796187961979620796217962279623796247962579626796277962879629796307963179632796337963479635796367963779638796397964079641796427964379644796457964679647796487964979650796517965279653796547965579656796577965879659796607966179662796637966479665796667966779668796697967079671796727967379674796757967679677796787967979680796817968279683796847968579686796877968879689796907969179692796937969479695796967969779698796997970079701797027970379704797057970679707797087970979710797117971279713797147971579716797177971879719797207972179722797237972479725797267972779728797297973079731797327973379734797357973679737797387973979740797417974279743797447974579746797477974879749797507975179752797537975479755797567975779758797597976079761797627976379764797657976679767797687976979770797717977279773797747977579776797777977879779797807978179782797837978479785797867978779788797897979079791797927979379794797957979679797797987979979800798017980279803798047980579806798077980879809798107981179812798137981479815798167981779818798197982079821798227982379824798257982679827798287982979830798317983279833798347983579836798377983879839798407984179842798437984479845798467984779848798497985079851798527985379854798557985679857798587985979860798617986279863798647986579866798677986879869798707987179872798737987479875798767987779878798797988079881798827988379884798857988679887798887988979890798917989279893798947989579896798977989879899799007990179902799037990479905799067990779908799097991079911799127991379914799157991679917799187991979920799217992279923799247992579926799277992879929799307993179932799337993479935799367993779938799397994079941799427994379944799457994679947799487994979950799517995279953799547995579956799577995879959799607996179962799637996479965799667996779968799697997079971799727997379974799757997679977799787997979980799817998279983799847998579986799877998879989799907999179992799937999479995799967999779998799998000080001800028000380004800058000680007800088000980010800118001280013800148001580016800178001880019800208002180022800238002480025800268002780028800298003080031800328003380034800358003680037800388003980040800418004280043800448004580046800478004880049800508005180052800538005480055800568005780058800598006080061800628006380064800658006680067800688006980070800718007280073800748007580076800778007880079800808008180082800838008480085800868008780088800898009080091800928009380094800958009680097800988009980100801018010280103801048010580106801078010880109801108011180112801138011480115801168011780118801198012080121801228012380124801258012680127801288012980130801318013280133801348013580136801378013880139801408014180142801438014480145801468014780148801498015080151801528015380154801558015680157801588015980160801618016280163801648016580166801678016880169801708017180172801738017480175801768017780178801798018080181801828018380184801858018680187801888018980190801918019280193801948019580196801978019880199802008020180202802038020480205802068020780208802098021080211802128021380214802158021680217802188021980220802218022280223802248022580226802278022880229802308023180232802338023480235802368023780238802398024080241802428024380244802458024680247802488024980250802518025280253802548025580256802578025880259802608026180262802638026480265802668026780268802698027080271802728027380274802758027680277802788027980280802818028280283802848028580286802878028880289802908029180292802938029480295802968029780298802998030080301803028030380304803058030680307803088030980310803118031280313803148031580316803178031880319803208032180322803238032480325803268032780328803298033080331803328033380334803358033680337803388033980340803418034280343803448034580346803478034880349803508035180352803538035480355803568035780358803598036080361803628036380364803658036680367803688036980370803718037280373803748037580376803778037880379803808038180382803838038480385803868038780388803898039080391803928039380394803958039680397803988039980400804018040280403804048040580406804078040880409804108041180412804138041480415804168041780418804198042080421804228042380424804258042680427804288042980430804318043280433804348043580436804378043880439804408044180442804438044480445804468044780448804498045080451804528045380454804558045680457804588045980460804618046280463804648046580466804678046880469804708047180472804738047480475804768047780478804798048080481804828048380484804858048680487804888048980490804918049280493804948049580496804978049880499805008050180502805038050480505805068050780508805098051080511805128051380514805158051680517805188051980520805218052280523805248052580526805278052880529805308053180532805338053480535805368053780538805398054080541805428054380544805458054680547805488054980550805518055280553805548055580556805578055880559805608056180562805638056480565805668056780568805698057080571805728057380574805758057680577805788057980580805818058280583805848058580586805878058880589805908059180592805938059480595805968059780598805998060080601806028060380604806058060680607806088060980610806118061280613806148061580616806178061880619806208062180622806238062480625806268062780628806298063080631806328063380634806358063680637806388063980640806418064280643806448064580646806478064880649806508065180652806538065480655806568065780658806598066080661806628066380664806658066680667806688066980670806718067280673806748067580676806778067880679806808068180682806838068480685806868068780688806898069080691806928069380694806958069680697806988069980700807018070280703807048070580706807078070880709807108071180712807138071480715807168071780718807198072080721807228072380724807258072680727807288072980730807318073280733807348073580736807378073880739807408074180742807438074480745807468074780748807498075080751807528075380754807558075680757807588075980760807618076280763807648076580766807678076880769807708077180772807738077480775807768077780778807798078080781807828078380784807858078680787807888078980790807918079280793807948079580796807978079880799808008080180802808038080480805808068080780808808098081080811808128081380814808158081680817808188081980820808218082280823808248082580826808278082880829808308083180832808338083480835808368083780838808398084080841808428084380844808458084680847808488084980850808518085280853808548085580856808578085880859808608086180862808638086480865808668086780868808698087080871808728087380874808758087680877808788087980880808818088280883808848088580886808878088880889808908089180892808938089480895808968089780898808998090080901809028090380904809058090680907809088090980910809118091280913809148091580916809178091880919809208092180922809238092480925809268092780928809298093080931809328093380934809358093680937809388093980940809418094280943809448094580946809478094880949809508095180952809538095480955809568095780958809598096080961809628096380964809658096680967809688096980970809718097280973809748097580976809778097880979809808098180982809838098480985809868098780988809898099080991809928099380994809958099680997809988099981000810018100281003810048100581006810078100881009810108101181012810138101481015810168101781018810198102081021810228102381024810258102681027810288102981030810318103281033810348103581036810378103881039810408104181042810438104481045810468104781048810498105081051810528105381054810558105681057810588105981060810618106281063810648106581066810678106881069810708107181072810738107481075810768107781078810798108081081810828108381084810858108681087810888108981090810918109281093810948109581096810978109881099811008110181102811038110481105811068110781108811098111081111811128111381114811158111681117811188111981120811218112281123811248112581126811278112881129811308113181132811338113481135811368113781138811398114081141811428114381144811458114681147811488114981150811518115281153811548115581156811578115881159811608116181162811638116481165811668116781168811698117081171811728117381174811758117681177811788117981180811818118281183811848118581186811878118881189811908119181192811938119481195811968119781198811998120081201812028120381204812058120681207812088120981210812118121281213812148121581216812178121881219812208122181222812238122481225812268122781228812298123081231812328123381234812358123681237812388123981240812418124281243812448124581246812478124881249812508125181252812538125481255812568125781258812598126081261812628126381264812658126681267812688126981270812718127281273812748127581276812778127881279812808128181282812838128481285812868128781288812898129081291812928129381294812958129681297812988129981300813018130281303813048130581306813078130881309813108131181312813138131481315813168131781318813198132081321813228132381324813258132681327813288132981330813318133281333813348133581336813378133881339813408134181342813438134481345813468134781348813498135081351813528135381354813558135681357813588135981360813618136281363813648136581366813678136881369813708137181372813738137481375813768137781378813798138081381813828138381384813858138681387813888138981390813918139281393813948139581396813978139881399814008140181402814038140481405814068140781408814098141081411814128141381414814158141681417814188141981420814218142281423814248142581426814278142881429814308143181432814338143481435814368143781438814398144081441814428144381444814458144681447814488144981450814518145281453814548145581456814578145881459814608146181462814638146481465814668146781468814698147081471814728147381474814758147681477814788147981480814818148281483814848148581486814878148881489814908149181492814938149481495814968149781498814998150081501815028150381504815058150681507815088150981510815118151281513815148151581516815178151881519815208152181522815238152481525815268152781528815298153081531815328153381534815358153681537815388153981540815418154281543815448154581546815478154881549815508155181552815538155481555815568155781558815598156081561815628156381564815658156681567815688156981570815718157281573815748157581576815778157881579815808158181582815838158481585815868158781588815898159081591815928159381594815958159681597815988159981600816018160281603816048160581606816078160881609816108161181612816138161481615816168161781618816198162081621816228162381624816258162681627816288162981630816318163281633816348163581636816378163881639816408164181642816438164481645816468164781648816498165081651816528165381654816558165681657816588165981660816618166281663816648166581666816678166881669816708167181672816738167481675816768167781678816798168081681816828168381684816858168681687816888168981690816918169281693816948169581696816978169881699817008170181702817038170481705817068170781708817098171081711817128171381714817158171681717817188171981720817218172281723817248172581726817278172881729817308173181732817338173481735817368173781738817398174081741817428174381744817458174681747817488174981750817518175281753817548175581756817578175881759817608176181762817638176481765817668176781768817698177081771817728177381774817758177681777817788177981780817818178281783817848178581786817878178881789817908179181792817938179481795817968179781798817998180081801818028180381804818058180681807818088180981810818118181281813818148181581816818178181881819818208182181822818238182481825818268182781828818298183081831818328183381834818358183681837818388183981840818418184281843818448184581846818478184881849818508185181852818538185481855818568185781858818598186081861818628186381864818658186681867818688186981870818718187281873818748187581876818778187881879818808188181882818838188481885818868188781888818898189081891818928189381894818958189681897818988189981900819018190281903819048190581906819078190881909819108191181912819138191481915819168191781918819198192081921819228192381924819258192681927819288192981930819318193281933819348193581936819378193881939819408194181942819438194481945819468194781948819498195081951819528195381954819558195681957819588195981960819618196281963819648196581966819678196881969819708197181972819738197481975819768197781978819798198081981819828198381984819858198681987819888198981990819918199281993819948199581996819978199881999820008200182002820038200482005820068200782008820098201082011820128201382014820158201682017820188201982020820218202282023820248202582026820278202882029820308203182032820338203482035820368203782038820398204082041820428204382044820458204682047820488204982050820518205282053820548205582056820578205882059820608206182062820638206482065820668206782068820698207082071820728207382074820758207682077820788207982080820818208282083820848208582086820878208882089820908209182092820938209482095820968209782098820998210082101821028210382104821058210682107821088210982110821118211282113821148211582116821178211882119821208212182122821238212482125821268212782128821298213082131821328213382134821358213682137821388213982140821418214282143821448214582146821478214882149821508215182152821538215482155821568215782158821598216082161821628216382164821658216682167821688216982170821718217282173821748217582176821778217882179821808218182182821838218482185821868218782188821898219082191821928219382194821958219682197821988219982200822018220282203822048220582206822078220882209822108221182212822138221482215822168221782218822198222082221822228222382224822258222682227822288222982230822318223282233822348223582236822378223882239822408224182242822438224482245822468224782248822498225082251822528225382254822558225682257822588225982260822618226282263822648226582266822678226882269822708227182272822738227482275822768227782278822798228082281822828228382284822858228682287822888228982290822918229282293822948229582296822978229882299823008230182302823038230482305823068230782308823098231082311823128231382314823158231682317823188231982320823218232282323823248232582326823278232882329823308233182332823338233482335823368233782338823398234082341823428234382344823458234682347823488234982350823518235282353823548235582356823578235882359823608236182362823638236482365823668236782368823698237082371823728237382374823758237682377823788237982380823818238282383823848238582386823878238882389823908239182392823938239482395823968239782398823998240082401824028240382404824058240682407824088240982410824118241282413824148241582416824178241882419824208242182422824238242482425824268242782428824298243082431824328243382434824358243682437824388243982440824418244282443824448244582446824478244882449824508245182452824538245482455824568245782458824598246082461824628246382464824658246682467824688246982470824718247282473824748247582476824778247882479824808248182482824838248482485824868248782488824898249082491824928249382494824958249682497824988249982500825018250282503825048250582506825078250882509825108251182512825138251482515825168251782518825198252082521825228252382524825258252682527825288252982530825318253282533825348253582536825378253882539825408254182542825438254482545825468254782548825498255082551825528255382554825558255682557825588255982560825618256282563825648256582566825678256882569825708257182572825738257482575825768257782578825798258082581825828258382584825858258682587825888258982590825918259282593825948259582596825978259882599826008260182602826038260482605826068260782608826098261082611826128261382614826158261682617826188261982620826218262282623826248262582626826278262882629826308263182632826338263482635826368263782638826398264082641826428264382644826458264682647826488264982650826518265282653826548265582656826578265882659826608266182662826638266482665826668266782668826698267082671826728267382674826758267682677826788267982680826818268282683826848268582686826878268882689826908269182692826938269482695826968269782698826998270082701827028270382704827058270682707827088270982710827118271282713827148271582716827178271882719827208272182722827238272482725827268272782728827298273082731827328273382734827358273682737827388273982740827418274282743827448274582746827478274882749827508275182752827538275482755827568275782758827598276082761827628276382764827658276682767827688276982770827718277282773827748277582776827778277882779827808278182782827838278482785827868278782788827898279082791827928279382794827958279682797827988279982800828018280282803828048280582806828078280882809828108281182812828138281482815828168281782818828198282082821828228282382824828258282682827828288282982830828318283282833828348283582836828378283882839828408284182842828438284482845828468284782848828498285082851828528285382854828558285682857828588285982860828618286282863828648286582866828678286882869828708287182872828738287482875828768287782878828798288082881828828288382884828858288682887828888288982890828918289282893828948289582896828978289882899829008290182902829038290482905829068290782908829098291082911829128291382914829158291682917829188291982920829218292282923829248292582926829278292882929829308293182932829338293482935829368293782938829398294082941829428294382944829458294682947829488294982950829518295282953829548295582956829578295882959829608296182962829638296482965829668296782968829698297082971829728297382974829758297682977829788297982980829818298282983829848298582986829878298882989829908299182992829938299482995829968299782998829998300083001830028300383004830058300683007830088300983010830118301283013830148301583016830178301883019830208302183022830238302483025830268302783028830298303083031830328303383034830358303683037830388303983040830418304283043830448304583046830478304883049830508305183052830538305483055830568305783058830598306083061830628306383064830658306683067830688306983070830718307283073830748307583076830778307883079830808308183082830838308483085830868308783088830898309083091830928309383094830958309683097830988309983100831018310283103831048310583106831078310883109831108311183112831138311483115831168311783118831198312083121831228312383124831258312683127831288312983130831318313283133831348313583136831378313883139831408314183142831438314483145831468314783148831498315083151831528315383154831558315683157831588315983160831618316283163831648316583166831678316883169831708317183172831738317483175831768317783178831798318083181831828318383184831858318683187831888318983190831918319283193831948319583196831978319883199832008320183202832038320483205832068320783208832098321083211832128321383214832158321683217832188321983220832218322283223832248322583226832278322883229832308323183232832338323483235832368323783238
  1. /******/ (function(modules) { // webpackBootstrap
  2. /******/ // The module cache
  3. /******/ var installedModules = {};
  4. /******/
  5. /******/ // The require function
  6. /******/ function __webpack_require__(moduleId) {
  7. /******/
  8. /******/ // Check if module is in cache
  9. /******/ if(installedModules[moduleId]) {
  10. /******/ return installedModules[moduleId].exports;
  11. /******/ }
  12. /******/ // Create a new module (and put it into the cache)
  13. /******/ var module = installedModules[moduleId] = {
  14. /******/ i: moduleId,
  15. /******/ l: false,
  16. /******/ exports: {}
  17. /******/ };
  18. /******/
  19. /******/ // Execute the module function
  20. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  21. /******/
  22. /******/ // Flag the module as loaded
  23. /******/ module.l = true;
  24. /******/
  25. /******/ // Return the exports of the module
  26. /******/ return module.exports;
  27. /******/ }
  28. /******/
  29. /******/
  30. /******/ // expose the modules object (__webpack_modules__)
  31. /******/ __webpack_require__.m = modules;
  32. /******/
  33. /******/ // expose the module cache
  34. /******/ __webpack_require__.c = installedModules;
  35. /******/
  36. /******/ // define getter function for harmony exports
  37. /******/ __webpack_require__.d = function(exports, name, getter) {
  38. /******/ if(!__webpack_require__.o(exports, name)) {
  39. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  40. /******/ }
  41. /******/ };
  42. /******/
  43. /******/ // define __esModule on exports
  44. /******/ __webpack_require__.r = function(exports) {
  45. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  46. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  47. /******/ }
  48. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  49. /******/ };
  50. /******/
  51. /******/ // create a fake namespace object
  52. /******/ // mode & 1: value is a module id, require it
  53. /******/ // mode & 2: merge all properties of value into the ns
  54. /******/ // mode & 4: return value when already ns object
  55. /******/ // mode & 8|1: behave like require
  56. /******/ __webpack_require__.t = function(value, mode) {
  57. /******/ if(mode & 1) value = __webpack_require__(value);
  58. /******/ if(mode & 8) return value;
  59. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  60. /******/ var ns = Object.create(null);
  61. /******/ __webpack_require__.r(ns);
  62. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  63. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  64. /******/ return ns;
  65. /******/ };
  66. /******/
  67. /******/ // getDefaultExport function for compatibility with non-harmony modules
  68. /******/ __webpack_require__.n = function(module) {
  69. /******/ var getter = module && module.__esModule ?
  70. /******/ function getDefault() { return module['default']; } :
  71. /******/ function getModuleExports() { return module; };
  72. /******/ __webpack_require__.d(getter, 'a', getter);
  73. /******/ return getter;
  74. /******/ };
  75. /******/
  76. /******/ // Object.prototype.hasOwnProperty.call
  77. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  78. /******/
  79. /******/ // __webpack_public_path__
  80. /******/ __webpack_require__.p = "/";
  81. /******/
  82. /******/
  83. /******/ // Load entry module and return exports
  84. /******/ return __webpack_require__(__webpack_require__.s = 0);
  85. /******/ })
  86. /************************************************************************/
  87. /******/ ({
  88. /***/ "./node_modules/after/index.js":
  89. /*!*************************************!*\
  90. !*** ./node_modules/after/index.js ***!
  91. \*************************************/
  92. /*! no static exports found */
  93. /***/ (function(module, exports) {
  94. module.exports = after
  95. function after(count, callback, err_cb) {
  96. var bail = false
  97. err_cb = err_cb || noop
  98. proxy.count = count
  99. return (count === 0) ? callback() : proxy
  100. function proxy(err, result) {
  101. if (proxy.count <= 0) {
  102. throw new Error('after called too many times')
  103. }
  104. --proxy.count
  105. // after first error, rest are passed to err_cb
  106. if (err) {
  107. bail = true
  108. callback(err)
  109. // future error callbacks will go to error handler
  110. callback = err_cb
  111. } else if (proxy.count === 0 && !bail) {
  112. callback(null, result)
  113. }
  114. }
  115. }
  116. function noop() {}
  117. /***/ }),
  118. /***/ "./node_modules/arraybuffer.slice/index.js":
  119. /*!*************************************************!*\
  120. !*** ./node_modules/arraybuffer.slice/index.js ***!
  121. \*************************************************/
  122. /*! no static exports found */
  123. /***/ (function(module, exports) {
  124. /**
  125. * An abstraction for slicing an arraybuffer even when
  126. * ArrayBuffer.prototype.slice is not supported
  127. *
  128. * @api public
  129. */
  130. module.exports = function(arraybuffer, start, end) {
  131. var bytes = arraybuffer.byteLength;
  132. start = start || 0;
  133. end = end || bytes;
  134. if (arraybuffer.slice) { return arraybuffer.slice(start, end); }
  135. if (start < 0) { start += bytes; }
  136. if (end < 0) { end += bytes; }
  137. if (end > bytes) { end = bytes; }
  138. if (start >= bytes || start >= end || bytes === 0) {
  139. return new ArrayBuffer(0);
  140. }
  141. var abv = new Uint8Array(arraybuffer);
  142. var result = new Uint8Array(end - start);
  143. for (var i = start, ii = 0; i < end; i++, ii++) {
  144. result[ii] = abv[i];
  145. }
  146. return result.buffer;
  147. };
  148. /***/ }),
  149. /***/ "./node_modules/axios/index.js":
  150. /*!*************************************!*\
  151. !*** ./node_modules/axios/index.js ***!
  152. \*************************************/
  153. /*! no static exports found */
  154. /***/ (function(module, exports, __webpack_require__) {
  155. module.exports = __webpack_require__(/*! ./lib/axios */ "./node_modules/axios/lib/axios.js");
  156. /***/ }),
  157. /***/ "./node_modules/axios/lib/adapters/xhr.js":
  158. /*!************************************************!*\
  159. !*** ./node_modules/axios/lib/adapters/xhr.js ***!
  160. \************************************************/
  161. /*! no static exports found */
  162. /***/ (function(module, exports, __webpack_require__) {
  163. "use strict";
  164. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  165. var settle = __webpack_require__(/*! ./../core/settle */ "./node_modules/axios/lib/core/settle.js");
  166. var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js");
  167. var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "./node_modules/axios/lib/core/buildFullPath.js");
  168. var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "./node_modules/axios/lib/helpers/parseHeaders.js");
  169. var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "./node_modules/axios/lib/helpers/isURLSameOrigin.js");
  170. var createError = __webpack_require__(/*! ../core/createError */ "./node_modules/axios/lib/core/createError.js");
  171. module.exports = function xhrAdapter(config) {
  172. return new Promise(function dispatchXhrRequest(resolve, reject) {
  173. var requestData = config.data;
  174. var requestHeaders = config.headers;
  175. if (utils.isFormData(requestData)) {
  176. delete requestHeaders['Content-Type']; // Let the browser set it
  177. }
  178. var request = new XMLHttpRequest();
  179. // HTTP basic authentication
  180. if (config.auth) {
  181. var username = config.auth.username || '';
  182. var password = config.auth.password || '';
  183. requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
  184. }
  185. var fullPath = buildFullPath(config.baseURL, config.url);
  186. request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
  187. // Set the request timeout in MS
  188. request.timeout = config.timeout;
  189. // Listen for ready state
  190. request.onreadystatechange = function handleLoad() {
  191. if (!request || request.readyState !== 4) {
  192. return;
  193. }
  194. // The request errored out and we didn't get a response, this will be
  195. // handled by onerror instead
  196. // With one exception: request that using file: protocol, most browsers
  197. // will return status as 0 even though it's a successful request
  198. if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
  199. return;
  200. }
  201. // Prepare the response
  202. var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
  203. var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;
  204. var response = {
  205. data: responseData,
  206. status: request.status,
  207. statusText: request.statusText,
  208. headers: responseHeaders,
  209. config: config,
  210. request: request
  211. };
  212. settle(resolve, reject, response);
  213. // Clean up request
  214. request = null;
  215. };
  216. // Handle browser request cancellation (as opposed to a manual cancellation)
  217. request.onabort = function handleAbort() {
  218. if (!request) {
  219. return;
  220. }
  221. reject(createError('Request aborted', config, 'ECONNABORTED', request));
  222. // Clean up request
  223. request = null;
  224. };
  225. // Handle low level network errors
  226. request.onerror = function handleError() {
  227. // Real errors are hidden from us by the browser
  228. // onerror should only fire if it's a network error
  229. reject(createError('Network Error', config, null, request));
  230. // Clean up request
  231. request = null;
  232. };
  233. // Handle timeout
  234. request.ontimeout = function handleTimeout() {
  235. var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';
  236. if (config.timeoutErrorMessage) {
  237. timeoutErrorMessage = config.timeoutErrorMessage;
  238. }
  239. reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',
  240. request));
  241. // Clean up request
  242. request = null;
  243. };
  244. // Add xsrf header
  245. // This is only done if running in a standard browser environment.
  246. // Specifically not if we're in a web worker, or react-native.
  247. if (utils.isStandardBrowserEnv()) {
  248. var cookies = __webpack_require__(/*! ./../helpers/cookies */ "./node_modules/axios/lib/helpers/cookies.js");
  249. // Add xsrf header
  250. var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
  251. cookies.read(config.xsrfCookieName) :
  252. undefined;
  253. if (xsrfValue) {
  254. requestHeaders[config.xsrfHeaderName] = xsrfValue;
  255. }
  256. }
  257. // Add headers to the request
  258. if ('setRequestHeader' in request) {
  259. utils.forEach(requestHeaders, function setRequestHeader(val, key) {
  260. if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
  261. // Remove Content-Type if data is undefined
  262. delete requestHeaders[key];
  263. } else {
  264. // Otherwise add header to the request
  265. request.setRequestHeader(key, val);
  266. }
  267. });
  268. }
  269. // Add withCredentials to request if needed
  270. if (!utils.isUndefined(config.withCredentials)) {
  271. request.withCredentials = !!config.withCredentials;
  272. }
  273. // Add responseType to request if needed
  274. if (config.responseType) {
  275. try {
  276. request.responseType = config.responseType;
  277. } catch (e) {
  278. // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.
  279. // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.
  280. if (config.responseType !== 'json') {
  281. throw e;
  282. }
  283. }
  284. }
  285. // Handle progress if needed
  286. if (typeof config.onDownloadProgress === 'function') {
  287. request.addEventListener('progress', config.onDownloadProgress);
  288. }
  289. // Not all browsers support upload events
  290. if (typeof config.onUploadProgress === 'function' && request.upload) {
  291. request.upload.addEventListener('progress', config.onUploadProgress);
  292. }
  293. if (config.cancelToken) {
  294. // Handle cancellation
  295. config.cancelToken.promise.then(function onCanceled(cancel) {
  296. if (!request) {
  297. return;
  298. }
  299. request.abort();
  300. reject(cancel);
  301. // Clean up request
  302. request = null;
  303. });
  304. }
  305. if (requestData === undefined) {
  306. requestData = null;
  307. }
  308. // Send the request
  309. request.send(requestData);
  310. });
  311. };
  312. /***/ }),
  313. /***/ "./node_modules/axios/lib/axios.js":
  314. /*!*****************************************!*\
  315. !*** ./node_modules/axios/lib/axios.js ***!
  316. \*****************************************/
  317. /*! no static exports found */
  318. /***/ (function(module, exports, __webpack_require__) {
  319. "use strict";
  320. var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.js");
  321. var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js");
  322. var Axios = __webpack_require__(/*! ./core/Axios */ "./node_modules/axios/lib/core/Axios.js");
  323. var mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js");
  324. var defaults = __webpack_require__(/*! ./defaults */ "./node_modules/axios/lib/defaults.js");
  325. /**
  326. * Create an instance of Axios
  327. *
  328. * @param {Object} defaultConfig The default config for the instance
  329. * @return {Axios} A new instance of Axios
  330. */
  331. function createInstance(defaultConfig) {
  332. var context = new Axios(defaultConfig);
  333. var instance = bind(Axios.prototype.request, context);
  334. // Copy axios.prototype to instance
  335. utils.extend(instance, Axios.prototype, context);
  336. // Copy context to instance
  337. utils.extend(instance, context);
  338. return instance;
  339. }
  340. // Create the default instance to be exported
  341. var axios = createInstance(defaults);
  342. // Expose Axios class to allow class inheritance
  343. axios.Axios = Axios;
  344. // Factory for creating new instances
  345. axios.create = function create(instanceConfig) {
  346. return createInstance(mergeConfig(axios.defaults, instanceConfig));
  347. };
  348. // Expose Cancel & CancelToken
  349. axios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ "./node_modules/axios/lib/cancel/Cancel.js");
  350. axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "./node_modules/axios/lib/cancel/CancelToken.js");
  351. axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js");
  352. // Expose all/spread
  353. axios.all = function all(promises) {
  354. return Promise.all(promises);
  355. };
  356. axios.spread = __webpack_require__(/*! ./helpers/spread */ "./node_modules/axios/lib/helpers/spread.js");
  357. module.exports = axios;
  358. // Allow use of default import syntax in TypeScript
  359. module.exports.default = axios;
  360. /***/ }),
  361. /***/ "./node_modules/axios/lib/cancel/Cancel.js":
  362. /*!*************************************************!*\
  363. !*** ./node_modules/axios/lib/cancel/Cancel.js ***!
  364. \*************************************************/
  365. /*! no static exports found */
  366. /***/ (function(module, exports, __webpack_require__) {
  367. "use strict";
  368. /**
  369. * A `Cancel` is an object that is thrown when an operation is canceled.
  370. *
  371. * @class
  372. * @param {string=} message The message.
  373. */
  374. function Cancel(message) {
  375. this.message = message;
  376. }
  377. Cancel.prototype.toString = function toString() {
  378. return 'Cancel' + (this.message ? ': ' + this.message : '');
  379. };
  380. Cancel.prototype.__CANCEL__ = true;
  381. module.exports = Cancel;
  382. /***/ }),
  383. /***/ "./node_modules/axios/lib/cancel/CancelToken.js":
  384. /*!******************************************************!*\
  385. !*** ./node_modules/axios/lib/cancel/CancelToken.js ***!
  386. \******************************************************/
  387. /*! no static exports found */
  388. /***/ (function(module, exports, __webpack_require__) {
  389. "use strict";
  390. var Cancel = __webpack_require__(/*! ./Cancel */ "./node_modules/axios/lib/cancel/Cancel.js");
  391. /**
  392. * A `CancelToken` is an object that can be used to request cancellation of an operation.
  393. *
  394. * @class
  395. * @param {Function} executor The executor function.
  396. */
  397. function CancelToken(executor) {
  398. if (typeof executor !== 'function') {
  399. throw new TypeError('executor must be a function.');
  400. }
  401. var resolvePromise;
  402. this.promise = new Promise(function promiseExecutor(resolve) {
  403. resolvePromise = resolve;
  404. });
  405. var token = this;
  406. executor(function cancel(message) {
  407. if (token.reason) {
  408. // Cancellation has already been requested
  409. return;
  410. }
  411. token.reason = new Cancel(message);
  412. resolvePromise(token.reason);
  413. });
  414. }
  415. /**
  416. * Throws a `Cancel` if cancellation has been requested.
  417. */
  418. CancelToken.prototype.throwIfRequested = function throwIfRequested() {
  419. if (this.reason) {
  420. throw this.reason;
  421. }
  422. };
  423. /**
  424. * Returns an object that contains a new `CancelToken` and a function that, when called,
  425. * cancels the `CancelToken`.
  426. */
  427. CancelToken.source = function source() {
  428. var cancel;
  429. var token = new CancelToken(function executor(c) {
  430. cancel = c;
  431. });
  432. return {
  433. token: token,
  434. cancel: cancel
  435. };
  436. };
  437. module.exports = CancelToken;
  438. /***/ }),
  439. /***/ "./node_modules/axios/lib/cancel/isCancel.js":
  440. /*!***************************************************!*\
  441. !*** ./node_modules/axios/lib/cancel/isCancel.js ***!
  442. \***************************************************/
  443. /*! no static exports found */
  444. /***/ (function(module, exports, __webpack_require__) {
  445. "use strict";
  446. module.exports = function isCancel(value) {
  447. return !!(value && value.__CANCEL__);
  448. };
  449. /***/ }),
  450. /***/ "./node_modules/axios/lib/core/Axios.js":
  451. /*!**********************************************!*\
  452. !*** ./node_modules/axios/lib/core/Axios.js ***!
  453. \**********************************************/
  454. /*! no static exports found */
  455. /***/ (function(module, exports, __webpack_require__) {
  456. "use strict";
  457. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  458. var buildURL = __webpack_require__(/*! ../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js");
  459. var InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ "./node_modules/axios/lib/core/InterceptorManager.js");
  460. var dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ "./node_modules/axios/lib/core/dispatchRequest.js");
  461. var mergeConfig = __webpack_require__(/*! ./mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js");
  462. /**
  463. * Create a new instance of Axios
  464. *
  465. * @param {Object} instanceConfig The default config for the instance
  466. */
  467. function Axios(instanceConfig) {
  468. this.defaults = instanceConfig;
  469. this.interceptors = {
  470. request: new InterceptorManager(),
  471. response: new InterceptorManager()
  472. };
  473. }
  474. /**
  475. * Dispatch a request
  476. *
  477. * @param {Object} config The config specific for this request (merged with this.defaults)
  478. */
  479. Axios.prototype.request = function request(config) {
  480. /*eslint no-param-reassign:0*/
  481. // Allow for axios('example/url'[, config]) a la fetch API
  482. if (typeof config === 'string') {
  483. config = arguments[1] || {};
  484. config.url = arguments[0];
  485. } else {
  486. config = config || {};
  487. }
  488. config = mergeConfig(this.defaults, config);
  489. // Set config.method
  490. if (config.method) {
  491. config.method = config.method.toLowerCase();
  492. } else if (this.defaults.method) {
  493. config.method = this.defaults.method.toLowerCase();
  494. } else {
  495. config.method = 'get';
  496. }
  497. // Hook up interceptors middleware
  498. var chain = [dispatchRequest, undefined];
  499. var promise = Promise.resolve(config);
  500. this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
  501. chain.unshift(interceptor.fulfilled, interceptor.rejected);
  502. });
  503. this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
  504. chain.push(interceptor.fulfilled, interceptor.rejected);
  505. });
  506. while (chain.length) {
  507. promise = promise.then(chain.shift(), chain.shift());
  508. }
  509. return promise;
  510. };
  511. Axios.prototype.getUri = function getUri(config) {
  512. config = mergeConfig(this.defaults, config);
  513. return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');
  514. };
  515. // Provide aliases for supported request methods
  516. utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
  517. /*eslint func-names:0*/
  518. Axios.prototype[method] = function(url, config) {
  519. return this.request(utils.merge(config || {}, {
  520. method: method,
  521. url: url
  522. }));
  523. };
  524. });
  525. utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  526. /*eslint func-names:0*/
  527. Axios.prototype[method] = function(url, data, config) {
  528. return this.request(utils.merge(config || {}, {
  529. method: method,
  530. url: url,
  531. data: data
  532. }));
  533. };
  534. });
  535. module.exports = Axios;
  536. /***/ }),
  537. /***/ "./node_modules/axios/lib/core/InterceptorManager.js":
  538. /*!***********************************************************!*\
  539. !*** ./node_modules/axios/lib/core/InterceptorManager.js ***!
  540. \***********************************************************/
  541. /*! no static exports found */
  542. /***/ (function(module, exports, __webpack_require__) {
  543. "use strict";
  544. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  545. function InterceptorManager() {
  546. this.handlers = [];
  547. }
  548. /**
  549. * Add a new interceptor to the stack
  550. *
  551. * @param {Function} fulfilled The function to handle `then` for a `Promise`
  552. * @param {Function} rejected The function to handle `reject` for a `Promise`
  553. *
  554. * @return {Number} An ID used to remove interceptor later
  555. */
  556. InterceptorManager.prototype.use = function use(fulfilled, rejected) {
  557. this.handlers.push({
  558. fulfilled: fulfilled,
  559. rejected: rejected
  560. });
  561. return this.handlers.length - 1;
  562. };
  563. /**
  564. * Remove an interceptor from the stack
  565. *
  566. * @param {Number} id The ID that was returned by `use`
  567. */
  568. InterceptorManager.prototype.eject = function eject(id) {
  569. if (this.handlers[id]) {
  570. this.handlers[id] = null;
  571. }
  572. };
  573. /**
  574. * Iterate over all the registered interceptors
  575. *
  576. * This method is particularly useful for skipping over any
  577. * interceptors that may have become `null` calling `eject`.
  578. *
  579. * @param {Function} fn The function to call for each interceptor
  580. */
  581. InterceptorManager.prototype.forEach = function forEach(fn) {
  582. utils.forEach(this.handlers, function forEachHandler(h) {
  583. if (h !== null) {
  584. fn(h);
  585. }
  586. });
  587. };
  588. module.exports = InterceptorManager;
  589. /***/ }),
  590. /***/ "./node_modules/axios/lib/core/buildFullPath.js":
  591. /*!******************************************************!*\
  592. !*** ./node_modules/axios/lib/core/buildFullPath.js ***!
  593. \******************************************************/
  594. /*! no static exports found */
  595. /***/ (function(module, exports, __webpack_require__) {
  596. "use strict";
  597. var isAbsoluteURL = __webpack_require__(/*! ../helpers/isAbsoluteURL */ "./node_modules/axios/lib/helpers/isAbsoluteURL.js");
  598. var combineURLs = __webpack_require__(/*! ../helpers/combineURLs */ "./node_modules/axios/lib/helpers/combineURLs.js");
  599. /**
  600. * Creates a new URL by combining the baseURL with the requestedURL,
  601. * only when the requestedURL is not already an absolute URL.
  602. * If the requestURL is absolute, this function returns the requestedURL untouched.
  603. *
  604. * @param {string} baseURL The base URL
  605. * @param {string} requestedURL Absolute or relative URL to combine
  606. * @returns {string} The combined full path
  607. */
  608. module.exports = function buildFullPath(baseURL, requestedURL) {
  609. if (baseURL && !isAbsoluteURL(requestedURL)) {
  610. return combineURLs(baseURL, requestedURL);
  611. }
  612. return requestedURL;
  613. };
  614. /***/ }),
  615. /***/ "./node_modules/axios/lib/core/createError.js":
  616. /*!****************************************************!*\
  617. !*** ./node_modules/axios/lib/core/createError.js ***!
  618. \****************************************************/
  619. /*! no static exports found */
  620. /***/ (function(module, exports, __webpack_require__) {
  621. "use strict";
  622. var enhanceError = __webpack_require__(/*! ./enhanceError */ "./node_modules/axios/lib/core/enhanceError.js");
  623. /**
  624. * Create an Error with the specified message, config, error code, request and response.
  625. *
  626. * @param {string} message The error message.
  627. * @param {Object} config The config.
  628. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  629. * @param {Object} [request] The request.
  630. * @param {Object} [response] The response.
  631. * @returns {Error} The created error.
  632. */
  633. module.exports = function createError(message, config, code, request, response) {
  634. var error = new Error(message);
  635. return enhanceError(error, config, code, request, response);
  636. };
  637. /***/ }),
  638. /***/ "./node_modules/axios/lib/core/dispatchRequest.js":
  639. /*!********************************************************!*\
  640. !*** ./node_modules/axios/lib/core/dispatchRequest.js ***!
  641. \********************************************************/
  642. /*! no static exports found */
  643. /***/ (function(module, exports, __webpack_require__) {
  644. "use strict";
  645. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  646. var transformData = __webpack_require__(/*! ./transformData */ "./node_modules/axios/lib/core/transformData.js");
  647. var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js");
  648. var defaults = __webpack_require__(/*! ../defaults */ "./node_modules/axios/lib/defaults.js");
  649. /**
  650. * Throws a `Cancel` if cancellation has been requested.
  651. */
  652. function throwIfCancellationRequested(config) {
  653. if (config.cancelToken) {
  654. config.cancelToken.throwIfRequested();
  655. }
  656. }
  657. /**
  658. * Dispatch a request to the server using the configured adapter.
  659. *
  660. * @param {object} config The config that is to be used for the request
  661. * @returns {Promise} The Promise to be fulfilled
  662. */
  663. module.exports = function dispatchRequest(config) {
  664. throwIfCancellationRequested(config);
  665. // Ensure headers exist
  666. config.headers = config.headers || {};
  667. // Transform request data
  668. config.data = transformData(
  669. config.data,
  670. config.headers,
  671. config.transformRequest
  672. );
  673. // Flatten headers
  674. config.headers = utils.merge(
  675. config.headers.common || {},
  676. config.headers[config.method] || {},
  677. config.headers
  678. );
  679. utils.forEach(
  680. ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
  681. function cleanHeaderConfig(method) {
  682. delete config.headers[method];
  683. }
  684. );
  685. var adapter = config.adapter || defaults.adapter;
  686. return adapter(config).then(function onAdapterResolution(response) {
  687. throwIfCancellationRequested(config);
  688. // Transform response data
  689. response.data = transformData(
  690. response.data,
  691. response.headers,
  692. config.transformResponse
  693. );
  694. return response;
  695. }, function onAdapterRejection(reason) {
  696. if (!isCancel(reason)) {
  697. throwIfCancellationRequested(config);
  698. // Transform response data
  699. if (reason && reason.response) {
  700. reason.response.data = transformData(
  701. reason.response.data,
  702. reason.response.headers,
  703. config.transformResponse
  704. );
  705. }
  706. }
  707. return Promise.reject(reason);
  708. });
  709. };
  710. /***/ }),
  711. /***/ "./node_modules/axios/lib/core/enhanceError.js":
  712. /*!*****************************************************!*\
  713. !*** ./node_modules/axios/lib/core/enhanceError.js ***!
  714. \*****************************************************/
  715. /*! no static exports found */
  716. /***/ (function(module, exports, __webpack_require__) {
  717. "use strict";
  718. /**
  719. * Update an Error with the specified config, error code, and response.
  720. *
  721. * @param {Error} error The error to update.
  722. * @param {Object} config The config.
  723. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  724. * @param {Object} [request] The request.
  725. * @param {Object} [response] The response.
  726. * @returns {Error} The error.
  727. */
  728. module.exports = function enhanceError(error, config, code, request, response) {
  729. error.config = config;
  730. if (code) {
  731. error.code = code;
  732. }
  733. error.request = request;
  734. error.response = response;
  735. error.isAxiosError = true;
  736. error.toJSON = function() {
  737. return {
  738. // Standard
  739. message: this.message,
  740. name: this.name,
  741. // Microsoft
  742. description: this.description,
  743. number: this.number,
  744. // Mozilla
  745. fileName: this.fileName,
  746. lineNumber: this.lineNumber,
  747. columnNumber: this.columnNumber,
  748. stack: this.stack,
  749. // Axios
  750. config: this.config,
  751. code: this.code
  752. };
  753. };
  754. return error;
  755. };
  756. /***/ }),
  757. /***/ "./node_modules/axios/lib/core/mergeConfig.js":
  758. /*!****************************************************!*\
  759. !*** ./node_modules/axios/lib/core/mergeConfig.js ***!
  760. \****************************************************/
  761. /*! no static exports found */
  762. /***/ (function(module, exports, __webpack_require__) {
  763. "use strict";
  764. var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js");
  765. /**
  766. * Config-specific merge-function which creates a new config-object
  767. * by merging two configuration objects together.
  768. *
  769. * @param {Object} config1
  770. * @param {Object} config2
  771. * @returns {Object} New object resulting from merging config2 to config1
  772. */
  773. module.exports = function mergeConfig(config1, config2) {
  774. // eslint-disable-next-line no-param-reassign
  775. config2 = config2 || {};
  776. var config = {};
  777. var valueFromConfig2Keys = ['url', 'method', 'params', 'data'];
  778. var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy'];
  779. var defaultToConfig2Keys = [
  780. 'baseURL', 'url', 'transformRequest', 'transformResponse', 'paramsSerializer',
  781. 'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',
  782. 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress',
  783. 'maxContentLength', 'validateStatus', 'maxRedirects', 'httpAgent',
  784. 'httpsAgent', 'cancelToken', 'socketPath'
  785. ];
  786. utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {
  787. if (typeof config2[prop] !== 'undefined') {
  788. config[prop] = config2[prop];
  789. }
  790. });
  791. utils.forEach(mergeDeepPropertiesKeys, function mergeDeepProperties(prop) {
  792. if (utils.isObject(config2[prop])) {
  793. config[prop] = utils.deepMerge(config1[prop], config2[prop]);
  794. } else if (typeof config2[prop] !== 'undefined') {
  795. config[prop] = config2[prop];
  796. } else if (utils.isObject(config1[prop])) {
  797. config[prop] = utils.deepMerge(config1[prop]);
  798. } else if (typeof config1[prop] !== 'undefined') {
  799. config[prop] = config1[prop];
  800. }
  801. });
  802. utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {
  803. if (typeof config2[prop] !== 'undefined') {
  804. config[prop] = config2[prop];
  805. } else if (typeof config1[prop] !== 'undefined') {
  806. config[prop] = config1[prop];
  807. }
  808. });
  809. var axiosKeys = valueFromConfig2Keys
  810. .concat(mergeDeepPropertiesKeys)
  811. .concat(defaultToConfig2Keys);
  812. var otherKeys = Object
  813. .keys(config2)
  814. .filter(function filterAxiosKeys(key) {
  815. return axiosKeys.indexOf(key) === -1;
  816. });
  817. utils.forEach(otherKeys, function otherKeysDefaultToConfig2(prop) {
  818. if (typeof config2[prop] !== 'undefined') {
  819. config[prop] = config2[prop];
  820. } else if (typeof config1[prop] !== 'undefined') {
  821. config[prop] = config1[prop];
  822. }
  823. });
  824. return config;
  825. };
  826. /***/ }),
  827. /***/ "./node_modules/axios/lib/core/settle.js":
  828. /*!***********************************************!*\
  829. !*** ./node_modules/axios/lib/core/settle.js ***!
  830. \***********************************************/
  831. /*! no static exports found */
  832. /***/ (function(module, exports, __webpack_require__) {
  833. "use strict";
  834. var createError = __webpack_require__(/*! ./createError */ "./node_modules/axios/lib/core/createError.js");
  835. /**
  836. * Resolve or reject a Promise based on response status.
  837. *
  838. * @param {Function} resolve A function that resolves the promise.
  839. * @param {Function} reject A function that rejects the promise.
  840. * @param {object} response The response.
  841. */
  842. module.exports = function settle(resolve, reject, response) {
  843. var validateStatus = response.config.validateStatus;
  844. if (!validateStatus || validateStatus(response.status)) {
  845. resolve(response);
  846. } else {
  847. reject(createError(
  848. 'Request failed with status code ' + response.status,
  849. response.config,
  850. null,
  851. response.request,
  852. response
  853. ));
  854. }
  855. };
  856. /***/ }),
  857. /***/ "./node_modules/axios/lib/core/transformData.js":
  858. /*!******************************************************!*\
  859. !*** ./node_modules/axios/lib/core/transformData.js ***!
  860. \******************************************************/
  861. /*! no static exports found */
  862. /***/ (function(module, exports, __webpack_require__) {
  863. "use strict";
  864. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  865. /**
  866. * Transform the data for a request or a response
  867. *
  868. * @param {Object|String} data The data to be transformed
  869. * @param {Array} headers The headers for the request or response
  870. * @param {Array|Function} fns A single function or Array of functions
  871. * @returns {*} The resulting transformed data
  872. */
  873. module.exports = function transformData(data, headers, fns) {
  874. /*eslint no-param-reassign:0*/
  875. utils.forEach(fns, function transform(fn) {
  876. data = fn(data, headers);
  877. });
  878. return data;
  879. };
  880. /***/ }),
  881. /***/ "./node_modules/axios/lib/defaults.js":
  882. /*!********************************************!*\
  883. !*** ./node_modules/axios/lib/defaults.js ***!
  884. \********************************************/
  885. /*! no static exports found */
  886. /***/ (function(module, exports, __webpack_require__) {
  887. "use strict";
  888. /* WEBPACK VAR INJECTION */(function(process) {
  889. var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.js");
  890. var normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ "./node_modules/axios/lib/helpers/normalizeHeaderName.js");
  891. var DEFAULT_CONTENT_TYPE = {
  892. 'Content-Type': 'application/x-www-form-urlencoded'
  893. };
  894. function setContentTypeIfUnset(headers, value) {
  895. if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
  896. headers['Content-Type'] = value;
  897. }
  898. }
  899. function getDefaultAdapter() {
  900. var adapter;
  901. if (typeof XMLHttpRequest !== 'undefined') {
  902. // For browsers use XHR adapter
  903. adapter = __webpack_require__(/*! ./adapters/xhr */ "./node_modules/axios/lib/adapters/xhr.js");
  904. } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
  905. // For node use HTTP adapter
  906. adapter = __webpack_require__(/*! ./adapters/http */ "./node_modules/axios/lib/adapters/xhr.js");
  907. }
  908. return adapter;
  909. }
  910. var defaults = {
  911. adapter: getDefaultAdapter(),
  912. transformRequest: [function transformRequest(data, headers) {
  913. normalizeHeaderName(headers, 'Accept');
  914. normalizeHeaderName(headers, 'Content-Type');
  915. if (utils.isFormData(data) ||
  916. utils.isArrayBuffer(data) ||
  917. utils.isBuffer(data) ||
  918. utils.isStream(data) ||
  919. utils.isFile(data) ||
  920. utils.isBlob(data)
  921. ) {
  922. return data;
  923. }
  924. if (utils.isArrayBufferView(data)) {
  925. return data.buffer;
  926. }
  927. if (utils.isURLSearchParams(data)) {
  928. setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
  929. return data.toString();
  930. }
  931. if (utils.isObject(data)) {
  932. setContentTypeIfUnset(headers, 'application/json;charset=utf-8');
  933. return JSON.stringify(data);
  934. }
  935. return data;
  936. }],
  937. transformResponse: [function transformResponse(data) {
  938. /*eslint no-param-reassign:0*/
  939. if (typeof data === 'string') {
  940. try {
  941. data = JSON.parse(data);
  942. } catch (e) { /* Ignore */ }
  943. }
  944. return data;
  945. }],
  946. /**
  947. * A timeout in milliseconds to abort a request. If set to 0 (default) a
  948. * timeout is not created.
  949. */
  950. timeout: 0,
  951. xsrfCookieName: 'XSRF-TOKEN',
  952. xsrfHeaderName: 'X-XSRF-TOKEN',
  953. maxContentLength: -1,
  954. validateStatus: function validateStatus(status) {
  955. return status >= 200 && status < 300;
  956. }
  957. };
  958. defaults.headers = {
  959. common: {
  960. 'Accept': 'application/json, text/plain, */*'
  961. }
  962. };
  963. utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
  964. defaults.headers[method] = {};
  965. });
  966. utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  967. defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
  968. });
  969. module.exports = defaults;
  970. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ "./node_modules/process/browser.js")))
  971. /***/ }),
  972. /***/ "./node_modules/axios/lib/helpers/bind.js":
  973. /*!************************************************!*\
  974. !*** ./node_modules/axios/lib/helpers/bind.js ***!
  975. \************************************************/
  976. /*! no static exports found */
  977. /***/ (function(module, exports, __webpack_require__) {
  978. "use strict";
  979. module.exports = function bind(fn, thisArg) {
  980. return function wrap() {
  981. var args = new Array(arguments.length);
  982. for (var i = 0; i < args.length; i++) {
  983. args[i] = arguments[i];
  984. }
  985. return fn.apply(thisArg, args);
  986. };
  987. };
  988. /***/ }),
  989. /***/ "./node_modules/axios/lib/helpers/buildURL.js":
  990. /*!****************************************************!*\
  991. !*** ./node_modules/axios/lib/helpers/buildURL.js ***!
  992. \****************************************************/
  993. /*! no static exports found */
  994. /***/ (function(module, exports, __webpack_require__) {
  995. "use strict";
  996. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  997. function encode(val) {
  998. return encodeURIComponent(val).
  999. replace(/%40/gi, '@').
  1000. replace(/%3A/gi, ':').
  1001. replace(/%24/g, '$').
  1002. replace(/%2C/gi, ',').
  1003. replace(/%20/g, '+').
  1004. replace(/%5B/gi, '[').
  1005. replace(/%5D/gi, ']');
  1006. }
  1007. /**
  1008. * Build a URL by appending params to the end
  1009. *
  1010. * @param {string} url The base of the url (e.g., http://www.google.com)
  1011. * @param {object} [params] The params to be appended
  1012. * @returns {string} The formatted url
  1013. */
  1014. module.exports = function buildURL(url, params, paramsSerializer) {
  1015. /*eslint no-param-reassign:0*/
  1016. if (!params) {
  1017. return url;
  1018. }
  1019. var serializedParams;
  1020. if (paramsSerializer) {
  1021. serializedParams = paramsSerializer(params);
  1022. } else if (utils.isURLSearchParams(params)) {
  1023. serializedParams = params.toString();
  1024. } else {
  1025. var parts = [];
  1026. utils.forEach(params, function serialize(val, key) {
  1027. if (val === null || typeof val === 'undefined') {
  1028. return;
  1029. }
  1030. if (utils.isArray(val)) {
  1031. key = key + '[]';
  1032. } else {
  1033. val = [val];
  1034. }
  1035. utils.forEach(val, function parseValue(v) {
  1036. if (utils.isDate(v)) {
  1037. v = v.toISOString();
  1038. } else if (utils.isObject(v)) {
  1039. v = JSON.stringify(v);
  1040. }
  1041. parts.push(encode(key) + '=' + encode(v));
  1042. });
  1043. });
  1044. serializedParams = parts.join('&');
  1045. }
  1046. if (serializedParams) {
  1047. var hashmarkIndex = url.indexOf('#');
  1048. if (hashmarkIndex !== -1) {
  1049. url = url.slice(0, hashmarkIndex);
  1050. }
  1051. url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
  1052. }
  1053. return url;
  1054. };
  1055. /***/ }),
  1056. /***/ "./node_modules/axios/lib/helpers/combineURLs.js":
  1057. /*!*******************************************************!*\
  1058. !*** ./node_modules/axios/lib/helpers/combineURLs.js ***!
  1059. \*******************************************************/
  1060. /*! no static exports found */
  1061. /***/ (function(module, exports, __webpack_require__) {
  1062. "use strict";
  1063. /**
  1064. * Creates a new URL by combining the specified URLs
  1065. *
  1066. * @param {string} baseURL The base URL
  1067. * @param {string} relativeURL The relative URL
  1068. * @returns {string} The combined URL
  1069. */
  1070. module.exports = function combineURLs(baseURL, relativeURL) {
  1071. return relativeURL
  1072. ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
  1073. : baseURL;
  1074. };
  1075. /***/ }),
  1076. /***/ "./node_modules/axios/lib/helpers/cookies.js":
  1077. /*!***************************************************!*\
  1078. !*** ./node_modules/axios/lib/helpers/cookies.js ***!
  1079. \***************************************************/
  1080. /*! no static exports found */
  1081. /***/ (function(module, exports, __webpack_require__) {
  1082. "use strict";
  1083. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  1084. module.exports = (
  1085. utils.isStandardBrowserEnv() ?
  1086. // Standard browser envs support document.cookie
  1087. (function standardBrowserEnv() {
  1088. return {
  1089. write: function write(name, value, expires, path, domain, secure) {
  1090. var cookie = [];
  1091. cookie.push(name + '=' + encodeURIComponent(value));
  1092. if (utils.isNumber(expires)) {
  1093. cookie.push('expires=' + new Date(expires).toGMTString());
  1094. }
  1095. if (utils.isString(path)) {
  1096. cookie.push('path=' + path);
  1097. }
  1098. if (utils.isString(domain)) {
  1099. cookie.push('domain=' + domain);
  1100. }
  1101. if (secure === true) {
  1102. cookie.push('secure');
  1103. }
  1104. document.cookie = cookie.join('; ');
  1105. },
  1106. read: function read(name) {
  1107. var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
  1108. return (match ? decodeURIComponent(match[3]) : null);
  1109. },
  1110. remove: function remove(name) {
  1111. this.write(name, '', Date.now() - 86400000);
  1112. }
  1113. };
  1114. })() :
  1115. // Non standard browser env (web workers, react-native) lack needed support.
  1116. (function nonStandardBrowserEnv() {
  1117. return {
  1118. write: function write() {},
  1119. read: function read() { return null; },
  1120. remove: function remove() {}
  1121. };
  1122. })()
  1123. );
  1124. /***/ }),
  1125. /***/ "./node_modules/axios/lib/helpers/isAbsoluteURL.js":
  1126. /*!*********************************************************!*\
  1127. !*** ./node_modules/axios/lib/helpers/isAbsoluteURL.js ***!
  1128. \*********************************************************/
  1129. /*! no static exports found */
  1130. /***/ (function(module, exports, __webpack_require__) {
  1131. "use strict";
  1132. /**
  1133. * Determines whether the specified URL is absolute
  1134. *
  1135. * @param {string} url The URL to test
  1136. * @returns {boolean} True if the specified URL is absolute, otherwise false
  1137. */
  1138. module.exports = function isAbsoluteURL(url) {
  1139. // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
  1140. // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
  1141. // by any combination of letters, digits, plus, period, or hyphen.
  1142. return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
  1143. };
  1144. /***/ }),
  1145. /***/ "./node_modules/axios/lib/helpers/isURLSameOrigin.js":
  1146. /*!***********************************************************!*\
  1147. !*** ./node_modules/axios/lib/helpers/isURLSameOrigin.js ***!
  1148. \***********************************************************/
  1149. /*! no static exports found */
  1150. /***/ (function(module, exports, __webpack_require__) {
  1151. "use strict";
  1152. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  1153. module.exports = (
  1154. utils.isStandardBrowserEnv() ?
  1155. // Standard browser envs have full support of the APIs needed to test
  1156. // whether the request URL is of the same origin as current location.
  1157. (function standardBrowserEnv() {
  1158. var msie = /(msie|trident)/i.test(navigator.userAgent);
  1159. var urlParsingNode = document.createElement('a');
  1160. var originURL;
  1161. /**
  1162. * Parse a URL to discover it's components
  1163. *
  1164. * @param {String} url The URL to be parsed
  1165. * @returns {Object}
  1166. */
  1167. function resolveURL(url) {
  1168. var href = url;
  1169. if (msie) {
  1170. // IE needs attribute set twice to normalize properties
  1171. urlParsingNode.setAttribute('href', href);
  1172. href = urlParsingNode.href;
  1173. }
  1174. urlParsingNode.setAttribute('href', href);
  1175. // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
  1176. return {
  1177. href: urlParsingNode.href,
  1178. protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
  1179. host: urlParsingNode.host,
  1180. search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
  1181. hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
  1182. hostname: urlParsingNode.hostname,
  1183. port: urlParsingNode.port,
  1184. pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
  1185. urlParsingNode.pathname :
  1186. '/' + urlParsingNode.pathname
  1187. };
  1188. }
  1189. originURL = resolveURL(window.location.href);
  1190. /**
  1191. * Determine if a URL shares the same origin as the current location
  1192. *
  1193. * @param {String} requestURL The URL to test
  1194. * @returns {boolean} True if URL shares the same origin, otherwise false
  1195. */
  1196. return function isURLSameOrigin(requestURL) {
  1197. var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
  1198. return (parsed.protocol === originURL.protocol &&
  1199. parsed.host === originURL.host);
  1200. };
  1201. })() :
  1202. // Non standard browser envs (web workers, react-native) lack needed support.
  1203. (function nonStandardBrowserEnv() {
  1204. return function isURLSameOrigin() {
  1205. return true;
  1206. };
  1207. })()
  1208. );
  1209. /***/ }),
  1210. /***/ "./node_modules/axios/lib/helpers/normalizeHeaderName.js":
  1211. /*!***************************************************************!*\
  1212. !*** ./node_modules/axios/lib/helpers/normalizeHeaderName.js ***!
  1213. \***************************************************************/
  1214. /*! no static exports found */
  1215. /***/ (function(module, exports, __webpack_require__) {
  1216. "use strict";
  1217. var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js");
  1218. module.exports = function normalizeHeaderName(headers, normalizedName) {
  1219. utils.forEach(headers, function processHeader(value, name) {
  1220. if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
  1221. headers[normalizedName] = value;
  1222. delete headers[name];
  1223. }
  1224. });
  1225. };
  1226. /***/ }),
  1227. /***/ "./node_modules/axios/lib/helpers/parseHeaders.js":
  1228. /*!********************************************************!*\
  1229. !*** ./node_modules/axios/lib/helpers/parseHeaders.js ***!
  1230. \********************************************************/
  1231. /*! no static exports found */
  1232. /***/ (function(module, exports, __webpack_require__) {
  1233. "use strict";
  1234. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  1235. // Headers whose duplicates are ignored by node
  1236. // c.f. https://nodejs.org/api/http.html#http_message_headers
  1237. var ignoreDuplicateOf = [
  1238. 'age', 'authorization', 'content-length', 'content-type', 'etag',
  1239. 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
  1240. 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
  1241. 'referer', 'retry-after', 'user-agent'
  1242. ];
  1243. /**
  1244. * Parse headers into an object
  1245. *
  1246. * ```
  1247. * Date: Wed, 27 Aug 2014 08:58:49 GMT
  1248. * Content-Type: application/json
  1249. * Connection: keep-alive
  1250. * Transfer-Encoding: chunked
  1251. * ```
  1252. *
  1253. * @param {String} headers Headers needing to be parsed
  1254. * @returns {Object} Headers parsed into an object
  1255. */
  1256. module.exports = function parseHeaders(headers) {
  1257. var parsed = {};
  1258. var key;
  1259. var val;
  1260. var i;
  1261. if (!headers) { return parsed; }
  1262. utils.forEach(headers.split('\n'), function parser(line) {
  1263. i = line.indexOf(':');
  1264. key = utils.trim(line.substr(0, i)).toLowerCase();
  1265. val = utils.trim(line.substr(i + 1));
  1266. if (key) {
  1267. if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
  1268. return;
  1269. }
  1270. if (key === 'set-cookie') {
  1271. parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
  1272. } else {
  1273. parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
  1274. }
  1275. }
  1276. });
  1277. return parsed;
  1278. };
  1279. /***/ }),
  1280. /***/ "./node_modules/axios/lib/helpers/spread.js":
  1281. /*!**************************************************!*\
  1282. !*** ./node_modules/axios/lib/helpers/spread.js ***!
  1283. \**************************************************/
  1284. /*! no static exports found */
  1285. /***/ (function(module, exports, __webpack_require__) {
  1286. "use strict";
  1287. /**
  1288. * Syntactic sugar for invoking a function and expanding an array for arguments.
  1289. *
  1290. * Common use case would be to use `Function.prototype.apply`.
  1291. *
  1292. * ```js
  1293. * function f(x, y, z) {}
  1294. * var args = [1, 2, 3];
  1295. * f.apply(null, args);
  1296. * ```
  1297. *
  1298. * With `spread` this example can be re-written.
  1299. *
  1300. * ```js
  1301. * spread(function(x, y, z) {})([1, 2, 3]);
  1302. * ```
  1303. *
  1304. * @param {Function} callback
  1305. * @returns {Function}
  1306. */
  1307. module.exports = function spread(callback) {
  1308. return function wrap(arr) {
  1309. return callback.apply(null, arr);
  1310. };
  1311. };
  1312. /***/ }),
  1313. /***/ "./node_modules/axios/lib/utils.js":
  1314. /*!*****************************************!*\
  1315. !*** ./node_modules/axios/lib/utils.js ***!
  1316. \*****************************************/
  1317. /*! no static exports found */
  1318. /***/ (function(module, exports, __webpack_require__) {
  1319. "use strict";
  1320. var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js");
  1321. /*global toString:true*/
  1322. // utils is a library of generic helper functions non-specific to axios
  1323. var toString = Object.prototype.toString;
  1324. /**
  1325. * Determine if a value is an Array
  1326. *
  1327. * @param {Object} val The value to test
  1328. * @returns {boolean} True if value is an Array, otherwise false
  1329. */
  1330. function isArray(val) {
  1331. return toString.call(val) === '[object Array]';
  1332. }
  1333. /**
  1334. * Determine if a value is undefined
  1335. *
  1336. * @param {Object} val The value to test
  1337. * @returns {boolean} True if the value is undefined, otherwise false
  1338. */
  1339. function isUndefined(val) {
  1340. return typeof val === 'undefined';
  1341. }
  1342. /**
  1343. * Determine if a value is a Buffer
  1344. *
  1345. * @param {Object} val The value to test
  1346. * @returns {boolean} True if value is a Buffer, otherwise false
  1347. */
  1348. function isBuffer(val) {
  1349. return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
  1350. && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
  1351. }
  1352. /**
  1353. * Determine if a value is an ArrayBuffer
  1354. *
  1355. * @param {Object} val The value to test
  1356. * @returns {boolean} True if value is an ArrayBuffer, otherwise false
  1357. */
  1358. function isArrayBuffer(val) {
  1359. return toString.call(val) === '[object ArrayBuffer]';
  1360. }
  1361. /**
  1362. * Determine if a value is a FormData
  1363. *
  1364. * @param {Object} val The value to test
  1365. * @returns {boolean} True if value is an FormData, otherwise false
  1366. */
  1367. function isFormData(val) {
  1368. return (typeof FormData !== 'undefined') && (val instanceof FormData);
  1369. }
  1370. /**
  1371. * Determine if a value is a view on an ArrayBuffer
  1372. *
  1373. * @param {Object} val The value to test
  1374. * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
  1375. */
  1376. function isArrayBufferView(val) {
  1377. var result;
  1378. if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
  1379. result = ArrayBuffer.isView(val);
  1380. } else {
  1381. result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
  1382. }
  1383. return result;
  1384. }
  1385. /**
  1386. * Determine if a value is a String
  1387. *
  1388. * @param {Object} val The value to test
  1389. * @returns {boolean} True if value is a String, otherwise false
  1390. */
  1391. function isString(val) {
  1392. return typeof val === 'string';
  1393. }
  1394. /**
  1395. * Determine if a value is a Number
  1396. *
  1397. * @param {Object} val The value to test
  1398. * @returns {boolean} True if value is a Number, otherwise false
  1399. */
  1400. function isNumber(val) {
  1401. return typeof val === 'number';
  1402. }
  1403. /**
  1404. * Determine if a value is an Object
  1405. *
  1406. * @param {Object} val The value to test
  1407. * @returns {boolean} True if value is an Object, otherwise false
  1408. */
  1409. function isObject(val) {
  1410. return val !== null && typeof val === 'object';
  1411. }
  1412. /**
  1413. * Determine if a value is a Date
  1414. *
  1415. * @param {Object} val The value to test
  1416. * @returns {boolean} True if value is a Date, otherwise false
  1417. */
  1418. function isDate(val) {
  1419. return toString.call(val) === '[object Date]';
  1420. }
  1421. /**
  1422. * Determine if a value is a File
  1423. *
  1424. * @param {Object} val The value to test
  1425. * @returns {boolean} True if value is a File, otherwise false
  1426. */
  1427. function isFile(val) {
  1428. return toString.call(val) === '[object File]';
  1429. }
  1430. /**
  1431. * Determine if a value is a Blob
  1432. *
  1433. * @param {Object} val The value to test
  1434. * @returns {boolean} True if value is a Blob, otherwise false
  1435. */
  1436. function isBlob(val) {
  1437. return toString.call(val) === '[object Blob]';
  1438. }
  1439. /**
  1440. * Determine if a value is a Function
  1441. *
  1442. * @param {Object} val The value to test
  1443. * @returns {boolean} True if value is a Function, otherwise false
  1444. */
  1445. function isFunction(val) {
  1446. return toString.call(val) === '[object Function]';
  1447. }
  1448. /**
  1449. * Determine if a value is a Stream
  1450. *
  1451. * @param {Object} val The value to test
  1452. * @returns {boolean} True if value is a Stream, otherwise false
  1453. */
  1454. function isStream(val) {
  1455. return isObject(val) && isFunction(val.pipe);
  1456. }
  1457. /**
  1458. * Determine if a value is a URLSearchParams object
  1459. *
  1460. * @param {Object} val The value to test
  1461. * @returns {boolean} True if value is a URLSearchParams object, otherwise false
  1462. */
  1463. function isURLSearchParams(val) {
  1464. return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
  1465. }
  1466. /**
  1467. * Trim excess whitespace off the beginning and end of a string
  1468. *
  1469. * @param {String} str The String to trim
  1470. * @returns {String} The String freed of excess whitespace
  1471. */
  1472. function trim(str) {
  1473. return str.replace(/^\s*/, '').replace(/\s*$/, '');
  1474. }
  1475. /**
  1476. * Determine if we're running in a standard browser environment
  1477. *
  1478. * This allows axios to run in a web worker, and react-native.
  1479. * Both environments support XMLHttpRequest, but not fully standard globals.
  1480. *
  1481. * web workers:
  1482. * typeof window -> undefined
  1483. * typeof document -> undefined
  1484. *
  1485. * react-native:
  1486. * navigator.product -> 'ReactNative'
  1487. * nativescript
  1488. * navigator.product -> 'NativeScript' or 'NS'
  1489. */
  1490. function isStandardBrowserEnv() {
  1491. if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
  1492. navigator.product === 'NativeScript' ||
  1493. navigator.product === 'NS')) {
  1494. return false;
  1495. }
  1496. return (
  1497. typeof window !== 'undefined' &&
  1498. typeof document !== 'undefined'
  1499. );
  1500. }
  1501. /**
  1502. * Iterate over an Array or an Object invoking a function for each item.
  1503. *
  1504. * If `obj` is an Array callback will be called passing
  1505. * the value, index, and complete array for each item.
  1506. *
  1507. * If 'obj' is an Object callback will be called passing
  1508. * the value, key, and complete object for each property.
  1509. *
  1510. * @param {Object|Array} obj The object to iterate
  1511. * @param {Function} fn The callback to invoke for each item
  1512. */
  1513. function forEach(obj, fn) {
  1514. // Don't bother if no value provided
  1515. if (obj === null || typeof obj === 'undefined') {
  1516. return;
  1517. }
  1518. // Force an array if not already something iterable
  1519. if (typeof obj !== 'object') {
  1520. /*eslint no-param-reassign:0*/
  1521. obj = [obj];
  1522. }
  1523. if (isArray(obj)) {
  1524. // Iterate over array values
  1525. for (var i = 0, l = obj.length; i < l; i++) {
  1526. fn.call(null, obj[i], i, obj);
  1527. }
  1528. } else {
  1529. // Iterate over object keys
  1530. for (var key in obj) {
  1531. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  1532. fn.call(null, obj[key], key, obj);
  1533. }
  1534. }
  1535. }
  1536. }
  1537. /**
  1538. * Accepts varargs expecting each argument to be an object, then
  1539. * immutably merges the properties of each object and returns result.
  1540. *
  1541. * When multiple objects contain the same key the later object in
  1542. * the arguments list will take precedence.
  1543. *
  1544. * Example:
  1545. *
  1546. * ```js
  1547. * var result = merge({foo: 123}, {foo: 456});
  1548. * console.log(result.foo); // outputs 456
  1549. * ```
  1550. *
  1551. * @param {Object} obj1 Object to merge
  1552. * @returns {Object} Result of all merge properties
  1553. */
  1554. function merge(/* obj1, obj2, obj3, ... */) {
  1555. var result = {};
  1556. function assignValue(val, key) {
  1557. if (typeof result[key] === 'object' && typeof val === 'object') {
  1558. result[key] = merge(result[key], val);
  1559. } else {
  1560. result[key] = val;
  1561. }
  1562. }
  1563. for (var i = 0, l = arguments.length; i < l; i++) {
  1564. forEach(arguments[i], assignValue);
  1565. }
  1566. return result;
  1567. }
  1568. /**
  1569. * Function equal to merge with the difference being that no reference
  1570. * to original objects is kept.
  1571. *
  1572. * @see merge
  1573. * @param {Object} obj1 Object to merge
  1574. * @returns {Object} Result of all merge properties
  1575. */
  1576. function deepMerge(/* obj1, obj2, obj3, ... */) {
  1577. var result = {};
  1578. function assignValue(val, key) {
  1579. if (typeof result[key] === 'object' && typeof val === 'object') {
  1580. result[key] = deepMerge(result[key], val);
  1581. } else if (typeof val === 'object') {
  1582. result[key] = deepMerge({}, val);
  1583. } else {
  1584. result[key] = val;
  1585. }
  1586. }
  1587. for (var i = 0, l = arguments.length; i < l; i++) {
  1588. forEach(arguments[i], assignValue);
  1589. }
  1590. return result;
  1591. }
  1592. /**
  1593. * Extends object a by mutably adding to it the properties of object b.
  1594. *
  1595. * @param {Object} a The object to be extended
  1596. * @param {Object} b The object to copy properties from
  1597. * @param {Object} thisArg The object to bind function to
  1598. * @return {Object} The resulting value of object a
  1599. */
  1600. function extend(a, b, thisArg) {
  1601. forEach(b, function assignValue(val, key) {
  1602. if (thisArg && typeof val === 'function') {
  1603. a[key] = bind(val, thisArg);
  1604. } else {
  1605. a[key] = val;
  1606. }
  1607. });
  1608. return a;
  1609. }
  1610. module.exports = {
  1611. isArray: isArray,
  1612. isArrayBuffer: isArrayBuffer,
  1613. isBuffer: isBuffer,
  1614. isFormData: isFormData,
  1615. isArrayBufferView: isArrayBufferView,
  1616. isString: isString,
  1617. isNumber: isNumber,
  1618. isObject: isObject,
  1619. isUndefined: isUndefined,
  1620. isDate: isDate,
  1621. isFile: isFile,
  1622. isBlob: isBlob,
  1623. isFunction: isFunction,
  1624. isStream: isStream,
  1625. isURLSearchParams: isURLSearchParams,
  1626. isStandardBrowserEnv: isStandardBrowserEnv,
  1627. forEach: forEach,
  1628. merge: merge,
  1629. deepMerge: deepMerge,
  1630. extend: extend,
  1631. trim: trim
  1632. };
  1633. /***/ }),
  1634. /***/ "./node_modules/backo2/index.js":
  1635. /*!**************************************!*\
  1636. !*** ./node_modules/backo2/index.js ***!
  1637. \**************************************/
  1638. /*! no static exports found */
  1639. /***/ (function(module, exports) {
  1640. /**
  1641. * Expose `Backoff`.
  1642. */
  1643. module.exports = Backoff;
  1644. /**
  1645. * Initialize backoff timer with `opts`.
  1646. *
  1647. * - `min` initial timeout in milliseconds [100]
  1648. * - `max` max timeout [10000]
  1649. * - `jitter` [0]
  1650. * - `factor` [2]
  1651. *
  1652. * @param {Object} opts
  1653. * @api public
  1654. */
  1655. function Backoff(opts) {
  1656. opts = opts || {};
  1657. this.ms = opts.min || 100;
  1658. this.max = opts.max || 10000;
  1659. this.factor = opts.factor || 2;
  1660. this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;
  1661. this.attempts = 0;
  1662. }
  1663. /**
  1664. * Return the backoff duration.
  1665. *
  1666. * @return {Number}
  1667. * @api public
  1668. */
  1669. Backoff.prototype.duration = function(){
  1670. var ms = this.ms * Math.pow(this.factor, this.attempts++);
  1671. if (this.jitter) {
  1672. var rand = Math.random();
  1673. var deviation = Math.floor(rand * this.jitter * ms);
  1674. ms = (Math.floor(rand * 10) & 1) == 0 ? ms - deviation : ms + deviation;
  1675. }
  1676. return Math.min(ms, this.max) | 0;
  1677. };
  1678. /**
  1679. * Reset the number of attempts.
  1680. *
  1681. * @api public
  1682. */
  1683. Backoff.prototype.reset = function(){
  1684. this.attempts = 0;
  1685. };
  1686. /**
  1687. * Set the minimum duration
  1688. *
  1689. * @api public
  1690. */
  1691. Backoff.prototype.setMin = function(min){
  1692. this.ms = min;
  1693. };
  1694. /**
  1695. * Set the maximum duration
  1696. *
  1697. * @api public
  1698. */
  1699. Backoff.prototype.setMax = function(max){
  1700. this.max = max;
  1701. };
  1702. /**
  1703. * Set the jitter
  1704. *
  1705. * @api public
  1706. */
  1707. Backoff.prototype.setJitter = function(jitter){
  1708. this.jitter = jitter;
  1709. };
  1710. /***/ }),
  1711. /***/ "./node_modules/base64-arraybuffer/lib/base64-arraybuffer.js":
  1712. /*!*******************************************************************!*\
  1713. !*** ./node_modules/base64-arraybuffer/lib/base64-arraybuffer.js ***!
  1714. \*******************************************************************/
  1715. /*! no static exports found */
  1716. /***/ (function(module, exports) {
  1717. /*
  1718. * base64-arraybuffer
  1719. * https://github.com/niklasvh/base64-arraybuffer
  1720. *
  1721. * Copyright (c) 2012 Niklas von Hertzen
  1722. * Licensed under the MIT license.
  1723. */
  1724. (function(){
  1725. "use strict";
  1726. var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  1727. // Use a lookup table to find the index.
  1728. var lookup = new Uint8Array(256);
  1729. for (var i = 0; i < chars.length; i++) {
  1730. lookup[chars.charCodeAt(i)] = i;
  1731. }
  1732. exports.encode = function(arraybuffer) {
  1733. var bytes = new Uint8Array(arraybuffer),
  1734. i, len = bytes.length, base64 = "";
  1735. for (i = 0; i < len; i+=3) {
  1736. base64 += chars[bytes[i] >> 2];
  1737. base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];
  1738. base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];
  1739. base64 += chars[bytes[i + 2] & 63];
  1740. }
  1741. if ((len % 3) === 2) {
  1742. base64 = base64.substring(0, base64.length - 1) + "=";
  1743. } else if (len % 3 === 1) {
  1744. base64 = base64.substring(0, base64.length - 2) + "==";
  1745. }
  1746. return base64;
  1747. };
  1748. exports.decode = function(base64) {
  1749. var bufferLength = base64.length * 0.75,
  1750. len = base64.length, i, p = 0,
  1751. encoded1, encoded2, encoded3, encoded4;
  1752. if (base64[base64.length - 1] === "=") {
  1753. bufferLength--;
  1754. if (base64[base64.length - 2] === "=") {
  1755. bufferLength--;
  1756. }
  1757. }
  1758. var arraybuffer = new ArrayBuffer(bufferLength),
  1759. bytes = new Uint8Array(arraybuffer);
  1760. for (i = 0; i < len; i+=4) {
  1761. encoded1 = lookup[base64.charCodeAt(i)];
  1762. encoded2 = lookup[base64.charCodeAt(i+1)];
  1763. encoded3 = lookup[base64.charCodeAt(i+2)];
  1764. encoded4 = lookup[base64.charCodeAt(i+3)];
  1765. bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);
  1766. bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);
  1767. bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);
  1768. }
  1769. return arraybuffer;
  1770. };
  1771. })();
  1772. /***/ }),
  1773. /***/ "./node_modules/base64-js/index.js":
  1774. /*!*****************************************!*\
  1775. !*** ./node_modules/base64-js/index.js ***!
  1776. \*****************************************/
  1777. /*! no static exports found */
  1778. /***/ (function(module, exports, __webpack_require__) {
  1779. "use strict";
  1780. exports.byteLength = byteLength
  1781. exports.toByteArray = toByteArray
  1782. exports.fromByteArray = fromByteArray
  1783. var lookup = []
  1784. var revLookup = []
  1785. var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
  1786. var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
  1787. for (var i = 0, len = code.length; i < len; ++i) {
  1788. lookup[i] = code[i]
  1789. revLookup[code.charCodeAt(i)] = i
  1790. }
  1791. // Support decoding URL-safe base64 strings, as Node.js does.
  1792. // See: https://en.wikipedia.org/wiki/Base64#URL_applications
  1793. revLookup['-'.charCodeAt(0)] = 62
  1794. revLookup['_'.charCodeAt(0)] = 63
  1795. function getLens (b64) {
  1796. var len = b64.length
  1797. if (len % 4 > 0) {
  1798. throw new Error('Invalid string. Length must be a multiple of 4')
  1799. }
  1800. // Trim off extra bytes after placeholder bytes are found
  1801. // See: https://github.com/beatgammit/base64-js/issues/42
  1802. var validLen = b64.indexOf('=')
  1803. if (validLen === -1) validLen = len
  1804. var placeHoldersLen = validLen === len
  1805. ? 0
  1806. : 4 - (validLen % 4)
  1807. return [validLen, placeHoldersLen]
  1808. }
  1809. // base64 is 4/3 + up to two characters of the original data
  1810. function byteLength (b64) {
  1811. var lens = getLens(b64)
  1812. var validLen = lens[0]
  1813. var placeHoldersLen = lens[1]
  1814. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  1815. }
  1816. function _byteLength (b64, validLen, placeHoldersLen) {
  1817. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  1818. }
  1819. function toByteArray (b64) {
  1820. var tmp
  1821. var lens = getLens(b64)
  1822. var validLen = lens[0]
  1823. var placeHoldersLen = lens[1]
  1824. var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
  1825. var curByte = 0
  1826. // if there are placeholders, only get up to the last complete 4 chars
  1827. var len = placeHoldersLen > 0
  1828. ? validLen - 4
  1829. : validLen
  1830. var i
  1831. for (i = 0; i < len; i += 4) {
  1832. tmp =
  1833. (revLookup[b64.charCodeAt(i)] << 18) |
  1834. (revLookup[b64.charCodeAt(i + 1)] << 12) |
  1835. (revLookup[b64.charCodeAt(i + 2)] << 6) |
  1836. revLookup[b64.charCodeAt(i + 3)]
  1837. arr[curByte++] = (tmp >> 16) & 0xFF
  1838. arr[curByte++] = (tmp >> 8) & 0xFF
  1839. arr[curByte++] = tmp & 0xFF
  1840. }
  1841. if (placeHoldersLen === 2) {
  1842. tmp =
  1843. (revLookup[b64.charCodeAt(i)] << 2) |
  1844. (revLookup[b64.charCodeAt(i + 1)] >> 4)
  1845. arr[curByte++] = tmp & 0xFF
  1846. }
  1847. if (placeHoldersLen === 1) {
  1848. tmp =
  1849. (revLookup[b64.charCodeAt(i)] << 10) |
  1850. (revLookup[b64.charCodeAt(i + 1)] << 4) |
  1851. (revLookup[b64.charCodeAt(i + 2)] >> 2)
  1852. arr[curByte++] = (tmp >> 8) & 0xFF
  1853. arr[curByte++] = tmp & 0xFF
  1854. }
  1855. return arr
  1856. }
  1857. function tripletToBase64 (num) {
  1858. return lookup[num >> 18 & 0x3F] +
  1859. lookup[num >> 12 & 0x3F] +
  1860. lookup[num >> 6 & 0x3F] +
  1861. lookup[num & 0x3F]
  1862. }
  1863. function encodeChunk (uint8, start, end) {
  1864. var tmp
  1865. var output = []
  1866. for (var i = start; i < end; i += 3) {
  1867. tmp =
  1868. ((uint8[i] << 16) & 0xFF0000) +
  1869. ((uint8[i + 1] << 8) & 0xFF00) +
  1870. (uint8[i + 2] & 0xFF)
  1871. output.push(tripletToBase64(tmp))
  1872. }
  1873. return output.join('')
  1874. }
  1875. function fromByteArray (uint8) {
  1876. var tmp
  1877. var len = uint8.length
  1878. var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
  1879. var parts = []
  1880. var maxChunkLength = 16383 // must be multiple of 3
  1881. // go through the array every three bytes, we'll deal with trailing stuff later
  1882. for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
  1883. parts.push(encodeChunk(
  1884. uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)
  1885. ))
  1886. }
  1887. // pad the end with zeros, but make sure to not forget the extra bytes
  1888. if (extraBytes === 1) {
  1889. tmp = uint8[len - 1]
  1890. parts.push(
  1891. lookup[tmp >> 2] +
  1892. lookup[(tmp << 4) & 0x3F] +
  1893. '=='
  1894. )
  1895. } else if (extraBytes === 2) {
  1896. tmp = (uint8[len - 2] << 8) + uint8[len - 1]
  1897. parts.push(
  1898. lookup[tmp >> 10] +
  1899. lookup[(tmp >> 4) & 0x3F] +
  1900. lookup[(tmp << 2) & 0x3F] +
  1901. '='
  1902. )
  1903. }
  1904. return parts.join('')
  1905. }
  1906. /***/ }),
  1907. /***/ "./node_modules/blob/index.js":
  1908. /*!************************************!*\
  1909. !*** ./node_modules/blob/index.js ***!
  1910. \************************************/
  1911. /*! no static exports found */
  1912. /***/ (function(module, exports) {
  1913. /**
  1914. * Create a blob builder even when vendor prefixes exist
  1915. */
  1916. var BlobBuilder = typeof BlobBuilder !== 'undefined' ? BlobBuilder :
  1917. typeof WebKitBlobBuilder !== 'undefined' ? WebKitBlobBuilder :
  1918. typeof MSBlobBuilder !== 'undefined' ? MSBlobBuilder :
  1919. typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder :
  1920. false;
  1921. /**
  1922. * Check if Blob constructor is supported
  1923. */
  1924. var blobSupported = (function() {
  1925. try {
  1926. var a = new Blob(['hi']);
  1927. return a.size === 2;
  1928. } catch(e) {
  1929. return false;
  1930. }
  1931. })();
  1932. /**
  1933. * Check if Blob constructor supports ArrayBufferViews
  1934. * Fails in Safari 6, so we need to map to ArrayBuffers there.
  1935. */
  1936. var blobSupportsArrayBufferView = blobSupported && (function() {
  1937. try {
  1938. var b = new Blob([new Uint8Array([1,2])]);
  1939. return b.size === 2;
  1940. } catch(e) {
  1941. return false;
  1942. }
  1943. })();
  1944. /**
  1945. * Check if BlobBuilder is supported
  1946. */
  1947. var blobBuilderSupported = BlobBuilder
  1948. && BlobBuilder.prototype.append
  1949. && BlobBuilder.prototype.getBlob;
  1950. /**
  1951. * Helper function that maps ArrayBufferViews to ArrayBuffers
  1952. * Used by BlobBuilder constructor and old browsers that didn't
  1953. * support it in the Blob constructor.
  1954. */
  1955. function mapArrayBufferViews(ary) {
  1956. return ary.map(function(chunk) {
  1957. if (chunk.buffer instanceof ArrayBuffer) {
  1958. var buf = chunk.buffer;
  1959. // if this is a subarray, make a copy so we only
  1960. // include the subarray region from the underlying buffer
  1961. if (chunk.byteLength !== buf.byteLength) {
  1962. var copy = new Uint8Array(chunk.byteLength);
  1963. copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));
  1964. buf = copy.buffer;
  1965. }
  1966. return buf;
  1967. }
  1968. return chunk;
  1969. });
  1970. }
  1971. function BlobBuilderConstructor(ary, options) {
  1972. options = options || {};
  1973. var bb = new BlobBuilder();
  1974. mapArrayBufferViews(ary).forEach(function(part) {
  1975. bb.append(part);
  1976. });
  1977. return (options.type) ? bb.getBlob(options.type) : bb.getBlob();
  1978. };
  1979. function BlobConstructor(ary, options) {
  1980. return new Blob(mapArrayBufferViews(ary), options || {});
  1981. };
  1982. if (typeof Blob !== 'undefined') {
  1983. BlobBuilderConstructor.prototype = Blob.prototype;
  1984. BlobConstructor.prototype = Blob.prototype;
  1985. }
  1986. module.exports = (function() {
  1987. if (blobSupported) {
  1988. return blobSupportsArrayBufferView ? Blob : BlobConstructor;
  1989. } else if (blobBuilderSupported) {
  1990. return BlobBuilderConstructor;
  1991. } else {
  1992. return undefined;
  1993. }
  1994. })();
  1995. /***/ }),
  1996. /***/ "./node_modules/bootstrap/dist/js/bootstrap.js":
  1997. /*!*****************************************************!*\
  1998. !*** ./node_modules/bootstrap/dist/js/bootstrap.js ***!
  1999. \*****************************************************/
  2000. /*! no static exports found */
  2001. /***/ (function(module, exports, __webpack_require__) {
  2002. /*!
  2003. * Bootstrap v4.5.0 (https://getbootstrap.com/)
  2004. * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
  2005. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  2006. */
  2007. (function (global, factory) {
  2008. true ? factory(exports, __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"), __webpack_require__(/*! popper.js */ "./node_modules/popper.js/dist/esm/popper.js")) :
  2009. undefined;
  2010. }(this, (function (exports, $, Popper) { 'use strict';
  2011. $ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
  2012. Popper = Popper && Object.prototype.hasOwnProperty.call(Popper, 'default') ? Popper['default'] : Popper;
  2013. function _defineProperties(target, props) {
  2014. for (var i = 0; i < props.length; i++) {
  2015. var descriptor = props[i];
  2016. descriptor.enumerable = descriptor.enumerable || false;
  2017. descriptor.configurable = true;
  2018. if ("value" in descriptor) descriptor.writable = true;
  2019. Object.defineProperty(target, descriptor.key, descriptor);
  2020. }
  2021. }
  2022. function _createClass(Constructor, protoProps, staticProps) {
  2023. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  2024. if (staticProps) _defineProperties(Constructor, staticProps);
  2025. return Constructor;
  2026. }
  2027. function _defineProperty(obj, key, value) {
  2028. if (key in obj) {
  2029. Object.defineProperty(obj, key, {
  2030. value: value,
  2031. enumerable: true,
  2032. configurable: true,
  2033. writable: true
  2034. });
  2035. } else {
  2036. obj[key] = value;
  2037. }
  2038. return obj;
  2039. }
  2040. function ownKeys(object, enumerableOnly) {
  2041. var keys = Object.keys(object);
  2042. if (Object.getOwnPropertySymbols) {
  2043. var symbols = Object.getOwnPropertySymbols(object);
  2044. if (enumerableOnly) symbols = symbols.filter(function (sym) {
  2045. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  2046. });
  2047. keys.push.apply(keys, symbols);
  2048. }
  2049. return keys;
  2050. }
  2051. function _objectSpread2(target) {
  2052. for (var i = 1; i < arguments.length; i++) {
  2053. var source = arguments[i] != null ? arguments[i] : {};
  2054. if (i % 2) {
  2055. ownKeys(Object(source), true).forEach(function (key) {
  2056. _defineProperty(target, key, source[key]);
  2057. });
  2058. } else if (Object.getOwnPropertyDescriptors) {
  2059. Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
  2060. } else {
  2061. ownKeys(Object(source)).forEach(function (key) {
  2062. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  2063. });
  2064. }
  2065. }
  2066. return target;
  2067. }
  2068. function _inheritsLoose(subClass, superClass) {
  2069. subClass.prototype = Object.create(superClass.prototype);
  2070. subClass.prototype.constructor = subClass;
  2071. subClass.__proto__ = superClass;
  2072. }
  2073. /**
  2074. * --------------------------------------------------------------------------
  2075. * Bootstrap (v4.5.0): util.js
  2076. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  2077. * --------------------------------------------------------------------------
  2078. */
  2079. /**
  2080. * ------------------------------------------------------------------------
  2081. * Private TransitionEnd Helpers
  2082. * ------------------------------------------------------------------------
  2083. */
  2084. var TRANSITION_END = 'transitionend';
  2085. var MAX_UID = 1000000;
  2086. var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
  2087. function toType(obj) {
  2088. if (obj === null || typeof obj === 'undefined') {
  2089. return "" + obj;
  2090. }
  2091. return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
  2092. }
  2093. function getSpecialTransitionEndEvent() {
  2094. return {
  2095. bindType: TRANSITION_END,
  2096. delegateType: TRANSITION_END,
  2097. handle: function handle(event) {
  2098. if ($(event.target).is(this)) {
  2099. return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
  2100. }
  2101. return undefined;
  2102. }
  2103. };
  2104. }
  2105. function transitionEndEmulator(duration) {
  2106. var _this = this;
  2107. var called = false;
  2108. $(this).one(Util.TRANSITION_END, function () {
  2109. called = true;
  2110. });
  2111. setTimeout(function () {
  2112. if (!called) {
  2113. Util.triggerTransitionEnd(_this);
  2114. }
  2115. }, duration);
  2116. return this;
  2117. }
  2118. function setTransitionEndSupport() {
  2119. $.fn.emulateTransitionEnd = transitionEndEmulator;
  2120. $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
  2121. }
  2122. /**
  2123. * --------------------------------------------------------------------------
  2124. * Public Util Api
  2125. * --------------------------------------------------------------------------
  2126. */
  2127. var Util = {
  2128. TRANSITION_END: 'bsTransitionEnd',
  2129. getUID: function getUID(prefix) {
  2130. do {
  2131. // eslint-disable-next-line no-bitwise
  2132. prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
  2133. } while (document.getElementById(prefix));
  2134. return prefix;
  2135. },
  2136. getSelectorFromElement: function getSelectorFromElement(element) {
  2137. var selector = element.getAttribute('data-target');
  2138. if (!selector || selector === '#') {
  2139. var hrefAttr = element.getAttribute('href');
  2140. selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : '';
  2141. }
  2142. try {
  2143. return document.querySelector(selector) ? selector : null;
  2144. } catch (err) {
  2145. return null;
  2146. }
  2147. },
  2148. getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {
  2149. if (!element) {
  2150. return 0;
  2151. } // Get transition-duration of the element
  2152. var transitionDuration = $(element).css('transition-duration');
  2153. var transitionDelay = $(element).css('transition-delay');
  2154. var floatTransitionDuration = parseFloat(transitionDuration);
  2155. var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
  2156. if (!floatTransitionDuration && !floatTransitionDelay) {
  2157. return 0;
  2158. } // If multiple durations are defined, take the first
  2159. transitionDuration = transitionDuration.split(',')[0];
  2160. transitionDelay = transitionDelay.split(',')[0];
  2161. return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
  2162. },
  2163. reflow: function reflow(element) {
  2164. return element.offsetHeight;
  2165. },
  2166. triggerTransitionEnd: function triggerTransitionEnd(element) {
  2167. $(element).trigger(TRANSITION_END);
  2168. },
  2169. // TODO: Remove in v5
  2170. supportsTransitionEnd: function supportsTransitionEnd() {
  2171. return Boolean(TRANSITION_END);
  2172. },
  2173. isElement: function isElement(obj) {
  2174. return (obj[0] || obj).nodeType;
  2175. },
  2176. typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
  2177. for (var property in configTypes) {
  2178. if (Object.prototype.hasOwnProperty.call(configTypes, property)) {
  2179. var expectedTypes = configTypes[property];
  2180. var value = config[property];
  2181. var valueType = value && Util.isElement(value) ? 'element' : toType(value);
  2182. if (!new RegExp(expectedTypes).test(valueType)) {
  2183. throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\"."));
  2184. }
  2185. }
  2186. }
  2187. },
  2188. findShadowRoot: function findShadowRoot(element) {
  2189. if (!document.documentElement.attachShadow) {
  2190. return null;
  2191. } // Can find the shadow root otherwise it'll return the document
  2192. if (typeof element.getRootNode === 'function') {
  2193. var root = element.getRootNode();
  2194. return root instanceof ShadowRoot ? root : null;
  2195. }
  2196. if (element instanceof ShadowRoot) {
  2197. return element;
  2198. } // when we don't find a shadow root
  2199. if (!element.parentNode) {
  2200. return null;
  2201. }
  2202. return Util.findShadowRoot(element.parentNode);
  2203. },
  2204. jQueryDetection: function jQueryDetection() {
  2205. if (typeof $ === 'undefined') {
  2206. throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.');
  2207. }
  2208. var version = $.fn.jquery.split(' ')[0].split('.');
  2209. var minMajor = 1;
  2210. var ltMajor = 2;
  2211. var minMinor = 9;
  2212. var minPatch = 1;
  2213. var maxMajor = 4;
  2214. if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {
  2215. throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
  2216. }
  2217. }
  2218. };
  2219. Util.jQueryDetection();
  2220. setTransitionEndSupport();
  2221. /**
  2222. * ------------------------------------------------------------------------
  2223. * Constants
  2224. * ------------------------------------------------------------------------
  2225. */
  2226. var NAME = 'alert';
  2227. var VERSION = '4.5.0';
  2228. var DATA_KEY = 'bs.alert';
  2229. var EVENT_KEY = "." + DATA_KEY;
  2230. var DATA_API_KEY = '.data-api';
  2231. var JQUERY_NO_CONFLICT = $.fn[NAME];
  2232. var SELECTOR_DISMISS = '[data-dismiss="alert"]';
  2233. var EVENT_CLOSE = "close" + EVENT_KEY;
  2234. var EVENT_CLOSED = "closed" + EVENT_KEY;
  2235. var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
  2236. var CLASS_NAME_ALERT = 'alert';
  2237. var CLASS_NAME_FADE = 'fade';
  2238. var CLASS_NAME_SHOW = 'show';
  2239. /**
  2240. * ------------------------------------------------------------------------
  2241. * Class Definition
  2242. * ------------------------------------------------------------------------
  2243. */
  2244. var Alert = /*#__PURE__*/function () {
  2245. function Alert(element) {
  2246. this._element = element;
  2247. } // Getters
  2248. var _proto = Alert.prototype;
  2249. // Public
  2250. _proto.close = function close(element) {
  2251. var rootElement = this._element;
  2252. if (element) {
  2253. rootElement = this._getRootElement(element);
  2254. }
  2255. var customEvent = this._triggerCloseEvent(rootElement);
  2256. if (customEvent.isDefaultPrevented()) {
  2257. return;
  2258. }
  2259. this._removeElement(rootElement);
  2260. };
  2261. _proto.dispose = function dispose() {
  2262. $.removeData(this._element, DATA_KEY);
  2263. this._element = null;
  2264. } // Private
  2265. ;
  2266. _proto._getRootElement = function _getRootElement(element) {
  2267. var selector = Util.getSelectorFromElement(element);
  2268. var parent = false;
  2269. if (selector) {
  2270. parent = document.querySelector(selector);
  2271. }
  2272. if (!parent) {
  2273. parent = $(element).closest("." + CLASS_NAME_ALERT)[0];
  2274. }
  2275. return parent;
  2276. };
  2277. _proto._triggerCloseEvent = function _triggerCloseEvent(element) {
  2278. var closeEvent = $.Event(EVENT_CLOSE);
  2279. $(element).trigger(closeEvent);
  2280. return closeEvent;
  2281. };
  2282. _proto._removeElement = function _removeElement(element) {
  2283. var _this = this;
  2284. $(element).removeClass(CLASS_NAME_SHOW);
  2285. if (!$(element).hasClass(CLASS_NAME_FADE)) {
  2286. this._destroyElement(element);
  2287. return;
  2288. }
  2289. var transitionDuration = Util.getTransitionDurationFromElement(element);
  2290. $(element).one(Util.TRANSITION_END, function (event) {
  2291. return _this._destroyElement(element, event);
  2292. }).emulateTransitionEnd(transitionDuration);
  2293. };
  2294. _proto._destroyElement = function _destroyElement(element) {
  2295. $(element).detach().trigger(EVENT_CLOSED).remove();
  2296. } // Static
  2297. ;
  2298. Alert._jQueryInterface = function _jQueryInterface(config) {
  2299. return this.each(function () {
  2300. var $element = $(this);
  2301. var data = $element.data(DATA_KEY);
  2302. if (!data) {
  2303. data = new Alert(this);
  2304. $element.data(DATA_KEY, data);
  2305. }
  2306. if (config === 'close') {
  2307. data[config](this);
  2308. }
  2309. });
  2310. };
  2311. Alert._handleDismiss = function _handleDismiss(alertInstance) {
  2312. return function (event) {
  2313. if (event) {
  2314. event.preventDefault();
  2315. }
  2316. alertInstance.close(this);
  2317. };
  2318. };
  2319. _createClass(Alert, null, [{
  2320. key: "VERSION",
  2321. get: function get() {
  2322. return VERSION;
  2323. }
  2324. }]);
  2325. return Alert;
  2326. }();
  2327. /**
  2328. * ------------------------------------------------------------------------
  2329. * Data Api implementation
  2330. * ------------------------------------------------------------------------
  2331. */
  2332. $(document).on(EVENT_CLICK_DATA_API, SELECTOR_DISMISS, Alert._handleDismiss(new Alert()));
  2333. /**
  2334. * ------------------------------------------------------------------------
  2335. * jQuery
  2336. * ------------------------------------------------------------------------
  2337. */
  2338. $.fn[NAME] = Alert._jQueryInterface;
  2339. $.fn[NAME].Constructor = Alert;
  2340. $.fn[NAME].noConflict = function () {
  2341. $.fn[NAME] = JQUERY_NO_CONFLICT;
  2342. return Alert._jQueryInterface;
  2343. };
  2344. /**
  2345. * ------------------------------------------------------------------------
  2346. * Constants
  2347. * ------------------------------------------------------------------------
  2348. */
  2349. var NAME$1 = 'button';
  2350. var VERSION$1 = '4.5.0';
  2351. var DATA_KEY$1 = 'bs.button';
  2352. var EVENT_KEY$1 = "." + DATA_KEY$1;
  2353. var DATA_API_KEY$1 = '.data-api';
  2354. var JQUERY_NO_CONFLICT$1 = $.fn[NAME$1];
  2355. var CLASS_NAME_ACTIVE = 'active';
  2356. var CLASS_NAME_BUTTON = 'btn';
  2357. var CLASS_NAME_FOCUS = 'focus';
  2358. var SELECTOR_DATA_TOGGLE_CARROT = '[data-toggle^="button"]';
  2359. var SELECTOR_DATA_TOGGLES = '[data-toggle="buttons"]';
  2360. var SELECTOR_DATA_TOGGLE = '[data-toggle="button"]';
  2361. var SELECTOR_DATA_TOGGLES_BUTTONS = '[data-toggle="buttons"] .btn';
  2362. var SELECTOR_INPUT = 'input:not([type="hidden"])';
  2363. var SELECTOR_ACTIVE = '.active';
  2364. var SELECTOR_BUTTON = '.btn';
  2365. var EVENT_CLICK_DATA_API$1 = "click" + EVENT_KEY$1 + DATA_API_KEY$1;
  2366. var EVENT_FOCUS_BLUR_DATA_API = "focus" + EVENT_KEY$1 + DATA_API_KEY$1 + " " + ("blur" + EVENT_KEY$1 + DATA_API_KEY$1);
  2367. var EVENT_LOAD_DATA_API = "load" + EVENT_KEY$1 + DATA_API_KEY$1;
  2368. /**
  2369. * ------------------------------------------------------------------------
  2370. * Class Definition
  2371. * ------------------------------------------------------------------------
  2372. */
  2373. var Button = /*#__PURE__*/function () {
  2374. function Button(element) {
  2375. this._element = element;
  2376. } // Getters
  2377. var _proto = Button.prototype;
  2378. // Public
  2379. _proto.toggle = function toggle() {
  2380. var triggerChangeEvent = true;
  2381. var addAriaPressed = true;
  2382. var rootElement = $(this._element).closest(SELECTOR_DATA_TOGGLES)[0];
  2383. if (rootElement) {
  2384. var input = this._element.querySelector(SELECTOR_INPUT);
  2385. if (input) {
  2386. if (input.type === 'radio') {
  2387. if (input.checked && this._element.classList.contains(CLASS_NAME_ACTIVE)) {
  2388. triggerChangeEvent = false;
  2389. } else {
  2390. var activeElement = rootElement.querySelector(SELECTOR_ACTIVE);
  2391. if (activeElement) {
  2392. $(activeElement).removeClass(CLASS_NAME_ACTIVE);
  2393. }
  2394. }
  2395. }
  2396. if (triggerChangeEvent) {
  2397. // if it's not a radio button or checkbox don't add a pointless/invalid checked property to the input
  2398. if (input.type === 'checkbox' || input.type === 'radio') {
  2399. input.checked = !this._element.classList.contains(CLASS_NAME_ACTIVE);
  2400. }
  2401. $(input).trigger('change');
  2402. }
  2403. input.focus();
  2404. addAriaPressed = false;
  2405. }
  2406. }
  2407. if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) {
  2408. if (addAriaPressed) {
  2409. this._element.setAttribute('aria-pressed', !this._element.classList.contains(CLASS_NAME_ACTIVE));
  2410. }
  2411. if (triggerChangeEvent) {
  2412. $(this._element).toggleClass(CLASS_NAME_ACTIVE);
  2413. }
  2414. }
  2415. };
  2416. _proto.dispose = function dispose() {
  2417. $.removeData(this._element, DATA_KEY$1);
  2418. this._element = null;
  2419. } // Static
  2420. ;
  2421. Button._jQueryInterface = function _jQueryInterface(config) {
  2422. return this.each(function () {
  2423. var data = $(this).data(DATA_KEY$1);
  2424. if (!data) {
  2425. data = new Button(this);
  2426. $(this).data(DATA_KEY$1, data);
  2427. }
  2428. if (config === 'toggle') {
  2429. data[config]();
  2430. }
  2431. });
  2432. };
  2433. _createClass(Button, null, [{
  2434. key: "VERSION",
  2435. get: function get() {
  2436. return VERSION$1;
  2437. }
  2438. }]);
  2439. return Button;
  2440. }();
  2441. /**
  2442. * ------------------------------------------------------------------------
  2443. * Data Api implementation
  2444. * ------------------------------------------------------------------------
  2445. */
  2446. $(document).on(EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE_CARROT, function (event) {
  2447. var button = event.target;
  2448. var initialButton = button;
  2449. if (!$(button).hasClass(CLASS_NAME_BUTTON)) {
  2450. button = $(button).closest(SELECTOR_BUTTON)[0];
  2451. }
  2452. if (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) {
  2453. event.preventDefault(); // work around Firefox bug #1540995
  2454. } else {
  2455. var inputBtn = button.querySelector(SELECTOR_INPUT);
  2456. if (inputBtn && (inputBtn.hasAttribute('disabled') || inputBtn.classList.contains('disabled'))) {
  2457. event.preventDefault(); // work around Firefox bug #1540995
  2458. return;
  2459. }
  2460. if (initialButton.tagName === 'LABEL' && inputBtn && inputBtn.type === 'checkbox') {
  2461. event.preventDefault(); // work around event sent to label and input
  2462. }
  2463. Button._jQueryInterface.call($(button), 'toggle');
  2464. }
  2465. }).on(EVENT_FOCUS_BLUR_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, function (event) {
  2466. var button = $(event.target).closest(SELECTOR_BUTTON)[0];
  2467. $(button).toggleClass(CLASS_NAME_FOCUS, /^focus(in)?$/.test(event.type));
  2468. });
  2469. $(window).on(EVENT_LOAD_DATA_API, function () {
  2470. // ensure correct active class is set to match the controls' actual values/states
  2471. // find all checkboxes/readio buttons inside data-toggle groups
  2472. var buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLES_BUTTONS));
  2473. for (var i = 0, len = buttons.length; i < len; i++) {
  2474. var button = buttons[i];
  2475. var input = button.querySelector(SELECTOR_INPUT);
  2476. if (input.checked || input.hasAttribute('checked')) {
  2477. button.classList.add(CLASS_NAME_ACTIVE);
  2478. } else {
  2479. button.classList.remove(CLASS_NAME_ACTIVE);
  2480. }
  2481. } // find all button toggles
  2482. buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE));
  2483. for (var _i = 0, _len = buttons.length; _i < _len; _i++) {
  2484. var _button = buttons[_i];
  2485. if (_button.getAttribute('aria-pressed') === 'true') {
  2486. _button.classList.add(CLASS_NAME_ACTIVE);
  2487. } else {
  2488. _button.classList.remove(CLASS_NAME_ACTIVE);
  2489. }
  2490. }
  2491. });
  2492. /**
  2493. * ------------------------------------------------------------------------
  2494. * jQuery
  2495. * ------------------------------------------------------------------------
  2496. */
  2497. $.fn[NAME$1] = Button._jQueryInterface;
  2498. $.fn[NAME$1].Constructor = Button;
  2499. $.fn[NAME$1].noConflict = function () {
  2500. $.fn[NAME$1] = JQUERY_NO_CONFLICT$1;
  2501. return Button._jQueryInterface;
  2502. };
  2503. /**
  2504. * ------------------------------------------------------------------------
  2505. * Constants
  2506. * ------------------------------------------------------------------------
  2507. */
  2508. var NAME$2 = 'carousel';
  2509. var VERSION$2 = '4.5.0';
  2510. var DATA_KEY$2 = 'bs.carousel';
  2511. var EVENT_KEY$2 = "." + DATA_KEY$2;
  2512. var DATA_API_KEY$2 = '.data-api';
  2513. var JQUERY_NO_CONFLICT$2 = $.fn[NAME$2];
  2514. var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
  2515. var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
  2516. var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
  2517. var SWIPE_THRESHOLD = 40;
  2518. var Default = {
  2519. interval: 5000,
  2520. keyboard: true,
  2521. slide: false,
  2522. pause: 'hover',
  2523. wrap: true,
  2524. touch: true
  2525. };
  2526. var DefaultType = {
  2527. interval: '(number|boolean)',
  2528. keyboard: 'boolean',
  2529. slide: '(boolean|string)',
  2530. pause: '(string|boolean)',
  2531. wrap: 'boolean',
  2532. touch: 'boolean'
  2533. };
  2534. var DIRECTION_NEXT = 'next';
  2535. var DIRECTION_PREV = 'prev';
  2536. var DIRECTION_LEFT = 'left';
  2537. var DIRECTION_RIGHT = 'right';
  2538. var EVENT_SLIDE = "slide" + EVENT_KEY$2;
  2539. var EVENT_SLID = "slid" + EVENT_KEY$2;
  2540. var EVENT_KEYDOWN = "keydown" + EVENT_KEY$2;
  2541. var EVENT_MOUSEENTER = "mouseenter" + EVENT_KEY$2;
  2542. var EVENT_MOUSELEAVE = "mouseleave" + EVENT_KEY$2;
  2543. var EVENT_TOUCHSTART = "touchstart" + EVENT_KEY$2;
  2544. var EVENT_TOUCHMOVE = "touchmove" + EVENT_KEY$2;
  2545. var EVENT_TOUCHEND = "touchend" + EVENT_KEY$2;
  2546. var EVENT_POINTERDOWN = "pointerdown" + EVENT_KEY$2;
  2547. var EVENT_POINTERUP = "pointerup" + EVENT_KEY$2;
  2548. var EVENT_DRAG_START = "dragstart" + EVENT_KEY$2;
  2549. var EVENT_LOAD_DATA_API$1 = "load" + EVENT_KEY$2 + DATA_API_KEY$2;
  2550. var EVENT_CLICK_DATA_API$2 = "click" + EVENT_KEY$2 + DATA_API_KEY$2;
  2551. var CLASS_NAME_CAROUSEL = 'carousel';
  2552. var CLASS_NAME_ACTIVE$1 = 'active';
  2553. var CLASS_NAME_SLIDE = 'slide';
  2554. var CLASS_NAME_RIGHT = 'carousel-item-right';
  2555. var CLASS_NAME_LEFT = 'carousel-item-left';
  2556. var CLASS_NAME_NEXT = 'carousel-item-next';
  2557. var CLASS_NAME_PREV = 'carousel-item-prev';
  2558. var CLASS_NAME_POINTER_EVENT = 'pointer-event';
  2559. var SELECTOR_ACTIVE$1 = '.active';
  2560. var SELECTOR_ACTIVE_ITEM = '.active.carousel-item';
  2561. var SELECTOR_ITEM = '.carousel-item';
  2562. var SELECTOR_ITEM_IMG = '.carousel-item img';
  2563. var SELECTOR_NEXT_PREV = '.carousel-item-next, .carousel-item-prev';
  2564. var SELECTOR_INDICATORS = '.carousel-indicators';
  2565. var SELECTOR_DATA_SLIDE = '[data-slide], [data-slide-to]';
  2566. var SELECTOR_DATA_RIDE = '[data-ride="carousel"]';
  2567. var PointerType = {
  2568. TOUCH: 'touch',
  2569. PEN: 'pen'
  2570. };
  2571. /**
  2572. * ------------------------------------------------------------------------
  2573. * Class Definition
  2574. * ------------------------------------------------------------------------
  2575. */
  2576. var Carousel = /*#__PURE__*/function () {
  2577. function Carousel(element, config) {
  2578. this._items = null;
  2579. this._interval = null;
  2580. this._activeElement = null;
  2581. this._isPaused = false;
  2582. this._isSliding = false;
  2583. this.touchTimeout = null;
  2584. this.touchStartX = 0;
  2585. this.touchDeltaX = 0;
  2586. this._config = this._getConfig(config);
  2587. this._element = element;
  2588. this._indicatorsElement = this._element.querySelector(SELECTOR_INDICATORS);
  2589. this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
  2590. this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent);
  2591. this._addEventListeners();
  2592. } // Getters
  2593. var _proto = Carousel.prototype;
  2594. // Public
  2595. _proto.next = function next() {
  2596. if (!this._isSliding) {
  2597. this._slide(DIRECTION_NEXT);
  2598. }
  2599. };
  2600. _proto.nextWhenVisible = function nextWhenVisible() {
  2601. // Don't call next when the page isn't visible
  2602. // or the carousel or its parent isn't visible
  2603. if (!document.hidden && $(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden') {
  2604. this.next();
  2605. }
  2606. };
  2607. _proto.prev = function prev() {
  2608. if (!this._isSliding) {
  2609. this._slide(DIRECTION_PREV);
  2610. }
  2611. };
  2612. _proto.pause = function pause(event) {
  2613. if (!event) {
  2614. this._isPaused = true;
  2615. }
  2616. if (this._element.querySelector(SELECTOR_NEXT_PREV)) {
  2617. Util.triggerTransitionEnd(this._element);
  2618. this.cycle(true);
  2619. }
  2620. clearInterval(this._interval);
  2621. this._interval = null;
  2622. };
  2623. _proto.cycle = function cycle(event) {
  2624. if (!event) {
  2625. this._isPaused = false;
  2626. }
  2627. if (this._interval) {
  2628. clearInterval(this._interval);
  2629. this._interval = null;
  2630. }
  2631. if (this._config.interval && !this._isPaused) {
  2632. this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
  2633. }
  2634. };
  2635. _proto.to = function to(index) {
  2636. var _this = this;
  2637. this._activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM);
  2638. var activeIndex = this._getItemIndex(this._activeElement);
  2639. if (index > this._items.length - 1 || index < 0) {
  2640. return;
  2641. }
  2642. if (this._isSliding) {
  2643. $(this._element).one(EVENT_SLID, function () {
  2644. return _this.to(index);
  2645. });
  2646. return;
  2647. }
  2648. if (activeIndex === index) {
  2649. this.pause();
  2650. this.cycle();
  2651. return;
  2652. }
  2653. var direction = index > activeIndex ? DIRECTION_NEXT : DIRECTION_PREV;
  2654. this._slide(direction, this._items[index]);
  2655. };
  2656. _proto.dispose = function dispose() {
  2657. $(this._element).off(EVENT_KEY$2);
  2658. $.removeData(this._element, DATA_KEY$2);
  2659. this._items = null;
  2660. this._config = null;
  2661. this._element = null;
  2662. this._interval = null;
  2663. this._isPaused = null;
  2664. this._isSliding = null;
  2665. this._activeElement = null;
  2666. this._indicatorsElement = null;
  2667. } // Private
  2668. ;
  2669. _proto._getConfig = function _getConfig(config) {
  2670. config = _objectSpread2(_objectSpread2({}, Default), config);
  2671. Util.typeCheckConfig(NAME$2, config, DefaultType);
  2672. return config;
  2673. };
  2674. _proto._handleSwipe = function _handleSwipe() {
  2675. var absDeltax = Math.abs(this.touchDeltaX);
  2676. if (absDeltax <= SWIPE_THRESHOLD) {
  2677. return;
  2678. }
  2679. var direction = absDeltax / this.touchDeltaX;
  2680. this.touchDeltaX = 0; // swipe left
  2681. if (direction > 0) {
  2682. this.prev();
  2683. } // swipe right
  2684. if (direction < 0) {
  2685. this.next();
  2686. }
  2687. };
  2688. _proto._addEventListeners = function _addEventListeners() {
  2689. var _this2 = this;
  2690. if (this._config.keyboard) {
  2691. $(this._element).on(EVENT_KEYDOWN, function (event) {
  2692. return _this2._keydown(event);
  2693. });
  2694. }
  2695. if (this._config.pause === 'hover') {
  2696. $(this._element).on(EVENT_MOUSEENTER, function (event) {
  2697. return _this2.pause(event);
  2698. }).on(EVENT_MOUSELEAVE, function (event) {
  2699. return _this2.cycle(event);
  2700. });
  2701. }
  2702. if (this._config.touch) {
  2703. this._addTouchEventListeners();
  2704. }
  2705. };
  2706. _proto._addTouchEventListeners = function _addTouchEventListeners() {
  2707. var _this3 = this;
  2708. if (!this._touchSupported) {
  2709. return;
  2710. }
  2711. var start = function start(event) {
  2712. if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
  2713. _this3.touchStartX = event.originalEvent.clientX;
  2714. } else if (!_this3._pointerEvent) {
  2715. _this3.touchStartX = event.originalEvent.touches[0].clientX;
  2716. }
  2717. };
  2718. var move = function move(event) {
  2719. // ensure swiping with one touch and not pinching
  2720. if (event.originalEvent.touches && event.originalEvent.touches.length > 1) {
  2721. _this3.touchDeltaX = 0;
  2722. } else {
  2723. _this3.touchDeltaX = event.originalEvent.touches[0].clientX - _this3.touchStartX;
  2724. }
  2725. };
  2726. var end = function end(event) {
  2727. if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
  2728. _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX;
  2729. }
  2730. _this3._handleSwipe();
  2731. if (_this3._config.pause === 'hover') {
  2732. // If it's a touch-enabled device, mouseenter/leave are fired as
  2733. // part of the mouse compatibility events on first tap - the carousel
  2734. // would stop cycling until user tapped out of it;
  2735. // here, we listen for touchend, explicitly pause the carousel
  2736. // (as if it's the second time we tap on it, mouseenter compat event
  2737. // is NOT fired) and after a timeout (to allow for mouse compatibility
  2738. // events to fire) we explicitly restart cycling
  2739. _this3.pause();
  2740. if (_this3.touchTimeout) {
  2741. clearTimeout(_this3.touchTimeout);
  2742. }
  2743. _this3.touchTimeout = setTimeout(function (event) {
  2744. return _this3.cycle(event);
  2745. }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval);
  2746. }
  2747. };
  2748. $(this._element.querySelectorAll(SELECTOR_ITEM_IMG)).on(EVENT_DRAG_START, function (e) {
  2749. return e.preventDefault();
  2750. });
  2751. if (this._pointerEvent) {
  2752. $(this._element).on(EVENT_POINTERDOWN, function (event) {
  2753. return start(event);
  2754. });
  2755. $(this._element).on(EVENT_POINTERUP, function (event) {
  2756. return end(event);
  2757. });
  2758. this._element.classList.add(CLASS_NAME_POINTER_EVENT);
  2759. } else {
  2760. $(this._element).on(EVENT_TOUCHSTART, function (event) {
  2761. return start(event);
  2762. });
  2763. $(this._element).on(EVENT_TOUCHMOVE, function (event) {
  2764. return move(event);
  2765. });
  2766. $(this._element).on(EVENT_TOUCHEND, function (event) {
  2767. return end(event);
  2768. });
  2769. }
  2770. };
  2771. _proto._keydown = function _keydown(event) {
  2772. if (/input|textarea/i.test(event.target.tagName)) {
  2773. return;
  2774. }
  2775. switch (event.which) {
  2776. case ARROW_LEFT_KEYCODE:
  2777. event.preventDefault();
  2778. this.prev();
  2779. break;
  2780. case ARROW_RIGHT_KEYCODE:
  2781. event.preventDefault();
  2782. this.next();
  2783. break;
  2784. }
  2785. };
  2786. _proto._getItemIndex = function _getItemIndex(element) {
  2787. this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(SELECTOR_ITEM)) : [];
  2788. return this._items.indexOf(element);
  2789. };
  2790. _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
  2791. var isNextDirection = direction === DIRECTION_NEXT;
  2792. var isPrevDirection = direction === DIRECTION_PREV;
  2793. var activeIndex = this._getItemIndex(activeElement);
  2794. var lastItemIndex = this._items.length - 1;
  2795. var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
  2796. if (isGoingToWrap && !this._config.wrap) {
  2797. return activeElement;
  2798. }
  2799. var delta = direction === DIRECTION_PREV ? -1 : 1;
  2800. var itemIndex = (activeIndex + delta) % this._items.length;
  2801. return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
  2802. };
  2803. _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
  2804. var targetIndex = this._getItemIndex(relatedTarget);
  2805. var fromIndex = this._getItemIndex(this._element.querySelector(SELECTOR_ACTIVE_ITEM));
  2806. var slideEvent = $.Event(EVENT_SLIDE, {
  2807. relatedTarget: relatedTarget,
  2808. direction: eventDirectionName,
  2809. from: fromIndex,
  2810. to: targetIndex
  2811. });
  2812. $(this._element).trigger(slideEvent);
  2813. return slideEvent;
  2814. };
  2815. _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
  2816. if (this._indicatorsElement) {
  2817. var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(SELECTOR_ACTIVE$1));
  2818. $(indicators).removeClass(CLASS_NAME_ACTIVE$1);
  2819. var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
  2820. if (nextIndicator) {
  2821. $(nextIndicator).addClass(CLASS_NAME_ACTIVE$1);
  2822. }
  2823. }
  2824. };
  2825. _proto._slide = function _slide(direction, element) {
  2826. var _this4 = this;
  2827. var activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM);
  2828. var activeElementIndex = this._getItemIndex(activeElement);
  2829. var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
  2830. var nextElementIndex = this._getItemIndex(nextElement);
  2831. var isCycling = Boolean(this._interval);
  2832. var directionalClassName;
  2833. var orderClassName;
  2834. var eventDirectionName;
  2835. if (direction === DIRECTION_NEXT) {
  2836. directionalClassName = CLASS_NAME_LEFT;
  2837. orderClassName = CLASS_NAME_NEXT;
  2838. eventDirectionName = DIRECTION_LEFT;
  2839. } else {
  2840. directionalClassName = CLASS_NAME_RIGHT;
  2841. orderClassName = CLASS_NAME_PREV;
  2842. eventDirectionName = DIRECTION_RIGHT;
  2843. }
  2844. if (nextElement && $(nextElement).hasClass(CLASS_NAME_ACTIVE$1)) {
  2845. this._isSliding = false;
  2846. return;
  2847. }
  2848. var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
  2849. if (slideEvent.isDefaultPrevented()) {
  2850. return;
  2851. }
  2852. if (!activeElement || !nextElement) {
  2853. // Some weirdness is happening, so we bail
  2854. return;
  2855. }
  2856. this._isSliding = true;
  2857. if (isCycling) {
  2858. this.pause();
  2859. }
  2860. this._setActiveIndicatorElement(nextElement);
  2861. var slidEvent = $.Event(EVENT_SLID, {
  2862. relatedTarget: nextElement,
  2863. direction: eventDirectionName,
  2864. from: activeElementIndex,
  2865. to: nextElementIndex
  2866. });
  2867. if ($(this._element).hasClass(CLASS_NAME_SLIDE)) {
  2868. $(nextElement).addClass(orderClassName);
  2869. Util.reflow(nextElement);
  2870. $(activeElement).addClass(directionalClassName);
  2871. $(nextElement).addClass(directionalClassName);
  2872. var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10);
  2873. if (nextElementInterval) {
  2874. this._config.defaultInterval = this._config.defaultInterval || this._config.interval;
  2875. this._config.interval = nextElementInterval;
  2876. } else {
  2877. this._config.interval = this._config.defaultInterval || this._config.interval;
  2878. }
  2879. var transitionDuration = Util.getTransitionDurationFromElement(activeElement);
  2880. $(activeElement).one(Util.TRANSITION_END, function () {
  2881. $(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(CLASS_NAME_ACTIVE$1);
  2882. $(activeElement).removeClass(CLASS_NAME_ACTIVE$1 + " " + orderClassName + " " + directionalClassName);
  2883. _this4._isSliding = false;
  2884. setTimeout(function () {
  2885. return $(_this4._element).trigger(slidEvent);
  2886. }, 0);
  2887. }).emulateTransitionEnd(transitionDuration);
  2888. } else {
  2889. $(activeElement).removeClass(CLASS_NAME_ACTIVE$1);
  2890. $(nextElement).addClass(CLASS_NAME_ACTIVE$1);
  2891. this._isSliding = false;
  2892. $(this._element).trigger(slidEvent);
  2893. }
  2894. if (isCycling) {
  2895. this.cycle();
  2896. }
  2897. } // Static
  2898. ;
  2899. Carousel._jQueryInterface = function _jQueryInterface(config) {
  2900. return this.each(function () {
  2901. var data = $(this).data(DATA_KEY$2);
  2902. var _config = _objectSpread2(_objectSpread2({}, Default), $(this).data());
  2903. if (typeof config === 'object') {
  2904. _config = _objectSpread2(_objectSpread2({}, _config), config);
  2905. }
  2906. var action = typeof config === 'string' ? config : _config.slide;
  2907. if (!data) {
  2908. data = new Carousel(this, _config);
  2909. $(this).data(DATA_KEY$2, data);
  2910. }
  2911. if (typeof config === 'number') {
  2912. data.to(config);
  2913. } else if (typeof action === 'string') {
  2914. if (typeof data[action] === 'undefined') {
  2915. throw new TypeError("No method named \"" + action + "\"");
  2916. }
  2917. data[action]();
  2918. } else if (_config.interval && _config.ride) {
  2919. data.pause();
  2920. data.cycle();
  2921. }
  2922. });
  2923. };
  2924. Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {
  2925. var selector = Util.getSelectorFromElement(this);
  2926. if (!selector) {
  2927. return;
  2928. }
  2929. var target = $(selector)[0];
  2930. if (!target || !$(target).hasClass(CLASS_NAME_CAROUSEL)) {
  2931. return;
  2932. }
  2933. var config = _objectSpread2(_objectSpread2({}, $(target).data()), $(this).data());
  2934. var slideIndex = this.getAttribute('data-slide-to');
  2935. if (slideIndex) {
  2936. config.interval = false;
  2937. }
  2938. Carousel._jQueryInterface.call($(target), config);
  2939. if (slideIndex) {
  2940. $(target).data(DATA_KEY$2).to(slideIndex);
  2941. }
  2942. event.preventDefault();
  2943. };
  2944. _createClass(Carousel, null, [{
  2945. key: "VERSION",
  2946. get: function get() {
  2947. return VERSION$2;
  2948. }
  2949. }, {
  2950. key: "Default",
  2951. get: function get() {
  2952. return Default;
  2953. }
  2954. }]);
  2955. return Carousel;
  2956. }();
  2957. /**
  2958. * ------------------------------------------------------------------------
  2959. * Data Api implementation
  2960. * ------------------------------------------------------------------------
  2961. */
  2962. $(document).on(EVENT_CLICK_DATA_API$2, SELECTOR_DATA_SLIDE, Carousel._dataApiClickHandler);
  2963. $(window).on(EVENT_LOAD_DATA_API$1, function () {
  2964. var carousels = [].slice.call(document.querySelectorAll(SELECTOR_DATA_RIDE));
  2965. for (var i = 0, len = carousels.length; i < len; i++) {
  2966. var $carousel = $(carousels[i]);
  2967. Carousel._jQueryInterface.call($carousel, $carousel.data());
  2968. }
  2969. });
  2970. /**
  2971. * ------------------------------------------------------------------------
  2972. * jQuery
  2973. * ------------------------------------------------------------------------
  2974. */
  2975. $.fn[NAME$2] = Carousel._jQueryInterface;
  2976. $.fn[NAME$2].Constructor = Carousel;
  2977. $.fn[NAME$2].noConflict = function () {
  2978. $.fn[NAME$2] = JQUERY_NO_CONFLICT$2;
  2979. return Carousel._jQueryInterface;
  2980. };
  2981. /**
  2982. * ------------------------------------------------------------------------
  2983. * Constants
  2984. * ------------------------------------------------------------------------
  2985. */
  2986. var NAME$3 = 'collapse';
  2987. var VERSION$3 = '4.5.0';
  2988. var DATA_KEY$3 = 'bs.collapse';
  2989. var EVENT_KEY$3 = "." + DATA_KEY$3;
  2990. var DATA_API_KEY$3 = '.data-api';
  2991. var JQUERY_NO_CONFLICT$3 = $.fn[NAME$3];
  2992. var Default$1 = {
  2993. toggle: true,
  2994. parent: ''
  2995. };
  2996. var DefaultType$1 = {
  2997. toggle: 'boolean',
  2998. parent: '(string|element)'
  2999. };
  3000. var EVENT_SHOW = "show" + EVENT_KEY$3;
  3001. var EVENT_SHOWN = "shown" + EVENT_KEY$3;
  3002. var EVENT_HIDE = "hide" + EVENT_KEY$3;
  3003. var EVENT_HIDDEN = "hidden" + EVENT_KEY$3;
  3004. var EVENT_CLICK_DATA_API$3 = "click" + EVENT_KEY$3 + DATA_API_KEY$3;
  3005. var CLASS_NAME_SHOW$1 = 'show';
  3006. var CLASS_NAME_COLLAPSE = 'collapse';
  3007. var CLASS_NAME_COLLAPSING = 'collapsing';
  3008. var CLASS_NAME_COLLAPSED = 'collapsed';
  3009. var DIMENSION_WIDTH = 'width';
  3010. var DIMENSION_HEIGHT = 'height';
  3011. var SELECTOR_ACTIVES = '.show, .collapsing';
  3012. var SELECTOR_DATA_TOGGLE$1 = '[data-toggle="collapse"]';
  3013. /**
  3014. * ------------------------------------------------------------------------
  3015. * Class Definition
  3016. * ------------------------------------------------------------------------
  3017. */
  3018. var Collapse = /*#__PURE__*/function () {
  3019. function Collapse(element, config) {
  3020. this._isTransitioning = false;
  3021. this._element = element;
  3022. this._config = this._getConfig(config);
  3023. this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]")));
  3024. var toggleList = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$1));
  3025. for (var i = 0, len = toggleList.length; i < len; i++) {
  3026. var elem = toggleList[i];
  3027. var selector = Util.getSelectorFromElement(elem);
  3028. var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) {
  3029. return foundElem === element;
  3030. });
  3031. if (selector !== null && filterElement.length > 0) {
  3032. this._selector = selector;
  3033. this._triggerArray.push(elem);
  3034. }
  3035. }
  3036. this._parent = this._config.parent ? this._getParent() : null;
  3037. if (!this._config.parent) {
  3038. this._addAriaAndCollapsedClass(this._element, this._triggerArray);
  3039. }
  3040. if (this._config.toggle) {
  3041. this.toggle();
  3042. }
  3043. } // Getters
  3044. var _proto = Collapse.prototype;
  3045. // Public
  3046. _proto.toggle = function toggle() {
  3047. if ($(this._element).hasClass(CLASS_NAME_SHOW$1)) {
  3048. this.hide();
  3049. } else {
  3050. this.show();
  3051. }
  3052. };
  3053. _proto.show = function show() {
  3054. var _this = this;
  3055. if (this._isTransitioning || $(this._element).hasClass(CLASS_NAME_SHOW$1)) {
  3056. return;
  3057. }
  3058. var actives;
  3059. var activesData;
  3060. if (this._parent) {
  3061. actives = [].slice.call(this._parent.querySelectorAll(SELECTOR_ACTIVES)).filter(function (elem) {
  3062. if (typeof _this._config.parent === 'string') {
  3063. return elem.getAttribute('data-parent') === _this._config.parent;
  3064. }
  3065. return elem.classList.contains(CLASS_NAME_COLLAPSE);
  3066. });
  3067. if (actives.length === 0) {
  3068. actives = null;
  3069. }
  3070. }
  3071. if (actives) {
  3072. activesData = $(actives).not(this._selector).data(DATA_KEY$3);
  3073. if (activesData && activesData._isTransitioning) {
  3074. return;
  3075. }
  3076. }
  3077. var startEvent = $.Event(EVENT_SHOW);
  3078. $(this._element).trigger(startEvent);
  3079. if (startEvent.isDefaultPrevented()) {
  3080. return;
  3081. }
  3082. if (actives) {
  3083. Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide');
  3084. if (!activesData) {
  3085. $(actives).data(DATA_KEY$3, null);
  3086. }
  3087. }
  3088. var dimension = this._getDimension();
  3089. $(this._element).removeClass(CLASS_NAME_COLLAPSE).addClass(CLASS_NAME_COLLAPSING);
  3090. this._element.style[dimension] = 0;
  3091. if (this._triggerArray.length) {
  3092. $(this._triggerArray).removeClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', true);
  3093. }
  3094. this.setTransitioning(true);
  3095. var complete = function complete() {
  3096. $(_this._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW$1);
  3097. _this._element.style[dimension] = '';
  3098. _this.setTransitioning(false);
  3099. $(_this._element).trigger(EVENT_SHOWN);
  3100. };
  3101. var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
  3102. var scrollSize = "scroll" + capitalizedDimension;
  3103. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  3104. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  3105. this._element.style[dimension] = this._element[scrollSize] + "px";
  3106. };
  3107. _proto.hide = function hide() {
  3108. var _this2 = this;
  3109. if (this._isTransitioning || !$(this._element).hasClass(CLASS_NAME_SHOW$1)) {
  3110. return;
  3111. }
  3112. var startEvent = $.Event(EVENT_HIDE);
  3113. $(this._element).trigger(startEvent);
  3114. if (startEvent.isDefaultPrevented()) {
  3115. return;
  3116. }
  3117. var dimension = this._getDimension();
  3118. this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";
  3119. Util.reflow(this._element);
  3120. $(this._element).addClass(CLASS_NAME_COLLAPSING).removeClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW$1);
  3121. var triggerArrayLength = this._triggerArray.length;
  3122. if (triggerArrayLength > 0) {
  3123. for (var i = 0; i < triggerArrayLength; i++) {
  3124. var trigger = this._triggerArray[i];
  3125. var selector = Util.getSelectorFromElement(trigger);
  3126. if (selector !== null) {
  3127. var $elem = $([].slice.call(document.querySelectorAll(selector)));
  3128. if (!$elem.hasClass(CLASS_NAME_SHOW$1)) {
  3129. $(trigger).addClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', false);
  3130. }
  3131. }
  3132. }
  3133. }
  3134. this.setTransitioning(true);
  3135. var complete = function complete() {
  3136. _this2.setTransitioning(false);
  3137. $(_this2._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE).trigger(EVENT_HIDDEN);
  3138. };
  3139. this._element.style[dimension] = '';
  3140. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  3141. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  3142. };
  3143. _proto.setTransitioning = function setTransitioning(isTransitioning) {
  3144. this._isTransitioning = isTransitioning;
  3145. };
  3146. _proto.dispose = function dispose() {
  3147. $.removeData(this._element, DATA_KEY$3);
  3148. this._config = null;
  3149. this._parent = null;
  3150. this._element = null;
  3151. this._triggerArray = null;
  3152. this._isTransitioning = null;
  3153. } // Private
  3154. ;
  3155. _proto._getConfig = function _getConfig(config) {
  3156. config = _objectSpread2(_objectSpread2({}, Default$1), config);
  3157. config.toggle = Boolean(config.toggle); // Coerce string values
  3158. Util.typeCheckConfig(NAME$3, config, DefaultType$1);
  3159. return config;
  3160. };
  3161. _proto._getDimension = function _getDimension() {
  3162. var hasWidth = $(this._element).hasClass(DIMENSION_WIDTH);
  3163. return hasWidth ? DIMENSION_WIDTH : DIMENSION_HEIGHT;
  3164. };
  3165. _proto._getParent = function _getParent() {
  3166. var _this3 = this;
  3167. var parent;
  3168. if (Util.isElement(this._config.parent)) {
  3169. parent = this._config.parent; // It's a jQuery object
  3170. if (typeof this._config.parent.jquery !== 'undefined') {
  3171. parent = this._config.parent[0];
  3172. }
  3173. } else {
  3174. parent = document.querySelector(this._config.parent);
  3175. }
  3176. var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]";
  3177. var children = [].slice.call(parent.querySelectorAll(selector));
  3178. $(children).each(function (i, element) {
  3179. _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
  3180. });
  3181. return parent;
  3182. };
  3183. _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
  3184. var isOpen = $(element).hasClass(CLASS_NAME_SHOW$1);
  3185. if (triggerArray.length) {
  3186. $(triggerArray).toggleClass(CLASS_NAME_COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
  3187. }
  3188. } // Static
  3189. ;
  3190. Collapse._getTargetFromElement = function _getTargetFromElement(element) {
  3191. var selector = Util.getSelectorFromElement(element);
  3192. return selector ? document.querySelector(selector) : null;
  3193. };
  3194. Collapse._jQueryInterface = function _jQueryInterface(config) {
  3195. return this.each(function () {
  3196. var $this = $(this);
  3197. var data = $this.data(DATA_KEY$3);
  3198. var _config = _objectSpread2(_objectSpread2(_objectSpread2({}, Default$1), $this.data()), typeof config === 'object' && config ? config : {});
  3199. if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) {
  3200. _config.toggle = false;
  3201. }
  3202. if (!data) {
  3203. data = new Collapse(this, _config);
  3204. $this.data(DATA_KEY$3, data);
  3205. }
  3206. if (typeof config === 'string') {
  3207. if (typeof data[config] === 'undefined') {
  3208. throw new TypeError("No method named \"" + config + "\"");
  3209. }
  3210. data[config]();
  3211. }
  3212. });
  3213. };
  3214. _createClass(Collapse, null, [{
  3215. key: "VERSION",
  3216. get: function get() {
  3217. return VERSION$3;
  3218. }
  3219. }, {
  3220. key: "Default",
  3221. get: function get() {
  3222. return Default$1;
  3223. }
  3224. }]);
  3225. return Collapse;
  3226. }();
  3227. /**
  3228. * ------------------------------------------------------------------------
  3229. * Data Api implementation
  3230. * ------------------------------------------------------------------------
  3231. */
  3232. $(document).on(EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$1, function (event) {
  3233. // preventDefault only for <a> elements (which change the URL) not inside the collapsible element
  3234. if (event.currentTarget.tagName === 'A') {
  3235. event.preventDefault();
  3236. }
  3237. var $trigger = $(this);
  3238. var selector = Util.getSelectorFromElement(this);
  3239. var selectors = [].slice.call(document.querySelectorAll(selector));
  3240. $(selectors).each(function () {
  3241. var $target = $(this);
  3242. var data = $target.data(DATA_KEY$3);
  3243. var config = data ? 'toggle' : $trigger.data();
  3244. Collapse._jQueryInterface.call($target, config);
  3245. });
  3246. });
  3247. /**
  3248. * ------------------------------------------------------------------------
  3249. * jQuery
  3250. * ------------------------------------------------------------------------
  3251. */
  3252. $.fn[NAME$3] = Collapse._jQueryInterface;
  3253. $.fn[NAME$3].Constructor = Collapse;
  3254. $.fn[NAME$3].noConflict = function () {
  3255. $.fn[NAME$3] = JQUERY_NO_CONFLICT$3;
  3256. return Collapse._jQueryInterface;
  3257. };
  3258. /**
  3259. * ------------------------------------------------------------------------
  3260. * Constants
  3261. * ------------------------------------------------------------------------
  3262. */
  3263. var NAME$4 = 'dropdown';
  3264. var VERSION$4 = '4.5.0';
  3265. var DATA_KEY$4 = 'bs.dropdown';
  3266. var EVENT_KEY$4 = "." + DATA_KEY$4;
  3267. var DATA_API_KEY$4 = '.data-api';
  3268. var JQUERY_NO_CONFLICT$4 = $.fn[NAME$4];
  3269. var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
  3270. var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key
  3271. var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key
  3272. var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key
  3273. var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key
  3274. var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)
  3275. var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE);
  3276. var EVENT_HIDE$1 = "hide" + EVENT_KEY$4;
  3277. var EVENT_HIDDEN$1 = "hidden" + EVENT_KEY$4;
  3278. var EVENT_SHOW$1 = "show" + EVENT_KEY$4;
  3279. var EVENT_SHOWN$1 = "shown" + EVENT_KEY$4;
  3280. var EVENT_CLICK = "click" + EVENT_KEY$4;
  3281. var EVENT_CLICK_DATA_API$4 = "click" + EVENT_KEY$4 + DATA_API_KEY$4;
  3282. var EVENT_KEYDOWN_DATA_API = "keydown" + EVENT_KEY$4 + DATA_API_KEY$4;
  3283. var EVENT_KEYUP_DATA_API = "keyup" + EVENT_KEY$4 + DATA_API_KEY$4;
  3284. var CLASS_NAME_DISABLED = 'disabled';
  3285. var CLASS_NAME_SHOW$2 = 'show';
  3286. var CLASS_NAME_DROPUP = 'dropup';
  3287. var CLASS_NAME_DROPRIGHT = 'dropright';
  3288. var CLASS_NAME_DROPLEFT = 'dropleft';
  3289. var CLASS_NAME_MENURIGHT = 'dropdown-menu-right';
  3290. var CLASS_NAME_POSITION_STATIC = 'position-static';
  3291. var SELECTOR_DATA_TOGGLE$2 = '[data-toggle="dropdown"]';
  3292. var SELECTOR_FORM_CHILD = '.dropdown form';
  3293. var SELECTOR_MENU = '.dropdown-menu';
  3294. var SELECTOR_NAVBAR_NAV = '.navbar-nav';
  3295. var SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)';
  3296. var PLACEMENT_TOP = 'top-start';
  3297. var PLACEMENT_TOPEND = 'top-end';
  3298. var PLACEMENT_BOTTOM = 'bottom-start';
  3299. var PLACEMENT_BOTTOMEND = 'bottom-end';
  3300. var PLACEMENT_RIGHT = 'right-start';
  3301. var PLACEMENT_LEFT = 'left-start';
  3302. var Default$2 = {
  3303. offset: 0,
  3304. flip: true,
  3305. boundary: 'scrollParent',
  3306. reference: 'toggle',
  3307. display: 'dynamic',
  3308. popperConfig: null
  3309. };
  3310. var DefaultType$2 = {
  3311. offset: '(number|string|function)',
  3312. flip: 'boolean',
  3313. boundary: '(string|element)',
  3314. reference: '(string|element)',
  3315. display: 'string',
  3316. popperConfig: '(null|object)'
  3317. };
  3318. /**
  3319. * ------------------------------------------------------------------------
  3320. * Class Definition
  3321. * ------------------------------------------------------------------------
  3322. */
  3323. var Dropdown = /*#__PURE__*/function () {
  3324. function Dropdown(element, config) {
  3325. this._element = element;
  3326. this._popper = null;
  3327. this._config = this._getConfig(config);
  3328. this._menu = this._getMenuElement();
  3329. this._inNavbar = this._detectNavbar();
  3330. this._addEventListeners();
  3331. } // Getters
  3332. var _proto = Dropdown.prototype;
  3333. // Public
  3334. _proto.toggle = function toggle() {
  3335. if (this._element.disabled || $(this._element).hasClass(CLASS_NAME_DISABLED)) {
  3336. return;
  3337. }
  3338. var isActive = $(this._menu).hasClass(CLASS_NAME_SHOW$2);
  3339. Dropdown._clearMenus();
  3340. if (isActive) {
  3341. return;
  3342. }
  3343. this.show(true);
  3344. };
  3345. _proto.show = function show(usePopper) {
  3346. if (usePopper === void 0) {
  3347. usePopper = false;
  3348. }
  3349. if (this._element.disabled || $(this._element).hasClass(CLASS_NAME_DISABLED) || $(this._menu).hasClass(CLASS_NAME_SHOW$2)) {
  3350. return;
  3351. }
  3352. var relatedTarget = {
  3353. relatedTarget: this._element
  3354. };
  3355. var showEvent = $.Event(EVENT_SHOW$1, relatedTarget);
  3356. var parent = Dropdown._getParentFromElement(this._element);
  3357. $(parent).trigger(showEvent);
  3358. if (showEvent.isDefaultPrevented()) {
  3359. return;
  3360. } // Disable totally Popper.js for Dropdown in Navbar
  3361. if (!this._inNavbar && usePopper) {
  3362. /**
  3363. * Check for Popper dependency
  3364. * Popper - https://popper.js.org
  3365. */
  3366. if (typeof Popper === 'undefined') {
  3367. throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org/)');
  3368. }
  3369. var referenceElement = this._element;
  3370. if (this._config.reference === 'parent') {
  3371. referenceElement = parent;
  3372. } else if (Util.isElement(this._config.reference)) {
  3373. referenceElement = this._config.reference; // Check if it's jQuery element
  3374. if (typeof this._config.reference.jquery !== 'undefined') {
  3375. referenceElement = this._config.reference[0];
  3376. }
  3377. } // If boundary is not `scrollParent`, then set position to `static`
  3378. // to allow the menu to "escape" the scroll parent's boundaries
  3379. // https://github.com/twbs/bootstrap/issues/24251
  3380. if (this._config.boundary !== 'scrollParent') {
  3381. $(parent).addClass(CLASS_NAME_POSITION_STATIC);
  3382. }
  3383. this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig());
  3384. } // If this is a touch-enabled device we add extra
  3385. // empty mouseover listeners to the body's immediate children;
  3386. // only needed because of broken event delegation on iOS
  3387. // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
  3388. if ('ontouchstart' in document.documentElement && $(parent).closest(SELECTOR_NAVBAR_NAV).length === 0) {
  3389. $(document.body).children().on('mouseover', null, $.noop);
  3390. }
  3391. this._element.focus();
  3392. this._element.setAttribute('aria-expanded', true);
  3393. $(this._menu).toggleClass(CLASS_NAME_SHOW$2);
  3394. $(parent).toggleClass(CLASS_NAME_SHOW$2).trigger($.Event(EVENT_SHOWN$1, relatedTarget));
  3395. };
  3396. _proto.hide = function hide() {
  3397. if (this._element.disabled || $(this._element).hasClass(CLASS_NAME_DISABLED) || !$(this._menu).hasClass(CLASS_NAME_SHOW$2)) {
  3398. return;
  3399. }
  3400. var relatedTarget = {
  3401. relatedTarget: this._element
  3402. };
  3403. var hideEvent = $.Event(EVENT_HIDE$1, relatedTarget);
  3404. var parent = Dropdown._getParentFromElement(this._element);
  3405. $(parent).trigger(hideEvent);
  3406. if (hideEvent.isDefaultPrevented()) {
  3407. return;
  3408. }
  3409. if (this._popper) {
  3410. this._popper.destroy();
  3411. }
  3412. $(this._menu).toggleClass(CLASS_NAME_SHOW$2);
  3413. $(parent).toggleClass(CLASS_NAME_SHOW$2).trigger($.Event(EVENT_HIDDEN$1, relatedTarget));
  3414. };
  3415. _proto.dispose = function dispose() {
  3416. $.removeData(this._element, DATA_KEY$4);
  3417. $(this._element).off(EVENT_KEY$4);
  3418. this._element = null;
  3419. this._menu = null;
  3420. if (this._popper !== null) {
  3421. this._popper.destroy();
  3422. this._popper = null;
  3423. }
  3424. };
  3425. _proto.update = function update() {
  3426. this._inNavbar = this._detectNavbar();
  3427. if (this._popper !== null) {
  3428. this._popper.scheduleUpdate();
  3429. }
  3430. } // Private
  3431. ;
  3432. _proto._addEventListeners = function _addEventListeners() {
  3433. var _this = this;
  3434. $(this._element).on(EVENT_CLICK, function (event) {
  3435. event.preventDefault();
  3436. event.stopPropagation();
  3437. _this.toggle();
  3438. });
  3439. };
  3440. _proto._getConfig = function _getConfig(config) {
  3441. config = _objectSpread2(_objectSpread2(_objectSpread2({}, this.constructor.Default), $(this._element).data()), config);
  3442. Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType);
  3443. return config;
  3444. };
  3445. _proto._getMenuElement = function _getMenuElement() {
  3446. if (!this._menu) {
  3447. var parent = Dropdown._getParentFromElement(this._element);
  3448. if (parent) {
  3449. this._menu = parent.querySelector(SELECTOR_MENU);
  3450. }
  3451. }
  3452. return this._menu;
  3453. };
  3454. _proto._getPlacement = function _getPlacement() {
  3455. var $parentDropdown = $(this._element.parentNode);
  3456. var placement = PLACEMENT_BOTTOM; // Handle dropup
  3457. if ($parentDropdown.hasClass(CLASS_NAME_DROPUP)) {
  3458. placement = $(this._menu).hasClass(CLASS_NAME_MENURIGHT) ? PLACEMENT_TOPEND : PLACEMENT_TOP;
  3459. } else if ($parentDropdown.hasClass(CLASS_NAME_DROPRIGHT)) {
  3460. placement = PLACEMENT_RIGHT;
  3461. } else if ($parentDropdown.hasClass(CLASS_NAME_DROPLEFT)) {
  3462. placement = PLACEMENT_LEFT;
  3463. } else if ($(this._menu).hasClass(CLASS_NAME_MENURIGHT)) {
  3464. placement = PLACEMENT_BOTTOMEND;
  3465. }
  3466. return placement;
  3467. };
  3468. _proto._detectNavbar = function _detectNavbar() {
  3469. return $(this._element).closest('.navbar').length > 0;
  3470. };
  3471. _proto._getOffset = function _getOffset() {
  3472. var _this2 = this;
  3473. var offset = {};
  3474. if (typeof this._config.offset === 'function') {
  3475. offset.fn = function (data) {
  3476. data.offsets = _objectSpread2(_objectSpread2({}, data.offsets), _this2._config.offset(data.offsets, _this2._element) || {});
  3477. return data;
  3478. };
  3479. } else {
  3480. offset.offset = this._config.offset;
  3481. }
  3482. return offset;
  3483. };
  3484. _proto._getPopperConfig = function _getPopperConfig() {
  3485. var popperConfig = {
  3486. placement: this._getPlacement(),
  3487. modifiers: {
  3488. offset: this._getOffset(),
  3489. flip: {
  3490. enabled: this._config.flip
  3491. },
  3492. preventOverflow: {
  3493. boundariesElement: this._config.boundary
  3494. }
  3495. }
  3496. }; // Disable Popper.js if we have a static display
  3497. if (this._config.display === 'static') {
  3498. popperConfig.modifiers.applyStyle = {
  3499. enabled: false
  3500. };
  3501. }
  3502. return _objectSpread2(_objectSpread2({}, popperConfig), this._config.popperConfig);
  3503. } // Static
  3504. ;
  3505. Dropdown._jQueryInterface = function _jQueryInterface(config) {
  3506. return this.each(function () {
  3507. var data = $(this).data(DATA_KEY$4);
  3508. var _config = typeof config === 'object' ? config : null;
  3509. if (!data) {
  3510. data = new Dropdown(this, _config);
  3511. $(this).data(DATA_KEY$4, data);
  3512. }
  3513. if (typeof config === 'string') {
  3514. if (typeof data[config] === 'undefined') {
  3515. throw new TypeError("No method named \"" + config + "\"");
  3516. }
  3517. data[config]();
  3518. }
  3519. });
  3520. };
  3521. Dropdown._clearMenus = function _clearMenus(event) {
  3522. if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {
  3523. return;
  3524. }
  3525. var toggles = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$2));
  3526. for (var i = 0, len = toggles.length; i < len; i++) {
  3527. var parent = Dropdown._getParentFromElement(toggles[i]);
  3528. var context = $(toggles[i]).data(DATA_KEY$4);
  3529. var relatedTarget = {
  3530. relatedTarget: toggles[i]
  3531. };
  3532. if (event && event.type === 'click') {
  3533. relatedTarget.clickEvent = event;
  3534. }
  3535. if (!context) {
  3536. continue;
  3537. }
  3538. var dropdownMenu = context._menu;
  3539. if (!$(parent).hasClass(CLASS_NAME_SHOW$2)) {
  3540. continue;
  3541. }
  3542. if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $.contains(parent, event.target)) {
  3543. continue;
  3544. }
  3545. var hideEvent = $.Event(EVENT_HIDE$1, relatedTarget);
  3546. $(parent).trigger(hideEvent);
  3547. if (hideEvent.isDefaultPrevented()) {
  3548. continue;
  3549. } // If this is a touch-enabled device we remove the extra
  3550. // empty mouseover listeners we added for iOS support
  3551. if ('ontouchstart' in document.documentElement) {
  3552. $(document.body).children().off('mouseover', null, $.noop);
  3553. }
  3554. toggles[i].setAttribute('aria-expanded', 'false');
  3555. if (context._popper) {
  3556. context._popper.destroy();
  3557. }
  3558. $(dropdownMenu).removeClass(CLASS_NAME_SHOW$2);
  3559. $(parent).removeClass(CLASS_NAME_SHOW$2).trigger($.Event(EVENT_HIDDEN$1, relatedTarget));
  3560. }
  3561. };
  3562. Dropdown._getParentFromElement = function _getParentFromElement(element) {
  3563. var parent;
  3564. var selector = Util.getSelectorFromElement(element);
  3565. if (selector) {
  3566. parent = document.querySelector(selector);
  3567. }
  3568. return parent || element.parentNode;
  3569. } // eslint-disable-next-line complexity
  3570. ;
  3571. Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
  3572. // If not input/textarea:
  3573. // - And not a key in REGEXP_KEYDOWN => not a dropdown command
  3574. // If input/textarea:
  3575. // - If space key => not a dropdown command
  3576. // - If key is other than escape
  3577. // - If key is not up or down => not a dropdown command
  3578. // - If trigger inside the menu => not a dropdown command
  3579. if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $(event.target).closest(SELECTOR_MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {
  3580. return;
  3581. }
  3582. if (this.disabled || $(this).hasClass(CLASS_NAME_DISABLED)) {
  3583. return;
  3584. }
  3585. var parent = Dropdown._getParentFromElement(this);
  3586. var isActive = $(parent).hasClass(CLASS_NAME_SHOW$2);
  3587. if (!isActive && event.which === ESCAPE_KEYCODE) {
  3588. return;
  3589. }
  3590. event.preventDefault();
  3591. event.stopPropagation();
  3592. if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
  3593. if (event.which === ESCAPE_KEYCODE) {
  3594. $(parent.querySelector(SELECTOR_DATA_TOGGLE$2)).trigger('focus');
  3595. }
  3596. $(this).trigger('click');
  3597. return;
  3598. }
  3599. var items = [].slice.call(parent.querySelectorAll(SELECTOR_VISIBLE_ITEMS)).filter(function (item) {
  3600. return $(item).is(':visible');
  3601. });
  3602. if (items.length === 0) {
  3603. return;
  3604. }
  3605. var index = items.indexOf(event.target);
  3606. if (event.which === ARROW_UP_KEYCODE && index > 0) {
  3607. // Up
  3608. index--;
  3609. }
  3610. if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
  3611. // Down
  3612. index++;
  3613. }
  3614. if (index < 0) {
  3615. index = 0;
  3616. }
  3617. items[index].focus();
  3618. };
  3619. _createClass(Dropdown, null, [{
  3620. key: "VERSION",
  3621. get: function get() {
  3622. return VERSION$4;
  3623. }
  3624. }, {
  3625. key: "Default",
  3626. get: function get() {
  3627. return Default$2;
  3628. }
  3629. }, {
  3630. key: "DefaultType",
  3631. get: function get() {
  3632. return DefaultType$2;
  3633. }
  3634. }]);
  3635. return Dropdown;
  3636. }();
  3637. /**
  3638. * ------------------------------------------------------------------------
  3639. * Data Api implementation
  3640. * ------------------------------------------------------------------------
  3641. */
  3642. $(document).on(EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$2, Dropdown._dataApiKeydownHandler).on(EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown._dataApiKeydownHandler).on(EVENT_CLICK_DATA_API$4 + " " + EVENT_KEYUP_DATA_API, Dropdown._clearMenus).on(EVENT_CLICK_DATA_API$4, SELECTOR_DATA_TOGGLE$2, function (event) {
  3643. event.preventDefault();
  3644. event.stopPropagation();
  3645. Dropdown._jQueryInterface.call($(this), 'toggle');
  3646. }).on(EVENT_CLICK_DATA_API$4, SELECTOR_FORM_CHILD, function (e) {
  3647. e.stopPropagation();
  3648. });
  3649. /**
  3650. * ------------------------------------------------------------------------
  3651. * jQuery
  3652. * ------------------------------------------------------------------------
  3653. */
  3654. $.fn[NAME$4] = Dropdown._jQueryInterface;
  3655. $.fn[NAME$4].Constructor = Dropdown;
  3656. $.fn[NAME$4].noConflict = function () {
  3657. $.fn[NAME$4] = JQUERY_NO_CONFLICT$4;
  3658. return Dropdown._jQueryInterface;
  3659. };
  3660. /**
  3661. * ------------------------------------------------------------------------
  3662. * Constants
  3663. * ------------------------------------------------------------------------
  3664. */
  3665. var NAME$5 = 'modal';
  3666. var VERSION$5 = '4.5.0';
  3667. var DATA_KEY$5 = 'bs.modal';
  3668. var EVENT_KEY$5 = "." + DATA_KEY$5;
  3669. var DATA_API_KEY$5 = '.data-api';
  3670. var JQUERY_NO_CONFLICT$5 = $.fn[NAME$5];
  3671. var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key
  3672. var Default$3 = {
  3673. backdrop: true,
  3674. keyboard: true,
  3675. focus: true,
  3676. show: true
  3677. };
  3678. var DefaultType$3 = {
  3679. backdrop: '(boolean|string)',
  3680. keyboard: 'boolean',
  3681. focus: 'boolean',
  3682. show: 'boolean'
  3683. };
  3684. var EVENT_HIDE$2 = "hide" + EVENT_KEY$5;
  3685. var EVENT_HIDE_PREVENTED = "hidePrevented" + EVENT_KEY$5;
  3686. var EVENT_HIDDEN$2 = "hidden" + EVENT_KEY$5;
  3687. var EVENT_SHOW$2 = "show" + EVENT_KEY$5;
  3688. var EVENT_SHOWN$2 = "shown" + EVENT_KEY$5;
  3689. var EVENT_FOCUSIN = "focusin" + EVENT_KEY$5;
  3690. var EVENT_RESIZE = "resize" + EVENT_KEY$5;
  3691. var EVENT_CLICK_DISMISS = "click.dismiss" + EVENT_KEY$5;
  3692. var EVENT_KEYDOWN_DISMISS = "keydown.dismiss" + EVENT_KEY$5;
  3693. var EVENT_MOUSEUP_DISMISS = "mouseup.dismiss" + EVENT_KEY$5;
  3694. var EVENT_MOUSEDOWN_DISMISS = "mousedown.dismiss" + EVENT_KEY$5;
  3695. var EVENT_CLICK_DATA_API$5 = "click" + EVENT_KEY$5 + DATA_API_KEY$5;
  3696. var CLASS_NAME_SCROLLABLE = 'modal-dialog-scrollable';
  3697. var CLASS_NAME_SCROLLBAR_MEASURER = 'modal-scrollbar-measure';
  3698. var CLASS_NAME_BACKDROP = 'modal-backdrop';
  3699. var CLASS_NAME_OPEN = 'modal-open';
  3700. var CLASS_NAME_FADE$1 = 'fade';
  3701. var CLASS_NAME_SHOW$3 = 'show';
  3702. var CLASS_NAME_STATIC = 'modal-static';
  3703. var SELECTOR_DIALOG = '.modal-dialog';
  3704. var SELECTOR_MODAL_BODY = '.modal-body';
  3705. var SELECTOR_DATA_TOGGLE$3 = '[data-toggle="modal"]';
  3706. var SELECTOR_DATA_DISMISS = '[data-dismiss="modal"]';
  3707. var SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
  3708. var SELECTOR_STICKY_CONTENT = '.sticky-top';
  3709. /**
  3710. * ------------------------------------------------------------------------
  3711. * Class Definition
  3712. * ------------------------------------------------------------------------
  3713. */
  3714. var Modal = /*#__PURE__*/function () {
  3715. function Modal(element, config) {
  3716. this._config = this._getConfig(config);
  3717. this._element = element;
  3718. this._dialog = element.querySelector(SELECTOR_DIALOG);
  3719. this._backdrop = null;
  3720. this._isShown = false;
  3721. this._isBodyOverflowing = false;
  3722. this._ignoreBackdropClick = false;
  3723. this._isTransitioning = false;
  3724. this._scrollbarWidth = 0;
  3725. } // Getters
  3726. var _proto = Modal.prototype;
  3727. // Public
  3728. _proto.toggle = function toggle(relatedTarget) {
  3729. return this._isShown ? this.hide() : this.show(relatedTarget);
  3730. };
  3731. _proto.show = function show(relatedTarget) {
  3732. var _this = this;
  3733. if (this._isShown || this._isTransitioning) {
  3734. return;
  3735. }
  3736. if ($(this._element).hasClass(CLASS_NAME_FADE$1)) {
  3737. this._isTransitioning = true;
  3738. }
  3739. var showEvent = $.Event(EVENT_SHOW$2, {
  3740. relatedTarget: relatedTarget
  3741. });
  3742. $(this._element).trigger(showEvent);
  3743. if (this._isShown || showEvent.isDefaultPrevented()) {
  3744. return;
  3745. }
  3746. this._isShown = true;
  3747. this._checkScrollbar();
  3748. this._setScrollbar();
  3749. this._adjustDialog();
  3750. this._setEscapeEvent();
  3751. this._setResizeEvent();
  3752. $(this._element).on(EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function (event) {
  3753. return _this.hide(event);
  3754. });
  3755. $(this._dialog).on(EVENT_MOUSEDOWN_DISMISS, function () {
  3756. $(_this._element).one(EVENT_MOUSEUP_DISMISS, function (event) {
  3757. if ($(event.target).is(_this._element)) {
  3758. _this._ignoreBackdropClick = true;
  3759. }
  3760. });
  3761. });
  3762. this._showBackdrop(function () {
  3763. return _this._showElement(relatedTarget);
  3764. });
  3765. };
  3766. _proto.hide = function hide(event) {
  3767. var _this2 = this;
  3768. if (event) {
  3769. event.preventDefault();
  3770. }
  3771. if (!this._isShown || this._isTransitioning) {
  3772. return;
  3773. }
  3774. var hideEvent = $.Event(EVENT_HIDE$2);
  3775. $(this._element).trigger(hideEvent);
  3776. if (!this._isShown || hideEvent.isDefaultPrevented()) {
  3777. return;
  3778. }
  3779. this._isShown = false;
  3780. var transition = $(this._element).hasClass(CLASS_NAME_FADE$1);
  3781. if (transition) {
  3782. this._isTransitioning = true;
  3783. }
  3784. this._setEscapeEvent();
  3785. this._setResizeEvent();
  3786. $(document).off(EVENT_FOCUSIN);
  3787. $(this._element).removeClass(CLASS_NAME_SHOW$3);
  3788. $(this._element).off(EVENT_CLICK_DISMISS);
  3789. $(this._dialog).off(EVENT_MOUSEDOWN_DISMISS);
  3790. if (transition) {
  3791. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  3792. $(this._element).one(Util.TRANSITION_END, function (event) {
  3793. return _this2._hideModal(event);
  3794. }).emulateTransitionEnd(transitionDuration);
  3795. } else {
  3796. this._hideModal();
  3797. }
  3798. };
  3799. _proto.dispose = function dispose() {
  3800. [window, this._element, this._dialog].forEach(function (htmlElement) {
  3801. return $(htmlElement).off(EVENT_KEY$5);
  3802. });
  3803. /**
  3804. * `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
  3805. * Do not move `document` in `htmlElements` array
  3806. * It will remove `EVENT_CLICK_DATA_API` event that should remain
  3807. */
  3808. $(document).off(EVENT_FOCUSIN);
  3809. $.removeData(this._element, DATA_KEY$5);
  3810. this._config = null;
  3811. this._element = null;
  3812. this._dialog = null;
  3813. this._backdrop = null;
  3814. this._isShown = null;
  3815. this._isBodyOverflowing = null;
  3816. this._ignoreBackdropClick = null;
  3817. this._isTransitioning = null;
  3818. this._scrollbarWidth = null;
  3819. };
  3820. _proto.handleUpdate = function handleUpdate() {
  3821. this._adjustDialog();
  3822. } // Private
  3823. ;
  3824. _proto._getConfig = function _getConfig(config) {
  3825. config = _objectSpread2(_objectSpread2({}, Default$3), config);
  3826. Util.typeCheckConfig(NAME$5, config, DefaultType$3);
  3827. return config;
  3828. };
  3829. _proto._triggerBackdropTransition = function _triggerBackdropTransition() {
  3830. var _this3 = this;
  3831. if (this._config.backdrop === 'static') {
  3832. var hideEventPrevented = $.Event(EVENT_HIDE_PREVENTED);
  3833. $(this._element).trigger(hideEventPrevented);
  3834. if (hideEventPrevented.defaultPrevented) {
  3835. return;
  3836. }
  3837. this._element.classList.add(CLASS_NAME_STATIC);
  3838. var modalTransitionDuration = Util.getTransitionDurationFromElement(this._element);
  3839. $(this._element).one(Util.TRANSITION_END, function () {
  3840. _this3._element.classList.remove(CLASS_NAME_STATIC);
  3841. }).emulateTransitionEnd(modalTransitionDuration);
  3842. this._element.focus();
  3843. } else {
  3844. this.hide();
  3845. }
  3846. };
  3847. _proto._showElement = function _showElement(relatedTarget) {
  3848. var _this4 = this;
  3849. var transition = $(this._element).hasClass(CLASS_NAME_FADE$1);
  3850. var modalBody = this._dialog ? this._dialog.querySelector(SELECTOR_MODAL_BODY) : null;
  3851. if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
  3852. // Don't move modal's DOM position
  3853. document.body.appendChild(this._element);
  3854. }
  3855. this._element.style.display = 'block';
  3856. this._element.removeAttribute('aria-hidden');
  3857. this._element.setAttribute('aria-modal', true);
  3858. if ($(this._dialog).hasClass(CLASS_NAME_SCROLLABLE) && modalBody) {
  3859. modalBody.scrollTop = 0;
  3860. } else {
  3861. this._element.scrollTop = 0;
  3862. }
  3863. if (transition) {
  3864. Util.reflow(this._element);
  3865. }
  3866. $(this._element).addClass(CLASS_NAME_SHOW$3);
  3867. if (this._config.focus) {
  3868. this._enforceFocus();
  3869. }
  3870. var shownEvent = $.Event(EVENT_SHOWN$2, {
  3871. relatedTarget: relatedTarget
  3872. });
  3873. var transitionComplete = function transitionComplete() {
  3874. if (_this4._config.focus) {
  3875. _this4._element.focus();
  3876. }
  3877. _this4._isTransitioning = false;
  3878. $(_this4._element).trigger(shownEvent);
  3879. };
  3880. if (transition) {
  3881. var transitionDuration = Util.getTransitionDurationFromElement(this._dialog);
  3882. $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);
  3883. } else {
  3884. transitionComplete();
  3885. }
  3886. };
  3887. _proto._enforceFocus = function _enforceFocus() {
  3888. var _this5 = this;
  3889. $(document).off(EVENT_FOCUSIN) // Guard against infinite focus loop
  3890. .on(EVENT_FOCUSIN, function (event) {
  3891. if (document !== event.target && _this5._element !== event.target && $(_this5._element).has(event.target).length === 0) {
  3892. _this5._element.focus();
  3893. }
  3894. });
  3895. };
  3896. _proto._setEscapeEvent = function _setEscapeEvent() {
  3897. var _this6 = this;
  3898. if (this._isShown) {
  3899. $(this._element).on(EVENT_KEYDOWN_DISMISS, function (event) {
  3900. if (_this6._config.keyboard && event.which === ESCAPE_KEYCODE$1) {
  3901. event.preventDefault();
  3902. _this6.hide();
  3903. } else if (!_this6._config.keyboard && event.which === ESCAPE_KEYCODE$1) {
  3904. _this6._triggerBackdropTransition();
  3905. }
  3906. });
  3907. } else if (!this._isShown) {
  3908. $(this._element).off(EVENT_KEYDOWN_DISMISS);
  3909. }
  3910. };
  3911. _proto._setResizeEvent = function _setResizeEvent() {
  3912. var _this7 = this;
  3913. if (this._isShown) {
  3914. $(window).on(EVENT_RESIZE, function (event) {
  3915. return _this7.handleUpdate(event);
  3916. });
  3917. } else {
  3918. $(window).off(EVENT_RESIZE);
  3919. }
  3920. };
  3921. _proto._hideModal = function _hideModal() {
  3922. var _this8 = this;
  3923. this._element.style.display = 'none';
  3924. this._element.setAttribute('aria-hidden', true);
  3925. this._element.removeAttribute('aria-modal');
  3926. this._isTransitioning = false;
  3927. this._showBackdrop(function () {
  3928. $(document.body).removeClass(CLASS_NAME_OPEN);
  3929. _this8._resetAdjustments();
  3930. _this8._resetScrollbar();
  3931. $(_this8._element).trigger(EVENT_HIDDEN$2);
  3932. });
  3933. };
  3934. _proto._removeBackdrop = function _removeBackdrop() {
  3935. if (this._backdrop) {
  3936. $(this._backdrop).remove();
  3937. this._backdrop = null;
  3938. }
  3939. };
  3940. _proto._showBackdrop = function _showBackdrop(callback) {
  3941. var _this9 = this;
  3942. var animate = $(this._element).hasClass(CLASS_NAME_FADE$1) ? CLASS_NAME_FADE$1 : '';
  3943. if (this._isShown && this._config.backdrop) {
  3944. this._backdrop = document.createElement('div');
  3945. this._backdrop.className = CLASS_NAME_BACKDROP;
  3946. if (animate) {
  3947. this._backdrop.classList.add(animate);
  3948. }
  3949. $(this._backdrop).appendTo(document.body);
  3950. $(this._element).on(EVENT_CLICK_DISMISS, function (event) {
  3951. if (_this9._ignoreBackdropClick) {
  3952. _this9._ignoreBackdropClick = false;
  3953. return;
  3954. }
  3955. if (event.target !== event.currentTarget) {
  3956. return;
  3957. }
  3958. _this9._triggerBackdropTransition();
  3959. });
  3960. if (animate) {
  3961. Util.reflow(this._backdrop);
  3962. }
  3963. $(this._backdrop).addClass(CLASS_NAME_SHOW$3);
  3964. if (!callback) {
  3965. return;
  3966. }
  3967. if (!animate) {
  3968. callback();
  3969. return;
  3970. }
  3971. var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
  3972. $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);
  3973. } else if (!this._isShown && this._backdrop) {
  3974. $(this._backdrop).removeClass(CLASS_NAME_SHOW$3);
  3975. var callbackRemove = function callbackRemove() {
  3976. _this9._removeBackdrop();
  3977. if (callback) {
  3978. callback();
  3979. }
  3980. };
  3981. if ($(this._element).hasClass(CLASS_NAME_FADE$1)) {
  3982. var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
  3983. $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);
  3984. } else {
  3985. callbackRemove();
  3986. }
  3987. } else if (callback) {
  3988. callback();
  3989. }
  3990. } // ----------------------------------------------------------------------
  3991. // the following methods are used to handle overflowing modals
  3992. // todo (fat): these should probably be refactored out of modal.js
  3993. // ----------------------------------------------------------------------
  3994. ;
  3995. _proto._adjustDialog = function _adjustDialog() {
  3996. var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
  3997. if (!this._isBodyOverflowing && isModalOverflowing) {
  3998. this._element.style.paddingLeft = this._scrollbarWidth + "px";
  3999. }
  4000. if (this._isBodyOverflowing && !isModalOverflowing) {
  4001. this._element.style.paddingRight = this._scrollbarWidth + "px";
  4002. }
  4003. };
  4004. _proto._resetAdjustments = function _resetAdjustments() {
  4005. this._element.style.paddingLeft = '';
  4006. this._element.style.paddingRight = '';
  4007. };
  4008. _proto._checkScrollbar = function _checkScrollbar() {
  4009. var rect = document.body.getBoundingClientRect();
  4010. this._isBodyOverflowing = Math.round(rect.left + rect.right) < window.innerWidth;
  4011. this._scrollbarWidth = this._getScrollbarWidth();
  4012. };
  4013. _proto._setScrollbar = function _setScrollbar() {
  4014. var _this10 = this;
  4015. if (this._isBodyOverflowing) {
  4016. // Note: DOMNode.style.paddingRight returns the actual value or '' if not set
  4017. // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
  4018. var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT));
  4019. var stickyContent = [].slice.call(document.querySelectorAll(SELECTOR_STICKY_CONTENT)); // Adjust fixed content padding
  4020. $(fixedContent).each(function (index, element) {
  4021. var actualPadding = element.style.paddingRight;
  4022. var calculatedPadding = $(element).css('padding-right');
  4023. $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this10._scrollbarWidth + "px");
  4024. }); // Adjust sticky content margin
  4025. $(stickyContent).each(function (index, element) {
  4026. var actualMargin = element.style.marginRight;
  4027. var calculatedMargin = $(element).css('margin-right');
  4028. $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this10._scrollbarWidth + "px");
  4029. }); // Adjust body padding
  4030. var actualPadding = document.body.style.paddingRight;
  4031. var calculatedPadding = $(document.body).css('padding-right');
  4032. $(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px");
  4033. }
  4034. $(document.body).addClass(CLASS_NAME_OPEN);
  4035. };
  4036. _proto._resetScrollbar = function _resetScrollbar() {
  4037. // Restore fixed content padding
  4038. var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT));
  4039. $(fixedContent).each(function (index, element) {
  4040. var padding = $(element).data('padding-right');
  4041. $(element).removeData('padding-right');
  4042. element.style.paddingRight = padding ? padding : '';
  4043. }); // Restore sticky content
  4044. var elements = [].slice.call(document.querySelectorAll("" + SELECTOR_STICKY_CONTENT));
  4045. $(elements).each(function (index, element) {
  4046. var margin = $(element).data('margin-right');
  4047. if (typeof margin !== 'undefined') {
  4048. $(element).css('margin-right', margin).removeData('margin-right');
  4049. }
  4050. }); // Restore body padding
  4051. var padding = $(document.body).data('padding-right');
  4052. $(document.body).removeData('padding-right');
  4053. document.body.style.paddingRight = padding ? padding : '';
  4054. };
  4055. _proto._getScrollbarWidth = function _getScrollbarWidth() {
  4056. // thx d.walsh
  4057. var scrollDiv = document.createElement('div');
  4058. scrollDiv.className = CLASS_NAME_SCROLLBAR_MEASURER;
  4059. document.body.appendChild(scrollDiv);
  4060. var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
  4061. document.body.removeChild(scrollDiv);
  4062. return scrollbarWidth;
  4063. } // Static
  4064. ;
  4065. Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
  4066. return this.each(function () {
  4067. var data = $(this).data(DATA_KEY$5);
  4068. var _config = _objectSpread2(_objectSpread2(_objectSpread2({}, Default$3), $(this).data()), typeof config === 'object' && config ? config : {});
  4069. if (!data) {
  4070. data = new Modal(this, _config);
  4071. $(this).data(DATA_KEY$5, data);
  4072. }
  4073. if (typeof config === 'string') {
  4074. if (typeof data[config] === 'undefined') {
  4075. throw new TypeError("No method named \"" + config + "\"");
  4076. }
  4077. data[config](relatedTarget);
  4078. } else if (_config.show) {
  4079. data.show(relatedTarget);
  4080. }
  4081. });
  4082. };
  4083. _createClass(Modal, null, [{
  4084. key: "VERSION",
  4085. get: function get() {
  4086. return VERSION$5;
  4087. }
  4088. }, {
  4089. key: "Default",
  4090. get: function get() {
  4091. return Default$3;
  4092. }
  4093. }]);
  4094. return Modal;
  4095. }();
  4096. /**
  4097. * ------------------------------------------------------------------------
  4098. * Data Api implementation
  4099. * ------------------------------------------------------------------------
  4100. */
  4101. $(document).on(EVENT_CLICK_DATA_API$5, SELECTOR_DATA_TOGGLE$3, function (event) {
  4102. var _this11 = this;
  4103. var target;
  4104. var selector = Util.getSelectorFromElement(this);
  4105. if (selector) {
  4106. target = document.querySelector(selector);
  4107. }
  4108. var config = $(target).data(DATA_KEY$5) ? 'toggle' : _objectSpread2(_objectSpread2({}, $(target).data()), $(this).data());
  4109. if (this.tagName === 'A' || this.tagName === 'AREA') {
  4110. event.preventDefault();
  4111. }
  4112. var $target = $(target).one(EVENT_SHOW$2, function (showEvent) {
  4113. if (showEvent.isDefaultPrevented()) {
  4114. // Only register focus restorer if modal will actually get shown
  4115. return;
  4116. }
  4117. $target.one(EVENT_HIDDEN$2, function () {
  4118. if ($(_this11).is(':visible')) {
  4119. _this11.focus();
  4120. }
  4121. });
  4122. });
  4123. Modal._jQueryInterface.call($(target), config, this);
  4124. });
  4125. /**
  4126. * ------------------------------------------------------------------------
  4127. * jQuery
  4128. * ------------------------------------------------------------------------
  4129. */
  4130. $.fn[NAME$5] = Modal._jQueryInterface;
  4131. $.fn[NAME$5].Constructor = Modal;
  4132. $.fn[NAME$5].noConflict = function () {
  4133. $.fn[NAME$5] = JQUERY_NO_CONFLICT$5;
  4134. return Modal._jQueryInterface;
  4135. };
  4136. /**
  4137. * --------------------------------------------------------------------------
  4138. * Bootstrap (v4.5.0): tools/sanitizer.js
  4139. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  4140. * --------------------------------------------------------------------------
  4141. */
  4142. var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];
  4143. var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
  4144. var DefaultWhitelist = {
  4145. // Global attributes allowed on any supplied element below.
  4146. '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
  4147. a: ['target', 'href', 'title', 'rel'],
  4148. area: [],
  4149. b: [],
  4150. br: [],
  4151. col: [],
  4152. code: [],
  4153. div: [],
  4154. em: [],
  4155. hr: [],
  4156. h1: [],
  4157. h2: [],
  4158. h3: [],
  4159. h4: [],
  4160. h5: [],
  4161. h6: [],
  4162. i: [],
  4163. img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],
  4164. li: [],
  4165. ol: [],
  4166. p: [],
  4167. pre: [],
  4168. s: [],
  4169. small: [],
  4170. span: [],
  4171. sub: [],
  4172. sup: [],
  4173. strong: [],
  4174. u: [],
  4175. ul: []
  4176. };
  4177. /**
  4178. * A pattern that recognizes a commonly useful subset of URLs that are safe.
  4179. *
  4180. * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
  4181. */
  4182. var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi;
  4183. /**
  4184. * A pattern that matches safe data URLs. Only matches image, video and audio types.
  4185. *
  4186. * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
  4187. */
  4188. var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i;
  4189. function allowedAttribute(attr, allowedAttributeList) {
  4190. var attrName = attr.nodeName.toLowerCase();
  4191. if (allowedAttributeList.indexOf(attrName) !== -1) {
  4192. if (uriAttrs.indexOf(attrName) !== -1) {
  4193. return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN));
  4194. }
  4195. return true;
  4196. }
  4197. var regExp = allowedAttributeList.filter(function (attrRegex) {
  4198. return attrRegex instanceof RegExp;
  4199. }); // Check if a regular expression validates the attribute.
  4200. for (var i = 0, len = regExp.length; i < len; i++) {
  4201. if (attrName.match(regExp[i])) {
  4202. return true;
  4203. }
  4204. }
  4205. return false;
  4206. }
  4207. function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
  4208. if (unsafeHtml.length === 0) {
  4209. return unsafeHtml;
  4210. }
  4211. if (sanitizeFn && typeof sanitizeFn === 'function') {
  4212. return sanitizeFn(unsafeHtml);
  4213. }
  4214. var domParser = new window.DOMParser();
  4215. var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
  4216. var whitelistKeys = Object.keys(whiteList);
  4217. var elements = [].slice.call(createdDocument.body.querySelectorAll('*'));
  4218. var _loop = function _loop(i, len) {
  4219. var el = elements[i];
  4220. var elName = el.nodeName.toLowerCase();
  4221. if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) {
  4222. el.parentNode.removeChild(el);
  4223. return "continue";
  4224. }
  4225. var attributeList = [].slice.call(el.attributes);
  4226. var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
  4227. attributeList.forEach(function (attr) {
  4228. if (!allowedAttribute(attr, whitelistedAttributes)) {
  4229. el.removeAttribute(attr.nodeName);
  4230. }
  4231. });
  4232. };
  4233. for (var i = 0, len = elements.length; i < len; i++) {
  4234. var _ret = _loop(i);
  4235. if (_ret === "continue") continue;
  4236. }
  4237. return createdDocument.body.innerHTML;
  4238. }
  4239. /**
  4240. * ------------------------------------------------------------------------
  4241. * Constants
  4242. * ------------------------------------------------------------------------
  4243. */
  4244. var NAME$6 = 'tooltip';
  4245. var VERSION$6 = '4.5.0';
  4246. var DATA_KEY$6 = 'bs.tooltip';
  4247. var EVENT_KEY$6 = "." + DATA_KEY$6;
  4248. var JQUERY_NO_CONFLICT$6 = $.fn[NAME$6];
  4249. var CLASS_PREFIX = 'bs-tooltip';
  4250. var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
  4251. var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];
  4252. var DefaultType$4 = {
  4253. animation: 'boolean',
  4254. template: 'string',
  4255. title: '(string|element|function)',
  4256. trigger: 'string',
  4257. delay: '(number|object)',
  4258. html: 'boolean',
  4259. selector: '(string|boolean)',
  4260. placement: '(string|function)',
  4261. offset: '(number|string|function)',
  4262. container: '(string|element|boolean)',
  4263. fallbackPlacement: '(string|array)',
  4264. boundary: '(string|element)',
  4265. sanitize: 'boolean',
  4266. sanitizeFn: '(null|function)',
  4267. whiteList: 'object',
  4268. popperConfig: '(null|object)'
  4269. };
  4270. var AttachmentMap = {
  4271. AUTO: 'auto',
  4272. TOP: 'top',
  4273. RIGHT: 'right',
  4274. BOTTOM: 'bottom',
  4275. LEFT: 'left'
  4276. };
  4277. var Default$4 = {
  4278. animation: true,
  4279. template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>',
  4280. trigger: 'hover focus',
  4281. title: '',
  4282. delay: 0,
  4283. html: false,
  4284. selector: false,
  4285. placement: 'top',
  4286. offset: 0,
  4287. container: false,
  4288. fallbackPlacement: 'flip',
  4289. boundary: 'scrollParent',
  4290. sanitize: true,
  4291. sanitizeFn: null,
  4292. whiteList: DefaultWhitelist,
  4293. popperConfig: null
  4294. };
  4295. var HOVER_STATE_SHOW = 'show';
  4296. var HOVER_STATE_OUT = 'out';
  4297. var Event = {
  4298. HIDE: "hide" + EVENT_KEY$6,
  4299. HIDDEN: "hidden" + EVENT_KEY$6,
  4300. SHOW: "show" + EVENT_KEY$6,
  4301. SHOWN: "shown" + EVENT_KEY$6,
  4302. INSERTED: "inserted" + EVENT_KEY$6,
  4303. CLICK: "click" + EVENT_KEY$6,
  4304. FOCUSIN: "focusin" + EVENT_KEY$6,
  4305. FOCUSOUT: "focusout" + EVENT_KEY$6,
  4306. MOUSEENTER: "mouseenter" + EVENT_KEY$6,
  4307. MOUSELEAVE: "mouseleave" + EVENT_KEY$6
  4308. };
  4309. var CLASS_NAME_FADE$2 = 'fade';
  4310. var CLASS_NAME_SHOW$4 = 'show';
  4311. var SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
  4312. var SELECTOR_ARROW = '.arrow';
  4313. var TRIGGER_HOVER = 'hover';
  4314. var TRIGGER_FOCUS = 'focus';
  4315. var TRIGGER_CLICK = 'click';
  4316. var TRIGGER_MANUAL = 'manual';
  4317. /**
  4318. * ------------------------------------------------------------------------
  4319. * Class Definition
  4320. * ------------------------------------------------------------------------
  4321. */
  4322. var Tooltip = /*#__PURE__*/function () {
  4323. function Tooltip(element, config) {
  4324. if (typeof Popper === 'undefined') {
  4325. throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)');
  4326. } // private
  4327. this._isEnabled = true;
  4328. this._timeout = 0;
  4329. this._hoverState = '';
  4330. this._activeTrigger = {};
  4331. this._popper = null; // Protected
  4332. this.element = element;
  4333. this.config = this._getConfig(config);
  4334. this.tip = null;
  4335. this._setListeners();
  4336. } // Getters
  4337. var _proto = Tooltip.prototype;
  4338. // Public
  4339. _proto.enable = function enable() {
  4340. this._isEnabled = true;
  4341. };
  4342. _proto.disable = function disable() {
  4343. this._isEnabled = false;
  4344. };
  4345. _proto.toggleEnabled = function toggleEnabled() {
  4346. this._isEnabled = !this._isEnabled;
  4347. };
  4348. _proto.toggle = function toggle(event) {
  4349. if (!this._isEnabled) {
  4350. return;
  4351. }
  4352. if (event) {
  4353. var dataKey = this.constructor.DATA_KEY;
  4354. var context = $(event.currentTarget).data(dataKey);
  4355. if (!context) {
  4356. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  4357. $(event.currentTarget).data(dataKey, context);
  4358. }
  4359. context._activeTrigger.click = !context._activeTrigger.click;
  4360. if (context._isWithActiveTrigger()) {
  4361. context._enter(null, context);
  4362. } else {
  4363. context._leave(null, context);
  4364. }
  4365. } else {
  4366. if ($(this.getTipElement()).hasClass(CLASS_NAME_SHOW$4)) {
  4367. this._leave(null, this);
  4368. return;
  4369. }
  4370. this._enter(null, this);
  4371. }
  4372. };
  4373. _proto.dispose = function dispose() {
  4374. clearTimeout(this._timeout);
  4375. $.removeData(this.element, this.constructor.DATA_KEY);
  4376. $(this.element).off(this.constructor.EVENT_KEY);
  4377. $(this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler);
  4378. if (this.tip) {
  4379. $(this.tip).remove();
  4380. }
  4381. this._isEnabled = null;
  4382. this._timeout = null;
  4383. this._hoverState = null;
  4384. this._activeTrigger = null;
  4385. if (this._popper) {
  4386. this._popper.destroy();
  4387. }
  4388. this._popper = null;
  4389. this.element = null;
  4390. this.config = null;
  4391. this.tip = null;
  4392. };
  4393. _proto.show = function show() {
  4394. var _this = this;
  4395. if ($(this.element).css('display') === 'none') {
  4396. throw new Error('Please use show on visible elements');
  4397. }
  4398. var showEvent = $.Event(this.constructor.Event.SHOW);
  4399. if (this.isWithContent() && this._isEnabled) {
  4400. $(this.element).trigger(showEvent);
  4401. var shadowRoot = Util.findShadowRoot(this.element);
  4402. var isInTheDom = $.contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);
  4403. if (showEvent.isDefaultPrevented() || !isInTheDom) {
  4404. return;
  4405. }
  4406. var tip = this.getTipElement();
  4407. var tipId = Util.getUID(this.constructor.NAME);
  4408. tip.setAttribute('id', tipId);
  4409. this.element.setAttribute('aria-describedby', tipId);
  4410. this.setContent();
  4411. if (this.config.animation) {
  4412. $(tip).addClass(CLASS_NAME_FADE$2);
  4413. }
  4414. var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
  4415. var attachment = this._getAttachment(placement);
  4416. this.addAttachmentClass(attachment);
  4417. var container = this._getContainer();
  4418. $(tip).data(this.constructor.DATA_KEY, this);
  4419. if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {
  4420. $(tip).appendTo(container);
  4421. }
  4422. $(this.element).trigger(this.constructor.Event.INSERTED);
  4423. this._popper = new Popper(this.element, tip, this._getPopperConfig(attachment));
  4424. $(tip).addClass(CLASS_NAME_SHOW$4); // If this is a touch-enabled device we add extra
  4425. // empty mouseover listeners to the body's immediate children;
  4426. // only needed because of broken event delegation on iOS
  4427. // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
  4428. if ('ontouchstart' in document.documentElement) {
  4429. $(document.body).children().on('mouseover', null, $.noop);
  4430. }
  4431. var complete = function complete() {
  4432. if (_this.config.animation) {
  4433. _this._fixTransition();
  4434. }
  4435. var prevHoverState = _this._hoverState;
  4436. _this._hoverState = null;
  4437. $(_this.element).trigger(_this.constructor.Event.SHOWN);
  4438. if (prevHoverState === HOVER_STATE_OUT) {
  4439. _this._leave(null, _this);
  4440. }
  4441. };
  4442. if ($(this.tip).hasClass(CLASS_NAME_FADE$2)) {
  4443. var transitionDuration = Util.getTransitionDurationFromElement(this.tip);
  4444. $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  4445. } else {
  4446. complete();
  4447. }
  4448. }
  4449. };
  4450. _proto.hide = function hide(callback) {
  4451. var _this2 = this;
  4452. var tip = this.getTipElement();
  4453. var hideEvent = $.Event(this.constructor.Event.HIDE);
  4454. var complete = function complete() {
  4455. if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
  4456. tip.parentNode.removeChild(tip);
  4457. }
  4458. _this2._cleanTipClass();
  4459. _this2.element.removeAttribute('aria-describedby');
  4460. $(_this2.element).trigger(_this2.constructor.Event.HIDDEN);
  4461. if (_this2._popper !== null) {
  4462. _this2._popper.destroy();
  4463. }
  4464. if (callback) {
  4465. callback();
  4466. }
  4467. };
  4468. $(this.element).trigger(hideEvent);
  4469. if (hideEvent.isDefaultPrevented()) {
  4470. return;
  4471. }
  4472. $(tip).removeClass(CLASS_NAME_SHOW$4); // If this is a touch-enabled device we remove the extra
  4473. // empty mouseover listeners we added for iOS support
  4474. if ('ontouchstart' in document.documentElement) {
  4475. $(document.body).children().off('mouseover', null, $.noop);
  4476. }
  4477. this._activeTrigger[TRIGGER_CLICK] = false;
  4478. this._activeTrigger[TRIGGER_FOCUS] = false;
  4479. this._activeTrigger[TRIGGER_HOVER] = false;
  4480. if ($(this.tip).hasClass(CLASS_NAME_FADE$2)) {
  4481. var transitionDuration = Util.getTransitionDurationFromElement(tip);
  4482. $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  4483. } else {
  4484. complete();
  4485. }
  4486. this._hoverState = '';
  4487. };
  4488. _proto.update = function update() {
  4489. if (this._popper !== null) {
  4490. this._popper.scheduleUpdate();
  4491. }
  4492. } // Protected
  4493. ;
  4494. _proto.isWithContent = function isWithContent() {
  4495. return Boolean(this.getTitle());
  4496. };
  4497. _proto.addAttachmentClass = function addAttachmentClass(attachment) {
  4498. $(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
  4499. };
  4500. _proto.getTipElement = function getTipElement() {
  4501. this.tip = this.tip || $(this.config.template)[0];
  4502. return this.tip;
  4503. };
  4504. _proto.setContent = function setContent() {
  4505. var tip = this.getTipElement();
  4506. this.setElementContent($(tip.querySelectorAll(SELECTOR_TOOLTIP_INNER)), this.getTitle());
  4507. $(tip).removeClass(CLASS_NAME_FADE$2 + " " + CLASS_NAME_SHOW$4);
  4508. };
  4509. _proto.setElementContent = function setElementContent($element, content) {
  4510. if (typeof content === 'object' && (content.nodeType || content.jquery)) {
  4511. // Content is a DOM node or a jQuery
  4512. if (this.config.html) {
  4513. if (!$(content).parent().is($element)) {
  4514. $element.empty().append(content);
  4515. }
  4516. } else {
  4517. $element.text($(content).text());
  4518. }
  4519. return;
  4520. }
  4521. if (this.config.html) {
  4522. if (this.config.sanitize) {
  4523. content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn);
  4524. }
  4525. $element.html(content);
  4526. } else {
  4527. $element.text(content);
  4528. }
  4529. };
  4530. _proto.getTitle = function getTitle() {
  4531. var title = this.element.getAttribute('data-original-title');
  4532. if (!title) {
  4533. title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
  4534. }
  4535. return title;
  4536. } // Private
  4537. ;
  4538. _proto._getPopperConfig = function _getPopperConfig(attachment) {
  4539. var _this3 = this;
  4540. var defaultBsConfig = {
  4541. placement: attachment,
  4542. modifiers: {
  4543. offset: this._getOffset(),
  4544. flip: {
  4545. behavior: this.config.fallbackPlacement
  4546. },
  4547. arrow: {
  4548. element: SELECTOR_ARROW
  4549. },
  4550. preventOverflow: {
  4551. boundariesElement: this.config.boundary
  4552. }
  4553. },
  4554. onCreate: function onCreate(data) {
  4555. if (data.originalPlacement !== data.placement) {
  4556. _this3._handlePopperPlacementChange(data);
  4557. }
  4558. },
  4559. onUpdate: function onUpdate(data) {
  4560. return _this3._handlePopperPlacementChange(data);
  4561. }
  4562. };
  4563. return _objectSpread2(_objectSpread2({}, defaultBsConfig), this.config.popperConfig);
  4564. };
  4565. _proto._getOffset = function _getOffset() {
  4566. var _this4 = this;
  4567. var offset = {};
  4568. if (typeof this.config.offset === 'function') {
  4569. offset.fn = function (data) {
  4570. data.offsets = _objectSpread2(_objectSpread2({}, data.offsets), _this4.config.offset(data.offsets, _this4.element) || {});
  4571. return data;
  4572. };
  4573. } else {
  4574. offset.offset = this.config.offset;
  4575. }
  4576. return offset;
  4577. };
  4578. _proto._getContainer = function _getContainer() {
  4579. if (this.config.container === false) {
  4580. return document.body;
  4581. }
  4582. if (Util.isElement(this.config.container)) {
  4583. return $(this.config.container);
  4584. }
  4585. return $(document).find(this.config.container);
  4586. };
  4587. _proto._getAttachment = function _getAttachment(placement) {
  4588. return AttachmentMap[placement.toUpperCase()];
  4589. };
  4590. _proto._setListeners = function _setListeners() {
  4591. var _this5 = this;
  4592. var triggers = this.config.trigger.split(' ');
  4593. triggers.forEach(function (trigger) {
  4594. if (trigger === 'click') {
  4595. $(_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
  4596. return _this5.toggle(event);
  4597. });
  4598. } else if (trigger !== TRIGGER_MANUAL) {
  4599. var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
  4600. var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
  4601. $(_this5.element).on(eventIn, _this5.config.selector, function (event) {
  4602. return _this5._enter(event);
  4603. }).on(eventOut, _this5.config.selector, function (event) {
  4604. return _this5._leave(event);
  4605. });
  4606. }
  4607. });
  4608. this._hideModalHandler = function () {
  4609. if (_this5.element) {
  4610. _this5.hide();
  4611. }
  4612. };
  4613. $(this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler);
  4614. if (this.config.selector) {
  4615. this.config = _objectSpread2(_objectSpread2({}, this.config), {}, {
  4616. trigger: 'manual',
  4617. selector: ''
  4618. });
  4619. } else {
  4620. this._fixTitle();
  4621. }
  4622. };
  4623. _proto._fixTitle = function _fixTitle() {
  4624. var titleType = typeof this.element.getAttribute('data-original-title');
  4625. if (this.element.getAttribute('title') || titleType !== 'string') {
  4626. this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
  4627. this.element.setAttribute('title', '');
  4628. }
  4629. };
  4630. _proto._enter = function _enter(event, context) {
  4631. var dataKey = this.constructor.DATA_KEY;
  4632. context = context || $(event.currentTarget).data(dataKey);
  4633. if (!context) {
  4634. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  4635. $(event.currentTarget).data(dataKey, context);
  4636. }
  4637. if (event) {
  4638. context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
  4639. }
  4640. if ($(context.getTipElement()).hasClass(CLASS_NAME_SHOW$4) || context._hoverState === HOVER_STATE_SHOW) {
  4641. context._hoverState = HOVER_STATE_SHOW;
  4642. return;
  4643. }
  4644. clearTimeout(context._timeout);
  4645. context._hoverState = HOVER_STATE_SHOW;
  4646. if (!context.config.delay || !context.config.delay.show) {
  4647. context.show();
  4648. return;
  4649. }
  4650. context._timeout = setTimeout(function () {
  4651. if (context._hoverState === HOVER_STATE_SHOW) {
  4652. context.show();
  4653. }
  4654. }, context.config.delay.show);
  4655. };
  4656. _proto._leave = function _leave(event, context) {
  4657. var dataKey = this.constructor.DATA_KEY;
  4658. context = context || $(event.currentTarget).data(dataKey);
  4659. if (!context) {
  4660. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  4661. $(event.currentTarget).data(dataKey, context);
  4662. }
  4663. if (event) {
  4664. context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = false;
  4665. }
  4666. if (context._isWithActiveTrigger()) {
  4667. return;
  4668. }
  4669. clearTimeout(context._timeout);
  4670. context._hoverState = HOVER_STATE_OUT;
  4671. if (!context.config.delay || !context.config.delay.hide) {
  4672. context.hide();
  4673. return;
  4674. }
  4675. context._timeout = setTimeout(function () {
  4676. if (context._hoverState === HOVER_STATE_OUT) {
  4677. context.hide();
  4678. }
  4679. }, context.config.delay.hide);
  4680. };
  4681. _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
  4682. for (var trigger in this._activeTrigger) {
  4683. if (this._activeTrigger[trigger]) {
  4684. return true;
  4685. }
  4686. }
  4687. return false;
  4688. };
  4689. _proto._getConfig = function _getConfig(config) {
  4690. var dataAttributes = $(this.element).data();
  4691. Object.keys(dataAttributes).forEach(function (dataAttr) {
  4692. if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
  4693. delete dataAttributes[dataAttr];
  4694. }
  4695. });
  4696. config = _objectSpread2(_objectSpread2(_objectSpread2({}, this.constructor.Default), dataAttributes), typeof config === 'object' && config ? config : {});
  4697. if (typeof config.delay === 'number') {
  4698. config.delay = {
  4699. show: config.delay,
  4700. hide: config.delay
  4701. };
  4702. }
  4703. if (typeof config.title === 'number') {
  4704. config.title = config.title.toString();
  4705. }
  4706. if (typeof config.content === 'number') {
  4707. config.content = config.content.toString();
  4708. }
  4709. Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType);
  4710. if (config.sanitize) {
  4711. config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);
  4712. }
  4713. return config;
  4714. };
  4715. _proto._getDelegateConfig = function _getDelegateConfig() {
  4716. var config = {};
  4717. if (this.config) {
  4718. for (var key in this.config) {
  4719. if (this.constructor.Default[key] !== this.config[key]) {
  4720. config[key] = this.config[key];
  4721. }
  4722. }
  4723. }
  4724. return config;
  4725. };
  4726. _proto._cleanTipClass = function _cleanTipClass() {
  4727. var $tip = $(this.getTipElement());
  4728. var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
  4729. if (tabClass !== null && tabClass.length) {
  4730. $tip.removeClass(tabClass.join(''));
  4731. }
  4732. };
  4733. _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
  4734. this.tip = popperData.instance.popper;
  4735. this._cleanTipClass();
  4736. this.addAttachmentClass(this._getAttachment(popperData.placement));
  4737. };
  4738. _proto._fixTransition = function _fixTransition() {
  4739. var tip = this.getTipElement();
  4740. var initConfigAnimation = this.config.animation;
  4741. if (tip.getAttribute('x-placement') !== null) {
  4742. return;
  4743. }
  4744. $(tip).removeClass(CLASS_NAME_FADE$2);
  4745. this.config.animation = false;
  4746. this.hide();
  4747. this.show();
  4748. this.config.animation = initConfigAnimation;
  4749. } // Static
  4750. ;
  4751. Tooltip._jQueryInterface = function _jQueryInterface(config) {
  4752. return this.each(function () {
  4753. var data = $(this).data(DATA_KEY$6);
  4754. var _config = typeof config === 'object' && config;
  4755. if (!data && /dispose|hide/.test(config)) {
  4756. return;
  4757. }
  4758. if (!data) {
  4759. data = new Tooltip(this, _config);
  4760. $(this).data(DATA_KEY$6, data);
  4761. }
  4762. if (typeof config === 'string') {
  4763. if (typeof data[config] === 'undefined') {
  4764. throw new TypeError("No method named \"" + config + "\"");
  4765. }
  4766. data[config]();
  4767. }
  4768. });
  4769. };
  4770. _createClass(Tooltip, null, [{
  4771. key: "VERSION",
  4772. get: function get() {
  4773. return VERSION$6;
  4774. }
  4775. }, {
  4776. key: "Default",
  4777. get: function get() {
  4778. return Default$4;
  4779. }
  4780. }, {
  4781. key: "NAME",
  4782. get: function get() {
  4783. return NAME$6;
  4784. }
  4785. }, {
  4786. key: "DATA_KEY",
  4787. get: function get() {
  4788. return DATA_KEY$6;
  4789. }
  4790. }, {
  4791. key: "Event",
  4792. get: function get() {
  4793. return Event;
  4794. }
  4795. }, {
  4796. key: "EVENT_KEY",
  4797. get: function get() {
  4798. return EVENT_KEY$6;
  4799. }
  4800. }, {
  4801. key: "DefaultType",
  4802. get: function get() {
  4803. return DefaultType$4;
  4804. }
  4805. }]);
  4806. return Tooltip;
  4807. }();
  4808. /**
  4809. * ------------------------------------------------------------------------
  4810. * jQuery
  4811. * ------------------------------------------------------------------------
  4812. */
  4813. $.fn[NAME$6] = Tooltip._jQueryInterface;
  4814. $.fn[NAME$6].Constructor = Tooltip;
  4815. $.fn[NAME$6].noConflict = function () {
  4816. $.fn[NAME$6] = JQUERY_NO_CONFLICT$6;
  4817. return Tooltip._jQueryInterface;
  4818. };
  4819. /**
  4820. * ------------------------------------------------------------------------
  4821. * Constants
  4822. * ------------------------------------------------------------------------
  4823. */
  4824. var NAME$7 = 'popover';
  4825. var VERSION$7 = '4.5.0';
  4826. var DATA_KEY$7 = 'bs.popover';
  4827. var EVENT_KEY$7 = "." + DATA_KEY$7;
  4828. var JQUERY_NO_CONFLICT$7 = $.fn[NAME$7];
  4829. var CLASS_PREFIX$1 = 'bs-popover';
  4830. var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g');
  4831. var Default$5 = _objectSpread2(_objectSpread2({}, Tooltip.Default), {}, {
  4832. placement: 'right',
  4833. trigger: 'click',
  4834. content: '',
  4835. template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
  4836. });
  4837. var DefaultType$5 = _objectSpread2(_objectSpread2({}, Tooltip.DefaultType), {}, {
  4838. content: '(string|element|function)'
  4839. });
  4840. var CLASS_NAME_FADE$3 = 'fade';
  4841. var CLASS_NAME_SHOW$5 = 'show';
  4842. var SELECTOR_TITLE = '.popover-header';
  4843. var SELECTOR_CONTENT = '.popover-body';
  4844. var Event$1 = {
  4845. HIDE: "hide" + EVENT_KEY$7,
  4846. HIDDEN: "hidden" + EVENT_KEY$7,
  4847. SHOW: "show" + EVENT_KEY$7,
  4848. SHOWN: "shown" + EVENT_KEY$7,
  4849. INSERTED: "inserted" + EVENT_KEY$7,
  4850. CLICK: "click" + EVENT_KEY$7,
  4851. FOCUSIN: "focusin" + EVENT_KEY$7,
  4852. FOCUSOUT: "focusout" + EVENT_KEY$7,
  4853. MOUSEENTER: "mouseenter" + EVENT_KEY$7,
  4854. MOUSELEAVE: "mouseleave" + EVENT_KEY$7
  4855. };
  4856. /**
  4857. * ------------------------------------------------------------------------
  4858. * Class Definition
  4859. * ------------------------------------------------------------------------
  4860. */
  4861. var Popover = /*#__PURE__*/function (_Tooltip) {
  4862. _inheritsLoose(Popover, _Tooltip);
  4863. function Popover() {
  4864. return _Tooltip.apply(this, arguments) || this;
  4865. }
  4866. var _proto = Popover.prototype;
  4867. // Overrides
  4868. _proto.isWithContent = function isWithContent() {
  4869. return this.getTitle() || this._getContent();
  4870. };
  4871. _proto.addAttachmentClass = function addAttachmentClass(attachment) {
  4872. $(this.getTipElement()).addClass(CLASS_PREFIX$1 + "-" + attachment);
  4873. };
  4874. _proto.getTipElement = function getTipElement() {
  4875. this.tip = this.tip || $(this.config.template)[0];
  4876. return this.tip;
  4877. };
  4878. _proto.setContent = function setContent() {
  4879. var $tip = $(this.getTipElement()); // We use append for html objects to maintain js events
  4880. this.setElementContent($tip.find(SELECTOR_TITLE), this.getTitle());
  4881. var content = this._getContent();
  4882. if (typeof content === 'function') {
  4883. content = content.call(this.element);
  4884. }
  4885. this.setElementContent($tip.find(SELECTOR_CONTENT), content);
  4886. $tip.removeClass(CLASS_NAME_FADE$3 + " " + CLASS_NAME_SHOW$5);
  4887. } // Private
  4888. ;
  4889. _proto._getContent = function _getContent() {
  4890. return this.element.getAttribute('data-content') || this.config.content;
  4891. };
  4892. _proto._cleanTipClass = function _cleanTipClass() {
  4893. var $tip = $(this.getTipElement());
  4894. var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX$1);
  4895. if (tabClass !== null && tabClass.length > 0) {
  4896. $tip.removeClass(tabClass.join(''));
  4897. }
  4898. } // Static
  4899. ;
  4900. Popover._jQueryInterface = function _jQueryInterface(config) {
  4901. return this.each(function () {
  4902. var data = $(this).data(DATA_KEY$7);
  4903. var _config = typeof config === 'object' ? config : null;
  4904. if (!data && /dispose|hide/.test(config)) {
  4905. return;
  4906. }
  4907. if (!data) {
  4908. data = new Popover(this, _config);
  4909. $(this).data(DATA_KEY$7, data);
  4910. }
  4911. if (typeof config === 'string') {
  4912. if (typeof data[config] === 'undefined') {
  4913. throw new TypeError("No method named \"" + config + "\"");
  4914. }
  4915. data[config]();
  4916. }
  4917. });
  4918. };
  4919. _createClass(Popover, null, [{
  4920. key: "VERSION",
  4921. // Getters
  4922. get: function get() {
  4923. return VERSION$7;
  4924. }
  4925. }, {
  4926. key: "Default",
  4927. get: function get() {
  4928. return Default$5;
  4929. }
  4930. }, {
  4931. key: "NAME",
  4932. get: function get() {
  4933. return NAME$7;
  4934. }
  4935. }, {
  4936. key: "DATA_KEY",
  4937. get: function get() {
  4938. return DATA_KEY$7;
  4939. }
  4940. }, {
  4941. key: "Event",
  4942. get: function get() {
  4943. return Event$1;
  4944. }
  4945. }, {
  4946. key: "EVENT_KEY",
  4947. get: function get() {
  4948. return EVENT_KEY$7;
  4949. }
  4950. }, {
  4951. key: "DefaultType",
  4952. get: function get() {
  4953. return DefaultType$5;
  4954. }
  4955. }]);
  4956. return Popover;
  4957. }(Tooltip);
  4958. /**
  4959. * ------------------------------------------------------------------------
  4960. * jQuery
  4961. * ------------------------------------------------------------------------
  4962. */
  4963. $.fn[NAME$7] = Popover._jQueryInterface;
  4964. $.fn[NAME$7].Constructor = Popover;
  4965. $.fn[NAME$7].noConflict = function () {
  4966. $.fn[NAME$7] = JQUERY_NO_CONFLICT$7;
  4967. return Popover._jQueryInterface;
  4968. };
  4969. /**
  4970. * ------------------------------------------------------------------------
  4971. * Constants
  4972. * ------------------------------------------------------------------------
  4973. */
  4974. var NAME$8 = 'scrollspy';
  4975. var VERSION$8 = '4.5.0';
  4976. var DATA_KEY$8 = 'bs.scrollspy';
  4977. var EVENT_KEY$8 = "." + DATA_KEY$8;
  4978. var DATA_API_KEY$6 = '.data-api';
  4979. var JQUERY_NO_CONFLICT$8 = $.fn[NAME$8];
  4980. var Default$6 = {
  4981. offset: 10,
  4982. method: 'auto',
  4983. target: ''
  4984. };
  4985. var DefaultType$6 = {
  4986. offset: 'number',
  4987. method: 'string',
  4988. target: '(string|element)'
  4989. };
  4990. var EVENT_ACTIVATE = "activate" + EVENT_KEY$8;
  4991. var EVENT_SCROLL = "scroll" + EVENT_KEY$8;
  4992. var EVENT_LOAD_DATA_API$2 = "load" + EVENT_KEY$8 + DATA_API_KEY$6;
  4993. var CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item';
  4994. var CLASS_NAME_ACTIVE$2 = 'active';
  4995. var SELECTOR_DATA_SPY = '[data-spy="scroll"]';
  4996. var SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';
  4997. var SELECTOR_NAV_LINKS = '.nav-link';
  4998. var SELECTOR_NAV_ITEMS = '.nav-item';
  4999. var SELECTOR_LIST_ITEMS = '.list-group-item';
  5000. var SELECTOR_DROPDOWN = '.dropdown';
  5001. var SELECTOR_DROPDOWN_ITEMS = '.dropdown-item';
  5002. var SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';
  5003. var METHOD_OFFSET = 'offset';
  5004. var METHOD_POSITION = 'position';
  5005. /**
  5006. * ------------------------------------------------------------------------
  5007. * Class Definition
  5008. * ------------------------------------------------------------------------
  5009. */
  5010. var ScrollSpy = /*#__PURE__*/function () {
  5011. function ScrollSpy(element, config) {
  5012. var _this = this;
  5013. this._element = element;
  5014. this._scrollElement = element.tagName === 'BODY' ? window : element;
  5015. this._config = this._getConfig(config);
  5016. this._selector = this._config.target + " " + SELECTOR_NAV_LINKS + "," + (this._config.target + " " + SELECTOR_LIST_ITEMS + ",") + (this._config.target + " " + SELECTOR_DROPDOWN_ITEMS);
  5017. this._offsets = [];
  5018. this._targets = [];
  5019. this._activeTarget = null;
  5020. this._scrollHeight = 0;
  5021. $(this._scrollElement).on(EVENT_SCROLL, function (event) {
  5022. return _this._process(event);
  5023. });
  5024. this.refresh();
  5025. this._process();
  5026. } // Getters
  5027. var _proto = ScrollSpy.prototype;
  5028. // Public
  5029. _proto.refresh = function refresh() {
  5030. var _this2 = this;
  5031. var autoMethod = this._scrollElement === this._scrollElement.window ? METHOD_OFFSET : METHOD_POSITION;
  5032. var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
  5033. var offsetBase = offsetMethod === METHOD_POSITION ? this._getScrollTop() : 0;
  5034. this._offsets = [];
  5035. this._targets = [];
  5036. this._scrollHeight = this._getScrollHeight();
  5037. var targets = [].slice.call(document.querySelectorAll(this._selector));
  5038. targets.map(function (element) {
  5039. var target;
  5040. var targetSelector = Util.getSelectorFromElement(element);
  5041. if (targetSelector) {
  5042. target = document.querySelector(targetSelector);
  5043. }
  5044. if (target) {
  5045. var targetBCR = target.getBoundingClientRect();
  5046. if (targetBCR.width || targetBCR.height) {
  5047. // TODO (fat): remove sketch reliance on jQuery position/offset
  5048. return [$(target)[offsetMethod]().top + offsetBase, targetSelector];
  5049. }
  5050. }
  5051. return null;
  5052. }).filter(function (item) {
  5053. return item;
  5054. }).sort(function (a, b) {
  5055. return a[0] - b[0];
  5056. }).forEach(function (item) {
  5057. _this2._offsets.push(item[0]);
  5058. _this2._targets.push(item[1]);
  5059. });
  5060. };
  5061. _proto.dispose = function dispose() {
  5062. $.removeData(this._element, DATA_KEY$8);
  5063. $(this._scrollElement).off(EVENT_KEY$8);
  5064. this._element = null;
  5065. this._scrollElement = null;
  5066. this._config = null;
  5067. this._selector = null;
  5068. this._offsets = null;
  5069. this._targets = null;
  5070. this._activeTarget = null;
  5071. this._scrollHeight = null;
  5072. } // Private
  5073. ;
  5074. _proto._getConfig = function _getConfig(config) {
  5075. config = _objectSpread2(_objectSpread2({}, Default$6), typeof config === 'object' && config ? config : {});
  5076. if (typeof config.target !== 'string' && Util.isElement(config.target)) {
  5077. var id = $(config.target).attr('id');
  5078. if (!id) {
  5079. id = Util.getUID(NAME$8);
  5080. $(config.target).attr('id', id);
  5081. }
  5082. config.target = "#" + id;
  5083. }
  5084. Util.typeCheckConfig(NAME$8, config, DefaultType$6);
  5085. return config;
  5086. };
  5087. _proto._getScrollTop = function _getScrollTop() {
  5088. return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
  5089. };
  5090. _proto._getScrollHeight = function _getScrollHeight() {
  5091. return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
  5092. };
  5093. _proto._getOffsetHeight = function _getOffsetHeight() {
  5094. return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
  5095. };
  5096. _proto._process = function _process() {
  5097. var scrollTop = this._getScrollTop() + this._config.offset;
  5098. var scrollHeight = this._getScrollHeight();
  5099. var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
  5100. if (this._scrollHeight !== scrollHeight) {
  5101. this.refresh();
  5102. }
  5103. if (scrollTop >= maxScroll) {
  5104. var target = this._targets[this._targets.length - 1];
  5105. if (this._activeTarget !== target) {
  5106. this._activate(target);
  5107. }
  5108. return;
  5109. }
  5110. if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
  5111. this._activeTarget = null;
  5112. this._clear();
  5113. return;
  5114. }
  5115. for (var i = this._offsets.length; i--;) {
  5116. var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);
  5117. if (isActiveTarget) {
  5118. this._activate(this._targets[i]);
  5119. }
  5120. }
  5121. };
  5122. _proto._activate = function _activate(target) {
  5123. this._activeTarget = target;
  5124. this._clear();
  5125. var queries = this._selector.split(',').map(function (selector) {
  5126. return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]";
  5127. });
  5128. var $link = $([].slice.call(document.querySelectorAll(queries.join(','))));
  5129. if ($link.hasClass(CLASS_NAME_DROPDOWN_ITEM)) {
  5130. $link.closest(SELECTOR_DROPDOWN).find(SELECTOR_DROPDOWN_TOGGLE).addClass(CLASS_NAME_ACTIVE$2);
  5131. $link.addClass(CLASS_NAME_ACTIVE$2);
  5132. } else {
  5133. // Set triggered link as active
  5134. $link.addClass(CLASS_NAME_ACTIVE$2); // Set triggered links parents as active
  5135. // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
  5136. $link.parents(SELECTOR_NAV_LIST_GROUP).prev(SELECTOR_NAV_LINKS + ", " + SELECTOR_LIST_ITEMS).addClass(CLASS_NAME_ACTIVE$2); // Handle special case when .nav-link is inside .nav-item
  5137. $link.parents(SELECTOR_NAV_LIST_GROUP).prev(SELECTOR_NAV_ITEMS).children(SELECTOR_NAV_LINKS).addClass(CLASS_NAME_ACTIVE$2);
  5138. }
  5139. $(this._scrollElement).trigger(EVENT_ACTIVATE, {
  5140. relatedTarget: target
  5141. });
  5142. };
  5143. _proto._clear = function _clear() {
  5144. [].slice.call(document.querySelectorAll(this._selector)).filter(function (node) {
  5145. return node.classList.contains(CLASS_NAME_ACTIVE$2);
  5146. }).forEach(function (node) {
  5147. return node.classList.remove(CLASS_NAME_ACTIVE$2);
  5148. });
  5149. } // Static
  5150. ;
  5151. ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
  5152. return this.each(function () {
  5153. var data = $(this).data(DATA_KEY$8);
  5154. var _config = typeof config === 'object' && config;
  5155. if (!data) {
  5156. data = new ScrollSpy(this, _config);
  5157. $(this).data(DATA_KEY$8, data);
  5158. }
  5159. if (typeof config === 'string') {
  5160. if (typeof data[config] === 'undefined') {
  5161. throw new TypeError("No method named \"" + config + "\"");
  5162. }
  5163. data[config]();
  5164. }
  5165. });
  5166. };
  5167. _createClass(ScrollSpy, null, [{
  5168. key: "VERSION",
  5169. get: function get() {
  5170. return VERSION$8;
  5171. }
  5172. }, {
  5173. key: "Default",
  5174. get: function get() {
  5175. return Default$6;
  5176. }
  5177. }]);
  5178. return ScrollSpy;
  5179. }();
  5180. /**
  5181. * ------------------------------------------------------------------------
  5182. * Data Api implementation
  5183. * ------------------------------------------------------------------------
  5184. */
  5185. $(window).on(EVENT_LOAD_DATA_API$2, function () {
  5186. var scrollSpys = [].slice.call(document.querySelectorAll(SELECTOR_DATA_SPY));
  5187. var scrollSpysLength = scrollSpys.length;
  5188. for (var i = scrollSpysLength; i--;) {
  5189. var $spy = $(scrollSpys[i]);
  5190. ScrollSpy._jQueryInterface.call($spy, $spy.data());
  5191. }
  5192. });
  5193. /**
  5194. * ------------------------------------------------------------------------
  5195. * jQuery
  5196. * ------------------------------------------------------------------------
  5197. */
  5198. $.fn[NAME$8] = ScrollSpy._jQueryInterface;
  5199. $.fn[NAME$8].Constructor = ScrollSpy;
  5200. $.fn[NAME$8].noConflict = function () {
  5201. $.fn[NAME$8] = JQUERY_NO_CONFLICT$8;
  5202. return ScrollSpy._jQueryInterface;
  5203. };
  5204. /**
  5205. * ------------------------------------------------------------------------
  5206. * Constants
  5207. * ------------------------------------------------------------------------
  5208. */
  5209. var NAME$9 = 'tab';
  5210. var VERSION$9 = '4.5.0';
  5211. var DATA_KEY$9 = 'bs.tab';
  5212. var EVENT_KEY$9 = "." + DATA_KEY$9;
  5213. var DATA_API_KEY$7 = '.data-api';
  5214. var JQUERY_NO_CONFLICT$9 = $.fn[NAME$9];
  5215. var EVENT_HIDE$3 = "hide" + EVENT_KEY$9;
  5216. var EVENT_HIDDEN$3 = "hidden" + EVENT_KEY$9;
  5217. var EVENT_SHOW$3 = "show" + EVENT_KEY$9;
  5218. var EVENT_SHOWN$3 = "shown" + EVENT_KEY$9;
  5219. var EVENT_CLICK_DATA_API$6 = "click" + EVENT_KEY$9 + DATA_API_KEY$7;
  5220. var CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu';
  5221. var CLASS_NAME_ACTIVE$3 = 'active';
  5222. var CLASS_NAME_DISABLED$1 = 'disabled';
  5223. var CLASS_NAME_FADE$4 = 'fade';
  5224. var CLASS_NAME_SHOW$6 = 'show';
  5225. var SELECTOR_DROPDOWN$1 = '.dropdown';
  5226. var SELECTOR_NAV_LIST_GROUP$1 = '.nav, .list-group';
  5227. var SELECTOR_ACTIVE$2 = '.active';
  5228. var SELECTOR_ACTIVE_UL = '> li > .active';
  5229. var SELECTOR_DATA_TOGGLE$4 = '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]';
  5230. var SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle';
  5231. var SELECTOR_DROPDOWN_ACTIVE_CHILD = '> .dropdown-menu .active';
  5232. /**
  5233. * ------------------------------------------------------------------------
  5234. * Class Definition
  5235. * ------------------------------------------------------------------------
  5236. */
  5237. var Tab = /*#__PURE__*/function () {
  5238. function Tab(element) {
  5239. this._element = element;
  5240. } // Getters
  5241. var _proto = Tab.prototype;
  5242. // Public
  5243. _proto.show = function show() {
  5244. var _this = this;
  5245. if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(CLASS_NAME_ACTIVE$3) || $(this._element).hasClass(CLASS_NAME_DISABLED$1)) {
  5246. return;
  5247. }
  5248. var target;
  5249. var previous;
  5250. var listElement = $(this._element).closest(SELECTOR_NAV_LIST_GROUP$1)[0];
  5251. var selector = Util.getSelectorFromElement(this._element);
  5252. if (listElement) {
  5253. var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE$2;
  5254. previous = $.makeArray($(listElement).find(itemSelector));
  5255. previous = previous[previous.length - 1];
  5256. }
  5257. var hideEvent = $.Event(EVENT_HIDE$3, {
  5258. relatedTarget: this._element
  5259. });
  5260. var showEvent = $.Event(EVENT_SHOW$3, {
  5261. relatedTarget: previous
  5262. });
  5263. if (previous) {
  5264. $(previous).trigger(hideEvent);
  5265. }
  5266. $(this._element).trigger(showEvent);
  5267. if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
  5268. return;
  5269. }
  5270. if (selector) {
  5271. target = document.querySelector(selector);
  5272. }
  5273. this._activate(this._element, listElement);
  5274. var complete = function complete() {
  5275. var hiddenEvent = $.Event(EVENT_HIDDEN$3, {
  5276. relatedTarget: _this._element
  5277. });
  5278. var shownEvent = $.Event(EVENT_SHOWN$3, {
  5279. relatedTarget: previous
  5280. });
  5281. $(previous).trigger(hiddenEvent);
  5282. $(_this._element).trigger(shownEvent);
  5283. };
  5284. if (target) {
  5285. this._activate(target, target.parentNode, complete);
  5286. } else {
  5287. complete();
  5288. }
  5289. };
  5290. _proto.dispose = function dispose() {
  5291. $.removeData(this._element, DATA_KEY$9);
  5292. this._element = null;
  5293. } // Private
  5294. ;
  5295. _proto._activate = function _activate(element, container, callback) {
  5296. var _this2 = this;
  5297. var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $(container).find(SELECTOR_ACTIVE_UL) : $(container).children(SELECTOR_ACTIVE$2);
  5298. var active = activeElements[0];
  5299. var isTransitioning = callback && active && $(active).hasClass(CLASS_NAME_FADE$4);
  5300. var complete = function complete() {
  5301. return _this2._transitionComplete(element, active, callback);
  5302. };
  5303. if (active && isTransitioning) {
  5304. var transitionDuration = Util.getTransitionDurationFromElement(active);
  5305. $(active).removeClass(CLASS_NAME_SHOW$6).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  5306. } else {
  5307. complete();
  5308. }
  5309. };
  5310. _proto._transitionComplete = function _transitionComplete(element, active, callback) {
  5311. if (active) {
  5312. $(active).removeClass(CLASS_NAME_ACTIVE$3);
  5313. var dropdownChild = $(active.parentNode).find(SELECTOR_DROPDOWN_ACTIVE_CHILD)[0];
  5314. if (dropdownChild) {
  5315. $(dropdownChild).removeClass(CLASS_NAME_ACTIVE$3);
  5316. }
  5317. if (active.getAttribute('role') === 'tab') {
  5318. active.setAttribute('aria-selected', false);
  5319. }
  5320. }
  5321. $(element).addClass(CLASS_NAME_ACTIVE$3);
  5322. if (element.getAttribute('role') === 'tab') {
  5323. element.setAttribute('aria-selected', true);
  5324. }
  5325. Util.reflow(element);
  5326. if (element.classList.contains(CLASS_NAME_FADE$4)) {
  5327. element.classList.add(CLASS_NAME_SHOW$6);
  5328. }
  5329. if (element.parentNode && $(element.parentNode).hasClass(CLASS_NAME_DROPDOWN_MENU)) {
  5330. var dropdownElement = $(element).closest(SELECTOR_DROPDOWN$1)[0];
  5331. if (dropdownElement) {
  5332. var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(SELECTOR_DROPDOWN_TOGGLE$1));
  5333. $(dropdownToggleList).addClass(CLASS_NAME_ACTIVE$3);
  5334. }
  5335. element.setAttribute('aria-expanded', true);
  5336. }
  5337. if (callback) {
  5338. callback();
  5339. }
  5340. } // Static
  5341. ;
  5342. Tab._jQueryInterface = function _jQueryInterface(config) {
  5343. return this.each(function () {
  5344. var $this = $(this);
  5345. var data = $this.data(DATA_KEY$9);
  5346. if (!data) {
  5347. data = new Tab(this);
  5348. $this.data(DATA_KEY$9, data);
  5349. }
  5350. if (typeof config === 'string') {
  5351. if (typeof data[config] === 'undefined') {
  5352. throw new TypeError("No method named \"" + config + "\"");
  5353. }
  5354. data[config]();
  5355. }
  5356. });
  5357. };
  5358. _createClass(Tab, null, [{
  5359. key: "VERSION",
  5360. get: function get() {
  5361. return VERSION$9;
  5362. }
  5363. }]);
  5364. return Tab;
  5365. }();
  5366. /**
  5367. * ------------------------------------------------------------------------
  5368. * Data Api implementation
  5369. * ------------------------------------------------------------------------
  5370. */
  5371. $(document).on(EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$4, function (event) {
  5372. event.preventDefault();
  5373. Tab._jQueryInterface.call($(this), 'show');
  5374. });
  5375. /**
  5376. * ------------------------------------------------------------------------
  5377. * jQuery
  5378. * ------------------------------------------------------------------------
  5379. */
  5380. $.fn[NAME$9] = Tab._jQueryInterface;
  5381. $.fn[NAME$9].Constructor = Tab;
  5382. $.fn[NAME$9].noConflict = function () {
  5383. $.fn[NAME$9] = JQUERY_NO_CONFLICT$9;
  5384. return Tab._jQueryInterface;
  5385. };
  5386. /**
  5387. * ------------------------------------------------------------------------
  5388. * Constants
  5389. * ------------------------------------------------------------------------
  5390. */
  5391. var NAME$a = 'toast';
  5392. var VERSION$a = '4.5.0';
  5393. var DATA_KEY$a = 'bs.toast';
  5394. var EVENT_KEY$a = "." + DATA_KEY$a;
  5395. var JQUERY_NO_CONFLICT$a = $.fn[NAME$a];
  5396. var EVENT_CLICK_DISMISS$1 = "click.dismiss" + EVENT_KEY$a;
  5397. var EVENT_HIDE$4 = "hide" + EVENT_KEY$a;
  5398. var EVENT_HIDDEN$4 = "hidden" + EVENT_KEY$a;
  5399. var EVENT_SHOW$4 = "show" + EVENT_KEY$a;
  5400. var EVENT_SHOWN$4 = "shown" + EVENT_KEY$a;
  5401. var CLASS_NAME_FADE$5 = 'fade';
  5402. var CLASS_NAME_HIDE = 'hide';
  5403. var CLASS_NAME_SHOW$7 = 'show';
  5404. var CLASS_NAME_SHOWING = 'showing';
  5405. var DefaultType$7 = {
  5406. animation: 'boolean',
  5407. autohide: 'boolean',
  5408. delay: 'number'
  5409. };
  5410. var Default$7 = {
  5411. animation: true,
  5412. autohide: true,
  5413. delay: 500
  5414. };
  5415. var SELECTOR_DATA_DISMISS$1 = '[data-dismiss="toast"]';
  5416. /**
  5417. * ------------------------------------------------------------------------
  5418. * Class Definition
  5419. * ------------------------------------------------------------------------
  5420. */
  5421. var Toast = /*#__PURE__*/function () {
  5422. function Toast(element, config) {
  5423. this._element = element;
  5424. this._config = this._getConfig(config);
  5425. this._timeout = null;
  5426. this._setListeners();
  5427. } // Getters
  5428. var _proto = Toast.prototype;
  5429. // Public
  5430. _proto.show = function show() {
  5431. var _this = this;
  5432. var showEvent = $.Event(EVENT_SHOW$4);
  5433. $(this._element).trigger(showEvent);
  5434. if (showEvent.isDefaultPrevented()) {
  5435. return;
  5436. }
  5437. if (this._config.animation) {
  5438. this._element.classList.add(CLASS_NAME_FADE$5);
  5439. }
  5440. var complete = function complete() {
  5441. _this._element.classList.remove(CLASS_NAME_SHOWING);
  5442. _this._element.classList.add(CLASS_NAME_SHOW$7);
  5443. $(_this._element).trigger(EVENT_SHOWN$4);
  5444. if (_this._config.autohide) {
  5445. _this._timeout = setTimeout(function () {
  5446. _this.hide();
  5447. }, _this._config.delay);
  5448. }
  5449. };
  5450. this._element.classList.remove(CLASS_NAME_HIDE);
  5451. Util.reflow(this._element);
  5452. this._element.classList.add(CLASS_NAME_SHOWING);
  5453. if (this._config.animation) {
  5454. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  5455. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  5456. } else {
  5457. complete();
  5458. }
  5459. };
  5460. _proto.hide = function hide() {
  5461. if (!this._element.classList.contains(CLASS_NAME_SHOW$7)) {
  5462. return;
  5463. }
  5464. var hideEvent = $.Event(EVENT_HIDE$4);
  5465. $(this._element).trigger(hideEvent);
  5466. if (hideEvent.isDefaultPrevented()) {
  5467. return;
  5468. }
  5469. this._close();
  5470. };
  5471. _proto.dispose = function dispose() {
  5472. clearTimeout(this._timeout);
  5473. this._timeout = null;
  5474. if (this._element.classList.contains(CLASS_NAME_SHOW$7)) {
  5475. this._element.classList.remove(CLASS_NAME_SHOW$7);
  5476. }
  5477. $(this._element).off(EVENT_CLICK_DISMISS$1);
  5478. $.removeData(this._element, DATA_KEY$a);
  5479. this._element = null;
  5480. this._config = null;
  5481. } // Private
  5482. ;
  5483. _proto._getConfig = function _getConfig(config) {
  5484. config = _objectSpread2(_objectSpread2(_objectSpread2({}, Default$7), $(this._element).data()), typeof config === 'object' && config ? config : {});
  5485. Util.typeCheckConfig(NAME$a, config, this.constructor.DefaultType);
  5486. return config;
  5487. };
  5488. _proto._setListeners = function _setListeners() {
  5489. var _this2 = this;
  5490. $(this._element).on(EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, function () {
  5491. return _this2.hide();
  5492. });
  5493. };
  5494. _proto._close = function _close() {
  5495. var _this3 = this;
  5496. var complete = function complete() {
  5497. _this3._element.classList.add(CLASS_NAME_HIDE);
  5498. $(_this3._element).trigger(EVENT_HIDDEN$4);
  5499. };
  5500. this._element.classList.remove(CLASS_NAME_SHOW$7);
  5501. if (this._config.animation) {
  5502. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  5503. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  5504. } else {
  5505. complete();
  5506. }
  5507. } // Static
  5508. ;
  5509. Toast._jQueryInterface = function _jQueryInterface(config) {
  5510. return this.each(function () {
  5511. var $element = $(this);
  5512. var data = $element.data(DATA_KEY$a);
  5513. var _config = typeof config === 'object' && config;
  5514. if (!data) {
  5515. data = new Toast(this, _config);
  5516. $element.data(DATA_KEY$a, data);
  5517. }
  5518. if (typeof config === 'string') {
  5519. if (typeof data[config] === 'undefined') {
  5520. throw new TypeError("No method named \"" + config + "\"");
  5521. }
  5522. data[config](this);
  5523. }
  5524. });
  5525. };
  5526. _createClass(Toast, null, [{
  5527. key: "VERSION",
  5528. get: function get() {
  5529. return VERSION$a;
  5530. }
  5531. }, {
  5532. key: "DefaultType",
  5533. get: function get() {
  5534. return DefaultType$7;
  5535. }
  5536. }, {
  5537. key: "Default",
  5538. get: function get() {
  5539. return Default$7;
  5540. }
  5541. }]);
  5542. return Toast;
  5543. }();
  5544. /**
  5545. * ------------------------------------------------------------------------
  5546. * jQuery
  5547. * ------------------------------------------------------------------------
  5548. */
  5549. $.fn[NAME$a] = Toast._jQueryInterface;
  5550. $.fn[NAME$a].Constructor = Toast;
  5551. $.fn[NAME$a].noConflict = function () {
  5552. $.fn[NAME$a] = JQUERY_NO_CONFLICT$a;
  5553. return Toast._jQueryInterface;
  5554. };
  5555. exports.Alert = Alert;
  5556. exports.Button = Button;
  5557. exports.Carousel = Carousel;
  5558. exports.Collapse = Collapse;
  5559. exports.Dropdown = Dropdown;
  5560. exports.Modal = Modal;
  5561. exports.Popover = Popover;
  5562. exports.Scrollspy = ScrollSpy;
  5563. exports.Tab = Tab;
  5564. exports.Toast = Toast;
  5565. exports.Tooltip = Tooltip;
  5566. exports.Util = Util;
  5567. Object.defineProperty(exports, '__esModule', { value: true });
  5568. })));
  5569. //# sourceMappingURL=bootstrap.js.map
  5570. /***/ }),
  5571. /***/ "./node_modules/buffer/index.js":
  5572. /*!**************************************!*\
  5573. !*** ./node_modules/buffer/index.js ***!
  5574. \**************************************/
  5575. /*! no static exports found */
  5576. /***/ (function(module, exports, __webpack_require__) {
  5577. "use strict";
  5578. /* WEBPACK VAR INJECTION */(function(global) {/*!
  5579. * The buffer module from node.js, for the browser.
  5580. *
  5581. * @author Feross Aboukhadijeh <http://feross.org>
  5582. * @license MIT
  5583. */
  5584. /* eslint-disable no-proto */
  5585. var base64 = __webpack_require__(/*! base64-js */ "./node_modules/base64-js/index.js")
  5586. var ieee754 = __webpack_require__(/*! ieee754 */ "./node_modules/ieee754/index.js")
  5587. var isArray = __webpack_require__(/*! isarray */ "./node_modules/isarray/index.js")
  5588. exports.Buffer = Buffer
  5589. exports.SlowBuffer = SlowBuffer
  5590. exports.INSPECT_MAX_BYTES = 50
  5591. /**
  5592. * If `Buffer.TYPED_ARRAY_SUPPORT`:
  5593. * === true Use Uint8Array implementation (fastest)
  5594. * === false Use Object implementation (most compatible, even IE6)
  5595. *
  5596. * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
  5597. * Opera 11.6+, iOS 4.2+.
  5598. *
  5599. * Due to various browser bugs, sometimes the Object implementation will be used even
  5600. * when the browser supports typed arrays.
  5601. *
  5602. * Note:
  5603. *
  5604. * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
  5605. * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
  5606. *
  5607. * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
  5608. *
  5609. * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
  5610. * incorrect length in some situations.
  5611. * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
  5612. * get the Object implementation, which is slower but behaves correctly.
  5613. */
  5614. Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
  5615. ? global.TYPED_ARRAY_SUPPORT
  5616. : typedArraySupport()
  5617. /*
  5618. * Export kMaxLength after typed array support is determined.
  5619. */
  5620. exports.kMaxLength = kMaxLength()
  5621. function typedArraySupport () {
  5622. try {
  5623. var arr = new Uint8Array(1)
  5624. arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
  5625. return arr.foo() === 42 && // typed array instances can be augmented
  5626. typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
  5627. arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
  5628. } catch (e) {
  5629. return false
  5630. }
  5631. }
  5632. function kMaxLength () {
  5633. return Buffer.TYPED_ARRAY_SUPPORT
  5634. ? 0x7fffffff
  5635. : 0x3fffffff
  5636. }
  5637. function createBuffer (that, length) {
  5638. if (kMaxLength() < length) {
  5639. throw new RangeError('Invalid typed array length')
  5640. }
  5641. if (Buffer.TYPED_ARRAY_SUPPORT) {
  5642. // Return an augmented `Uint8Array` instance, for best performance
  5643. that = new Uint8Array(length)
  5644. that.__proto__ = Buffer.prototype
  5645. } else {
  5646. // Fallback: Return an object instance of the Buffer class
  5647. if (that === null) {
  5648. that = new Buffer(length)
  5649. }
  5650. that.length = length
  5651. }
  5652. return that
  5653. }
  5654. /**
  5655. * The Buffer constructor returns instances of `Uint8Array` that have their
  5656. * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
  5657. * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
  5658. * and the `Uint8Array` methods. Square bracket notation works as expected -- it
  5659. * returns a single octet.
  5660. *
  5661. * The `Uint8Array` prototype remains unmodified.
  5662. */
  5663. function Buffer (arg, encodingOrOffset, length) {
  5664. if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
  5665. return new Buffer(arg, encodingOrOffset, length)
  5666. }
  5667. // Common case.
  5668. if (typeof arg === 'number') {
  5669. if (typeof encodingOrOffset === 'string') {
  5670. throw new Error(
  5671. 'If encoding is specified then the first argument must be a string'
  5672. )
  5673. }
  5674. return allocUnsafe(this, arg)
  5675. }
  5676. return from(this, arg, encodingOrOffset, length)
  5677. }
  5678. Buffer.poolSize = 8192 // not used by this implementation
  5679. // TODO: Legacy, not needed anymore. Remove in next major version.
  5680. Buffer._augment = function (arr) {
  5681. arr.__proto__ = Buffer.prototype
  5682. return arr
  5683. }
  5684. function from (that, value, encodingOrOffset, length) {
  5685. if (typeof value === 'number') {
  5686. throw new TypeError('"value" argument must not be a number')
  5687. }
  5688. if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
  5689. return fromArrayBuffer(that, value, encodingOrOffset, length)
  5690. }
  5691. if (typeof value === 'string') {
  5692. return fromString(that, value, encodingOrOffset)
  5693. }
  5694. return fromObject(that, value)
  5695. }
  5696. /**
  5697. * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
  5698. * if value is a number.
  5699. * Buffer.from(str[, encoding])
  5700. * Buffer.from(array)
  5701. * Buffer.from(buffer)
  5702. * Buffer.from(arrayBuffer[, byteOffset[, length]])
  5703. **/
  5704. Buffer.from = function (value, encodingOrOffset, length) {
  5705. return from(null, value, encodingOrOffset, length)
  5706. }
  5707. if (Buffer.TYPED_ARRAY_SUPPORT) {
  5708. Buffer.prototype.__proto__ = Uint8Array.prototype
  5709. Buffer.__proto__ = Uint8Array
  5710. if (typeof Symbol !== 'undefined' && Symbol.species &&
  5711. Buffer[Symbol.species] === Buffer) {
  5712. // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
  5713. Object.defineProperty(Buffer, Symbol.species, {
  5714. value: null,
  5715. configurable: true
  5716. })
  5717. }
  5718. }
  5719. function assertSize (size) {
  5720. if (typeof size !== 'number') {
  5721. throw new TypeError('"size" argument must be a number')
  5722. } else if (size < 0) {
  5723. throw new RangeError('"size" argument must not be negative')
  5724. }
  5725. }
  5726. function alloc (that, size, fill, encoding) {
  5727. assertSize(size)
  5728. if (size <= 0) {
  5729. return createBuffer(that, size)
  5730. }
  5731. if (fill !== undefined) {
  5732. // Only pay attention to encoding if it's a string. This
  5733. // prevents accidentally sending in a number that would
  5734. // be interpretted as a start offset.
  5735. return typeof encoding === 'string'
  5736. ? createBuffer(that, size).fill(fill, encoding)
  5737. : createBuffer(that, size).fill(fill)
  5738. }
  5739. return createBuffer(that, size)
  5740. }
  5741. /**
  5742. * Creates a new filled Buffer instance.
  5743. * alloc(size[, fill[, encoding]])
  5744. **/
  5745. Buffer.alloc = function (size, fill, encoding) {
  5746. return alloc(null, size, fill, encoding)
  5747. }
  5748. function allocUnsafe (that, size) {
  5749. assertSize(size)
  5750. that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
  5751. if (!Buffer.TYPED_ARRAY_SUPPORT) {
  5752. for (var i = 0; i < size; ++i) {
  5753. that[i] = 0
  5754. }
  5755. }
  5756. return that
  5757. }
  5758. /**
  5759. * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
  5760. * */
  5761. Buffer.allocUnsafe = function (size) {
  5762. return allocUnsafe(null, size)
  5763. }
  5764. /**
  5765. * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
  5766. */
  5767. Buffer.allocUnsafeSlow = function (size) {
  5768. return allocUnsafe(null, size)
  5769. }
  5770. function fromString (that, string, encoding) {
  5771. if (typeof encoding !== 'string' || encoding === '') {
  5772. encoding = 'utf8'
  5773. }
  5774. if (!Buffer.isEncoding(encoding)) {
  5775. throw new TypeError('"encoding" must be a valid string encoding')
  5776. }
  5777. var length = byteLength(string, encoding) | 0
  5778. that = createBuffer(that, length)
  5779. var actual = that.write(string, encoding)
  5780. if (actual !== length) {
  5781. // Writing a hex string, for example, that contains invalid characters will
  5782. // cause everything after the first invalid character to be ignored. (e.g.
  5783. // 'abxxcd' will be treated as 'ab')
  5784. that = that.slice(0, actual)
  5785. }
  5786. return that
  5787. }
  5788. function fromArrayLike (that, array) {
  5789. var length = array.length < 0 ? 0 : checked(array.length) | 0
  5790. that = createBuffer(that, length)
  5791. for (var i = 0; i < length; i += 1) {
  5792. that[i] = array[i] & 255
  5793. }
  5794. return that
  5795. }
  5796. function fromArrayBuffer (that, array, byteOffset, length) {
  5797. array.byteLength // this throws if `array` is not a valid ArrayBuffer
  5798. if (byteOffset < 0 || array.byteLength < byteOffset) {
  5799. throw new RangeError('\'offset\' is out of bounds')
  5800. }
  5801. if (array.byteLength < byteOffset + (length || 0)) {
  5802. throw new RangeError('\'length\' is out of bounds')
  5803. }
  5804. if (byteOffset === undefined && length === undefined) {
  5805. array = new Uint8Array(array)
  5806. } else if (length === undefined) {
  5807. array = new Uint8Array(array, byteOffset)
  5808. } else {
  5809. array = new Uint8Array(array, byteOffset, length)
  5810. }
  5811. if (Buffer.TYPED_ARRAY_SUPPORT) {
  5812. // Return an augmented `Uint8Array` instance, for best performance
  5813. that = array
  5814. that.__proto__ = Buffer.prototype
  5815. } else {
  5816. // Fallback: Return an object instance of the Buffer class
  5817. that = fromArrayLike(that, array)
  5818. }
  5819. return that
  5820. }
  5821. function fromObject (that, obj) {
  5822. if (Buffer.isBuffer(obj)) {
  5823. var len = checked(obj.length) | 0
  5824. that = createBuffer(that, len)
  5825. if (that.length === 0) {
  5826. return that
  5827. }
  5828. obj.copy(that, 0, 0, len)
  5829. return that
  5830. }
  5831. if (obj) {
  5832. if ((typeof ArrayBuffer !== 'undefined' &&
  5833. obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
  5834. if (typeof obj.length !== 'number' || isnan(obj.length)) {
  5835. return createBuffer(that, 0)
  5836. }
  5837. return fromArrayLike(that, obj)
  5838. }
  5839. if (obj.type === 'Buffer' && isArray(obj.data)) {
  5840. return fromArrayLike(that, obj.data)
  5841. }
  5842. }
  5843. throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
  5844. }
  5845. function checked (length) {
  5846. // Note: cannot use `length < kMaxLength()` here because that fails when
  5847. // length is NaN (which is otherwise coerced to zero.)
  5848. if (length >= kMaxLength()) {
  5849. throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
  5850. 'size: 0x' + kMaxLength().toString(16) + ' bytes')
  5851. }
  5852. return length | 0
  5853. }
  5854. function SlowBuffer (length) {
  5855. if (+length != length) { // eslint-disable-line eqeqeq
  5856. length = 0
  5857. }
  5858. return Buffer.alloc(+length)
  5859. }
  5860. Buffer.isBuffer = function isBuffer (b) {
  5861. return !!(b != null && b._isBuffer)
  5862. }
  5863. Buffer.compare = function compare (a, b) {
  5864. if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
  5865. throw new TypeError('Arguments must be Buffers')
  5866. }
  5867. if (a === b) return 0
  5868. var x = a.length
  5869. var y = b.length
  5870. for (var i = 0, len = Math.min(x, y); i < len; ++i) {
  5871. if (a[i] !== b[i]) {
  5872. x = a[i]
  5873. y = b[i]
  5874. break
  5875. }
  5876. }
  5877. if (x < y) return -1
  5878. if (y < x) return 1
  5879. return 0
  5880. }
  5881. Buffer.isEncoding = function isEncoding (encoding) {
  5882. switch (String(encoding).toLowerCase()) {
  5883. case 'hex':
  5884. case 'utf8':
  5885. case 'utf-8':
  5886. case 'ascii':
  5887. case 'latin1':
  5888. case 'binary':
  5889. case 'base64':
  5890. case 'ucs2':
  5891. case 'ucs-2':
  5892. case 'utf16le':
  5893. case 'utf-16le':
  5894. return true
  5895. default:
  5896. return false
  5897. }
  5898. }
  5899. Buffer.concat = function concat (list, length) {
  5900. if (!isArray(list)) {
  5901. throw new TypeError('"list" argument must be an Array of Buffers')
  5902. }
  5903. if (list.length === 0) {
  5904. return Buffer.alloc(0)
  5905. }
  5906. var i
  5907. if (length === undefined) {
  5908. length = 0
  5909. for (i = 0; i < list.length; ++i) {
  5910. length += list[i].length
  5911. }
  5912. }
  5913. var buffer = Buffer.allocUnsafe(length)
  5914. var pos = 0
  5915. for (i = 0; i < list.length; ++i) {
  5916. var buf = list[i]
  5917. if (!Buffer.isBuffer(buf)) {
  5918. throw new TypeError('"list" argument must be an Array of Buffers')
  5919. }
  5920. buf.copy(buffer, pos)
  5921. pos += buf.length
  5922. }
  5923. return buffer
  5924. }
  5925. function byteLength (string, encoding) {
  5926. if (Buffer.isBuffer(string)) {
  5927. return string.length
  5928. }
  5929. if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
  5930. (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
  5931. return string.byteLength
  5932. }
  5933. if (typeof string !== 'string') {
  5934. string = '' + string
  5935. }
  5936. var len = string.length
  5937. if (len === 0) return 0
  5938. // Use a for loop to avoid recursion
  5939. var loweredCase = false
  5940. for (;;) {
  5941. switch (encoding) {
  5942. case 'ascii':
  5943. case 'latin1':
  5944. case 'binary':
  5945. return len
  5946. case 'utf8':
  5947. case 'utf-8':
  5948. case undefined:
  5949. return utf8ToBytes(string).length
  5950. case 'ucs2':
  5951. case 'ucs-2':
  5952. case 'utf16le':
  5953. case 'utf-16le':
  5954. return len * 2
  5955. case 'hex':
  5956. return len >>> 1
  5957. case 'base64':
  5958. return base64ToBytes(string).length
  5959. default:
  5960. if (loweredCase) return utf8ToBytes(string).length // assume utf8
  5961. encoding = ('' + encoding).toLowerCase()
  5962. loweredCase = true
  5963. }
  5964. }
  5965. }
  5966. Buffer.byteLength = byteLength
  5967. function slowToString (encoding, start, end) {
  5968. var loweredCase = false
  5969. // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
  5970. // property of a typed array.
  5971. // This behaves neither like String nor Uint8Array in that we set start/end
  5972. // to their upper/lower bounds if the value passed is out of range.
  5973. // undefined is handled specially as per ECMA-262 6th Edition,
  5974. // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
  5975. if (start === undefined || start < 0) {
  5976. start = 0
  5977. }
  5978. // Return early if start > this.length. Done here to prevent potential uint32
  5979. // coercion fail below.
  5980. if (start > this.length) {
  5981. return ''
  5982. }
  5983. if (end === undefined || end > this.length) {
  5984. end = this.length
  5985. }
  5986. if (end <= 0) {
  5987. return ''
  5988. }
  5989. // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
  5990. end >>>= 0
  5991. start >>>= 0
  5992. if (end <= start) {
  5993. return ''
  5994. }
  5995. if (!encoding) encoding = 'utf8'
  5996. while (true) {
  5997. switch (encoding) {
  5998. case 'hex':
  5999. return hexSlice(this, start, end)
  6000. case 'utf8':
  6001. case 'utf-8':
  6002. return utf8Slice(this, start, end)
  6003. case 'ascii':
  6004. return asciiSlice(this, start, end)
  6005. case 'latin1':
  6006. case 'binary':
  6007. return latin1Slice(this, start, end)
  6008. case 'base64':
  6009. return base64Slice(this, start, end)
  6010. case 'ucs2':
  6011. case 'ucs-2':
  6012. case 'utf16le':
  6013. case 'utf-16le':
  6014. return utf16leSlice(this, start, end)
  6015. default:
  6016. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  6017. encoding = (encoding + '').toLowerCase()
  6018. loweredCase = true
  6019. }
  6020. }
  6021. }
  6022. // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
  6023. // Buffer instances.
  6024. Buffer.prototype._isBuffer = true
  6025. function swap (b, n, m) {
  6026. var i = b[n]
  6027. b[n] = b[m]
  6028. b[m] = i
  6029. }
  6030. Buffer.prototype.swap16 = function swap16 () {
  6031. var len = this.length
  6032. if (len % 2 !== 0) {
  6033. throw new RangeError('Buffer size must be a multiple of 16-bits')
  6034. }
  6035. for (var i = 0; i < len; i += 2) {
  6036. swap(this, i, i + 1)
  6037. }
  6038. return this
  6039. }
  6040. Buffer.prototype.swap32 = function swap32 () {
  6041. var len = this.length
  6042. if (len % 4 !== 0) {
  6043. throw new RangeError('Buffer size must be a multiple of 32-bits')
  6044. }
  6045. for (var i = 0; i < len; i += 4) {
  6046. swap(this, i, i + 3)
  6047. swap(this, i + 1, i + 2)
  6048. }
  6049. return this
  6050. }
  6051. Buffer.prototype.swap64 = function swap64 () {
  6052. var len = this.length
  6053. if (len % 8 !== 0) {
  6054. throw new RangeError('Buffer size must be a multiple of 64-bits')
  6055. }
  6056. for (var i = 0; i < len; i += 8) {
  6057. swap(this, i, i + 7)
  6058. swap(this, i + 1, i + 6)
  6059. swap(this, i + 2, i + 5)
  6060. swap(this, i + 3, i + 4)
  6061. }
  6062. return this
  6063. }
  6064. Buffer.prototype.toString = function toString () {
  6065. var length = this.length | 0
  6066. if (length === 0) return ''
  6067. if (arguments.length === 0) return utf8Slice(this, 0, length)
  6068. return slowToString.apply(this, arguments)
  6069. }
  6070. Buffer.prototype.equals = function equals (b) {
  6071. if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
  6072. if (this === b) return true
  6073. return Buffer.compare(this, b) === 0
  6074. }
  6075. Buffer.prototype.inspect = function inspect () {
  6076. var str = ''
  6077. var max = exports.INSPECT_MAX_BYTES
  6078. if (this.length > 0) {
  6079. str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
  6080. if (this.length > max) str += ' ... '
  6081. }
  6082. return '<Buffer ' + str + '>'
  6083. }
  6084. Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
  6085. if (!Buffer.isBuffer(target)) {
  6086. throw new TypeError('Argument must be a Buffer')
  6087. }
  6088. if (start === undefined) {
  6089. start = 0
  6090. }
  6091. if (end === undefined) {
  6092. end = target ? target.length : 0
  6093. }
  6094. if (thisStart === undefined) {
  6095. thisStart = 0
  6096. }
  6097. if (thisEnd === undefined) {
  6098. thisEnd = this.length
  6099. }
  6100. if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
  6101. throw new RangeError('out of range index')
  6102. }
  6103. if (thisStart >= thisEnd && start >= end) {
  6104. return 0
  6105. }
  6106. if (thisStart >= thisEnd) {
  6107. return -1
  6108. }
  6109. if (start >= end) {
  6110. return 1
  6111. }
  6112. start >>>= 0
  6113. end >>>= 0
  6114. thisStart >>>= 0
  6115. thisEnd >>>= 0
  6116. if (this === target) return 0
  6117. var x = thisEnd - thisStart
  6118. var y = end - start
  6119. var len = Math.min(x, y)
  6120. var thisCopy = this.slice(thisStart, thisEnd)
  6121. var targetCopy = target.slice(start, end)
  6122. for (var i = 0; i < len; ++i) {
  6123. if (thisCopy[i] !== targetCopy[i]) {
  6124. x = thisCopy[i]
  6125. y = targetCopy[i]
  6126. break
  6127. }
  6128. }
  6129. if (x < y) return -1
  6130. if (y < x) return 1
  6131. return 0
  6132. }
  6133. // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
  6134. // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
  6135. //
  6136. // Arguments:
  6137. // - buffer - a Buffer to search
  6138. // - val - a string, Buffer, or number
  6139. // - byteOffset - an index into `buffer`; will be clamped to an int32
  6140. // - encoding - an optional encoding, relevant is val is a string
  6141. // - dir - true for indexOf, false for lastIndexOf
  6142. function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
  6143. // Empty buffer means no match
  6144. if (buffer.length === 0) return -1
  6145. // Normalize byteOffset
  6146. if (typeof byteOffset === 'string') {
  6147. encoding = byteOffset
  6148. byteOffset = 0
  6149. } else if (byteOffset > 0x7fffffff) {
  6150. byteOffset = 0x7fffffff
  6151. } else if (byteOffset < -0x80000000) {
  6152. byteOffset = -0x80000000
  6153. }
  6154. byteOffset = +byteOffset // Coerce to Number.
  6155. if (isNaN(byteOffset)) {
  6156. // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
  6157. byteOffset = dir ? 0 : (buffer.length - 1)
  6158. }
  6159. // Normalize byteOffset: negative offsets start from the end of the buffer
  6160. if (byteOffset < 0) byteOffset = buffer.length + byteOffset
  6161. if (byteOffset >= buffer.length) {
  6162. if (dir) return -1
  6163. else byteOffset = buffer.length - 1
  6164. } else if (byteOffset < 0) {
  6165. if (dir) byteOffset = 0
  6166. else return -1
  6167. }
  6168. // Normalize val
  6169. if (typeof val === 'string') {
  6170. val = Buffer.from(val, encoding)
  6171. }
  6172. // Finally, search either indexOf (if dir is true) or lastIndexOf
  6173. if (Buffer.isBuffer(val)) {
  6174. // Special case: looking for empty string/buffer always fails
  6175. if (val.length === 0) {
  6176. return -1
  6177. }
  6178. return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
  6179. } else if (typeof val === 'number') {
  6180. val = val & 0xFF // Search for a byte value [0-255]
  6181. if (Buffer.TYPED_ARRAY_SUPPORT &&
  6182. typeof Uint8Array.prototype.indexOf === 'function') {
  6183. if (dir) {
  6184. return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
  6185. } else {
  6186. return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
  6187. }
  6188. }
  6189. return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
  6190. }
  6191. throw new TypeError('val must be string, number or Buffer')
  6192. }
  6193. function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
  6194. var indexSize = 1
  6195. var arrLength = arr.length
  6196. var valLength = val.length
  6197. if (encoding !== undefined) {
  6198. encoding = String(encoding).toLowerCase()
  6199. if (encoding === 'ucs2' || encoding === 'ucs-2' ||
  6200. encoding === 'utf16le' || encoding === 'utf-16le') {
  6201. if (arr.length < 2 || val.length < 2) {
  6202. return -1
  6203. }
  6204. indexSize = 2
  6205. arrLength /= 2
  6206. valLength /= 2
  6207. byteOffset /= 2
  6208. }
  6209. }
  6210. function read (buf, i) {
  6211. if (indexSize === 1) {
  6212. return buf[i]
  6213. } else {
  6214. return buf.readUInt16BE(i * indexSize)
  6215. }
  6216. }
  6217. var i
  6218. if (dir) {
  6219. var foundIndex = -1
  6220. for (i = byteOffset; i < arrLength; i++) {
  6221. if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
  6222. if (foundIndex === -1) foundIndex = i
  6223. if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
  6224. } else {
  6225. if (foundIndex !== -1) i -= i - foundIndex
  6226. foundIndex = -1
  6227. }
  6228. }
  6229. } else {
  6230. if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
  6231. for (i = byteOffset; i >= 0; i--) {
  6232. var found = true
  6233. for (var j = 0; j < valLength; j++) {
  6234. if (read(arr, i + j) !== read(val, j)) {
  6235. found = false
  6236. break
  6237. }
  6238. }
  6239. if (found) return i
  6240. }
  6241. }
  6242. return -1
  6243. }
  6244. Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
  6245. return this.indexOf(val, byteOffset, encoding) !== -1
  6246. }
  6247. Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
  6248. return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
  6249. }
  6250. Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
  6251. return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
  6252. }
  6253. function hexWrite (buf, string, offset, length) {
  6254. offset = Number(offset) || 0
  6255. var remaining = buf.length - offset
  6256. if (!length) {
  6257. length = remaining
  6258. } else {
  6259. length = Number(length)
  6260. if (length > remaining) {
  6261. length = remaining
  6262. }
  6263. }
  6264. // must be an even number of digits
  6265. var strLen = string.length
  6266. if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
  6267. if (length > strLen / 2) {
  6268. length = strLen / 2
  6269. }
  6270. for (var i = 0; i < length; ++i) {
  6271. var parsed = parseInt(string.substr(i * 2, 2), 16)
  6272. if (isNaN(parsed)) return i
  6273. buf[offset + i] = parsed
  6274. }
  6275. return i
  6276. }
  6277. function utf8Write (buf, string, offset, length) {
  6278. return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
  6279. }
  6280. function asciiWrite (buf, string, offset, length) {
  6281. return blitBuffer(asciiToBytes(string), buf, offset, length)
  6282. }
  6283. function latin1Write (buf, string, offset, length) {
  6284. return asciiWrite(buf, string, offset, length)
  6285. }
  6286. function base64Write (buf, string, offset, length) {
  6287. return blitBuffer(base64ToBytes(string), buf, offset, length)
  6288. }
  6289. function ucs2Write (buf, string, offset, length) {
  6290. return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
  6291. }
  6292. Buffer.prototype.write = function write (string, offset, length, encoding) {
  6293. // Buffer#write(string)
  6294. if (offset === undefined) {
  6295. encoding = 'utf8'
  6296. length = this.length
  6297. offset = 0
  6298. // Buffer#write(string, encoding)
  6299. } else if (length === undefined && typeof offset === 'string') {
  6300. encoding = offset
  6301. length = this.length
  6302. offset = 0
  6303. // Buffer#write(string, offset[, length][, encoding])
  6304. } else if (isFinite(offset)) {
  6305. offset = offset | 0
  6306. if (isFinite(length)) {
  6307. length = length | 0
  6308. if (encoding === undefined) encoding = 'utf8'
  6309. } else {
  6310. encoding = length
  6311. length = undefined
  6312. }
  6313. // legacy write(string, encoding, offset, length) - remove in v0.13
  6314. } else {
  6315. throw new Error(
  6316. 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
  6317. )
  6318. }
  6319. var remaining = this.length - offset
  6320. if (length === undefined || length > remaining) length = remaining
  6321. if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
  6322. throw new RangeError('Attempt to write outside buffer bounds')
  6323. }
  6324. if (!encoding) encoding = 'utf8'
  6325. var loweredCase = false
  6326. for (;;) {
  6327. switch (encoding) {
  6328. case 'hex':
  6329. return hexWrite(this, string, offset, length)
  6330. case 'utf8':
  6331. case 'utf-8':
  6332. return utf8Write(this, string, offset, length)
  6333. case 'ascii':
  6334. return asciiWrite(this, string, offset, length)
  6335. case 'latin1':
  6336. case 'binary':
  6337. return latin1Write(this, string, offset, length)
  6338. case 'base64':
  6339. // Warning: maxLength not taken into account in base64Write
  6340. return base64Write(this, string, offset, length)
  6341. case 'ucs2':
  6342. case 'ucs-2':
  6343. case 'utf16le':
  6344. case 'utf-16le':
  6345. return ucs2Write(this, string, offset, length)
  6346. default:
  6347. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  6348. encoding = ('' + encoding).toLowerCase()
  6349. loweredCase = true
  6350. }
  6351. }
  6352. }
  6353. Buffer.prototype.toJSON = function toJSON () {
  6354. return {
  6355. type: 'Buffer',
  6356. data: Array.prototype.slice.call(this._arr || this, 0)
  6357. }
  6358. }
  6359. function base64Slice (buf, start, end) {
  6360. if (start === 0 && end === buf.length) {
  6361. return base64.fromByteArray(buf)
  6362. } else {
  6363. return base64.fromByteArray(buf.slice(start, end))
  6364. }
  6365. }
  6366. function utf8Slice (buf, start, end) {
  6367. end = Math.min(buf.length, end)
  6368. var res = []
  6369. var i = start
  6370. while (i < end) {
  6371. var firstByte = buf[i]
  6372. var codePoint = null
  6373. var bytesPerSequence = (firstByte > 0xEF) ? 4
  6374. : (firstByte > 0xDF) ? 3
  6375. : (firstByte > 0xBF) ? 2
  6376. : 1
  6377. if (i + bytesPerSequence <= end) {
  6378. var secondByte, thirdByte, fourthByte, tempCodePoint
  6379. switch (bytesPerSequence) {
  6380. case 1:
  6381. if (firstByte < 0x80) {
  6382. codePoint = firstByte
  6383. }
  6384. break
  6385. case 2:
  6386. secondByte = buf[i + 1]
  6387. if ((secondByte & 0xC0) === 0x80) {
  6388. tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
  6389. if (tempCodePoint > 0x7F) {
  6390. codePoint = tempCodePoint
  6391. }
  6392. }
  6393. break
  6394. case 3:
  6395. secondByte = buf[i + 1]
  6396. thirdByte = buf[i + 2]
  6397. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
  6398. tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
  6399. if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
  6400. codePoint = tempCodePoint
  6401. }
  6402. }
  6403. break
  6404. case 4:
  6405. secondByte = buf[i + 1]
  6406. thirdByte = buf[i + 2]
  6407. fourthByte = buf[i + 3]
  6408. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
  6409. tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
  6410. if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
  6411. codePoint = tempCodePoint
  6412. }
  6413. }
  6414. }
  6415. }
  6416. if (codePoint === null) {
  6417. // we did not generate a valid codePoint so insert a
  6418. // replacement char (U+FFFD) and advance only 1 byte
  6419. codePoint = 0xFFFD
  6420. bytesPerSequence = 1
  6421. } else if (codePoint > 0xFFFF) {
  6422. // encode to utf16 (surrogate pair dance)
  6423. codePoint -= 0x10000
  6424. res.push(codePoint >>> 10 & 0x3FF | 0xD800)
  6425. codePoint = 0xDC00 | codePoint & 0x3FF
  6426. }
  6427. res.push(codePoint)
  6428. i += bytesPerSequence
  6429. }
  6430. return decodeCodePointsArray(res)
  6431. }
  6432. // Based on http://stackoverflow.com/a/22747272/680742, the browser with
  6433. // the lowest limit is Chrome, with 0x10000 args.
  6434. // We go 1 magnitude less, for safety
  6435. var MAX_ARGUMENTS_LENGTH = 0x1000
  6436. function decodeCodePointsArray (codePoints) {
  6437. var len = codePoints.length
  6438. if (len <= MAX_ARGUMENTS_LENGTH) {
  6439. return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
  6440. }
  6441. // Decode in chunks to avoid "call stack size exceeded".
  6442. var res = ''
  6443. var i = 0
  6444. while (i < len) {
  6445. res += String.fromCharCode.apply(
  6446. String,
  6447. codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
  6448. )
  6449. }
  6450. return res
  6451. }
  6452. function asciiSlice (buf, start, end) {
  6453. var ret = ''
  6454. end = Math.min(buf.length, end)
  6455. for (var i = start; i < end; ++i) {
  6456. ret += String.fromCharCode(buf[i] & 0x7F)
  6457. }
  6458. return ret
  6459. }
  6460. function latin1Slice (buf, start, end) {
  6461. var ret = ''
  6462. end = Math.min(buf.length, end)
  6463. for (var i = start; i < end; ++i) {
  6464. ret += String.fromCharCode(buf[i])
  6465. }
  6466. return ret
  6467. }
  6468. function hexSlice (buf, start, end) {
  6469. var len = buf.length
  6470. if (!start || start < 0) start = 0
  6471. if (!end || end < 0 || end > len) end = len
  6472. var out = ''
  6473. for (var i = start; i < end; ++i) {
  6474. out += toHex(buf[i])
  6475. }
  6476. return out
  6477. }
  6478. function utf16leSlice (buf, start, end) {
  6479. var bytes = buf.slice(start, end)
  6480. var res = ''
  6481. for (var i = 0; i < bytes.length; i += 2) {
  6482. res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
  6483. }
  6484. return res
  6485. }
  6486. Buffer.prototype.slice = function slice (start, end) {
  6487. var len = this.length
  6488. start = ~~start
  6489. end = end === undefined ? len : ~~end
  6490. if (start < 0) {
  6491. start += len
  6492. if (start < 0) start = 0
  6493. } else if (start > len) {
  6494. start = len
  6495. }
  6496. if (end < 0) {
  6497. end += len
  6498. if (end < 0) end = 0
  6499. } else if (end > len) {
  6500. end = len
  6501. }
  6502. if (end < start) end = start
  6503. var newBuf
  6504. if (Buffer.TYPED_ARRAY_SUPPORT) {
  6505. newBuf = this.subarray(start, end)
  6506. newBuf.__proto__ = Buffer.prototype
  6507. } else {
  6508. var sliceLen = end - start
  6509. newBuf = new Buffer(sliceLen, undefined)
  6510. for (var i = 0; i < sliceLen; ++i) {
  6511. newBuf[i] = this[i + start]
  6512. }
  6513. }
  6514. return newBuf
  6515. }
  6516. /*
  6517. * Need to make sure that buffer isn't trying to write out of bounds.
  6518. */
  6519. function checkOffset (offset, ext, length) {
  6520. if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
  6521. if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
  6522. }
  6523. Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
  6524. offset = offset | 0
  6525. byteLength = byteLength | 0
  6526. if (!noAssert) checkOffset(offset, byteLength, this.length)
  6527. var val = this[offset]
  6528. var mul = 1
  6529. var i = 0
  6530. while (++i < byteLength && (mul *= 0x100)) {
  6531. val += this[offset + i] * mul
  6532. }
  6533. return val
  6534. }
  6535. Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
  6536. offset = offset | 0
  6537. byteLength = byteLength | 0
  6538. if (!noAssert) {
  6539. checkOffset(offset, byteLength, this.length)
  6540. }
  6541. var val = this[offset + --byteLength]
  6542. var mul = 1
  6543. while (byteLength > 0 && (mul *= 0x100)) {
  6544. val += this[offset + --byteLength] * mul
  6545. }
  6546. return val
  6547. }
  6548. Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
  6549. if (!noAssert) checkOffset(offset, 1, this.length)
  6550. return this[offset]
  6551. }
  6552. Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
  6553. if (!noAssert) checkOffset(offset, 2, this.length)
  6554. return this[offset] | (this[offset + 1] << 8)
  6555. }
  6556. Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
  6557. if (!noAssert) checkOffset(offset, 2, this.length)
  6558. return (this[offset] << 8) | this[offset + 1]
  6559. }
  6560. Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
  6561. if (!noAssert) checkOffset(offset, 4, this.length)
  6562. return ((this[offset]) |
  6563. (this[offset + 1] << 8) |
  6564. (this[offset + 2] << 16)) +
  6565. (this[offset + 3] * 0x1000000)
  6566. }
  6567. Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
  6568. if (!noAssert) checkOffset(offset, 4, this.length)
  6569. return (this[offset] * 0x1000000) +
  6570. ((this[offset + 1] << 16) |
  6571. (this[offset + 2] << 8) |
  6572. this[offset + 3])
  6573. }
  6574. Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
  6575. offset = offset | 0
  6576. byteLength = byteLength | 0
  6577. if (!noAssert) checkOffset(offset, byteLength, this.length)
  6578. var val = this[offset]
  6579. var mul = 1
  6580. var i = 0
  6581. while (++i < byteLength && (mul *= 0x100)) {
  6582. val += this[offset + i] * mul
  6583. }
  6584. mul *= 0x80
  6585. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  6586. return val
  6587. }
  6588. Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
  6589. offset = offset | 0
  6590. byteLength = byteLength | 0
  6591. if (!noAssert) checkOffset(offset, byteLength, this.length)
  6592. var i = byteLength
  6593. var mul = 1
  6594. var val = this[offset + --i]
  6595. while (i > 0 && (mul *= 0x100)) {
  6596. val += this[offset + --i] * mul
  6597. }
  6598. mul *= 0x80
  6599. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  6600. return val
  6601. }
  6602. Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
  6603. if (!noAssert) checkOffset(offset, 1, this.length)
  6604. if (!(this[offset] & 0x80)) return (this[offset])
  6605. return ((0xff - this[offset] + 1) * -1)
  6606. }
  6607. Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
  6608. if (!noAssert) checkOffset(offset, 2, this.length)
  6609. var val = this[offset] | (this[offset + 1] << 8)
  6610. return (val & 0x8000) ? val | 0xFFFF0000 : val
  6611. }
  6612. Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
  6613. if (!noAssert) checkOffset(offset, 2, this.length)
  6614. var val = this[offset + 1] | (this[offset] << 8)
  6615. return (val & 0x8000) ? val | 0xFFFF0000 : val
  6616. }
  6617. Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
  6618. if (!noAssert) checkOffset(offset, 4, this.length)
  6619. return (this[offset]) |
  6620. (this[offset + 1] << 8) |
  6621. (this[offset + 2] << 16) |
  6622. (this[offset + 3] << 24)
  6623. }
  6624. Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
  6625. if (!noAssert) checkOffset(offset, 4, this.length)
  6626. return (this[offset] << 24) |
  6627. (this[offset + 1] << 16) |
  6628. (this[offset + 2] << 8) |
  6629. (this[offset + 3])
  6630. }
  6631. Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
  6632. if (!noAssert) checkOffset(offset, 4, this.length)
  6633. return ieee754.read(this, offset, true, 23, 4)
  6634. }
  6635. Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
  6636. if (!noAssert) checkOffset(offset, 4, this.length)
  6637. return ieee754.read(this, offset, false, 23, 4)
  6638. }
  6639. Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
  6640. if (!noAssert) checkOffset(offset, 8, this.length)
  6641. return ieee754.read(this, offset, true, 52, 8)
  6642. }
  6643. Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
  6644. if (!noAssert) checkOffset(offset, 8, this.length)
  6645. return ieee754.read(this, offset, false, 52, 8)
  6646. }
  6647. function checkInt (buf, value, offset, ext, max, min) {
  6648. if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
  6649. if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
  6650. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  6651. }
  6652. Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
  6653. value = +value
  6654. offset = offset | 0
  6655. byteLength = byteLength | 0
  6656. if (!noAssert) {
  6657. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  6658. checkInt(this, value, offset, byteLength, maxBytes, 0)
  6659. }
  6660. var mul = 1
  6661. var i = 0
  6662. this[offset] = value & 0xFF
  6663. while (++i < byteLength && (mul *= 0x100)) {
  6664. this[offset + i] = (value / mul) & 0xFF
  6665. }
  6666. return offset + byteLength
  6667. }
  6668. Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
  6669. value = +value
  6670. offset = offset | 0
  6671. byteLength = byteLength | 0
  6672. if (!noAssert) {
  6673. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  6674. checkInt(this, value, offset, byteLength, maxBytes, 0)
  6675. }
  6676. var i = byteLength - 1
  6677. var mul = 1
  6678. this[offset + i] = value & 0xFF
  6679. while (--i >= 0 && (mul *= 0x100)) {
  6680. this[offset + i] = (value / mul) & 0xFF
  6681. }
  6682. return offset + byteLength
  6683. }
  6684. Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
  6685. value = +value
  6686. offset = offset | 0
  6687. if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
  6688. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  6689. this[offset] = (value & 0xff)
  6690. return offset + 1
  6691. }
  6692. function objectWriteUInt16 (buf, value, offset, littleEndian) {
  6693. if (value < 0) value = 0xffff + value + 1
  6694. for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
  6695. buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
  6696. (littleEndian ? i : 1 - i) * 8
  6697. }
  6698. }
  6699. Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
  6700. value = +value
  6701. offset = offset | 0
  6702. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  6703. if (Buffer.TYPED_ARRAY_SUPPORT) {
  6704. this[offset] = (value & 0xff)
  6705. this[offset + 1] = (value >>> 8)
  6706. } else {
  6707. objectWriteUInt16(this, value, offset, true)
  6708. }
  6709. return offset + 2
  6710. }
  6711. Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
  6712. value = +value
  6713. offset = offset | 0
  6714. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  6715. if (Buffer.TYPED_ARRAY_SUPPORT) {
  6716. this[offset] = (value >>> 8)
  6717. this[offset + 1] = (value & 0xff)
  6718. } else {
  6719. objectWriteUInt16(this, value, offset, false)
  6720. }
  6721. return offset + 2
  6722. }
  6723. function objectWriteUInt32 (buf, value, offset, littleEndian) {
  6724. if (value < 0) value = 0xffffffff + value + 1
  6725. for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
  6726. buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
  6727. }
  6728. }
  6729. Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
  6730. value = +value
  6731. offset = offset | 0
  6732. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  6733. if (Buffer.TYPED_ARRAY_SUPPORT) {
  6734. this[offset + 3] = (value >>> 24)
  6735. this[offset + 2] = (value >>> 16)
  6736. this[offset + 1] = (value >>> 8)
  6737. this[offset] = (value & 0xff)
  6738. } else {
  6739. objectWriteUInt32(this, value, offset, true)
  6740. }
  6741. return offset + 4
  6742. }
  6743. Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
  6744. value = +value
  6745. offset = offset | 0
  6746. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  6747. if (Buffer.TYPED_ARRAY_SUPPORT) {
  6748. this[offset] = (value >>> 24)
  6749. this[offset + 1] = (value >>> 16)
  6750. this[offset + 2] = (value >>> 8)
  6751. this[offset + 3] = (value & 0xff)
  6752. } else {
  6753. objectWriteUInt32(this, value, offset, false)
  6754. }
  6755. return offset + 4
  6756. }
  6757. Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
  6758. value = +value
  6759. offset = offset | 0
  6760. if (!noAssert) {
  6761. var limit = Math.pow(2, 8 * byteLength - 1)
  6762. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  6763. }
  6764. var i = 0
  6765. var mul = 1
  6766. var sub = 0
  6767. this[offset] = value & 0xFF
  6768. while (++i < byteLength && (mul *= 0x100)) {
  6769. if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
  6770. sub = 1
  6771. }
  6772. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  6773. }
  6774. return offset + byteLength
  6775. }
  6776. Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
  6777. value = +value
  6778. offset = offset | 0
  6779. if (!noAssert) {
  6780. var limit = Math.pow(2, 8 * byteLength - 1)
  6781. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  6782. }
  6783. var i = byteLength - 1
  6784. var mul = 1
  6785. var sub = 0
  6786. this[offset + i] = value & 0xFF
  6787. while (--i >= 0 && (mul *= 0x100)) {
  6788. if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
  6789. sub = 1
  6790. }
  6791. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  6792. }
  6793. return offset + byteLength
  6794. }
  6795. Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
  6796. value = +value
  6797. offset = offset | 0
  6798. if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
  6799. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  6800. if (value < 0) value = 0xff + value + 1
  6801. this[offset] = (value & 0xff)
  6802. return offset + 1
  6803. }
  6804. Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
  6805. value = +value
  6806. offset = offset | 0
  6807. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  6808. if (Buffer.TYPED_ARRAY_SUPPORT) {
  6809. this[offset] = (value & 0xff)
  6810. this[offset + 1] = (value >>> 8)
  6811. } else {
  6812. objectWriteUInt16(this, value, offset, true)
  6813. }
  6814. return offset + 2
  6815. }
  6816. Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
  6817. value = +value
  6818. offset = offset | 0
  6819. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  6820. if (Buffer.TYPED_ARRAY_SUPPORT) {
  6821. this[offset] = (value >>> 8)
  6822. this[offset + 1] = (value & 0xff)
  6823. } else {
  6824. objectWriteUInt16(this, value, offset, false)
  6825. }
  6826. return offset + 2
  6827. }
  6828. Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
  6829. value = +value
  6830. offset = offset | 0
  6831. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  6832. if (Buffer.TYPED_ARRAY_SUPPORT) {
  6833. this[offset] = (value & 0xff)
  6834. this[offset + 1] = (value >>> 8)
  6835. this[offset + 2] = (value >>> 16)
  6836. this[offset + 3] = (value >>> 24)
  6837. } else {
  6838. objectWriteUInt32(this, value, offset, true)
  6839. }
  6840. return offset + 4
  6841. }
  6842. Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
  6843. value = +value
  6844. offset = offset | 0
  6845. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  6846. if (value < 0) value = 0xffffffff + value + 1
  6847. if (Buffer.TYPED_ARRAY_SUPPORT) {
  6848. this[offset] = (value >>> 24)
  6849. this[offset + 1] = (value >>> 16)
  6850. this[offset + 2] = (value >>> 8)
  6851. this[offset + 3] = (value & 0xff)
  6852. } else {
  6853. objectWriteUInt32(this, value, offset, false)
  6854. }
  6855. return offset + 4
  6856. }
  6857. function checkIEEE754 (buf, value, offset, ext, max, min) {
  6858. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  6859. if (offset < 0) throw new RangeError('Index out of range')
  6860. }
  6861. function writeFloat (buf, value, offset, littleEndian, noAssert) {
  6862. if (!noAssert) {
  6863. checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
  6864. }
  6865. ieee754.write(buf, value, offset, littleEndian, 23, 4)
  6866. return offset + 4
  6867. }
  6868. Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
  6869. return writeFloat(this, value, offset, true, noAssert)
  6870. }
  6871. Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
  6872. return writeFloat(this, value, offset, false, noAssert)
  6873. }
  6874. function writeDouble (buf, value, offset, littleEndian, noAssert) {
  6875. if (!noAssert) {
  6876. checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
  6877. }
  6878. ieee754.write(buf, value, offset, littleEndian, 52, 8)
  6879. return offset + 8
  6880. }
  6881. Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
  6882. return writeDouble(this, value, offset, true, noAssert)
  6883. }
  6884. Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
  6885. return writeDouble(this, value, offset, false, noAssert)
  6886. }
  6887. // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
  6888. Buffer.prototype.copy = function copy (target, targetStart, start, end) {
  6889. if (!start) start = 0
  6890. if (!end && end !== 0) end = this.length
  6891. if (targetStart >= target.length) targetStart = target.length
  6892. if (!targetStart) targetStart = 0
  6893. if (end > 0 && end < start) end = start
  6894. // Copy 0 bytes; we're done
  6895. if (end === start) return 0
  6896. if (target.length === 0 || this.length === 0) return 0
  6897. // Fatal error conditions
  6898. if (targetStart < 0) {
  6899. throw new RangeError('targetStart out of bounds')
  6900. }
  6901. if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
  6902. if (end < 0) throw new RangeError('sourceEnd out of bounds')
  6903. // Are we oob?
  6904. if (end > this.length) end = this.length
  6905. if (target.length - targetStart < end - start) {
  6906. end = target.length - targetStart + start
  6907. }
  6908. var len = end - start
  6909. var i
  6910. if (this === target && start < targetStart && targetStart < end) {
  6911. // descending copy from end
  6912. for (i = len - 1; i >= 0; --i) {
  6913. target[i + targetStart] = this[i + start]
  6914. }
  6915. } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
  6916. // ascending copy from start
  6917. for (i = 0; i < len; ++i) {
  6918. target[i + targetStart] = this[i + start]
  6919. }
  6920. } else {
  6921. Uint8Array.prototype.set.call(
  6922. target,
  6923. this.subarray(start, start + len),
  6924. targetStart
  6925. )
  6926. }
  6927. return len
  6928. }
  6929. // Usage:
  6930. // buffer.fill(number[, offset[, end]])
  6931. // buffer.fill(buffer[, offset[, end]])
  6932. // buffer.fill(string[, offset[, end]][, encoding])
  6933. Buffer.prototype.fill = function fill (val, start, end, encoding) {
  6934. // Handle string cases:
  6935. if (typeof val === 'string') {
  6936. if (typeof start === 'string') {
  6937. encoding = start
  6938. start = 0
  6939. end = this.length
  6940. } else if (typeof end === 'string') {
  6941. encoding = end
  6942. end = this.length
  6943. }
  6944. if (val.length === 1) {
  6945. var code = val.charCodeAt(0)
  6946. if (code < 256) {
  6947. val = code
  6948. }
  6949. }
  6950. if (encoding !== undefined && typeof encoding !== 'string') {
  6951. throw new TypeError('encoding must be a string')
  6952. }
  6953. if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
  6954. throw new TypeError('Unknown encoding: ' + encoding)
  6955. }
  6956. } else if (typeof val === 'number') {
  6957. val = val & 255
  6958. }
  6959. // Invalid ranges are not set to a default, so can range check early.
  6960. if (start < 0 || this.length < start || this.length < end) {
  6961. throw new RangeError('Out of range index')
  6962. }
  6963. if (end <= start) {
  6964. return this
  6965. }
  6966. start = start >>> 0
  6967. end = end === undefined ? this.length : end >>> 0
  6968. if (!val) val = 0
  6969. var i
  6970. if (typeof val === 'number') {
  6971. for (i = start; i < end; ++i) {
  6972. this[i] = val
  6973. }
  6974. } else {
  6975. var bytes = Buffer.isBuffer(val)
  6976. ? val
  6977. : utf8ToBytes(new Buffer(val, encoding).toString())
  6978. var len = bytes.length
  6979. for (i = 0; i < end - start; ++i) {
  6980. this[i + start] = bytes[i % len]
  6981. }
  6982. }
  6983. return this
  6984. }
  6985. // HELPER FUNCTIONS
  6986. // ================
  6987. var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
  6988. function base64clean (str) {
  6989. // Node strips out invalid characters like \n and \t from the string, base64-js does not
  6990. str = stringtrim(str).replace(INVALID_BASE64_RE, '')
  6991. // Node converts strings with length < 2 to ''
  6992. if (str.length < 2) return ''
  6993. // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
  6994. while (str.length % 4 !== 0) {
  6995. str = str + '='
  6996. }
  6997. return str
  6998. }
  6999. function stringtrim (str) {
  7000. if (str.trim) return str.trim()
  7001. return str.replace(/^\s+|\s+$/g, '')
  7002. }
  7003. function toHex (n) {
  7004. if (n < 16) return '0' + n.toString(16)
  7005. return n.toString(16)
  7006. }
  7007. function utf8ToBytes (string, units) {
  7008. units = units || Infinity
  7009. var codePoint
  7010. var length = string.length
  7011. var leadSurrogate = null
  7012. var bytes = []
  7013. for (var i = 0; i < length; ++i) {
  7014. codePoint = string.charCodeAt(i)
  7015. // is surrogate component
  7016. if (codePoint > 0xD7FF && codePoint < 0xE000) {
  7017. // last char was a lead
  7018. if (!leadSurrogate) {
  7019. // no lead yet
  7020. if (codePoint > 0xDBFF) {
  7021. // unexpected trail
  7022. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  7023. continue
  7024. } else if (i + 1 === length) {
  7025. // unpaired lead
  7026. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  7027. continue
  7028. }
  7029. // valid lead
  7030. leadSurrogate = codePoint
  7031. continue
  7032. }
  7033. // 2 leads in a row
  7034. if (codePoint < 0xDC00) {
  7035. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  7036. leadSurrogate = codePoint
  7037. continue
  7038. }
  7039. // valid surrogate pair
  7040. codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
  7041. } else if (leadSurrogate) {
  7042. // valid bmp char, but last char was a lead
  7043. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  7044. }
  7045. leadSurrogate = null
  7046. // encode utf8
  7047. if (codePoint < 0x80) {
  7048. if ((units -= 1) < 0) break
  7049. bytes.push(codePoint)
  7050. } else if (codePoint < 0x800) {
  7051. if ((units -= 2) < 0) break
  7052. bytes.push(
  7053. codePoint >> 0x6 | 0xC0,
  7054. codePoint & 0x3F | 0x80
  7055. )
  7056. } else if (codePoint < 0x10000) {
  7057. if ((units -= 3) < 0) break
  7058. bytes.push(
  7059. codePoint >> 0xC | 0xE0,
  7060. codePoint >> 0x6 & 0x3F | 0x80,
  7061. codePoint & 0x3F | 0x80
  7062. )
  7063. } else if (codePoint < 0x110000) {
  7064. if ((units -= 4) < 0) break
  7065. bytes.push(
  7066. codePoint >> 0x12 | 0xF0,
  7067. codePoint >> 0xC & 0x3F | 0x80,
  7068. codePoint >> 0x6 & 0x3F | 0x80,
  7069. codePoint & 0x3F | 0x80
  7070. )
  7071. } else {
  7072. throw new Error('Invalid code point')
  7073. }
  7074. }
  7075. return bytes
  7076. }
  7077. function asciiToBytes (str) {
  7078. var byteArray = []
  7079. for (var i = 0; i < str.length; ++i) {
  7080. // Node's code seems to be doing this and not & 0x7F..
  7081. byteArray.push(str.charCodeAt(i) & 0xFF)
  7082. }
  7083. return byteArray
  7084. }
  7085. function utf16leToBytes (str, units) {
  7086. var c, hi, lo
  7087. var byteArray = []
  7088. for (var i = 0; i < str.length; ++i) {
  7089. if ((units -= 2) < 0) break
  7090. c = str.charCodeAt(i)
  7091. hi = c >> 8
  7092. lo = c % 256
  7093. byteArray.push(lo)
  7094. byteArray.push(hi)
  7095. }
  7096. return byteArray
  7097. }
  7098. function base64ToBytes (str) {
  7099. return base64.toByteArray(base64clean(str))
  7100. }
  7101. function blitBuffer (src, dst, offset, length) {
  7102. for (var i = 0; i < length; ++i) {
  7103. if ((i + offset >= dst.length) || (i >= src.length)) break
  7104. dst[i + offset] = src[i]
  7105. }
  7106. return i
  7107. }
  7108. function isnan (val) {
  7109. return val !== val // eslint-disable-line no-self-compare
  7110. }
  7111. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  7112. /***/ }),
  7113. /***/ "./node_modules/component-bind/index.js":
  7114. /*!**********************************************!*\
  7115. !*** ./node_modules/component-bind/index.js ***!
  7116. \**********************************************/
  7117. /*! no static exports found */
  7118. /***/ (function(module, exports) {
  7119. /**
  7120. * Slice reference.
  7121. */
  7122. var slice = [].slice;
  7123. /**
  7124. * Bind `obj` to `fn`.
  7125. *
  7126. * @param {Object} obj
  7127. * @param {Function|String} fn or string
  7128. * @return {Function}
  7129. * @api public
  7130. */
  7131. module.exports = function(obj, fn){
  7132. if ('string' == typeof fn) fn = obj[fn];
  7133. if ('function' != typeof fn) throw new Error('bind() requires a function');
  7134. var args = slice.call(arguments, 2);
  7135. return function(){
  7136. return fn.apply(obj, args.concat(slice.call(arguments)));
  7137. }
  7138. };
  7139. /***/ }),
  7140. /***/ "./node_modules/component-emitter/index.js":
  7141. /*!*************************************************!*\
  7142. !*** ./node_modules/component-emitter/index.js ***!
  7143. \*************************************************/
  7144. /*! no static exports found */
  7145. /***/ (function(module, exports, __webpack_require__) {
  7146. /**
  7147. * Expose `Emitter`.
  7148. */
  7149. if (true) {
  7150. module.exports = Emitter;
  7151. }
  7152. /**
  7153. * Initialize a new `Emitter`.
  7154. *
  7155. * @api public
  7156. */
  7157. function Emitter(obj) {
  7158. if (obj) return mixin(obj);
  7159. };
  7160. /**
  7161. * Mixin the emitter properties.
  7162. *
  7163. * @param {Object} obj
  7164. * @return {Object}
  7165. * @api private
  7166. */
  7167. function mixin(obj) {
  7168. for (var key in Emitter.prototype) {
  7169. obj[key] = Emitter.prototype[key];
  7170. }
  7171. return obj;
  7172. }
  7173. /**
  7174. * Listen on the given `event` with `fn`.
  7175. *
  7176. * @param {String} event
  7177. * @param {Function} fn
  7178. * @return {Emitter}
  7179. * @api public
  7180. */
  7181. Emitter.prototype.on =
  7182. Emitter.prototype.addEventListener = function(event, fn){
  7183. this._callbacks = this._callbacks || {};
  7184. (this._callbacks['$' + event] = this._callbacks['$' + event] || [])
  7185. .push(fn);
  7186. return this;
  7187. };
  7188. /**
  7189. * Adds an `event` listener that will be invoked a single
  7190. * time then automatically removed.
  7191. *
  7192. * @param {String} event
  7193. * @param {Function} fn
  7194. * @return {Emitter}
  7195. * @api public
  7196. */
  7197. Emitter.prototype.once = function(event, fn){
  7198. function on() {
  7199. this.off(event, on);
  7200. fn.apply(this, arguments);
  7201. }
  7202. on.fn = fn;
  7203. this.on(event, on);
  7204. return this;
  7205. };
  7206. /**
  7207. * Remove the given callback for `event` or all
  7208. * registered callbacks.
  7209. *
  7210. * @param {String} event
  7211. * @param {Function} fn
  7212. * @return {Emitter}
  7213. * @api public
  7214. */
  7215. Emitter.prototype.off =
  7216. Emitter.prototype.removeListener =
  7217. Emitter.prototype.removeAllListeners =
  7218. Emitter.prototype.removeEventListener = function(event, fn){
  7219. this._callbacks = this._callbacks || {};
  7220. // all
  7221. if (0 == arguments.length) {
  7222. this._callbacks = {};
  7223. return this;
  7224. }
  7225. // specific event
  7226. var callbacks = this._callbacks['$' + event];
  7227. if (!callbacks) return this;
  7228. // remove all handlers
  7229. if (1 == arguments.length) {
  7230. delete this._callbacks['$' + event];
  7231. return this;
  7232. }
  7233. // remove specific handler
  7234. var cb;
  7235. for (var i = 0; i < callbacks.length; i++) {
  7236. cb = callbacks[i];
  7237. if (cb === fn || cb.fn === fn) {
  7238. callbacks.splice(i, 1);
  7239. break;
  7240. }
  7241. }
  7242. // Remove event specific arrays for event types that no
  7243. // one is subscribed for to avoid memory leak.
  7244. if (callbacks.length === 0) {
  7245. delete this._callbacks['$' + event];
  7246. }
  7247. return this;
  7248. };
  7249. /**
  7250. * Emit `event` with the given args.
  7251. *
  7252. * @param {String} event
  7253. * @param {Mixed} ...
  7254. * @return {Emitter}
  7255. */
  7256. Emitter.prototype.emit = function(event){
  7257. this._callbacks = this._callbacks || {};
  7258. var args = new Array(arguments.length - 1)
  7259. , callbacks = this._callbacks['$' + event];
  7260. for (var i = 1; i < arguments.length; i++) {
  7261. args[i - 1] = arguments[i];
  7262. }
  7263. if (callbacks) {
  7264. callbacks = callbacks.slice(0);
  7265. for (var i = 0, len = callbacks.length; i < len; ++i) {
  7266. callbacks[i].apply(this, args);
  7267. }
  7268. }
  7269. return this;
  7270. };
  7271. /**
  7272. * Return array of callbacks for `event`.
  7273. *
  7274. * @param {String} event
  7275. * @return {Array}
  7276. * @api public
  7277. */
  7278. Emitter.prototype.listeners = function(event){
  7279. this._callbacks = this._callbacks || {};
  7280. return this._callbacks['$' + event] || [];
  7281. };
  7282. /**
  7283. * Check if this emitter has `event` handlers.
  7284. *
  7285. * @param {String} event
  7286. * @return {Boolean}
  7287. * @api public
  7288. */
  7289. Emitter.prototype.hasListeners = function(event){
  7290. return !! this.listeners(event).length;
  7291. };
  7292. /***/ }),
  7293. /***/ "./node_modules/component-inherit/index.js":
  7294. /*!*************************************************!*\
  7295. !*** ./node_modules/component-inherit/index.js ***!
  7296. \*************************************************/
  7297. /*! no static exports found */
  7298. /***/ (function(module, exports) {
  7299. module.exports = function(a, b){
  7300. var fn = function(){};
  7301. fn.prototype = b.prototype;
  7302. a.prototype = new fn;
  7303. a.prototype.constructor = a;
  7304. };
  7305. /***/ }),
  7306. /***/ "./node_modules/debug/src/browser.js":
  7307. /*!*******************************************!*\
  7308. !*** ./node_modules/debug/src/browser.js ***!
  7309. \*******************************************/
  7310. /*! no static exports found */
  7311. /***/ (function(module, exports, __webpack_require__) {
  7312. /* WEBPACK VAR INJECTION */(function(process) {/**
  7313. * This is the web browser implementation of `debug()`.
  7314. *
  7315. * Expose `debug()` as the module.
  7316. */
  7317. exports = module.exports = __webpack_require__(/*! ./debug */ "./node_modules/debug/src/debug.js");
  7318. exports.log = log;
  7319. exports.formatArgs = formatArgs;
  7320. exports.save = save;
  7321. exports.load = load;
  7322. exports.useColors = useColors;
  7323. exports.storage = 'undefined' != typeof chrome
  7324. && 'undefined' != typeof chrome.storage
  7325. ? chrome.storage.local
  7326. : localstorage();
  7327. /**
  7328. * Colors.
  7329. */
  7330. exports.colors = [
  7331. '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC',
  7332. '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF',
  7333. '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC',
  7334. '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF',
  7335. '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC',
  7336. '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033',
  7337. '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366',
  7338. '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933',
  7339. '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC',
  7340. '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF',
  7341. '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'
  7342. ];
  7343. /**
  7344. * Currently only WebKit-based Web Inspectors, Firefox >= v31,
  7345. * and the Firebug extension (any Firefox version) are known
  7346. * to support "%c" CSS customizations.
  7347. *
  7348. * TODO: add a `localStorage` variable to explicitly enable/disable colors
  7349. */
  7350. function useColors() {
  7351. // NB: In an Electron preload script, document will be defined but not fully
  7352. // initialized. Since we know we're in Chrome, we'll just detect this case
  7353. // explicitly
  7354. if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
  7355. return true;
  7356. }
  7357. // Internet Explorer and Edge do not support colors.
  7358. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
  7359. return false;
  7360. }
  7361. // is webkit? http://stackoverflow.com/a/16459606/376773
  7362. // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
  7363. return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
  7364. // is firebug? http://stackoverflow.com/a/398120/376773
  7365. (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
  7366. // is firefox >= v31?
  7367. // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
  7368. (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
  7369. // double check webkit in userAgent just in case we are in a worker
  7370. (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
  7371. }
  7372. /**
  7373. * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
  7374. */
  7375. exports.formatters.j = function(v) {
  7376. try {
  7377. return JSON.stringify(v);
  7378. } catch (err) {
  7379. return '[UnexpectedJSONParseError]: ' + err.message;
  7380. }
  7381. };
  7382. /**
  7383. * Colorize log arguments if enabled.
  7384. *
  7385. * @api public
  7386. */
  7387. function formatArgs(args) {
  7388. var useColors = this.useColors;
  7389. args[0] = (useColors ? '%c' : '')
  7390. + this.namespace
  7391. + (useColors ? ' %c' : ' ')
  7392. + args[0]
  7393. + (useColors ? '%c ' : ' ')
  7394. + '+' + exports.humanize(this.diff);
  7395. if (!useColors) return;
  7396. var c = 'color: ' + this.color;
  7397. args.splice(1, 0, c, 'color: inherit')
  7398. // the final "%c" is somewhat tricky, because there could be other
  7399. // arguments passed either before or after the %c, so we need to
  7400. // figure out the correct index to insert the CSS into
  7401. var index = 0;
  7402. var lastC = 0;
  7403. args[0].replace(/%[a-zA-Z%]/g, function(match) {
  7404. if ('%%' === match) return;
  7405. index++;
  7406. if ('%c' === match) {
  7407. // we only are interested in the *last* %c
  7408. // (the user may have provided their own)
  7409. lastC = index;
  7410. }
  7411. });
  7412. args.splice(lastC, 0, c);
  7413. }
  7414. /**
  7415. * Invokes `console.log()` when available.
  7416. * No-op when `console.log` is not a "function".
  7417. *
  7418. * @api public
  7419. */
  7420. function log() {
  7421. // this hackery is required for IE8/9, where
  7422. // the `console.log` function doesn't have 'apply'
  7423. return 'object' === typeof console
  7424. && console.log
  7425. && Function.prototype.apply.call(console.log, console, arguments);
  7426. }
  7427. /**
  7428. * Save `namespaces`.
  7429. *
  7430. * @param {String} namespaces
  7431. * @api private
  7432. */
  7433. function save(namespaces) {
  7434. try {
  7435. if (null == namespaces) {
  7436. exports.storage.removeItem('debug');
  7437. } else {
  7438. exports.storage.debug = namespaces;
  7439. }
  7440. } catch(e) {}
  7441. }
  7442. /**
  7443. * Load `namespaces`.
  7444. *
  7445. * @return {String} returns the previously persisted debug modes
  7446. * @api private
  7447. */
  7448. function load() {
  7449. var r;
  7450. try {
  7451. r = exports.storage.debug;
  7452. } catch(e) {}
  7453. // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
  7454. if (!r && typeof process !== 'undefined' && 'env' in process) {
  7455. r = process.env.DEBUG;
  7456. }
  7457. return r;
  7458. }
  7459. /**
  7460. * Enable namespaces listed in `localStorage.debug` initially.
  7461. */
  7462. exports.enable(load());
  7463. /**
  7464. * Localstorage attempts to return the localstorage.
  7465. *
  7466. * This is necessary because safari throws
  7467. * when a user disables cookies/localstorage
  7468. * and you attempt to access it.
  7469. *
  7470. * @return {LocalStorage}
  7471. * @api private
  7472. */
  7473. function localstorage() {
  7474. try {
  7475. return window.localStorage;
  7476. } catch (e) {}
  7477. }
  7478. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ "./node_modules/process/browser.js")))
  7479. /***/ }),
  7480. /***/ "./node_modules/debug/src/debug.js":
  7481. /*!*****************************************!*\
  7482. !*** ./node_modules/debug/src/debug.js ***!
  7483. \*****************************************/
  7484. /*! no static exports found */
  7485. /***/ (function(module, exports, __webpack_require__) {
  7486. /**
  7487. * This is the common logic for both the Node.js and web browser
  7488. * implementations of `debug()`.
  7489. *
  7490. * Expose `debug()` as the module.
  7491. */
  7492. exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
  7493. exports.coerce = coerce;
  7494. exports.disable = disable;
  7495. exports.enable = enable;
  7496. exports.enabled = enabled;
  7497. exports.humanize = __webpack_require__(/*! ms */ "./node_modules/ms/index.js");
  7498. /**
  7499. * Active `debug` instances.
  7500. */
  7501. exports.instances = [];
  7502. /**
  7503. * The currently active debug mode names, and names to skip.
  7504. */
  7505. exports.names = [];
  7506. exports.skips = [];
  7507. /**
  7508. * Map of special "%n" handling functions, for the debug "format" argument.
  7509. *
  7510. * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
  7511. */
  7512. exports.formatters = {};
  7513. /**
  7514. * Select a color.
  7515. * @param {String} namespace
  7516. * @return {Number}
  7517. * @api private
  7518. */
  7519. function selectColor(namespace) {
  7520. var hash = 0, i;
  7521. for (i in namespace) {
  7522. hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
  7523. hash |= 0; // Convert to 32bit integer
  7524. }
  7525. return exports.colors[Math.abs(hash) % exports.colors.length];
  7526. }
  7527. /**
  7528. * Create a debugger with the given `namespace`.
  7529. *
  7530. * @param {String} namespace
  7531. * @return {Function}
  7532. * @api public
  7533. */
  7534. function createDebug(namespace) {
  7535. var prevTime;
  7536. function debug() {
  7537. // disabled?
  7538. if (!debug.enabled) return;
  7539. var self = debug;
  7540. // set `diff` timestamp
  7541. var curr = +new Date();
  7542. var ms = curr - (prevTime || curr);
  7543. self.diff = ms;
  7544. self.prev = prevTime;
  7545. self.curr = curr;
  7546. prevTime = curr;
  7547. // turn the `arguments` into a proper Array
  7548. var args = new Array(arguments.length);
  7549. for (var i = 0; i < args.length; i++) {
  7550. args[i] = arguments[i];
  7551. }
  7552. args[0] = exports.coerce(args[0]);
  7553. if ('string' !== typeof args[0]) {
  7554. // anything else let's inspect with %O
  7555. args.unshift('%O');
  7556. }
  7557. // apply any `formatters` transformations
  7558. var index = 0;
  7559. args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
  7560. // if we encounter an escaped % then don't increase the array index
  7561. if (match === '%%') return match;
  7562. index++;
  7563. var formatter = exports.formatters[format];
  7564. if ('function' === typeof formatter) {
  7565. var val = args[index];
  7566. match = formatter.call(self, val);
  7567. // now we need to remove `args[index]` since it's inlined in the `format`
  7568. args.splice(index, 1);
  7569. index--;
  7570. }
  7571. return match;
  7572. });
  7573. // apply env-specific formatting (colors, etc.)
  7574. exports.formatArgs.call(self, args);
  7575. var logFn = debug.log || exports.log || console.log.bind(console);
  7576. logFn.apply(self, args);
  7577. }
  7578. debug.namespace = namespace;
  7579. debug.enabled = exports.enabled(namespace);
  7580. debug.useColors = exports.useColors();
  7581. debug.color = selectColor(namespace);
  7582. debug.destroy = destroy;
  7583. // env-specific initialization logic for debug instances
  7584. if ('function' === typeof exports.init) {
  7585. exports.init(debug);
  7586. }
  7587. exports.instances.push(debug);
  7588. return debug;
  7589. }
  7590. function destroy () {
  7591. var index = exports.instances.indexOf(this);
  7592. if (index !== -1) {
  7593. exports.instances.splice(index, 1);
  7594. return true;
  7595. } else {
  7596. return false;
  7597. }
  7598. }
  7599. /**
  7600. * Enables a debug mode by namespaces. This can include modes
  7601. * separated by a colon and wildcards.
  7602. *
  7603. * @param {String} namespaces
  7604. * @api public
  7605. */
  7606. function enable(namespaces) {
  7607. exports.save(namespaces);
  7608. exports.names = [];
  7609. exports.skips = [];
  7610. var i;
  7611. var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
  7612. var len = split.length;
  7613. for (i = 0; i < len; i++) {
  7614. if (!split[i]) continue; // ignore empty strings
  7615. namespaces = split[i].replace(/\*/g, '.*?');
  7616. if (namespaces[0] === '-') {
  7617. exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
  7618. } else {
  7619. exports.names.push(new RegExp('^' + namespaces + '$'));
  7620. }
  7621. }
  7622. for (i = 0; i < exports.instances.length; i++) {
  7623. var instance = exports.instances[i];
  7624. instance.enabled = exports.enabled(instance.namespace);
  7625. }
  7626. }
  7627. /**
  7628. * Disable debug output.
  7629. *
  7630. * @api public
  7631. */
  7632. function disable() {
  7633. exports.enable('');
  7634. }
  7635. /**
  7636. * Returns true if the given mode name is enabled, false otherwise.
  7637. *
  7638. * @param {String} name
  7639. * @return {Boolean}
  7640. * @api public
  7641. */
  7642. function enabled(name) {
  7643. if (name[name.length - 1] === '*') {
  7644. return true;
  7645. }
  7646. var i, len;
  7647. for (i = 0, len = exports.skips.length; i < len; i++) {
  7648. if (exports.skips[i].test(name)) {
  7649. return false;
  7650. }
  7651. }
  7652. for (i = 0, len = exports.names.length; i < len; i++) {
  7653. if (exports.names[i].test(name)) {
  7654. return true;
  7655. }
  7656. }
  7657. return false;
  7658. }
  7659. /**
  7660. * Coerce `val`.
  7661. *
  7662. * @param {Mixed} val
  7663. * @return {Mixed}
  7664. * @api private
  7665. */
  7666. function coerce(val) {
  7667. if (val instanceof Error) return val.stack || val.message;
  7668. return val;
  7669. }
  7670. /***/ }),
  7671. /***/ "./node_modules/engine.io-client/lib/globalThis.browser.js":
  7672. /*!*****************************************************************!*\
  7673. !*** ./node_modules/engine.io-client/lib/globalThis.browser.js ***!
  7674. \*****************************************************************/
  7675. /*! no static exports found */
  7676. /***/ (function(module, exports) {
  7677. module.exports = (function () {
  7678. if (typeof self !== 'undefined') {
  7679. return self;
  7680. } else if (typeof window !== 'undefined') {
  7681. return window;
  7682. } else {
  7683. return Function('return this')(); // eslint-disable-line no-new-func
  7684. }
  7685. })();
  7686. /***/ }),
  7687. /***/ "./node_modules/engine.io-client/lib/index.js":
  7688. /*!****************************************************!*\
  7689. !*** ./node_modules/engine.io-client/lib/index.js ***!
  7690. \****************************************************/
  7691. /*! no static exports found */
  7692. /***/ (function(module, exports, __webpack_require__) {
  7693. module.exports = __webpack_require__(/*! ./socket */ "./node_modules/engine.io-client/lib/socket.js");
  7694. /**
  7695. * Exports parser
  7696. *
  7697. * @api public
  7698. *
  7699. */
  7700. module.exports.parser = __webpack_require__(/*! engine.io-parser */ "./node_modules/engine.io-parser/lib/browser.js");
  7701. /***/ }),
  7702. /***/ "./node_modules/engine.io-client/lib/socket.js":
  7703. /*!*****************************************************!*\
  7704. !*** ./node_modules/engine.io-client/lib/socket.js ***!
  7705. \*****************************************************/
  7706. /*! no static exports found */
  7707. /***/ (function(module, exports, __webpack_require__) {
  7708. /**
  7709. * Module dependencies.
  7710. */
  7711. var transports = __webpack_require__(/*! ./transports/index */ "./node_modules/engine.io-client/lib/transports/index.js");
  7712. var Emitter = __webpack_require__(/*! component-emitter */ "./node_modules/component-emitter/index.js");
  7713. var debug = __webpack_require__(/*! debug */ "./node_modules/engine.io-client/node_modules/debug/src/browser.js")('engine.io-client:socket');
  7714. var index = __webpack_require__(/*! indexof */ "./node_modules/indexof/index.js");
  7715. var parser = __webpack_require__(/*! engine.io-parser */ "./node_modules/engine.io-parser/lib/browser.js");
  7716. var parseuri = __webpack_require__(/*! parseuri */ "./node_modules/parseuri/index.js");
  7717. var parseqs = __webpack_require__(/*! parseqs */ "./node_modules/parseqs/index.js");
  7718. /**
  7719. * Module exports.
  7720. */
  7721. module.exports = Socket;
  7722. /**
  7723. * Socket constructor.
  7724. *
  7725. * @param {String|Object} uri or options
  7726. * @param {Object} options
  7727. * @api public
  7728. */
  7729. function Socket (uri, opts) {
  7730. if (!(this instanceof Socket)) return new Socket(uri, opts);
  7731. opts = opts || {};
  7732. if (uri && 'object' === typeof uri) {
  7733. opts = uri;
  7734. uri = null;
  7735. }
  7736. if (uri) {
  7737. uri = parseuri(uri);
  7738. opts.hostname = uri.host;
  7739. opts.secure = uri.protocol === 'https' || uri.protocol === 'wss';
  7740. opts.port = uri.port;
  7741. if (uri.query) opts.query = uri.query;
  7742. } else if (opts.host) {
  7743. opts.hostname = parseuri(opts.host).host;
  7744. }
  7745. this.secure = null != opts.secure ? opts.secure
  7746. : (typeof location !== 'undefined' && 'https:' === location.protocol);
  7747. if (opts.hostname && !opts.port) {
  7748. // if no port is specified manually, use the protocol default
  7749. opts.port = this.secure ? '443' : '80';
  7750. }
  7751. this.agent = opts.agent || false;
  7752. this.hostname = opts.hostname ||
  7753. (typeof location !== 'undefined' ? location.hostname : 'localhost');
  7754. this.port = opts.port || (typeof location !== 'undefined' && location.port
  7755. ? location.port
  7756. : (this.secure ? 443 : 80));
  7757. this.query = opts.query || {};
  7758. if ('string' === typeof this.query) this.query = parseqs.decode(this.query);
  7759. this.upgrade = false !== opts.upgrade;
  7760. this.path = (opts.path || '/engine.io').replace(/\/$/, '') + '/';
  7761. this.forceJSONP = !!opts.forceJSONP;
  7762. this.jsonp = false !== opts.jsonp;
  7763. this.forceBase64 = !!opts.forceBase64;
  7764. this.enablesXDR = !!opts.enablesXDR;
  7765. this.withCredentials = false !== opts.withCredentials;
  7766. this.timestampParam = opts.timestampParam || 't';
  7767. this.timestampRequests = opts.timestampRequests;
  7768. this.transports = opts.transports || ['polling', 'websocket'];
  7769. this.transportOptions = opts.transportOptions || {};
  7770. this.readyState = '';
  7771. this.writeBuffer = [];
  7772. this.prevBufferLen = 0;
  7773. this.policyPort = opts.policyPort || 843;
  7774. this.rememberUpgrade = opts.rememberUpgrade || false;
  7775. this.binaryType = null;
  7776. this.onlyBinaryUpgrades = opts.onlyBinaryUpgrades;
  7777. this.perMessageDeflate = false !== opts.perMessageDeflate ? (opts.perMessageDeflate || {}) : false;
  7778. if (true === this.perMessageDeflate) this.perMessageDeflate = {};
  7779. if (this.perMessageDeflate && null == this.perMessageDeflate.threshold) {
  7780. this.perMessageDeflate.threshold = 1024;
  7781. }
  7782. // SSL options for Node.js client
  7783. this.pfx = opts.pfx || null;
  7784. this.key = opts.key || null;
  7785. this.passphrase = opts.passphrase || null;
  7786. this.cert = opts.cert || null;
  7787. this.ca = opts.ca || null;
  7788. this.ciphers = opts.ciphers || null;
  7789. this.rejectUnauthorized = opts.rejectUnauthorized === undefined ? true : opts.rejectUnauthorized;
  7790. this.forceNode = !!opts.forceNode;
  7791. // detect ReactNative environment
  7792. this.isReactNative = (typeof navigator !== 'undefined' && typeof navigator.product === 'string' && navigator.product.toLowerCase() === 'reactnative');
  7793. // other options for Node.js or ReactNative client
  7794. if (typeof self === 'undefined' || this.isReactNative) {
  7795. if (opts.extraHeaders && Object.keys(opts.extraHeaders).length > 0) {
  7796. this.extraHeaders = opts.extraHeaders;
  7797. }
  7798. if (opts.localAddress) {
  7799. this.localAddress = opts.localAddress;
  7800. }
  7801. }
  7802. // set on handshake
  7803. this.id = null;
  7804. this.upgrades = null;
  7805. this.pingInterval = null;
  7806. this.pingTimeout = null;
  7807. // set on heartbeat
  7808. this.pingIntervalTimer = null;
  7809. this.pingTimeoutTimer = null;
  7810. this.open();
  7811. }
  7812. Socket.priorWebsocketSuccess = false;
  7813. /**
  7814. * Mix in `Emitter`.
  7815. */
  7816. Emitter(Socket.prototype);
  7817. /**
  7818. * Protocol version.
  7819. *
  7820. * @api public
  7821. */
  7822. Socket.protocol = parser.protocol; // this is an int
  7823. /**
  7824. * Expose deps for legacy compatibility
  7825. * and standalone browser access.
  7826. */
  7827. Socket.Socket = Socket;
  7828. Socket.Transport = __webpack_require__(/*! ./transport */ "./node_modules/engine.io-client/lib/transport.js");
  7829. Socket.transports = __webpack_require__(/*! ./transports/index */ "./node_modules/engine.io-client/lib/transports/index.js");
  7830. Socket.parser = __webpack_require__(/*! engine.io-parser */ "./node_modules/engine.io-parser/lib/browser.js");
  7831. /**
  7832. * Creates transport of the given type.
  7833. *
  7834. * @param {String} transport name
  7835. * @return {Transport}
  7836. * @api private
  7837. */
  7838. Socket.prototype.createTransport = function (name) {
  7839. debug('creating transport "%s"', name);
  7840. var query = clone(this.query);
  7841. // append engine.io protocol identifier
  7842. query.EIO = parser.protocol;
  7843. // transport name
  7844. query.transport = name;
  7845. // per-transport options
  7846. var options = this.transportOptions[name] || {};
  7847. // session id if we already have one
  7848. if (this.id) query.sid = this.id;
  7849. var transport = new transports[name]({
  7850. query: query,
  7851. socket: this,
  7852. agent: options.agent || this.agent,
  7853. hostname: options.hostname || this.hostname,
  7854. port: options.port || this.port,
  7855. secure: options.secure || this.secure,
  7856. path: options.path || this.path,
  7857. forceJSONP: options.forceJSONP || this.forceJSONP,
  7858. jsonp: options.jsonp || this.jsonp,
  7859. forceBase64: options.forceBase64 || this.forceBase64,
  7860. enablesXDR: options.enablesXDR || this.enablesXDR,
  7861. withCredentials: options.withCredentials || this.withCredentials,
  7862. timestampRequests: options.timestampRequests || this.timestampRequests,
  7863. timestampParam: options.timestampParam || this.timestampParam,
  7864. policyPort: options.policyPort || this.policyPort,
  7865. pfx: options.pfx || this.pfx,
  7866. key: options.key || this.key,
  7867. passphrase: options.passphrase || this.passphrase,
  7868. cert: options.cert || this.cert,
  7869. ca: options.ca || this.ca,
  7870. ciphers: options.ciphers || this.ciphers,
  7871. rejectUnauthorized: options.rejectUnauthorized || this.rejectUnauthorized,
  7872. perMessageDeflate: options.perMessageDeflate || this.perMessageDeflate,
  7873. extraHeaders: options.extraHeaders || this.extraHeaders,
  7874. forceNode: options.forceNode || this.forceNode,
  7875. localAddress: options.localAddress || this.localAddress,
  7876. requestTimeout: options.requestTimeout || this.requestTimeout,
  7877. protocols: options.protocols || void (0),
  7878. isReactNative: this.isReactNative
  7879. });
  7880. return transport;
  7881. };
  7882. function clone (obj) {
  7883. var o = {};
  7884. for (var i in obj) {
  7885. if (obj.hasOwnProperty(i)) {
  7886. o[i] = obj[i];
  7887. }
  7888. }
  7889. return o;
  7890. }
  7891. /**
  7892. * Initializes transport to use and starts probe.
  7893. *
  7894. * @api private
  7895. */
  7896. Socket.prototype.open = function () {
  7897. var transport;
  7898. if (this.rememberUpgrade && Socket.priorWebsocketSuccess && this.transports.indexOf('websocket') !== -1) {
  7899. transport = 'websocket';
  7900. } else if (0 === this.transports.length) {
  7901. // Emit error on next tick so it can be listened to
  7902. var self = this;
  7903. setTimeout(function () {
  7904. self.emit('error', 'No transports available');
  7905. }, 0);
  7906. return;
  7907. } else {
  7908. transport = this.transports[0];
  7909. }
  7910. this.readyState = 'opening';
  7911. // Retry with the next transport if the transport is disabled (jsonp: false)
  7912. try {
  7913. transport = this.createTransport(transport);
  7914. } catch (e) {
  7915. this.transports.shift();
  7916. this.open();
  7917. return;
  7918. }
  7919. transport.open();
  7920. this.setTransport(transport);
  7921. };
  7922. /**
  7923. * Sets the current transport. Disables the existing one (if any).
  7924. *
  7925. * @api private
  7926. */
  7927. Socket.prototype.setTransport = function (transport) {
  7928. debug('setting transport %s', transport.name);
  7929. var self = this;
  7930. if (this.transport) {
  7931. debug('clearing existing transport %s', this.transport.name);
  7932. this.transport.removeAllListeners();
  7933. }
  7934. // set up transport
  7935. this.transport = transport;
  7936. // set up transport listeners
  7937. transport
  7938. .on('drain', function () {
  7939. self.onDrain();
  7940. })
  7941. .on('packet', function (packet) {
  7942. self.onPacket(packet);
  7943. })
  7944. .on('error', function (e) {
  7945. self.onError(e);
  7946. })
  7947. .on('close', function () {
  7948. self.onClose('transport close');
  7949. });
  7950. };
  7951. /**
  7952. * Probes a transport.
  7953. *
  7954. * @param {String} transport name
  7955. * @api private
  7956. */
  7957. Socket.prototype.probe = function (name) {
  7958. debug('probing transport "%s"', name);
  7959. var transport = this.createTransport(name, { probe: 1 });
  7960. var failed = false;
  7961. var self = this;
  7962. Socket.priorWebsocketSuccess = false;
  7963. function onTransportOpen () {
  7964. if (self.onlyBinaryUpgrades) {
  7965. var upgradeLosesBinary = !this.supportsBinary && self.transport.supportsBinary;
  7966. failed = failed || upgradeLosesBinary;
  7967. }
  7968. if (failed) return;
  7969. debug('probe transport "%s" opened', name);
  7970. transport.send([{ type: 'ping', data: 'probe' }]);
  7971. transport.once('packet', function (msg) {
  7972. if (failed) return;
  7973. if ('pong' === msg.type && 'probe' === msg.data) {
  7974. debug('probe transport "%s" pong', name);
  7975. self.upgrading = true;
  7976. self.emit('upgrading', transport);
  7977. if (!transport) return;
  7978. Socket.priorWebsocketSuccess = 'websocket' === transport.name;
  7979. debug('pausing current transport "%s"', self.transport.name);
  7980. self.transport.pause(function () {
  7981. if (failed) return;
  7982. if ('closed' === self.readyState) return;
  7983. debug('changing transport and sending upgrade packet');
  7984. cleanup();
  7985. self.setTransport(transport);
  7986. transport.send([{ type: 'upgrade' }]);
  7987. self.emit('upgrade', transport);
  7988. transport = null;
  7989. self.upgrading = false;
  7990. self.flush();
  7991. });
  7992. } else {
  7993. debug('probe transport "%s" failed', name);
  7994. var err = new Error('probe error');
  7995. err.transport = transport.name;
  7996. self.emit('upgradeError', err);
  7997. }
  7998. });
  7999. }
  8000. function freezeTransport () {
  8001. if (failed) return;
  8002. // Any callback called by transport should be ignored since now
  8003. failed = true;
  8004. cleanup();
  8005. transport.close();
  8006. transport = null;
  8007. }
  8008. // Handle any error that happens while probing
  8009. function onerror (err) {
  8010. var error = new Error('probe error: ' + err);
  8011. error.transport = transport.name;
  8012. freezeTransport();
  8013. debug('probe transport "%s" failed because of error: %s', name, err);
  8014. self.emit('upgradeError', error);
  8015. }
  8016. function onTransportClose () {
  8017. onerror('transport closed');
  8018. }
  8019. // When the socket is closed while we're probing
  8020. function onclose () {
  8021. onerror('socket closed');
  8022. }
  8023. // When the socket is upgraded while we're probing
  8024. function onupgrade (to) {
  8025. if (transport && to.name !== transport.name) {
  8026. debug('"%s" works - aborting "%s"', to.name, transport.name);
  8027. freezeTransport();
  8028. }
  8029. }
  8030. // Remove all listeners on the transport and on self
  8031. function cleanup () {
  8032. transport.removeListener('open', onTransportOpen);
  8033. transport.removeListener('error', onerror);
  8034. transport.removeListener('close', onTransportClose);
  8035. self.removeListener('close', onclose);
  8036. self.removeListener('upgrading', onupgrade);
  8037. }
  8038. transport.once('open', onTransportOpen);
  8039. transport.once('error', onerror);
  8040. transport.once('close', onTransportClose);
  8041. this.once('close', onclose);
  8042. this.once('upgrading', onupgrade);
  8043. transport.open();
  8044. };
  8045. /**
  8046. * Called when connection is deemed open.
  8047. *
  8048. * @api public
  8049. */
  8050. Socket.prototype.onOpen = function () {
  8051. debug('socket open');
  8052. this.readyState = 'open';
  8053. Socket.priorWebsocketSuccess = 'websocket' === this.transport.name;
  8054. this.emit('open');
  8055. this.flush();
  8056. // we check for `readyState` in case an `open`
  8057. // listener already closed the socket
  8058. if ('open' === this.readyState && this.upgrade && this.transport.pause) {
  8059. debug('starting upgrade probes');
  8060. for (var i = 0, l = this.upgrades.length; i < l; i++) {
  8061. this.probe(this.upgrades[i]);
  8062. }
  8063. }
  8064. };
  8065. /**
  8066. * Handles a packet.
  8067. *
  8068. * @api private
  8069. */
  8070. Socket.prototype.onPacket = function (packet) {
  8071. if ('opening' === this.readyState || 'open' === this.readyState ||
  8072. 'closing' === this.readyState) {
  8073. debug('socket receive: type "%s", data "%s"', packet.type, packet.data);
  8074. this.emit('packet', packet);
  8075. // Socket is live - any packet counts
  8076. this.emit('heartbeat');
  8077. switch (packet.type) {
  8078. case 'open':
  8079. this.onHandshake(JSON.parse(packet.data));
  8080. break;
  8081. case 'pong':
  8082. this.setPing();
  8083. this.emit('pong');
  8084. break;
  8085. case 'error':
  8086. var err = new Error('server error');
  8087. err.code = packet.data;
  8088. this.onError(err);
  8089. break;
  8090. case 'message':
  8091. this.emit('data', packet.data);
  8092. this.emit('message', packet.data);
  8093. break;
  8094. }
  8095. } else {
  8096. debug('packet received with socket readyState "%s"', this.readyState);
  8097. }
  8098. };
  8099. /**
  8100. * Called upon handshake completion.
  8101. *
  8102. * @param {Object} handshake obj
  8103. * @api private
  8104. */
  8105. Socket.prototype.onHandshake = function (data) {
  8106. this.emit('handshake', data);
  8107. this.id = data.sid;
  8108. this.transport.query.sid = data.sid;
  8109. this.upgrades = this.filterUpgrades(data.upgrades);
  8110. this.pingInterval = data.pingInterval;
  8111. this.pingTimeout = data.pingTimeout;
  8112. this.onOpen();
  8113. // In case open handler closes socket
  8114. if ('closed' === this.readyState) return;
  8115. this.setPing();
  8116. // Prolong liveness of socket on heartbeat
  8117. this.removeListener('heartbeat', this.onHeartbeat);
  8118. this.on('heartbeat', this.onHeartbeat);
  8119. };
  8120. /**
  8121. * Resets ping timeout.
  8122. *
  8123. * @api private
  8124. */
  8125. Socket.prototype.onHeartbeat = function (timeout) {
  8126. clearTimeout(this.pingTimeoutTimer);
  8127. var self = this;
  8128. self.pingTimeoutTimer = setTimeout(function () {
  8129. if ('closed' === self.readyState) return;
  8130. self.onClose('ping timeout');
  8131. }, timeout || (self.pingInterval + self.pingTimeout));
  8132. };
  8133. /**
  8134. * Pings server every `this.pingInterval` and expects response
  8135. * within `this.pingTimeout` or closes connection.
  8136. *
  8137. * @api private
  8138. */
  8139. Socket.prototype.setPing = function () {
  8140. var self = this;
  8141. clearTimeout(self.pingIntervalTimer);
  8142. self.pingIntervalTimer = setTimeout(function () {
  8143. debug('writing ping packet - expecting pong within %sms', self.pingTimeout);
  8144. self.ping();
  8145. self.onHeartbeat(self.pingTimeout);
  8146. }, self.pingInterval);
  8147. };
  8148. /**
  8149. * Sends a ping packet.
  8150. *
  8151. * @api private
  8152. */
  8153. Socket.prototype.ping = function () {
  8154. var self = this;
  8155. this.sendPacket('ping', function () {
  8156. self.emit('ping');
  8157. });
  8158. };
  8159. /**
  8160. * Called on `drain` event
  8161. *
  8162. * @api private
  8163. */
  8164. Socket.prototype.onDrain = function () {
  8165. this.writeBuffer.splice(0, this.prevBufferLen);
  8166. // setting prevBufferLen = 0 is very important
  8167. // for example, when upgrading, upgrade packet is sent over,
  8168. // and a nonzero prevBufferLen could cause problems on `drain`
  8169. this.prevBufferLen = 0;
  8170. if (0 === this.writeBuffer.length) {
  8171. this.emit('drain');
  8172. } else {
  8173. this.flush();
  8174. }
  8175. };
  8176. /**
  8177. * Flush write buffers.
  8178. *
  8179. * @api private
  8180. */
  8181. Socket.prototype.flush = function () {
  8182. if ('closed' !== this.readyState && this.transport.writable &&
  8183. !this.upgrading && this.writeBuffer.length) {
  8184. debug('flushing %d packets in socket', this.writeBuffer.length);
  8185. this.transport.send(this.writeBuffer);
  8186. // keep track of current length of writeBuffer
  8187. // splice writeBuffer and callbackBuffer on `drain`
  8188. this.prevBufferLen = this.writeBuffer.length;
  8189. this.emit('flush');
  8190. }
  8191. };
  8192. /**
  8193. * Sends a message.
  8194. *
  8195. * @param {String} message.
  8196. * @param {Function} callback function.
  8197. * @param {Object} options.
  8198. * @return {Socket} for chaining.
  8199. * @api public
  8200. */
  8201. Socket.prototype.write =
  8202. Socket.prototype.send = function (msg, options, fn) {
  8203. this.sendPacket('message', msg, options, fn);
  8204. return this;
  8205. };
  8206. /**
  8207. * Sends a packet.
  8208. *
  8209. * @param {String} packet type.
  8210. * @param {String} data.
  8211. * @param {Object} options.
  8212. * @param {Function} callback function.
  8213. * @api private
  8214. */
  8215. Socket.prototype.sendPacket = function (type, data, options, fn) {
  8216. if ('function' === typeof data) {
  8217. fn = data;
  8218. data = undefined;
  8219. }
  8220. if ('function' === typeof options) {
  8221. fn = options;
  8222. options = null;
  8223. }
  8224. if ('closing' === this.readyState || 'closed' === this.readyState) {
  8225. return;
  8226. }
  8227. options = options || {};
  8228. options.compress = false !== options.compress;
  8229. var packet = {
  8230. type: type,
  8231. data: data,
  8232. options: options
  8233. };
  8234. this.emit('packetCreate', packet);
  8235. this.writeBuffer.push(packet);
  8236. if (fn) this.once('flush', fn);
  8237. this.flush();
  8238. };
  8239. /**
  8240. * Closes the connection.
  8241. *
  8242. * @api private
  8243. */
  8244. Socket.prototype.close = function () {
  8245. if ('opening' === this.readyState || 'open' === this.readyState) {
  8246. this.readyState = 'closing';
  8247. var self = this;
  8248. if (this.writeBuffer.length) {
  8249. this.once('drain', function () {
  8250. if (this.upgrading) {
  8251. waitForUpgrade();
  8252. } else {
  8253. close();
  8254. }
  8255. });
  8256. } else if (this.upgrading) {
  8257. waitForUpgrade();
  8258. } else {
  8259. close();
  8260. }
  8261. }
  8262. function close () {
  8263. self.onClose('forced close');
  8264. debug('socket closing - telling transport to close');
  8265. self.transport.close();
  8266. }
  8267. function cleanupAndClose () {
  8268. self.removeListener('upgrade', cleanupAndClose);
  8269. self.removeListener('upgradeError', cleanupAndClose);
  8270. close();
  8271. }
  8272. function waitForUpgrade () {
  8273. // wait for upgrade to finish since we can't send packets while pausing a transport
  8274. self.once('upgrade', cleanupAndClose);
  8275. self.once('upgradeError', cleanupAndClose);
  8276. }
  8277. return this;
  8278. };
  8279. /**
  8280. * Called upon transport error
  8281. *
  8282. * @api private
  8283. */
  8284. Socket.prototype.onError = function (err) {
  8285. debug('socket error %j', err);
  8286. Socket.priorWebsocketSuccess = false;
  8287. this.emit('error', err);
  8288. this.onClose('transport error', err);
  8289. };
  8290. /**
  8291. * Called upon transport close.
  8292. *
  8293. * @api private
  8294. */
  8295. Socket.prototype.onClose = function (reason, desc) {
  8296. if ('opening' === this.readyState || 'open' === this.readyState || 'closing' === this.readyState) {
  8297. debug('socket close with reason: "%s"', reason);
  8298. var self = this;
  8299. // clear timers
  8300. clearTimeout(this.pingIntervalTimer);
  8301. clearTimeout(this.pingTimeoutTimer);
  8302. // stop event from firing again for transport
  8303. this.transport.removeAllListeners('close');
  8304. // ensure transport won't stay open
  8305. this.transport.close();
  8306. // ignore further transport communication
  8307. this.transport.removeAllListeners();
  8308. // set ready state
  8309. this.readyState = 'closed';
  8310. // clear session id
  8311. this.id = null;
  8312. // emit close event
  8313. this.emit('close', reason, desc);
  8314. // clean buffers after, so users can still
  8315. // grab the buffers on `close` event
  8316. self.writeBuffer = [];
  8317. self.prevBufferLen = 0;
  8318. }
  8319. };
  8320. /**
  8321. * Filters upgrades, returning only those matching client transports.
  8322. *
  8323. * @param {Array} server upgrades
  8324. * @api private
  8325. *
  8326. */
  8327. Socket.prototype.filterUpgrades = function (upgrades) {
  8328. var filteredUpgrades = [];
  8329. for (var i = 0, j = upgrades.length; i < j; i++) {
  8330. if (~index(this.transports, upgrades[i])) filteredUpgrades.push(upgrades[i]);
  8331. }
  8332. return filteredUpgrades;
  8333. };
  8334. /***/ }),
  8335. /***/ "./node_modules/engine.io-client/lib/transport.js":
  8336. /*!********************************************************!*\
  8337. !*** ./node_modules/engine.io-client/lib/transport.js ***!
  8338. \********************************************************/
  8339. /*! no static exports found */
  8340. /***/ (function(module, exports, __webpack_require__) {
  8341. /**
  8342. * Module dependencies.
  8343. */
  8344. var parser = __webpack_require__(/*! engine.io-parser */ "./node_modules/engine.io-parser/lib/browser.js");
  8345. var Emitter = __webpack_require__(/*! component-emitter */ "./node_modules/component-emitter/index.js");
  8346. /**
  8347. * Module exports.
  8348. */
  8349. module.exports = Transport;
  8350. /**
  8351. * Transport abstract constructor.
  8352. *
  8353. * @param {Object} options.
  8354. * @api private
  8355. */
  8356. function Transport (opts) {
  8357. this.path = opts.path;
  8358. this.hostname = opts.hostname;
  8359. this.port = opts.port;
  8360. this.secure = opts.secure;
  8361. this.query = opts.query;
  8362. this.timestampParam = opts.timestampParam;
  8363. this.timestampRequests = opts.timestampRequests;
  8364. this.readyState = '';
  8365. this.agent = opts.agent || false;
  8366. this.socket = opts.socket;
  8367. this.enablesXDR = opts.enablesXDR;
  8368. this.withCredentials = opts.withCredentials;
  8369. // SSL options for Node.js client
  8370. this.pfx = opts.pfx;
  8371. this.key = opts.key;
  8372. this.passphrase = opts.passphrase;
  8373. this.cert = opts.cert;
  8374. this.ca = opts.ca;
  8375. this.ciphers = opts.ciphers;
  8376. this.rejectUnauthorized = opts.rejectUnauthorized;
  8377. this.forceNode = opts.forceNode;
  8378. // results of ReactNative environment detection
  8379. this.isReactNative = opts.isReactNative;
  8380. // other options for Node.js client
  8381. this.extraHeaders = opts.extraHeaders;
  8382. this.localAddress = opts.localAddress;
  8383. }
  8384. /**
  8385. * Mix in `Emitter`.
  8386. */
  8387. Emitter(Transport.prototype);
  8388. /**
  8389. * Emits an error.
  8390. *
  8391. * @param {String} str
  8392. * @return {Transport} for chaining
  8393. * @api public
  8394. */
  8395. Transport.prototype.onError = function (msg, desc) {
  8396. var err = new Error(msg);
  8397. err.type = 'TransportError';
  8398. err.description = desc;
  8399. this.emit('error', err);
  8400. return this;
  8401. };
  8402. /**
  8403. * Opens the transport.
  8404. *
  8405. * @api public
  8406. */
  8407. Transport.prototype.open = function () {
  8408. if ('closed' === this.readyState || '' === this.readyState) {
  8409. this.readyState = 'opening';
  8410. this.doOpen();
  8411. }
  8412. return this;
  8413. };
  8414. /**
  8415. * Closes the transport.
  8416. *
  8417. * @api private
  8418. */
  8419. Transport.prototype.close = function () {
  8420. if ('opening' === this.readyState || 'open' === this.readyState) {
  8421. this.doClose();
  8422. this.onClose();
  8423. }
  8424. return this;
  8425. };
  8426. /**
  8427. * Sends multiple packets.
  8428. *
  8429. * @param {Array} packets
  8430. * @api private
  8431. */
  8432. Transport.prototype.send = function (packets) {
  8433. if ('open' === this.readyState) {
  8434. this.write(packets);
  8435. } else {
  8436. throw new Error('Transport not open');
  8437. }
  8438. };
  8439. /**
  8440. * Called upon open
  8441. *
  8442. * @api private
  8443. */
  8444. Transport.prototype.onOpen = function () {
  8445. this.readyState = 'open';
  8446. this.writable = true;
  8447. this.emit('open');
  8448. };
  8449. /**
  8450. * Called with data.
  8451. *
  8452. * @param {String} data
  8453. * @api private
  8454. */
  8455. Transport.prototype.onData = function (data) {
  8456. var packet = parser.decodePacket(data, this.socket.binaryType);
  8457. this.onPacket(packet);
  8458. };
  8459. /**
  8460. * Called with a decoded packet.
  8461. */
  8462. Transport.prototype.onPacket = function (packet) {
  8463. this.emit('packet', packet);
  8464. };
  8465. /**
  8466. * Called upon close.
  8467. *
  8468. * @api private
  8469. */
  8470. Transport.prototype.onClose = function () {
  8471. this.readyState = 'closed';
  8472. this.emit('close');
  8473. };
  8474. /***/ }),
  8475. /***/ "./node_modules/engine.io-client/lib/transports/index.js":
  8476. /*!***************************************************************!*\
  8477. !*** ./node_modules/engine.io-client/lib/transports/index.js ***!
  8478. \***************************************************************/
  8479. /*! no static exports found */
  8480. /***/ (function(module, exports, __webpack_require__) {
  8481. /**
  8482. * Module dependencies
  8483. */
  8484. var XMLHttpRequest = __webpack_require__(/*! xmlhttprequest-ssl */ "./node_modules/engine.io-client/lib/xmlhttprequest.js");
  8485. var XHR = __webpack_require__(/*! ./polling-xhr */ "./node_modules/engine.io-client/lib/transports/polling-xhr.js");
  8486. var JSONP = __webpack_require__(/*! ./polling-jsonp */ "./node_modules/engine.io-client/lib/transports/polling-jsonp.js");
  8487. var websocket = __webpack_require__(/*! ./websocket */ "./node_modules/engine.io-client/lib/transports/websocket.js");
  8488. /**
  8489. * Export transports.
  8490. */
  8491. exports.polling = polling;
  8492. exports.websocket = websocket;
  8493. /**
  8494. * Polling transport polymorphic constructor.
  8495. * Decides on xhr vs jsonp based on feature detection.
  8496. *
  8497. * @api private
  8498. */
  8499. function polling (opts) {
  8500. var xhr;
  8501. var xd = false;
  8502. var xs = false;
  8503. var jsonp = false !== opts.jsonp;
  8504. if (typeof location !== 'undefined') {
  8505. var isSSL = 'https:' === location.protocol;
  8506. var port = location.port;
  8507. // some user agents have empty `location.port`
  8508. if (!port) {
  8509. port = isSSL ? 443 : 80;
  8510. }
  8511. xd = opts.hostname !== location.hostname || port !== opts.port;
  8512. xs = opts.secure !== isSSL;
  8513. }
  8514. opts.xdomain = xd;
  8515. opts.xscheme = xs;
  8516. xhr = new XMLHttpRequest(opts);
  8517. if ('open' in xhr && !opts.forceJSONP) {
  8518. return new XHR(opts);
  8519. } else {
  8520. if (!jsonp) throw new Error('JSONP disabled');
  8521. return new JSONP(opts);
  8522. }
  8523. }
  8524. /***/ }),
  8525. /***/ "./node_modules/engine.io-client/lib/transports/polling-jsonp.js":
  8526. /*!***********************************************************************!*\
  8527. !*** ./node_modules/engine.io-client/lib/transports/polling-jsonp.js ***!
  8528. \***********************************************************************/
  8529. /*! no static exports found */
  8530. /***/ (function(module, exports, __webpack_require__) {
  8531. /**
  8532. * Module requirements.
  8533. */
  8534. var Polling = __webpack_require__(/*! ./polling */ "./node_modules/engine.io-client/lib/transports/polling.js");
  8535. var inherit = __webpack_require__(/*! component-inherit */ "./node_modules/component-inherit/index.js");
  8536. var globalThis = __webpack_require__(/*! ../globalThis */ "./node_modules/engine.io-client/lib/globalThis.browser.js");
  8537. /**
  8538. * Module exports.
  8539. */
  8540. module.exports = JSONPPolling;
  8541. /**
  8542. * Cached regular expressions.
  8543. */
  8544. var rNewline = /\n/g;
  8545. var rEscapedNewline = /\\n/g;
  8546. /**
  8547. * Global JSONP callbacks.
  8548. */
  8549. var callbacks;
  8550. /**
  8551. * Noop.
  8552. */
  8553. function empty () { }
  8554. /**
  8555. * JSONP Polling constructor.
  8556. *
  8557. * @param {Object} opts.
  8558. * @api public
  8559. */
  8560. function JSONPPolling (opts) {
  8561. Polling.call(this, opts);
  8562. this.query = this.query || {};
  8563. // define global callbacks array if not present
  8564. // we do this here (lazily) to avoid unneeded global pollution
  8565. if (!callbacks) {
  8566. // we need to consider multiple engines in the same page
  8567. callbacks = globalThis.___eio = (globalThis.___eio || []);
  8568. }
  8569. // callback identifier
  8570. this.index = callbacks.length;
  8571. // add callback to jsonp global
  8572. var self = this;
  8573. callbacks.push(function (msg) {
  8574. self.onData(msg);
  8575. });
  8576. // append to query string
  8577. this.query.j = this.index;
  8578. // prevent spurious errors from being emitted when the window is unloaded
  8579. if (typeof addEventListener === 'function') {
  8580. addEventListener('beforeunload', function () {
  8581. if (self.script) self.script.onerror = empty;
  8582. }, false);
  8583. }
  8584. }
  8585. /**
  8586. * Inherits from Polling.
  8587. */
  8588. inherit(JSONPPolling, Polling);
  8589. /*
  8590. * JSONP only supports binary as base64 encoded strings
  8591. */
  8592. JSONPPolling.prototype.supportsBinary = false;
  8593. /**
  8594. * Closes the socket.
  8595. *
  8596. * @api private
  8597. */
  8598. JSONPPolling.prototype.doClose = function () {
  8599. if (this.script) {
  8600. this.script.parentNode.removeChild(this.script);
  8601. this.script = null;
  8602. }
  8603. if (this.form) {
  8604. this.form.parentNode.removeChild(this.form);
  8605. this.form = null;
  8606. this.iframe = null;
  8607. }
  8608. Polling.prototype.doClose.call(this);
  8609. };
  8610. /**
  8611. * Starts a poll cycle.
  8612. *
  8613. * @api private
  8614. */
  8615. JSONPPolling.prototype.doPoll = function () {
  8616. var self = this;
  8617. var script = document.createElement('script');
  8618. if (this.script) {
  8619. this.script.parentNode.removeChild(this.script);
  8620. this.script = null;
  8621. }
  8622. script.async = true;
  8623. script.src = this.uri();
  8624. script.onerror = function (e) {
  8625. self.onError('jsonp poll error', e);
  8626. };
  8627. var insertAt = document.getElementsByTagName('script')[0];
  8628. if (insertAt) {
  8629. insertAt.parentNode.insertBefore(script, insertAt);
  8630. } else {
  8631. (document.head || document.body).appendChild(script);
  8632. }
  8633. this.script = script;
  8634. var isUAgecko = 'undefined' !== typeof navigator && /gecko/i.test(navigator.userAgent);
  8635. if (isUAgecko) {
  8636. setTimeout(function () {
  8637. var iframe = document.createElement('iframe');
  8638. document.body.appendChild(iframe);
  8639. document.body.removeChild(iframe);
  8640. }, 100);
  8641. }
  8642. };
  8643. /**
  8644. * Writes with a hidden iframe.
  8645. *
  8646. * @param {String} data to send
  8647. * @param {Function} called upon flush.
  8648. * @api private
  8649. */
  8650. JSONPPolling.prototype.doWrite = function (data, fn) {
  8651. var self = this;
  8652. if (!this.form) {
  8653. var form = document.createElement('form');
  8654. var area = document.createElement('textarea');
  8655. var id = this.iframeId = 'eio_iframe_' + this.index;
  8656. var iframe;
  8657. form.className = 'socketio';
  8658. form.style.position = 'absolute';
  8659. form.style.top = '-1000px';
  8660. form.style.left = '-1000px';
  8661. form.target = id;
  8662. form.method = 'POST';
  8663. form.setAttribute('accept-charset', 'utf-8');
  8664. area.name = 'd';
  8665. form.appendChild(area);
  8666. document.body.appendChild(form);
  8667. this.form = form;
  8668. this.area = area;
  8669. }
  8670. this.form.action = this.uri();
  8671. function complete () {
  8672. initIframe();
  8673. fn();
  8674. }
  8675. function initIframe () {
  8676. if (self.iframe) {
  8677. try {
  8678. self.form.removeChild(self.iframe);
  8679. } catch (e) {
  8680. self.onError('jsonp polling iframe removal error', e);
  8681. }
  8682. }
  8683. try {
  8684. // ie6 dynamic iframes with target="" support (thanks Chris Lambacher)
  8685. var html = '<iframe src="javascript:0" name="' + self.iframeId + '">';
  8686. iframe = document.createElement(html);
  8687. } catch (e) {
  8688. iframe = document.createElement('iframe');
  8689. iframe.name = self.iframeId;
  8690. iframe.src = 'javascript:0';
  8691. }
  8692. iframe.id = self.iframeId;
  8693. self.form.appendChild(iframe);
  8694. self.iframe = iframe;
  8695. }
  8696. initIframe();
  8697. // escape \n to prevent it from being converted into \r\n by some UAs
  8698. // double escaping is required for escaped new lines because unescaping of new lines can be done safely on server-side
  8699. data = data.replace(rEscapedNewline, '\\\n');
  8700. this.area.value = data.replace(rNewline, '\\n');
  8701. try {
  8702. this.form.submit();
  8703. } catch (e) {}
  8704. if (this.iframe.attachEvent) {
  8705. this.iframe.onreadystatechange = function () {
  8706. if (self.iframe.readyState === 'complete') {
  8707. complete();
  8708. }
  8709. };
  8710. } else {
  8711. this.iframe.onload = complete;
  8712. }
  8713. };
  8714. /***/ }),
  8715. /***/ "./node_modules/engine.io-client/lib/transports/polling-xhr.js":
  8716. /*!*********************************************************************!*\
  8717. !*** ./node_modules/engine.io-client/lib/transports/polling-xhr.js ***!
  8718. \*********************************************************************/
  8719. /*! no static exports found */
  8720. /***/ (function(module, exports, __webpack_require__) {
  8721. /* global attachEvent */
  8722. /**
  8723. * Module requirements.
  8724. */
  8725. var XMLHttpRequest = __webpack_require__(/*! xmlhttprequest-ssl */ "./node_modules/engine.io-client/lib/xmlhttprequest.js");
  8726. var Polling = __webpack_require__(/*! ./polling */ "./node_modules/engine.io-client/lib/transports/polling.js");
  8727. var Emitter = __webpack_require__(/*! component-emitter */ "./node_modules/component-emitter/index.js");
  8728. var inherit = __webpack_require__(/*! component-inherit */ "./node_modules/component-inherit/index.js");
  8729. var debug = __webpack_require__(/*! debug */ "./node_modules/engine.io-client/node_modules/debug/src/browser.js")('engine.io-client:polling-xhr');
  8730. var globalThis = __webpack_require__(/*! ../globalThis */ "./node_modules/engine.io-client/lib/globalThis.browser.js");
  8731. /**
  8732. * Module exports.
  8733. */
  8734. module.exports = XHR;
  8735. module.exports.Request = Request;
  8736. /**
  8737. * Empty function
  8738. */
  8739. function empty () {}
  8740. /**
  8741. * XHR Polling constructor.
  8742. *
  8743. * @param {Object} opts
  8744. * @api public
  8745. */
  8746. function XHR (opts) {
  8747. Polling.call(this, opts);
  8748. this.requestTimeout = opts.requestTimeout;
  8749. this.extraHeaders = opts.extraHeaders;
  8750. if (typeof location !== 'undefined') {
  8751. var isSSL = 'https:' === location.protocol;
  8752. var port = location.port;
  8753. // some user agents have empty `location.port`
  8754. if (!port) {
  8755. port = isSSL ? 443 : 80;
  8756. }
  8757. this.xd = (typeof location !== 'undefined' && opts.hostname !== location.hostname) ||
  8758. port !== opts.port;
  8759. this.xs = opts.secure !== isSSL;
  8760. }
  8761. }
  8762. /**
  8763. * Inherits from Polling.
  8764. */
  8765. inherit(XHR, Polling);
  8766. /**
  8767. * XHR supports binary
  8768. */
  8769. XHR.prototype.supportsBinary = true;
  8770. /**
  8771. * Creates a request.
  8772. *
  8773. * @param {String} method
  8774. * @api private
  8775. */
  8776. XHR.prototype.request = function (opts) {
  8777. opts = opts || {};
  8778. opts.uri = this.uri();
  8779. opts.xd = this.xd;
  8780. opts.xs = this.xs;
  8781. opts.agent = this.agent || false;
  8782. opts.supportsBinary = this.supportsBinary;
  8783. opts.enablesXDR = this.enablesXDR;
  8784. opts.withCredentials = this.withCredentials;
  8785. // SSL options for Node.js client
  8786. opts.pfx = this.pfx;
  8787. opts.key = this.key;
  8788. opts.passphrase = this.passphrase;
  8789. opts.cert = this.cert;
  8790. opts.ca = this.ca;
  8791. opts.ciphers = this.ciphers;
  8792. opts.rejectUnauthorized = this.rejectUnauthorized;
  8793. opts.requestTimeout = this.requestTimeout;
  8794. // other options for Node.js client
  8795. opts.extraHeaders = this.extraHeaders;
  8796. return new Request(opts);
  8797. };
  8798. /**
  8799. * Sends data.
  8800. *
  8801. * @param {String} data to send.
  8802. * @param {Function} called upon flush.
  8803. * @api private
  8804. */
  8805. XHR.prototype.doWrite = function (data, fn) {
  8806. var isBinary = typeof data !== 'string' && data !== undefined;
  8807. var req = this.request({ method: 'POST', data: data, isBinary: isBinary });
  8808. var self = this;
  8809. req.on('success', fn);
  8810. req.on('error', function (err) {
  8811. self.onError('xhr post error', err);
  8812. });
  8813. this.sendXhr = req;
  8814. };
  8815. /**
  8816. * Starts a poll cycle.
  8817. *
  8818. * @api private
  8819. */
  8820. XHR.prototype.doPoll = function () {
  8821. debug('xhr poll');
  8822. var req = this.request();
  8823. var self = this;
  8824. req.on('data', function (data) {
  8825. self.onData(data);
  8826. });
  8827. req.on('error', function (err) {
  8828. self.onError('xhr poll error', err);
  8829. });
  8830. this.pollXhr = req;
  8831. };
  8832. /**
  8833. * Request constructor
  8834. *
  8835. * @param {Object} options
  8836. * @api public
  8837. */
  8838. function Request (opts) {
  8839. this.method = opts.method || 'GET';
  8840. this.uri = opts.uri;
  8841. this.xd = !!opts.xd;
  8842. this.xs = !!opts.xs;
  8843. this.async = false !== opts.async;
  8844. this.data = undefined !== opts.data ? opts.data : null;
  8845. this.agent = opts.agent;
  8846. this.isBinary = opts.isBinary;
  8847. this.supportsBinary = opts.supportsBinary;
  8848. this.enablesXDR = opts.enablesXDR;
  8849. this.withCredentials = opts.withCredentials;
  8850. this.requestTimeout = opts.requestTimeout;
  8851. // SSL options for Node.js client
  8852. this.pfx = opts.pfx;
  8853. this.key = opts.key;
  8854. this.passphrase = opts.passphrase;
  8855. this.cert = opts.cert;
  8856. this.ca = opts.ca;
  8857. this.ciphers = opts.ciphers;
  8858. this.rejectUnauthorized = opts.rejectUnauthorized;
  8859. // other options for Node.js client
  8860. this.extraHeaders = opts.extraHeaders;
  8861. this.create();
  8862. }
  8863. /**
  8864. * Mix in `Emitter`.
  8865. */
  8866. Emitter(Request.prototype);
  8867. /**
  8868. * Creates the XHR object and sends the request.
  8869. *
  8870. * @api private
  8871. */
  8872. Request.prototype.create = function () {
  8873. var opts = { agent: this.agent, xdomain: this.xd, xscheme: this.xs, enablesXDR: this.enablesXDR };
  8874. // SSL options for Node.js client
  8875. opts.pfx = this.pfx;
  8876. opts.key = this.key;
  8877. opts.passphrase = this.passphrase;
  8878. opts.cert = this.cert;
  8879. opts.ca = this.ca;
  8880. opts.ciphers = this.ciphers;
  8881. opts.rejectUnauthorized = this.rejectUnauthorized;
  8882. var xhr = this.xhr = new XMLHttpRequest(opts);
  8883. var self = this;
  8884. try {
  8885. debug('xhr open %s: %s', this.method, this.uri);
  8886. xhr.open(this.method, this.uri, this.async);
  8887. try {
  8888. if (this.extraHeaders) {
  8889. xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);
  8890. for (var i in this.extraHeaders) {
  8891. if (this.extraHeaders.hasOwnProperty(i)) {
  8892. xhr.setRequestHeader(i, this.extraHeaders[i]);
  8893. }
  8894. }
  8895. }
  8896. } catch (e) {}
  8897. if ('POST' === this.method) {
  8898. try {
  8899. if (this.isBinary) {
  8900. xhr.setRequestHeader('Content-type', 'application/octet-stream');
  8901. } else {
  8902. xhr.setRequestHeader('Content-type', 'text/plain;charset=UTF-8');
  8903. }
  8904. } catch (e) {}
  8905. }
  8906. try {
  8907. xhr.setRequestHeader('Accept', '*/*');
  8908. } catch (e) {}
  8909. // ie6 check
  8910. if ('withCredentials' in xhr) {
  8911. xhr.withCredentials = this.withCredentials;
  8912. }
  8913. if (this.requestTimeout) {
  8914. xhr.timeout = this.requestTimeout;
  8915. }
  8916. if (this.hasXDR()) {
  8917. xhr.onload = function () {
  8918. self.onLoad();
  8919. };
  8920. xhr.onerror = function () {
  8921. self.onError(xhr.responseText);
  8922. };
  8923. } else {
  8924. xhr.onreadystatechange = function () {
  8925. if (xhr.readyState === 2) {
  8926. try {
  8927. var contentType = xhr.getResponseHeader('Content-Type');
  8928. if (self.supportsBinary && contentType === 'application/octet-stream' || contentType === 'application/octet-stream; charset=UTF-8') {
  8929. xhr.responseType = 'arraybuffer';
  8930. }
  8931. } catch (e) {}
  8932. }
  8933. if (4 !== xhr.readyState) return;
  8934. if (200 === xhr.status || 1223 === xhr.status) {
  8935. self.onLoad();
  8936. } else {
  8937. // make sure the `error` event handler that's user-set
  8938. // does not throw in the same tick and gets caught here
  8939. setTimeout(function () {
  8940. self.onError(typeof xhr.status === 'number' ? xhr.status : 0);
  8941. }, 0);
  8942. }
  8943. };
  8944. }
  8945. debug('xhr data %s', this.data);
  8946. xhr.send(this.data);
  8947. } catch (e) {
  8948. // Need to defer since .create() is called directly fhrom the constructor
  8949. // and thus the 'error' event can only be only bound *after* this exception
  8950. // occurs. Therefore, also, we cannot throw here at all.
  8951. setTimeout(function () {
  8952. self.onError(e);
  8953. }, 0);
  8954. return;
  8955. }
  8956. if (typeof document !== 'undefined') {
  8957. this.index = Request.requestsCount++;
  8958. Request.requests[this.index] = this;
  8959. }
  8960. };
  8961. /**
  8962. * Called upon successful response.
  8963. *
  8964. * @api private
  8965. */
  8966. Request.prototype.onSuccess = function () {
  8967. this.emit('success');
  8968. this.cleanup();
  8969. };
  8970. /**
  8971. * Called if we have data.
  8972. *
  8973. * @api private
  8974. */
  8975. Request.prototype.onData = function (data) {
  8976. this.emit('data', data);
  8977. this.onSuccess();
  8978. };
  8979. /**
  8980. * Called upon error.
  8981. *
  8982. * @api private
  8983. */
  8984. Request.prototype.onError = function (err) {
  8985. this.emit('error', err);
  8986. this.cleanup(true);
  8987. };
  8988. /**
  8989. * Cleans up house.
  8990. *
  8991. * @api private
  8992. */
  8993. Request.prototype.cleanup = function (fromError) {
  8994. if ('undefined' === typeof this.xhr || null === this.xhr) {
  8995. return;
  8996. }
  8997. // xmlhttprequest
  8998. if (this.hasXDR()) {
  8999. this.xhr.onload = this.xhr.onerror = empty;
  9000. } else {
  9001. this.xhr.onreadystatechange = empty;
  9002. }
  9003. if (fromError) {
  9004. try {
  9005. this.xhr.abort();
  9006. } catch (e) {}
  9007. }
  9008. if (typeof document !== 'undefined') {
  9009. delete Request.requests[this.index];
  9010. }
  9011. this.xhr = null;
  9012. };
  9013. /**
  9014. * Called upon load.
  9015. *
  9016. * @api private
  9017. */
  9018. Request.prototype.onLoad = function () {
  9019. var data;
  9020. try {
  9021. var contentType;
  9022. try {
  9023. contentType = this.xhr.getResponseHeader('Content-Type');
  9024. } catch (e) {}
  9025. if (contentType === 'application/octet-stream' || contentType === 'application/octet-stream; charset=UTF-8') {
  9026. data = this.xhr.response || this.xhr.responseText;
  9027. } else {
  9028. data = this.xhr.responseText;
  9029. }
  9030. } catch (e) {
  9031. this.onError(e);
  9032. }
  9033. if (null != data) {
  9034. this.onData(data);
  9035. }
  9036. };
  9037. /**
  9038. * Check if it has XDomainRequest.
  9039. *
  9040. * @api private
  9041. */
  9042. Request.prototype.hasXDR = function () {
  9043. return typeof XDomainRequest !== 'undefined' && !this.xs && this.enablesXDR;
  9044. };
  9045. /**
  9046. * Aborts the request.
  9047. *
  9048. * @api public
  9049. */
  9050. Request.prototype.abort = function () {
  9051. this.cleanup();
  9052. };
  9053. /**
  9054. * Aborts pending requests when unloading the window. This is needed to prevent
  9055. * memory leaks (e.g. when using IE) and to ensure that no spurious error is
  9056. * emitted.
  9057. */
  9058. Request.requestsCount = 0;
  9059. Request.requests = {};
  9060. if (typeof document !== 'undefined') {
  9061. if (typeof attachEvent === 'function') {
  9062. attachEvent('onunload', unloadHandler);
  9063. } else if (typeof addEventListener === 'function') {
  9064. var terminationEvent = 'onpagehide' in globalThis ? 'pagehide' : 'unload';
  9065. addEventListener(terminationEvent, unloadHandler, false);
  9066. }
  9067. }
  9068. function unloadHandler () {
  9069. for (var i in Request.requests) {
  9070. if (Request.requests.hasOwnProperty(i)) {
  9071. Request.requests[i].abort();
  9072. }
  9073. }
  9074. }
  9075. /***/ }),
  9076. /***/ "./node_modules/engine.io-client/lib/transports/polling.js":
  9077. /*!*****************************************************************!*\
  9078. !*** ./node_modules/engine.io-client/lib/transports/polling.js ***!
  9079. \*****************************************************************/
  9080. /*! no static exports found */
  9081. /***/ (function(module, exports, __webpack_require__) {
  9082. /**
  9083. * Module dependencies.
  9084. */
  9085. var Transport = __webpack_require__(/*! ../transport */ "./node_modules/engine.io-client/lib/transport.js");
  9086. var parseqs = __webpack_require__(/*! parseqs */ "./node_modules/parseqs/index.js");
  9087. var parser = __webpack_require__(/*! engine.io-parser */ "./node_modules/engine.io-parser/lib/browser.js");
  9088. var inherit = __webpack_require__(/*! component-inherit */ "./node_modules/component-inherit/index.js");
  9089. var yeast = __webpack_require__(/*! yeast */ "./node_modules/yeast/index.js");
  9090. var debug = __webpack_require__(/*! debug */ "./node_modules/engine.io-client/node_modules/debug/src/browser.js")('engine.io-client:polling');
  9091. /**
  9092. * Module exports.
  9093. */
  9094. module.exports = Polling;
  9095. /**
  9096. * Is XHR2 supported?
  9097. */
  9098. var hasXHR2 = (function () {
  9099. var XMLHttpRequest = __webpack_require__(/*! xmlhttprequest-ssl */ "./node_modules/engine.io-client/lib/xmlhttprequest.js");
  9100. var xhr = new XMLHttpRequest({ xdomain: false });
  9101. return null != xhr.responseType;
  9102. })();
  9103. /**
  9104. * Polling interface.
  9105. *
  9106. * @param {Object} opts
  9107. * @api private
  9108. */
  9109. function Polling (opts) {
  9110. var forceBase64 = (opts && opts.forceBase64);
  9111. if (!hasXHR2 || forceBase64) {
  9112. this.supportsBinary = false;
  9113. }
  9114. Transport.call(this, opts);
  9115. }
  9116. /**
  9117. * Inherits from Transport.
  9118. */
  9119. inherit(Polling, Transport);
  9120. /**
  9121. * Transport name.
  9122. */
  9123. Polling.prototype.name = 'polling';
  9124. /**
  9125. * Opens the socket (triggers polling). We write a PING message to determine
  9126. * when the transport is open.
  9127. *
  9128. * @api private
  9129. */
  9130. Polling.prototype.doOpen = function () {
  9131. this.poll();
  9132. };
  9133. /**
  9134. * Pauses polling.
  9135. *
  9136. * @param {Function} callback upon buffers are flushed and transport is paused
  9137. * @api private
  9138. */
  9139. Polling.prototype.pause = function (onPause) {
  9140. var self = this;
  9141. this.readyState = 'pausing';
  9142. function pause () {
  9143. debug('paused');
  9144. self.readyState = 'paused';
  9145. onPause();
  9146. }
  9147. if (this.polling || !this.writable) {
  9148. var total = 0;
  9149. if (this.polling) {
  9150. debug('we are currently polling - waiting to pause');
  9151. total++;
  9152. this.once('pollComplete', function () {
  9153. debug('pre-pause polling complete');
  9154. --total || pause();
  9155. });
  9156. }
  9157. if (!this.writable) {
  9158. debug('we are currently writing - waiting to pause');
  9159. total++;
  9160. this.once('drain', function () {
  9161. debug('pre-pause writing complete');
  9162. --total || pause();
  9163. });
  9164. }
  9165. } else {
  9166. pause();
  9167. }
  9168. };
  9169. /**
  9170. * Starts polling cycle.
  9171. *
  9172. * @api public
  9173. */
  9174. Polling.prototype.poll = function () {
  9175. debug('polling');
  9176. this.polling = true;
  9177. this.doPoll();
  9178. this.emit('poll');
  9179. };
  9180. /**
  9181. * Overloads onData to detect payloads.
  9182. *
  9183. * @api private
  9184. */
  9185. Polling.prototype.onData = function (data) {
  9186. var self = this;
  9187. debug('polling got data %s', data);
  9188. var callback = function (packet, index, total) {
  9189. // if its the first message we consider the transport open
  9190. if ('opening' === self.readyState) {
  9191. self.onOpen();
  9192. }
  9193. // if its a close packet, we close the ongoing requests
  9194. if ('close' === packet.type) {
  9195. self.onClose();
  9196. return false;
  9197. }
  9198. // otherwise bypass onData and handle the message
  9199. self.onPacket(packet);
  9200. };
  9201. // decode payload
  9202. parser.decodePayload(data, this.socket.binaryType, callback);
  9203. // if an event did not trigger closing
  9204. if ('closed' !== this.readyState) {
  9205. // if we got data we're not polling
  9206. this.polling = false;
  9207. this.emit('pollComplete');
  9208. if ('open' === this.readyState) {
  9209. this.poll();
  9210. } else {
  9211. debug('ignoring poll - transport state "%s"', this.readyState);
  9212. }
  9213. }
  9214. };
  9215. /**
  9216. * For polling, send a close packet.
  9217. *
  9218. * @api private
  9219. */
  9220. Polling.prototype.doClose = function () {
  9221. var self = this;
  9222. function close () {
  9223. debug('writing close packet');
  9224. self.write([{ type: 'close' }]);
  9225. }
  9226. if ('open' === this.readyState) {
  9227. debug('transport open - closing');
  9228. close();
  9229. } else {
  9230. // in case we're trying to close while
  9231. // handshaking is in progress (GH-164)
  9232. debug('transport not open - deferring close');
  9233. this.once('open', close);
  9234. }
  9235. };
  9236. /**
  9237. * Writes a packets payload.
  9238. *
  9239. * @param {Array} data packets
  9240. * @param {Function} drain callback
  9241. * @api private
  9242. */
  9243. Polling.prototype.write = function (packets) {
  9244. var self = this;
  9245. this.writable = false;
  9246. var callbackfn = function () {
  9247. self.writable = true;
  9248. self.emit('drain');
  9249. };
  9250. parser.encodePayload(packets, this.supportsBinary, function (data) {
  9251. self.doWrite(data, callbackfn);
  9252. });
  9253. };
  9254. /**
  9255. * Generates uri for connection.
  9256. *
  9257. * @api private
  9258. */
  9259. Polling.prototype.uri = function () {
  9260. var query = this.query || {};
  9261. var schema = this.secure ? 'https' : 'http';
  9262. var port = '';
  9263. // cache busting is forced
  9264. if (false !== this.timestampRequests) {
  9265. query[this.timestampParam] = yeast();
  9266. }
  9267. if (!this.supportsBinary && !query.sid) {
  9268. query.b64 = 1;
  9269. }
  9270. query = parseqs.encode(query);
  9271. // avoid port if default for schema
  9272. if (this.port && (('https' === schema && Number(this.port) !== 443) ||
  9273. ('http' === schema && Number(this.port) !== 80))) {
  9274. port = ':' + this.port;
  9275. }
  9276. // prepend ? to query
  9277. if (query.length) {
  9278. query = '?' + query;
  9279. }
  9280. var ipv6 = this.hostname.indexOf(':') !== -1;
  9281. return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;
  9282. };
  9283. /***/ }),
  9284. /***/ "./node_modules/engine.io-client/lib/transports/websocket.js":
  9285. /*!*******************************************************************!*\
  9286. !*** ./node_modules/engine.io-client/lib/transports/websocket.js ***!
  9287. \*******************************************************************/
  9288. /*! no static exports found */
  9289. /***/ (function(module, exports, __webpack_require__) {
  9290. /* WEBPACK VAR INJECTION */(function(Buffer) {/**
  9291. * Module dependencies.
  9292. */
  9293. var Transport = __webpack_require__(/*! ../transport */ "./node_modules/engine.io-client/lib/transport.js");
  9294. var parser = __webpack_require__(/*! engine.io-parser */ "./node_modules/engine.io-parser/lib/browser.js");
  9295. var parseqs = __webpack_require__(/*! parseqs */ "./node_modules/parseqs/index.js");
  9296. var inherit = __webpack_require__(/*! component-inherit */ "./node_modules/component-inherit/index.js");
  9297. var yeast = __webpack_require__(/*! yeast */ "./node_modules/yeast/index.js");
  9298. var debug = __webpack_require__(/*! debug */ "./node_modules/engine.io-client/node_modules/debug/src/browser.js")('engine.io-client:websocket');
  9299. var BrowserWebSocket, NodeWebSocket;
  9300. if (typeof WebSocket !== 'undefined') {
  9301. BrowserWebSocket = WebSocket;
  9302. } else if (typeof self !== 'undefined') {
  9303. BrowserWebSocket = self.WebSocket || self.MozWebSocket;
  9304. }
  9305. if (typeof window === 'undefined') {
  9306. try {
  9307. NodeWebSocket = __webpack_require__(/*! ws */ 1);
  9308. } catch (e) { }
  9309. }
  9310. /**
  9311. * Get either the `WebSocket` or `MozWebSocket` globals
  9312. * in the browser or try to resolve WebSocket-compatible
  9313. * interface exposed by `ws` for Node-like environment.
  9314. */
  9315. var WebSocketImpl = BrowserWebSocket || NodeWebSocket;
  9316. /**
  9317. * Module exports.
  9318. */
  9319. module.exports = WS;
  9320. /**
  9321. * WebSocket transport constructor.
  9322. *
  9323. * @api {Object} connection options
  9324. * @api public
  9325. */
  9326. function WS (opts) {
  9327. var forceBase64 = (opts && opts.forceBase64);
  9328. if (forceBase64) {
  9329. this.supportsBinary = false;
  9330. }
  9331. this.perMessageDeflate = opts.perMessageDeflate;
  9332. this.usingBrowserWebSocket = BrowserWebSocket && !opts.forceNode;
  9333. this.protocols = opts.protocols;
  9334. if (!this.usingBrowserWebSocket) {
  9335. WebSocketImpl = NodeWebSocket;
  9336. }
  9337. Transport.call(this, opts);
  9338. }
  9339. /**
  9340. * Inherits from Transport.
  9341. */
  9342. inherit(WS, Transport);
  9343. /**
  9344. * Transport name.
  9345. *
  9346. * @api public
  9347. */
  9348. WS.prototype.name = 'websocket';
  9349. /*
  9350. * WebSockets support binary
  9351. */
  9352. WS.prototype.supportsBinary = true;
  9353. /**
  9354. * Opens socket.
  9355. *
  9356. * @api private
  9357. */
  9358. WS.prototype.doOpen = function () {
  9359. if (!this.check()) {
  9360. // let probe timeout
  9361. return;
  9362. }
  9363. var uri = this.uri();
  9364. var protocols = this.protocols;
  9365. var opts = {
  9366. agent: this.agent,
  9367. perMessageDeflate: this.perMessageDeflate
  9368. };
  9369. // SSL options for Node.js client
  9370. opts.pfx = this.pfx;
  9371. opts.key = this.key;
  9372. opts.passphrase = this.passphrase;
  9373. opts.cert = this.cert;
  9374. opts.ca = this.ca;
  9375. opts.ciphers = this.ciphers;
  9376. opts.rejectUnauthorized = this.rejectUnauthorized;
  9377. if (this.extraHeaders) {
  9378. opts.headers = this.extraHeaders;
  9379. }
  9380. if (this.localAddress) {
  9381. opts.localAddress = this.localAddress;
  9382. }
  9383. try {
  9384. this.ws =
  9385. this.usingBrowserWebSocket && !this.isReactNative
  9386. ? protocols
  9387. ? new WebSocketImpl(uri, protocols)
  9388. : new WebSocketImpl(uri)
  9389. : new WebSocketImpl(uri, protocols, opts);
  9390. } catch (err) {
  9391. return this.emit('error', err);
  9392. }
  9393. if (this.ws.binaryType === undefined) {
  9394. this.supportsBinary = false;
  9395. }
  9396. if (this.ws.supports && this.ws.supports.binary) {
  9397. this.supportsBinary = true;
  9398. this.ws.binaryType = 'nodebuffer';
  9399. } else {
  9400. this.ws.binaryType = 'arraybuffer';
  9401. }
  9402. this.addEventListeners();
  9403. };
  9404. /**
  9405. * Adds event listeners to the socket
  9406. *
  9407. * @api private
  9408. */
  9409. WS.prototype.addEventListeners = function () {
  9410. var self = this;
  9411. this.ws.onopen = function () {
  9412. self.onOpen();
  9413. };
  9414. this.ws.onclose = function () {
  9415. self.onClose();
  9416. };
  9417. this.ws.onmessage = function (ev) {
  9418. self.onData(ev.data);
  9419. };
  9420. this.ws.onerror = function (e) {
  9421. self.onError('websocket error', e);
  9422. };
  9423. };
  9424. /**
  9425. * Writes data to socket.
  9426. *
  9427. * @param {Array} array of packets.
  9428. * @api private
  9429. */
  9430. WS.prototype.write = function (packets) {
  9431. var self = this;
  9432. this.writable = false;
  9433. // encodePacket efficient as it uses WS framing
  9434. // no need for encodePayload
  9435. var total = packets.length;
  9436. for (var i = 0, l = total; i < l; i++) {
  9437. (function (packet) {
  9438. parser.encodePacket(packet, self.supportsBinary, function (data) {
  9439. if (!self.usingBrowserWebSocket) {
  9440. // always create a new object (GH-437)
  9441. var opts = {};
  9442. if (packet.options) {
  9443. opts.compress = packet.options.compress;
  9444. }
  9445. if (self.perMessageDeflate) {
  9446. var len = 'string' === typeof data ? Buffer.byteLength(data) : data.length;
  9447. if (len < self.perMessageDeflate.threshold) {
  9448. opts.compress = false;
  9449. }
  9450. }
  9451. }
  9452. // Sometimes the websocket has already been closed but the browser didn't
  9453. // have a chance of informing us about it yet, in that case send will
  9454. // throw an error
  9455. try {
  9456. if (self.usingBrowserWebSocket) {
  9457. // TypeError is thrown when passing the second argument on Safari
  9458. self.ws.send(data);
  9459. } else {
  9460. self.ws.send(data, opts);
  9461. }
  9462. } catch (e) {
  9463. debug('websocket closed before onclose event');
  9464. }
  9465. --total || done();
  9466. });
  9467. })(packets[i]);
  9468. }
  9469. function done () {
  9470. self.emit('flush');
  9471. // fake drain
  9472. // defer to next tick to allow Socket to clear writeBuffer
  9473. setTimeout(function () {
  9474. self.writable = true;
  9475. self.emit('drain');
  9476. }, 0);
  9477. }
  9478. };
  9479. /**
  9480. * Called upon close
  9481. *
  9482. * @api private
  9483. */
  9484. WS.prototype.onClose = function () {
  9485. Transport.prototype.onClose.call(this);
  9486. };
  9487. /**
  9488. * Closes socket.
  9489. *
  9490. * @api private
  9491. */
  9492. WS.prototype.doClose = function () {
  9493. if (typeof this.ws !== 'undefined') {
  9494. this.ws.close();
  9495. }
  9496. };
  9497. /**
  9498. * Generates uri for connection.
  9499. *
  9500. * @api private
  9501. */
  9502. WS.prototype.uri = function () {
  9503. var query = this.query || {};
  9504. var schema = this.secure ? 'wss' : 'ws';
  9505. var port = '';
  9506. // avoid port if default for schema
  9507. if (this.port && (('wss' === schema && Number(this.port) !== 443) ||
  9508. ('ws' === schema && Number(this.port) !== 80))) {
  9509. port = ':' + this.port;
  9510. }
  9511. // append timestamp to URI
  9512. if (this.timestampRequests) {
  9513. query[this.timestampParam] = yeast();
  9514. }
  9515. // communicate binary support capabilities
  9516. if (!this.supportsBinary) {
  9517. query.b64 = 1;
  9518. }
  9519. query = parseqs.encode(query);
  9520. // prepend ? to query
  9521. if (query.length) {
  9522. query = '?' + query;
  9523. }
  9524. var ipv6 = this.hostname.indexOf(':') !== -1;
  9525. return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;
  9526. };
  9527. /**
  9528. * Feature detection for WebSocket.
  9529. *
  9530. * @return {Boolean} whether this transport is available.
  9531. * @api public
  9532. */
  9533. WS.prototype.check = function () {
  9534. return !!WebSocketImpl && !('__initialize' in WebSocketImpl && this.name === WS.prototype.name);
  9535. };
  9536. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../buffer/index.js */ "./node_modules/buffer/index.js").Buffer))
  9537. /***/ }),
  9538. /***/ "./node_modules/engine.io-client/lib/xmlhttprequest.js":
  9539. /*!*************************************************************!*\
  9540. !*** ./node_modules/engine.io-client/lib/xmlhttprequest.js ***!
  9541. \*************************************************************/
  9542. /*! no static exports found */
  9543. /***/ (function(module, exports, __webpack_require__) {
  9544. // browser shim for xmlhttprequest module
  9545. var hasCORS = __webpack_require__(/*! has-cors */ "./node_modules/has-cors/index.js");
  9546. var globalThis = __webpack_require__(/*! ./globalThis */ "./node_modules/engine.io-client/lib/globalThis.browser.js");
  9547. module.exports = function (opts) {
  9548. var xdomain = opts.xdomain;
  9549. // scheme must be same when usign XDomainRequest
  9550. // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx
  9551. var xscheme = opts.xscheme;
  9552. // XDomainRequest has a flow of not sending cookie, therefore it should be disabled as a default.
  9553. // https://github.com/Automattic/engine.io-client/pull/217
  9554. var enablesXDR = opts.enablesXDR;
  9555. // XMLHttpRequest can be disabled on IE
  9556. try {
  9557. if ('undefined' !== typeof XMLHttpRequest && (!xdomain || hasCORS)) {
  9558. return new XMLHttpRequest();
  9559. }
  9560. } catch (e) { }
  9561. // Use XDomainRequest for IE8 if enablesXDR is true
  9562. // because loading bar keeps flashing when using jsonp-polling
  9563. // https://github.com/yujiosaka/socke.io-ie8-loading-example
  9564. try {
  9565. if ('undefined' !== typeof XDomainRequest && !xscheme && enablesXDR) {
  9566. return new XDomainRequest();
  9567. }
  9568. } catch (e) { }
  9569. if (!xdomain) {
  9570. try {
  9571. return new globalThis[['Active'].concat('Object').join('X')]('Microsoft.XMLHTTP');
  9572. } catch (e) { }
  9573. }
  9574. };
  9575. /***/ }),
  9576. /***/ "./node_modules/engine.io-client/node_modules/debug/src/browser.js":
  9577. /*!*************************************************************************!*\
  9578. !*** ./node_modules/engine.io-client/node_modules/debug/src/browser.js ***!
  9579. \*************************************************************************/
  9580. /*! no static exports found */
  9581. /***/ (function(module, exports, __webpack_require__) {
  9582. /* WEBPACK VAR INJECTION */(function(process) {/* eslint-env browser */
  9583. /**
  9584. * This is the web browser implementation of `debug()`.
  9585. */
  9586. exports.log = log;
  9587. exports.formatArgs = formatArgs;
  9588. exports.save = save;
  9589. exports.load = load;
  9590. exports.useColors = useColors;
  9591. exports.storage = localstorage();
  9592. /**
  9593. * Colors.
  9594. */
  9595. exports.colors = [
  9596. '#0000CC',
  9597. '#0000FF',
  9598. '#0033CC',
  9599. '#0033FF',
  9600. '#0066CC',
  9601. '#0066FF',
  9602. '#0099CC',
  9603. '#0099FF',
  9604. '#00CC00',
  9605. '#00CC33',
  9606. '#00CC66',
  9607. '#00CC99',
  9608. '#00CCCC',
  9609. '#00CCFF',
  9610. '#3300CC',
  9611. '#3300FF',
  9612. '#3333CC',
  9613. '#3333FF',
  9614. '#3366CC',
  9615. '#3366FF',
  9616. '#3399CC',
  9617. '#3399FF',
  9618. '#33CC00',
  9619. '#33CC33',
  9620. '#33CC66',
  9621. '#33CC99',
  9622. '#33CCCC',
  9623. '#33CCFF',
  9624. '#6600CC',
  9625. '#6600FF',
  9626. '#6633CC',
  9627. '#6633FF',
  9628. '#66CC00',
  9629. '#66CC33',
  9630. '#9900CC',
  9631. '#9900FF',
  9632. '#9933CC',
  9633. '#9933FF',
  9634. '#99CC00',
  9635. '#99CC33',
  9636. '#CC0000',
  9637. '#CC0033',
  9638. '#CC0066',
  9639. '#CC0099',
  9640. '#CC00CC',
  9641. '#CC00FF',
  9642. '#CC3300',
  9643. '#CC3333',
  9644. '#CC3366',
  9645. '#CC3399',
  9646. '#CC33CC',
  9647. '#CC33FF',
  9648. '#CC6600',
  9649. '#CC6633',
  9650. '#CC9900',
  9651. '#CC9933',
  9652. '#CCCC00',
  9653. '#CCCC33',
  9654. '#FF0000',
  9655. '#FF0033',
  9656. '#FF0066',
  9657. '#FF0099',
  9658. '#FF00CC',
  9659. '#FF00FF',
  9660. '#FF3300',
  9661. '#FF3333',
  9662. '#FF3366',
  9663. '#FF3399',
  9664. '#FF33CC',
  9665. '#FF33FF',
  9666. '#FF6600',
  9667. '#FF6633',
  9668. '#FF9900',
  9669. '#FF9933',
  9670. '#FFCC00',
  9671. '#FFCC33'
  9672. ];
  9673. /**
  9674. * Currently only WebKit-based Web Inspectors, Firefox >= v31,
  9675. * and the Firebug extension (any Firefox version) are known
  9676. * to support "%c" CSS customizations.
  9677. *
  9678. * TODO: add a `localStorage` variable to explicitly enable/disable colors
  9679. */
  9680. // eslint-disable-next-line complexity
  9681. function useColors() {
  9682. // NB: In an Electron preload script, document will be defined but not fully
  9683. // initialized. Since we know we're in Chrome, we'll just detect this case
  9684. // explicitly
  9685. if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
  9686. return true;
  9687. }
  9688. // Internet Explorer and Edge do not support colors.
  9689. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
  9690. return false;
  9691. }
  9692. // Is webkit? http://stackoverflow.com/a/16459606/376773
  9693. // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
  9694. return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
  9695. // Is firebug? http://stackoverflow.com/a/398120/376773
  9696. (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
  9697. // Is firefox >= v31?
  9698. // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
  9699. (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
  9700. // Double check webkit in userAgent just in case we are in a worker
  9701. (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
  9702. }
  9703. /**
  9704. * Colorize log arguments if enabled.
  9705. *
  9706. * @api public
  9707. */
  9708. function formatArgs(args) {
  9709. args[0] = (this.useColors ? '%c' : '') +
  9710. this.namespace +
  9711. (this.useColors ? ' %c' : ' ') +
  9712. args[0] +
  9713. (this.useColors ? '%c ' : ' ') +
  9714. '+' + module.exports.humanize(this.diff);
  9715. if (!this.useColors) {
  9716. return;
  9717. }
  9718. const c = 'color: ' + this.color;
  9719. args.splice(1, 0, c, 'color: inherit');
  9720. // The final "%c" is somewhat tricky, because there could be other
  9721. // arguments passed either before or after the %c, so we need to
  9722. // figure out the correct index to insert the CSS into
  9723. let index = 0;
  9724. let lastC = 0;
  9725. args[0].replace(/%[a-zA-Z%]/g, match => {
  9726. if (match === '%%') {
  9727. return;
  9728. }
  9729. index++;
  9730. if (match === '%c') {
  9731. // We only are interested in the *last* %c
  9732. // (the user may have provided their own)
  9733. lastC = index;
  9734. }
  9735. });
  9736. args.splice(lastC, 0, c);
  9737. }
  9738. /**
  9739. * Invokes `console.log()` when available.
  9740. * No-op when `console.log` is not a "function".
  9741. *
  9742. * @api public
  9743. */
  9744. function log(...args) {
  9745. // This hackery is required for IE8/9, where
  9746. // the `console.log` function doesn't have 'apply'
  9747. return typeof console === 'object' &&
  9748. console.log &&
  9749. console.log(...args);
  9750. }
  9751. /**
  9752. * Save `namespaces`.
  9753. *
  9754. * @param {String} namespaces
  9755. * @api private
  9756. */
  9757. function save(namespaces) {
  9758. try {
  9759. if (namespaces) {
  9760. exports.storage.setItem('debug', namespaces);
  9761. } else {
  9762. exports.storage.removeItem('debug');
  9763. }
  9764. } catch (error) {
  9765. // Swallow
  9766. // XXX (@Qix-) should we be logging these?
  9767. }
  9768. }
  9769. /**
  9770. * Load `namespaces`.
  9771. *
  9772. * @return {String} returns the previously persisted debug modes
  9773. * @api private
  9774. */
  9775. function load() {
  9776. let r;
  9777. try {
  9778. r = exports.storage.getItem('debug');
  9779. } catch (error) {
  9780. // Swallow
  9781. // XXX (@Qix-) should we be logging these?
  9782. }
  9783. // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
  9784. if (!r && typeof process !== 'undefined' && 'env' in process) {
  9785. r = process.env.DEBUG;
  9786. }
  9787. return r;
  9788. }
  9789. /**
  9790. * Localstorage attempts to return the localstorage.
  9791. *
  9792. * This is necessary because safari throws
  9793. * when a user disables cookies/localstorage
  9794. * and you attempt to access it.
  9795. *
  9796. * @return {LocalStorage}
  9797. * @api private
  9798. */
  9799. function localstorage() {
  9800. try {
  9801. // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
  9802. // The Browser also has localStorage in the global context.
  9803. return localStorage;
  9804. } catch (error) {
  9805. // Swallow
  9806. // XXX (@Qix-) should we be logging these?
  9807. }
  9808. }
  9809. module.exports = __webpack_require__(/*! ./common */ "./node_modules/engine.io-client/node_modules/debug/src/common.js")(exports);
  9810. const {formatters} = module.exports;
  9811. /**
  9812. * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
  9813. */
  9814. formatters.j = function (v) {
  9815. try {
  9816. return JSON.stringify(v);
  9817. } catch (error) {
  9818. return '[UnexpectedJSONParseError]: ' + error.message;
  9819. }
  9820. };
  9821. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ "./node_modules/process/browser.js")))
  9822. /***/ }),
  9823. /***/ "./node_modules/engine.io-client/node_modules/debug/src/common.js":
  9824. /*!************************************************************************!*\
  9825. !*** ./node_modules/engine.io-client/node_modules/debug/src/common.js ***!
  9826. \************************************************************************/
  9827. /*! no static exports found */
  9828. /***/ (function(module, exports, __webpack_require__) {
  9829. /**
  9830. * This is the common logic for both the Node.js and web browser
  9831. * implementations of `debug()`.
  9832. */
  9833. function setup(env) {
  9834. createDebug.debug = createDebug;
  9835. createDebug.default = createDebug;
  9836. createDebug.coerce = coerce;
  9837. createDebug.disable = disable;
  9838. createDebug.enable = enable;
  9839. createDebug.enabled = enabled;
  9840. createDebug.humanize = __webpack_require__(/*! ms */ "./node_modules/engine.io-client/node_modules/ms/index.js");
  9841. Object.keys(env).forEach(key => {
  9842. createDebug[key] = env[key];
  9843. });
  9844. /**
  9845. * Active `debug` instances.
  9846. */
  9847. createDebug.instances = [];
  9848. /**
  9849. * The currently active debug mode names, and names to skip.
  9850. */
  9851. createDebug.names = [];
  9852. createDebug.skips = [];
  9853. /**
  9854. * Map of special "%n" handling functions, for the debug "format" argument.
  9855. *
  9856. * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
  9857. */
  9858. createDebug.formatters = {};
  9859. /**
  9860. * Selects a color for a debug namespace
  9861. * @param {String} namespace The namespace string for the for the debug instance to be colored
  9862. * @return {Number|String} An ANSI color code for the given namespace
  9863. * @api private
  9864. */
  9865. function selectColor(namespace) {
  9866. let hash = 0;
  9867. for (let i = 0; i < namespace.length; i++) {
  9868. hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
  9869. hash |= 0; // Convert to 32bit integer
  9870. }
  9871. return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
  9872. }
  9873. createDebug.selectColor = selectColor;
  9874. /**
  9875. * Create a debugger with the given `namespace`.
  9876. *
  9877. * @param {String} namespace
  9878. * @return {Function}
  9879. * @api public
  9880. */
  9881. function createDebug(namespace) {
  9882. let prevTime;
  9883. function debug(...args) {
  9884. // Disabled?
  9885. if (!debug.enabled) {
  9886. return;
  9887. }
  9888. const self = debug;
  9889. // Set `diff` timestamp
  9890. const curr = Number(new Date());
  9891. const ms = curr - (prevTime || curr);
  9892. self.diff = ms;
  9893. self.prev = prevTime;
  9894. self.curr = curr;
  9895. prevTime = curr;
  9896. args[0] = createDebug.coerce(args[0]);
  9897. if (typeof args[0] !== 'string') {
  9898. // Anything else let's inspect with %O
  9899. args.unshift('%O');
  9900. }
  9901. // Apply any `formatters` transformations
  9902. let index = 0;
  9903. args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
  9904. // If we encounter an escaped % then don't increase the array index
  9905. if (match === '%%') {
  9906. return match;
  9907. }
  9908. index++;
  9909. const formatter = createDebug.formatters[format];
  9910. if (typeof formatter === 'function') {
  9911. const val = args[index];
  9912. match = formatter.call(self, val);
  9913. // Now we need to remove `args[index]` since it's inlined in the `format`
  9914. args.splice(index, 1);
  9915. index--;
  9916. }
  9917. return match;
  9918. });
  9919. // Apply env-specific formatting (colors, etc.)
  9920. createDebug.formatArgs.call(self, args);
  9921. const logFn = self.log || createDebug.log;
  9922. logFn.apply(self, args);
  9923. }
  9924. debug.namespace = namespace;
  9925. debug.enabled = createDebug.enabled(namespace);
  9926. debug.useColors = createDebug.useColors();
  9927. debug.color = selectColor(namespace);
  9928. debug.destroy = destroy;
  9929. debug.extend = extend;
  9930. // Debug.formatArgs = formatArgs;
  9931. // debug.rawLog = rawLog;
  9932. // env-specific initialization logic for debug instances
  9933. if (typeof createDebug.init === 'function') {
  9934. createDebug.init(debug);
  9935. }
  9936. createDebug.instances.push(debug);
  9937. return debug;
  9938. }
  9939. function destroy() {
  9940. const index = createDebug.instances.indexOf(this);
  9941. if (index !== -1) {
  9942. createDebug.instances.splice(index, 1);
  9943. return true;
  9944. }
  9945. return false;
  9946. }
  9947. function extend(namespace, delimiter) {
  9948. const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
  9949. newDebug.log = this.log;
  9950. return newDebug;
  9951. }
  9952. /**
  9953. * Enables a debug mode by namespaces. This can include modes
  9954. * separated by a colon and wildcards.
  9955. *
  9956. * @param {String} namespaces
  9957. * @api public
  9958. */
  9959. function enable(namespaces) {
  9960. createDebug.save(namespaces);
  9961. createDebug.names = [];
  9962. createDebug.skips = [];
  9963. let i;
  9964. const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
  9965. const len = split.length;
  9966. for (i = 0; i < len; i++) {
  9967. if (!split[i]) {
  9968. // ignore empty strings
  9969. continue;
  9970. }
  9971. namespaces = split[i].replace(/\*/g, '.*?');
  9972. if (namespaces[0] === '-') {
  9973. createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
  9974. } else {
  9975. createDebug.names.push(new RegExp('^' + namespaces + '$'));
  9976. }
  9977. }
  9978. for (i = 0; i < createDebug.instances.length; i++) {
  9979. const instance = createDebug.instances[i];
  9980. instance.enabled = createDebug.enabled(instance.namespace);
  9981. }
  9982. }
  9983. /**
  9984. * Disable debug output.
  9985. *
  9986. * @return {String} namespaces
  9987. * @api public
  9988. */
  9989. function disable() {
  9990. const namespaces = [
  9991. ...createDebug.names.map(toNamespace),
  9992. ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
  9993. ].join(',');
  9994. createDebug.enable('');
  9995. return namespaces;
  9996. }
  9997. /**
  9998. * Returns true if the given mode name is enabled, false otherwise.
  9999. *
  10000. * @param {String} name
  10001. * @return {Boolean}
  10002. * @api public
  10003. */
  10004. function enabled(name) {
  10005. if (name[name.length - 1] === '*') {
  10006. return true;
  10007. }
  10008. let i;
  10009. let len;
  10010. for (i = 0, len = createDebug.skips.length; i < len; i++) {
  10011. if (createDebug.skips[i].test(name)) {
  10012. return false;
  10013. }
  10014. }
  10015. for (i = 0, len = createDebug.names.length; i < len; i++) {
  10016. if (createDebug.names[i].test(name)) {
  10017. return true;
  10018. }
  10019. }
  10020. return false;
  10021. }
  10022. /**
  10023. * Convert regexp to namespace
  10024. *
  10025. * @param {RegExp} regxep
  10026. * @return {String} namespace
  10027. * @api private
  10028. */
  10029. function toNamespace(regexp) {
  10030. return regexp.toString()
  10031. .substring(2, regexp.toString().length - 2)
  10032. .replace(/\.\*\?$/, '*');
  10033. }
  10034. /**
  10035. * Coerce `val`.
  10036. *
  10037. * @param {Mixed} val
  10038. * @return {Mixed}
  10039. * @api private
  10040. */
  10041. function coerce(val) {
  10042. if (val instanceof Error) {
  10043. return val.stack || val.message;
  10044. }
  10045. return val;
  10046. }
  10047. createDebug.enable(createDebug.load());
  10048. return createDebug;
  10049. }
  10050. module.exports = setup;
  10051. /***/ }),
  10052. /***/ "./node_modules/engine.io-client/node_modules/ms/index.js":
  10053. /*!****************************************************************!*\
  10054. !*** ./node_modules/engine.io-client/node_modules/ms/index.js ***!
  10055. \****************************************************************/
  10056. /*! no static exports found */
  10057. /***/ (function(module, exports) {
  10058. /**
  10059. * Helpers.
  10060. */
  10061. var s = 1000;
  10062. var m = s * 60;
  10063. var h = m * 60;
  10064. var d = h * 24;
  10065. var w = d * 7;
  10066. var y = d * 365.25;
  10067. /**
  10068. * Parse or format the given `val`.
  10069. *
  10070. * Options:
  10071. *
  10072. * - `long` verbose formatting [false]
  10073. *
  10074. * @param {String|Number} val
  10075. * @param {Object} [options]
  10076. * @throws {Error} throw an error if val is not a non-empty string or a number
  10077. * @return {String|Number}
  10078. * @api public
  10079. */
  10080. module.exports = function(val, options) {
  10081. options = options || {};
  10082. var type = typeof val;
  10083. if (type === 'string' && val.length > 0) {
  10084. return parse(val);
  10085. } else if (type === 'number' && isFinite(val)) {
  10086. return options.long ? fmtLong(val) : fmtShort(val);
  10087. }
  10088. throw new Error(
  10089. 'val is not a non-empty string or a valid number. val=' +
  10090. JSON.stringify(val)
  10091. );
  10092. };
  10093. /**
  10094. * Parse the given `str` and return milliseconds.
  10095. *
  10096. * @param {String} str
  10097. * @return {Number}
  10098. * @api private
  10099. */
  10100. function parse(str) {
  10101. str = String(str);
  10102. if (str.length > 100) {
  10103. return;
  10104. }
  10105. var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
  10106. str
  10107. );
  10108. if (!match) {
  10109. return;
  10110. }
  10111. var n = parseFloat(match[1]);
  10112. var type = (match[2] || 'ms').toLowerCase();
  10113. switch (type) {
  10114. case 'years':
  10115. case 'year':
  10116. case 'yrs':
  10117. case 'yr':
  10118. case 'y':
  10119. return n * y;
  10120. case 'weeks':
  10121. case 'week':
  10122. case 'w':
  10123. return n * w;
  10124. case 'days':
  10125. case 'day':
  10126. case 'd':
  10127. return n * d;
  10128. case 'hours':
  10129. case 'hour':
  10130. case 'hrs':
  10131. case 'hr':
  10132. case 'h':
  10133. return n * h;
  10134. case 'minutes':
  10135. case 'minute':
  10136. case 'mins':
  10137. case 'min':
  10138. case 'm':
  10139. return n * m;
  10140. case 'seconds':
  10141. case 'second':
  10142. case 'secs':
  10143. case 'sec':
  10144. case 's':
  10145. return n * s;
  10146. case 'milliseconds':
  10147. case 'millisecond':
  10148. case 'msecs':
  10149. case 'msec':
  10150. case 'ms':
  10151. return n;
  10152. default:
  10153. return undefined;
  10154. }
  10155. }
  10156. /**
  10157. * Short format for `ms`.
  10158. *
  10159. * @param {Number} ms
  10160. * @return {String}
  10161. * @api private
  10162. */
  10163. function fmtShort(ms) {
  10164. var msAbs = Math.abs(ms);
  10165. if (msAbs >= d) {
  10166. return Math.round(ms / d) + 'd';
  10167. }
  10168. if (msAbs >= h) {
  10169. return Math.round(ms / h) + 'h';
  10170. }
  10171. if (msAbs >= m) {
  10172. return Math.round(ms / m) + 'm';
  10173. }
  10174. if (msAbs >= s) {
  10175. return Math.round(ms / s) + 's';
  10176. }
  10177. return ms + 'ms';
  10178. }
  10179. /**
  10180. * Long format for `ms`.
  10181. *
  10182. * @param {Number} ms
  10183. * @return {String}
  10184. * @api private
  10185. */
  10186. function fmtLong(ms) {
  10187. var msAbs = Math.abs(ms);
  10188. if (msAbs >= d) {
  10189. return plural(ms, msAbs, d, 'day');
  10190. }
  10191. if (msAbs >= h) {
  10192. return plural(ms, msAbs, h, 'hour');
  10193. }
  10194. if (msAbs >= m) {
  10195. return plural(ms, msAbs, m, 'minute');
  10196. }
  10197. if (msAbs >= s) {
  10198. return plural(ms, msAbs, s, 'second');
  10199. }
  10200. return ms + ' ms';
  10201. }
  10202. /**
  10203. * Pluralization helper.
  10204. */
  10205. function plural(ms, msAbs, n, name) {
  10206. var isPlural = msAbs >= n * 1.5;
  10207. return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
  10208. }
  10209. /***/ }),
  10210. /***/ "./node_modules/engine.io-parser/lib/browser.js":
  10211. /*!******************************************************!*\
  10212. !*** ./node_modules/engine.io-parser/lib/browser.js ***!
  10213. \******************************************************/
  10214. /*! no static exports found */
  10215. /***/ (function(module, exports, __webpack_require__) {
  10216. /**
  10217. * Module dependencies.
  10218. */
  10219. var keys = __webpack_require__(/*! ./keys */ "./node_modules/engine.io-parser/lib/keys.js");
  10220. var hasBinary = __webpack_require__(/*! has-binary2 */ "./node_modules/has-binary2/index.js");
  10221. var sliceBuffer = __webpack_require__(/*! arraybuffer.slice */ "./node_modules/arraybuffer.slice/index.js");
  10222. var after = __webpack_require__(/*! after */ "./node_modules/after/index.js");
  10223. var utf8 = __webpack_require__(/*! ./utf8 */ "./node_modules/engine.io-parser/lib/utf8.js");
  10224. var base64encoder;
  10225. if (typeof ArrayBuffer !== 'undefined') {
  10226. base64encoder = __webpack_require__(/*! base64-arraybuffer */ "./node_modules/base64-arraybuffer/lib/base64-arraybuffer.js");
  10227. }
  10228. /**
  10229. * Check if we are running an android browser. That requires us to use
  10230. * ArrayBuffer with polling transports...
  10231. *
  10232. * http://ghinda.net/jpeg-blob-ajax-android/
  10233. */
  10234. var isAndroid = typeof navigator !== 'undefined' && /Android/i.test(navigator.userAgent);
  10235. /**
  10236. * Check if we are running in PhantomJS.
  10237. * Uploading a Blob with PhantomJS does not work correctly, as reported here:
  10238. * https://github.com/ariya/phantomjs/issues/11395
  10239. * @type boolean
  10240. */
  10241. var isPhantomJS = typeof navigator !== 'undefined' && /PhantomJS/i.test(navigator.userAgent);
  10242. /**
  10243. * When true, avoids using Blobs to encode payloads.
  10244. * @type boolean
  10245. */
  10246. var dontSendBlobs = isAndroid || isPhantomJS;
  10247. /**
  10248. * Current protocol version.
  10249. */
  10250. exports.protocol = 3;
  10251. /**
  10252. * Packet types.
  10253. */
  10254. var packets = exports.packets = {
  10255. open: 0 // non-ws
  10256. , close: 1 // non-ws
  10257. , ping: 2
  10258. , pong: 3
  10259. , message: 4
  10260. , upgrade: 5
  10261. , noop: 6
  10262. };
  10263. var packetslist = keys(packets);
  10264. /**
  10265. * Premade error packet.
  10266. */
  10267. var err = { type: 'error', data: 'parser error' };
  10268. /**
  10269. * Create a blob api even for blob builder when vendor prefixes exist
  10270. */
  10271. var Blob = __webpack_require__(/*! blob */ "./node_modules/blob/index.js");
  10272. /**
  10273. * Encodes a packet.
  10274. *
  10275. * <packet type id> [ <data> ]
  10276. *
  10277. * Example:
  10278. *
  10279. * 5hello world
  10280. * 3
  10281. * 4
  10282. *
  10283. * Binary is encoded in an identical principle
  10284. *
  10285. * @api private
  10286. */
  10287. exports.encodePacket = function (packet, supportsBinary, utf8encode, callback) {
  10288. if (typeof supportsBinary === 'function') {
  10289. callback = supportsBinary;
  10290. supportsBinary = false;
  10291. }
  10292. if (typeof utf8encode === 'function') {
  10293. callback = utf8encode;
  10294. utf8encode = null;
  10295. }
  10296. var data = (packet.data === undefined)
  10297. ? undefined
  10298. : packet.data.buffer || packet.data;
  10299. if (typeof ArrayBuffer !== 'undefined' && data instanceof ArrayBuffer) {
  10300. return encodeArrayBuffer(packet, supportsBinary, callback);
  10301. } else if (typeof Blob !== 'undefined' && data instanceof Blob) {
  10302. return encodeBlob(packet, supportsBinary, callback);
  10303. }
  10304. // might be an object with { base64: true, data: dataAsBase64String }
  10305. if (data && data.base64) {
  10306. return encodeBase64Object(packet, callback);
  10307. }
  10308. // Sending data as a utf-8 string
  10309. var encoded = packets[packet.type];
  10310. // data fragment is optional
  10311. if (undefined !== packet.data) {
  10312. encoded += utf8encode ? utf8.encode(String(packet.data), { strict: false }) : String(packet.data);
  10313. }
  10314. return callback('' + encoded);
  10315. };
  10316. function encodeBase64Object(packet, callback) {
  10317. // packet data is an object { base64: true, data: dataAsBase64String }
  10318. var message = 'b' + exports.packets[packet.type] + packet.data.data;
  10319. return callback(message);
  10320. }
  10321. /**
  10322. * Encode packet helpers for binary types
  10323. */
  10324. function encodeArrayBuffer(packet, supportsBinary, callback) {
  10325. if (!supportsBinary) {
  10326. return exports.encodeBase64Packet(packet, callback);
  10327. }
  10328. var data = packet.data;
  10329. var contentArray = new Uint8Array(data);
  10330. var resultBuffer = new Uint8Array(1 + data.byteLength);
  10331. resultBuffer[0] = packets[packet.type];
  10332. for (var i = 0; i < contentArray.length; i++) {
  10333. resultBuffer[i+1] = contentArray[i];
  10334. }
  10335. return callback(resultBuffer.buffer);
  10336. }
  10337. function encodeBlobAsArrayBuffer(packet, supportsBinary, callback) {
  10338. if (!supportsBinary) {
  10339. return exports.encodeBase64Packet(packet, callback);
  10340. }
  10341. var fr = new FileReader();
  10342. fr.onload = function() {
  10343. exports.encodePacket({ type: packet.type, data: fr.result }, supportsBinary, true, callback);
  10344. };
  10345. return fr.readAsArrayBuffer(packet.data);
  10346. }
  10347. function encodeBlob(packet, supportsBinary, callback) {
  10348. if (!supportsBinary) {
  10349. return exports.encodeBase64Packet(packet, callback);
  10350. }
  10351. if (dontSendBlobs) {
  10352. return encodeBlobAsArrayBuffer(packet, supportsBinary, callback);
  10353. }
  10354. var length = new Uint8Array(1);
  10355. length[0] = packets[packet.type];
  10356. var blob = new Blob([length.buffer, packet.data]);
  10357. return callback(blob);
  10358. }
  10359. /**
  10360. * Encodes a packet with binary data in a base64 string
  10361. *
  10362. * @param {Object} packet, has `type` and `data`
  10363. * @return {String} base64 encoded message
  10364. */
  10365. exports.encodeBase64Packet = function(packet, callback) {
  10366. var message = 'b' + exports.packets[packet.type];
  10367. if (typeof Blob !== 'undefined' && packet.data instanceof Blob) {
  10368. var fr = new FileReader();
  10369. fr.onload = function() {
  10370. var b64 = fr.result.split(',')[1];
  10371. callback(message + b64);
  10372. };
  10373. return fr.readAsDataURL(packet.data);
  10374. }
  10375. var b64data;
  10376. try {
  10377. b64data = String.fromCharCode.apply(null, new Uint8Array(packet.data));
  10378. } catch (e) {
  10379. // iPhone Safari doesn't let you apply with typed arrays
  10380. var typed = new Uint8Array(packet.data);
  10381. var basic = new Array(typed.length);
  10382. for (var i = 0; i < typed.length; i++) {
  10383. basic[i] = typed[i];
  10384. }
  10385. b64data = String.fromCharCode.apply(null, basic);
  10386. }
  10387. message += btoa(b64data);
  10388. return callback(message);
  10389. };
  10390. /**
  10391. * Decodes a packet. Changes format to Blob if requested.
  10392. *
  10393. * @return {Object} with `type` and `data` (if any)
  10394. * @api private
  10395. */
  10396. exports.decodePacket = function (data, binaryType, utf8decode) {
  10397. if (data === undefined) {
  10398. return err;
  10399. }
  10400. // String data
  10401. if (typeof data === 'string') {
  10402. if (data.charAt(0) === 'b') {
  10403. return exports.decodeBase64Packet(data.substr(1), binaryType);
  10404. }
  10405. if (utf8decode) {
  10406. data = tryDecode(data);
  10407. if (data === false) {
  10408. return err;
  10409. }
  10410. }
  10411. var type = data.charAt(0);
  10412. if (Number(type) != type || !packetslist[type]) {
  10413. return err;
  10414. }
  10415. if (data.length > 1) {
  10416. return { type: packetslist[type], data: data.substring(1) };
  10417. } else {
  10418. return { type: packetslist[type] };
  10419. }
  10420. }
  10421. var asArray = new Uint8Array(data);
  10422. var type = asArray[0];
  10423. var rest = sliceBuffer(data, 1);
  10424. if (Blob && binaryType === 'blob') {
  10425. rest = new Blob([rest]);
  10426. }
  10427. return { type: packetslist[type], data: rest };
  10428. };
  10429. function tryDecode(data) {
  10430. try {
  10431. data = utf8.decode(data, { strict: false });
  10432. } catch (e) {
  10433. return false;
  10434. }
  10435. return data;
  10436. }
  10437. /**
  10438. * Decodes a packet encoded in a base64 string
  10439. *
  10440. * @param {String} base64 encoded message
  10441. * @return {Object} with `type` and `data` (if any)
  10442. */
  10443. exports.decodeBase64Packet = function(msg, binaryType) {
  10444. var type = packetslist[msg.charAt(0)];
  10445. if (!base64encoder) {
  10446. return { type: type, data: { base64: true, data: msg.substr(1) } };
  10447. }
  10448. var data = base64encoder.decode(msg.substr(1));
  10449. if (binaryType === 'blob' && Blob) {
  10450. data = new Blob([data]);
  10451. }
  10452. return { type: type, data: data };
  10453. };
  10454. /**
  10455. * Encodes multiple messages (payload).
  10456. *
  10457. * <length>:data
  10458. *
  10459. * Example:
  10460. *
  10461. * 11:hello world2:hi
  10462. *
  10463. * If any contents are binary, they will be encoded as base64 strings. Base64
  10464. * encoded strings are marked with a b before the length specifier
  10465. *
  10466. * @param {Array} packets
  10467. * @api private
  10468. */
  10469. exports.encodePayload = function (packets, supportsBinary, callback) {
  10470. if (typeof supportsBinary === 'function') {
  10471. callback = supportsBinary;
  10472. supportsBinary = null;
  10473. }
  10474. var isBinary = hasBinary(packets);
  10475. if (supportsBinary && isBinary) {
  10476. if (Blob && !dontSendBlobs) {
  10477. return exports.encodePayloadAsBlob(packets, callback);
  10478. }
  10479. return exports.encodePayloadAsArrayBuffer(packets, callback);
  10480. }
  10481. if (!packets.length) {
  10482. return callback('0:');
  10483. }
  10484. function setLengthHeader(message) {
  10485. return message.length + ':' + message;
  10486. }
  10487. function encodeOne(packet, doneCallback) {
  10488. exports.encodePacket(packet, !isBinary ? false : supportsBinary, false, function(message) {
  10489. doneCallback(null, setLengthHeader(message));
  10490. });
  10491. }
  10492. map(packets, encodeOne, function(err, results) {
  10493. return callback(results.join(''));
  10494. });
  10495. };
  10496. /**
  10497. * Async array map using after
  10498. */
  10499. function map(ary, each, done) {
  10500. var result = new Array(ary.length);
  10501. var next = after(ary.length, done);
  10502. var eachWithIndex = function(i, el, cb) {
  10503. each(el, function(error, msg) {
  10504. result[i] = msg;
  10505. cb(error, result);
  10506. });
  10507. };
  10508. for (var i = 0; i < ary.length; i++) {
  10509. eachWithIndex(i, ary[i], next);
  10510. }
  10511. }
  10512. /*
  10513. * Decodes data when a payload is maybe expected. Possible binary contents are
  10514. * decoded from their base64 representation
  10515. *
  10516. * @param {String} data, callback method
  10517. * @api public
  10518. */
  10519. exports.decodePayload = function (data, binaryType, callback) {
  10520. if (typeof data !== 'string') {
  10521. return exports.decodePayloadAsBinary(data, binaryType, callback);
  10522. }
  10523. if (typeof binaryType === 'function') {
  10524. callback = binaryType;
  10525. binaryType = null;
  10526. }
  10527. var packet;
  10528. if (data === '') {
  10529. // parser error - ignoring payload
  10530. return callback(err, 0, 1);
  10531. }
  10532. var length = '', n, msg;
  10533. for (var i = 0, l = data.length; i < l; i++) {
  10534. var chr = data.charAt(i);
  10535. if (chr !== ':') {
  10536. length += chr;
  10537. continue;
  10538. }
  10539. if (length === '' || (length != (n = Number(length)))) {
  10540. // parser error - ignoring payload
  10541. return callback(err, 0, 1);
  10542. }
  10543. msg = data.substr(i + 1, n);
  10544. if (length != msg.length) {
  10545. // parser error - ignoring payload
  10546. return callback(err, 0, 1);
  10547. }
  10548. if (msg.length) {
  10549. packet = exports.decodePacket(msg, binaryType, false);
  10550. if (err.type === packet.type && err.data === packet.data) {
  10551. // parser error in individual packet - ignoring payload
  10552. return callback(err, 0, 1);
  10553. }
  10554. var ret = callback(packet, i + n, l);
  10555. if (false === ret) return;
  10556. }
  10557. // advance cursor
  10558. i += n;
  10559. length = '';
  10560. }
  10561. if (length !== '') {
  10562. // parser error - ignoring payload
  10563. return callback(err, 0, 1);
  10564. }
  10565. };
  10566. /**
  10567. * Encodes multiple messages (payload) as binary.
  10568. *
  10569. * <1 = binary, 0 = string><number from 0-9><number from 0-9>[...]<number
  10570. * 255><data>
  10571. *
  10572. * Example:
  10573. * 1 3 255 1 2 3, if the binary contents are interpreted as 8 bit integers
  10574. *
  10575. * @param {Array} packets
  10576. * @return {ArrayBuffer} encoded payload
  10577. * @api private
  10578. */
  10579. exports.encodePayloadAsArrayBuffer = function(packets, callback) {
  10580. if (!packets.length) {
  10581. return callback(new ArrayBuffer(0));
  10582. }
  10583. function encodeOne(packet, doneCallback) {
  10584. exports.encodePacket(packet, true, true, function(data) {
  10585. return doneCallback(null, data);
  10586. });
  10587. }
  10588. map(packets, encodeOne, function(err, encodedPackets) {
  10589. var totalLength = encodedPackets.reduce(function(acc, p) {
  10590. var len;
  10591. if (typeof p === 'string'){
  10592. len = p.length;
  10593. } else {
  10594. len = p.byteLength;
  10595. }
  10596. return acc + len.toString().length + len + 2; // string/binary identifier + separator = 2
  10597. }, 0);
  10598. var resultArray = new Uint8Array(totalLength);
  10599. var bufferIndex = 0;
  10600. encodedPackets.forEach(function(p) {
  10601. var isString = typeof p === 'string';
  10602. var ab = p;
  10603. if (isString) {
  10604. var view = new Uint8Array(p.length);
  10605. for (var i = 0; i < p.length; i++) {
  10606. view[i] = p.charCodeAt(i);
  10607. }
  10608. ab = view.buffer;
  10609. }
  10610. if (isString) { // not true binary
  10611. resultArray[bufferIndex++] = 0;
  10612. } else { // true binary
  10613. resultArray[bufferIndex++] = 1;
  10614. }
  10615. var lenStr = ab.byteLength.toString();
  10616. for (var i = 0; i < lenStr.length; i++) {
  10617. resultArray[bufferIndex++] = parseInt(lenStr[i]);
  10618. }
  10619. resultArray[bufferIndex++] = 255;
  10620. var view = new Uint8Array(ab);
  10621. for (var i = 0; i < view.length; i++) {
  10622. resultArray[bufferIndex++] = view[i];
  10623. }
  10624. });
  10625. return callback(resultArray.buffer);
  10626. });
  10627. };
  10628. /**
  10629. * Encode as Blob
  10630. */
  10631. exports.encodePayloadAsBlob = function(packets, callback) {
  10632. function encodeOne(packet, doneCallback) {
  10633. exports.encodePacket(packet, true, true, function(encoded) {
  10634. var binaryIdentifier = new Uint8Array(1);
  10635. binaryIdentifier[0] = 1;
  10636. if (typeof encoded === 'string') {
  10637. var view = new Uint8Array(encoded.length);
  10638. for (var i = 0; i < encoded.length; i++) {
  10639. view[i] = encoded.charCodeAt(i);
  10640. }
  10641. encoded = view.buffer;
  10642. binaryIdentifier[0] = 0;
  10643. }
  10644. var len = (encoded instanceof ArrayBuffer)
  10645. ? encoded.byteLength
  10646. : encoded.size;
  10647. var lenStr = len.toString();
  10648. var lengthAry = new Uint8Array(lenStr.length + 1);
  10649. for (var i = 0; i < lenStr.length; i++) {
  10650. lengthAry[i] = parseInt(lenStr[i]);
  10651. }
  10652. lengthAry[lenStr.length] = 255;
  10653. if (Blob) {
  10654. var blob = new Blob([binaryIdentifier.buffer, lengthAry.buffer, encoded]);
  10655. doneCallback(null, blob);
  10656. }
  10657. });
  10658. }
  10659. map(packets, encodeOne, function(err, results) {
  10660. return callback(new Blob(results));
  10661. });
  10662. };
  10663. /*
  10664. * Decodes data when a payload is maybe expected. Strings are decoded by
  10665. * interpreting each byte as a key code for entries marked to start with 0. See
  10666. * description of encodePayloadAsBinary
  10667. *
  10668. * @param {ArrayBuffer} data, callback method
  10669. * @api public
  10670. */
  10671. exports.decodePayloadAsBinary = function (data, binaryType, callback) {
  10672. if (typeof binaryType === 'function') {
  10673. callback = binaryType;
  10674. binaryType = null;
  10675. }
  10676. var bufferTail = data;
  10677. var buffers = [];
  10678. while (bufferTail.byteLength > 0) {
  10679. var tailArray = new Uint8Array(bufferTail);
  10680. var isString = tailArray[0] === 0;
  10681. var msgLength = '';
  10682. for (var i = 1; ; i++) {
  10683. if (tailArray[i] === 255) break;
  10684. // 310 = char length of Number.MAX_VALUE
  10685. if (msgLength.length > 310) {
  10686. return callback(err, 0, 1);
  10687. }
  10688. msgLength += tailArray[i];
  10689. }
  10690. bufferTail = sliceBuffer(bufferTail, 2 + msgLength.length);
  10691. msgLength = parseInt(msgLength);
  10692. var msg = sliceBuffer(bufferTail, 0, msgLength);
  10693. if (isString) {
  10694. try {
  10695. msg = String.fromCharCode.apply(null, new Uint8Array(msg));
  10696. } catch (e) {
  10697. // iPhone Safari doesn't let you apply to typed arrays
  10698. var typed = new Uint8Array(msg);
  10699. msg = '';
  10700. for (var i = 0; i < typed.length; i++) {
  10701. msg += String.fromCharCode(typed[i]);
  10702. }
  10703. }
  10704. }
  10705. buffers.push(msg);
  10706. bufferTail = sliceBuffer(bufferTail, msgLength);
  10707. }
  10708. var total = buffers.length;
  10709. buffers.forEach(function(buffer, i) {
  10710. callback(exports.decodePacket(buffer, binaryType, true), i, total);
  10711. });
  10712. };
  10713. /***/ }),
  10714. /***/ "./node_modules/engine.io-parser/lib/keys.js":
  10715. /*!***************************************************!*\
  10716. !*** ./node_modules/engine.io-parser/lib/keys.js ***!
  10717. \***************************************************/
  10718. /*! no static exports found */
  10719. /***/ (function(module, exports) {
  10720. /**
  10721. * Gets the keys for an object.
  10722. *
  10723. * @return {Array} keys
  10724. * @api private
  10725. */
  10726. module.exports = Object.keys || function keys (obj){
  10727. var arr = [];
  10728. var has = Object.prototype.hasOwnProperty;
  10729. for (var i in obj) {
  10730. if (has.call(obj, i)) {
  10731. arr.push(i);
  10732. }
  10733. }
  10734. return arr;
  10735. };
  10736. /***/ }),
  10737. /***/ "./node_modules/engine.io-parser/lib/utf8.js":
  10738. /*!***************************************************!*\
  10739. !*** ./node_modules/engine.io-parser/lib/utf8.js ***!
  10740. \***************************************************/
  10741. /*! no static exports found */
  10742. /***/ (function(module, exports) {
  10743. /*! https://mths.be/utf8js v2.1.2 by @mathias */
  10744. var stringFromCharCode = String.fromCharCode;
  10745. // Taken from https://mths.be/punycode
  10746. function ucs2decode(string) {
  10747. var output = [];
  10748. var counter = 0;
  10749. var length = string.length;
  10750. var value;
  10751. var extra;
  10752. while (counter < length) {
  10753. value = string.charCodeAt(counter++);
  10754. if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
  10755. // high surrogate, and there is a next character
  10756. extra = string.charCodeAt(counter++);
  10757. if ((extra & 0xFC00) == 0xDC00) { // low surrogate
  10758. output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
  10759. } else {
  10760. // unmatched surrogate; only append this code unit, in case the next
  10761. // code unit is the high surrogate of a surrogate pair
  10762. output.push(value);
  10763. counter--;
  10764. }
  10765. } else {
  10766. output.push(value);
  10767. }
  10768. }
  10769. return output;
  10770. }
  10771. // Taken from https://mths.be/punycode
  10772. function ucs2encode(array) {
  10773. var length = array.length;
  10774. var index = -1;
  10775. var value;
  10776. var output = '';
  10777. while (++index < length) {
  10778. value = array[index];
  10779. if (value > 0xFFFF) {
  10780. value -= 0x10000;
  10781. output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
  10782. value = 0xDC00 | value & 0x3FF;
  10783. }
  10784. output += stringFromCharCode(value);
  10785. }
  10786. return output;
  10787. }
  10788. function checkScalarValue(codePoint, strict) {
  10789. if (codePoint >= 0xD800 && codePoint <= 0xDFFF) {
  10790. if (strict) {
  10791. throw Error(
  10792. 'Lone surrogate U+' + codePoint.toString(16).toUpperCase() +
  10793. ' is not a scalar value'
  10794. );
  10795. }
  10796. return false;
  10797. }
  10798. return true;
  10799. }
  10800. /*--------------------------------------------------------------------------*/
  10801. function createByte(codePoint, shift) {
  10802. return stringFromCharCode(((codePoint >> shift) & 0x3F) | 0x80);
  10803. }
  10804. function encodeCodePoint(codePoint, strict) {
  10805. if ((codePoint & 0xFFFFFF80) == 0) { // 1-byte sequence
  10806. return stringFromCharCode(codePoint);
  10807. }
  10808. var symbol = '';
  10809. if ((codePoint & 0xFFFFF800) == 0) { // 2-byte sequence
  10810. symbol = stringFromCharCode(((codePoint >> 6) & 0x1F) | 0xC0);
  10811. }
  10812. else if ((codePoint & 0xFFFF0000) == 0) { // 3-byte sequence
  10813. if (!checkScalarValue(codePoint, strict)) {
  10814. codePoint = 0xFFFD;
  10815. }
  10816. symbol = stringFromCharCode(((codePoint >> 12) & 0x0F) | 0xE0);
  10817. symbol += createByte(codePoint, 6);
  10818. }
  10819. else if ((codePoint & 0xFFE00000) == 0) { // 4-byte sequence
  10820. symbol = stringFromCharCode(((codePoint >> 18) & 0x07) | 0xF0);
  10821. symbol += createByte(codePoint, 12);
  10822. symbol += createByte(codePoint, 6);
  10823. }
  10824. symbol += stringFromCharCode((codePoint & 0x3F) | 0x80);
  10825. return symbol;
  10826. }
  10827. function utf8encode(string, opts) {
  10828. opts = opts || {};
  10829. var strict = false !== opts.strict;
  10830. var codePoints = ucs2decode(string);
  10831. var length = codePoints.length;
  10832. var index = -1;
  10833. var codePoint;
  10834. var byteString = '';
  10835. while (++index < length) {
  10836. codePoint = codePoints[index];
  10837. byteString += encodeCodePoint(codePoint, strict);
  10838. }
  10839. return byteString;
  10840. }
  10841. /*--------------------------------------------------------------------------*/
  10842. function readContinuationByte() {
  10843. if (byteIndex >= byteCount) {
  10844. throw Error('Invalid byte index');
  10845. }
  10846. var continuationByte = byteArray[byteIndex] & 0xFF;
  10847. byteIndex++;
  10848. if ((continuationByte & 0xC0) == 0x80) {
  10849. return continuationByte & 0x3F;
  10850. }
  10851. // If we end up here, it’s not a continuation byte
  10852. throw Error('Invalid continuation byte');
  10853. }
  10854. function decodeSymbol(strict) {
  10855. var byte1;
  10856. var byte2;
  10857. var byte3;
  10858. var byte4;
  10859. var codePoint;
  10860. if (byteIndex > byteCount) {
  10861. throw Error('Invalid byte index');
  10862. }
  10863. if (byteIndex == byteCount) {
  10864. return false;
  10865. }
  10866. // Read first byte
  10867. byte1 = byteArray[byteIndex] & 0xFF;
  10868. byteIndex++;
  10869. // 1-byte sequence (no continuation bytes)
  10870. if ((byte1 & 0x80) == 0) {
  10871. return byte1;
  10872. }
  10873. // 2-byte sequence
  10874. if ((byte1 & 0xE0) == 0xC0) {
  10875. byte2 = readContinuationByte();
  10876. codePoint = ((byte1 & 0x1F) << 6) | byte2;
  10877. if (codePoint >= 0x80) {
  10878. return codePoint;
  10879. } else {
  10880. throw Error('Invalid continuation byte');
  10881. }
  10882. }
  10883. // 3-byte sequence (may include unpaired surrogates)
  10884. if ((byte1 & 0xF0) == 0xE0) {
  10885. byte2 = readContinuationByte();
  10886. byte3 = readContinuationByte();
  10887. codePoint = ((byte1 & 0x0F) << 12) | (byte2 << 6) | byte3;
  10888. if (codePoint >= 0x0800) {
  10889. return checkScalarValue(codePoint, strict) ? codePoint : 0xFFFD;
  10890. } else {
  10891. throw Error('Invalid continuation byte');
  10892. }
  10893. }
  10894. // 4-byte sequence
  10895. if ((byte1 & 0xF8) == 0xF0) {
  10896. byte2 = readContinuationByte();
  10897. byte3 = readContinuationByte();
  10898. byte4 = readContinuationByte();
  10899. codePoint = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0C) |
  10900. (byte3 << 0x06) | byte4;
  10901. if (codePoint >= 0x010000 && codePoint <= 0x10FFFF) {
  10902. return codePoint;
  10903. }
  10904. }
  10905. throw Error('Invalid UTF-8 detected');
  10906. }
  10907. var byteArray;
  10908. var byteCount;
  10909. var byteIndex;
  10910. function utf8decode(byteString, opts) {
  10911. opts = opts || {};
  10912. var strict = false !== opts.strict;
  10913. byteArray = ucs2decode(byteString);
  10914. byteCount = byteArray.length;
  10915. byteIndex = 0;
  10916. var codePoints = [];
  10917. var tmp;
  10918. while ((tmp = decodeSymbol(strict)) !== false) {
  10919. codePoints.push(tmp);
  10920. }
  10921. return ucs2encode(codePoints);
  10922. }
  10923. module.exports = {
  10924. version: '2.1.2',
  10925. encode: utf8encode,
  10926. decode: utf8decode
  10927. };
  10928. /***/ }),
  10929. /***/ "./node_modules/has-binary2/index.js":
  10930. /*!*******************************************!*\
  10931. !*** ./node_modules/has-binary2/index.js ***!
  10932. \*******************************************/
  10933. /*! no static exports found */
  10934. /***/ (function(module, exports, __webpack_require__) {
  10935. /* WEBPACK VAR INJECTION */(function(Buffer) {/* global Blob File */
  10936. /*
  10937. * Module requirements.
  10938. */
  10939. var isArray = __webpack_require__(/*! isarray */ "./node_modules/has-binary2/node_modules/isarray/index.js");
  10940. var toString = Object.prototype.toString;
  10941. var withNativeBlob = typeof Blob === 'function' ||
  10942. typeof Blob !== 'undefined' && toString.call(Blob) === '[object BlobConstructor]';
  10943. var withNativeFile = typeof File === 'function' ||
  10944. typeof File !== 'undefined' && toString.call(File) === '[object FileConstructor]';
  10945. /**
  10946. * Module exports.
  10947. */
  10948. module.exports = hasBinary;
  10949. /**
  10950. * Checks for binary data.
  10951. *
  10952. * Supports Buffer, ArrayBuffer, Blob and File.
  10953. *
  10954. * @param {Object} anything
  10955. * @api public
  10956. */
  10957. function hasBinary (obj) {
  10958. if (!obj || typeof obj !== 'object') {
  10959. return false;
  10960. }
  10961. if (isArray(obj)) {
  10962. for (var i = 0, l = obj.length; i < l; i++) {
  10963. if (hasBinary(obj[i])) {
  10964. return true;
  10965. }
  10966. }
  10967. return false;
  10968. }
  10969. if ((typeof Buffer === 'function' && Buffer.isBuffer && Buffer.isBuffer(obj)) ||
  10970. (typeof ArrayBuffer === 'function' && obj instanceof ArrayBuffer) ||
  10971. (withNativeBlob && obj instanceof Blob) ||
  10972. (withNativeFile && obj instanceof File)
  10973. ) {
  10974. return true;
  10975. }
  10976. // see: https://github.com/Automattic/has-binary/pull/4
  10977. if (obj.toJSON && typeof obj.toJSON === 'function' && arguments.length === 1) {
  10978. return hasBinary(obj.toJSON(), true);
  10979. }
  10980. for (var key in obj) {
  10981. if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) {
  10982. return true;
  10983. }
  10984. }
  10985. return false;
  10986. }
  10987. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ "./node_modules/buffer/index.js").Buffer))
  10988. /***/ }),
  10989. /***/ "./node_modules/has-binary2/node_modules/isarray/index.js":
  10990. /*!****************************************************************!*\
  10991. !*** ./node_modules/has-binary2/node_modules/isarray/index.js ***!
  10992. \****************************************************************/
  10993. /*! no static exports found */
  10994. /***/ (function(module, exports) {
  10995. var toString = {}.toString;
  10996. module.exports = Array.isArray || function (arr) {
  10997. return toString.call(arr) == '[object Array]';
  10998. };
  10999. /***/ }),
  11000. /***/ "./node_modules/has-cors/index.js":
  11001. /*!****************************************!*\
  11002. !*** ./node_modules/has-cors/index.js ***!
  11003. \****************************************/
  11004. /*! no static exports found */
  11005. /***/ (function(module, exports) {
  11006. /**
  11007. * Module exports.
  11008. *
  11009. * Logic borrowed from Modernizr:
  11010. *
  11011. * - https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cors.js
  11012. */
  11013. try {
  11014. module.exports = typeof XMLHttpRequest !== 'undefined' &&
  11015. 'withCredentials' in new XMLHttpRequest();
  11016. } catch (err) {
  11017. // if XMLHttp support is disabled in IE then it will throw
  11018. // when trying to create
  11019. module.exports = false;
  11020. }
  11021. /***/ }),
  11022. /***/ "./node_modules/ieee754/index.js":
  11023. /*!***************************************!*\
  11024. !*** ./node_modules/ieee754/index.js ***!
  11025. \***************************************/
  11026. /*! no static exports found */
  11027. /***/ (function(module, exports) {
  11028. exports.read = function (buffer, offset, isLE, mLen, nBytes) {
  11029. var e, m
  11030. var eLen = (nBytes * 8) - mLen - 1
  11031. var eMax = (1 << eLen) - 1
  11032. var eBias = eMax >> 1
  11033. var nBits = -7
  11034. var i = isLE ? (nBytes - 1) : 0
  11035. var d = isLE ? -1 : 1
  11036. var s = buffer[offset + i]
  11037. i += d
  11038. e = s & ((1 << (-nBits)) - 1)
  11039. s >>= (-nBits)
  11040. nBits += eLen
  11041. for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  11042. m = e & ((1 << (-nBits)) - 1)
  11043. e >>= (-nBits)
  11044. nBits += mLen
  11045. for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  11046. if (e === 0) {
  11047. e = 1 - eBias
  11048. } else if (e === eMax) {
  11049. return m ? NaN : ((s ? -1 : 1) * Infinity)
  11050. } else {
  11051. m = m + Math.pow(2, mLen)
  11052. e = e - eBias
  11053. }
  11054. return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
  11055. }
  11056. exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
  11057. var e, m, c
  11058. var eLen = (nBytes * 8) - mLen - 1
  11059. var eMax = (1 << eLen) - 1
  11060. var eBias = eMax >> 1
  11061. var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
  11062. var i = isLE ? 0 : (nBytes - 1)
  11063. var d = isLE ? 1 : -1
  11064. var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
  11065. value = Math.abs(value)
  11066. if (isNaN(value) || value === Infinity) {
  11067. m = isNaN(value) ? 1 : 0
  11068. e = eMax
  11069. } else {
  11070. e = Math.floor(Math.log(value) / Math.LN2)
  11071. if (value * (c = Math.pow(2, -e)) < 1) {
  11072. e--
  11073. c *= 2
  11074. }
  11075. if (e + eBias >= 1) {
  11076. value += rt / c
  11077. } else {
  11078. value += rt * Math.pow(2, 1 - eBias)
  11079. }
  11080. if (value * c >= 2) {
  11081. e++
  11082. c /= 2
  11083. }
  11084. if (e + eBias >= eMax) {
  11085. m = 0
  11086. e = eMax
  11087. } else if (e + eBias >= 1) {
  11088. m = ((value * c) - 1) * Math.pow(2, mLen)
  11089. e = e + eBias
  11090. } else {
  11091. m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
  11092. e = 0
  11093. }
  11094. }
  11095. for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
  11096. e = (e << mLen) | m
  11097. eLen += mLen
  11098. for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
  11099. buffer[offset + i - d] |= s * 128
  11100. }
  11101. /***/ }),
  11102. /***/ "./node_modules/indexof/index.js":
  11103. /*!***************************************!*\
  11104. !*** ./node_modules/indexof/index.js ***!
  11105. \***************************************/
  11106. /*! no static exports found */
  11107. /***/ (function(module, exports) {
  11108. var indexOf = [].indexOf;
  11109. module.exports = function(arr, obj){
  11110. if (indexOf) return arr.indexOf(obj);
  11111. for (var i = 0; i < arr.length; ++i) {
  11112. if (arr[i] === obj) return i;
  11113. }
  11114. return -1;
  11115. };
  11116. /***/ }),
  11117. /***/ "./node_modules/isarray/index.js":
  11118. /*!***************************************!*\
  11119. !*** ./node_modules/isarray/index.js ***!
  11120. \***************************************/
  11121. /*! no static exports found */
  11122. /***/ (function(module, exports) {
  11123. var toString = {}.toString;
  11124. module.exports = Array.isArray || function (arr) {
  11125. return toString.call(arr) == '[object Array]';
  11126. };
  11127. /***/ }),
  11128. /***/ "./node_modules/jquery/dist/jquery.js":
  11129. /*!********************************************!*\
  11130. !*** ./node_modules/jquery/dist/jquery.js ***!
  11131. \********************************************/
  11132. /*! no static exports found */
  11133. /***/ (function(module, exports, __webpack_require__) {
  11134. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  11135. * jQuery JavaScript Library v3.5.1
  11136. * https://jquery.com/
  11137. *
  11138. * Includes Sizzle.js
  11139. * https://sizzlejs.com/
  11140. *
  11141. * Copyright JS Foundation and other contributors
  11142. * Released under the MIT license
  11143. * https://jquery.org/license
  11144. *
  11145. * Date: 2020-05-04T22:49Z
  11146. */
  11147. ( function( global, factory ) {
  11148. "use strict";
  11149. if ( true && typeof module.exports === "object" ) {
  11150. // For CommonJS and CommonJS-like environments where a proper `window`
  11151. // is present, execute the factory and get jQuery.
  11152. // For environments that do not have a `window` with a `document`
  11153. // (such as Node.js), expose a factory as module.exports.
  11154. // This accentuates the need for the creation of a real `window`.
  11155. // e.g. var jQuery = require("jquery")(window);
  11156. // See ticket #14549 for more info.
  11157. module.exports = global.document ?
  11158. factory( global, true ) :
  11159. function( w ) {
  11160. if ( !w.document ) {
  11161. throw new Error( "jQuery requires a window with a document" );
  11162. }
  11163. return factory( w );
  11164. };
  11165. } else {
  11166. factory( global );
  11167. }
  11168. // Pass this if window is not defined yet
  11169. } )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
  11170. // Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
  11171. // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
  11172. // arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
  11173. // enough that all such attempts are guarded in a try block.
  11174. "use strict";
  11175. var arr = [];
  11176. var getProto = Object.getPrototypeOf;
  11177. var slice = arr.slice;
  11178. var flat = arr.flat ? function( array ) {
  11179. return arr.flat.call( array );
  11180. } : function( array ) {
  11181. return arr.concat.apply( [], array );
  11182. };
  11183. var push = arr.push;
  11184. var indexOf = arr.indexOf;
  11185. var class2type = {};
  11186. var toString = class2type.toString;
  11187. var hasOwn = class2type.hasOwnProperty;
  11188. var fnToString = hasOwn.toString;
  11189. var ObjectFunctionString = fnToString.call( Object );
  11190. var support = {};
  11191. var isFunction = function isFunction( obj ) {
  11192. // Support: Chrome <=57, Firefox <=52
  11193. // In some browsers, typeof returns "function" for HTML <object> elements
  11194. // (i.e., `typeof document.createElement( "object" ) === "function"`).
  11195. // We don't want to classify *any* DOM node as a function.
  11196. return typeof obj === "function" && typeof obj.nodeType !== "number";
  11197. };
  11198. var isWindow = function isWindow( obj ) {
  11199. return obj != null && obj === obj.window;
  11200. };
  11201. var document = window.document;
  11202. var preservedScriptAttributes = {
  11203. type: true,
  11204. src: true,
  11205. nonce: true,
  11206. noModule: true
  11207. };
  11208. function DOMEval( code, node, doc ) {
  11209. doc = doc || document;
  11210. var i, val,
  11211. script = doc.createElement( "script" );
  11212. script.text = code;
  11213. if ( node ) {
  11214. for ( i in preservedScriptAttributes ) {
  11215. // Support: Firefox 64+, Edge 18+
  11216. // Some browsers don't support the "nonce" property on scripts.
  11217. // On the other hand, just using `getAttribute` is not enough as
  11218. // the `nonce` attribute is reset to an empty string whenever it
  11219. // becomes browsing-context connected.
  11220. // See https://github.com/whatwg/html/issues/2369
  11221. // See https://html.spec.whatwg.org/#nonce-attributes
  11222. // The `node.getAttribute` check was added for the sake of
  11223. // `jQuery.globalEval` so that it can fake a nonce-containing node
  11224. // via an object.
  11225. val = node[ i ] || node.getAttribute && node.getAttribute( i );
  11226. if ( val ) {
  11227. script.setAttribute( i, val );
  11228. }
  11229. }
  11230. }
  11231. doc.head.appendChild( script ).parentNode.removeChild( script );
  11232. }
  11233. function toType( obj ) {
  11234. if ( obj == null ) {
  11235. return obj + "";
  11236. }
  11237. // Support: Android <=2.3 only (functionish RegExp)
  11238. return typeof obj === "object" || typeof obj === "function" ?
  11239. class2type[ toString.call( obj ) ] || "object" :
  11240. typeof obj;
  11241. }
  11242. /* global Symbol */
  11243. // Defining this global in .eslintrc.json would create a danger of using the global
  11244. // unguarded in another place, it seems safer to define global only for this module
  11245. var
  11246. version = "3.5.1",
  11247. // Define a local copy of jQuery
  11248. jQuery = function( selector, context ) {
  11249. // The jQuery object is actually just the init constructor 'enhanced'
  11250. // Need init if jQuery is called (just allow error to be thrown if not included)
  11251. return new jQuery.fn.init( selector, context );
  11252. };
  11253. jQuery.fn = jQuery.prototype = {
  11254. // The current version of jQuery being used
  11255. jquery: version,
  11256. constructor: jQuery,
  11257. // The default length of a jQuery object is 0
  11258. length: 0,
  11259. toArray: function() {
  11260. return slice.call( this );
  11261. },
  11262. // Get the Nth element in the matched element set OR
  11263. // Get the whole matched element set as a clean array
  11264. get: function( num ) {
  11265. // Return all the elements in a clean array
  11266. if ( num == null ) {
  11267. return slice.call( this );
  11268. }
  11269. // Return just the one element from the set
  11270. return num < 0 ? this[ num + this.length ] : this[ num ];
  11271. },
  11272. // Take an array of elements and push it onto the stack
  11273. // (returning the new matched element set)
  11274. pushStack: function( elems ) {
  11275. // Build a new jQuery matched element set
  11276. var ret = jQuery.merge( this.constructor(), elems );
  11277. // Add the old object onto the stack (as a reference)
  11278. ret.prevObject = this;
  11279. // Return the newly-formed element set
  11280. return ret;
  11281. },
  11282. // Execute a callback for every element in the matched set.
  11283. each: function( callback ) {
  11284. return jQuery.each( this, callback );
  11285. },
  11286. map: function( callback ) {
  11287. return this.pushStack( jQuery.map( this, function( elem, i ) {
  11288. return callback.call( elem, i, elem );
  11289. } ) );
  11290. },
  11291. slice: function() {
  11292. return this.pushStack( slice.apply( this, arguments ) );
  11293. },
  11294. first: function() {
  11295. return this.eq( 0 );
  11296. },
  11297. last: function() {
  11298. return this.eq( -1 );
  11299. },
  11300. even: function() {
  11301. return this.pushStack( jQuery.grep( this, function( _elem, i ) {
  11302. return ( i + 1 ) % 2;
  11303. } ) );
  11304. },
  11305. odd: function() {
  11306. return this.pushStack( jQuery.grep( this, function( _elem, i ) {
  11307. return i % 2;
  11308. } ) );
  11309. },
  11310. eq: function( i ) {
  11311. var len = this.length,
  11312. j = +i + ( i < 0 ? len : 0 );
  11313. return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
  11314. },
  11315. end: function() {
  11316. return this.prevObject || this.constructor();
  11317. },
  11318. // For internal use only.
  11319. // Behaves like an Array's method, not like a jQuery method.
  11320. push: push,
  11321. sort: arr.sort,
  11322. splice: arr.splice
  11323. };
  11324. jQuery.extend = jQuery.fn.extend = function() {
  11325. var options, name, src, copy, copyIsArray, clone,
  11326. target = arguments[ 0 ] || {},
  11327. i = 1,
  11328. length = arguments.length,
  11329. deep = false;
  11330. // Handle a deep copy situation
  11331. if ( typeof target === "boolean" ) {
  11332. deep = target;
  11333. // Skip the boolean and the target
  11334. target = arguments[ i ] || {};
  11335. i++;
  11336. }
  11337. // Handle case when target is a string or something (possible in deep copy)
  11338. if ( typeof target !== "object" && !isFunction( target ) ) {
  11339. target = {};
  11340. }
  11341. // Extend jQuery itself if only one argument is passed
  11342. if ( i === length ) {
  11343. target = this;
  11344. i--;
  11345. }
  11346. for ( ; i < length; i++ ) {
  11347. // Only deal with non-null/undefined values
  11348. if ( ( options = arguments[ i ] ) != null ) {
  11349. // Extend the base object
  11350. for ( name in options ) {
  11351. copy = options[ name ];
  11352. // Prevent Object.prototype pollution
  11353. // Prevent never-ending loop
  11354. if ( name === "__proto__" || target === copy ) {
  11355. continue;
  11356. }
  11357. // Recurse if we're merging plain objects or arrays
  11358. if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
  11359. ( copyIsArray = Array.isArray( copy ) ) ) ) {
  11360. src = target[ name ];
  11361. // Ensure proper type for the source value
  11362. if ( copyIsArray && !Array.isArray( src ) ) {
  11363. clone = [];
  11364. } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {
  11365. clone = {};
  11366. } else {
  11367. clone = src;
  11368. }
  11369. copyIsArray = false;
  11370. // Never move original objects, clone them
  11371. target[ name ] = jQuery.extend( deep, clone, copy );
  11372. // Don't bring in undefined values
  11373. } else if ( copy !== undefined ) {
  11374. target[ name ] = copy;
  11375. }
  11376. }
  11377. }
  11378. }
  11379. // Return the modified object
  11380. return target;
  11381. };
  11382. jQuery.extend( {
  11383. // Unique for each copy of jQuery on the page
  11384. expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
  11385. // Assume jQuery is ready without the ready module
  11386. isReady: true,
  11387. error: function( msg ) {
  11388. throw new Error( msg );
  11389. },
  11390. noop: function() {},
  11391. isPlainObject: function( obj ) {
  11392. var proto, Ctor;
  11393. // Detect obvious negatives
  11394. // Use toString instead of jQuery.type to catch host objects
  11395. if ( !obj || toString.call( obj ) !== "[object Object]" ) {
  11396. return false;
  11397. }
  11398. proto = getProto( obj );
  11399. // Objects with no prototype (e.g., `Object.create( null )`) are plain
  11400. if ( !proto ) {
  11401. return true;
  11402. }
  11403. // Objects with prototype are plain iff they were constructed by a global Object function
  11404. Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
  11405. return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
  11406. },
  11407. isEmptyObject: function( obj ) {
  11408. var name;
  11409. for ( name in obj ) {
  11410. return false;
  11411. }
  11412. return true;
  11413. },
  11414. // Evaluates a script in a provided context; falls back to the global one
  11415. // if not specified.
  11416. globalEval: function( code, options, doc ) {
  11417. DOMEval( code, { nonce: options && options.nonce }, doc );
  11418. },
  11419. each: function( obj, callback ) {
  11420. var length, i = 0;
  11421. if ( isArrayLike( obj ) ) {
  11422. length = obj.length;
  11423. for ( ; i < length; i++ ) {
  11424. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  11425. break;
  11426. }
  11427. }
  11428. } else {
  11429. for ( i in obj ) {
  11430. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  11431. break;
  11432. }
  11433. }
  11434. }
  11435. return obj;
  11436. },
  11437. // results is for internal usage only
  11438. makeArray: function( arr, results ) {
  11439. var ret = results || [];
  11440. if ( arr != null ) {
  11441. if ( isArrayLike( Object( arr ) ) ) {
  11442. jQuery.merge( ret,
  11443. typeof arr === "string" ?
  11444. [ arr ] : arr
  11445. );
  11446. } else {
  11447. push.call( ret, arr );
  11448. }
  11449. }
  11450. return ret;
  11451. },
  11452. inArray: function( elem, arr, i ) {
  11453. return arr == null ? -1 : indexOf.call( arr, elem, i );
  11454. },
  11455. // Support: Android <=4.0 only, PhantomJS 1 only
  11456. // push.apply(_, arraylike) throws on ancient WebKit
  11457. merge: function( first, second ) {
  11458. var len = +second.length,
  11459. j = 0,
  11460. i = first.length;
  11461. for ( ; j < len; j++ ) {
  11462. first[ i++ ] = second[ j ];
  11463. }
  11464. first.length = i;
  11465. return first;
  11466. },
  11467. grep: function( elems, callback, invert ) {
  11468. var callbackInverse,
  11469. matches = [],
  11470. i = 0,
  11471. length = elems.length,
  11472. callbackExpect = !invert;
  11473. // Go through the array, only saving the items
  11474. // that pass the validator function
  11475. for ( ; i < length; i++ ) {
  11476. callbackInverse = !callback( elems[ i ], i );
  11477. if ( callbackInverse !== callbackExpect ) {
  11478. matches.push( elems[ i ] );
  11479. }
  11480. }
  11481. return matches;
  11482. },
  11483. // arg is for internal usage only
  11484. map: function( elems, callback, arg ) {
  11485. var length, value,
  11486. i = 0,
  11487. ret = [];
  11488. // Go through the array, translating each of the items to their new values
  11489. if ( isArrayLike( elems ) ) {
  11490. length = elems.length;
  11491. for ( ; i < length; i++ ) {
  11492. value = callback( elems[ i ], i, arg );
  11493. if ( value != null ) {
  11494. ret.push( value );
  11495. }
  11496. }
  11497. // Go through every key on the object,
  11498. } else {
  11499. for ( i in elems ) {
  11500. value = callback( elems[ i ], i, arg );
  11501. if ( value != null ) {
  11502. ret.push( value );
  11503. }
  11504. }
  11505. }
  11506. // Flatten any nested arrays
  11507. return flat( ret );
  11508. },
  11509. // A global GUID counter for objects
  11510. guid: 1,
  11511. // jQuery.support is not used in Core but other projects attach their
  11512. // properties to it so it needs to exist.
  11513. support: support
  11514. } );
  11515. if ( typeof Symbol === "function" ) {
  11516. jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
  11517. }
  11518. // Populate the class2type map
  11519. jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
  11520. function( _i, name ) {
  11521. class2type[ "[object " + name + "]" ] = name.toLowerCase();
  11522. } );
  11523. function isArrayLike( obj ) {
  11524. // Support: real iOS 8.2 only (not reproducible in simulator)
  11525. // `in` check used to prevent JIT error (gh-2145)
  11526. // hasOwn isn't used here due to false negatives
  11527. // regarding Nodelist length in IE
  11528. var length = !!obj && "length" in obj && obj.length,
  11529. type = toType( obj );
  11530. if ( isFunction( obj ) || isWindow( obj ) ) {
  11531. return false;
  11532. }
  11533. return type === "array" || length === 0 ||
  11534. typeof length === "number" && length > 0 && ( length - 1 ) in obj;
  11535. }
  11536. var Sizzle =
  11537. /*!
  11538. * Sizzle CSS Selector Engine v2.3.5
  11539. * https://sizzlejs.com/
  11540. *
  11541. * Copyright JS Foundation and other contributors
  11542. * Released under the MIT license
  11543. * https://js.foundation/
  11544. *
  11545. * Date: 2020-03-14
  11546. */
  11547. ( function( window ) {
  11548. var i,
  11549. support,
  11550. Expr,
  11551. getText,
  11552. isXML,
  11553. tokenize,
  11554. compile,
  11555. select,
  11556. outermostContext,
  11557. sortInput,
  11558. hasDuplicate,
  11559. // Local document vars
  11560. setDocument,
  11561. document,
  11562. docElem,
  11563. documentIsHTML,
  11564. rbuggyQSA,
  11565. rbuggyMatches,
  11566. matches,
  11567. contains,
  11568. // Instance-specific data
  11569. expando = "sizzle" + 1 * new Date(),
  11570. preferredDoc = window.document,
  11571. dirruns = 0,
  11572. done = 0,
  11573. classCache = createCache(),
  11574. tokenCache = createCache(),
  11575. compilerCache = createCache(),
  11576. nonnativeSelectorCache = createCache(),
  11577. sortOrder = function( a, b ) {
  11578. if ( a === b ) {
  11579. hasDuplicate = true;
  11580. }
  11581. return 0;
  11582. },
  11583. // Instance methods
  11584. hasOwn = ( {} ).hasOwnProperty,
  11585. arr = [],
  11586. pop = arr.pop,
  11587. pushNative = arr.push,
  11588. push = arr.push,
  11589. slice = arr.slice,
  11590. // Use a stripped-down indexOf as it's faster than native
  11591. // https://jsperf.com/thor-indexof-vs-for/5
  11592. indexOf = function( list, elem ) {
  11593. var i = 0,
  11594. len = list.length;
  11595. for ( ; i < len; i++ ) {
  11596. if ( list[ i ] === elem ) {
  11597. return i;
  11598. }
  11599. }
  11600. return -1;
  11601. },
  11602. booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" +
  11603. "ismap|loop|multiple|open|readonly|required|scoped",
  11604. // Regular expressions
  11605. // http://www.w3.org/TR/css3-selectors/#whitespace
  11606. whitespace = "[\\x20\\t\\r\\n\\f]",
  11607. // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram
  11608. identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace +
  11609. "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",
  11610. // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
  11611. attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
  11612. // Operator (capture 2)
  11613. "*([*^$|!~]?=)" + whitespace +
  11614. // "Attribute values must be CSS identifiers [capture 5]
  11615. // or strings [capture 3 or capture 4]"
  11616. "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" +
  11617. whitespace + "*\\]",
  11618. pseudos = ":(" + identifier + ")(?:\\((" +
  11619. // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
  11620. // 1. quoted (capture 3; capture 4 or capture 5)
  11621. "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
  11622. // 2. simple (capture 6)
  11623. "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
  11624. // 3. anything else (capture 2)
  11625. ".*" +
  11626. ")\\)|)",
  11627. // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
  11628. rwhitespace = new RegExp( whitespace + "+", "g" ),
  11629. rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" +
  11630. whitespace + "+$", "g" ),
  11631. rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
  11632. rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace +
  11633. "*" ),
  11634. rdescend = new RegExp( whitespace + "|>" ),
  11635. rpseudo = new RegExp( pseudos ),
  11636. ridentifier = new RegExp( "^" + identifier + "$" ),
  11637. matchExpr = {
  11638. "ID": new RegExp( "^#(" + identifier + ")" ),
  11639. "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
  11640. "TAG": new RegExp( "^(" + identifier + "|[*])" ),
  11641. "ATTR": new RegExp( "^" + attributes ),
  11642. "PSEUDO": new RegExp( "^" + pseudos ),
  11643. "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" +
  11644. whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" +
  11645. whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
  11646. "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
  11647. // For use in libraries implementing .is()
  11648. // We use this for POS matching in `select`
  11649. "needsContext": new RegExp( "^" + whitespace +
  11650. "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +
  11651. "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
  11652. },
  11653. rhtml = /HTML$/i,
  11654. rinputs = /^(?:input|select|textarea|button)$/i,
  11655. rheader = /^h\d$/i,
  11656. rnative = /^[^{]+\{\s*\[native \w/,
  11657. // Easily-parseable/retrievable ID or TAG or CLASS selectors
  11658. rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
  11659. rsibling = /[+~]/,
  11660. // CSS escapes
  11661. // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
  11662. runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ),
  11663. funescape = function( escape, nonHex ) {
  11664. var high = "0x" + escape.slice( 1 ) - 0x10000;
  11665. return nonHex ?
  11666. // Strip the backslash prefix from a non-hex escape sequence
  11667. nonHex :
  11668. // Replace a hexadecimal escape sequence with the encoded Unicode code point
  11669. // Support: IE <=11+
  11670. // For values outside the Basic Multilingual Plane (BMP), manually construct a
  11671. // surrogate pair
  11672. high < 0 ?
  11673. String.fromCharCode( high + 0x10000 ) :
  11674. String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
  11675. },
  11676. // CSS string/identifier serialization
  11677. // https://drafts.csswg.org/cssom/#common-serializing-idioms
  11678. rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
  11679. fcssescape = function( ch, asCodePoint ) {
  11680. if ( asCodePoint ) {
  11681. // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
  11682. if ( ch === "\0" ) {
  11683. return "\uFFFD";
  11684. }
  11685. // Control characters and (dependent upon position) numbers get escaped as code points
  11686. return ch.slice( 0, -1 ) + "\\" +
  11687. ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
  11688. }
  11689. // Other potentially-special ASCII characters get backslash-escaped
  11690. return "\\" + ch;
  11691. },
  11692. // Used for iframes
  11693. // See setDocument()
  11694. // Removing the function wrapper causes a "Permission Denied"
  11695. // error in IE
  11696. unloadHandler = function() {
  11697. setDocument();
  11698. },
  11699. inDisabledFieldset = addCombinator(
  11700. function( elem ) {
  11701. return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset";
  11702. },
  11703. { dir: "parentNode", next: "legend" }
  11704. );
  11705. // Optimize for push.apply( _, NodeList )
  11706. try {
  11707. push.apply(
  11708. ( arr = slice.call( preferredDoc.childNodes ) ),
  11709. preferredDoc.childNodes
  11710. );
  11711. // Support: Android<4.0
  11712. // Detect silently failing push.apply
  11713. // eslint-disable-next-line no-unused-expressions
  11714. arr[ preferredDoc.childNodes.length ].nodeType;
  11715. } catch ( e ) {
  11716. push = { apply: arr.length ?
  11717. // Leverage slice if possible
  11718. function( target, els ) {
  11719. pushNative.apply( target, slice.call( els ) );
  11720. } :
  11721. // Support: IE<9
  11722. // Otherwise append directly
  11723. function( target, els ) {
  11724. var j = target.length,
  11725. i = 0;
  11726. // Can't trust NodeList.length
  11727. while ( ( target[ j++ ] = els[ i++ ] ) ) {}
  11728. target.length = j - 1;
  11729. }
  11730. };
  11731. }
  11732. function Sizzle( selector, context, results, seed ) {
  11733. var m, i, elem, nid, match, groups, newSelector,
  11734. newContext = context && context.ownerDocument,
  11735. // nodeType defaults to 9, since context defaults to document
  11736. nodeType = context ? context.nodeType : 9;
  11737. results = results || [];
  11738. // Return early from calls with invalid selector or context
  11739. if ( typeof selector !== "string" || !selector ||
  11740. nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
  11741. return results;
  11742. }
  11743. // Try to shortcut find operations (as opposed to filters) in HTML documents
  11744. if ( !seed ) {
  11745. setDocument( context );
  11746. context = context || document;
  11747. if ( documentIsHTML ) {
  11748. // If the selector is sufficiently simple, try using a "get*By*" DOM method
  11749. // (excepting DocumentFragment context, where the methods don't exist)
  11750. if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) {
  11751. // ID selector
  11752. if ( ( m = match[ 1 ] ) ) {
  11753. // Document context
  11754. if ( nodeType === 9 ) {
  11755. if ( ( elem = context.getElementById( m ) ) ) {
  11756. // Support: IE, Opera, Webkit
  11757. // TODO: identify versions
  11758. // getElementById can match elements by name instead of ID
  11759. if ( elem.id === m ) {
  11760. results.push( elem );
  11761. return results;
  11762. }
  11763. } else {
  11764. return results;
  11765. }
  11766. // Element context
  11767. } else {
  11768. // Support: IE, Opera, Webkit
  11769. // TODO: identify versions
  11770. // getElementById can match elements by name instead of ID
  11771. if ( newContext && ( elem = newContext.getElementById( m ) ) &&
  11772. contains( context, elem ) &&
  11773. elem.id === m ) {
  11774. results.push( elem );
  11775. return results;
  11776. }
  11777. }
  11778. // Type selector
  11779. } else if ( match[ 2 ] ) {
  11780. push.apply( results, context.getElementsByTagName( selector ) );
  11781. return results;
  11782. // Class selector
  11783. } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName &&
  11784. context.getElementsByClassName ) {
  11785. push.apply( results, context.getElementsByClassName( m ) );
  11786. return results;
  11787. }
  11788. }
  11789. // Take advantage of querySelectorAll
  11790. if ( support.qsa &&
  11791. !nonnativeSelectorCache[ selector + " " ] &&
  11792. ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) &&
  11793. // Support: IE 8 only
  11794. // Exclude object elements
  11795. ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) {
  11796. newSelector = selector;
  11797. newContext = context;
  11798. // qSA considers elements outside a scoping root when evaluating child or
  11799. // descendant combinators, which is not what we want.
  11800. // In such cases, we work around the behavior by prefixing every selector in the
  11801. // list with an ID selector referencing the scope context.
  11802. // The technique has to be used as well when a leading combinator is used
  11803. // as such selectors are not recognized by querySelectorAll.
  11804. // Thanks to Andrew Dupont for this technique.
  11805. if ( nodeType === 1 &&
  11806. ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) {
  11807. // Expand context for sibling selectors
  11808. newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
  11809. context;
  11810. // We can use :scope instead of the ID hack if the browser
  11811. // supports it & if we're not changing the context.
  11812. if ( newContext !== context || !support.scope ) {
  11813. // Capture the context ID, setting it first if necessary
  11814. if ( ( nid = context.getAttribute( "id" ) ) ) {
  11815. nid = nid.replace( rcssescape, fcssescape );
  11816. } else {
  11817. context.setAttribute( "id", ( nid = expando ) );
  11818. }
  11819. }
  11820. // Prefix every selector in the list
  11821. groups = tokenize( selector );
  11822. i = groups.length;
  11823. while ( i-- ) {
  11824. groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " +
  11825. toSelector( groups[ i ] );
  11826. }
  11827. newSelector = groups.join( "," );
  11828. }
  11829. try {
  11830. push.apply( results,
  11831. newContext.querySelectorAll( newSelector )
  11832. );
  11833. return results;
  11834. } catch ( qsaError ) {
  11835. nonnativeSelectorCache( selector, true );
  11836. } finally {
  11837. if ( nid === expando ) {
  11838. context.removeAttribute( "id" );
  11839. }
  11840. }
  11841. }
  11842. }
  11843. }
  11844. // All others
  11845. return select( selector.replace( rtrim, "$1" ), context, results, seed );
  11846. }
  11847. /**
  11848. * Create key-value caches of limited size
  11849. * @returns {function(string, object)} Returns the Object data after storing it on itself with
  11850. * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
  11851. * deleting the oldest entry
  11852. */
  11853. function createCache() {
  11854. var keys = [];
  11855. function cache( key, value ) {
  11856. // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
  11857. if ( keys.push( key + " " ) > Expr.cacheLength ) {
  11858. // Only keep the most recent entries
  11859. delete cache[ keys.shift() ];
  11860. }
  11861. return ( cache[ key + " " ] = value );
  11862. }
  11863. return cache;
  11864. }
  11865. /**
  11866. * Mark a function for special use by Sizzle
  11867. * @param {Function} fn The function to mark
  11868. */
  11869. function markFunction( fn ) {
  11870. fn[ expando ] = true;
  11871. return fn;
  11872. }
  11873. /**
  11874. * Support testing using an element
  11875. * @param {Function} fn Passed the created element and returns a boolean result
  11876. */
  11877. function assert( fn ) {
  11878. var el = document.createElement( "fieldset" );
  11879. try {
  11880. return !!fn( el );
  11881. } catch ( e ) {
  11882. return false;
  11883. } finally {
  11884. // Remove from its parent by default
  11885. if ( el.parentNode ) {
  11886. el.parentNode.removeChild( el );
  11887. }
  11888. // release memory in IE
  11889. el = null;
  11890. }
  11891. }
  11892. /**
  11893. * Adds the same handler for all of the specified attrs
  11894. * @param {String} attrs Pipe-separated list of attributes
  11895. * @param {Function} handler The method that will be applied
  11896. */
  11897. function addHandle( attrs, handler ) {
  11898. var arr = attrs.split( "|" ),
  11899. i = arr.length;
  11900. while ( i-- ) {
  11901. Expr.attrHandle[ arr[ i ] ] = handler;
  11902. }
  11903. }
  11904. /**
  11905. * Checks document order of two siblings
  11906. * @param {Element} a
  11907. * @param {Element} b
  11908. * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
  11909. */
  11910. function siblingCheck( a, b ) {
  11911. var cur = b && a,
  11912. diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
  11913. a.sourceIndex - b.sourceIndex;
  11914. // Use IE sourceIndex if available on both nodes
  11915. if ( diff ) {
  11916. return diff;
  11917. }
  11918. // Check if b follows a
  11919. if ( cur ) {
  11920. while ( ( cur = cur.nextSibling ) ) {
  11921. if ( cur === b ) {
  11922. return -1;
  11923. }
  11924. }
  11925. }
  11926. return a ? 1 : -1;
  11927. }
  11928. /**
  11929. * Returns a function to use in pseudos for input types
  11930. * @param {String} type
  11931. */
  11932. function createInputPseudo( type ) {
  11933. return function( elem ) {
  11934. var name = elem.nodeName.toLowerCase();
  11935. return name === "input" && elem.type === type;
  11936. };
  11937. }
  11938. /**
  11939. * Returns a function to use in pseudos for buttons
  11940. * @param {String} type
  11941. */
  11942. function createButtonPseudo( type ) {
  11943. return function( elem ) {
  11944. var name = elem.nodeName.toLowerCase();
  11945. return ( name === "input" || name === "button" ) && elem.type === type;
  11946. };
  11947. }
  11948. /**
  11949. * Returns a function to use in pseudos for :enabled/:disabled
  11950. * @param {Boolean} disabled true for :disabled; false for :enabled
  11951. */
  11952. function createDisabledPseudo( disabled ) {
  11953. // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
  11954. return function( elem ) {
  11955. // Only certain elements can match :enabled or :disabled
  11956. // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
  11957. // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
  11958. if ( "form" in elem ) {
  11959. // Check for inherited disabledness on relevant non-disabled elements:
  11960. // * listed form-associated elements in a disabled fieldset
  11961. // https://html.spec.whatwg.org/multipage/forms.html#category-listed
  11962. // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
  11963. // * option elements in a disabled optgroup
  11964. // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
  11965. // All such elements have a "form" property.
  11966. if ( elem.parentNode && elem.disabled === false ) {
  11967. // Option elements defer to a parent optgroup if present
  11968. if ( "label" in elem ) {
  11969. if ( "label" in elem.parentNode ) {
  11970. return elem.parentNode.disabled === disabled;
  11971. } else {
  11972. return elem.disabled === disabled;
  11973. }
  11974. }
  11975. // Support: IE 6 - 11
  11976. // Use the isDisabled shortcut property to check for disabled fieldset ancestors
  11977. return elem.isDisabled === disabled ||
  11978. // Where there is no isDisabled, check manually
  11979. /* jshint -W018 */
  11980. elem.isDisabled !== !disabled &&
  11981. inDisabledFieldset( elem ) === disabled;
  11982. }
  11983. return elem.disabled === disabled;
  11984. // Try to winnow out elements that can't be disabled before trusting the disabled property.
  11985. // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
  11986. // even exist on them, let alone have a boolean value.
  11987. } else if ( "label" in elem ) {
  11988. return elem.disabled === disabled;
  11989. }
  11990. // Remaining elements are neither :enabled nor :disabled
  11991. return false;
  11992. };
  11993. }
  11994. /**
  11995. * Returns a function to use in pseudos for positionals
  11996. * @param {Function} fn
  11997. */
  11998. function createPositionalPseudo( fn ) {
  11999. return markFunction( function( argument ) {
  12000. argument = +argument;
  12001. return markFunction( function( seed, matches ) {
  12002. var j,
  12003. matchIndexes = fn( [], seed.length, argument ),
  12004. i = matchIndexes.length;
  12005. // Match elements found at the specified indexes
  12006. while ( i-- ) {
  12007. if ( seed[ ( j = matchIndexes[ i ] ) ] ) {
  12008. seed[ j ] = !( matches[ j ] = seed[ j ] );
  12009. }
  12010. }
  12011. } );
  12012. } );
  12013. }
  12014. /**
  12015. * Checks a node for validity as a Sizzle context
  12016. * @param {Element|Object=} context
  12017. * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
  12018. */
  12019. function testContext( context ) {
  12020. return context && typeof context.getElementsByTagName !== "undefined" && context;
  12021. }
  12022. // Expose support vars for convenience
  12023. support = Sizzle.support = {};
  12024. /**
  12025. * Detects XML nodes
  12026. * @param {Element|Object} elem An element or a document
  12027. * @returns {Boolean} True iff elem is a non-HTML XML node
  12028. */
  12029. isXML = Sizzle.isXML = function( elem ) {
  12030. var namespace = elem.namespaceURI,
  12031. docElem = ( elem.ownerDocument || elem ).documentElement;
  12032. // Support: IE <=8
  12033. // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes
  12034. // https://bugs.jquery.com/ticket/4833
  12035. return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" );
  12036. };
  12037. /**
  12038. * Sets document-related variables once based on the current document
  12039. * @param {Element|Object} [doc] An element or document object to use to set the document
  12040. * @returns {Object} Returns the current document
  12041. */
  12042. setDocument = Sizzle.setDocument = function( node ) {
  12043. var hasCompare, subWindow,
  12044. doc = node ? node.ownerDocument || node : preferredDoc;
  12045. // Return early if doc is invalid or already selected
  12046. // Support: IE 11+, Edge 17 - 18+
  12047. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  12048. // two documents; shallow comparisons work.
  12049. // eslint-disable-next-line eqeqeq
  12050. if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) {
  12051. return document;
  12052. }
  12053. // Update global variables
  12054. document = doc;
  12055. docElem = document.documentElement;
  12056. documentIsHTML = !isXML( document );
  12057. // Support: IE 9 - 11+, Edge 12 - 18+
  12058. // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
  12059. // Support: IE 11+, Edge 17 - 18+
  12060. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  12061. // two documents; shallow comparisons work.
  12062. // eslint-disable-next-line eqeqeq
  12063. if ( preferredDoc != document &&
  12064. ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {
  12065. // Support: IE 11, Edge
  12066. if ( subWindow.addEventListener ) {
  12067. subWindow.addEventListener( "unload", unloadHandler, false );
  12068. // Support: IE 9 - 10 only
  12069. } else if ( subWindow.attachEvent ) {
  12070. subWindow.attachEvent( "onunload", unloadHandler );
  12071. }
  12072. }
  12073. // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only,
  12074. // Safari 4 - 5 only, Opera <=11.6 - 12.x only
  12075. // IE/Edge & older browsers don't support the :scope pseudo-class.
  12076. // Support: Safari 6.0 only
  12077. // Safari 6.0 supports :scope but it's an alias of :root there.
  12078. support.scope = assert( function( el ) {
  12079. docElem.appendChild( el ).appendChild( document.createElement( "div" ) );
  12080. return typeof el.querySelectorAll !== "undefined" &&
  12081. !el.querySelectorAll( ":scope fieldset div" ).length;
  12082. } );
  12083. /* Attributes
  12084. ---------------------------------------------------------------------- */
  12085. // Support: IE<8
  12086. // Verify that getAttribute really returns attributes and not properties
  12087. // (excepting IE8 booleans)
  12088. support.attributes = assert( function( el ) {
  12089. el.className = "i";
  12090. return !el.getAttribute( "className" );
  12091. } );
  12092. /* getElement(s)By*
  12093. ---------------------------------------------------------------------- */
  12094. // Check if getElementsByTagName("*") returns only elements
  12095. support.getElementsByTagName = assert( function( el ) {
  12096. el.appendChild( document.createComment( "" ) );
  12097. return !el.getElementsByTagName( "*" ).length;
  12098. } );
  12099. // Support: IE<9
  12100. support.getElementsByClassName = rnative.test( document.getElementsByClassName );
  12101. // Support: IE<10
  12102. // Check if getElementById returns elements by name
  12103. // The broken getElementById methods don't pick up programmatically-set names,
  12104. // so use a roundabout getElementsByName test
  12105. support.getById = assert( function( el ) {
  12106. docElem.appendChild( el ).id = expando;
  12107. return !document.getElementsByName || !document.getElementsByName( expando ).length;
  12108. } );
  12109. // ID filter and find
  12110. if ( support.getById ) {
  12111. Expr.filter[ "ID" ] = function( id ) {
  12112. var attrId = id.replace( runescape, funescape );
  12113. return function( elem ) {
  12114. return elem.getAttribute( "id" ) === attrId;
  12115. };
  12116. };
  12117. Expr.find[ "ID" ] = function( id, context ) {
  12118. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  12119. var elem = context.getElementById( id );
  12120. return elem ? [ elem ] : [];
  12121. }
  12122. };
  12123. } else {
  12124. Expr.filter[ "ID" ] = function( id ) {
  12125. var attrId = id.replace( runescape, funescape );
  12126. return function( elem ) {
  12127. var node = typeof elem.getAttributeNode !== "undefined" &&
  12128. elem.getAttributeNode( "id" );
  12129. return node && node.value === attrId;
  12130. };
  12131. };
  12132. // Support: IE 6 - 7 only
  12133. // getElementById is not reliable as a find shortcut
  12134. Expr.find[ "ID" ] = function( id, context ) {
  12135. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  12136. var node, i, elems,
  12137. elem = context.getElementById( id );
  12138. if ( elem ) {
  12139. // Verify the id attribute
  12140. node = elem.getAttributeNode( "id" );
  12141. if ( node && node.value === id ) {
  12142. return [ elem ];
  12143. }
  12144. // Fall back on getElementsByName
  12145. elems = context.getElementsByName( id );
  12146. i = 0;
  12147. while ( ( elem = elems[ i++ ] ) ) {
  12148. node = elem.getAttributeNode( "id" );
  12149. if ( node && node.value === id ) {
  12150. return [ elem ];
  12151. }
  12152. }
  12153. }
  12154. return [];
  12155. }
  12156. };
  12157. }
  12158. // Tag
  12159. Expr.find[ "TAG" ] = support.getElementsByTagName ?
  12160. function( tag, context ) {
  12161. if ( typeof context.getElementsByTagName !== "undefined" ) {
  12162. return context.getElementsByTagName( tag );
  12163. // DocumentFragment nodes don't have gEBTN
  12164. } else if ( support.qsa ) {
  12165. return context.querySelectorAll( tag );
  12166. }
  12167. } :
  12168. function( tag, context ) {
  12169. var elem,
  12170. tmp = [],
  12171. i = 0,
  12172. // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
  12173. results = context.getElementsByTagName( tag );
  12174. // Filter out possible comments
  12175. if ( tag === "*" ) {
  12176. while ( ( elem = results[ i++ ] ) ) {
  12177. if ( elem.nodeType === 1 ) {
  12178. tmp.push( elem );
  12179. }
  12180. }
  12181. return tmp;
  12182. }
  12183. return results;
  12184. };
  12185. // Class
  12186. Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) {
  12187. if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
  12188. return context.getElementsByClassName( className );
  12189. }
  12190. };
  12191. /* QSA/matchesSelector
  12192. ---------------------------------------------------------------------- */
  12193. // QSA and matchesSelector support
  12194. // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
  12195. rbuggyMatches = [];
  12196. // qSa(:focus) reports false when true (Chrome 21)
  12197. // We allow this because of a bug in IE8/9 that throws an error
  12198. // whenever `document.activeElement` is accessed on an iframe
  12199. // So, we allow :focus to pass through QSA all the time to avoid the IE error
  12200. // See https://bugs.jquery.com/ticket/13378
  12201. rbuggyQSA = [];
  12202. if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) {
  12203. // Build QSA regex
  12204. // Regex strategy adopted from Diego Perini
  12205. assert( function( el ) {
  12206. var input;
  12207. // Select is set to empty string on purpose
  12208. // This is to test IE's treatment of not explicitly
  12209. // setting a boolean content attribute,
  12210. // since its presence should be enough
  12211. // https://bugs.jquery.com/ticket/12359
  12212. docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
  12213. "<select id='" + expando + "-\r\\' msallowcapture=''>" +
  12214. "<option selected=''></option></select>";
  12215. // Support: IE8, Opera 11-12.16
  12216. // Nothing should be selected when empty strings follow ^= or $= or *=
  12217. // The test attribute must be unknown in Opera but "safe" for WinRT
  12218. // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
  12219. if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) {
  12220. rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
  12221. }
  12222. // Support: IE8
  12223. // Boolean attributes and "value" are not treated correctly
  12224. if ( !el.querySelectorAll( "[selected]" ).length ) {
  12225. rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
  12226. }
  12227. // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
  12228. if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
  12229. rbuggyQSA.push( "~=" );
  12230. }
  12231. // Support: IE 11+, Edge 15 - 18+
  12232. // IE 11/Edge don't find elements on a `[name='']` query in some cases.
  12233. // Adding a temporary attribute to the document before the selection works
  12234. // around the issue.
  12235. // Interestingly, IE 10 & older don't seem to have the issue.
  12236. input = document.createElement( "input" );
  12237. input.setAttribute( "name", "" );
  12238. el.appendChild( input );
  12239. if ( !el.querySelectorAll( "[name='']" ).length ) {
  12240. rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" +
  12241. whitespace + "*(?:''|\"\")" );
  12242. }
  12243. // Webkit/Opera - :checked should return selected option elements
  12244. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  12245. // IE8 throws error here and will not see later tests
  12246. if ( !el.querySelectorAll( ":checked" ).length ) {
  12247. rbuggyQSA.push( ":checked" );
  12248. }
  12249. // Support: Safari 8+, iOS 8+
  12250. // https://bugs.webkit.org/show_bug.cgi?id=136851
  12251. // In-page `selector#id sibling-combinator selector` fails
  12252. if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
  12253. rbuggyQSA.push( ".#.+[+~]" );
  12254. }
  12255. // Support: Firefox <=3.6 - 5 only
  12256. // Old Firefox doesn't throw on a badly-escaped identifier.
  12257. el.querySelectorAll( "\\\f" );
  12258. rbuggyQSA.push( "[\\r\\n\\f]" );
  12259. } );
  12260. assert( function( el ) {
  12261. el.innerHTML = "<a href='' disabled='disabled'></a>" +
  12262. "<select disabled='disabled'><option/></select>";
  12263. // Support: Windows 8 Native Apps
  12264. // The type and name attributes are restricted during .innerHTML assignment
  12265. var input = document.createElement( "input" );
  12266. input.setAttribute( "type", "hidden" );
  12267. el.appendChild( input ).setAttribute( "name", "D" );
  12268. // Support: IE8
  12269. // Enforce case-sensitivity of name attribute
  12270. if ( el.querySelectorAll( "[name=d]" ).length ) {
  12271. rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
  12272. }
  12273. // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
  12274. // IE8 throws error here and will not see later tests
  12275. if ( el.querySelectorAll( ":enabled" ).length !== 2 ) {
  12276. rbuggyQSA.push( ":enabled", ":disabled" );
  12277. }
  12278. // Support: IE9-11+
  12279. // IE's :disabled selector does not pick up the children of disabled fieldsets
  12280. docElem.appendChild( el ).disabled = true;
  12281. if ( el.querySelectorAll( ":disabled" ).length !== 2 ) {
  12282. rbuggyQSA.push( ":enabled", ":disabled" );
  12283. }
  12284. // Support: Opera 10 - 11 only
  12285. // Opera 10-11 does not throw on post-comma invalid pseudos
  12286. el.querySelectorAll( "*,:x" );
  12287. rbuggyQSA.push( ",.*:" );
  12288. } );
  12289. }
  12290. if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches ||
  12291. docElem.webkitMatchesSelector ||
  12292. docElem.mozMatchesSelector ||
  12293. docElem.oMatchesSelector ||
  12294. docElem.msMatchesSelector ) ) ) ) {
  12295. assert( function( el ) {
  12296. // Check to see if it's possible to do matchesSelector
  12297. // on a disconnected node (IE 9)
  12298. support.disconnectedMatch = matches.call( el, "*" );
  12299. // This should fail with an exception
  12300. // Gecko does not error, returns false instead
  12301. matches.call( el, "[s!='']:x" );
  12302. rbuggyMatches.push( "!=", pseudos );
  12303. } );
  12304. }
  12305. rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) );
  12306. rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) );
  12307. /* Contains
  12308. ---------------------------------------------------------------------- */
  12309. hasCompare = rnative.test( docElem.compareDocumentPosition );
  12310. // Element contains another
  12311. // Purposefully self-exclusive
  12312. // As in, an element does not contain itself
  12313. contains = hasCompare || rnative.test( docElem.contains ) ?
  12314. function( a, b ) {
  12315. var adown = a.nodeType === 9 ? a.documentElement : a,
  12316. bup = b && b.parentNode;
  12317. return a === bup || !!( bup && bup.nodeType === 1 && (
  12318. adown.contains ?
  12319. adown.contains( bup ) :
  12320. a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
  12321. ) );
  12322. } :
  12323. function( a, b ) {
  12324. if ( b ) {
  12325. while ( ( b = b.parentNode ) ) {
  12326. if ( b === a ) {
  12327. return true;
  12328. }
  12329. }
  12330. }
  12331. return false;
  12332. };
  12333. /* Sorting
  12334. ---------------------------------------------------------------------- */
  12335. // Document order sorting
  12336. sortOrder = hasCompare ?
  12337. function( a, b ) {
  12338. // Flag for duplicate removal
  12339. if ( a === b ) {
  12340. hasDuplicate = true;
  12341. return 0;
  12342. }
  12343. // Sort on method existence if only one input has compareDocumentPosition
  12344. var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
  12345. if ( compare ) {
  12346. return compare;
  12347. }
  12348. // Calculate position if both inputs belong to the same document
  12349. // Support: IE 11+, Edge 17 - 18+
  12350. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  12351. // two documents; shallow comparisons work.
  12352. // eslint-disable-next-line eqeqeq
  12353. compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ?
  12354. a.compareDocumentPosition( b ) :
  12355. // Otherwise we know they are disconnected
  12356. 1;
  12357. // Disconnected nodes
  12358. if ( compare & 1 ||
  12359. ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) {
  12360. // Choose the first element that is related to our preferred document
  12361. // Support: IE 11+, Edge 17 - 18+
  12362. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  12363. // two documents; shallow comparisons work.
  12364. // eslint-disable-next-line eqeqeq
  12365. if ( a == document || a.ownerDocument == preferredDoc &&
  12366. contains( preferredDoc, a ) ) {
  12367. return -1;
  12368. }
  12369. // Support: IE 11+, Edge 17 - 18+
  12370. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  12371. // two documents; shallow comparisons work.
  12372. // eslint-disable-next-line eqeqeq
  12373. if ( b == document || b.ownerDocument == preferredDoc &&
  12374. contains( preferredDoc, b ) ) {
  12375. return 1;
  12376. }
  12377. // Maintain original order
  12378. return sortInput ?
  12379. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  12380. 0;
  12381. }
  12382. return compare & 4 ? -1 : 1;
  12383. } :
  12384. function( a, b ) {
  12385. // Exit early if the nodes are identical
  12386. if ( a === b ) {
  12387. hasDuplicate = true;
  12388. return 0;
  12389. }
  12390. var cur,
  12391. i = 0,
  12392. aup = a.parentNode,
  12393. bup = b.parentNode,
  12394. ap = [ a ],
  12395. bp = [ b ];
  12396. // Parentless nodes are either documents or disconnected
  12397. if ( !aup || !bup ) {
  12398. // Support: IE 11+, Edge 17 - 18+
  12399. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  12400. // two documents; shallow comparisons work.
  12401. /* eslint-disable eqeqeq */
  12402. return a == document ? -1 :
  12403. b == document ? 1 :
  12404. /* eslint-enable eqeqeq */
  12405. aup ? -1 :
  12406. bup ? 1 :
  12407. sortInput ?
  12408. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  12409. 0;
  12410. // If the nodes are siblings, we can do a quick check
  12411. } else if ( aup === bup ) {
  12412. return siblingCheck( a, b );
  12413. }
  12414. // Otherwise we need full lists of their ancestors for comparison
  12415. cur = a;
  12416. while ( ( cur = cur.parentNode ) ) {
  12417. ap.unshift( cur );
  12418. }
  12419. cur = b;
  12420. while ( ( cur = cur.parentNode ) ) {
  12421. bp.unshift( cur );
  12422. }
  12423. // Walk down the tree looking for a discrepancy
  12424. while ( ap[ i ] === bp[ i ] ) {
  12425. i++;
  12426. }
  12427. return i ?
  12428. // Do a sibling check if the nodes have a common ancestor
  12429. siblingCheck( ap[ i ], bp[ i ] ) :
  12430. // Otherwise nodes in our document sort first
  12431. // Support: IE 11+, Edge 17 - 18+
  12432. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  12433. // two documents; shallow comparisons work.
  12434. /* eslint-disable eqeqeq */
  12435. ap[ i ] == preferredDoc ? -1 :
  12436. bp[ i ] == preferredDoc ? 1 :
  12437. /* eslint-enable eqeqeq */
  12438. 0;
  12439. };
  12440. return document;
  12441. };
  12442. Sizzle.matches = function( expr, elements ) {
  12443. return Sizzle( expr, null, null, elements );
  12444. };
  12445. Sizzle.matchesSelector = function( elem, expr ) {
  12446. setDocument( elem );
  12447. if ( support.matchesSelector && documentIsHTML &&
  12448. !nonnativeSelectorCache[ expr + " " ] &&
  12449. ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
  12450. ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
  12451. try {
  12452. var ret = matches.call( elem, expr );
  12453. // IE 9's matchesSelector returns false on disconnected nodes
  12454. if ( ret || support.disconnectedMatch ||
  12455. // As well, disconnected nodes are said to be in a document
  12456. // fragment in IE 9
  12457. elem.document && elem.document.nodeType !== 11 ) {
  12458. return ret;
  12459. }
  12460. } catch ( e ) {
  12461. nonnativeSelectorCache( expr, true );
  12462. }
  12463. }
  12464. return Sizzle( expr, document, null, [ elem ] ).length > 0;
  12465. };
  12466. Sizzle.contains = function( context, elem ) {
  12467. // Set document vars if needed
  12468. // Support: IE 11+, Edge 17 - 18+
  12469. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  12470. // two documents; shallow comparisons work.
  12471. // eslint-disable-next-line eqeqeq
  12472. if ( ( context.ownerDocument || context ) != document ) {
  12473. setDocument( context );
  12474. }
  12475. return contains( context, elem );
  12476. };
  12477. Sizzle.attr = function( elem, name ) {
  12478. // Set document vars if needed
  12479. // Support: IE 11+, Edge 17 - 18+
  12480. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  12481. // two documents; shallow comparisons work.
  12482. // eslint-disable-next-line eqeqeq
  12483. if ( ( elem.ownerDocument || elem ) != document ) {
  12484. setDocument( elem );
  12485. }
  12486. var fn = Expr.attrHandle[ name.toLowerCase() ],
  12487. // Don't get fooled by Object.prototype properties (jQuery #13807)
  12488. val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
  12489. fn( elem, name, !documentIsHTML ) :
  12490. undefined;
  12491. return val !== undefined ?
  12492. val :
  12493. support.attributes || !documentIsHTML ?
  12494. elem.getAttribute( name ) :
  12495. ( val = elem.getAttributeNode( name ) ) && val.specified ?
  12496. val.value :
  12497. null;
  12498. };
  12499. Sizzle.escape = function( sel ) {
  12500. return ( sel + "" ).replace( rcssescape, fcssescape );
  12501. };
  12502. Sizzle.error = function( msg ) {
  12503. throw new Error( "Syntax error, unrecognized expression: " + msg );
  12504. };
  12505. /**
  12506. * Document sorting and removing duplicates
  12507. * @param {ArrayLike} results
  12508. */
  12509. Sizzle.uniqueSort = function( results ) {
  12510. var elem,
  12511. duplicates = [],
  12512. j = 0,
  12513. i = 0;
  12514. // Unless we *know* we can detect duplicates, assume their presence
  12515. hasDuplicate = !support.detectDuplicates;
  12516. sortInput = !support.sortStable && results.slice( 0 );
  12517. results.sort( sortOrder );
  12518. if ( hasDuplicate ) {
  12519. while ( ( elem = results[ i++ ] ) ) {
  12520. if ( elem === results[ i ] ) {
  12521. j = duplicates.push( i );
  12522. }
  12523. }
  12524. while ( j-- ) {
  12525. results.splice( duplicates[ j ], 1 );
  12526. }
  12527. }
  12528. // Clear input after sorting to release objects
  12529. // See https://github.com/jquery/sizzle/pull/225
  12530. sortInput = null;
  12531. return results;
  12532. };
  12533. /**
  12534. * Utility function for retrieving the text value of an array of DOM nodes
  12535. * @param {Array|Element} elem
  12536. */
  12537. getText = Sizzle.getText = function( elem ) {
  12538. var node,
  12539. ret = "",
  12540. i = 0,
  12541. nodeType = elem.nodeType;
  12542. if ( !nodeType ) {
  12543. // If no nodeType, this is expected to be an array
  12544. while ( ( node = elem[ i++ ] ) ) {
  12545. // Do not traverse comment nodes
  12546. ret += getText( node );
  12547. }
  12548. } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
  12549. // Use textContent for elements
  12550. // innerText usage removed for consistency of new lines (jQuery #11153)
  12551. if ( typeof elem.textContent === "string" ) {
  12552. return elem.textContent;
  12553. } else {
  12554. // Traverse its children
  12555. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  12556. ret += getText( elem );
  12557. }
  12558. }
  12559. } else if ( nodeType === 3 || nodeType === 4 ) {
  12560. return elem.nodeValue;
  12561. }
  12562. // Do not include comment or processing instruction nodes
  12563. return ret;
  12564. };
  12565. Expr = Sizzle.selectors = {
  12566. // Can be adjusted by the user
  12567. cacheLength: 50,
  12568. createPseudo: markFunction,
  12569. match: matchExpr,
  12570. attrHandle: {},
  12571. find: {},
  12572. relative: {
  12573. ">": { dir: "parentNode", first: true },
  12574. " ": { dir: "parentNode" },
  12575. "+": { dir: "previousSibling", first: true },
  12576. "~": { dir: "previousSibling" }
  12577. },
  12578. preFilter: {
  12579. "ATTR": function( match ) {
  12580. match[ 1 ] = match[ 1 ].replace( runescape, funescape );
  12581. // Move the given value to match[3] whether quoted or unquoted
  12582. match[ 3 ] = ( match[ 3 ] || match[ 4 ] ||
  12583. match[ 5 ] || "" ).replace( runescape, funescape );
  12584. if ( match[ 2 ] === "~=" ) {
  12585. match[ 3 ] = " " + match[ 3 ] + " ";
  12586. }
  12587. return match.slice( 0, 4 );
  12588. },
  12589. "CHILD": function( match ) {
  12590. /* matches from matchExpr["CHILD"]
  12591. 1 type (only|nth|...)
  12592. 2 what (child|of-type)
  12593. 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
  12594. 4 xn-component of xn+y argument ([+-]?\d*n|)
  12595. 5 sign of xn-component
  12596. 6 x of xn-component
  12597. 7 sign of y-component
  12598. 8 y of y-component
  12599. */
  12600. match[ 1 ] = match[ 1 ].toLowerCase();
  12601. if ( match[ 1 ].slice( 0, 3 ) === "nth" ) {
  12602. // nth-* requires argument
  12603. if ( !match[ 3 ] ) {
  12604. Sizzle.error( match[ 0 ] );
  12605. }
  12606. // numeric x and y parameters for Expr.filter.CHILD
  12607. // remember that false/true cast respectively to 0/1
  12608. match[ 4 ] = +( match[ 4 ] ?
  12609. match[ 5 ] + ( match[ 6 ] || 1 ) :
  12610. 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) );
  12611. match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" );
  12612. // other types prohibit arguments
  12613. } else if ( match[ 3 ] ) {
  12614. Sizzle.error( match[ 0 ] );
  12615. }
  12616. return match;
  12617. },
  12618. "PSEUDO": function( match ) {
  12619. var excess,
  12620. unquoted = !match[ 6 ] && match[ 2 ];
  12621. if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) {
  12622. return null;
  12623. }
  12624. // Accept quoted arguments as-is
  12625. if ( match[ 3 ] ) {
  12626. match[ 2 ] = match[ 4 ] || match[ 5 ] || "";
  12627. // Strip excess characters from unquoted arguments
  12628. } else if ( unquoted && rpseudo.test( unquoted ) &&
  12629. // Get excess from tokenize (recursively)
  12630. ( excess = tokenize( unquoted, true ) ) &&
  12631. // advance to the next closing parenthesis
  12632. ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) {
  12633. // excess is a negative index
  12634. match[ 0 ] = match[ 0 ].slice( 0, excess );
  12635. match[ 2 ] = unquoted.slice( 0, excess );
  12636. }
  12637. // Return only captures needed by the pseudo filter method (type and argument)
  12638. return match.slice( 0, 3 );
  12639. }
  12640. },
  12641. filter: {
  12642. "TAG": function( nodeNameSelector ) {
  12643. var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
  12644. return nodeNameSelector === "*" ?
  12645. function() {
  12646. return true;
  12647. } :
  12648. function( elem ) {
  12649. return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
  12650. };
  12651. },
  12652. "CLASS": function( className ) {
  12653. var pattern = classCache[ className + " " ];
  12654. return pattern ||
  12655. ( pattern = new RegExp( "(^|" + whitespace +
  12656. ")" + className + "(" + whitespace + "|$)" ) ) && classCache(
  12657. className, function( elem ) {
  12658. return pattern.test(
  12659. typeof elem.className === "string" && elem.className ||
  12660. typeof elem.getAttribute !== "undefined" &&
  12661. elem.getAttribute( "class" ) ||
  12662. ""
  12663. );
  12664. } );
  12665. },
  12666. "ATTR": function( name, operator, check ) {
  12667. return function( elem ) {
  12668. var result = Sizzle.attr( elem, name );
  12669. if ( result == null ) {
  12670. return operator === "!=";
  12671. }
  12672. if ( !operator ) {
  12673. return true;
  12674. }
  12675. result += "";
  12676. /* eslint-disable max-len */
  12677. return operator === "=" ? result === check :
  12678. operator === "!=" ? result !== check :
  12679. operator === "^=" ? check && result.indexOf( check ) === 0 :
  12680. operator === "*=" ? check && result.indexOf( check ) > -1 :
  12681. operator === "$=" ? check && result.slice( -check.length ) === check :
  12682. operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
  12683. operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
  12684. false;
  12685. /* eslint-enable max-len */
  12686. };
  12687. },
  12688. "CHILD": function( type, what, _argument, first, last ) {
  12689. var simple = type.slice( 0, 3 ) !== "nth",
  12690. forward = type.slice( -4 ) !== "last",
  12691. ofType = what === "of-type";
  12692. return first === 1 && last === 0 ?
  12693. // Shortcut for :nth-*(n)
  12694. function( elem ) {
  12695. return !!elem.parentNode;
  12696. } :
  12697. function( elem, _context, xml ) {
  12698. var cache, uniqueCache, outerCache, node, nodeIndex, start,
  12699. dir = simple !== forward ? "nextSibling" : "previousSibling",
  12700. parent = elem.parentNode,
  12701. name = ofType && elem.nodeName.toLowerCase(),
  12702. useCache = !xml && !ofType,
  12703. diff = false;
  12704. if ( parent ) {
  12705. // :(first|last|only)-(child|of-type)
  12706. if ( simple ) {
  12707. while ( dir ) {
  12708. node = elem;
  12709. while ( ( node = node[ dir ] ) ) {
  12710. if ( ofType ?
  12711. node.nodeName.toLowerCase() === name :
  12712. node.nodeType === 1 ) {
  12713. return false;
  12714. }
  12715. }
  12716. // Reverse direction for :only-* (if we haven't yet done so)
  12717. start = dir = type === "only" && !start && "nextSibling";
  12718. }
  12719. return true;
  12720. }
  12721. start = [ forward ? parent.firstChild : parent.lastChild ];
  12722. // non-xml :nth-child(...) stores cache data on `parent`
  12723. if ( forward && useCache ) {
  12724. // Seek `elem` from a previously-cached index
  12725. // ...in a gzip-friendly way
  12726. node = parent;
  12727. outerCache = node[ expando ] || ( node[ expando ] = {} );
  12728. // Support: IE <9 only
  12729. // Defend against cloned attroperties (jQuery gh-1709)
  12730. uniqueCache = outerCache[ node.uniqueID ] ||
  12731. ( outerCache[ node.uniqueID ] = {} );
  12732. cache = uniqueCache[ type ] || [];
  12733. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  12734. diff = nodeIndex && cache[ 2 ];
  12735. node = nodeIndex && parent.childNodes[ nodeIndex ];
  12736. while ( ( node = ++nodeIndex && node && node[ dir ] ||
  12737. // Fallback to seeking `elem` from the start
  12738. ( diff = nodeIndex = 0 ) || start.pop() ) ) {
  12739. // When found, cache indexes on `parent` and break
  12740. if ( node.nodeType === 1 && ++diff && node === elem ) {
  12741. uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
  12742. break;
  12743. }
  12744. }
  12745. } else {
  12746. // Use previously-cached element index if available
  12747. if ( useCache ) {
  12748. // ...in a gzip-friendly way
  12749. node = elem;
  12750. outerCache = node[ expando ] || ( node[ expando ] = {} );
  12751. // Support: IE <9 only
  12752. // Defend against cloned attroperties (jQuery gh-1709)
  12753. uniqueCache = outerCache[ node.uniqueID ] ||
  12754. ( outerCache[ node.uniqueID ] = {} );
  12755. cache = uniqueCache[ type ] || [];
  12756. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  12757. diff = nodeIndex;
  12758. }
  12759. // xml :nth-child(...)
  12760. // or :nth-last-child(...) or :nth(-last)?-of-type(...)
  12761. if ( diff === false ) {
  12762. // Use the same loop as above to seek `elem` from the start
  12763. while ( ( node = ++nodeIndex && node && node[ dir ] ||
  12764. ( diff = nodeIndex = 0 ) || start.pop() ) ) {
  12765. if ( ( ofType ?
  12766. node.nodeName.toLowerCase() === name :
  12767. node.nodeType === 1 ) &&
  12768. ++diff ) {
  12769. // Cache the index of each encountered element
  12770. if ( useCache ) {
  12771. outerCache = node[ expando ] ||
  12772. ( node[ expando ] = {} );
  12773. // Support: IE <9 only
  12774. // Defend against cloned attroperties (jQuery gh-1709)
  12775. uniqueCache = outerCache[ node.uniqueID ] ||
  12776. ( outerCache[ node.uniqueID ] = {} );
  12777. uniqueCache[ type ] = [ dirruns, diff ];
  12778. }
  12779. if ( node === elem ) {
  12780. break;
  12781. }
  12782. }
  12783. }
  12784. }
  12785. }
  12786. // Incorporate the offset, then check against cycle size
  12787. diff -= last;
  12788. return diff === first || ( diff % first === 0 && diff / first >= 0 );
  12789. }
  12790. };
  12791. },
  12792. "PSEUDO": function( pseudo, argument ) {
  12793. // pseudo-class names are case-insensitive
  12794. // http://www.w3.org/TR/selectors/#pseudo-classes
  12795. // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
  12796. // Remember that setFilters inherits from pseudos
  12797. var args,
  12798. fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
  12799. Sizzle.error( "unsupported pseudo: " + pseudo );
  12800. // The user may use createPseudo to indicate that
  12801. // arguments are needed to create the filter function
  12802. // just as Sizzle does
  12803. if ( fn[ expando ] ) {
  12804. return fn( argument );
  12805. }
  12806. // But maintain support for old signatures
  12807. if ( fn.length > 1 ) {
  12808. args = [ pseudo, pseudo, "", argument ];
  12809. return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
  12810. markFunction( function( seed, matches ) {
  12811. var idx,
  12812. matched = fn( seed, argument ),
  12813. i = matched.length;
  12814. while ( i-- ) {
  12815. idx = indexOf( seed, matched[ i ] );
  12816. seed[ idx ] = !( matches[ idx ] = matched[ i ] );
  12817. }
  12818. } ) :
  12819. function( elem ) {
  12820. return fn( elem, 0, args );
  12821. };
  12822. }
  12823. return fn;
  12824. }
  12825. },
  12826. pseudos: {
  12827. // Potentially complex pseudos
  12828. "not": markFunction( function( selector ) {
  12829. // Trim the selector passed to compile
  12830. // to avoid treating leading and trailing
  12831. // spaces as combinators
  12832. var input = [],
  12833. results = [],
  12834. matcher = compile( selector.replace( rtrim, "$1" ) );
  12835. return matcher[ expando ] ?
  12836. markFunction( function( seed, matches, _context, xml ) {
  12837. var elem,
  12838. unmatched = matcher( seed, null, xml, [] ),
  12839. i = seed.length;
  12840. // Match elements unmatched by `matcher`
  12841. while ( i-- ) {
  12842. if ( ( elem = unmatched[ i ] ) ) {
  12843. seed[ i ] = !( matches[ i ] = elem );
  12844. }
  12845. }
  12846. } ) :
  12847. function( elem, _context, xml ) {
  12848. input[ 0 ] = elem;
  12849. matcher( input, null, xml, results );
  12850. // Don't keep the element (issue #299)
  12851. input[ 0 ] = null;
  12852. return !results.pop();
  12853. };
  12854. } ),
  12855. "has": markFunction( function( selector ) {
  12856. return function( elem ) {
  12857. return Sizzle( selector, elem ).length > 0;
  12858. };
  12859. } ),
  12860. "contains": markFunction( function( text ) {
  12861. text = text.replace( runescape, funescape );
  12862. return function( elem ) {
  12863. return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;
  12864. };
  12865. } ),
  12866. // "Whether an element is represented by a :lang() selector
  12867. // is based solely on the element's language value
  12868. // being equal to the identifier C,
  12869. // or beginning with the identifier C immediately followed by "-".
  12870. // The matching of C against the element's language value is performed case-insensitively.
  12871. // The identifier C does not have to be a valid language name."
  12872. // http://www.w3.org/TR/selectors/#lang-pseudo
  12873. "lang": markFunction( function( lang ) {
  12874. // lang value must be a valid identifier
  12875. if ( !ridentifier.test( lang || "" ) ) {
  12876. Sizzle.error( "unsupported lang: " + lang );
  12877. }
  12878. lang = lang.replace( runescape, funescape ).toLowerCase();
  12879. return function( elem ) {
  12880. var elemLang;
  12881. do {
  12882. if ( ( elemLang = documentIsHTML ?
  12883. elem.lang :
  12884. elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) {
  12885. elemLang = elemLang.toLowerCase();
  12886. return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
  12887. }
  12888. } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 );
  12889. return false;
  12890. };
  12891. } ),
  12892. // Miscellaneous
  12893. "target": function( elem ) {
  12894. var hash = window.location && window.location.hash;
  12895. return hash && hash.slice( 1 ) === elem.id;
  12896. },
  12897. "root": function( elem ) {
  12898. return elem === docElem;
  12899. },
  12900. "focus": function( elem ) {
  12901. return elem === document.activeElement &&
  12902. ( !document.hasFocus || document.hasFocus() ) &&
  12903. !!( elem.type || elem.href || ~elem.tabIndex );
  12904. },
  12905. // Boolean properties
  12906. "enabled": createDisabledPseudo( false ),
  12907. "disabled": createDisabledPseudo( true ),
  12908. "checked": function( elem ) {
  12909. // In CSS3, :checked should return both checked and selected elements
  12910. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  12911. var nodeName = elem.nodeName.toLowerCase();
  12912. return ( nodeName === "input" && !!elem.checked ) ||
  12913. ( nodeName === "option" && !!elem.selected );
  12914. },
  12915. "selected": function( elem ) {
  12916. // Accessing this property makes selected-by-default
  12917. // options in Safari work properly
  12918. if ( elem.parentNode ) {
  12919. // eslint-disable-next-line no-unused-expressions
  12920. elem.parentNode.selectedIndex;
  12921. }
  12922. return elem.selected === true;
  12923. },
  12924. // Contents
  12925. "empty": function( elem ) {
  12926. // http://www.w3.org/TR/selectors/#empty-pseudo
  12927. // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
  12928. // but not by others (comment: 8; processing instruction: 7; etc.)
  12929. // nodeType < 6 works because attributes (2) do not appear as children
  12930. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  12931. if ( elem.nodeType < 6 ) {
  12932. return false;
  12933. }
  12934. }
  12935. return true;
  12936. },
  12937. "parent": function( elem ) {
  12938. return !Expr.pseudos[ "empty" ]( elem );
  12939. },
  12940. // Element/input types
  12941. "header": function( elem ) {
  12942. return rheader.test( elem.nodeName );
  12943. },
  12944. "input": function( elem ) {
  12945. return rinputs.test( elem.nodeName );
  12946. },
  12947. "button": function( elem ) {
  12948. var name = elem.nodeName.toLowerCase();
  12949. return name === "input" && elem.type === "button" || name === "button";
  12950. },
  12951. "text": function( elem ) {
  12952. var attr;
  12953. return elem.nodeName.toLowerCase() === "input" &&
  12954. elem.type === "text" &&
  12955. // Support: IE<8
  12956. // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
  12957. ( ( attr = elem.getAttribute( "type" ) ) == null ||
  12958. attr.toLowerCase() === "text" );
  12959. },
  12960. // Position-in-collection
  12961. "first": createPositionalPseudo( function() {
  12962. return [ 0 ];
  12963. } ),
  12964. "last": createPositionalPseudo( function( _matchIndexes, length ) {
  12965. return [ length - 1 ];
  12966. } ),
  12967. "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) {
  12968. return [ argument < 0 ? argument + length : argument ];
  12969. } ),
  12970. "even": createPositionalPseudo( function( matchIndexes, length ) {
  12971. var i = 0;
  12972. for ( ; i < length; i += 2 ) {
  12973. matchIndexes.push( i );
  12974. }
  12975. return matchIndexes;
  12976. } ),
  12977. "odd": createPositionalPseudo( function( matchIndexes, length ) {
  12978. var i = 1;
  12979. for ( ; i < length; i += 2 ) {
  12980. matchIndexes.push( i );
  12981. }
  12982. return matchIndexes;
  12983. } ),
  12984. "lt": createPositionalPseudo( function( matchIndexes, length, argument ) {
  12985. var i = argument < 0 ?
  12986. argument + length :
  12987. argument > length ?
  12988. length :
  12989. argument;
  12990. for ( ; --i >= 0; ) {
  12991. matchIndexes.push( i );
  12992. }
  12993. return matchIndexes;
  12994. } ),
  12995. "gt": createPositionalPseudo( function( matchIndexes, length, argument ) {
  12996. var i = argument < 0 ? argument + length : argument;
  12997. for ( ; ++i < length; ) {
  12998. matchIndexes.push( i );
  12999. }
  13000. return matchIndexes;
  13001. } )
  13002. }
  13003. };
  13004. Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ];
  13005. // Add button/input type pseudos
  13006. for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
  13007. Expr.pseudos[ i ] = createInputPseudo( i );
  13008. }
  13009. for ( i in { submit: true, reset: true } ) {
  13010. Expr.pseudos[ i ] = createButtonPseudo( i );
  13011. }
  13012. // Easy API for creating new setFilters
  13013. function setFilters() {}
  13014. setFilters.prototype = Expr.filters = Expr.pseudos;
  13015. Expr.setFilters = new setFilters();
  13016. tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
  13017. var matched, match, tokens, type,
  13018. soFar, groups, preFilters,
  13019. cached = tokenCache[ selector + " " ];
  13020. if ( cached ) {
  13021. return parseOnly ? 0 : cached.slice( 0 );
  13022. }
  13023. soFar = selector;
  13024. groups = [];
  13025. preFilters = Expr.preFilter;
  13026. while ( soFar ) {
  13027. // Comma and first run
  13028. if ( !matched || ( match = rcomma.exec( soFar ) ) ) {
  13029. if ( match ) {
  13030. // Don't consume trailing commas as valid
  13031. soFar = soFar.slice( match[ 0 ].length ) || soFar;
  13032. }
  13033. groups.push( ( tokens = [] ) );
  13034. }
  13035. matched = false;
  13036. // Combinators
  13037. if ( ( match = rcombinators.exec( soFar ) ) ) {
  13038. matched = match.shift();
  13039. tokens.push( {
  13040. value: matched,
  13041. // Cast descendant combinators to space
  13042. type: match[ 0 ].replace( rtrim, " " )
  13043. } );
  13044. soFar = soFar.slice( matched.length );
  13045. }
  13046. // Filters
  13047. for ( type in Expr.filter ) {
  13048. if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] ||
  13049. ( match = preFilters[ type ]( match ) ) ) ) {
  13050. matched = match.shift();
  13051. tokens.push( {
  13052. value: matched,
  13053. type: type,
  13054. matches: match
  13055. } );
  13056. soFar = soFar.slice( matched.length );
  13057. }
  13058. }
  13059. if ( !matched ) {
  13060. break;
  13061. }
  13062. }
  13063. // Return the length of the invalid excess
  13064. // if we're just parsing
  13065. // Otherwise, throw an error or return tokens
  13066. return parseOnly ?
  13067. soFar.length :
  13068. soFar ?
  13069. Sizzle.error( selector ) :
  13070. // Cache the tokens
  13071. tokenCache( selector, groups ).slice( 0 );
  13072. };
  13073. function toSelector( tokens ) {
  13074. var i = 0,
  13075. len = tokens.length,
  13076. selector = "";
  13077. for ( ; i < len; i++ ) {
  13078. selector += tokens[ i ].value;
  13079. }
  13080. return selector;
  13081. }
  13082. function addCombinator( matcher, combinator, base ) {
  13083. var dir = combinator.dir,
  13084. skip = combinator.next,
  13085. key = skip || dir,
  13086. checkNonElements = base && key === "parentNode",
  13087. doneName = done++;
  13088. return combinator.first ?
  13089. // Check against closest ancestor/preceding element
  13090. function( elem, context, xml ) {
  13091. while ( ( elem = elem[ dir ] ) ) {
  13092. if ( elem.nodeType === 1 || checkNonElements ) {
  13093. return matcher( elem, context, xml );
  13094. }
  13095. }
  13096. return false;
  13097. } :
  13098. // Check against all ancestor/preceding elements
  13099. function( elem, context, xml ) {
  13100. var oldCache, uniqueCache, outerCache,
  13101. newCache = [ dirruns, doneName ];
  13102. // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
  13103. if ( xml ) {
  13104. while ( ( elem = elem[ dir ] ) ) {
  13105. if ( elem.nodeType === 1 || checkNonElements ) {
  13106. if ( matcher( elem, context, xml ) ) {
  13107. return true;
  13108. }
  13109. }
  13110. }
  13111. } else {
  13112. while ( ( elem = elem[ dir ] ) ) {
  13113. if ( elem.nodeType === 1 || checkNonElements ) {
  13114. outerCache = elem[ expando ] || ( elem[ expando ] = {} );
  13115. // Support: IE <9 only
  13116. // Defend against cloned attroperties (jQuery gh-1709)
  13117. uniqueCache = outerCache[ elem.uniqueID ] ||
  13118. ( outerCache[ elem.uniqueID ] = {} );
  13119. if ( skip && skip === elem.nodeName.toLowerCase() ) {
  13120. elem = elem[ dir ] || elem;
  13121. } else if ( ( oldCache = uniqueCache[ key ] ) &&
  13122. oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
  13123. // Assign to newCache so results back-propagate to previous elements
  13124. return ( newCache[ 2 ] = oldCache[ 2 ] );
  13125. } else {
  13126. // Reuse newcache so results back-propagate to previous elements
  13127. uniqueCache[ key ] = newCache;
  13128. // A match means we're done; a fail means we have to keep checking
  13129. if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) {
  13130. return true;
  13131. }
  13132. }
  13133. }
  13134. }
  13135. }
  13136. return false;
  13137. };
  13138. }
  13139. function elementMatcher( matchers ) {
  13140. return matchers.length > 1 ?
  13141. function( elem, context, xml ) {
  13142. var i = matchers.length;
  13143. while ( i-- ) {
  13144. if ( !matchers[ i ]( elem, context, xml ) ) {
  13145. return false;
  13146. }
  13147. }
  13148. return true;
  13149. } :
  13150. matchers[ 0 ];
  13151. }
  13152. function multipleContexts( selector, contexts, results ) {
  13153. var i = 0,
  13154. len = contexts.length;
  13155. for ( ; i < len; i++ ) {
  13156. Sizzle( selector, contexts[ i ], results );
  13157. }
  13158. return results;
  13159. }
  13160. function condense( unmatched, map, filter, context, xml ) {
  13161. var elem,
  13162. newUnmatched = [],
  13163. i = 0,
  13164. len = unmatched.length,
  13165. mapped = map != null;
  13166. for ( ; i < len; i++ ) {
  13167. if ( ( elem = unmatched[ i ] ) ) {
  13168. if ( !filter || filter( elem, context, xml ) ) {
  13169. newUnmatched.push( elem );
  13170. if ( mapped ) {
  13171. map.push( i );
  13172. }
  13173. }
  13174. }
  13175. }
  13176. return newUnmatched;
  13177. }
  13178. function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
  13179. if ( postFilter && !postFilter[ expando ] ) {
  13180. postFilter = setMatcher( postFilter );
  13181. }
  13182. if ( postFinder && !postFinder[ expando ] ) {
  13183. postFinder = setMatcher( postFinder, postSelector );
  13184. }
  13185. return markFunction( function( seed, results, context, xml ) {
  13186. var temp, i, elem,
  13187. preMap = [],
  13188. postMap = [],
  13189. preexisting = results.length,
  13190. // Get initial elements from seed or context
  13191. elems = seed || multipleContexts(
  13192. selector || "*",
  13193. context.nodeType ? [ context ] : context,
  13194. []
  13195. ),
  13196. // Prefilter to get matcher input, preserving a map for seed-results synchronization
  13197. matcherIn = preFilter && ( seed || !selector ) ?
  13198. condense( elems, preMap, preFilter, context, xml ) :
  13199. elems,
  13200. matcherOut = matcher ?
  13201. // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
  13202. postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
  13203. // ...intermediate processing is necessary
  13204. [] :
  13205. // ...otherwise use results directly
  13206. results :
  13207. matcherIn;
  13208. // Find primary matches
  13209. if ( matcher ) {
  13210. matcher( matcherIn, matcherOut, context, xml );
  13211. }
  13212. // Apply postFilter
  13213. if ( postFilter ) {
  13214. temp = condense( matcherOut, postMap );
  13215. postFilter( temp, [], context, xml );
  13216. // Un-match failing elements by moving them back to matcherIn
  13217. i = temp.length;
  13218. while ( i-- ) {
  13219. if ( ( elem = temp[ i ] ) ) {
  13220. matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem );
  13221. }
  13222. }
  13223. }
  13224. if ( seed ) {
  13225. if ( postFinder || preFilter ) {
  13226. if ( postFinder ) {
  13227. // Get the final matcherOut by condensing this intermediate into postFinder contexts
  13228. temp = [];
  13229. i = matcherOut.length;
  13230. while ( i-- ) {
  13231. if ( ( elem = matcherOut[ i ] ) ) {
  13232. // Restore matcherIn since elem is not yet a final match
  13233. temp.push( ( matcherIn[ i ] = elem ) );
  13234. }
  13235. }
  13236. postFinder( null, ( matcherOut = [] ), temp, xml );
  13237. }
  13238. // Move matched elements from seed to results to keep them synchronized
  13239. i = matcherOut.length;
  13240. while ( i-- ) {
  13241. if ( ( elem = matcherOut[ i ] ) &&
  13242. ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) {
  13243. seed[ temp ] = !( results[ temp ] = elem );
  13244. }
  13245. }
  13246. }
  13247. // Add elements to results, through postFinder if defined
  13248. } else {
  13249. matcherOut = condense(
  13250. matcherOut === results ?
  13251. matcherOut.splice( preexisting, matcherOut.length ) :
  13252. matcherOut
  13253. );
  13254. if ( postFinder ) {
  13255. postFinder( null, results, matcherOut, xml );
  13256. } else {
  13257. push.apply( results, matcherOut );
  13258. }
  13259. }
  13260. } );
  13261. }
  13262. function matcherFromTokens( tokens ) {
  13263. var checkContext, matcher, j,
  13264. len = tokens.length,
  13265. leadingRelative = Expr.relative[ tokens[ 0 ].type ],
  13266. implicitRelative = leadingRelative || Expr.relative[ " " ],
  13267. i = leadingRelative ? 1 : 0,
  13268. // The foundational matcher ensures that elements are reachable from top-level context(s)
  13269. matchContext = addCombinator( function( elem ) {
  13270. return elem === checkContext;
  13271. }, implicitRelative, true ),
  13272. matchAnyContext = addCombinator( function( elem ) {
  13273. return indexOf( checkContext, elem ) > -1;
  13274. }, implicitRelative, true ),
  13275. matchers = [ function( elem, context, xml ) {
  13276. var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
  13277. ( checkContext = context ).nodeType ?
  13278. matchContext( elem, context, xml ) :
  13279. matchAnyContext( elem, context, xml ) );
  13280. // Avoid hanging onto element (issue #299)
  13281. checkContext = null;
  13282. return ret;
  13283. } ];
  13284. for ( ; i < len; i++ ) {
  13285. if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) {
  13286. matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];
  13287. } else {
  13288. matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches );
  13289. // Return special upon seeing a positional matcher
  13290. if ( matcher[ expando ] ) {
  13291. // Find the next relative operator (if any) for proper handling
  13292. j = ++i;
  13293. for ( ; j < len; j++ ) {
  13294. if ( Expr.relative[ tokens[ j ].type ] ) {
  13295. break;
  13296. }
  13297. }
  13298. return setMatcher(
  13299. i > 1 && elementMatcher( matchers ),
  13300. i > 1 && toSelector(
  13301. // If the preceding token was a descendant combinator, insert an implicit any-element `*`
  13302. tokens
  13303. .slice( 0, i - 1 )
  13304. .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } )
  13305. ).replace( rtrim, "$1" ),
  13306. matcher,
  13307. i < j && matcherFromTokens( tokens.slice( i, j ) ),
  13308. j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ),
  13309. j < len && toSelector( tokens )
  13310. );
  13311. }
  13312. matchers.push( matcher );
  13313. }
  13314. }
  13315. return elementMatcher( matchers );
  13316. }
  13317. function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
  13318. var bySet = setMatchers.length > 0,
  13319. byElement = elementMatchers.length > 0,
  13320. superMatcher = function( seed, context, xml, results, outermost ) {
  13321. var elem, j, matcher,
  13322. matchedCount = 0,
  13323. i = "0",
  13324. unmatched = seed && [],
  13325. setMatched = [],
  13326. contextBackup = outermostContext,
  13327. // We must always have either seed elements or outermost context
  13328. elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ),
  13329. // Use integer dirruns iff this is the outermost matcher
  13330. dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ),
  13331. len = elems.length;
  13332. if ( outermost ) {
  13333. // Support: IE 11+, Edge 17 - 18+
  13334. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  13335. // two documents; shallow comparisons work.
  13336. // eslint-disable-next-line eqeqeq
  13337. outermostContext = context == document || context || outermost;
  13338. }
  13339. // Add elements passing elementMatchers directly to results
  13340. // Support: IE<9, Safari
  13341. // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
  13342. for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) {
  13343. if ( byElement && elem ) {
  13344. j = 0;
  13345. // Support: IE 11+, Edge 17 - 18+
  13346. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  13347. // two documents; shallow comparisons work.
  13348. // eslint-disable-next-line eqeqeq
  13349. if ( !context && elem.ownerDocument != document ) {
  13350. setDocument( elem );
  13351. xml = !documentIsHTML;
  13352. }
  13353. while ( ( matcher = elementMatchers[ j++ ] ) ) {
  13354. if ( matcher( elem, context || document, xml ) ) {
  13355. results.push( elem );
  13356. break;
  13357. }
  13358. }
  13359. if ( outermost ) {
  13360. dirruns = dirrunsUnique;
  13361. }
  13362. }
  13363. // Track unmatched elements for set filters
  13364. if ( bySet ) {
  13365. // They will have gone through all possible matchers
  13366. if ( ( elem = !matcher && elem ) ) {
  13367. matchedCount--;
  13368. }
  13369. // Lengthen the array for every element, matched or not
  13370. if ( seed ) {
  13371. unmatched.push( elem );
  13372. }
  13373. }
  13374. }
  13375. // `i` is now the count of elements visited above, and adding it to `matchedCount`
  13376. // makes the latter nonnegative.
  13377. matchedCount += i;
  13378. // Apply set filters to unmatched elements
  13379. // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
  13380. // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
  13381. // no element matchers and no seed.
  13382. // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
  13383. // case, which will result in a "00" `matchedCount` that differs from `i` but is also
  13384. // numerically zero.
  13385. if ( bySet && i !== matchedCount ) {
  13386. j = 0;
  13387. while ( ( matcher = setMatchers[ j++ ] ) ) {
  13388. matcher( unmatched, setMatched, context, xml );
  13389. }
  13390. if ( seed ) {
  13391. // Reintegrate element matches to eliminate the need for sorting
  13392. if ( matchedCount > 0 ) {
  13393. while ( i-- ) {
  13394. if ( !( unmatched[ i ] || setMatched[ i ] ) ) {
  13395. setMatched[ i ] = pop.call( results );
  13396. }
  13397. }
  13398. }
  13399. // Discard index placeholder values to get only actual matches
  13400. setMatched = condense( setMatched );
  13401. }
  13402. // Add matches to results
  13403. push.apply( results, setMatched );
  13404. // Seedless set matches succeeding multiple successful matchers stipulate sorting
  13405. if ( outermost && !seed && setMatched.length > 0 &&
  13406. ( matchedCount + setMatchers.length ) > 1 ) {
  13407. Sizzle.uniqueSort( results );
  13408. }
  13409. }
  13410. // Override manipulation of globals by nested matchers
  13411. if ( outermost ) {
  13412. dirruns = dirrunsUnique;
  13413. outermostContext = contextBackup;
  13414. }
  13415. return unmatched;
  13416. };
  13417. return bySet ?
  13418. markFunction( superMatcher ) :
  13419. superMatcher;
  13420. }
  13421. compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
  13422. var i,
  13423. setMatchers = [],
  13424. elementMatchers = [],
  13425. cached = compilerCache[ selector + " " ];
  13426. if ( !cached ) {
  13427. // Generate a function of recursive functions that can be used to check each element
  13428. if ( !match ) {
  13429. match = tokenize( selector );
  13430. }
  13431. i = match.length;
  13432. while ( i-- ) {
  13433. cached = matcherFromTokens( match[ i ] );
  13434. if ( cached[ expando ] ) {
  13435. setMatchers.push( cached );
  13436. } else {
  13437. elementMatchers.push( cached );
  13438. }
  13439. }
  13440. // Cache the compiled function
  13441. cached = compilerCache(
  13442. selector,
  13443. matcherFromGroupMatchers( elementMatchers, setMatchers )
  13444. );
  13445. // Save selector and tokenization
  13446. cached.selector = selector;
  13447. }
  13448. return cached;
  13449. };
  13450. /**
  13451. * A low-level selection function that works with Sizzle's compiled
  13452. * selector functions
  13453. * @param {String|Function} selector A selector or a pre-compiled
  13454. * selector function built with Sizzle.compile
  13455. * @param {Element} context
  13456. * @param {Array} [results]
  13457. * @param {Array} [seed] A set of elements to match against
  13458. */
  13459. select = Sizzle.select = function( selector, context, results, seed ) {
  13460. var i, tokens, token, type, find,
  13461. compiled = typeof selector === "function" && selector,
  13462. match = !seed && tokenize( ( selector = compiled.selector || selector ) );
  13463. results = results || [];
  13464. // Try to minimize operations if there is only one selector in the list and no seed
  13465. // (the latter of which guarantees us context)
  13466. if ( match.length === 1 ) {
  13467. // Reduce context if the leading compound selector is an ID
  13468. tokens = match[ 0 ] = match[ 0 ].slice( 0 );
  13469. if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" &&
  13470. context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) {
  13471. context = ( Expr.find[ "ID" ]( token.matches[ 0 ]
  13472. .replace( runescape, funescape ), context ) || [] )[ 0 ];
  13473. if ( !context ) {
  13474. return results;
  13475. // Precompiled matchers will still verify ancestry, so step up a level
  13476. } else if ( compiled ) {
  13477. context = context.parentNode;
  13478. }
  13479. selector = selector.slice( tokens.shift().value.length );
  13480. }
  13481. // Fetch a seed set for right-to-left matching
  13482. i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length;
  13483. while ( i-- ) {
  13484. token = tokens[ i ];
  13485. // Abort if we hit a combinator
  13486. if ( Expr.relative[ ( type = token.type ) ] ) {
  13487. break;
  13488. }
  13489. if ( ( find = Expr.find[ type ] ) ) {
  13490. // Search, expanding context for leading sibling combinators
  13491. if ( ( seed = find(
  13492. token.matches[ 0 ].replace( runescape, funescape ),
  13493. rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) ||
  13494. context
  13495. ) ) ) {
  13496. // If seed is empty or no tokens remain, we can return early
  13497. tokens.splice( i, 1 );
  13498. selector = seed.length && toSelector( tokens );
  13499. if ( !selector ) {
  13500. push.apply( results, seed );
  13501. return results;
  13502. }
  13503. break;
  13504. }
  13505. }
  13506. }
  13507. }
  13508. // Compile and execute a filtering function if one is not provided
  13509. // Provide `match` to avoid retokenization if we modified the selector above
  13510. ( compiled || compile( selector, match ) )(
  13511. seed,
  13512. context,
  13513. !documentIsHTML,
  13514. results,
  13515. !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
  13516. );
  13517. return results;
  13518. };
  13519. // One-time assignments
  13520. // Sort stability
  13521. support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando;
  13522. // Support: Chrome 14-35+
  13523. // Always assume duplicates if they aren't passed to the comparison function
  13524. support.detectDuplicates = !!hasDuplicate;
  13525. // Initialize against the default document
  13526. setDocument();
  13527. // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
  13528. // Detached nodes confoundingly follow *each other*
  13529. support.sortDetached = assert( function( el ) {
  13530. // Should return 1, but returns 4 (following)
  13531. return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1;
  13532. } );
  13533. // Support: IE<8
  13534. // Prevent attribute/property "interpolation"
  13535. // https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
  13536. if ( !assert( function( el ) {
  13537. el.innerHTML = "<a href='#'></a>";
  13538. return el.firstChild.getAttribute( "href" ) === "#";
  13539. } ) ) {
  13540. addHandle( "type|href|height|width", function( elem, name, isXML ) {
  13541. if ( !isXML ) {
  13542. return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
  13543. }
  13544. } );
  13545. }
  13546. // Support: IE<9
  13547. // Use defaultValue in place of getAttribute("value")
  13548. if ( !support.attributes || !assert( function( el ) {
  13549. el.innerHTML = "<input/>";
  13550. el.firstChild.setAttribute( "value", "" );
  13551. return el.firstChild.getAttribute( "value" ) === "";
  13552. } ) ) {
  13553. addHandle( "value", function( elem, _name, isXML ) {
  13554. if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
  13555. return elem.defaultValue;
  13556. }
  13557. } );
  13558. }
  13559. // Support: IE<9
  13560. // Use getAttributeNode to fetch booleans when getAttribute lies
  13561. if ( !assert( function( el ) {
  13562. return el.getAttribute( "disabled" ) == null;
  13563. } ) ) {
  13564. addHandle( booleans, function( elem, name, isXML ) {
  13565. var val;
  13566. if ( !isXML ) {
  13567. return elem[ name ] === true ? name.toLowerCase() :
  13568. ( val = elem.getAttributeNode( name ) ) && val.specified ?
  13569. val.value :
  13570. null;
  13571. }
  13572. } );
  13573. }
  13574. return Sizzle;
  13575. } )( window );
  13576. jQuery.find = Sizzle;
  13577. jQuery.expr = Sizzle.selectors;
  13578. // Deprecated
  13579. jQuery.expr[ ":" ] = jQuery.expr.pseudos;
  13580. jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
  13581. jQuery.text = Sizzle.getText;
  13582. jQuery.isXMLDoc = Sizzle.isXML;
  13583. jQuery.contains = Sizzle.contains;
  13584. jQuery.escapeSelector = Sizzle.escape;
  13585. var dir = function( elem, dir, until ) {
  13586. var matched = [],
  13587. truncate = until !== undefined;
  13588. while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
  13589. if ( elem.nodeType === 1 ) {
  13590. if ( truncate && jQuery( elem ).is( until ) ) {
  13591. break;
  13592. }
  13593. matched.push( elem );
  13594. }
  13595. }
  13596. return matched;
  13597. };
  13598. var siblings = function( n, elem ) {
  13599. var matched = [];
  13600. for ( ; n; n = n.nextSibling ) {
  13601. if ( n.nodeType === 1 && n !== elem ) {
  13602. matched.push( n );
  13603. }
  13604. }
  13605. return matched;
  13606. };
  13607. var rneedsContext = jQuery.expr.match.needsContext;
  13608. function nodeName( elem, name ) {
  13609. return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  13610. };
  13611. var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
  13612. // Implement the identical functionality for filter and not
  13613. function winnow( elements, qualifier, not ) {
  13614. if ( isFunction( qualifier ) ) {
  13615. return jQuery.grep( elements, function( elem, i ) {
  13616. return !!qualifier.call( elem, i, elem ) !== not;
  13617. } );
  13618. }
  13619. // Single element
  13620. if ( qualifier.nodeType ) {
  13621. return jQuery.grep( elements, function( elem ) {
  13622. return ( elem === qualifier ) !== not;
  13623. } );
  13624. }
  13625. // Arraylike of elements (jQuery, arguments, Array)
  13626. if ( typeof qualifier !== "string" ) {
  13627. return jQuery.grep( elements, function( elem ) {
  13628. return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
  13629. } );
  13630. }
  13631. // Filtered directly for both simple and complex selectors
  13632. return jQuery.filter( qualifier, elements, not );
  13633. }
  13634. jQuery.filter = function( expr, elems, not ) {
  13635. var elem = elems[ 0 ];
  13636. if ( not ) {
  13637. expr = ":not(" + expr + ")";
  13638. }
  13639. if ( elems.length === 1 && elem.nodeType === 1 ) {
  13640. return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
  13641. }
  13642. return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
  13643. return elem.nodeType === 1;
  13644. } ) );
  13645. };
  13646. jQuery.fn.extend( {
  13647. find: function( selector ) {
  13648. var i, ret,
  13649. len = this.length,
  13650. self = this;
  13651. if ( typeof selector !== "string" ) {
  13652. return this.pushStack( jQuery( selector ).filter( function() {
  13653. for ( i = 0; i < len; i++ ) {
  13654. if ( jQuery.contains( self[ i ], this ) ) {
  13655. return true;
  13656. }
  13657. }
  13658. } ) );
  13659. }
  13660. ret = this.pushStack( [] );
  13661. for ( i = 0; i < len; i++ ) {
  13662. jQuery.find( selector, self[ i ], ret );
  13663. }
  13664. return len > 1 ? jQuery.uniqueSort( ret ) : ret;
  13665. },
  13666. filter: function( selector ) {
  13667. return this.pushStack( winnow( this, selector || [], false ) );
  13668. },
  13669. not: function( selector ) {
  13670. return this.pushStack( winnow( this, selector || [], true ) );
  13671. },
  13672. is: function( selector ) {
  13673. return !!winnow(
  13674. this,
  13675. // If this is a positional/relative selector, check membership in the returned set
  13676. // so $("p:first").is("p:last") won't return true for a doc with two "p".
  13677. typeof selector === "string" && rneedsContext.test( selector ) ?
  13678. jQuery( selector ) :
  13679. selector || [],
  13680. false
  13681. ).length;
  13682. }
  13683. } );
  13684. // Initialize a jQuery object
  13685. // A central reference to the root jQuery(document)
  13686. var rootjQuery,
  13687. // A simple way to check for HTML strings
  13688. // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
  13689. // Strict HTML recognition (#11290: must start with <)
  13690. // Shortcut simple #id case for speed
  13691. rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
  13692. init = jQuery.fn.init = function( selector, context, root ) {
  13693. var match, elem;
  13694. // HANDLE: $(""), $(null), $(undefined), $(false)
  13695. if ( !selector ) {
  13696. return this;
  13697. }
  13698. // Method init() accepts an alternate rootjQuery
  13699. // so migrate can support jQuery.sub (gh-2101)
  13700. root = root || rootjQuery;
  13701. // Handle HTML strings
  13702. if ( typeof selector === "string" ) {
  13703. if ( selector[ 0 ] === "<" &&
  13704. selector[ selector.length - 1 ] === ">" &&
  13705. selector.length >= 3 ) {
  13706. // Assume that strings that start and end with <> are HTML and skip the regex check
  13707. match = [ null, selector, null ];
  13708. } else {
  13709. match = rquickExpr.exec( selector );
  13710. }
  13711. // Match html or make sure no context is specified for #id
  13712. if ( match && ( match[ 1 ] || !context ) ) {
  13713. // HANDLE: $(html) -> $(array)
  13714. if ( match[ 1 ] ) {
  13715. context = context instanceof jQuery ? context[ 0 ] : context;
  13716. // Option to run scripts is true for back-compat
  13717. // Intentionally let the error be thrown if parseHTML is not present
  13718. jQuery.merge( this, jQuery.parseHTML(
  13719. match[ 1 ],
  13720. context && context.nodeType ? context.ownerDocument || context : document,
  13721. true
  13722. ) );
  13723. // HANDLE: $(html, props)
  13724. if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
  13725. for ( match in context ) {
  13726. // Properties of context are called as methods if possible
  13727. if ( isFunction( this[ match ] ) ) {
  13728. this[ match ]( context[ match ] );
  13729. // ...and otherwise set as attributes
  13730. } else {
  13731. this.attr( match, context[ match ] );
  13732. }
  13733. }
  13734. }
  13735. return this;
  13736. // HANDLE: $(#id)
  13737. } else {
  13738. elem = document.getElementById( match[ 2 ] );
  13739. if ( elem ) {
  13740. // Inject the element directly into the jQuery object
  13741. this[ 0 ] = elem;
  13742. this.length = 1;
  13743. }
  13744. return this;
  13745. }
  13746. // HANDLE: $(expr, $(...))
  13747. } else if ( !context || context.jquery ) {
  13748. return ( context || root ).find( selector );
  13749. // HANDLE: $(expr, context)
  13750. // (which is just equivalent to: $(context).find(expr)
  13751. } else {
  13752. return this.constructor( context ).find( selector );
  13753. }
  13754. // HANDLE: $(DOMElement)
  13755. } else if ( selector.nodeType ) {
  13756. this[ 0 ] = selector;
  13757. this.length = 1;
  13758. return this;
  13759. // HANDLE: $(function)
  13760. // Shortcut for document ready
  13761. } else if ( isFunction( selector ) ) {
  13762. return root.ready !== undefined ?
  13763. root.ready( selector ) :
  13764. // Execute immediately if ready is not present
  13765. selector( jQuery );
  13766. }
  13767. return jQuery.makeArray( selector, this );
  13768. };
  13769. // Give the init function the jQuery prototype for later instantiation
  13770. init.prototype = jQuery.fn;
  13771. // Initialize central reference
  13772. rootjQuery = jQuery( document );
  13773. var rparentsprev = /^(?:parents|prev(?:Until|All))/,
  13774. // Methods guaranteed to produce a unique set when starting from a unique set
  13775. guaranteedUnique = {
  13776. children: true,
  13777. contents: true,
  13778. next: true,
  13779. prev: true
  13780. };
  13781. jQuery.fn.extend( {
  13782. has: function( target ) {
  13783. var targets = jQuery( target, this ),
  13784. l = targets.length;
  13785. return this.filter( function() {
  13786. var i = 0;
  13787. for ( ; i < l; i++ ) {
  13788. if ( jQuery.contains( this, targets[ i ] ) ) {
  13789. return true;
  13790. }
  13791. }
  13792. } );
  13793. },
  13794. closest: function( selectors, context ) {
  13795. var cur,
  13796. i = 0,
  13797. l = this.length,
  13798. matched = [],
  13799. targets = typeof selectors !== "string" && jQuery( selectors );
  13800. // Positional selectors never match, since there's no _selection_ context
  13801. if ( !rneedsContext.test( selectors ) ) {
  13802. for ( ; i < l; i++ ) {
  13803. for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
  13804. // Always skip document fragments
  13805. if ( cur.nodeType < 11 && ( targets ?
  13806. targets.index( cur ) > -1 :
  13807. // Don't pass non-elements to Sizzle
  13808. cur.nodeType === 1 &&
  13809. jQuery.find.matchesSelector( cur, selectors ) ) ) {
  13810. matched.push( cur );
  13811. break;
  13812. }
  13813. }
  13814. }
  13815. }
  13816. return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
  13817. },
  13818. // Determine the position of an element within the set
  13819. index: function( elem ) {
  13820. // No argument, return index in parent
  13821. if ( !elem ) {
  13822. return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
  13823. }
  13824. // Index in selector
  13825. if ( typeof elem === "string" ) {
  13826. return indexOf.call( jQuery( elem ), this[ 0 ] );
  13827. }
  13828. // Locate the position of the desired element
  13829. return indexOf.call( this,
  13830. // If it receives a jQuery object, the first element is used
  13831. elem.jquery ? elem[ 0 ] : elem
  13832. );
  13833. },
  13834. add: function( selector, context ) {
  13835. return this.pushStack(
  13836. jQuery.uniqueSort(
  13837. jQuery.merge( this.get(), jQuery( selector, context ) )
  13838. )
  13839. );
  13840. },
  13841. addBack: function( selector ) {
  13842. return this.add( selector == null ?
  13843. this.prevObject : this.prevObject.filter( selector )
  13844. );
  13845. }
  13846. } );
  13847. function sibling( cur, dir ) {
  13848. while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
  13849. return cur;
  13850. }
  13851. jQuery.each( {
  13852. parent: function( elem ) {
  13853. var parent = elem.parentNode;
  13854. return parent && parent.nodeType !== 11 ? parent : null;
  13855. },
  13856. parents: function( elem ) {
  13857. return dir( elem, "parentNode" );
  13858. },
  13859. parentsUntil: function( elem, _i, until ) {
  13860. return dir( elem, "parentNode", until );
  13861. },
  13862. next: function( elem ) {
  13863. return sibling( elem, "nextSibling" );
  13864. },
  13865. prev: function( elem ) {
  13866. return sibling( elem, "previousSibling" );
  13867. },
  13868. nextAll: function( elem ) {
  13869. return dir( elem, "nextSibling" );
  13870. },
  13871. prevAll: function( elem ) {
  13872. return dir( elem, "previousSibling" );
  13873. },
  13874. nextUntil: function( elem, _i, until ) {
  13875. return dir( elem, "nextSibling", until );
  13876. },
  13877. prevUntil: function( elem, _i, until ) {
  13878. return dir( elem, "previousSibling", until );
  13879. },
  13880. siblings: function( elem ) {
  13881. return siblings( ( elem.parentNode || {} ).firstChild, elem );
  13882. },
  13883. children: function( elem ) {
  13884. return siblings( elem.firstChild );
  13885. },
  13886. contents: function( elem ) {
  13887. if ( elem.contentDocument != null &&
  13888. // Support: IE 11+
  13889. // <object> elements with no `data` attribute has an object
  13890. // `contentDocument` with a `null` prototype.
  13891. getProto( elem.contentDocument ) ) {
  13892. return elem.contentDocument;
  13893. }
  13894. // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only
  13895. // Treat the template element as a regular one in browsers that
  13896. // don't support it.
  13897. if ( nodeName( elem, "template" ) ) {
  13898. elem = elem.content || elem;
  13899. }
  13900. return jQuery.merge( [], elem.childNodes );
  13901. }
  13902. }, function( name, fn ) {
  13903. jQuery.fn[ name ] = function( until, selector ) {
  13904. var matched = jQuery.map( this, fn, until );
  13905. if ( name.slice( -5 ) !== "Until" ) {
  13906. selector = until;
  13907. }
  13908. if ( selector && typeof selector === "string" ) {
  13909. matched = jQuery.filter( selector, matched );
  13910. }
  13911. if ( this.length > 1 ) {
  13912. // Remove duplicates
  13913. if ( !guaranteedUnique[ name ] ) {
  13914. jQuery.uniqueSort( matched );
  13915. }
  13916. // Reverse order for parents* and prev-derivatives
  13917. if ( rparentsprev.test( name ) ) {
  13918. matched.reverse();
  13919. }
  13920. }
  13921. return this.pushStack( matched );
  13922. };
  13923. } );
  13924. var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
  13925. // Convert String-formatted options into Object-formatted ones
  13926. function createOptions( options ) {
  13927. var object = {};
  13928. jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
  13929. object[ flag ] = true;
  13930. } );
  13931. return object;
  13932. }
  13933. /*
  13934. * Create a callback list using the following parameters:
  13935. *
  13936. * options: an optional list of space-separated options that will change how
  13937. * the callback list behaves or a more traditional option object
  13938. *
  13939. * By default a callback list will act like an event callback list and can be
  13940. * "fired" multiple times.
  13941. *
  13942. * Possible options:
  13943. *
  13944. * once: will ensure the callback list can only be fired once (like a Deferred)
  13945. *
  13946. * memory: will keep track of previous values and will call any callback added
  13947. * after the list has been fired right away with the latest "memorized"
  13948. * values (like a Deferred)
  13949. *
  13950. * unique: will ensure a callback can only be added once (no duplicate in the list)
  13951. *
  13952. * stopOnFalse: interrupt callings when a callback returns false
  13953. *
  13954. */
  13955. jQuery.Callbacks = function( options ) {
  13956. // Convert options from String-formatted to Object-formatted if needed
  13957. // (we check in cache first)
  13958. options = typeof options === "string" ?
  13959. createOptions( options ) :
  13960. jQuery.extend( {}, options );
  13961. var // Flag to know if list is currently firing
  13962. firing,
  13963. // Last fire value for non-forgettable lists
  13964. memory,
  13965. // Flag to know if list was already fired
  13966. fired,
  13967. // Flag to prevent firing
  13968. locked,
  13969. // Actual callback list
  13970. list = [],
  13971. // Queue of execution data for repeatable lists
  13972. queue = [],
  13973. // Index of currently firing callback (modified by add/remove as needed)
  13974. firingIndex = -1,
  13975. // Fire callbacks
  13976. fire = function() {
  13977. // Enforce single-firing
  13978. locked = locked || options.once;
  13979. // Execute callbacks for all pending executions,
  13980. // respecting firingIndex overrides and runtime changes
  13981. fired = firing = true;
  13982. for ( ; queue.length; firingIndex = -1 ) {
  13983. memory = queue.shift();
  13984. while ( ++firingIndex < list.length ) {
  13985. // Run callback and check for early termination
  13986. if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
  13987. options.stopOnFalse ) {
  13988. // Jump to end and forget the data so .add doesn't re-fire
  13989. firingIndex = list.length;
  13990. memory = false;
  13991. }
  13992. }
  13993. }
  13994. // Forget the data if we're done with it
  13995. if ( !options.memory ) {
  13996. memory = false;
  13997. }
  13998. firing = false;
  13999. // Clean up if we're done firing for good
  14000. if ( locked ) {
  14001. // Keep an empty list if we have data for future add calls
  14002. if ( memory ) {
  14003. list = [];
  14004. // Otherwise, this object is spent
  14005. } else {
  14006. list = "";
  14007. }
  14008. }
  14009. },
  14010. // Actual Callbacks object
  14011. self = {
  14012. // Add a callback or a collection of callbacks to the list
  14013. add: function() {
  14014. if ( list ) {
  14015. // If we have memory from a past run, we should fire after adding
  14016. if ( memory && !firing ) {
  14017. firingIndex = list.length - 1;
  14018. queue.push( memory );
  14019. }
  14020. ( function add( args ) {
  14021. jQuery.each( args, function( _, arg ) {
  14022. if ( isFunction( arg ) ) {
  14023. if ( !options.unique || !self.has( arg ) ) {
  14024. list.push( arg );
  14025. }
  14026. } else if ( arg && arg.length && toType( arg ) !== "string" ) {
  14027. // Inspect recursively
  14028. add( arg );
  14029. }
  14030. } );
  14031. } )( arguments );
  14032. if ( memory && !firing ) {
  14033. fire();
  14034. }
  14035. }
  14036. return this;
  14037. },
  14038. // Remove a callback from the list
  14039. remove: function() {
  14040. jQuery.each( arguments, function( _, arg ) {
  14041. var index;
  14042. while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
  14043. list.splice( index, 1 );
  14044. // Handle firing indexes
  14045. if ( index <= firingIndex ) {
  14046. firingIndex--;
  14047. }
  14048. }
  14049. } );
  14050. return this;
  14051. },
  14052. // Check if a given callback is in the list.
  14053. // If no argument is given, return whether or not list has callbacks attached.
  14054. has: function( fn ) {
  14055. return fn ?
  14056. jQuery.inArray( fn, list ) > -1 :
  14057. list.length > 0;
  14058. },
  14059. // Remove all callbacks from the list
  14060. empty: function() {
  14061. if ( list ) {
  14062. list = [];
  14063. }
  14064. return this;
  14065. },
  14066. // Disable .fire and .add
  14067. // Abort any current/pending executions
  14068. // Clear all callbacks and values
  14069. disable: function() {
  14070. locked = queue = [];
  14071. list = memory = "";
  14072. return this;
  14073. },
  14074. disabled: function() {
  14075. return !list;
  14076. },
  14077. // Disable .fire
  14078. // Also disable .add unless we have memory (since it would have no effect)
  14079. // Abort any pending executions
  14080. lock: function() {
  14081. locked = queue = [];
  14082. if ( !memory && !firing ) {
  14083. list = memory = "";
  14084. }
  14085. return this;
  14086. },
  14087. locked: function() {
  14088. return !!locked;
  14089. },
  14090. // Call all callbacks with the given context and arguments
  14091. fireWith: function( context, args ) {
  14092. if ( !locked ) {
  14093. args = args || [];
  14094. args = [ context, args.slice ? args.slice() : args ];
  14095. queue.push( args );
  14096. if ( !firing ) {
  14097. fire();
  14098. }
  14099. }
  14100. return this;
  14101. },
  14102. // Call all the callbacks with the given arguments
  14103. fire: function() {
  14104. self.fireWith( this, arguments );
  14105. return this;
  14106. },
  14107. // To know if the callbacks have already been called at least once
  14108. fired: function() {
  14109. return !!fired;
  14110. }
  14111. };
  14112. return self;
  14113. };
  14114. function Identity( v ) {
  14115. return v;
  14116. }
  14117. function Thrower( ex ) {
  14118. throw ex;
  14119. }
  14120. function adoptValue( value, resolve, reject, noValue ) {
  14121. var method;
  14122. try {
  14123. // Check for promise aspect first to privilege synchronous behavior
  14124. if ( value && isFunction( ( method = value.promise ) ) ) {
  14125. method.call( value ).done( resolve ).fail( reject );
  14126. // Other thenables
  14127. } else if ( value && isFunction( ( method = value.then ) ) ) {
  14128. method.call( value, resolve, reject );
  14129. // Other non-thenables
  14130. } else {
  14131. // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:
  14132. // * false: [ value ].slice( 0 ) => resolve( value )
  14133. // * true: [ value ].slice( 1 ) => resolve()
  14134. resolve.apply( undefined, [ value ].slice( noValue ) );
  14135. }
  14136. // For Promises/A+, convert exceptions into rejections
  14137. // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
  14138. // Deferred#then to conditionally suppress rejection.
  14139. } catch ( value ) {
  14140. // Support: Android 4.0 only
  14141. // Strict mode functions invoked without .call/.apply get global-object context
  14142. reject.apply( undefined, [ value ] );
  14143. }
  14144. }
  14145. jQuery.extend( {
  14146. Deferred: function( func ) {
  14147. var tuples = [
  14148. // action, add listener, callbacks,
  14149. // ... .then handlers, argument index, [final state]
  14150. [ "notify", "progress", jQuery.Callbacks( "memory" ),
  14151. jQuery.Callbacks( "memory" ), 2 ],
  14152. [ "resolve", "done", jQuery.Callbacks( "once memory" ),
  14153. jQuery.Callbacks( "once memory" ), 0, "resolved" ],
  14154. [ "reject", "fail", jQuery.Callbacks( "once memory" ),
  14155. jQuery.Callbacks( "once memory" ), 1, "rejected" ]
  14156. ],
  14157. state = "pending",
  14158. promise = {
  14159. state: function() {
  14160. return state;
  14161. },
  14162. always: function() {
  14163. deferred.done( arguments ).fail( arguments );
  14164. return this;
  14165. },
  14166. "catch": function( fn ) {
  14167. return promise.then( null, fn );
  14168. },
  14169. // Keep pipe for back-compat
  14170. pipe: function( /* fnDone, fnFail, fnProgress */ ) {
  14171. var fns = arguments;
  14172. return jQuery.Deferred( function( newDefer ) {
  14173. jQuery.each( tuples, function( _i, tuple ) {
  14174. // Map tuples (progress, done, fail) to arguments (done, fail, progress)
  14175. var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
  14176. // deferred.progress(function() { bind to newDefer or newDefer.notify })
  14177. // deferred.done(function() { bind to newDefer or newDefer.resolve })
  14178. // deferred.fail(function() { bind to newDefer or newDefer.reject })
  14179. deferred[ tuple[ 1 ] ]( function() {
  14180. var returned = fn && fn.apply( this, arguments );
  14181. if ( returned && isFunction( returned.promise ) ) {
  14182. returned.promise()
  14183. .progress( newDefer.notify )
  14184. .done( newDefer.resolve )
  14185. .fail( newDefer.reject );
  14186. } else {
  14187. newDefer[ tuple[ 0 ] + "With" ](
  14188. this,
  14189. fn ? [ returned ] : arguments
  14190. );
  14191. }
  14192. } );
  14193. } );
  14194. fns = null;
  14195. } ).promise();
  14196. },
  14197. then: function( onFulfilled, onRejected, onProgress ) {
  14198. var maxDepth = 0;
  14199. function resolve( depth, deferred, handler, special ) {
  14200. return function() {
  14201. var that = this,
  14202. args = arguments,
  14203. mightThrow = function() {
  14204. var returned, then;
  14205. // Support: Promises/A+ section 2.3.3.3.3
  14206. // https://promisesaplus.com/#point-59
  14207. // Ignore double-resolution attempts
  14208. if ( depth < maxDepth ) {
  14209. return;
  14210. }
  14211. returned = handler.apply( that, args );
  14212. // Support: Promises/A+ section 2.3.1
  14213. // https://promisesaplus.com/#point-48
  14214. if ( returned === deferred.promise() ) {
  14215. throw new TypeError( "Thenable self-resolution" );
  14216. }
  14217. // Support: Promises/A+ sections 2.3.3.1, 3.5
  14218. // https://promisesaplus.com/#point-54
  14219. // https://promisesaplus.com/#point-75
  14220. // Retrieve `then` only once
  14221. then = returned &&
  14222. // Support: Promises/A+ section 2.3.4
  14223. // https://promisesaplus.com/#point-64
  14224. // Only check objects and functions for thenability
  14225. ( typeof returned === "object" ||
  14226. typeof returned === "function" ) &&
  14227. returned.then;
  14228. // Handle a returned thenable
  14229. if ( isFunction( then ) ) {
  14230. // Special processors (notify) just wait for resolution
  14231. if ( special ) {
  14232. then.call(
  14233. returned,
  14234. resolve( maxDepth, deferred, Identity, special ),
  14235. resolve( maxDepth, deferred, Thrower, special )
  14236. );
  14237. // Normal processors (resolve) also hook into progress
  14238. } else {
  14239. // ...and disregard older resolution values
  14240. maxDepth++;
  14241. then.call(
  14242. returned,
  14243. resolve( maxDepth, deferred, Identity, special ),
  14244. resolve( maxDepth, deferred, Thrower, special ),
  14245. resolve( maxDepth, deferred, Identity,
  14246. deferred.notifyWith )
  14247. );
  14248. }
  14249. // Handle all other returned values
  14250. } else {
  14251. // Only substitute handlers pass on context
  14252. // and multiple values (non-spec behavior)
  14253. if ( handler !== Identity ) {
  14254. that = undefined;
  14255. args = [ returned ];
  14256. }
  14257. // Process the value(s)
  14258. // Default process is resolve
  14259. ( special || deferred.resolveWith )( that, args );
  14260. }
  14261. },
  14262. // Only normal processors (resolve) catch and reject exceptions
  14263. process = special ?
  14264. mightThrow :
  14265. function() {
  14266. try {
  14267. mightThrow();
  14268. } catch ( e ) {
  14269. if ( jQuery.Deferred.exceptionHook ) {
  14270. jQuery.Deferred.exceptionHook( e,
  14271. process.stackTrace );
  14272. }
  14273. // Support: Promises/A+ section 2.3.3.3.4.1
  14274. // https://promisesaplus.com/#point-61
  14275. // Ignore post-resolution exceptions
  14276. if ( depth + 1 >= maxDepth ) {
  14277. // Only substitute handlers pass on context
  14278. // and multiple values (non-spec behavior)
  14279. if ( handler !== Thrower ) {
  14280. that = undefined;
  14281. args = [ e ];
  14282. }
  14283. deferred.rejectWith( that, args );
  14284. }
  14285. }
  14286. };
  14287. // Support: Promises/A+ section 2.3.3.3.1
  14288. // https://promisesaplus.com/#point-57
  14289. // Re-resolve promises immediately to dodge false rejection from
  14290. // subsequent errors
  14291. if ( depth ) {
  14292. process();
  14293. } else {
  14294. // Call an optional hook to record the stack, in case of exception
  14295. // since it's otherwise lost when execution goes async
  14296. if ( jQuery.Deferred.getStackHook ) {
  14297. process.stackTrace = jQuery.Deferred.getStackHook();
  14298. }
  14299. window.setTimeout( process );
  14300. }
  14301. };
  14302. }
  14303. return jQuery.Deferred( function( newDefer ) {
  14304. // progress_handlers.add( ... )
  14305. tuples[ 0 ][ 3 ].add(
  14306. resolve(
  14307. 0,
  14308. newDefer,
  14309. isFunction( onProgress ) ?
  14310. onProgress :
  14311. Identity,
  14312. newDefer.notifyWith
  14313. )
  14314. );
  14315. // fulfilled_handlers.add( ... )
  14316. tuples[ 1 ][ 3 ].add(
  14317. resolve(
  14318. 0,
  14319. newDefer,
  14320. isFunction( onFulfilled ) ?
  14321. onFulfilled :
  14322. Identity
  14323. )
  14324. );
  14325. // rejected_handlers.add( ... )
  14326. tuples[ 2 ][ 3 ].add(
  14327. resolve(
  14328. 0,
  14329. newDefer,
  14330. isFunction( onRejected ) ?
  14331. onRejected :
  14332. Thrower
  14333. )
  14334. );
  14335. } ).promise();
  14336. },
  14337. // Get a promise for this deferred
  14338. // If obj is provided, the promise aspect is added to the object
  14339. promise: function( obj ) {
  14340. return obj != null ? jQuery.extend( obj, promise ) : promise;
  14341. }
  14342. },
  14343. deferred = {};
  14344. // Add list-specific methods
  14345. jQuery.each( tuples, function( i, tuple ) {
  14346. var list = tuple[ 2 ],
  14347. stateString = tuple[ 5 ];
  14348. // promise.progress = list.add
  14349. // promise.done = list.add
  14350. // promise.fail = list.add
  14351. promise[ tuple[ 1 ] ] = list.add;
  14352. // Handle state
  14353. if ( stateString ) {
  14354. list.add(
  14355. function() {
  14356. // state = "resolved" (i.e., fulfilled)
  14357. // state = "rejected"
  14358. state = stateString;
  14359. },
  14360. // rejected_callbacks.disable
  14361. // fulfilled_callbacks.disable
  14362. tuples[ 3 - i ][ 2 ].disable,
  14363. // rejected_handlers.disable
  14364. // fulfilled_handlers.disable
  14365. tuples[ 3 - i ][ 3 ].disable,
  14366. // progress_callbacks.lock
  14367. tuples[ 0 ][ 2 ].lock,
  14368. // progress_handlers.lock
  14369. tuples[ 0 ][ 3 ].lock
  14370. );
  14371. }
  14372. // progress_handlers.fire
  14373. // fulfilled_handlers.fire
  14374. // rejected_handlers.fire
  14375. list.add( tuple[ 3 ].fire );
  14376. // deferred.notify = function() { deferred.notifyWith(...) }
  14377. // deferred.resolve = function() { deferred.resolveWith(...) }
  14378. // deferred.reject = function() { deferred.rejectWith(...) }
  14379. deferred[ tuple[ 0 ] ] = function() {
  14380. deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
  14381. return this;
  14382. };
  14383. // deferred.notifyWith = list.fireWith
  14384. // deferred.resolveWith = list.fireWith
  14385. // deferred.rejectWith = list.fireWith
  14386. deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
  14387. } );
  14388. // Make the deferred a promise
  14389. promise.promise( deferred );
  14390. // Call given func if any
  14391. if ( func ) {
  14392. func.call( deferred, deferred );
  14393. }
  14394. // All done!
  14395. return deferred;
  14396. },
  14397. // Deferred helper
  14398. when: function( singleValue ) {
  14399. var
  14400. // count of uncompleted subordinates
  14401. remaining = arguments.length,
  14402. // count of unprocessed arguments
  14403. i = remaining,
  14404. // subordinate fulfillment data
  14405. resolveContexts = Array( i ),
  14406. resolveValues = slice.call( arguments ),
  14407. // the master Deferred
  14408. master = jQuery.Deferred(),
  14409. // subordinate callback factory
  14410. updateFunc = function( i ) {
  14411. return function( value ) {
  14412. resolveContexts[ i ] = this;
  14413. resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
  14414. if ( !( --remaining ) ) {
  14415. master.resolveWith( resolveContexts, resolveValues );
  14416. }
  14417. };
  14418. };
  14419. // Single- and empty arguments are adopted like Promise.resolve
  14420. if ( remaining <= 1 ) {
  14421. adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject,
  14422. !remaining );
  14423. // Use .then() to unwrap secondary thenables (cf. gh-3000)
  14424. if ( master.state() === "pending" ||
  14425. isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
  14426. return master.then();
  14427. }
  14428. }
  14429. // Multiple arguments are aggregated like Promise.all array elements
  14430. while ( i-- ) {
  14431. adoptValue( resolveValues[ i ], updateFunc( i ), master.reject );
  14432. }
  14433. return master.promise();
  14434. }
  14435. } );
  14436. // These usually indicate a programmer mistake during development,
  14437. // warn about them ASAP rather than swallowing them by default.
  14438. var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
  14439. jQuery.Deferred.exceptionHook = function( error, stack ) {
  14440. // Support: IE 8 - 9 only
  14441. // Console exists when dev tools are open, which can happen at any time
  14442. if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
  14443. window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );
  14444. }
  14445. };
  14446. jQuery.readyException = function( error ) {
  14447. window.setTimeout( function() {
  14448. throw error;
  14449. } );
  14450. };
  14451. // The deferred used on DOM ready
  14452. var readyList = jQuery.Deferred();
  14453. jQuery.fn.ready = function( fn ) {
  14454. readyList
  14455. .then( fn )
  14456. // Wrap jQuery.readyException in a function so that the lookup
  14457. // happens at the time of error handling instead of callback
  14458. // registration.
  14459. .catch( function( error ) {
  14460. jQuery.readyException( error );
  14461. } );
  14462. return this;
  14463. };
  14464. jQuery.extend( {
  14465. // Is the DOM ready to be used? Set to true once it occurs.
  14466. isReady: false,
  14467. // A counter to track how many items to wait for before
  14468. // the ready event fires. See #6781
  14469. readyWait: 1,
  14470. // Handle when the DOM is ready
  14471. ready: function( wait ) {
  14472. // Abort if there are pending holds or we're already ready
  14473. if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
  14474. return;
  14475. }
  14476. // Remember that the DOM is ready
  14477. jQuery.isReady = true;
  14478. // If a normal DOM Ready event fired, decrement, and wait if need be
  14479. if ( wait !== true && --jQuery.readyWait > 0 ) {
  14480. return;
  14481. }
  14482. // If there are functions bound, to execute
  14483. readyList.resolveWith( document, [ jQuery ] );
  14484. }
  14485. } );
  14486. jQuery.ready.then = readyList.then;
  14487. // The ready event handler and self cleanup method
  14488. function completed() {
  14489. document.removeEventListener( "DOMContentLoaded", completed );
  14490. window.removeEventListener( "load", completed );
  14491. jQuery.ready();
  14492. }
  14493. // Catch cases where $(document).ready() is called
  14494. // after the browser event has already occurred.
  14495. // Support: IE <=9 - 10 only
  14496. // Older IE sometimes signals "interactive" too soon
  14497. if ( document.readyState === "complete" ||
  14498. ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
  14499. // Handle it asynchronously to allow scripts the opportunity to delay ready
  14500. window.setTimeout( jQuery.ready );
  14501. } else {
  14502. // Use the handy event callback
  14503. document.addEventListener( "DOMContentLoaded", completed );
  14504. // A fallback to window.onload, that will always work
  14505. window.addEventListener( "load", completed );
  14506. }
  14507. // Multifunctional method to get and set values of a collection
  14508. // The value/s can optionally be executed if it's a function
  14509. var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
  14510. var i = 0,
  14511. len = elems.length,
  14512. bulk = key == null;
  14513. // Sets many values
  14514. if ( toType( key ) === "object" ) {
  14515. chainable = true;
  14516. for ( i in key ) {
  14517. access( elems, fn, i, key[ i ], true, emptyGet, raw );
  14518. }
  14519. // Sets one value
  14520. } else if ( value !== undefined ) {
  14521. chainable = true;
  14522. if ( !isFunction( value ) ) {
  14523. raw = true;
  14524. }
  14525. if ( bulk ) {
  14526. // Bulk operations run against the entire set
  14527. if ( raw ) {
  14528. fn.call( elems, value );
  14529. fn = null;
  14530. // ...except when executing function values
  14531. } else {
  14532. bulk = fn;
  14533. fn = function( elem, _key, value ) {
  14534. return bulk.call( jQuery( elem ), value );
  14535. };
  14536. }
  14537. }
  14538. if ( fn ) {
  14539. for ( ; i < len; i++ ) {
  14540. fn(
  14541. elems[ i ], key, raw ?
  14542. value :
  14543. value.call( elems[ i ], i, fn( elems[ i ], key ) )
  14544. );
  14545. }
  14546. }
  14547. }
  14548. if ( chainable ) {
  14549. return elems;
  14550. }
  14551. // Gets
  14552. if ( bulk ) {
  14553. return fn.call( elems );
  14554. }
  14555. return len ? fn( elems[ 0 ], key ) : emptyGet;
  14556. };
  14557. // Matches dashed string for camelizing
  14558. var rmsPrefix = /^-ms-/,
  14559. rdashAlpha = /-([a-z])/g;
  14560. // Used by camelCase as callback to replace()
  14561. function fcamelCase( _all, letter ) {
  14562. return letter.toUpperCase();
  14563. }
  14564. // Convert dashed to camelCase; used by the css and data modules
  14565. // Support: IE <=9 - 11, Edge 12 - 15
  14566. // Microsoft forgot to hump their vendor prefix (#9572)
  14567. function camelCase( string ) {
  14568. return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
  14569. }
  14570. var acceptData = function( owner ) {
  14571. // Accepts only:
  14572. // - Node
  14573. // - Node.ELEMENT_NODE
  14574. // - Node.DOCUMENT_NODE
  14575. // - Object
  14576. // - Any
  14577. return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
  14578. };
  14579. function Data() {
  14580. this.expando = jQuery.expando + Data.uid++;
  14581. }
  14582. Data.uid = 1;
  14583. Data.prototype = {
  14584. cache: function( owner ) {
  14585. // Check if the owner object already has a cache
  14586. var value = owner[ this.expando ];
  14587. // If not, create one
  14588. if ( !value ) {
  14589. value = {};
  14590. // We can accept data for non-element nodes in modern browsers,
  14591. // but we should not, see #8335.
  14592. // Always return an empty object.
  14593. if ( acceptData( owner ) ) {
  14594. // If it is a node unlikely to be stringify-ed or looped over
  14595. // use plain assignment
  14596. if ( owner.nodeType ) {
  14597. owner[ this.expando ] = value;
  14598. // Otherwise secure it in a non-enumerable property
  14599. // configurable must be true to allow the property to be
  14600. // deleted when data is removed
  14601. } else {
  14602. Object.defineProperty( owner, this.expando, {
  14603. value: value,
  14604. configurable: true
  14605. } );
  14606. }
  14607. }
  14608. }
  14609. return value;
  14610. },
  14611. set: function( owner, data, value ) {
  14612. var prop,
  14613. cache = this.cache( owner );
  14614. // Handle: [ owner, key, value ] args
  14615. // Always use camelCase key (gh-2257)
  14616. if ( typeof data === "string" ) {
  14617. cache[ camelCase( data ) ] = value;
  14618. // Handle: [ owner, { properties } ] args
  14619. } else {
  14620. // Copy the properties one-by-one to the cache object
  14621. for ( prop in data ) {
  14622. cache[ camelCase( prop ) ] = data[ prop ];
  14623. }
  14624. }
  14625. return cache;
  14626. },
  14627. get: function( owner, key ) {
  14628. return key === undefined ?
  14629. this.cache( owner ) :
  14630. // Always use camelCase key (gh-2257)
  14631. owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];
  14632. },
  14633. access: function( owner, key, value ) {
  14634. // In cases where either:
  14635. //
  14636. // 1. No key was specified
  14637. // 2. A string key was specified, but no value provided
  14638. //
  14639. // Take the "read" path and allow the get method to determine
  14640. // which value to return, respectively either:
  14641. //
  14642. // 1. The entire cache object
  14643. // 2. The data stored at the key
  14644. //
  14645. if ( key === undefined ||
  14646. ( ( key && typeof key === "string" ) && value === undefined ) ) {
  14647. return this.get( owner, key );
  14648. }
  14649. // When the key is not a string, or both a key and value
  14650. // are specified, set or extend (existing objects) with either:
  14651. //
  14652. // 1. An object of properties
  14653. // 2. A key and value
  14654. //
  14655. this.set( owner, key, value );
  14656. // Since the "set" path can have two possible entry points
  14657. // return the expected data based on which path was taken[*]
  14658. return value !== undefined ? value : key;
  14659. },
  14660. remove: function( owner, key ) {
  14661. var i,
  14662. cache = owner[ this.expando ];
  14663. if ( cache === undefined ) {
  14664. return;
  14665. }
  14666. if ( key !== undefined ) {
  14667. // Support array or space separated string of keys
  14668. if ( Array.isArray( key ) ) {
  14669. // If key is an array of keys...
  14670. // We always set camelCase keys, so remove that.
  14671. key = key.map( camelCase );
  14672. } else {
  14673. key = camelCase( key );
  14674. // If a key with the spaces exists, use it.
  14675. // Otherwise, create an array by matching non-whitespace
  14676. key = key in cache ?
  14677. [ key ] :
  14678. ( key.match( rnothtmlwhite ) || [] );
  14679. }
  14680. i = key.length;
  14681. while ( i-- ) {
  14682. delete cache[ key[ i ] ];
  14683. }
  14684. }
  14685. // Remove the expando if there's no more data
  14686. if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
  14687. // Support: Chrome <=35 - 45
  14688. // Webkit & Blink performance suffers when deleting properties
  14689. // from DOM nodes, so set to undefined instead
  14690. // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
  14691. if ( owner.nodeType ) {
  14692. owner[ this.expando ] = undefined;
  14693. } else {
  14694. delete owner[ this.expando ];
  14695. }
  14696. }
  14697. },
  14698. hasData: function( owner ) {
  14699. var cache = owner[ this.expando ];
  14700. return cache !== undefined && !jQuery.isEmptyObject( cache );
  14701. }
  14702. };
  14703. var dataPriv = new Data();
  14704. var dataUser = new Data();
  14705. // Implementation Summary
  14706. //
  14707. // 1. Enforce API surface and semantic compatibility with 1.9.x branch
  14708. // 2. Improve the module's maintainability by reducing the storage
  14709. // paths to a single mechanism.
  14710. // 3. Use the same single mechanism to support "private" and "user" data.
  14711. // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
  14712. // 5. Avoid exposing implementation details on user objects (eg. expando properties)
  14713. // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
  14714. var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
  14715. rmultiDash = /[A-Z]/g;
  14716. function getData( data ) {
  14717. if ( data === "true" ) {
  14718. return true;
  14719. }
  14720. if ( data === "false" ) {
  14721. return false;
  14722. }
  14723. if ( data === "null" ) {
  14724. return null;
  14725. }
  14726. // Only convert to a number if it doesn't change the string
  14727. if ( data === +data + "" ) {
  14728. return +data;
  14729. }
  14730. if ( rbrace.test( data ) ) {
  14731. return JSON.parse( data );
  14732. }
  14733. return data;
  14734. }
  14735. function dataAttr( elem, key, data ) {
  14736. var name;
  14737. // If nothing was found internally, try to fetch any
  14738. // data from the HTML5 data-* attribute
  14739. if ( data === undefined && elem.nodeType === 1 ) {
  14740. name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
  14741. data = elem.getAttribute( name );
  14742. if ( typeof data === "string" ) {
  14743. try {
  14744. data = getData( data );
  14745. } catch ( e ) {}
  14746. // Make sure we set the data so it isn't changed later
  14747. dataUser.set( elem, key, data );
  14748. } else {
  14749. data = undefined;
  14750. }
  14751. }
  14752. return data;
  14753. }
  14754. jQuery.extend( {
  14755. hasData: function( elem ) {
  14756. return dataUser.hasData( elem ) || dataPriv.hasData( elem );
  14757. },
  14758. data: function( elem, name, data ) {
  14759. return dataUser.access( elem, name, data );
  14760. },
  14761. removeData: function( elem, name ) {
  14762. dataUser.remove( elem, name );
  14763. },
  14764. // TODO: Now that all calls to _data and _removeData have been replaced
  14765. // with direct calls to dataPriv methods, these can be deprecated.
  14766. _data: function( elem, name, data ) {
  14767. return dataPriv.access( elem, name, data );
  14768. },
  14769. _removeData: function( elem, name ) {
  14770. dataPriv.remove( elem, name );
  14771. }
  14772. } );
  14773. jQuery.fn.extend( {
  14774. data: function( key, value ) {
  14775. var i, name, data,
  14776. elem = this[ 0 ],
  14777. attrs = elem && elem.attributes;
  14778. // Gets all values
  14779. if ( key === undefined ) {
  14780. if ( this.length ) {
  14781. data = dataUser.get( elem );
  14782. if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
  14783. i = attrs.length;
  14784. while ( i-- ) {
  14785. // Support: IE 11 only
  14786. // The attrs elements can be null (#14894)
  14787. if ( attrs[ i ] ) {
  14788. name = attrs[ i ].name;
  14789. if ( name.indexOf( "data-" ) === 0 ) {
  14790. name = camelCase( name.slice( 5 ) );
  14791. dataAttr( elem, name, data[ name ] );
  14792. }
  14793. }
  14794. }
  14795. dataPriv.set( elem, "hasDataAttrs", true );
  14796. }
  14797. }
  14798. return data;
  14799. }
  14800. // Sets multiple values
  14801. if ( typeof key === "object" ) {
  14802. return this.each( function() {
  14803. dataUser.set( this, key );
  14804. } );
  14805. }
  14806. return access( this, function( value ) {
  14807. var data;
  14808. // The calling jQuery object (element matches) is not empty
  14809. // (and therefore has an element appears at this[ 0 ]) and the
  14810. // `value` parameter was not undefined. An empty jQuery object
  14811. // will result in `undefined` for elem = this[ 0 ] which will
  14812. // throw an exception if an attempt to read a data cache is made.
  14813. if ( elem && value === undefined ) {
  14814. // Attempt to get data from the cache
  14815. // The key will always be camelCased in Data
  14816. data = dataUser.get( elem, key );
  14817. if ( data !== undefined ) {
  14818. return data;
  14819. }
  14820. // Attempt to "discover" the data in
  14821. // HTML5 custom data-* attrs
  14822. data = dataAttr( elem, key );
  14823. if ( data !== undefined ) {
  14824. return data;
  14825. }
  14826. // We tried really hard, but the data doesn't exist.
  14827. return;
  14828. }
  14829. // Set the data...
  14830. this.each( function() {
  14831. // We always store the camelCased key
  14832. dataUser.set( this, key, value );
  14833. } );
  14834. }, null, value, arguments.length > 1, null, true );
  14835. },
  14836. removeData: function( key ) {
  14837. return this.each( function() {
  14838. dataUser.remove( this, key );
  14839. } );
  14840. }
  14841. } );
  14842. jQuery.extend( {
  14843. queue: function( elem, type, data ) {
  14844. var queue;
  14845. if ( elem ) {
  14846. type = ( type || "fx" ) + "queue";
  14847. queue = dataPriv.get( elem, type );
  14848. // Speed up dequeue by getting out quickly if this is just a lookup
  14849. if ( data ) {
  14850. if ( !queue || Array.isArray( data ) ) {
  14851. queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
  14852. } else {
  14853. queue.push( data );
  14854. }
  14855. }
  14856. return queue || [];
  14857. }
  14858. },
  14859. dequeue: function( elem, type ) {
  14860. type = type || "fx";
  14861. var queue = jQuery.queue( elem, type ),
  14862. startLength = queue.length,
  14863. fn = queue.shift(),
  14864. hooks = jQuery._queueHooks( elem, type ),
  14865. next = function() {
  14866. jQuery.dequeue( elem, type );
  14867. };
  14868. // If the fx queue is dequeued, always remove the progress sentinel
  14869. if ( fn === "inprogress" ) {
  14870. fn = queue.shift();
  14871. startLength--;
  14872. }
  14873. if ( fn ) {
  14874. // Add a progress sentinel to prevent the fx queue from being
  14875. // automatically dequeued
  14876. if ( type === "fx" ) {
  14877. queue.unshift( "inprogress" );
  14878. }
  14879. // Clear up the last queue stop function
  14880. delete hooks.stop;
  14881. fn.call( elem, next, hooks );
  14882. }
  14883. if ( !startLength && hooks ) {
  14884. hooks.empty.fire();
  14885. }
  14886. },
  14887. // Not public - generate a queueHooks object, or return the current one
  14888. _queueHooks: function( elem, type ) {
  14889. var key = type + "queueHooks";
  14890. return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
  14891. empty: jQuery.Callbacks( "once memory" ).add( function() {
  14892. dataPriv.remove( elem, [ type + "queue", key ] );
  14893. } )
  14894. } );
  14895. }
  14896. } );
  14897. jQuery.fn.extend( {
  14898. queue: function( type, data ) {
  14899. var setter = 2;
  14900. if ( typeof type !== "string" ) {
  14901. data = type;
  14902. type = "fx";
  14903. setter--;
  14904. }
  14905. if ( arguments.length < setter ) {
  14906. return jQuery.queue( this[ 0 ], type );
  14907. }
  14908. return data === undefined ?
  14909. this :
  14910. this.each( function() {
  14911. var queue = jQuery.queue( this, type, data );
  14912. // Ensure a hooks for this queue
  14913. jQuery._queueHooks( this, type );
  14914. if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
  14915. jQuery.dequeue( this, type );
  14916. }
  14917. } );
  14918. },
  14919. dequeue: function( type ) {
  14920. return this.each( function() {
  14921. jQuery.dequeue( this, type );
  14922. } );
  14923. },
  14924. clearQueue: function( type ) {
  14925. return this.queue( type || "fx", [] );
  14926. },
  14927. // Get a promise resolved when queues of a certain type
  14928. // are emptied (fx is the type by default)
  14929. promise: function( type, obj ) {
  14930. var tmp,
  14931. count = 1,
  14932. defer = jQuery.Deferred(),
  14933. elements = this,
  14934. i = this.length,
  14935. resolve = function() {
  14936. if ( !( --count ) ) {
  14937. defer.resolveWith( elements, [ elements ] );
  14938. }
  14939. };
  14940. if ( typeof type !== "string" ) {
  14941. obj = type;
  14942. type = undefined;
  14943. }
  14944. type = type || "fx";
  14945. while ( i-- ) {
  14946. tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
  14947. if ( tmp && tmp.empty ) {
  14948. count++;
  14949. tmp.empty.add( resolve );
  14950. }
  14951. }
  14952. resolve();
  14953. return defer.promise( obj );
  14954. }
  14955. } );
  14956. var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
  14957. var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
  14958. var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
  14959. var documentElement = document.documentElement;
  14960. var isAttached = function( elem ) {
  14961. return jQuery.contains( elem.ownerDocument, elem );
  14962. },
  14963. composed = { composed: true };
  14964. // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only
  14965. // Check attachment across shadow DOM boundaries when possible (gh-3504)
  14966. // Support: iOS 10.0-10.2 only
  14967. // Early iOS 10 versions support `attachShadow` but not `getRootNode`,
  14968. // leading to errors. We need to check for `getRootNode`.
  14969. if ( documentElement.getRootNode ) {
  14970. isAttached = function( elem ) {
  14971. return jQuery.contains( elem.ownerDocument, elem ) ||
  14972. elem.getRootNode( composed ) === elem.ownerDocument;
  14973. };
  14974. }
  14975. var isHiddenWithinTree = function( elem, el ) {
  14976. // isHiddenWithinTree might be called from jQuery#filter function;
  14977. // in that case, element will be second argument
  14978. elem = el || elem;
  14979. // Inline style trumps all
  14980. return elem.style.display === "none" ||
  14981. elem.style.display === "" &&
  14982. // Otherwise, check computed style
  14983. // Support: Firefox <=43 - 45
  14984. // Disconnected elements can have computed display: none, so first confirm that elem is
  14985. // in the document.
  14986. isAttached( elem ) &&
  14987. jQuery.css( elem, "display" ) === "none";
  14988. };
  14989. function adjustCSS( elem, prop, valueParts, tween ) {
  14990. var adjusted, scale,
  14991. maxIterations = 20,
  14992. currentValue = tween ?
  14993. function() {
  14994. return tween.cur();
  14995. } :
  14996. function() {
  14997. return jQuery.css( elem, prop, "" );
  14998. },
  14999. initial = currentValue(),
  15000. unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
  15001. // Starting value computation is required for potential unit mismatches
  15002. initialInUnit = elem.nodeType &&
  15003. ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
  15004. rcssNum.exec( jQuery.css( elem, prop ) );
  15005. if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
  15006. // Support: Firefox <=54
  15007. // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)
  15008. initial = initial / 2;
  15009. // Trust units reported by jQuery.css
  15010. unit = unit || initialInUnit[ 3 ];
  15011. // Iteratively approximate from a nonzero starting point
  15012. initialInUnit = +initial || 1;
  15013. while ( maxIterations-- ) {
  15014. // Evaluate and update our best guess (doubling guesses that zero out).
  15015. // Finish if the scale equals or crosses 1 (making the old*new product non-positive).
  15016. jQuery.style( elem, prop, initialInUnit + unit );
  15017. if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {
  15018. maxIterations = 0;
  15019. }
  15020. initialInUnit = initialInUnit / scale;
  15021. }
  15022. initialInUnit = initialInUnit * 2;
  15023. jQuery.style( elem, prop, initialInUnit + unit );
  15024. // Make sure we update the tween properties later on
  15025. valueParts = valueParts || [];
  15026. }
  15027. if ( valueParts ) {
  15028. initialInUnit = +initialInUnit || +initial || 0;
  15029. // Apply relative offset (+=/-=) if specified
  15030. adjusted = valueParts[ 1 ] ?
  15031. initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
  15032. +valueParts[ 2 ];
  15033. if ( tween ) {
  15034. tween.unit = unit;
  15035. tween.start = initialInUnit;
  15036. tween.end = adjusted;
  15037. }
  15038. }
  15039. return adjusted;
  15040. }
  15041. var defaultDisplayMap = {};
  15042. function getDefaultDisplay( elem ) {
  15043. var temp,
  15044. doc = elem.ownerDocument,
  15045. nodeName = elem.nodeName,
  15046. display = defaultDisplayMap[ nodeName ];
  15047. if ( display ) {
  15048. return display;
  15049. }
  15050. temp = doc.body.appendChild( doc.createElement( nodeName ) );
  15051. display = jQuery.css( temp, "display" );
  15052. temp.parentNode.removeChild( temp );
  15053. if ( display === "none" ) {
  15054. display = "block";
  15055. }
  15056. defaultDisplayMap[ nodeName ] = display;
  15057. return display;
  15058. }
  15059. function showHide( elements, show ) {
  15060. var display, elem,
  15061. values = [],
  15062. index = 0,
  15063. length = elements.length;
  15064. // Determine new display value for elements that need to change
  15065. for ( ; index < length; index++ ) {
  15066. elem = elements[ index ];
  15067. if ( !elem.style ) {
  15068. continue;
  15069. }
  15070. display = elem.style.display;
  15071. if ( show ) {
  15072. // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
  15073. // check is required in this first loop unless we have a nonempty display value (either
  15074. // inline or about-to-be-restored)
  15075. if ( display === "none" ) {
  15076. values[ index ] = dataPriv.get( elem, "display" ) || null;
  15077. if ( !values[ index ] ) {
  15078. elem.style.display = "";
  15079. }
  15080. }
  15081. if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
  15082. values[ index ] = getDefaultDisplay( elem );
  15083. }
  15084. } else {
  15085. if ( display !== "none" ) {
  15086. values[ index ] = "none";
  15087. // Remember what we're overwriting
  15088. dataPriv.set( elem, "display", display );
  15089. }
  15090. }
  15091. }
  15092. // Set the display of the elements in a second loop to avoid constant reflow
  15093. for ( index = 0; index < length; index++ ) {
  15094. if ( values[ index ] != null ) {
  15095. elements[ index ].style.display = values[ index ];
  15096. }
  15097. }
  15098. return elements;
  15099. }
  15100. jQuery.fn.extend( {
  15101. show: function() {
  15102. return showHide( this, true );
  15103. },
  15104. hide: function() {
  15105. return showHide( this );
  15106. },
  15107. toggle: function( state ) {
  15108. if ( typeof state === "boolean" ) {
  15109. return state ? this.show() : this.hide();
  15110. }
  15111. return this.each( function() {
  15112. if ( isHiddenWithinTree( this ) ) {
  15113. jQuery( this ).show();
  15114. } else {
  15115. jQuery( this ).hide();
  15116. }
  15117. } );
  15118. }
  15119. } );
  15120. var rcheckableType = ( /^(?:checkbox|radio)$/i );
  15121. var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i );
  15122. var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
  15123. ( function() {
  15124. var fragment = document.createDocumentFragment(),
  15125. div = fragment.appendChild( document.createElement( "div" ) ),
  15126. input = document.createElement( "input" );
  15127. // Support: Android 4.0 - 4.3 only
  15128. // Check state lost if the name is set (#11217)
  15129. // Support: Windows Web Apps (WWA)
  15130. // `name` and `type` must use .setAttribute for WWA (#14901)
  15131. input.setAttribute( "type", "radio" );
  15132. input.setAttribute( "checked", "checked" );
  15133. input.setAttribute( "name", "t" );
  15134. div.appendChild( input );
  15135. // Support: Android <=4.1 only
  15136. // Older WebKit doesn't clone checked state correctly in fragments
  15137. support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
  15138. // Support: IE <=11 only
  15139. // Make sure textarea (and checkbox) defaultValue is properly cloned
  15140. div.innerHTML = "<textarea>x</textarea>";
  15141. support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
  15142. // Support: IE <=9 only
  15143. // IE <=9 replaces <option> tags with their contents when inserted outside of
  15144. // the select element.
  15145. div.innerHTML = "<option></option>";
  15146. support.option = !!div.lastChild;
  15147. } )();
  15148. // We have to close these tags to support XHTML (#13200)
  15149. var wrapMap = {
  15150. // XHTML parsers do not magically insert elements in the
  15151. // same way that tag soup parsers do. So we cannot shorten
  15152. // this by omitting <tbody> or other required elements.
  15153. thead: [ 1, "<table>", "</table>" ],
  15154. col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
  15155. tr: [ 2, "<table><tbody>", "</tbody></table>" ],
  15156. td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
  15157. _default: [ 0, "", "" ]
  15158. };
  15159. wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
  15160. wrapMap.th = wrapMap.td;
  15161. // Support: IE <=9 only
  15162. if ( !support.option ) {
  15163. wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ];
  15164. }
  15165. function getAll( context, tag ) {
  15166. // Support: IE <=9 - 11 only
  15167. // Use typeof to avoid zero-argument method invocation on host objects (#15151)
  15168. var ret;
  15169. if ( typeof context.getElementsByTagName !== "undefined" ) {
  15170. ret = context.getElementsByTagName( tag || "*" );
  15171. } else if ( typeof context.querySelectorAll !== "undefined" ) {
  15172. ret = context.querySelectorAll( tag || "*" );
  15173. } else {
  15174. ret = [];
  15175. }
  15176. if ( tag === undefined || tag && nodeName( context, tag ) ) {
  15177. return jQuery.merge( [ context ], ret );
  15178. }
  15179. return ret;
  15180. }
  15181. // Mark scripts as having already been evaluated
  15182. function setGlobalEval( elems, refElements ) {
  15183. var i = 0,
  15184. l = elems.length;
  15185. for ( ; i < l; i++ ) {
  15186. dataPriv.set(
  15187. elems[ i ],
  15188. "globalEval",
  15189. !refElements || dataPriv.get( refElements[ i ], "globalEval" )
  15190. );
  15191. }
  15192. }
  15193. var rhtml = /<|&#?\w+;/;
  15194. function buildFragment( elems, context, scripts, selection, ignored ) {
  15195. var elem, tmp, tag, wrap, attached, j,
  15196. fragment = context.createDocumentFragment(),
  15197. nodes = [],
  15198. i = 0,
  15199. l = elems.length;
  15200. for ( ; i < l; i++ ) {
  15201. elem = elems[ i ];
  15202. if ( elem || elem === 0 ) {
  15203. // Add nodes directly
  15204. if ( toType( elem ) === "object" ) {
  15205. // Support: Android <=4.0 only, PhantomJS 1 only
  15206. // push.apply(_, arraylike) throws on ancient WebKit
  15207. jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
  15208. // Convert non-html into a text node
  15209. } else if ( !rhtml.test( elem ) ) {
  15210. nodes.push( context.createTextNode( elem ) );
  15211. // Convert html into DOM nodes
  15212. } else {
  15213. tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
  15214. // Deserialize a standard representation
  15215. tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
  15216. wrap = wrapMap[ tag ] || wrapMap._default;
  15217. tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
  15218. // Descend through wrappers to the right content
  15219. j = wrap[ 0 ];
  15220. while ( j-- ) {
  15221. tmp = tmp.lastChild;
  15222. }
  15223. // Support: Android <=4.0 only, PhantomJS 1 only
  15224. // push.apply(_, arraylike) throws on ancient WebKit
  15225. jQuery.merge( nodes, tmp.childNodes );
  15226. // Remember the top-level container
  15227. tmp = fragment.firstChild;
  15228. // Ensure the created nodes are orphaned (#12392)
  15229. tmp.textContent = "";
  15230. }
  15231. }
  15232. }
  15233. // Remove wrapper from fragment
  15234. fragment.textContent = "";
  15235. i = 0;
  15236. while ( ( elem = nodes[ i++ ] ) ) {
  15237. // Skip elements already in the context collection (trac-4087)
  15238. if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
  15239. if ( ignored ) {
  15240. ignored.push( elem );
  15241. }
  15242. continue;
  15243. }
  15244. attached = isAttached( elem );
  15245. // Append to fragment
  15246. tmp = getAll( fragment.appendChild( elem ), "script" );
  15247. // Preserve script evaluation history
  15248. if ( attached ) {
  15249. setGlobalEval( tmp );
  15250. }
  15251. // Capture executables
  15252. if ( scripts ) {
  15253. j = 0;
  15254. while ( ( elem = tmp[ j++ ] ) ) {
  15255. if ( rscriptType.test( elem.type || "" ) ) {
  15256. scripts.push( elem );
  15257. }
  15258. }
  15259. }
  15260. }
  15261. return fragment;
  15262. }
  15263. var
  15264. rkeyEvent = /^key/,
  15265. rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
  15266. rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
  15267. function returnTrue() {
  15268. return true;
  15269. }
  15270. function returnFalse() {
  15271. return false;
  15272. }
  15273. // Support: IE <=9 - 11+
  15274. // focus() and blur() are asynchronous, except when they are no-op.
  15275. // So expect focus to be synchronous when the element is already active,
  15276. // and blur to be synchronous when the element is not already active.
  15277. // (focus and blur are always synchronous in other supported browsers,
  15278. // this just defines when we can count on it).
  15279. function expectSync( elem, type ) {
  15280. return ( elem === safeActiveElement() ) === ( type === "focus" );
  15281. }
  15282. // Support: IE <=9 only
  15283. // Accessing document.activeElement can throw unexpectedly
  15284. // https://bugs.jquery.com/ticket/13393
  15285. function safeActiveElement() {
  15286. try {
  15287. return document.activeElement;
  15288. } catch ( err ) { }
  15289. }
  15290. function on( elem, types, selector, data, fn, one ) {
  15291. var origFn, type;
  15292. // Types can be a map of types/handlers
  15293. if ( typeof types === "object" ) {
  15294. // ( types-Object, selector, data )
  15295. if ( typeof selector !== "string" ) {
  15296. // ( types-Object, data )
  15297. data = data || selector;
  15298. selector = undefined;
  15299. }
  15300. for ( type in types ) {
  15301. on( elem, type, selector, data, types[ type ], one );
  15302. }
  15303. return elem;
  15304. }
  15305. if ( data == null && fn == null ) {
  15306. // ( types, fn )
  15307. fn = selector;
  15308. data = selector = undefined;
  15309. } else if ( fn == null ) {
  15310. if ( typeof selector === "string" ) {
  15311. // ( types, selector, fn )
  15312. fn = data;
  15313. data = undefined;
  15314. } else {
  15315. // ( types, data, fn )
  15316. fn = data;
  15317. data = selector;
  15318. selector = undefined;
  15319. }
  15320. }
  15321. if ( fn === false ) {
  15322. fn = returnFalse;
  15323. } else if ( !fn ) {
  15324. return elem;
  15325. }
  15326. if ( one === 1 ) {
  15327. origFn = fn;
  15328. fn = function( event ) {
  15329. // Can use an empty set, since event contains the info
  15330. jQuery().off( event );
  15331. return origFn.apply( this, arguments );
  15332. };
  15333. // Use same guid so caller can remove using origFn
  15334. fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
  15335. }
  15336. return elem.each( function() {
  15337. jQuery.event.add( this, types, fn, data, selector );
  15338. } );
  15339. }
  15340. /*
  15341. * Helper functions for managing events -- not part of the public interface.
  15342. * Props to Dean Edwards' addEvent library for many of the ideas.
  15343. */
  15344. jQuery.event = {
  15345. global: {},
  15346. add: function( elem, types, handler, data, selector ) {
  15347. var handleObjIn, eventHandle, tmp,
  15348. events, t, handleObj,
  15349. special, handlers, type, namespaces, origType,
  15350. elemData = dataPriv.get( elem );
  15351. // Only attach events to objects that accept data
  15352. if ( !acceptData( elem ) ) {
  15353. return;
  15354. }
  15355. // Caller can pass in an object of custom data in lieu of the handler
  15356. if ( handler.handler ) {
  15357. handleObjIn = handler;
  15358. handler = handleObjIn.handler;
  15359. selector = handleObjIn.selector;
  15360. }
  15361. // Ensure that invalid selectors throw exceptions at attach time
  15362. // Evaluate against documentElement in case elem is a non-element node (e.g., document)
  15363. if ( selector ) {
  15364. jQuery.find.matchesSelector( documentElement, selector );
  15365. }
  15366. // Make sure that the handler has a unique ID, used to find/remove it later
  15367. if ( !handler.guid ) {
  15368. handler.guid = jQuery.guid++;
  15369. }
  15370. // Init the element's event structure and main handler, if this is the first
  15371. if ( !( events = elemData.events ) ) {
  15372. events = elemData.events = Object.create( null );
  15373. }
  15374. if ( !( eventHandle = elemData.handle ) ) {
  15375. eventHandle = elemData.handle = function( e ) {
  15376. // Discard the second event of a jQuery.event.trigger() and
  15377. // when an event is called after a page has unloaded
  15378. return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
  15379. jQuery.event.dispatch.apply( elem, arguments ) : undefined;
  15380. };
  15381. }
  15382. // Handle multiple events separated by a space
  15383. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  15384. t = types.length;
  15385. while ( t-- ) {
  15386. tmp = rtypenamespace.exec( types[ t ] ) || [];
  15387. type = origType = tmp[ 1 ];
  15388. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  15389. // There *must* be a type, no attaching namespace-only handlers
  15390. if ( !type ) {
  15391. continue;
  15392. }
  15393. // If event changes its type, use the special event handlers for the changed type
  15394. special = jQuery.event.special[ type ] || {};
  15395. // If selector defined, determine special event api type, otherwise given type
  15396. type = ( selector ? special.delegateType : special.bindType ) || type;
  15397. // Update special based on newly reset type
  15398. special = jQuery.event.special[ type ] || {};
  15399. // handleObj is passed to all event handlers
  15400. handleObj = jQuery.extend( {
  15401. type: type,
  15402. origType: origType,
  15403. data: data,
  15404. handler: handler,
  15405. guid: handler.guid,
  15406. selector: selector,
  15407. needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
  15408. namespace: namespaces.join( "." )
  15409. }, handleObjIn );
  15410. // Init the event handler queue if we're the first
  15411. if ( !( handlers = events[ type ] ) ) {
  15412. handlers = events[ type ] = [];
  15413. handlers.delegateCount = 0;
  15414. // Only use addEventListener if the special events handler returns false
  15415. if ( !special.setup ||
  15416. special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
  15417. if ( elem.addEventListener ) {
  15418. elem.addEventListener( type, eventHandle );
  15419. }
  15420. }
  15421. }
  15422. if ( special.add ) {
  15423. special.add.call( elem, handleObj );
  15424. if ( !handleObj.handler.guid ) {
  15425. handleObj.handler.guid = handler.guid;
  15426. }
  15427. }
  15428. // Add to the element's handler list, delegates in front
  15429. if ( selector ) {
  15430. handlers.splice( handlers.delegateCount++, 0, handleObj );
  15431. } else {
  15432. handlers.push( handleObj );
  15433. }
  15434. // Keep track of which events have ever been used, for event optimization
  15435. jQuery.event.global[ type ] = true;
  15436. }
  15437. },
  15438. // Detach an event or set of events from an element
  15439. remove: function( elem, types, handler, selector, mappedTypes ) {
  15440. var j, origCount, tmp,
  15441. events, t, handleObj,
  15442. special, handlers, type, namespaces, origType,
  15443. elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
  15444. if ( !elemData || !( events = elemData.events ) ) {
  15445. return;
  15446. }
  15447. // Once for each type.namespace in types; type may be omitted
  15448. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  15449. t = types.length;
  15450. while ( t-- ) {
  15451. tmp = rtypenamespace.exec( types[ t ] ) || [];
  15452. type = origType = tmp[ 1 ];
  15453. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  15454. // Unbind all events (on this namespace, if provided) for the element
  15455. if ( !type ) {
  15456. for ( type in events ) {
  15457. jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
  15458. }
  15459. continue;
  15460. }
  15461. special = jQuery.event.special[ type ] || {};
  15462. type = ( selector ? special.delegateType : special.bindType ) || type;
  15463. handlers = events[ type ] || [];
  15464. tmp = tmp[ 2 ] &&
  15465. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
  15466. // Remove matching events
  15467. origCount = j = handlers.length;
  15468. while ( j-- ) {
  15469. handleObj = handlers[ j ];
  15470. if ( ( mappedTypes || origType === handleObj.origType ) &&
  15471. ( !handler || handler.guid === handleObj.guid ) &&
  15472. ( !tmp || tmp.test( handleObj.namespace ) ) &&
  15473. ( !selector || selector === handleObj.selector ||
  15474. selector === "**" && handleObj.selector ) ) {
  15475. handlers.splice( j, 1 );
  15476. if ( handleObj.selector ) {
  15477. handlers.delegateCount--;
  15478. }
  15479. if ( special.remove ) {
  15480. special.remove.call( elem, handleObj );
  15481. }
  15482. }
  15483. }
  15484. // Remove generic event handler if we removed something and no more handlers exist
  15485. // (avoids potential for endless recursion during removal of special event handlers)
  15486. if ( origCount && !handlers.length ) {
  15487. if ( !special.teardown ||
  15488. special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
  15489. jQuery.removeEvent( elem, type, elemData.handle );
  15490. }
  15491. delete events[ type ];
  15492. }
  15493. }
  15494. // Remove data and the expando if it's no longer used
  15495. if ( jQuery.isEmptyObject( events ) ) {
  15496. dataPriv.remove( elem, "handle events" );
  15497. }
  15498. },
  15499. dispatch: function( nativeEvent ) {
  15500. var i, j, ret, matched, handleObj, handlerQueue,
  15501. args = new Array( arguments.length ),
  15502. // Make a writable jQuery.Event from the native event object
  15503. event = jQuery.event.fix( nativeEvent ),
  15504. handlers = (
  15505. dataPriv.get( this, "events" ) || Object.create( null )
  15506. )[ event.type ] || [],
  15507. special = jQuery.event.special[ event.type ] || {};
  15508. // Use the fix-ed jQuery.Event rather than the (read-only) native event
  15509. args[ 0 ] = event;
  15510. for ( i = 1; i < arguments.length; i++ ) {
  15511. args[ i ] = arguments[ i ];
  15512. }
  15513. event.delegateTarget = this;
  15514. // Call the preDispatch hook for the mapped type, and let it bail if desired
  15515. if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
  15516. return;
  15517. }
  15518. // Determine handlers
  15519. handlerQueue = jQuery.event.handlers.call( this, event, handlers );
  15520. // Run delegates first; they may want to stop propagation beneath us
  15521. i = 0;
  15522. while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
  15523. event.currentTarget = matched.elem;
  15524. j = 0;
  15525. while ( ( handleObj = matched.handlers[ j++ ] ) &&
  15526. !event.isImmediatePropagationStopped() ) {
  15527. // If the event is namespaced, then each handler is only invoked if it is
  15528. // specially universal or its namespaces are a superset of the event's.
  15529. if ( !event.rnamespace || handleObj.namespace === false ||
  15530. event.rnamespace.test( handleObj.namespace ) ) {
  15531. event.handleObj = handleObj;
  15532. event.data = handleObj.data;
  15533. ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
  15534. handleObj.handler ).apply( matched.elem, args );
  15535. if ( ret !== undefined ) {
  15536. if ( ( event.result = ret ) === false ) {
  15537. event.preventDefault();
  15538. event.stopPropagation();
  15539. }
  15540. }
  15541. }
  15542. }
  15543. }
  15544. // Call the postDispatch hook for the mapped type
  15545. if ( special.postDispatch ) {
  15546. special.postDispatch.call( this, event );
  15547. }
  15548. return event.result;
  15549. },
  15550. handlers: function( event, handlers ) {
  15551. var i, handleObj, sel, matchedHandlers, matchedSelectors,
  15552. handlerQueue = [],
  15553. delegateCount = handlers.delegateCount,
  15554. cur = event.target;
  15555. // Find delegate handlers
  15556. if ( delegateCount &&
  15557. // Support: IE <=9
  15558. // Black-hole SVG <use> instance trees (trac-13180)
  15559. cur.nodeType &&
  15560. // Support: Firefox <=42
  15561. // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
  15562. // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
  15563. // Support: IE 11 only
  15564. // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
  15565. !( event.type === "click" && event.button >= 1 ) ) {
  15566. for ( ; cur !== this; cur = cur.parentNode || this ) {
  15567. // Don't check non-elements (#13208)
  15568. // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
  15569. if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
  15570. matchedHandlers = [];
  15571. matchedSelectors = {};
  15572. for ( i = 0; i < delegateCount; i++ ) {
  15573. handleObj = handlers[ i ];
  15574. // Don't conflict with Object.prototype properties (#13203)
  15575. sel = handleObj.selector + " ";
  15576. if ( matchedSelectors[ sel ] === undefined ) {
  15577. matchedSelectors[ sel ] = handleObj.needsContext ?
  15578. jQuery( sel, this ).index( cur ) > -1 :
  15579. jQuery.find( sel, this, null, [ cur ] ).length;
  15580. }
  15581. if ( matchedSelectors[ sel ] ) {
  15582. matchedHandlers.push( handleObj );
  15583. }
  15584. }
  15585. if ( matchedHandlers.length ) {
  15586. handlerQueue.push( { elem: cur, handlers: matchedHandlers } );
  15587. }
  15588. }
  15589. }
  15590. }
  15591. // Add the remaining (directly-bound) handlers
  15592. cur = this;
  15593. if ( delegateCount < handlers.length ) {
  15594. handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );
  15595. }
  15596. return handlerQueue;
  15597. },
  15598. addProp: function( name, hook ) {
  15599. Object.defineProperty( jQuery.Event.prototype, name, {
  15600. enumerable: true,
  15601. configurable: true,
  15602. get: isFunction( hook ) ?
  15603. function() {
  15604. if ( this.originalEvent ) {
  15605. return hook( this.originalEvent );
  15606. }
  15607. } :
  15608. function() {
  15609. if ( this.originalEvent ) {
  15610. return this.originalEvent[ name ];
  15611. }
  15612. },
  15613. set: function( value ) {
  15614. Object.defineProperty( this, name, {
  15615. enumerable: true,
  15616. configurable: true,
  15617. writable: true,
  15618. value: value
  15619. } );
  15620. }
  15621. } );
  15622. },
  15623. fix: function( originalEvent ) {
  15624. return originalEvent[ jQuery.expando ] ?
  15625. originalEvent :
  15626. new jQuery.Event( originalEvent );
  15627. },
  15628. special: {
  15629. load: {
  15630. // Prevent triggered image.load events from bubbling to window.load
  15631. noBubble: true
  15632. },
  15633. click: {
  15634. // Utilize native event to ensure correct state for checkable inputs
  15635. setup: function( data ) {
  15636. // For mutual compressibility with _default, replace `this` access with a local var.
  15637. // `|| data` is dead code meant only to preserve the variable through minification.
  15638. var el = this || data;
  15639. // Claim the first handler
  15640. if ( rcheckableType.test( el.type ) &&
  15641. el.click && nodeName( el, "input" ) ) {
  15642. // dataPriv.set( el, "click", ... )
  15643. leverageNative( el, "click", returnTrue );
  15644. }
  15645. // Return false to allow normal processing in the caller
  15646. return false;
  15647. },
  15648. trigger: function( data ) {
  15649. // For mutual compressibility with _default, replace `this` access with a local var.
  15650. // `|| data` is dead code meant only to preserve the variable through minification.
  15651. var el = this || data;
  15652. // Force setup before triggering a click
  15653. if ( rcheckableType.test( el.type ) &&
  15654. el.click && nodeName( el, "input" ) ) {
  15655. leverageNative( el, "click" );
  15656. }
  15657. // Return non-false to allow normal event-path propagation
  15658. return true;
  15659. },
  15660. // For cross-browser consistency, suppress native .click() on links
  15661. // Also prevent it if we're currently inside a leveraged native-event stack
  15662. _default: function( event ) {
  15663. var target = event.target;
  15664. return rcheckableType.test( target.type ) &&
  15665. target.click && nodeName( target, "input" ) &&
  15666. dataPriv.get( target, "click" ) ||
  15667. nodeName( target, "a" );
  15668. }
  15669. },
  15670. beforeunload: {
  15671. postDispatch: function( event ) {
  15672. // Support: Firefox 20+
  15673. // Firefox doesn't alert if the returnValue field is not set.
  15674. if ( event.result !== undefined && event.originalEvent ) {
  15675. event.originalEvent.returnValue = event.result;
  15676. }
  15677. }
  15678. }
  15679. }
  15680. };
  15681. // Ensure the presence of an event listener that handles manually-triggered
  15682. // synthetic events by interrupting progress until reinvoked in response to
  15683. // *native* events that it fires directly, ensuring that state changes have
  15684. // already occurred before other listeners are invoked.
  15685. function leverageNative( el, type, expectSync ) {
  15686. // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add
  15687. if ( !expectSync ) {
  15688. if ( dataPriv.get( el, type ) === undefined ) {
  15689. jQuery.event.add( el, type, returnTrue );
  15690. }
  15691. return;
  15692. }
  15693. // Register the controller as a special universal handler for all event namespaces
  15694. dataPriv.set( el, type, false );
  15695. jQuery.event.add( el, type, {
  15696. namespace: false,
  15697. handler: function( event ) {
  15698. var notAsync, result,
  15699. saved = dataPriv.get( this, type );
  15700. if ( ( event.isTrigger & 1 ) && this[ type ] ) {
  15701. // Interrupt processing of the outer synthetic .trigger()ed event
  15702. // Saved data should be false in such cases, but might be a leftover capture object
  15703. // from an async native handler (gh-4350)
  15704. if ( !saved.length ) {
  15705. // Store arguments for use when handling the inner native event
  15706. // There will always be at least one argument (an event object), so this array
  15707. // will not be confused with a leftover capture object.
  15708. saved = slice.call( arguments );
  15709. dataPriv.set( this, type, saved );
  15710. // Trigger the native event and capture its result
  15711. // Support: IE <=9 - 11+
  15712. // focus() and blur() are asynchronous
  15713. notAsync = expectSync( this, type );
  15714. this[ type ]();
  15715. result = dataPriv.get( this, type );
  15716. if ( saved !== result || notAsync ) {
  15717. dataPriv.set( this, type, false );
  15718. } else {
  15719. result = {};
  15720. }
  15721. if ( saved !== result ) {
  15722. // Cancel the outer synthetic event
  15723. event.stopImmediatePropagation();
  15724. event.preventDefault();
  15725. return result.value;
  15726. }
  15727. // If this is an inner synthetic event for an event with a bubbling surrogate
  15728. // (focus or blur), assume that the surrogate already propagated from triggering the
  15729. // native event and prevent that from happening again here.
  15730. // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the
  15731. // bubbling surrogate propagates *after* the non-bubbling base), but that seems
  15732. // less bad than duplication.
  15733. } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {
  15734. event.stopPropagation();
  15735. }
  15736. // If this is a native event triggered above, everything is now in order
  15737. // Fire an inner synthetic event with the original arguments
  15738. } else if ( saved.length ) {
  15739. // ...and capture the result
  15740. dataPriv.set( this, type, {
  15741. value: jQuery.event.trigger(
  15742. // Support: IE <=9 - 11+
  15743. // Extend with the prototype to reset the above stopImmediatePropagation()
  15744. jQuery.extend( saved[ 0 ], jQuery.Event.prototype ),
  15745. saved.slice( 1 ),
  15746. this
  15747. )
  15748. } );
  15749. // Abort handling of the native event
  15750. event.stopImmediatePropagation();
  15751. }
  15752. }
  15753. } );
  15754. }
  15755. jQuery.removeEvent = function( elem, type, handle ) {
  15756. // This "if" is needed for plain objects
  15757. if ( elem.removeEventListener ) {
  15758. elem.removeEventListener( type, handle );
  15759. }
  15760. };
  15761. jQuery.Event = function( src, props ) {
  15762. // Allow instantiation without the 'new' keyword
  15763. if ( !( this instanceof jQuery.Event ) ) {
  15764. return new jQuery.Event( src, props );
  15765. }
  15766. // Event object
  15767. if ( src && src.type ) {
  15768. this.originalEvent = src;
  15769. this.type = src.type;
  15770. // Events bubbling up the document may have been marked as prevented
  15771. // by a handler lower down the tree; reflect the correct value.
  15772. this.isDefaultPrevented = src.defaultPrevented ||
  15773. src.defaultPrevented === undefined &&
  15774. // Support: Android <=2.3 only
  15775. src.returnValue === false ?
  15776. returnTrue :
  15777. returnFalse;
  15778. // Create target properties
  15779. // Support: Safari <=6 - 7 only
  15780. // Target should not be a text node (#504, #13143)
  15781. this.target = ( src.target && src.target.nodeType === 3 ) ?
  15782. src.target.parentNode :
  15783. src.target;
  15784. this.currentTarget = src.currentTarget;
  15785. this.relatedTarget = src.relatedTarget;
  15786. // Event type
  15787. } else {
  15788. this.type = src;
  15789. }
  15790. // Put explicitly provided properties onto the event object
  15791. if ( props ) {
  15792. jQuery.extend( this, props );
  15793. }
  15794. // Create a timestamp if incoming event doesn't have one
  15795. this.timeStamp = src && src.timeStamp || Date.now();
  15796. // Mark it as fixed
  15797. this[ jQuery.expando ] = true;
  15798. };
  15799. // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
  15800. // https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
  15801. jQuery.Event.prototype = {
  15802. constructor: jQuery.Event,
  15803. isDefaultPrevented: returnFalse,
  15804. isPropagationStopped: returnFalse,
  15805. isImmediatePropagationStopped: returnFalse,
  15806. isSimulated: false,
  15807. preventDefault: function() {
  15808. var e = this.originalEvent;
  15809. this.isDefaultPrevented = returnTrue;
  15810. if ( e && !this.isSimulated ) {
  15811. e.preventDefault();
  15812. }
  15813. },
  15814. stopPropagation: function() {
  15815. var e = this.originalEvent;
  15816. this.isPropagationStopped = returnTrue;
  15817. if ( e && !this.isSimulated ) {
  15818. e.stopPropagation();
  15819. }
  15820. },
  15821. stopImmediatePropagation: function() {
  15822. var e = this.originalEvent;
  15823. this.isImmediatePropagationStopped = returnTrue;
  15824. if ( e && !this.isSimulated ) {
  15825. e.stopImmediatePropagation();
  15826. }
  15827. this.stopPropagation();
  15828. }
  15829. };
  15830. // Includes all common event props including KeyEvent and MouseEvent specific props
  15831. jQuery.each( {
  15832. altKey: true,
  15833. bubbles: true,
  15834. cancelable: true,
  15835. changedTouches: true,
  15836. ctrlKey: true,
  15837. detail: true,
  15838. eventPhase: true,
  15839. metaKey: true,
  15840. pageX: true,
  15841. pageY: true,
  15842. shiftKey: true,
  15843. view: true,
  15844. "char": true,
  15845. code: true,
  15846. charCode: true,
  15847. key: true,
  15848. keyCode: true,
  15849. button: true,
  15850. buttons: true,
  15851. clientX: true,
  15852. clientY: true,
  15853. offsetX: true,
  15854. offsetY: true,
  15855. pointerId: true,
  15856. pointerType: true,
  15857. screenX: true,
  15858. screenY: true,
  15859. targetTouches: true,
  15860. toElement: true,
  15861. touches: true,
  15862. which: function( event ) {
  15863. var button = event.button;
  15864. // Add which for key events
  15865. if ( event.which == null && rkeyEvent.test( event.type ) ) {
  15866. return event.charCode != null ? event.charCode : event.keyCode;
  15867. }
  15868. // Add which for click: 1 === left; 2 === middle; 3 === right
  15869. if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {
  15870. if ( button & 1 ) {
  15871. return 1;
  15872. }
  15873. if ( button & 2 ) {
  15874. return 3;
  15875. }
  15876. if ( button & 4 ) {
  15877. return 2;
  15878. }
  15879. return 0;
  15880. }
  15881. return event.which;
  15882. }
  15883. }, jQuery.event.addProp );
  15884. jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) {
  15885. jQuery.event.special[ type ] = {
  15886. // Utilize native event if possible so blur/focus sequence is correct
  15887. setup: function() {
  15888. // Claim the first handler
  15889. // dataPriv.set( this, "focus", ... )
  15890. // dataPriv.set( this, "blur", ... )
  15891. leverageNative( this, type, expectSync );
  15892. // Return false to allow normal processing in the caller
  15893. return false;
  15894. },
  15895. trigger: function() {
  15896. // Force setup before trigger
  15897. leverageNative( this, type );
  15898. // Return non-false to allow normal event-path propagation
  15899. return true;
  15900. },
  15901. delegateType: delegateType
  15902. };
  15903. } );
  15904. // Create mouseenter/leave events using mouseover/out and event-time checks
  15905. // so that event delegation works in jQuery.
  15906. // Do the same for pointerenter/pointerleave and pointerover/pointerout
  15907. //
  15908. // Support: Safari 7 only
  15909. // Safari sends mouseenter too often; see:
  15910. // https://bugs.chromium.org/p/chromium/issues/detail?id=470258
  15911. // for the description of the bug (it existed in older Chrome versions as well).
  15912. jQuery.each( {
  15913. mouseenter: "mouseover",
  15914. mouseleave: "mouseout",
  15915. pointerenter: "pointerover",
  15916. pointerleave: "pointerout"
  15917. }, function( orig, fix ) {
  15918. jQuery.event.special[ orig ] = {
  15919. delegateType: fix,
  15920. bindType: fix,
  15921. handle: function( event ) {
  15922. var ret,
  15923. target = this,
  15924. related = event.relatedTarget,
  15925. handleObj = event.handleObj;
  15926. // For mouseenter/leave call the handler if related is outside the target.
  15927. // NB: No relatedTarget if the mouse left/entered the browser window
  15928. if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
  15929. event.type = handleObj.origType;
  15930. ret = handleObj.handler.apply( this, arguments );
  15931. event.type = fix;
  15932. }
  15933. return ret;
  15934. }
  15935. };
  15936. } );
  15937. jQuery.fn.extend( {
  15938. on: function( types, selector, data, fn ) {
  15939. return on( this, types, selector, data, fn );
  15940. },
  15941. one: function( types, selector, data, fn ) {
  15942. return on( this, types, selector, data, fn, 1 );
  15943. },
  15944. off: function( types, selector, fn ) {
  15945. var handleObj, type;
  15946. if ( types && types.preventDefault && types.handleObj ) {
  15947. // ( event ) dispatched jQuery.Event
  15948. handleObj = types.handleObj;
  15949. jQuery( types.delegateTarget ).off(
  15950. handleObj.namespace ?
  15951. handleObj.origType + "." + handleObj.namespace :
  15952. handleObj.origType,
  15953. handleObj.selector,
  15954. handleObj.handler
  15955. );
  15956. return this;
  15957. }
  15958. if ( typeof types === "object" ) {
  15959. // ( types-object [, selector] )
  15960. for ( type in types ) {
  15961. this.off( type, selector, types[ type ] );
  15962. }
  15963. return this;
  15964. }
  15965. if ( selector === false || typeof selector === "function" ) {
  15966. // ( types [, fn] )
  15967. fn = selector;
  15968. selector = undefined;
  15969. }
  15970. if ( fn === false ) {
  15971. fn = returnFalse;
  15972. }
  15973. return this.each( function() {
  15974. jQuery.event.remove( this, types, fn, selector );
  15975. } );
  15976. }
  15977. } );
  15978. var
  15979. // Support: IE <=10 - 11, Edge 12 - 13 only
  15980. // In IE/Edge using regex groups here causes severe slowdowns.
  15981. // See https://connect.microsoft.com/IE/feedback/details/1736512/
  15982. rnoInnerhtml = /<script|<style|<link/i,
  15983. // checked="checked" or checked
  15984. rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
  15985. rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
  15986. // Prefer a tbody over its parent table for containing new rows
  15987. function manipulationTarget( elem, content ) {
  15988. if ( nodeName( elem, "table" ) &&
  15989. nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
  15990. return jQuery( elem ).children( "tbody" )[ 0 ] || elem;
  15991. }
  15992. return elem;
  15993. }
  15994. // Replace/restore the type attribute of script elements for safe DOM manipulation
  15995. function disableScript( elem ) {
  15996. elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
  15997. return elem;
  15998. }
  15999. function restoreScript( elem ) {
  16000. if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) {
  16001. elem.type = elem.type.slice( 5 );
  16002. } else {
  16003. elem.removeAttribute( "type" );
  16004. }
  16005. return elem;
  16006. }
  16007. function cloneCopyEvent( src, dest ) {
  16008. var i, l, type, pdataOld, udataOld, udataCur, events;
  16009. if ( dest.nodeType !== 1 ) {
  16010. return;
  16011. }
  16012. // 1. Copy private data: events, handlers, etc.
  16013. if ( dataPriv.hasData( src ) ) {
  16014. pdataOld = dataPriv.get( src );
  16015. events = pdataOld.events;
  16016. if ( events ) {
  16017. dataPriv.remove( dest, "handle events" );
  16018. for ( type in events ) {
  16019. for ( i = 0, l = events[ type ].length; i < l; i++ ) {
  16020. jQuery.event.add( dest, type, events[ type ][ i ] );
  16021. }
  16022. }
  16023. }
  16024. }
  16025. // 2. Copy user data
  16026. if ( dataUser.hasData( src ) ) {
  16027. udataOld = dataUser.access( src );
  16028. udataCur = jQuery.extend( {}, udataOld );
  16029. dataUser.set( dest, udataCur );
  16030. }
  16031. }
  16032. // Fix IE bugs, see support tests
  16033. function fixInput( src, dest ) {
  16034. var nodeName = dest.nodeName.toLowerCase();
  16035. // Fails to persist the checked state of a cloned checkbox or radio button.
  16036. if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
  16037. dest.checked = src.checked;
  16038. // Fails to return the selected option to the default selected state when cloning options
  16039. } else if ( nodeName === "input" || nodeName === "textarea" ) {
  16040. dest.defaultValue = src.defaultValue;
  16041. }
  16042. }
  16043. function domManip( collection, args, callback, ignored ) {
  16044. // Flatten any nested arrays
  16045. args = flat( args );
  16046. var fragment, first, scripts, hasScripts, node, doc,
  16047. i = 0,
  16048. l = collection.length,
  16049. iNoClone = l - 1,
  16050. value = args[ 0 ],
  16051. valueIsFunction = isFunction( value );
  16052. // We can't cloneNode fragments that contain checked, in WebKit
  16053. if ( valueIsFunction ||
  16054. ( l > 1 && typeof value === "string" &&
  16055. !support.checkClone && rchecked.test( value ) ) ) {
  16056. return collection.each( function( index ) {
  16057. var self = collection.eq( index );
  16058. if ( valueIsFunction ) {
  16059. args[ 0 ] = value.call( this, index, self.html() );
  16060. }
  16061. domManip( self, args, callback, ignored );
  16062. } );
  16063. }
  16064. if ( l ) {
  16065. fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
  16066. first = fragment.firstChild;
  16067. if ( fragment.childNodes.length === 1 ) {
  16068. fragment = first;
  16069. }
  16070. // Require either new content or an interest in ignored elements to invoke the callback
  16071. if ( first || ignored ) {
  16072. scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
  16073. hasScripts = scripts.length;
  16074. // Use the original fragment for the last item
  16075. // instead of the first because it can end up
  16076. // being emptied incorrectly in certain situations (#8070).
  16077. for ( ; i < l; i++ ) {
  16078. node = fragment;
  16079. if ( i !== iNoClone ) {
  16080. node = jQuery.clone( node, true, true );
  16081. // Keep references to cloned scripts for later restoration
  16082. if ( hasScripts ) {
  16083. // Support: Android <=4.0 only, PhantomJS 1 only
  16084. // push.apply(_, arraylike) throws on ancient WebKit
  16085. jQuery.merge( scripts, getAll( node, "script" ) );
  16086. }
  16087. }
  16088. callback.call( collection[ i ], node, i );
  16089. }
  16090. if ( hasScripts ) {
  16091. doc = scripts[ scripts.length - 1 ].ownerDocument;
  16092. // Reenable scripts
  16093. jQuery.map( scripts, restoreScript );
  16094. // Evaluate executable scripts on first document insertion
  16095. for ( i = 0; i < hasScripts; i++ ) {
  16096. node = scripts[ i ];
  16097. if ( rscriptType.test( node.type || "" ) &&
  16098. !dataPriv.access( node, "globalEval" ) &&
  16099. jQuery.contains( doc, node ) ) {
  16100. if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) {
  16101. // Optional AJAX dependency, but won't run scripts if not present
  16102. if ( jQuery._evalUrl && !node.noModule ) {
  16103. jQuery._evalUrl( node.src, {
  16104. nonce: node.nonce || node.getAttribute( "nonce" )
  16105. }, doc );
  16106. }
  16107. } else {
  16108. DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
  16109. }
  16110. }
  16111. }
  16112. }
  16113. }
  16114. }
  16115. return collection;
  16116. }
  16117. function remove( elem, selector, keepData ) {
  16118. var node,
  16119. nodes = selector ? jQuery.filter( selector, elem ) : elem,
  16120. i = 0;
  16121. for ( ; ( node = nodes[ i ] ) != null; i++ ) {
  16122. if ( !keepData && node.nodeType === 1 ) {
  16123. jQuery.cleanData( getAll( node ) );
  16124. }
  16125. if ( node.parentNode ) {
  16126. if ( keepData && isAttached( node ) ) {
  16127. setGlobalEval( getAll( node, "script" ) );
  16128. }
  16129. node.parentNode.removeChild( node );
  16130. }
  16131. }
  16132. return elem;
  16133. }
  16134. jQuery.extend( {
  16135. htmlPrefilter: function( html ) {
  16136. return html;
  16137. },
  16138. clone: function( elem, dataAndEvents, deepDataAndEvents ) {
  16139. var i, l, srcElements, destElements,
  16140. clone = elem.cloneNode( true ),
  16141. inPage = isAttached( elem );
  16142. // Fix IE cloning issues
  16143. if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
  16144. !jQuery.isXMLDoc( elem ) ) {
  16145. // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2
  16146. destElements = getAll( clone );
  16147. srcElements = getAll( elem );
  16148. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  16149. fixInput( srcElements[ i ], destElements[ i ] );
  16150. }
  16151. }
  16152. // Copy the events from the original to the clone
  16153. if ( dataAndEvents ) {
  16154. if ( deepDataAndEvents ) {
  16155. srcElements = srcElements || getAll( elem );
  16156. destElements = destElements || getAll( clone );
  16157. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  16158. cloneCopyEvent( srcElements[ i ], destElements[ i ] );
  16159. }
  16160. } else {
  16161. cloneCopyEvent( elem, clone );
  16162. }
  16163. }
  16164. // Preserve script evaluation history
  16165. destElements = getAll( clone, "script" );
  16166. if ( destElements.length > 0 ) {
  16167. setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
  16168. }
  16169. // Return the cloned set
  16170. return clone;
  16171. },
  16172. cleanData: function( elems ) {
  16173. var data, elem, type,
  16174. special = jQuery.event.special,
  16175. i = 0;
  16176. for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
  16177. if ( acceptData( elem ) ) {
  16178. if ( ( data = elem[ dataPriv.expando ] ) ) {
  16179. if ( data.events ) {
  16180. for ( type in data.events ) {
  16181. if ( special[ type ] ) {
  16182. jQuery.event.remove( elem, type );
  16183. // This is a shortcut to avoid jQuery.event.remove's overhead
  16184. } else {
  16185. jQuery.removeEvent( elem, type, data.handle );
  16186. }
  16187. }
  16188. }
  16189. // Support: Chrome <=35 - 45+
  16190. // Assign undefined instead of using delete, see Data#remove
  16191. elem[ dataPriv.expando ] = undefined;
  16192. }
  16193. if ( elem[ dataUser.expando ] ) {
  16194. // Support: Chrome <=35 - 45+
  16195. // Assign undefined instead of using delete, see Data#remove
  16196. elem[ dataUser.expando ] = undefined;
  16197. }
  16198. }
  16199. }
  16200. }
  16201. } );
  16202. jQuery.fn.extend( {
  16203. detach: function( selector ) {
  16204. return remove( this, selector, true );
  16205. },
  16206. remove: function( selector ) {
  16207. return remove( this, selector );
  16208. },
  16209. text: function( value ) {
  16210. return access( this, function( value ) {
  16211. return value === undefined ?
  16212. jQuery.text( this ) :
  16213. this.empty().each( function() {
  16214. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  16215. this.textContent = value;
  16216. }
  16217. } );
  16218. }, null, value, arguments.length );
  16219. },
  16220. append: function() {
  16221. return domManip( this, arguments, function( elem ) {
  16222. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  16223. var target = manipulationTarget( this, elem );
  16224. target.appendChild( elem );
  16225. }
  16226. } );
  16227. },
  16228. prepend: function() {
  16229. return domManip( this, arguments, function( elem ) {
  16230. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  16231. var target = manipulationTarget( this, elem );
  16232. target.insertBefore( elem, target.firstChild );
  16233. }
  16234. } );
  16235. },
  16236. before: function() {
  16237. return domManip( this, arguments, function( elem ) {
  16238. if ( this.parentNode ) {
  16239. this.parentNode.insertBefore( elem, this );
  16240. }
  16241. } );
  16242. },
  16243. after: function() {
  16244. return domManip( this, arguments, function( elem ) {
  16245. if ( this.parentNode ) {
  16246. this.parentNode.insertBefore( elem, this.nextSibling );
  16247. }
  16248. } );
  16249. },
  16250. empty: function() {
  16251. var elem,
  16252. i = 0;
  16253. for ( ; ( elem = this[ i ] ) != null; i++ ) {
  16254. if ( elem.nodeType === 1 ) {
  16255. // Prevent memory leaks
  16256. jQuery.cleanData( getAll( elem, false ) );
  16257. // Remove any remaining nodes
  16258. elem.textContent = "";
  16259. }
  16260. }
  16261. return this;
  16262. },
  16263. clone: function( dataAndEvents, deepDataAndEvents ) {
  16264. dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
  16265. deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
  16266. return this.map( function() {
  16267. return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
  16268. } );
  16269. },
  16270. html: function( value ) {
  16271. return access( this, function( value ) {
  16272. var elem = this[ 0 ] || {},
  16273. i = 0,
  16274. l = this.length;
  16275. if ( value === undefined && elem.nodeType === 1 ) {
  16276. return elem.innerHTML;
  16277. }
  16278. // See if we can take a shortcut and just use innerHTML
  16279. if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
  16280. !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
  16281. value = jQuery.htmlPrefilter( value );
  16282. try {
  16283. for ( ; i < l; i++ ) {
  16284. elem = this[ i ] || {};
  16285. // Remove element nodes and prevent memory leaks
  16286. if ( elem.nodeType === 1 ) {
  16287. jQuery.cleanData( getAll( elem, false ) );
  16288. elem.innerHTML = value;
  16289. }
  16290. }
  16291. elem = 0;
  16292. // If using innerHTML throws an exception, use the fallback method
  16293. } catch ( e ) {}
  16294. }
  16295. if ( elem ) {
  16296. this.empty().append( value );
  16297. }
  16298. }, null, value, arguments.length );
  16299. },
  16300. replaceWith: function() {
  16301. var ignored = [];
  16302. // Make the changes, replacing each non-ignored context element with the new content
  16303. return domManip( this, arguments, function( elem ) {
  16304. var parent = this.parentNode;
  16305. if ( jQuery.inArray( this, ignored ) < 0 ) {
  16306. jQuery.cleanData( getAll( this ) );
  16307. if ( parent ) {
  16308. parent.replaceChild( elem, this );
  16309. }
  16310. }
  16311. // Force callback invocation
  16312. }, ignored );
  16313. }
  16314. } );
  16315. jQuery.each( {
  16316. appendTo: "append",
  16317. prependTo: "prepend",
  16318. insertBefore: "before",
  16319. insertAfter: "after",
  16320. replaceAll: "replaceWith"
  16321. }, function( name, original ) {
  16322. jQuery.fn[ name ] = function( selector ) {
  16323. var elems,
  16324. ret = [],
  16325. insert = jQuery( selector ),
  16326. last = insert.length - 1,
  16327. i = 0;
  16328. for ( ; i <= last; i++ ) {
  16329. elems = i === last ? this : this.clone( true );
  16330. jQuery( insert[ i ] )[ original ]( elems );
  16331. // Support: Android <=4.0 only, PhantomJS 1 only
  16332. // .get() because push.apply(_, arraylike) throws on ancient WebKit
  16333. push.apply( ret, elems.get() );
  16334. }
  16335. return this.pushStack( ret );
  16336. };
  16337. } );
  16338. var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
  16339. var getStyles = function( elem ) {
  16340. // Support: IE <=11 only, Firefox <=30 (#15098, #14150)
  16341. // IE throws on elements created in popups
  16342. // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
  16343. var view = elem.ownerDocument.defaultView;
  16344. if ( !view || !view.opener ) {
  16345. view = window;
  16346. }
  16347. return view.getComputedStyle( elem );
  16348. };
  16349. var swap = function( elem, options, callback ) {
  16350. var ret, name,
  16351. old = {};
  16352. // Remember the old values, and insert the new ones
  16353. for ( name in options ) {
  16354. old[ name ] = elem.style[ name ];
  16355. elem.style[ name ] = options[ name ];
  16356. }
  16357. ret = callback.call( elem );
  16358. // Revert the old values
  16359. for ( name in options ) {
  16360. elem.style[ name ] = old[ name ];
  16361. }
  16362. return ret;
  16363. };
  16364. var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
  16365. ( function() {
  16366. // Executing both pixelPosition & boxSizingReliable tests require only one layout
  16367. // so they're executed at the same time to save the second computation.
  16368. function computeStyleTests() {
  16369. // This is a singleton, we need to execute it only once
  16370. if ( !div ) {
  16371. return;
  16372. }
  16373. container.style.cssText = "position:absolute;left:-11111px;width:60px;" +
  16374. "margin-top:1px;padding:0;border:0";
  16375. div.style.cssText =
  16376. "position:relative;display:block;box-sizing:border-box;overflow:scroll;" +
  16377. "margin:auto;border:1px;padding:1px;" +
  16378. "width:60%;top:1%";
  16379. documentElement.appendChild( container ).appendChild( div );
  16380. var divStyle = window.getComputedStyle( div );
  16381. pixelPositionVal = divStyle.top !== "1%";
  16382. // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
  16383. reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;
  16384. // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3
  16385. // Some styles come back with percentage values, even though they shouldn't
  16386. div.style.right = "60%";
  16387. pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;
  16388. // Support: IE 9 - 11 only
  16389. // Detect misreporting of content dimensions for box-sizing:border-box elements
  16390. boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;
  16391. // Support: IE 9 only
  16392. // Detect overflow:scroll screwiness (gh-3699)
  16393. // Support: Chrome <=64
  16394. // Don't get tricked when zoom affects offsetWidth (gh-4029)
  16395. div.style.position = "absolute";
  16396. scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;
  16397. documentElement.removeChild( container );
  16398. // Nullify the div so it wouldn't be stored in the memory and
  16399. // it will also be a sign that checks already performed
  16400. div = null;
  16401. }
  16402. function roundPixelMeasures( measure ) {
  16403. return Math.round( parseFloat( measure ) );
  16404. }
  16405. var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,
  16406. reliableTrDimensionsVal, reliableMarginLeftVal,
  16407. container = document.createElement( "div" ),
  16408. div = document.createElement( "div" );
  16409. // Finish early in limited (non-browser) environments
  16410. if ( !div.style ) {
  16411. return;
  16412. }
  16413. // Support: IE <=9 - 11 only
  16414. // Style of cloned element affects source element cloned (#8908)
  16415. div.style.backgroundClip = "content-box";
  16416. div.cloneNode( true ).style.backgroundClip = "";
  16417. support.clearCloneStyle = div.style.backgroundClip === "content-box";
  16418. jQuery.extend( support, {
  16419. boxSizingReliable: function() {
  16420. computeStyleTests();
  16421. return boxSizingReliableVal;
  16422. },
  16423. pixelBoxStyles: function() {
  16424. computeStyleTests();
  16425. return pixelBoxStylesVal;
  16426. },
  16427. pixelPosition: function() {
  16428. computeStyleTests();
  16429. return pixelPositionVal;
  16430. },
  16431. reliableMarginLeft: function() {
  16432. computeStyleTests();
  16433. return reliableMarginLeftVal;
  16434. },
  16435. scrollboxSize: function() {
  16436. computeStyleTests();
  16437. return scrollboxSizeVal;
  16438. },
  16439. // Support: IE 9 - 11+, Edge 15 - 18+
  16440. // IE/Edge misreport `getComputedStyle` of table rows with width/height
  16441. // set in CSS while `offset*` properties report correct values.
  16442. // Behavior in IE 9 is more subtle than in newer versions & it passes
  16443. // some versions of this test; make sure not to make it pass there!
  16444. reliableTrDimensions: function() {
  16445. var table, tr, trChild, trStyle;
  16446. if ( reliableTrDimensionsVal == null ) {
  16447. table = document.createElement( "table" );
  16448. tr = document.createElement( "tr" );
  16449. trChild = document.createElement( "div" );
  16450. table.style.cssText = "position:absolute;left:-11111px";
  16451. tr.style.height = "1px";
  16452. trChild.style.height = "9px";
  16453. documentElement
  16454. .appendChild( table )
  16455. .appendChild( tr )
  16456. .appendChild( trChild );
  16457. trStyle = window.getComputedStyle( tr );
  16458. reliableTrDimensionsVal = parseInt( trStyle.height ) > 3;
  16459. documentElement.removeChild( table );
  16460. }
  16461. return reliableTrDimensionsVal;
  16462. }
  16463. } );
  16464. } )();
  16465. function curCSS( elem, name, computed ) {
  16466. var width, minWidth, maxWidth, ret,
  16467. // Support: Firefox 51+
  16468. // Retrieving style before computed somehow
  16469. // fixes an issue with getting wrong values
  16470. // on detached elements
  16471. style = elem.style;
  16472. computed = computed || getStyles( elem );
  16473. // getPropertyValue is needed for:
  16474. // .css('filter') (IE 9 only, #12537)
  16475. // .css('--customProperty) (#3144)
  16476. if ( computed ) {
  16477. ret = computed.getPropertyValue( name ) || computed[ name ];
  16478. if ( ret === "" && !isAttached( elem ) ) {
  16479. ret = jQuery.style( elem, name );
  16480. }
  16481. // A tribute to the "awesome hack by Dean Edwards"
  16482. // Android Browser returns percentage for some values,
  16483. // but width seems to be reliably pixels.
  16484. // This is against the CSSOM draft spec:
  16485. // https://drafts.csswg.org/cssom/#resolved-values
  16486. if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {
  16487. // Remember the original values
  16488. width = style.width;
  16489. minWidth = style.minWidth;
  16490. maxWidth = style.maxWidth;
  16491. // Put in the new values to get a computed value out
  16492. style.minWidth = style.maxWidth = style.width = ret;
  16493. ret = computed.width;
  16494. // Revert the changed values
  16495. style.width = width;
  16496. style.minWidth = minWidth;
  16497. style.maxWidth = maxWidth;
  16498. }
  16499. }
  16500. return ret !== undefined ?
  16501. // Support: IE <=9 - 11 only
  16502. // IE returns zIndex value as an integer.
  16503. ret + "" :
  16504. ret;
  16505. }
  16506. function addGetHookIf( conditionFn, hookFn ) {
  16507. // Define the hook, we'll check on the first run if it's really needed.
  16508. return {
  16509. get: function() {
  16510. if ( conditionFn() ) {
  16511. // Hook not needed (or it's not possible to use it due
  16512. // to missing dependency), remove it.
  16513. delete this.get;
  16514. return;
  16515. }
  16516. // Hook needed; redefine it so that the support test is not executed again.
  16517. return ( this.get = hookFn ).apply( this, arguments );
  16518. }
  16519. };
  16520. }
  16521. var cssPrefixes = [ "Webkit", "Moz", "ms" ],
  16522. emptyStyle = document.createElement( "div" ).style,
  16523. vendorProps = {};
  16524. // Return a vendor-prefixed property or undefined
  16525. function vendorPropName( name ) {
  16526. // Check for vendor prefixed names
  16527. var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
  16528. i = cssPrefixes.length;
  16529. while ( i-- ) {
  16530. name = cssPrefixes[ i ] + capName;
  16531. if ( name in emptyStyle ) {
  16532. return name;
  16533. }
  16534. }
  16535. }
  16536. // Return a potentially-mapped jQuery.cssProps or vendor prefixed property
  16537. function finalPropName( name ) {
  16538. var final = jQuery.cssProps[ name ] || vendorProps[ name ];
  16539. if ( final ) {
  16540. return final;
  16541. }
  16542. if ( name in emptyStyle ) {
  16543. return name;
  16544. }
  16545. return vendorProps[ name ] = vendorPropName( name ) || name;
  16546. }
  16547. var
  16548. // Swappable if display is none or starts with table
  16549. // except "table", "table-cell", or "table-caption"
  16550. // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
  16551. rdisplayswap = /^(none|table(?!-c[ea]).+)/,
  16552. rcustomProp = /^--/,
  16553. cssShow = { position: "absolute", visibility: "hidden", display: "block" },
  16554. cssNormalTransform = {
  16555. letterSpacing: "0",
  16556. fontWeight: "400"
  16557. };
  16558. function setPositiveNumber( _elem, value, subtract ) {
  16559. // Any relative (+/-) values have already been
  16560. // normalized at this point
  16561. var matches = rcssNum.exec( value );
  16562. return matches ?
  16563. // Guard against undefined "subtract", e.g., when used as in cssHooks
  16564. Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
  16565. value;
  16566. }
  16567. function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {
  16568. var i = dimension === "width" ? 1 : 0,
  16569. extra = 0,
  16570. delta = 0;
  16571. // Adjustment may not be necessary
  16572. if ( box === ( isBorderBox ? "border" : "content" ) ) {
  16573. return 0;
  16574. }
  16575. for ( ; i < 4; i += 2 ) {
  16576. // Both box models exclude margin
  16577. if ( box === "margin" ) {
  16578. delta += jQuery.css( elem, box + cssExpand[ i ], true, styles );
  16579. }
  16580. // If we get here with a content-box, we're seeking "padding" or "border" or "margin"
  16581. if ( !isBorderBox ) {
  16582. // Add padding
  16583. delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  16584. // For "border" or "margin", add border
  16585. if ( box !== "padding" ) {
  16586. delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  16587. // But still keep track of it otherwise
  16588. } else {
  16589. extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  16590. }
  16591. // If we get here with a border-box (content + padding + border), we're seeking "content" or
  16592. // "padding" or "margin"
  16593. } else {
  16594. // For "content", subtract padding
  16595. if ( box === "content" ) {
  16596. delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  16597. }
  16598. // For "content" or "padding", subtract border
  16599. if ( box !== "margin" ) {
  16600. delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  16601. }
  16602. }
  16603. }
  16604. // Account for positive content-box scroll gutter when requested by providing computedVal
  16605. if ( !isBorderBox && computedVal >= 0 ) {
  16606. // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border
  16607. // Assuming integer scroll gutter, subtract the rest and round down
  16608. delta += Math.max( 0, Math.ceil(
  16609. elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
  16610. computedVal -
  16611. delta -
  16612. extra -
  16613. 0.5
  16614. // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter
  16615. // Use an explicit zero to avoid NaN (gh-3964)
  16616. ) ) || 0;
  16617. }
  16618. return delta;
  16619. }
  16620. function getWidthOrHeight( elem, dimension, extra ) {
  16621. // Start with computed style
  16622. var styles = getStyles( elem ),
  16623. // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).
  16624. // Fake content-box until we know it's needed to know the true value.
  16625. boxSizingNeeded = !support.boxSizingReliable() || extra,
  16626. isBorderBox = boxSizingNeeded &&
  16627. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  16628. valueIsBorderBox = isBorderBox,
  16629. val = curCSS( elem, dimension, styles ),
  16630. offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );
  16631. // Support: Firefox <=54
  16632. // Return a confounding non-pixel value or feign ignorance, as appropriate.
  16633. if ( rnumnonpx.test( val ) ) {
  16634. if ( !extra ) {
  16635. return val;
  16636. }
  16637. val = "auto";
  16638. }
  16639. // Support: IE 9 - 11 only
  16640. // Use offsetWidth/offsetHeight for when box sizing is unreliable.
  16641. // In those cases, the computed value can be trusted to be border-box.
  16642. if ( ( !support.boxSizingReliable() && isBorderBox ||
  16643. // Support: IE 10 - 11+, Edge 15 - 18+
  16644. // IE/Edge misreport `getComputedStyle` of table rows with width/height
  16645. // set in CSS while `offset*` properties report correct values.
  16646. // Interestingly, in some cases IE 9 doesn't suffer from this issue.
  16647. !support.reliableTrDimensions() && nodeName( elem, "tr" ) ||
  16648. // Fall back to offsetWidth/offsetHeight when value is "auto"
  16649. // This happens for inline elements with no explicit setting (gh-3571)
  16650. val === "auto" ||
  16651. // Support: Android <=4.1 - 4.3 only
  16652. // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)
  16653. !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) &&
  16654. // Make sure the element is visible & connected
  16655. elem.getClientRects().length ) {
  16656. isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
  16657. // Where available, offsetWidth/offsetHeight approximate border box dimensions.
  16658. // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the
  16659. // retrieved value as a content box dimension.
  16660. valueIsBorderBox = offsetProp in elem;
  16661. if ( valueIsBorderBox ) {
  16662. val = elem[ offsetProp ];
  16663. }
  16664. }
  16665. // Normalize "" and auto
  16666. val = parseFloat( val ) || 0;
  16667. // Adjust for the element's box model
  16668. return ( val +
  16669. boxModelAdjustment(
  16670. elem,
  16671. dimension,
  16672. extra || ( isBorderBox ? "border" : "content" ),
  16673. valueIsBorderBox,
  16674. styles,
  16675. // Provide the current computed size to request scroll gutter calculation (gh-3589)
  16676. val
  16677. )
  16678. ) + "px";
  16679. }
  16680. jQuery.extend( {
  16681. // Add in style property hooks for overriding the default
  16682. // behavior of getting and setting a style property
  16683. cssHooks: {
  16684. opacity: {
  16685. get: function( elem, computed ) {
  16686. if ( computed ) {
  16687. // We should always get a number back from opacity
  16688. var ret = curCSS( elem, "opacity" );
  16689. return ret === "" ? "1" : ret;
  16690. }
  16691. }
  16692. }
  16693. },
  16694. // Don't automatically add "px" to these possibly-unitless properties
  16695. cssNumber: {
  16696. "animationIterationCount": true,
  16697. "columnCount": true,
  16698. "fillOpacity": true,
  16699. "flexGrow": true,
  16700. "flexShrink": true,
  16701. "fontWeight": true,
  16702. "gridArea": true,
  16703. "gridColumn": true,
  16704. "gridColumnEnd": true,
  16705. "gridColumnStart": true,
  16706. "gridRow": true,
  16707. "gridRowEnd": true,
  16708. "gridRowStart": true,
  16709. "lineHeight": true,
  16710. "opacity": true,
  16711. "order": true,
  16712. "orphans": true,
  16713. "widows": true,
  16714. "zIndex": true,
  16715. "zoom": true
  16716. },
  16717. // Add in properties whose names you wish to fix before
  16718. // setting or getting the value
  16719. cssProps: {},
  16720. // Get and set the style property on a DOM Node
  16721. style: function( elem, name, value, extra ) {
  16722. // Don't set styles on text and comment nodes
  16723. if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
  16724. return;
  16725. }
  16726. // Make sure that we're working with the right name
  16727. var ret, type, hooks,
  16728. origName = camelCase( name ),
  16729. isCustomProp = rcustomProp.test( name ),
  16730. style = elem.style;
  16731. // Make sure that we're working with the right name. We don't
  16732. // want to query the value if it is a CSS custom property
  16733. // since they are user-defined.
  16734. if ( !isCustomProp ) {
  16735. name = finalPropName( origName );
  16736. }
  16737. // Gets hook for the prefixed version, then unprefixed version
  16738. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  16739. // Check if we're setting a value
  16740. if ( value !== undefined ) {
  16741. type = typeof value;
  16742. // Convert "+=" or "-=" to relative numbers (#7345)
  16743. if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
  16744. value = adjustCSS( elem, name, ret );
  16745. // Fixes bug #9237
  16746. type = "number";
  16747. }
  16748. // Make sure that null and NaN values aren't set (#7116)
  16749. if ( value == null || value !== value ) {
  16750. return;
  16751. }
  16752. // If a number was passed in, add the unit (except for certain CSS properties)
  16753. // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append
  16754. // "px" to a few hardcoded values.
  16755. if ( type === "number" && !isCustomProp ) {
  16756. value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
  16757. }
  16758. // background-* props affect original clone's values
  16759. if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
  16760. style[ name ] = "inherit";
  16761. }
  16762. // If a hook was provided, use that value, otherwise just set the specified value
  16763. if ( !hooks || !( "set" in hooks ) ||
  16764. ( value = hooks.set( elem, value, extra ) ) !== undefined ) {
  16765. if ( isCustomProp ) {
  16766. style.setProperty( name, value );
  16767. } else {
  16768. style[ name ] = value;
  16769. }
  16770. }
  16771. } else {
  16772. // If a hook was provided get the non-computed value from there
  16773. if ( hooks && "get" in hooks &&
  16774. ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
  16775. return ret;
  16776. }
  16777. // Otherwise just get the value from the style object
  16778. return style[ name ];
  16779. }
  16780. },
  16781. css: function( elem, name, extra, styles ) {
  16782. var val, num, hooks,
  16783. origName = camelCase( name ),
  16784. isCustomProp = rcustomProp.test( name );
  16785. // Make sure that we're working with the right name. We don't
  16786. // want to modify the value if it is a CSS custom property
  16787. // since they are user-defined.
  16788. if ( !isCustomProp ) {
  16789. name = finalPropName( origName );
  16790. }
  16791. // Try prefixed name followed by the unprefixed name
  16792. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  16793. // If a hook was provided get the computed value from there
  16794. if ( hooks && "get" in hooks ) {
  16795. val = hooks.get( elem, true, extra );
  16796. }
  16797. // Otherwise, if a way to get the computed value exists, use that
  16798. if ( val === undefined ) {
  16799. val = curCSS( elem, name, styles );
  16800. }
  16801. // Convert "normal" to computed value
  16802. if ( val === "normal" && name in cssNormalTransform ) {
  16803. val = cssNormalTransform[ name ];
  16804. }
  16805. // Make numeric if forced or a qualifier was provided and val looks numeric
  16806. if ( extra === "" || extra ) {
  16807. num = parseFloat( val );
  16808. return extra === true || isFinite( num ) ? num || 0 : val;
  16809. }
  16810. return val;
  16811. }
  16812. } );
  16813. jQuery.each( [ "height", "width" ], function( _i, dimension ) {
  16814. jQuery.cssHooks[ dimension ] = {
  16815. get: function( elem, computed, extra ) {
  16816. if ( computed ) {
  16817. // Certain elements can have dimension info if we invisibly show them
  16818. // but it must have a current display style that would benefit
  16819. return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
  16820. // Support: Safari 8+
  16821. // Table columns in Safari have non-zero offsetWidth & zero
  16822. // getBoundingClientRect().width unless display is changed.
  16823. // Support: IE <=11 only
  16824. // Running getBoundingClientRect on a disconnected node
  16825. // in IE throws an error.
  16826. ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
  16827. swap( elem, cssShow, function() {
  16828. return getWidthOrHeight( elem, dimension, extra );
  16829. } ) :
  16830. getWidthOrHeight( elem, dimension, extra );
  16831. }
  16832. },
  16833. set: function( elem, value, extra ) {
  16834. var matches,
  16835. styles = getStyles( elem ),
  16836. // Only read styles.position if the test has a chance to fail
  16837. // to avoid forcing a reflow.
  16838. scrollboxSizeBuggy = !support.scrollboxSize() &&
  16839. styles.position === "absolute",
  16840. // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)
  16841. boxSizingNeeded = scrollboxSizeBuggy || extra,
  16842. isBorderBox = boxSizingNeeded &&
  16843. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  16844. subtract = extra ?
  16845. boxModelAdjustment(
  16846. elem,
  16847. dimension,
  16848. extra,
  16849. isBorderBox,
  16850. styles
  16851. ) :
  16852. 0;
  16853. // Account for unreliable border-box dimensions by comparing offset* to computed and
  16854. // faking a content-box to get border and padding (gh-3699)
  16855. if ( isBorderBox && scrollboxSizeBuggy ) {
  16856. subtract -= Math.ceil(
  16857. elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
  16858. parseFloat( styles[ dimension ] ) -
  16859. boxModelAdjustment( elem, dimension, "border", false, styles ) -
  16860. 0.5
  16861. );
  16862. }
  16863. // Convert to pixels if value adjustment is needed
  16864. if ( subtract && ( matches = rcssNum.exec( value ) ) &&
  16865. ( matches[ 3 ] || "px" ) !== "px" ) {
  16866. elem.style[ dimension ] = value;
  16867. value = jQuery.css( elem, dimension );
  16868. }
  16869. return setPositiveNumber( elem, value, subtract );
  16870. }
  16871. };
  16872. } );
  16873. jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
  16874. function( elem, computed ) {
  16875. if ( computed ) {
  16876. return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
  16877. elem.getBoundingClientRect().left -
  16878. swap( elem, { marginLeft: 0 }, function() {
  16879. return elem.getBoundingClientRect().left;
  16880. } )
  16881. ) + "px";
  16882. }
  16883. }
  16884. );
  16885. // These hooks are used by animate to expand properties
  16886. jQuery.each( {
  16887. margin: "",
  16888. padding: "",
  16889. border: "Width"
  16890. }, function( prefix, suffix ) {
  16891. jQuery.cssHooks[ prefix + suffix ] = {
  16892. expand: function( value ) {
  16893. var i = 0,
  16894. expanded = {},
  16895. // Assumes a single number if not a string
  16896. parts = typeof value === "string" ? value.split( " " ) : [ value ];
  16897. for ( ; i < 4; i++ ) {
  16898. expanded[ prefix + cssExpand[ i ] + suffix ] =
  16899. parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
  16900. }
  16901. return expanded;
  16902. }
  16903. };
  16904. if ( prefix !== "margin" ) {
  16905. jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
  16906. }
  16907. } );
  16908. jQuery.fn.extend( {
  16909. css: function( name, value ) {
  16910. return access( this, function( elem, name, value ) {
  16911. var styles, len,
  16912. map = {},
  16913. i = 0;
  16914. if ( Array.isArray( name ) ) {
  16915. styles = getStyles( elem );
  16916. len = name.length;
  16917. for ( ; i < len; i++ ) {
  16918. map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
  16919. }
  16920. return map;
  16921. }
  16922. return value !== undefined ?
  16923. jQuery.style( elem, name, value ) :
  16924. jQuery.css( elem, name );
  16925. }, name, value, arguments.length > 1 );
  16926. }
  16927. } );
  16928. function Tween( elem, options, prop, end, easing ) {
  16929. return new Tween.prototype.init( elem, options, prop, end, easing );
  16930. }
  16931. jQuery.Tween = Tween;
  16932. Tween.prototype = {
  16933. constructor: Tween,
  16934. init: function( elem, options, prop, end, easing, unit ) {
  16935. this.elem = elem;
  16936. this.prop = prop;
  16937. this.easing = easing || jQuery.easing._default;
  16938. this.options = options;
  16939. this.start = this.now = this.cur();
  16940. this.end = end;
  16941. this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
  16942. },
  16943. cur: function() {
  16944. var hooks = Tween.propHooks[ this.prop ];
  16945. return hooks && hooks.get ?
  16946. hooks.get( this ) :
  16947. Tween.propHooks._default.get( this );
  16948. },
  16949. run: function( percent ) {
  16950. var eased,
  16951. hooks = Tween.propHooks[ this.prop ];
  16952. if ( this.options.duration ) {
  16953. this.pos = eased = jQuery.easing[ this.easing ](
  16954. percent, this.options.duration * percent, 0, 1, this.options.duration
  16955. );
  16956. } else {
  16957. this.pos = eased = percent;
  16958. }
  16959. this.now = ( this.end - this.start ) * eased + this.start;
  16960. if ( this.options.step ) {
  16961. this.options.step.call( this.elem, this.now, this );
  16962. }
  16963. if ( hooks && hooks.set ) {
  16964. hooks.set( this );
  16965. } else {
  16966. Tween.propHooks._default.set( this );
  16967. }
  16968. return this;
  16969. }
  16970. };
  16971. Tween.prototype.init.prototype = Tween.prototype;
  16972. Tween.propHooks = {
  16973. _default: {
  16974. get: function( tween ) {
  16975. var result;
  16976. // Use a property on the element directly when it is not a DOM element,
  16977. // or when there is no matching style property that exists.
  16978. if ( tween.elem.nodeType !== 1 ||
  16979. tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
  16980. return tween.elem[ tween.prop ];
  16981. }
  16982. // Passing an empty string as a 3rd parameter to .css will automatically
  16983. // attempt a parseFloat and fallback to a string if the parse fails.
  16984. // Simple values such as "10px" are parsed to Float;
  16985. // complex values such as "rotate(1rad)" are returned as-is.
  16986. result = jQuery.css( tween.elem, tween.prop, "" );
  16987. // Empty strings, null, undefined and "auto" are converted to 0.
  16988. return !result || result === "auto" ? 0 : result;
  16989. },
  16990. set: function( tween ) {
  16991. // Use step hook for back compat.
  16992. // Use cssHook if its there.
  16993. // Use .style if available and use plain properties where available.
  16994. if ( jQuery.fx.step[ tween.prop ] ) {
  16995. jQuery.fx.step[ tween.prop ]( tween );
  16996. } else if ( tween.elem.nodeType === 1 && (
  16997. jQuery.cssHooks[ tween.prop ] ||
  16998. tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {
  16999. jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
  17000. } else {
  17001. tween.elem[ tween.prop ] = tween.now;
  17002. }
  17003. }
  17004. }
  17005. };
  17006. // Support: IE <=9 only
  17007. // Panic based approach to setting things on disconnected nodes
  17008. Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
  17009. set: function( tween ) {
  17010. if ( tween.elem.nodeType && tween.elem.parentNode ) {
  17011. tween.elem[ tween.prop ] = tween.now;
  17012. }
  17013. }
  17014. };
  17015. jQuery.easing = {
  17016. linear: function( p ) {
  17017. return p;
  17018. },
  17019. swing: function( p ) {
  17020. return 0.5 - Math.cos( p * Math.PI ) / 2;
  17021. },
  17022. _default: "swing"
  17023. };
  17024. jQuery.fx = Tween.prototype.init;
  17025. // Back compat <1.8 extension point
  17026. jQuery.fx.step = {};
  17027. var
  17028. fxNow, inProgress,
  17029. rfxtypes = /^(?:toggle|show|hide)$/,
  17030. rrun = /queueHooks$/;
  17031. function schedule() {
  17032. if ( inProgress ) {
  17033. if ( document.hidden === false && window.requestAnimationFrame ) {
  17034. window.requestAnimationFrame( schedule );
  17035. } else {
  17036. window.setTimeout( schedule, jQuery.fx.interval );
  17037. }
  17038. jQuery.fx.tick();
  17039. }
  17040. }
  17041. // Animations created synchronously will run synchronously
  17042. function createFxNow() {
  17043. window.setTimeout( function() {
  17044. fxNow = undefined;
  17045. } );
  17046. return ( fxNow = Date.now() );
  17047. }
  17048. // Generate parameters to create a standard animation
  17049. function genFx( type, includeWidth ) {
  17050. var which,
  17051. i = 0,
  17052. attrs = { height: type };
  17053. // If we include width, step value is 1 to do all cssExpand values,
  17054. // otherwise step value is 2 to skip over Left and Right
  17055. includeWidth = includeWidth ? 1 : 0;
  17056. for ( ; i < 4; i += 2 - includeWidth ) {
  17057. which = cssExpand[ i ];
  17058. attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
  17059. }
  17060. if ( includeWidth ) {
  17061. attrs.opacity = attrs.width = type;
  17062. }
  17063. return attrs;
  17064. }
  17065. function createTween( value, prop, animation ) {
  17066. var tween,
  17067. collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
  17068. index = 0,
  17069. length = collection.length;
  17070. for ( ; index < length; index++ ) {
  17071. if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
  17072. // We're done with this property
  17073. return tween;
  17074. }
  17075. }
  17076. }
  17077. function defaultPrefilter( elem, props, opts ) {
  17078. var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
  17079. isBox = "width" in props || "height" in props,
  17080. anim = this,
  17081. orig = {},
  17082. style = elem.style,
  17083. hidden = elem.nodeType && isHiddenWithinTree( elem ),
  17084. dataShow = dataPriv.get( elem, "fxshow" );
  17085. // Queue-skipping animations hijack the fx hooks
  17086. if ( !opts.queue ) {
  17087. hooks = jQuery._queueHooks( elem, "fx" );
  17088. if ( hooks.unqueued == null ) {
  17089. hooks.unqueued = 0;
  17090. oldfire = hooks.empty.fire;
  17091. hooks.empty.fire = function() {
  17092. if ( !hooks.unqueued ) {
  17093. oldfire();
  17094. }
  17095. };
  17096. }
  17097. hooks.unqueued++;
  17098. anim.always( function() {
  17099. // Ensure the complete handler is called before this completes
  17100. anim.always( function() {
  17101. hooks.unqueued--;
  17102. if ( !jQuery.queue( elem, "fx" ).length ) {
  17103. hooks.empty.fire();
  17104. }
  17105. } );
  17106. } );
  17107. }
  17108. // Detect show/hide animations
  17109. for ( prop in props ) {
  17110. value = props[ prop ];
  17111. if ( rfxtypes.test( value ) ) {
  17112. delete props[ prop ];
  17113. toggle = toggle || value === "toggle";
  17114. if ( value === ( hidden ? "hide" : "show" ) ) {
  17115. // Pretend to be hidden if this is a "show" and
  17116. // there is still data from a stopped show/hide
  17117. if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
  17118. hidden = true;
  17119. // Ignore all other no-op show/hide data
  17120. } else {
  17121. continue;
  17122. }
  17123. }
  17124. orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
  17125. }
  17126. }
  17127. // Bail out if this is a no-op like .hide().hide()
  17128. propTween = !jQuery.isEmptyObject( props );
  17129. if ( !propTween && jQuery.isEmptyObject( orig ) ) {
  17130. return;
  17131. }
  17132. // Restrict "overflow" and "display" styles during box animations
  17133. if ( isBox && elem.nodeType === 1 ) {
  17134. // Support: IE <=9 - 11, Edge 12 - 15
  17135. // Record all 3 overflow attributes because IE does not infer the shorthand
  17136. // from identically-valued overflowX and overflowY and Edge just mirrors
  17137. // the overflowX value there.
  17138. opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
  17139. // Identify a display type, preferring old show/hide data over the CSS cascade
  17140. restoreDisplay = dataShow && dataShow.display;
  17141. if ( restoreDisplay == null ) {
  17142. restoreDisplay = dataPriv.get( elem, "display" );
  17143. }
  17144. display = jQuery.css( elem, "display" );
  17145. if ( display === "none" ) {
  17146. if ( restoreDisplay ) {
  17147. display = restoreDisplay;
  17148. } else {
  17149. // Get nonempty value(s) by temporarily forcing visibility
  17150. showHide( [ elem ], true );
  17151. restoreDisplay = elem.style.display || restoreDisplay;
  17152. display = jQuery.css( elem, "display" );
  17153. showHide( [ elem ] );
  17154. }
  17155. }
  17156. // Animate inline elements as inline-block
  17157. if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) {
  17158. if ( jQuery.css( elem, "float" ) === "none" ) {
  17159. // Restore the original display value at the end of pure show/hide animations
  17160. if ( !propTween ) {
  17161. anim.done( function() {
  17162. style.display = restoreDisplay;
  17163. } );
  17164. if ( restoreDisplay == null ) {
  17165. display = style.display;
  17166. restoreDisplay = display === "none" ? "" : display;
  17167. }
  17168. }
  17169. style.display = "inline-block";
  17170. }
  17171. }
  17172. }
  17173. if ( opts.overflow ) {
  17174. style.overflow = "hidden";
  17175. anim.always( function() {
  17176. style.overflow = opts.overflow[ 0 ];
  17177. style.overflowX = opts.overflow[ 1 ];
  17178. style.overflowY = opts.overflow[ 2 ];
  17179. } );
  17180. }
  17181. // Implement show/hide animations
  17182. propTween = false;
  17183. for ( prop in orig ) {
  17184. // General show/hide setup for this element animation
  17185. if ( !propTween ) {
  17186. if ( dataShow ) {
  17187. if ( "hidden" in dataShow ) {
  17188. hidden = dataShow.hidden;
  17189. }
  17190. } else {
  17191. dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } );
  17192. }
  17193. // Store hidden/visible for toggle so `.stop().toggle()` "reverses"
  17194. if ( toggle ) {
  17195. dataShow.hidden = !hidden;
  17196. }
  17197. // Show elements before animating them
  17198. if ( hidden ) {
  17199. showHide( [ elem ], true );
  17200. }
  17201. /* eslint-disable no-loop-func */
  17202. anim.done( function() {
  17203. /* eslint-enable no-loop-func */
  17204. // The final step of a "hide" animation is actually hiding the element
  17205. if ( !hidden ) {
  17206. showHide( [ elem ] );
  17207. }
  17208. dataPriv.remove( elem, "fxshow" );
  17209. for ( prop in orig ) {
  17210. jQuery.style( elem, prop, orig[ prop ] );
  17211. }
  17212. } );
  17213. }
  17214. // Per-property setup
  17215. propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
  17216. if ( !( prop in dataShow ) ) {
  17217. dataShow[ prop ] = propTween.start;
  17218. if ( hidden ) {
  17219. propTween.end = propTween.start;
  17220. propTween.start = 0;
  17221. }
  17222. }
  17223. }
  17224. }
  17225. function propFilter( props, specialEasing ) {
  17226. var index, name, easing, value, hooks;
  17227. // camelCase, specialEasing and expand cssHook pass
  17228. for ( index in props ) {
  17229. name = camelCase( index );
  17230. easing = specialEasing[ name ];
  17231. value = props[ index ];
  17232. if ( Array.isArray( value ) ) {
  17233. easing = value[ 1 ];
  17234. value = props[ index ] = value[ 0 ];
  17235. }
  17236. if ( index !== name ) {
  17237. props[ name ] = value;
  17238. delete props[ index ];
  17239. }
  17240. hooks = jQuery.cssHooks[ name ];
  17241. if ( hooks && "expand" in hooks ) {
  17242. value = hooks.expand( value );
  17243. delete props[ name ];
  17244. // Not quite $.extend, this won't overwrite existing keys.
  17245. // Reusing 'index' because we have the correct "name"
  17246. for ( index in value ) {
  17247. if ( !( index in props ) ) {
  17248. props[ index ] = value[ index ];
  17249. specialEasing[ index ] = easing;
  17250. }
  17251. }
  17252. } else {
  17253. specialEasing[ name ] = easing;
  17254. }
  17255. }
  17256. }
  17257. function Animation( elem, properties, options ) {
  17258. var result,
  17259. stopped,
  17260. index = 0,
  17261. length = Animation.prefilters.length,
  17262. deferred = jQuery.Deferred().always( function() {
  17263. // Don't match elem in the :animated selector
  17264. delete tick.elem;
  17265. } ),
  17266. tick = function() {
  17267. if ( stopped ) {
  17268. return false;
  17269. }
  17270. var currentTime = fxNow || createFxNow(),
  17271. remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
  17272. // Support: Android 2.3 only
  17273. // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
  17274. temp = remaining / animation.duration || 0,
  17275. percent = 1 - temp,
  17276. index = 0,
  17277. length = animation.tweens.length;
  17278. for ( ; index < length; index++ ) {
  17279. animation.tweens[ index ].run( percent );
  17280. }
  17281. deferred.notifyWith( elem, [ animation, percent, remaining ] );
  17282. // If there's more to do, yield
  17283. if ( percent < 1 && length ) {
  17284. return remaining;
  17285. }
  17286. // If this was an empty animation, synthesize a final progress notification
  17287. if ( !length ) {
  17288. deferred.notifyWith( elem, [ animation, 1, 0 ] );
  17289. }
  17290. // Resolve the animation and report its conclusion
  17291. deferred.resolveWith( elem, [ animation ] );
  17292. return false;
  17293. },
  17294. animation = deferred.promise( {
  17295. elem: elem,
  17296. props: jQuery.extend( {}, properties ),
  17297. opts: jQuery.extend( true, {
  17298. specialEasing: {},
  17299. easing: jQuery.easing._default
  17300. }, options ),
  17301. originalProperties: properties,
  17302. originalOptions: options,
  17303. startTime: fxNow || createFxNow(),
  17304. duration: options.duration,
  17305. tweens: [],
  17306. createTween: function( prop, end ) {
  17307. var tween = jQuery.Tween( elem, animation.opts, prop, end,
  17308. animation.opts.specialEasing[ prop ] || animation.opts.easing );
  17309. animation.tweens.push( tween );
  17310. return tween;
  17311. },
  17312. stop: function( gotoEnd ) {
  17313. var index = 0,
  17314. // If we are going to the end, we want to run all the tweens
  17315. // otherwise we skip this part
  17316. length = gotoEnd ? animation.tweens.length : 0;
  17317. if ( stopped ) {
  17318. return this;
  17319. }
  17320. stopped = true;
  17321. for ( ; index < length; index++ ) {
  17322. animation.tweens[ index ].run( 1 );
  17323. }
  17324. // Resolve when we played the last frame; otherwise, reject
  17325. if ( gotoEnd ) {
  17326. deferred.notifyWith( elem, [ animation, 1, 0 ] );
  17327. deferred.resolveWith( elem, [ animation, gotoEnd ] );
  17328. } else {
  17329. deferred.rejectWith( elem, [ animation, gotoEnd ] );
  17330. }
  17331. return this;
  17332. }
  17333. } ),
  17334. props = animation.props;
  17335. propFilter( props, animation.opts.specialEasing );
  17336. for ( ; index < length; index++ ) {
  17337. result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
  17338. if ( result ) {
  17339. if ( isFunction( result.stop ) ) {
  17340. jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
  17341. result.stop.bind( result );
  17342. }
  17343. return result;
  17344. }
  17345. }
  17346. jQuery.map( props, createTween, animation );
  17347. if ( isFunction( animation.opts.start ) ) {
  17348. animation.opts.start.call( elem, animation );
  17349. }
  17350. // Attach callbacks from options
  17351. animation
  17352. .progress( animation.opts.progress )
  17353. .done( animation.opts.done, animation.opts.complete )
  17354. .fail( animation.opts.fail )
  17355. .always( animation.opts.always );
  17356. jQuery.fx.timer(
  17357. jQuery.extend( tick, {
  17358. elem: elem,
  17359. anim: animation,
  17360. queue: animation.opts.queue
  17361. } )
  17362. );
  17363. return animation;
  17364. }
  17365. jQuery.Animation = jQuery.extend( Animation, {
  17366. tweeners: {
  17367. "*": [ function( prop, value ) {
  17368. var tween = this.createTween( prop, value );
  17369. adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
  17370. return tween;
  17371. } ]
  17372. },
  17373. tweener: function( props, callback ) {
  17374. if ( isFunction( props ) ) {
  17375. callback = props;
  17376. props = [ "*" ];
  17377. } else {
  17378. props = props.match( rnothtmlwhite );
  17379. }
  17380. var prop,
  17381. index = 0,
  17382. length = props.length;
  17383. for ( ; index < length; index++ ) {
  17384. prop = props[ index ];
  17385. Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
  17386. Animation.tweeners[ prop ].unshift( callback );
  17387. }
  17388. },
  17389. prefilters: [ defaultPrefilter ],
  17390. prefilter: function( callback, prepend ) {
  17391. if ( prepend ) {
  17392. Animation.prefilters.unshift( callback );
  17393. } else {
  17394. Animation.prefilters.push( callback );
  17395. }
  17396. }
  17397. } );
  17398. jQuery.speed = function( speed, easing, fn ) {
  17399. var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
  17400. complete: fn || !fn && easing ||
  17401. isFunction( speed ) && speed,
  17402. duration: speed,
  17403. easing: fn && easing || easing && !isFunction( easing ) && easing
  17404. };
  17405. // Go to the end state if fx are off
  17406. if ( jQuery.fx.off ) {
  17407. opt.duration = 0;
  17408. } else {
  17409. if ( typeof opt.duration !== "number" ) {
  17410. if ( opt.duration in jQuery.fx.speeds ) {
  17411. opt.duration = jQuery.fx.speeds[ opt.duration ];
  17412. } else {
  17413. opt.duration = jQuery.fx.speeds._default;
  17414. }
  17415. }
  17416. }
  17417. // Normalize opt.queue - true/undefined/null -> "fx"
  17418. if ( opt.queue == null || opt.queue === true ) {
  17419. opt.queue = "fx";
  17420. }
  17421. // Queueing
  17422. opt.old = opt.complete;
  17423. opt.complete = function() {
  17424. if ( isFunction( opt.old ) ) {
  17425. opt.old.call( this );
  17426. }
  17427. if ( opt.queue ) {
  17428. jQuery.dequeue( this, opt.queue );
  17429. }
  17430. };
  17431. return opt;
  17432. };
  17433. jQuery.fn.extend( {
  17434. fadeTo: function( speed, to, easing, callback ) {
  17435. // Show any hidden elements after setting opacity to 0
  17436. return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()
  17437. // Animate to the value specified
  17438. .end().animate( { opacity: to }, speed, easing, callback );
  17439. },
  17440. animate: function( prop, speed, easing, callback ) {
  17441. var empty = jQuery.isEmptyObject( prop ),
  17442. optall = jQuery.speed( speed, easing, callback ),
  17443. doAnimation = function() {
  17444. // Operate on a copy of prop so per-property easing won't be lost
  17445. var anim = Animation( this, jQuery.extend( {}, prop ), optall );
  17446. // Empty animations, or finishing resolves immediately
  17447. if ( empty || dataPriv.get( this, "finish" ) ) {
  17448. anim.stop( true );
  17449. }
  17450. };
  17451. doAnimation.finish = doAnimation;
  17452. return empty || optall.queue === false ?
  17453. this.each( doAnimation ) :
  17454. this.queue( optall.queue, doAnimation );
  17455. },
  17456. stop: function( type, clearQueue, gotoEnd ) {
  17457. var stopQueue = function( hooks ) {
  17458. var stop = hooks.stop;
  17459. delete hooks.stop;
  17460. stop( gotoEnd );
  17461. };
  17462. if ( typeof type !== "string" ) {
  17463. gotoEnd = clearQueue;
  17464. clearQueue = type;
  17465. type = undefined;
  17466. }
  17467. if ( clearQueue ) {
  17468. this.queue( type || "fx", [] );
  17469. }
  17470. return this.each( function() {
  17471. var dequeue = true,
  17472. index = type != null && type + "queueHooks",
  17473. timers = jQuery.timers,
  17474. data = dataPriv.get( this );
  17475. if ( index ) {
  17476. if ( data[ index ] && data[ index ].stop ) {
  17477. stopQueue( data[ index ] );
  17478. }
  17479. } else {
  17480. for ( index in data ) {
  17481. if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
  17482. stopQueue( data[ index ] );
  17483. }
  17484. }
  17485. }
  17486. for ( index = timers.length; index--; ) {
  17487. if ( timers[ index ].elem === this &&
  17488. ( type == null || timers[ index ].queue === type ) ) {
  17489. timers[ index ].anim.stop( gotoEnd );
  17490. dequeue = false;
  17491. timers.splice( index, 1 );
  17492. }
  17493. }
  17494. // Start the next in the queue if the last step wasn't forced.
  17495. // Timers currently will call their complete callbacks, which
  17496. // will dequeue but only if they were gotoEnd.
  17497. if ( dequeue || !gotoEnd ) {
  17498. jQuery.dequeue( this, type );
  17499. }
  17500. } );
  17501. },
  17502. finish: function( type ) {
  17503. if ( type !== false ) {
  17504. type = type || "fx";
  17505. }
  17506. return this.each( function() {
  17507. var index,
  17508. data = dataPriv.get( this ),
  17509. queue = data[ type + "queue" ],
  17510. hooks = data[ type + "queueHooks" ],
  17511. timers = jQuery.timers,
  17512. length = queue ? queue.length : 0;
  17513. // Enable finishing flag on private data
  17514. data.finish = true;
  17515. // Empty the queue first
  17516. jQuery.queue( this, type, [] );
  17517. if ( hooks && hooks.stop ) {
  17518. hooks.stop.call( this, true );
  17519. }
  17520. // Look for any active animations, and finish them
  17521. for ( index = timers.length; index--; ) {
  17522. if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
  17523. timers[ index ].anim.stop( true );
  17524. timers.splice( index, 1 );
  17525. }
  17526. }
  17527. // Look for any animations in the old queue and finish them
  17528. for ( index = 0; index < length; index++ ) {
  17529. if ( queue[ index ] && queue[ index ].finish ) {
  17530. queue[ index ].finish.call( this );
  17531. }
  17532. }
  17533. // Turn off finishing flag
  17534. delete data.finish;
  17535. } );
  17536. }
  17537. } );
  17538. jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) {
  17539. var cssFn = jQuery.fn[ name ];
  17540. jQuery.fn[ name ] = function( speed, easing, callback ) {
  17541. return speed == null || typeof speed === "boolean" ?
  17542. cssFn.apply( this, arguments ) :
  17543. this.animate( genFx( name, true ), speed, easing, callback );
  17544. };
  17545. } );
  17546. // Generate shortcuts for custom animations
  17547. jQuery.each( {
  17548. slideDown: genFx( "show" ),
  17549. slideUp: genFx( "hide" ),
  17550. slideToggle: genFx( "toggle" ),
  17551. fadeIn: { opacity: "show" },
  17552. fadeOut: { opacity: "hide" },
  17553. fadeToggle: { opacity: "toggle" }
  17554. }, function( name, props ) {
  17555. jQuery.fn[ name ] = function( speed, easing, callback ) {
  17556. return this.animate( props, speed, easing, callback );
  17557. };
  17558. } );
  17559. jQuery.timers = [];
  17560. jQuery.fx.tick = function() {
  17561. var timer,
  17562. i = 0,
  17563. timers = jQuery.timers;
  17564. fxNow = Date.now();
  17565. for ( ; i < timers.length; i++ ) {
  17566. timer = timers[ i ];
  17567. // Run the timer and safely remove it when done (allowing for external removal)
  17568. if ( !timer() && timers[ i ] === timer ) {
  17569. timers.splice( i--, 1 );
  17570. }
  17571. }
  17572. if ( !timers.length ) {
  17573. jQuery.fx.stop();
  17574. }
  17575. fxNow = undefined;
  17576. };
  17577. jQuery.fx.timer = function( timer ) {
  17578. jQuery.timers.push( timer );
  17579. jQuery.fx.start();
  17580. };
  17581. jQuery.fx.interval = 13;
  17582. jQuery.fx.start = function() {
  17583. if ( inProgress ) {
  17584. return;
  17585. }
  17586. inProgress = true;
  17587. schedule();
  17588. };
  17589. jQuery.fx.stop = function() {
  17590. inProgress = null;
  17591. };
  17592. jQuery.fx.speeds = {
  17593. slow: 600,
  17594. fast: 200,
  17595. // Default speed
  17596. _default: 400
  17597. };
  17598. // Based off of the plugin by Clint Helfers, with permission.
  17599. // https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
  17600. jQuery.fn.delay = function( time, type ) {
  17601. time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
  17602. type = type || "fx";
  17603. return this.queue( type, function( next, hooks ) {
  17604. var timeout = window.setTimeout( next, time );
  17605. hooks.stop = function() {
  17606. window.clearTimeout( timeout );
  17607. };
  17608. } );
  17609. };
  17610. ( function() {
  17611. var input = document.createElement( "input" ),
  17612. select = document.createElement( "select" ),
  17613. opt = select.appendChild( document.createElement( "option" ) );
  17614. input.type = "checkbox";
  17615. // Support: Android <=4.3 only
  17616. // Default value for a checkbox should be "on"
  17617. support.checkOn = input.value !== "";
  17618. // Support: IE <=11 only
  17619. // Must access selectedIndex to make default options select
  17620. support.optSelected = opt.selected;
  17621. // Support: IE <=11 only
  17622. // An input loses its value after becoming a radio
  17623. input = document.createElement( "input" );
  17624. input.value = "t";
  17625. input.type = "radio";
  17626. support.radioValue = input.value === "t";
  17627. } )();
  17628. var boolHook,
  17629. attrHandle = jQuery.expr.attrHandle;
  17630. jQuery.fn.extend( {
  17631. attr: function( name, value ) {
  17632. return access( this, jQuery.attr, name, value, arguments.length > 1 );
  17633. },
  17634. removeAttr: function( name ) {
  17635. return this.each( function() {
  17636. jQuery.removeAttr( this, name );
  17637. } );
  17638. }
  17639. } );
  17640. jQuery.extend( {
  17641. attr: function( elem, name, value ) {
  17642. var ret, hooks,
  17643. nType = elem.nodeType;
  17644. // Don't get/set attributes on text, comment and attribute nodes
  17645. if ( nType === 3 || nType === 8 || nType === 2 ) {
  17646. return;
  17647. }
  17648. // Fallback to prop when attributes are not supported
  17649. if ( typeof elem.getAttribute === "undefined" ) {
  17650. return jQuery.prop( elem, name, value );
  17651. }
  17652. // Attribute hooks are determined by the lowercase version
  17653. // Grab necessary hook if one is defined
  17654. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  17655. hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
  17656. ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
  17657. }
  17658. if ( value !== undefined ) {
  17659. if ( value === null ) {
  17660. jQuery.removeAttr( elem, name );
  17661. return;
  17662. }
  17663. if ( hooks && "set" in hooks &&
  17664. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  17665. return ret;
  17666. }
  17667. elem.setAttribute( name, value + "" );
  17668. return value;
  17669. }
  17670. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  17671. return ret;
  17672. }
  17673. ret = jQuery.find.attr( elem, name );
  17674. // Non-existent attributes return null, we normalize to undefined
  17675. return ret == null ? undefined : ret;
  17676. },
  17677. attrHooks: {
  17678. type: {
  17679. set: function( elem, value ) {
  17680. if ( !support.radioValue && value === "radio" &&
  17681. nodeName( elem, "input" ) ) {
  17682. var val = elem.value;
  17683. elem.setAttribute( "type", value );
  17684. if ( val ) {
  17685. elem.value = val;
  17686. }
  17687. return value;
  17688. }
  17689. }
  17690. }
  17691. },
  17692. removeAttr: function( elem, value ) {
  17693. var name,
  17694. i = 0,
  17695. // Attribute names can contain non-HTML whitespace characters
  17696. // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
  17697. attrNames = value && value.match( rnothtmlwhite );
  17698. if ( attrNames && elem.nodeType === 1 ) {
  17699. while ( ( name = attrNames[ i++ ] ) ) {
  17700. elem.removeAttribute( name );
  17701. }
  17702. }
  17703. }
  17704. } );
  17705. // Hooks for boolean attributes
  17706. boolHook = {
  17707. set: function( elem, value, name ) {
  17708. if ( value === false ) {
  17709. // Remove boolean attributes when set to false
  17710. jQuery.removeAttr( elem, name );
  17711. } else {
  17712. elem.setAttribute( name, name );
  17713. }
  17714. return name;
  17715. }
  17716. };
  17717. jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) {
  17718. var getter = attrHandle[ name ] || jQuery.find.attr;
  17719. attrHandle[ name ] = function( elem, name, isXML ) {
  17720. var ret, handle,
  17721. lowercaseName = name.toLowerCase();
  17722. if ( !isXML ) {
  17723. // Avoid an infinite loop by temporarily removing this function from the getter
  17724. handle = attrHandle[ lowercaseName ];
  17725. attrHandle[ lowercaseName ] = ret;
  17726. ret = getter( elem, name, isXML ) != null ?
  17727. lowercaseName :
  17728. null;
  17729. attrHandle[ lowercaseName ] = handle;
  17730. }
  17731. return ret;
  17732. };
  17733. } );
  17734. var rfocusable = /^(?:input|select|textarea|button)$/i,
  17735. rclickable = /^(?:a|area)$/i;
  17736. jQuery.fn.extend( {
  17737. prop: function( name, value ) {
  17738. return access( this, jQuery.prop, name, value, arguments.length > 1 );
  17739. },
  17740. removeProp: function( name ) {
  17741. return this.each( function() {
  17742. delete this[ jQuery.propFix[ name ] || name ];
  17743. } );
  17744. }
  17745. } );
  17746. jQuery.extend( {
  17747. prop: function( elem, name, value ) {
  17748. var ret, hooks,
  17749. nType = elem.nodeType;
  17750. // Don't get/set properties on text, comment and attribute nodes
  17751. if ( nType === 3 || nType === 8 || nType === 2 ) {
  17752. return;
  17753. }
  17754. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  17755. // Fix name and attach hooks
  17756. name = jQuery.propFix[ name ] || name;
  17757. hooks = jQuery.propHooks[ name ];
  17758. }
  17759. if ( value !== undefined ) {
  17760. if ( hooks && "set" in hooks &&
  17761. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  17762. return ret;
  17763. }
  17764. return ( elem[ name ] = value );
  17765. }
  17766. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  17767. return ret;
  17768. }
  17769. return elem[ name ];
  17770. },
  17771. propHooks: {
  17772. tabIndex: {
  17773. get: function( elem ) {
  17774. // Support: IE <=9 - 11 only
  17775. // elem.tabIndex doesn't always return the
  17776. // correct value when it hasn't been explicitly set
  17777. // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
  17778. // Use proper attribute retrieval(#12072)
  17779. var tabindex = jQuery.find.attr( elem, "tabindex" );
  17780. if ( tabindex ) {
  17781. return parseInt( tabindex, 10 );
  17782. }
  17783. if (
  17784. rfocusable.test( elem.nodeName ) ||
  17785. rclickable.test( elem.nodeName ) &&
  17786. elem.href
  17787. ) {
  17788. return 0;
  17789. }
  17790. return -1;
  17791. }
  17792. }
  17793. },
  17794. propFix: {
  17795. "for": "htmlFor",
  17796. "class": "className"
  17797. }
  17798. } );
  17799. // Support: IE <=11 only
  17800. // Accessing the selectedIndex property
  17801. // forces the browser to respect setting selected
  17802. // on the option
  17803. // The getter ensures a default option is selected
  17804. // when in an optgroup
  17805. // eslint rule "no-unused-expressions" is disabled for this code
  17806. // since it considers such accessions noop
  17807. if ( !support.optSelected ) {
  17808. jQuery.propHooks.selected = {
  17809. get: function( elem ) {
  17810. /* eslint no-unused-expressions: "off" */
  17811. var parent = elem.parentNode;
  17812. if ( parent && parent.parentNode ) {
  17813. parent.parentNode.selectedIndex;
  17814. }
  17815. return null;
  17816. },
  17817. set: function( elem ) {
  17818. /* eslint no-unused-expressions: "off" */
  17819. var parent = elem.parentNode;
  17820. if ( parent ) {
  17821. parent.selectedIndex;
  17822. if ( parent.parentNode ) {
  17823. parent.parentNode.selectedIndex;
  17824. }
  17825. }
  17826. }
  17827. };
  17828. }
  17829. jQuery.each( [
  17830. "tabIndex",
  17831. "readOnly",
  17832. "maxLength",
  17833. "cellSpacing",
  17834. "cellPadding",
  17835. "rowSpan",
  17836. "colSpan",
  17837. "useMap",
  17838. "frameBorder",
  17839. "contentEditable"
  17840. ], function() {
  17841. jQuery.propFix[ this.toLowerCase() ] = this;
  17842. } );
  17843. // Strip and collapse whitespace according to HTML spec
  17844. // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace
  17845. function stripAndCollapse( value ) {
  17846. var tokens = value.match( rnothtmlwhite ) || [];
  17847. return tokens.join( " " );
  17848. }
  17849. function getClass( elem ) {
  17850. return elem.getAttribute && elem.getAttribute( "class" ) || "";
  17851. }
  17852. function classesToArray( value ) {
  17853. if ( Array.isArray( value ) ) {
  17854. return value;
  17855. }
  17856. if ( typeof value === "string" ) {
  17857. return value.match( rnothtmlwhite ) || [];
  17858. }
  17859. return [];
  17860. }
  17861. jQuery.fn.extend( {
  17862. addClass: function( value ) {
  17863. var classes, elem, cur, curValue, clazz, j, finalValue,
  17864. i = 0;
  17865. if ( isFunction( value ) ) {
  17866. return this.each( function( j ) {
  17867. jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
  17868. } );
  17869. }
  17870. classes = classesToArray( value );
  17871. if ( classes.length ) {
  17872. while ( ( elem = this[ i++ ] ) ) {
  17873. curValue = getClass( elem );
  17874. cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
  17875. if ( cur ) {
  17876. j = 0;
  17877. while ( ( clazz = classes[ j++ ] ) ) {
  17878. if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
  17879. cur += clazz + " ";
  17880. }
  17881. }
  17882. // Only assign if different to avoid unneeded rendering.
  17883. finalValue = stripAndCollapse( cur );
  17884. if ( curValue !== finalValue ) {
  17885. elem.setAttribute( "class", finalValue );
  17886. }
  17887. }
  17888. }
  17889. }
  17890. return this;
  17891. },
  17892. removeClass: function( value ) {
  17893. var classes, elem, cur, curValue, clazz, j, finalValue,
  17894. i = 0;
  17895. if ( isFunction( value ) ) {
  17896. return this.each( function( j ) {
  17897. jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
  17898. } );
  17899. }
  17900. if ( !arguments.length ) {
  17901. return this.attr( "class", "" );
  17902. }
  17903. classes = classesToArray( value );
  17904. if ( classes.length ) {
  17905. while ( ( elem = this[ i++ ] ) ) {
  17906. curValue = getClass( elem );
  17907. // This expression is here for better compressibility (see addClass)
  17908. cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
  17909. if ( cur ) {
  17910. j = 0;
  17911. while ( ( clazz = classes[ j++ ] ) ) {
  17912. // Remove *all* instances
  17913. while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
  17914. cur = cur.replace( " " + clazz + " ", " " );
  17915. }
  17916. }
  17917. // Only assign if different to avoid unneeded rendering.
  17918. finalValue = stripAndCollapse( cur );
  17919. if ( curValue !== finalValue ) {
  17920. elem.setAttribute( "class", finalValue );
  17921. }
  17922. }
  17923. }
  17924. }
  17925. return this;
  17926. },
  17927. toggleClass: function( value, stateVal ) {
  17928. var type = typeof value,
  17929. isValidValue = type === "string" || Array.isArray( value );
  17930. if ( typeof stateVal === "boolean" && isValidValue ) {
  17931. return stateVal ? this.addClass( value ) : this.removeClass( value );
  17932. }
  17933. if ( isFunction( value ) ) {
  17934. return this.each( function( i ) {
  17935. jQuery( this ).toggleClass(
  17936. value.call( this, i, getClass( this ), stateVal ),
  17937. stateVal
  17938. );
  17939. } );
  17940. }
  17941. return this.each( function() {
  17942. var className, i, self, classNames;
  17943. if ( isValidValue ) {
  17944. // Toggle individual class names
  17945. i = 0;
  17946. self = jQuery( this );
  17947. classNames = classesToArray( value );
  17948. while ( ( className = classNames[ i++ ] ) ) {
  17949. // Check each className given, space separated list
  17950. if ( self.hasClass( className ) ) {
  17951. self.removeClass( className );
  17952. } else {
  17953. self.addClass( className );
  17954. }
  17955. }
  17956. // Toggle whole class name
  17957. } else if ( value === undefined || type === "boolean" ) {
  17958. className = getClass( this );
  17959. if ( className ) {
  17960. // Store className if set
  17961. dataPriv.set( this, "__className__", className );
  17962. }
  17963. // If the element has a class name or if we're passed `false`,
  17964. // then remove the whole classname (if there was one, the above saved it).
  17965. // Otherwise bring back whatever was previously saved (if anything),
  17966. // falling back to the empty string if nothing was stored.
  17967. if ( this.setAttribute ) {
  17968. this.setAttribute( "class",
  17969. className || value === false ?
  17970. "" :
  17971. dataPriv.get( this, "__className__" ) || ""
  17972. );
  17973. }
  17974. }
  17975. } );
  17976. },
  17977. hasClass: function( selector ) {
  17978. var className, elem,
  17979. i = 0;
  17980. className = " " + selector + " ";
  17981. while ( ( elem = this[ i++ ] ) ) {
  17982. if ( elem.nodeType === 1 &&
  17983. ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
  17984. return true;
  17985. }
  17986. }
  17987. return false;
  17988. }
  17989. } );
  17990. var rreturn = /\r/g;
  17991. jQuery.fn.extend( {
  17992. val: function( value ) {
  17993. var hooks, ret, valueIsFunction,
  17994. elem = this[ 0 ];
  17995. if ( !arguments.length ) {
  17996. if ( elem ) {
  17997. hooks = jQuery.valHooks[ elem.type ] ||
  17998. jQuery.valHooks[ elem.nodeName.toLowerCase() ];
  17999. if ( hooks &&
  18000. "get" in hooks &&
  18001. ( ret = hooks.get( elem, "value" ) ) !== undefined
  18002. ) {
  18003. return ret;
  18004. }
  18005. ret = elem.value;
  18006. // Handle most common string cases
  18007. if ( typeof ret === "string" ) {
  18008. return ret.replace( rreturn, "" );
  18009. }
  18010. // Handle cases where value is null/undef or number
  18011. return ret == null ? "" : ret;
  18012. }
  18013. return;
  18014. }
  18015. valueIsFunction = isFunction( value );
  18016. return this.each( function( i ) {
  18017. var val;
  18018. if ( this.nodeType !== 1 ) {
  18019. return;
  18020. }
  18021. if ( valueIsFunction ) {
  18022. val = value.call( this, i, jQuery( this ).val() );
  18023. } else {
  18024. val = value;
  18025. }
  18026. // Treat null/undefined as ""; convert numbers to string
  18027. if ( val == null ) {
  18028. val = "";
  18029. } else if ( typeof val === "number" ) {
  18030. val += "";
  18031. } else if ( Array.isArray( val ) ) {
  18032. val = jQuery.map( val, function( value ) {
  18033. return value == null ? "" : value + "";
  18034. } );
  18035. }
  18036. hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
  18037. // If set returns undefined, fall back to normal setting
  18038. if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
  18039. this.value = val;
  18040. }
  18041. } );
  18042. }
  18043. } );
  18044. jQuery.extend( {
  18045. valHooks: {
  18046. option: {
  18047. get: function( elem ) {
  18048. var val = jQuery.find.attr( elem, "value" );
  18049. return val != null ?
  18050. val :
  18051. // Support: IE <=10 - 11 only
  18052. // option.text throws exceptions (#14686, #14858)
  18053. // Strip and collapse whitespace
  18054. // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
  18055. stripAndCollapse( jQuery.text( elem ) );
  18056. }
  18057. },
  18058. select: {
  18059. get: function( elem ) {
  18060. var value, option, i,
  18061. options = elem.options,
  18062. index = elem.selectedIndex,
  18063. one = elem.type === "select-one",
  18064. values = one ? null : [],
  18065. max = one ? index + 1 : options.length;
  18066. if ( index < 0 ) {
  18067. i = max;
  18068. } else {
  18069. i = one ? index : 0;
  18070. }
  18071. // Loop through all the selected options
  18072. for ( ; i < max; i++ ) {
  18073. option = options[ i ];
  18074. // Support: IE <=9 only
  18075. // IE8-9 doesn't update selected after form reset (#2551)
  18076. if ( ( option.selected || i === index ) &&
  18077. // Don't return options that are disabled or in a disabled optgroup
  18078. !option.disabled &&
  18079. ( !option.parentNode.disabled ||
  18080. !nodeName( option.parentNode, "optgroup" ) ) ) {
  18081. // Get the specific value for the option
  18082. value = jQuery( option ).val();
  18083. // We don't need an array for one selects
  18084. if ( one ) {
  18085. return value;
  18086. }
  18087. // Multi-Selects return an array
  18088. values.push( value );
  18089. }
  18090. }
  18091. return values;
  18092. },
  18093. set: function( elem, value ) {
  18094. var optionSet, option,
  18095. options = elem.options,
  18096. values = jQuery.makeArray( value ),
  18097. i = options.length;
  18098. while ( i-- ) {
  18099. option = options[ i ];
  18100. /* eslint-disable no-cond-assign */
  18101. if ( option.selected =
  18102. jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
  18103. ) {
  18104. optionSet = true;
  18105. }
  18106. /* eslint-enable no-cond-assign */
  18107. }
  18108. // Force browsers to behave consistently when non-matching value is set
  18109. if ( !optionSet ) {
  18110. elem.selectedIndex = -1;
  18111. }
  18112. return values;
  18113. }
  18114. }
  18115. }
  18116. } );
  18117. // Radios and checkboxes getter/setter
  18118. jQuery.each( [ "radio", "checkbox" ], function() {
  18119. jQuery.valHooks[ this ] = {
  18120. set: function( elem, value ) {
  18121. if ( Array.isArray( value ) ) {
  18122. return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
  18123. }
  18124. }
  18125. };
  18126. if ( !support.checkOn ) {
  18127. jQuery.valHooks[ this ].get = function( elem ) {
  18128. return elem.getAttribute( "value" ) === null ? "on" : elem.value;
  18129. };
  18130. }
  18131. } );
  18132. // Return jQuery for attributes-only inclusion
  18133. support.focusin = "onfocusin" in window;
  18134. var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
  18135. stopPropagationCallback = function( e ) {
  18136. e.stopPropagation();
  18137. };
  18138. jQuery.extend( jQuery.event, {
  18139. trigger: function( event, data, elem, onlyHandlers ) {
  18140. var i, cur, tmp, bubbleType, ontype, handle, special, lastElement,
  18141. eventPath = [ elem || document ],
  18142. type = hasOwn.call( event, "type" ) ? event.type : event,
  18143. namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
  18144. cur = lastElement = tmp = elem = elem || document;
  18145. // Don't do events on text and comment nodes
  18146. if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
  18147. return;
  18148. }
  18149. // focus/blur morphs to focusin/out; ensure we're not firing them right now
  18150. if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
  18151. return;
  18152. }
  18153. if ( type.indexOf( "." ) > -1 ) {
  18154. // Namespaced trigger; create a regexp to match event type in handle()
  18155. namespaces = type.split( "." );
  18156. type = namespaces.shift();
  18157. namespaces.sort();
  18158. }
  18159. ontype = type.indexOf( ":" ) < 0 && "on" + type;
  18160. // Caller can pass in a jQuery.Event object, Object, or just an event type string
  18161. event = event[ jQuery.expando ] ?
  18162. event :
  18163. new jQuery.Event( type, typeof event === "object" && event );
  18164. // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
  18165. event.isTrigger = onlyHandlers ? 2 : 3;
  18166. event.namespace = namespaces.join( "." );
  18167. event.rnamespace = event.namespace ?
  18168. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
  18169. null;
  18170. // Clean up the event in case it is being reused
  18171. event.result = undefined;
  18172. if ( !event.target ) {
  18173. event.target = elem;
  18174. }
  18175. // Clone any incoming data and prepend the event, creating the handler arg list
  18176. data = data == null ?
  18177. [ event ] :
  18178. jQuery.makeArray( data, [ event ] );
  18179. // Allow special events to draw outside the lines
  18180. special = jQuery.event.special[ type ] || {};
  18181. if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
  18182. return;
  18183. }
  18184. // Determine event propagation path in advance, per W3C events spec (#9951)
  18185. // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
  18186. if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {
  18187. bubbleType = special.delegateType || type;
  18188. if ( !rfocusMorph.test( bubbleType + type ) ) {
  18189. cur = cur.parentNode;
  18190. }
  18191. for ( ; cur; cur = cur.parentNode ) {
  18192. eventPath.push( cur );
  18193. tmp = cur;
  18194. }
  18195. // Only add window if we got to document (e.g., not plain obj or detached DOM)
  18196. if ( tmp === ( elem.ownerDocument || document ) ) {
  18197. eventPath.push( tmp.defaultView || tmp.parentWindow || window );
  18198. }
  18199. }
  18200. // Fire handlers on the event path
  18201. i = 0;
  18202. while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
  18203. lastElement = cur;
  18204. event.type = i > 1 ?
  18205. bubbleType :
  18206. special.bindType || type;
  18207. // jQuery handler
  18208. handle = (
  18209. dataPriv.get( cur, "events" ) || Object.create( null )
  18210. )[ event.type ] &&
  18211. dataPriv.get( cur, "handle" );
  18212. if ( handle ) {
  18213. handle.apply( cur, data );
  18214. }
  18215. // Native handler
  18216. handle = ontype && cur[ ontype ];
  18217. if ( handle && handle.apply && acceptData( cur ) ) {
  18218. event.result = handle.apply( cur, data );
  18219. if ( event.result === false ) {
  18220. event.preventDefault();
  18221. }
  18222. }
  18223. }
  18224. event.type = type;
  18225. // If nobody prevented the default action, do it now
  18226. if ( !onlyHandlers && !event.isDefaultPrevented() ) {
  18227. if ( ( !special._default ||
  18228. special._default.apply( eventPath.pop(), data ) === false ) &&
  18229. acceptData( elem ) ) {
  18230. // Call a native DOM method on the target with the same name as the event.
  18231. // Don't do default actions on window, that's where global variables be (#6170)
  18232. if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {
  18233. // Don't re-trigger an onFOO event when we call its FOO() method
  18234. tmp = elem[ ontype ];
  18235. if ( tmp ) {
  18236. elem[ ontype ] = null;
  18237. }
  18238. // Prevent re-triggering of the same event, since we already bubbled it above
  18239. jQuery.event.triggered = type;
  18240. if ( event.isPropagationStopped() ) {
  18241. lastElement.addEventListener( type, stopPropagationCallback );
  18242. }
  18243. elem[ type ]();
  18244. if ( event.isPropagationStopped() ) {
  18245. lastElement.removeEventListener( type, stopPropagationCallback );
  18246. }
  18247. jQuery.event.triggered = undefined;
  18248. if ( tmp ) {
  18249. elem[ ontype ] = tmp;
  18250. }
  18251. }
  18252. }
  18253. }
  18254. return event.result;
  18255. },
  18256. // Piggyback on a donor event to simulate a different one
  18257. // Used only for `focus(in | out)` events
  18258. simulate: function( type, elem, event ) {
  18259. var e = jQuery.extend(
  18260. new jQuery.Event(),
  18261. event,
  18262. {
  18263. type: type,
  18264. isSimulated: true
  18265. }
  18266. );
  18267. jQuery.event.trigger( e, null, elem );
  18268. }
  18269. } );
  18270. jQuery.fn.extend( {
  18271. trigger: function( type, data ) {
  18272. return this.each( function() {
  18273. jQuery.event.trigger( type, data, this );
  18274. } );
  18275. },
  18276. triggerHandler: function( type, data ) {
  18277. var elem = this[ 0 ];
  18278. if ( elem ) {
  18279. return jQuery.event.trigger( type, data, elem, true );
  18280. }
  18281. }
  18282. } );
  18283. // Support: Firefox <=44
  18284. // Firefox doesn't have focus(in | out) events
  18285. // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
  18286. //
  18287. // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
  18288. // focus(in | out) events fire after focus & blur events,
  18289. // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
  18290. // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
  18291. if ( !support.focusin ) {
  18292. jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
  18293. // Attach a single capturing handler on the document while someone wants focusin/focusout
  18294. var handler = function( event ) {
  18295. jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
  18296. };
  18297. jQuery.event.special[ fix ] = {
  18298. setup: function() {
  18299. // Handle: regular nodes (via `this.ownerDocument`), window
  18300. // (via `this.document`) & document (via `this`).
  18301. var doc = this.ownerDocument || this.document || this,
  18302. attaches = dataPriv.access( doc, fix );
  18303. if ( !attaches ) {
  18304. doc.addEventListener( orig, handler, true );
  18305. }
  18306. dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
  18307. },
  18308. teardown: function() {
  18309. var doc = this.ownerDocument || this.document || this,
  18310. attaches = dataPriv.access( doc, fix ) - 1;
  18311. if ( !attaches ) {
  18312. doc.removeEventListener( orig, handler, true );
  18313. dataPriv.remove( doc, fix );
  18314. } else {
  18315. dataPriv.access( doc, fix, attaches );
  18316. }
  18317. }
  18318. };
  18319. } );
  18320. }
  18321. var location = window.location;
  18322. var nonce = { guid: Date.now() };
  18323. var rquery = ( /\?/ );
  18324. // Cross-browser xml parsing
  18325. jQuery.parseXML = function( data ) {
  18326. var xml;
  18327. if ( !data || typeof data !== "string" ) {
  18328. return null;
  18329. }
  18330. // Support: IE 9 - 11 only
  18331. // IE throws on parseFromString with invalid input.
  18332. try {
  18333. xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
  18334. } catch ( e ) {
  18335. xml = undefined;
  18336. }
  18337. if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
  18338. jQuery.error( "Invalid XML: " + data );
  18339. }
  18340. return xml;
  18341. };
  18342. var
  18343. rbracket = /\[\]$/,
  18344. rCRLF = /\r?\n/g,
  18345. rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
  18346. rsubmittable = /^(?:input|select|textarea|keygen)/i;
  18347. function buildParams( prefix, obj, traditional, add ) {
  18348. var name;
  18349. if ( Array.isArray( obj ) ) {
  18350. // Serialize array item.
  18351. jQuery.each( obj, function( i, v ) {
  18352. if ( traditional || rbracket.test( prefix ) ) {
  18353. // Treat each array item as a scalar.
  18354. add( prefix, v );
  18355. } else {
  18356. // Item is non-scalar (array or object), encode its numeric index.
  18357. buildParams(
  18358. prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
  18359. v,
  18360. traditional,
  18361. add
  18362. );
  18363. }
  18364. } );
  18365. } else if ( !traditional && toType( obj ) === "object" ) {
  18366. // Serialize object item.
  18367. for ( name in obj ) {
  18368. buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
  18369. }
  18370. } else {
  18371. // Serialize scalar item.
  18372. add( prefix, obj );
  18373. }
  18374. }
  18375. // Serialize an array of form elements or a set of
  18376. // key/values into a query string
  18377. jQuery.param = function( a, traditional ) {
  18378. var prefix,
  18379. s = [],
  18380. add = function( key, valueOrFunction ) {
  18381. // If value is a function, invoke it and use its return value
  18382. var value = isFunction( valueOrFunction ) ?
  18383. valueOrFunction() :
  18384. valueOrFunction;
  18385. s[ s.length ] = encodeURIComponent( key ) + "=" +
  18386. encodeURIComponent( value == null ? "" : value );
  18387. };
  18388. if ( a == null ) {
  18389. return "";
  18390. }
  18391. // If an array was passed in, assume that it is an array of form elements.
  18392. if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
  18393. // Serialize the form elements
  18394. jQuery.each( a, function() {
  18395. add( this.name, this.value );
  18396. } );
  18397. } else {
  18398. // If traditional, encode the "old" way (the way 1.3.2 or older
  18399. // did it), otherwise encode params recursively.
  18400. for ( prefix in a ) {
  18401. buildParams( prefix, a[ prefix ], traditional, add );
  18402. }
  18403. }
  18404. // Return the resulting serialization
  18405. return s.join( "&" );
  18406. };
  18407. jQuery.fn.extend( {
  18408. serialize: function() {
  18409. return jQuery.param( this.serializeArray() );
  18410. },
  18411. serializeArray: function() {
  18412. return this.map( function() {
  18413. // Can add propHook for "elements" to filter or add form elements
  18414. var elements = jQuery.prop( this, "elements" );
  18415. return elements ? jQuery.makeArray( elements ) : this;
  18416. } )
  18417. .filter( function() {
  18418. var type = this.type;
  18419. // Use .is( ":disabled" ) so that fieldset[disabled] works
  18420. return this.name && !jQuery( this ).is( ":disabled" ) &&
  18421. rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
  18422. ( this.checked || !rcheckableType.test( type ) );
  18423. } )
  18424. .map( function( _i, elem ) {
  18425. var val = jQuery( this ).val();
  18426. if ( val == null ) {
  18427. return null;
  18428. }
  18429. if ( Array.isArray( val ) ) {
  18430. return jQuery.map( val, function( val ) {
  18431. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  18432. } );
  18433. }
  18434. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  18435. } ).get();
  18436. }
  18437. } );
  18438. var
  18439. r20 = /%20/g,
  18440. rhash = /#.*$/,
  18441. rantiCache = /([?&])_=[^&]*/,
  18442. rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
  18443. // #7653, #8125, #8152: local protocol detection
  18444. rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
  18445. rnoContent = /^(?:GET|HEAD)$/,
  18446. rprotocol = /^\/\//,
  18447. /* Prefilters
  18448. * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
  18449. * 2) These are called:
  18450. * - BEFORE asking for a transport
  18451. * - AFTER param serialization (s.data is a string if s.processData is true)
  18452. * 3) key is the dataType
  18453. * 4) the catchall symbol "*" can be used
  18454. * 5) execution will start with transport dataType and THEN continue down to "*" if needed
  18455. */
  18456. prefilters = {},
  18457. /* Transports bindings
  18458. * 1) key is the dataType
  18459. * 2) the catchall symbol "*" can be used
  18460. * 3) selection will start with transport dataType and THEN go to "*" if needed
  18461. */
  18462. transports = {},
  18463. // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
  18464. allTypes = "*/".concat( "*" ),
  18465. // Anchor tag for parsing the document origin
  18466. originAnchor = document.createElement( "a" );
  18467. originAnchor.href = location.href;
  18468. // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
  18469. function addToPrefiltersOrTransports( structure ) {
  18470. // dataTypeExpression is optional and defaults to "*"
  18471. return function( dataTypeExpression, func ) {
  18472. if ( typeof dataTypeExpression !== "string" ) {
  18473. func = dataTypeExpression;
  18474. dataTypeExpression = "*";
  18475. }
  18476. var dataType,
  18477. i = 0,
  18478. dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];
  18479. if ( isFunction( func ) ) {
  18480. // For each dataType in the dataTypeExpression
  18481. while ( ( dataType = dataTypes[ i++ ] ) ) {
  18482. // Prepend if requested
  18483. if ( dataType[ 0 ] === "+" ) {
  18484. dataType = dataType.slice( 1 ) || "*";
  18485. ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
  18486. // Otherwise append
  18487. } else {
  18488. ( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
  18489. }
  18490. }
  18491. }
  18492. };
  18493. }
  18494. // Base inspection function for prefilters and transports
  18495. function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
  18496. var inspected = {},
  18497. seekingTransport = ( structure === transports );
  18498. function inspect( dataType ) {
  18499. var selected;
  18500. inspected[ dataType ] = true;
  18501. jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
  18502. var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
  18503. if ( typeof dataTypeOrTransport === "string" &&
  18504. !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
  18505. options.dataTypes.unshift( dataTypeOrTransport );
  18506. inspect( dataTypeOrTransport );
  18507. return false;
  18508. } else if ( seekingTransport ) {
  18509. return !( selected = dataTypeOrTransport );
  18510. }
  18511. } );
  18512. return selected;
  18513. }
  18514. return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
  18515. }
  18516. // A special extend for ajax options
  18517. // that takes "flat" options (not to be deep extended)
  18518. // Fixes #9887
  18519. function ajaxExtend( target, src ) {
  18520. var key, deep,
  18521. flatOptions = jQuery.ajaxSettings.flatOptions || {};
  18522. for ( key in src ) {
  18523. if ( src[ key ] !== undefined ) {
  18524. ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
  18525. }
  18526. }
  18527. if ( deep ) {
  18528. jQuery.extend( true, target, deep );
  18529. }
  18530. return target;
  18531. }
  18532. /* Handles responses to an ajax request:
  18533. * - finds the right dataType (mediates between content-type and expected dataType)
  18534. * - returns the corresponding response
  18535. */
  18536. function ajaxHandleResponses( s, jqXHR, responses ) {
  18537. var ct, type, finalDataType, firstDataType,
  18538. contents = s.contents,
  18539. dataTypes = s.dataTypes;
  18540. // Remove auto dataType and get content-type in the process
  18541. while ( dataTypes[ 0 ] === "*" ) {
  18542. dataTypes.shift();
  18543. if ( ct === undefined ) {
  18544. ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
  18545. }
  18546. }
  18547. // Check if we're dealing with a known content-type
  18548. if ( ct ) {
  18549. for ( type in contents ) {
  18550. if ( contents[ type ] && contents[ type ].test( ct ) ) {
  18551. dataTypes.unshift( type );
  18552. break;
  18553. }
  18554. }
  18555. }
  18556. // Check to see if we have a response for the expected dataType
  18557. if ( dataTypes[ 0 ] in responses ) {
  18558. finalDataType = dataTypes[ 0 ];
  18559. } else {
  18560. // Try convertible dataTypes
  18561. for ( type in responses ) {
  18562. if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
  18563. finalDataType = type;
  18564. break;
  18565. }
  18566. if ( !firstDataType ) {
  18567. firstDataType = type;
  18568. }
  18569. }
  18570. // Or just use first one
  18571. finalDataType = finalDataType || firstDataType;
  18572. }
  18573. // If we found a dataType
  18574. // We add the dataType to the list if needed
  18575. // and return the corresponding response
  18576. if ( finalDataType ) {
  18577. if ( finalDataType !== dataTypes[ 0 ] ) {
  18578. dataTypes.unshift( finalDataType );
  18579. }
  18580. return responses[ finalDataType ];
  18581. }
  18582. }
  18583. /* Chain conversions given the request and the original response
  18584. * Also sets the responseXXX fields on the jqXHR instance
  18585. */
  18586. function ajaxConvert( s, response, jqXHR, isSuccess ) {
  18587. var conv2, current, conv, tmp, prev,
  18588. converters = {},
  18589. // Work with a copy of dataTypes in case we need to modify it for conversion
  18590. dataTypes = s.dataTypes.slice();
  18591. // Create converters map with lowercased keys
  18592. if ( dataTypes[ 1 ] ) {
  18593. for ( conv in s.converters ) {
  18594. converters[ conv.toLowerCase() ] = s.converters[ conv ];
  18595. }
  18596. }
  18597. current = dataTypes.shift();
  18598. // Convert to each sequential dataType
  18599. while ( current ) {
  18600. if ( s.responseFields[ current ] ) {
  18601. jqXHR[ s.responseFields[ current ] ] = response;
  18602. }
  18603. // Apply the dataFilter if provided
  18604. if ( !prev && isSuccess && s.dataFilter ) {
  18605. response = s.dataFilter( response, s.dataType );
  18606. }
  18607. prev = current;
  18608. current = dataTypes.shift();
  18609. if ( current ) {
  18610. // There's only work to do if current dataType is non-auto
  18611. if ( current === "*" ) {
  18612. current = prev;
  18613. // Convert response if prev dataType is non-auto and differs from current
  18614. } else if ( prev !== "*" && prev !== current ) {
  18615. // Seek a direct converter
  18616. conv = converters[ prev + " " + current ] || converters[ "* " + current ];
  18617. // If none found, seek a pair
  18618. if ( !conv ) {
  18619. for ( conv2 in converters ) {
  18620. // If conv2 outputs current
  18621. tmp = conv2.split( " " );
  18622. if ( tmp[ 1 ] === current ) {
  18623. // If prev can be converted to accepted input
  18624. conv = converters[ prev + " " + tmp[ 0 ] ] ||
  18625. converters[ "* " + tmp[ 0 ] ];
  18626. if ( conv ) {
  18627. // Condense equivalence converters
  18628. if ( conv === true ) {
  18629. conv = converters[ conv2 ];
  18630. // Otherwise, insert the intermediate dataType
  18631. } else if ( converters[ conv2 ] !== true ) {
  18632. current = tmp[ 0 ];
  18633. dataTypes.unshift( tmp[ 1 ] );
  18634. }
  18635. break;
  18636. }
  18637. }
  18638. }
  18639. }
  18640. // Apply converter (if not an equivalence)
  18641. if ( conv !== true ) {
  18642. // Unless errors are allowed to bubble, catch and return them
  18643. if ( conv && s.throws ) {
  18644. response = conv( response );
  18645. } else {
  18646. try {
  18647. response = conv( response );
  18648. } catch ( e ) {
  18649. return {
  18650. state: "parsererror",
  18651. error: conv ? e : "No conversion from " + prev + " to " + current
  18652. };
  18653. }
  18654. }
  18655. }
  18656. }
  18657. }
  18658. }
  18659. return { state: "success", data: response };
  18660. }
  18661. jQuery.extend( {
  18662. // Counter for holding the number of active queries
  18663. active: 0,
  18664. // Last-Modified header cache for next request
  18665. lastModified: {},
  18666. etag: {},
  18667. ajaxSettings: {
  18668. url: location.href,
  18669. type: "GET",
  18670. isLocal: rlocalProtocol.test( location.protocol ),
  18671. global: true,
  18672. processData: true,
  18673. async: true,
  18674. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  18675. /*
  18676. timeout: 0,
  18677. data: null,
  18678. dataType: null,
  18679. username: null,
  18680. password: null,
  18681. cache: null,
  18682. throws: false,
  18683. traditional: false,
  18684. headers: {},
  18685. */
  18686. accepts: {
  18687. "*": allTypes,
  18688. text: "text/plain",
  18689. html: "text/html",
  18690. xml: "application/xml, text/xml",
  18691. json: "application/json, text/javascript"
  18692. },
  18693. contents: {
  18694. xml: /\bxml\b/,
  18695. html: /\bhtml/,
  18696. json: /\bjson\b/
  18697. },
  18698. responseFields: {
  18699. xml: "responseXML",
  18700. text: "responseText",
  18701. json: "responseJSON"
  18702. },
  18703. // Data converters
  18704. // Keys separate source (or catchall "*") and destination types with a single space
  18705. converters: {
  18706. // Convert anything to text
  18707. "* text": String,
  18708. // Text to html (true = no transformation)
  18709. "text html": true,
  18710. // Evaluate text as a json expression
  18711. "text json": JSON.parse,
  18712. // Parse text as xml
  18713. "text xml": jQuery.parseXML
  18714. },
  18715. // For options that shouldn't be deep extended:
  18716. // you can add your own custom options here if
  18717. // and when you create one that shouldn't be
  18718. // deep extended (see ajaxExtend)
  18719. flatOptions: {
  18720. url: true,
  18721. context: true
  18722. }
  18723. },
  18724. // Creates a full fledged settings object into target
  18725. // with both ajaxSettings and settings fields.
  18726. // If target is omitted, writes into ajaxSettings.
  18727. ajaxSetup: function( target, settings ) {
  18728. return settings ?
  18729. // Building a settings object
  18730. ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
  18731. // Extending ajaxSettings
  18732. ajaxExtend( jQuery.ajaxSettings, target );
  18733. },
  18734. ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
  18735. ajaxTransport: addToPrefiltersOrTransports( transports ),
  18736. // Main method
  18737. ajax: function( url, options ) {
  18738. // If url is an object, simulate pre-1.5 signature
  18739. if ( typeof url === "object" ) {
  18740. options = url;
  18741. url = undefined;
  18742. }
  18743. // Force options to be an object
  18744. options = options || {};
  18745. var transport,
  18746. // URL without anti-cache param
  18747. cacheURL,
  18748. // Response headers
  18749. responseHeadersString,
  18750. responseHeaders,
  18751. // timeout handle
  18752. timeoutTimer,
  18753. // Url cleanup var
  18754. urlAnchor,
  18755. // Request state (becomes false upon send and true upon completion)
  18756. completed,
  18757. // To know if global events are to be dispatched
  18758. fireGlobals,
  18759. // Loop variable
  18760. i,
  18761. // uncached part of the url
  18762. uncached,
  18763. // Create the final options object
  18764. s = jQuery.ajaxSetup( {}, options ),
  18765. // Callbacks context
  18766. callbackContext = s.context || s,
  18767. // Context for global events is callbackContext if it is a DOM node or jQuery collection
  18768. globalEventContext = s.context &&
  18769. ( callbackContext.nodeType || callbackContext.jquery ) ?
  18770. jQuery( callbackContext ) :
  18771. jQuery.event,
  18772. // Deferreds
  18773. deferred = jQuery.Deferred(),
  18774. completeDeferred = jQuery.Callbacks( "once memory" ),
  18775. // Status-dependent callbacks
  18776. statusCode = s.statusCode || {},
  18777. // Headers (they are sent all at once)
  18778. requestHeaders = {},
  18779. requestHeadersNames = {},
  18780. // Default abort message
  18781. strAbort = "canceled",
  18782. // Fake xhr
  18783. jqXHR = {
  18784. readyState: 0,
  18785. // Builds headers hashtable if needed
  18786. getResponseHeader: function( key ) {
  18787. var match;
  18788. if ( completed ) {
  18789. if ( !responseHeaders ) {
  18790. responseHeaders = {};
  18791. while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
  18792. responseHeaders[ match[ 1 ].toLowerCase() + " " ] =
  18793. ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] )
  18794. .concat( match[ 2 ] );
  18795. }
  18796. }
  18797. match = responseHeaders[ key.toLowerCase() + " " ];
  18798. }
  18799. return match == null ? null : match.join( ", " );
  18800. },
  18801. // Raw string
  18802. getAllResponseHeaders: function() {
  18803. return completed ? responseHeadersString : null;
  18804. },
  18805. // Caches the header
  18806. setRequestHeader: function( name, value ) {
  18807. if ( completed == null ) {
  18808. name = requestHeadersNames[ name.toLowerCase() ] =
  18809. requestHeadersNames[ name.toLowerCase() ] || name;
  18810. requestHeaders[ name ] = value;
  18811. }
  18812. return this;
  18813. },
  18814. // Overrides response content-type header
  18815. overrideMimeType: function( type ) {
  18816. if ( completed == null ) {
  18817. s.mimeType = type;
  18818. }
  18819. return this;
  18820. },
  18821. // Status-dependent callbacks
  18822. statusCode: function( map ) {
  18823. var code;
  18824. if ( map ) {
  18825. if ( completed ) {
  18826. // Execute the appropriate callbacks
  18827. jqXHR.always( map[ jqXHR.status ] );
  18828. } else {
  18829. // Lazy-add the new callbacks in a way that preserves old ones
  18830. for ( code in map ) {
  18831. statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
  18832. }
  18833. }
  18834. }
  18835. return this;
  18836. },
  18837. // Cancel the request
  18838. abort: function( statusText ) {
  18839. var finalText = statusText || strAbort;
  18840. if ( transport ) {
  18841. transport.abort( finalText );
  18842. }
  18843. done( 0, finalText );
  18844. return this;
  18845. }
  18846. };
  18847. // Attach deferreds
  18848. deferred.promise( jqXHR );
  18849. // Add protocol if not provided (prefilters might expect it)
  18850. // Handle falsy url in the settings object (#10093: consistency with old signature)
  18851. // We also use the url parameter if available
  18852. s.url = ( ( url || s.url || location.href ) + "" )
  18853. .replace( rprotocol, location.protocol + "//" );
  18854. // Alias method option to type as per ticket #12004
  18855. s.type = options.method || options.type || s.method || s.type;
  18856. // Extract dataTypes list
  18857. s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ];
  18858. // A cross-domain request is in order when the origin doesn't match the current origin.
  18859. if ( s.crossDomain == null ) {
  18860. urlAnchor = document.createElement( "a" );
  18861. // Support: IE <=8 - 11, Edge 12 - 15
  18862. // IE throws exception on accessing the href property if url is malformed,
  18863. // e.g. http://example.com:80x/
  18864. try {
  18865. urlAnchor.href = s.url;
  18866. // Support: IE <=8 - 11 only
  18867. // Anchor's host property isn't correctly set when s.url is relative
  18868. urlAnchor.href = urlAnchor.href;
  18869. s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
  18870. urlAnchor.protocol + "//" + urlAnchor.host;
  18871. } catch ( e ) {
  18872. // If there is an error parsing the URL, assume it is crossDomain,
  18873. // it can be rejected by the transport if it is invalid
  18874. s.crossDomain = true;
  18875. }
  18876. }
  18877. // Convert data if not already a string
  18878. if ( s.data && s.processData && typeof s.data !== "string" ) {
  18879. s.data = jQuery.param( s.data, s.traditional );
  18880. }
  18881. // Apply prefilters
  18882. inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
  18883. // If request was aborted inside a prefilter, stop there
  18884. if ( completed ) {
  18885. return jqXHR;
  18886. }
  18887. // We can fire global events as of now if asked to
  18888. // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
  18889. fireGlobals = jQuery.event && s.global;
  18890. // Watch for a new set of requests
  18891. if ( fireGlobals && jQuery.active++ === 0 ) {
  18892. jQuery.event.trigger( "ajaxStart" );
  18893. }
  18894. // Uppercase the type
  18895. s.type = s.type.toUpperCase();
  18896. // Determine if request has content
  18897. s.hasContent = !rnoContent.test( s.type );
  18898. // Save the URL in case we're toying with the If-Modified-Since
  18899. // and/or If-None-Match header later on
  18900. // Remove hash to simplify url manipulation
  18901. cacheURL = s.url.replace( rhash, "" );
  18902. // More options handling for requests with no content
  18903. if ( !s.hasContent ) {
  18904. // Remember the hash so we can put it back
  18905. uncached = s.url.slice( cacheURL.length );
  18906. // If data is available and should be processed, append data to url
  18907. if ( s.data && ( s.processData || typeof s.data === "string" ) ) {
  18908. cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
  18909. // #9682: remove data so that it's not used in an eventual retry
  18910. delete s.data;
  18911. }
  18912. // Add or update anti-cache param if needed
  18913. if ( s.cache === false ) {
  18914. cacheURL = cacheURL.replace( rantiCache, "$1" );
  18915. uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) +
  18916. uncached;
  18917. }
  18918. // Put hash and anti-cache on the URL that will be requested (gh-1732)
  18919. s.url = cacheURL + uncached;
  18920. // Change '%20' to '+' if this is encoded form body content (gh-2658)
  18921. } else if ( s.data && s.processData &&
  18922. ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) {
  18923. s.data = s.data.replace( r20, "+" );
  18924. }
  18925. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  18926. if ( s.ifModified ) {
  18927. if ( jQuery.lastModified[ cacheURL ] ) {
  18928. jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
  18929. }
  18930. if ( jQuery.etag[ cacheURL ] ) {
  18931. jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
  18932. }
  18933. }
  18934. // Set the correct header, if data is being sent
  18935. if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
  18936. jqXHR.setRequestHeader( "Content-Type", s.contentType );
  18937. }
  18938. // Set the Accepts header for the server, depending on the dataType
  18939. jqXHR.setRequestHeader(
  18940. "Accept",
  18941. s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
  18942. s.accepts[ s.dataTypes[ 0 ] ] +
  18943. ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
  18944. s.accepts[ "*" ]
  18945. );
  18946. // Check for headers option
  18947. for ( i in s.headers ) {
  18948. jqXHR.setRequestHeader( i, s.headers[ i ] );
  18949. }
  18950. // Allow custom headers/mimetypes and early abort
  18951. if ( s.beforeSend &&
  18952. ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {
  18953. // Abort if not done already and return
  18954. return jqXHR.abort();
  18955. }
  18956. // Aborting is no longer a cancellation
  18957. strAbort = "abort";
  18958. // Install callbacks on deferreds
  18959. completeDeferred.add( s.complete );
  18960. jqXHR.done( s.success );
  18961. jqXHR.fail( s.error );
  18962. // Get transport
  18963. transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
  18964. // If no transport, we auto-abort
  18965. if ( !transport ) {
  18966. done( -1, "No Transport" );
  18967. } else {
  18968. jqXHR.readyState = 1;
  18969. // Send global event
  18970. if ( fireGlobals ) {
  18971. globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
  18972. }
  18973. // If request was aborted inside ajaxSend, stop there
  18974. if ( completed ) {
  18975. return jqXHR;
  18976. }
  18977. // Timeout
  18978. if ( s.async && s.timeout > 0 ) {
  18979. timeoutTimer = window.setTimeout( function() {
  18980. jqXHR.abort( "timeout" );
  18981. }, s.timeout );
  18982. }
  18983. try {
  18984. completed = false;
  18985. transport.send( requestHeaders, done );
  18986. } catch ( e ) {
  18987. // Rethrow post-completion exceptions
  18988. if ( completed ) {
  18989. throw e;
  18990. }
  18991. // Propagate others as results
  18992. done( -1, e );
  18993. }
  18994. }
  18995. // Callback for when everything is done
  18996. function done( status, nativeStatusText, responses, headers ) {
  18997. var isSuccess, success, error, response, modified,
  18998. statusText = nativeStatusText;
  18999. // Ignore repeat invocations
  19000. if ( completed ) {
  19001. return;
  19002. }
  19003. completed = true;
  19004. // Clear timeout if it exists
  19005. if ( timeoutTimer ) {
  19006. window.clearTimeout( timeoutTimer );
  19007. }
  19008. // Dereference transport for early garbage collection
  19009. // (no matter how long the jqXHR object will be used)
  19010. transport = undefined;
  19011. // Cache response headers
  19012. responseHeadersString = headers || "";
  19013. // Set readyState
  19014. jqXHR.readyState = status > 0 ? 4 : 0;
  19015. // Determine if successful
  19016. isSuccess = status >= 200 && status < 300 || status === 304;
  19017. // Get response data
  19018. if ( responses ) {
  19019. response = ajaxHandleResponses( s, jqXHR, responses );
  19020. }
  19021. // Use a noop converter for missing script
  19022. if ( !isSuccess && jQuery.inArray( "script", s.dataTypes ) > -1 ) {
  19023. s.converters[ "text script" ] = function() {};
  19024. }
  19025. // Convert no matter what (that way responseXXX fields are always set)
  19026. response = ajaxConvert( s, response, jqXHR, isSuccess );
  19027. // If successful, handle type chaining
  19028. if ( isSuccess ) {
  19029. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  19030. if ( s.ifModified ) {
  19031. modified = jqXHR.getResponseHeader( "Last-Modified" );
  19032. if ( modified ) {
  19033. jQuery.lastModified[ cacheURL ] = modified;
  19034. }
  19035. modified = jqXHR.getResponseHeader( "etag" );
  19036. if ( modified ) {
  19037. jQuery.etag[ cacheURL ] = modified;
  19038. }
  19039. }
  19040. // if no content
  19041. if ( status === 204 || s.type === "HEAD" ) {
  19042. statusText = "nocontent";
  19043. // if not modified
  19044. } else if ( status === 304 ) {
  19045. statusText = "notmodified";
  19046. // If we have data, let's convert it
  19047. } else {
  19048. statusText = response.state;
  19049. success = response.data;
  19050. error = response.error;
  19051. isSuccess = !error;
  19052. }
  19053. } else {
  19054. // Extract error from statusText and normalize for non-aborts
  19055. error = statusText;
  19056. if ( status || !statusText ) {
  19057. statusText = "error";
  19058. if ( status < 0 ) {
  19059. status = 0;
  19060. }
  19061. }
  19062. }
  19063. // Set data for the fake xhr object
  19064. jqXHR.status = status;
  19065. jqXHR.statusText = ( nativeStatusText || statusText ) + "";
  19066. // Success/Error
  19067. if ( isSuccess ) {
  19068. deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
  19069. } else {
  19070. deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
  19071. }
  19072. // Status-dependent callbacks
  19073. jqXHR.statusCode( statusCode );
  19074. statusCode = undefined;
  19075. if ( fireGlobals ) {
  19076. globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
  19077. [ jqXHR, s, isSuccess ? success : error ] );
  19078. }
  19079. // Complete
  19080. completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
  19081. if ( fireGlobals ) {
  19082. globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
  19083. // Handle the global AJAX counter
  19084. if ( !( --jQuery.active ) ) {
  19085. jQuery.event.trigger( "ajaxStop" );
  19086. }
  19087. }
  19088. }
  19089. return jqXHR;
  19090. },
  19091. getJSON: function( url, data, callback ) {
  19092. return jQuery.get( url, data, callback, "json" );
  19093. },
  19094. getScript: function( url, callback ) {
  19095. return jQuery.get( url, undefined, callback, "script" );
  19096. }
  19097. } );
  19098. jQuery.each( [ "get", "post" ], function( _i, method ) {
  19099. jQuery[ method ] = function( url, data, callback, type ) {
  19100. // Shift arguments if data argument was omitted
  19101. if ( isFunction( data ) ) {
  19102. type = type || callback;
  19103. callback = data;
  19104. data = undefined;
  19105. }
  19106. // The url can be an options object (which then must have .url)
  19107. return jQuery.ajax( jQuery.extend( {
  19108. url: url,
  19109. type: method,
  19110. dataType: type,
  19111. data: data,
  19112. success: callback
  19113. }, jQuery.isPlainObject( url ) && url ) );
  19114. };
  19115. } );
  19116. jQuery.ajaxPrefilter( function( s ) {
  19117. var i;
  19118. for ( i in s.headers ) {
  19119. if ( i.toLowerCase() === "content-type" ) {
  19120. s.contentType = s.headers[ i ] || "";
  19121. }
  19122. }
  19123. } );
  19124. jQuery._evalUrl = function( url, options, doc ) {
  19125. return jQuery.ajax( {
  19126. url: url,
  19127. // Make this explicit, since user can override this through ajaxSetup (#11264)
  19128. type: "GET",
  19129. dataType: "script",
  19130. cache: true,
  19131. async: false,
  19132. global: false,
  19133. // Only evaluate the response if it is successful (gh-4126)
  19134. // dataFilter is not invoked for failure responses, so using it instead
  19135. // of the default converter is kludgy but it works.
  19136. converters: {
  19137. "text script": function() {}
  19138. },
  19139. dataFilter: function( response ) {
  19140. jQuery.globalEval( response, options, doc );
  19141. }
  19142. } );
  19143. };
  19144. jQuery.fn.extend( {
  19145. wrapAll: function( html ) {
  19146. var wrap;
  19147. if ( this[ 0 ] ) {
  19148. if ( isFunction( html ) ) {
  19149. html = html.call( this[ 0 ] );
  19150. }
  19151. // The elements to wrap the target around
  19152. wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
  19153. if ( this[ 0 ].parentNode ) {
  19154. wrap.insertBefore( this[ 0 ] );
  19155. }
  19156. wrap.map( function() {
  19157. var elem = this;
  19158. while ( elem.firstElementChild ) {
  19159. elem = elem.firstElementChild;
  19160. }
  19161. return elem;
  19162. } ).append( this );
  19163. }
  19164. return this;
  19165. },
  19166. wrapInner: function( html ) {
  19167. if ( isFunction( html ) ) {
  19168. return this.each( function( i ) {
  19169. jQuery( this ).wrapInner( html.call( this, i ) );
  19170. } );
  19171. }
  19172. return this.each( function() {
  19173. var self = jQuery( this ),
  19174. contents = self.contents();
  19175. if ( contents.length ) {
  19176. contents.wrapAll( html );
  19177. } else {
  19178. self.append( html );
  19179. }
  19180. } );
  19181. },
  19182. wrap: function( html ) {
  19183. var htmlIsFunction = isFunction( html );
  19184. return this.each( function( i ) {
  19185. jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );
  19186. } );
  19187. },
  19188. unwrap: function( selector ) {
  19189. this.parent( selector ).not( "body" ).each( function() {
  19190. jQuery( this ).replaceWith( this.childNodes );
  19191. } );
  19192. return this;
  19193. }
  19194. } );
  19195. jQuery.expr.pseudos.hidden = function( elem ) {
  19196. return !jQuery.expr.pseudos.visible( elem );
  19197. };
  19198. jQuery.expr.pseudos.visible = function( elem ) {
  19199. return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
  19200. };
  19201. jQuery.ajaxSettings.xhr = function() {
  19202. try {
  19203. return new window.XMLHttpRequest();
  19204. } catch ( e ) {}
  19205. };
  19206. var xhrSuccessStatus = {
  19207. // File protocol always yields status code 0, assume 200
  19208. 0: 200,
  19209. // Support: IE <=9 only
  19210. // #1450: sometimes IE returns 1223 when it should be 204
  19211. 1223: 204
  19212. },
  19213. xhrSupported = jQuery.ajaxSettings.xhr();
  19214. support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
  19215. support.ajax = xhrSupported = !!xhrSupported;
  19216. jQuery.ajaxTransport( function( options ) {
  19217. var callback, errorCallback;
  19218. // Cross domain only allowed if supported through XMLHttpRequest
  19219. if ( support.cors || xhrSupported && !options.crossDomain ) {
  19220. return {
  19221. send: function( headers, complete ) {
  19222. var i,
  19223. xhr = options.xhr();
  19224. xhr.open(
  19225. options.type,
  19226. options.url,
  19227. options.async,
  19228. options.username,
  19229. options.password
  19230. );
  19231. // Apply custom fields if provided
  19232. if ( options.xhrFields ) {
  19233. for ( i in options.xhrFields ) {
  19234. xhr[ i ] = options.xhrFields[ i ];
  19235. }
  19236. }
  19237. // Override mime type if needed
  19238. if ( options.mimeType && xhr.overrideMimeType ) {
  19239. xhr.overrideMimeType( options.mimeType );
  19240. }
  19241. // X-Requested-With header
  19242. // For cross-domain requests, seeing as conditions for a preflight are
  19243. // akin to a jigsaw puzzle, we simply never set it to be sure.
  19244. // (it can always be set on a per-request basis or even using ajaxSetup)
  19245. // For same-domain requests, won't change header if already provided.
  19246. if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
  19247. headers[ "X-Requested-With" ] = "XMLHttpRequest";
  19248. }
  19249. // Set headers
  19250. for ( i in headers ) {
  19251. xhr.setRequestHeader( i, headers[ i ] );
  19252. }
  19253. // Callback
  19254. callback = function( type ) {
  19255. return function() {
  19256. if ( callback ) {
  19257. callback = errorCallback = xhr.onload =
  19258. xhr.onerror = xhr.onabort = xhr.ontimeout =
  19259. xhr.onreadystatechange = null;
  19260. if ( type === "abort" ) {
  19261. xhr.abort();
  19262. } else if ( type === "error" ) {
  19263. // Support: IE <=9 only
  19264. // On a manual native abort, IE9 throws
  19265. // errors on any property access that is not readyState
  19266. if ( typeof xhr.status !== "number" ) {
  19267. complete( 0, "error" );
  19268. } else {
  19269. complete(
  19270. // File: protocol always yields status 0; see #8605, #14207
  19271. xhr.status,
  19272. xhr.statusText
  19273. );
  19274. }
  19275. } else {
  19276. complete(
  19277. xhrSuccessStatus[ xhr.status ] || xhr.status,
  19278. xhr.statusText,
  19279. // Support: IE <=9 only
  19280. // IE9 has no XHR2 but throws on binary (trac-11426)
  19281. // For XHR2 non-text, let the caller handle it (gh-2498)
  19282. ( xhr.responseType || "text" ) !== "text" ||
  19283. typeof xhr.responseText !== "string" ?
  19284. { binary: xhr.response } :
  19285. { text: xhr.responseText },
  19286. xhr.getAllResponseHeaders()
  19287. );
  19288. }
  19289. }
  19290. };
  19291. };
  19292. // Listen to events
  19293. xhr.onload = callback();
  19294. errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" );
  19295. // Support: IE 9 only
  19296. // Use onreadystatechange to replace onabort
  19297. // to handle uncaught aborts
  19298. if ( xhr.onabort !== undefined ) {
  19299. xhr.onabort = errorCallback;
  19300. } else {
  19301. xhr.onreadystatechange = function() {
  19302. // Check readyState before timeout as it changes
  19303. if ( xhr.readyState === 4 ) {
  19304. // Allow onerror to be called first,
  19305. // but that will not handle a native abort
  19306. // Also, save errorCallback to a variable
  19307. // as xhr.onerror cannot be accessed
  19308. window.setTimeout( function() {
  19309. if ( callback ) {
  19310. errorCallback();
  19311. }
  19312. } );
  19313. }
  19314. };
  19315. }
  19316. // Create the abort callback
  19317. callback = callback( "abort" );
  19318. try {
  19319. // Do send the request (this may raise an exception)
  19320. xhr.send( options.hasContent && options.data || null );
  19321. } catch ( e ) {
  19322. // #14683: Only rethrow if this hasn't been notified as an error yet
  19323. if ( callback ) {
  19324. throw e;
  19325. }
  19326. }
  19327. },
  19328. abort: function() {
  19329. if ( callback ) {
  19330. callback();
  19331. }
  19332. }
  19333. };
  19334. }
  19335. } );
  19336. // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
  19337. jQuery.ajaxPrefilter( function( s ) {
  19338. if ( s.crossDomain ) {
  19339. s.contents.script = false;
  19340. }
  19341. } );
  19342. // Install script dataType
  19343. jQuery.ajaxSetup( {
  19344. accepts: {
  19345. script: "text/javascript, application/javascript, " +
  19346. "application/ecmascript, application/x-ecmascript"
  19347. },
  19348. contents: {
  19349. script: /\b(?:java|ecma)script\b/
  19350. },
  19351. converters: {
  19352. "text script": function( text ) {
  19353. jQuery.globalEval( text );
  19354. return text;
  19355. }
  19356. }
  19357. } );
  19358. // Handle cache's special case and crossDomain
  19359. jQuery.ajaxPrefilter( "script", function( s ) {
  19360. if ( s.cache === undefined ) {
  19361. s.cache = false;
  19362. }
  19363. if ( s.crossDomain ) {
  19364. s.type = "GET";
  19365. }
  19366. } );
  19367. // Bind script tag hack transport
  19368. jQuery.ajaxTransport( "script", function( s ) {
  19369. // This transport only deals with cross domain or forced-by-attrs requests
  19370. if ( s.crossDomain || s.scriptAttrs ) {
  19371. var script, callback;
  19372. return {
  19373. send: function( _, complete ) {
  19374. script = jQuery( "<script>" )
  19375. .attr( s.scriptAttrs || {} )
  19376. .prop( { charset: s.scriptCharset, src: s.url } )
  19377. .on( "load error", callback = function( evt ) {
  19378. script.remove();
  19379. callback = null;
  19380. if ( evt ) {
  19381. complete( evt.type === "error" ? 404 : 200, evt.type );
  19382. }
  19383. } );
  19384. // Use native DOM manipulation to avoid our domManip AJAX trickery
  19385. document.head.appendChild( script[ 0 ] );
  19386. },
  19387. abort: function() {
  19388. if ( callback ) {
  19389. callback();
  19390. }
  19391. }
  19392. };
  19393. }
  19394. } );
  19395. var oldCallbacks = [],
  19396. rjsonp = /(=)\?(?=&|$)|\?\?/;
  19397. // Default jsonp settings
  19398. jQuery.ajaxSetup( {
  19399. jsonp: "callback",
  19400. jsonpCallback: function() {
  19401. var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) );
  19402. this[ callback ] = true;
  19403. return callback;
  19404. }
  19405. } );
  19406. // Detect, normalize options and install callbacks for jsonp requests
  19407. jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
  19408. var callbackName, overwritten, responseContainer,
  19409. jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
  19410. "url" :
  19411. typeof s.data === "string" &&
  19412. ( s.contentType || "" )
  19413. .indexOf( "application/x-www-form-urlencoded" ) === 0 &&
  19414. rjsonp.test( s.data ) && "data"
  19415. );
  19416. // Handle iff the expected data type is "jsonp" or we have a parameter to set
  19417. if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
  19418. // Get callback name, remembering preexisting value associated with it
  19419. callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?
  19420. s.jsonpCallback() :
  19421. s.jsonpCallback;
  19422. // Insert callback into url or form data
  19423. if ( jsonProp ) {
  19424. s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
  19425. } else if ( s.jsonp !== false ) {
  19426. s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
  19427. }
  19428. // Use data converter to retrieve json after script execution
  19429. s.converters[ "script json" ] = function() {
  19430. if ( !responseContainer ) {
  19431. jQuery.error( callbackName + " was not called" );
  19432. }
  19433. return responseContainer[ 0 ];
  19434. };
  19435. // Force json dataType
  19436. s.dataTypes[ 0 ] = "json";
  19437. // Install callback
  19438. overwritten = window[ callbackName ];
  19439. window[ callbackName ] = function() {
  19440. responseContainer = arguments;
  19441. };
  19442. // Clean-up function (fires after converters)
  19443. jqXHR.always( function() {
  19444. // If previous value didn't exist - remove it
  19445. if ( overwritten === undefined ) {
  19446. jQuery( window ).removeProp( callbackName );
  19447. // Otherwise restore preexisting value
  19448. } else {
  19449. window[ callbackName ] = overwritten;
  19450. }
  19451. // Save back as free
  19452. if ( s[ callbackName ] ) {
  19453. // Make sure that re-using the options doesn't screw things around
  19454. s.jsonpCallback = originalSettings.jsonpCallback;
  19455. // Save the callback name for future use
  19456. oldCallbacks.push( callbackName );
  19457. }
  19458. // Call if it was a function and we have a response
  19459. if ( responseContainer && isFunction( overwritten ) ) {
  19460. overwritten( responseContainer[ 0 ] );
  19461. }
  19462. responseContainer = overwritten = undefined;
  19463. } );
  19464. // Delegate to script
  19465. return "script";
  19466. }
  19467. } );
  19468. // Support: Safari 8 only
  19469. // In Safari 8 documents created via document.implementation.createHTMLDocument
  19470. // collapse sibling forms: the second one becomes a child of the first one.
  19471. // Because of that, this security measure has to be disabled in Safari 8.
  19472. // https://bugs.webkit.org/show_bug.cgi?id=137337
  19473. support.createHTMLDocument = ( function() {
  19474. var body = document.implementation.createHTMLDocument( "" ).body;
  19475. body.innerHTML = "<form></form><form></form>";
  19476. return body.childNodes.length === 2;
  19477. } )();
  19478. // Argument "data" should be string of html
  19479. // context (optional): If specified, the fragment will be created in this context,
  19480. // defaults to document
  19481. // keepScripts (optional): If true, will include scripts passed in the html string
  19482. jQuery.parseHTML = function( data, context, keepScripts ) {
  19483. if ( typeof data !== "string" ) {
  19484. return [];
  19485. }
  19486. if ( typeof context === "boolean" ) {
  19487. keepScripts = context;
  19488. context = false;
  19489. }
  19490. var base, parsed, scripts;
  19491. if ( !context ) {
  19492. // Stop scripts or inline event handlers from being executed immediately
  19493. // by using document.implementation
  19494. if ( support.createHTMLDocument ) {
  19495. context = document.implementation.createHTMLDocument( "" );
  19496. // Set the base href for the created document
  19497. // so any parsed elements with URLs
  19498. // are based on the document's URL (gh-2965)
  19499. base = context.createElement( "base" );
  19500. base.href = document.location.href;
  19501. context.head.appendChild( base );
  19502. } else {
  19503. context = document;
  19504. }
  19505. }
  19506. parsed = rsingleTag.exec( data );
  19507. scripts = !keepScripts && [];
  19508. // Single tag
  19509. if ( parsed ) {
  19510. return [ context.createElement( parsed[ 1 ] ) ];
  19511. }
  19512. parsed = buildFragment( [ data ], context, scripts );
  19513. if ( scripts && scripts.length ) {
  19514. jQuery( scripts ).remove();
  19515. }
  19516. return jQuery.merge( [], parsed.childNodes );
  19517. };
  19518. /**
  19519. * Load a url into a page
  19520. */
  19521. jQuery.fn.load = function( url, params, callback ) {
  19522. var selector, type, response,
  19523. self = this,
  19524. off = url.indexOf( " " );
  19525. if ( off > -1 ) {
  19526. selector = stripAndCollapse( url.slice( off ) );
  19527. url = url.slice( 0, off );
  19528. }
  19529. // If it's a function
  19530. if ( isFunction( params ) ) {
  19531. // We assume that it's the callback
  19532. callback = params;
  19533. params = undefined;
  19534. // Otherwise, build a param string
  19535. } else if ( params && typeof params === "object" ) {
  19536. type = "POST";
  19537. }
  19538. // If we have elements to modify, make the request
  19539. if ( self.length > 0 ) {
  19540. jQuery.ajax( {
  19541. url: url,
  19542. // If "type" variable is undefined, then "GET" method will be used.
  19543. // Make value of this field explicit since
  19544. // user can override it through ajaxSetup method
  19545. type: type || "GET",
  19546. dataType: "html",
  19547. data: params
  19548. } ).done( function( responseText ) {
  19549. // Save response for use in complete callback
  19550. response = arguments;
  19551. self.html( selector ?
  19552. // If a selector was specified, locate the right elements in a dummy div
  19553. // Exclude scripts to avoid IE 'Permission Denied' errors
  19554. jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
  19555. // Otherwise use the full result
  19556. responseText );
  19557. // If the request succeeds, this function gets "data", "status", "jqXHR"
  19558. // but they are ignored because response was set above.
  19559. // If it fails, this function gets "jqXHR", "status", "error"
  19560. } ).always( callback && function( jqXHR, status ) {
  19561. self.each( function() {
  19562. callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
  19563. } );
  19564. } );
  19565. }
  19566. return this;
  19567. };
  19568. jQuery.expr.pseudos.animated = function( elem ) {
  19569. return jQuery.grep( jQuery.timers, function( fn ) {
  19570. return elem === fn.elem;
  19571. } ).length;
  19572. };
  19573. jQuery.offset = {
  19574. setOffset: function( elem, options, i ) {
  19575. var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
  19576. position = jQuery.css( elem, "position" ),
  19577. curElem = jQuery( elem ),
  19578. props = {};
  19579. // Set position first, in-case top/left are set even on static elem
  19580. if ( position === "static" ) {
  19581. elem.style.position = "relative";
  19582. }
  19583. curOffset = curElem.offset();
  19584. curCSSTop = jQuery.css( elem, "top" );
  19585. curCSSLeft = jQuery.css( elem, "left" );
  19586. calculatePosition = ( position === "absolute" || position === "fixed" ) &&
  19587. ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
  19588. // Need to be able to calculate position if either
  19589. // top or left is auto and position is either absolute or fixed
  19590. if ( calculatePosition ) {
  19591. curPosition = curElem.position();
  19592. curTop = curPosition.top;
  19593. curLeft = curPosition.left;
  19594. } else {
  19595. curTop = parseFloat( curCSSTop ) || 0;
  19596. curLeft = parseFloat( curCSSLeft ) || 0;
  19597. }
  19598. if ( isFunction( options ) ) {
  19599. // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
  19600. options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
  19601. }
  19602. if ( options.top != null ) {
  19603. props.top = ( options.top - curOffset.top ) + curTop;
  19604. }
  19605. if ( options.left != null ) {
  19606. props.left = ( options.left - curOffset.left ) + curLeft;
  19607. }
  19608. if ( "using" in options ) {
  19609. options.using.call( elem, props );
  19610. } else {
  19611. if ( typeof props.top === "number" ) {
  19612. props.top += "px";
  19613. }
  19614. if ( typeof props.left === "number" ) {
  19615. props.left += "px";
  19616. }
  19617. curElem.css( props );
  19618. }
  19619. }
  19620. };
  19621. jQuery.fn.extend( {
  19622. // offset() relates an element's border box to the document origin
  19623. offset: function( options ) {
  19624. // Preserve chaining for setter
  19625. if ( arguments.length ) {
  19626. return options === undefined ?
  19627. this :
  19628. this.each( function( i ) {
  19629. jQuery.offset.setOffset( this, options, i );
  19630. } );
  19631. }
  19632. var rect, win,
  19633. elem = this[ 0 ];
  19634. if ( !elem ) {
  19635. return;
  19636. }
  19637. // Return zeros for disconnected and hidden (display: none) elements (gh-2310)
  19638. // Support: IE <=11 only
  19639. // Running getBoundingClientRect on a
  19640. // disconnected node in IE throws an error
  19641. if ( !elem.getClientRects().length ) {
  19642. return { top: 0, left: 0 };
  19643. }
  19644. // Get document-relative position by adding viewport scroll to viewport-relative gBCR
  19645. rect = elem.getBoundingClientRect();
  19646. win = elem.ownerDocument.defaultView;
  19647. return {
  19648. top: rect.top + win.pageYOffset,
  19649. left: rect.left + win.pageXOffset
  19650. };
  19651. },
  19652. // position() relates an element's margin box to its offset parent's padding box
  19653. // This corresponds to the behavior of CSS absolute positioning
  19654. position: function() {
  19655. if ( !this[ 0 ] ) {
  19656. return;
  19657. }
  19658. var offsetParent, offset, doc,
  19659. elem = this[ 0 ],
  19660. parentOffset = { top: 0, left: 0 };
  19661. // position:fixed elements are offset from the viewport, which itself always has zero offset
  19662. if ( jQuery.css( elem, "position" ) === "fixed" ) {
  19663. // Assume position:fixed implies availability of getBoundingClientRect
  19664. offset = elem.getBoundingClientRect();
  19665. } else {
  19666. offset = this.offset();
  19667. // Account for the *real* offset parent, which can be the document or its root element
  19668. // when a statically positioned element is identified
  19669. doc = elem.ownerDocument;
  19670. offsetParent = elem.offsetParent || doc.documentElement;
  19671. while ( offsetParent &&
  19672. ( offsetParent === doc.body || offsetParent === doc.documentElement ) &&
  19673. jQuery.css( offsetParent, "position" ) === "static" ) {
  19674. offsetParent = offsetParent.parentNode;
  19675. }
  19676. if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {
  19677. // Incorporate borders into its offset, since they are outside its content origin
  19678. parentOffset = jQuery( offsetParent ).offset();
  19679. parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true );
  19680. parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true );
  19681. }
  19682. }
  19683. // Subtract parent offsets and element margins
  19684. return {
  19685. top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
  19686. left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
  19687. };
  19688. },
  19689. // This method will return documentElement in the following cases:
  19690. // 1) For the element inside the iframe without offsetParent, this method will return
  19691. // documentElement of the parent window
  19692. // 2) For the hidden or detached element
  19693. // 3) For body or html element, i.e. in case of the html node - it will return itself
  19694. //
  19695. // but those exceptions were never presented as a real life use-cases
  19696. // and might be considered as more preferable results.
  19697. //
  19698. // This logic, however, is not guaranteed and can change at any point in the future
  19699. offsetParent: function() {
  19700. return this.map( function() {
  19701. var offsetParent = this.offsetParent;
  19702. while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
  19703. offsetParent = offsetParent.offsetParent;
  19704. }
  19705. return offsetParent || documentElement;
  19706. } );
  19707. }
  19708. } );
  19709. // Create scrollLeft and scrollTop methods
  19710. jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
  19711. var top = "pageYOffset" === prop;
  19712. jQuery.fn[ method ] = function( val ) {
  19713. return access( this, function( elem, method, val ) {
  19714. // Coalesce documents and windows
  19715. var win;
  19716. if ( isWindow( elem ) ) {
  19717. win = elem;
  19718. } else if ( elem.nodeType === 9 ) {
  19719. win = elem.defaultView;
  19720. }
  19721. if ( val === undefined ) {
  19722. return win ? win[ prop ] : elem[ method ];
  19723. }
  19724. if ( win ) {
  19725. win.scrollTo(
  19726. !top ? val : win.pageXOffset,
  19727. top ? val : win.pageYOffset
  19728. );
  19729. } else {
  19730. elem[ method ] = val;
  19731. }
  19732. }, method, val, arguments.length );
  19733. };
  19734. } );
  19735. // Support: Safari <=7 - 9.1, Chrome <=37 - 49
  19736. // Add the top/left cssHooks using jQuery.fn.position
  19737. // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
  19738. // Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
  19739. // getComputedStyle returns percent when specified for top/left/bottom/right;
  19740. // rather than make the css module depend on the offset module, just check for it here
  19741. jQuery.each( [ "top", "left" ], function( _i, prop ) {
  19742. jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
  19743. function( elem, computed ) {
  19744. if ( computed ) {
  19745. computed = curCSS( elem, prop );
  19746. // If curCSS returns percentage, fallback to offset
  19747. return rnumnonpx.test( computed ) ?
  19748. jQuery( elem ).position()[ prop ] + "px" :
  19749. computed;
  19750. }
  19751. }
  19752. );
  19753. } );
  19754. // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
  19755. jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
  19756. jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
  19757. function( defaultExtra, funcName ) {
  19758. // Margin is only for outerHeight, outerWidth
  19759. jQuery.fn[ funcName ] = function( margin, value ) {
  19760. var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
  19761. extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
  19762. return access( this, function( elem, type, value ) {
  19763. var doc;
  19764. if ( isWindow( elem ) ) {
  19765. // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
  19766. return funcName.indexOf( "outer" ) === 0 ?
  19767. elem[ "inner" + name ] :
  19768. elem.document.documentElement[ "client" + name ];
  19769. }
  19770. // Get document width or height
  19771. if ( elem.nodeType === 9 ) {
  19772. doc = elem.documentElement;
  19773. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
  19774. // whichever is greatest
  19775. return Math.max(
  19776. elem.body[ "scroll" + name ], doc[ "scroll" + name ],
  19777. elem.body[ "offset" + name ], doc[ "offset" + name ],
  19778. doc[ "client" + name ]
  19779. );
  19780. }
  19781. return value === undefined ?
  19782. // Get width or height on the element, requesting but not forcing parseFloat
  19783. jQuery.css( elem, type, extra ) :
  19784. // Set width or height on the element
  19785. jQuery.style( elem, type, value, extra );
  19786. }, type, chainable ? margin : undefined, chainable );
  19787. };
  19788. } );
  19789. } );
  19790. jQuery.each( [
  19791. "ajaxStart",
  19792. "ajaxStop",
  19793. "ajaxComplete",
  19794. "ajaxError",
  19795. "ajaxSuccess",
  19796. "ajaxSend"
  19797. ], function( _i, type ) {
  19798. jQuery.fn[ type ] = function( fn ) {
  19799. return this.on( type, fn );
  19800. };
  19801. } );
  19802. jQuery.fn.extend( {
  19803. bind: function( types, data, fn ) {
  19804. return this.on( types, null, data, fn );
  19805. },
  19806. unbind: function( types, fn ) {
  19807. return this.off( types, null, fn );
  19808. },
  19809. delegate: function( selector, types, data, fn ) {
  19810. return this.on( types, selector, data, fn );
  19811. },
  19812. undelegate: function( selector, types, fn ) {
  19813. // ( namespace ) or ( selector, types [, fn] )
  19814. return arguments.length === 1 ?
  19815. this.off( selector, "**" ) :
  19816. this.off( types, selector || "**", fn );
  19817. },
  19818. hover: function( fnOver, fnOut ) {
  19819. return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
  19820. }
  19821. } );
  19822. jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
  19823. "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
  19824. "change select submit keydown keypress keyup contextmenu" ).split( " " ),
  19825. function( _i, name ) {
  19826. // Handle event binding
  19827. jQuery.fn[ name ] = function( data, fn ) {
  19828. return arguments.length > 0 ?
  19829. this.on( name, null, data, fn ) :
  19830. this.trigger( name );
  19831. };
  19832. } );
  19833. // Support: Android <=4.0 only
  19834. // Make sure we trim BOM and NBSP
  19835. var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
  19836. // Bind a function to a context, optionally partially applying any
  19837. // arguments.
  19838. // jQuery.proxy is deprecated to promote standards (specifically Function#bind)
  19839. // However, it is not slated for removal any time soon
  19840. jQuery.proxy = function( fn, context ) {
  19841. var tmp, args, proxy;
  19842. if ( typeof context === "string" ) {
  19843. tmp = fn[ context ];
  19844. context = fn;
  19845. fn = tmp;
  19846. }
  19847. // Quick check to determine if target is callable, in the spec
  19848. // this throws a TypeError, but we will just return undefined.
  19849. if ( !isFunction( fn ) ) {
  19850. return undefined;
  19851. }
  19852. // Simulated bind
  19853. args = slice.call( arguments, 2 );
  19854. proxy = function() {
  19855. return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
  19856. };
  19857. // Set the guid of unique handler to the same of original handler, so it can be removed
  19858. proxy.guid = fn.guid = fn.guid || jQuery.guid++;
  19859. return proxy;
  19860. };
  19861. jQuery.holdReady = function( hold ) {
  19862. if ( hold ) {
  19863. jQuery.readyWait++;
  19864. } else {
  19865. jQuery.ready( true );
  19866. }
  19867. };
  19868. jQuery.isArray = Array.isArray;
  19869. jQuery.parseJSON = JSON.parse;
  19870. jQuery.nodeName = nodeName;
  19871. jQuery.isFunction = isFunction;
  19872. jQuery.isWindow = isWindow;
  19873. jQuery.camelCase = camelCase;
  19874. jQuery.type = toType;
  19875. jQuery.now = Date.now;
  19876. jQuery.isNumeric = function( obj ) {
  19877. // As of jQuery 3.0, isNumeric is limited to
  19878. // strings and numbers (primitives or objects)
  19879. // that can be coerced to finite numbers (gh-2662)
  19880. var type = jQuery.type( obj );
  19881. return ( type === "number" || type === "string" ) &&
  19882. // parseFloat NaNs numeric-cast false positives ("")
  19883. // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
  19884. // subtraction forces infinities to NaN
  19885. !isNaN( obj - parseFloat( obj ) );
  19886. };
  19887. jQuery.trim = function( text ) {
  19888. return text == null ?
  19889. "" :
  19890. ( text + "" ).replace( rtrim, "" );
  19891. };
  19892. // Register as a named AMD module, since jQuery can be concatenated with other
  19893. // files that may use define, but not via a proper concatenation script that
  19894. // understands anonymous AMD modules. A named AMD is safest and most robust
  19895. // way to register. Lowercase jquery is used because AMD module names are
  19896. // derived from file names, and jQuery is normally delivered in a lowercase
  19897. // file name. Do this after creating the global so that if an AMD module wants
  19898. // to call noConflict to hide this version of jQuery, it will work.
  19899. // Note that for maximum portability, libraries that are not jQuery should
  19900. // declare themselves as anonymous modules, and avoid setting a global if an
  19901. // AMD loader is present. jQuery is a special case. For more information, see
  19902. // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
  19903. if ( true ) {
  19904. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  19905. return jQuery;
  19906. }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  19907. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  19908. }
  19909. var
  19910. // Map over jQuery in case of overwrite
  19911. _jQuery = window.jQuery,
  19912. // Map over the $ in case of overwrite
  19913. _$ = window.$;
  19914. jQuery.noConflict = function( deep ) {
  19915. if ( window.$ === jQuery ) {
  19916. window.$ = _$;
  19917. }
  19918. if ( deep && window.jQuery === jQuery ) {
  19919. window.jQuery = _jQuery;
  19920. }
  19921. return jQuery;
  19922. };
  19923. // Expose jQuery and $ identifiers, even in AMD
  19924. // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
  19925. // and CommonJS for browser emulators (#13566)
  19926. if ( typeof noGlobal === "undefined" ) {
  19927. window.jQuery = window.$ = jQuery;
  19928. }
  19929. return jQuery;
  19930. } );
  19931. /***/ }),
  19932. /***/ "./node_modules/js-cookie/src/js.cookie.js":
  19933. /*!*************************************************!*\
  19934. !*** ./node_modules/js-cookie/src/js.cookie.js ***!
  19935. \*************************************************/
  19936. /*! no static exports found */
  19937. /***/ (function(module, exports, __webpack_require__) {
  19938. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  19939. * JavaScript Cookie v2.2.1
  19940. * https://github.com/js-cookie/js-cookie
  19941. *
  19942. * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
  19943. * Released under the MIT license
  19944. */
  19945. ;(function (factory) {
  19946. var registeredInModuleLoader;
  19947. if (true) {
  19948. !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  19949. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  19950. (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
  19951. __WEBPACK_AMD_DEFINE_FACTORY__),
  19952. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  19953. registeredInModuleLoader = true;
  19954. }
  19955. if (true) {
  19956. module.exports = factory();
  19957. registeredInModuleLoader = true;
  19958. }
  19959. if (!registeredInModuleLoader) {
  19960. var OldCookies = window.Cookies;
  19961. var api = window.Cookies = factory();
  19962. api.noConflict = function () {
  19963. window.Cookies = OldCookies;
  19964. return api;
  19965. };
  19966. }
  19967. }(function () {
  19968. function extend () {
  19969. var i = 0;
  19970. var result = {};
  19971. for (; i < arguments.length; i++) {
  19972. var attributes = arguments[ i ];
  19973. for (var key in attributes) {
  19974. result[key] = attributes[key];
  19975. }
  19976. }
  19977. return result;
  19978. }
  19979. function decode (s) {
  19980. return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);
  19981. }
  19982. function init (converter) {
  19983. function api() {}
  19984. function set (key, value, attributes) {
  19985. if (typeof document === 'undefined') {
  19986. return;
  19987. }
  19988. attributes = extend({
  19989. path: '/'
  19990. }, api.defaults, attributes);
  19991. if (typeof attributes.expires === 'number') {
  19992. attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5);
  19993. }
  19994. // We're using "expires" because "max-age" is not supported by IE
  19995. attributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';
  19996. try {
  19997. var result = JSON.stringify(value);
  19998. if (/^[\{\[]/.test(result)) {
  19999. value = result;
  20000. }
  20001. } catch (e) {}
  20002. value = converter.write ?
  20003. converter.write(value, key) :
  20004. encodeURIComponent(String(value))
  20005. .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
  20006. key = encodeURIComponent(String(key))
  20007. .replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)
  20008. .replace(/[\(\)]/g, escape);
  20009. var stringifiedAttributes = '';
  20010. for (var attributeName in attributes) {
  20011. if (!attributes[attributeName]) {
  20012. continue;
  20013. }
  20014. stringifiedAttributes += '; ' + attributeName;
  20015. if (attributes[attributeName] === true) {
  20016. continue;
  20017. }
  20018. // Considers RFC 6265 section 5.2:
  20019. // ...
  20020. // 3. If the remaining unparsed-attributes contains a %x3B (";")
  20021. // character:
  20022. // Consume the characters of the unparsed-attributes up to,
  20023. // not including, the first %x3B (";") character.
  20024. // ...
  20025. stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];
  20026. }
  20027. return (document.cookie = key + '=' + value + stringifiedAttributes);
  20028. }
  20029. function get (key, json) {
  20030. if (typeof document === 'undefined') {
  20031. return;
  20032. }
  20033. var jar = {};
  20034. // To prevent the for loop in the first place assign an empty array
  20035. // in case there are no cookies at all.
  20036. var cookies = document.cookie ? document.cookie.split('; ') : [];
  20037. var i = 0;
  20038. for (; i < cookies.length; i++) {
  20039. var parts = cookies[i].split('=');
  20040. var cookie = parts.slice(1).join('=');
  20041. if (!json && cookie.charAt(0) === '"') {
  20042. cookie = cookie.slice(1, -1);
  20043. }
  20044. try {
  20045. var name = decode(parts[0]);
  20046. cookie = (converter.read || converter)(cookie, name) ||
  20047. decode(cookie);
  20048. if (json) {
  20049. try {
  20050. cookie = JSON.parse(cookie);
  20051. } catch (e) {}
  20052. }
  20053. jar[name] = cookie;
  20054. if (key === name) {
  20055. break;
  20056. }
  20057. } catch (e) {}
  20058. }
  20059. return key ? jar[key] : jar;
  20060. }
  20061. api.set = set;
  20062. api.get = function (key) {
  20063. return get(key, false /* read as raw */);
  20064. };
  20065. api.getJSON = function (key) {
  20066. return get(key, true /* read as json */);
  20067. };
  20068. api.remove = function (key, attributes) {
  20069. set(key, '', extend(attributes, {
  20070. expires: -1
  20071. }));
  20072. };
  20073. api.defaults = {};
  20074. api.withConverter = init;
  20075. return api;
  20076. }
  20077. return init(function () {});
  20078. }));
  20079. /***/ }),
  20080. /***/ "./node_modules/laravel-echo/dist/echo.js":
  20081. /*!************************************************!*\
  20082. !*** ./node_modules/laravel-echo/dist/echo.js ***!
  20083. \************************************************/
  20084. /*! exports provided: default */
  20085. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20086. "use strict";
  20087. __webpack_require__.r(__webpack_exports__);
  20088. function _classCallCheck(instance, Constructor) {
  20089. if (!(instance instanceof Constructor)) {
  20090. throw new TypeError("Cannot call a class as a function");
  20091. }
  20092. }
  20093. function _defineProperties(target, props) {
  20094. for (var i = 0; i < props.length; i++) {
  20095. var descriptor = props[i];
  20096. descriptor.enumerable = descriptor.enumerable || false;
  20097. descriptor.configurable = true;
  20098. if ("value" in descriptor) descriptor.writable = true;
  20099. Object.defineProperty(target, descriptor.key, descriptor);
  20100. }
  20101. }
  20102. function _createClass(Constructor, protoProps, staticProps) {
  20103. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  20104. if (staticProps) _defineProperties(Constructor, staticProps);
  20105. return Constructor;
  20106. }
  20107. function _extends() {
  20108. _extends = Object.assign || function (target) {
  20109. for (var i = 1; i < arguments.length; i++) {
  20110. var source = arguments[i];
  20111. for (var key in source) {
  20112. if (Object.prototype.hasOwnProperty.call(source, key)) {
  20113. target[key] = source[key];
  20114. }
  20115. }
  20116. }
  20117. return target;
  20118. };
  20119. return _extends.apply(this, arguments);
  20120. }
  20121. function _inherits(subClass, superClass) {
  20122. if (typeof superClass !== "function" && superClass !== null) {
  20123. throw new TypeError("Super expression must either be null or a function");
  20124. }
  20125. subClass.prototype = Object.create(superClass && superClass.prototype, {
  20126. constructor: {
  20127. value: subClass,
  20128. writable: true,
  20129. configurable: true
  20130. }
  20131. });
  20132. if (superClass) _setPrototypeOf(subClass, superClass);
  20133. }
  20134. function _getPrototypeOf(o) {
  20135. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  20136. return o.__proto__ || Object.getPrototypeOf(o);
  20137. };
  20138. return _getPrototypeOf(o);
  20139. }
  20140. function _setPrototypeOf(o, p) {
  20141. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  20142. o.__proto__ = p;
  20143. return o;
  20144. };
  20145. return _setPrototypeOf(o, p);
  20146. }
  20147. function _isNativeReflectConstruct() {
  20148. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  20149. if (Reflect.construct.sham) return false;
  20150. if (typeof Proxy === "function") return true;
  20151. try {
  20152. Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
  20153. return true;
  20154. } catch (e) {
  20155. return false;
  20156. }
  20157. }
  20158. function _assertThisInitialized(self) {
  20159. if (self === void 0) {
  20160. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  20161. }
  20162. return self;
  20163. }
  20164. function _possibleConstructorReturn(self, call) {
  20165. if (call && (typeof call === "object" || typeof call === "function")) {
  20166. return call;
  20167. }
  20168. return _assertThisInitialized(self);
  20169. }
  20170. function _createSuper(Derived) {
  20171. var hasNativeReflectConstruct = _isNativeReflectConstruct();
  20172. return function () {
  20173. var Super = _getPrototypeOf(Derived),
  20174. result;
  20175. if (hasNativeReflectConstruct) {
  20176. var NewTarget = _getPrototypeOf(this).constructor;
  20177. result = Reflect.construct(Super, arguments, NewTarget);
  20178. } else {
  20179. result = Super.apply(this, arguments);
  20180. }
  20181. return _possibleConstructorReturn(this, result);
  20182. };
  20183. }
  20184. var Connector = /*#__PURE__*/function () {
  20185. /**
  20186. * Create a new class instance.
  20187. */
  20188. function Connector(options) {
  20189. _classCallCheck(this, Connector);
  20190. /**
  20191. * Default connector options.
  20192. */
  20193. this._defaultOptions = {
  20194. auth: {
  20195. headers: {}
  20196. },
  20197. authEndpoint: '/broadcasting/auth',
  20198. broadcaster: 'pusher',
  20199. csrfToken: null,
  20200. host: null,
  20201. key: null,
  20202. namespace: 'App.Events'
  20203. };
  20204. this.setOptions(options);
  20205. this.connect();
  20206. }
  20207. /**
  20208. * Merge the custom options with the defaults.
  20209. */
  20210. _createClass(Connector, [{
  20211. key: "setOptions",
  20212. value: function setOptions(options) {
  20213. this.options = _extends(this._defaultOptions, options);
  20214. if (this.csrfToken()) {
  20215. this.options.auth.headers['X-CSRF-TOKEN'] = this.csrfToken();
  20216. }
  20217. return options;
  20218. }
  20219. /**
  20220. * Extract the CSRF token from the page.
  20221. */
  20222. }, {
  20223. key: "csrfToken",
  20224. value: function csrfToken() {
  20225. var selector;
  20226. if (typeof window !== 'undefined' && window['Laravel'] && window['Laravel'].csrfToken) {
  20227. return window['Laravel'].csrfToken;
  20228. } else if (this.options.csrfToken) {
  20229. return this.options.csrfToken;
  20230. } else if (typeof document !== 'undefined' && typeof document.querySelector === 'function' && (selector = document.querySelector('meta[name="csrf-token"]'))) {
  20231. return selector.getAttribute('content');
  20232. }
  20233. return null;
  20234. }
  20235. }]);
  20236. return Connector;
  20237. }();
  20238. /**
  20239. * This class represents a basic channel.
  20240. */
  20241. var Channel = /*#__PURE__*/function () {
  20242. function Channel() {
  20243. _classCallCheck(this, Channel);
  20244. }
  20245. _createClass(Channel, [{
  20246. key: "listenForWhisper",
  20247. /**
  20248. * Listen for a whisper event on the channel instance.
  20249. */
  20250. value: function listenForWhisper(event, callback) {
  20251. return this.listen('.client-' + event, callback);
  20252. }
  20253. /**
  20254. * Listen for an event on the channel instance.
  20255. */
  20256. }, {
  20257. key: "notification",
  20258. value: function notification(callback) {
  20259. return this.listen('.Illuminate\\Notifications\\Events\\BroadcastNotificationCreated', callback);
  20260. }
  20261. /**
  20262. * Stop listening for a whispser event on the channel instance.
  20263. */
  20264. }, {
  20265. key: "stopListeningForWhisper",
  20266. value: function stopListeningForWhisper(event) {
  20267. return this.stopListening('.client-' + event);
  20268. }
  20269. }]);
  20270. return Channel;
  20271. }();
  20272. /**
  20273. * Event name formatter
  20274. */
  20275. var EventFormatter = /*#__PURE__*/function () {
  20276. /**
  20277. * Create a new class instance.
  20278. */
  20279. function EventFormatter(namespace) {
  20280. _classCallCheck(this, EventFormatter);
  20281. this.setNamespace(namespace);
  20282. }
  20283. /**
  20284. * Format the given event name.
  20285. */
  20286. _createClass(EventFormatter, [{
  20287. key: "format",
  20288. value: function format(event) {
  20289. if (event.charAt(0) === '.' || event.charAt(0) === '\\') {
  20290. return event.substr(1);
  20291. } else if (this.namespace) {
  20292. event = this.namespace + '.' + event;
  20293. }
  20294. return event.replace(/\./g, '\\');
  20295. }
  20296. /**
  20297. * Set the event namespace.
  20298. */
  20299. }, {
  20300. key: "setNamespace",
  20301. value: function setNamespace(value) {
  20302. this.namespace = value;
  20303. }
  20304. }]);
  20305. return EventFormatter;
  20306. }();
  20307. /**
  20308. * This class represents a Pusher channel.
  20309. */
  20310. var PusherChannel = /*#__PURE__*/function (_Channel) {
  20311. _inherits(PusherChannel, _Channel);
  20312. var _super = _createSuper(PusherChannel);
  20313. /**
  20314. * Create a new class instance.
  20315. */
  20316. function PusherChannel(pusher, name, options) {
  20317. var _this;
  20318. _classCallCheck(this, PusherChannel);
  20319. _this = _super.call(this);
  20320. _this.name = name;
  20321. _this.pusher = pusher;
  20322. _this.options = options;
  20323. _this.eventFormatter = new EventFormatter(_this.options.namespace);
  20324. _this.subscribe();
  20325. return _this;
  20326. }
  20327. /**
  20328. * Subscribe to a Pusher channel.
  20329. */
  20330. _createClass(PusherChannel, [{
  20331. key: "subscribe",
  20332. value: function subscribe() {
  20333. this.subscription = this.pusher.subscribe(this.name);
  20334. }
  20335. /**
  20336. * Unsubscribe from a Pusher channel.
  20337. */
  20338. }, {
  20339. key: "unsubscribe",
  20340. value: function unsubscribe() {
  20341. this.pusher.unsubscribe(this.name);
  20342. }
  20343. /**
  20344. * Listen for an event on the channel instance.
  20345. */
  20346. }, {
  20347. key: "listen",
  20348. value: function listen(event, callback) {
  20349. this.on(this.eventFormatter.format(event), callback);
  20350. return this;
  20351. }
  20352. /**
  20353. * Stop listening for an event on the channel instance.
  20354. */
  20355. }, {
  20356. key: "stopListening",
  20357. value: function stopListening(event) {
  20358. this.subscription.unbind(this.eventFormatter.format(event));
  20359. return this;
  20360. }
  20361. /**
  20362. * Bind a channel to an event.
  20363. */
  20364. }, {
  20365. key: "on",
  20366. value: function on(event, callback) {
  20367. this.subscription.bind(event, callback);
  20368. return this;
  20369. }
  20370. }]);
  20371. return PusherChannel;
  20372. }(Channel);
  20373. /**
  20374. * This class represents a Pusher private channel.
  20375. */
  20376. var PusherPrivateChannel = /*#__PURE__*/function (_PusherChannel) {
  20377. _inherits(PusherPrivateChannel, _PusherChannel);
  20378. var _super = _createSuper(PusherPrivateChannel);
  20379. function PusherPrivateChannel() {
  20380. _classCallCheck(this, PusherPrivateChannel);
  20381. return _super.apply(this, arguments);
  20382. }
  20383. _createClass(PusherPrivateChannel, [{
  20384. key: "whisper",
  20385. /**
  20386. * Trigger client event on the channel.
  20387. */
  20388. value: function whisper(eventName, data) {
  20389. this.pusher.channels.channels[this.name].trigger("client-".concat(eventName), data);
  20390. return this;
  20391. }
  20392. }]);
  20393. return PusherPrivateChannel;
  20394. }(PusherChannel);
  20395. /**
  20396. * This class represents a Pusher private channel.
  20397. */
  20398. var PusherEncryptedPrivateChannel = /*#__PURE__*/function (_PusherChannel) {
  20399. _inherits(PusherEncryptedPrivateChannel, _PusherChannel);
  20400. var _super = _createSuper(PusherEncryptedPrivateChannel);
  20401. function PusherEncryptedPrivateChannel() {
  20402. _classCallCheck(this, PusherEncryptedPrivateChannel);
  20403. return _super.apply(this, arguments);
  20404. }
  20405. _createClass(PusherEncryptedPrivateChannel, [{
  20406. key: "whisper",
  20407. /**
  20408. * Trigger client event on the channel.
  20409. */
  20410. value: function whisper(eventName, data) {
  20411. this.pusher.channels.channels[this.name].trigger("client-".concat(eventName), data);
  20412. return this;
  20413. }
  20414. }]);
  20415. return PusherEncryptedPrivateChannel;
  20416. }(PusherChannel);
  20417. /**
  20418. * This class represents a Pusher presence channel.
  20419. */
  20420. var PusherPresenceChannel = /*#__PURE__*/function (_PusherChannel) {
  20421. _inherits(PusherPresenceChannel, _PusherChannel);
  20422. var _super = _createSuper(PusherPresenceChannel);
  20423. function PusherPresenceChannel() {
  20424. _classCallCheck(this, PusherPresenceChannel);
  20425. return _super.apply(this, arguments);
  20426. }
  20427. _createClass(PusherPresenceChannel, [{
  20428. key: "here",
  20429. /**
  20430. * Register a callback to be called anytime the member list changes.
  20431. */
  20432. value: function here(callback) {
  20433. this.on('pusher:subscription_succeeded', function (data) {
  20434. callback(Object.keys(data.members).map(function (k) {
  20435. return data.members[k];
  20436. }));
  20437. });
  20438. return this;
  20439. }
  20440. /**
  20441. * Listen for someone joining the channel.
  20442. */
  20443. }, {
  20444. key: "joining",
  20445. value: function joining(callback) {
  20446. this.on('pusher:member_added', function (member) {
  20447. callback(member.info);
  20448. });
  20449. return this;
  20450. }
  20451. /**
  20452. * Listen for someone leaving the channel.
  20453. */
  20454. }, {
  20455. key: "leaving",
  20456. value: function leaving(callback) {
  20457. this.on('pusher:member_removed', function (member) {
  20458. callback(member.info);
  20459. });
  20460. return this;
  20461. }
  20462. /**
  20463. * Trigger client event on the channel.
  20464. */
  20465. }, {
  20466. key: "whisper",
  20467. value: function whisper(eventName, data) {
  20468. this.pusher.channels.channels[this.name].trigger("client-".concat(eventName), data);
  20469. return this;
  20470. }
  20471. }]);
  20472. return PusherPresenceChannel;
  20473. }(PusherChannel);
  20474. /**
  20475. * This class represents a Socket.io channel.
  20476. */
  20477. var SocketIoChannel = /*#__PURE__*/function (_Channel) {
  20478. _inherits(SocketIoChannel, _Channel);
  20479. var _super = _createSuper(SocketIoChannel);
  20480. /**
  20481. * Create a new class instance.
  20482. */
  20483. function SocketIoChannel(socket, name, options) {
  20484. var _this;
  20485. _classCallCheck(this, SocketIoChannel);
  20486. _this = _super.call(this);
  20487. /**
  20488. * The event callbacks applied to the channel.
  20489. */
  20490. _this.events = {};
  20491. _this.name = name;
  20492. _this.socket = socket;
  20493. _this.options = options;
  20494. _this.eventFormatter = new EventFormatter(_this.options.namespace);
  20495. _this.subscribe();
  20496. _this.configureReconnector();
  20497. return _this;
  20498. }
  20499. /**
  20500. * Subscribe to a Socket.io channel.
  20501. */
  20502. _createClass(SocketIoChannel, [{
  20503. key: "subscribe",
  20504. value: function subscribe() {
  20505. this.socket.emit('subscribe', {
  20506. channel: this.name,
  20507. auth: this.options.auth || {}
  20508. });
  20509. }
  20510. /**
  20511. * Unsubscribe from channel and ubind event callbacks.
  20512. */
  20513. }, {
  20514. key: "unsubscribe",
  20515. value: function unsubscribe() {
  20516. this.unbind();
  20517. this.socket.emit('unsubscribe', {
  20518. channel: this.name,
  20519. auth: this.options.auth || {}
  20520. });
  20521. }
  20522. /**
  20523. * Listen for an event on the channel instance.
  20524. */
  20525. }, {
  20526. key: "listen",
  20527. value: function listen(event, callback) {
  20528. this.on(this.eventFormatter.format(event), callback);
  20529. return this;
  20530. }
  20531. /**
  20532. * Stop listening for an event on the channel instance.
  20533. */
  20534. }, {
  20535. key: "stopListening",
  20536. value: function stopListening(event) {
  20537. var name = this.eventFormatter.format(event);
  20538. this.socket.removeListener(name);
  20539. delete this.events[name];
  20540. return this;
  20541. }
  20542. /**
  20543. * Bind the channel's socket to an event and store the callback.
  20544. */
  20545. }, {
  20546. key: "on",
  20547. value: function on(event, callback) {
  20548. var _this2 = this;
  20549. var listener = function listener(channel, data) {
  20550. if (_this2.name == channel) {
  20551. callback(data);
  20552. }
  20553. };
  20554. this.socket.on(event, listener);
  20555. this.bind(event, listener);
  20556. }
  20557. /**
  20558. * Attach a 'reconnect' listener and bind the event.
  20559. */
  20560. }, {
  20561. key: "configureReconnector",
  20562. value: function configureReconnector() {
  20563. var _this3 = this;
  20564. var listener = function listener() {
  20565. _this3.subscribe();
  20566. };
  20567. this.socket.on('reconnect', listener);
  20568. this.bind('reconnect', listener);
  20569. }
  20570. /**
  20571. * Bind the channel's socket to an event and store the callback.
  20572. */
  20573. }, {
  20574. key: "bind",
  20575. value: function bind(event, callback) {
  20576. this.events[event] = this.events[event] || [];
  20577. this.events[event].push(callback);
  20578. }
  20579. /**
  20580. * Unbind the channel's socket from all stored event callbacks.
  20581. */
  20582. }, {
  20583. key: "unbind",
  20584. value: function unbind() {
  20585. var _this4 = this;
  20586. Object.keys(this.events).forEach(function (event) {
  20587. _this4.events[event].forEach(function (callback) {
  20588. _this4.socket.removeListener(event, callback);
  20589. });
  20590. delete _this4.events[event];
  20591. });
  20592. }
  20593. }]);
  20594. return SocketIoChannel;
  20595. }(Channel);
  20596. /**
  20597. * This class represents a Socket.io presence channel.
  20598. */
  20599. var SocketIoPrivateChannel = /*#__PURE__*/function (_SocketIoChannel) {
  20600. _inherits(SocketIoPrivateChannel, _SocketIoChannel);
  20601. var _super = _createSuper(SocketIoPrivateChannel);
  20602. function SocketIoPrivateChannel() {
  20603. _classCallCheck(this, SocketIoPrivateChannel);
  20604. return _super.apply(this, arguments);
  20605. }
  20606. _createClass(SocketIoPrivateChannel, [{
  20607. key: "whisper",
  20608. /**
  20609. * Trigger client event on the channel.
  20610. */
  20611. value: function whisper(eventName, data) {
  20612. this.socket.emit('client event', {
  20613. channel: this.name,
  20614. event: "client-".concat(eventName),
  20615. data: data
  20616. });
  20617. return this;
  20618. }
  20619. }]);
  20620. return SocketIoPrivateChannel;
  20621. }(SocketIoChannel);
  20622. /**
  20623. * This class represents a Socket.io presence channel.
  20624. */
  20625. var SocketIoPresenceChannel = /*#__PURE__*/function (_SocketIoPrivateChann) {
  20626. _inherits(SocketIoPresenceChannel, _SocketIoPrivateChann);
  20627. var _super = _createSuper(SocketIoPresenceChannel);
  20628. function SocketIoPresenceChannel() {
  20629. _classCallCheck(this, SocketIoPresenceChannel);
  20630. return _super.apply(this, arguments);
  20631. }
  20632. _createClass(SocketIoPresenceChannel, [{
  20633. key: "here",
  20634. /**
  20635. * Register a callback to be called anytime the member list changes.
  20636. */
  20637. value: function here(callback) {
  20638. this.on('presence:subscribed', function (members) {
  20639. callback(members.map(function (m) {
  20640. return m.user_info;
  20641. }));
  20642. });
  20643. return this;
  20644. }
  20645. /**
  20646. * Listen for someone joining the channel.
  20647. */
  20648. }, {
  20649. key: "joining",
  20650. value: function joining(callback) {
  20651. this.on('presence:joining', function (member) {
  20652. return callback(member.user_info);
  20653. });
  20654. return this;
  20655. }
  20656. /**
  20657. * Listen for someone leaving the channel.
  20658. */
  20659. }, {
  20660. key: "leaving",
  20661. value: function leaving(callback) {
  20662. this.on('presence:leaving', function (member) {
  20663. return callback(member.user_info);
  20664. });
  20665. return this;
  20666. }
  20667. }]);
  20668. return SocketIoPresenceChannel;
  20669. }(SocketIoPrivateChannel);
  20670. /**
  20671. * This class represents a null channel.
  20672. */
  20673. var NullChannel = /*#__PURE__*/function (_Channel) {
  20674. _inherits(NullChannel, _Channel);
  20675. var _super = _createSuper(NullChannel);
  20676. function NullChannel() {
  20677. _classCallCheck(this, NullChannel);
  20678. return _super.apply(this, arguments);
  20679. }
  20680. _createClass(NullChannel, [{
  20681. key: "subscribe",
  20682. /**
  20683. * Subscribe to a channel.
  20684. */
  20685. value: function subscribe() {} //
  20686. /**
  20687. * Unsubscribe from a channel.
  20688. */
  20689. }, {
  20690. key: "unsubscribe",
  20691. value: function unsubscribe() {} //
  20692. /**
  20693. * Listen for an event on the channel instance.
  20694. */
  20695. }, {
  20696. key: "listen",
  20697. value: function listen(event, callback) {
  20698. return this;
  20699. }
  20700. /**
  20701. * Stop listening for an event on the channel instance.
  20702. */
  20703. }, {
  20704. key: "stopListening",
  20705. value: function stopListening(event) {
  20706. return this;
  20707. }
  20708. /**
  20709. * Bind a channel to an event.
  20710. */
  20711. }, {
  20712. key: "on",
  20713. value: function on(event, callback) {
  20714. return this;
  20715. }
  20716. }]);
  20717. return NullChannel;
  20718. }(Channel);
  20719. /**
  20720. * This class represents a null private channel.
  20721. */
  20722. var NullPrivateChannel = /*#__PURE__*/function (_NullChannel) {
  20723. _inherits(NullPrivateChannel, _NullChannel);
  20724. var _super = _createSuper(NullPrivateChannel);
  20725. function NullPrivateChannel() {
  20726. _classCallCheck(this, NullPrivateChannel);
  20727. return _super.apply(this, arguments);
  20728. }
  20729. _createClass(NullPrivateChannel, [{
  20730. key: "whisper",
  20731. /**
  20732. * Trigger client event on the channel.
  20733. */
  20734. value: function whisper(eventName, data) {
  20735. return this;
  20736. }
  20737. }]);
  20738. return NullPrivateChannel;
  20739. }(NullChannel);
  20740. /**
  20741. * This class represents a null presence channel.
  20742. */
  20743. var NullPresenceChannel = /*#__PURE__*/function (_NullChannel) {
  20744. _inherits(NullPresenceChannel, _NullChannel);
  20745. var _super = _createSuper(NullPresenceChannel);
  20746. function NullPresenceChannel() {
  20747. _classCallCheck(this, NullPresenceChannel);
  20748. return _super.apply(this, arguments);
  20749. }
  20750. _createClass(NullPresenceChannel, [{
  20751. key: "here",
  20752. /**
  20753. * Register a callback to be called anytime the member list changes.
  20754. */
  20755. value: function here(callback) {
  20756. return this;
  20757. }
  20758. /**
  20759. * Listen for someone joining the channel.
  20760. */
  20761. }, {
  20762. key: "joining",
  20763. value: function joining(callback) {
  20764. return this;
  20765. }
  20766. /**
  20767. * Listen for someone leaving the channel.
  20768. */
  20769. }, {
  20770. key: "leaving",
  20771. value: function leaving(callback) {
  20772. return this;
  20773. }
  20774. /**
  20775. * Trigger client event on the channel.
  20776. */
  20777. }, {
  20778. key: "whisper",
  20779. value: function whisper(eventName, data) {
  20780. return this;
  20781. }
  20782. }]);
  20783. return NullPresenceChannel;
  20784. }(NullChannel);
  20785. /**
  20786. * This class creates a connector to Pusher.
  20787. */
  20788. var PusherConnector = /*#__PURE__*/function (_Connector) {
  20789. _inherits(PusherConnector, _Connector);
  20790. var _super = _createSuper(PusherConnector);
  20791. function PusherConnector() {
  20792. var _this;
  20793. _classCallCheck(this, PusherConnector);
  20794. _this = _super.apply(this, arguments);
  20795. /**
  20796. * All of the subscribed channel names.
  20797. */
  20798. _this.channels = {};
  20799. return _this;
  20800. }
  20801. /**
  20802. * Create a fresh Pusher connection.
  20803. */
  20804. _createClass(PusherConnector, [{
  20805. key: "connect",
  20806. value: function connect() {
  20807. if (typeof this.options.client !== 'undefined') {
  20808. this.pusher = this.options.client;
  20809. } else {
  20810. this.pusher = new Pusher(this.options.key, this.options);
  20811. }
  20812. }
  20813. /**
  20814. * Listen for an event on a channel instance.
  20815. */
  20816. }, {
  20817. key: "listen",
  20818. value: function listen(name, event, callback) {
  20819. return this.channel(name).listen(event, callback);
  20820. }
  20821. /**
  20822. * Get a channel instance by name.
  20823. */
  20824. }, {
  20825. key: "channel",
  20826. value: function channel(name) {
  20827. if (!this.channels[name]) {
  20828. this.channels[name] = new PusherChannel(this.pusher, name, this.options);
  20829. }
  20830. return this.channels[name];
  20831. }
  20832. /**
  20833. * Get a private channel instance by name.
  20834. */
  20835. }, {
  20836. key: "privateChannel",
  20837. value: function privateChannel(name) {
  20838. if (!this.channels['private-' + name]) {
  20839. this.channels['private-' + name] = new PusherPrivateChannel(this.pusher, 'private-' + name, this.options);
  20840. }
  20841. return this.channels['private-' + name];
  20842. }
  20843. /**
  20844. * Get a private encrypted channel instance by name.
  20845. */
  20846. }, {
  20847. key: "encryptedPrivateChannel",
  20848. value: function encryptedPrivateChannel(name) {
  20849. if (!this.channels['private-encrypted-' + name]) {
  20850. this.channels['private-encrypted-' + name] = new PusherEncryptedPrivateChannel(this.pusher, 'private-encrypted-' + name, this.options);
  20851. }
  20852. return this.channels['private-encrypted-' + name];
  20853. }
  20854. /**
  20855. * Get a presence channel instance by name.
  20856. */
  20857. }, {
  20858. key: "presenceChannel",
  20859. value: function presenceChannel(name) {
  20860. if (!this.channels['presence-' + name]) {
  20861. this.channels['presence-' + name] = new PusherPresenceChannel(this.pusher, 'presence-' + name, this.options);
  20862. }
  20863. return this.channels['presence-' + name];
  20864. }
  20865. /**
  20866. * Leave the given channel, as well as its private and presence variants.
  20867. */
  20868. }, {
  20869. key: "leave",
  20870. value: function leave(name) {
  20871. var _this2 = this;
  20872. var channels = [name, 'private-' + name, 'presence-' + name];
  20873. channels.forEach(function (name, index) {
  20874. _this2.leaveChannel(name);
  20875. });
  20876. }
  20877. /**
  20878. * Leave the given channel.
  20879. */
  20880. }, {
  20881. key: "leaveChannel",
  20882. value: function leaveChannel(name) {
  20883. if (this.channels[name]) {
  20884. this.channels[name].unsubscribe();
  20885. delete this.channels[name];
  20886. }
  20887. }
  20888. /**
  20889. * Get the socket ID for the connection.
  20890. */
  20891. }, {
  20892. key: "socketId",
  20893. value: function socketId() {
  20894. return this.pusher.connection.socket_id;
  20895. }
  20896. /**
  20897. * Disconnect Pusher connection.
  20898. */
  20899. }, {
  20900. key: "disconnect",
  20901. value: function disconnect() {
  20902. this.pusher.disconnect();
  20903. }
  20904. }]);
  20905. return PusherConnector;
  20906. }(Connector);
  20907. /**
  20908. * This class creates a connnector to a Socket.io server.
  20909. */
  20910. var SocketIoConnector = /*#__PURE__*/function (_Connector) {
  20911. _inherits(SocketIoConnector, _Connector);
  20912. var _super = _createSuper(SocketIoConnector);
  20913. function SocketIoConnector() {
  20914. var _this;
  20915. _classCallCheck(this, SocketIoConnector);
  20916. _this = _super.apply(this, arguments);
  20917. /**
  20918. * All of the subscribed channel names.
  20919. */
  20920. _this.channels = {};
  20921. return _this;
  20922. }
  20923. /**
  20924. * Create a fresh Socket.io connection.
  20925. */
  20926. _createClass(SocketIoConnector, [{
  20927. key: "connect",
  20928. value: function connect() {
  20929. var io = this.getSocketIO();
  20930. this.socket = io(this.options.host, this.options);
  20931. return this.socket;
  20932. }
  20933. /**
  20934. * Get socket.io module from global scope or options.
  20935. */
  20936. }, {
  20937. key: "getSocketIO",
  20938. value: function getSocketIO() {
  20939. if (typeof this.options.client !== 'undefined') {
  20940. return this.options.client;
  20941. }
  20942. if (typeof io !== 'undefined') {
  20943. return io;
  20944. }
  20945. throw new Error('Socket.io client not found. Should be globally available or passed via options.client');
  20946. }
  20947. /**
  20948. * Listen for an event on a channel instance.
  20949. */
  20950. }, {
  20951. key: "listen",
  20952. value: function listen(name, event, callback) {
  20953. return this.channel(name).listen(event, callback);
  20954. }
  20955. /**
  20956. * Get a channel instance by name.
  20957. */
  20958. }, {
  20959. key: "channel",
  20960. value: function channel(name) {
  20961. if (!this.channels[name]) {
  20962. this.channels[name] = new SocketIoChannel(this.socket, name, this.options);
  20963. }
  20964. return this.channels[name];
  20965. }
  20966. /**
  20967. * Get a private channel instance by name.
  20968. */
  20969. }, {
  20970. key: "privateChannel",
  20971. value: function privateChannel(name) {
  20972. if (!this.channels['private-' + name]) {
  20973. this.channels['private-' + name] = new SocketIoPrivateChannel(this.socket, 'private-' + name, this.options);
  20974. }
  20975. return this.channels['private-' + name];
  20976. }
  20977. /**
  20978. * Get a presence channel instance by name.
  20979. */
  20980. }, {
  20981. key: "presenceChannel",
  20982. value: function presenceChannel(name) {
  20983. if (!this.channels['presence-' + name]) {
  20984. this.channels['presence-' + name] = new SocketIoPresenceChannel(this.socket, 'presence-' + name, this.options);
  20985. }
  20986. return this.channels['presence-' + name];
  20987. }
  20988. /**
  20989. * Leave the given channel, as well as its private and presence variants.
  20990. */
  20991. }, {
  20992. key: "leave",
  20993. value: function leave(name) {
  20994. var _this2 = this;
  20995. var channels = [name, 'private-' + name, 'presence-' + name];
  20996. channels.forEach(function (name) {
  20997. _this2.leaveChannel(name);
  20998. });
  20999. }
  21000. /**
  21001. * Leave the given channel.
  21002. */
  21003. }, {
  21004. key: "leaveChannel",
  21005. value: function leaveChannel(name) {
  21006. if (this.channels[name]) {
  21007. this.channels[name].unsubscribe();
  21008. delete this.channels[name];
  21009. }
  21010. }
  21011. /**
  21012. * Get the socket ID for the connection.
  21013. */
  21014. }, {
  21015. key: "socketId",
  21016. value: function socketId() {
  21017. return this.socket.id;
  21018. }
  21019. /**
  21020. * Disconnect Socketio connection.
  21021. */
  21022. }, {
  21023. key: "disconnect",
  21024. value: function disconnect() {
  21025. this.socket.disconnect();
  21026. }
  21027. }]);
  21028. return SocketIoConnector;
  21029. }(Connector);
  21030. /**
  21031. * This class creates a null connector.
  21032. */
  21033. var NullConnector = /*#__PURE__*/function (_Connector) {
  21034. _inherits(NullConnector, _Connector);
  21035. var _super = _createSuper(NullConnector);
  21036. function NullConnector() {
  21037. var _this;
  21038. _classCallCheck(this, NullConnector);
  21039. _this = _super.apply(this, arguments);
  21040. /**
  21041. * All of the subscribed channel names.
  21042. */
  21043. _this.channels = {};
  21044. return _this;
  21045. }
  21046. /**
  21047. * Create a fresh connection.
  21048. */
  21049. _createClass(NullConnector, [{
  21050. key: "connect",
  21051. value: function connect() {} //
  21052. /**
  21053. * Listen for an event on a channel instance.
  21054. */
  21055. }, {
  21056. key: "listen",
  21057. value: function listen(name, event, callback) {
  21058. return new NullChannel();
  21059. }
  21060. /**
  21061. * Get a channel instance by name.
  21062. */
  21063. }, {
  21064. key: "channel",
  21065. value: function channel(name) {
  21066. return new NullChannel();
  21067. }
  21068. /**
  21069. * Get a private channel instance by name.
  21070. */
  21071. }, {
  21072. key: "privateChannel",
  21073. value: function privateChannel(name) {
  21074. return new NullPrivateChannel();
  21075. }
  21076. /**
  21077. * Get a presence channel instance by name.
  21078. */
  21079. }, {
  21080. key: "presenceChannel",
  21081. value: function presenceChannel(name) {
  21082. return new NullPresenceChannel();
  21083. }
  21084. /**
  21085. * Leave the given channel, as well as its private and presence variants.
  21086. */
  21087. }, {
  21088. key: "leave",
  21089. value: function leave(name) {} //
  21090. /**
  21091. * Leave the given channel.
  21092. */
  21093. }, {
  21094. key: "leaveChannel",
  21095. value: function leaveChannel(name) {} //
  21096. /**
  21097. * Get the socket ID for the connection.
  21098. */
  21099. }, {
  21100. key: "socketId",
  21101. value: function socketId() {
  21102. return 'fake-socket-id';
  21103. }
  21104. /**
  21105. * Disconnect the connection.
  21106. */
  21107. }, {
  21108. key: "disconnect",
  21109. value: function disconnect() {//
  21110. }
  21111. }]);
  21112. return NullConnector;
  21113. }(Connector);
  21114. /**
  21115. * This class is the primary API for interacting with broadcasting.
  21116. */
  21117. var Echo = /*#__PURE__*/function () {
  21118. /**
  21119. * Create a new class instance.
  21120. */
  21121. function Echo(options) {
  21122. _classCallCheck(this, Echo);
  21123. this.options = options;
  21124. this.connect();
  21125. if (!this.options.withoutInterceptors) {
  21126. this.registerInterceptors();
  21127. }
  21128. }
  21129. /**
  21130. * Get a channel instance by name.
  21131. */
  21132. _createClass(Echo, [{
  21133. key: "channel",
  21134. value: function channel(_channel) {
  21135. return this.connector.channel(_channel);
  21136. }
  21137. /**
  21138. * Create a new connection.
  21139. */
  21140. }, {
  21141. key: "connect",
  21142. value: function connect() {
  21143. if (this.options.broadcaster == 'pusher') {
  21144. this.connector = new PusherConnector(this.options);
  21145. } else if (this.options.broadcaster == 'socket.io') {
  21146. this.connector = new SocketIoConnector(this.options);
  21147. } else if (this.options.broadcaster == 'null') {
  21148. this.connector = new NullConnector(this.options);
  21149. } else if (typeof this.options.broadcaster == 'function') {
  21150. this.connector = new this.options.broadcaster(this.options);
  21151. }
  21152. }
  21153. /**
  21154. * Disconnect from the Echo server.
  21155. */
  21156. }, {
  21157. key: "disconnect",
  21158. value: function disconnect() {
  21159. this.connector.disconnect();
  21160. }
  21161. /**
  21162. * Get a presence channel instance by name.
  21163. */
  21164. }, {
  21165. key: "join",
  21166. value: function join(channel) {
  21167. return this.connector.presenceChannel(channel);
  21168. }
  21169. /**
  21170. * Leave the given channel, as well as its private and presence variants.
  21171. */
  21172. }, {
  21173. key: "leave",
  21174. value: function leave(channel) {
  21175. this.connector.leave(channel);
  21176. }
  21177. /**
  21178. * Leave the given channel.
  21179. */
  21180. }, {
  21181. key: "leaveChannel",
  21182. value: function leaveChannel(channel) {
  21183. this.connector.leaveChannel(channel);
  21184. }
  21185. /**
  21186. * Listen for an event on a channel instance.
  21187. */
  21188. }, {
  21189. key: "listen",
  21190. value: function listen(channel, event, callback) {
  21191. return this.connector.listen(channel, event, callback);
  21192. }
  21193. /**
  21194. * Get a private channel instance by name.
  21195. */
  21196. }, {
  21197. key: "private",
  21198. value: function _private(channel) {
  21199. return this.connector.privateChannel(channel);
  21200. }
  21201. /**
  21202. * Get a private encrypted channel instance by name.
  21203. */
  21204. }, {
  21205. key: "encryptedPrivate",
  21206. value: function encryptedPrivate(channel) {
  21207. return this.connector.encryptedPrivateChannel(channel);
  21208. }
  21209. /**
  21210. * Get the Socket ID for the connection.
  21211. */
  21212. }, {
  21213. key: "socketId",
  21214. value: function socketId() {
  21215. return this.connector.socketId();
  21216. }
  21217. /**
  21218. * Register 3rd party request interceptiors. These are used to automatically
  21219. * send a connections socket id to a Laravel app with a X-Socket-Id header.
  21220. */
  21221. }, {
  21222. key: "registerInterceptors",
  21223. value: function registerInterceptors() {
  21224. if (typeof Vue === 'function' && Vue.http) {
  21225. this.registerVueRequestInterceptor();
  21226. }
  21227. if (typeof axios === 'function') {
  21228. this.registerAxiosRequestInterceptor();
  21229. }
  21230. if (typeof jQuery === 'function') {
  21231. this.registerjQueryAjaxSetup();
  21232. }
  21233. }
  21234. /**
  21235. * Register a Vue HTTP interceptor to add the X-Socket-ID header.
  21236. */
  21237. }, {
  21238. key: "registerVueRequestInterceptor",
  21239. value: function registerVueRequestInterceptor() {
  21240. var _this = this;
  21241. Vue.http.interceptors.push(function (request, next) {
  21242. if (_this.socketId()) {
  21243. request.headers.set('X-Socket-ID', _this.socketId());
  21244. }
  21245. next();
  21246. });
  21247. }
  21248. /**
  21249. * Register an Axios HTTP interceptor to add the X-Socket-ID header.
  21250. */
  21251. }, {
  21252. key: "registerAxiosRequestInterceptor",
  21253. value: function registerAxiosRequestInterceptor() {
  21254. var _this2 = this;
  21255. axios.interceptors.request.use(function (config) {
  21256. if (_this2.socketId()) {
  21257. config.headers['X-Socket-Id'] = _this2.socketId();
  21258. }
  21259. return config;
  21260. });
  21261. }
  21262. /**
  21263. * Register jQuery AjaxPrefilter to add the X-Socket-ID header.
  21264. */
  21265. }, {
  21266. key: "registerjQueryAjaxSetup",
  21267. value: function registerjQueryAjaxSetup() {
  21268. var _this3 = this;
  21269. if (typeof jQuery.ajax != 'undefined') {
  21270. jQuery.ajaxPrefilter(function (options, originalOptions, xhr) {
  21271. if (_this3.socketId()) {
  21272. xhr.setRequestHeader('X-Socket-Id', _this3.socketId());
  21273. }
  21274. });
  21275. }
  21276. }
  21277. }]);
  21278. return Echo;
  21279. }();
  21280. /* harmony default export */ __webpack_exports__["default"] = (Echo);
  21281. /***/ }),
  21282. /***/ "./node_modules/lodash/lodash.js":
  21283. /*!***************************************!*\
  21284. !*** ./node_modules/lodash/lodash.js ***!
  21285. \***************************************/
  21286. /*! no static exports found */
  21287. /***/ (function(module, exports, __webpack_require__) {
  21288. /* WEBPACK VAR INJECTION */(function(global, module) {var __WEBPACK_AMD_DEFINE_RESULT__;/**
  21289. * @license
  21290. * Lodash <https://lodash.com/>
  21291. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  21292. * Released under MIT license <https://lodash.com/license>
  21293. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  21294. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  21295. */
  21296. ;(function() {
  21297. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  21298. var undefined;
  21299. /** Used as the semantic version number. */
  21300. var VERSION = '4.17.20';
  21301. /** Used as the size to enable large array optimizations. */
  21302. var LARGE_ARRAY_SIZE = 200;
  21303. /** Error message constants. */
  21304. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  21305. FUNC_ERROR_TEXT = 'Expected a function';
  21306. /** Used to stand-in for `undefined` hash values. */
  21307. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  21308. /** Used as the maximum memoize cache size. */
  21309. var MAX_MEMOIZE_SIZE = 500;
  21310. /** Used as the internal argument placeholder. */
  21311. var PLACEHOLDER = '__lodash_placeholder__';
  21312. /** Used to compose bitmasks for cloning. */
  21313. var CLONE_DEEP_FLAG = 1,
  21314. CLONE_FLAT_FLAG = 2,
  21315. CLONE_SYMBOLS_FLAG = 4;
  21316. /** Used to compose bitmasks for value comparisons. */
  21317. var COMPARE_PARTIAL_FLAG = 1,
  21318. COMPARE_UNORDERED_FLAG = 2;
  21319. /** Used to compose bitmasks for function metadata. */
  21320. var WRAP_BIND_FLAG = 1,
  21321. WRAP_BIND_KEY_FLAG = 2,
  21322. WRAP_CURRY_BOUND_FLAG = 4,
  21323. WRAP_CURRY_FLAG = 8,
  21324. WRAP_CURRY_RIGHT_FLAG = 16,
  21325. WRAP_PARTIAL_FLAG = 32,
  21326. WRAP_PARTIAL_RIGHT_FLAG = 64,
  21327. WRAP_ARY_FLAG = 128,
  21328. WRAP_REARG_FLAG = 256,
  21329. WRAP_FLIP_FLAG = 512;
  21330. /** Used as default options for `_.truncate`. */
  21331. var DEFAULT_TRUNC_LENGTH = 30,
  21332. DEFAULT_TRUNC_OMISSION = '...';
  21333. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  21334. var HOT_COUNT = 800,
  21335. HOT_SPAN = 16;
  21336. /** Used to indicate the type of lazy iteratees. */
  21337. var LAZY_FILTER_FLAG = 1,
  21338. LAZY_MAP_FLAG = 2,
  21339. LAZY_WHILE_FLAG = 3;
  21340. /** Used as references for various `Number` constants. */
  21341. var INFINITY = 1 / 0,
  21342. MAX_SAFE_INTEGER = 9007199254740991,
  21343. MAX_INTEGER = 1.7976931348623157e+308,
  21344. NAN = 0 / 0;
  21345. /** Used as references for the maximum length and index of an array. */
  21346. var MAX_ARRAY_LENGTH = 4294967295,
  21347. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  21348. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  21349. /** Used to associate wrap methods with their bit flags. */
  21350. var wrapFlags = [
  21351. ['ary', WRAP_ARY_FLAG],
  21352. ['bind', WRAP_BIND_FLAG],
  21353. ['bindKey', WRAP_BIND_KEY_FLAG],
  21354. ['curry', WRAP_CURRY_FLAG],
  21355. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  21356. ['flip', WRAP_FLIP_FLAG],
  21357. ['partial', WRAP_PARTIAL_FLAG],
  21358. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  21359. ['rearg', WRAP_REARG_FLAG]
  21360. ];
  21361. /** `Object#toString` result references. */
  21362. var argsTag = '[object Arguments]',
  21363. arrayTag = '[object Array]',
  21364. asyncTag = '[object AsyncFunction]',
  21365. boolTag = '[object Boolean]',
  21366. dateTag = '[object Date]',
  21367. domExcTag = '[object DOMException]',
  21368. errorTag = '[object Error]',
  21369. funcTag = '[object Function]',
  21370. genTag = '[object GeneratorFunction]',
  21371. mapTag = '[object Map]',
  21372. numberTag = '[object Number]',
  21373. nullTag = '[object Null]',
  21374. objectTag = '[object Object]',
  21375. promiseTag = '[object Promise]',
  21376. proxyTag = '[object Proxy]',
  21377. regexpTag = '[object RegExp]',
  21378. setTag = '[object Set]',
  21379. stringTag = '[object String]',
  21380. symbolTag = '[object Symbol]',
  21381. undefinedTag = '[object Undefined]',
  21382. weakMapTag = '[object WeakMap]',
  21383. weakSetTag = '[object WeakSet]';
  21384. var arrayBufferTag = '[object ArrayBuffer]',
  21385. dataViewTag = '[object DataView]',
  21386. float32Tag = '[object Float32Array]',
  21387. float64Tag = '[object Float64Array]',
  21388. int8Tag = '[object Int8Array]',
  21389. int16Tag = '[object Int16Array]',
  21390. int32Tag = '[object Int32Array]',
  21391. uint8Tag = '[object Uint8Array]',
  21392. uint8ClampedTag = '[object Uint8ClampedArray]',
  21393. uint16Tag = '[object Uint16Array]',
  21394. uint32Tag = '[object Uint32Array]';
  21395. /** Used to match empty string literals in compiled template source. */
  21396. var reEmptyStringLeading = /\b__p \+= '';/g,
  21397. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  21398. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  21399. /** Used to match HTML entities and HTML characters. */
  21400. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  21401. reUnescapedHtml = /[&<>"']/g,
  21402. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  21403. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  21404. /** Used to match template delimiters. */
  21405. var reEscape = /<%-([\s\S]+?)%>/g,
  21406. reEvaluate = /<%([\s\S]+?)%>/g,
  21407. reInterpolate = /<%=([\s\S]+?)%>/g;
  21408. /** Used to match property names within property paths. */
  21409. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  21410. reIsPlainProp = /^\w*$/,
  21411. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  21412. /**
  21413. * Used to match `RegExp`
  21414. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  21415. */
  21416. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  21417. reHasRegExpChar = RegExp(reRegExpChar.source);
  21418. /** Used to match leading and trailing whitespace. */
  21419. var reTrim = /^\s+|\s+$/g,
  21420. reTrimStart = /^\s+/,
  21421. reTrimEnd = /\s+$/;
  21422. /** Used to match wrap detail comments. */
  21423. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  21424. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  21425. reSplitDetails = /,? & /;
  21426. /** Used to match words composed of alphanumeric characters. */
  21427. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  21428. /** Used to match backslashes in property paths. */
  21429. var reEscapeChar = /\\(\\)?/g;
  21430. /**
  21431. * Used to match
  21432. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  21433. */
  21434. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  21435. /** Used to match `RegExp` flags from their coerced string values. */
  21436. var reFlags = /\w*$/;
  21437. /** Used to detect bad signed hexadecimal string values. */
  21438. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  21439. /** Used to detect binary string values. */
  21440. var reIsBinary = /^0b[01]+$/i;
  21441. /** Used to detect host constructors (Safari). */
  21442. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  21443. /** Used to detect octal string values. */
  21444. var reIsOctal = /^0o[0-7]+$/i;
  21445. /** Used to detect unsigned integer values. */
  21446. var reIsUint = /^(?:0|[1-9]\d*)$/;
  21447. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  21448. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  21449. /** Used to ensure capturing order of template delimiters. */
  21450. var reNoMatch = /($^)/;
  21451. /** Used to match unescaped characters in compiled string literals. */
  21452. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  21453. /** Used to compose unicode character classes. */
  21454. var rsAstralRange = '\\ud800-\\udfff',
  21455. rsComboMarksRange = '\\u0300-\\u036f',
  21456. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  21457. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  21458. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  21459. rsDingbatRange = '\\u2700-\\u27bf',
  21460. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  21461. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  21462. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  21463. rsPunctuationRange = '\\u2000-\\u206f',
  21464. rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
  21465. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  21466. rsVarRange = '\\ufe0e\\ufe0f',
  21467. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  21468. /** Used to compose unicode capture groups. */
  21469. var rsApos = "['\u2019]",
  21470. rsAstral = '[' + rsAstralRange + ']',
  21471. rsBreak = '[' + rsBreakRange + ']',
  21472. rsCombo = '[' + rsComboRange + ']',
  21473. rsDigits = '\\d+',
  21474. rsDingbat = '[' + rsDingbatRange + ']',
  21475. rsLower = '[' + rsLowerRange + ']',
  21476. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  21477. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  21478. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  21479. rsNonAstral = '[^' + rsAstralRange + ']',
  21480. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  21481. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  21482. rsUpper = '[' + rsUpperRange + ']',
  21483. rsZWJ = '\\u200d';
  21484. /** Used to compose unicode regexes. */
  21485. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  21486. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  21487. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  21488. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  21489. reOptMod = rsModifier + '?',
  21490. rsOptVar = '[' + rsVarRange + ']?',
  21491. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  21492. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  21493. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  21494. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  21495. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  21496. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  21497. /** Used to match apostrophes. */
  21498. var reApos = RegExp(rsApos, 'g');
  21499. /**
  21500. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  21501. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  21502. */
  21503. var reComboMark = RegExp(rsCombo, 'g');
  21504. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  21505. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  21506. /** Used to match complex or compound words. */
  21507. var reUnicodeWord = RegExp([
  21508. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  21509. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  21510. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  21511. rsUpper + '+' + rsOptContrUpper,
  21512. rsOrdUpper,
  21513. rsOrdLower,
  21514. rsDigits,
  21515. rsEmoji
  21516. ].join('|'), 'g');
  21517. /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
  21518. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  21519. /** Used to detect strings that need a more robust regexp to match words. */
  21520. var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
  21521. /** Used to assign default `context` object properties. */
  21522. var contextProps = [
  21523. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  21524. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  21525. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  21526. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  21527. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  21528. ];
  21529. /** Used to make template sourceURLs easier to identify. */
  21530. var templateCounter = -1;
  21531. /** Used to identify `toStringTag` values of typed arrays. */
  21532. var typedArrayTags = {};
  21533. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  21534. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  21535. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  21536. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  21537. typedArrayTags[uint32Tag] = true;
  21538. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  21539. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  21540. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  21541. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  21542. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  21543. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  21544. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  21545. typedArrayTags[weakMapTag] = false;
  21546. /** Used to identify `toStringTag` values supported by `_.clone`. */
  21547. var cloneableTags = {};
  21548. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  21549. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  21550. cloneableTags[boolTag] = cloneableTags[dateTag] =
  21551. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  21552. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  21553. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  21554. cloneableTags[numberTag] = cloneableTags[objectTag] =
  21555. cloneableTags[regexpTag] = cloneableTags[setTag] =
  21556. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  21557. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  21558. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  21559. cloneableTags[errorTag] = cloneableTags[funcTag] =
  21560. cloneableTags[weakMapTag] = false;
  21561. /** Used to map Latin Unicode letters to basic Latin letters. */
  21562. var deburredLetters = {
  21563. // Latin-1 Supplement block.
  21564. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  21565. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  21566. '\xc7': 'C', '\xe7': 'c',
  21567. '\xd0': 'D', '\xf0': 'd',
  21568. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  21569. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  21570. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  21571. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  21572. '\xd1': 'N', '\xf1': 'n',
  21573. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  21574. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  21575. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  21576. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  21577. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  21578. '\xc6': 'Ae', '\xe6': 'ae',
  21579. '\xde': 'Th', '\xfe': 'th',
  21580. '\xdf': 'ss',
  21581. // Latin Extended-A block.
  21582. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  21583. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  21584. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  21585. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  21586. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  21587. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  21588. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  21589. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  21590. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  21591. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  21592. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  21593. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  21594. '\u0134': 'J', '\u0135': 'j',
  21595. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  21596. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  21597. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  21598. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  21599. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  21600. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  21601. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  21602. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  21603. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  21604. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  21605. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  21606. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  21607. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  21608. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  21609. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  21610. '\u0174': 'W', '\u0175': 'w',
  21611. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  21612. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  21613. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  21614. '\u0132': 'IJ', '\u0133': 'ij',
  21615. '\u0152': 'Oe', '\u0153': 'oe',
  21616. '\u0149': "'n", '\u017f': 's'
  21617. };
  21618. /** Used to map characters to HTML entities. */
  21619. var htmlEscapes = {
  21620. '&': '&amp;',
  21621. '<': '&lt;',
  21622. '>': '&gt;',
  21623. '"': '&quot;',
  21624. "'": '&#39;'
  21625. };
  21626. /** Used to map HTML entities to characters. */
  21627. var htmlUnescapes = {
  21628. '&amp;': '&',
  21629. '&lt;': '<',
  21630. '&gt;': '>',
  21631. '&quot;': '"',
  21632. '&#39;': "'"
  21633. };
  21634. /** Used to escape characters for inclusion in compiled string literals. */
  21635. var stringEscapes = {
  21636. '\\': '\\',
  21637. "'": "'",
  21638. '\n': 'n',
  21639. '\r': 'r',
  21640. '\u2028': 'u2028',
  21641. '\u2029': 'u2029'
  21642. };
  21643. /** Built-in method references without a dependency on `root`. */
  21644. var freeParseFloat = parseFloat,
  21645. freeParseInt = parseInt;
  21646. /** Detect free variable `global` from Node.js. */
  21647. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  21648. /** Detect free variable `self`. */
  21649. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  21650. /** Used as a reference to the global object. */
  21651. var root = freeGlobal || freeSelf || Function('return this')();
  21652. /** Detect free variable `exports`. */
  21653. var freeExports = true && exports && !exports.nodeType && exports;
  21654. /** Detect free variable `module`. */
  21655. var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
  21656. /** Detect the popular CommonJS extension `module.exports`. */
  21657. var moduleExports = freeModule && freeModule.exports === freeExports;
  21658. /** Detect free variable `process` from Node.js. */
  21659. var freeProcess = moduleExports && freeGlobal.process;
  21660. /** Used to access faster Node.js helpers. */
  21661. var nodeUtil = (function() {
  21662. try {
  21663. // Use `util.types` for Node.js 10+.
  21664. var types = freeModule && freeModule.require && freeModule.require('util').types;
  21665. if (types) {
  21666. return types;
  21667. }
  21668. // Legacy `process.binding('util')` for Node.js < 10.
  21669. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  21670. } catch (e) {}
  21671. }());
  21672. /* Node.js helper references. */
  21673. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  21674. nodeIsDate = nodeUtil && nodeUtil.isDate,
  21675. nodeIsMap = nodeUtil && nodeUtil.isMap,
  21676. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  21677. nodeIsSet = nodeUtil && nodeUtil.isSet,
  21678. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  21679. /*--------------------------------------------------------------------------*/
  21680. /**
  21681. * A faster alternative to `Function#apply`, this function invokes `func`
  21682. * with the `this` binding of `thisArg` and the arguments of `args`.
  21683. *
  21684. * @private
  21685. * @param {Function} func The function to invoke.
  21686. * @param {*} thisArg The `this` binding of `func`.
  21687. * @param {Array} args The arguments to invoke `func` with.
  21688. * @returns {*} Returns the result of `func`.
  21689. */
  21690. function apply(func, thisArg, args) {
  21691. switch (args.length) {
  21692. case 0: return func.call(thisArg);
  21693. case 1: return func.call(thisArg, args[0]);
  21694. case 2: return func.call(thisArg, args[0], args[1]);
  21695. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  21696. }
  21697. return func.apply(thisArg, args);
  21698. }
  21699. /**
  21700. * A specialized version of `baseAggregator` for arrays.
  21701. *
  21702. * @private
  21703. * @param {Array} [array] The array to iterate over.
  21704. * @param {Function} setter The function to set `accumulator` values.
  21705. * @param {Function} iteratee The iteratee to transform keys.
  21706. * @param {Object} accumulator The initial aggregated object.
  21707. * @returns {Function} Returns `accumulator`.
  21708. */
  21709. function arrayAggregator(array, setter, iteratee, accumulator) {
  21710. var index = -1,
  21711. length = array == null ? 0 : array.length;
  21712. while (++index < length) {
  21713. var value = array[index];
  21714. setter(accumulator, value, iteratee(value), array);
  21715. }
  21716. return accumulator;
  21717. }
  21718. /**
  21719. * A specialized version of `_.forEach` for arrays without support for
  21720. * iteratee shorthands.
  21721. *
  21722. * @private
  21723. * @param {Array} [array] The array to iterate over.
  21724. * @param {Function} iteratee The function invoked per iteration.
  21725. * @returns {Array} Returns `array`.
  21726. */
  21727. function arrayEach(array, iteratee) {
  21728. var index = -1,
  21729. length = array == null ? 0 : array.length;
  21730. while (++index < length) {
  21731. if (iteratee(array[index], index, array) === false) {
  21732. break;
  21733. }
  21734. }
  21735. return array;
  21736. }
  21737. /**
  21738. * A specialized version of `_.forEachRight` for arrays without support for
  21739. * iteratee shorthands.
  21740. *
  21741. * @private
  21742. * @param {Array} [array] The array to iterate over.
  21743. * @param {Function} iteratee The function invoked per iteration.
  21744. * @returns {Array} Returns `array`.
  21745. */
  21746. function arrayEachRight(array, iteratee) {
  21747. var length = array == null ? 0 : array.length;
  21748. while (length--) {
  21749. if (iteratee(array[length], length, array) === false) {
  21750. break;
  21751. }
  21752. }
  21753. return array;
  21754. }
  21755. /**
  21756. * A specialized version of `_.every` for arrays without support for
  21757. * iteratee shorthands.
  21758. *
  21759. * @private
  21760. * @param {Array} [array] The array to iterate over.
  21761. * @param {Function} predicate The function invoked per iteration.
  21762. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  21763. * else `false`.
  21764. */
  21765. function arrayEvery(array, predicate) {
  21766. var index = -1,
  21767. length = array == null ? 0 : array.length;
  21768. while (++index < length) {
  21769. if (!predicate(array[index], index, array)) {
  21770. return false;
  21771. }
  21772. }
  21773. return true;
  21774. }
  21775. /**
  21776. * A specialized version of `_.filter` for arrays without support for
  21777. * iteratee shorthands.
  21778. *
  21779. * @private
  21780. * @param {Array} [array] The array to iterate over.
  21781. * @param {Function} predicate The function invoked per iteration.
  21782. * @returns {Array} Returns the new filtered array.
  21783. */
  21784. function arrayFilter(array, predicate) {
  21785. var index = -1,
  21786. length = array == null ? 0 : array.length,
  21787. resIndex = 0,
  21788. result = [];
  21789. while (++index < length) {
  21790. var value = array[index];
  21791. if (predicate(value, index, array)) {
  21792. result[resIndex++] = value;
  21793. }
  21794. }
  21795. return result;
  21796. }
  21797. /**
  21798. * A specialized version of `_.includes` for arrays without support for
  21799. * specifying an index to search from.
  21800. *
  21801. * @private
  21802. * @param {Array} [array] The array to inspect.
  21803. * @param {*} target The value to search for.
  21804. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  21805. */
  21806. function arrayIncludes(array, value) {
  21807. var length = array == null ? 0 : array.length;
  21808. return !!length && baseIndexOf(array, value, 0) > -1;
  21809. }
  21810. /**
  21811. * This function is like `arrayIncludes` except that it accepts a comparator.
  21812. *
  21813. * @private
  21814. * @param {Array} [array] The array to inspect.
  21815. * @param {*} target The value to search for.
  21816. * @param {Function} comparator The comparator invoked per element.
  21817. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  21818. */
  21819. function arrayIncludesWith(array, value, comparator) {
  21820. var index = -1,
  21821. length = array == null ? 0 : array.length;
  21822. while (++index < length) {
  21823. if (comparator(value, array[index])) {
  21824. return true;
  21825. }
  21826. }
  21827. return false;
  21828. }
  21829. /**
  21830. * A specialized version of `_.map` for arrays without support for iteratee
  21831. * shorthands.
  21832. *
  21833. * @private
  21834. * @param {Array} [array] The array to iterate over.
  21835. * @param {Function} iteratee The function invoked per iteration.
  21836. * @returns {Array} Returns the new mapped array.
  21837. */
  21838. function arrayMap(array, iteratee) {
  21839. var index = -1,
  21840. length = array == null ? 0 : array.length,
  21841. result = Array(length);
  21842. while (++index < length) {
  21843. result[index] = iteratee(array[index], index, array);
  21844. }
  21845. return result;
  21846. }
  21847. /**
  21848. * Appends the elements of `values` to `array`.
  21849. *
  21850. * @private
  21851. * @param {Array} array The array to modify.
  21852. * @param {Array} values The values to append.
  21853. * @returns {Array} Returns `array`.
  21854. */
  21855. function arrayPush(array, values) {
  21856. var index = -1,
  21857. length = values.length,
  21858. offset = array.length;
  21859. while (++index < length) {
  21860. array[offset + index] = values[index];
  21861. }
  21862. return array;
  21863. }
  21864. /**
  21865. * A specialized version of `_.reduce` for arrays without support for
  21866. * iteratee shorthands.
  21867. *
  21868. * @private
  21869. * @param {Array} [array] The array to iterate over.
  21870. * @param {Function} iteratee The function invoked per iteration.
  21871. * @param {*} [accumulator] The initial value.
  21872. * @param {boolean} [initAccum] Specify using the first element of `array` as
  21873. * the initial value.
  21874. * @returns {*} Returns the accumulated value.
  21875. */
  21876. function arrayReduce(array, iteratee, accumulator, initAccum) {
  21877. var index = -1,
  21878. length = array == null ? 0 : array.length;
  21879. if (initAccum && length) {
  21880. accumulator = array[++index];
  21881. }
  21882. while (++index < length) {
  21883. accumulator = iteratee(accumulator, array[index], index, array);
  21884. }
  21885. return accumulator;
  21886. }
  21887. /**
  21888. * A specialized version of `_.reduceRight` for arrays without support for
  21889. * iteratee shorthands.
  21890. *
  21891. * @private
  21892. * @param {Array} [array] The array to iterate over.
  21893. * @param {Function} iteratee The function invoked per iteration.
  21894. * @param {*} [accumulator] The initial value.
  21895. * @param {boolean} [initAccum] Specify using the last element of `array` as
  21896. * the initial value.
  21897. * @returns {*} Returns the accumulated value.
  21898. */
  21899. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  21900. var length = array == null ? 0 : array.length;
  21901. if (initAccum && length) {
  21902. accumulator = array[--length];
  21903. }
  21904. while (length--) {
  21905. accumulator = iteratee(accumulator, array[length], length, array);
  21906. }
  21907. return accumulator;
  21908. }
  21909. /**
  21910. * A specialized version of `_.some` for arrays without support for iteratee
  21911. * shorthands.
  21912. *
  21913. * @private
  21914. * @param {Array} [array] The array to iterate over.
  21915. * @param {Function} predicate The function invoked per iteration.
  21916. * @returns {boolean} Returns `true` if any element passes the predicate check,
  21917. * else `false`.
  21918. */
  21919. function arraySome(array, predicate) {
  21920. var index = -1,
  21921. length = array == null ? 0 : array.length;
  21922. while (++index < length) {
  21923. if (predicate(array[index], index, array)) {
  21924. return true;
  21925. }
  21926. }
  21927. return false;
  21928. }
  21929. /**
  21930. * Gets the size of an ASCII `string`.
  21931. *
  21932. * @private
  21933. * @param {string} string The string inspect.
  21934. * @returns {number} Returns the string size.
  21935. */
  21936. var asciiSize = baseProperty('length');
  21937. /**
  21938. * Converts an ASCII `string` to an array.
  21939. *
  21940. * @private
  21941. * @param {string} string The string to convert.
  21942. * @returns {Array} Returns the converted array.
  21943. */
  21944. function asciiToArray(string) {
  21945. return string.split('');
  21946. }
  21947. /**
  21948. * Splits an ASCII `string` into an array of its words.
  21949. *
  21950. * @private
  21951. * @param {string} The string to inspect.
  21952. * @returns {Array} Returns the words of `string`.
  21953. */
  21954. function asciiWords(string) {
  21955. return string.match(reAsciiWord) || [];
  21956. }
  21957. /**
  21958. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  21959. * without support for iteratee shorthands, which iterates over `collection`
  21960. * using `eachFunc`.
  21961. *
  21962. * @private
  21963. * @param {Array|Object} collection The collection to inspect.
  21964. * @param {Function} predicate The function invoked per iteration.
  21965. * @param {Function} eachFunc The function to iterate over `collection`.
  21966. * @returns {*} Returns the found element or its key, else `undefined`.
  21967. */
  21968. function baseFindKey(collection, predicate, eachFunc) {
  21969. var result;
  21970. eachFunc(collection, function(value, key, collection) {
  21971. if (predicate(value, key, collection)) {
  21972. result = key;
  21973. return false;
  21974. }
  21975. });
  21976. return result;
  21977. }
  21978. /**
  21979. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  21980. * support for iteratee shorthands.
  21981. *
  21982. * @private
  21983. * @param {Array} array The array to inspect.
  21984. * @param {Function} predicate The function invoked per iteration.
  21985. * @param {number} fromIndex The index to search from.
  21986. * @param {boolean} [fromRight] Specify iterating from right to left.
  21987. * @returns {number} Returns the index of the matched value, else `-1`.
  21988. */
  21989. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  21990. var length = array.length,
  21991. index = fromIndex + (fromRight ? 1 : -1);
  21992. while ((fromRight ? index-- : ++index < length)) {
  21993. if (predicate(array[index], index, array)) {
  21994. return index;
  21995. }
  21996. }
  21997. return -1;
  21998. }
  21999. /**
  22000. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  22001. *
  22002. * @private
  22003. * @param {Array} array The array to inspect.
  22004. * @param {*} value The value to search for.
  22005. * @param {number} fromIndex The index to search from.
  22006. * @returns {number} Returns the index of the matched value, else `-1`.
  22007. */
  22008. function baseIndexOf(array, value, fromIndex) {
  22009. return value === value
  22010. ? strictIndexOf(array, value, fromIndex)
  22011. : baseFindIndex(array, baseIsNaN, fromIndex);
  22012. }
  22013. /**
  22014. * This function is like `baseIndexOf` except that it accepts a comparator.
  22015. *
  22016. * @private
  22017. * @param {Array} array The array to inspect.
  22018. * @param {*} value The value to search for.
  22019. * @param {number} fromIndex The index to search from.
  22020. * @param {Function} comparator The comparator invoked per element.
  22021. * @returns {number} Returns the index of the matched value, else `-1`.
  22022. */
  22023. function baseIndexOfWith(array, value, fromIndex, comparator) {
  22024. var index = fromIndex - 1,
  22025. length = array.length;
  22026. while (++index < length) {
  22027. if (comparator(array[index], value)) {
  22028. return index;
  22029. }
  22030. }
  22031. return -1;
  22032. }
  22033. /**
  22034. * The base implementation of `_.isNaN` without support for number objects.
  22035. *
  22036. * @private
  22037. * @param {*} value The value to check.
  22038. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  22039. */
  22040. function baseIsNaN(value) {
  22041. return value !== value;
  22042. }
  22043. /**
  22044. * The base implementation of `_.mean` and `_.meanBy` without support for
  22045. * iteratee shorthands.
  22046. *
  22047. * @private
  22048. * @param {Array} array The array to iterate over.
  22049. * @param {Function} iteratee The function invoked per iteration.
  22050. * @returns {number} Returns the mean.
  22051. */
  22052. function baseMean(array, iteratee) {
  22053. var length = array == null ? 0 : array.length;
  22054. return length ? (baseSum(array, iteratee) / length) : NAN;
  22055. }
  22056. /**
  22057. * The base implementation of `_.property` without support for deep paths.
  22058. *
  22059. * @private
  22060. * @param {string} key The key of the property to get.
  22061. * @returns {Function} Returns the new accessor function.
  22062. */
  22063. function baseProperty(key) {
  22064. return function(object) {
  22065. return object == null ? undefined : object[key];
  22066. };
  22067. }
  22068. /**
  22069. * The base implementation of `_.propertyOf` without support for deep paths.
  22070. *
  22071. * @private
  22072. * @param {Object} object The object to query.
  22073. * @returns {Function} Returns the new accessor function.
  22074. */
  22075. function basePropertyOf(object) {
  22076. return function(key) {
  22077. return object == null ? undefined : object[key];
  22078. };
  22079. }
  22080. /**
  22081. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  22082. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  22083. *
  22084. * @private
  22085. * @param {Array|Object} collection The collection to iterate over.
  22086. * @param {Function} iteratee The function invoked per iteration.
  22087. * @param {*} accumulator The initial value.
  22088. * @param {boolean} initAccum Specify using the first or last element of
  22089. * `collection` as the initial value.
  22090. * @param {Function} eachFunc The function to iterate over `collection`.
  22091. * @returns {*} Returns the accumulated value.
  22092. */
  22093. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  22094. eachFunc(collection, function(value, index, collection) {
  22095. accumulator = initAccum
  22096. ? (initAccum = false, value)
  22097. : iteratee(accumulator, value, index, collection);
  22098. });
  22099. return accumulator;
  22100. }
  22101. /**
  22102. * The base implementation of `_.sortBy` which uses `comparer` to define the
  22103. * sort order of `array` and replaces criteria objects with their corresponding
  22104. * values.
  22105. *
  22106. * @private
  22107. * @param {Array} array The array to sort.
  22108. * @param {Function} comparer The function to define sort order.
  22109. * @returns {Array} Returns `array`.
  22110. */
  22111. function baseSortBy(array, comparer) {
  22112. var length = array.length;
  22113. array.sort(comparer);
  22114. while (length--) {
  22115. array[length] = array[length].value;
  22116. }
  22117. return array;
  22118. }
  22119. /**
  22120. * The base implementation of `_.sum` and `_.sumBy` without support for
  22121. * iteratee shorthands.
  22122. *
  22123. * @private
  22124. * @param {Array} array The array to iterate over.
  22125. * @param {Function} iteratee The function invoked per iteration.
  22126. * @returns {number} Returns the sum.
  22127. */
  22128. function baseSum(array, iteratee) {
  22129. var result,
  22130. index = -1,
  22131. length = array.length;
  22132. while (++index < length) {
  22133. var current = iteratee(array[index]);
  22134. if (current !== undefined) {
  22135. result = result === undefined ? current : (result + current);
  22136. }
  22137. }
  22138. return result;
  22139. }
  22140. /**
  22141. * The base implementation of `_.times` without support for iteratee shorthands
  22142. * or max array length checks.
  22143. *
  22144. * @private
  22145. * @param {number} n The number of times to invoke `iteratee`.
  22146. * @param {Function} iteratee The function invoked per iteration.
  22147. * @returns {Array} Returns the array of results.
  22148. */
  22149. function baseTimes(n, iteratee) {
  22150. var index = -1,
  22151. result = Array(n);
  22152. while (++index < n) {
  22153. result[index] = iteratee(index);
  22154. }
  22155. return result;
  22156. }
  22157. /**
  22158. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  22159. * of key-value pairs for `object` corresponding to the property names of `props`.
  22160. *
  22161. * @private
  22162. * @param {Object} object The object to query.
  22163. * @param {Array} props The property names to get values for.
  22164. * @returns {Object} Returns the key-value pairs.
  22165. */
  22166. function baseToPairs(object, props) {
  22167. return arrayMap(props, function(key) {
  22168. return [key, object[key]];
  22169. });
  22170. }
  22171. /**
  22172. * The base implementation of `_.unary` without support for storing metadata.
  22173. *
  22174. * @private
  22175. * @param {Function} func The function to cap arguments for.
  22176. * @returns {Function} Returns the new capped function.
  22177. */
  22178. function baseUnary(func) {
  22179. return function(value) {
  22180. return func(value);
  22181. };
  22182. }
  22183. /**
  22184. * The base implementation of `_.values` and `_.valuesIn` which creates an
  22185. * array of `object` property values corresponding to the property names
  22186. * of `props`.
  22187. *
  22188. * @private
  22189. * @param {Object} object The object to query.
  22190. * @param {Array} props The property names to get values for.
  22191. * @returns {Object} Returns the array of property values.
  22192. */
  22193. function baseValues(object, props) {
  22194. return arrayMap(props, function(key) {
  22195. return object[key];
  22196. });
  22197. }
  22198. /**
  22199. * Checks if a `cache` value for `key` exists.
  22200. *
  22201. * @private
  22202. * @param {Object} cache The cache to query.
  22203. * @param {string} key The key of the entry to check.
  22204. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  22205. */
  22206. function cacheHas(cache, key) {
  22207. return cache.has(key);
  22208. }
  22209. /**
  22210. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  22211. * that is not found in the character symbols.
  22212. *
  22213. * @private
  22214. * @param {Array} strSymbols The string symbols to inspect.
  22215. * @param {Array} chrSymbols The character symbols to find.
  22216. * @returns {number} Returns the index of the first unmatched string symbol.
  22217. */
  22218. function charsStartIndex(strSymbols, chrSymbols) {
  22219. var index = -1,
  22220. length = strSymbols.length;
  22221. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  22222. return index;
  22223. }
  22224. /**
  22225. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  22226. * that is not found in the character symbols.
  22227. *
  22228. * @private
  22229. * @param {Array} strSymbols The string symbols to inspect.
  22230. * @param {Array} chrSymbols The character symbols to find.
  22231. * @returns {number} Returns the index of the last unmatched string symbol.
  22232. */
  22233. function charsEndIndex(strSymbols, chrSymbols) {
  22234. var index = strSymbols.length;
  22235. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  22236. return index;
  22237. }
  22238. /**
  22239. * Gets the number of `placeholder` occurrences in `array`.
  22240. *
  22241. * @private
  22242. * @param {Array} array The array to inspect.
  22243. * @param {*} placeholder The placeholder to search for.
  22244. * @returns {number} Returns the placeholder count.
  22245. */
  22246. function countHolders(array, placeholder) {
  22247. var length = array.length,
  22248. result = 0;
  22249. while (length--) {
  22250. if (array[length] === placeholder) {
  22251. ++result;
  22252. }
  22253. }
  22254. return result;
  22255. }
  22256. /**
  22257. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  22258. * letters to basic Latin letters.
  22259. *
  22260. * @private
  22261. * @param {string} letter The matched letter to deburr.
  22262. * @returns {string} Returns the deburred letter.
  22263. */
  22264. var deburrLetter = basePropertyOf(deburredLetters);
  22265. /**
  22266. * Used by `_.escape` to convert characters to HTML entities.
  22267. *
  22268. * @private
  22269. * @param {string} chr The matched character to escape.
  22270. * @returns {string} Returns the escaped character.
  22271. */
  22272. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  22273. /**
  22274. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  22275. *
  22276. * @private
  22277. * @param {string} chr The matched character to escape.
  22278. * @returns {string} Returns the escaped character.
  22279. */
  22280. function escapeStringChar(chr) {
  22281. return '\\' + stringEscapes[chr];
  22282. }
  22283. /**
  22284. * Gets the value at `key` of `object`.
  22285. *
  22286. * @private
  22287. * @param {Object} [object] The object to query.
  22288. * @param {string} key The key of the property to get.
  22289. * @returns {*} Returns the property value.
  22290. */
  22291. function getValue(object, key) {
  22292. return object == null ? undefined : object[key];
  22293. }
  22294. /**
  22295. * Checks if `string` contains Unicode symbols.
  22296. *
  22297. * @private
  22298. * @param {string} string The string to inspect.
  22299. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  22300. */
  22301. function hasUnicode(string) {
  22302. return reHasUnicode.test(string);
  22303. }
  22304. /**
  22305. * Checks if `string` contains a word composed of Unicode symbols.
  22306. *
  22307. * @private
  22308. * @param {string} string The string to inspect.
  22309. * @returns {boolean} Returns `true` if a word is found, else `false`.
  22310. */
  22311. function hasUnicodeWord(string) {
  22312. return reHasUnicodeWord.test(string);
  22313. }
  22314. /**
  22315. * Converts `iterator` to an array.
  22316. *
  22317. * @private
  22318. * @param {Object} iterator The iterator to convert.
  22319. * @returns {Array} Returns the converted array.
  22320. */
  22321. function iteratorToArray(iterator) {
  22322. var data,
  22323. result = [];
  22324. while (!(data = iterator.next()).done) {
  22325. result.push(data.value);
  22326. }
  22327. return result;
  22328. }
  22329. /**
  22330. * Converts `map` to its key-value pairs.
  22331. *
  22332. * @private
  22333. * @param {Object} map The map to convert.
  22334. * @returns {Array} Returns the key-value pairs.
  22335. */
  22336. function mapToArray(map) {
  22337. var index = -1,
  22338. result = Array(map.size);
  22339. map.forEach(function(value, key) {
  22340. result[++index] = [key, value];
  22341. });
  22342. return result;
  22343. }
  22344. /**
  22345. * Creates a unary function that invokes `func` with its argument transformed.
  22346. *
  22347. * @private
  22348. * @param {Function} func The function to wrap.
  22349. * @param {Function} transform The argument transform.
  22350. * @returns {Function} Returns the new function.
  22351. */
  22352. function overArg(func, transform) {
  22353. return function(arg) {
  22354. return func(transform(arg));
  22355. };
  22356. }
  22357. /**
  22358. * Replaces all `placeholder` elements in `array` with an internal placeholder
  22359. * and returns an array of their indexes.
  22360. *
  22361. * @private
  22362. * @param {Array} array The array to modify.
  22363. * @param {*} placeholder The placeholder to replace.
  22364. * @returns {Array} Returns the new array of placeholder indexes.
  22365. */
  22366. function replaceHolders(array, placeholder) {
  22367. var index = -1,
  22368. length = array.length,
  22369. resIndex = 0,
  22370. result = [];
  22371. while (++index < length) {
  22372. var value = array[index];
  22373. if (value === placeholder || value === PLACEHOLDER) {
  22374. array[index] = PLACEHOLDER;
  22375. result[resIndex++] = index;
  22376. }
  22377. }
  22378. return result;
  22379. }
  22380. /**
  22381. * Converts `set` to an array of its values.
  22382. *
  22383. * @private
  22384. * @param {Object} set The set to convert.
  22385. * @returns {Array} Returns the values.
  22386. */
  22387. function setToArray(set) {
  22388. var index = -1,
  22389. result = Array(set.size);
  22390. set.forEach(function(value) {
  22391. result[++index] = value;
  22392. });
  22393. return result;
  22394. }
  22395. /**
  22396. * Converts `set` to its value-value pairs.
  22397. *
  22398. * @private
  22399. * @param {Object} set The set to convert.
  22400. * @returns {Array} Returns the value-value pairs.
  22401. */
  22402. function setToPairs(set) {
  22403. var index = -1,
  22404. result = Array(set.size);
  22405. set.forEach(function(value) {
  22406. result[++index] = [value, value];
  22407. });
  22408. return result;
  22409. }
  22410. /**
  22411. * A specialized version of `_.indexOf` which performs strict equality
  22412. * comparisons of values, i.e. `===`.
  22413. *
  22414. * @private
  22415. * @param {Array} array The array to inspect.
  22416. * @param {*} value The value to search for.
  22417. * @param {number} fromIndex The index to search from.
  22418. * @returns {number} Returns the index of the matched value, else `-1`.
  22419. */
  22420. function strictIndexOf(array, value, fromIndex) {
  22421. var index = fromIndex - 1,
  22422. length = array.length;
  22423. while (++index < length) {
  22424. if (array[index] === value) {
  22425. return index;
  22426. }
  22427. }
  22428. return -1;
  22429. }
  22430. /**
  22431. * A specialized version of `_.lastIndexOf` which performs strict equality
  22432. * comparisons of values, i.e. `===`.
  22433. *
  22434. * @private
  22435. * @param {Array} array The array to inspect.
  22436. * @param {*} value The value to search for.
  22437. * @param {number} fromIndex The index to search from.
  22438. * @returns {number} Returns the index of the matched value, else `-1`.
  22439. */
  22440. function strictLastIndexOf(array, value, fromIndex) {
  22441. var index = fromIndex + 1;
  22442. while (index--) {
  22443. if (array[index] === value) {
  22444. return index;
  22445. }
  22446. }
  22447. return index;
  22448. }
  22449. /**
  22450. * Gets the number of symbols in `string`.
  22451. *
  22452. * @private
  22453. * @param {string} string The string to inspect.
  22454. * @returns {number} Returns the string size.
  22455. */
  22456. function stringSize(string) {
  22457. return hasUnicode(string)
  22458. ? unicodeSize(string)
  22459. : asciiSize(string);
  22460. }
  22461. /**
  22462. * Converts `string` to an array.
  22463. *
  22464. * @private
  22465. * @param {string} string The string to convert.
  22466. * @returns {Array} Returns the converted array.
  22467. */
  22468. function stringToArray(string) {
  22469. return hasUnicode(string)
  22470. ? unicodeToArray(string)
  22471. : asciiToArray(string);
  22472. }
  22473. /**
  22474. * Used by `_.unescape` to convert HTML entities to characters.
  22475. *
  22476. * @private
  22477. * @param {string} chr The matched character to unescape.
  22478. * @returns {string} Returns the unescaped character.
  22479. */
  22480. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  22481. /**
  22482. * Gets the size of a Unicode `string`.
  22483. *
  22484. * @private
  22485. * @param {string} string The string inspect.
  22486. * @returns {number} Returns the string size.
  22487. */
  22488. function unicodeSize(string) {
  22489. var result = reUnicode.lastIndex = 0;
  22490. while (reUnicode.test(string)) {
  22491. ++result;
  22492. }
  22493. return result;
  22494. }
  22495. /**
  22496. * Converts a Unicode `string` to an array.
  22497. *
  22498. * @private
  22499. * @param {string} string The string to convert.
  22500. * @returns {Array} Returns the converted array.
  22501. */
  22502. function unicodeToArray(string) {
  22503. return string.match(reUnicode) || [];
  22504. }
  22505. /**
  22506. * Splits a Unicode `string` into an array of its words.
  22507. *
  22508. * @private
  22509. * @param {string} The string to inspect.
  22510. * @returns {Array} Returns the words of `string`.
  22511. */
  22512. function unicodeWords(string) {
  22513. return string.match(reUnicodeWord) || [];
  22514. }
  22515. /*--------------------------------------------------------------------------*/
  22516. /**
  22517. * Create a new pristine `lodash` function using the `context` object.
  22518. *
  22519. * @static
  22520. * @memberOf _
  22521. * @since 1.1.0
  22522. * @category Util
  22523. * @param {Object} [context=root] The context object.
  22524. * @returns {Function} Returns a new `lodash` function.
  22525. * @example
  22526. *
  22527. * _.mixin({ 'foo': _.constant('foo') });
  22528. *
  22529. * var lodash = _.runInContext();
  22530. * lodash.mixin({ 'bar': lodash.constant('bar') });
  22531. *
  22532. * _.isFunction(_.foo);
  22533. * // => true
  22534. * _.isFunction(_.bar);
  22535. * // => false
  22536. *
  22537. * lodash.isFunction(lodash.foo);
  22538. * // => false
  22539. * lodash.isFunction(lodash.bar);
  22540. * // => true
  22541. *
  22542. * // Create a suped-up `defer` in Node.js.
  22543. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  22544. */
  22545. var runInContext = (function runInContext(context) {
  22546. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  22547. /** Built-in constructor references. */
  22548. var Array = context.Array,
  22549. Date = context.Date,
  22550. Error = context.Error,
  22551. Function = context.Function,
  22552. Math = context.Math,
  22553. Object = context.Object,
  22554. RegExp = context.RegExp,
  22555. String = context.String,
  22556. TypeError = context.TypeError;
  22557. /** Used for built-in method references. */
  22558. var arrayProto = Array.prototype,
  22559. funcProto = Function.prototype,
  22560. objectProto = Object.prototype;
  22561. /** Used to detect overreaching core-js shims. */
  22562. var coreJsData = context['__core-js_shared__'];
  22563. /** Used to resolve the decompiled source of functions. */
  22564. var funcToString = funcProto.toString;
  22565. /** Used to check objects for own properties. */
  22566. var hasOwnProperty = objectProto.hasOwnProperty;
  22567. /** Used to generate unique IDs. */
  22568. var idCounter = 0;
  22569. /** Used to detect methods masquerading as native. */
  22570. var maskSrcKey = (function() {
  22571. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  22572. return uid ? ('Symbol(src)_1.' + uid) : '';
  22573. }());
  22574. /**
  22575. * Used to resolve the
  22576. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  22577. * of values.
  22578. */
  22579. var nativeObjectToString = objectProto.toString;
  22580. /** Used to infer the `Object` constructor. */
  22581. var objectCtorString = funcToString.call(Object);
  22582. /** Used to restore the original `_` reference in `_.noConflict`. */
  22583. var oldDash = root._;
  22584. /** Used to detect if a method is native. */
  22585. var reIsNative = RegExp('^' +
  22586. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  22587. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  22588. );
  22589. /** Built-in value references. */
  22590. var Buffer = moduleExports ? context.Buffer : undefined,
  22591. Symbol = context.Symbol,
  22592. Uint8Array = context.Uint8Array,
  22593. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  22594. getPrototype = overArg(Object.getPrototypeOf, Object),
  22595. objectCreate = Object.create,
  22596. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  22597. splice = arrayProto.splice,
  22598. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  22599. symIterator = Symbol ? Symbol.iterator : undefined,
  22600. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  22601. var defineProperty = (function() {
  22602. try {
  22603. var func = getNative(Object, 'defineProperty');
  22604. func({}, '', {});
  22605. return func;
  22606. } catch (e) {}
  22607. }());
  22608. /** Mocked built-ins. */
  22609. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  22610. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  22611. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  22612. /* Built-in method references for those with the same name as other `lodash` methods. */
  22613. var nativeCeil = Math.ceil,
  22614. nativeFloor = Math.floor,
  22615. nativeGetSymbols = Object.getOwnPropertySymbols,
  22616. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  22617. nativeIsFinite = context.isFinite,
  22618. nativeJoin = arrayProto.join,
  22619. nativeKeys = overArg(Object.keys, Object),
  22620. nativeMax = Math.max,
  22621. nativeMin = Math.min,
  22622. nativeNow = Date.now,
  22623. nativeParseInt = context.parseInt,
  22624. nativeRandom = Math.random,
  22625. nativeReverse = arrayProto.reverse;
  22626. /* Built-in method references that are verified to be native. */
  22627. var DataView = getNative(context, 'DataView'),
  22628. Map = getNative(context, 'Map'),
  22629. Promise = getNative(context, 'Promise'),
  22630. Set = getNative(context, 'Set'),
  22631. WeakMap = getNative(context, 'WeakMap'),
  22632. nativeCreate = getNative(Object, 'create');
  22633. /** Used to store function metadata. */
  22634. var metaMap = WeakMap && new WeakMap;
  22635. /** Used to lookup unminified function names. */
  22636. var realNames = {};
  22637. /** Used to detect maps, sets, and weakmaps. */
  22638. var dataViewCtorString = toSource(DataView),
  22639. mapCtorString = toSource(Map),
  22640. promiseCtorString = toSource(Promise),
  22641. setCtorString = toSource(Set),
  22642. weakMapCtorString = toSource(WeakMap);
  22643. /** Used to convert symbols to primitives and strings. */
  22644. var symbolProto = Symbol ? Symbol.prototype : undefined,
  22645. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  22646. symbolToString = symbolProto ? symbolProto.toString : undefined;
  22647. /*------------------------------------------------------------------------*/
  22648. /**
  22649. * Creates a `lodash` object which wraps `value` to enable implicit method
  22650. * chain sequences. Methods that operate on and return arrays, collections,
  22651. * and functions can be chained together. Methods that retrieve a single value
  22652. * or may return a primitive value will automatically end the chain sequence
  22653. * and return the unwrapped value. Otherwise, the value must be unwrapped
  22654. * with `_#value`.
  22655. *
  22656. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  22657. * enabled using `_.chain`.
  22658. *
  22659. * The execution of chained methods is lazy, that is, it's deferred until
  22660. * `_#value` is implicitly or explicitly called.
  22661. *
  22662. * Lazy evaluation allows several methods to support shortcut fusion.
  22663. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  22664. * the creation of intermediate arrays and can greatly reduce the number of
  22665. * iteratee executions. Sections of a chain sequence qualify for shortcut
  22666. * fusion if the section is applied to an array and iteratees accept only
  22667. * one argument. The heuristic for whether a section qualifies for shortcut
  22668. * fusion is subject to change.
  22669. *
  22670. * Chaining is supported in custom builds as long as the `_#value` method is
  22671. * directly or indirectly included in the build.
  22672. *
  22673. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  22674. *
  22675. * The wrapper `Array` methods are:
  22676. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  22677. *
  22678. * The wrapper `String` methods are:
  22679. * `replace` and `split`
  22680. *
  22681. * The wrapper methods that support shortcut fusion are:
  22682. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  22683. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  22684. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  22685. *
  22686. * The chainable wrapper methods are:
  22687. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  22688. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  22689. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  22690. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  22691. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  22692. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  22693. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  22694. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  22695. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  22696. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  22697. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  22698. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  22699. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  22700. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  22701. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  22702. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  22703. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  22704. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  22705. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  22706. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  22707. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  22708. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  22709. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  22710. * `zipObject`, `zipObjectDeep`, and `zipWith`
  22711. *
  22712. * The wrapper methods that are **not** chainable by default are:
  22713. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  22714. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  22715. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  22716. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  22717. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  22718. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  22719. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  22720. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  22721. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  22722. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  22723. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  22724. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  22725. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  22726. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  22727. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  22728. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  22729. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  22730. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  22731. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  22732. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  22733. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  22734. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  22735. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  22736. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  22737. * `upperFirst`, `value`, and `words`
  22738. *
  22739. * @name _
  22740. * @constructor
  22741. * @category Seq
  22742. * @param {*} value The value to wrap in a `lodash` instance.
  22743. * @returns {Object} Returns the new `lodash` wrapper instance.
  22744. * @example
  22745. *
  22746. * function square(n) {
  22747. * return n * n;
  22748. * }
  22749. *
  22750. * var wrapped = _([1, 2, 3]);
  22751. *
  22752. * // Returns an unwrapped value.
  22753. * wrapped.reduce(_.add);
  22754. * // => 6
  22755. *
  22756. * // Returns a wrapped value.
  22757. * var squares = wrapped.map(square);
  22758. *
  22759. * _.isArray(squares);
  22760. * // => false
  22761. *
  22762. * _.isArray(squares.value());
  22763. * // => true
  22764. */
  22765. function lodash(value) {
  22766. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  22767. if (value instanceof LodashWrapper) {
  22768. return value;
  22769. }
  22770. if (hasOwnProperty.call(value, '__wrapped__')) {
  22771. return wrapperClone(value);
  22772. }
  22773. }
  22774. return new LodashWrapper(value);
  22775. }
  22776. /**
  22777. * The base implementation of `_.create` without support for assigning
  22778. * properties to the created object.
  22779. *
  22780. * @private
  22781. * @param {Object} proto The object to inherit from.
  22782. * @returns {Object} Returns the new object.
  22783. */
  22784. var baseCreate = (function() {
  22785. function object() {}
  22786. return function(proto) {
  22787. if (!isObject(proto)) {
  22788. return {};
  22789. }
  22790. if (objectCreate) {
  22791. return objectCreate(proto);
  22792. }
  22793. object.prototype = proto;
  22794. var result = new object;
  22795. object.prototype = undefined;
  22796. return result;
  22797. };
  22798. }());
  22799. /**
  22800. * The function whose prototype chain sequence wrappers inherit from.
  22801. *
  22802. * @private
  22803. */
  22804. function baseLodash() {
  22805. // No operation performed.
  22806. }
  22807. /**
  22808. * The base constructor for creating `lodash` wrapper objects.
  22809. *
  22810. * @private
  22811. * @param {*} value The value to wrap.
  22812. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  22813. */
  22814. function LodashWrapper(value, chainAll) {
  22815. this.__wrapped__ = value;
  22816. this.__actions__ = [];
  22817. this.__chain__ = !!chainAll;
  22818. this.__index__ = 0;
  22819. this.__values__ = undefined;
  22820. }
  22821. /**
  22822. * By default, the template delimiters used by lodash are like those in
  22823. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  22824. * following template settings to use alternative delimiters.
  22825. *
  22826. * @static
  22827. * @memberOf _
  22828. * @type {Object}
  22829. */
  22830. lodash.templateSettings = {
  22831. /**
  22832. * Used to detect `data` property values to be HTML-escaped.
  22833. *
  22834. * @memberOf _.templateSettings
  22835. * @type {RegExp}
  22836. */
  22837. 'escape': reEscape,
  22838. /**
  22839. * Used to detect code to be evaluated.
  22840. *
  22841. * @memberOf _.templateSettings
  22842. * @type {RegExp}
  22843. */
  22844. 'evaluate': reEvaluate,
  22845. /**
  22846. * Used to detect `data` property values to inject.
  22847. *
  22848. * @memberOf _.templateSettings
  22849. * @type {RegExp}
  22850. */
  22851. 'interpolate': reInterpolate,
  22852. /**
  22853. * Used to reference the data object in the template text.
  22854. *
  22855. * @memberOf _.templateSettings
  22856. * @type {string}
  22857. */
  22858. 'variable': '',
  22859. /**
  22860. * Used to import variables into the compiled template.
  22861. *
  22862. * @memberOf _.templateSettings
  22863. * @type {Object}
  22864. */
  22865. 'imports': {
  22866. /**
  22867. * A reference to the `lodash` function.
  22868. *
  22869. * @memberOf _.templateSettings.imports
  22870. * @type {Function}
  22871. */
  22872. '_': lodash
  22873. }
  22874. };
  22875. // Ensure wrappers are instances of `baseLodash`.
  22876. lodash.prototype = baseLodash.prototype;
  22877. lodash.prototype.constructor = lodash;
  22878. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  22879. LodashWrapper.prototype.constructor = LodashWrapper;
  22880. /*------------------------------------------------------------------------*/
  22881. /**
  22882. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  22883. *
  22884. * @private
  22885. * @constructor
  22886. * @param {*} value The value to wrap.
  22887. */
  22888. function LazyWrapper(value) {
  22889. this.__wrapped__ = value;
  22890. this.__actions__ = [];
  22891. this.__dir__ = 1;
  22892. this.__filtered__ = false;
  22893. this.__iteratees__ = [];
  22894. this.__takeCount__ = MAX_ARRAY_LENGTH;
  22895. this.__views__ = [];
  22896. }
  22897. /**
  22898. * Creates a clone of the lazy wrapper object.
  22899. *
  22900. * @private
  22901. * @name clone
  22902. * @memberOf LazyWrapper
  22903. * @returns {Object} Returns the cloned `LazyWrapper` object.
  22904. */
  22905. function lazyClone() {
  22906. var result = new LazyWrapper(this.__wrapped__);
  22907. result.__actions__ = copyArray(this.__actions__);
  22908. result.__dir__ = this.__dir__;
  22909. result.__filtered__ = this.__filtered__;
  22910. result.__iteratees__ = copyArray(this.__iteratees__);
  22911. result.__takeCount__ = this.__takeCount__;
  22912. result.__views__ = copyArray(this.__views__);
  22913. return result;
  22914. }
  22915. /**
  22916. * Reverses the direction of lazy iteration.
  22917. *
  22918. * @private
  22919. * @name reverse
  22920. * @memberOf LazyWrapper
  22921. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  22922. */
  22923. function lazyReverse() {
  22924. if (this.__filtered__) {
  22925. var result = new LazyWrapper(this);
  22926. result.__dir__ = -1;
  22927. result.__filtered__ = true;
  22928. } else {
  22929. result = this.clone();
  22930. result.__dir__ *= -1;
  22931. }
  22932. return result;
  22933. }
  22934. /**
  22935. * Extracts the unwrapped value from its lazy wrapper.
  22936. *
  22937. * @private
  22938. * @name value
  22939. * @memberOf LazyWrapper
  22940. * @returns {*} Returns the unwrapped value.
  22941. */
  22942. function lazyValue() {
  22943. var array = this.__wrapped__.value(),
  22944. dir = this.__dir__,
  22945. isArr = isArray(array),
  22946. isRight = dir < 0,
  22947. arrLength = isArr ? array.length : 0,
  22948. view = getView(0, arrLength, this.__views__),
  22949. start = view.start,
  22950. end = view.end,
  22951. length = end - start,
  22952. index = isRight ? end : (start - 1),
  22953. iteratees = this.__iteratees__,
  22954. iterLength = iteratees.length,
  22955. resIndex = 0,
  22956. takeCount = nativeMin(length, this.__takeCount__);
  22957. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  22958. return baseWrapperValue(array, this.__actions__);
  22959. }
  22960. var result = [];
  22961. outer:
  22962. while (length-- && resIndex < takeCount) {
  22963. index += dir;
  22964. var iterIndex = -1,
  22965. value = array[index];
  22966. while (++iterIndex < iterLength) {
  22967. var data = iteratees[iterIndex],
  22968. iteratee = data.iteratee,
  22969. type = data.type,
  22970. computed = iteratee(value);
  22971. if (type == LAZY_MAP_FLAG) {
  22972. value = computed;
  22973. } else if (!computed) {
  22974. if (type == LAZY_FILTER_FLAG) {
  22975. continue outer;
  22976. } else {
  22977. break outer;
  22978. }
  22979. }
  22980. }
  22981. result[resIndex++] = value;
  22982. }
  22983. return result;
  22984. }
  22985. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  22986. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  22987. LazyWrapper.prototype.constructor = LazyWrapper;
  22988. /*------------------------------------------------------------------------*/
  22989. /**
  22990. * Creates a hash object.
  22991. *
  22992. * @private
  22993. * @constructor
  22994. * @param {Array} [entries] The key-value pairs to cache.
  22995. */
  22996. function Hash(entries) {
  22997. var index = -1,
  22998. length = entries == null ? 0 : entries.length;
  22999. this.clear();
  23000. while (++index < length) {
  23001. var entry = entries[index];
  23002. this.set(entry[0], entry[1]);
  23003. }
  23004. }
  23005. /**
  23006. * Removes all key-value entries from the hash.
  23007. *
  23008. * @private
  23009. * @name clear
  23010. * @memberOf Hash
  23011. */
  23012. function hashClear() {
  23013. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  23014. this.size = 0;
  23015. }
  23016. /**
  23017. * Removes `key` and its value from the hash.
  23018. *
  23019. * @private
  23020. * @name delete
  23021. * @memberOf Hash
  23022. * @param {Object} hash The hash to modify.
  23023. * @param {string} key The key of the value to remove.
  23024. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  23025. */
  23026. function hashDelete(key) {
  23027. var result = this.has(key) && delete this.__data__[key];
  23028. this.size -= result ? 1 : 0;
  23029. return result;
  23030. }
  23031. /**
  23032. * Gets the hash value for `key`.
  23033. *
  23034. * @private
  23035. * @name get
  23036. * @memberOf Hash
  23037. * @param {string} key The key of the value to get.
  23038. * @returns {*} Returns the entry value.
  23039. */
  23040. function hashGet(key) {
  23041. var data = this.__data__;
  23042. if (nativeCreate) {
  23043. var result = data[key];
  23044. return result === HASH_UNDEFINED ? undefined : result;
  23045. }
  23046. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  23047. }
  23048. /**
  23049. * Checks if a hash value for `key` exists.
  23050. *
  23051. * @private
  23052. * @name has
  23053. * @memberOf Hash
  23054. * @param {string} key The key of the entry to check.
  23055. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  23056. */
  23057. function hashHas(key) {
  23058. var data = this.__data__;
  23059. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  23060. }
  23061. /**
  23062. * Sets the hash `key` to `value`.
  23063. *
  23064. * @private
  23065. * @name set
  23066. * @memberOf Hash
  23067. * @param {string} key The key of the value to set.
  23068. * @param {*} value The value to set.
  23069. * @returns {Object} Returns the hash instance.
  23070. */
  23071. function hashSet(key, value) {
  23072. var data = this.__data__;
  23073. this.size += this.has(key) ? 0 : 1;
  23074. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  23075. return this;
  23076. }
  23077. // Add methods to `Hash`.
  23078. Hash.prototype.clear = hashClear;
  23079. Hash.prototype['delete'] = hashDelete;
  23080. Hash.prototype.get = hashGet;
  23081. Hash.prototype.has = hashHas;
  23082. Hash.prototype.set = hashSet;
  23083. /*------------------------------------------------------------------------*/
  23084. /**
  23085. * Creates an list cache object.
  23086. *
  23087. * @private
  23088. * @constructor
  23089. * @param {Array} [entries] The key-value pairs to cache.
  23090. */
  23091. function ListCache(entries) {
  23092. var index = -1,
  23093. length = entries == null ? 0 : entries.length;
  23094. this.clear();
  23095. while (++index < length) {
  23096. var entry = entries[index];
  23097. this.set(entry[0], entry[1]);
  23098. }
  23099. }
  23100. /**
  23101. * Removes all key-value entries from the list cache.
  23102. *
  23103. * @private
  23104. * @name clear
  23105. * @memberOf ListCache
  23106. */
  23107. function listCacheClear() {
  23108. this.__data__ = [];
  23109. this.size = 0;
  23110. }
  23111. /**
  23112. * Removes `key` and its value from the list cache.
  23113. *
  23114. * @private
  23115. * @name delete
  23116. * @memberOf ListCache
  23117. * @param {string} key The key of the value to remove.
  23118. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  23119. */
  23120. function listCacheDelete(key) {
  23121. var data = this.__data__,
  23122. index = assocIndexOf(data, key);
  23123. if (index < 0) {
  23124. return false;
  23125. }
  23126. var lastIndex = data.length - 1;
  23127. if (index == lastIndex) {
  23128. data.pop();
  23129. } else {
  23130. splice.call(data, index, 1);
  23131. }
  23132. --this.size;
  23133. return true;
  23134. }
  23135. /**
  23136. * Gets the list cache value for `key`.
  23137. *
  23138. * @private
  23139. * @name get
  23140. * @memberOf ListCache
  23141. * @param {string} key The key of the value to get.
  23142. * @returns {*} Returns the entry value.
  23143. */
  23144. function listCacheGet(key) {
  23145. var data = this.__data__,
  23146. index = assocIndexOf(data, key);
  23147. return index < 0 ? undefined : data[index][1];
  23148. }
  23149. /**
  23150. * Checks if a list cache value for `key` exists.
  23151. *
  23152. * @private
  23153. * @name has
  23154. * @memberOf ListCache
  23155. * @param {string} key The key of the entry to check.
  23156. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  23157. */
  23158. function listCacheHas(key) {
  23159. return assocIndexOf(this.__data__, key) > -1;
  23160. }
  23161. /**
  23162. * Sets the list cache `key` to `value`.
  23163. *
  23164. * @private
  23165. * @name set
  23166. * @memberOf ListCache
  23167. * @param {string} key The key of the value to set.
  23168. * @param {*} value The value to set.
  23169. * @returns {Object} Returns the list cache instance.
  23170. */
  23171. function listCacheSet(key, value) {
  23172. var data = this.__data__,
  23173. index = assocIndexOf(data, key);
  23174. if (index < 0) {
  23175. ++this.size;
  23176. data.push([key, value]);
  23177. } else {
  23178. data[index][1] = value;
  23179. }
  23180. return this;
  23181. }
  23182. // Add methods to `ListCache`.
  23183. ListCache.prototype.clear = listCacheClear;
  23184. ListCache.prototype['delete'] = listCacheDelete;
  23185. ListCache.prototype.get = listCacheGet;
  23186. ListCache.prototype.has = listCacheHas;
  23187. ListCache.prototype.set = listCacheSet;
  23188. /*------------------------------------------------------------------------*/
  23189. /**
  23190. * Creates a map cache object to store key-value pairs.
  23191. *
  23192. * @private
  23193. * @constructor
  23194. * @param {Array} [entries] The key-value pairs to cache.
  23195. */
  23196. function MapCache(entries) {
  23197. var index = -1,
  23198. length = entries == null ? 0 : entries.length;
  23199. this.clear();
  23200. while (++index < length) {
  23201. var entry = entries[index];
  23202. this.set(entry[0], entry[1]);
  23203. }
  23204. }
  23205. /**
  23206. * Removes all key-value entries from the map.
  23207. *
  23208. * @private
  23209. * @name clear
  23210. * @memberOf MapCache
  23211. */
  23212. function mapCacheClear() {
  23213. this.size = 0;
  23214. this.__data__ = {
  23215. 'hash': new Hash,
  23216. 'map': new (Map || ListCache),
  23217. 'string': new Hash
  23218. };
  23219. }
  23220. /**
  23221. * Removes `key` and its value from the map.
  23222. *
  23223. * @private
  23224. * @name delete
  23225. * @memberOf MapCache
  23226. * @param {string} key The key of the value to remove.
  23227. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  23228. */
  23229. function mapCacheDelete(key) {
  23230. var result = getMapData(this, key)['delete'](key);
  23231. this.size -= result ? 1 : 0;
  23232. return result;
  23233. }
  23234. /**
  23235. * Gets the map value for `key`.
  23236. *
  23237. * @private
  23238. * @name get
  23239. * @memberOf MapCache
  23240. * @param {string} key The key of the value to get.
  23241. * @returns {*} Returns the entry value.
  23242. */
  23243. function mapCacheGet(key) {
  23244. return getMapData(this, key).get(key);
  23245. }
  23246. /**
  23247. * Checks if a map value for `key` exists.
  23248. *
  23249. * @private
  23250. * @name has
  23251. * @memberOf MapCache
  23252. * @param {string} key The key of the entry to check.
  23253. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  23254. */
  23255. function mapCacheHas(key) {
  23256. return getMapData(this, key).has(key);
  23257. }
  23258. /**
  23259. * Sets the map `key` to `value`.
  23260. *
  23261. * @private
  23262. * @name set
  23263. * @memberOf MapCache
  23264. * @param {string} key The key of the value to set.
  23265. * @param {*} value The value to set.
  23266. * @returns {Object} Returns the map cache instance.
  23267. */
  23268. function mapCacheSet(key, value) {
  23269. var data = getMapData(this, key),
  23270. size = data.size;
  23271. data.set(key, value);
  23272. this.size += data.size == size ? 0 : 1;
  23273. return this;
  23274. }
  23275. // Add methods to `MapCache`.
  23276. MapCache.prototype.clear = mapCacheClear;
  23277. MapCache.prototype['delete'] = mapCacheDelete;
  23278. MapCache.prototype.get = mapCacheGet;
  23279. MapCache.prototype.has = mapCacheHas;
  23280. MapCache.prototype.set = mapCacheSet;
  23281. /*------------------------------------------------------------------------*/
  23282. /**
  23283. *
  23284. * Creates an array cache object to store unique values.
  23285. *
  23286. * @private
  23287. * @constructor
  23288. * @param {Array} [values] The values to cache.
  23289. */
  23290. function SetCache(values) {
  23291. var index = -1,
  23292. length = values == null ? 0 : values.length;
  23293. this.__data__ = new MapCache;
  23294. while (++index < length) {
  23295. this.add(values[index]);
  23296. }
  23297. }
  23298. /**
  23299. * Adds `value` to the array cache.
  23300. *
  23301. * @private
  23302. * @name add
  23303. * @memberOf SetCache
  23304. * @alias push
  23305. * @param {*} value The value to cache.
  23306. * @returns {Object} Returns the cache instance.
  23307. */
  23308. function setCacheAdd(value) {
  23309. this.__data__.set(value, HASH_UNDEFINED);
  23310. return this;
  23311. }
  23312. /**
  23313. * Checks if `value` is in the array cache.
  23314. *
  23315. * @private
  23316. * @name has
  23317. * @memberOf SetCache
  23318. * @param {*} value The value to search for.
  23319. * @returns {number} Returns `true` if `value` is found, else `false`.
  23320. */
  23321. function setCacheHas(value) {
  23322. return this.__data__.has(value);
  23323. }
  23324. // Add methods to `SetCache`.
  23325. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  23326. SetCache.prototype.has = setCacheHas;
  23327. /*------------------------------------------------------------------------*/
  23328. /**
  23329. * Creates a stack cache object to store key-value pairs.
  23330. *
  23331. * @private
  23332. * @constructor
  23333. * @param {Array} [entries] The key-value pairs to cache.
  23334. */
  23335. function Stack(entries) {
  23336. var data = this.__data__ = new ListCache(entries);
  23337. this.size = data.size;
  23338. }
  23339. /**
  23340. * Removes all key-value entries from the stack.
  23341. *
  23342. * @private
  23343. * @name clear
  23344. * @memberOf Stack
  23345. */
  23346. function stackClear() {
  23347. this.__data__ = new ListCache;
  23348. this.size = 0;
  23349. }
  23350. /**
  23351. * Removes `key` and its value from the stack.
  23352. *
  23353. * @private
  23354. * @name delete
  23355. * @memberOf Stack
  23356. * @param {string} key The key of the value to remove.
  23357. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  23358. */
  23359. function stackDelete(key) {
  23360. var data = this.__data__,
  23361. result = data['delete'](key);
  23362. this.size = data.size;
  23363. return result;
  23364. }
  23365. /**
  23366. * Gets the stack value for `key`.
  23367. *
  23368. * @private
  23369. * @name get
  23370. * @memberOf Stack
  23371. * @param {string} key The key of the value to get.
  23372. * @returns {*} Returns the entry value.
  23373. */
  23374. function stackGet(key) {
  23375. return this.__data__.get(key);
  23376. }
  23377. /**
  23378. * Checks if a stack value for `key` exists.
  23379. *
  23380. * @private
  23381. * @name has
  23382. * @memberOf Stack
  23383. * @param {string} key The key of the entry to check.
  23384. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  23385. */
  23386. function stackHas(key) {
  23387. return this.__data__.has(key);
  23388. }
  23389. /**
  23390. * Sets the stack `key` to `value`.
  23391. *
  23392. * @private
  23393. * @name set
  23394. * @memberOf Stack
  23395. * @param {string} key The key of the value to set.
  23396. * @param {*} value The value to set.
  23397. * @returns {Object} Returns the stack cache instance.
  23398. */
  23399. function stackSet(key, value) {
  23400. var data = this.__data__;
  23401. if (data instanceof ListCache) {
  23402. var pairs = data.__data__;
  23403. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  23404. pairs.push([key, value]);
  23405. this.size = ++data.size;
  23406. return this;
  23407. }
  23408. data = this.__data__ = new MapCache(pairs);
  23409. }
  23410. data.set(key, value);
  23411. this.size = data.size;
  23412. return this;
  23413. }
  23414. // Add methods to `Stack`.
  23415. Stack.prototype.clear = stackClear;
  23416. Stack.prototype['delete'] = stackDelete;
  23417. Stack.prototype.get = stackGet;
  23418. Stack.prototype.has = stackHas;
  23419. Stack.prototype.set = stackSet;
  23420. /*------------------------------------------------------------------------*/
  23421. /**
  23422. * Creates an array of the enumerable property names of the array-like `value`.
  23423. *
  23424. * @private
  23425. * @param {*} value The value to query.
  23426. * @param {boolean} inherited Specify returning inherited property names.
  23427. * @returns {Array} Returns the array of property names.
  23428. */
  23429. function arrayLikeKeys(value, inherited) {
  23430. var isArr = isArray(value),
  23431. isArg = !isArr && isArguments(value),
  23432. isBuff = !isArr && !isArg && isBuffer(value),
  23433. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  23434. skipIndexes = isArr || isArg || isBuff || isType,
  23435. result = skipIndexes ? baseTimes(value.length, String) : [],
  23436. length = result.length;
  23437. for (var key in value) {
  23438. if ((inherited || hasOwnProperty.call(value, key)) &&
  23439. !(skipIndexes && (
  23440. // Safari 9 has enumerable `arguments.length` in strict mode.
  23441. key == 'length' ||
  23442. // Node.js 0.10 has enumerable non-index properties on buffers.
  23443. (isBuff && (key == 'offset' || key == 'parent')) ||
  23444. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  23445. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  23446. // Skip index properties.
  23447. isIndex(key, length)
  23448. ))) {
  23449. result.push(key);
  23450. }
  23451. }
  23452. return result;
  23453. }
  23454. /**
  23455. * A specialized version of `_.sample` for arrays.
  23456. *
  23457. * @private
  23458. * @param {Array} array The array to sample.
  23459. * @returns {*} Returns the random element.
  23460. */
  23461. function arraySample(array) {
  23462. var length = array.length;
  23463. return length ? array[baseRandom(0, length - 1)] : undefined;
  23464. }
  23465. /**
  23466. * A specialized version of `_.sampleSize` for arrays.
  23467. *
  23468. * @private
  23469. * @param {Array} array The array to sample.
  23470. * @param {number} n The number of elements to sample.
  23471. * @returns {Array} Returns the random elements.
  23472. */
  23473. function arraySampleSize(array, n) {
  23474. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  23475. }
  23476. /**
  23477. * A specialized version of `_.shuffle` for arrays.
  23478. *
  23479. * @private
  23480. * @param {Array} array The array to shuffle.
  23481. * @returns {Array} Returns the new shuffled array.
  23482. */
  23483. function arrayShuffle(array) {
  23484. return shuffleSelf(copyArray(array));
  23485. }
  23486. /**
  23487. * This function is like `assignValue` except that it doesn't assign
  23488. * `undefined` values.
  23489. *
  23490. * @private
  23491. * @param {Object} object The object to modify.
  23492. * @param {string} key The key of the property to assign.
  23493. * @param {*} value The value to assign.
  23494. */
  23495. function assignMergeValue(object, key, value) {
  23496. if ((value !== undefined && !eq(object[key], value)) ||
  23497. (value === undefined && !(key in object))) {
  23498. baseAssignValue(object, key, value);
  23499. }
  23500. }
  23501. /**
  23502. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  23503. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  23504. * for equality comparisons.
  23505. *
  23506. * @private
  23507. * @param {Object} object The object to modify.
  23508. * @param {string} key The key of the property to assign.
  23509. * @param {*} value The value to assign.
  23510. */
  23511. function assignValue(object, key, value) {
  23512. var objValue = object[key];
  23513. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  23514. (value === undefined && !(key in object))) {
  23515. baseAssignValue(object, key, value);
  23516. }
  23517. }
  23518. /**
  23519. * Gets the index at which the `key` is found in `array` of key-value pairs.
  23520. *
  23521. * @private
  23522. * @param {Array} array The array to inspect.
  23523. * @param {*} key The key to search for.
  23524. * @returns {number} Returns the index of the matched value, else `-1`.
  23525. */
  23526. function assocIndexOf(array, key) {
  23527. var length = array.length;
  23528. while (length--) {
  23529. if (eq(array[length][0], key)) {
  23530. return length;
  23531. }
  23532. }
  23533. return -1;
  23534. }
  23535. /**
  23536. * Aggregates elements of `collection` on `accumulator` with keys transformed
  23537. * by `iteratee` and values set by `setter`.
  23538. *
  23539. * @private
  23540. * @param {Array|Object} collection The collection to iterate over.
  23541. * @param {Function} setter The function to set `accumulator` values.
  23542. * @param {Function} iteratee The iteratee to transform keys.
  23543. * @param {Object} accumulator The initial aggregated object.
  23544. * @returns {Function} Returns `accumulator`.
  23545. */
  23546. function baseAggregator(collection, setter, iteratee, accumulator) {
  23547. baseEach(collection, function(value, key, collection) {
  23548. setter(accumulator, value, iteratee(value), collection);
  23549. });
  23550. return accumulator;
  23551. }
  23552. /**
  23553. * The base implementation of `_.assign` without support for multiple sources
  23554. * or `customizer` functions.
  23555. *
  23556. * @private
  23557. * @param {Object} object The destination object.
  23558. * @param {Object} source The source object.
  23559. * @returns {Object} Returns `object`.
  23560. */
  23561. function baseAssign(object, source) {
  23562. return object && copyObject(source, keys(source), object);
  23563. }
  23564. /**
  23565. * The base implementation of `_.assignIn` without support for multiple sources
  23566. * or `customizer` functions.
  23567. *
  23568. * @private
  23569. * @param {Object} object The destination object.
  23570. * @param {Object} source The source object.
  23571. * @returns {Object} Returns `object`.
  23572. */
  23573. function baseAssignIn(object, source) {
  23574. return object && copyObject(source, keysIn(source), object);
  23575. }
  23576. /**
  23577. * The base implementation of `assignValue` and `assignMergeValue` without
  23578. * value checks.
  23579. *
  23580. * @private
  23581. * @param {Object} object The object to modify.
  23582. * @param {string} key The key of the property to assign.
  23583. * @param {*} value The value to assign.
  23584. */
  23585. function baseAssignValue(object, key, value) {
  23586. if (key == '__proto__' && defineProperty) {
  23587. defineProperty(object, key, {
  23588. 'configurable': true,
  23589. 'enumerable': true,
  23590. 'value': value,
  23591. 'writable': true
  23592. });
  23593. } else {
  23594. object[key] = value;
  23595. }
  23596. }
  23597. /**
  23598. * The base implementation of `_.at` without support for individual paths.
  23599. *
  23600. * @private
  23601. * @param {Object} object The object to iterate over.
  23602. * @param {string[]} paths The property paths to pick.
  23603. * @returns {Array} Returns the picked elements.
  23604. */
  23605. function baseAt(object, paths) {
  23606. var index = -1,
  23607. length = paths.length,
  23608. result = Array(length),
  23609. skip = object == null;
  23610. while (++index < length) {
  23611. result[index] = skip ? undefined : get(object, paths[index]);
  23612. }
  23613. return result;
  23614. }
  23615. /**
  23616. * The base implementation of `_.clamp` which doesn't coerce arguments.
  23617. *
  23618. * @private
  23619. * @param {number} number The number to clamp.
  23620. * @param {number} [lower] The lower bound.
  23621. * @param {number} upper The upper bound.
  23622. * @returns {number} Returns the clamped number.
  23623. */
  23624. function baseClamp(number, lower, upper) {
  23625. if (number === number) {
  23626. if (upper !== undefined) {
  23627. number = number <= upper ? number : upper;
  23628. }
  23629. if (lower !== undefined) {
  23630. number = number >= lower ? number : lower;
  23631. }
  23632. }
  23633. return number;
  23634. }
  23635. /**
  23636. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  23637. * traversed objects.
  23638. *
  23639. * @private
  23640. * @param {*} value The value to clone.
  23641. * @param {boolean} bitmask The bitmask flags.
  23642. * 1 - Deep clone
  23643. * 2 - Flatten inherited properties
  23644. * 4 - Clone symbols
  23645. * @param {Function} [customizer] The function to customize cloning.
  23646. * @param {string} [key] The key of `value`.
  23647. * @param {Object} [object] The parent object of `value`.
  23648. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  23649. * @returns {*} Returns the cloned value.
  23650. */
  23651. function baseClone(value, bitmask, customizer, key, object, stack) {
  23652. var result,
  23653. isDeep = bitmask & CLONE_DEEP_FLAG,
  23654. isFlat = bitmask & CLONE_FLAT_FLAG,
  23655. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  23656. if (customizer) {
  23657. result = object ? customizer(value, key, object, stack) : customizer(value);
  23658. }
  23659. if (result !== undefined) {
  23660. return result;
  23661. }
  23662. if (!isObject(value)) {
  23663. return value;
  23664. }
  23665. var isArr = isArray(value);
  23666. if (isArr) {
  23667. result = initCloneArray(value);
  23668. if (!isDeep) {
  23669. return copyArray(value, result);
  23670. }
  23671. } else {
  23672. var tag = getTag(value),
  23673. isFunc = tag == funcTag || tag == genTag;
  23674. if (isBuffer(value)) {
  23675. return cloneBuffer(value, isDeep);
  23676. }
  23677. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  23678. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  23679. if (!isDeep) {
  23680. return isFlat
  23681. ? copySymbolsIn(value, baseAssignIn(result, value))
  23682. : copySymbols(value, baseAssign(result, value));
  23683. }
  23684. } else {
  23685. if (!cloneableTags[tag]) {
  23686. return object ? value : {};
  23687. }
  23688. result = initCloneByTag(value, tag, isDeep);
  23689. }
  23690. }
  23691. // Check for circular references and return its corresponding clone.
  23692. stack || (stack = new Stack);
  23693. var stacked = stack.get(value);
  23694. if (stacked) {
  23695. return stacked;
  23696. }
  23697. stack.set(value, result);
  23698. if (isSet(value)) {
  23699. value.forEach(function(subValue) {
  23700. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  23701. });
  23702. } else if (isMap(value)) {
  23703. value.forEach(function(subValue, key) {
  23704. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  23705. });
  23706. }
  23707. var keysFunc = isFull
  23708. ? (isFlat ? getAllKeysIn : getAllKeys)
  23709. : (isFlat ? keysIn : keys);
  23710. var props = isArr ? undefined : keysFunc(value);
  23711. arrayEach(props || value, function(subValue, key) {
  23712. if (props) {
  23713. key = subValue;
  23714. subValue = value[key];
  23715. }
  23716. // Recursively populate clone (susceptible to call stack limits).
  23717. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  23718. });
  23719. return result;
  23720. }
  23721. /**
  23722. * The base implementation of `_.conforms` which doesn't clone `source`.
  23723. *
  23724. * @private
  23725. * @param {Object} source The object of property predicates to conform to.
  23726. * @returns {Function} Returns the new spec function.
  23727. */
  23728. function baseConforms(source) {
  23729. var props = keys(source);
  23730. return function(object) {
  23731. return baseConformsTo(object, source, props);
  23732. };
  23733. }
  23734. /**
  23735. * The base implementation of `_.conformsTo` which accepts `props` to check.
  23736. *
  23737. * @private
  23738. * @param {Object} object The object to inspect.
  23739. * @param {Object} source The object of property predicates to conform to.
  23740. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  23741. */
  23742. function baseConformsTo(object, source, props) {
  23743. var length = props.length;
  23744. if (object == null) {
  23745. return !length;
  23746. }
  23747. object = Object(object);
  23748. while (length--) {
  23749. var key = props[length],
  23750. predicate = source[key],
  23751. value = object[key];
  23752. if ((value === undefined && !(key in object)) || !predicate(value)) {
  23753. return false;
  23754. }
  23755. }
  23756. return true;
  23757. }
  23758. /**
  23759. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  23760. * to provide to `func`.
  23761. *
  23762. * @private
  23763. * @param {Function} func The function to delay.
  23764. * @param {number} wait The number of milliseconds to delay invocation.
  23765. * @param {Array} args The arguments to provide to `func`.
  23766. * @returns {number|Object} Returns the timer id or timeout object.
  23767. */
  23768. function baseDelay(func, wait, args) {
  23769. if (typeof func != 'function') {
  23770. throw new TypeError(FUNC_ERROR_TEXT);
  23771. }
  23772. return setTimeout(function() { func.apply(undefined, args); }, wait);
  23773. }
  23774. /**
  23775. * The base implementation of methods like `_.difference` without support
  23776. * for excluding multiple arrays or iteratee shorthands.
  23777. *
  23778. * @private
  23779. * @param {Array} array The array to inspect.
  23780. * @param {Array} values The values to exclude.
  23781. * @param {Function} [iteratee] The iteratee invoked per element.
  23782. * @param {Function} [comparator] The comparator invoked per element.
  23783. * @returns {Array} Returns the new array of filtered values.
  23784. */
  23785. function baseDifference(array, values, iteratee, comparator) {
  23786. var index = -1,
  23787. includes = arrayIncludes,
  23788. isCommon = true,
  23789. length = array.length,
  23790. result = [],
  23791. valuesLength = values.length;
  23792. if (!length) {
  23793. return result;
  23794. }
  23795. if (iteratee) {
  23796. values = arrayMap(values, baseUnary(iteratee));
  23797. }
  23798. if (comparator) {
  23799. includes = arrayIncludesWith;
  23800. isCommon = false;
  23801. }
  23802. else if (values.length >= LARGE_ARRAY_SIZE) {
  23803. includes = cacheHas;
  23804. isCommon = false;
  23805. values = new SetCache(values);
  23806. }
  23807. outer:
  23808. while (++index < length) {
  23809. var value = array[index],
  23810. computed = iteratee == null ? value : iteratee(value);
  23811. value = (comparator || value !== 0) ? value : 0;
  23812. if (isCommon && computed === computed) {
  23813. var valuesIndex = valuesLength;
  23814. while (valuesIndex--) {
  23815. if (values[valuesIndex] === computed) {
  23816. continue outer;
  23817. }
  23818. }
  23819. result.push(value);
  23820. }
  23821. else if (!includes(values, computed, comparator)) {
  23822. result.push(value);
  23823. }
  23824. }
  23825. return result;
  23826. }
  23827. /**
  23828. * The base implementation of `_.forEach` without support for iteratee shorthands.
  23829. *
  23830. * @private
  23831. * @param {Array|Object} collection The collection to iterate over.
  23832. * @param {Function} iteratee The function invoked per iteration.
  23833. * @returns {Array|Object} Returns `collection`.
  23834. */
  23835. var baseEach = createBaseEach(baseForOwn);
  23836. /**
  23837. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  23838. *
  23839. * @private
  23840. * @param {Array|Object} collection The collection to iterate over.
  23841. * @param {Function} iteratee The function invoked per iteration.
  23842. * @returns {Array|Object} Returns `collection`.
  23843. */
  23844. var baseEachRight = createBaseEach(baseForOwnRight, true);
  23845. /**
  23846. * The base implementation of `_.every` without support for iteratee shorthands.
  23847. *
  23848. * @private
  23849. * @param {Array|Object} collection The collection to iterate over.
  23850. * @param {Function} predicate The function invoked per iteration.
  23851. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  23852. * else `false`
  23853. */
  23854. function baseEvery(collection, predicate) {
  23855. var result = true;
  23856. baseEach(collection, function(value, index, collection) {
  23857. result = !!predicate(value, index, collection);
  23858. return result;
  23859. });
  23860. return result;
  23861. }
  23862. /**
  23863. * The base implementation of methods like `_.max` and `_.min` which accepts a
  23864. * `comparator` to determine the extremum value.
  23865. *
  23866. * @private
  23867. * @param {Array} array The array to iterate over.
  23868. * @param {Function} iteratee The iteratee invoked per iteration.
  23869. * @param {Function} comparator The comparator used to compare values.
  23870. * @returns {*} Returns the extremum value.
  23871. */
  23872. function baseExtremum(array, iteratee, comparator) {
  23873. var index = -1,
  23874. length = array.length;
  23875. while (++index < length) {
  23876. var value = array[index],
  23877. current = iteratee(value);
  23878. if (current != null && (computed === undefined
  23879. ? (current === current && !isSymbol(current))
  23880. : comparator(current, computed)
  23881. )) {
  23882. var computed = current,
  23883. result = value;
  23884. }
  23885. }
  23886. return result;
  23887. }
  23888. /**
  23889. * The base implementation of `_.fill` without an iteratee call guard.
  23890. *
  23891. * @private
  23892. * @param {Array} array The array to fill.
  23893. * @param {*} value The value to fill `array` with.
  23894. * @param {number} [start=0] The start position.
  23895. * @param {number} [end=array.length] The end position.
  23896. * @returns {Array} Returns `array`.
  23897. */
  23898. function baseFill(array, value, start, end) {
  23899. var length = array.length;
  23900. start = toInteger(start);
  23901. if (start < 0) {
  23902. start = -start > length ? 0 : (length + start);
  23903. }
  23904. end = (end === undefined || end > length) ? length : toInteger(end);
  23905. if (end < 0) {
  23906. end += length;
  23907. }
  23908. end = start > end ? 0 : toLength(end);
  23909. while (start < end) {
  23910. array[start++] = value;
  23911. }
  23912. return array;
  23913. }
  23914. /**
  23915. * The base implementation of `_.filter` without support for iteratee shorthands.
  23916. *
  23917. * @private
  23918. * @param {Array|Object} collection The collection to iterate over.
  23919. * @param {Function} predicate The function invoked per iteration.
  23920. * @returns {Array} Returns the new filtered array.
  23921. */
  23922. function baseFilter(collection, predicate) {
  23923. var result = [];
  23924. baseEach(collection, function(value, index, collection) {
  23925. if (predicate(value, index, collection)) {
  23926. result.push(value);
  23927. }
  23928. });
  23929. return result;
  23930. }
  23931. /**
  23932. * The base implementation of `_.flatten` with support for restricting flattening.
  23933. *
  23934. * @private
  23935. * @param {Array} array The array to flatten.
  23936. * @param {number} depth The maximum recursion depth.
  23937. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  23938. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  23939. * @param {Array} [result=[]] The initial result value.
  23940. * @returns {Array} Returns the new flattened array.
  23941. */
  23942. function baseFlatten(array, depth, predicate, isStrict, result) {
  23943. var index = -1,
  23944. length = array.length;
  23945. predicate || (predicate = isFlattenable);
  23946. result || (result = []);
  23947. while (++index < length) {
  23948. var value = array[index];
  23949. if (depth > 0 && predicate(value)) {
  23950. if (depth > 1) {
  23951. // Recursively flatten arrays (susceptible to call stack limits).
  23952. baseFlatten(value, depth - 1, predicate, isStrict, result);
  23953. } else {
  23954. arrayPush(result, value);
  23955. }
  23956. } else if (!isStrict) {
  23957. result[result.length] = value;
  23958. }
  23959. }
  23960. return result;
  23961. }
  23962. /**
  23963. * The base implementation of `baseForOwn` which iterates over `object`
  23964. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  23965. * Iteratee functions may exit iteration early by explicitly returning `false`.
  23966. *
  23967. * @private
  23968. * @param {Object} object The object to iterate over.
  23969. * @param {Function} iteratee The function invoked per iteration.
  23970. * @param {Function} keysFunc The function to get the keys of `object`.
  23971. * @returns {Object} Returns `object`.
  23972. */
  23973. var baseFor = createBaseFor();
  23974. /**
  23975. * This function is like `baseFor` except that it iterates over properties
  23976. * in the opposite order.
  23977. *
  23978. * @private
  23979. * @param {Object} object The object to iterate over.
  23980. * @param {Function} iteratee The function invoked per iteration.
  23981. * @param {Function} keysFunc The function to get the keys of `object`.
  23982. * @returns {Object} Returns `object`.
  23983. */
  23984. var baseForRight = createBaseFor(true);
  23985. /**
  23986. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  23987. *
  23988. * @private
  23989. * @param {Object} object The object to iterate over.
  23990. * @param {Function} iteratee The function invoked per iteration.
  23991. * @returns {Object} Returns `object`.
  23992. */
  23993. function baseForOwn(object, iteratee) {
  23994. return object && baseFor(object, iteratee, keys);
  23995. }
  23996. /**
  23997. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  23998. *
  23999. * @private
  24000. * @param {Object} object The object to iterate over.
  24001. * @param {Function} iteratee The function invoked per iteration.
  24002. * @returns {Object} Returns `object`.
  24003. */
  24004. function baseForOwnRight(object, iteratee) {
  24005. return object && baseForRight(object, iteratee, keys);
  24006. }
  24007. /**
  24008. * The base implementation of `_.functions` which creates an array of
  24009. * `object` function property names filtered from `props`.
  24010. *
  24011. * @private
  24012. * @param {Object} object The object to inspect.
  24013. * @param {Array} props The property names to filter.
  24014. * @returns {Array} Returns the function names.
  24015. */
  24016. function baseFunctions(object, props) {
  24017. return arrayFilter(props, function(key) {
  24018. return isFunction(object[key]);
  24019. });
  24020. }
  24021. /**
  24022. * The base implementation of `_.get` without support for default values.
  24023. *
  24024. * @private
  24025. * @param {Object} object The object to query.
  24026. * @param {Array|string} path The path of the property to get.
  24027. * @returns {*} Returns the resolved value.
  24028. */
  24029. function baseGet(object, path) {
  24030. path = castPath(path, object);
  24031. var index = 0,
  24032. length = path.length;
  24033. while (object != null && index < length) {
  24034. object = object[toKey(path[index++])];
  24035. }
  24036. return (index && index == length) ? object : undefined;
  24037. }
  24038. /**
  24039. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  24040. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  24041. * symbols of `object`.
  24042. *
  24043. * @private
  24044. * @param {Object} object The object to query.
  24045. * @param {Function} keysFunc The function to get the keys of `object`.
  24046. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  24047. * @returns {Array} Returns the array of property names and symbols.
  24048. */
  24049. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  24050. var result = keysFunc(object);
  24051. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  24052. }
  24053. /**
  24054. * The base implementation of `getTag` without fallbacks for buggy environments.
  24055. *
  24056. * @private
  24057. * @param {*} value The value to query.
  24058. * @returns {string} Returns the `toStringTag`.
  24059. */
  24060. function baseGetTag(value) {
  24061. if (value == null) {
  24062. return value === undefined ? undefinedTag : nullTag;
  24063. }
  24064. return (symToStringTag && symToStringTag in Object(value))
  24065. ? getRawTag(value)
  24066. : objectToString(value);
  24067. }
  24068. /**
  24069. * The base implementation of `_.gt` which doesn't coerce arguments.
  24070. *
  24071. * @private
  24072. * @param {*} value The value to compare.
  24073. * @param {*} other The other value to compare.
  24074. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  24075. * else `false`.
  24076. */
  24077. function baseGt(value, other) {
  24078. return value > other;
  24079. }
  24080. /**
  24081. * The base implementation of `_.has` without support for deep paths.
  24082. *
  24083. * @private
  24084. * @param {Object} [object] The object to query.
  24085. * @param {Array|string} key The key to check.
  24086. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  24087. */
  24088. function baseHas(object, key) {
  24089. return object != null && hasOwnProperty.call(object, key);
  24090. }
  24091. /**
  24092. * The base implementation of `_.hasIn` without support for deep paths.
  24093. *
  24094. * @private
  24095. * @param {Object} [object] The object to query.
  24096. * @param {Array|string} key The key to check.
  24097. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  24098. */
  24099. function baseHasIn(object, key) {
  24100. return object != null && key in Object(object);
  24101. }
  24102. /**
  24103. * The base implementation of `_.inRange` which doesn't coerce arguments.
  24104. *
  24105. * @private
  24106. * @param {number} number The number to check.
  24107. * @param {number} start The start of the range.
  24108. * @param {number} end The end of the range.
  24109. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  24110. */
  24111. function baseInRange(number, start, end) {
  24112. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  24113. }
  24114. /**
  24115. * The base implementation of methods like `_.intersection`, without support
  24116. * for iteratee shorthands, that accepts an array of arrays to inspect.
  24117. *
  24118. * @private
  24119. * @param {Array} arrays The arrays to inspect.
  24120. * @param {Function} [iteratee] The iteratee invoked per element.
  24121. * @param {Function} [comparator] The comparator invoked per element.
  24122. * @returns {Array} Returns the new array of shared values.
  24123. */
  24124. function baseIntersection(arrays, iteratee, comparator) {
  24125. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  24126. length = arrays[0].length,
  24127. othLength = arrays.length,
  24128. othIndex = othLength,
  24129. caches = Array(othLength),
  24130. maxLength = Infinity,
  24131. result = [];
  24132. while (othIndex--) {
  24133. var array = arrays[othIndex];
  24134. if (othIndex && iteratee) {
  24135. array = arrayMap(array, baseUnary(iteratee));
  24136. }
  24137. maxLength = nativeMin(array.length, maxLength);
  24138. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  24139. ? new SetCache(othIndex && array)
  24140. : undefined;
  24141. }
  24142. array = arrays[0];
  24143. var index = -1,
  24144. seen = caches[0];
  24145. outer:
  24146. while (++index < length && result.length < maxLength) {
  24147. var value = array[index],
  24148. computed = iteratee ? iteratee(value) : value;
  24149. value = (comparator || value !== 0) ? value : 0;
  24150. if (!(seen
  24151. ? cacheHas(seen, computed)
  24152. : includes(result, computed, comparator)
  24153. )) {
  24154. othIndex = othLength;
  24155. while (--othIndex) {
  24156. var cache = caches[othIndex];
  24157. if (!(cache
  24158. ? cacheHas(cache, computed)
  24159. : includes(arrays[othIndex], computed, comparator))
  24160. ) {
  24161. continue outer;
  24162. }
  24163. }
  24164. if (seen) {
  24165. seen.push(computed);
  24166. }
  24167. result.push(value);
  24168. }
  24169. }
  24170. return result;
  24171. }
  24172. /**
  24173. * The base implementation of `_.invert` and `_.invertBy` which inverts
  24174. * `object` with values transformed by `iteratee` and set by `setter`.
  24175. *
  24176. * @private
  24177. * @param {Object} object The object to iterate over.
  24178. * @param {Function} setter The function to set `accumulator` values.
  24179. * @param {Function} iteratee The iteratee to transform values.
  24180. * @param {Object} accumulator The initial inverted object.
  24181. * @returns {Function} Returns `accumulator`.
  24182. */
  24183. function baseInverter(object, setter, iteratee, accumulator) {
  24184. baseForOwn(object, function(value, key, object) {
  24185. setter(accumulator, iteratee(value), key, object);
  24186. });
  24187. return accumulator;
  24188. }
  24189. /**
  24190. * The base implementation of `_.invoke` without support for individual
  24191. * method arguments.
  24192. *
  24193. * @private
  24194. * @param {Object} object The object to query.
  24195. * @param {Array|string} path The path of the method to invoke.
  24196. * @param {Array} args The arguments to invoke the method with.
  24197. * @returns {*} Returns the result of the invoked method.
  24198. */
  24199. function baseInvoke(object, path, args) {
  24200. path = castPath(path, object);
  24201. object = parent(object, path);
  24202. var func = object == null ? object : object[toKey(last(path))];
  24203. return func == null ? undefined : apply(func, object, args);
  24204. }
  24205. /**
  24206. * The base implementation of `_.isArguments`.
  24207. *
  24208. * @private
  24209. * @param {*} value The value to check.
  24210. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  24211. */
  24212. function baseIsArguments(value) {
  24213. return isObjectLike(value) && baseGetTag(value) == argsTag;
  24214. }
  24215. /**
  24216. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  24217. *
  24218. * @private
  24219. * @param {*} value The value to check.
  24220. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  24221. */
  24222. function baseIsArrayBuffer(value) {
  24223. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  24224. }
  24225. /**
  24226. * The base implementation of `_.isDate` without Node.js optimizations.
  24227. *
  24228. * @private
  24229. * @param {*} value The value to check.
  24230. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  24231. */
  24232. function baseIsDate(value) {
  24233. return isObjectLike(value) && baseGetTag(value) == dateTag;
  24234. }
  24235. /**
  24236. * The base implementation of `_.isEqual` which supports partial comparisons
  24237. * and tracks traversed objects.
  24238. *
  24239. * @private
  24240. * @param {*} value The value to compare.
  24241. * @param {*} other The other value to compare.
  24242. * @param {boolean} bitmask The bitmask flags.
  24243. * 1 - Unordered comparison
  24244. * 2 - Partial comparison
  24245. * @param {Function} [customizer] The function to customize comparisons.
  24246. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  24247. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  24248. */
  24249. function baseIsEqual(value, other, bitmask, customizer, stack) {
  24250. if (value === other) {
  24251. return true;
  24252. }
  24253. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  24254. return value !== value && other !== other;
  24255. }
  24256. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  24257. }
  24258. /**
  24259. * A specialized version of `baseIsEqual` for arrays and objects which performs
  24260. * deep comparisons and tracks traversed objects enabling objects with circular
  24261. * references to be compared.
  24262. *
  24263. * @private
  24264. * @param {Object} object The object to compare.
  24265. * @param {Object} other The other object to compare.
  24266. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  24267. * @param {Function} customizer The function to customize comparisons.
  24268. * @param {Function} equalFunc The function to determine equivalents of values.
  24269. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  24270. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  24271. */
  24272. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  24273. var objIsArr = isArray(object),
  24274. othIsArr = isArray(other),
  24275. objTag = objIsArr ? arrayTag : getTag(object),
  24276. othTag = othIsArr ? arrayTag : getTag(other);
  24277. objTag = objTag == argsTag ? objectTag : objTag;
  24278. othTag = othTag == argsTag ? objectTag : othTag;
  24279. var objIsObj = objTag == objectTag,
  24280. othIsObj = othTag == objectTag,
  24281. isSameTag = objTag == othTag;
  24282. if (isSameTag && isBuffer(object)) {
  24283. if (!isBuffer(other)) {
  24284. return false;
  24285. }
  24286. objIsArr = true;
  24287. objIsObj = false;
  24288. }
  24289. if (isSameTag && !objIsObj) {
  24290. stack || (stack = new Stack);
  24291. return (objIsArr || isTypedArray(object))
  24292. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  24293. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  24294. }
  24295. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  24296. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  24297. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  24298. if (objIsWrapped || othIsWrapped) {
  24299. var objUnwrapped = objIsWrapped ? object.value() : object,
  24300. othUnwrapped = othIsWrapped ? other.value() : other;
  24301. stack || (stack = new Stack);
  24302. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  24303. }
  24304. }
  24305. if (!isSameTag) {
  24306. return false;
  24307. }
  24308. stack || (stack = new Stack);
  24309. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  24310. }
  24311. /**
  24312. * The base implementation of `_.isMap` without Node.js optimizations.
  24313. *
  24314. * @private
  24315. * @param {*} value The value to check.
  24316. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  24317. */
  24318. function baseIsMap(value) {
  24319. return isObjectLike(value) && getTag(value) == mapTag;
  24320. }
  24321. /**
  24322. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  24323. *
  24324. * @private
  24325. * @param {Object} object The object to inspect.
  24326. * @param {Object} source The object of property values to match.
  24327. * @param {Array} matchData The property names, values, and compare flags to match.
  24328. * @param {Function} [customizer] The function to customize comparisons.
  24329. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  24330. */
  24331. function baseIsMatch(object, source, matchData, customizer) {
  24332. var index = matchData.length,
  24333. length = index,
  24334. noCustomizer = !customizer;
  24335. if (object == null) {
  24336. return !length;
  24337. }
  24338. object = Object(object);
  24339. while (index--) {
  24340. var data = matchData[index];
  24341. if ((noCustomizer && data[2])
  24342. ? data[1] !== object[data[0]]
  24343. : !(data[0] in object)
  24344. ) {
  24345. return false;
  24346. }
  24347. }
  24348. while (++index < length) {
  24349. data = matchData[index];
  24350. var key = data[0],
  24351. objValue = object[key],
  24352. srcValue = data[1];
  24353. if (noCustomizer && data[2]) {
  24354. if (objValue === undefined && !(key in object)) {
  24355. return false;
  24356. }
  24357. } else {
  24358. var stack = new Stack;
  24359. if (customizer) {
  24360. var result = customizer(objValue, srcValue, key, object, source, stack);
  24361. }
  24362. if (!(result === undefined
  24363. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  24364. : result
  24365. )) {
  24366. return false;
  24367. }
  24368. }
  24369. }
  24370. return true;
  24371. }
  24372. /**
  24373. * The base implementation of `_.isNative` without bad shim checks.
  24374. *
  24375. * @private
  24376. * @param {*} value The value to check.
  24377. * @returns {boolean} Returns `true` if `value` is a native function,
  24378. * else `false`.
  24379. */
  24380. function baseIsNative(value) {
  24381. if (!isObject(value) || isMasked(value)) {
  24382. return false;
  24383. }
  24384. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  24385. return pattern.test(toSource(value));
  24386. }
  24387. /**
  24388. * The base implementation of `_.isRegExp` without Node.js optimizations.
  24389. *
  24390. * @private
  24391. * @param {*} value The value to check.
  24392. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  24393. */
  24394. function baseIsRegExp(value) {
  24395. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  24396. }
  24397. /**
  24398. * The base implementation of `_.isSet` without Node.js optimizations.
  24399. *
  24400. * @private
  24401. * @param {*} value The value to check.
  24402. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  24403. */
  24404. function baseIsSet(value) {
  24405. return isObjectLike(value) && getTag(value) == setTag;
  24406. }
  24407. /**
  24408. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  24409. *
  24410. * @private
  24411. * @param {*} value The value to check.
  24412. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  24413. */
  24414. function baseIsTypedArray(value) {
  24415. return isObjectLike(value) &&
  24416. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  24417. }
  24418. /**
  24419. * The base implementation of `_.iteratee`.
  24420. *
  24421. * @private
  24422. * @param {*} [value=_.identity] The value to convert to an iteratee.
  24423. * @returns {Function} Returns the iteratee.
  24424. */
  24425. function baseIteratee(value) {
  24426. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  24427. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  24428. if (typeof value == 'function') {
  24429. return value;
  24430. }
  24431. if (value == null) {
  24432. return identity;
  24433. }
  24434. if (typeof value == 'object') {
  24435. return isArray(value)
  24436. ? baseMatchesProperty(value[0], value[1])
  24437. : baseMatches(value);
  24438. }
  24439. return property(value);
  24440. }
  24441. /**
  24442. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  24443. *
  24444. * @private
  24445. * @param {Object} object The object to query.
  24446. * @returns {Array} Returns the array of property names.
  24447. */
  24448. function baseKeys(object) {
  24449. if (!isPrototype(object)) {
  24450. return nativeKeys(object);
  24451. }
  24452. var result = [];
  24453. for (var key in Object(object)) {
  24454. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  24455. result.push(key);
  24456. }
  24457. }
  24458. return result;
  24459. }
  24460. /**
  24461. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  24462. *
  24463. * @private
  24464. * @param {Object} object The object to query.
  24465. * @returns {Array} Returns the array of property names.
  24466. */
  24467. function baseKeysIn(object) {
  24468. if (!isObject(object)) {
  24469. return nativeKeysIn(object);
  24470. }
  24471. var isProto = isPrototype(object),
  24472. result = [];
  24473. for (var key in object) {
  24474. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  24475. result.push(key);
  24476. }
  24477. }
  24478. return result;
  24479. }
  24480. /**
  24481. * The base implementation of `_.lt` which doesn't coerce arguments.
  24482. *
  24483. * @private
  24484. * @param {*} value The value to compare.
  24485. * @param {*} other The other value to compare.
  24486. * @returns {boolean} Returns `true` if `value` is less than `other`,
  24487. * else `false`.
  24488. */
  24489. function baseLt(value, other) {
  24490. return value < other;
  24491. }
  24492. /**
  24493. * The base implementation of `_.map` without support for iteratee shorthands.
  24494. *
  24495. * @private
  24496. * @param {Array|Object} collection The collection to iterate over.
  24497. * @param {Function} iteratee The function invoked per iteration.
  24498. * @returns {Array} Returns the new mapped array.
  24499. */
  24500. function baseMap(collection, iteratee) {
  24501. var index = -1,
  24502. result = isArrayLike(collection) ? Array(collection.length) : [];
  24503. baseEach(collection, function(value, key, collection) {
  24504. result[++index] = iteratee(value, key, collection);
  24505. });
  24506. return result;
  24507. }
  24508. /**
  24509. * The base implementation of `_.matches` which doesn't clone `source`.
  24510. *
  24511. * @private
  24512. * @param {Object} source The object of property values to match.
  24513. * @returns {Function} Returns the new spec function.
  24514. */
  24515. function baseMatches(source) {
  24516. var matchData = getMatchData(source);
  24517. if (matchData.length == 1 && matchData[0][2]) {
  24518. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  24519. }
  24520. return function(object) {
  24521. return object === source || baseIsMatch(object, source, matchData);
  24522. };
  24523. }
  24524. /**
  24525. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  24526. *
  24527. * @private
  24528. * @param {string} path The path of the property to get.
  24529. * @param {*} srcValue The value to match.
  24530. * @returns {Function} Returns the new spec function.
  24531. */
  24532. function baseMatchesProperty(path, srcValue) {
  24533. if (isKey(path) && isStrictComparable(srcValue)) {
  24534. return matchesStrictComparable(toKey(path), srcValue);
  24535. }
  24536. return function(object) {
  24537. var objValue = get(object, path);
  24538. return (objValue === undefined && objValue === srcValue)
  24539. ? hasIn(object, path)
  24540. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  24541. };
  24542. }
  24543. /**
  24544. * The base implementation of `_.merge` without support for multiple sources.
  24545. *
  24546. * @private
  24547. * @param {Object} object The destination object.
  24548. * @param {Object} source The source object.
  24549. * @param {number} srcIndex The index of `source`.
  24550. * @param {Function} [customizer] The function to customize merged values.
  24551. * @param {Object} [stack] Tracks traversed source values and their merged
  24552. * counterparts.
  24553. */
  24554. function baseMerge(object, source, srcIndex, customizer, stack) {
  24555. if (object === source) {
  24556. return;
  24557. }
  24558. baseFor(source, function(srcValue, key) {
  24559. stack || (stack = new Stack);
  24560. if (isObject(srcValue)) {
  24561. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  24562. }
  24563. else {
  24564. var newValue = customizer
  24565. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  24566. : undefined;
  24567. if (newValue === undefined) {
  24568. newValue = srcValue;
  24569. }
  24570. assignMergeValue(object, key, newValue);
  24571. }
  24572. }, keysIn);
  24573. }
  24574. /**
  24575. * A specialized version of `baseMerge` for arrays and objects which performs
  24576. * deep merges and tracks traversed objects enabling objects with circular
  24577. * references to be merged.
  24578. *
  24579. * @private
  24580. * @param {Object} object The destination object.
  24581. * @param {Object} source The source object.
  24582. * @param {string} key The key of the value to merge.
  24583. * @param {number} srcIndex The index of `source`.
  24584. * @param {Function} mergeFunc The function to merge values.
  24585. * @param {Function} [customizer] The function to customize assigned values.
  24586. * @param {Object} [stack] Tracks traversed source values and their merged
  24587. * counterparts.
  24588. */
  24589. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  24590. var objValue = safeGet(object, key),
  24591. srcValue = safeGet(source, key),
  24592. stacked = stack.get(srcValue);
  24593. if (stacked) {
  24594. assignMergeValue(object, key, stacked);
  24595. return;
  24596. }
  24597. var newValue = customizer
  24598. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  24599. : undefined;
  24600. var isCommon = newValue === undefined;
  24601. if (isCommon) {
  24602. var isArr = isArray(srcValue),
  24603. isBuff = !isArr && isBuffer(srcValue),
  24604. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  24605. newValue = srcValue;
  24606. if (isArr || isBuff || isTyped) {
  24607. if (isArray(objValue)) {
  24608. newValue = objValue;
  24609. }
  24610. else if (isArrayLikeObject(objValue)) {
  24611. newValue = copyArray(objValue);
  24612. }
  24613. else if (isBuff) {
  24614. isCommon = false;
  24615. newValue = cloneBuffer(srcValue, true);
  24616. }
  24617. else if (isTyped) {
  24618. isCommon = false;
  24619. newValue = cloneTypedArray(srcValue, true);
  24620. }
  24621. else {
  24622. newValue = [];
  24623. }
  24624. }
  24625. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  24626. newValue = objValue;
  24627. if (isArguments(objValue)) {
  24628. newValue = toPlainObject(objValue);
  24629. }
  24630. else if (!isObject(objValue) || isFunction(objValue)) {
  24631. newValue = initCloneObject(srcValue);
  24632. }
  24633. }
  24634. else {
  24635. isCommon = false;
  24636. }
  24637. }
  24638. if (isCommon) {
  24639. // Recursively merge objects and arrays (susceptible to call stack limits).
  24640. stack.set(srcValue, newValue);
  24641. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  24642. stack['delete'](srcValue);
  24643. }
  24644. assignMergeValue(object, key, newValue);
  24645. }
  24646. /**
  24647. * The base implementation of `_.nth` which doesn't coerce arguments.
  24648. *
  24649. * @private
  24650. * @param {Array} array The array to query.
  24651. * @param {number} n The index of the element to return.
  24652. * @returns {*} Returns the nth element of `array`.
  24653. */
  24654. function baseNth(array, n) {
  24655. var length = array.length;
  24656. if (!length) {
  24657. return;
  24658. }
  24659. n += n < 0 ? length : 0;
  24660. return isIndex(n, length) ? array[n] : undefined;
  24661. }
  24662. /**
  24663. * The base implementation of `_.orderBy` without param guards.
  24664. *
  24665. * @private
  24666. * @param {Array|Object} collection The collection to iterate over.
  24667. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  24668. * @param {string[]} orders The sort orders of `iteratees`.
  24669. * @returns {Array} Returns the new sorted array.
  24670. */
  24671. function baseOrderBy(collection, iteratees, orders) {
  24672. if (iteratees.length) {
  24673. iteratees = arrayMap(iteratees, function(iteratee) {
  24674. if (isArray(iteratee)) {
  24675. return function(value) {
  24676. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  24677. }
  24678. }
  24679. return iteratee;
  24680. });
  24681. } else {
  24682. iteratees = [identity];
  24683. }
  24684. var index = -1;
  24685. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  24686. var result = baseMap(collection, function(value, key, collection) {
  24687. var criteria = arrayMap(iteratees, function(iteratee) {
  24688. return iteratee(value);
  24689. });
  24690. return { 'criteria': criteria, 'index': ++index, 'value': value };
  24691. });
  24692. return baseSortBy(result, function(object, other) {
  24693. return compareMultiple(object, other, orders);
  24694. });
  24695. }
  24696. /**
  24697. * The base implementation of `_.pick` without support for individual
  24698. * property identifiers.
  24699. *
  24700. * @private
  24701. * @param {Object} object The source object.
  24702. * @param {string[]} paths The property paths to pick.
  24703. * @returns {Object} Returns the new object.
  24704. */
  24705. function basePick(object, paths) {
  24706. return basePickBy(object, paths, function(value, path) {
  24707. return hasIn(object, path);
  24708. });
  24709. }
  24710. /**
  24711. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  24712. *
  24713. * @private
  24714. * @param {Object} object The source object.
  24715. * @param {string[]} paths The property paths to pick.
  24716. * @param {Function} predicate The function invoked per property.
  24717. * @returns {Object} Returns the new object.
  24718. */
  24719. function basePickBy(object, paths, predicate) {
  24720. var index = -1,
  24721. length = paths.length,
  24722. result = {};
  24723. while (++index < length) {
  24724. var path = paths[index],
  24725. value = baseGet(object, path);
  24726. if (predicate(value, path)) {
  24727. baseSet(result, castPath(path, object), value);
  24728. }
  24729. }
  24730. return result;
  24731. }
  24732. /**
  24733. * A specialized version of `baseProperty` which supports deep paths.
  24734. *
  24735. * @private
  24736. * @param {Array|string} path The path of the property to get.
  24737. * @returns {Function} Returns the new accessor function.
  24738. */
  24739. function basePropertyDeep(path) {
  24740. return function(object) {
  24741. return baseGet(object, path);
  24742. };
  24743. }
  24744. /**
  24745. * The base implementation of `_.pullAllBy` without support for iteratee
  24746. * shorthands.
  24747. *
  24748. * @private
  24749. * @param {Array} array The array to modify.
  24750. * @param {Array} values The values to remove.
  24751. * @param {Function} [iteratee] The iteratee invoked per element.
  24752. * @param {Function} [comparator] The comparator invoked per element.
  24753. * @returns {Array} Returns `array`.
  24754. */
  24755. function basePullAll(array, values, iteratee, comparator) {
  24756. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  24757. index = -1,
  24758. length = values.length,
  24759. seen = array;
  24760. if (array === values) {
  24761. values = copyArray(values);
  24762. }
  24763. if (iteratee) {
  24764. seen = arrayMap(array, baseUnary(iteratee));
  24765. }
  24766. while (++index < length) {
  24767. var fromIndex = 0,
  24768. value = values[index],
  24769. computed = iteratee ? iteratee(value) : value;
  24770. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  24771. if (seen !== array) {
  24772. splice.call(seen, fromIndex, 1);
  24773. }
  24774. splice.call(array, fromIndex, 1);
  24775. }
  24776. }
  24777. return array;
  24778. }
  24779. /**
  24780. * The base implementation of `_.pullAt` without support for individual
  24781. * indexes or capturing the removed elements.
  24782. *
  24783. * @private
  24784. * @param {Array} array The array to modify.
  24785. * @param {number[]} indexes The indexes of elements to remove.
  24786. * @returns {Array} Returns `array`.
  24787. */
  24788. function basePullAt(array, indexes) {
  24789. var length = array ? indexes.length : 0,
  24790. lastIndex = length - 1;
  24791. while (length--) {
  24792. var index = indexes[length];
  24793. if (length == lastIndex || index !== previous) {
  24794. var previous = index;
  24795. if (isIndex(index)) {
  24796. splice.call(array, index, 1);
  24797. } else {
  24798. baseUnset(array, index);
  24799. }
  24800. }
  24801. }
  24802. return array;
  24803. }
  24804. /**
  24805. * The base implementation of `_.random` without support for returning
  24806. * floating-point numbers.
  24807. *
  24808. * @private
  24809. * @param {number} lower The lower bound.
  24810. * @param {number} upper The upper bound.
  24811. * @returns {number} Returns the random number.
  24812. */
  24813. function baseRandom(lower, upper) {
  24814. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  24815. }
  24816. /**
  24817. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  24818. * coerce arguments.
  24819. *
  24820. * @private
  24821. * @param {number} start The start of the range.
  24822. * @param {number} end The end of the range.
  24823. * @param {number} step The value to increment or decrement by.
  24824. * @param {boolean} [fromRight] Specify iterating from right to left.
  24825. * @returns {Array} Returns the range of numbers.
  24826. */
  24827. function baseRange(start, end, step, fromRight) {
  24828. var index = -1,
  24829. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  24830. result = Array(length);
  24831. while (length--) {
  24832. result[fromRight ? length : ++index] = start;
  24833. start += step;
  24834. }
  24835. return result;
  24836. }
  24837. /**
  24838. * The base implementation of `_.repeat` which doesn't coerce arguments.
  24839. *
  24840. * @private
  24841. * @param {string} string The string to repeat.
  24842. * @param {number} n The number of times to repeat the string.
  24843. * @returns {string} Returns the repeated string.
  24844. */
  24845. function baseRepeat(string, n) {
  24846. var result = '';
  24847. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  24848. return result;
  24849. }
  24850. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  24851. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  24852. do {
  24853. if (n % 2) {
  24854. result += string;
  24855. }
  24856. n = nativeFloor(n / 2);
  24857. if (n) {
  24858. string += string;
  24859. }
  24860. } while (n);
  24861. return result;
  24862. }
  24863. /**
  24864. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  24865. *
  24866. * @private
  24867. * @param {Function} func The function to apply a rest parameter to.
  24868. * @param {number} [start=func.length-1] The start position of the rest parameter.
  24869. * @returns {Function} Returns the new function.
  24870. */
  24871. function baseRest(func, start) {
  24872. return setToString(overRest(func, start, identity), func + '');
  24873. }
  24874. /**
  24875. * The base implementation of `_.sample`.
  24876. *
  24877. * @private
  24878. * @param {Array|Object} collection The collection to sample.
  24879. * @returns {*} Returns the random element.
  24880. */
  24881. function baseSample(collection) {
  24882. return arraySample(values(collection));
  24883. }
  24884. /**
  24885. * The base implementation of `_.sampleSize` without param guards.
  24886. *
  24887. * @private
  24888. * @param {Array|Object} collection The collection to sample.
  24889. * @param {number} n The number of elements to sample.
  24890. * @returns {Array} Returns the random elements.
  24891. */
  24892. function baseSampleSize(collection, n) {
  24893. var array = values(collection);
  24894. return shuffleSelf(array, baseClamp(n, 0, array.length));
  24895. }
  24896. /**
  24897. * The base implementation of `_.set`.
  24898. *
  24899. * @private
  24900. * @param {Object} object The object to modify.
  24901. * @param {Array|string} path The path of the property to set.
  24902. * @param {*} value The value to set.
  24903. * @param {Function} [customizer] The function to customize path creation.
  24904. * @returns {Object} Returns `object`.
  24905. */
  24906. function baseSet(object, path, value, customizer) {
  24907. if (!isObject(object)) {
  24908. return object;
  24909. }
  24910. path = castPath(path, object);
  24911. var index = -1,
  24912. length = path.length,
  24913. lastIndex = length - 1,
  24914. nested = object;
  24915. while (nested != null && ++index < length) {
  24916. var key = toKey(path[index]),
  24917. newValue = value;
  24918. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  24919. return object;
  24920. }
  24921. if (index != lastIndex) {
  24922. var objValue = nested[key];
  24923. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  24924. if (newValue === undefined) {
  24925. newValue = isObject(objValue)
  24926. ? objValue
  24927. : (isIndex(path[index + 1]) ? [] : {});
  24928. }
  24929. }
  24930. assignValue(nested, key, newValue);
  24931. nested = nested[key];
  24932. }
  24933. return object;
  24934. }
  24935. /**
  24936. * The base implementation of `setData` without support for hot loop shorting.
  24937. *
  24938. * @private
  24939. * @param {Function} func The function to associate metadata with.
  24940. * @param {*} data The metadata.
  24941. * @returns {Function} Returns `func`.
  24942. */
  24943. var baseSetData = !metaMap ? identity : function(func, data) {
  24944. metaMap.set(func, data);
  24945. return func;
  24946. };
  24947. /**
  24948. * The base implementation of `setToString` without support for hot loop shorting.
  24949. *
  24950. * @private
  24951. * @param {Function} func The function to modify.
  24952. * @param {Function} string The `toString` result.
  24953. * @returns {Function} Returns `func`.
  24954. */
  24955. var baseSetToString = !defineProperty ? identity : function(func, string) {
  24956. return defineProperty(func, 'toString', {
  24957. 'configurable': true,
  24958. 'enumerable': false,
  24959. 'value': constant(string),
  24960. 'writable': true
  24961. });
  24962. };
  24963. /**
  24964. * The base implementation of `_.shuffle`.
  24965. *
  24966. * @private
  24967. * @param {Array|Object} collection The collection to shuffle.
  24968. * @returns {Array} Returns the new shuffled array.
  24969. */
  24970. function baseShuffle(collection) {
  24971. return shuffleSelf(values(collection));
  24972. }
  24973. /**
  24974. * The base implementation of `_.slice` without an iteratee call guard.
  24975. *
  24976. * @private
  24977. * @param {Array} array The array to slice.
  24978. * @param {number} [start=0] The start position.
  24979. * @param {number} [end=array.length] The end position.
  24980. * @returns {Array} Returns the slice of `array`.
  24981. */
  24982. function baseSlice(array, start, end) {
  24983. var index = -1,
  24984. length = array.length;
  24985. if (start < 0) {
  24986. start = -start > length ? 0 : (length + start);
  24987. }
  24988. end = end > length ? length : end;
  24989. if (end < 0) {
  24990. end += length;
  24991. }
  24992. length = start > end ? 0 : ((end - start) >>> 0);
  24993. start >>>= 0;
  24994. var result = Array(length);
  24995. while (++index < length) {
  24996. result[index] = array[index + start];
  24997. }
  24998. return result;
  24999. }
  25000. /**
  25001. * The base implementation of `_.some` without support for iteratee shorthands.
  25002. *
  25003. * @private
  25004. * @param {Array|Object} collection The collection to iterate over.
  25005. * @param {Function} predicate The function invoked per iteration.
  25006. * @returns {boolean} Returns `true` if any element passes the predicate check,
  25007. * else `false`.
  25008. */
  25009. function baseSome(collection, predicate) {
  25010. var result;
  25011. baseEach(collection, function(value, index, collection) {
  25012. result = predicate(value, index, collection);
  25013. return !result;
  25014. });
  25015. return !!result;
  25016. }
  25017. /**
  25018. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  25019. * performs a binary search of `array` to determine the index at which `value`
  25020. * should be inserted into `array` in order to maintain its sort order.
  25021. *
  25022. * @private
  25023. * @param {Array} array The sorted array to inspect.
  25024. * @param {*} value The value to evaluate.
  25025. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  25026. * @returns {number} Returns the index at which `value` should be inserted
  25027. * into `array`.
  25028. */
  25029. function baseSortedIndex(array, value, retHighest) {
  25030. var low = 0,
  25031. high = array == null ? low : array.length;
  25032. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  25033. while (low < high) {
  25034. var mid = (low + high) >>> 1,
  25035. computed = array[mid];
  25036. if (computed !== null && !isSymbol(computed) &&
  25037. (retHighest ? (computed <= value) : (computed < value))) {
  25038. low = mid + 1;
  25039. } else {
  25040. high = mid;
  25041. }
  25042. }
  25043. return high;
  25044. }
  25045. return baseSortedIndexBy(array, value, identity, retHighest);
  25046. }
  25047. /**
  25048. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  25049. * which invokes `iteratee` for `value` and each element of `array` to compute
  25050. * their sort ranking. The iteratee is invoked with one argument; (value).
  25051. *
  25052. * @private
  25053. * @param {Array} array The sorted array to inspect.
  25054. * @param {*} value The value to evaluate.
  25055. * @param {Function} iteratee The iteratee invoked per element.
  25056. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  25057. * @returns {number} Returns the index at which `value` should be inserted
  25058. * into `array`.
  25059. */
  25060. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  25061. var low = 0,
  25062. high = array == null ? 0 : array.length;
  25063. if (high === 0) {
  25064. return 0;
  25065. }
  25066. value = iteratee(value);
  25067. var valIsNaN = value !== value,
  25068. valIsNull = value === null,
  25069. valIsSymbol = isSymbol(value),
  25070. valIsUndefined = value === undefined;
  25071. while (low < high) {
  25072. var mid = nativeFloor((low + high) / 2),
  25073. computed = iteratee(array[mid]),
  25074. othIsDefined = computed !== undefined,
  25075. othIsNull = computed === null,
  25076. othIsReflexive = computed === computed,
  25077. othIsSymbol = isSymbol(computed);
  25078. if (valIsNaN) {
  25079. var setLow = retHighest || othIsReflexive;
  25080. } else if (valIsUndefined) {
  25081. setLow = othIsReflexive && (retHighest || othIsDefined);
  25082. } else if (valIsNull) {
  25083. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  25084. } else if (valIsSymbol) {
  25085. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  25086. } else if (othIsNull || othIsSymbol) {
  25087. setLow = false;
  25088. } else {
  25089. setLow = retHighest ? (computed <= value) : (computed < value);
  25090. }
  25091. if (setLow) {
  25092. low = mid + 1;
  25093. } else {
  25094. high = mid;
  25095. }
  25096. }
  25097. return nativeMin(high, MAX_ARRAY_INDEX);
  25098. }
  25099. /**
  25100. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  25101. * support for iteratee shorthands.
  25102. *
  25103. * @private
  25104. * @param {Array} array The array to inspect.
  25105. * @param {Function} [iteratee] The iteratee invoked per element.
  25106. * @returns {Array} Returns the new duplicate free array.
  25107. */
  25108. function baseSortedUniq(array, iteratee) {
  25109. var index = -1,
  25110. length = array.length,
  25111. resIndex = 0,
  25112. result = [];
  25113. while (++index < length) {
  25114. var value = array[index],
  25115. computed = iteratee ? iteratee(value) : value;
  25116. if (!index || !eq(computed, seen)) {
  25117. var seen = computed;
  25118. result[resIndex++] = value === 0 ? 0 : value;
  25119. }
  25120. }
  25121. return result;
  25122. }
  25123. /**
  25124. * The base implementation of `_.toNumber` which doesn't ensure correct
  25125. * conversions of binary, hexadecimal, or octal string values.
  25126. *
  25127. * @private
  25128. * @param {*} value The value to process.
  25129. * @returns {number} Returns the number.
  25130. */
  25131. function baseToNumber(value) {
  25132. if (typeof value == 'number') {
  25133. return value;
  25134. }
  25135. if (isSymbol(value)) {
  25136. return NAN;
  25137. }
  25138. return +value;
  25139. }
  25140. /**
  25141. * The base implementation of `_.toString` which doesn't convert nullish
  25142. * values to empty strings.
  25143. *
  25144. * @private
  25145. * @param {*} value The value to process.
  25146. * @returns {string} Returns the string.
  25147. */
  25148. function baseToString(value) {
  25149. // Exit early for strings to avoid a performance hit in some environments.
  25150. if (typeof value == 'string') {
  25151. return value;
  25152. }
  25153. if (isArray(value)) {
  25154. // Recursively convert values (susceptible to call stack limits).
  25155. return arrayMap(value, baseToString) + '';
  25156. }
  25157. if (isSymbol(value)) {
  25158. return symbolToString ? symbolToString.call(value) : '';
  25159. }
  25160. var result = (value + '');
  25161. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  25162. }
  25163. /**
  25164. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  25165. *
  25166. * @private
  25167. * @param {Array} array The array to inspect.
  25168. * @param {Function} [iteratee] The iteratee invoked per element.
  25169. * @param {Function} [comparator] The comparator invoked per element.
  25170. * @returns {Array} Returns the new duplicate free array.
  25171. */
  25172. function baseUniq(array, iteratee, comparator) {
  25173. var index = -1,
  25174. includes = arrayIncludes,
  25175. length = array.length,
  25176. isCommon = true,
  25177. result = [],
  25178. seen = result;
  25179. if (comparator) {
  25180. isCommon = false;
  25181. includes = arrayIncludesWith;
  25182. }
  25183. else if (length >= LARGE_ARRAY_SIZE) {
  25184. var set = iteratee ? null : createSet(array);
  25185. if (set) {
  25186. return setToArray(set);
  25187. }
  25188. isCommon = false;
  25189. includes = cacheHas;
  25190. seen = new SetCache;
  25191. }
  25192. else {
  25193. seen = iteratee ? [] : result;
  25194. }
  25195. outer:
  25196. while (++index < length) {
  25197. var value = array[index],
  25198. computed = iteratee ? iteratee(value) : value;
  25199. value = (comparator || value !== 0) ? value : 0;
  25200. if (isCommon && computed === computed) {
  25201. var seenIndex = seen.length;
  25202. while (seenIndex--) {
  25203. if (seen[seenIndex] === computed) {
  25204. continue outer;
  25205. }
  25206. }
  25207. if (iteratee) {
  25208. seen.push(computed);
  25209. }
  25210. result.push(value);
  25211. }
  25212. else if (!includes(seen, computed, comparator)) {
  25213. if (seen !== result) {
  25214. seen.push(computed);
  25215. }
  25216. result.push(value);
  25217. }
  25218. }
  25219. return result;
  25220. }
  25221. /**
  25222. * The base implementation of `_.unset`.
  25223. *
  25224. * @private
  25225. * @param {Object} object The object to modify.
  25226. * @param {Array|string} path The property path to unset.
  25227. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  25228. */
  25229. function baseUnset(object, path) {
  25230. path = castPath(path, object);
  25231. object = parent(object, path);
  25232. return object == null || delete object[toKey(last(path))];
  25233. }
  25234. /**
  25235. * The base implementation of `_.update`.
  25236. *
  25237. * @private
  25238. * @param {Object} object The object to modify.
  25239. * @param {Array|string} path The path of the property to update.
  25240. * @param {Function} updater The function to produce the updated value.
  25241. * @param {Function} [customizer] The function to customize path creation.
  25242. * @returns {Object} Returns `object`.
  25243. */
  25244. function baseUpdate(object, path, updater, customizer) {
  25245. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  25246. }
  25247. /**
  25248. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  25249. * without support for iteratee shorthands.
  25250. *
  25251. * @private
  25252. * @param {Array} array The array to query.
  25253. * @param {Function} predicate The function invoked per iteration.
  25254. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  25255. * @param {boolean} [fromRight] Specify iterating from right to left.
  25256. * @returns {Array} Returns the slice of `array`.
  25257. */
  25258. function baseWhile(array, predicate, isDrop, fromRight) {
  25259. var length = array.length,
  25260. index = fromRight ? length : -1;
  25261. while ((fromRight ? index-- : ++index < length) &&
  25262. predicate(array[index], index, array)) {}
  25263. return isDrop
  25264. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  25265. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  25266. }
  25267. /**
  25268. * The base implementation of `wrapperValue` which returns the result of
  25269. * performing a sequence of actions on the unwrapped `value`, where each
  25270. * successive action is supplied the return value of the previous.
  25271. *
  25272. * @private
  25273. * @param {*} value The unwrapped value.
  25274. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  25275. * @returns {*} Returns the resolved value.
  25276. */
  25277. function baseWrapperValue(value, actions) {
  25278. var result = value;
  25279. if (result instanceof LazyWrapper) {
  25280. result = result.value();
  25281. }
  25282. return arrayReduce(actions, function(result, action) {
  25283. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  25284. }, result);
  25285. }
  25286. /**
  25287. * The base implementation of methods like `_.xor`, without support for
  25288. * iteratee shorthands, that accepts an array of arrays to inspect.
  25289. *
  25290. * @private
  25291. * @param {Array} arrays The arrays to inspect.
  25292. * @param {Function} [iteratee] The iteratee invoked per element.
  25293. * @param {Function} [comparator] The comparator invoked per element.
  25294. * @returns {Array} Returns the new array of values.
  25295. */
  25296. function baseXor(arrays, iteratee, comparator) {
  25297. var length = arrays.length;
  25298. if (length < 2) {
  25299. return length ? baseUniq(arrays[0]) : [];
  25300. }
  25301. var index = -1,
  25302. result = Array(length);
  25303. while (++index < length) {
  25304. var array = arrays[index],
  25305. othIndex = -1;
  25306. while (++othIndex < length) {
  25307. if (othIndex != index) {
  25308. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  25309. }
  25310. }
  25311. }
  25312. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  25313. }
  25314. /**
  25315. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  25316. *
  25317. * @private
  25318. * @param {Array} props The property identifiers.
  25319. * @param {Array} values The property values.
  25320. * @param {Function} assignFunc The function to assign values.
  25321. * @returns {Object} Returns the new object.
  25322. */
  25323. function baseZipObject(props, values, assignFunc) {
  25324. var index = -1,
  25325. length = props.length,
  25326. valsLength = values.length,
  25327. result = {};
  25328. while (++index < length) {
  25329. var value = index < valsLength ? values[index] : undefined;
  25330. assignFunc(result, props[index], value);
  25331. }
  25332. return result;
  25333. }
  25334. /**
  25335. * Casts `value` to an empty array if it's not an array like object.
  25336. *
  25337. * @private
  25338. * @param {*} value The value to inspect.
  25339. * @returns {Array|Object} Returns the cast array-like object.
  25340. */
  25341. function castArrayLikeObject(value) {
  25342. return isArrayLikeObject(value) ? value : [];
  25343. }
  25344. /**
  25345. * Casts `value` to `identity` if it's not a function.
  25346. *
  25347. * @private
  25348. * @param {*} value The value to inspect.
  25349. * @returns {Function} Returns cast function.
  25350. */
  25351. function castFunction(value) {
  25352. return typeof value == 'function' ? value : identity;
  25353. }
  25354. /**
  25355. * Casts `value` to a path array if it's not one.
  25356. *
  25357. * @private
  25358. * @param {*} value The value to inspect.
  25359. * @param {Object} [object] The object to query keys on.
  25360. * @returns {Array} Returns the cast property path array.
  25361. */
  25362. function castPath(value, object) {
  25363. if (isArray(value)) {
  25364. return value;
  25365. }
  25366. return isKey(value, object) ? [value] : stringToPath(toString(value));
  25367. }
  25368. /**
  25369. * A `baseRest` alias which can be replaced with `identity` by module
  25370. * replacement plugins.
  25371. *
  25372. * @private
  25373. * @type {Function}
  25374. * @param {Function} func The function to apply a rest parameter to.
  25375. * @returns {Function} Returns the new function.
  25376. */
  25377. var castRest = baseRest;
  25378. /**
  25379. * Casts `array` to a slice if it's needed.
  25380. *
  25381. * @private
  25382. * @param {Array} array The array to inspect.
  25383. * @param {number} start The start position.
  25384. * @param {number} [end=array.length] The end position.
  25385. * @returns {Array} Returns the cast slice.
  25386. */
  25387. function castSlice(array, start, end) {
  25388. var length = array.length;
  25389. end = end === undefined ? length : end;
  25390. return (!start && end >= length) ? array : baseSlice(array, start, end);
  25391. }
  25392. /**
  25393. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  25394. *
  25395. * @private
  25396. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  25397. */
  25398. var clearTimeout = ctxClearTimeout || function(id) {
  25399. return root.clearTimeout(id);
  25400. };
  25401. /**
  25402. * Creates a clone of `buffer`.
  25403. *
  25404. * @private
  25405. * @param {Buffer} buffer The buffer to clone.
  25406. * @param {boolean} [isDeep] Specify a deep clone.
  25407. * @returns {Buffer} Returns the cloned buffer.
  25408. */
  25409. function cloneBuffer(buffer, isDeep) {
  25410. if (isDeep) {
  25411. return buffer.slice();
  25412. }
  25413. var length = buffer.length,
  25414. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  25415. buffer.copy(result);
  25416. return result;
  25417. }
  25418. /**
  25419. * Creates a clone of `arrayBuffer`.
  25420. *
  25421. * @private
  25422. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  25423. * @returns {ArrayBuffer} Returns the cloned array buffer.
  25424. */
  25425. function cloneArrayBuffer(arrayBuffer) {
  25426. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  25427. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  25428. return result;
  25429. }
  25430. /**
  25431. * Creates a clone of `dataView`.
  25432. *
  25433. * @private
  25434. * @param {Object} dataView The data view to clone.
  25435. * @param {boolean} [isDeep] Specify a deep clone.
  25436. * @returns {Object} Returns the cloned data view.
  25437. */
  25438. function cloneDataView(dataView, isDeep) {
  25439. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  25440. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  25441. }
  25442. /**
  25443. * Creates a clone of `regexp`.
  25444. *
  25445. * @private
  25446. * @param {Object} regexp The regexp to clone.
  25447. * @returns {Object} Returns the cloned regexp.
  25448. */
  25449. function cloneRegExp(regexp) {
  25450. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  25451. result.lastIndex = regexp.lastIndex;
  25452. return result;
  25453. }
  25454. /**
  25455. * Creates a clone of the `symbol` object.
  25456. *
  25457. * @private
  25458. * @param {Object} symbol The symbol object to clone.
  25459. * @returns {Object} Returns the cloned symbol object.
  25460. */
  25461. function cloneSymbol(symbol) {
  25462. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  25463. }
  25464. /**
  25465. * Creates a clone of `typedArray`.
  25466. *
  25467. * @private
  25468. * @param {Object} typedArray The typed array to clone.
  25469. * @param {boolean} [isDeep] Specify a deep clone.
  25470. * @returns {Object} Returns the cloned typed array.
  25471. */
  25472. function cloneTypedArray(typedArray, isDeep) {
  25473. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  25474. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  25475. }
  25476. /**
  25477. * Compares values to sort them in ascending order.
  25478. *
  25479. * @private
  25480. * @param {*} value The value to compare.
  25481. * @param {*} other The other value to compare.
  25482. * @returns {number} Returns the sort order indicator for `value`.
  25483. */
  25484. function compareAscending(value, other) {
  25485. if (value !== other) {
  25486. var valIsDefined = value !== undefined,
  25487. valIsNull = value === null,
  25488. valIsReflexive = value === value,
  25489. valIsSymbol = isSymbol(value);
  25490. var othIsDefined = other !== undefined,
  25491. othIsNull = other === null,
  25492. othIsReflexive = other === other,
  25493. othIsSymbol = isSymbol(other);
  25494. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  25495. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  25496. (valIsNull && othIsDefined && othIsReflexive) ||
  25497. (!valIsDefined && othIsReflexive) ||
  25498. !valIsReflexive) {
  25499. return 1;
  25500. }
  25501. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  25502. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  25503. (othIsNull && valIsDefined && valIsReflexive) ||
  25504. (!othIsDefined && valIsReflexive) ||
  25505. !othIsReflexive) {
  25506. return -1;
  25507. }
  25508. }
  25509. return 0;
  25510. }
  25511. /**
  25512. * Used by `_.orderBy` to compare multiple properties of a value to another
  25513. * and stable sort them.
  25514. *
  25515. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  25516. * specify an order of "desc" for descending or "asc" for ascending sort order
  25517. * of corresponding values.
  25518. *
  25519. * @private
  25520. * @param {Object} object The object to compare.
  25521. * @param {Object} other The other object to compare.
  25522. * @param {boolean[]|string[]} orders The order to sort by for each property.
  25523. * @returns {number} Returns the sort order indicator for `object`.
  25524. */
  25525. function compareMultiple(object, other, orders) {
  25526. var index = -1,
  25527. objCriteria = object.criteria,
  25528. othCriteria = other.criteria,
  25529. length = objCriteria.length,
  25530. ordersLength = orders.length;
  25531. while (++index < length) {
  25532. var result = compareAscending(objCriteria[index], othCriteria[index]);
  25533. if (result) {
  25534. if (index >= ordersLength) {
  25535. return result;
  25536. }
  25537. var order = orders[index];
  25538. return result * (order == 'desc' ? -1 : 1);
  25539. }
  25540. }
  25541. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  25542. // that causes it, under certain circumstances, to provide the same value for
  25543. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  25544. // for more details.
  25545. //
  25546. // This also ensures a stable sort in V8 and other engines.
  25547. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  25548. return object.index - other.index;
  25549. }
  25550. /**
  25551. * Creates an array that is the composition of partially applied arguments,
  25552. * placeholders, and provided arguments into a single array of arguments.
  25553. *
  25554. * @private
  25555. * @param {Array} args The provided arguments.
  25556. * @param {Array} partials The arguments to prepend to those provided.
  25557. * @param {Array} holders The `partials` placeholder indexes.
  25558. * @params {boolean} [isCurried] Specify composing for a curried function.
  25559. * @returns {Array} Returns the new array of composed arguments.
  25560. */
  25561. function composeArgs(args, partials, holders, isCurried) {
  25562. var argsIndex = -1,
  25563. argsLength = args.length,
  25564. holdersLength = holders.length,
  25565. leftIndex = -1,
  25566. leftLength = partials.length,
  25567. rangeLength = nativeMax(argsLength - holdersLength, 0),
  25568. result = Array(leftLength + rangeLength),
  25569. isUncurried = !isCurried;
  25570. while (++leftIndex < leftLength) {
  25571. result[leftIndex] = partials[leftIndex];
  25572. }
  25573. while (++argsIndex < holdersLength) {
  25574. if (isUncurried || argsIndex < argsLength) {
  25575. result[holders[argsIndex]] = args[argsIndex];
  25576. }
  25577. }
  25578. while (rangeLength--) {
  25579. result[leftIndex++] = args[argsIndex++];
  25580. }
  25581. return result;
  25582. }
  25583. /**
  25584. * This function is like `composeArgs` except that the arguments composition
  25585. * is tailored for `_.partialRight`.
  25586. *
  25587. * @private
  25588. * @param {Array} args The provided arguments.
  25589. * @param {Array} partials The arguments to append to those provided.
  25590. * @param {Array} holders The `partials` placeholder indexes.
  25591. * @params {boolean} [isCurried] Specify composing for a curried function.
  25592. * @returns {Array} Returns the new array of composed arguments.
  25593. */
  25594. function composeArgsRight(args, partials, holders, isCurried) {
  25595. var argsIndex = -1,
  25596. argsLength = args.length,
  25597. holdersIndex = -1,
  25598. holdersLength = holders.length,
  25599. rightIndex = -1,
  25600. rightLength = partials.length,
  25601. rangeLength = nativeMax(argsLength - holdersLength, 0),
  25602. result = Array(rangeLength + rightLength),
  25603. isUncurried = !isCurried;
  25604. while (++argsIndex < rangeLength) {
  25605. result[argsIndex] = args[argsIndex];
  25606. }
  25607. var offset = argsIndex;
  25608. while (++rightIndex < rightLength) {
  25609. result[offset + rightIndex] = partials[rightIndex];
  25610. }
  25611. while (++holdersIndex < holdersLength) {
  25612. if (isUncurried || argsIndex < argsLength) {
  25613. result[offset + holders[holdersIndex]] = args[argsIndex++];
  25614. }
  25615. }
  25616. return result;
  25617. }
  25618. /**
  25619. * Copies the values of `source` to `array`.
  25620. *
  25621. * @private
  25622. * @param {Array} source The array to copy values from.
  25623. * @param {Array} [array=[]] The array to copy values to.
  25624. * @returns {Array} Returns `array`.
  25625. */
  25626. function copyArray(source, array) {
  25627. var index = -1,
  25628. length = source.length;
  25629. array || (array = Array(length));
  25630. while (++index < length) {
  25631. array[index] = source[index];
  25632. }
  25633. return array;
  25634. }
  25635. /**
  25636. * Copies properties of `source` to `object`.
  25637. *
  25638. * @private
  25639. * @param {Object} source The object to copy properties from.
  25640. * @param {Array} props The property identifiers to copy.
  25641. * @param {Object} [object={}] The object to copy properties to.
  25642. * @param {Function} [customizer] The function to customize copied values.
  25643. * @returns {Object} Returns `object`.
  25644. */
  25645. function copyObject(source, props, object, customizer) {
  25646. var isNew = !object;
  25647. object || (object = {});
  25648. var index = -1,
  25649. length = props.length;
  25650. while (++index < length) {
  25651. var key = props[index];
  25652. var newValue = customizer
  25653. ? customizer(object[key], source[key], key, object, source)
  25654. : undefined;
  25655. if (newValue === undefined) {
  25656. newValue = source[key];
  25657. }
  25658. if (isNew) {
  25659. baseAssignValue(object, key, newValue);
  25660. } else {
  25661. assignValue(object, key, newValue);
  25662. }
  25663. }
  25664. return object;
  25665. }
  25666. /**
  25667. * Copies own symbols of `source` to `object`.
  25668. *
  25669. * @private
  25670. * @param {Object} source The object to copy symbols from.
  25671. * @param {Object} [object={}] The object to copy symbols to.
  25672. * @returns {Object} Returns `object`.
  25673. */
  25674. function copySymbols(source, object) {
  25675. return copyObject(source, getSymbols(source), object);
  25676. }
  25677. /**
  25678. * Copies own and inherited symbols of `source` to `object`.
  25679. *
  25680. * @private
  25681. * @param {Object} source The object to copy symbols from.
  25682. * @param {Object} [object={}] The object to copy symbols to.
  25683. * @returns {Object} Returns `object`.
  25684. */
  25685. function copySymbolsIn(source, object) {
  25686. return copyObject(source, getSymbolsIn(source), object);
  25687. }
  25688. /**
  25689. * Creates a function like `_.groupBy`.
  25690. *
  25691. * @private
  25692. * @param {Function} setter The function to set accumulator values.
  25693. * @param {Function} [initializer] The accumulator object initializer.
  25694. * @returns {Function} Returns the new aggregator function.
  25695. */
  25696. function createAggregator(setter, initializer) {
  25697. return function(collection, iteratee) {
  25698. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  25699. accumulator = initializer ? initializer() : {};
  25700. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  25701. };
  25702. }
  25703. /**
  25704. * Creates a function like `_.assign`.
  25705. *
  25706. * @private
  25707. * @param {Function} assigner The function to assign values.
  25708. * @returns {Function} Returns the new assigner function.
  25709. */
  25710. function createAssigner(assigner) {
  25711. return baseRest(function(object, sources) {
  25712. var index = -1,
  25713. length = sources.length,
  25714. customizer = length > 1 ? sources[length - 1] : undefined,
  25715. guard = length > 2 ? sources[2] : undefined;
  25716. customizer = (assigner.length > 3 && typeof customizer == 'function')
  25717. ? (length--, customizer)
  25718. : undefined;
  25719. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  25720. customizer = length < 3 ? undefined : customizer;
  25721. length = 1;
  25722. }
  25723. object = Object(object);
  25724. while (++index < length) {
  25725. var source = sources[index];
  25726. if (source) {
  25727. assigner(object, source, index, customizer);
  25728. }
  25729. }
  25730. return object;
  25731. });
  25732. }
  25733. /**
  25734. * Creates a `baseEach` or `baseEachRight` function.
  25735. *
  25736. * @private
  25737. * @param {Function} eachFunc The function to iterate over a collection.
  25738. * @param {boolean} [fromRight] Specify iterating from right to left.
  25739. * @returns {Function} Returns the new base function.
  25740. */
  25741. function createBaseEach(eachFunc, fromRight) {
  25742. return function(collection, iteratee) {
  25743. if (collection == null) {
  25744. return collection;
  25745. }
  25746. if (!isArrayLike(collection)) {
  25747. return eachFunc(collection, iteratee);
  25748. }
  25749. var length = collection.length,
  25750. index = fromRight ? length : -1,
  25751. iterable = Object(collection);
  25752. while ((fromRight ? index-- : ++index < length)) {
  25753. if (iteratee(iterable[index], index, iterable) === false) {
  25754. break;
  25755. }
  25756. }
  25757. return collection;
  25758. };
  25759. }
  25760. /**
  25761. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  25762. *
  25763. * @private
  25764. * @param {boolean} [fromRight] Specify iterating from right to left.
  25765. * @returns {Function} Returns the new base function.
  25766. */
  25767. function createBaseFor(fromRight) {
  25768. return function(object, iteratee, keysFunc) {
  25769. var index = -1,
  25770. iterable = Object(object),
  25771. props = keysFunc(object),
  25772. length = props.length;
  25773. while (length--) {
  25774. var key = props[fromRight ? length : ++index];
  25775. if (iteratee(iterable[key], key, iterable) === false) {
  25776. break;
  25777. }
  25778. }
  25779. return object;
  25780. };
  25781. }
  25782. /**
  25783. * Creates a function that wraps `func` to invoke it with the optional `this`
  25784. * binding of `thisArg`.
  25785. *
  25786. * @private
  25787. * @param {Function} func The function to wrap.
  25788. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  25789. * @param {*} [thisArg] The `this` binding of `func`.
  25790. * @returns {Function} Returns the new wrapped function.
  25791. */
  25792. function createBind(func, bitmask, thisArg) {
  25793. var isBind = bitmask & WRAP_BIND_FLAG,
  25794. Ctor = createCtor(func);
  25795. function wrapper() {
  25796. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  25797. return fn.apply(isBind ? thisArg : this, arguments);
  25798. }
  25799. return wrapper;
  25800. }
  25801. /**
  25802. * Creates a function like `_.lowerFirst`.
  25803. *
  25804. * @private
  25805. * @param {string} methodName The name of the `String` case method to use.
  25806. * @returns {Function} Returns the new case function.
  25807. */
  25808. function createCaseFirst(methodName) {
  25809. return function(string) {
  25810. string = toString(string);
  25811. var strSymbols = hasUnicode(string)
  25812. ? stringToArray(string)
  25813. : undefined;
  25814. var chr = strSymbols
  25815. ? strSymbols[0]
  25816. : string.charAt(0);
  25817. var trailing = strSymbols
  25818. ? castSlice(strSymbols, 1).join('')
  25819. : string.slice(1);
  25820. return chr[methodName]() + trailing;
  25821. };
  25822. }
  25823. /**
  25824. * Creates a function like `_.camelCase`.
  25825. *
  25826. * @private
  25827. * @param {Function} callback The function to combine each word.
  25828. * @returns {Function} Returns the new compounder function.
  25829. */
  25830. function createCompounder(callback) {
  25831. return function(string) {
  25832. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  25833. };
  25834. }
  25835. /**
  25836. * Creates a function that produces an instance of `Ctor` regardless of
  25837. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  25838. *
  25839. * @private
  25840. * @param {Function} Ctor The constructor to wrap.
  25841. * @returns {Function} Returns the new wrapped function.
  25842. */
  25843. function createCtor(Ctor) {
  25844. return function() {
  25845. // Use a `switch` statement to work with class constructors. See
  25846. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  25847. // for more details.
  25848. var args = arguments;
  25849. switch (args.length) {
  25850. case 0: return new Ctor;
  25851. case 1: return new Ctor(args[0]);
  25852. case 2: return new Ctor(args[0], args[1]);
  25853. case 3: return new Ctor(args[0], args[1], args[2]);
  25854. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  25855. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  25856. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  25857. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  25858. }
  25859. var thisBinding = baseCreate(Ctor.prototype),
  25860. result = Ctor.apply(thisBinding, args);
  25861. // Mimic the constructor's `return` behavior.
  25862. // See https://es5.github.io/#x13.2.2 for more details.
  25863. return isObject(result) ? result : thisBinding;
  25864. };
  25865. }
  25866. /**
  25867. * Creates a function that wraps `func` to enable currying.
  25868. *
  25869. * @private
  25870. * @param {Function} func The function to wrap.
  25871. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  25872. * @param {number} arity The arity of `func`.
  25873. * @returns {Function} Returns the new wrapped function.
  25874. */
  25875. function createCurry(func, bitmask, arity) {
  25876. var Ctor = createCtor(func);
  25877. function wrapper() {
  25878. var length = arguments.length,
  25879. args = Array(length),
  25880. index = length,
  25881. placeholder = getHolder(wrapper);
  25882. while (index--) {
  25883. args[index] = arguments[index];
  25884. }
  25885. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  25886. ? []
  25887. : replaceHolders(args, placeholder);
  25888. length -= holders.length;
  25889. if (length < arity) {
  25890. return createRecurry(
  25891. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  25892. args, holders, undefined, undefined, arity - length);
  25893. }
  25894. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  25895. return apply(fn, this, args);
  25896. }
  25897. return wrapper;
  25898. }
  25899. /**
  25900. * Creates a `_.find` or `_.findLast` function.
  25901. *
  25902. * @private
  25903. * @param {Function} findIndexFunc The function to find the collection index.
  25904. * @returns {Function} Returns the new find function.
  25905. */
  25906. function createFind(findIndexFunc) {
  25907. return function(collection, predicate, fromIndex) {
  25908. var iterable = Object(collection);
  25909. if (!isArrayLike(collection)) {
  25910. var iteratee = getIteratee(predicate, 3);
  25911. collection = keys(collection);
  25912. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  25913. }
  25914. var index = findIndexFunc(collection, predicate, fromIndex);
  25915. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  25916. };
  25917. }
  25918. /**
  25919. * Creates a `_.flow` or `_.flowRight` function.
  25920. *
  25921. * @private
  25922. * @param {boolean} [fromRight] Specify iterating from right to left.
  25923. * @returns {Function} Returns the new flow function.
  25924. */
  25925. function createFlow(fromRight) {
  25926. return flatRest(function(funcs) {
  25927. var length = funcs.length,
  25928. index = length,
  25929. prereq = LodashWrapper.prototype.thru;
  25930. if (fromRight) {
  25931. funcs.reverse();
  25932. }
  25933. while (index--) {
  25934. var func = funcs[index];
  25935. if (typeof func != 'function') {
  25936. throw new TypeError(FUNC_ERROR_TEXT);
  25937. }
  25938. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  25939. var wrapper = new LodashWrapper([], true);
  25940. }
  25941. }
  25942. index = wrapper ? index : length;
  25943. while (++index < length) {
  25944. func = funcs[index];
  25945. var funcName = getFuncName(func),
  25946. data = funcName == 'wrapper' ? getData(func) : undefined;
  25947. if (data && isLaziable(data[0]) &&
  25948. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  25949. !data[4].length && data[9] == 1
  25950. ) {
  25951. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  25952. } else {
  25953. wrapper = (func.length == 1 && isLaziable(func))
  25954. ? wrapper[funcName]()
  25955. : wrapper.thru(func);
  25956. }
  25957. }
  25958. return function() {
  25959. var args = arguments,
  25960. value = args[0];
  25961. if (wrapper && args.length == 1 && isArray(value)) {
  25962. return wrapper.plant(value).value();
  25963. }
  25964. var index = 0,
  25965. result = length ? funcs[index].apply(this, args) : value;
  25966. while (++index < length) {
  25967. result = funcs[index].call(this, result);
  25968. }
  25969. return result;
  25970. };
  25971. });
  25972. }
  25973. /**
  25974. * Creates a function that wraps `func` to invoke it with optional `this`
  25975. * binding of `thisArg`, partial application, and currying.
  25976. *
  25977. * @private
  25978. * @param {Function|string} func The function or method name to wrap.
  25979. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  25980. * @param {*} [thisArg] The `this` binding of `func`.
  25981. * @param {Array} [partials] The arguments to prepend to those provided to
  25982. * the new function.
  25983. * @param {Array} [holders] The `partials` placeholder indexes.
  25984. * @param {Array} [partialsRight] The arguments to append to those provided
  25985. * to the new function.
  25986. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  25987. * @param {Array} [argPos] The argument positions of the new function.
  25988. * @param {number} [ary] The arity cap of `func`.
  25989. * @param {number} [arity] The arity of `func`.
  25990. * @returns {Function} Returns the new wrapped function.
  25991. */
  25992. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  25993. var isAry = bitmask & WRAP_ARY_FLAG,
  25994. isBind = bitmask & WRAP_BIND_FLAG,
  25995. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  25996. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  25997. isFlip = bitmask & WRAP_FLIP_FLAG,
  25998. Ctor = isBindKey ? undefined : createCtor(func);
  25999. function wrapper() {
  26000. var length = arguments.length,
  26001. args = Array(length),
  26002. index = length;
  26003. while (index--) {
  26004. args[index] = arguments[index];
  26005. }
  26006. if (isCurried) {
  26007. var placeholder = getHolder(wrapper),
  26008. holdersCount = countHolders(args, placeholder);
  26009. }
  26010. if (partials) {
  26011. args = composeArgs(args, partials, holders, isCurried);
  26012. }
  26013. if (partialsRight) {
  26014. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  26015. }
  26016. length -= holdersCount;
  26017. if (isCurried && length < arity) {
  26018. var newHolders = replaceHolders(args, placeholder);
  26019. return createRecurry(
  26020. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  26021. args, newHolders, argPos, ary, arity - length
  26022. );
  26023. }
  26024. var thisBinding = isBind ? thisArg : this,
  26025. fn = isBindKey ? thisBinding[func] : func;
  26026. length = args.length;
  26027. if (argPos) {
  26028. args = reorder(args, argPos);
  26029. } else if (isFlip && length > 1) {
  26030. args.reverse();
  26031. }
  26032. if (isAry && ary < length) {
  26033. args.length = ary;
  26034. }
  26035. if (this && this !== root && this instanceof wrapper) {
  26036. fn = Ctor || createCtor(fn);
  26037. }
  26038. return fn.apply(thisBinding, args);
  26039. }
  26040. return wrapper;
  26041. }
  26042. /**
  26043. * Creates a function like `_.invertBy`.
  26044. *
  26045. * @private
  26046. * @param {Function} setter The function to set accumulator values.
  26047. * @param {Function} toIteratee The function to resolve iteratees.
  26048. * @returns {Function} Returns the new inverter function.
  26049. */
  26050. function createInverter(setter, toIteratee) {
  26051. return function(object, iteratee) {
  26052. return baseInverter(object, setter, toIteratee(iteratee), {});
  26053. };
  26054. }
  26055. /**
  26056. * Creates a function that performs a mathematical operation on two values.
  26057. *
  26058. * @private
  26059. * @param {Function} operator The function to perform the operation.
  26060. * @param {number} [defaultValue] The value used for `undefined` arguments.
  26061. * @returns {Function} Returns the new mathematical operation function.
  26062. */
  26063. function createMathOperation(operator, defaultValue) {
  26064. return function(value, other) {
  26065. var result;
  26066. if (value === undefined && other === undefined) {
  26067. return defaultValue;
  26068. }
  26069. if (value !== undefined) {
  26070. result = value;
  26071. }
  26072. if (other !== undefined) {
  26073. if (result === undefined) {
  26074. return other;
  26075. }
  26076. if (typeof value == 'string' || typeof other == 'string') {
  26077. value = baseToString(value);
  26078. other = baseToString(other);
  26079. } else {
  26080. value = baseToNumber(value);
  26081. other = baseToNumber(other);
  26082. }
  26083. result = operator(value, other);
  26084. }
  26085. return result;
  26086. };
  26087. }
  26088. /**
  26089. * Creates a function like `_.over`.
  26090. *
  26091. * @private
  26092. * @param {Function} arrayFunc The function to iterate over iteratees.
  26093. * @returns {Function} Returns the new over function.
  26094. */
  26095. function createOver(arrayFunc) {
  26096. return flatRest(function(iteratees) {
  26097. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  26098. return baseRest(function(args) {
  26099. var thisArg = this;
  26100. return arrayFunc(iteratees, function(iteratee) {
  26101. return apply(iteratee, thisArg, args);
  26102. });
  26103. });
  26104. });
  26105. }
  26106. /**
  26107. * Creates the padding for `string` based on `length`. The `chars` string
  26108. * is truncated if the number of characters exceeds `length`.
  26109. *
  26110. * @private
  26111. * @param {number} length The padding length.
  26112. * @param {string} [chars=' '] The string used as padding.
  26113. * @returns {string} Returns the padding for `string`.
  26114. */
  26115. function createPadding(length, chars) {
  26116. chars = chars === undefined ? ' ' : baseToString(chars);
  26117. var charsLength = chars.length;
  26118. if (charsLength < 2) {
  26119. return charsLength ? baseRepeat(chars, length) : chars;
  26120. }
  26121. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  26122. return hasUnicode(chars)
  26123. ? castSlice(stringToArray(result), 0, length).join('')
  26124. : result.slice(0, length);
  26125. }
  26126. /**
  26127. * Creates a function that wraps `func` to invoke it with the `this` binding
  26128. * of `thisArg` and `partials` prepended to the arguments it receives.
  26129. *
  26130. * @private
  26131. * @param {Function} func The function to wrap.
  26132. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  26133. * @param {*} thisArg The `this` binding of `func`.
  26134. * @param {Array} partials The arguments to prepend to those provided to
  26135. * the new function.
  26136. * @returns {Function} Returns the new wrapped function.
  26137. */
  26138. function createPartial(func, bitmask, thisArg, partials) {
  26139. var isBind = bitmask & WRAP_BIND_FLAG,
  26140. Ctor = createCtor(func);
  26141. function wrapper() {
  26142. var argsIndex = -1,
  26143. argsLength = arguments.length,
  26144. leftIndex = -1,
  26145. leftLength = partials.length,
  26146. args = Array(leftLength + argsLength),
  26147. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  26148. while (++leftIndex < leftLength) {
  26149. args[leftIndex] = partials[leftIndex];
  26150. }
  26151. while (argsLength--) {
  26152. args[leftIndex++] = arguments[++argsIndex];
  26153. }
  26154. return apply(fn, isBind ? thisArg : this, args);
  26155. }
  26156. return wrapper;
  26157. }
  26158. /**
  26159. * Creates a `_.range` or `_.rangeRight` function.
  26160. *
  26161. * @private
  26162. * @param {boolean} [fromRight] Specify iterating from right to left.
  26163. * @returns {Function} Returns the new range function.
  26164. */
  26165. function createRange(fromRight) {
  26166. return function(start, end, step) {
  26167. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  26168. end = step = undefined;
  26169. }
  26170. // Ensure the sign of `-0` is preserved.
  26171. start = toFinite(start);
  26172. if (end === undefined) {
  26173. end = start;
  26174. start = 0;
  26175. } else {
  26176. end = toFinite(end);
  26177. }
  26178. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  26179. return baseRange(start, end, step, fromRight);
  26180. };
  26181. }
  26182. /**
  26183. * Creates a function that performs a relational operation on two values.
  26184. *
  26185. * @private
  26186. * @param {Function} operator The function to perform the operation.
  26187. * @returns {Function} Returns the new relational operation function.
  26188. */
  26189. function createRelationalOperation(operator) {
  26190. return function(value, other) {
  26191. if (!(typeof value == 'string' && typeof other == 'string')) {
  26192. value = toNumber(value);
  26193. other = toNumber(other);
  26194. }
  26195. return operator(value, other);
  26196. };
  26197. }
  26198. /**
  26199. * Creates a function that wraps `func` to continue currying.
  26200. *
  26201. * @private
  26202. * @param {Function} func The function to wrap.
  26203. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  26204. * @param {Function} wrapFunc The function to create the `func` wrapper.
  26205. * @param {*} placeholder The placeholder value.
  26206. * @param {*} [thisArg] The `this` binding of `func`.
  26207. * @param {Array} [partials] The arguments to prepend to those provided to
  26208. * the new function.
  26209. * @param {Array} [holders] The `partials` placeholder indexes.
  26210. * @param {Array} [argPos] The argument positions of the new function.
  26211. * @param {number} [ary] The arity cap of `func`.
  26212. * @param {number} [arity] The arity of `func`.
  26213. * @returns {Function} Returns the new wrapped function.
  26214. */
  26215. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  26216. var isCurry = bitmask & WRAP_CURRY_FLAG,
  26217. newHolders = isCurry ? holders : undefined,
  26218. newHoldersRight = isCurry ? undefined : holders,
  26219. newPartials = isCurry ? partials : undefined,
  26220. newPartialsRight = isCurry ? undefined : partials;
  26221. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  26222. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  26223. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  26224. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  26225. }
  26226. var newData = [
  26227. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  26228. newHoldersRight, argPos, ary, arity
  26229. ];
  26230. var result = wrapFunc.apply(undefined, newData);
  26231. if (isLaziable(func)) {
  26232. setData(result, newData);
  26233. }
  26234. result.placeholder = placeholder;
  26235. return setWrapToString(result, func, bitmask);
  26236. }
  26237. /**
  26238. * Creates a function like `_.round`.
  26239. *
  26240. * @private
  26241. * @param {string} methodName The name of the `Math` method to use when rounding.
  26242. * @returns {Function} Returns the new round function.
  26243. */
  26244. function createRound(methodName) {
  26245. var func = Math[methodName];
  26246. return function(number, precision) {
  26247. number = toNumber(number);
  26248. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  26249. if (precision && nativeIsFinite(number)) {
  26250. // Shift with exponential notation to avoid floating-point issues.
  26251. // See [MDN](https://mdn.io/round#Examples) for more details.
  26252. var pair = (toString(number) + 'e').split('e'),
  26253. value = func(pair[0] + 'e' + (+pair[1] + precision));
  26254. pair = (toString(value) + 'e').split('e');
  26255. return +(pair[0] + 'e' + (+pair[1] - precision));
  26256. }
  26257. return func(number);
  26258. };
  26259. }
  26260. /**
  26261. * Creates a set object of `values`.
  26262. *
  26263. * @private
  26264. * @param {Array} values The values to add to the set.
  26265. * @returns {Object} Returns the new set.
  26266. */
  26267. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  26268. return new Set(values);
  26269. };
  26270. /**
  26271. * Creates a `_.toPairs` or `_.toPairsIn` function.
  26272. *
  26273. * @private
  26274. * @param {Function} keysFunc The function to get the keys of a given object.
  26275. * @returns {Function} Returns the new pairs function.
  26276. */
  26277. function createToPairs(keysFunc) {
  26278. return function(object) {
  26279. var tag = getTag(object);
  26280. if (tag == mapTag) {
  26281. return mapToArray(object);
  26282. }
  26283. if (tag == setTag) {
  26284. return setToPairs(object);
  26285. }
  26286. return baseToPairs(object, keysFunc(object));
  26287. };
  26288. }
  26289. /**
  26290. * Creates a function that either curries or invokes `func` with optional
  26291. * `this` binding and partially applied arguments.
  26292. *
  26293. * @private
  26294. * @param {Function|string} func The function or method name to wrap.
  26295. * @param {number} bitmask The bitmask flags.
  26296. * 1 - `_.bind`
  26297. * 2 - `_.bindKey`
  26298. * 4 - `_.curry` or `_.curryRight` of a bound function
  26299. * 8 - `_.curry`
  26300. * 16 - `_.curryRight`
  26301. * 32 - `_.partial`
  26302. * 64 - `_.partialRight`
  26303. * 128 - `_.rearg`
  26304. * 256 - `_.ary`
  26305. * 512 - `_.flip`
  26306. * @param {*} [thisArg] The `this` binding of `func`.
  26307. * @param {Array} [partials] The arguments to be partially applied.
  26308. * @param {Array} [holders] The `partials` placeholder indexes.
  26309. * @param {Array} [argPos] The argument positions of the new function.
  26310. * @param {number} [ary] The arity cap of `func`.
  26311. * @param {number} [arity] The arity of `func`.
  26312. * @returns {Function} Returns the new wrapped function.
  26313. */
  26314. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  26315. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  26316. if (!isBindKey && typeof func != 'function') {
  26317. throw new TypeError(FUNC_ERROR_TEXT);
  26318. }
  26319. var length = partials ? partials.length : 0;
  26320. if (!length) {
  26321. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  26322. partials = holders = undefined;
  26323. }
  26324. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  26325. arity = arity === undefined ? arity : toInteger(arity);
  26326. length -= holders ? holders.length : 0;
  26327. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  26328. var partialsRight = partials,
  26329. holdersRight = holders;
  26330. partials = holders = undefined;
  26331. }
  26332. var data = isBindKey ? undefined : getData(func);
  26333. var newData = [
  26334. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  26335. argPos, ary, arity
  26336. ];
  26337. if (data) {
  26338. mergeData(newData, data);
  26339. }
  26340. func = newData[0];
  26341. bitmask = newData[1];
  26342. thisArg = newData[2];
  26343. partials = newData[3];
  26344. holders = newData[4];
  26345. arity = newData[9] = newData[9] === undefined
  26346. ? (isBindKey ? 0 : func.length)
  26347. : nativeMax(newData[9] - length, 0);
  26348. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  26349. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  26350. }
  26351. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  26352. var result = createBind(func, bitmask, thisArg);
  26353. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  26354. result = createCurry(func, bitmask, arity);
  26355. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  26356. result = createPartial(func, bitmask, thisArg, partials);
  26357. } else {
  26358. result = createHybrid.apply(undefined, newData);
  26359. }
  26360. var setter = data ? baseSetData : setData;
  26361. return setWrapToString(setter(result, newData), func, bitmask);
  26362. }
  26363. /**
  26364. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  26365. * of source objects to the destination object for all destination properties
  26366. * that resolve to `undefined`.
  26367. *
  26368. * @private
  26369. * @param {*} objValue The destination value.
  26370. * @param {*} srcValue The source value.
  26371. * @param {string} key The key of the property to assign.
  26372. * @param {Object} object The parent object of `objValue`.
  26373. * @returns {*} Returns the value to assign.
  26374. */
  26375. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  26376. if (objValue === undefined ||
  26377. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  26378. return srcValue;
  26379. }
  26380. return objValue;
  26381. }
  26382. /**
  26383. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  26384. * objects into destination objects that are passed thru.
  26385. *
  26386. * @private
  26387. * @param {*} objValue The destination value.
  26388. * @param {*} srcValue The source value.
  26389. * @param {string} key The key of the property to merge.
  26390. * @param {Object} object The parent object of `objValue`.
  26391. * @param {Object} source The parent object of `srcValue`.
  26392. * @param {Object} [stack] Tracks traversed source values and their merged
  26393. * counterparts.
  26394. * @returns {*} Returns the value to assign.
  26395. */
  26396. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  26397. if (isObject(objValue) && isObject(srcValue)) {
  26398. // Recursively merge objects and arrays (susceptible to call stack limits).
  26399. stack.set(srcValue, objValue);
  26400. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  26401. stack['delete'](srcValue);
  26402. }
  26403. return objValue;
  26404. }
  26405. /**
  26406. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  26407. * objects.
  26408. *
  26409. * @private
  26410. * @param {*} value The value to inspect.
  26411. * @param {string} key The key of the property to inspect.
  26412. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  26413. */
  26414. function customOmitClone(value) {
  26415. return isPlainObject(value) ? undefined : value;
  26416. }
  26417. /**
  26418. * A specialized version of `baseIsEqualDeep` for arrays with support for
  26419. * partial deep comparisons.
  26420. *
  26421. * @private
  26422. * @param {Array} array The array to compare.
  26423. * @param {Array} other The other array to compare.
  26424. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  26425. * @param {Function} customizer The function to customize comparisons.
  26426. * @param {Function} equalFunc The function to determine equivalents of values.
  26427. * @param {Object} stack Tracks traversed `array` and `other` objects.
  26428. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  26429. */
  26430. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  26431. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  26432. arrLength = array.length,
  26433. othLength = other.length;
  26434. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  26435. return false;
  26436. }
  26437. // Check that cyclic values are equal.
  26438. var arrStacked = stack.get(array);
  26439. var othStacked = stack.get(other);
  26440. if (arrStacked && othStacked) {
  26441. return arrStacked == other && othStacked == array;
  26442. }
  26443. var index = -1,
  26444. result = true,
  26445. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  26446. stack.set(array, other);
  26447. stack.set(other, array);
  26448. // Ignore non-index properties.
  26449. while (++index < arrLength) {
  26450. var arrValue = array[index],
  26451. othValue = other[index];
  26452. if (customizer) {
  26453. var compared = isPartial
  26454. ? customizer(othValue, arrValue, index, other, array, stack)
  26455. : customizer(arrValue, othValue, index, array, other, stack);
  26456. }
  26457. if (compared !== undefined) {
  26458. if (compared) {
  26459. continue;
  26460. }
  26461. result = false;
  26462. break;
  26463. }
  26464. // Recursively compare arrays (susceptible to call stack limits).
  26465. if (seen) {
  26466. if (!arraySome(other, function(othValue, othIndex) {
  26467. if (!cacheHas(seen, othIndex) &&
  26468. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  26469. return seen.push(othIndex);
  26470. }
  26471. })) {
  26472. result = false;
  26473. break;
  26474. }
  26475. } else if (!(
  26476. arrValue === othValue ||
  26477. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  26478. )) {
  26479. result = false;
  26480. break;
  26481. }
  26482. }
  26483. stack['delete'](array);
  26484. stack['delete'](other);
  26485. return result;
  26486. }
  26487. /**
  26488. * A specialized version of `baseIsEqualDeep` for comparing objects of
  26489. * the same `toStringTag`.
  26490. *
  26491. * **Note:** This function only supports comparing values with tags of
  26492. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  26493. *
  26494. * @private
  26495. * @param {Object} object The object to compare.
  26496. * @param {Object} other The other object to compare.
  26497. * @param {string} tag The `toStringTag` of the objects to compare.
  26498. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  26499. * @param {Function} customizer The function to customize comparisons.
  26500. * @param {Function} equalFunc The function to determine equivalents of values.
  26501. * @param {Object} stack Tracks traversed `object` and `other` objects.
  26502. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  26503. */
  26504. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  26505. switch (tag) {
  26506. case dataViewTag:
  26507. if ((object.byteLength != other.byteLength) ||
  26508. (object.byteOffset != other.byteOffset)) {
  26509. return false;
  26510. }
  26511. object = object.buffer;
  26512. other = other.buffer;
  26513. case arrayBufferTag:
  26514. if ((object.byteLength != other.byteLength) ||
  26515. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  26516. return false;
  26517. }
  26518. return true;
  26519. case boolTag:
  26520. case dateTag:
  26521. case numberTag:
  26522. // Coerce booleans to `1` or `0` and dates to milliseconds.
  26523. // Invalid dates are coerced to `NaN`.
  26524. return eq(+object, +other);
  26525. case errorTag:
  26526. return object.name == other.name && object.message == other.message;
  26527. case regexpTag:
  26528. case stringTag:
  26529. // Coerce regexes to strings and treat strings, primitives and objects,
  26530. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  26531. // for more details.
  26532. return object == (other + '');
  26533. case mapTag:
  26534. var convert = mapToArray;
  26535. case setTag:
  26536. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  26537. convert || (convert = setToArray);
  26538. if (object.size != other.size && !isPartial) {
  26539. return false;
  26540. }
  26541. // Assume cyclic values are equal.
  26542. var stacked = stack.get(object);
  26543. if (stacked) {
  26544. return stacked == other;
  26545. }
  26546. bitmask |= COMPARE_UNORDERED_FLAG;
  26547. // Recursively compare objects (susceptible to call stack limits).
  26548. stack.set(object, other);
  26549. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  26550. stack['delete'](object);
  26551. return result;
  26552. case symbolTag:
  26553. if (symbolValueOf) {
  26554. return symbolValueOf.call(object) == symbolValueOf.call(other);
  26555. }
  26556. }
  26557. return false;
  26558. }
  26559. /**
  26560. * A specialized version of `baseIsEqualDeep` for objects with support for
  26561. * partial deep comparisons.
  26562. *
  26563. * @private
  26564. * @param {Object} object The object to compare.
  26565. * @param {Object} other The other object to compare.
  26566. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  26567. * @param {Function} customizer The function to customize comparisons.
  26568. * @param {Function} equalFunc The function to determine equivalents of values.
  26569. * @param {Object} stack Tracks traversed `object` and `other` objects.
  26570. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  26571. */
  26572. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  26573. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  26574. objProps = getAllKeys(object),
  26575. objLength = objProps.length,
  26576. othProps = getAllKeys(other),
  26577. othLength = othProps.length;
  26578. if (objLength != othLength && !isPartial) {
  26579. return false;
  26580. }
  26581. var index = objLength;
  26582. while (index--) {
  26583. var key = objProps[index];
  26584. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  26585. return false;
  26586. }
  26587. }
  26588. // Check that cyclic values are equal.
  26589. var objStacked = stack.get(object);
  26590. var othStacked = stack.get(other);
  26591. if (objStacked && othStacked) {
  26592. return objStacked == other && othStacked == object;
  26593. }
  26594. var result = true;
  26595. stack.set(object, other);
  26596. stack.set(other, object);
  26597. var skipCtor = isPartial;
  26598. while (++index < objLength) {
  26599. key = objProps[index];
  26600. var objValue = object[key],
  26601. othValue = other[key];
  26602. if (customizer) {
  26603. var compared = isPartial
  26604. ? customizer(othValue, objValue, key, other, object, stack)
  26605. : customizer(objValue, othValue, key, object, other, stack);
  26606. }
  26607. // Recursively compare objects (susceptible to call stack limits).
  26608. if (!(compared === undefined
  26609. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  26610. : compared
  26611. )) {
  26612. result = false;
  26613. break;
  26614. }
  26615. skipCtor || (skipCtor = key == 'constructor');
  26616. }
  26617. if (result && !skipCtor) {
  26618. var objCtor = object.constructor,
  26619. othCtor = other.constructor;
  26620. // Non `Object` object instances with different constructors are not equal.
  26621. if (objCtor != othCtor &&
  26622. ('constructor' in object && 'constructor' in other) &&
  26623. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  26624. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  26625. result = false;
  26626. }
  26627. }
  26628. stack['delete'](object);
  26629. stack['delete'](other);
  26630. return result;
  26631. }
  26632. /**
  26633. * A specialized version of `baseRest` which flattens the rest array.
  26634. *
  26635. * @private
  26636. * @param {Function} func The function to apply a rest parameter to.
  26637. * @returns {Function} Returns the new function.
  26638. */
  26639. function flatRest(func) {
  26640. return setToString(overRest(func, undefined, flatten), func + '');
  26641. }
  26642. /**
  26643. * Creates an array of own enumerable property names and symbols of `object`.
  26644. *
  26645. * @private
  26646. * @param {Object} object The object to query.
  26647. * @returns {Array} Returns the array of property names and symbols.
  26648. */
  26649. function getAllKeys(object) {
  26650. return baseGetAllKeys(object, keys, getSymbols);
  26651. }
  26652. /**
  26653. * Creates an array of own and inherited enumerable property names and
  26654. * symbols of `object`.
  26655. *
  26656. * @private
  26657. * @param {Object} object The object to query.
  26658. * @returns {Array} Returns the array of property names and symbols.
  26659. */
  26660. function getAllKeysIn(object) {
  26661. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  26662. }
  26663. /**
  26664. * Gets metadata for `func`.
  26665. *
  26666. * @private
  26667. * @param {Function} func The function to query.
  26668. * @returns {*} Returns the metadata for `func`.
  26669. */
  26670. var getData = !metaMap ? noop : function(func) {
  26671. return metaMap.get(func);
  26672. };
  26673. /**
  26674. * Gets the name of `func`.
  26675. *
  26676. * @private
  26677. * @param {Function} func The function to query.
  26678. * @returns {string} Returns the function name.
  26679. */
  26680. function getFuncName(func) {
  26681. var result = (func.name + ''),
  26682. array = realNames[result],
  26683. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  26684. while (length--) {
  26685. var data = array[length],
  26686. otherFunc = data.func;
  26687. if (otherFunc == null || otherFunc == func) {
  26688. return data.name;
  26689. }
  26690. }
  26691. return result;
  26692. }
  26693. /**
  26694. * Gets the argument placeholder value for `func`.
  26695. *
  26696. * @private
  26697. * @param {Function} func The function to inspect.
  26698. * @returns {*} Returns the placeholder value.
  26699. */
  26700. function getHolder(func) {
  26701. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  26702. return object.placeholder;
  26703. }
  26704. /**
  26705. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  26706. * this function returns the custom method, otherwise it returns `baseIteratee`.
  26707. * If arguments are provided, the chosen function is invoked with them and
  26708. * its result is returned.
  26709. *
  26710. * @private
  26711. * @param {*} [value] The value to convert to an iteratee.
  26712. * @param {number} [arity] The arity of the created iteratee.
  26713. * @returns {Function} Returns the chosen function or its result.
  26714. */
  26715. function getIteratee() {
  26716. var result = lodash.iteratee || iteratee;
  26717. result = result === iteratee ? baseIteratee : result;
  26718. return arguments.length ? result(arguments[0], arguments[1]) : result;
  26719. }
  26720. /**
  26721. * Gets the data for `map`.
  26722. *
  26723. * @private
  26724. * @param {Object} map The map to query.
  26725. * @param {string} key The reference key.
  26726. * @returns {*} Returns the map data.
  26727. */
  26728. function getMapData(map, key) {
  26729. var data = map.__data__;
  26730. return isKeyable(key)
  26731. ? data[typeof key == 'string' ? 'string' : 'hash']
  26732. : data.map;
  26733. }
  26734. /**
  26735. * Gets the property names, values, and compare flags of `object`.
  26736. *
  26737. * @private
  26738. * @param {Object} object The object to query.
  26739. * @returns {Array} Returns the match data of `object`.
  26740. */
  26741. function getMatchData(object) {
  26742. var result = keys(object),
  26743. length = result.length;
  26744. while (length--) {
  26745. var key = result[length],
  26746. value = object[key];
  26747. result[length] = [key, value, isStrictComparable(value)];
  26748. }
  26749. return result;
  26750. }
  26751. /**
  26752. * Gets the native function at `key` of `object`.
  26753. *
  26754. * @private
  26755. * @param {Object} object The object to query.
  26756. * @param {string} key The key of the method to get.
  26757. * @returns {*} Returns the function if it's native, else `undefined`.
  26758. */
  26759. function getNative(object, key) {
  26760. var value = getValue(object, key);
  26761. return baseIsNative(value) ? value : undefined;
  26762. }
  26763. /**
  26764. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  26765. *
  26766. * @private
  26767. * @param {*} value The value to query.
  26768. * @returns {string} Returns the raw `toStringTag`.
  26769. */
  26770. function getRawTag(value) {
  26771. var isOwn = hasOwnProperty.call(value, symToStringTag),
  26772. tag = value[symToStringTag];
  26773. try {
  26774. value[symToStringTag] = undefined;
  26775. var unmasked = true;
  26776. } catch (e) {}
  26777. var result = nativeObjectToString.call(value);
  26778. if (unmasked) {
  26779. if (isOwn) {
  26780. value[symToStringTag] = tag;
  26781. } else {
  26782. delete value[symToStringTag];
  26783. }
  26784. }
  26785. return result;
  26786. }
  26787. /**
  26788. * Creates an array of the own enumerable symbols of `object`.
  26789. *
  26790. * @private
  26791. * @param {Object} object The object to query.
  26792. * @returns {Array} Returns the array of symbols.
  26793. */
  26794. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  26795. if (object == null) {
  26796. return [];
  26797. }
  26798. object = Object(object);
  26799. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  26800. return propertyIsEnumerable.call(object, symbol);
  26801. });
  26802. };
  26803. /**
  26804. * Creates an array of the own and inherited enumerable symbols of `object`.
  26805. *
  26806. * @private
  26807. * @param {Object} object The object to query.
  26808. * @returns {Array} Returns the array of symbols.
  26809. */
  26810. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  26811. var result = [];
  26812. while (object) {
  26813. arrayPush(result, getSymbols(object));
  26814. object = getPrototype(object);
  26815. }
  26816. return result;
  26817. };
  26818. /**
  26819. * Gets the `toStringTag` of `value`.
  26820. *
  26821. * @private
  26822. * @param {*} value The value to query.
  26823. * @returns {string} Returns the `toStringTag`.
  26824. */
  26825. var getTag = baseGetTag;
  26826. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  26827. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  26828. (Map && getTag(new Map) != mapTag) ||
  26829. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  26830. (Set && getTag(new Set) != setTag) ||
  26831. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  26832. getTag = function(value) {
  26833. var result = baseGetTag(value),
  26834. Ctor = result == objectTag ? value.constructor : undefined,
  26835. ctorString = Ctor ? toSource(Ctor) : '';
  26836. if (ctorString) {
  26837. switch (ctorString) {
  26838. case dataViewCtorString: return dataViewTag;
  26839. case mapCtorString: return mapTag;
  26840. case promiseCtorString: return promiseTag;
  26841. case setCtorString: return setTag;
  26842. case weakMapCtorString: return weakMapTag;
  26843. }
  26844. }
  26845. return result;
  26846. };
  26847. }
  26848. /**
  26849. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  26850. *
  26851. * @private
  26852. * @param {number} start The start of the view.
  26853. * @param {number} end The end of the view.
  26854. * @param {Array} transforms The transformations to apply to the view.
  26855. * @returns {Object} Returns an object containing the `start` and `end`
  26856. * positions of the view.
  26857. */
  26858. function getView(start, end, transforms) {
  26859. var index = -1,
  26860. length = transforms.length;
  26861. while (++index < length) {
  26862. var data = transforms[index],
  26863. size = data.size;
  26864. switch (data.type) {
  26865. case 'drop': start += size; break;
  26866. case 'dropRight': end -= size; break;
  26867. case 'take': end = nativeMin(end, start + size); break;
  26868. case 'takeRight': start = nativeMax(start, end - size); break;
  26869. }
  26870. }
  26871. return { 'start': start, 'end': end };
  26872. }
  26873. /**
  26874. * Extracts wrapper details from the `source` body comment.
  26875. *
  26876. * @private
  26877. * @param {string} source The source to inspect.
  26878. * @returns {Array} Returns the wrapper details.
  26879. */
  26880. function getWrapDetails(source) {
  26881. var match = source.match(reWrapDetails);
  26882. return match ? match[1].split(reSplitDetails) : [];
  26883. }
  26884. /**
  26885. * Checks if `path` exists on `object`.
  26886. *
  26887. * @private
  26888. * @param {Object} object The object to query.
  26889. * @param {Array|string} path The path to check.
  26890. * @param {Function} hasFunc The function to check properties.
  26891. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  26892. */
  26893. function hasPath(object, path, hasFunc) {
  26894. path = castPath(path, object);
  26895. var index = -1,
  26896. length = path.length,
  26897. result = false;
  26898. while (++index < length) {
  26899. var key = toKey(path[index]);
  26900. if (!(result = object != null && hasFunc(object, key))) {
  26901. break;
  26902. }
  26903. object = object[key];
  26904. }
  26905. if (result || ++index != length) {
  26906. return result;
  26907. }
  26908. length = object == null ? 0 : object.length;
  26909. return !!length && isLength(length) && isIndex(key, length) &&
  26910. (isArray(object) || isArguments(object));
  26911. }
  26912. /**
  26913. * Initializes an array clone.
  26914. *
  26915. * @private
  26916. * @param {Array} array The array to clone.
  26917. * @returns {Array} Returns the initialized clone.
  26918. */
  26919. function initCloneArray(array) {
  26920. var length = array.length,
  26921. result = new array.constructor(length);
  26922. // Add properties assigned by `RegExp#exec`.
  26923. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  26924. result.index = array.index;
  26925. result.input = array.input;
  26926. }
  26927. return result;
  26928. }
  26929. /**
  26930. * Initializes an object clone.
  26931. *
  26932. * @private
  26933. * @param {Object} object The object to clone.
  26934. * @returns {Object} Returns the initialized clone.
  26935. */
  26936. function initCloneObject(object) {
  26937. return (typeof object.constructor == 'function' && !isPrototype(object))
  26938. ? baseCreate(getPrototype(object))
  26939. : {};
  26940. }
  26941. /**
  26942. * Initializes an object clone based on its `toStringTag`.
  26943. *
  26944. * **Note:** This function only supports cloning values with tags of
  26945. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  26946. *
  26947. * @private
  26948. * @param {Object} object The object to clone.
  26949. * @param {string} tag The `toStringTag` of the object to clone.
  26950. * @param {boolean} [isDeep] Specify a deep clone.
  26951. * @returns {Object} Returns the initialized clone.
  26952. */
  26953. function initCloneByTag(object, tag, isDeep) {
  26954. var Ctor = object.constructor;
  26955. switch (tag) {
  26956. case arrayBufferTag:
  26957. return cloneArrayBuffer(object);
  26958. case boolTag:
  26959. case dateTag:
  26960. return new Ctor(+object);
  26961. case dataViewTag:
  26962. return cloneDataView(object, isDeep);
  26963. case float32Tag: case float64Tag:
  26964. case int8Tag: case int16Tag: case int32Tag:
  26965. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  26966. return cloneTypedArray(object, isDeep);
  26967. case mapTag:
  26968. return new Ctor;
  26969. case numberTag:
  26970. case stringTag:
  26971. return new Ctor(object);
  26972. case regexpTag:
  26973. return cloneRegExp(object);
  26974. case setTag:
  26975. return new Ctor;
  26976. case symbolTag:
  26977. return cloneSymbol(object);
  26978. }
  26979. }
  26980. /**
  26981. * Inserts wrapper `details` in a comment at the top of the `source` body.
  26982. *
  26983. * @private
  26984. * @param {string} source The source to modify.
  26985. * @returns {Array} details The details to insert.
  26986. * @returns {string} Returns the modified source.
  26987. */
  26988. function insertWrapDetails(source, details) {
  26989. var length = details.length;
  26990. if (!length) {
  26991. return source;
  26992. }
  26993. var lastIndex = length - 1;
  26994. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  26995. details = details.join(length > 2 ? ', ' : ' ');
  26996. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  26997. }
  26998. /**
  26999. * Checks if `value` is a flattenable `arguments` object or array.
  27000. *
  27001. * @private
  27002. * @param {*} value The value to check.
  27003. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  27004. */
  27005. function isFlattenable(value) {
  27006. return isArray(value) || isArguments(value) ||
  27007. !!(spreadableSymbol && value && value[spreadableSymbol]);
  27008. }
  27009. /**
  27010. * Checks if `value` is a valid array-like index.
  27011. *
  27012. * @private
  27013. * @param {*} value The value to check.
  27014. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  27015. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  27016. */
  27017. function isIndex(value, length) {
  27018. var type = typeof value;
  27019. length = length == null ? MAX_SAFE_INTEGER : length;
  27020. return !!length &&
  27021. (type == 'number' ||
  27022. (type != 'symbol' && reIsUint.test(value))) &&
  27023. (value > -1 && value % 1 == 0 && value < length);
  27024. }
  27025. /**
  27026. * Checks if the given arguments are from an iteratee call.
  27027. *
  27028. * @private
  27029. * @param {*} value The potential iteratee value argument.
  27030. * @param {*} index The potential iteratee index or key argument.
  27031. * @param {*} object The potential iteratee object argument.
  27032. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  27033. * else `false`.
  27034. */
  27035. function isIterateeCall(value, index, object) {
  27036. if (!isObject(object)) {
  27037. return false;
  27038. }
  27039. var type = typeof index;
  27040. if (type == 'number'
  27041. ? (isArrayLike(object) && isIndex(index, object.length))
  27042. : (type == 'string' && index in object)
  27043. ) {
  27044. return eq(object[index], value);
  27045. }
  27046. return false;
  27047. }
  27048. /**
  27049. * Checks if `value` is a property name and not a property path.
  27050. *
  27051. * @private
  27052. * @param {*} value The value to check.
  27053. * @param {Object} [object] The object to query keys on.
  27054. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  27055. */
  27056. function isKey(value, object) {
  27057. if (isArray(value)) {
  27058. return false;
  27059. }
  27060. var type = typeof value;
  27061. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  27062. value == null || isSymbol(value)) {
  27063. return true;
  27064. }
  27065. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  27066. (object != null && value in Object(object));
  27067. }
  27068. /**
  27069. * Checks if `value` is suitable for use as unique object key.
  27070. *
  27071. * @private
  27072. * @param {*} value The value to check.
  27073. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  27074. */
  27075. function isKeyable(value) {
  27076. var type = typeof value;
  27077. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  27078. ? (value !== '__proto__')
  27079. : (value === null);
  27080. }
  27081. /**
  27082. * Checks if `func` has a lazy counterpart.
  27083. *
  27084. * @private
  27085. * @param {Function} func The function to check.
  27086. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  27087. * else `false`.
  27088. */
  27089. function isLaziable(func) {
  27090. var funcName = getFuncName(func),
  27091. other = lodash[funcName];
  27092. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  27093. return false;
  27094. }
  27095. if (func === other) {
  27096. return true;
  27097. }
  27098. var data = getData(other);
  27099. return !!data && func === data[0];
  27100. }
  27101. /**
  27102. * Checks if `func` has its source masked.
  27103. *
  27104. * @private
  27105. * @param {Function} func The function to check.
  27106. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  27107. */
  27108. function isMasked(func) {
  27109. return !!maskSrcKey && (maskSrcKey in func);
  27110. }
  27111. /**
  27112. * Checks if `func` is capable of being masked.
  27113. *
  27114. * @private
  27115. * @param {*} value The value to check.
  27116. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  27117. */
  27118. var isMaskable = coreJsData ? isFunction : stubFalse;
  27119. /**
  27120. * Checks if `value` is likely a prototype object.
  27121. *
  27122. * @private
  27123. * @param {*} value The value to check.
  27124. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  27125. */
  27126. function isPrototype(value) {
  27127. var Ctor = value && value.constructor,
  27128. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  27129. return value === proto;
  27130. }
  27131. /**
  27132. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  27133. *
  27134. * @private
  27135. * @param {*} value The value to check.
  27136. * @returns {boolean} Returns `true` if `value` if suitable for strict
  27137. * equality comparisons, else `false`.
  27138. */
  27139. function isStrictComparable(value) {
  27140. return value === value && !isObject(value);
  27141. }
  27142. /**
  27143. * A specialized version of `matchesProperty` for source values suitable
  27144. * for strict equality comparisons, i.e. `===`.
  27145. *
  27146. * @private
  27147. * @param {string} key The key of the property to get.
  27148. * @param {*} srcValue The value to match.
  27149. * @returns {Function} Returns the new spec function.
  27150. */
  27151. function matchesStrictComparable(key, srcValue) {
  27152. return function(object) {
  27153. if (object == null) {
  27154. return false;
  27155. }
  27156. return object[key] === srcValue &&
  27157. (srcValue !== undefined || (key in Object(object)));
  27158. };
  27159. }
  27160. /**
  27161. * A specialized version of `_.memoize` which clears the memoized function's
  27162. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  27163. *
  27164. * @private
  27165. * @param {Function} func The function to have its output memoized.
  27166. * @returns {Function} Returns the new memoized function.
  27167. */
  27168. function memoizeCapped(func) {
  27169. var result = memoize(func, function(key) {
  27170. if (cache.size === MAX_MEMOIZE_SIZE) {
  27171. cache.clear();
  27172. }
  27173. return key;
  27174. });
  27175. var cache = result.cache;
  27176. return result;
  27177. }
  27178. /**
  27179. * Merges the function metadata of `source` into `data`.
  27180. *
  27181. * Merging metadata reduces the number of wrappers used to invoke a function.
  27182. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  27183. * may be applied regardless of execution order. Methods like `_.ary` and
  27184. * `_.rearg` modify function arguments, making the order in which they are
  27185. * executed important, preventing the merging of metadata. However, we make
  27186. * an exception for a safe combined case where curried functions have `_.ary`
  27187. * and or `_.rearg` applied.
  27188. *
  27189. * @private
  27190. * @param {Array} data The destination metadata.
  27191. * @param {Array} source The source metadata.
  27192. * @returns {Array} Returns `data`.
  27193. */
  27194. function mergeData(data, source) {
  27195. var bitmask = data[1],
  27196. srcBitmask = source[1],
  27197. newBitmask = bitmask | srcBitmask,
  27198. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  27199. var isCombo =
  27200. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  27201. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  27202. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  27203. // Exit early if metadata can't be merged.
  27204. if (!(isCommon || isCombo)) {
  27205. return data;
  27206. }
  27207. // Use source `thisArg` if available.
  27208. if (srcBitmask & WRAP_BIND_FLAG) {
  27209. data[2] = source[2];
  27210. // Set when currying a bound function.
  27211. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  27212. }
  27213. // Compose partial arguments.
  27214. var value = source[3];
  27215. if (value) {
  27216. var partials = data[3];
  27217. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  27218. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  27219. }
  27220. // Compose partial right arguments.
  27221. value = source[5];
  27222. if (value) {
  27223. partials = data[5];
  27224. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  27225. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  27226. }
  27227. // Use source `argPos` if available.
  27228. value = source[7];
  27229. if (value) {
  27230. data[7] = value;
  27231. }
  27232. // Use source `ary` if it's smaller.
  27233. if (srcBitmask & WRAP_ARY_FLAG) {
  27234. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  27235. }
  27236. // Use source `arity` if one is not provided.
  27237. if (data[9] == null) {
  27238. data[9] = source[9];
  27239. }
  27240. // Use source `func` and merge bitmasks.
  27241. data[0] = source[0];
  27242. data[1] = newBitmask;
  27243. return data;
  27244. }
  27245. /**
  27246. * This function is like
  27247. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  27248. * except that it includes inherited enumerable properties.
  27249. *
  27250. * @private
  27251. * @param {Object} object The object to query.
  27252. * @returns {Array} Returns the array of property names.
  27253. */
  27254. function nativeKeysIn(object) {
  27255. var result = [];
  27256. if (object != null) {
  27257. for (var key in Object(object)) {
  27258. result.push(key);
  27259. }
  27260. }
  27261. return result;
  27262. }
  27263. /**
  27264. * Converts `value` to a string using `Object.prototype.toString`.
  27265. *
  27266. * @private
  27267. * @param {*} value The value to convert.
  27268. * @returns {string} Returns the converted string.
  27269. */
  27270. function objectToString(value) {
  27271. return nativeObjectToString.call(value);
  27272. }
  27273. /**
  27274. * A specialized version of `baseRest` which transforms the rest array.
  27275. *
  27276. * @private
  27277. * @param {Function} func The function to apply a rest parameter to.
  27278. * @param {number} [start=func.length-1] The start position of the rest parameter.
  27279. * @param {Function} transform The rest array transform.
  27280. * @returns {Function} Returns the new function.
  27281. */
  27282. function overRest(func, start, transform) {
  27283. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  27284. return function() {
  27285. var args = arguments,
  27286. index = -1,
  27287. length = nativeMax(args.length - start, 0),
  27288. array = Array(length);
  27289. while (++index < length) {
  27290. array[index] = args[start + index];
  27291. }
  27292. index = -1;
  27293. var otherArgs = Array(start + 1);
  27294. while (++index < start) {
  27295. otherArgs[index] = args[index];
  27296. }
  27297. otherArgs[start] = transform(array);
  27298. return apply(func, this, otherArgs);
  27299. };
  27300. }
  27301. /**
  27302. * Gets the parent value at `path` of `object`.
  27303. *
  27304. * @private
  27305. * @param {Object} object The object to query.
  27306. * @param {Array} path The path to get the parent value of.
  27307. * @returns {*} Returns the parent value.
  27308. */
  27309. function parent(object, path) {
  27310. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  27311. }
  27312. /**
  27313. * Reorder `array` according to the specified indexes where the element at
  27314. * the first index is assigned as the first element, the element at
  27315. * the second index is assigned as the second element, and so on.
  27316. *
  27317. * @private
  27318. * @param {Array} array The array to reorder.
  27319. * @param {Array} indexes The arranged array indexes.
  27320. * @returns {Array} Returns `array`.
  27321. */
  27322. function reorder(array, indexes) {
  27323. var arrLength = array.length,
  27324. length = nativeMin(indexes.length, arrLength),
  27325. oldArray = copyArray(array);
  27326. while (length--) {
  27327. var index = indexes[length];
  27328. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  27329. }
  27330. return array;
  27331. }
  27332. /**
  27333. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  27334. *
  27335. * @private
  27336. * @param {Object} object The object to query.
  27337. * @param {string} key The key of the property to get.
  27338. * @returns {*} Returns the property value.
  27339. */
  27340. function safeGet(object, key) {
  27341. if (key === 'constructor' && typeof object[key] === 'function') {
  27342. return;
  27343. }
  27344. if (key == '__proto__') {
  27345. return;
  27346. }
  27347. return object[key];
  27348. }
  27349. /**
  27350. * Sets metadata for `func`.
  27351. *
  27352. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  27353. * period of time, it will trip its breaker and transition to an identity
  27354. * function to avoid garbage collection pauses in V8. See
  27355. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  27356. * for more details.
  27357. *
  27358. * @private
  27359. * @param {Function} func The function to associate metadata with.
  27360. * @param {*} data The metadata.
  27361. * @returns {Function} Returns `func`.
  27362. */
  27363. var setData = shortOut(baseSetData);
  27364. /**
  27365. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  27366. *
  27367. * @private
  27368. * @param {Function} func The function to delay.
  27369. * @param {number} wait The number of milliseconds to delay invocation.
  27370. * @returns {number|Object} Returns the timer id or timeout object.
  27371. */
  27372. var setTimeout = ctxSetTimeout || function(func, wait) {
  27373. return root.setTimeout(func, wait);
  27374. };
  27375. /**
  27376. * Sets the `toString` method of `func` to return `string`.
  27377. *
  27378. * @private
  27379. * @param {Function} func The function to modify.
  27380. * @param {Function} string The `toString` result.
  27381. * @returns {Function} Returns `func`.
  27382. */
  27383. var setToString = shortOut(baseSetToString);
  27384. /**
  27385. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  27386. * with wrapper details in a comment at the top of the source body.
  27387. *
  27388. * @private
  27389. * @param {Function} wrapper The function to modify.
  27390. * @param {Function} reference The reference function.
  27391. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  27392. * @returns {Function} Returns `wrapper`.
  27393. */
  27394. function setWrapToString(wrapper, reference, bitmask) {
  27395. var source = (reference + '');
  27396. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  27397. }
  27398. /**
  27399. * Creates a function that'll short out and invoke `identity` instead
  27400. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  27401. * milliseconds.
  27402. *
  27403. * @private
  27404. * @param {Function} func The function to restrict.
  27405. * @returns {Function} Returns the new shortable function.
  27406. */
  27407. function shortOut(func) {
  27408. var count = 0,
  27409. lastCalled = 0;
  27410. return function() {
  27411. var stamp = nativeNow(),
  27412. remaining = HOT_SPAN - (stamp - lastCalled);
  27413. lastCalled = stamp;
  27414. if (remaining > 0) {
  27415. if (++count >= HOT_COUNT) {
  27416. return arguments[0];
  27417. }
  27418. } else {
  27419. count = 0;
  27420. }
  27421. return func.apply(undefined, arguments);
  27422. };
  27423. }
  27424. /**
  27425. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  27426. *
  27427. * @private
  27428. * @param {Array} array The array to shuffle.
  27429. * @param {number} [size=array.length] The size of `array`.
  27430. * @returns {Array} Returns `array`.
  27431. */
  27432. function shuffleSelf(array, size) {
  27433. var index = -1,
  27434. length = array.length,
  27435. lastIndex = length - 1;
  27436. size = size === undefined ? length : size;
  27437. while (++index < size) {
  27438. var rand = baseRandom(index, lastIndex),
  27439. value = array[rand];
  27440. array[rand] = array[index];
  27441. array[index] = value;
  27442. }
  27443. array.length = size;
  27444. return array;
  27445. }
  27446. /**
  27447. * Converts `string` to a property path array.
  27448. *
  27449. * @private
  27450. * @param {string} string The string to convert.
  27451. * @returns {Array} Returns the property path array.
  27452. */
  27453. var stringToPath = memoizeCapped(function(string) {
  27454. var result = [];
  27455. if (string.charCodeAt(0) === 46 /* . */) {
  27456. result.push('');
  27457. }
  27458. string.replace(rePropName, function(match, number, quote, subString) {
  27459. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  27460. });
  27461. return result;
  27462. });
  27463. /**
  27464. * Converts `value` to a string key if it's not a string or symbol.
  27465. *
  27466. * @private
  27467. * @param {*} value The value to inspect.
  27468. * @returns {string|symbol} Returns the key.
  27469. */
  27470. function toKey(value) {
  27471. if (typeof value == 'string' || isSymbol(value)) {
  27472. return value;
  27473. }
  27474. var result = (value + '');
  27475. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  27476. }
  27477. /**
  27478. * Converts `func` to its source code.
  27479. *
  27480. * @private
  27481. * @param {Function} func The function to convert.
  27482. * @returns {string} Returns the source code.
  27483. */
  27484. function toSource(func) {
  27485. if (func != null) {
  27486. try {
  27487. return funcToString.call(func);
  27488. } catch (e) {}
  27489. try {
  27490. return (func + '');
  27491. } catch (e) {}
  27492. }
  27493. return '';
  27494. }
  27495. /**
  27496. * Updates wrapper `details` based on `bitmask` flags.
  27497. *
  27498. * @private
  27499. * @returns {Array} details The details to modify.
  27500. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  27501. * @returns {Array} Returns `details`.
  27502. */
  27503. function updateWrapDetails(details, bitmask) {
  27504. arrayEach(wrapFlags, function(pair) {
  27505. var value = '_.' + pair[0];
  27506. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  27507. details.push(value);
  27508. }
  27509. });
  27510. return details.sort();
  27511. }
  27512. /**
  27513. * Creates a clone of `wrapper`.
  27514. *
  27515. * @private
  27516. * @param {Object} wrapper The wrapper to clone.
  27517. * @returns {Object} Returns the cloned wrapper.
  27518. */
  27519. function wrapperClone(wrapper) {
  27520. if (wrapper instanceof LazyWrapper) {
  27521. return wrapper.clone();
  27522. }
  27523. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  27524. result.__actions__ = copyArray(wrapper.__actions__);
  27525. result.__index__ = wrapper.__index__;
  27526. result.__values__ = wrapper.__values__;
  27527. return result;
  27528. }
  27529. /*------------------------------------------------------------------------*/
  27530. /**
  27531. * Creates an array of elements split into groups the length of `size`.
  27532. * If `array` can't be split evenly, the final chunk will be the remaining
  27533. * elements.
  27534. *
  27535. * @static
  27536. * @memberOf _
  27537. * @since 3.0.0
  27538. * @category Array
  27539. * @param {Array} array The array to process.
  27540. * @param {number} [size=1] The length of each chunk
  27541. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  27542. * @returns {Array} Returns the new array of chunks.
  27543. * @example
  27544. *
  27545. * _.chunk(['a', 'b', 'c', 'd'], 2);
  27546. * // => [['a', 'b'], ['c', 'd']]
  27547. *
  27548. * _.chunk(['a', 'b', 'c', 'd'], 3);
  27549. * // => [['a', 'b', 'c'], ['d']]
  27550. */
  27551. function chunk(array, size, guard) {
  27552. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  27553. size = 1;
  27554. } else {
  27555. size = nativeMax(toInteger(size), 0);
  27556. }
  27557. var length = array == null ? 0 : array.length;
  27558. if (!length || size < 1) {
  27559. return [];
  27560. }
  27561. var index = 0,
  27562. resIndex = 0,
  27563. result = Array(nativeCeil(length / size));
  27564. while (index < length) {
  27565. result[resIndex++] = baseSlice(array, index, (index += size));
  27566. }
  27567. return result;
  27568. }
  27569. /**
  27570. * Creates an array with all falsey values removed. The values `false`, `null`,
  27571. * `0`, `""`, `undefined`, and `NaN` are falsey.
  27572. *
  27573. * @static
  27574. * @memberOf _
  27575. * @since 0.1.0
  27576. * @category Array
  27577. * @param {Array} array The array to compact.
  27578. * @returns {Array} Returns the new array of filtered values.
  27579. * @example
  27580. *
  27581. * _.compact([0, 1, false, 2, '', 3]);
  27582. * // => [1, 2, 3]
  27583. */
  27584. function compact(array) {
  27585. var index = -1,
  27586. length = array == null ? 0 : array.length,
  27587. resIndex = 0,
  27588. result = [];
  27589. while (++index < length) {
  27590. var value = array[index];
  27591. if (value) {
  27592. result[resIndex++] = value;
  27593. }
  27594. }
  27595. return result;
  27596. }
  27597. /**
  27598. * Creates a new array concatenating `array` with any additional arrays
  27599. * and/or values.
  27600. *
  27601. * @static
  27602. * @memberOf _
  27603. * @since 4.0.0
  27604. * @category Array
  27605. * @param {Array} array The array to concatenate.
  27606. * @param {...*} [values] The values to concatenate.
  27607. * @returns {Array} Returns the new concatenated array.
  27608. * @example
  27609. *
  27610. * var array = [1];
  27611. * var other = _.concat(array, 2, [3], [[4]]);
  27612. *
  27613. * console.log(other);
  27614. * // => [1, 2, 3, [4]]
  27615. *
  27616. * console.log(array);
  27617. * // => [1]
  27618. */
  27619. function concat() {
  27620. var length = arguments.length;
  27621. if (!length) {
  27622. return [];
  27623. }
  27624. var args = Array(length - 1),
  27625. array = arguments[0],
  27626. index = length;
  27627. while (index--) {
  27628. args[index - 1] = arguments[index];
  27629. }
  27630. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  27631. }
  27632. /**
  27633. * Creates an array of `array` values not included in the other given arrays
  27634. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  27635. * for equality comparisons. The order and references of result values are
  27636. * determined by the first array.
  27637. *
  27638. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  27639. *
  27640. * @static
  27641. * @memberOf _
  27642. * @since 0.1.0
  27643. * @category Array
  27644. * @param {Array} array The array to inspect.
  27645. * @param {...Array} [values] The values to exclude.
  27646. * @returns {Array} Returns the new array of filtered values.
  27647. * @see _.without, _.xor
  27648. * @example
  27649. *
  27650. * _.difference([2, 1], [2, 3]);
  27651. * // => [1]
  27652. */
  27653. var difference = baseRest(function(array, values) {
  27654. return isArrayLikeObject(array)
  27655. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  27656. : [];
  27657. });
  27658. /**
  27659. * This method is like `_.difference` except that it accepts `iteratee` which
  27660. * is invoked for each element of `array` and `values` to generate the criterion
  27661. * by which they're compared. The order and references of result values are
  27662. * determined by the first array. The iteratee is invoked with one argument:
  27663. * (value).
  27664. *
  27665. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  27666. *
  27667. * @static
  27668. * @memberOf _
  27669. * @since 4.0.0
  27670. * @category Array
  27671. * @param {Array} array The array to inspect.
  27672. * @param {...Array} [values] The values to exclude.
  27673. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  27674. * @returns {Array} Returns the new array of filtered values.
  27675. * @example
  27676. *
  27677. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  27678. * // => [1.2]
  27679. *
  27680. * // The `_.property` iteratee shorthand.
  27681. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  27682. * // => [{ 'x': 2 }]
  27683. */
  27684. var differenceBy = baseRest(function(array, values) {
  27685. var iteratee = last(values);
  27686. if (isArrayLikeObject(iteratee)) {
  27687. iteratee = undefined;
  27688. }
  27689. return isArrayLikeObject(array)
  27690. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  27691. : [];
  27692. });
  27693. /**
  27694. * This method is like `_.difference` except that it accepts `comparator`
  27695. * which is invoked to compare elements of `array` to `values`. The order and
  27696. * references of result values are determined by the first array. The comparator
  27697. * is invoked with two arguments: (arrVal, othVal).
  27698. *
  27699. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  27700. *
  27701. * @static
  27702. * @memberOf _
  27703. * @since 4.0.0
  27704. * @category Array
  27705. * @param {Array} array The array to inspect.
  27706. * @param {...Array} [values] The values to exclude.
  27707. * @param {Function} [comparator] The comparator invoked per element.
  27708. * @returns {Array} Returns the new array of filtered values.
  27709. * @example
  27710. *
  27711. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  27712. *
  27713. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  27714. * // => [{ 'x': 2, 'y': 1 }]
  27715. */
  27716. var differenceWith = baseRest(function(array, values) {
  27717. var comparator = last(values);
  27718. if (isArrayLikeObject(comparator)) {
  27719. comparator = undefined;
  27720. }
  27721. return isArrayLikeObject(array)
  27722. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  27723. : [];
  27724. });
  27725. /**
  27726. * Creates a slice of `array` with `n` elements dropped from the beginning.
  27727. *
  27728. * @static
  27729. * @memberOf _
  27730. * @since 0.5.0
  27731. * @category Array
  27732. * @param {Array} array The array to query.
  27733. * @param {number} [n=1] The number of elements to drop.
  27734. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  27735. * @returns {Array} Returns the slice of `array`.
  27736. * @example
  27737. *
  27738. * _.drop([1, 2, 3]);
  27739. * // => [2, 3]
  27740. *
  27741. * _.drop([1, 2, 3], 2);
  27742. * // => [3]
  27743. *
  27744. * _.drop([1, 2, 3], 5);
  27745. * // => []
  27746. *
  27747. * _.drop([1, 2, 3], 0);
  27748. * // => [1, 2, 3]
  27749. */
  27750. function drop(array, n, guard) {
  27751. var length = array == null ? 0 : array.length;
  27752. if (!length) {
  27753. return [];
  27754. }
  27755. n = (guard || n === undefined) ? 1 : toInteger(n);
  27756. return baseSlice(array, n < 0 ? 0 : n, length);
  27757. }
  27758. /**
  27759. * Creates a slice of `array` with `n` elements dropped from the end.
  27760. *
  27761. * @static
  27762. * @memberOf _
  27763. * @since 3.0.0
  27764. * @category Array
  27765. * @param {Array} array The array to query.
  27766. * @param {number} [n=1] The number of elements to drop.
  27767. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  27768. * @returns {Array} Returns the slice of `array`.
  27769. * @example
  27770. *
  27771. * _.dropRight([1, 2, 3]);
  27772. * // => [1, 2]
  27773. *
  27774. * _.dropRight([1, 2, 3], 2);
  27775. * // => [1]
  27776. *
  27777. * _.dropRight([1, 2, 3], 5);
  27778. * // => []
  27779. *
  27780. * _.dropRight([1, 2, 3], 0);
  27781. * // => [1, 2, 3]
  27782. */
  27783. function dropRight(array, n, guard) {
  27784. var length = array == null ? 0 : array.length;
  27785. if (!length) {
  27786. return [];
  27787. }
  27788. n = (guard || n === undefined) ? 1 : toInteger(n);
  27789. n = length - n;
  27790. return baseSlice(array, 0, n < 0 ? 0 : n);
  27791. }
  27792. /**
  27793. * Creates a slice of `array` excluding elements dropped from the end.
  27794. * Elements are dropped until `predicate` returns falsey. The predicate is
  27795. * invoked with three arguments: (value, index, array).
  27796. *
  27797. * @static
  27798. * @memberOf _
  27799. * @since 3.0.0
  27800. * @category Array
  27801. * @param {Array} array The array to query.
  27802. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  27803. * @returns {Array} Returns the slice of `array`.
  27804. * @example
  27805. *
  27806. * var users = [
  27807. * { 'user': 'barney', 'active': true },
  27808. * { 'user': 'fred', 'active': false },
  27809. * { 'user': 'pebbles', 'active': false }
  27810. * ];
  27811. *
  27812. * _.dropRightWhile(users, function(o) { return !o.active; });
  27813. * // => objects for ['barney']
  27814. *
  27815. * // The `_.matches` iteratee shorthand.
  27816. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  27817. * // => objects for ['barney', 'fred']
  27818. *
  27819. * // The `_.matchesProperty` iteratee shorthand.
  27820. * _.dropRightWhile(users, ['active', false]);
  27821. * // => objects for ['barney']
  27822. *
  27823. * // The `_.property` iteratee shorthand.
  27824. * _.dropRightWhile(users, 'active');
  27825. * // => objects for ['barney', 'fred', 'pebbles']
  27826. */
  27827. function dropRightWhile(array, predicate) {
  27828. return (array && array.length)
  27829. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  27830. : [];
  27831. }
  27832. /**
  27833. * Creates a slice of `array` excluding elements dropped from the beginning.
  27834. * Elements are dropped until `predicate` returns falsey. The predicate is
  27835. * invoked with three arguments: (value, index, array).
  27836. *
  27837. * @static
  27838. * @memberOf _
  27839. * @since 3.0.0
  27840. * @category Array
  27841. * @param {Array} array The array to query.
  27842. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  27843. * @returns {Array} Returns the slice of `array`.
  27844. * @example
  27845. *
  27846. * var users = [
  27847. * { 'user': 'barney', 'active': false },
  27848. * { 'user': 'fred', 'active': false },
  27849. * { 'user': 'pebbles', 'active': true }
  27850. * ];
  27851. *
  27852. * _.dropWhile(users, function(o) { return !o.active; });
  27853. * // => objects for ['pebbles']
  27854. *
  27855. * // The `_.matches` iteratee shorthand.
  27856. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  27857. * // => objects for ['fred', 'pebbles']
  27858. *
  27859. * // The `_.matchesProperty` iteratee shorthand.
  27860. * _.dropWhile(users, ['active', false]);
  27861. * // => objects for ['pebbles']
  27862. *
  27863. * // The `_.property` iteratee shorthand.
  27864. * _.dropWhile(users, 'active');
  27865. * // => objects for ['barney', 'fred', 'pebbles']
  27866. */
  27867. function dropWhile(array, predicate) {
  27868. return (array && array.length)
  27869. ? baseWhile(array, getIteratee(predicate, 3), true)
  27870. : [];
  27871. }
  27872. /**
  27873. * Fills elements of `array` with `value` from `start` up to, but not
  27874. * including, `end`.
  27875. *
  27876. * **Note:** This method mutates `array`.
  27877. *
  27878. * @static
  27879. * @memberOf _
  27880. * @since 3.2.0
  27881. * @category Array
  27882. * @param {Array} array The array to fill.
  27883. * @param {*} value The value to fill `array` with.
  27884. * @param {number} [start=0] The start position.
  27885. * @param {number} [end=array.length] The end position.
  27886. * @returns {Array} Returns `array`.
  27887. * @example
  27888. *
  27889. * var array = [1, 2, 3];
  27890. *
  27891. * _.fill(array, 'a');
  27892. * console.log(array);
  27893. * // => ['a', 'a', 'a']
  27894. *
  27895. * _.fill(Array(3), 2);
  27896. * // => [2, 2, 2]
  27897. *
  27898. * _.fill([4, 6, 8, 10], '*', 1, 3);
  27899. * // => [4, '*', '*', 10]
  27900. */
  27901. function fill(array, value, start, end) {
  27902. var length = array == null ? 0 : array.length;
  27903. if (!length) {
  27904. return [];
  27905. }
  27906. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  27907. start = 0;
  27908. end = length;
  27909. }
  27910. return baseFill(array, value, start, end);
  27911. }
  27912. /**
  27913. * This method is like `_.find` except that it returns the index of the first
  27914. * element `predicate` returns truthy for instead of the element itself.
  27915. *
  27916. * @static
  27917. * @memberOf _
  27918. * @since 1.1.0
  27919. * @category Array
  27920. * @param {Array} array The array to inspect.
  27921. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  27922. * @param {number} [fromIndex=0] The index to search from.
  27923. * @returns {number} Returns the index of the found element, else `-1`.
  27924. * @example
  27925. *
  27926. * var users = [
  27927. * { 'user': 'barney', 'active': false },
  27928. * { 'user': 'fred', 'active': false },
  27929. * { 'user': 'pebbles', 'active': true }
  27930. * ];
  27931. *
  27932. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  27933. * // => 0
  27934. *
  27935. * // The `_.matches` iteratee shorthand.
  27936. * _.findIndex(users, { 'user': 'fred', 'active': false });
  27937. * // => 1
  27938. *
  27939. * // The `_.matchesProperty` iteratee shorthand.
  27940. * _.findIndex(users, ['active', false]);
  27941. * // => 0
  27942. *
  27943. * // The `_.property` iteratee shorthand.
  27944. * _.findIndex(users, 'active');
  27945. * // => 2
  27946. */
  27947. function findIndex(array, predicate, fromIndex) {
  27948. var length = array == null ? 0 : array.length;
  27949. if (!length) {
  27950. return -1;
  27951. }
  27952. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  27953. if (index < 0) {
  27954. index = nativeMax(length + index, 0);
  27955. }
  27956. return baseFindIndex(array, getIteratee(predicate, 3), index);
  27957. }
  27958. /**
  27959. * This method is like `_.findIndex` except that it iterates over elements
  27960. * of `collection` from right to left.
  27961. *
  27962. * @static
  27963. * @memberOf _
  27964. * @since 2.0.0
  27965. * @category Array
  27966. * @param {Array} array The array to inspect.
  27967. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  27968. * @param {number} [fromIndex=array.length-1] The index to search from.
  27969. * @returns {number} Returns the index of the found element, else `-1`.
  27970. * @example
  27971. *
  27972. * var users = [
  27973. * { 'user': 'barney', 'active': true },
  27974. * { 'user': 'fred', 'active': false },
  27975. * { 'user': 'pebbles', 'active': false }
  27976. * ];
  27977. *
  27978. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  27979. * // => 2
  27980. *
  27981. * // The `_.matches` iteratee shorthand.
  27982. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  27983. * // => 0
  27984. *
  27985. * // The `_.matchesProperty` iteratee shorthand.
  27986. * _.findLastIndex(users, ['active', false]);
  27987. * // => 2
  27988. *
  27989. * // The `_.property` iteratee shorthand.
  27990. * _.findLastIndex(users, 'active');
  27991. * // => 0
  27992. */
  27993. function findLastIndex(array, predicate, fromIndex) {
  27994. var length = array == null ? 0 : array.length;
  27995. if (!length) {
  27996. return -1;
  27997. }
  27998. var index = length - 1;
  27999. if (fromIndex !== undefined) {
  28000. index = toInteger(fromIndex);
  28001. index = fromIndex < 0
  28002. ? nativeMax(length + index, 0)
  28003. : nativeMin(index, length - 1);
  28004. }
  28005. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  28006. }
  28007. /**
  28008. * Flattens `array` a single level deep.
  28009. *
  28010. * @static
  28011. * @memberOf _
  28012. * @since 0.1.0
  28013. * @category Array
  28014. * @param {Array} array The array to flatten.
  28015. * @returns {Array} Returns the new flattened array.
  28016. * @example
  28017. *
  28018. * _.flatten([1, [2, [3, [4]], 5]]);
  28019. * // => [1, 2, [3, [4]], 5]
  28020. */
  28021. function flatten(array) {
  28022. var length = array == null ? 0 : array.length;
  28023. return length ? baseFlatten(array, 1) : [];
  28024. }
  28025. /**
  28026. * Recursively flattens `array`.
  28027. *
  28028. * @static
  28029. * @memberOf _
  28030. * @since 3.0.0
  28031. * @category Array
  28032. * @param {Array} array The array to flatten.
  28033. * @returns {Array} Returns the new flattened array.
  28034. * @example
  28035. *
  28036. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  28037. * // => [1, 2, 3, 4, 5]
  28038. */
  28039. function flattenDeep(array) {
  28040. var length = array == null ? 0 : array.length;
  28041. return length ? baseFlatten(array, INFINITY) : [];
  28042. }
  28043. /**
  28044. * Recursively flatten `array` up to `depth` times.
  28045. *
  28046. * @static
  28047. * @memberOf _
  28048. * @since 4.4.0
  28049. * @category Array
  28050. * @param {Array} array The array to flatten.
  28051. * @param {number} [depth=1] The maximum recursion depth.
  28052. * @returns {Array} Returns the new flattened array.
  28053. * @example
  28054. *
  28055. * var array = [1, [2, [3, [4]], 5]];
  28056. *
  28057. * _.flattenDepth(array, 1);
  28058. * // => [1, 2, [3, [4]], 5]
  28059. *
  28060. * _.flattenDepth(array, 2);
  28061. * // => [1, 2, 3, [4], 5]
  28062. */
  28063. function flattenDepth(array, depth) {
  28064. var length = array == null ? 0 : array.length;
  28065. if (!length) {
  28066. return [];
  28067. }
  28068. depth = depth === undefined ? 1 : toInteger(depth);
  28069. return baseFlatten(array, depth);
  28070. }
  28071. /**
  28072. * The inverse of `_.toPairs`; this method returns an object composed
  28073. * from key-value `pairs`.
  28074. *
  28075. * @static
  28076. * @memberOf _
  28077. * @since 4.0.0
  28078. * @category Array
  28079. * @param {Array} pairs The key-value pairs.
  28080. * @returns {Object} Returns the new object.
  28081. * @example
  28082. *
  28083. * _.fromPairs([['a', 1], ['b', 2]]);
  28084. * // => { 'a': 1, 'b': 2 }
  28085. */
  28086. function fromPairs(pairs) {
  28087. var index = -1,
  28088. length = pairs == null ? 0 : pairs.length,
  28089. result = {};
  28090. while (++index < length) {
  28091. var pair = pairs[index];
  28092. result[pair[0]] = pair[1];
  28093. }
  28094. return result;
  28095. }
  28096. /**
  28097. * Gets the first element of `array`.
  28098. *
  28099. * @static
  28100. * @memberOf _
  28101. * @since 0.1.0
  28102. * @alias first
  28103. * @category Array
  28104. * @param {Array} array The array to query.
  28105. * @returns {*} Returns the first element of `array`.
  28106. * @example
  28107. *
  28108. * _.head([1, 2, 3]);
  28109. * // => 1
  28110. *
  28111. * _.head([]);
  28112. * // => undefined
  28113. */
  28114. function head(array) {
  28115. return (array && array.length) ? array[0] : undefined;
  28116. }
  28117. /**
  28118. * Gets the index at which the first occurrence of `value` is found in `array`
  28119. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  28120. * for equality comparisons. If `fromIndex` is negative, it's used as the
  28121. * offset from the end of `array`.
  28122. *
  28123. * @static
  28124. * @memberOf _
  28125. * @since 0.1.0
  28126. * @category Array
  28127. * @param {Array} array The array to inspect.
  28128. * @param {*} value The value to search for.
  28129. * @param {number} [fromIndex=0] The index to search from.
  28130. * @returns {number} Returns the index of the matched value, else `-1`.
  28131. * @example
  28132. *
  28133. * _.indexOf([1, 2, 1, 2], 2);
  28134. * // => 1
  28135. *
  28136. * // Search from the `fromIndex`.
  28137. * _.indexOf([1, 2, 1, 2], 2, 2);
  28138. * // => 3
  28139. */
  28140. function indexOf(array, value, fromIndex) {
  28141. var length = array == null ? 0 : array.length;
  28142. if (!length) {
  28143. return -1;
  28144. }
  28145. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  28146. if (index < 0) {
  28147. index = nativeMax(length + index, 0);
  28148. }
  28149. return baseIndexOf(array, value, index);
  28150. }
  28151. /**
  28152. * Gets all but the last element of `array`.
  28153. *
  28154. * @static
  28155. * @memberOf _
  28156. * @since 0.1.0
  28157. * @category Array
  28158. * @param {Array} array The array to query.
  28159. * @returns {Array} Returns the slice of `array`.
  28160. * @example
  28161. *
  28162. * _.initial([1, 2, 3]);
  28163. * // => [1, 2]
  28164. */
  28165. function initial(array) {
  28166. var length = array == null ? 0 : array.length;
  28167. return length ? baseSlice(array, 0, -1) : [];
  28168. }
  28169. /**
  28170. * Creates an array of unique values that are included in all given arrays
  28171. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  28172. * for equality comparisons. The order and references of result values are
  28173. * determined by the first array.
  28174. *
  28175. * @static
  28176. * @memberOf _
  28177. * @since 0.1.0
  28178. * @category Array
  28179. * @param {...Array} [arrays] The arrays to inspect.
  28180. * @returns {Array} Returns the new array of intersecting values.
  28181. * @example
  28182. *
  28183. * _.intersection([2, 1], [2, 3]);
  28184. * // => [2]
  28185. */
  28186. var intersection = baseRest(function(arrays) {
  28187. var mapped = arrayMap(arrays, castArrayLikeObject);
  28188. return (mapped.length && mapped[0] === arrays[0])
  28189. ? baseIntersection(mapped)
  28190. : [];
  28191. });
  28192. /**
  28193. * This method is like `_.intersection` except that it accepts `iteratee`
  28194. * which is invoked for each element of each `arrays` to generate the criterion
  28195. * by which they're compared. The order and references of result values are
  28196. * determined by the first array. The iteratee is invoked with one argument:
  28197. * (value).
  28198. *
  28199. * @static
  28200. * @memberOf _
  28201. * @since 4.0.0
  28202. * @category Array
  28203. * @param {...Array} [arrays] The arrays to inspect.
  28204. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  28205. * @returns {Array} Returns the new array of intersecting values.
  28206. * @example
  28207. *
  28208. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  28209. * // => [2.1]
  28210. *
  28211. * // The `_.property` iteratee shorthand.
  28212. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  28213. * // => [{ 'x': 1 }]
  28214. */
  28215. var intersectionBy = baseRest(function(arrays) {
  28216. var iteratee = last(arrays),
  28217. mapped = arrayMap(arrays, castArrayLikeObject);
  28218. if (iteratee === last(mapped)) {
  28219. iteratee = undefined;
  28220. } else {
  28221. mapped.pop();
  28222. }
  28223. return (mapped.length && mapped[0] === arrays[0])
  28224. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  28225. : [];
  28226. });
  28227. /**
  28228. * This method is like `_.intersection` except that it accepts `comparator`
  28229. * which is invoked to compare elements of `arrays`. The order and references
  28230. * of result values are determined by the first array. The comparator is
  28231. * invoked with two arguments: (arrVal, othVal).
  28232. *
  28233. * @static
  28234. * @memberOf _
  28235. * @since 4.0.0
  28236. * @category Array
  28237. * @param {...Array} [arrays] The arrays to inspect.
  28238. * @param {Function} [comparator] The comparator invoked per element.
  28239. * @returns {Array} Returns the new array of intersecting values.
  28240. * @example
  28241. *
  28242. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  28243. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  28244. *
  28245. * _.intersectionWith(objects, others, _.isEqual);
  28246. * // => [{ 'x': 1, 'y': 2 }]
  28247. */
  28248. var intersectionWith = baseRest(function(arrays) {
  28249. var comparator = last(arrays),
  28250. mapped = arrayMap(arrays, castArrayLikeObject);
  28251. comparator = typeof comparator == 'function' ? comparator : undefined;
  28252. if (comparator) {
  28253. mapped.pop();
  28254. }
  28255. return (mapped.length && mapped[0] === arrays[0])
  28256. ? baseIntersection(mapped, undefined, comparator)
  28257. : [];
  28258. });
  28259. /**
  28260. * Converts all elements in `array` into a string separated by `separator`.
  28261. *
  28262. * @static
  28263. * @memberOf _
  28264. * @since 4.0.0
  28265. * @category Array
  28266. * @param {Array} array The array to convert.
  28267. * @param {string} [separator=','] The element separator.
  28268. * @returns {string} Returns the joined string.
  28269. * @example
  28270. *
  28271. * _.join(['a', 'b', 'c'], '~');
  28272. * // => 'a~b~c'
  28273. */
  28274. function join(array, separator) {
  28275. return array == null ? '' : nativeJoin.call(array, separator);
  28276. }
  28277. /**
  28278. * Gets the last element of `array`.
  28279. *
  28280. * @static
  28281. * @memberOf _
  28282. * @since 0.1.0
  28283. * @category Array
  28284. * @param {Array} array The array to query.
  28285. * @returns {*} Returns the last element of `array`.
  28286. * @example
  28287. *
  28288. * _.last([1, 2, 3]);
  28289. * // => 3
  28290. */
  28291. function last(array) {
  28292. var length = array == null ? 0 : array.length;
  28293. return length ? array[length - 1] : undefined;
  28294. }
  28295. /**
  28296. * This method is like `_.indexOf` except that it iterates over elements of
  28297. * `array` from right to left.
  28298. *
  28299. * @static
  28300. * @memberOf _
  28301. * @since 0.1.0
  28302. * @category Array
  28303. * @param {Array} array The array to inspect.
  28304. * @param {*} value The value to search for.
  28305. * @param {number} [fromIndex=array.length-1] The index to search from.
  28306. * @returns {number} Returns the index of the matched value, else `-1`.
  28307. * @example
  28308. *
  28309. * _.lastIndexOf([1, 2, 1, 2], 2);
  28310. * // => 3
  28311. *
  28312. * // Search from the `fromIndex`.
  28313. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  28314. * // => 1
  28315. */
  28316. function lastIndexOf(array, value, fromIndex) {
  28317. var length = array == null ? 0 : array.length;
  28318. if (!length) {
  28319. return -1;
  28320. }
  28321. var index = length;
  28322. if (fromIndex !== undefined) {
  28323. index = toInteger(fromIndex);
  28324. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  28325. }
  28326. return value === value
  28327. ? strictLastIndexOf(array, value, index)
  28328. : baseFindIndex(array, baseIsNaN, index, true);
  28329. }
  28330. /**
  28331. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  28332. * element from the end is returned.
  28333. *
  28334. * @static
  28335. * @memberOf _
  28336. * @since 4.11.0
  28337. * @category Array
  28338. * @param {Array} array The array to query.
  28339. * @param {number} [n=0] The index of the element to return.
  28340. * @returns {*} Returns the nth element of `array`.
  28341. * @example
  28342. *
  28343. * var array = ['a', 'b', 'c', 'd'];
  28344. *
  28345. * _.nth(array, 1);
  28346. * // => 'b'
  28347. *
  28348. * _.nth(array, -2);
  28349. * // => 'c';
  28350. */
  28351. function nth(array, n) {
  28352. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  28353. }
  28354. /**
  28355. * Removes all given values from `array` using
  28356. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  28357. * for equality comparisons.
  28358. *
  28359. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  28360. * to remove elements from an array by predicate.
  28361. *
  28362. * @static
  28363. * @memberOf _
  28364. * @since 2.0.0
  28365. * @category Array
  28366. * @param {Array} array The array to modify.
  28367. * @param {...*} [values] The values to remove.
  28368. * @returns {Array} Returns `array`.
  28369. * @example
  28370. *
  28371. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  28372. *
  28373. * _.pull(array, 'a', 'c');
  28374. * console.log(array);
  28375. * // => ['b', 'b']
  28376. */
  28377. var pull = baseRest(pullAll);
  28378. /**
  28379. * This method is like `_.pull` except that it accepts an array of values to remove.
  28380. *
  28381. * **Note:** Unlike `_.difference`, this method mutates `array`.
  28382. *
  28383. * @static
  28384. * @memberOf _
  28385. * @since 4.0.0
  28386. * @category Array
  28387. * @param {Array} array The array to modify.
  28388. * @param {Array} values The values to remove.
  28389. * @returns {Array} Returns `array`.
  28390. * @example
  28391. *
  28392. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  28393. *
  28394. * _.pullAll(array, ['a', 'c']);
  28395. * console.log(array);
  28396. * // => ['b', 'b']
  28397. */
  28398. function pullAll(array, values) {
  28399. return (array && array.length && values && values.length)
  28400. ? basePullAll(array, values)
  28401. : array;
  28402. }
  28403. /**
  28404. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  28405. * invoked for each element of `array` and `values` to generate the criterion
  28406. * by which they're compared. The iteratee is invoked with one argument: (value).
  28407. *
  28408. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  28409. *
  28410. * @static
  28411. * @memberOf _
  28412. * @since 4.0.0
  28413. * @category Array
  28414. * @param {Array} array The array to modify.
  28415. * @param {Array} values The values to remove.
  28416. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  28417. * @returns {Array} Returns `array`.
  28418. * @example
  28419. *
  28420. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  28421. *
  28422. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  28423. * console.log(array);
  28424. * // => [{ 'x': 2 }]
  28425. */
  28426. function pullAllBy(array, values, iteratee) {
  28427. return (array && array.length && values && values.length)
  28428. ? basePullAll(array, values, getIteratee(iteratee, 2))
  28429. : array;
  28430. }
  28431. /**
  28432. * This method is like `_.pullAll` except that it accepts `comparator` which
  28433. * is invoked to compare elements of `array` to `values`. The comparator is
  28434. * invoked with two arguments: (arrVal, othVal).
  28435. *
  28436. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  28437. *
  28438. * @static
  28439. * @memberOf _
  28440. * @since 4.6.0
  28441. * @category Array
  28442. * @param {Array} array The array to modify.
  28443. * @param {Array} values The values to remove.
  28444. * @param {Function} [comparator] The comparator invoked per element.
  28445. * @returns {Array} Returns `array`.
  28446. * @example
  28447. *
  28448. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  28449. *
  28450. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  28451. * console.log(array);
  28452. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  28453. */
  28454. function pullAllWith(array, values, comparator) {
  28455. return (array && array.length && values && values.length)
  28456. ? basePullAll(array, values, undefined, comparator)
  28457. : array;
  28458. }
  28459. /**
  28460. * Removes elements from `array` corresponding to `indexes` and returns an
  28461. * array of removed elements.
  28462. *
  28463. * **Note:** Unlike `_.at`, this method mutates `array`.
  28464. *
  28465. * @static
  28466. * @memberOf _
  28467. * @since 3.0.0
  28468. * @category Array
  28469. * @param {Array} array The array to modify.
  28470. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  28471. * @returns {Array} Returns the new array of removed elements.
  28472. * @example
  28473. *
  28474. * var array = ['a', 'b', 'c', 'd'];
  28475. * var pulled = _.pullAt(array, [1, 3]);
  28476. *
  28477. * console.log(array);
  28478. * // => ['a', 'c']
  28479. *
  28480. * console.log(pulled);
  28481. * // => ['b', 'd']
  28482. */
  28483. var pullAt = flatRest(function(array, indexes) {
  28484. var length = array == null ? 0 : array.length,
  28485. result = baseAt(array, indexes);
  28486. basePullAt(array, arrayMap(indexes, function(index) {
  28487. return isIndex(index, length) ? +index : index;
  28488. }).sort(compareAscending));
  28489. return result;
  28490. });
  28491. /**
  28492. * Removes all elements from `array` that `predicate` returns truthy for
  28493. * and returns an array of the removed elements. The predicate is invoked
  28494. * with three arguments: (value, index, array).
  28495. *
  28496. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  28497. * to pull elements from an array by value.
  28498. *
  28499. * @static
  28500. * @memberOf _
  28501. * @since 2.0.0
  28502. * @category Array
  28503. * @param {Array} array The array to modify.
  28504. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  28505. * @returns {Array} Returns the new array of removed elements.
  28506. * @example
  28507. *
  28508. * var array = [1, 2, 3, 4];
  28509. * var evens = _.remove(array, function(n) {
  28510. * return n % 2 == 0;
  28511. * });
  28512. *
  28513. * console.log(array);
  28514. * // => [1, 3]
  28515. *
  28516. * console.log(evens);
  28517. * // => [2, 4]
  28518. */
  28519. function remove(array, predicate) {
  28520. var result = [];
  28521. if (!(array && array.length)) {
  28522. return result;
  28523. }
  28524. var index = -1,
  28525. indexes = [],
  28526. length = array.length;
  28527. predicate = getIteratee(predicate, 3);
  28528. while (++index < length) {
  28529. var value = array[index];
  28530. if (predicate(value, index, array)) {
  28531. result.push(value);
  28532. indexes.push(index);
  28533. }
  28534. }
  28535. basePullAt(array, indexes);
  28536. return result;
  28537. }
  28538. /**
  28539. * Reverses `array` so that the first element becomes the last, the second
  28540. * element becomes the second to last, and so on.
  28541. *
  28542. * **Note:** This method mutates `array` and is based on
  28543. * [`Array#reverse`](https://mdn.io/Array/reverse).
  28544. *
  28545. * @static
  28546. * @memberOf _
  28547. * @since 4.0.0
  28548. * @category Array
  28549. * @param {Array} array The array to modify.
  28550. * @returns {Array} Returns `array`.
  28551. * @example
  28552. *
  28553. * var array = [1, 2, 3];
  28554. *
  28555. * _.reverse(array);
  28556. * // => [3, 2, 1]
  28557. *
  28558. * console.log(array);
  28559. * // => [3, 2, 1]
  28560. */
  28561. function reverse(array) {
  28562. return array == null ? array : nativeReverse.call(array);
  28563. }
  28564. /**
  28565. * Creates a slice of `array` from `start` up to, but not including, `end`.
  28566. *
  28567. * **Note:** This method is used instead of
  28568. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  28569. * returned.
  28570. *
  28571. * @static
  28572. * @memberOf _
  28573. * @since 3.0.0
  28574. * @category Array
  28575. * @param {Array} array The array to slice.
  28576. * @param {number} [start=0] The start position.
  28577. * @param {number} [end=array.length] The end position.
  28578. * @returns {Array} Returns the slice of `array`.
  28579. */
  28580. function slice(array, start, end) {
  28581. var length = array == null ? 0 : array.length;
  28582. if (!length) {
  28583. return [];
  28584. }
  28585. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  28586. start = 0;
  28587. end = length;
  28588. }
  28589. else {
  28590. start = start == null ? 0 : toInteger(start);
  28591. end = end === undefined ? length : toInteger(end);
  28592. }
  28593. return baseSlice(array, start, end);
  28594. }
  28595. /**
  28596. * Uses a binary search to determine the lowest index at which `value`
  28597. * should be inserted into `array` in order to maintain its sort order.
  28598. *
  28599. * @static
  28600. * @memberOf _
  28601. * @since 0.1.0
  28602. * @category Array
  28603. * @param {Array} array The sorted array to inspect.
  28604. * @param {*} value The value to evaluate.
  28605. * @returns {number} Returns the index at which `value` should be inserted
  28606. * into `array`.
  28607. * @example
  28608. *
  28609. * _.sortedIndex([30, 50], 40);
  28610. * // => 1
  28611. */
  28612. function sortedIndex(array, value) {
  28613. return baseSortedIndex(array, value);
  28614. }
  28615. /**
  28616. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  28617. * which is invoked for `value` and each element of `array` to compute their
  28618. * sort ranking. The iteratee is invoked with one argument: (value).
  28619. *
  28620. * @static
  28621. * @memberOf _
  28622. * @since 4.0.0
  28623. * @category Array
  28624. * @param {Array} array The sorted array to inspect.
  28625. * @param {*} value The value to evaluate.
  28626. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  28627. * @returns {number} Returns the index at which `value` should be inserted
  28628. * into `array`.
  28629. * @example
  28630. *
  28631. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  28632. *
  28633. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  28634. * // => 0
  28635. *
  28636. * // The `_.property` iteratee shorthand.
  28637. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  28638. * // => 0
  28639. */
  28640. function sortedIndexBy(array, value, iteratee) {
  28641. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  28642. }
  28643. /**
  28644. * This method is like `_.indexOf` except that it performs a binary
  28645. * search on a sorted `array`.
  28646. *
  28647. * @static
  28648. * @memberOf _
  28649. * @since 4.0.0
  28650. * @category Array
  28651. * @param {Array} array The array to inspect.
  28652. * @param {*} value The value to search for.
  28653. * @returns {number} Returns the index of the matched value, else `-1`.
  28654. * @example
  28655. *
  28656. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  28657. * // => 1
  28658. */
  28659. function sortedIndexOf(array, value) {
  28660. var length = array == null ? 0 : array.length;
  28661. if (length) {
  28662. var index = baseSortedIndex(array, value);
  28663. if (index < length && eq(array[index], value)) {
  28664. return index;
  28665. }
  28666. }
  28667. return -1;
  28668. }
  28669. /**
  28670. * This method is like `_.sortedIndex` except that it returns the highest
  28671. * index at which `value` should be inserted into `array` in order to
  28672. * maintain its sort order.
  28673. *
  28674. * @static
  28675. * @memberOf _
  28676. * @since 3.0.0
  28677. * @category Array
  28678. * @param {Array} array The sorted array to inspect.
  28679. * @param {*} value The value to evaluate.
  28680. * @returns {number} Returns the index at which `value` should be inserted
  28681. * into `array`.
  28682. * @example
  28683. *
  28684. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  28685. * // => 4
  28686. */
  28687. function sortedLastIndex(array, value) {
  28688. return baseSortedIndex(array, value, true);
  28689. }
  28690. /**
  28691. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  28692. * which is invoked for `value` and each element of `array` to compute their
  28693. * sort ranking. The iteratee is invoked with one argument: (value).
  28694. *
  28695. * @static
  28696. * @memberOf _
  28697. * @since 4.0.0
  28698. * @category Array
  28699. * @param {Array} array The sorted array to inspect.
  28700. * @param {*} value The value to evaluate.
  28701. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  28702. * @returns {number} Returns the index at which `value` should be inserted
  28703. * into `array`.
  28704. * @example
  28705. *
  28706. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  28707. *
  28708. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  28709. * // => 1
  28710. *
  28711. * // The `_.property` iteratee shorthand.
  28712. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  28713. * // => 1
  28714. */
  28715. function sortedLastIndexBy(array, value, iteratee) {
  28716. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  28717. }
  28718. /**
  28719. * This method is like `_.lastIndexOf` except that it performs a binary
  28720. * search on a sorted `array`.
  28721. *
  28722. * @static
  28723. * @memberOf _
  28724. * @since 4.0.0
  28725. * @category Array
  28726. * @param {Array} array The array to inspect.
  28727. * @param {*} value The value to search for.
  28728. * @returns {number} Returns the index of the matched value, else `-1`.
  28729. * @example
  28730. *
  28731. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  28732. * // => 3
  28733. */
  28734. function sortedLastIndexOf(array, value) {
  28735. var length = array == null ? 0 : array.length;
  28736. if (length) {
  28737. var index = baseSortedIndex(array, value, true) - 1;
  28738. if (eq(array[index], value)) {
  28739. return index;
  28740. }
  28741. }
  28742. return -1;
  28743. }
  28744. /**
  28745. * This method is like `_.uniq` except that it's designed and optimized
  28746. * for sorted arrays.
  28747. *
  28748. * @static
  28749. * @memberOf _
  28750. * @since 4.0.0
  28751. * @category Array
  28752. * @param {Array} array The array to inspect.
  28753. * @returns {Array} Returns the new duplicate free array.
  28754. * @example
  28755. *
  28756. * _.sortedUniq([1, 1, 2]);
  28757. * // => [1, 2]
  28758. */
  28759. function sortedUniq(array) {
  28760. return (array && array.length)
  28761. ? baseSortedUniq(array)
  28762. : [];
  28763. }
  28764. /**
  28765. * This method is like `_.uniqBy` except that it's designed and optimized
  28766. * for sorted arrays.
  28767. *
  28768. * @static
  28769. * @memberOf _
  28770. * @since 4.0.0
  28771. * @category Array
  28772. * @param {Array} array The array to inspect.
  28773. * @param {Function} [iteratee] The iteratee invoked per element.
  28774. * @returns {Array} Returns the new duplicate free array.
  28775. * @example
  28776. *
  28777. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  28778. * // => [1.1, 2.3]
  28779. */
  28780. function sortedUniqBy(array, iteratee) {
  28781. return (array && array.length)
  28782. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  28783. : [];
  28784. }
  28785. /**
  28786. * Gets all but the first element of `array`.
  28787. *
  28788. * @static
  28789. * @memberOf _
  28790. * @since 4.0.0
  28791. * @category Array
  28792. * @param {Array} array The array to query.
  28793. * @returns {Array} Returns the slice of `array`.
  28794. * @example
  28795. *
  28796. * _.tail([1, 2, 3]);
  28797. * // => [2, 3]
  28798. */
  28799. function tail(array) {
  28800. var length = array == null ? 0 : array.length;
  28801. return length ? baseSlice(array, 1, length) : [];
  28802. }
  28803. /**
  28804. * Creates a slice of `array` with `n` elements taken from the beginning.
  28805. *
  28806. * @static
  28807. * @memberOf _
  28808. * @since 0.1.0
  28809. * @category Array
  28810. * @param {Array} array The array to query.
  28811. * @param {number} [n=1] The number of elements to take.
  28812. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  28813. * @returns {Array} Returns the slice of `array`.
  28814. * @example
  28815. *
  28816. * _.take([1, 2, 3]);
  28817. * // => [1]
  28818. *
  28819. * _.take([1, 2, 3], 2);
  28820. * // => [1, 2]
  28821. *
  28822. * _.take([1, 2, 3], 5);
  28823. * // => [1, 2, 3]
  28824. *
  28825. * _.take([1, 2, 3], 0);
  28826. * // => []
  28827. */
  28828. function take(array, n, guard) {
  28829. if (!(array && array.length)) {
  28830. return [];
  28831. }
  28832. n = (guard || n === undefined) ? 1 : toInteger(n);
  28833. return baseSlice(array, 0, n < 0 ? 0 : n);
  28834. }
  28835. /**
  28836. * Creates a slice of `array` with `n` elements taken from the end.
  28837. *
  28838. * @static
  28839. * @memberOf _
  28840. * @since 3.0.0
  28841. * @category Array
  28842. * @param {Array} array The array to query.
  28843. * @param {number} [n=1] The number of elements to take.
  28844. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  28845. * @returns {Array} Returns the slice of `array`.
  28846. * @example
  28847. *
  28848. * _.takeRight([1, 2, 3]);
  28849. * // => [3]
  28850. *
  28851. * _.takeRight([1, 2, 3], 2);
  28852. * // => [2, 3]
  28853. *
  28854. * _.takeRight([1, 2, 3], 5);
  28855. * // => [1, 2, 3]
  28856. *
  28857. * _.takeRight([1, 2, 3], 0);
  28858. * // => []
  28859. */
  28860. function takeRight(array, n, guard) {
  28861. var length = array == null ? 0 : array.length;
  28862. if (!length) {
  28863. return [];
  28864. }
  28865. n = (guard || n === undefined) ? 1 : toInteger(n);
  28866. n = length - n;
  28867. return baseSlice(array, n < 0 ? 0 : n, length);
  28868. }
  28869. /**
  28870. * Creates a slice of `array` with elements taken from the end. Elements are
  28871. * taken until `predicate` returns falsey. The predicate is invoked with
  28872. * three arguments: (value, index, array).
  28873. *
  28874. * @static
  28875. * @memberOf _
  28876. * @since 3.0.0
  28877. * @category Array
  28878. * @param {Array} array The array to query.
  28879. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  28880. * @returns {Array} Returns the slice of `array`.
  28881. * @example
  28882. *
  28883. * var users = [
  28884. * { 'user': 'barney', 'active': true },
  28885. * { 'user': 'fred', 'active': false },
  28886. * { 'user': 'pebbles', 'active': false }
  28887. * ];
  28888. *
  28889. * _.takeRightWhile(users, function(o) { return !o.active; });
  28890. * // => objects for ['fred', 'pebbles']
  28891. *
  28892. * // The `_.matches` iteratee shorthand.
  28893. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  28894. * // => objects for ['pebbles']
  28895. *
  28896. * // The `_.matchesProperty` iteratee shorthand.
  28897. * _.takeRightWhile(users, ['active', false]);
  28898. * // => objects for ['fred', 'pebbles']
  28899. *
  28900. * // The `_.property` iteratee shorthand.
  28901. * _.takeRightWhile(users, 'active');
  28902. * // => []
  28903. */
  28904. function takeRightWhile(array, predicate) {
  28905. return (array && array.length)
  28906. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  28907. : [];
  28908. }
  28909. /**
  28910. * Creates a slice of `array` with elements taken from the beginning. Elements
  28911. * are taken until `predicate` returns falsey. The predicate is invoked with
  28912. * three arguments: (value, index, array).
  28913. *
  28914. * @static
  28915. * @memberOf _
  28916. * @since 3.0.0
  28917. * @category Array
  28918. * @param {Array} array The array to query.
  28919. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  28920. * @returns {Array} Returns the slice of `array`.
  28921. * @example
  28922. *
  28923. * var users = [
  28924. * { 'user': 'barney', 'active': false },
  28925. * { 'user': 'fred', 'active': false },
  28926. * { 'user': 'pebbles', 'active': true }
  28927. * ];
  28928. *
  28929. * _.takeWhile(users, function(o) { return !o.active; });
  28930. * // => objects for ['barney', 'fred']
  28931. *
  28932. * // The `_.matches` iteratee shorthand.
  28933. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  28934. * // => objects for ['barney']
  28935. *
  28936. * // The `_.matchesProperty` iteratee shorthand.
  28937. * _.takeWhile(users, ['active', false]);
  28938. * // => objects for ['barney', 'fred']
  28939. *
  28940. * // The `_.property` iteratee shorthand.
  28941. * _.takeWhile(users, 'active');
  28942. * // => []
  28943. */
  28944. function takeWhile(array, predicate) {
  28945. return (array && array.length)
  28946. ? baseWhile(array, getIteratee(predicate, 3))
  28947. : [];
  28948. }
  28949. /**
  28950. * Creates an array of unique values, in order, from all given arrays using
  28951. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  28952. * for equality comparisons.
  28953. *
  28954. * @static
  28955. * @memberOf _
  28956. * @since 0.1.0
  28957. * @category Array
  28958. * @param {...Array} [arrays] The arrays to inspect.
  28959. * @returns {Array} Returns the new array of combined values.
  28960. * @example
  28961. *
  28962. * _.union([2], [1, 2]);
  28963. * // => [2, 1]
  28964. */
  28965. var union = baseRest(function(arrays) {
  28966. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  28967. });
  28968. /**
  28969. * This method is like `_.union` except that it accepts `iteratee` which is
  28970. * invoked for each element of each `arrays` to generate the criterion by
  28971. * which uniqueness is computed. Result values are chosen from the first
  28972. * array in which the value occurs. The iteratee is invoked with one argument:
  28973. * (value).
  28974. *
  28975. * @static
  28976. * @memberOf _
  28977. * @since 4.0.0
  28978. * @category Array
  28979. * @param {...Array} [arrays] The arrays to inspect.
  28980. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  28981. * @returns {Array} Returns the new array of combined values.
  28982. * @example
  28983. *
  28984. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  28985. * // => [2.1, 1.2]
  28986. *
  28987. * // The `_.property` iteratee shorthand.
  28988. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  28989. * // => [{ 'x': 1 }, { 'x': 2 }]
  28990. */
  28991. var unionBy = baseRest(function(arrays) {
  28992. var iteratee = last(arrays);
  28993. if (isArrayLikeObject(iteratee)) {
  28994. iteratee = undefined;
  28995. }
  28996. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  28997. });
  28998. /**
  28999. * This method is like `_.union` except that it accepts `comparator` which
  29000. * is invoked to compare elements of `arrays`. Result values are chosen from
  29001. * the first array in which the value occurs. The comparator is invoked
  29002. * with two arguments: (arrVal, othVal).
  29003. *
  29004. * @static
  29005. * @memberOf _
  29006. * @since 4.0.0
  29007. * @category Array
  29008. * @param {...Array} [arrays] The arrays to inspect.
  29009. * @param {Function} [comparator] The comparator invoked per element.
  29010. * @returns {Array} Returns the new array of combined values.
  29011. * @example
  29012. *
  29013. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  29014. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  29015. *
  29016. * _.unionWith(objects, others, _.isEqual);
  29017. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  29018. */
  29019. var unionWith = baseRest(function(arrays) {
  29020. var comparator = last(arrays);
  29021. comparator = typeof comparator == 'function' ? comparator : undefined;
  29022. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  29023. });
  29024. /**
  29025. * Creates a duplicate-free version of an array, using
  29026. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  29027. * for equality comparisons, in which only the first occurrence of each element
  29028. * is kept. The order of result values is determined by the order they occur
  29029. * in the array.
  29030. *
  29031. * @static
  29032. * @memberOf _
  29033. * @since 0.1.0
  29034. * @category Array
  29035. * @param {Array} array The array to inspect.
  29036. * @returns {Array} Returns the new duplicate free array.
  29037. * @example
  29038. *
  29039. * _.uniq([2, 1, 2]);
  29040. * // => [2, 1]
  29041. */
  29042. function uniq(array) {
  29043. return (array && array.length) ? baseUniq(array) : [];
  29044. }
  29045. /**
  29046. * This method is like `_.uniq` except that it accepts `iteratee` which is
  29047. * invoked for each element in `array` to generate the criterion by which
  29048. * uniqueness is computed. The order of result values is determined by the
  29049. * order they occur in the array. The iteratee is invoked with one argument:
  29050. * (value).
  29051. *
  29052. * @static
  29053. * @memberOf _
  29054. * @since 4.0.0
  29055. * @category Array
  29056. * @param {Array} array The array to inspect.
  29057. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  29058. * @returns {Array} Returns the new duplicate free array.
  29059. * @example
  29060. *
  29061. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  29062. * // => [2.1, 1.2]
  29063. *
  29064. * // The `_.property` iteratee shorthand.
  29065. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  29066. * // => [{ 'x': 1 }, { 'x': 2 }]
  29067. */
  29068. function uniqBy(array, iteratee) {
  29069. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  29070. }
  29071. /**
  29072. * This method is like `_.uniq` except that it accepts `comparator` which
  29073. * is invoked to compare elements of `array`. The order of result values is
  29074. * determined by the order they occur in the array.The comparator is invoked
  29075. * with two arguments: (arrVal, othVal).
  29076. *
  29077. * @static
  29078. * @memberOf _
  29079. * @since 4.0.0
  29080. * @category Array
  29081. * @param {Array} array The array to inspect.
  29082. * @param {Function} [comparator] The comparator invoked per element.
  29083. * @returns {Array} Returns the new duplicate free array.
  29084. * @example
  29085. *
  29086. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  29087. *
  29088. * _.uniqWith(objects, _.isEqual);
  29089. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  29090. */
  29091. function uniqWith(array, comparator) {
  29092. comparator = typeof comparator == 'function' ? comparator : undefined;
  29093. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  29094. }
  29095. /**
  29096. * This method is like `_.zip` except that it accepts an array of grouped
  29097. * elements and creates an array regrouping the elements to their pre-zip
  29098. * configuration.
  29099. *
  29100. * @static
  29101. * @memberOf _
  29102. * @since 1.2.0
  29103. * @category Array
  29104. * @param {Array} array The array of grouped elements to process.
  29105. * @returns {Array} Returns the new array of regrouped elements.
  29106. * @example
  29107. *
  29108. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  29109. * // => [['a', 1, true], ['b', 2, false]]
  29110. *
  29111. * _.unzip(zipped);
  29112. * // => [['a', 'b'], [1, 2], [true, false]]
  29113. */
  29114. function unzip(array) {
  29115. if (!(array && array.length)) {
  29116. return [];
  29117. }
  29118. var length = 0;
  29119. array = arrayFilter(array, function(group) {
  29120. if (isArrayLikeObject(group)) {
  29121. length = nativeMax(group.length, length);
  29122. return true;
  29123. }
  29124. });
  29125. return baseTimes(length, function(index) {
  29126. return arrayMap(array, baseProperty(index));
  29127. });
  29128. }
  29129. /**
  29130. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  29131. * how regrouped values should be combined. The iteratee is invoked with the
  29132. * elements of each group: (...group).
  29133. *
  29134. * @static
  29135. * @memberOf _
  29136. * @since 3.8.0
  29137. * @category Array
  29138. * @param {Array} array The array of grouped elements to process.
  29139. * @param {Function} [iteratee=_.identity] The function to combine
  29140. * regrouped values.
  29141. * @returns {Array} Returns the new array of regrouped elements.
  29142. * @example
  29143. *
  29144. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  29145. * // => [[1, 10, 100], [2, 20, 200]]
  29146. *
  29147. * _.unzipWith(zipped, _.add);
  29148. * // => [3, 30, 300]
  29149. */
  29150. function unzipWith(array, iteratee) {
  29151. if (!(array && array.length)) {
  29152. return [];
  29153. }
  29154. var result = unzip(array);
  29155. if (iteratee == null) {
  29156. return result;
  29157. }
  29158. return arrayMap(result, function(group) {
  29159. return apply(iteratee, undefined, group);
  29160. });
  29161. }
  29162. /**
  29163. * Creates an array excluding all given values using
  29164. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  29165. * for equality comparisons.
  29166. *
  29167. * **Note:** Unlike `_.pull`, this method returns a new array.
  29168. *
  29169. * @static
  29170. * @memberOf _
  29171. * @since 0.1.0
  29172. * @category Array
  29173. * @param {Array} array The array to inspect.
  29174. * @param {...*} [values] The values to exclude.
  29175. * @returns {Array} Returns the new array of filtered values.
  29176. * @see _.difference, _.xor
  29177. * @example
  29178. *
  29179. * _.without([2, 1, 2, 3], 1, 2);
  29180. * // => [3]
  29181. */
  29182. var without = baseRest(function(array, values) {
  29183. return isArrayLikeObject(array)
  29184. ? baseDifference(array, values)
  29185. : [];
  29186. });
  29187. /**
  29188. * Creates an array of unique values that is the
  29189. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  29190. * of the given arrays. The order of result values is determined by the order
  29191. * they occur in the arrays.
  29192. *
  29193. * @static
  29194. * @memberOf _
  29195. * @since 2.4.0
  29196. * @category Array
  29197. * @param {...Array} [arrays] The arrays to inspect.
  29198. * @returns {Array} Returns the new array of filtered values.
  29199. * @see _.difference, _.without
  29200. * @example
  29201. *
  29202. * _.xor([2, 1], [2, 3]);
  29203. * // => [1, 3]
  29204. */
  29205. var xor = baseRest(function(arrays) {
  29206. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  29207. });
  29208. /**
  29209. * This method is like `_.xor` except that it accepts `iteratee` which is
  29210. * invoked for each element of each `arrays` to generate the criterion by
  29211. * which by which they're compared. The order of result values is determined
  29212. * by the order they occur in the arrays. The iteratee is invoked with one
  29213. * argument: (value).
  29214. *
  29215. * @static
  29216. * @memberOf _
  29217. * @since 4.0.0
  29218. * @category Array
  29219. * @param {...Array} [arrays] The arrays to inspect.
  29220. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  29221. * @returns {Array} Returns the new array of filtered values.
  29222. * @example
  29223. *
  29224. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  29225. * // => [1.2, 3.4]
  29226. *
  29227. * // The `_.property` iteratee shorthand.
  29228. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  29229. * // => [{ 'x': 2 }]
  29230. */
  29231. var xorBy = baseRest(function(arrays) {
  29232. var iteratee = last(arrays);
  29233. if (isArrayLikeObject(iteratee)) {
  29234. iteratee = undefined;
  29235. }
  29236. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  29237. });
  29238. /**
  29239. * This method is like `_.xor` except that it accepts `comparator` which is
  29240. * invoked to compare elements of `arrays`. The order of result values is
  29241. * determined by the order they occur in the arrays. The comparator is invoked
  29242. * with two arguments: (arrVal, othVal).
  29243. *
  29244. * @static
  29245. * @memberOf _
  29246. * @since 4.0.0
  29247. * @category Array
  29248. * @param {...Array} [arrays] The arrays to inspect.
  29249. * @param {Function} [comparator] The comparator invoked per element.
  29250. * @returns {Array} Returns the new array of filtered values.
  29251. * @example
  29252. *
  29253. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  29254. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  29255. *
  29256. * _.xorWith(objects, others, _.isEqual);
  29257. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  29258. */
  29259. var xorWith = baseRest(function(arrays) {
  29260. var comparator = last(arrays);
  29261. comparator = typeof comparator == 'function' ? comparator : undefined;
  29262. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  29263. });
  29264. /**
  29265. * Creates an array of grouped elements, the first of which contains the
  29266. * first elements of the given arrays, the second of which contains the
  29267. * second elements of the given arrays, and so on.
  29268. *
  29269. * @static
  29270. * @memberOf _
  29271. * @since 0.1.0
  29272. * @category Array
  29273. * @param {...Array} [arrays] The arrays to process.
  29274. * @returns {Array} Returns the new array of grouped elements.
  29275. * @example
  29276. *
  29277. * _.zip(['a', 'b'], [1, 2], [true, false]);
  29278. * // => [['a', 1, true], ['b', 2, false]]
  29279. */
  29280. var zip = baseRest(unzip);
  29281. /**
  29282. * This method is like `_.fromPairs` except that it accepts two arrays,
  29283. * one of property identifiers and one of corresponding values.
  29284. *
  29285. * @static
  29286. * @memberOf _
  29287. * @since 0.4.0
  29288. * @category Array
  29289. * @param {Array} [props=[]] The property identifiers.
  29290. * @param {Array} [values=[]] The property values.
  29291. * @returns {Object} Returns the new object.
  29292. * @example
  29293. *
  29294. * _.zipObject(['a', 'b'], [1, 2]);
  29295. * // => { 'a': 1, 'b': 2 }
  29296. */
  29297. function zipObject(props, values) {
  29298. return baseZipObject(props || [], values || [], assignValue);
  29299. }
  29300. /**
  29301. * This method is like `_.zipObject` except that it supports property paths.
  29302. *
  29303. * @static
  29304. * @memberOf _
  29305. * @since 4.1.0
  29306. * @category Array
  29307. * @param {Array} [props=[]] The property identifiers.
  29308. * @param {Array} [values=[]] The property values.
  29309. * @returns {Object} Returns the new object.
  29310. * @example
  29311. *
  29312. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  29313. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  29314. */
  29315. function zipObjectDeep(props, values) {
  29316. return baseZipObject(props || [], values || [], baseSet);
  29317. }
  29318. /**
  29319. * This method is like `_.zip` except that it accepts `iteratee` to specify
  29320. * how grouped values should be combined. The iteratee is invoked with the
  29321. * elements of each group: (...group).
  29322. *
  29323. * @static
  29324. * @memberOf _
  29325. * @since 3.8.0
  29326. * @category Array
  29327. * @param {...Array} [arrays] The arrays to process.
  29328. * @param {Function} [iteratee=_.identity] The function to combine
  29329. * grouped values.
  29330. * @returns {Array} Returns the new array of grouped elements.
  29331. * @example
  29332. *
  29333. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  29334. * return a + b + c;
  29335. * });
  29336. * // => [111, 222]
  29337. */
  29338. var zipWith = baseRest(function(arrays) {
  29339. var length = arrays.length,
  29340. iteratee = length > 1 ? arrays[length - 1] : undefined;
  29341. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  29342. return unzipWith(arrays, iteratee);
  29343. });
  29344. /*------------------------------------------------------------------------*/
  29345. /**
  29346. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  29347. * chain sequences enabled. The result of such sequences must be unwrapped
  29348. * with `_#value`.
  29349. *
  29350. * @static
  29351. * @memberOf _
  29352. * @since 1.3.0
  29353. * @category Seq
  29354. * @param {*} value The value to wrap.
  29355. * @returns {Object} Returns the new `lodash` wrapper instance.
  29356. * @example
  29357. *
  29358. * var users = [
  29359. * { 'user': 'barney', 'age': 36 },
  29360. * { 'user': 'fred', 'age': 40 },
  29361. * { 'user': 'pebbles', 'age': 1 }
  29362. * ];
  29363. *
  29364. * var youngest = _
  29365. * .chain(users)
  29366. * .sortBy('age')
  29367. * .map(function(o) {
  29368. * return o.user + ' is ' + o.age;
  29369. * })
  29370. * .head()
  29371. * .value();
  29372. * // => 'pebbles is 1'
  29373. */
  29374. function chain(value) {
  29375. var result = lodash(value);
  29376. result.__chain__ = true;
  29377. return result;
  29378. }
  29379. /**
  29380. * This method invokes `interceptor` and returns `value`. The interceptor
  29381. * is invoked with one argument; (value). The purpose of this method is to
  29382. * "tap into" a method chain sequence in order to modify intermediate results.
  29383. *
  29384. * @static
  29385. * @memberOf _
  29386. * @since 0.1.0
  29387. * @category Seq
  29388. * @param {*} value The value to provide to `interceptor`.
  29389. * @param {Function} interceptor The function to invoke.
  29390. * @returns {*} Returns `value`.
  29391. * @example
  29392. *
  29393. * _([1, 2, 3])
  29394. * .tap(function(array) {
  29395. * // Mutate input array.
  29396. * array.pop();
  29397. * })
  29398. * .reverse()
  29399. * .value();
  29400. * // => [2, 1]
  29401. */
  29402. function tap(value, interceptor) {
  29403. interceptor(value);
  29404. return value;
  29405. }
  29406. /**
  29407. * This method is like `_.tap` except that it returns the result of `interceptor`.
  29408. * The purpose of this method is to "pass thru" values replacing intermediate
  29409. * results in a method chain sequence.
  29410. *
  29411. * @static
  29412. * @memberOf _
  29413. * @since 3.0.0
  29414. * @category Seq
  29415. * @param {*} value The value to provide to `interceptor`.
  29416. * @param {Function} interceptor The function to invoke.
  29417. * @returns {*} Returns the result of `interceptor`.
  29418. * @example
  29419. *
  29420. * _(' abc ')
  29421. * .chain()
  29422. * .trim()
  29423. * .thru(function(value) {
  29424. * return [value];
  29425. * })
  29426. * .value();
  29427. * // => ['abc']
  29428. */
  29429. function thru(value, interceptor) {
  29430. return interceptor(value);
  29431. }
  29432. /**
  29433. * This method is the wrapper version of `_.at`.
  29434. *
  29435. * @name at
  29436. * @memberOf _
  29437. * @since 1.0.0
  29438. * @category Seq
  29439. * @param {...(string|string[])} [paths] The property paths to pick.
  29440. * @returns {Object} Returns the new `lodash` wrapper instance.
  29441. * @example
  29442. *
  29443. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  29444. *
  29445. * _(object).at(['a[0].b.c', 'a[1]']).value();
  29446. * // => [3, 4]
  29447. */
  29448. var wrapperAt = flatRest(function(paths) {
  29449. var length = paths.length,
  29450. start = length ? paths[0] : 0,
  29451. value = this.__wrapped__,
  29452. interceptor = function(object) { return baseAt(object, paths); };
  29453. if (length > 1 || this.__actions__.length ||
  29454. !(value instanceof LazyWrapper) || !isIndex(start)) {
  29455. return this.thru(interceptor);
  29456. }
  29457. value = value.slice(start, +start + (length ? 1 : 0));
  29458. value.__actions__.push({
  29459. 'func': thru,
  29460. 'args': [interceptor],
  29461. 'thisArg': undefined
  29462. });
  29463. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  29464. if (length && !array.length) {
  29465. array.push(undefined);
  29466. }
  29467. return array;
  29468. });
  29469. });
  29470. /**
  29471. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  29472. *
  29473. * @name chain
  29474. * @memberOf _
  29475. * @since 0.1.0
  29476. * @category Seq
  29477. * @returns {Object} Returns the new `lodash` wrapper instance.
  29478. * @example
  29479. *
  29480. * var users = [
  29481. * { 'user': 'barney', 'age': 36 },
  29482. * { 'user': 'fred', 'age': 40 }
  29483. * ];
  29484. *
  29485. * // A sequence without explicit chaining.
  29486. * _(users).head();
  29487. * // => { 'user': 'barney', 'age': 36 }
  29488. *
  29489. * // A sequence with explicit chaining.
  29490. * _(users)
  29491. * .chain()
  29492. * .head()
  29493. * .pick('user')
  29494. * .value();
  29495. * // => { 'user': 'barney' }
  29496. */
  29497. function wrapperChain() {
  29498. return chain(this);
  29499. }
  29500. /**
  29501. * Executes the chain sequence and returns the wrapped result.
  29502. *
  29503. * @name commit
  29504. * @memberOf _
  29505. * @since 3.2.0
  29506. * @category Seq
  29507. * @returns {Object} Returns the new `lodash` wrapper instance.
  29508. * @example
  29509. *
  29510. * var array = [1, 2];
  29511. * var wrapped = _(array).push(3);
  29512. *
  29513. * console.log(array);
  29514. * // => [1, 2]
  29515. *
  29516. * wrapped = wrapped.commit();
  29517. * console.log(array);
  29518. * // => [1, 2, 3]
  29519. *
  29520. * wrapped.last();
  29521. * // => 3
  29522. *
  29523. * console.log(array);
  29524. * // => [1, 2, 3]
  29525. */
  29526. function wrapperCommit() {
  29527. return new LodashWrapper(this.value(), this.__chain__);
  29528. }
  29529. /**
  29530. * Gets the next value on a wrapped object following the
  29531. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  29532. *
  29533. * @name next
  29534. * @memberOf _
  29535. * @since 4.0.0
  29536. * @category Seq
  29537. * @returns {Object} Returns the next iterator value.
  29538. * @example
  29539. *
  29540. * var wrapped = _([1, 2]);
  29541. *
  29542. * wrapped.next();
  29543. * // => { 'done': false, 'value': 1 }
  29544. *
  29545. * wrapped.next();
  29546. * // => { 'done': false, 'value': 2 }
  29547. *
  29548. * wrapped.next();
  29549. * // => { 'done': true, 'value': undefined }
  29550. */
  29551. function wrapperNext() {
  29552. if (this.__values__ === undefined) {
  29553. this.__values__ = toArray(this.value());
  29554. }
  29555. var done = this.__index__ >= this.__values__.length,
  29556. value = done ? undefined : this.__values__[this.__index__++];
  29557. return { 'done': done, 'value': value };
  29558. }
  29559. /**
  29560. * Enables the wrapper to be iterable.
  29561. *
  29562. * @name Symbol.iterator
  29563. * @memberOf _
  29564. * @since 4.0.0
  29565. * @category Seq
  29566. * @returns {Object} Returns the wrapper object.
  29567. * @example
  29568. *
  29569. * var wrapped = _([1, 2]);
  29570. *
  29571. * wrapped[Symbol.iterator]() === wrapped;
  29572. * // => true
  29573. *
  29574. * Array.from(wrapped);
  29575. * // => [1, 2]
  29576. */
  29577. function wrapperToIterator() {
  29578. return this;
  29579. }
  29580. /**
  29581. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  29582. *
  29583. * @name plant
  29584. * @memberOf _
  29585. * @since 3.2.0
  29586. * @category Seq
  29587. * @param {*} value The value to plant.
  29588. * @returns {Object} Returns the new `lodash` wrapper instance.
  29589. * @example
  29590. *
  29591. * function square(n) {
  29592. * return n * n;
  29593. * }
  29594. *
  29595. * var wrapped = _([1, 2]).map(square);
  29596. * var other = wrapped.plant([3, 4]);
  29597. *
  29598. * other.value();
  29599. * // => [9, 16]
  29600. *
  29601. * wrapped.value();
  29602. * // => [1, 4]
  29603. */
  29604. function wrapperPlant(value) {
  29605. var result,
  29606. parent = this;
  29607. while (parent instanceof baseLodash) {
  29608. var clone = wrapperClone(parent);
  29609. clone.__index__ = 0;
  29610. clone.__values__ = undefined;
  29611. if (result) {
  29612. previous.__wrapped__ = clone;
  29613. } else {
  29614. result = clone;
  29615. }
  29616. var previous = clone;
  29617. parent = parent.__wrapped__;
  29618. }
  29619. previous.__wrapped__ = value;
  29620. return result;
  29621. }
  29622. /**
  29623. * This method is the wrapper version of `_.reverse`.
  29624. *
  29625. * **Note:** This method mutates the wrapped array.
  29626. *
  29627. * @name reverse
  29628. * @memberOf _
  29629. * @since 0.1.0
  29630. * @category Seq
  29631. * @returns {Object} Returns the new `lodash` wrapper instance.
  29632. * @example
  29633. *
  29634. * var array = [1, 2, 3];
  29635. *
  29636. * _(array).reverse().value()
  29637. * // => [3, 2, 1]
  29638. *
  29639. * console.log(array);
  29640. * // => [3, 2, 1]
  29641. */
  29642. function wrapperReverse() {
  29643. var value = this.__wrapped__;
  29644. if (value instanceof LazyWrapper) {
  29645. var wrapped = value;
  29646. if (this.__actions__.length) {
  29647. wrapped = new LazyWrapper(this);
  29648. }
  29649. wrapped = wrapped.reverse();
  29650. wrapped.__actions__.push({
  29651. 'func': thru,
  29652. 'args': [reverse],
  29653. 'thisArg': undefined
  29654. });
  29655. return new LodashWrapper(wrapped, this.__chain__);
  29656. }
  29657. return this.thru(reverse);
  29658. }
  29659. /**
  29660. * Executes the chain sequence to resolve the unwrapped value.
  29661. *
  29662. * @name value
  29663. * @memberOf _
  29664. * @since 0.1.0
  29665. * @alias toJSON, valueOf
  29666. * @category Seq
  29667. * @returns {*} Returns the resolved unwrapped value.
  29668. * @example
  29669. *
  29670. * _([1, 2, 3]).value();
  29671. * // => [1, 2, 3]
  29672. */
  29673. function wrapperValue() {
  29674. return baseWrapperValue(this.__wrapped__, this.__actions__);
  29675. }
  29676. /*------------------------------------------------------------------------*/
  29677. /**
  29678. * Creates an object composed of keys generated from the results of running
  29679. * each element of `collection` thru `iteratee`. The corresponding value of
  29680. * each key is the number of times the key was returned by `iteratee`. The
  29681. * iteratee is invoked with one argument: (value).
  29682. *
  29683. * @static
  29684. * @memberOf _
  29685. * @since 0.5.0
  29686. * @category Collection
  29687. * @param {Array|Object} collection The collection to iterate over.
  29688. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  29689. * @returns {Object} Returns the composed aggregate object.
  29690. * @example
  29691. *
  29692. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  29693. * // => { '4': 1, '6': 2 }
  29694. *
  29695. * // The `_.property` iteratee shorthand.
  29696. * _.countBy(['one', 'two', 'three'], 'length');
  29697. * // => { '3': 2, '5': 1 }
  29698. */
  29699. var countBy = createAggregator(function(result, value, key) {
  29700. if (hasOwnProperty.call(result, key)) {
  29701. ++result[key];
  29702. } else {
  29703. baseAssignValue(result, key, 1);
  29704. }
  29705. });
  29706. /**
  29707. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  29708. * Iteration is stopped once `predicate` returns falsey. The predicate is
  29709. * invoked with three arguments: (value, index|key, collection).
  29710. *
  29711. * **Note:** This method returns `true` for
  29712. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  29713. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  29714. * elements of empty collections.
  29715. *
  29716. * @static
  29717. * @memberOf _
  29718. * @since 0.1.0
  29719. * @category Collection
  29720. * @param {Array|Object} collection The collection to iterate over.
  29721. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  29722. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  29723. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  29724. * else `false`.
  29725. * @example
  29726. *
  29727. * _.every([true, 1, null, 'yes'], Boolean);
  29728. * // => false
  29729. *
  29730. * var users = [
  29731. * { 'user': 'barney', 'age': 36, 'active': false },
  29732. * { 'user': 'fred', 'age': 40, 'active': false }
  29733. * ];
  29734. *
  29735. * // The `_.matches` iteratee shorthand.
  29736. * _.every(users, { 'user': 'barney', 'active': false });
  29737. * // => false
  29738. *
  29739. * // The `_.matchesProperty` iteratee shorthand.
  29740. * _.every(users, ['active', false]);
  29741. * // => true
  29742. *
  29743. * // The `_.property` iteratee shorthand.
  29744. * _.every(users, 'active');
  29745. * // => false
  29746. */
  29747. function every(collection, predicate, guard) {
  29748. var func = isArray(collection) ? arrayEvery : baseEvery;
  29749. if (guard && isIterateeCall(collection, predicate, guard)) {
  29750. predicate = undefined;
  29751. }
  29752. return func(collection, getIteratee(predicate, 3));
  29753. }
  29754. /**
  29755. * Iterates over elements of `collection`, returning an array of all elements
  29756. * `predicate` returns truthy for. The predicate is invoked with three
  29757. * arguments: (value, index|key, collection).
  29758. *
  29759. * **Note:** Unlike `_.remove`, this method returns a new array.
  29760. *
  29761. * @static
  29762. * @memberOf _
  29763. * @since 0.1.0
  29764. * @category Collection
  29765. * @param {Array|Object} collection The collection to iterate over.
  29766. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  29767. * @returns {Array} Returns the new filtered array.
  29768. * @see _.reject
  29769. * @example
  29770. *
  29771. * var users = [
  29772. * { 'user': 'barney', 'age': 36, 'active': true },
  29773. * { 'user': 'fred', 'age': 40, 'active': false }
  29774. * ];
  29775. *
  29776. * _.filter(users, function(o) { return !o.active; });
  29777. * // => objects for ['fred']
  29778. *
  29779. * // The `_.matches` iteratee shorthand.
  29780. * _.filter(users, { 'age': 36, 'active': true });
  29781. * // => objects for ['barney']
  29782. *
  29783. * // The `_.matchesProperty` iteratee shorthand.
  29784. * _.filter(users, ['active', false]);
  29785. * // => objects for ['fred']
  29786. *
  29787. * // The `_.property` iteratee shorthand.
  29788. * _.filter(users, 'active');
  29789. * // => objects for ['barney']
  29790. *
  29791. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  29792. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  29793. * // => objects for ['fred', 'barney']
  29794. */
  29795. function filter(collection, predicate) {
  29796. var func = isArray(collection) ? arrayFilter : baseFilter;
  29797. return func(collection, getIteratee(predicate, 3));
  29798. }
  29799. /**
  29800. * Iterates over elements of `collection`, returning the first element
  29801. * `predicate` returns truthy for. The predicate is invoked with three
  29802. * arguments: (value, index|key, collection).
  29803. *
  29804. * @static
  29805. * @memberOf _
  29806. * @since 0.1.0
  29807. * @category Collection
  29808. * @param {Array|Object} collection The collection to inspect.
  29809. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  29810. * @param {number} [fromIndex=0] The index to search from.
  29811. * @returns {*} Returns the matched element, else `undefined`.
  29812. * @example
  29813. *
  29814. * var users = [
  29815. * { 'user': 'barney', 'age': 36, 'active': true },
  29816. * { 'user': 'fred', 'age': 40, 'active': false },
  29817. * { 'user': 'pebbles', 'age': 1, 'active': true }
  29818. * ];
  29819. *
  29820. * _.find(users, function(o) { return o.age < 40; });
  29821. * // => object for 'barney'
  29822. *
  29823. * // The `_.matches` iteratee shorthand.
  29824. * _.find(users, { 'age': 1, 'active': true });
  29825. * // => object for 'pebbles'
  29826. *
  29827. * // The `_.matchesProperty` iteratee shorthand.
  29828. * _.find(users, ['active', false]);
  29829. * // => object for 'fred'
  29830. *
  29831. * // The `_.property` iteratee shorthand.
  29832. * _.find(users, 'active');
  29833. * // => object for 'barney'
  29834. */
  29835. var find = createFind(findIndex);
  29836. /**
  29837. * This method is like `_.find` except that it iterates over elements of
  29838. * `collection` from right to left.
  29839. *
  29840. * @static
  29841. * @memberOf _
  29842. * @since 2.0.0
  29843. * @category Collection
  29844. * @param {Array|Object} collection The collection to inspect.
  29845. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  29846. * @param {number} [fromIndex=collection.length-1] The index to search from.
  29847. * @returns {*} Returns the matched element, else `undefined`.
  29848. * @example
  29849. *
  29850. * _.findLast([1, 2, 3, 4], function(n) {
  29851. * return n % 2 == 1;
  29852. * });
  29853. * // => 3
  29854. */
  29855. var findLast = createFind(findLastIndex);
  29856. /**
  29857. * Creates a flattened array of values by running each element in `collection`
  29858. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  29859. * with three arguments: (value, index|key, collection).
  29860. *
  29861. * @static
  29862. * @memberOf _
  29863. * @since 4.0.0
  29864. * @category Collection
  29865. * @param {Array|Object} collection The collection to iterate over.
  29866. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  29867. * @returns {Array} Returns the new flattened array.
  29868. * @example
  29869. *
  29870. * function duplicate(n) {
  29871. * return [n, n];
  29872. * }
  29873. *
  29874. * _.flatMap([1, 2], duplicate);
  29875. * // => [1, 1, 2, 2]
  29876. */
  29877. function flatMap(collection, iteratee) {
  29878. return baseFlatten(map(collection, iteratee), 1);
  29879. }
  29880. /**
  29881. * This method is like `_.flatMap` except that it recursively flattens the
  29882. * mapped results.
  29883. *
  29884. * @static
  29885. * @memberOf _
  29886. * @since 4.7.0
  29887. * @category Collection
  29888. * @param {Array|Object} collection The collection to iterate over.
  29889. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  29890. * @returns {Array} Returns the new flattened array.
  29891. * @example
  29892. *
  29893. * function duplicate(n) {
  29894. * return [[[n, n]]];
  29895. * }
  29896. *
  29897. * _.flatMapDeep([1, 2], duplicate);
  29898. * // => [1, 1, 2, 2]
  29899. */
  29900. function flatMapDeep(collection, iteratee) {
  29901. return baseFlatten(map(collection, iteratee), INFINITY);
  29902. }
  29903. /**
  29904. * This method is like `_.flatMap` except that it recursively flattens the
  29905. * mapped results up to `depth` times.
  29906. *
  29907. * @static
  29908. * @memberOf _
  29909. * @since 4.7.0
  29910. * @category Collection
  29911. * @param {Array|Object} collection The collection to iterate over.
  29912. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  29913. * @param {number} [depth=1] The maximum recursion depth.
  29914. * @returns {Array} Returns the new flattened array.
  29915. * @example
  29916. *
  29917. * function duplicate(n) {
  29918. * return [[[n, n]]];
  29919. * }
  29920. *
  29921. * _.flatMapDepth([1, 2], duplicate, 2);
  29922. * // => [[1, 1], [2, 2]]
  29923. */
  29924. function flatMapDepth(collection, iteratee, depth) {
  29925. depth = depth === undefined ? 1 : toInteger(depth);
  29926. return baseFlatten(map(collection, iteratee), depth);
  29927. }
  29928. /**
  29929. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  29930. * The iteratee is invoked with three arguments: (value, index|key, collection).
  29931. * Iteratee functions may exit iteration early by explicitly returning `false`.
  29932. *
  29933. * **Note:** As with other "Collections" methods, objects with a "length"
  29934. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  29935. * or `_.forOwn` for object iteration.
  29936. *
  29937. * @static
  29938. * @memberOf _
  29939. * @since 0.1.0
  29940. * @alias each
  29941. * @category Collection
  29942. * @param {Array|Object} collection The collection to iterate over.
  29943. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  29944. * @returns {Array|Object} Returns `collection`.
  29945. * @see _.forEachRight
  29946. * @example
  29947. *
  29948. * _.forEach([1, 2], function(value) {
  29949. * console.log(value);
  29950. * });
  29951. * // => Logs `1` then `2`.
  29952. *
  29953. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  29954. * console.log(key);
  29955. * });
  29956. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  29957. */
  29958. function forEach(collection, iteratee) {
  29959. var func = isArray(collection) ? arrayEach : baseEach;
  29960. return func(collection, getIteratee(iteratee, 3));
  29961. }
  29962. /**
  29963. * This method is like `_.forEach` except that it iterates over elements of
  29964. * `collection` from right to left.
  29965. *
  29966. * @static
  29967. * @memberOf _
  29968. * @since 2.0.0
  29969. * @alias eachRight
  29970. * @category Collection
  29971. * @param {Array|Object} collection The collection to iterate over.
  29972. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  29973. * @returns {Array|Object} Returns `collection`.
  29974. * @see _.forEach
  29975. * @example
  29976. *
  29977. * _.forEachRight([1, 2], function(value) {
  29978. * console.log(value);
  29979. * });
  29980. * // => Logs `2` then `1`.
  29981. */
  29982. function forEachRight(collection, iteratee) {
  29983. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  29984. return func(collection, getIteratee(iteratee, 3));
  29985. }
  29986. /**
  29987. * Creates an object composed of keys generated from the results of running
  29988. * each element of `collection` thru `iteratee`. The order of grouped values
  29989. * is determined by the order they occur in `collection`. The corresponding
  29990. * value of each key is an array of elements responsible for generating the
  29991. * key. The iteratee is invoked with one argument: (value).
  29992. *
  29993. * @static
  29994. * @memberOf _
  29995. * @since 0.1.0
  29996. * @category Collection
  29997. * @param {Array|Object} collection The collection to iterate over.
  29998. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  29999. * @returns {Object} Returns the composed aggregate object.
  30000. * @example
  30001. *
  30002. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  30003. * // => { '4': [4.2], '6': [6.1, 6.3] }
  30004. *
  30005. * // The `_.property` iteratee shorthand.
  30006. * _.groupBy(['one', 'two', 'three'], 'length');
  30007. * // => { '3': ['one', 'two'], '5': ['three'] }
  30008. */
  30009. var groupBy = createAggregator(function(result, value, key) {
  30010. if (hasOwnProperty.call(result, key)) {
  30011. result[key].push(value);
  30012. } else {
  30013. baseAssignValue(result, key, [value]);
  30014. }
  30015. });
  30016. /**
  30017. * Checks if `value` is in `collection`. If `collection` is a string, it's
  30018. * checked for a substring of `value`, otherwise
  30019. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  30020. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  30021. * the offset from the end of `collection`.
  30022. *
  30023. * @static
  30024. * @memberOf _
  30025. * @since 0.1.0
  30026. * @category Collection
  30027. * @param {Array|Object|string} collection The collection to inspect.
  30028. * @param {*} value The value to search for.
  30029. * @param {number} [fromIndex=0] The index to search from.
  30030. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  30031. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  30032. * @example
  30033. *
  30034. * _.includes([1, 2, 3], 1);
  30035. * // => true
  30036. *
  30037. * _.includes([1, 2, 3], 1, 2);
  30038. * // => false
  30039. *
  30040. * _.includes({ 'a': 1, 'b': 2 }, 1);
  30041. * // => true
  30042. *
  30043. * _.includes('abcd', 'bc');
  30044. * // => true
  30045. */
  30046. function includes(collection, value, fromIndex, guard) {
  30047. collection = isArrayLike(collection) ? collection : values(collection);
  30048. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  30049. var length = collection.length;
  30050. if (fromIndex < 0) {
  30051. fromIndex = nativeMax(length + fromIndex, 0);
  30052. }
  30053. return isString(collection)
  30054. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  30055. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  30056. }
  30057. /**
  30058. * Invokes the method at `path` of each element in `collection`, returning
  30059. * an array of the results of each invoked method. Any additional arguments
  30060. * are provided to each invoked method. If `path` is a function, it's invoked
  30061. * for, and `this` bound to, each element in `collection`.
  30062. *
  30063. * @static
  30064. * @memberOf _
  30065. * @since 4.0.0
  30066. * @category Collection
  30067. * @param {Array|Object} collection The collection to iterate over.
  30068. * @param {Array|Function|string} path The path of the method to invoke or
  30069. * the function invoked per iteration.
  30070. * @param {...*} [args] The arguments to invoke each method with.
  30071. * @returns {Array} Returns the array of results.
  30072. * @example
  30073. *
  30074. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  30075. * // => [[1, 5, 7], [1, 2, 3]]
  30076. *
  30077. * _.invokeMap([123, 456], String.prototype.split, '');
  30078. * // => [['1', '2', '3'], ['4', '5', '6']]
  30079. */
  30080. var invokeMap = baseRest(function(collection, path, args) {
  30081. var index = -1,
  30082. isFunc = typeof path == 'function',
  30083. result = isArrayLike(collection) ? Array(collection.length) : [];
  30084. baseEach(collection, function(value) {
  30085. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  30086. });
  30087. return result;
  30088. });
  30089. /**
  30090. * Creates an object composed of keys generated from the results of running
  30091. * each element of `collection` thru `iteratee`. The corresponding value of
  30092. * each key is the last element responsible for generating the key. The
  30093. * iteratee is invoked with one argument: (value).
  30094. *
  30095. * @static
  30096. * @memberOf _
  30097. * @since 4.0.0
  30098. * @category Collection
  30099. * @param {Array|Object} collection The collection to iterate over.
  30100. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  30101. * @returns {Object} Returns the composed aggregate object.
  30102. * @example
  30103. *
  30104. * var array = [
  30105. * { 'dir': 'left', 'code': 97 },
  30106. * { 'dir': 'right', 'code': 100 }
  30107. * ];
  30108. *
  30109. * _.keyBy(array, function(o) {
  30110. * return String.fromCharCode(o.code);
  30111. * });
  30112. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  30113. *
  30114. * _.keyBy(array, 'dir');
  30115. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  30116. */
  30117. var keyBy = createAggregator(function(result, value, key) {
  30118. baseAssignValue(result, key, value);
  30119. });
  30120. /**
  30121. * Creates an array of values by running each element in `collection` thru
  30122. * `iteratee`. The iteratee is invoked with three arguments:
  30123. * (value, index|key, collection).
  30124. *
  30125. * Many lodash methods are guarded to work as iteratees for methods like
  30126. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  30127. *
  30128. * The guarded methods are:
  30129. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  30130. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  30131. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  30132. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  30133. *
  30134. * @static
  30135. * @memberOf _
  30136. * @since 0.1.0
  30137. * @category Collection
  30138. * @param {Array|Object} collection The collection to iterate over.
  30139. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  30140. * @returns {Array} Returns the new mapped array.
  30141. * @example
  30142. *
  30143. * function square(n) {
  30144. * return n * n;
  30145. * }
  30146. *
  30147. * _.map([4, 8], square);
  30148. * // => [16, 64]
  30149. *
  30150. * _.map({ 'a': 4, 'b': 8 }, square);
  30151. * // => [16, 64] (iteration order is not guaranteed)
  30152. *
  30153. * var users = [
  30154. * { 'user': 'barney' },
  30155. * { 'user': 'fred' }
  30156. * ];
  30157. *
  30158. * // The `_.property` iteratee shorthand.
  30159. * _.map(users, 'user');
  30160. * // => ['barney', 'fred']
  30161. */
  30162. function map(collection, iteratee) {
  30163. var func = isArray(collection) ? arrayMap : baseMap;
  30164. return func(collection, getIteratee(iteratee, 3));
  30165. }
  30166. /**
  30167. * This method is like `_.sortBy` except that it allows specifying the sort
  30168. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  30169. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  30170. * descending or "asc" for ascending sort order of corresponding values.
  30171. *
  30172. * @static
  30173. * @memberOf _
  30174. * @since 4.0.0
  30175. * @category Collection
  30176. * @param {Array|Object} collection The collection to iterate over.
  30177. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  30178. * The iteratees to sort by.
  30179. * @param {string[]} [orders] The sort orders of `iteratees`.
  30180. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  30181. * @returns {Array} Returns the new sorted array.
  30182. * @example
  30183. *
  30184. * var users = [
  30185. * { 'user': 'fred', 'age': 48 },
  30186. * { 'user': 'barney', 'age': 34 },
  30187. * { 'user': 'fred', 'age': 40 },
  30188. * { 'user': 'barney', 'age': 36 }
  30189. * ];
  30190. *
  30191. * // Sort by `user` in ascending order and by `age` in descending order.
  30192. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  30193. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  30194. */
  30195. function orderBy(collection, iteratees, orders, guard) {
  30196. if (collection == null) {
  30197. return [];
  30198. }
  30199. if (!isArray(iteratees)) {
  30200. iteratees = iteratees == null ? [] : [iteratees];
  30201. }
  30202. orders = guard ? undefined : orders;
  30203. if (!isArray(orders)) {
  30204. orders = orders == null ? [] : [orders];
  30205. }
  30206. return baseOrderBy(collection, iteratees, orders);
  30207. }
  30208. /**
  30209. * Creates an array of elements split into two groups, the first of which
  30210. * contains elements `predicate` returns truthy for, the second of which
  30211. * contains elements `predicate` returns falsey for. The predicate is
  30212. * invoked with one argument: (value).
  30213. *
  30214. * @static
  30215. * @memberOf _
  30216. * @since 3.0.0
  30217. * @category Collection
  30218. * @param {Array|Object} collection The collection to iterate over.
  30219. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  30220. * @returns {Array} Returns the array of grouped elements.
  30221. * @example
  30222. *
  30223. * var users = [
  30224. * { 'user': 'barney', 'age': 36, 'active': false },
  30225. * { 'user': 'fred', 'age': 40, 'active': true },
  30226. * { 'user': 'pebbles', 'age': 1, 'active': false }
  30227. * ];
  30228. *
  30229. * _.partition(users, function(o) { return o.active; });
  30230. * // => objects for [['fred'], ['barney', 'pebbles']]
  30231. *
  30232. * // The `_.matches` iteratee shorthand.
  30233. * _.partition(users, { 'age': 1, 'active': false });
  30234. * // => objects for [['pebbles'], ['barney', 'fred']]
  30235. *
  30236. * // The `_.matchesProperty` iteratee shorthand.
  30237. * _.partition(users, ['active', false]);
  30238. * // => objects for [['barney', 'pebbles'], ['fred']]
  30239. *
  30240. * // The `_.property` iteratee shorthand.
  30241. * _.partition(users, 'active');
  30242. * // => objects for [['fred'], ['barney', 'pebbles']]
  30243. */
  30244. var partition = createAggregator(function(result, value, key) {
  30245. result[key ? 0 : 1].push(value);
  30246. }, function() { return [[], []]; });
  30247. /**
  30248. * Reduces `collection` to a value which is the accumulated result of running
  30249. * each element in `collection` thru `iteratee`, where each successive
  30250. * invocation is supplied the return value of the previous. If `accumulator`
  30251. * is not given, the first element of `collection` is used as the initial
  30252. * value. The iteratee is invoked with four arguments:
  30253. * (accumulator, value, index|key, collection).
  30254. *
  30255. * Many lodash methods are guarded to work as iteratees for methods like
  30256. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  30257. *
  30258. * The guarded methods are:
  30259. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  30260. * and `sortBy`
  30261. *
  30262. * @static
  30263. * @memberOf _
  30264. * @since 0.1.0
  30265. * @category Collection
  30266. * @param {Array|Object} collection The collection to iterate over.
  30267. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  30268. * @param {*} [accumulator] The initial value.
  30269. * @returns {*} Returns the accumulated value.
  30270. * @see _.reduceRight
  30271. * @example
  30272. *
  30273. * _.reduce([1, 2], function(sum, n) {
  30274. * return sum + n;
  30275. * }, 0);
  30276. * // => 3
  30277. *
  30278. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  30279. * (result[value] || (result[value] = [])).push(key);
  30280. * return result;
  30281. * }, {});
  30282. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  30283. */
  30284. function reduce(collection, iteratee, accumulator) {
  30285. var func = isArray(collection) ? arrayReduce : baseReduce,
  30286. initAccum = arguments.length < 3;
  30287. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  30288. }
  30289. /**
  30290. * This method is like `_.reduce` except that it iterates over elements of
  30291. * `collection` from right to left.
  30292. *
  30293. * @static
  30294. * @memberOf _
  30295. * @since 0.1.0
  30296. * @category Collection
  30297. * @param {Array|Object} collection The collection to iterate over.
  30298. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  30299. * @param {*} [accumulator] The initial value.
  30300. * @returns {*} Returns the accumulated value.
  30301. * @see _.reduce
  30302. * @example
  30303. *
  30304. * var array = [[0, 1], [2, 3], [4, 5]];
  30305. *
  30306. * _.reduceRight(array, function(flattened, other) {
  30307. * return flattened.concat(other);
  30308. * }, []);
  30309. * // => [4, 5, 2, 3, 0, 1]
  30310. */
  30311. function reduceRight(collection, iteratee, accumulator) {
  30312. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  30313. initAccum = arguments.length < 3;
  30314. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  30315. }
  30316. /**
  30317. * The opposite of `_.filter`; this method returns the elements of `collection`
  30318. * that `predicate` does **not** return truthy for.
  30319. *
  30320. * @static
  30321. * @memberOf _
  30322. * @since 0.1.0
  30323. * @category Collection
  30324. * @param {Array|Object} collection The collection to iterate over.
  30325. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  30326. * @returns {Array} Returns the new filtered array.
  30327. * @see _.filter
  30328. * @example
  30329. *
  30330. * var users = [
  30331. * { 'user': 'barney', 'age': 36, 'active': false },
  30332. * { 'user': 'fred', 'age': 40, 'active': true }
  30333. * ];
  30334. *
  30335. * _.reject(users, function(o) { return !o.active; });
  30336. * // => objects for ['fred']
  30337. *
  30338. * // The `_.matches` iteratee shorthand.
  30339. * _.reject(users, { 'age': 40, 'active': true });
  30340. * // => objects for ['barney']
  30341. *
  30342. * // The `_.matchesProperty` iteratee shorthand.
  30343. * _.reject(users, ['active', false]);
  30344. * // => objects for ['fred']
  30345. *
  30346. * // The `_.property` iteratee shorthand.
  30347. * _.reject(users, 'active');
  30348. * // => objects for ['barney']
  30349. */
  30350. function reject(collection, predicate) {
  30351. var func = isArray(collection) ? arrayFilter : baseFilter;
  30352. return func(collection, negate(getIteratee(predicate, 3)));
  30353. }
  30354. /**
  30355. * Gets a random element from `collection`.
  30356. *
  30357. * @static
  30358. * @memberOf _
  30359. * @since 2.0.0
  30360. * @category Collection
  30361. * @param {Array|Object} collection The collection to sample.
  30362. * @returns {*} Returns the random element.
  30363. * @example
  30364. *
  30365. * _.sample([1, 2, 3, 4]);
  30366. * // => 2
  30367. */
  30368. function sample(collection) {
  30369. var func = isArray(collection) ? arraySample : baseSample;
  30370. return func(collection);
  30371. }
  30372. /**
  30373. * Gets `n` random elements at unique keys from `collection` up to the
  30374. * size of `collection`.
  30375. *
  30376. * @static
  30377. * @memberOf _
  30378. * @since 4.0.0
  30379. * @category Collection
  30380. * @param {Array|Object} collection The collection to sample.
  30381. * @param {number} [n=1] The number of elements to sample.
  30382. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  30383. * @returns {Array} Returns the random elements.
  30384. * @example
  30385. *
  30386. * _.sampleSize([1, 2, 3], 2);
  30387. * // => [3, 1]
  30388. *
  30389. * _.sampleSize([1, 2, 3], 4);
  30390. * // => [2, 3, 1]
  30391. */
  30392. function sampleSize(collection, n, guard) {
  30393. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  30394. n = 1;
  30395. } else {
  30396. n = toInteger(n);
  30397. }
  30398. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  30399. return func(collection, n);
  30400. }
  30401. /**
  30402. * Creates an array of shuffled values, using a version of the
  30403. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  30404. *
  30405. * @static
  30406. * @memberOf _
  30407. * @since 0.1.0
  30408. * @category Collection
  30409. * @param {Array|Object} collection The collection to shuffle.
  30410. * @returns {Array} Returns the new shuffled array.
  30411. * @example
  30412. *
  30413. * _.shuffle([1, 2, 3, 4]);
  30414. * // => [4, 1, 3, 2]
  30415. */
  30416. function shuffle(collection) {
  30417. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  30418. return func(collection);
  30419. }
  30420. /**
  30421. * Gets the size of `collection` by returning its length for array-like
  30422. * values or the number of own enumerable string keyed properties for objects.
  30423. *
  30424. * @static
  30425. * @memberOf _
  30426. * @since 0.1.0
  30427. * @category Collection
  30428. * @param {Array|Object|string} collection The collection to inspect.
  30429. * @returns {number} Returns the collection size.
  30430. * @example
  30431. *
  30432. * _.size([1, 2, 3]);
  30433. * // => 3
  30434. *
  30435. * _.size({ 'a': 1, 'b': 2 });
  30436. * // => 2
  30437. *
  30438. * _.size('pebbles');
  30439. * // => 7
  30440. */
  30441. function size(collection) {
  30442. if (collection == null) {
  30443. return 0;
  30444. }
  30445. if (isArrayLike(collection)) {
  30446. return isString(collection) ? stringSize(collection) : collection.length;
  30447. }
  30448. var tag = getTag(collection);
  30449. if (tag == mapTag || tag == setTag) {
  30450. return collection.size;
  30451. }
  30452. return baseKeys(collection).length;
  30453. }
  30454. /**
  30455. * Checks if `predicate` returns truthy for **any** element of `collection`.
  30456. * Iteration is stopped once `predicate` returns truthy. The predicate is
  30457. * invoked with three arguments: (value, index|key, collection).
  30458. *
  30459. * @static
  30460. * @memberOf _
  30461. * @since 0.1.0
  30462. * @category Collection
  30463. * @param {Array|Object} collection The collection to iterate over.
  30464. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  30465. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  30466. * @returns {boolean} Returns `true` if any element passes the predicate check,
  30467. * else `false`.
  30468. * @example
  30469. *
  30470. * _.some([null, 0, 'yes', false], Boolean);
  30471. * // => true
  30472. *
  30473. * var users = [
  30474. * { 'user': 'barney', 'active': true },
  30475. * { 'user': 'fred', 'active': false }
  30476. * ];
  30477. *
  30478. * // The `_.matches` iteratee shorthand.
  30479. * _.some(users, { 'user': 'barney', 'active': false });
  30480. * // => false
  30481. *
  30482. * // The `_.matchesProperty` iteratee shorthand.
  30483. * _.some(users, ['active', false]);
  30484. * // => true
  30485. *
  30486. * // The `_.property` iteratee shorthand.
  30487. * _.some(users, 'active');
  30488. * // => true
  30489. */
  30490. function some(collection, predicate, guard) {
  30491. var func = isArray(collection) ? arraySome : baseSome;
  30492. if (guard && isIterateeCall(collection, predicate, guard)) {
  30493. predicate = undefined;
  30494. }
  30495. return func(collection, getIteratee(predicate, 3));
  30496. }
  30497. /**
  30498. * Creates an array of elements, sorted in ascending order by the results of
  30499. * running each element in a collection thru each iteratee. This method
  30500. * performs a stable sort, that is, it preserves the original sort order of
  30501. * equal elements. The iteratees are invoked with one argument: (value).
  30502. *
  30503. * @static
  30504. * @memberOf _
  30505. * @since 0.1.0
  30506. * @category Collection
  30507. * @param {Array|Object} collection The collection to iterate over.
  30508. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  30509. * The iteratees to sort by.
  30510. * @returns {Array} Returns the new sorted array.
  30511. * @example
  30512. *
  30513. * var users = [
  30514. * { 'user': 'fred', 'age': 48 },
  30515. * { 'user': 'barney', 'age': 36 },
  30516. * { 'user': 'fred', 'age': 30 },
  30517. * { 'user': 'barney', 'age': 34 }
  30518. * ];
  30519. *
  30520. * _.sortBy(users, [function(o) { return o.user; }]);
  30521. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  30522. *
  30523. * _.sortBy(users, ['user', 'age']);
  30524. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  30525. */
  30526. var sortBy = baseRest(function(collection, iteratees) {
  30527. if (collection == null) {
  30528. return [];
  30529. }
  30530. var length = iteratees.length;
  30531. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  30532. iteratees = [];
  30533. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  30534. iteratees = [iteratees[0]];
  30535. }
  30536. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  30537. });
  30538. /*------------------------------------------------------------------------*/
  30539. /**
  30540. * Gets the timestamp of the number of milliseconds that have elapsed since
  30541. * the Unix epoch (1 January 1970 00:00:00 UTC).
  30542. *
  30543. * @static
  30544. * @memberOf _
  30545. * @since 2.4.0
  30546. * @category Date
  30547. * @returns {number} Returns the timestamp.
  30548. * @example
  30549. *
  30550. * _.defer(function(stamp) {
  30551. * console.log(_.now() - stamp);
  30552. * }, _.now());
  30553. * // => Logs the number of milliseconds it took for the deferred invocation.
  30554. */
  30555. var now = ctxNow || function() {
  30556. return root.Date.now();
  30557. };
  30558. /*------------------------------------------------------------------------*/
  30559. /**
  30560. * The opposite of `_.before`; this method creates a function that invokes
  30561. * `func` once it's called `n` or more times.
  30562. *
  30563. * @static
  30564. * @memberOf _
  30565. * @since 0.1.0
  30566. * @category Function
  30567. * @param {number} n The number of calls before `func` is invoked.
  30568. * @param {Function} func The function to restrict.
  30569. * @returns {Function} Returns the new restricted function.
  30570. * @example
  30571. *
  30572. * var saves = ['profile', 'settings'];
  30573. *
  30574. * var done = _.after(saves.length, function() {
  30575. * console.log('done saving!');
  30576. * });
  30577. *
  30578. * _.forEach(saves, function(type) {
  30579. * asyncSave({ 'type': type, 'complete': done });
  30580. * });
  30581. * // => Logs 'done saving!' after the two async saves have completed.
  30582. */
  30583. function after(n, func) {
  30584. if (typeof func != 'function') {
  30585. throw new TypeError(FUNC_ERROR_TEXT);
  30586. }
  30587. n = toInteger(n);
  30588. return function() {
  30589. if (--n < 1) {
  30590. return func.apply(this, arguments);
  30591. }
  30592. };
  30593. }
  30594. /**
  30595. * Creates a function that invokes `func`, with up to `n` arguments,
  30596. * ignoring any additional arguments.
  30597. *
  30598. * @static
  30599. * @memberOf _
  30600. * @since 3.0.0
  30601. * @category Function
  30602. * @param {Function} func The function to cap arguments for.
  30603. * @param {number} [n=func.length] The arity cap.
  30604. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  30605. * @returns {Function} Returns the new capped function.
  30606. * @example
  30607. *
  30608. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  30609. * // => [6, 8, 10]
  30610. */
  30611. function ary(func, n, guard) {
  30612. n = guard ? undefined : n;
  30613. n = (func && n == null) ? func.length : n;
  30614. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  30615. }
  30616. /**
  30617. * Creates a function that invokes `func`, with the `this` binding and arguments
  30618. * of the created function, while it's called less than `n` times. Subsequent
  30619. * calls to the created function return the result of the last `func` invocation.
  30620. *
  30621. * @static
  30622. * @memberOf _
  30623. * @since 3.0.0
  30624. * @category Function
  30625. * @param {number} n The number of calls at which `func` is no longer invoked.
  30626. * @param {Function} func The function to restrict.
  30627. * @returns {Function} Returns the new restricted function.
  30628. * @example
  30629. *
  30630. * jQuery(element).on('click', _.before(5, addContactToList));
  30631. * // => Allows adding up to 4 contacts to the list.
  30632. */
  30633. function before(n, func) {
  30634. var result;
  30635. if (typeof func != 'function') {
  30636. throw new TypeError(FUNC_ERROR_TEXT);
  30637. }
  30638. n = toInteger(n);
  30639. return function() {
  30640. if (--n > 0) {
  30641. result = func.apply(this, arguments);
  30642. }
  30643. if (n <= 1) {
  30644. func = undefined;
  30645. }
  30646. return result;
  30647. };
  30648. }
  30649. /**
  30650. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  30651. * and `partials` prepended to the arguments it receives.
  30652. *
  30653. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  30654. * may be used as a placeholder for partially applied arguments.
  30655. *
  30656. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  30657. * property of bound functions.
  30658. *
  30659. * @static
  30660. * @memberOf _
  30661. * @since 0.1.0
  30662. * @category Function
  30663. * @param {Function} func The function to bind.
  30664. * @param {*} thisArg The `this` binding of `func`.
  30665. * @param {...*} [partials] The arguments to be partially applied.
  30666. * @returns {Function} Returns the new bound function.
  30667. * @example
  30668. *
  30669. * function greet(greeting, punctuation) {
  30670. * return greeting + ' ' + this.user + punctuation;
  30671. * }
  30672. *
  30673. * var object = { 'user': 'fred' };
  30674. *
  30675. * var bound = _.bind(greet, object, 'hi');
  30676. * bound('!');
  30677. * // => 'hi fred!'
  30678. *
  30679. * // Bound with placeholders.
  30680. * var bound = _.bind(greet, object, _, '!');
  30681. * bound('hi');
  30682. * // => 'hi fred!'
  30683. */
  30684. var bind = baseRest(function(func, thisArg, partials) {
  30685. var bitmask = WRAP_BIND_FLAG;
  30686. if (partials.length) {
  30687. var holders = replaceHolders(partials, getHolder(bind));
  30688. bitmask |= WRAP_PARTIAL_FLAG;
  30689. }
  30690. return createWrap(func, bitmask, thisArg, partials, holders);
  30691. });
  30692. /**
  30693. * Creates a function that invokes the method at `object[key]` with `partials`
  30694. * prepended to the arguments it receives.
  30695. *
  30696. * This method differs from `_.bind` by allowing bound functions to reference
  30697. * methods that may be redefined or don't yet exist. See
  30698. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  30699. * for more details.
  30700. *
  30701. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  30702. * builds, may be used as a placeholder for partially applied arguments.
  30703. *
  30704. * @static
  30705. * @memberOf _
  30706. * @since 0.10.0
  30707. * @category Function
  30708. * @param {Object} object The object to invoke the method on.
  30709. * @param {string} key The key of the method.
  30710. * @param {...*} [partials] The arguments to be partially applied.
  30711. * @returns {Function} Returns the new bound function.
  30712. * @example
  30713. *
  30714. * var object = {
  30715. * 'user': 'fred',
  30716. * 'greet': function(greeting, punctuation) {
  30717. * return greeting + ' ' + this.user + punctuation;
  30718. * }
  30719. * };
  30720. *
  30721. * var bound = _.bindKey(object, 'greet', 'hi');
  30722. * bound('!');
  30723. * // => 'hi fred!'
  30724. *
  30725. * object.greet = function(greeting, punctuation) {
  30726. * return greeting + 'ya ' + this.user + punctuation;
  30727. * };
  30728. *
  30729. * bound('!');
  30730. * // => 'hiya fred!'
  30731. *
  30732. * // Bound with placeholders.
  30733. * var bound = _.bindKey(object, 'greet', _, '!');
  30734. * bound('hi');
  30735. * // => 'hiya fred!'
  30736. */
  30737. var bindKey = baseRest(function(object, key, partials) {
  30738. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  30739. if (partials.length) {
  30740. var holders = replaceHolders(partials, getHolder(bindKey));
  30741. bitmask |= WRAP_PARTIAL_FLAG;
  30742. }
  30743. return createWrap(key, bitmask, object, partials, holders);
  30744. });
  30745. /**
  30746. * Creates a function that accepts arguments of `func` and either invokes
  30747. * `func` returning its result, if at least `arity` number of arguments have
  30748. * been provided, or returns a function that accepts the remaining `func`
  30749. * arguments, and so on. The arity of `func` may be specified if `func.length`
  30750. * is not sufficient.
  30751. *
  30752. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  30753. * may be used as a placeholder for provided arguments.
  30754. *
  30755. * **Note:** This method doesn't set the "length" property of curried functions.
  30756. *
  30757. * @static
  30758. * @memberOf _
  30759. * @since 2.0.0
  30760. * @category Function
  30761. * @param {Function} func The function to curry.
  30762. * @param {number} [arity=func.length] The arity of `func`.
  30763. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  30764. * @returns {Function} Returns the new curried function.
  30765. * @example
  30766. *
  30767. * var abc = function(a, b, c) {
  30768. * return [a, b, c];
  30769. * };
  30770. *
  30771. * var curried = _.curry(abc);
  30772. *
  30773. * curried(1)(2)(3);
  30774. * // => [1, 2, 3]
  30775. *
  30776. * curried(1, 2)(3);
  30777. * // => [1, 2, 3]
  30778. *
  30779. * curried(1, 2, 3);
  30780. * // => [1, 2, 3]
  30781. *
  30782. * // Curried with placeholders.
  30783. * curried(1)(_, 3)(2);
  30784. * // => [1, 2, 3]
  30785. */
  30786. function curry(func, arity, guard) {
  30787. arity = guard ? undefined : arity;
  30788. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  30789. result.placeholder = curry.placeholder;
  30790. return result;
  30791. }
  30792. /**
  30793. * This method is like `_.curry` except that arguments are applied to `func`
  30794. * in the manner of `_.partialRight` instead of `_.partial`.
  30795. *
  30796. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  30797. * builds, may be used as a placeholder for provided arguments.
  30798. *
  30799. * **Note:** This method doesn't set the "length" property of curried functions.
  30800. *
  30801. * @static
  30802. * @memberOf _
  30803. * @since 3.0.0
  30804. * @category Function
  30805. * @param {Function} func The function to curry.
  30806. * @param {number} [arity=func.length] The arity of `func`.
  30807. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  30808. * @returns {Function} Returns the new curried function.
  30809. * @example
  30810. *
  30811. * var abc = function(a, b, c) {
  30812. * return [a, b, c];
  30813. * };
  30814. *
  30815. * var curried = _.curryRight(abc);
  30816. *
  30817. * curried(3)(2)(1);
  30818. * // => [1, 2, 3]
  30819. *
  30820. * curried(2, 3)(1);
  30821. * // => [1, 2, 3]
  30822. *
  30823. * curried(1, 2, 3);
  30824. * // => [1, 2, 3]
  30825. *
  30826. * // Curried with placeholders.
  30827. * curried(3)(1, _)(2);
  30828. * // => [1, 2, 3]
  30829. */
  30830. function curryRight(func, arity, guard) {
  30831. arity = guard ? undefined : arity;
  30832. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  30833. result.placeholder = curryRight.placeholder;
  30834. return result;
  30835. }
  30836. /**
  30837. * Creates a debounced function that delays invoking `func` until after `wait`
  30838. * milliseconds have elapsed since the last time the debounced function was
  30839. * invoked. The debounced function comes with a `cancel` method to cancel
  30840. * delayed `func` invocations and a `flush` method to immediately invoke them.
  30841. * Provide `options` to indicate whether `func` should be invoked on the
  30842. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  30843. * with the last arguments provided to the debounced function. Subsequent
  30844. * calls to the debounced function return the result of the last `func`
  30845. * invocation.
  30846. *
  30847. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  30848. * invoked on the trailing edge of the timeout only if the debounced function
  30849. * is invoked more than once during the `wait` timeout.
  30850. *
  30851. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  30852. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  30853. *
  30854. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  30855. * for details over the differences between `_.debounce` and `_.throttle`.
  30856. *
  30857. * @static
  30858. * @memberOf _
  30859. * @since 0.1.0
  30860. * @category Function
  30861. * @param {Function} func The function to debounce.
  30862. * @param {number} [wait=0] The number of milliseconds to delay.
  30863. * @param {Object} [options={}] The options object.
  30864. * @param {boolean} [options.leading=false]
  30865. * Specify invoking on the leading edge of the timeout.
  30866. * @param {number} [options.maxWait]
  30867. * The maximum time `func` is allowed to be delayed before it's invoked.
  30868. * @param {boolean} [options.trailing=true]
  30869. * Specify invoking on the trailing edge of the timeout.
  30870. * @returns {Function} Returns the new debounced function.
  30871. * @example
  30872. *
  30873. * // Avoid costly calculations while the window size is in flux.
  30874. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  30875. *
  30876. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  30877. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  30878. * 'leading': true,
  30879. * 'trailing': false
  30880. * }));
  30881. *
  30882. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  30883. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  30884. * var source = new EventSource('/stream');
  30885. * jQuery(source).on('message', debounced);
  30886. *
  30887. * // Cancel the trailing debounced invocation.
  30888. * jQuery(window).on('popstate', debounced.cancel);
  30889. */
  30890. function debounce(func, wait, options) {
  30891. var lastArgs,
  30892. lastThis,
  30893. maxWait,
  30894. result,
  30895. timerId,
  30896. lastCallTime,
  30897. lastInvokeTime = 0,
  30898. leading = false,
  30899. maxing = false,
  30900. trailing = true;
  30901. if (typeof func != 'function') {
  30902. throw new TypeError(FUNC_ERROR_TEXT);
  30903. }
  30904. wait = toNumber(wait) || 0;
  30905. if (isObject(options)) {
  30906. leading = !!options.leading;
  30907. maxing = 'maxWait' in options;
  30908. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  30909. trailing = 'trailing' in options ? !!options.trailing : trailing;
  30910. }
  30911. function invokeFunc(time) {
  30912. var args = lastArgs,
  30913. thisArg = lastThis;
  30914. lastArgs = lastThis = undefined;
  30915. lastInvokeTime = time;
  30916. result = func.apply(thisArg, args);
  30917. return result;
  30918. }
  30919. function leadingEdge(time) {
  30920. // Reset any `maxWait` timer.
  30921. lastInvokeTime = time;
  30922. // Start the timer for the trailing edge.
  30923. timerId = setTimeout(timerExpired, wait);
  30924. // Invoke the leading edge.
  30925. return leading ? invokeFunc(time) : result;
  30926. }
  30927. function remainingWait(time) {
  30928. var timeSinceLastCall = time - lastCallTime,
  30929. timeSinceLastInvoke = time - lastInvokeTime,
  30930. timeWaiting = wait - timeSinceLastCall;
  30931. return maxing
  30932. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  30933. : timeWaiting;
  30934. }
  30935. function shouldInvoke(time) {
  30936. var timeSinceLastCall = time - lastCallTime,
  30937. timeSinceLastInvoke = time - lastInvokeTime;
  30938. // Either this is the first call, activity has stopped and we're at the
  30939. // trailing edge, the system time has gone backwards and we're treating
  30940. // it as the trailing edge, or we've hit the `maxWait` limit.
  30941. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  30942. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  30943. }
  30944. function timerExpired() {
  30945. var time = now();
  30946. if (shouldInvoke(time)) {
  30947. return trailingEdge(time);
  30948. }
  30949. // Restart the timer.
  30950. timerId = setTimeout(timerExpired, remainingWait(time));
  30951. }
  30952. function trailingEdge(time) {
  30953. timerId = undefined;
  30954. // Only invoke if we have `lastArgs` which means `func` has been
  30955. // debounced at least once.
  30956. if (trailing && lastArgs) {
  30957. return invokeFunc(time);
  30958. }
  30959. lastArgs = lastThis = undefined;
  30960. return result;
  30961. }
  30962. function cancel() {
  30963. if (timerId !== undefined) {
  30964. clearTimeout(timerId);
  30965. }
  30966. lastInvokeTime = 0;
  30967. lastArgs = lastCallTime = lastThis = timerId = undefined;
  30968. }
  30969. function flush() {
  30970. return timerId === undefined ? result : trailingEdge(now());
  30971. }
  30972. function debounced() {
  30973. var time = now(),
  30974. isInvoking = shouldInvoke(time);
  30975. lastArgs = arguments;
  30976. lastThis = this;
  30977. lastCallTime = time;
  30978. if (isInvoking) {
  30979. if (timerId === undefined) {
  30980. return leadingEdge(lastCallTime);
  30981. }
  30982. if (maxing) {
  30983. // Handle invocations in a tight loop.
  30984. clearTimeout(timerId);
  30985. timerId = setTimeout(timerExpired, wait);
  30986. return invokeFunc(lastCallTime);
  30987. }
  30988. }
  30989. if (timerId === undefined) {
  30990. timerId = setTimeout(timerExpired, wait);
  30991. }
  30992. return result;
  30993. }
  30994. debounced.cancel = cancel;
  30995. debounced.flush = flush;
  30996. return debounced;
  30997. }
  30998. /**
  30999. * Defers invoking the `func` until the current call stack has cleared. Any
  31000. * additional arguments are provided to `func` when it's invoked.
  31001. *
  31002. * @static
  31003. * @memberOf _
  31004. * @since 0.1.0
  31005. * @category Function
  31006. * @param {Function} func The function to defer.
  31007. * @param {...*} [args] The arguments to invoke `func` with.
  31008. * @returns {number} Returns the timer id.
  31009. * @example
  31010. *
  31011. * _.defer(function(text) {
  31012. * console.log(text);
  31013. * }, 'deferred');
  31014. * // => Logs 'deferred' after one millisecond.
  31015. */
  31016. var defer = baseRest(function(func, args) {
  31017. return baseDelay(func, 1, args);
  31018. });
  31019. /**
  31020. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  31021. * provided to `func` when it's invoked.
  31022. *
  31023. * @static
  31024. * @memberOf _
  31025. * @since 0.1.0
  31026. * @category Function
  31027. * @param {Function} func The function to delay.
  31028. * @param {number} wait The number of milliseconds to delay invocation.
  31029. * @param {...*} [args] The arguments to invoke `func` with.
  31030. * @returns {number} Returns the timer id.
  31031. * @example
  31032. *
  31033. * _.delay(function(text) {
  31034. * console.log(text);
  31035. * }, 1000, 'later');
  31036. * // => Logs 'later' after one second.
  31037. */
  31038. var delay = baseRest(function(func, wait, args) {
  31039. return baseDelay(func, toNumber(wait) || 0, args);
  31040. });
  31041. /**
  31042. * Creates a function that invokes `func` with arguments reversed.
  31043. *
  31044. * @static
  31045. * @memberOf _
  31046. * @since 4.0.0
  31047. * @category Function
  31048. * @param {Function} func The function to flip arguments for.
  31049. * @returns {Function} Returns the new flipped function.
  31050. * @example
  31051. *
  31052. * var flipped = _.flip(function() {
  31053. * return _.toArray(arguments);
  31054. * });
  31055. *
  31056. * flipped('a', 'b', 'c', 'd');
  31057. * // => ['d', 'c', 'b', 'a']
  31058. */
  31059. function flip(func) {
  31060. return createWrap(func, WRAP_FLIP_FLAG);
  31061. }
  31062. /**
  31063. * Creates a function that memoizes the result of `func`. If `resolver` is
  31064. * provided, it determines the cache key for storing the result based on the
  31065. * arguments provided to the memoized function. By default, the first argument
  31066. * provided to the memoized function is used as the map cache key. The `func`
  31067. * is invoked with the `this` binding of the memoized function.
  31068. *
  31069. * **Note:** The cache is exposed as the `cache` property on the memoized
  31070. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  31071. * constructor with one whose instances implement the
  31072. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  31073. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  31074. *
  31075. * @static
  31076. * @memberOf _
  31077. * @since 0.1.0
  31078. * @category Function
  31079. * @param {Function} func The function to have its output memoized.
  31080. * @param {Function} [resolver] The function to resolve the cache key.
  31081. * @returns {Function} Returns the new memoized function.
  31082. * @example
  31083. *
  31084. * var object = { 'a': 1, 'b': 2 };
  31085. * var other = { 'c': 3, 'd': 4 };
  31086. *
  31087. * var values = _.memoize(_.values);
  31088. * values(object);
  31089. * // => [1, 2]
  31090. *
  31091. * values(other);
  31092. * // => [3, 4]
  31093. *
  31094. * object.a = 2;
  31095. * values(object);
  31096. * // => [1, 2]
  31097. *
  31098. * // Modify the result cache.
  31099. * values.cache.set(object, ['a', 'b']);
  31100. * values(object);
  31101. * // => ['a', 'b']
  31102. *
  31103. * // Replace `_.memoize.Cache`.
  31104. * _.memoize.Cache = WeakMap;
  31105. */
  31106. function memoize(func, resolver) {
  31107. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  31108. throw new TypeError(FUNC_ERROR_TEXT);
  31109. }
  31110. var memoized = function() {
  31111. var args = arguments,
  31112. key = resolver ? resolver.apply(this, args) : args[0],
  31113. cache = memoized.cache;
  31114. if (cache.has(key)) {
  31115. return cache.get(key);
  31116. }
  31117. var result = func.apply(this, args);
  31118. memoized.cache = cache.set(key, result) || cache;
  31119. return result;
  31120. };
  31121. memoized.cache = new (memoize.Cache || MapCache);
  31122. return memoized;
  31123. }
  31124. // Expose `MapCache`.
  31125. memoize.Cache = MapCache;
  31126. /**
  31127. * Creates a function that negates the result of the predicate `func`. The
  31128. * `func` predicate is invoked with the `this` binding and arguments of the
  31129. * created function.
  31130. *
  31131. * @static
  31132. * @memberOf _
  31133. * @since 3.0.0
  31134. * @category Function
  31135. * @param {Function} predicate The predicate to negate.
  31136. * @returns {Function} Returns the new negated function.
  31137. * @example
  31138. *
  31139. * function isEven(n) {
  31140. * return n % 2 == 0;
  31141. * }
  31142. *
  31143. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  31144. * // => [1, 3, 5]
  31145. */
  31146. function negate(predicate) {
  31147. if (typeof predicate != 'function') {
  31148. throw new TypeError(FUNC_ERROR_TEXT);
  31149. }
  31150. return function() {
  31151. var args = arguments;
  31152. switch (args.length) {
  31153. case 0: return !predicate.call(this);
  31154. case 1: return !predicate.call(this, args[0]);
  31155. case 2: return !predicate.call(this, args[0], args[1]);
  31156. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  31157. }
  31158. return !predicate.apply(this, args);
  31159. };
  31160. }
  31161. /**
  31162. * Creates a function that is restricted to invoking `func` once. Repeat calls
  31163. * to the function return the value of the first invocation. The `func` is
  31164. * invoked with the `this` binding and arguments of the created function.
  31165. *
  31166. * @static
  31167. * @memberOf _
  31168. * @since 0.1.0
  31169. * @category Function
  31170. * @param {Function} func The function to restrict.
  31171. * @returns {Function} Returns the new restricted function.
  31172. * @example
  31173. *
  31174. * var initialize = _.once(createApplication);
  31175. * initialize();
  31176. * initialize();
  31177. * // => `createApplication` is invoked once
  31178. */
  31179. function once(func) {
  31180. return before(2, func);
  31181. }
  31182. /**
  31183. * Creates a function that invokes `func` with its arguments transformed.
  31184. *
  31185. * @static
  31186. * @since 4.0.0
  31187. * @memberOf _
  31188. * @category Function
  31189. * @param {Function} func The function to wrap.
  31190. * @param {...(Function|Function[])} [transforms=[_.identity]]
  31191. * The argument transforms.
  31192. * @returns {Function} Returns the new function.
  31193. * @example
  31194. *
  31195. * function doubled(n) {
  31196. * return n * 2;
  31197. * }
  31198. *
  31199. * function square(n) {
  31200. * return n * n;
  31201. * }
  31202. *
  31203. * var func = _.overArgs(function(x, y) {
  31204. * return [x, y];
  31205. * }, [square, doubled]);
  31206. *
  31207. * func(9, 3);
  31208. * // => [81, 6]
  31209. *
  31210. * func(10, 5);
  31211. * // => [100, 10]
  31212. */
  31213. var overArgs = castRest(function(func, transforms) {
  31214. transforms = (transforms.length == 1 && isArray(transforms[0]))
  31215. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  31216. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  31217. var funcsLength = transforms.length;
  31218. return baseRest(function(args) {
  31219. var index = -1,
  31220. length = nativeMin(args.length, funcsLength);
  31221. while (++index < length) {
  31222. args[index] = transforms[index].call(this, args[index]);
  31223. }
  31224. return apply(func, this, args);
  31225. });
  31226. });
  31227. /**
  31228. * Creates a function that invokes `func` with `partials` prepended to the
  31229. * arguments it receives. This method is like `_.bind` except it does **not**
  31230. * alter the `this` binding.
  31231. *
  31232. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  31233. * builds, may be used as a placeholder for partially applied arguments.
  31234. *
  31235. * **Note:** This method doesn't set the "length" property of partially
  31236. * applied functions.
  31237. *
  31238. * @static
  31239. * @memberOf _
  31240. * @since 0.2.0
  31241. * @category Function
  31242. * @param {Function} func The function to partially apply arguments to.
  31243. * @param {...*} [partials] The arguments to be partially applied.
  31244. * @returns {Function} Returns the new partially applied function.
  31245. * @example
  31246. *
  31247. * function greet(greeting, name) {
  31248. * return greeting + ' ' + name;
  31249. * }
  31250. *
  31251. * var sayHelloTo = _.partial(greet, 'hello');
  31252. * sayHelloTo('fred');
  31253. * // => 'hello fred'
  31254. *
  31255. * // Partially applied with placeholders.
  31256. * var greetFred = _.partial(greet, _, 'fred');
  31257. * greetFred('hi');
  31258. * // => 'hi fred'
  31259. */
  31260. var partial = baseRest(function(func, partials) {
  31261. var holders = replaceHolders(partials, getHolder(partial));
  31262. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  31263. });
  31264. /**
  31265. * This method is like `_.partial` except that partially applied arguments
  31266. * are appended to the arguments it receives.
  31267. *
  31268. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  31269. * builds, may be used as a placeholder for partially applied arguments.
  31270. *
  31271. * **Note:** This method doesn't set the "length" property of partially
  31272. * applied functions.
  31273. *
  31274. * @static
  31275. * @memberOf _
  31276. * @since 1.0.0
  31277. * @category Function
  31278. * @param {Function} func The function to partially apply arguments to.
  31279. * @param {...*} [partials] The arguments to be partially applied.
  31280. * @returns {Function} Returns the new partially applied function.
  31281. * @example
  31282. *
  31283. * function greet(greeting, name) {
  31284. * return greeting + ' ' + name;
  31285. * }
  31286. *
  31287. * var greetFred = _.partialRight(greet, 'fred');
  31288. * greetFred('hi');
  31289. * // => 'hi fred'
  31290. *
  31291. * // Partially applied with placeholders.
  31292. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  31293. * sayHelloTo('fred');
  31294. * // => 'hello fred'
  31295. */
  31296. var partialRight = baseRest(function(func, partials) {
  31297. var holders = replaceHolders(partials, getHolder(partialRight));
  31298. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  31299. });
  31300. /**
  31301. * Creates a function that invokes `func` with arguments arranged according
  31302. * to the specified `indexes` where the argument value at the first index is
  31303. * provided as the first argument, the argument value at the second index is
  31304. * provided as the second argument, and so on.
  31305. *
  31306. * @static
  31307. * @memberOf _
  31308. * @since 3.0.0
  31309. * @category Function
  31310. * @param {Function} func The function to rearrange arguments for.
  31311. * @param {...(number|number[])} indexes The arranged argument indexes.
  31312. * @returns {Function} Returns the new function.
  31313. * @example
  31314. *
  31315. * var rearged = _.rearg(function(a, b, c) {
  31316. * return [a, b, c];
  31317. * }, [2, 0, 1]);
  31318. *
  31319. * rearged('b', 'c', 'a')
  31320. * // => ['a', 'b', 'c']
  31321. */
  31322. var rearg = flatRest(function(func, indexes) {
  31323. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  31324. });
  31325. /**
  31326. * Creates a function that invokes `func` with the `this` binding of the
  31327. * created function and arguments from `start` and beyond provided as
  31328. * an array.
  31329. *
  31330. * **Note:** This method is based on the
  31331. * [rest parameter](https://mdn.io/rest_parameters).
  31332. *
  31333. * @static
  31334. * @memberOf _
  31335. * @since 4.0.0
  31336. * @category Function
  31337. * @param {Function} func The function to apply a rest parameter to.
  31338. * @param {number} [start=func.length-1] The start position of the rest parameter.
  31339. * @returns {Function} Returns the new function.
  31340. * @example
  31341. *
  31342. * var say = _.rest(function(what, names) {
  31343. * return what + ' ' + _.initial(names).join(', ') +
  31344. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  31345. * });
  31346. *
  31347. * say('hello', 'fred', 'barney', 'pebbles');
  31348. * // => 'hello fred, barney, & pebbles'
  31349. */
  31350. function rest(func, start) {
  31351. if (typeof func != 'function') {
  31352. throw new TypeError(FUNC_ERROR_TEXT);
  31353. }
  31354. start = start === undefined ? start : toInteger(start);
  31355. return baseRest(func, start);
  31356. }
  31357. /**
  31358. * Creates a function that invokes `func` with the `this` binding of the
  31359. * create function and an array of arguments much like
  31360. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  31361. *
  31362. * **Note:** This method is based on the
  31363. * [spread operator](https://mdn.io/spread_operator).
  31364. *
  31365. * @static
  31366. * @memberOf _
  31367. * @since 3.2.0
  31368. * @category Function
  31369. * @param {Function} func The function to spread arguments over.
  31370. * @param {number} [start=0] The start position of the spread.
  31371. * @returns {Function} Returns the new function.
  31372. * @example
  31373. *
  31374. * var say = _.spread(function(who, what) {
  31375. * return who + ' says ' + what;
  31376. * });
  31377. *
  31378. * say(['fred', 'hello']);
  31379. * // => 'fred says hello'
  31380. *
  31381. * var numbers = Promise.all([
  31382. * Promise.resolve(40),
  31383. * Promise.resolve(36)
  31384. * ]);
  31385. *
  31386. * numbers.then(_.spread(function(x, y) {
  31387. * return x + y;
  31388. * }));
  31389. * // => a Promise of 76
  31390. */
  31391. function spread(func, start) {
  31392. if (typeof func != 'function') {
  31393. throw new TypeError(FUNC_ERROR_TEXT);
  31394. }
  31395. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  31396. return baseRest(function(args) {
  31397. var array = args[start],
  31398. otherArgs = castSlice(args, 0, start);
  31399. if (array) {
  31400. arrayPush(otherArgs, array);
  31401. }
  31402. return apply(func, this, otherArgs);
  31403. });
  31404. }
  31405. /**
  31406. * Creates a throttled function that only invokes `func` at most once per
  31407. * every `wait` milliseconds. The throttled function comes with a `cancel`
  31408. * method to cancel delayed `func` invocations and a `flush` method to
  31409. * immediately invoke them. Provide `options` to indicate whether `func`
  31410. * should be invoked on the leading and/or trailing edge of the `wait`
  31411. * timeout. The `func` is invoked with the last arguments provided to the
  31412. * throttled function. Subsequent calls to the throttled function return the
  31413. * result of the last `func` invocation.
  31414. *
  31415. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  31416. * invoked on the trailing edge of the timeout only if the throttled function
  31417. * is invoked more than once during the `wait` timeout.
  31418. *
  31419. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  31420. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  31421. *
  31422. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  31423. * for details over the differences between `_.throttle` and `_.debounce`.
  31424. *
  31425. * @static
  31426. * @memberOf _
  31427. * @since 0.1.0
  31428. * @category Function
  31429. * @param {Function} func The function to throttle.
  31430. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  31431. * @param {Object} [options={}] The options object.
  31432. * @param {boolean} [options.leading=true]
  31433. * Specify invoking on the leading edge of the timeout.
  31434. * @param {boolean} [options.trailing=true]
  31435. * Specify invoking on the trailing edge of the timeout.
  31436. * @returns {Function} Returns the new throttled function.
  31437. * @example
  31438. *
  31439. * // Avoid excessively updating the position while scrolling.
  31440. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  31441. *
  31442. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  31443. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  31444. * jQuery(element).on('click', throttled);
  31445. *
  31446. * // Cancel the trailing throttled invocation.
  31447. * jQuery(window).on('popstate', throttled.cancel);
  31448. */
  31449. function throttle(func, wait, options) {
  31450. var leading = true,
  31451. trailing = true;
  31452. if (typeof func != 'function') {
  31453. throw new TypeError(FUNC_ERROR_TEXT);
  31454. }
  31455. if (isObject(options)) {
  31456. leading = 'leading' in options ? !!options.leading : leading;
  31457. trailing = 'trailing' in options ? !!options.trailing : trailing;
  31458. }
  31459. return debounce(func, wait, {
  31460. 'leading': leading,
  31461. 'maxWait': wait,
  31462. 'trailing': trailing
  31463. });
  31464. }
  31465. /**
  31466. * Creates a function that accepts up to one argument, ignoring any
  31467. * additional arguments.
  31468. *
  31469. * @static
  31470. * @memberOf _
  31471. * @since 4.0.0
  31472. * @category Function
  31473. * @param {Function} func The function to cap arguments for.
  31474. * @returns {Function} Returns the new capped function.
  31475. * @example
  31476. *
  31477. * _.map(['6', '8', '10'], _.unary(parseInt));
  31478. * // => [6, 8, 10]
  31479. */
  31480. function unary(func) {
  31481. return ary(func, 1);
  31482. }
  31483. /**
  31484. * Creates a function that provides `value` to `wrapper` as its first
  31485. * argument. Any additional arguments provided to the function are appended
  31486. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  31487. * binding of the created function.
  31488. *
  31489. * @static
  31490. * @memberOf _
  31491. * @since 0.1.0
  31492. * @category Function
  31493. * @param {*} value The value to wrap.
  31494. * @param {Function} [wrapper=identity] The wrapper function.
  31495. * @returns {Function} Returns the new function.
  31496. * @example
  31497. *
  31498. * var p = _.wrap(_.escape, function(func, text) {
  31499. * return '<p>' + func(text) + '</p>';
  31500. * });
  31501. *
  31502. * p('fred, barney, & pebbles');
  31503. * // => '<p>fred, barney, &amp; pebbles</p>'
  31504. */
  31505. function wrap(value, wrapper) {
  31506. return partial(castFunction(wrapper), value);
  31507. }
  31508. /*------------------------------------------------------------------------*/
  31509. /**
  31510. * Casts `value` as an array if it's not one.
  31511. *
  31512. * @static
  31513. * @memberOf _
  31514. * @since 4.4.0
  31515. * @category Lang
  31516. * @param {*} value The value to inspect.
  31517. * @returns {Array} Returns the cast array.
  31518. * @example
  31519. *
  31520. * _.castArray(1);
  31521. * // => [1]
  31522. *
  31523. * _.castArray({ 'a': 1 });
  31524. * // => [{ 'a': 1 }]
  31525. *
  31526. * _.castArray('abc');
  31527. * // => ['abc']
  31528. *
  31529. * _.castArray(null);
  31530. * // => [null]
  31531. *
  31532. * _.castArray(undefined);
  31533. * // => [undefined]
  31534. *
  31535. * _.castArray();
  31536. * // => []
  31537. *
  31538. * var array = [1, 2, 3];
  31539. * console.log(_.castArray(array) === array);
  31540. * // => true
  31541. */
  31542. function castArray() {
  31543. if (!arguments.length) {
  31544. return [];
  31545. }
  31546. var value = arguments[0];
  31547. return isArray(value) ? value : [value];
  31548. }
  31549. /**
  31550. * Creates a shallow clone of `value`.
  31551. *
  31552. * **Note:** This method is loosely based on the
  31553. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  31554. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  31555. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  31556. * arrays. The own enumerable properties of `arguments` objects are cloned
  31557. * as plain objects. An empty object is returned for uncloneable values such
  31558. * as error objects, functions, DOM nodes, and WeakMaps.
  31559. *
  31560. * @static
  31561. * @memberOf _
  31562. * @since 0.1.0
  31563. * @category Lang
  31564. * @param {*} value The value to clone.
  31565. * @returns {*} Returns the cloned value.
  31566. * @see _.cloneDeep
  31567. * @example
  31568. *
  31569. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  31570. *
  31571. * var shallow = _.clone(objects);
  31572. * console.log(shallow[0] === objects[0]);
  31573. * // => true
  31574. */
  31575. function clone(value) {
  31576. return baseClone(value, CLONE_SYMBOLS_FLAG);
  31577. }
  31578. /**
  31579. * This method is like `_.clone` except that it accepts `customizer` which
  31580. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  31581. * cloning is handled by the method instead. The `customizer` is invoked with
  31582. * up to four arguments; (value [, index|key, object, stack]).
  31583. *
  31584. * @static
  31585. * @memberOf _
  31586. * @since 4.0.0
  31587. * @category Lang
  31588. * @param {*} value The value to clone.
  31589. * @param {Function} [customizer] The function to customize cloning.
  31590. * @returns {*} Returns the cloned value.
  31591. * @see _.cloneDeepWith
  31592. * @example
  31593. *
  31594. * function customizer(value) {
  31595. * if (_.isElement(value)) {
  31596. * return value.cloneNode(false);
  31597. * }
  31598. * }
  31599. *
  31600. * var el = _.cloneWith(document.body, customizer);
  31601. *
  31602. * console.log(el === document.body);
  31603. * // => false
  31604. * console.log(el.nodeName);
  31605. * // => 'BODY'
  31606. * console.log(el.childNodes.length);
  31607. * // => 0
  31608. */
  31609. function cloneWith(value, customizer) {
  31610. customizer = typeof customizer == 'function' ? customizer : undefined;
  31611. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  31612. }
  31613. /**
  31614. * This method is like `_.clone` except that it recursively clones `value`.
  31615. *
  31616. * @static
  31617. * @memberOf _
  31618. * @since 1.0.0
  31619. * @category Lang
  31620. * @param {*} value The value to recursively clone.
  31621. * @returns {*} Returns the deep cloned value.
  31622. * @see _.clone
  31623. * @example
  31624. *
  31625. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  31626. *
  31627. * var deep = _.cloneDeep(objects);
  31628. * console.log(deep[0] === objects[0]);
  31629. * // => false
  31630. */
  31631. function cloneDeep(value) {
  31632. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  31633. }
  31634. /**
  31635. * This method is like `_.cloneWith` except that it recursively clones `value`.
  31636. *
  31637. * @static
  31638. * @memberOf _
  31639. * @since 4.0.0
  31640. * @category Lang
  31641. * @param {*} value The value to recursively clone.
  31642. * @param {Function} [customizer] The function to customize cloning.
  31643. * @returns {*} Returns the deep cloned value.
  31644. * @see _.cloneWith
  31645. * @example
  31646. *
  31647. * function customizer(value) {
  31648. * if (_.isElement(value)) {
  31649. * return value.cloneNode(true);
  31650. * }
  31651. * }
  31652. *
  31653. * var el = _.cloneDeepWith(document.body, customizer);
  31654. *
  31655. * console.log(el === document.body);
  31656. * // => false
  31657. * console.log(el.nodeName);
  31658. * // => 'BODY'
  31659. * console.log(el.childNodes.length);
  31660. * // => 20
  31661. */
  31662. function cloneDeepWith(value, customizer) {
  31663. customizer = typeof customizer == 'function' ? customizer : undefined;
  31664. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  31665. }
  31666. /**
  31667. * Checks if `object` conforms to `source` by invoking the predicate
  31668. * properties of `source` with the corresponding property values of `object`.
  31669. *
  31670. * **Note:** This method is equivalent to `_.conforms` when `source` is
  31671. * partially applied.
  31672. *
  31673. * @static
  31674. * @memberOf _
  31675. * @since 4.14.0
  31676. * @category Lang
  31677. * @param {Object} object The object to inspect.
  31678. * @param {Object} source The object of property predicates to conform to.
  31679. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  31680. * @example
  31681. *
  31682. * var object = { 'a': 1, 'b': 2 };
  31683. *
  31684. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  31685. * // => true
  31686. *
  31687. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  31688. * // => false
  31689. */
  31690. function conformsTo(object, source) {
  31691. return source == null || baseConformsTo(object, source, keys(source));
  31692. }
  31693. /**
  31694. * Performs a
  31695. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  31696. * comparison between two values to determine if they are equivalent.
  31697. *
  31698. * @static
  31699. * @memberOf _
  31700. * @since 4.0.0
  31701. * @category Lang
  31702. * @param {*} value The value to compare.
  31703. * @param {*} other The other value to compare.
  31704. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  31705. * @example
  31706. *
  31707. * var object = { 'a': 1 };
  31708. * var other = { 'a': 1 };
  31709. *
  31710. * _.eq(object, object);
  31711. * // => true
  31712. *
  31713. * _.eq(object, other);
  31714. * // => false
  31715. *
  31716. * _.eq('a', 'a');
  31717. * // => true
  31718. *
  31719. * _.eq('a', Object('a'));
  31720. * // => false
  31721. *
  31722. * _.eq(NaN, NaN);
  31723. * // => true
  31724. */
  31725. function eq(value, other) {
  31726. return value === other || (value !== value && other !== other);
  31727. }
  31728. /**
  31729. * Checks if `value` is greater than `other`.
  31730. *
  31731. * @static
  31732. * @memberOf _
  31733. * @since 3.9.0
  31734. * @category Lang
  31735. * @param {*} value The value to compare.
  31736. * @param {*} other The other value to compare.
  31737. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  31738. * else `false`.
  31739. * @see _.lt
  31740. * @example
  31741. *
  31742. * _.gt(3, 1);
  31743. * // => true
  31744. *
  31745. * _.gt(3, 3);
  31746. * // => false
  31747. *
  31748. * _.gt(1, 3);
  31749. * // => false
  31750. */
  31751. var gt = createRelationalOperation(baseGt);
  31752. /**
  31753. * Checks if `value` is greater than or equal to `other`.
  31754. *
  31755. * @static
  31756. * @memberOf _
  31757. * @since 3.9.0
  31758. * @category Lang
  31759. * @param {*} value The value to compare.
  31760. * @param {*} other The other value to compare.
  31761. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  31762. * `other`, else `false`.
  31763. * @see _.lte
  31764. * @example
  31765. *
  31766. * _.gte(3, 1);
  31767. * // => true
  31768. *
  31769. * _.gte(3, 3);
  31770. * // => true
  31771. *
  31772. * _.gte(1, 3);
  31773. * // => false
  31774. */
  31775. var gte = createRelationalOperation(function(value, other) {
  31776. return value >= other;
  31777. });
  31778. /**
  31779. * Checks if `value` is likely an `arguments` object.
  31780. *
  31781. * @static
  31782. * @memberOf _
  31783. * @since 0.1.0
  31784. * @category Lang
  31785. * @param {*} value The value to check.
  31786. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  31787. * else `false`.
  31788. * @example
  31789. *
  31790. * _.isArguments(function() { return arguments; }());
  31791. * // => true
  31792. *
  31793. * _.isArguments([1, 2, 3]);
  31794. * // => false
  31795. */
  31796. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  31797. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  31798. !propertyIsEnumerable.call(value, 'callee');
  31799. };
  31800. /**
  31801. * Checks if `value` is classified as an `Array` object.
  31802. *
  31803. * @static
  31804. * @memberOf _
  31805. * @since 0.1.0
  31806. * @category Lang
  31807. * @param {*} value The value to check.
  31808. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  31809. * @example
  31810. *
  31811. * _.isArray([1, 2, 3]);
  31812. * // => true
  31813. *
  31814. * _.isArray(document.body.children);
  31815. * // => false
  31816. *
  31817. * _.isArray('abc');
  31818. * // => false
  31819. *
  31820. * _.isArray(_.noop);
  31821. * // => false
  31822. */
  31823. var isArray = Array.isArray;
  31824. /**
  31825. * Checks if `value` is classified as an `ArrayBuffer` object.
  31826. *
  31827. * @static
  31828. * @memberOf _
  31829. * @since 4.3.0
  31830. * @category Lang
  31831. * @param {*} value The value to check.
  31832. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  31833. * @example
  31834. *
  31835. * _.isArrayBuffer(new ArrayBuffer(2));
  31836. * // => true
  31837. *
  31838. * _.isArrayBuffer(new Array(2));
  31839. * // => false
  31840. */
  31841. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  31842. /**
  31843. * Checks if `value` is array-like. A value is considered array-like if it's
  31844. * not a function and has a `value.length` that's an integer greater than or
  31845. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  31846. *
  31847. * @static
  31848. * @memberOf _
  31849. * @since 4.0.0
  31850. * @category Lang
  31851. * @param {*} value The value to check.
  31852. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  31853. * @example
  31854. *
  31855. * _.isArrayLike([1, 2, 3]);
  31856. * // => true
  31857. *
  31858. * _.isArrayLike(document.body.children);
  31859. * // => true
  31860. *
  31861. * _.isArrayLike('abc');
  31862. * // => true
  31863. *
  31864. * _.isArrayLike(_.noop);
  31865. * // => false
  31866. */
  31867. function isArrayLike(value) {
  31868. return value != null && isLength(value.length) && !isFunction(value);
  31869. }
  31870. /**
  31871. * This method is like `_.isArrayLike` except that it also checks if `value`
  31872. * is an object.
  31873. *
  31874. * @static
  31875. * @memberOf _
  31876. * @since 4.0.0
  31877. * @category Lang
  31878. * @param {*} value The value to check.
  31879. * @returns {boolean} Returns `true` if `value` is an array-like object,
  31880. * else `false`.
  31881. * @example
  31882. *
  31883. * _.isArrayLikeObject([1, 2, 3]);
  31884. * // => true
  31885. *
  31886. * _.isArrayLikeObject(document.body.children);
  31887. * // => true
  31888. *
  31889. * _.isArrayLikeObject('abc');
  31890. * // => false
  31891. *
  31892. * _.isArrayLikeObject(_.noop);
  31893. * // => false
  31894. */
  31895. function isArrayLikeObject(value) {
  31896. return isObjectLike(value) && isArrayLike(value);
  31897. }
  31898. /**
  31899. * Checks if `value` is classified as a boolean primitive or object.
  31900. *
  31901. * @static
  31902. * @memberOf _
  31903. * @since 0.1.0
  31904. * @category Lang
  31905. * @param {*} value The value to check.
  31906. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  31907. * @example
  31908. *
  31909. * _.isBoolean(false);
  31910. * // => true
  31911. *
  31912. * _.isBoolean(null);
  31913. * // => false
  31914. */
  31915. function isBoolean(value) {
  31916. return value === true || value === false ||
  31917. (isObjectLike(value) && baseGetTag(value) == boolTag);
  31918. }
  31919. /**
  31920. * Checks if `value` is a buffer.
  31921. *
  31922. * @static
  31923. * @memberOf _
  31924. * @since 4.3.0
  31925. * @category Lang
  31926. * @param {*} value The value to check.
  31927. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  31928. * @example
  31929. *
  31930. * _.isBuffer(new Buffer(2));
  31931. * // => true
  31932. *
  31933. * _.isBuffer(new Uint8Array(2));
  31934. * // => false
  31935. */
  31936. var isBuffer = nativeIsBuffer || stubFalse;
  31937. /**
  31938. * Checks if `value` is classified as a `Date` object.
  31939. *
  31940. * @static
  31941. * @memberOf _
  31942. * @since 0.1.0
  31943. * @category Lang
  31944. * @param {*} value The value to check.
  31945. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  31946. * @example
  31947. *
  31948. * _.isDate(new Date);
  31949. * // => true
  31950. *
  31951. * _.isDate('Mon April 23 2012');
  31952. * // => false
  31953. */
  31954. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  31955. /**
  31956. * Checks if `value` is likely a DOM element.
  31957. *
  31958. * @static
  31959. * @memberOf _
  31960. * @since 0.1.0
  31961. * @category Lang
  31962. * @param {*} value The value to check.
  31963. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  31964. * @example
  31965. *
  31966. * _.isElement(document.body);
  31967. * // => true
  31968. *
  31969. * _.isElement('<body>');
  31970. * // => false
  31971. */
  31972. function isElement(value) {
  31973. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  31974. }
  31975. /**
  31976. * Checks if `value` is an empty object, collection, map, or set.
  31977. *
  31978. * Objects are considered empty if they have no own enumerable string keyed
  31979. * properties.
  31980. *
  31981. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  31982. * jQuery-like collections are considered empty if they have a `length` of `0`.
  31983. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  31984. *
  31985. * @static
  31986. * @memberOf _
  31987. * @since 0.1.0
  31988. * @category Lang
  31989. * @param {*} value The value to check.
  31990. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  31991. * @example
  31992. *
  31993. * _.isEmpty(null);
  31994. * // => true
  31995. *
  31996. * _.isEmpty(true);
  31997. * // => true
  31998. *
  31999. * _.isEmpty(1);
  32000. * // => true
  32001. *
  32002. * _.isEmpty([1, 2, 3]);
  32003. * // => false
  32004. *
  32005. * _.isEmpty({ 'a': 1 });
  32006. * // => false
  32007. */
  32008. function isEmpty(value) {
  32009. if (value == null) {
  32010. return true;
  32011. }
  32012. if (isArrayLike(value) &&
  32013. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  32014. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  32015. return !value.length;
  32016. }
  32017. var tag = getTag(value);
  32018. if (tag == mapTag || tag == setTag) {
  32019. return !value.size;
  32020. }
  32021. if (isPrototype(value)) {
  32022. return !baseKeys(value).length;
  32023. }
  32024. for (var key in value) {
  32025. if (hasOwnProperty.call(value, key)) {
  32026. return false;
  32027. }
  32028. }
  32029. return true;
  32030. }
  32031. /**
  32032. * Performs a deep comparison between two values to determine if they are
  32033. * equivalent.
  32034. *
  32035. * **Note:** This method supports comparing arrays, array buffers, booleans,
  32036. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  32037. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  32038. * by their own, not inherited, enumerable properties. Functions and DOM
  32039. * nodes are compared by strict equality, i.e. `===`.
  32040. *
  32041. * @static
  32042. * @memberOf _
  32043. * @since 0.1.0
  32044. * @category Lang
  32045. * @param {*} value The value to compare.
  32046. * @param {*} other The other value to compare.
  32047. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  32048. * @example
  32049. *
  32050. * var object = { 'a': 1 };
  32051. * var other = { 'a': 1 };
  32052. *
  32053. * _.isEqual(object, other);
  32054. * // => true
  32055. *
  32056. * object === other;
  32057. * // => false
  32058. */
  32059. function isEqual(value, other) {
  32060. return baseIsEqual(value, other);
  32061. }
  32062. /**
  32063. * This method is like `_.isEqual` except that it accepts `customizer` which
  32064. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  32065. * are handled by the method instead. The `customizer` is invoked with up to
  32066. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  32067. *
  32068. * @static
  32069. * @memberOf _
  32070. * @since 4.0.0
  32071. * @category Lang
  32072. * @param {*} value The value to compare.
  32073. * @param {*} other The other value to compare.
  32074. * @param {Function} [customizer] The function to customize comparisons.
  32075. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  32076. * @example
  32077. *
  32078. * function isGreeting(value) {
  32079. * return /^h(?:i|ello)$/.test(value);
  32080. * }
  32081. *
  32082. * function customizer(objValue, othValue) {
  32083. * if (isGreeting(objValue) && isGreeting(othValue)) {
  32084. * return true;
  32085. * }
  32086. * }
  32087. *
  32088. * var array = ['hello', 'goodbye'];
  32089. * var other = ['hi', 'goodbye'];
  32090. *
  32091. * _.isEqualWith(array, other, customizer);
  32092. * // => true
  32093. */
  32094. function isEqualWith(value, other, customizer) {
  32095. customizer = typeof customizer == 'function' ? customizer : undefined;
  32096. var result = customizer ? customizer(value, other) : undefined;
  32097. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  32098. }
  32099. /**
  32100. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  32101. * `SyntaxError`, `TypeError`, or `URIError` object.
  32102. *
  32103. * @static
  32104. * @memberOf _
  32105. * @since 3.0.0
  32106. * @category Lang
  32107. * @param {*} value The value to check.
  32108. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  32109. * @example
  32110. *
  32111. * _.isError(new Error);
  32112. * // => true
  32113. *
  32114. * _.isError(Error);
  32115. * // => false
  32116. */
  32117. function isError(value) {
  32118. if (!isObjectLike(value)) {
  32119. return false;
  32120. }
  32121. var tag = baseGetTag(value);
  32122. return tag == errorTag || tag == domExcTag ||
  32123. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  32124. }
  32125. /**
  32126. * Checks if `value` is a finite primitive number.
  32127. *
  32128. * **Note:** This method is based on
  32129. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  32130. *
  32131. * @static
  32132. * @memberOf _
  32133. * @since 0.1.0
  32134. * @category Lang
  32135. * @param {*} value The value to check.
  32136. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  32137. * @example
  32138. *
  32139. * _.isFinite(3);
  32140. * // => true
  32141. *
  32142. * _.isFinite(Number.MIN_VALUE);
  32143. * // => true
  32144. *
  32145. * _.isFinite(Infinity);
  32146. * // => false
  32147. *
  32148. * _.isFinite('3');
  32149. * // => false
  32150. */
  32151. function isFinite(value) {
  32152. return typeof value == 'number' && nativeIsFinite(value);
  32153. }
  32154. /**
  32155. * Checks if `value` is classified as a `Function` object.
  32156. *
  32157. * @static
  32158. * @memberOf _
  32159. * @since 0.1.0
  32160. * @category Lang
  32161. * @param {*} value The value to check.
  32162. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  32163. * @example
  32164. *
  32165. * _.isFunction(_);
  32166. * // => true
  32167. *
  32168. * _.isFunction(/abc/);
  32169. * // => false
  32170. */
  32171. function isFunction(value) {
  32172. if (!isObject(value)) {
  32173. return false;
  32174. }
  32175. // The use of `Object#toString` avoids issues with the `typeof` operator
  32176. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  32177. var tag = baseGetTag(value);
  32178. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  32179. }
  32180. /**
  32181. * Checks if `value` is an integer.
  32182. *
  32183. * **Note:** This method is based on
  32184. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  32185. *
  32186. * @static
  32187. * @memberOf _
  32188. * @since 4.0.0
  32189. * @category Lang
  32190. * @param {*} value The value to check.
  32191. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  32192. * @example
  32193. *
  32194. * _.isInteger(3);
  32195. * // => true
  32196. *
  32197. * _.isInteger(Number.MIN_VALUE);
  32198. * // => false
  32199. *
  32200. * _.isInteger(Infinity);
  32201. * // => false
  32202. *
  32203. * _.isInteger('3');
  32204. * // => false
  32205. */
  32206. function isInteger(value) {
  32207. return typeof value == 'number' && value == toInteger(value);
  32208. }
  32209. /**
  32210. * Checks if `value` is a valid array-like length.
  32211. *
  32212. * **Note:** This method is loosely based on
  32213. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  32214. *
  32215. * @static
  32216. * @memberOf _
  32217. * @since 4.0.0
  32218. * @category Lang
  32219. * @param {*} value The value to check.
  32220. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  32221. * @example
  32222. *
  32223. * _.isLength(3);
  32224. * // => true
  32225. *
  32226. * _.isLength(Number.MIN_VALUE);
  32227. * // => false
  32228. *
  32229. * _.isLength(Infinity);
  32230. * // => false
  32231. *
  32232. * _.isLength('3');
  32233. * // => false
  32234. */
  32235. function isLength(value) {
  32236. return typeof value == 'number' &&
  32237. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  32238. }
  32239. /**
  32240. * Checks if `value` is the
  32241. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  32242. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  32243. *
  32244. * @static
  32245. * @memberOf _
  32246. * @since 0.1.0
  32247. * @category Lang
  32248. * @param {*} value The value to check.
  32249. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  32250. * @example
  32251. *
  32252. * _.isObject({});
  32253. * // => true
  32254. *
  32255. * _.isObject([1, 2, 3]);
  32256. * // => true
  32257. *
  32258. * _.isObject(_.noop);
  32259. * // => true
  32260. *
  32261. * _.isObject(null);
  32262. * // => false
  32263. */
  32264. function isObject(value) {
  32265. var type = typeof value;
  32266. return value != null && (type == 'object' || type == 'function');
  32267. }
  32268. /**
  32269. * Checks if `value` is object-like. A value is object-like if it's not `null`
  32270. * and has a `typeof` result of "object".
  32271. *
  32272. * @static
  32273. * @memberOf _
  32274. * @since 4.0.0
  32275. * @category Lang
  32276. * @param {*} value The value to check.
  32277. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  32278. * @example
  32279. *
  32280. * _.isObjectLike({});
  32281. * // => true
  32282. *
  32283. * _.isObjectLike([1, 2, 3]);
  32284. * // => true
  32285. *
  32286. * _.isObjectLike(_.noop);
  32287. * // => false
  32288. *
  32289. * _.isObjectLike(null);
  32290. * // => false
  32291. */
  32292. function isObjectLike(value) {
  32293. return value != null && typeof value == 'object';
  32294. }
  32295. /**
  32296. * Checks if `value` is classified as a `Map` object.
  32297. *
  32298. * @static
  32299. * @memberOf _
  32300. * @since 4.3.0
  32301. * @category Lang
  32302. * @param {*} value The value to check.
  32303. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  32304. * @example
  32305. *
  32306. * _.isMap(new Map);
  32307. * // => true
  32308. *
  32309. * _.isMap(new WeakMap);
  32310. * // => false
  32311. */
  32312. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  32313. /**
  32314. * Performs a partial deep comparison between `object` and `source` to
  32315. * determine if `object` contains equivalent property values.
  32316. *
  32317. * **Note:** This method is equivalent to `_.matches` when `source` is
  32318. * partially applied.
  32319. *
  32320. * Partial comparisons will match empty array and empty object `source`
  32321. * values against any array or object value, respectively. See `_.isEqual`
  32322. * for a list of supported value comparisons.
  32323. *
  32324. * @static
  32325. * @memberOf _
  32326. * @since 3.0.0
  32327. * @category Lang
  32328. * @param {Object} object The object to inspect.
  32329. * @param {Object} source The object of property values to match.
  32330. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  32331. * @example
  32332. *
  32333. * var object = { 'a': 1, 'b': 2 };
  32334. *
  32335. * _.isMatch(object, { 'b': 2 });
  32336. * // => true
  32337. *
  32338. * _.isMatch(object, { 'b': 1 });
  32339. * // => false
  32340. */
  32341. function isMatch(object, source) {
  32342. return object === source || baseIsMatch(object, source, getMatchData(source));
  32343. }
  32344. /**
  32345. * This method is like `_.isMatch` except that it accepts `customizer` which
  32346. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  32347. * are handled by the method instead. The `customizer` is invoked with five
  32348. * arguments: (objValue, srcValue, index|key, object, source).
  32349. *
  32350. * @static
  32351. * @memberOf _
  32352. * @since 4.0.0
  32353. * @category Lang
  32354. * @param {Object} object The object to inspect.
  32355. * @param {Object} source The object of property values to match.
  32356. * @param {Function} [customizer] The function to customize comparisons.
  32357. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  32358. * @example
  32359. *
  32360. * function isGreeting(value) {
  32361. * return /^h(?:i|ello)$/.test(value);
  32362. * }
  32363. *
  32364. * function customizer(objValue, srcValue) {
  32365. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  32366. * return true;
  32367. * }
  32368. * }
  32369. *
  32370. * var object = { 'greeting': 'hello' };
  32371. * var source = { 'greeting': 'hi' };
  32372. *
  32373. * _.isMatchWith(object, source, customizer);
  32374. * // => true
  32375. */
  32376. function isMatchWith(object, source, customizer) {
  32377. customizer = typeof customizer == 'function' ? customizer : undefined;
  32378. return baseIsMatch(object, source, getMatchData(source), customizer);
  32379. }
  32380. /**
  32381. * Checks if `value` is `NaN`.
  32382. *
  32383. * **Note:** This method is based on
  32384. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  32385. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  32386. * `undefined` and other non-number values.
  32387. *
  32388. * @static
  32389. * @memberOf _
  32390. * @since 0.1.0
  32391. * @category Lang
  32392. * @param {*} value The value to check.
  32393. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  32394. * @example
  32395. *
  32396. * _.isNaN(NaN);
  32397. * // => true
  32398. *
  32399. * _.isNaN(new Number(NaN));
  32400. * // => true
  32401. *
  32402. * isNaN(undefined);
  32403. * // => true
  32404. *
  32405. * _.isNaN(undefined);
  32406. * // => false
  32407. */
  32408. function isNaN(value) {
  32409. // An `NaN` primitive is the only value that is not equal to itself.
  32410. // Perform the `toStringTag` check first to avoid errors with some
  32411. // ActiveX objects in IE.
  32412. return isNumber(value) && value != +value;
  32413. }
  32414. /**
  32415. * Checks if `value` is a pristine native function.
  32416. *
  32417. * **Note:** This method can't reliably detect native functions in the presence
  32418. * of the core-js package because core-js circumvents this kind of detection.
  32419. * Despite multiple requests, the core-js maintainer has made it clear: any
  32420. * attempt to fix the detection will be obstructed. As a result, we're left
  32421. * with little choice but to throw an error. Unfortunately, this also affects
  32422. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  32423. * which rely on core-js.
  32424. *
  32425. * @static
  32426. * @memberOf _
  32427. * @since 3.0.0
  32428. * @category Lang
  32429. * @param {*} value The value to check.
  32430. * @returns {boolean} Returns `true` if `value` is a native function,
  32431. * else `false`.
  32432. * @example
  32433. *
  32434. * _.isNative(Array.prototype.push);
  32435. * // => true
  32436. *
  32437. * _.isNative(_);
  32438. * // => false
  32439. */
  32440. function isNative(value) {
  32441. if (isMaskable(value)) {
  32442. throw new Error(CORE_ERROR_TEXT);
  32443. }
  32444. return baseIsNative(value);
  32445. }
  32446. /**
  32447. * Checks if `value` is `null`.
  32448. *
  32449. * @static
  32450. * @memberOf _
  32451. * @since 0.1.0
  32452. * @category Lang
  32453. * @param {*} value The value to check.
  32454. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  32455. * @example
  32456. *
  32457. * _.isNull(null);
  32458. * // => true
  32459. *
  32460. * _.isNull(void 0);
  32461. * // => false
  32462. */
  32463. function isNull(value) {
  32464. return value === null;
  32465. }
  32466. /**
  32467. * Checks if `value` is `null` or `undefined`.
  32468. *
  32469. * @static
  32470. * @memberOf _
  32471. * @since 4.0.0
  32472. * @category Lang
  32473. * @param {*} value The value to check.
  32474. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  32475. * @example
  32476. *
  32477. * _.isNil(null);
  32478. * // => true
  32479. *
  32480. * _.isNil(void 0);
  32481. * // => true
  32482. *
  32483. * _.isNil(NaN);
  32484. * // => false
  32485. */
  32486. function isNil(value) {
  32487. return value == null;
  32488. }
  32489. /**
  32490. * Checks if `value` is classified as a `Number` primitive or object.
  32491. *
  32492. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  32493. * classified as numbers, use the `_.isFinite` method.
  32494. *
  32495. * @static
  32496. * @memberOf _
  32497. * @since 0.1.0
  32498. * @category Lang
  32499. * @param {*} value The value to check.
  32500. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  32501. * @example
  32502. *
  32503. * _.isNumber(3);
  32504. * // => true
  32505. *
  32506. * _.isNumber(Number.MIN_VALUE);
  32507. * // => true
  32508. *
  32509. * _.isNumber(Infinity);
  32510. * // => true
  32511. *
  32512. * _.isNumber('3');
  32513. * // => false
  32514. */
  32515. function isNumber(value) {
  32516. return typeof value == 'number' ||
  32517. (isObjectLike(value) && baseGetTag(value) == numberTag);
  32518. }
  32519. /**
  32520. * Checks if `value` is a plain object, that is, an object created by the
  32521. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  32522. *
  32523. * @static
  32524. * @memberOf _
  32525. * @since 0.8.0
  32526. * @category Lang
  32527. * @param {*} value The value to check.
  32528. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  32529. * @example
  32530. *
  32531. * function Foo() {
  32532. * this.a = 1;
  32533. * }
  32534. *
  32535. * _.isPlainObject(new Foo);
  32536. * // => false
  32537. *
  32538. * _.isPlainObject([1, 2, 3]);
  32539. * // => false
  32540. *
  32541. * _.isPlainObject({ 'x': 0, 'y': 0 });
  32542. * // => true
  32543. *
  32544. * _.isPlainObject(Object.create(null));
  32545. * // => true
  32546. */
  32547. function isPlainObject(value) {
  32548. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  32549. return false;
  32550. }
  32551. var proto = getPrototype(value);
  32552. if (proto === null) {
  32553. return true;
  32554. }
  32555. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  32556. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  32557. funcToString.call(Ctor) == objectCtorString;
  32558. }
  32559. /**
  32560. * Checks if `value` is classified as a `RegExp` object.
  32561. *
  32562. * @static
  32563. * @memberOf _
  32564. * @since 0.1.0
  32565. * @category Lang
  32566. * @param {*} value The value to check.
  32567. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  32568. * @example
  32569. *
  32570. * _.isRegExp(/abc/);
  32571. * // => true
  32572. *
  32573. * _.isRegExp('/abc/');
  32574. * // => false
  32575. */
  32576. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  32577. /**
  32578. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  32579. * double precision number which isn't the result of a rounded unsafe integer.
  32580. *
  32581. * **Note:** This method is based on
  32582. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  32583. *
  32584. * @static
  32585. * @memberOf _
  32586. * @since 4.0.0
  32587. * @category Lang
  32588. * @param {*} value The value to check.
  32589. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  32590. * @example
  32591. *
  32592. * _.isSafeInteger(3);
  32593. * // => true
  32594. *
  32595. * _.isSafeInteger(Number.MIN_VALUE);
  32596. * // => false
  32597. *
  32598. * _.isSafeInteger(Infinity);
  32599. * // => false
  32600. *
  32601. * _.isSafeInteger('3');
  32602. * // => false
  32603. */
  32604. function isSafeInteger(value) {
  32605. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  32606. }
  32607. /**
  32608. * Checks if `value` is classified as a `Set` object.
  32609. *
  32610. * @static
  32611. * @memberOf _
  32612. * @since 4.3.0
  32613. * @category Lang
  32614. * @param {*} value The value to check.
  32615. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  32616. * @example
  32617. *
  32618. * _.isSet(new Set);
  32619. * // => true
  32620. *
  32621. * _.isSet(new WeakSet);
  32622. * // => false
  32623. */
  32624. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  32625. /**
  32626. * Checks if `value` is classified as a `String` primitive or object.
  32627. *
  32628. * @static
  32629. * @since 0.1.0
  32630. * @memberOf _
  32631. * @category Lang
  32632. * @param {*} value The value to check.
  32633. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  32634. * @example
  32635. *
  32636. * _.isString('abc');
  32637. * // => true
  32638. *
  32639. * _.isString(1);
  32640. * // => false
  32641. */
  32642. function isString(value) {
  32643. return typeof value == 'string' ||
  32644. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  32645. }
  32646. /**
  32647. * Checks if `value` is classified as a `Symbol` primitive or object.
  32648. *
  32649. * @static
  32650. * @memberOf _
  32651. * @since 4.0.0
  32652. * @category Lang
  32653. * @param {*} value The value to check.
  32654. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  32655. * @example
  32656. *
  32657. * _.isSymbol(Symbol.iterator);
  32658. * // => true
  32659. *
  32660. * _.isSymbol('abc');
  32661. * // => false
  32662. */
  32663. function isSymbol(value) {
  32664. return typeof value == 'symbol' ||
  32665. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  32666. }
  32667. /**
  32668. * Checks if `value` is classified as a typed array.
  32669. *
  32670. * @static
  32671. * @memberOf _
  32672. * @since 3.0.0
  32673. * @category Lang
  32674. * @param {*} value The value to check.
  32675. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  32676. * @example
  32677. *
  32678. * _.isTypedArray(new Uint8Array);
  32679. * // => true
  32680. *
  32681. * _.isTypedArray([]);
  32682. * // => false
  32683. */
  32684. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  32685. /**
  32686. * Checks if `value` is `undefined`.
  32687. *
  32688. * @static
  32689. * @since 0.1.0
  32690. * @memberOf _
  32691. * @category Lang
  32692. * @param {*} value The value to check.
  32693. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  32694. * @example
  32695. *
  32696. * _.isUndefined(void 0);
  32697. * // => true
  32698. *
  32699. * _.isUndefined(null);
  32700. * // => false
  32701. */
  32702. function isUndefined(value) {
  32703. return value === undefined;
  32704. }
  32705. /**
  32706. * Checks if `value` is classified as a `WeakMap` object.
  32707. *
  32708. * @static
  32709. * @memberOf _
  32710. * @since 4.3.0
  32711. * @category Lang
  32712. * @param {*} value The value to check.
  32713. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  32714. * @example
  32715. *
  32716. * _.isWeakMap(new WeakMap);
  32717. * // => true
  32718. *
  32719. * _.isWeakMap(new Map);
  32720. * // => false
  32721. */
  32722. function isWeakMap(value) {
  32723. return isObjectLike(value) && getTag(value) == weakMapTag;
  32724. }
  32725. /**
  32726. * Checks if `value` is classified as a `WeakSet` object.
  32727. *
  32728. * @static
  32729. * @memberOf _
  32730. * @since 4.3.0
  32731. * @category Lang
  32732. * @param {*} value The value to check.
  32733. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  32734. * @example
  32735. *
  32736. * _.isWeakSet(new WeakSet);
  32737. * // => true
  32738. *
  32739. * _.isWeakSet(new Set);
  32740. * // => false
  32741. */
  32742. function isWeakSet(value) {
  32743. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  32744. }
  32745. /**
  32746. * Checks if `value` is less than `other`.
  32747. *
  32748. * @static
  32749. * @memberOf _
  32750. * @since 3.9.0
  32751. * @category Lang
  32752. * @param {*} value The value to compare.
  32753. * @param {*} other The other value to compare.
  32754. * @returns {boolean} Returns `true` if `value` is less than `other`,
  32755. * else `false`.
  32756. * @see _.gt
  32757. * @example
  32758. *
  32759. * _.lt(1, 3);
  32760. * // => true
  32761. *
  32762. * _.lt(3, 3);
  32763. * // => false
  32764. *
  32765. * _.lt(3, 1);
  32766. * // => false
  32767. */
  32768. var lt = createRelationalOperation(baseLt);
  32769. /**
  32770. * Checks if `value` is less than or equal to `other`.
  32771. *
  32772. * @static
  32773. * @memberOf _
  32774. * @since 3.9.0
  32775. * @category Lang
  32776. * @param {*} value The value to compare.
  32777. * @param {*} other The other value to compare.
  32778. * @returns {boolean} Returns `true` if `value` is less than or equal to
  32779. * `other`, else `false`.
  32780. * @see _.gte
  32781. * @example
  32782. *
  32783. * _.lte(1, 3);
  32784. * // => true
  32785. *
  32786. * _.lte(3, 3);
  32787. * // => true
  32788. *
  32789. * _.lte(3, 1);
  32790. * // => false
  32791. */
  32792. var lte = createRelationalOperation(function(value, other) {
  32793. return value <= other;
  32794. });
  32795. /**
  32796. * Converts `value` to an array.
  32797. *
  32798. * @static
  32799. * @since 0.1.0
  32800. * @memberOf _
  32801. * @category Lang
  32802. * @param {*} value The value to convert.
  32803. * @returns {Array} Returns the converted array.
  32804. * @example
  32805. *
  32806. * _.toArray({ 'a': 1, 'b': 2 });
  32807. * // => [1, 2]
  32808. *
  32809. * _.toArray('abc');
  32810. * // => ['a', 'b', 'c']
  32811. *
  32812. * _.toArray(1);
  32813. * // => []
  32814. *
  32815. * _.toArray(null);
  32816. * // => []
  32817. */
  32818. function toArray(value) {
  32819. if (!value) {
  32820. return [];
  32821. }
  32822. if (isArrayLike(value)) {
  32823. return isString(value) ? stringToArray(value) : copyArray(value);
  32824. }
  32825. if (symIterator && value[symIterator]) {
  32826. return iteratorToArray(value[symIterator]());
  32827. }
  32828. var tag = getTag(value),
  32829. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  32830. return func(value);
  32831. }
  32832. /**
  32833. * Converts `value` to a finite number.
  32834. *
  32835. * @static
  32836. * @memberOf _
  32837. * @since 4.12.0
  32838. * @category Lang
  32839. * @param {*} value The value to convert.
  32840. * @returns {number} Returns the converted number.
  32841. * @example
  32842. *
  32843. * _.toFinite(3.2);
  32844. * // => 3.2
  32845. *
  32846. * _.toFinite(Number.MIN_VALUE);
  32847. * // => 5e-324
  32848. *
  32849. * _.toFinite(Infinity);
  32850. * // => 1.7976931348623157e+308
  32851. *
  32852. * _.toFinite('3.2');
  32853. * // => 3.2
  32854. */
  32855. function toFinite(value) {
  32856. if (!value) {
  32857. return value === 0 ? value : 0;
  32858. }
  32859. value = toNumber(value);
  32860. if (value === INFINITY || value === -INFINITY) {
  32861. var sign = (value < 0 ? -1 : 1);
  32862. return sign * MAX_INTEGER;
  32863. }
  32864. return value === value ? value : 0;
  32865. }
  32866. /**
  32867. * Converts `value` to an integer.
  32868. *
  32869. * **Note:** This method is loosely based on
  32870. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  32871. *
  32872. * @static
  32873. * @memberOf _
  32874. * @since 4.0.0
  32875. * @category Lang
  32876. * @param {*} value The value to convert.
  32877. * @returns {number} Returns the converted integer.
  32878. * @example
  32879. *
  32880. * _.toInteger(3.2);
  32881. * // => 3
  32882. *
  32883. * _.toInteger(Number.MIN_VALUE);
  32884. * // => 0
  32885. *
  32886. * _.toInteger(Infinity);
  32887. * // => 1.7976931348623157e+308
  32888. *
  32889. * _.toInteger('3.2');
  32890. * // => 3
  32891. */
  32892. function toInteger(value) {
  32893. var result = toFinite(value),
  32894. remainder = result % 1;
  32895. return result === result ? (remainder ? result - remainder : result) : 0;
  32896. }
  32897. /**
  32898. * Converts `value` to an integer suitable for use as the length of an
  32899. * array-like object.
  32900. *
  32901. * **Note:** This method is based on
  32902. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  32903. *
  32904. * @static
  32905. * @memberOf _
  32906. * @since 4.0.0
  32907. * @category Lang
  32908. * @param {*} value The value to convert.
  32909. * @returns {number} Returns the converted integer.
  32910. * @example
  32911. *
  32912. * _.toLength(3.2);
  32913. * // => 3
  32914. *
  32915. * _.toLength(Number.MIN_VALUE);
  32916. * // => 0
  32917. *
  32918. * _.toLength(Infinity);
  32919. * // => 4294967295
  32920. *
  32921. * _.toLength('3.2');
  32922. * // => 3
  32923. */
  32924. function toLength(value) {
  32925. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  32926. }
  32927. /**
  32928. * Converts `value` to a number.
  32929. *
  32930. * @static
  32931. * @memberOf _
  32932. * @since 4.0.0
  32933. * @category Lang
  32934. * @param {*} value The value to process.
  32935. * @returns {number} Returns the number.
  32936. * @example
  32937. *
  32938. * _.toNumber(3.2);
  32939. * // => 3.2
  32940. *
  32941. * _.toNumber(Number.MIN_VALUE);
  32942. * // => 5e-324
  32943. *
  32944. * _.toNumber(Infinity);
  32945. * // => Infinity
  32946. *
  32947. * _.toNumber('3.2');
  32948. * // => 3.2
  32949. */
  32950. function toNumber(value) {
  32951. if (typeof value == 'number') {
  32952. return value;
  32953. }
  32954. if (isSymbol(value)) {
  32955. return NAN;
  32956. }
  32957. if (isObject(value)) {
  32958. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  32959. value = isObject(other) ? (other + '') : other;
  32960. }
  32961. if (typeof value != 'string') {
  32962. return value === 0 ? value : +value;
  32963. }
  32964. value = value.replace(reTrim, '');
  32965. var isBinary = reIsBinary.test(value);
  32966. return (isBinary || reIsOctal.test(value))
  32967. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  32968. : (reIsBadHex.test(value) ? NAN : +value);
  32969. }
  32970. /**
  32971. * Converts `value` to a plain object flattening inherited enumerable string
  32972. * keyed properties of `value` to own properties of the plain object.
  32973. *
  32974. * @static
  32975. * @memberOf _
  32976. * @since 3.0.0
  32977. * @category Lang
  32978. * @param {*} value The value to convert.
  32979. * @returns {Object} Returns the converted plain object.
  32980. * @example
  32981. *
  32982. * function Foo() {
  32983. * this.b = 2;
  32984. * }
  32985. *
  32986. * Foo.prototype.c = 3;
  32987. *
  32988. * _.assign({ 'a': 1 }, new Foo);
  32989. * // => { 'a': 1, 'b': 2 }
  32990. *
  32991. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  32992. * // => { 'a': 1, 'b': 2, 'c': 3 }
  32993. */
  32994. function toPlainObject(value) {
  32995. return copyObject(value, keysIn(value));
  32996. }
  32997. /**
  32998. * Converts `value` to a safe integer. A safe integer can be compared and
  32999. * represented correctly.
  33000. *
  33001. * @static
  33002. * @memberOf _
  33003. * @since 4.0.0
  33004. * @category Lang
  33005. * @param {*} value The value to convert.
  33006. * @returns {number} Returns the converted integer.
  33007. * @example
  33008. *
  33009. * _.toSafeInteger(3.2);
  33010. * // => 3
  33011. *
  33012. * _.toSafeInteger(Number.MIN_VALUE);
  33013. * // => 0
  33014. *
  33015. * _.toSafeInteger(Infinity);
  33016. * // => 9007199254740991
  33017. *
  33018. * _.toSafeInteger('3.2');
  33019. * // => 3
  33020. */
  33021. function toSafeInteger(value) {
  33022. return value
  33023. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  33024. : (value === 0 ? value : 0);
  33025. }
  33026. /**
  33027. * Converts `value` to a string. An empty string is returned for `null`
  33028. * and `undefined` values. The sign of `-0` is preserved.
  33029. *
  33030. * @static
  33031. * @memberOf _
  33032. * @since 4.0.0
  33033. * @category Lang
  33034. * @param {*} value The value to convert.
  33035. * @returns {string} Returns the converted string.
  33036. * @example
  33037. *
  33038. * _.toString(null);
  33039. * // => ''
  33040. *
  33041. * _.toString(-0);
  33042. * // => '-0'
  33043. *
  33044. * _.toString([1, 2, 3]);
  33045. * // => '1,2,3'
  33046. */
  33047. function toString(value) {
  33048. return value == null ? '' : baseToString(value);
  33049. }
  33050. /*------------------------------------------------------------------------*/
  33051. /**
  33052. * Assigns own enumerable string keyed properties of source objects to the
  33053. * destination object. Source objects are applied from left to right.
  33054. * Subsequent sources overwrite property assignments of previous sources.
  33055. *
  33056. * **Note:** This method mutates `object` and is loosely based on
  33057. * [`Object.assign`](https://mdn.io/Object/assign).
  33058. *
  33059. * @static
  33060. * @memberOf _
  33061. * @since 0.10.0
  33062. * @category Object
  33063. * @param {Object} object The destination object.
  33064. * @param {...Object} [sources] The source objects.
  33065. * @returns {Object} Returns `object`.
  33066. * @see _.assignIn
  33067. * @example
  33068. *
  33069. * function Foo() {
  33070. * this.a = 1;
  33071. * }
  33072. *
  33073. * function Bar() {
  33074. * this.c = 3;
  33075. * }
  33076. *
  33077. * Foo.prototype.b = 2;
  33078. * Bar.prototype.d = 4;
  33079. *
  33080. * _.assign({ 'a': 0 }, new Foo, new Bar);
  33081. * // => { 'a': 1, 'c': 3 }
  33082. */
  33083. var assign = createAssigner(function(object, source) {
  33084. if (isPrototype(source) || isArrayLike(source)) {
  33085. copyObject(source, keys(source), object);
  33086. return;
  33087. }
  33088. for (var key in source) {
  33089. if (hasOwnProperty.call(source, key)) {
  33090. assignValue(object, key, source[key]);
  33091. }
  33092. }
  33093. });
  33094. /**
  33095. * This method is like `_.assign` except that it iterates over own and
  33096. * inherited source properties.
  33097. *
  33098. * **Note:** This method mutates `object`.
  33099. *
  33100. * @static
  33101. * @memberOf _
  33102. * @since 4.0.0
  33103. * @alias extend
  33104. * @category Object
  33105. * @param {Object} object The destination object.
  33106. * @param {...Object} [sources] The source objects.
  33107. * @returns {Object} Returns `object`.
  33108. * @see _.assign
  33109. * @example
  33110. *
  33111. * function Foo() {
  33112. * this.a = 1;
  33113. * }
  33114. *
  33115. * function Bar() {
  33116. * this.c = 3;
  33117. * }
  33118. *
  33119. * Foo.prototype.b = 2;
  33120. * Bar.prototype.d = 4;
  33121. *
  33122. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  33123. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  33124. */
  33125. var assignIn = createAssigner(function(object, source) {
  33126. copyObject(source, keysIn(source), object);
  33127. });
  33128. /**
  33129. * This method is like `_.assignIn` except that it accepts `customizer`
  33130. * which is invoked to produce the assigned values. If `customizer` returns
  33131. * `undefined`, assignment is handled by the method instead. The `customizer`
  33132. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  33133. *
  33134. * **Note:** This method mutates `object`.
  33135. *
  33136. * @static
  33137. * @memberOf _
  33138. * @since 4.0.0
  33139. * @alias extendWith
  33140. * @category Object
  33141. * @param {Object} object The destination object.
  33142. * @param {...Object} sources The source objects.
  33143. * @param {Function} [customizer] The function to customize assigned values.
  33144. * @returns {Object} Returns `object`.
  33145. * @see _.assignWith
  33146. * @example
  33147. *
  33148. * function customizer(objValue, srcValue) {
  33149. * return _.isUndefined(objValue) ? srcValue : objValue;
  33150. * }
  33151. *
  33152. * var defaults = _.partialRight(_.assignInWith, customizer);
  33153. *
  33154. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  33155. * // => { 'a': 1, 'b': 2 }
  33156. */
  33157. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  33158. copyObject(source, keysIn(source), object, customizer);
  33159. });
  33160. /**
  33161. * This method is like `_.assign` except that it accepts `customizer`
  33162. * which is invoked to produce the assigned values. If `customizer` returns
  33163. * `undefined`, assignment is handled by the method instead. The `customizer`
  33164. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  33165. *
  33166. * **Note:** This method mutates `object`.
  33167. *
  33168. * @static
  33169. * @memberOf _
  33170. * @since 4.0.0
  33171. * @category Object
  33172. * @param {Object} object The destination object.
  33173. * @param {...Object} sources The source objects.
  33174. * @param {Function} [customizer] The function to customize assigned values.
  33175. * @returns {Object} Returns `object`.
  33176. * @see _.assignInWith
  33177. * @example
  33178. *
  33179. * function customizer(objValue, srcValue) {
  33180. * return _.isUndefined(objValue) ? srcValue : objValue;
  33181. * }
  33182. *
  33183. * var defaults = _.partialRight(_.assignWith, customizer);
  33184. *
  33185. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  33186. * // => { 'a': 1, 'b': 2 }
  33187. */
  33188. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  33189. copyObject(source, keys(source), object, customizer);
  33190. });
  33191. /**
  33192. * Creates an array of values corresponding to `paths` of `object`.
  33193. *
  33194. * @static
  33195. * @memberOf _
  33196. * @since 1.0.0
  33197. * @category Object
  33198. * @param {Object} object The object to iterate over.
  33199. * @param {...(string|string[])} [paths] The property paths to pick.
  33200. * @returns {Array} Returns the picked values.
  33201. * @example
  33202. *
  33203. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  33204. *
  33205. * _.at(object, ['a[0].b.c', 'a[1]']);
  33206. * // => [3, 4]
  33207. */
  33208. var at = flatRest(baseAt);
  33209. /**
  33210. * Creates an object that inherits from the `prototype` object. If a
  33211. * `properties` object is given, its own enumerable string keyed properties
  33212. * are assigned to the created object.
  33213. *
  33214. * @static
  33215. * @memberOf _
  33216. * @since 2.3.0
  33217. * @category Object
  33218. * @param {Object} prototype The object to inherit from.
  33219. * @param {Object} [properties] The properties to assign to the object.
  33220. * @returns {Object} Returns the new object.
  33221. * @example
  33222. *
  33223. * function Shape() {
  33224. * this.x = 0;
  33225. * this.y = 0;
  33226. * }
  33227. *
  33228. * function Circle() {
  33229. * Shape.call(this);
  33230. * }
  33231. *
  33232. * Circle.prototype = _.create(Shape.prototype, {
  33233. * 'constructor': Circle
  33234. * });
  33235. *
  33236. * var circle = new Circle;
  33237. * circle instanceof Circle;
  33238. * // => true
  33239. *
  33240. * circle instanceof Shape;
  33241. * // => true
  33242. */
  33243. function create(prototype, properties) {
  33244. var result = baseCreate(prototype);
  33245. return properties == null ? result : baseAssign(result, properties);
  33246. }
  33247. /**
  33248. * Assigns own and inherited enumerable string keyed properties of source
  33249. * objects to the destination object for all destination properties that
  33250. * resolve to `undefined`. Source objects are applied from left to right.
  33251. * Once a property is set, additional values of the same property are ignored.
  33252. *
  33253. * **Note:** This method mutates `object`.
  33254. *
  33255. * @static
  33256. * @since 0.1.0
  33257. * @memberOf _
  33258. * @category Object
  33259. * @param {Object} object The destination object.
  33260. * @param {...Object} [sources] The source objects.
  33261. * @returns {Object} Returns `object`.
  33262. * @see _.defaultsDeep
  33263. * @example
  33264. *
  33265. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  33266. * // => { 'a': 1, 'b': 2 }
  33267. */
  33268. var defaults = baseRest(function(object, sources) {
  33269. object = Object(object);
  33270. var index = -1;
  33271. var length = sources.length;
  33272. var guard = length > 2 ? sources[2] : undefined;
  33273. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  33274. length = 1;
  33275. }
  33276. while (++index < length) {
  33277. var source = sources[index];
  33278. var props = keysIn(source);
  33279. var propsIndex = -1;
  33280. var propsLength = props.length;
  33281. while (++propsIndex < propsLength) {
  33282. var key = props[propsIndex];
  33283. var value = object[key];
  33284. if (value === undefined ||
  33285. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  33286. object[key] = source[key];
  33287. }
  33288. }
  33289. }
  33290. return object;
  33291. });
  33292. /**
  33293. * This method is like `_.defaults` except that it recursively assigns
  33294. * default properties.
  33295. *
  33296. * **Note:** This method mutates `object`.
  33297. *
  33298. * @static
  33299. * @memberOf _
  33300. * @since 3.10.0
  33301. * @category Object
  33302. * @param {Object} object The destination object.
  33303. * @param {...Object} [sources] The source objects.
  33304. * @returns {Object} Returns `object`.
  33305. * @see _.defaults
  33306. * @example
  33307. *
  33308. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  33309. * // => { 'a': { 'b': 2, 'c': 3 } }
  33310. */
  33311. var defaultsDeep = baseRest(function(args) {
  33312. args.push(undefined, customDefaultsMerge);
  33313. return apply(mergeWith, undefined, args);
  33314. });
  33315. /**
  33316. * This method is like `_.find` except that it returns the key of the first
  33317. * element `predicate` returns truthy for instead of the element itself.
  33318. *
  33319. * @static
  33320. * @memberOf _
  33321. * @since 1.1.0
  33322. * @category Object
  33323. * @param {Object} object The object to inspect.
  33324. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  33325. * @returns {string|undefined} Returns the key of the matched element,
  33326. * else `undefined`.
  33327. * @example
  33328. *
  33329. * var users = {
  33330. * 'barney': { 'age': 36, 'active': true },
  33331. * 'fred': { 'age': 40, 'active': false },
  33332. * 'pebbles': { 'age': 1, 'active': true }
  33333. * };
  33334. *
  33335. * _.findKey(users, function(o) { return o.age < 40; });
  33336. * // => 'barney' (iteration order is not guaranteed)
  33337. *
  33338. * // The `_.matches` iteratee shorthand.
  33339. * _.findKey(users, { 'age': 1, 'active': true });
  33340. * // => 'pebbles'
  33341. *
  33342. * // The `_.matchesProperty` iteratee shorthand.
  33343. * _.findKey(users, ['active', false]);
  33344. * // => 'fred'
  33345. *
  33346. * // The `_.property` iteratee shorthand.
  33347. * _.findKey(users, 'active');
  33348. * // => 'barney'
  33349. */
  33350. function findKey(object, predicate) {
  33351. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  33352. }
  33353. /**
  33354. * This method is like `_.findKey` except that it iterates over elements of
  33355. * a collection in the opposite order.
  33356. *
  33357. * @static
  33358. * @memberOf _
  33359. * @since 2.0.0
  33360. * @category Object
  33361. * @param {Object} object The object to inspect.
  33362. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  33363. * @returns {string|undefined} Returns the key of the matched element,
  33364. * else `undefined`.
  33365. * @example
  33366. *
  33367. * var users = {
  33368. * 'barney': { 'age': 36, 'active': true },
  33369. * 'fred': { 'age': 40, 'active': false },
  33370. * 'pebbles': { 'age': 1, 'active': true }
  33371. * };
  33372. *
  33373. * _.findLastKey(users, function(o) { return o.age < 40; });
  33374. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  33375. *
  33376. * // The `_.matches` iteratee shorthand.
  33377. * _.findLastKey(users, { 'age': 36, 'active': true });
  33378. * // => 'barney'
  33379. *
  33380. * // The `_.matchesProperty` iteratee shorthand.
  33381. * _.findLastKey(users, ['active', false]);
  33382. * // => 'fred'
  33383. *
  33384. * // The `_.property` iteratee shorthand.
  33385. * _.findLastKey(users, 'active');
  33386. * // => 'pebbles'
  33387. */
  33388. function findLastKey(object, predicate) {
  33389. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  33390. }
  33391. /**
  33392. * Iterates over own and inherited enumerable string keyed properties of an
  33393. * object and invokes `iteratee` for each property. The iteratee is invoked
  33394. * with three arguments: (value, key, object). Iteratee functions may exit
  33395. * iteration early by explicitly returning `false`.
  33396. *
  33397. * @static
  33398. * @memberOf _
  33399. * @since 0.3.0
  33400. * @category Object
  33401. * @param {Object} object The object to iterate over.
  33402. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  33403. * @returns {Object} Returns `object`.
  33404. * @see _.forInRight
  33405. * @example
  33406. *
  33407. * function Foo() {
  33408. * this.a = 1;
  33409. * this.b = 2;
  33410. * }
  33411. *
  33412. * Foo.prototype.c = 3;
  33413. *
  33414. * _.forIn(new Foo, function(value, key) {
  33415. * console.log(key);
  33416. * });
  33417. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  33418. */
  33419. function forIn(object, iteratee) {
  33420. return object == null
  33421. ? object
  33422. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  33423. }
  33424. /**
  33425. * This method is like `_.forIn` except that it iterates over properties of
  33426. * `object` in the opposite order.
  33427. *
  33428. * @static
  33429. * @memberOf _
  33430. * @since 2.0.0
  33431. * @category Object
  33432. * @param {Object} object The object to iterate over.
  33433. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  33434. * @returns {Object} Returns `object`.
  33435. * @see _.forIn
  33436. * @example
  33437. *
  33438. * function Foo() {
  33439. * this.a = 1;
  33440. * this.b = 2;
  33441. * }
  33442. *
  33443. * Foo.prototype.c = 3;
  33444. *
  33445. * _.forInRight(new Foo, function(value, key) {
  33446. * console.log(key);
  33447. * });
  33448. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  33449. */
  33450. function forInRight(object, iteratee) {
  33451. return object == null
  33452. ? object
  33453. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  33454. }
  33455. /**
  33456. * Iterates over own enumerable string keyed properties of an object and
  33457. * invokes `iteratee` for each property. The iteratee is invoked with three
  33458. * arguments: (value, key, object). Iteratee functions may exit iteration
  33459. * early by explicitly returning `false`.
  33460. *
  33461. * @static
  33462. * @memberOf _
  33463. * @since 0.3.0
  33464. * @category Object
  33465. * @param {Object} object The object to iterate over.
  33466. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  33467. * @returns {Object} Returns `object`.
  33468. * @see _.forOwnRight
  33469. * @example
  33470. *
  33471. * function Foo() {
  33472. * this.a = 1;
  33473. * this.b = 2;
  33474. * }
  33475. *
  33476. * Foo.prototype.c = 3;
  33477. *
  33478. * _.forOwn(new Foo, function(value, key) {
  33479. * console.log(key);
  33480. * });
  33481. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  33482. */
  33483. function forOwn(object, iteratee) {
  33484. return object && baseForOwn(object, getIteratee(iteratee, 3));
  33485. }
  33486. /**
  33487. * This method is like `_.forOwn` except that it iterates over properties of
  33488. * `object` in the opposite order.
  33489. *
  33490. * @static
  33491. * @memberOf _
  33492. * @since 2.0.0
  33493. * @category Object
  33494. * @param {Object} object The object to iterate over.
  33495. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  33496. * @returns {Object} Returns `object`.
  33497. * @see _.forOwn
  33498. * @example
  33499. *
  33500. * function Foo() {
  33501. * this.a = 1;
  33502. * this.b = 2;
  33503. * }
  33504. *
  33505. * Foo.prototype.c = 3;
  33506. *
  33507. * _.forOwnRight(new Foo, function(value, key) {
  33508. * console.log(key);
  33509. * });
  33510. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  33511. */
  33512. function forOwnRight(object, iteratee) {
  33513. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  33514. }
  33515. /**
  33516. * Creates an array of function property names from own enumerable properties
  33517. * of `object`.
  33518. *
  33519. * @static
  33520. * @since 0.1.0
  33521. * @memberOf _
  33522. * @category Object
  33523. * @param {Object} object The object to inspect.
  33524. * @returns {Array} Returns the function names.
  33525. * @see _.functionsIn
  33526. * @example
  33527. *
  33528. * function Foo() {
  33529. * this.a = _.constant('a');
  33530. * this.b = _.constant('b');
  33531. * }
  33532. *
  33533. * Foo.prototype.c = _.constant('c');
  33534. *
  33535. * _.functions(new Foo);
  33536. * // => ['a', 'b']
  33537. */
  33538. function functions(object) {
  33539. return object == null ? [] : baseFunctions(object, keys(object));
  33540. }
  33541. /**
  33542. * Creates an array of function property names from own and inherited
  33543. * enumerable properties of `object`.
  33544. *
  33545. * @static
  33546. * @memberOf _
  33547. * @since 4.0.0
  33548. * @category Object
  33549. * @param {Object} object The object to inspect.
  33550. * @returns {Array} Returns the function names.
  33551. * @see _.functions
  33552. * @example
  33553. *
  33554. * function Foo() {
  33555. * this.a = _.constant('a');
  33556. * this.b = _.constant('b');
  33557. * }
  33558. *
  33559. * Foo.prototype.c = _.constant('c');
  33560. *
  33561. * _.functionsIn(new Foo);
  33562. * // => ['a', 'b', 'c']
  33563. */
  33564. function functionsIn(object) {
  33565. return object == null ? [] : baseFunctions(object, keysIn(object));
  33566. }
  33567. /**
  33568. * Gets the value at `path` of `object`. If the resolved value is
  33569. * `undefined`, the `defaultValue` is returned in its place.
  33570. *
  33571. * @static
  33572. * @memberOf _
  33573. * @since 3.7.0
  33574. * @category Object
  33575. * @param {Object} object The object to query.
  33576. * @param {Array|string} path The path of the property to get.
  33577. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  33578. * @returns {*} Returns the resolved value.
  33579. * @example
  33580. *
  33581. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  33582. *
  33583. * _.get(object, 'a[0].b.c');
  33584. * // => 3
  33585. *
  33586. * _.get(object, ['a', '0', 'b', 'c']);
  33587. * // => 3
  33588. *
  33589. * _.get(object, 'a.b.c', 'default');
  33590. * // => 'default'
  33591. */
  33592. function get(object, path, defaultValue) {
  33593. var result = object == null ? undefined : baseGet(object, path);
  33594. return result === undefined ? defaultValue : result;
  33595. }
  33596. /**
  33597. * Checks if `path` is a direct property of `object`.
  33598. *
  33599. * @static
  33600. * @since 0.1.0
  33601. * @memberOf _
  33602. * @category Object
  33603. * @param {Object} object The object to query.
  33604. * @param {Array|string} path The path to check.
  33605. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  33606. * @example
  33607. *
  33608. * var object = { 'a': { 'b': 2 } };
  33609. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  33610. *
  33611. * _.has(object, 'a');
  33612. * // => true
  33613. *
  33614. * _.has(object, 'a.b');
  33615. * // => true
  33616. *
  33617. * _.has(object, ['a', 'b']);
  33618. * // => true
  33619. *
  33620. * _.has(other, 'a');
  33621. * // => false
  33622. */
  33623. function has(object, path) {
  33624. return object != null && hasPath(object, path, baseHas);
  33625. }
  33626. /**
  33627. * Checks if `path` is a direct or inherited property of `object`.
  33628. *
  33629. * @static
  33630. * @memberOf _
  33631. * @since 4.0.0
  33632. * @category Object
  33633. * @param {Object} object The object to query.
  33634. * @param {Array|string} path The path to check.
  33635. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  33636. * @example
  33637. *
  33638. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  33639. *
  33640. * _.hasIn(object, 'a');
  33641. * // => true
  33642. *
  33643. * _.hasIn(object, 'a.b');
  33644. * // => true
  33645. *
  33646. * _.hasIn(object, ['a', 'b']);
  33647. * // => true
  33648. *
  33649. * _.hasIn(object, 'b');
  33650. * // => false
  33651. */
  33652. function hasIn(object, path) {
  33653. return object != null && hasPath(object, path, baseHasIn);
  33654. }
  33655. /**
  33656. * Creates an object composed of the inverted keys and values of `object`.
  33657. * If `object` contains duplicate values, subsequent values overwrite
  33658. * property assignments of previous values.
  33659. *
  33660. * @static
  33661. * @memberOf _
  33662. * @since 0.7.0
  33663. * @category Object
  33664. * @param {Object} object The object to invert.
  33665. * @returns {Object} Returns the new inverted object.
  33666. * @example
  33667. *
  33668. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  33669. *
  33670. * _.invert(object);
  33671. * // => { '1': 'c', '2': 'b' }
  33672. */
  33673. var invert = createInverter(function(result, value, key) {
  33674. if (value != null &&
  33675. typeof value.toString != 'function') {
  33676. value = nativeObjectToString.call(value);
  33677. }
  33678. result[value] = key;
  33679. }, constant(identity));
  33680. /**
  33681. * This method is like `_.invert` except that the inverted object is generated
  33682. * from the results of running each element of `object` thru `iteratee`. The
  33683. * corresponding inverted value of each inverted key is an array of keys
  33684. * responsible for generating the inverted value. The iteratee is invoked
  33685. * with one argument: (value).
  33686. *
  33687. * @static
  33688. * @memberOf _
  33689. * @since 4.1.0
  33690. * @category Object
  33691. * @param {Object} object The object to invert.
  33692. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  33693. * @returns {Object} Returns the new inverted object.
  33694. * @example
  33695. *
  33696. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  33697. *
  33698. * _.invertBy(object);
  33699. * // => { '1': ['a', 'c'], '2': ['b'] }
  33700. *
  33701. * _.invertBy(object, function(value) {
  33702. * return 'group' + value;
  33703. * });
  33704. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  33705. */
  33706. var invertBy = createInverter(function(result, value, key) {
  33707. if (value != null &&
  33708. typeof value.toString != 'function') {
  33709. value = nativeObjectToString.call(value);
  33710. }
  33711. if (hasOwnProperty.call(result, value)) {
  33712. result[value].push(key);
  33713. } else {
  33714. result[value] = [key];
  33715. }
  33716. }, getIteratee);
  33717. /**
  33718. * Invokes the method at `path` of `object`.
  33719. *
  33720. * @static
  33721. * @memberOf _
  33722. * @since 4.0.0
  33723. * @category Object
  33724. * @param {Object} object The object to query.
  33725. * @param {Array|string} path The path of the method to invoke.
  33726. * @param {...*} [args] The arguments to invoke the method with.
  33727. * @returns {*} Returns the result of the invoked method.
  33728. * @example
  33729. *
  33730. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  33731. *
  33732. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  33733. * // => [2, 3]
  33734. */
  33735. var invoke = baseRest(baseInvoke);
  33736. /**
  33737. * Creates an array of the own enumerable property names of `object`.
  33738. *
  33739. * **Note:** Non-object values are coerced to objects. See the
  33740. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  33741. * for more details.
  33742. *
  33743. * @static
  33744. * @since 0.1.0
  33745. * @memberOf _
  33746. * @category Object
  33747. * @param {Object} object The object to query.
  33748. * @returns {Array} Returns the array of property names.
  33749. * @example
  33750. *
  33751. * function Foo() {
  33752. * this.a = 1;
  33753. * this.b = 2;
  33754. * }
  33755. *
  33756. * Foo.prototype.c = 3;
  33757. *
  33758. * _.keys(new Foo);
  33759. * // => ['a', 'b'] (iteration order is not guaranteed)
  33760. *
  33761. * _.keys('hi');
  33762. * // => ['0', '1']
  33763. */
  33764. function keys(object) {
  33765. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  33766. }
  33767. /**
  33768. * Creates an array of the own and inherited enumerable property names of `object`.
  33769. *
  33770. * **Note:** Non-object values are coerced to objects.
  33771. *
  33772. * @static
  33773. * @memberOf _
  33774. * @since 3.0.0
  33775. * @category Object
  33776. * @param {Object} object The object to query.
  33777. * @returns {Array} Returns the array of property names.
  33778. * @example
  33779. *
  33780. * function Foo() {
  33781. * this.a = 1;
  33782. * this.b = 2;
  33783. * }
  33784. *
  33785. * Foo.prototype.c = 3;
  33786. *
  33787. * _.keysIn(new Foo);
  33788. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  33789. */
  33790. function keysIn(object) {
  33791. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  33792. }
  33793. /**
  33794. * The opposite of `_.mapValues`; this method creates an object with the
  33795. * same values as `object` and keys generated by running each own enumerable
  33796. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  33797. * with three arguments: (value, key, object).
  33798. *
  33799. * @static
  33800. * @memberOf _
  33801. * @since 3.8.0
  33802. * @category Object
  33803. * @param {Object} object The object to iterate over.
  33804. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  33805. * @returns {Object} Returns the new mapped object.
  33806. * @see _.mapValues
  33807. * @example
  33808. *
  33809. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  33810. * return key + value;
  33811. * });
  33812. * // => { 'a1': 1, 'b2': 2 }
  33813. */
  33814. function mapKeys(object, iteratee) {
  33815. var result = {};
  33816. iteratee = getIteratee(iteratee, 3);
  33817. baseForOwn(object, function(value, key, object) {
  33818. baseAssignValue(result, iteratee(value, key, object), value);
  33819. });
  33820. return result;
  33821. }
  33822. /**
  33823. * Creates an object with the same keys as `object` and values generated
  33824. * by running each own enumerable string keyed property of `object` thru
  33825. * `iteratee`. The iteratee is invoked with three arguments:
  33826. * (value, key, object).
  33827. *
  33828. * @static
  33829. * @memberOf _
  33830. * @since 2.4.0
  33831. * @category Object
  33832. * @param {Object} object The object to iterate over.
  33833. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  33834. * @returns {Object} Returns the new mapped object.
  33835. * @see _.mapKeys
  33836. * @example
  33837. *
  33838. * var users = {
  33839. * 'fred': { 'user': 'fred', 'age': 40 },
  33840. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  33841. * };
  33842. *
  33843. * _.mapValues(users, function(o) { return o.age; });
  33844. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  33845. *
  33846. * // The `_.property` iteratee shorthand.
  33847. * _.mapValues(users, 'age');
  33848. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  33849. */
  33850. function mapValues(object, iteratee) {
  33851. var result = {};
  33852. iteratee = getIteratee(iteratee, 3);
  33853. baseForOwn(object, function(value, key, object) {
  33854. baseAssignValue(result, key, iteratee(value, key, object));
  33855. });
  33856. return result;
  33857. }
  33858. /**
  33859. * This method is like `_.assign` except that it recursively merges own and
  33860. * inherited enumerable string keyed properties of source objects into the
  33861. * destination object. Source properties that resolve to `undefined` are
  33862. * skipped if a destination value exists. Array and plain object properties
  33863. * are merged recursively. Other objects and value types are overridden by
  33864. * assignment. Source objects are applied from left to right. Subsequent
  33865. * sources overwrite property assignments of previous sources.
  33866. *
  33867. * **Note:** This method mutates `object`.
  33868. *
  33869. * @static
  33870. * @memberOf _
  33871. * @since 0.5.0
  33872. * @category Object
  33873. * @param {Object} object The destination object.
  33874. * @param {...Object} [sources] The source objects.
  33875. * @returns {Object} Returns `object`.
  33876. * @example
  33877. *
  33878. * var object = {
  33879. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  33880. * };
  33881. *
  33882. * var other = {
  33883. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  33884. * };
  33885. *
  33886. * _.merge(object, other);
  33887. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  33888. */
  33889. var merge = createAssigner(function(object, source, srcIndex) {
  33890. baseMerge(object, source, srcIndex);
  33891. });
  33892. /**
  33893. * This method is like `_.merge` except that it accepts `customizer` which
  33894. * is invoked to produce the merged values of the destination and source
  33895. * properties. If `customizer` returns `undefined`, merging is handled by the
  33896. * method instead. The `customizer` is invoked with six arguments:
  33897. * (objValue, srcValue, key, object, source, stack).
  33898. *
  33899. * **Note:** This method mutates `object`.
  33900. *
  33901. * @static
  33902. * @memberOf _
  33903. * @since 4.0.0
  33904. * @category Object
  33905. * @param {Object} object The destination object.
  33906. * @param {...Object} sources The source objects.
  33907. * @param {Function} customizer The function to customize assigned values.
  33908. * @returns {Object} Returns `object`.
  33909. * @example
  33910. *
  33911. * function customizer(objValue, srcValue) {
  33912. * if (_.isArray(objValue)) {
  33913. * return objValue.concat(srcValue);
  33914. * }
  33915. * }
  33916. *
  33917. * var object = { 'a': [1], 'b': [2] };
  33918. * var other = { 'a': [3], 'b': [4] };
  33919. *
  33920. * _.mergeWith(object, other, customizer);
  33921. * // => { 'a': [1, 3], 'b': [2, 4] }
  33922. */
  33923. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  33924. baseMerge(object, source, srcIndex, customizer);
  33925. });
  33926. /**
  33927. * The opposite of `_.pick`; this method creates an object composed of the
  33928. * own and inherited enumerable property paths of `object` that are not omitted.
  33929. *
  33930. * **Note:** This method is considerably slower than `_.pick`.
  33931. *
  33932. * @static
  33933. * @since 0.1.0
  33934. * @memberOf _
  33935. * @category Object
  33936. * @param {Object} object The source object.
  33937. * @param {...(string|string[])} [paths] The property paths to omit.
  33938. * @returns {Object} Returns the new object.
  33939. * @example
  33940. *
  33941. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  33942. *
  33943. * _.omit(object, ['a', 'c']);
  33944. * // => { 'b': '2' }
  33945. */
  33946. var omit = flatRest(function(object, paths) {
  33947. var result = {};
  33948. if (object == null) {
  33949. return result;
  33950. }
  33951. var isDeep = false;
  33952. paths = arrayMap(paths, function(path) {
  33953. path = castPath(path, object);
  33954. isDeep || (isDeep = path.length > 1);
  33955. return path;
  33956. });
  33957. copyObject(object, getAllKeysIn(object), result);
  33958. if (isDeep) {
  33959. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  33960. }
  33961. var length = paths.length;
  33962. while (length--) {
  33963. baseUnset(result, paths[length]);
  33964. }
  33965. return result;
  33966. });
  33967. /**
  33968. * The opposite of `_.pickBy`; this method creates an object composed of
  33969. * the own and inherited enumerable string keyed properties of `object` that
  33970. * `predicate` doesn't return truthy for. The predicate is invoked with two
  33971. * arguments: (value, key).
  33972. *
  33973. * @static
  33974. * @memberOf _
  33975. * @since 4.0.0
  33976. * @category Object
  33977. * @param {Object} object The source object.
  33978. * @param {Function} [predicate=_.identity] The function invoked per property.
  33979. * @returns {Object} Returns the new object.
  33980. * @example
  33981. *
  33982. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  33983. *
  33984. * _.omitBy(object, _.isNumber);
  33985. * // => { 'b': '2' }
  33986. */
  33987. function omitBy(object, predicate) {
  33988. return pickBy(object, negate(getIteratee(predicate)));
  33989. }
  33990. /**
  33991. * Creates an object composed of the picked `object` properties.
  33992. *
  33993. * @static
  33994. * @since 0.1.0
  33995. * @memberOf _
  33996. * @category Object
  33997. * @param {Object} object The source object.
  33998. * @param {...(string|string[])} [paths] The property paths to pick.
  33999. * @returns {Object} Returns the new object.
  34000. * @example
  34001. *
  34002. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  34003. *
  34004. * _.pick(object, ['a', 'c']);
  34005. * // => { 'a': 1, 'c': 3 }
  34006. */
  34007. var pick = flatRest(function(object, paths) {
  34008. return object == null ? {} : basePick(object, paths);
  34009. });
  34010. /**
  34011. * Creates an object composed of the `object` properties `predicate` returns
  34012. * truthy for. The predicate is invoked with two arguments: (value, key).
  34013. *
  34014. * @static
  34015. * @memberOf _
  34016. * @since 4.0.0
  34017. * @category Object
  34018. * @param {Object} object The source object.
  34019. * @param {Function} [predicate=_.identity] The function invoked per property.
  34020. * @returns {Object} Returns the new object.
  34021. * @example
  34022. *
  34023. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  34024. *
  34025. * _.pickBy(object, _.isNumber);
  34026. * // => { 'a': 1, 'c': 3 }
  34027. */
  34028. function pickBy(object, predicate) {
  34029. if (object == null) {
  34030. return {};
  34031. }
  34032. var props = arrayMap(getAllKeysIn(object), function(prop) {
  34033. return [prop];
  34034. });
  34035. predicate = getIteratee(predicate);
  34036. return basePickBy(object, props, function(value, path) {
  34037. return predicate(value, path[0]);
  34038. });
  34039. }
  34040. /**
  34041. * This method is like `_.get` except that if the resolved value is a
  34042. * function it's invoked with the `this` binding of its parent object and
  34043. * its result is returned.
  34044. *
  34045. * @static
  34046. * @since 0.1.0
  34047. * @memberOf _
  34048. * @category Object
  34049. * @param {Object} object The object to query.
  34050. * @param {Array|string} path The path of the property to resolve.
  34051. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  34052. * @returns {*} Returns the resolved value.
  34053. * @example
  34054. *
  34055. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  34056. *
  34057. * _.result(object, 'a[0].b.c1');
  34058. * // => 3
  34059. *
  34060. * _.result(object, 'a[0].b.c2');
  34061. * // => 4
  34062. *
  34063. * _.result(object, 'a[0].b.c3', 'default');
  34064. * // => 'default'
  34065. *
  34066. * _.result(object, 'a[0].b.c3', _.constant('default'));
  34067. * // => 'default'
  34068. */
  34069. function result(object, path, defaultValue) {
  34070. path = castPath(path, object);
  34071. var index = -1,
  34072. length = path.length;
  34073. // Ensure the loop is entered when path is empty.
  34074. if (!length) {
  34075. length = 1;
  34076. object = undefined;
  34077. }
  34078. while (++index < length) {
  34079. var value = object == null ? undefined : object[toKey(path[index])];
  34080. if (value === undefined) {
  34081. index = length;
  34082. value = defaultValue;
  34083. }
  34084. object = isFunction(value) ? value.call(object) : value;
  34085. }
  34086. return object;
  34087. }
  34088. /**
  34089. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  34090. * it's created. Arrays are created for missing index properties while objects
  34091. * are created for all other missing properties. Use `_.setWith` to customize
  34092. * `path` creation.
  34093. *
  34094. * **Note:** This method mutates `object`.
  34095. *
  34096. * @static
  34097. * @memberOf _
  34098. * @since 3.7.0
  34099. * @category Object
  34100. * @param {Object} object The object to modify.
  34101. * @param {Array|string} path The path of the property to set.
  34102. * @param {*} value The value to set.
  34103. * @returns {Object} Returns `object`.
  34104. * @example
  34105. *
  34106. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  34107. *
  34108. * _.set(object, 'a[0].b.c', 4);
  34109. * console.log(object.a[0].b.c);
  34110. * // => 4
  34111. *
  34112. * _.set(object, ['x', '0', 'y', 'z'], 5);
  34113. * console.log(object.x[0].y.z);
  34114. * // => 5
  34115. */
  34116. function set(object, path, value) {
  34117. return object == null ? object : baseSet(object, path, value);
  34118. }
  34119. /**
  34120. * This method is like `_.set` except that it accepts `customizer` which is
  34121. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  34122. * path creation is handled by the method instead. The `customizer` is invoked
  34123. * with three arguments: (nsValue, key, nsObject).
  34124. *
  34125. * **Note:** This method mutates `object`.
  34126. *
  34127. * @static
  34128. * @memberOf _
  34129. * @since 4.0.0
  34130. * @category Object
  34131. * @param {Object} object The object to modify.
  34132. * @param {Array|string} path The path of the property to set.
  34133. * @param {*} value The value to set.
  34134. * @param {Function} [customizer] The function to customize assigned values.
  34135. * @returns {Object} Returns `object`.
  34136. * @example
  34137. *
  34138. * var object = {};
  34139. *
  34140. * _.setWith(object, '[0][1]', 'a', Object);
  34141. * // => { '0': { '1': 'a' } }
  34142. */
  34143. function setWith(object, path, value, customizer) {
  34144. customizer = typeof customizer == 'function' ? customizer : undefined;
  34145. return object == null ? object : baseSet(object, path, value, customizer);
  34146. }
  34147. /**
  34148. * Creates an array of own enumerable string keyed-value pairs for `object`
  34149. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  34150. * entries are returned.
  34151. *
  34152. * @static
  34153. * @memberOf _
  34154. * @since 4.0.0
  34155. * @alias entries
  34156. * @category Object
  34157. * @param {Object} object The object to query.
  34158. * @returns {Array} Returns the key-value pairs.
  34159. * @example
  34160. *
  34161. * function Foo() {
  34162. * this.a = 1;
  34163. * this.b = 2;
  34164. * }
  34165. *
  34166. * Foo.prototype.c = 3;
  34167. *
  34168. * _.toPairs(new Foo);
  34169. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  34170. */
  34171. var toPairs = createToPairs(keys);
  34172. /**
  34173. * Creates an array of own and inherited enumerable string keyed-value pairs
  34174. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  34175. * or set, its entries are returned.
  34176. *
  34177. * @static
  34178. * @memberOf _
  34179. * @since 4.0.0
  34180. * @alias entriesIn
  34181. * @category Object
  34182. * @param {Object} object The object to query.
  34183. * @returns {Array} Returns the key-value pairs.
  34184. * @example
  34185. *
  34186. * function Foo() {
  34187. * this.a = 1;
  34188. * this.b = 2;
  34189. * }
  34190. *
  34191. * Foo.prototype.c = 3;
  34192. *
  34193. * _.toPairsIn(new Foo);
  34194. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  34195. */
  34196. var toPairsIn = createToPairs(keysIn);
  34197. /**
  34198. * An alternative to `_.reduce`; this method transforms `object` to a new
  34199. * `accumulator` object which is the result of running each of its own
  34200. * enumerable string keyed properties thru `iteratee`, with each invocation
  34201. * potentially mutating the `accumulator` object. If `accumulator` is not
  34202. * provided, a new object with the same `[[Prototype]]` will be used. The
  34203. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  34204. * Iteratee functions may exit iteration early by explicitly returning `false`.
  34205. *
  34206. * @static
  34207. * @memberOf _
  34208. * @since 1.3.0
  34209. * @category Object
  34210. * @param {Object} object The object to iterate over.
  34211. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  34212. * @param {*} [accumulator] The custom accumulator value.
  34213. * @returns {*} Returns the accumulated value.
  34214. * @example
  34215. *
  34216. * _.transform([2, 3, 4], function(result, n) {
  34217. * result.push(n *= n);
  34218. * return n % 2 == 0;
  34219. * }, []);
  34220. * // => [4, 9]
  34221. *
  34222. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  34223. * (result[value] || (result[value] = [])).push(key);
  34224. * }, {});
  34225. * // => { '1': ['a', 'c'], '2': ['b'] }
  34226. */
  34227. function transform(object, iteratee, accumulator) {
  34228. var isArr = isArray(object),
  34229. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  34230. iteratee = getIteratee(iteratee, 4);
  34231. if (accumulator == null) {
  34232. var Ctor = object && object.constructor;
  34233. if (isArrLike) {
  34234. accumulator = isArr ? new Ctor : [];
  34235. }
  34236. else if (isObject(object)) {
  34237. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  34238. }
  34239. else {
  34240. accumulator = {};
  34241. }
  34242. }
  34243. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  34244. return iteratee(accumulator, value, index, object);
  34245. });
  34246. return accumulator;
  34247. }
  34248. /**
  34249. * Removes the property at `path` of `object`.
  34250. *
  34251. * **Note:** This method mutates `object`.
  34252. *
  34253. * @static
  34254. * @memberOf _
  34255. * @since 4.0.0
  34256. * @category Object
  34257. * @param {Object} object The object to modify.
  34258. * @param {Array|string} path The path of the property to unset.
  34259. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  34260. * @example
  34261. *
  34262. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  34263. * _.unset(object, 'a[0].b.c');
  34264. * // => true
  34265. *
  34266. * console.log(object);
  34267. * // => { 'a': [{ 'b': {} }] };
  34268. *
  34269. * _.unset(object, ['a', '0', 'b', 'c']);
  34270. * // => true
  34271. *
  34272. * console.log(object);
  34273. * // => { 'a': [{ 'b': {} }] };
  34274. */
  34275. function unset(object, path) {
  34276. return object == null ? true : baseUnset(object, path);
  34277. }
  34278. /**
  34279. * This method is like `_.set` except that accepts `updater` to produce the
  34280. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  34281. * is invoked with one argument: (value).
  34282. *
  34283. * **Note:** This method mutates `object`.
  34284. *
  34285. * @static
  34286. * @memberOf _
  34287. * @since 4.6.0
  34288. * @category Object
  34289. * @param {Object} object The object to modify.
  34290. * @param {Array|string} path The path of the property to set.
  34291. * @param {Function} updater The function to produce the updated value.
  34292. * @returns {Object} Returns `object`.
  34293. * @example
  34294. *
  34295. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  34296. *
  34297. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  34298. * console.log(object.a[0].b.c);
  34299. * // => 9
  34300. *
  34301. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  34302. * console.log(object.x[0].y.z);
  34303. * // => 0
  34304. */
  34305. function update(object, path, updater) {
  34306. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  34307. }
  34308. /**
  34309. * This method is like `_.update` except that it accepts `customizer` which is
  34310. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  34311. * path creation is handled by the method instead. The `customizer` is invoked
  34312. * with three arguments: (nsValue, key, nsObject).
  34313. *
  34314. * **Note:** This method mutates `object`.
  34315. *
  34316. * @static
  34317. * @memberOf _
  34318. * @since 4.6.0
  34319. * @category Object
  34320. * @param {Object} object The object to modify.
  34321. * @param {Array|string} path The path of the property to set.
  34322. * @param {Function} updater The function to produce the updated value.
  34323. * @param {Function} [customizer] The function to customize assigned values.
  34324. * @returns {Object} Returns `object`.
  34325. * @example
  34326. *
  34327. * var object = {};
  34328. *
  34329. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  34330. * // => { '0': { '1': 'a' } }
  34331. */
  34332. function updateWith(object, path, updater, customizer) {
  34333. customizer = typeof customizer == 'function' ? customizer : undefined;
  34334. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  34335. }
  34336. /**
  34337. * Creates an array of the own enumerable string keyed property values of `object`.
  34338. *
  34339. * **Note:** Non-object values are coerced to objects.
  34340. *
  34341. * @static
  34342. * @since 0.1.0
  34343. * @memberOf _
  34344. * @category Object
  34345. * @param {Object} object The object to query.
  34346. * @returns {Array} Returns the array of property values.
  34347. * @example
  34348. *
  34349. * function Foo() {
  34350. * this.a = 1;
  34351. * this.b = 2;
  34352. * }
  34353. *
  34354. * Foo.prototype.c = 3;
  34355. *
  34356. * _.values(new Foo);
  34357. * // => [1, 2] (iteration order is not guaranteed)
  34358. *
  34359. * _.values('hi');
  34360. * // => ['h', 'i']
  34361. */
  34362. function values(object) {
  34363. return object == null ? [] : baseValues(object, keys(object));
  34364. }
  34365. /**
  34366. * Creates an array of the own and inherited enumerable string keyed property
  34367. * values of `object`.
  34368. *
  34369. * **Note:** Non-object values are coerced to objects.
  34370. *
  34371. * @static
  34372. * @memberOf _
  34373. * @since 3.0.0
  34374. * @category Object
  34375. * @param {Object} object The object to query.
  34376. * @returns {Array} Returns the array of property values.
  34377. * @example
  34378. *
  34379. * function Foo() {
  34380. * this.a = 1;
  34381. * this.b = 2;
  34382. * }
  34383. *
  34384. * Foo.prototype.c = 3;
  34385. *
  34386. * _.valuesIn(new Foo);
  34387. * // => [1, 2, 3] (iteration order is not guaranteed)
  34388. */
  34389. function valuesIn(object) {
  34390. return object == null ? [] : baseValues(object, keysIn(object));
  34391. }
  34392. /*------------------------------------------------------------------------*/
  34393. /**
  34394. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  34395. *
  34396. * @static
  34397. * @memberOf _
  34398. * @since 4.0.0
  34399. * @category Number
  34400. * @param {number} number The number to clamp.
  34401. * @param {number} [lower] The lower bound.
  34402. * @param {number} upper The upper bound.
  34403. * @returns {number} Returns the clamped number.
  34404. * @example
  34405. *
  34406. * _.clamp(-10, -5, 5);
  34407. * // => -5
  34408. *
  34409. * _.clamp(10, -5, 5);
  34410. * // => 5
  34411. */
  34412. function clamp(number, lower, upper) {
  34413. if (upper === undefined) {
  34414. upper = lower;
  34415. lower = undefined;
  34416. }
  34417. if (upper !== undefined) {
  34418. upper = toNumber(upper);
  34419. upper = upper === upper ? upper : 0;
  34420. }
  34421. if (lower !== undefined) {
  34422. lower = toNumber(lower);
  34423. lower = lower === lower ? lower : 0;
  34424. }
  34425. return baseClamp(toNumber(number), lower, upper);
  34426. }
  34427. /**
  34428. * Checks if `n` is between `start` and up to, but not including, `end`. If
  34429. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  34430. * If `start` is greater than `end` the params are swapped to support
  34431. * negative ranges.
  34432. *
  34433. * @static
  34434. * @memberOf _
  34435. * @since 3.3.0
  34436. * @category Number
  34437. * @param {number} number The number to check.
  34438. * @param {number} [start=0] The start of the range.
  34439. * @param {number} end The end of the range.
  34440. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  34441. * @see _.range, _.rangeRight
  34442. * @example
  34443. *
  34444. * _.inRange(3, 2, 4);
  34445. * // => true
  34446. *
  34447. * _.inRange(4, 8);
  34448. * // => true
  34449. *
  34450. * _.inRange(4, 2);
  34451. * // => false
  34452. *
  34453. * _.inRange(2, 2);
  34454. * // => false
  34455. *
  34456. * _.inRange(1.2, 2);
  34457. * // => true
  34458. *
  34459. * _.inRange(5.2, 4);
  34460. * // => false
  34461. *
  34462. * _.inRange(-3, -2, -6);
  34463. * // => true
  34464. */
  34465. function inRange(number, start, end) {
  34466. start = toFinite(start);
  34467. if (end === undefined) {
  34468. end = start;
  34469. start = 0;
  34470. } else {
  34471. end = toFinite(end);
  34472. }
  34473. number = toNumber(number);
  34474. return baseInRange(number, start, end);
  34475. }
  34476. /**
  34477. * Produces a random number between the inclusive `lower` and `upper` bounds.
  34478. * If only one argument is provided a number between `0` and the given number
  34479. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  34480. * floats, a floating-point number is returned instead of an integer.
  34481. *
  34482. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  34483. * floating-point values which can produce unexpected results.
  34484. *
  34485. * @static
  34486. * @memberOf _
  34487. * @since 0.7.0
  34488. * @category Number
  34489. * @param {number} [lower=0] The lower bound.
  34490. * @param {number} [upper=1] The upper bound.
  34491. * @param {boolean} [floating] Specify returning a floating-point number.
  34492. * @returns {number} Returns the random number.
  34493. * @example
  34494. *
  34495. * _.random(0, 5);
  34496. * // => an integer between 0 and 5
  34497. *
  34498. * _.random(5);
  34499. * // => also an integer between 0 and 5
  34500. *
  34501. * _.random(5, true);
  34502. * // => a floating-point number between 0 and 5
  34503. *
  34504. * _.random(1.2, 5.2);
  34505. * // => a floating-point number between 1.2 and 5.2
  34506. */
  34507. function random(lower, upper, floating) {
  34508. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  34509. upper = floating = undefined;
  34510. }
  34511. if (floating === undefined) {
  34512. if (typeof upper == 'boolean') {
  34513. floating = upper;
  34514. upper = undefined;
  34515. }
  34516. else if (typeof lower == 'boolean') {
  34517. floating = lower;
  34518. lower = undefined;
  34519. }
  34520. }
  34521. if (lower === undefined && upper === undefined) {
  34522. lower = 0;
  34523. upper = 1;
  34524. }
  34525. else {
  34526. lower = toFinite(lower);
  34527. if (upper === undefined) {
  34528. upper = lower;
  34529. lower = 0;
  34530. } else {
  34531. upper = toFinite(upper);
  34532. }
  34533. }
  34534. if (lower > upper) {
  34535. var temp = lower;
  34536. lower = upper;
  34537. upper = temp;
  34538. }
  34539. if (floating || lower % 1 || upper % 1) {
  34540. var rand = nativeRandom();
  34541. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  34542. }
  34543. return baseRandom(lower, upper);
  34544. }
  34545. /*------------------------------------------------------------------------*/
  34546. /**
  34547. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  34548. *
  34549. * @static
  34550. * @memberOf _
  34551. * @since 3.0.0
  34552. * @category String
  34553. * @param {string} [string=''] The string to convert.
  34554. * @returns {string} Returns the camel cased string.
  34555. * @example
  34556. *
  34557. * _.camelCase('Foo Bar');
  34558. * // => 'fooBar'
  34559. *
  34560. * _.camelCase('--foo-bar--');
  34561. * // => 'fooBar'
  34562. *
  34563. * _.camelCase('__FOO_BAR__');
  34564. * // => 'fooBar'
  34565. */
  34566. var camelCase = createCompounder(function(result, word, index) {
  34567. word = word.toLowerCase();
  34568. return result + (index ? capitalize(word) : word);
  34569. });
  34570. /**
  34571. * Converts the first character of `string` to upper case and the remaining
  34572. * to lower case.
  34573. *
  34574. * @static
  34575. * @memberOf _
  34576. * @since 3.0.0
  34577. * @category String
  34578. * @param {string} [string=''] The string to capitalize.
  34579. * @returns {string} Returns the capitalized string.
  34580. * @example
  34581. *
  34582. * _.capitalize('FRED');
  34583. * // => 'Fred'
  34584. */
  34585. function capitalize(string) {
  34586. return upperFirst(toString(string).toLowerCase());
  34587. }
  34588. /**
  34589. * Deburrs `string` by converting
  34590. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  34591. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  34592. * letters to basic Latin letters and removing
  34593. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  34594. *
  34595. * @static
  34596. * @memberOf _
  34597. * @since 3.0.0
  34598. * @category String
  34599. * @param {string} [string=''] The string to deburr.
  34600. * @returns {string} Returns the deburred string.
  34601. * @example
  34602. *
  34603. * _.deburr('déjà vu');
  34604. * // => 'deja vu'
  34605. */
  34606. function deburr(string) {
  34607. string = toString(string);
  34608. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  34609. }
  34610. /**
  34611. * Checks if `string` ends with the given target string.
  34612. *
  34613. * @static
  34614. * @memberOf _
  34615. * @since 3.0.0
  34616. * @category String
  34617. * @param {string} [string=''] The string to inspect.
  34618. * @param {string} [target] The string to search for.
  34619. * @param {number} [position=string.length] The position to search up to.
  34620. * @returns {boolean} Returns `true` if `string` ends with `target`,
  34621. * else `false`.
  34622. * @example
  34623. *
  34624. * _.endsWith('abc', 'c');
  34625. * // => true
  34626. *
  34627. * _.endsWith('abc', 'b');
  34628. * // => false
  34629. *
  34630. * _.endsWith('abc', 'b', 2);
  34631. * // => true
  34632. */
  34633. function endsWith(string, target, position) {
  34634. string = toString(string);
  34635. target = baseToString(target);
  34636. var length = string.length;
  34637. position = position === undefined
  34638. ? length
  34639. : baseClamp(toInteger(position), 0, length);
  34640. var end = position;
  34641. position -= target.length;
  34642. return position >= 0 && string.slice(position, end) == target;
  34643. }
  34644. /**
  34645. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  34646. * corresponding HTML entities.
  34647. *
  34648. * **Note:** No other characters are escaped. To escape additional
  34649. * characters use a third-party library like [_he_](https://mths.be/he).
  34650. *
  34651. * Though the ">" character is escaped for symmetry, characters like
  34652. * ">" and "/" don't need escaping in HTML and have no special meaning
  34653. * unless they're part of a tag or unquoted attribute value. See
  34654. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  34655. * (under "semi-related fun fact") for more details.
  34656. *
  34657. * When working with HTML you should always
  34658. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  34659. * XSS vectors.
  34660. *
  34661. * @static
  34662. * @since 0.1.0
  34663. * @memberOf _
  34664. * @category String
  34665. * @param {string} [string=''] The string to escape.
  34666. * @returns {string} Returns the escaped string.
  34667. * @example
  34668. *
  34669. * _.escape('fred, barney, & pebbles');
  34670. * // => 'fred, barney, &amp; pebbles'
  34671. */
  34672. function escape(string) {
  34673. string = toString(string);
  34674. return (string && reHasUnescapedHtml.test(string))
  34675. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  34676. : string;
  34677. }
  34678. /**
  34679. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  34680. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  34681. *
  34682. * @static
  34683. * @memberOf _
  34684. * @since 3.0.0
  34685. * @category String
  34686. * @param {string} [string=''] The string to escape.
  34687. * @returns {string} Returns the escaped string.
  34688. * @example
  34689. *
  34690. * _.escapeRegExp('[lodash](https://lodash.com/)');
  34691. * // => '\[lodash\]\(https://lodash\.com/\)'
  34692. */
  34693. function escapeRegExp(string) {
  34694. string = toString(string);
  34695. return (string && reHasRegExpChar.test(string))
  34696. ? string.replace(reRegExpChar, '\\$&')
  34697. : string;
  34698. }
  34699. /**
  34700. * Converts `string` to
  34701. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  34702. *
  34703. * @static
  34704. * @memberOf _
  34705. * @since 3.0.0
  34706. * @category String
  34707. * @param {string} [string=''] The string to convert.
  34708. * @returns {string} Returns the kebab cased string.
  34709. * @example
  34710. *
  34711. * _.kebabCase('Foo Bar');
  34712. * // => 'foo-bar'
  34713. *
  34714. * _.kebabCase('fooBar');
  34715. * // => 'foo-bar'
  34716. *
  34717. * _.kebabCase('__FOO_BAR__');
  34718. * // => 'foo-bar'
  34719. */
  34720. var kebabCase = createCompounder(function(result, word, index) {
  34721. return result + (index ? '-' : '') + word.toLowerCase();
  34722. });
  34723. /**
  34724. * Converts `string`, as space separated words, to lower case.
  34725. *
  34726. * @static
  34727. * @memberOf _
  34728. * @since 4.0.0
  34729. * @category String
  34730. * @param {string} [string=''] The string to convert.
  34731. * @returns {string} Returns the lower cased string.
  34732. * @example
  34733. *
  34734. * _.lowerCase('--Foo-Bar--');
  34735. * // => 'foo bar'
  34736. *
  34737. * _.lowerCase('fooBar');
  34738. * // => 'foo bar'
  34739. *
  34740. * _.lowerCase('__FOO_BAR__');
  34741. * // => 'foo bar'
  34742. */
  34743. var lowerCase = createCompounder(function(result, word, index) {
  34744. return result + (index ? ' ' : '') + word.toLowerCase();
  34745. });
  34746. /**
  34747. * Converts the first character of `string` to lower case.
  34748. *
  34749. * @static
  34750. * @memberOf _
  34751. * @since 4.0.0
  34752. * @category String
  34753. * @param {string} [string=''] The string to convert.
  34754. * @returns {string} Returns the converted string.
  34755. * @example
  34756. *
  34757. * _.lowerFirst('Fred');
  34758. * // => 'fred'
  34759. *
  34760. * _.lowerFirst('FRED');
  34761. * // => 'fRED'
  34762. */
  34763. var lowerFirst = createCaseFirst('toLowerCase');
  34764. /**
  34765. * Pads `string` on the left and right sides if it's shorter than `length`.
  34766. * Padding characters are truncated if they can't be evenly divided by `length`.
  34767. *
  34768. * @static
  34769. * @memberOf _
  34770. * @since 3.0.0
  34771. * @category String
  34772. * @param {string} [string=''] The string to pad.
  34773. * @param {number} [length=0] The padding length.
  34774. * @param {string} [chars=' '] The string used as padding.
  34775. * @returns {string} Returns the padded string.
  34776. * @example
  34777. *
  34778. * _.pad('abc', 8);
  34779. * // => ' abc '
  34780. *
  34781. * _.pad('abc', 8, '_-');
  34782. * // => '_-abc_-_'
  34783. *
  34784. * _.pad('abc', 3);
  34785. * // => 'abc'
  34786. */
  34787. function pad(string, length, chars) {
  34788. string = toString(string);
  34789. length = toInteger(length);
  34790. var strLength = length ? stringSize(string) : 0;
  34791. if (!length || strLength >= length) {
  34792. return string;
  34793. }
  34794. var mid = (length - strLength) / 2;
  34795. return (
  34796. createPadding(nativeFloor(mid), chars) +
  34797. string +
  34798. createPadding(nativeCeil(mid), chars)
  34799. );
  34800. }
  34801. /**
  34802. * Pads `string` on the right side if it's shorter than `length`. Padding
  34803. * characters are truncated if they exceed `length`.
  34804. *
  34805. * @static
  34806. * @memberOf _
  34807. * @since 4.0.0
  34808. * @category String
  34809. * @param {string} [string=''] The string to pad.
  34810. * @param {number} [length=0] The padding length.
  34811. * @param {string} [chars=' '] The string used as padding.
  34812. * @returns {string} Returns the padded string.
  34813. * @example
  34814. *
  34815. * _.padEnd('abc', 6);
  34816. * // => 'abc '
  34817. *
  34818. * _.padEnd('abc', 6, '_-');
  34819. * // => 'abc_-_'
  34820. *
  34821. * _.padEnd('abc', 3);
  34822. * // => 'abc'
  34823. */
  34824. function padEnd(string, length, chars) {
  34825. string = toString(string);
  34826. length = toInteger(length);
  34827. var strLength = length ? stringSize(string) : 0;
  34828. return (length && strLength < length)
  34829. ? (string + createPadding(length - strLength, chars))
  34830. : string;
  34831. }
  34832. /**
  34833. * Pads `string` on the left side if it's shorter than `length`. Padding
  34834. * characters are truncated if they exceed `length`.
  34835. *
  34836. * @static
  34837. * @memberOf _
  34838. * @since 4.0.0
  34839. * @category String
  34840. * @param {string} [string=''] The string to pad.
  34841. * @param {number} [length=0] The padding length.
  34842. * @param {string} [chars=' '] The string used as padding.
  34843. * @returns {string} Returns the padded string.
  34844. * @example
  34845. *
  34846. * _.padStart('abc', 6);
  34847. * // => ' abc'
  34848. *
  34849. * _.padStart('abc', 6, '_-');
  34850. * // => '_-_abc'
  34851. *
  34852. * _.padStart('abc', 3);
  34853. * // => 'abc'
  34854. */
  34855. function padStart(string, length, chars) {
  34856. string = toString(string);
  34857. length = toInteger(length);
  34858. var strLength = length ? stringSize(string) : 0;
  34859. return (length && strLength < length)
  34860. ? (createPadding(length - strLength, chars) + string)
  34861. : string;
  34862. }
  34863. /**
  34864. * Converts `string` to an integer of the specified radix. If `radix` is
  34865. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  34866. * hexadecimal, in which case a `radix` of `16` is used.
  34867. *
  34868. * **Note:** This method aligns with the
  34869. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  34870. *
  34871. * @static
  34872. * @memberOf _
  34873. * @since 1.1.0
  34874. * @category String
  34875. * @param {string} string The string to convert.
  34876. * @param {number} [radix=10] The radix to interpret `value` by.
  34877. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  34878. * @returns {number} Returns the converted integer.
  34879. * @example
  34880. *
  34881. * _.parseInt('08');
  34882. * // => 8
  34883. *
  34884. * _.map(['6', '08', '10'], _.parseInt);
  34885. * // => [6, 8, 10]
  34886. */
  34887. function parseInt(string, radix, guard) {
  34888. if (guard || radix == null) {
  34889. radix = 0;
  34890. } else if (radix) {
  34891. radix = +radix;
  34892. }
  34893. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  34894. }
  34895. /**
  34896. * Repeats the given string `n` times.
  34897. *
  34898. * @static
  34899. * @memberOf _
  34900. * @since 3.0.0
  34901. * @category String
  34902. * @param {string} [string=''] The string to repeat.
  34903. * @param {number} [n=1] The number of times to repeat the string.
  34904. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  34905. * @returns {string} Returns the repeated string.
  34906. * @example
  34907. *
  34908. * _.repeat('*', 3);
  34909. * // => '***'
  34910. *
  34911. * _.repeat('abc', 2);
  34912. * // => 'abcabc'
  34913. *
  34914. * _.repeat('abc', 0);
  34915. * // => ''
  34916. */
  34917. function repeat(string, n, guard) {
  34918. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  34919. n = 1;
  34920. } else {
  34921. n = toInteger(n);
  34922. }
  34923. return baseRepeat(toString(string), n);
  34924. }
  34925. /**
  34926. * Replaces matches for `pattern` in `string` with `replacement`.
  34927. *
  34928. * **Note:** This method is based on
  34929. * [`String#replace`](https://mdn.io/String/replace).
  34930. *
  34931. * @static
  34932. * @memberOf _
  34933. * @since 4.0.0
  34934. * @category String
  34935. * @param {string} [string=''] The string to modify.
  34936. * @param {RegExp|string} pattern The pattern to replace.
  34937. * @param {Function|string} replacement The match replacement.
  34938. * @returns {string} Returns the modified string.
  34939. * @example
  34940. *
  34941. * _.replace('Hi Fred', 'Fred', 'Barney');
  34942. * // => 'Hi Barney'
  34943. */
  34944. function replace() {
  34945. var args = arguments,
  34946. string = toString(args[0]);
  34947. return args.length < 3 ? string : string.replace(args[1], args[2]);
  34948. }
  34949. /**
  34950. * Converts `string` to
  34951. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  34952. *
  34953. * @static
  34954. * @memberOf _
  34955. * @since 3.0.0
  34956. * @category String
  34957. * @param {string} [string=''] The string to convert.
  34958. * @returns {string} Returns the snake cased string.
  34959. * @example
  34960. *
  34961. * _.snakeCase('Foo Bar');
  34962. * // => 'foo_bar'
  34963. *
  34964. * _.snakeCase('fooBar');
  34965. * // => 'foo_bar'
  34966. *
  34967. * _.snakeCase('--FOO-BAR--');
  34968. * // => 'foo_bar'
  34969. */
  34970. var snakeCase = createCompounder(function(result, word, index) {
  34971. return result + (index ? '_' : '') + word.toLowerCase();
  34972. });
  34973. /**
  34974. * Splits `string` by `separator`.
  34975. *
  34976. * **Note:** This method is based on
  34977. * [`String#split`](https://mdn.io/String/split).
  34978. *
  34979. * @static
  34980. * @memberOf _
  34981. * @since 4.0.0
  34982. * @category String
  34983. * @param {string} [string=''] The string to split.
  34984. * @param {RegExp|string} separator The separator pattern to split by.
  34985. * @param {number} [limit] The length to truncate results to.
  34986. * @returns {Array} Returns the string segments.
  34987. * @example
  34988. *
  34989. * _.split('a-b-c', '-', 2);
  34990. * // => ['a', 'b']
  34991. */
  34992. function split(string, separator, limit) {
  34993. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  34994. separator = limit = undefined;
  34995. }
  34996. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  34997. if (!limit) {
  34998. return [];
  34999. }
  35000. string = toString(string);
  35001. if (string && (
  35002. typeof separator == 'string' ||
  35003. (separator != null && !isRegExp(separator))
  35004. )) {
  35005. separator = baseToString(separator);
  35006. if (!separator && hasUnicode(string)) {
  35007. return castSlice(stringToArray(string), 0, limit);
  35008. }
  35009. }
  35010. return string.split(separator, limit);
  35011. }
  35012. /**
  35013. * Converts `string` to
  35014. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  35015. *
  35016. * @static
  35017. * @memberOf _
  35018. * @since 3.1.0
  35019. * @category String
  35020. * @param {string} [string=''] The string to convert.
  35021. * @returns {string} Returns the start cased string.
  35022. * @example
  35023. *
  35024. * _.startCase('--foo-bar--');
  35025. * // => 'Foo Bar'
  35026. *
  35027. * _.startCase('fooBar');
  35028. * // => 'Foo Bar'
  35029. *
  35030. * _.startCase('__FOO_BAR__');
  35031. * // => 'FOO BAR'
  35032. */
  35033. var startCase = createCompounder(function(result, word, index) {
  35034. return result + (index ? ' ' : '') + upperFirst(word);
  35035. });
  35036. /**
  35037. * Checks if `string` starts with the given target string.
  35038. *
  35039. * @static
  35040. * @memberOf _
  35041. * @since 3.0.0
  35042. * @category String
  35043. * @param {string} [string=''] The string to inspect.
  35044. * @param {string} [target] The string to search for.
  35045. * @param {number} [position=0] The position to search from.
  35046. * @returns {boolean} Returns `true` if `string` starts with `target`,
  35047. * else `false`.
  35048. * @example
  35049. *
  35050. * _.startsWith('abc', 'a');
  35051. * // => true
  35052. *
  35053. * _.startsWith('abc', 'b');
  35054. * // => false
  35055. *
  35056. * _.startsWith('abc', 'b', 1);
  35057. * // => true
  35058. */
  35059. function startsWith(string, target, position) {
  35060. string = toString(string);
  35061. position = position == null
  35062. ? 0
  35063. : baseClamp(toInteger(position), 0, string.length);
  35064. target = baseToString(target);
  35065. return string.slice(position, position + target.length) == target;
  35066. }
  35067. /**
  35068. * Creates a compiled template function that can interpolate data properties
  35069. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  35070. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  35071. * properties may be accessed as free variables in the template. If a setting
  35072. * object is given, it takes precedence over `_.templateSettings` values.
  35073. *
  35074. * **Note:** In the development build `_.template` utilizes
  35075. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  35076. * for easier debugging.
  35077. *
  35078. * For more information on precompiling templates see
  35079. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  35080. *
  35081. * For more information on Chrome extension sandboxes see
  35082. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  35083. *
  35084. * @static
  35085. * @since 0.1.0
  35086. * @memberOf _
  35087. * @category String
  35088. * @param {string} [string=''] The template string.
  35089. * @param {Object} [options={}] The options object.
  35090. * @param {RegExp} [options.escape=_.templateSettings.escape]
  35091. * The HTML "escape" delimiter.
  35092. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  35093. * The "evaluate" delimiter.
  35094. * @param {Object} [options.imports=_.templateSettings.imports]
  35095. * An object to import into the template as free variables.
  35096. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  35097. * The "interpolate" delimiter.
  35098. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  35099. * The sourceURL of the compiled template.
  35100. * @param {string} [options.variable='obj']
  35101. * The data object variable name.
  35102. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  35103. * @returns {Function} Returns the compiled template function.
  35104. * @example
  35105. *
  35106. * // Use the "interpolate" delimiter to create a compiled template.
  35107. * var compiled = _.template('hello <%= user %>!');
  35108. * compiled({ 'user': 'fred' });
  35109. * // => 'hello fred!'
  35110. *
  35111. * // Use the HTML "escape" delimiter to escape data property values.
  35112. * var compiled = _.template('<b><%- value %></b>');
  35113. * compiled({ 'value': '<script>' });
  35114. * // => '<b>&lt;script&gt;</b>'
  35115. *
  35116. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  35117. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  35118. * compiled({ 'users': ['fred', 'barney'] });
  35119. * // => '<li>fred</li><li>barney</li>'
  35120. *
  35121. * // Use the internal `print` function in "evaluate" delimiters.
  35122. * var compiled = _.template('<% print("hello " + user); %>!');
  35123. * compiled({ 'user': 'barney' });
  35124. * // => 'hello barney!'
  35125. *
  35126. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  35127. * // Disable support by replacing the "interpolate" delimiter.
  35128. * var compiled = _.template('hello ${ user }!');
  35129. * compiled({ 'user': 'pebbles' });
  35130. * // => 'hello pebbles!'
  35131. *
  35132. * // Use backslashes to treat delimiters as plain text.
  35133. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  35134. * compiled({ 'value': 'ignored' });
  35135. * // => '<%- value %>'
  35136. *
  35137. * // Use the `imports` option to import `jQuery` as `jq`.
  35138. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  35139. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  35140. * compiled({ 'users': ['fred', 'barney'] });
  35141. * // => '<li>fred</li><li>barney</li>'
  35142. *
  35143. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  35144. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  35145. * compiled(data);
  35146. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  35147. *
  35148. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  35149. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  35150. * compiled.source;
  35151. * // => function(data) {
  35152. * // var __t, __p = '';
  35153. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  35154. * // return __p;
  35155. * // }
  35156. *
  35157. * // Use custom template delimiters.
  35158. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  35159. * var compiled = _.template('hello {{ user }}!');
  35160. * compiled({ 'user': 'mustache' });
  35161. * // => 'hello mustache!'
  35162. *
  35163. * // Use the `source` property to inline compiled templates for meaningful
  35164. * // line numbers in error messages and stack traces.
  35165. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  35166. * var JST = {\
  35167. * "main": ' + _.template(mainText).source + '\
  35168. * };\
  35169. * ');
  35170. */
  35171. function template(string, options, guard) {
  35172. // Based on John Resig's `tmpl` implementation
  35173. // (http://ejohn.org/blog/javascript-micro-templating/)
  35174. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  35175. var settings = lodash.templateSettings;
  35176. if (guard && isIterateeCall(string, options, guard)) {
  35177. options = undefined;
  35178. }
  35179. string = toString(string);
  35180. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  35181. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  35182. importsKeys = keys(imports),
  35183. importsValues = baseValues(imports, importsKeys);
  35184. var isEscaping,
  35185. isEvaluating,
  35186. index = 0,
  35187. interpolate = options.interpolate || reNoMatch,
  35188. source = "__p += '";
  35189. // Compile the regexp to match each delimiter.
  35190. var reDelimiters = RegExp(
  35191. (options.escape || reNoMatch).source + '|' +
  35192. interpolate.source + '|' +
  35193. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  35194. (options.evaluate || reNoMatch).source + '|$'
  35195. , 'g');
  35196. // Use a sourceURL for easier debugging.
  35197. // The sourceURL gets injected into the source that's eval-ed, so be careful
  35198. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  35199. // and escape the comment, thus injecting code that gets evaled.
  35200. var sourceURL = '//# sourceURL=' +
  35201. (hasOwnProperty.call(options, 'sourceURL')
  35202. ? (options.sourceURL + '').replace(/\s/g, ' ')
  35203. : ('lodash.templateSources[' + (++templateCounter) + ']')
  35204. ) + '\n';
  35205. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  35206. interpolateValue || (interpolateValue = esTemplateValue);
  35207. // Escape characters that can't be included in string literals.
  35208. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  35209. // Replace delimiters with snippets.
  35210. if (escapeValue) {
  35211. isEscaping = true;
  35212. source += "' +\n__e(" + escapeValue + ") +\n'";
  35213. }
  35214. if (evaluateValue) {
  35215. isEvaluating = true;
  35216. source += "';\n" + evaluateValue + ";\n__p += '";
  35217. }
  35218. if (interpolateValue) {
  35219. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  35220. }
  35221. index = offset + match.length;
  35222. // The JS engine embedded in Adobe products needs `match` returned in
  35223. // order to produce the correct `offset` value.
  35224. return match;
  35225. });
  35226. source += "';\n";
  35227. // If `variable` is not specified wrap a with-statement around the generated
  35228. // code to add the data object to the top of the scope chain.
  35229. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  35230. if (!variable) {
  35231. source = 'with (obj) {\n' + source + '\n}\n';
  35232. }
  35233. // Cleanup code by stripping empty strings.
  35234. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  35235. .replace(reEmptyStringMiddle, '$1')
  35236. .replace(reEmptyStringTrailing, '$1;');
  35237. // Frame code as the function body.
  35238. source = 'function(' + (variable || 'obj') + ') {\n' +
  35239. (variable
  35240. ? ''
  35241. : 'obj || (obj = {});\n'
  35242. ) +
  35243. "var __t, __p = ''" +
  35244. (isEscaping
  35245. ? ', __e = _.escape'
  35246. : ''
  35247. ) +
  35248. (isEvaluating
  35249. ? ', __j = Array.prototype.join;\n' +
  35250. "function print() { __p += __j.call(arguments, '') }\n"
  35251. : ';\n'
  35252. ) +
  35253. source +
  35254. 'return __p\n}';
  35255. var result = attempt(function() {
  35256. return Function(importsKeys, sourceURL + 'return ' + source)
  35257. .apply(undefined, importsValues);
  35258. });
  35259. // Provide the compiled function's source by its `toString` method or
  35260. // the `source` property as a convenience for inlining compiled templates.
  35261. result.source = source;
  35262. if (isError(result)) {
  35263. throw result;
  35264. }
  35265. return result;
  35266. }
  35267. /**
  35268. * Converts `string`, as a whole, to lower case just like
  35269. * [String#toLowerCase](https://mdn.io/toLowerCase).
  35270. *
  35271. * @static
  35272. * @memberOf _
  35273. * @since 4.0.0
  35274. * @category String
  35275. * @param {string} [string=''] The string to convert.
  35276. * @returns {string} Returns the lower cased string.
  35277. * @example
  35278. *
  35279. * _.toLower('--Foo-Bar--');
  35280. * // => '--foo-bar--'
  35281. *
  35282. * _.toLower('fooBar');
  35283. * // => 'foobar'
  35284. *
  35285. * _.toLower('__FOO_BAR__');
  35286. * // => '__foo_bar__'
  35287. */
  35288. function toLower(value) {
  35289. return toString(value).toLowerCase();
  35290. }
  35291. /**
  35292. * Converts `string`, as a whole, to upper case just like
  35293. * [String#toUpperCase](https://mdn.io/toUpperCase).
  35294. *
  35295. * @static
  35296. * @memberOf _
  35297. * @since 4.0.0
  35298. * @category String
  35299. * @param {string} [string=''] The string to convert.
  35300. * @returns {string} Returns the upper cased string.
  35301. * @example
  35302. *
  35303. * _.toUpper('--foo-bar--');
  35304. * // => '--FOO-BAR--'
  35305. *
  35306. * _.toUpper('fooBar');
  35307. * // => 'FOOBAR'
  35308. *
  35309. * _.toUpper('__foo_bar__');
  35310. * // => '__FOO_BAR__'
  35311. */
  35312. function toUpper(value) {
  35313. return toString(value).toUpperCase();
  35314. }
  35315. /**
  35316. * Removes leading and trailing whitespace or specified characters from `string`.
  35317. *
  35318. * @static
  35319. * @memberOf _
  35320. * @since 3.0.0
  35321. * @category String
  35322. * @param {string} [string=''] The string to trim.
  35323. * @param {string} [chars=whitespace] The characters to trim.
  35324. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  35325. * @returns {string} Returns the trimmed string.
  35326. * @example
  35327. *
  35328. * _.trim(' abc ');
  35329. * // => 'abc'
  35330. *
  35331. * _.trim('-_-abc-_-', '_-');
  35332. * // => 'abc'
  35333. *
  35334. * _.map([' foo ', ' bar '], _.trim);
  35335. * // => ['foo', 'bar']
  35336. */
  35337. function trim(string, chars, guard) {
  35338. string = toString(string);
  35339. if (string && (guard || chars === undefined)) {
  35340. return string.replace(reTrim, '');
  35341. }
  35342. if (!string || !(chars = baseToString(chars))) {
  35343. return string;
  35344. }
  35345. var strSymbols = stringToArray(string),
  35346. chrSymbols = stringToArray(chars),
  35347. start = charsStartIndex(strSymbols, chrSymbols),
  35348. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  35349. return castSlice(strSymbols, start, end).join('');
  35350. }
  35351. /**
  35352. * Removes trailing whitespace or specified characters from `string`.
  35353. *
  35354. * @static
  35355. * @memberOf _
  35356. * @since 4.0.0
  35357. * @category String
  35358. * @param {string} [string=''] The string to trim.
  35359. * @param {string} [chars=whitespace] The characters to trim.
  35360. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  35361. * @returns {string} Returns the trimmed string.
  35362. * @example
  35363. *
  35364. * _.trimEnd(' abc ');
  35365. * // => ' abc'
  35366. *
  35367. * _.trimEnd('-_-abc-_-', '_-');
  35368. * // => '-_-abc'
  35369. */
  35370. function trimEnd(string, chars, guard) {
  35371. string = toString(string);
  35372. if (string && (guard || chars === undefined)) {
  35373. return string.replace(reTrimEnd, '');
  35374. }
  35375. if (!string || !(chars = baseToString(chars))) {
  35376. return string;
  35377. }
  35378. var strSymbols = stringToArray(string),
  35379. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  35380. return castSlice(strSymbols, 0, end).join('');
  35381. }
  35382. /**
  35383. * Removes leading whitespace or specified characters from `string`.
  35384. *
  35385. * @static
  35386. * @memberOf _
  35387. * @since 4.0.0
  35388. * @category String
  35389. * @param {string} [string=''] The string to trim.
  35390. * @param {string} [chars=whitespace] The characters to trim.
  35391. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  35392. * @returns {string} Returns the trimmed string.
  35393. * @example
  35394. *
  35395. * _.trimStart(' abc ');
  35396. * // => 'abc '
  35397. *
  35398. * _.trimStart('-_-abc-_-', '_-');
  35399. * // => 'abc-_-'
  35400. */
  35401. function trimStart(string, chars, guard) {
  35402. string = toString(string);
  35403. if (string && (guard || chars === undefined)) {
  35404. return string.replace(reTrimStart, '');
  35405. }
  35406. if (!string || !(chars = baseToString(chars))) {
  35407. return string;
  35408. }
  35409. var strSymbols = stringToArray(string),
  35410. start = charsStartIndex(strSymbols, stringToArray(chars));
  35411. return castSlice(strSymbols, start).join('');
  35412. }
  35413. /**
  35414. * Truncates `string` if it's longer than the given maximum string length.
  35415. * The last characters of the truncated string are replaced with the omission
  35416. * string which defaults to "...".
  35417. *
  35418. * @static
  35419. * @memberOf _
  35420. * @since 4.0.0
  35421. * @category String
  35422. * @param {string} [string=''] The string to truncate.
  35423. * @param {Object} [options={}] The options object.
  35424. * @param {number} [options.length=30] The maximum string length.
  35425. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  35426. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  35427. * @returns {string} Returns the truncated string.
  35428. * @example
  35429. *
  35430. * _.truncate('hi-diddly-ho there, neighborino');
  35431. * // => 'hi-diddly-ho there, neighbo...'
  35432. *
  35433. * _.truncate('hi-diddly-ho there, neighborino', {
  35434. * 'length': 24,
  35435. * 'separator': ' '
  35436. * });
  35437. * // => 'hi-diddly-ho there,...'
  35438. *
  35439. * _.truncate('hi-diddly-ho there, neighborino', {
  35440. * 'length': 24,
  35441. * 'separator': /,? +/
  35442. * });
  35443. * // => 'hi-diddly-ho there...'
  35444. *
  35445. * _.truncate('hi-diddly-ho there, neighborino', {
  35446. * 'omission': ' [...]'
  35447. * });
  35448. * // => 'hi-diddly-ho there, neig [...]'
  35449. */
  35450. function truncate(string, options) {
  35451. var length = DEFAULT_TRUNC_LENGTH,
  35452. omission = DEFAULT_TRUNC_OMISSION;
  35453. if (isObject(options)) {
  35454. var separator = 'separator' in options ? options.separator : separator;
  35455. length = 'length' in options ? toInteger(options.length) : length;
  35456. omission = 'omission' in options ? baseToString(options.omission) : omission;
  35457. }
  35458. string = toString(string);
  35459. var strLength = string.length;
  35460. if (hasUnicode(string)) {
  35461. var strSymbols = stringToArray(string);
  35462. strLength = strSymbols.length;
  35463. }
  35464. if (length >= strLength) {
  35465. return string;
  35466. }
  35467. var end = length - stringSize(omission);
  35468. if (end < 1) {
  35469. return omission;
  35470. }
  35471. var result = strSymbols
  35472. ? castSlice(strSymbols, 0, end).join('')
  35473. : string.slice(0, end);
  35474. if (separator === undefined) {
  35475. return result + omission;
  35476. }
  35477. if (strSymbols) {
  35478. end += (result.length - end);
  35479. }
  35480. if (isRegExp(separator)) {
  35481. if (string.slice(end).search(separator)) {
  35482. var match,
  35483. substring = result;
  35484. if (!separator.global) {
  35485. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  35486. }
  35487. separator.lastIndex = 0;
  35488. while ((match = separator.exec(substring))) {
  35489. var newEnd = match.index;
  35490. }
  35491. result = result.slice(0, newEnd === undefined ? end : newEnd);
  35492. }
  35493. } else if (string.indexOf(baseToString(separator), end) != end) {
  35494. var index = result.lastIndexOf(separator);
  35495. if (index > -1) {
  35496. result = result.slice(0, index);
  35497. }
  35498. }
  35499. return result + omission;
  35500. }
  35501. /**
  35502. * The inverse of `_.escape`; this method converts the HTML entities
  35503. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  35504. * their corresponding characters.
  35505. *
  35506. * **Note:** No other HTML entities are unescaped. To unescape additional
  35507. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  35508. *
  35509. * @static
  35510. * @memberOf _
  35511. * @since 0.6.0
  35512. * @category String
  35513. * @param {string} [string=''] The string to unescape.
  35514. * @returns {string} Returns the unescaped string.
  35515. * @example
  35516. *
  35517. * _.unescape('fred, barney, &amp; pebbles');
  35518. * // => 'fred, barney, & pebbles'
  35519. */
  35520. function unescape(string) {
  35521. string = toString(string);
  35522. return (string && reHasEscapedHtml.test(string))
  35523. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  35524. : string;
  35525. }
  35526. /**
  35527. * Converts `string`, as space separated words, to upper case.
  35528. *
  35529. * @static
  35530. * @memberOf _
  35531. * @since 4.0.0
  35532. * @category String
  35533. * @param {string} [string=''] The string to convert.
  35534. * @returns {string} Returns the upper cased string.
  35535. * @example
  35536. *
  35537. * _.upperCase('--foo-bar');
  35538. * // => 'FOO BAR'
  35539. *
  35540. * _.upperCase('fooBar');
  35541. * // => 'FOO BAR'
  35542. *
  35543. * _.upperCase('__foo_bar__');
  35544. * // => 'FOO BAR'
  35545. */
  35546. var upperCase = createCompounder(function(result, word, index) {
  35547. return result + (index ? ' ' : '') + word.toUpperCase();
  35548. });
  35549. /**
  35550. * Converts the first character of `string` to upper case.
  35551. *
  35552. * @static
  35553. * @memberOf _
  35554. * @since 4.0.0
  35555. * @category String
  35556. * @param {string} [string=''] The string to convert.
  35557. * @returns {string} Returns the converted string.
  35558. * @example
  35559. *
  35560. * _.upperFirst('fred');
  35561. * // => 'Fred'
  35562. *
  35563. * _.upperFirst('FRED');
  35564. * // => 'FRED'
  35565. */
  35566. var upperFirst = createCaseFirst('toUpperCase');
  35567. /**
  35568. * Splits `string` into an array of its words.
  35569. *
  35570. * @static
  35571. * @memberOf _
  35572. * @since 3.0.0
  35573. * @category String
  35574. * @param {string} [string=''] The string to inspect.
  35575. * @param {RegExp|string} [pattern] The pattern to match words.
  35576. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  35577. * @returns {Array} Returns the words of `string`.
  35578. * @example
  35579. *
  35580. * _.words('fred, barney, & pebbles');
  35581. * // => ['fred', 'barney', 'pebbles']
  35582. *
  35583. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  35584. * // => ['fred', 'barney', '&', 'pebbles']
  35585. */
  35586. function words(string, pattern, guard) {
  35587. string = toString(string);
  35588. pattern = guard ? undefined : pattern;
  35589. if (pattern === undefined) {
  35590. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  35591. }
  35592. return string.match(pattern) || [];
  35593. }
  35594. /*------------------------------------------------------------------------*/
  35595. /**
  35596. * Attempts to invoke `func`, returning either the result or the caught error
  35597. * object. Any additional arguments are provided to `func` when it's invoked.
  35598. *
  35599. * @static
  35600. * @memberOf _
  35601. * @since 3.0.0
  35602. * @category Util
  35603. * @param {Function} func The function to attempt.
  35604. * @param {...*} [args] The arguments to invoke `func` with.
  35605. * @returns {*} Returns the `func` result or error object.
  35606. * @example
  35607. *
  35608. * // Avoid throwing errors for invalid selectors.
  35609. * var elements = _.attempt(function(selector) {
  35610. * return document.querySelectorAll(selector);
  35611. * }, '>_>');
  35612. *
  35613. * if (_.isError(elements)) {
  35614. * elements = [];
  35615. * }
  35616. */
  35617. var attempt = baseRest(function(func, args) {
  35618. try {
  35619. return apply(func, undefined, args);
  35620. } catch (e) {
  35621. return isError(e) ? e : new Error(e);
  35622. }
  35623. });
  35624. /**
  35625. * Binds methods of an object to the object itself, overwriting the existing
  35626. * method.
  35627. *
  35628. * **Note:** This method doesn't set the "length" property of bound functions.
  35629. *
  35630. * @static
  35631. * @since 0.1.0
  35632. * @memberOf _
  35633. * @category Util
  35634. * @param {Object} object The object to bind and assign the bound methods to.
  35635. * @param {...(string|string[])} methodNames The object method names to bind.
  35636. * @returns {Object} Returns `object`.
  35637. * @example
  35638. *
  35639. * var view = {
  35640. * 'label': 'docs',
  35641. * 'click': function() {
  35642. * console.log('clicked ' + this.label);
  35643. * }
  35644. * };
  35645. *
  35646. * _.bindAll(view, ['click']);
  35647. * jQuery(element).on('click', view.click);
  35648. * // => Logs 'clicked docs' when clicked.
  35649. */
  35650. var bindAll = flatRest(function(object, methodNames) {
  35651. arrayEach(methodNames, function(key) {
  35652. key = toKey(key);
  35653. baseAssignValue(object, key, bind(object[key], object));
  35654. });
  35655. return object;
  35656. });
  35657. /**
  35658. * Creates a function that iterates over `pairs` and invokes the corresponding
  35659. * function of the first predicate to return truthy. The predicate-function
  35660. * pairs are invoked with the `this` binding and arguments of the created
  35661. * function.
  35662. *
  35663. * @static
  35664. * @memberOf _
  35665. * @since 4.0.0
  35666. * @category Util
  35667. * @param {Array} pairs The predicate-function pairs.
  35668. * @returns {Function} Returns the new composite function.
  35669. * @example
  35670. *
  35671. * var func = _.cond([
  35672. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  35673. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  35674. * [_.stubTrue, _.constant('no match')]
  35675. * ]);
  35676. *
  35677. * func({ 'a': 1, 'b': 2 });
  35678. * // => 'matches A'
  35679. *
  35680. * func({ 'a': 0, 'b': 1 });
  35681. * // => 'matches B'
  35682. *
  35683. * func({ 'a': '1', 'b': '2' });
  35684. * // => 'no match'
  35685. */
  35686. function cond(pairs) {
  35687. var length = pairs == null ? 0 : pairs.length,
  35688. toIteratee = getIteratee();
  35689. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  35690. if (typeof pair[1] != 'function') {
  35691. throw new TypeError(FUNC_ERROR_TEXT);
  35692. }
  35693. return [toIteratee(pair[0]), pair[1]];
  35694. });
  35695. return baseRest(function(args) {
  35696. var index = -1;
  35697. while (++index < length) {
  35698. var pair = pairs[index];
  35699. if (apply(pair[0], this, args)) {
  35700. return apply(pair[1], this, args);
  35701. }
  35702. }
  35703. });
  35704. }
  35705. /**
  35706. * Creates a function that invokes the predicate properties of `source` with
  35707. * the corresponding property values of a given object, returning `true` if
  35708. * all predicates return truthy, else `false`.
  35709. *
  35710. * **Note:** The created function is equivalent to `_.conformsTo` with
  35711. * `source` partially applied.
  35712. *
  35713. * @static
  35714. * @memberOf _
  35715. * @since 4.0.0
  35716. * @category Util
  35717. * @param {Object} source The object of property predicates to conform to.
  35718. * @returns {Function} Returns the new spec function.
  35719. * @example
  35720. *
  35721. * var objects = [
  35722. * { 'a': 2, 'b': 1 },
  35723. * { 'a': 1, 'b': 2 }
  35724. * ];
  35725. *
  35726. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  35727. * // => [{ 'a': 1, 'b': 2 }]
  35728. */
  35729. function conforms(source) {
  35730. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  35731. }
  35732. /**
  35733. * Creates a function that returns `value`.
  35734. *
  35735. * @static
  35736. * @memberOf _
  35737. * @since 2.4.0
  35738. * @category Util
  35739. * @param {*} value The value to return from the new function.
  35740. * @returns {Function} Returns the new constant function.
  35741. * @example
  35742. *
  35743. * var objects = _.times(2, _.constant({ 'a': 1 }));
  35744. *
  35745. * console.log(objects);
  35746. * // => [{ 'a': 1 }, { 'a': 1 }]
  35747. *
  35748. * console.log(objects[0] === objects[1]);
  35749. * // => true
  35750. */
  35751. function constant(value) {
  35752. return function() {
  35753. return value;
  35754. };
  35755. }
  35756. /**
  35757. * Checks `value` to determine whether a default value should be returned in
  35758. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  35759. * or `undefined`.
  35760. *
  35761. * @static
  35762. * @memberOf _
  35763. * @since 4.14.0
  35764. * @category Util
  35765. * @param {*} value The value to check.
  35766. * @param {*} defaultValue The default value.
  35767. * @returns {*} Returns the resolved value.
  35768. * @example
  35769. *
  35770. * _.defaultTo(1, 10);
  35771. * // => 1
  35772. *
  35773. * _.defaultTo(undefined, 10);
  35774. * // => 10
  35775. */
  35776. function defaultTo(value, defaultValue) {
  35777. return (value == null || value !== value) ? defaultValue : value;
  35778. }
  35779. /**
  35780. * Creates a function that returns the result of invoking the given functions
  35781. * with the `this` binding of the created function, where each successive
  35782. * invocation is supplied the return value of the previous.
  35783. *
  35784. * @static
  35785. * @memberOf _
  35786. * @since 3.0.0
  35787. * @category Util
  35788. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  35789. * @returns {Function} Returns the new composite function.
  35790. * @see _.flowRight
  35791. * @example
  35792. *
  35793. * function square(n) {
  35794. * return n * n;
  35795. * }
  35796. *
  35797. * var addSquare = _.flow([_.add, square]);
  35798. * addSquare(1, 2);
  35799. * // => 9
  35800. */
  35801. var flow = createFlow();
  35802. /**
  35803. * This method is like `_.flow` except that it creates a function that
  35804. * invokes the given functions from right to left.
  35805. *
  35806. * @static
  35807. * @since 3.0.0
  35808. * @memberOf _
  35809. * @category Util
  35810. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  35811. * @returns {Function} Returns the new composite function.
  35812. * @see _.flow
  35813. * @example
  35814. *
  35815. * function square(n) {
  35816. * return n * n;
  35817. * }
  35818. *
  35819. * var addSquare = _.flowRight([square, _.add]);
  35820. * addSquare(1, 2);
  35821. * // => 9
  35822. */
  35823. var flowRight = createFlow(true);
  35824. /**
  35825. * This method returns the first argument it receives.
  35826. *
  35827. * @static
  35828. * @since 0.1.0
  35829. * @memberOf _
  35830. * @category Util
  35831. * @param {*} value Any value.
  35832. * @returns {*} Returns `value`.
  35833. * @example
  35834. *
  35835. * var object = { 'a': 1 };
  35836. *
  35837. * console.log(_.identity(object) === object);
  35838. * // => true
  35839. */
  35840. function identity(value) {
  35841. return value;
  35842. }
  35843. /**
  35844. * Creates a function that invokes `func` with the arguments of the created
  35845. * function. If `func` is a property name, the created function returns the
  35846. * property value for a given element. If `func` is an array or object, the
  35847. * created function returns `true` for elements that contain the equivalent
  35848. * source properties, otherwise it returns `false`.
  35849. *
  35850. * @static
  35851. * @since 4.0.0
  35852. * @memberOf _
  35853. * @category Util
  35854. * @param {*} [func=_.identity] The value to convert to a callback.
  35855. * @returns {Function} Returns the callback.
  35856. * @example
  35857. *
  35858. * var users = [
  35859. * { 'user': 'barney', 'age': 36, 'active': true },
  35860. * { 'user': 'fred', 'age': 40, 'active': false }
  35861. * ];
  35862. *
  35863. * // The `_.matches` iteratee shorthand.
  35864. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  35865. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  35866. *
  35867. * // The `_.matchesProperty` iteratee shorthand.
  35868. * _.filter(users, _.iteratee(['user', 'fred']));
  35869. * // => [{ 'user': 'fred', 'age': 40 }]
  35870. *
  35871. * // The `_.property` iteratee shorthand.
  35872. * _.map(users, _.iteratee('user'));
  35873. * // => ['barney', 'fred']
  35874. *
  35875. * // Create custom iteratee shorthands.
  35876. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  35877. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  35878. * return func.test(string);
  35879. * };
  35880. * });
  35881. *
  35882. * _.filter(['abc', 'def'], /ef/);
  35883. * // => ['def']
  35884. */
  35885. function iteratee(func) {
  35886. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  35887. }
  35888. /**
  35889. * Creates a function that performs a partial deep comparison between a given
  35890. * object and `source`, returning `true` if the given object has equivalent
  35891. * property values, else `false`.
  35892. *
  35893. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  35894. * partially applied.
  35895. *
  35896. * Partial comparisons will match empty array and empty object `source`
  35897. * values against any array or object value, respectively. See `_.isEqual`
  35898. * for a list of supported value comparisons.
  35899. *
  35900. * **Note:** Multiple values can be checked by combining several matchers
  35901. * using `_.overSome`
  35902. *
  35903. * @static
  35904. * @memberOf _
  35905. * @since 3.0.0
  35906. * @category Util
  35907. * @param {Object} source The object of property values to match.
  35908. * @returns {Function} Returns the new spec function.
  35909. * @example
  35910. *
  35911. * var objects = [
  35912. * { 'a': 1, 'b': 2, 'c': 3 },
  35913. * { 'a': 4, 'b': 5, 'c': 6 }
  35914. * ];
  35915. *
  35916. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  35917. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  35918. *
  35919. * // Checking for several possible values
  35920. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  35921. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  35922. */
  35923. function matches(source) {
  35924. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  35925. }
  35926. /**
  35927. * Creates a function that performs a partial deep comparison between the
  35928. * value at `path` of a given object to `srcValue`, returning `true` if the
  35929. * object value is equivalent, else `false`.
  35930. *
  35931. * **Note:** Partial comparisons will match empty array and empty object
  35932. * `srcValue` values against any array or object value, respectively. See
  35933. * `_.isEqual` for a list of supported value comparisons.
  35934. *
  35935. * **Note:** Multiple values can be checked by combining several matchers
  35936. * using `_.overSome`
  35937. *
  35938. * @static
  35939. * @memberOf _
  35940. * @since 3.2.0
  35941. * @category Util
  35942. * @param {Array|string} path The path of the property to get.
  35943. * @param {*} srcValue The value to match.
  35944. * @returns {Function} Returns the new spec function.
  35945. * @example
  35946. *
  35947. * var objects = [
  35948. * { 'a': 1, 'b': 2, 'c': 3 },
  35949. * { 'a': 4, 'b': 5, 'c': 6 }
  35950. * ];
  35951. *
  35952. * _.find(objects, _.matchesProperty('a', 4));
  35953. * // => { 'a': 4, 'b': 5, 'c': 6 }
  35954. *
  35955. * // Checking for several possible values
  35956. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  35957. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  35958. */
  35959. function matchesProperty(path, srcValue) {
  35960. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  35961. }
  35962. /**
  35963. * Creates a function that invokes the method at `path` of a given object.
  35964. * Any additional arguments are provided to the invoked method.
  35965. *
  35966. * @static
  35967. * @memberOf _
  35968. * @since 3.7.0
  35969. * @category Util
  35970. * @param {Array|string} path The path of the method to invoke.
  35971. * @param {...*} [args] The arguments to invoke the method with.
  35972. * @returns {Function} Returns the new invoker function.
  35973. * @example
  35974. *
  35975. * var objects = [
  35976. * { 'a': { 'b': _.constant(2) } },
  35977. * { 'a': { 'b': _.constant(1) } }
  35978. * ];
  35979. *
  35980. * _.map(objects, _.method('a.b'));
  35981. * // => [2, 1]
  35982. *
  35983. * _.map(objects, _.method(['a', 'b']));
  35984. * // => [2, 1]
  35985. */
  35986. var method = baseRest(function(path, args) {
  35987. return function(object) {
  35988. return baseInvoke(object, path, args);
  35989. };
  35990. });
  35991. /**
  35992. * The opposite of `_.method`; this method creates a function that invokes
  35993. * the method at a given path of `object`. Any additional arguments are
  35994. * provided to the invoked method.
  35995. *
  35996. * @static
  35997. * @memberOf _
  35998. * @since 3.7.0
  35999. * @category Util
  36000. * @param {Object} object The object to query.
  36001. * @param {...*} [args] The arguments to invoke the method with.
  36002. * @returns {Function} Returns the new invoker function.
  36003. * @example
  36004. *
  36005. * var array = _.times(3, _.constant),
  36006. * object = { 'a': array, 'b': array, 'c': array };
  36007. *
  36008. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  36009. * // => [2, 0]
  36010. *
  36011. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  36012. * // => [2, 0]
  36013. */
  36014. var methodOf = baseRest(function(object, args) {
  36015. return function(path) {
  36016. return baseInvoke(object, path, args);
  36017. };
  36018. });
  36019. /**
  36020. * Adds all own enumerable string keyed function properties of a source
  36021. * object to the destination object. If `object` is a function, then methods
  36022. * are added to its prototype as well.
  36023. *
  36024. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  36025. * avoid conflicts caused by modifying the original.
  36026. *
  36027. * @static
  36028. * @since 0.1.0
  36029. * @memberOf _
  36030. * @category Util
  36031. * @param {Function|Object} [object=lodash] The destination object.
  36032. * @param {Object} source The object of functions to add.
  36033. * @param {Object} [options={}] The options object.
  36034. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  36035. * @returns {Function|Object} Returns `object`.
  36036. * @example
  36037. *
  36038. * function vowels(string) {
  36039. * return _.filter(string, function(v) {
  36040. * return /[aeiou]/i.test(v);
  36041. * });
  36042. * }
  36043. *
  36044. * _.mixin({ 'vowels': vowels });
  36045. * _.vowels('fred');
  36046. * // => ['e']
  36047. *
  36048. * _('fred').vowels().value();
  36049. * // => ['e']
  36050. *
  36051. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  36052. * _('fred').vowels();
  36053. * // => ['e']
  36054. */
  36055. function mixin(object, source, options) {
  36056. var props = keys(source),
  36057. methodNames = baseFunctions(source, props);
  36058. if (options == null &&
  36059. !(isObject(source) && (methodNames.length || !props.length))) {
  36060. options = source;
  36061. source = object;
  36062. object = this;
  36063. methodNames = baseFunctions(source, keys(source));
  36064. }
  36065. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  36066. isFunc = isFunction(object);
  36067. arrayEach(methodNames, function(methodName) {
  36068. var func = source[methodName];
  36069. object[methodName] = func;
  36070. if (isFunc) {
  36071. object.prototype[methodName] = function() {
  36072. var chainAll = this.__chain__;
  36073. if (chain || chainAll) {
  36074. var result = object(this.__wrapped__),
  36075. actions = result.__actions__ = copyArray(this.__actions__);
  36076. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  36077. result.__chain__ = chainAll;
  36078. return result;
  36079. }
  36080. return func.apply(object, arrayPush([this.value()], arguments));
  36081. };
  36082. }
  36083. });
  36084. return object;
  36085. }
  36086. /**
  36087. * Reverts the `_` variable to its previous value and returns a reference to
  36088. * the `lodash` function.
  36089. *
  36090. * @static
  36091. * @since 0.1.0
  36092. * @memberOf _
  36093. * @category Util
  36094. * @returns {Function} Returns the `lodash` function.
  36095. * @example
  36096. *
  36097. * var lodash = _.noConflict();
  36098. */
  36099. function noConflict() {
  36100. if (root._ === this) {
  36101. root._ = oldDash;
  36102. }
  36103. return this;
  36104. }
  36105. /**
  36106. * This method returns `undefined`.
  36107. *
  36108. * @static
  36109. * @memberOf _
  36110. * @since 2.3.0
  36111. * @category Util
  36112. * @example
  36113. *
  36114. * _.times(2, _.noop);
  36115. * // => [undefined, undefined]
  36116. */
  36117. function noop() {
  36118. // No operation performed.
  36119. }
  36120. /**
  36121. * Creates a function that gets the argument at index `n`. If `n` is negative,
  36122. * the nth argument from the end is returned.
  36123. *
  36124. * @static
  36125. * @memberOf _
  36126. * @since 4.0.0
  36127. * @category Util
  36128. * @param {number} [n=0] The index of the argument to return.
  36129. * @returns {Function} Returns the new pass-thru function.
  36130. * @example
  36131. *
  36132. * var func = _.nthArg(1);
  36133. * func('a', 'b', 'c', 'd');
  36134. * // => 'b'
  36135. *
  36136. * var func = _.nthArg(-2);
  36137. * func('a', 'b', 'c', 'd');
  36138. * // => 'c'
  36139. */
  36140. function nthArg(n) {
  36141. n = toInteger(n);
  36142. return baseRest(function(args) {
  36143. return baseNth(args, n);
  36144. });
  36145. }
  36146. /**
  36147. * Creates a function that invokes `iteratees` with the arguments it receives
  36148. * and returns their results.
  36149. *
  36150. * @static
  36151. * @memberOf _
  36152. * @since 4.0.0
  36153. * @category Util
  36154. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  36155. * The iteratees to invoke.
  36156. * @returns {Function} Returns the new function.
  36157. * @example
  36158. *
  36159. * var func = _.over([Math.max, Math.min]);
  36160. *
  36161. * func(1, 2, 3, 4);
  36162. * // => [4, 1]
  36163. */
  36164. var over = createOver(arrayMap);
  36165. /**
  36166. * Creates a function that checks if **all** of the `predicates` return
  36167. * truthy when invoked with the arguments it receives.
  36168. *
  36169. * Following shorthands are possible for providing predicates.
  36170. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  36171. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  36172. *
  36173. * @static
  36174. * @memberOf _
  36175. * @since 4.0.0
  36176. * @category Util
  36177. * @param {...(Function|Function[])} [predicates=[_.identity]]
  36178. * The predicates to check.
  36179. * @returns {Function} Returns the new function.
  36180. * @example
  36181. *
  36182. * var func = _.overEvery([Boolean, isFinite]);
  36183. *
  36184. * func('1');
  36185. * // => true
  36186. *
  36187. * func(null);
  36188. * // => false
  36189. *
  36190. * func(NaN);
  36191. * // => false
  36192. */
  36193. var overEvery = createOver(arrayEvery);
  36194. /**
  36195. * Creates a function that checks if **any** of the `predicates` return
  36196. * truthy when invoked with the arguments it receives.
  36197. *
  36198. * Following shorthands are possible for providing predicates.
  36199. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  36200. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  36201. *
  36202. * @static
  36203. * @memberOf _
  36204. * @since 4.0.0
  36205. * @category Util
  36206. * @param {...(Function|Function[])} [predicates=[_.identity]]
  36207. * The predicates to check.
  36208. * @returns {Function} Returns the new function.
  36209. * @example
  36210. *
  36211. * var func = _.overSome([Boolean, isFinite]);
  36212. *
  36213. * func('1');
  36214. * // => true
  36215. *
  36216. * func(null);
  36217. * // => true
  36218. *
  36219. * func(NaN);
  36220. * // => false
  36221. *
  36222. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  36223. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  36224. */
  36225. var overSome = createOver(arraySome);
  36226. /**
  36227. * Creates a function that returns the value at `path` of a given object.
  36228. *
  36229. * @static
  36230. * @memberOf _
  36231. * @since 2.4.0
  36232. * @category Util
  36233. * @param {Array|string} path The path of the property to get.
  36234. * @returns {Function} Returns the new accessor function.
  36235. * @example
  36236. *
  36237. * var objects = [
  36238. * { 'a': { 'b': 2 } },
  36239. * { 'a': { 'b': 1 } }
  36240. * ];
  36241. *
  36242. * _.map(objects, _.property('a.b'));
  36243. * // => [2, 1]
  36244. *
  36245. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  36246. * // => [1, 2]
  36247. */
  36248. function property(path) {
  36249. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  36250. }
  36251. /**
  36252. * The opposite of `_.property`; this method creates a function that returns
  36253. * the value at a given path of `object`.
  36254. *
  36255. * @static
  36256. * @memberOf _
  36257. * @since 3.0.0
  36258. * @category Util
  36259. * @param {Object} object The object to query.
  36260. * @returns {Function} Returns the new accessor function.
  36261. * @example
  36262. *
  36263. * var array = [0, 1, 2],
  36264. * object = { 'a': array, 'b': array, 'c': array };
  36265. *
  36266. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  36267. * // => [2, 0]
  36268. *
  36269. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  36270. * // => [2, 0]
  36271. */
  36272. function propertyOf(object) {
  36273. return function(path) {
  36274. return object == null ? undefined : baseGet(object, path);
  36275. };
  36276. }
  36277. /**
  36278. * Creates an array of numbers (positive and/or negative) progressing from
  36279. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  36280. * `start` is specified without an `end` or `step`. If `end` is not specified,
  36281. * it's set to `start` with `start` then set to `0`.
  36282. *
  36283. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  36284. * floating-point values which can produce unexpected results.
  36285. *
  36286. * @static
  36287. * @since 0.1.0
  36288. * @memberOf _
  36289. * @category Util
  36290. * @param {number} [start=0] The start of the range.
  36291. * @param {number} end The end of the range.
  36292. * @param {number} [step=1] The value to increment or decrement by.
  36293. * @returns {Array} Returns the range of numbers.
  36294. * @see _.inRange, _.rangeRight
  36295. * @example
  36296. *
  36297. * _.range(4);
  36298. * // => [0, 1, 2, 3]
  36299. *
  36300. * _.range(-4);
  36301. * // => [0, -1, -2, -3]
  36302. *
  36303. * _.range(1, 5);
  36304. * // => [1, 2, 3, 4]
  36305. *
  36306. * _.range(0, 20, 5);
  36307. * // => [0, 5, 10, 15]
  36308. *
  36309. * _.range(0, -4, -1);
  36310. * // => [0, -1, -2, -3]
  36311. *
  36312. * _.range(1, 4, 0);
  36313. * // => [1, 1, 1]
  36314. *
  36315. * _.range(0);
  36316. * // => []
  36317. */
  36318. var range = createRange();
  36319. /**
  36320. * This method is like `_.range` except that it populates values in
  36321. * descending order.
  36322. *
  36323. * @static
  36324. * @memberOf _
  36325. * @since 4.0.0
  36326. * @category Util
  36327. * @param {number} [start=0] The start of the range.
  36328. * @param {number} end The end of the range.
  36329. * @param {number} [step=1] The value to increment or decrement by.
  36330. * @returns {Array} Returns the range of numbers.
  36331. * @see _.inRange, _.range
  36332. * @example
  36333. *
  36334. * _.rangeRight(4);
  36335. * // => [3, 2, 1, 0]
  36336. *
  36337. * _.rangeRight(-4);
  36338. * // => [-3, -2, -1, 0]
  36339. *
  36340. * _.rangeRight(1, 5);
  36341. * // => [4, 3, 2, 1]
  36342. *
  36343. * _.rangeRight(0, 20, 5);
  36344. * // => [15, 10, 5, 0]
  36345. *
  36346. * _.rangeRight(0, -4, -1);
  36347. * // => [-3, -2, -1, 0]
  36348. *
  36349. * _.rangeRight(1, 4, 0);
  36350. * // => [1, 1, 1]
  36351. *
  36352. * _.rangeRight(0);
  36353. * // => []
  36354. */
  36355. var rangeRight = createRange(true);
  36356. /**
  36357. * This method returns a new empty array.
  36358. *
  36359. * @static
  36360. * @memberOf _
  36361. * @since 4.13.0
  36362. * @category Util
  36363. * @returns {Array} Returns the new empty array.
  36364. * @example
  36365. *
  36366. * var arrays = _.times(2, _.stubArray);
  36367. *
  36368. * console.log(arrays);
  36369. * // => [[], []]
  36370. *
  36371. * console.log(arrays[0] === arrays[1]);
  36372. * // => false
  36373. */
  36374. function stubArray() {
  36375. return [];
  36376. }
  36377. /**
  36378. * This method returns `false`.
  36379. *
  36380. * @static
  36381. * @memberOf _
  36382. * @since 4.13.0
  36383. * @category Util
  36384. * @returns {boolean} Returns `false`.
  36385. * @example
  36386. *
  36387. * _.times(2, _.stubFalse);
  36388. * // => [false, false]
  36389. */
  36390. function stubFalse() {
  36391. return false;
  36392. }
  36393. /**
  36394. * This method returns a new empty object.
  36395. *
  36396. * @static
  36397. * @memberOf _
  36398. * @since 4.13.0
  36399. * @category Util
  36400. * @returns {Object} Returns the new empty object.
  36401. * @example
  36402. *
  36403. * var objects = _.times(2, _.stubObject);
  36404. *
  36405. * console.log(objects);
  36406. * // => [{}, {}]
  36407. *
  36408. * console.log(objects[0] === objects[1]);
  36409. * // => false
  36410. */
  36411. function stubObject() {
  36412. return {};
  36413. }
  36414. /**
  36415. * This method returns an empty string.
  36416. *
  36417. * @static
  36418. * @memberOf _
  36419. * @since 4.13.0
  36420. * @category Util
  36421. * @returns {string} Returns the empty string.
  36422. * @example
  36423. *
  36424. * _.times(2, _.stubString);
  36425. * // => ['', '']
  36426. */
  36427. function stubString() {
  36428. return '';
  36429. }
  36430. /**
  36431. * This method returns `true`.
  36432. *
  36433. * @static
  36434. * @memberOf _
  36435. * @since 4.13.0
  36436. * @category Util
  36437. * @returns {boolean} Returns `true`.
  36438. * @example
  36439. *
  36440. * _.times(2, _.stubTrue);
  36441. * // => [true, true]
  36442. */
  36443. function stubTrue() {
  36444. return true;
  36445. }
  36446. /**
  36447. * Invokes the iteratee `n` times, returning an array of the results of
  36448. * each invocation. The iteratee is invoked with one argument; (index).
  36449. *
  36450. * @static
  36451. * @since 0.1.0
  36452. * @memberOf _
  36453. * @category Util
  36454. * @param {number} n The number of times to invoke `iteratee`.
  36455. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  36456. * @returns {Array} Returns the array of results.
  36457. * @example
  36458. *
  36459. * _.times(3, String);
  36460. * // => ['0', '1', '2']
  36461. *
  36462. * _.times(4, _.constant(0));
  36463. * // => [0, 0, 0, 0]
  36464. */
  36465. function times(n, iteratee) {
  36466. n = toInteger(n);
  36467. if (n < 1 || n > MAX_SAFE_INTEGER) {
  36468. return [];
  36469. }
  36470. var index = MAX_ARRAY_LENGTH,
  36471. length = nativeMin(n, MAX_ARRAY_LENGTH);
  36472. iteratee = getIteratee(iteratee);
  36473. n -= MAX_ARRAY_LENGTH;
  36474. var result = baseTimes(length, iteratee);
  36475. while (++index < n) {
  36476. iteratee(index);
  36477. }
  36478. return result;
  36479. }
  36480. /**
  36481. * Converts `value` to a property path array.
  36482. *
  36483. * @static
  36484. * @memberOf _
  36485. * @since 4.0.0
  36486. * @category Util
  36487. * @param {*} value The value to convert.
  36488. * @returns {Array} Returns the new property path array.
  36489. * @example
  36490. *
  36491. * _.toPath('a.b.c');
  36492. * // => ['a', 'b', 'c']
  36493. *
  36494. * _.toPath('a[0].b.c');
  36495. * // => ['a', '0', 'b', 'c']
  36496. */
  36497. function toPath(value) {
  36498. if (isArray(value)) {
  36499. return arrayMap(value, toKey);
  36500. }
  36501. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  36502. }
  36503. /**
  36504. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  36505. *
  36506. * @static
  36507. * @since 0.1.0
  36508. * @memberOf _
  36509. * @category Util
  36510. * @param {string} [prefix=''] The value to prefix the ID with.
  36511. * @returns {string} Returns the unique ID.
  36512. * @example
  36513. *
  36514. * _.uniqueId('contact_');
  36515. * // => 'contact_104'
  36516. *
  36517. * _.uniqueId();
  36518. * // => '105'
  36519. */
  36520. function uniqueId(prefix) {
  36521. var id = ++idCounter;
  36522. return toString(prefix) + id;
  36523. }
  36524. /*------------------------------------------------------------------------*/
  36525. /**
  36526. * Adds two numbers.
  36527. *
  36528. * @static
  36529. * @memberOf _
  36530. * @since 3.4.0
  36531. * @category Math
  36532. * @param {number} augend The first number in an addition.
  36533. * @param {number} addend The second number in an addition.
  36534. * @returns {number} Returns the total.
  36535. * @example
  36536. *
  36537. * _.add(6, 4);
  36538. * // => 10
  36539. */
  36540. var add = createMathOperation(function(augend, addend) {
  36541. return augend + addend;
  36542. }, 0);
  36543. /**
  36544. * Computes `number` rounded up to `precision`.
  36545. *
  36546. * @static
  36547. * @memberOf _
  36548. * @since 3.10.0
  36549. * @category Math
  36550. * @param {number} number The number to round up.
  36551. * @param {number} [precision=0] The precision to round up to.
  36552. * @returns {number} Returns the rounded up number.
  36553. * @example
  36554. *
  36555. * _.ceil(4.006);
  36556. * // => 5
  36557. *
  36558. * _.ceil(6.004, 2);
  36559. * // => 6.01
  36560. *
  36561. * _.ceil(6040, -2);
  36562. * // => 6100
  36563. */
  36564. var ceil = createRound('ceil');
  36565. /**
  36566. * Divide two numbers.
  36567. *
  36568. * @static
  36569. * @memberOf _
  36570. * @since 4.7.0
  36571. * @category Math
  36572. * @param {number} dividend The first number in a division.
  36573. * @param {number} divisor The second number in a division.
  36574. * @returns {number} Returns the quotient.
  36575. * @example
  36576. *
  36577. * _.divide(6, 4);
  36578. * // => 1.5
  36579. */
  36580. var divide = createMathOperation(function(dividend, divisor) {
  36581. return dividend / divisor;
  36582. }, 1);
  36583. /**
  36584. * Computes `number` rounded down to `precision`.
  36585. *
  36586. * @static
  36587. * @memberOf _
  36588. * @since 3.10.0
  36589. * @category Math
  36590. * @param {number} number The number to round down.
  36591. * @param {number} [precision=0] The precision to round down to.
  36592. * @returns {number} Returns the rounded down number.
  36593. * @example
  36594. *
  36595. * _.floor(4.006);
  36596. * // => 4
  36597. *
  36598. * _.floor(0.046, 2);
  36599. * // => 0.04
  36600. *
  36601. * _.floor(4060, -2);
  36602. * // => 4000
  36603. */
  36604. var floor = createRound('floor');
  36605. /**
  36606. * Computes the maximum value of `array`. If `array` is empty or falsey,
  36607. * `undefined` is returned.
  36608. *
  36609. * @static
  36610. * @since 0.1.0
  36611. * @memberOf _
  36612. * @category Math
  36613. * @param {Array} array The array to iterate over.
  36614. * @returns {*} Returns the maximum value.
  36615. * @example
  36616. *
  36617. * _.max([4, 2, 8, 6]);
  36618. * // => 8
  36619. *
  36620. * _.max([]);
  36621. * // => undefined
  36622. */
  36623. function max(array) {
  36624. return (array && array.length)
  36625. ? baseExtremum(array, identity, baseGt)
  36626. : undefined;
  36627. }
  36628. /**
  36629. * This method is like `_.max` except that it accepts `iteratee` which is
  36630. * invoked for each element in `array` to generate the criterion by which
  36631. * the value is ranked. The iteratee is invoked with one argument: (value).
  36632. *
  36633. * @static
  36634. * @memberOf _
  36635. * @since 4.0.0
  36636. * @category Math
  36637. * @param {Array} array The array to iterate over.
  36638. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  36639. * @returns {*} Returns the maximum value.
  36640. * @example
  36641. *
  36642. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  36643. *
  36644. * _.maxBy(objects, function(o) { return o.n; });
  36645. * // => { 'n': 2 }
  36646. *
  36647. * // The `_.property` iteratee shorthand.
  36648. * _.maxBy(objects, 'n');
  36649. * // => { 'n': 2 }
  36650. */
  36651. function maxBy(array, iteratee) {
  36652. return (array && array.length)
  36653. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  36654. : undefined;
  36655. }
  36656. /**
  36657. * Computes the mean of the values in `array`.
  36658. *
  36659. * @static
  36660. * @memberOf _
  36661. * @since 4.0.0
  36662. * @category Math
  36663. * @param {Array} array The array to iterate over.
  36664. * @returns {number} Returns the mean.
  36665. * @example
  36666. *
  36667. * _.mean([4, 2, 8, 6]);
  36668. * // => 5
  36669. */
  36670. function mean(array) {
  36671. return baseMean(array, identity);
  36672. }
  36673. /**
  36674. * This method is like `_.mean` except that it accepts `iteratee` which is
  36675. * invoked for each element in `array` to generate the value to be averaged.
  36676. * The iteratee is invoked with one argument: (value).
  36677. *
  36678. * @static
  36679. * @memberOf _
  36680. * @since 4.7.0
  36681. * @category Math
  36682. * @param {Array} array The array to iterate over.
  36683. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  36684. * @returns {number} Returns the mean.
  36685. * @example
  36686. *
  36687. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  36688. *
  36689. * _.meanBy(objects, function(o) { return o.n; });
  36690. * // => 5
  36691. *
  36692. * // The `_.property` iteratee shorthand.
  36693. * _.meanBy(objects, 'n');
  36694. * // => 5
  36695. */
  36696. function meanBy(array, iteratee) {
  36697. return baseMean(array, getIteratee(iteratee, 2));
  36698. }
  36699. /**
  36700. * Computes the minimum value of `array`. If `array` is empty or falsey,
  36701. * `undefined` is returned.
  36702. *
  36703. * @static
  36704. * @since 0.1.0
  36705. * @memberOf _
  36706. * @category Math
  36707. * @param {Array} array The array to iterate over.
  36708. * @returns {*} Returns the minimum value.
  36709. * @example
  36710. *
  36711. * _.min([4, 2, 8, 6]);
  36712. * // => 2
  36713. *
  36714. * _.min([]);
  36715. * // => undefined
  36716. */
  36717. function min(array) {
  36718. return (array && array.length)
  36719. ? baseExtremum(array, identity, baseLt)
  36720. : undefined;
  36721. }
  36722. /**
  36723. * This method is like `_.min` except that it accepts `iteratee` which is
  36724. * invoked for each element in `array` to generate the criterion by which
  36725. * the value is ranked. The iteratee is invoked with one argument: (value).
  36726. *
  36727. * @static
  36728. * @memberOf _
  36729. * @since 4.0.0
  36730. * @category Math
  36731. * @param {Array} array The array to iterate over.
  36732. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  36733. * @returns {*} Returns the minimum value.
  36734. * @example
  36735. *
  36736. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  36737. *
  36738. * _.minBy(objects, function(o) { return o.n; });
  36739. * // => { 'n': 1 }
  36740. *
  36741. * // The `_.property` iteratee shorthand.
  36742. * _.minBy(objects, 'n');
  36743. * // => { 'n': 1 }
  36744. */
  36745. function minBy(array, iteratee) {
  36746. return (array && array.length)
  36747. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  36748. : undefined;
  36749. }
  36750. /**
  36751. * Multiply two numbers.
  36752. *
  36753. * @static
  36754. * @memberOf _
  36755. * @since 4.7.0
  36756. * @category Math
  36757. * @param {number} multiplier The first number in a multiplication.
  36758. * @param {number} multiplicand The second number in a multiplication.
  36759. * @returns {number} Returns the product.
  36760. * @example
  36761. *
  36762. * _.multiply(6, 4);
  36763. * // => 24
  36764. */
  36765. var multiply = createMathOperation(function(multiplier, multiplicand) {
  36766. return multiplier * multiplicand;
  36767. }, 1);
  36768. /**
  36769. * Computes `number` rounded to `precision`.
  36770. *
  36771. * @static
  36772. * @memberOf _
  36773. * @since 3.10.0
  36774. * @category Math
  36775. * @param {number} number The number to round.
  36776. * @param {number} [precision=0] The precision to round to.
  36777. * @returns {number} Returns the rounded number.
  36778. * @example
  36779. *
  36780. * _.round(4.006);
  36781. * // => 4
  36782. *
  36783. * _.round(4.006, 2);
  36784. * // => 4.01
  36785. *
  36786. * _.round(4060, -2);
  36787. * // => 4100
  36788. */
  36789. var round = createRound('round');
  36790. /**
  36791. * Subtract two numbers.
  36792. *
  36793. * @static
  36794. * @memberOf _
  36795. * @since 4.0.0
  36796. * @category Math
  36797. * @param {number} minuend The first number in a subtraction.
  36798. * @param {number} subtrahend The second number in a subtraction.
  36799. * @returns {number} Returns the difference.
  36800. * @example
  36801. *
  36802. * _.subtract(6, 4);
  36803. * // => 2
  36804. */
  36805. var subtract = createMathOperation(function(minuend, subtrahend) {
  36806. return minuend - subtrahend;
  36807. }, 0);
  36808. /**
  36809. * Computes the sum of the values in `array`.
  36810. *
  36811. * @static
  36812. * @memberOf _
  36813. * @since 3.4.0
  36814. * @category Math
  36815. * @param {Array} array The array to iterate over.
  36816. * @returns {number} Returns the sum.
  36817. * @example
  36818. *
  36819. * _.sum([4, 2, 8, 6]);
  36820. * // => 20
  36821. */
  36822. function sum(array) {
  36823. return (array && array.length)
  36824. ? baseSum(array, identity)
  36825. : 0;
  36826. }
  36827. /**
  36828. * This method is like `_.sum` except that it accepts `iteratee` which is
  36829. * invoked for each element in `array` to generate the value to be summed.
  36830. * The iteratee is invoked with one argument: (value).
  36831. *
  36832. * @static
  36833. * @memberOf _
  36834. * @since 4.0.0
  36835. * @category Math
  36836. * @param {Array} array The array to iterate over.
  36837. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  36838. * @returns {number} Returns the sum.
  36839. * @example
  36840. *
  36841. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  36842. *
  36843. * _.sumBy(objects, function(o) { return o.n; });
  36844. * // => 20
  36845. *
  36846. * // The `_.property` iteratee shorthand.
  36847. * _.sumBy(objects, 'n');
  36848. * // => 20
  36849. */
  36850. function sumBy(array, iteratee) {
  36851. return (array && array.length)
  36852. ? baseSum(array, getIteratee(iteratee, 2))
  36853. : 0;
  36854. }
  36855. /*------------------------------------------------------------------------*/
  36856. // Add methods that return wrapped values in chain sequences.
  36857. lodash.after = after;
  36858. lodash.ary = ary;
  36859. lodash.assign = assign;
  36860. lodash.assignIn = assignIn;
  36861. lodash.assignInWith = assignInWith;
  36862. lodash.assignWith = assignWith;
  36863. lodash.at = at;
  36864. lodash.before = before;
  36865. lodash.bind = bind;
  36866. lodash.bindAll = bindAll;
  36867. lodash.bindKey = bindKey;
  36868. lodash.castArray = castArray;
  36869. lodash.chain = chain;
  36870. lodash.chunk = chunk;
  36871. lodash.compact = compact;
  36872. lodash.concat = concat;
  36873. lodash.cond = cond;
  36874. lodash.conforms = conforms;
  36875. lodash.constant = constant;
  36876. lodash.countBy = countBy;
  36877. lodash.create = create;
  36878. lodash.curry = curry;
  36879. lodash.curryRight = curryRight;
  36880. lodash.debounce = debounce;
  36881. lodash.defaults = defaults;
  36882. lodash.defaultsDeep = defaultsDeep;
  36883. lodash.defer = defer;
  36884. lodash.delay = delay;
  36885. lodash.difference = difference;
  36886. lodash.differenceBy = differenceBy;
  36887. lodash.differenceWith = differenceWith;
  36888. lodash.drop = drop;
  36889. lodash.dropRight = dropRight;
  36890. lodash.dropRightWhile = dropRightWhile;
  36891. lodash.dropWhile = dropWhile;
  36892. lodash.fill = fill;
  36893. lodash.filter = filter;
  36894. lodash.flatMap = flatMap;
  36895. lodash.flatMapDeep = flatMapDeep;
  36896. lodash.flatMapDepth = flatMapDepth;
  36897. lodash.flatten = flatten;
  36898. lodash.flattenDeep = flattenDeep;
  36899. lodash.flattenDepth = flattenDepth;
  36900. lodash.flip = flip;
  36901. lodash.flow = flow;
  36902. lodash.flowRight = flowRight;
  36903. lodash.fromPairs = fromPairs;
  36904. lodash.functions = functions;
  36905. lodash.functionsIn = functionsIn;
  36906. lodash.groupBy = groupBy;
  36907. lodash.initial = initial;
  36908. lodash.intersection = intersection;
  36909. lodash.intersectionBy = intersectionBy;
  36910. lodash.intersectionWith = intersectionWith;
  36911. lodash.invert = invert;
  36912. lodash.invertBy = invertBy;
  36913. lodash.invokeMap = invokeMap;
  36914. lodash.iteratee = iteratee;
  36915. lodash.keyBy = keyBy;
  36916. lodash.keys = keys;
  36917. lodash.keysIn = keysIn;
  36918. lodash.map = map;
  36919. lodash.mapKeys = mapKeys;
  36920. lodash.mapValues = mapValues;
  36921. lodash.matches = matches;
  36922. lodash.matchesProperty = matchesProperty;
  36923. lodash.memoize = memoize;
  36924. lodash.merge = merge;
  36925. lodash.mergeWith = mergeWith;
  36926. lodash.method = method;
  36927. lodash.methodOf = methodOf;
  36928. lodash.mixin = mixin;
  36929. lodash.negate = negate;
  36930. lodash.nthArg = nthArg;
  36931. lodash.omit = omit;
  36932. lodash.omitBy = omitBy;
  36933. lodash.once = once;
  36934. lodash.orderBy = orderBy;
  36935. lodash.over = over;
  36936. lodash.overArgs = overArgs;
  36937. lodash.overEvery = overEvery;
  36938. lodash.overSome = overSome;
  36939. lodash.partial = partial;
  36940. lodash.partialRight = partialRight;
  36941. lodash.partition = partition;
  36942. lodash.pick = pick;
  36943. lodash.pickBy = pickBy;
  36944. lodash.property = property;
  36945. lodash.propertyOf = propertyOf;
  36946. lodash.pull = pull;
  36947. lodash.pullAll = pullAll;
  36948. lodash.pullAllBy = pullAllBy;
  36949. lodash.pullAllWith = pullAllWith;
  36950. lodash.pullAt = pullAt;
  36951. lodash.range = range;
  36952. lodash.rangeRight = rangeRight;
  36953. lodash.rearg = rearg;
  36954. lodash.reject = reject;
  36955. lodash.remove = remove;
  36956. lodash.rest = rest;
  36957. lodash.reverse = reverse;
  36958. lodash.sampleSize = sampleSize;
  36959. lodash.set = set;
  36960. lodash.setWith = setWith;
  36961. lodash.shuffle = shuffle;
  36962. lodash.slice = slice;
  36963. lodash.sortBy = sortBy;
  36964. lodash.sortedUniq = sortedUniq;
  36965. lodash.sortedUniqBy = sortedUniqBy;
  36966. lodash.split = split;
  36967. lodash.spread = spread;
  36968. lodash.tail = tail;
  36969. lodash.take = take;
  36970. lodash.takeRight = takeRight;
  36971. lodash.takeRightWhile = takeRightWhile;
  36972. lodash.takeWhile = takeWhile;
  36973. lodash.tap = tap;
  36974. lodash.throttle = throttle;
  36975. lodash.thru = thru;
  36976. lodash.toArray = toArray;
  36977. lodash.toPairs = toPairs;
  36978. lodash.toPairsIn = toPairsIn;
  36979. lodash.toPath = toPath;
  36980. lodash.toPlainObject = toPlainObject;
  36981. lodash.transform = transform;
  36982. lodash.unary = unary;
  36983. lodash.union = union;
  36984. lodash.unionBy = unionBy;
  36985. lodash.unionWith = unionWith;
  36986. lodash.uniq = uniq;
  36987. lodash.uniqBy = uniqBy;
  36988. lodash.uniqWith = uniqWith;
  36989. lodash.unset = unset;
  36990. lodash.unzip = unzip;
  36991. lodash.unzipWith = unzipWith;
  36992. lodash.update = update;
  36993. lodash.updateWith = updateWith;
  36994. lodash.values = values;
  36995. lodash.valuesIn = valuesIn;
  36996. lodash.without = without;
  36997. lodash.words = words;
  36998. lodash.wrap = wrap;
  36999. lodash.xor = xor;
  37000. lodash.xorBy = xorBy;
  37001. lodash.xorWith = xorWith;
  37002. lodash.zip = zip;
  37003. lodash.zipObject = zipObject;
  37004. lodash.zipObjectDeep = zipObjectDeep;
  37005. lodash.zipWith = zipWith;
  37006. // Add aliases.
  37007. lodash.entries = toPairs;
  37008. lodash.entriesIn = toPairsIn;
  37009. lodash.extend = assignIn;
  37010. lodash.extendWith = assignInWith;
  37011. // Add methods to `lodash.prototype`.
  37012. mixin(lodash, lodash);
  37013. /*------------------------------------------------------------------------*/
  37014. // Add methods that return unwrapped values in chain sequences.
  37015. lodash.add = add;
  37016. lodash.attempt = attempt;
  37017. lodash.camelCase = camelCase;
  37018. lodash.capitalize = capitalize;
  37019. lodash.ceil = ceil;
  37020. lodash.clamp = clamp;
  37021. lodash.clone = clone;
  37022. lodash.cloneDeep = cloneDeep;
  37023. lodash.cloneDeepWith = cloneDeepWith;
  37024. lodash.cloneWith = cloneWith;
  37025. lodash.conformsTo = conformsTo;
  37026. lodash.deburr = deburr;
  37027. lodash.defaultTo = defaultTo;
  37028. lodash.divide = divide;
  37029. lodash.endsWith = endsWith;
  37030. lodash.eq = eq;
  37031. lodash.escape = escape;
  37032. lodash.escapeRegExp = escapeRegExp;
  37033. lodash.every = every;
  37034. lodash.find = find;
  37035. lodash.findIndex = findIndex;
  37036. lodash.findKey = findKey;
  37037. lodash.findLast = findLast;
  37038. lodash.findLastIndex = findLastIndex;
  37039. lodash.findLastKey = findLastKey;
  37040. lodash.floor = floor;
  37041. lodash.forEach = forEach;
  37042. lodash.forEachRight = forEachRight;
  37043. lodash.forIn = forIn;
  37044. lodash.forInRight = forInRight;
  37045. lodash.forOwn = forOwn;
  37046. lodash.forOwnRight = forOwnRight;
  37047. lodash.get = get;
  37048. lodash.gt = gt;
  37049. lodash.gte = gte;
  37050. lodash.has = has;
  37051. lodash.hasIn = hasIn;
  37052. lodash.head = head;
  37053. lodash.identity = identity;
  37054. lodash.includes = includes;
  37055. lodash.indexOf = indexOf;
  37056. lodash.inRange = inRange;
  37057. lodash.invoke = invoke;
  37058. lodash.isArguments = isArguments;
  37059. lodash.isArray = isArray;
  37060. lodash.isArrayBuffer = isArrayBuffer;
  37061. lodash.isArrayLike = isArrayLike;
  37062. lodash.isArrayLikeObject = isArrayLikeObject;
  37063. lodash.isBoolean = isBoolean;
  37064. lodash.isBuffer = isBuffer;
  37065. lodash.isDate = isDate;
  37066. lodash.isElement = isElement;
  37067. lodash.isEmpty = isEmpty;
  37068. lodash.isEqual = isEqual;
  37069. lodash.isEqualWith = isEqualWith;
  37070. lodash.isError = isError;
  37071. lodash.isFinite = isFinite;
  37072. lodash.isFunction = isFunction;
  37073. lodash.isInteger = isInteger;
  37074. lodash.isLength = isLength;
  37075. lodash.isMap = isMap;
  37076. lodash.isMatch = isMatch;
  37077. lodash.isMatchWith = isMatchWith;
  37078. lodash.isNaN = isNaN;
  37079. lodash.isNative = isNative;
  37080. lodash.isNil = isNil;
  37081. lodash.isNull = isNull;
  37082. lodash.isNumber = isNumber;
  37083. lodash.isObject = isObject;
  37084. lodash.isObjectLike = isObjectLike;
  37085. lodash.isPlainObject = isPlainObject;
  37086. lodash.isRegExp = isRegExp;
  37087. lodash.isSafeInteger = isSafeInteger;
  37088. lodash.isSet = isSet;
  37089. lodash.isString = isString;
  37090. lodash.isSymbol = isSymbol;
  37091. lodash.isTypedArray = isTypedArray;
  37092. lodash.isUndefined = isUndefined;
  37093. lodash.isWeakMap = isWeakMap;
  37094. lodash.isWeakSet = isWeakSet;
  37095. lodash.join = join;
  37096. lodash.kebabCase = kebabCase;
  37097. lodash.last = last;
  37098. lodash.lastIndexOf = lastIndexOf;
  37099. lodash.lowerCase = lowerCase;
  37100. lodash.lowerFirst = lowerFirst;
  37101. lodash.lt = lt;
  37102. lodash.lte = lte;
  37103. lodash.max = max;
  37104. lodash.maxBy = maxBy;
  37105. lodash.mean = mean;
  37106. lodash.meanBy = meanBy;
  37107. lodash.min = min;
  37108. lodash.minBy = minBy;
  37109. lodash.stubArray = stubArray;
  37110. lodash.stubFalse = stubFalse;
  37111. lodash.stubObject = stubObject;
  37112. lodash.stubString = stubString;
  37113. lodash.stubTrue = stubTrue;
  37114. lodash.multiply = multiply;
  37115. lodash.nth = nth;
  37116. lodash.noConflict = noConflict;
  37117. lodash.noop = noop;
  37118. lodash.now = now;
  37119. lodash.pad = pad;
  37120. lodash.padEnd = padEnd;
  37121. lodash.padStart = padStart;
  37122. lodash.parseInt = parseInt;
  37123. lodash.random = random;
  37124. lodash.reduce = reduce;
  37125. lodash.reduceRight = reduceRight;
  37126. lodash.repeat = repeat;
  37127. lodash.replace = replace;
  37128. lodash.result = result;
  37129. lodash.round = round;
  37130. lodash.runInContext = runInContext;
  37131. lodash.sample = sample;
  37132. lodash.size = size;
  37133. lodash.snakeCase = snakeCase;
  37134. lodash.some = some;
  37135. lodash.sortedIndex = sortedIndex;
  37136. lodash.sortedIndexBy = sortedIndexBy;
  37137. lodash.sortedIndexOf = sortedIndexOf;
  37138. lodash.sortedLastIndex = sortedLastIndex;
  37139. lodash.sortedLastIndexBy = sortedLastIndexBy;
  37140. lodash.sortedLastIndexOf = sortedLastIndexOf;
  37141. lodash.startCase = startCase;
  37142. lodash.startsWith = startsWith;
  37143. lodash.subtract = subtract;
  37144. lodash.sum = sum;
  37145. lodash.sumBy = sumBy;
  37146. lodash.template = template;
  37147. lodash.times = times;
  37148. lodash.toFinite = toFinite;
  37149. lodash.toInteger = toInteger;
  37150. lodash.toLength = toLength;
  37151. lodash.toLower = toLower;
  37152. lodash.toNumber = toNumber;
  37153. lodash.toSafeInteger = toSafeInteger;
  37154. lodash.toString = toString;
  37155. lodash.toUpper = toUpper;
  37156. lodash.trim = trim;
  37157. lodash.trimEnd = trimEnd;
  37158. lodash.trimStart = trimStart;
  37159. lodash.truncate = truncate;
  37160. lodash.unescape = unescape;
  37161. lodash.uniqueId = uniqueId;
  37162. lodash.upperCase = upperCase;
  37163. lodash.upperFirst = upperFirst;
  37164. // Add aliases.
  37165. lodash.each = forEach;
  37166. lodash.eachRight = forEachRight;
  37167. lodash.first = head;
  37168. mixin(lodash, (function() {
  37169. var source = {};
  37170. baseForOwn(lodash, function(func, methodName) {
  37171. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  37172. source[methodName] = func;
  37173. }
  37174. });
  37175. return source;
  37176. }()), { 'chain': false });
  37177. /*------------------------------------------------------------------------*/
  37178. /**
  37179. * The semantic version number.
  37180. *
  37181. * @static
  37182. * @memberOf _
  37183. * @type {string}
  37184. */
  37185. lodash.VERSION = VERSION;
  37186. // Assign default placeholders.
  37187. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  37188. lodash[methodName].placeholder = lodash;
  37189. });
  37190. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  37191. arrayEach(['drop', 'take'], function(methodName, index) {
  37192. LazyWrapper.prototype[methodName] = function(n) {
  37193. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  37194. var result = (this.__filtered__ && !index)
  37195. ? new LazyWrapper(this)
  37196. : this.clone();
  37197. if (result.__filtered__) {
  37198. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  37199. } else {
  37200. result.__views__.push({
  37201. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  37202. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  37203. });
  37204. }
  37205. return result;
  37206. };
  37207. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  37208. return this.reverse()[methodName](n).reverse();
  37209. };
  37210. });
  37211. // Add `LazyWrapper` methods that accept an `iteratee` value.
  37212. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  37213. var type = index + 1,
  37214. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  37215. LazyWrapper.prototype[methodName] = function(iteratee) {
  37216. var result = this.clone();
  37217. result.__iteratees__.push({
  37218. 'iteratee': getIteratee(iteratee, 3),
  37219. 'type': type
  37220. });
  37221. result.__filtered__ = result.__filtered__ || isFilter;
  37222. return result;
  37223. };
  37224. });
  37225. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  37226. arrayEach(['head', 'last'], function(methodName, index) {
  37227. var takeName = 'take' + (index ? 'Right' : '');
  37228. LazyWrapper.prototype[methodName] = function() {
  37229. return this[takeName](1).value()[0];
  37230. };
  37231. });
  37232. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  37233. arrayEach(['initial', 'tail'], function(methodName, index) {
  37234. var dropName = 'drop' + (index ? '' : 'Right');
  37235. LazyWrapper.prototype[methodName] = function() {
  37236. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  37237. };
  37238. });
  37239. LazyWrapper.prototype.compact = function() {
  37240. return this.filter(identity);
  37241. };
  37242. LazyWrapper.prototype.find = function(predicate) {
  37243. return this.filter(predicate).head();
  37244. };
  37245. LazyWrapper.prototype.findLast = function(predicate) {
  37246. return this.reverse().find(predicate);
  37247. };
  37248. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  37249. if (typeof path == 'function') {
  37250. return new LazyWrapper(this);
  37251. }
  37252. return this.map(function(value) {
  37253. return baseInvoke(value, path, args);
  37254. });
  37255. });
  37256. LazyWrapper.prototype.reject = function(predicate) {
  37257. return this.filter(negate(getIteratee(predicate)));
  37258. };
  37259. LazyWrapper.prototype.slice = function(start, end) {
  37260. start = toInteger(start);
  37261. var result = this;
  37262. if (result.__filtered__ && (start > 0 || end < 0)) {
  37263. return new LazyWrapper(result);
  37264. }
  37265. if (start < 0) {
  37266. result = result.takeRight(-start);
  37267. } else if (start) {
  37268. result = result.drop(start);
  37269. }
  37270. if (end !== undefined) {
  37271. end = toInteger(end);
  37272. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  37273. }
  37274. return result;
  37275. };
  37276. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  37277. return this.reverse().takeWhile(predicate).reverse();
  37278. };
  37279. LazyWrapper.prototype.toArray = function() {
  37280. return this.take(MAX_ARRAY_LENGTH);
  37281. };
  37282. // Add `LazyWrapper` methods to `lodash.prototype`.
  37283. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  37284. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  37285. isTaker = /^(?:head|last)$/.test(methodName),
  37286. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  37287. retUnwrapped = isTaker || /^find/.test(methodName);
  37288. if (!lodashFunc) {
  37289. return;
  37290. }
  37291. lodash.prototype[methodName] = function() {
  37292. var value = this.__wrapped__,
  37293. args = isTaker ? [1] : arguments,
  37294. isLazy = value instanceof LazyWrapper,
  37295. iteratee = args[0],
  37296. useLazy = isLazy || isArray(value);
  37297. var interceptor = function(value) {
  37298. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  37299. return (isTaker && chainAll) ? result[0] : result;
  37300. };
  37301. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  37302. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  37303. isLazy = useLazy = false;
  37304. }
  37305. var chainAll = this.__chain__,
  37306. isHybrid = !!this.__actions__.length,
  37307. isUnwrapped = retUnwrapped && !chainAll,
  37308. onlyLazy = isLazy && !isHybrid;
  37309. if (!retUnwrapped && useLazy) {
  37310. value = onlyLazy ? value : new LazyWrapper(this);
  37311. var result = func.apply(value, args);
  37312. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  37313. return new LodashWrapper(result, chainAll);
  37314. }
  37315. if (isUnwrapped && onlyLazy) {
  37316. return func.apply(this, args);
  37317. }
  37318. result = this.thru(interceptor);
  37319. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  37320. };
  37321. });
  37322. // Add `Array` methods to `lodash.prototype`.
  37323. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  37324. var func = arrayProto[methodName],
  37325. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  37326. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  37327. lodash.prototype[methodName] = function() {
  37328. var args = arguments;
  37329. if (retUnwrapped && !this.__chain__) {
  37330. var value = this.value();
  37331. return func.apply(isArray(value) ? value : [], args);
  37332. }
  37333. return this[chainName](function(value) {
  37334. return func.apply(isArray(value) ? value : [], args);
  37335. });
  37336. };
  37337. });
  37338. // Map minified method names to their real names.
  37339. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  37340. var lodashFunc = lodash[methodName];
  37341. if (lodashFunc) {
  37342. var key = lodashFunc.name + '';
  37343. if (!hasOwnProperty.call(realNames, key)) {
  37344. realNames[key] = [];
  37345. }
  37346. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  37347. }
  37348. });
  37349. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  37350. 'name': 'wrapper',
  37351. 'func': undefined
  37352. }];
  37353. // Add methods to `LazyWrapper`.
  37354. LazyWrapper.prototype.clone = lazyClone;
  37355. LazyWrapper.prototype.reverse = lazyReverse;
  37356. LazyWrapper.prototype.value = lazyValue;
  37357. // Add chain sequence methods to the `lodash` wrapper.
  37358. lodash.prototype.at = wrapperAt;
  37359. lodash.prototype.chain = wrapperChain;
  37360. lodash.prototype.commit = wrapperCommit;
  37361. lodash.prototype.next = wrapperNext;
  37362. lodash.prototype.plant = wrapperPlant;
  37363. lodash.prototype.reverse = wrapperReverse;
  37364. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  37365. // Add lazy aliases.
  37366. lodash.prototype.first = lodash.prototype.head;
  37367. if (symIterator) {
  37368. lodash.prototype[symIterator] = wrapperToIterator;
  37369. }
  37370. return lodash;
  37371. });
  37372. /*--------------------------------------------------------------------------*/
  37373. // Export lodash.
  37374. var _ = runInContext();
  37375. // Some AMD build optimizers, like r.js, check for condition patterns like:
  37376. if (true) {
  37377. // Expose Lodash on the global object to prevent errors when Lodash is
  37378. // loaded by a script tag in the presence of an AMD loader.
  37379. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  37380. // Use `_.noConflict` to remove Lodash from the global object.
  37381. root._ = _;
  37382. // Define as an anonymous module so, through path mapping, it can be
  37383. // referenced as the "underscore" module.
  37384. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  37385. return _;
  37386. }).call(exports, __webpack_require__, exports, module),
  37387. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  37388. }
  37389. // Check for `exports` after `define` in case a build optimizer adds it.
  37390. else {}
  37391. }.call(this));
  37392. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
  37393. /***/ }),
  37394. /***/ "./node_modules/moment/locale sync recursive ^\\.\\/.*$":
  37395. /*!**************************************************!*\
  37396. !*** ./node_modules/moment/locale sync ^\.\/.*$ ***!
  37397. \**************************************************/
  37398. /*! no static exports found */
  37399. /***/ (function(module, exports, __webpack_require__) {
  37400. var map = {
  37401. "./af": "./node_modules/moment/locale/af.js",
  37402. "./af.js": "./node_modules/moment/locale/af.js",
  37403. "./ar": "./node_modules/moment/locale/ar.js",
  37404. "./ar-dz": "./node_modules/moment/locale/ar-dz.js",
  37405. "./ar-dz.js": "./node_modules/moment/locale/ar-dz.js",
  37406. "./ar-kw": "./node_modules/moment/locale/ar-kw.js",
  37407. "./ar-kw.js": "./node_modules/moment/locale/ar-kw.js",
  37408. "./ar-ly": "./node_modules/moment/locale/ar-ly.js",
  37409. "./ar-ly.js": "./node_modules/moment/locale/ar-ly.js",
  37410. "./ar-ma": "./node_modules/moment/locale/ar-ma.js",
  37411. "./ar-ma.js": "./node_modules/moment/locale/ar-ma.js",
  37412. "./ar-sa": "./node_modules/moment/locale/ar-sa.js",
  37413. "./ar-sa.js": "./node_modules/moment/locale/ar-sa.js",
  37414. "./ar-tn": "./node_modules/moment/locale/ar-tn.js",
  37415. "./ar-tn.js": "./node_modules/moment/locale/ar-tn.js",
  37416. "./ar.js": "./node_modules/moment/locale/ar.js",
  37417. "./az": "./node_modules/moment/locale/az.js",
  37418. "./az.js": "./node_modules/moment/locale/az.js",
  37419. "./be": "./node_modules/moment/locale/be.js",
  37420. "./be.js": "./node_modules/moment/locale/be.js",
  37421. "./bg": "./node_modules/moment/locale/bg.js",
  37422. "./bg.js": "./node_modules/moment/locale/bg.js",
  37423. "./bm": "./node_modules/moment/locale/bm.js",
  37424. "./bm.js": "./node_modules/moment/locale/bm.js",
  37425. "./bn": "./node_modules/moment/locale/bn.js",
  37426. "./bn.js": "./node_modules/moment/locale/bn.js",
  37427. "./bo": "./node_modules/moment/locale/bo.js",
  37428. "./bo.js": "./node_modules/moment/locale/bo.js",
  37429. "./br": "./node_modules/moment/locale/br.js",
  37430. "./br.js": "./node_modules/moment/locale/br.js",
  37431. "./bs": "./node_modules/moment/locale/bs.js",
  37432. "./bs.js": "./node_modules/moment/locale/bs.js",
  37433. "./ca": "./node_modules/moment/locale/ca.js",
  37434. "./ca.js": "./node_modules/moment/locale/ca.js",
  37435. "./cs": "./node_modules/moment/locale/cs.js",
  37436. "./cs.js": "./node_modules/moment/locale/cs.js",
  37437. "./cv": "./node_modules/moment/locale/cv.js",
  37438. "./cv.js": "./node_modules/moment/locale/cv.js",
  37439. "./cy": "./node_modules/moment/locale/cy.js",
  37440. "./cy.js": "./node_modules/moment/locale/cy.js",
  37441. "./da": "./node_modules/moment/locale/da.js",
  37442. "./da.js": "./node_modules/moment/locale/da.js",
  37443. "./de": "./node_modules/moment/locale/de.js",
  37444. "./de-at": "./node_modules/moment/locale/de-at.js",
  37445. "./de-at.js": "./node_modules/moment/locale/de-at.js",
  37446. "./de-ch": "./node_modules/moment/locale/de-ch.js",
  37447. "./de-ch.js": "./node_modules/moment/locale/de-ch.js",
  37448. "./de.js": "./node_modules/moment/locale/de.js",
  37449. "./dv": "./node_modules/moment/locale/dv.js",
  37450. "./dv.js": "./node_modules/moment/locale/dv.js",
  37451. "./el": "./node_modules/moment/locale/el.js",
  37452. "./el.js": "./node_modules/moment/locale/el.js",
  37453. "./en-au": "./node_modules/moment/locale/en-au.js",
  37454. "./en-au.js": "./node_modules/moment/locale/en-au.js",
  37455. "./en-ca": "./node_modules/moment/locale/en-ca.js",
  37456. "./en-ca.js": "./node_modules/moment/locale/en-ca.js",
  37457. "./en-gb": "./node_modules/moment/locale/en-gb.js",
  37458. "./en-gb.js": "./node_modules/moment/locale/en-gb.js",
  37459. "./en-ie": "./node_modules/moment/locale/en-ie.js",
  37460. "./en-ie.js": "./node_modules/moment/locale/en-ie.js",
  37461. "./en-il": "./node_modules/moment/locale/en-il.js",
  37462. "./en-il.js": "./node_modules/moment/locale/en-il.js",
  37463. "./en-in": "./node_modules/moment/locale/en-in.js",
  37464. "./en-in.js": "./node_modules/moment/locale/en-in.js",
  37465. "./en-nz": "./node_modules/moment/locale/en-nz.js",
  37466. "./en-nz.js": "./node_modules/moment/locale/en-nz.js",
  37467. "./en-sg": "./node_modules/moment/locale/en-sg.js",
  37468. "./en-sg.js": "./node_modules/moment/locale/en-sg.js",
  37469. "./eo": "./node_modules/moment/locale/eo.js",
  37470. "./eo.js": "./node_modules/moment/locale/eo.js",
  37471. "./es": "./node_modules/moment/locale/es.js",
  37472. "./es-do": "./node_modules/moment/locale/es-do.js",
  37473. "./es-do.js": "./node_modules/moment/locale/es-do.js",
  37474. "./es-us": "./node_modules/moment/locale/es-us.js",
  37475. "./es-us.js": "./node_modules/moment/locale/es-us.js",
  37476. "./es.js": "./node_modules/moment/locale/es.js",
  37477. "./et": "./node_modules/moment/locale/et.js",
  37478. "./et.js": "./node_modules/moment/locale/et.js",
  37479. "./eu": "./node_modules/moment/locale/eu.js",
  37480. "./eu.js": "./node_modules/moment/locale/eu.js",
  37481. "./fa": "./node_modules/moment/locale/fa.js",
  37482. "./fa.js": "./node_modules/moment/locale/fa.js",
  37483. "./fi": "./node_modules/moment/locale/fi.js",
  37484. "./fi.js": "./node_modules/moment/locale/fi.js",
  37485. "./fil": "./node_modules/moment/locale/fil.js",
  37486. "./fil.js": "./node_modules/moment/locale/fil.js",
  37487. "./fo": "./node_modules/moment/locale/fo.js",
  37488. "./fo.js": "./node_modules/moment/locale/fo.js",
  37489. "./fr": "./node_modules/moment/locale/fr.js",
  37490. "./fr-ca": "./node_modules/moment/locale/fr-ca.js",
  37491. "./fr-ca.js": "./node_modules/moment/locale/fr-ca.js",
  37492. "./fr-ch": "./node_modules/moment/locale/fr-ch.js",
  37493. "./fr-ch.js": "./node_modules/moment/locale/fr-ch.js",
  37494. "./fr.js": "./node_modules/moment/locale/fr.js",
  37495. "./fy": "./node_modules/moment/locale/fy.js",
  37496. "./fy.js": "./node_modules/moment/locale/fy.js",
  37497. "./ga": "./node_modules/moment/locale/ga.js",
  37498. "./ga.js": "./node_modules/moment/locale/ga.js",
  37499. "./gd": "./node_modules/moment/locale/gd.js",
  37500. "./gd.js": "./node_modules/moment/locale/gd.js",
  37501. "./gl": "./node_modules/moment/locale/gl.js",
  37502. "./gl.js": "./node_modules/moment/locale/gl.js",
  37503. "./gom-deva": "./node_modules/moment/locale/gom-deva.js",
  37504. "./gom-deva.js": "./node_modules/moment/locale/gom-deva.js",
  37505. "./gom-latn": "./node_modules/moment/locale/gom-latn.js",
  37506. "./gom-latn.js": "./node_modules/moment/locale/gom-latn.js",
  37507. "./gu": "./node_modules/moment/locale/gu.js",
  37508. "./gu.js": "./node_modules/moment/locale/gu.js",
  37509. "./he": "./node_modules/moment/locale/he.js",
  37510. "./he.js": "./node_modules/moment/locale/he.js",
  37511. "./hi": "./node_modules/moment/locale/hi.js",
  37512. "./hi.js": "./node_modules/moment/locale/hi.js",
  37513. "./hr": "./node_modules/moment/locale/hr.js",
  37514. "./hr.js": "./node_modules/moment/locale/hr.js",
  37515. "./hu": "./node_modules/moment/locale/hu.js",
  37516. "./hu.js": "./node_modules/moment/locale/hu.js",
  37517. "./hy-am": "./node_modules/moment/locale/hy-am.js",
  37518. "./hy-am.js": "./node_modules/moment/locale/hy-am.js",
  37519. "./id": "./node_modules/moment/locale/id.js",
  37520. "./id.js": "./node_modules/moment/locale/id.js",
  37521. "./is": "./node_modules/moment/locale/is.js",
  37522. "./is.js": "./node_modules/moment/locale/is.js",
  37523. "./it": "./node_modules/moment/locale/it.js",
  37524. "./it-ch": "./node_modules/moment/locale/it-ch.js",
  37525. "./it-ch.js": "./node_modules/moment/locale/it-ch.js",
  37526. "./it.js": "./node_modules/moment/locale/it.js",
  37527. "./ja": "./node_modules/moment/locale/ja.js",
  37528. "./ja.js": "./node_modules/moment/locale/ja.js",
  37529. "./jv": "./node_modules/moment/locale/jv.js",
  37530. "./jv.js": "./node_modules/moment/locale/jv.js",
  37531. "./ka": "./node_modules/moment/locale/ka.js",
  37532. "./ka.js": "./node_modules/moment/locale/ka.js",
  37533. "./kk": "./node_modules/moment/locale/kk.js",
  37534. "./kk.js": "./node_modules/moment/locale/kk.js",
  37535. "./km": "./node_modules/moment/locale/km.js",
  37536. "./km.js": "./node_modules/moment/locale/km.js",
  37537. "./kn": "./node_modules/moment/locale/kn.js",
  37538. "./kn.js": "./node_modules/moment/locale/kn.js",
  37539. "./ko": "./node_modules/moment/locale/ko.js",
  37540. "./ko.js": "./node_modules/moment/locale/ko.js",
  37541. "./ku": "./node_modules/moment/locale/ku.js",
  37542. "./ku.js": "./node_modules/moment/locale/ku.js",
  37543. "./ky": "./node_modules/moment/locale/ky.js",
  37544. "./ky.js": "./node_modules/moment/locale/ky.js",
  37545. "./lb": "./node_modules/moment/locale/lb.js",
  37546. "./lb.js": "./node_modules/moment/locale/lb.js",
  37547. "./lo": "./node_modules/moment/locale/lo.js",
  37548. "./lo.js": "./node_modules/moment/locale/lo.js",
  37549. "./lt": "./node_modules/moment/locale/lt.js",
  37550. "./lt.js": "./node_modules/moment/locale/lt.js",
  37551. "./lv": "./node_modules/moment/locale/lv.js",
  37552. "./lv.js": "./node_modules/moment/locale/lv.js",
  37553. "./me": "./node_modules/moment/locale/me.js",
  37554. "./me.js": "./node_modules/moment/locale/me.js",
  37555. "./mi": "./node_modules/moment/locale/mi.js",
  37556. "./mi.js": "./node_modules/moment/locale/mi.js",
  37557. "./mk": "./node_modules/moment/locale/mk.js",
  37558. "./mk.js": "./node_modules/moment/locale/mk.js",
  37559. "./ml": "./node_modules/moment/locale/ml.js",
  37560. "./ml.js": "./node_modules/moment/locale/ml.js",
  37561. "./mn": "./node_modules/moment/locale/mn.js",
  37562. "./mn.js": "./node_modules/moment/locale/mn.js",
  37563. "./mr": "./node_modules/moment/locale/mr.js",
  37564. "./mr.js": "./node_modules/moment/locale/mr.js",
  37565. "./ms": "./node_modules/moment/locale/ms.js",
  37566. "./ms-my": "./node_modules/moment/locale/ms-my.js",
  37567. "./ms-my.js": "./node_modules/moment/locale/ms-my.js",
  37568. "./ms.js": "./node_modules/moment/locale/ms.js",
  37569. "./mt": "./node_modules/moment/locale/mt.js",
  37570. "./mt.js": "./node_modules/moment/locale/mt.js",
  37571. "./my": "./node_modules/moment/locale/my.js",
  37572. "./my.js": "./node_modules/moment/locale/my.js",
  37573. "./nb": "./node_modules/moment/locale/nb.js",
  37574. "./nb.js": "./node_modules/moment/locale/nb.js",
  37575. "./ne": "./node_modules/moment/locale/ne.js",
  37576. "./ne.js": "./node_modules/moment/locale/ne.js",
  37577. "./nl": "./node_modules/moment/locale/nl.js",
  37578. "./nl-be": "./node_modules/moment/locale/nl-be.js",
  37579. "./nl-be.js": "./node_modules/moment/locale/nl-be.js",
  37580. "./nl.js": "./node_modules/moment/locale/nl.js",
  37581. "./nn": "./node_modules/moment/locale/nn.js",
  37582. "./nn.js": "./node_modules/moment/locale/nn.js",
  37583. "./oc-lnc": "./node_modules/moment/locale/oc-lnc.js",
  37584. "./oc-lnc.js": "./node_modules/moment/locale/oc-lnc.js",
  37585. "./pa-in": "./node_modules/moment/locale/pa-in.js",
  37586. "./pa-in.js": "./node_modules/moment/locale/pa-in.js",
  37587. "./pl": "./node_modules/moment/locale/pl.js",
  37588. "./pl.js": "./node_modules/moment/locale/pl.js",
  37589. "./pt": "./node_modules/moment/locale/pt.js",
  37590. "./pt-br": "./node_modules/moment/locale/pt-br.js",
  37591. "./pt-br.js": "./node_modules/moment/locale/pt-br.js",
  37592. "./pt.js": "./node_modules/moment/locale/pt.js",
  37593. "./ro": "./node_modules/moment/locale/ro.js",
  37594. "./ro.js": "./node_modules/moment/locale/ro.js",
  37595. "./ru": "./node_modules/moment/locale/ru.js",
  37596. "./ru.js": "./node_modules/moment/locale/ru.js",
  37597. "./sd": "./node_modules/moment/locale/sd.js",
  37598. "./sd.js": "./node_modules/moment/locale/sd.js",
  37599. "./se": "./node_modules/moment/locale/se.js",
  37600. "./se.js": "./node_modules/moment/locale/se.js",
  37601. "./si": "./node_modules/moment/locale/si.js",
  37602. "./si.js": "./node_modules/moment/locale/si.js",
  37603. "./sk": "./node_modules/moment/locale/sk.js",
  37604. "./sk.js": "./node_modules/moment/locale/sk.js",
  37605. "./sl": "./node_modules/moment/locale/sl.js",
  37606. "./sl.js": "./node_modules/moment/locale/sl.js",
  37607. "./sq": "./node_modules/moment/locale/sq.js",
  37608. "./sq.js": "./node_modules/moment/locale/sq.js",
  37609. "./sr": "./node_modules/moment/locale/sr.js",
  37610. "./sr-cyrl": "./node_modules/moment/locale/sr-cyrl.js",
  37611. "./sr-cyrl.js": "./node_modules/moment/locale/sr-cyrl.js",
  37612. "./sr.js": "./node_modules/moment/locale/sr.js",
  37613. "./ss": "./node_modules/moment/locale/ss.js",
  37614. "./ss.js": "./node_modules/moment/locale/ss.js",
  37615. "./sv": "./node_modules/moment/locale/sv.js",
  37616. "./sv.js": "./node_modules/moment/locale/sv.js",
  37617. "./sw": "./node_modules/moment/locale/sw.js",
  37618. "./sw.js": "./node_modules/moment/locale/sw.js",
  37619. "./ta": "./node_modules/moment/locale/ta.js",
  37620. "./ta.js": "./node_modules/moment/locale/ta.js",
  37621. "./te": "./node_modules/moment/locale/te.js",
  37622. "./te.js": "./node_modules/moment/locale/te.js",
  37623. "./tet": "./node_modules/moment/locale/tet.js",
  37624. "./tet.js": "./node_modules/moment/locale/tet.js",
  37625. "./tg": "./node_modules/moment/locale/tg.js",
  37626. "./tg.js": "./node_modules/moment/locale/tg.js",
  37627. "./th": "./node_modules/moment/locale/th.js",
  37628. "./th.js": "./node_modules/moment/locale/th.js",
  37629. "./tk": "./node_modules/moment/locale/tk.js",
  37630. "./tk.js": "./node_modules/moment/locale/tk.js",
  37631. "./tl-ph": "./node_modules/moment/locale/tl-ph.js",
  37632. "./tl-ph.js": "./node_modules/moment/locale/tl-ph.js",
  37633. "./tlh": "./node_modules/moment/locale/tlh.js",
  37634. "./tlh.js": "./node_modules/moment/locale/tlh.js",
  37635. "./tr": "./node_modules/moment/locale/tr.js",
  37636. "./tr.js": "./node_modules/moment/locale/tr.js",
  37637. "./tzl": "./node_modules/moment/locale/tzl.js",
  37638. "./tzl.js": "./node_modules/moment/locale/tzl.js",
  37639. "./tzm": "./node_modules/moment/locale/tzm.js",
  37640. "./tzm-latn": "./node_modules/moment/locale/tzm-latn.js",
  37641. "./tzm-latn.js": "./node_modules/moment/locale/tzm-latn.js",
  37642. "./tzm.js": "./node_modules/moment/locale/tzm.js",
  37643. "./ug-cn": "./node_modules/moment/locale/ug-cn.js",
  37644. "./ug-cn.js": "./node_modules/moment/locale/ug-cn.js",
  37645. "./uk": "./node_modules/moment/locale/uk.js",
  37646. "./uk.js": "./node_modules/moment/locale/uk.js",
  37647. "./ur": "./node_modules/moment/locale/ur.js",
  37648. "./ur.js": "./node_modules/moment/locale/ur.js",
  37649. "./uz": "./node_modules/moment/locale/uz.js",
  37650. "./uz-latn": "./node_modules/moment/locale/uz-latn.js",
  37651. "./uz-latn.js": "./node_modules/moment/locale/uz-latn.js",
  37652. "./uz.js": "./node_modules/moment/locale/uz.js",
  37653. "./vi": "./node_modules/moment/locale/vi.js",
  37654. "./vi.js": "./node_modules/moment/locale/vi.js",
  37655. "./x-pseudo": "./node_modules/moment/locale/x-pseudo.js",
  37656. "./x-pseudo.js": "./node_modules/moment/locale/x-pseudo.js",
  37657. "./yo": "./node_modules/moment/locale/yo.js",
  37658. "./yo.js": "./node_modules/moment/locale/yo.js",
  37659. "./zh-cn": "./node_modules/moment/locale/zh-cn.js",
  37660. "./zh-cn.js": "./node_modules/moment/locale/zh-cn.js",
  37661. "./zh-hk": "./node_modules/moment/locale/zh-hk.js",
  37662. "./zh-hk.js": "./node_modules/moment/locale/zh-hk.js",
  37663. "./zh-mo": "./node_modules/moment/locale/zh-mo.js",
  37664. "./zh-mo.js": "./node_modules/moment/locale/zh-mo.js",
  37665. "./zh-tw": "./node_modules/moment/locale/zh-tw.js",
  37666. "./zh-tw.js": "./node_modules/moment/locale/zh-tw.js"
  37667. };
  37668. function webpackContext(req) {
  37669. var id = webpackContextResolve(req);
  37670. return __webpack_require__(id);
  37671. }
  37672. function webpackContextResolve(req) {
  37673. if(!__webpack_require__.o(map, req)) {
  37674. var e = new Error("Cannot find module '" + req + "'");
  37675. e.code = 'MODULE_NOT_FOUND';
  37676. throw e;
  37677. }
  37678. return map[req];
  37679. }
  37680. webpackContext.keys = function webpackContextKeys() {
  37681. return Object.keys(map);
  37682. };
  37683. webpackContext.resolve = webpackContextResolve;
  37684. module.exports = webpackContext;
  37685. webpackContext.id = "./node_modules/moment/locale sync recursive ^\\.\\/.*$";
  37686. /***/ }),
  37687. /***/ "./node_modules/moment/locale/af.js":
  37688. /*!******************************************!*\
  37689. !*** ./node_modules/moment/locale/af.js ***!
  37690. \******************************************/
  37691. /*! no static exports found */
  37692. /***/ (function(module, exports, __webpack_require__) {
  37693. //! moment.js locale configuration
  37694. //! locale : Afrikaans [af]
  37695. //! author : Werner Mollentze : https://github.com/wernerm
  37696. ;(function (global, factory) {
  37697. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  37698. undefined
  37699. }(this, (function (moment) { 'use strict';
  37700. //! moment.js locale configuration
  37701. var af = moment.defineLocale('af', {
  37702. months: 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split(
  37703. '_'
  37704. ),
  37705. monthsShort: 'Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des'.split('_'),
  37706. weekdays: 'Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag'.split(
  37707. '_'
  37708. ),
  37709. weekdaysShort: 'Son_Maa_Din_Woe_Don_Vry_Sat'.split('_'),
  37710. weekdaysMin: 'So_Ma_Di_Wo_Do_Vr_Sa'.split('_'),
  37711. meridiemParse: /vm|nm/i,
  37712. isPM: function (input) {
  37713. return /^nm$/i.test(input);
  37714. },
  37715. meridiem: function (hours, minutes, isLower) {
  37716. if (hours < 12) {
  37717. return isLower ? 'vm' : 'VM';
  37718. } else {
  37719. return isLower ? 'nm' : 'NM';
  37720. }
  37721. },
  37722. longDateFormat: {
  37723. LT: 'HH:mm',
  37724. LTS: 'HH:mm:ss',
  37725. L: 'DD/MM/YYYY',
  37726. LL: 'D MMMM YYYY',
  37727. LLL: 'D MMMM YYYY HH:mm',
  37728. LLLL: 'dddd, D MMMM YYYY HH:mm',
  37729. },
  37730. calendar: {
  37731. sameDay: '[Vandag om] LT',
  37732. nextDay: '[Môre om] LT',
  37733. nextWeek: 'dddd [om] LT',
  37734. lastDay: '[Gister om] LT',
  37735. lastWeek: '[Laas] dddd [om] LT',
  37736. sameElse: 'L',
  37737. },
  37738. relativeTime: {
  37739. future: 'oor %s',
  37740. past: '%s gelede',
  37741. s: "'n paar sekondes",
  37742. ss: '%d sekondes',
  37743. m: "'n minuut",
  37744. mm: '%d minute',
  37745. h: "'n uur",
  37746. hh: '%d ure',
  37747. d: "'n dag",
  37748. dd: '%d dae',
  37749. M: "'n maand",
  37750. MM: '%d maande',
  37751. y: "'n jaar",
  37752. yy: '%d jaar',
  37753. },
  37754. dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
  37755. ordinal: function (number) {
  37756. return (
  37757. number +
  37758. (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de')
  37759. ); // Thanks to Joris Röling : https://github.com/jjupiter
  37760. },
  37761. week: {
  37762. dow: 1, // Maandag is die eerste dag van die week.
  37763. doy: 4, // Die week wat die 4de Januarie bevat is die eerste week van die jaar.
  37764. },
  37765. });
  37766. return af;
  37767. })));
  37768. /***/ }),
  37769. /***/ "./node_modules/moment/locale/ar-dz.js":
  37770. /*!*********************************************!*\
  37771. !*** ./node_modules/moment/locale/ar-dz.js ***!
  37772. \*********************************************/
  37773. /*! no static exports found */
  37774. /***/ (function(module, exports, __webpack_require__) {
  37775. //! moment.js locale configuration
  37776. //! locale : Arabic (Algeria) [ar-dz]
  37777. //! author : Amine Roukh: https://github.com/Amine27
  37778. //! author : Abdel Said: https://github.com/abdelsaid
  37779. //! author : Ahmed Elkhatib
  37780. //! author : forabi https://github.com/forabi
  37781. //! author : Noureddine LOUAHEDJ : https://github.com/noureddinem
  37782. ;(function (global, factory) {
  37783. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  37784. undefined
  37785. }(this, (function (moment) { 'use strict';
  37786. //! moment.js locale configuration
  37787. var pluralForm = function (n) {
  37788. return n === 0
  37789. ? 0
  37790. : n === 1
  37791. ? 1
  37792. : n === 2
  37793. ? 2
  37794. : n % 100 >= 3 && n % 100 <= 10
  37795. ? 3
  37796. : n % 100 >= 11
  37797. ? 4
  37798. : 5;
  37799. },
  37800. plurals = {
  37801. s: [
  37802. 'أقل من ثانية',
  37803. 'ثانية واحدة',
  37804. ['ثانيتان', 'ثانيتين'],
  37805. '%d ثوان',
  37806. '%d ثانية',
  37807. '%d ثانية',
  37808. ],
  37809. m: [
  37810. 'أقل من دقيقة',
  37811. 'دقيقة واحدة',
  37812. ['دقيقتان', 'دقيقتين'],
  37813. '%d دقائق',
  37814. '%d دقيقة',
  37815. '%d دقيقة',
  37816. ],
  37817. h: [
  37818. 'أقل من ساعة',
  37819. 'ساعة واحدة',
  37820. ['ساعتان', 'ساعتين'],
  37821. '%d ساعات',
  37822. '%d ساعة',
  37823. '%d ساعة',
  37824. ],
  37825. d: [
  37826. 'أقل من يوم',
  37827. 'يوم واحد',
  37828. ['يومان', 'يومين'],
  37829. '%d أيام',
  37830. '%d يومًا',
  37831. '%d يوم',
  37832. ],
  37833. M: [
  37834. 'أقل من شهر',
  37835. 'شهر واحد',
  37836. ['شهران', 'شهرين'],
  37837. '%d أشهر',
  37838. '%d شهرا',
  37839. '%d شهر',
  37840. ],
  37841. y: [
  37842. 'أقل من عام',
  37843. 'عام واحد',
  37844. ['عامان', 'عامين'],
  37845. '%d أعوام',
  37846. '%d عامًا',
  37847. '%d عام',
  37848. ],
  37849. },
  37850. pluralize = function (u) {
  37851. return function (number, withoutSuffix, string, isFuture) {
  37852. var f = pluralForm(number),
  37853. str = plurals[u][pluralForm(number)];
  37854. if (f === 2) {
  37855. str = str[withoutSuffix ? 0 : 1];
  37856. }
  37857. return str.replace(/%d/i, number);
  37858. };
  37859. },
  37860. months = [
  37861. 'جانفي',
  37862. 'فيفري',
  37863. 'مارس',
  37864. 'أفريل',
  37865. 'ماي',
  37866. 'جوان',
  37867. 'جويلية',
  37868. 'أوت',
  37869. 'سبتمبر',
  37870. 'أكتوبر',
  37871. 'نوفمبر',
  37872. 'ديسمبر',
  37873. ];
  37874. var arDz = moment.defineLocale('ar-dz', {
  37875. months: months,
  37876. monthsShort: months,
  37877. weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  37878. weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
  37879. weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  37880. weekdaysParseExact: true,
  37881. longDateFormat: {
  37882. LT: 'HH:mm',
  37883. LTS: 'HH:mm:ss',
  37884. L: 'D/\u200FM/\u200FYYYY',
  37885. LL: 'D MMMM YYYY',
  37886. LLL: 'D MMMM YYYY HH:mm',
  37887. LLLL: 'dddd D MMMM YYYY HH:mm',
  37888. },
  37889. meridiemParse: /ص|م/,
  37890. isPM: function (input) {
  37891. return 'م' === input;
  37892. },
  37893. meridiem: function (hour, minute, isLower) {
  37894. if (hour < 12) {
  37895. return 'ص';
  37896. } else {
  37897. return 'م';
  37898. }
  37899. },
  37900. calendar: {
  37901. sameDay: '[اليوم عند الساعة] LT',
  37902. nextDay: '[غدًا عند الساعة] LT',
  37903. nextWeek: 'dddd [عند الساعة] LT',
  37904. lastDay: '[أمس عند الساعة] LT',
  37905. lastWeek: 'dddd [عند الساعة] LT',
  37906. sameElse: 'L',
  37907. },
  37908. relativeTime: {
  37909. future: 'بعد %s',
  37910. past: 'منذ %s',
  37911. s: pluralize('s'),
  37912. ss: pluralize('s'),
  37913. m: pluralize('m'),
  37914. mm: pluralize('m'),
  37915. h: pluralize('h'),
  37916. hh: pluralize('h'),
  37917. d: pluralize('d'),
  37918. dd: pluralize('d'),
  37919. M: pluralize('M'),
  37920. MM: pluralize('M'),
  37921. y: pluralize('y'),
  37922. yy: pluralize('y'),
  37923. },
  37924. postformat: function (string) {
  37925. return string.replace(/,/g, '،');
  37926. },
  37927. week: {
  37928. dow: 0, // Sunday is the first day of the week.
  37929. doy: 4, // The week that contains Jan 4th is the first week of the year.
  37930. },
  37931. });
  37932. return arDz;
  37933. })));
  37934. /***/ }),
  37935. /***/ "./node_modules/moment/locale/ar-kw.js":
  37936. /*!*********************************************!*\
  37937. !*** ./node_modules/moment/locale/ar-kw.js ***!
  37938. \*********************************************/
  37939. /*! no static exports found */
  37940. /***/ (function(module, exports, __webpack_require__) {
  37941. //! moment.js locale configuration
  37942. //! locale : Arabic (Kuwait) [ar-kw]
  37943. //! author : Nusret Parlak: https://github.com/nusretparlak
  37944. ;(function (global, factory) {
  37945. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  37946. undefined
  37947. }(this, (function (moment) { 'use strict';
  37948. //! moment.js locale configuration
  37949. var arKw = moment.defineLocale('ar-kw', {
  37950. months: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(
  37951. '_'
  37952. ),
  37953. monthsShort: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(
  37954. '_'
  37955. ),
  37956. weekdays: 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  37957. weekdaysShort: 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
  37958. weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  37959. weekdaysParseExact: true,
  37960. longDateFormat: {
  37961. LT: 'HH:mm',
  37962. LTS: 'HH:mm:ss',
  37963. L: 'DD/MM/YYYY',
  37964. LL: 'D MMMM YYYY',
  37965. LLL: 'D MMMM YYYY HH:mm',
  37966. LLLL: 'dddd D MMMM YYYY HH:mm',
  37967. },
  37968. calendar: {
  37969. sameDay: '[اليوم على الساعة] LT',
  37970. nextDay: '[غدا على الساعة] LT',
  37971. nextWeek: 'dddd [على الساعة] LT',
  37972. lastDay: '[أمس على الساعة] LT',
  37973. lastWeek: 'dddd [على الساعة] LT',
  37974. sameElse: 'L',
  37975. },
  37976. relativeTime: {
  37977. future: 'في %s',
  37978. past: 'منذ %s',
  37979. s: 'ثوان',
  37980. ss: '%d ثانية',
  37981. m: 'دقيقة',
  37982. mm: '%d دقائق',
  37983. h: 'ساعة',
  37984. hh: '%d ساعات',
  37985. d: 'يوم',
  37986. dd: '%d أيام',
  37987. M: 'شهر',
  37988. MM: '%d أشهر',
  37989. y: 'سنة',
  37990. yy: '%d سنوات',
  37991. },
  37992. week: {
  37993. dow: 0, // Sunday is the first day of the week.
  37994. doy: 12, // The week that contains Jan 12th is the first week of the year.
  37995. },
  37996. });
  37997. return arKw;
  37998. })));
  37999. /***/ }),
  38000. /***/ "./node_modules/moment/locale/ar-ly.js":
  38001. /*!*********************************************!*\
  38002. !*** ./node_modules/moment/locale/ar-ly.js ***!
  38003. \*********************************************/
  38004. /*! no static exports found */
  38005. /***/ (function(module, exports, __webpack_require__) {
  38006. //! moment.js locale configuration
  38007. //! locale : Arabic (Lybia) [ar-ly]
  38008. //! author : Ali Hmer: https://github.com/kikoanis
  38009. ;(function (global, factory) {
  38010. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  38011. undefined
  38012. }(this, (function (moment) { 'use strict';
  38013. //! moment.js locale configuration
  38014. var symbolMap = {
  38015. '1': '1',
  38016. '2': '2',
  38017. '3': '3',
  38018. '4': '4',
  38019. '5': '5',
  38020. '6': '6',
  38021. '7': '7',
  38022. '8': '8',
  38023. '9': '9',
  38024. '0': '0',
  38025. },
  38026. pluralForm = function (n) {
  38027. return n === 0
  38028. ? 0
  38029. : n === 1
  38030. ? 1
  38031. : n === 2
  38032. ? 2
  38033. : n % 100 >= 3 && n % 100 <= 10
  38034. ? 3
  38035. : n % 100 >= 11
  38036. ? 4
  38037. : 5;
  38038. },
  38039. plurals = {
  38040. s: [
  38041. 'أقل من ثانية',
  38042. 'ثانية واحدة',
  38043. ['ثانيتان', 'ثانيتين'],
  38044. '%d ثوان',
  38045. '%d ثانية',
  38046. '%d ثانية',
  38047. ],
  38048. m: [
  38049. 'أقل من دقيقة',
  38050. 'دقيقة واحدة',
  38051. ['دقيقتان', 'دقيقتين'],
  38052. '%d دقائق',
  38053. '%d دقيقة',
  38054. '%d دقيقة',
  38055. ],
  38056. h: [
  38057. 'أقل من ساعة',
  38058. 'ساعة واحدة',
  38059. ['ساعتان', 'ساعتين'],
  38060. '%d ساعات',
  38061. '%d ساعة',
  38062. '%d ساعة',
  38063. ],
  38064. d: [
  38065. 'أقل من يوم',
  38066. 'يوم واحد',
  38067. ['يومان', 'يومين'],
  38068. '%d أيام',
  38069. '%d يومًا',
  38070. '%d يوم',
  38071. ],
  38072. M: [
  38073. 'أقل من شهر',
  38074. 'شهر واحد',
  38075. ['شهران', 'شهرين'],
  38076. '%d أشهر',
  38077. '%d شهرا',
  38078. '%d شهر',
  38079. ],
  38080. y: [
  38081. 'أقل من عام',
  38082. 'عام واحد',
  38083. ['عامان', 'عامين'],
  38084. '%d أعوام',
  38085. '%d عامًا',
  38086. '%d عام',
  38087. ],
  38088. },
  38089. pluralize = function (u) {
  38090. return function (number, withoutSuffix, string, isFuture) {
  38091. var f = pluralForm(number),
  38092. str = plurals[u][pluralForm(number)];
  38093. if (f === 2) {
  38094. str = str[withoutSuffix ? 0 : 1];
  38095. }
  38096. return str.replace(/%d/i, number);
  38097. };
  38098. },
  38099. months = [
  38100. 'يناير',
  38101. 'فبراير',
  38102. 'مارس',
  38103. 'أبريل',
  38104. 'مايو',
  38105. 'يونيو',
  38106. 'يوليو',
  38107. 'أغسطس',
  38108. 'سبتمبر',
  38109. 'أكتوبر',
  38110. 'نوفمبر',
  38111. 'ديسمبر',
  38112. ];
  38113. var arLy = moment.defineLocale('ar-ly', {
  38114. months: months,
  38115. monthsShort: months,
  38116. weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  38117. weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
  38118. weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  38119. weekdaysParseExact: true,
  38120. longDateFormat: {
  38121. LT: 'HH:mm',
  38122. LTS: 'HH:mm:ss',
  38123. L: 'D/\u200FM/\u200FYYYY',
  38124. LL: 'D MMMM YYYY',
  38125. LLL: 'D MMMM YYYY HH:mm',
  38126. LLLL: 'dddd D MMMM YYYY HH:mm',
  38127. },
  38128. meridiemParse: /ص|م/,
  38129. isPM: function (input) {
  38130. return 'م' === input;
  38131. },
  38132. meridiem: function (hour, minute, isLower) {
  38133. if (hour < 12) {
  38134. return 'ص';
  38135. } else {
  38136. return 'م';
  38137. }
  38138. },
  38139. calendar: {
  38140. sameDay: '[اليوم عند الساعة] LT',
  38141. nextDay: '[غدًا عند الساعة] LT',
  38142. nextWeek: 'dddd [عند الساعة] LT',
  38143. lastDay: '[أمس عند الساعة] LT',
  38144. lastWeek: 'dddd [عند الساعة] LT',
  38145. sameElse: 'L',
  38146. },
  38147. relativeTime: {
  38148. future: 'بعد %s',
  38149. past: 'منذ %s',
  38150. s: pluralize('s'),
  38151. ss: pluralize('s'),
  38152. m: pluralize('m'),
  38153. mm: pluralize('m'),
  38154. h: pluralize('h'),
  38155. hh: pluralize('h'),
  38156. d: pluralize('d'),
  38157. dd: pluralize('d'),
  38158. M: pluralize('M'),
  38159. MM: pluralize('M'),
  38160. y: pluralize('y'),
  38161. yy: pluralize('y'),
  38162. },
  38163. preparse: function (string) {
  38164. return string.replace(/،/g, ',');
  38165. },
  38166. postformat: function (string) {
  38167. return string
  38168. .replace(/\d/g, function (match) {
  38169. return symbolMap[match];
  38170. })
  38171. .replace(/,/g, '،');
  38172. },
  38173. week: {
  38174. dow: 6, // Saturday is the first day of the week.
  38175. doy: 12, // The week that contains Jan 12th is the first week of the year.
  38176. },
  38177. });
  38178. return arLy;
  38179. })));
  38180. /***/ }),
  38181. /***/ "./node_modules/moment/locale/ar-ma.js":
  38182. /*!*********************************************!*\
  38183. !*** ./node_modules/moment/locale/ar-ma.js ***!
  38184. \*********************************************/
  38185. /*! no static exports found */
  38186. /***/ (function(module, exports, __webpack_require__) {
  38187. //! moment.js locale configuration
  38188. //! locale : Arabic (Morocco) [ar-ma]
  38189. //! author : ElFadili Yassine : https://github.com/ElFadiliY
  38190. //! author : Abdel Said : https://github.com/abdelsaid
  38191. ;(function (global, factory) {
  38192. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  38193. undefined
  38194. }(this, (function (moment) { 'use strict';
  38195. //! moment.js locale configuration
  38196. var arMa = moment.defineLocale('ar-ma', {
  38197. months: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(
  38198. '_'
  38199. ),
  38200. monthsShort: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(
  38201. '_'
  38202. ),
  38203. weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  38204. weekdaysShort: 'احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
  38205. weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  38206. weekdaysParseExact: true,
  38207. longDateFormat: {
  38208. LT: 'HH:mm',
  38209. LTS: 'HH:mm:ss',
  38210. L: 'DD/MM/YYYY',
  38211. LL: 'D MMMM YYYY',
  38212. LLL: 'D MMMM YYYY HH:mm',
  38213. LLLL: 'dddd D MMMM YYYY HH:mm',
  38214. },
  38215. calendar: {
  38216. sameDay: '[اليوم على الساعة] LT',
  38217. nextDay: '[غدا على الساعة] LT',
  38218. nextWeek: 'dddd [على الساعة] LT',
  38219. lastDay: '[أمس على الساعة] LT',
  38220. lastWeek: 'dddd [على الساعة] LT',
  38221. sameElse: 'L',
  38222. },
  38223. relativeTime: {
  38224. future: 'في %s',
  38225. past: 'منذ %s',
  38226. s: 'ثوان',
  38227. ss: '%d ثانية',
  38228. m: 'دقيقة',
  38229. mm: '%d دقائق',
  38230. h: 'ساعة',
  38231. hh: '%d ساعات',
  38232. d: 'يوم',
  38233. dd: '%d أيام',
  38234. M: 'شهر',
  38235. MM: '%d أشهر',
  38236. y: 'سنة',
  38237. yy: '%d سنوات',
  38238. },
  38239. week: {
  38240. dow: 6, // Saturday is the first day of the week.
  38241. doy: 12, // The week that contains Jan 12th is the first week of the year.
  38242. },
  38243. });
  38244. return arMa;
  38245. })));
  38246. /***/ }),
  38247. /***/ "./node_modules/moment/locale/ar-sa.js":
  38248. /*!*********************************************!*\
  38249. !*** ./node_modules/moment/locale/ar-sa.js ***!
  38250. \*********************************************/
  38251. /*! no static exports found */
  38252. /***/ (function(module, exports, __webpack_require__) {
  38253. //! moment.js locale configuration
  38254. //! locale : Arabic (Saudi Arabia) [ar-sa]
  38255. //! author : Suhail Alkowaileet : https://github.com/xsoh
  38256. ;(function (global, factory) {
  38257. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  38258. undefined
  38259. }(this, (function (moment) { 'use strict';
  38260. //! moment.js locale configuration
  38261. var symbolMap = {
  38262. '1': '١',
  38263. '2': '٢',
  38264. '3': '٣',
  38265. '4': '٤',
  38266. '5': '٥',
  38267. '6': '٦',
  38268. '7': '٧',
  38269. '8': '٨',
  38270. '9': '٩',
  38271. '0': '٠',
  38272. },
  38273. numberMap = {
  38274. '١': '1',
  38275. '٢': '2',
  38276. '٣': '3',
  38277. '٤': '4',
  38278. '٥': '5',
  38279. '٦': '6',
  38280. '٧': '7',
  38281. '٨': '8',
  38282. '٩': '9',
  38283. '٠': '0',
  38284. };
  38285. var arSa = moment.defineLocale('ar-sa', {
  38286. months: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(
  38287. '_'
  38288. ),
  38289. monthsShort: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(
  38290. '_'
  38291. ),
  38292. weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  38293. weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
  38294. weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  38295. weekdaysParseExact: true,
  38296. longDateFormat: {
  38297. LT: 'HH:mm',
  38298. LTS: 'HH:mm:ss',
  38299. L: 'DD/MM/YYYY',
  38300. LL: 'D MMMM YYYY',
  38301. LLL: 'D MMMM YYYY HH:mm',
  38302. LLLL: 'dddd D MMMM YYYY HH:mm',
  38303. },
  38304. meridiemParse: /ص|م/,
  38305. isPM: function (input) {
  38306. return 'م' === input;
  38307. },
  38308. meridiem: function (hour, minute, isLower) {
  38309. if (hour < 12) {
  38310. return 'ص';
  38311. } else {
  38312. return 'م';
  38313. }
  38314. },
  38315. calendar: {
  38316. sameDay: '[اليوم على الساعة] LT',
  38317. nextDay: '[غدا على الساعة] LT',
  38318. nextWeek: 'dddd [على الساعة] LT',
  38319. lastDay: '[أمس على الساعة] LT',
  38320. lastWeek: 'dddd [على الساعة] LT',
  38321. sameElse: 'L',
  38322. },
  38323. relativeTime: {
  38324. future: 'في %s',
  38325. past: 'منذ %s',
  38326. s: 'ثوان',
  38327. ss: '%d ثانية',
  38328. m: 'دقيقة',
  38329. mm: '%d دقائق',
  38330. h: 'ساعة',
  38331. hh: '%d ساعات',
  38332. d: 'يوم',
  38333. dd: '%d أيام',
  38334. M: 'شهر',
  38335. MM: '%d أشهر',
  38336. y: 'سنة',
  38337. yy: '%d سنوات',
  38338. },
  38339. preparse: function (string) {
  38340. return string
  38341. .replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
  38342. return numberMap[match];
  38343. })
  38344. .replace(/،/g, ',');
  38345. },
  38346. postformat: function (string) {
  38347. return string
  38348. .replace(/\d/g, function (match) {
  38349. return symbolMap[match];
  38350. })
  38351. .replace(/,/g, '،');
  38352. },
  38353. week: {
  38354. dow: 0, // Sunday is the first day of the week.
  38355. doy: 6, // The week that contains Jan 6th is the first week of the year.
  38356. },
  38357. });
  38358. return arSa;
  38359. })));
  38360. /***/ }),
  38361. /***/ "./node_modules/moment/locale/ar-tn.js":
  38362. /*!*********************************************!*\
  38363. !*** ./node_modules/moment/locale/ar-tn.js ***!
  38364. \*********************************************/
  38365. /*! no static exports found */
  38366. /***/ (function(module, exports, __webpack_require__) {
  38367. //! moment.js locale configuration
  38368. //! locale : Arabic (Tunisia) [ar-tn]
  38369. //! author : Nader Toukabri : https://github.com/naderio
  38370. ;(function (global, factory) {
  38371. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  38372. undefined
  38373. }(this, (function (moment) { 'use strict';
  38374. //! moment.js locale configuration
  38375. var arTn = moment.defineLocale('ar-tn', {
  38376. months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(
  38377. '_'
  38378. ),
  38379. monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(
  38380. '_'
  38381. ),
  38382. weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  38383. weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
  38384. weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  38385. weekdaysParseExact: true,
  38386. longDateFormat: {
  38387. LT: 'HH:mm',
  38388. LTS: 'HH:mm:ss',
  38389. L: 'DD/MM/YYYY',
  38390. LL: 'D MMMM YYYY',
  38391. LLL: 'D MMMM YYYY HH:mm',
  38392. LLLL: 'dddd D MMMM YYYY HH:mm',
  38393. },
  38394. calendar: {
  38395. sameDay: '[اليوم على الساعة] LT',
  38396. nextDay: '[غدا على الساعة] LT',
  38397. nextWeek: 'dddd [على الساعة] LT',
  38398. lastDay: '[أمس على الساعة] LT',
  38399. lastWeek: 'dddd [على الساعة] LT',
  38400. sameElse: 'L',
  38401. },
  38402. relativeTime: {
  38403. future: 'في %s',
  38404. past: 'منذ %s',
  38405. s: 'ثوان',
  38406. ss: '%d ثانية',
  38407. m: 'دقيقة',
  38408. mm: '%d دقائق',
  38409. h: 'ساعة',
  38410. hh: '%d ساعات',
  38411. d: 'يوم',
  38412. dd: '%d أيام',
  38413. M: 'شهر',
  38414. MM: '%d أشهر',
  38415. y: 'سنة',
  38416. yy: '%d سنوات',
  38417. },
  38418. week: {
  38419. dow: 1, // Monday is the first day of the week.
  38420. doy: 4, // The week that contains Jan 4th is the first week of the year.
  38421. },
  38422. });
  38423. return arTn;
  38424. })));
  38425. /***/ }),
  38426. /***/ "./node_modules/moment/locale/ar.js":
  38427. /*!******************************************!*\
  38428. !*** ./node_modules/moment/locale/ar.js ***!
  38429. \******************************************/
  38430. /*! no static exports found */
  38431. /***/ (function(module, exports, __webpack_require__) {
  38432. //! moment.js locale configuration
  38433. //! locale : Arabic [ar]
  38434. //! author : Abdel Said: https://github.com/abdelsaid
  38435. //! author : Ahmed Elkhatib
  38436. //! author : forabi https://github.com/forabi
  38437. ;(function (global, factory) {
  38438. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  38439. undefined
  38440. }(this, (function (moment) { 'use strict';
  38441. //! moment.js locale configuration
  38442. var symbolMap = {
  38443. '1': '١',
  38444. '2': '٢',
  38445. '3': '٣',
  38446. '4': '٤',
  38447. '5': '٥',
  38448. '6': '٦',
  38449. '7': '٧',
  38450. '8': '٨',
  38451. '9': '٩',
  38452. '0': '٠',
  38453. },
  38454. numberMap = {
  38455. '١': '1',
  38456. '٢': '2',
  38457. '٣': '3',
  38458. '٤': '4',
  38459. '٥': '5',
  38460. '٦': '6',
  38461. '٧': '7',
  38462. '٨': '8',
  38463. '٩': '9',
  38464. '٠': '0',
  38465. },
  38466. pluralForm = function (n) {
  38467. return n === 0
  38468. ? 0
  38469. : n === 1
  38470. ? 1
  38471. : n === 2
  38472. ? 2
  38473. : n % 100 >= 3 && n % 100 <= 10
  38474. ? 3
  38475. : n % 100 >= 11
  38476. ? 4
  38477. : 5;
  38478. },
  38479. plurals = {
  38480. s: [
  38481. 'أقل من ثانية',
  38482. 'ثانية واحدة',
  38483. ['ثانيتان', 'ثانيتين'],
  38484. '%d ثوان',
  38485. '%d ثانية',
  38486. '%d ثانية',
  38487. ],
  38488. m: [
  38489. 'أقل من دقيقة',
  38490. 'دقيقة واحدة',
  38491. ['دقيقتان', 'دقيقتين'],
  38492. '%d دقائق',
  38493. '%d دقيقة',
  38494. '%d دقيقة',
  38495. ],
  38496. h: [
  38497. 'أقل من ساعة',
  38498. 'ساعة واحدة',
  38499. ['ساعتان', 'ساعتين'],
  38500. '%d ساعات',
  38501. '%d ساعة',
  38502. '%d ساعة',
  38503. ],
  38504. d: [
  38505. 'أقل من يوم',
  38506. 'يوم واحد',
  38507. ['يومان', 'يومين'],
  38508. '%d أيام',
  38509. '%d يومًا',
  38510. '%d يوم',
  38511. ],
  38512. M: [
  38513. 'أقل من شهر',
  38514. 'شهر واحد',
  38515. ['شهران', 'شهرين'],
  38516. '%d أشهر',
  38517. '%d شهرا',
  38518. '%d شهر',
  38519. ],
  38520. y: [
  38521. 'أقل من عام',
  38522. 'عام واحد',
  38523. ['عامان', 'عامين'],
  38524. '%d أعوام',
  38525. '%d عامًا',
  38526. '%d عام',
  38527. ],
  38528. },
  38529. pluralize = function (u) {
  38530. return function (number, withoutSuffix, string, isFuture) {
  38531. var f = pluralForm(number),
  38532. str = plurals[u][pluralForm(number)];
  38533. if (f === 2) {
  38534. str = str[withoutSuffix ? 0 : 1];
  38535. }
  38536. return str.replace(/%d/i, number);
  38537. };
  38538. },
  38539. months = [
  38540. 'يناير',
  38541. 'فبراير',
  38542. 'مارس',
  38543. 'أبريل',
  38544. 'مايو',
  38545. 'يونيو',
  38546. 'يوليو',
  38547. 'أغسطس',
  38548. 'سبتمبر',
  38549. 'أكتوبر',
  38550. 'نوفمبر',
  38551. 'ديسمبر',
  38552. ];
  38553. var ar = moment.defineLocale('ar', {
  38554. months: months,
  38555. monthsShort: months,
  38556. weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  38557. weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
  38558. weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  38559. weekdaysParseExact: true,
  38560. longDateFormat: {
  38561. LT: 'HH:mm',
  38562. LTS: 'HH:mm:ss',
  38563. L: 'D/\u200FM/\u200FYYYY',
  38564. LL: 'D MMMM YYYY',
  38565. LLL: 'D MMMM YYYY HH:mm',
  38566. LLLL: 'dddd D MMMM YYYY HH:mm',
  38567. },
  38568. meridiemParse: /ص|م/,
  38569. isPM: function (input) {
  38570. return 'م' === input;
  38571. },
  38572. meridiem: function (hour, minute, isLower) {
  38573. if (hour < 12) {
  38574. return 'ص';
  38575. } else {
  38576. return 'م';
  38577. }
  38578. },
  38579. calendar: {
  38580. sameDay: '[اليوم عند الساعة] LT',
  38581. nextDay: '[غدًا عند الساعة] LT',
  38582. nextWeek: 'dddd [عند الساعة] LT',
  38583. lastDay: '[أمس عند الساعة] LT',
  38584. lastWeek: 'dddd [عند الساعة] LT',
  38585. sameElse: 'L',
  38586. },
  38587. relativeTime: {
  38588. future: 'بعد %s',
  38589. past: 'منذ %s',
  38590. s: pluralize('s'),
  38591. ss: pluralize('s'),
  38592. m: pluralize('m'),
  38593. mm: pluralize('m'),
  38594. h: pluralize('h'),
  38595. hh: pluralize('h'),
  38596. d: pluralize('d'),
  38597. dd: pluralize('d'),
  38598. M: pluralize('M'),
  38599. MM: pluralize('M'),
  38600. y: pluralize('y'),
  38601. yy: pluralize('y'),
  38602. },
  38603. preparse: function (string) {
  38604. return string
  38605. .replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
  38606. return numberMap[match];
  38607. })
  38608. .replace(/،/g, ',');
  38609. },
  38610. postformat: function (string) {
  38611. return string
  38612. .replace(/\d/g, function (match) {
  38613. return symbolMap[match];
  38614. })
  38615. .replace(/,/g, '،');
  38616. },
  38617. week: {
  38618. dow: 6, // Saturday is the first day of the week.
  38619. doy: 12, // The week that contains Jan 12th is the first week of the year.
  38620. },
  38621. });
  38622. return ar;
  38623. })));
  38624. /***/ }),
  38625. /***/ "./node_modules/moment/locale/az.js":
  38626. /*!******************************************!*\
  38627. !*** ./node_modules/moment/locale/az.js ***!
  38628. \******************************************/
  38629. /*! no static exports found */
  38630. /***/ (function(module, exports, __webpack_require__) {
  38631. //! moment.js locale configuration
  38632. //! locale : Azerbaijani [az]
  38633. //! author : topchiyev : https://github.com/topchiyev
  38634. ;(function (global, factory) {
  38635. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  38636. undefined
  38637. }(this, (function (moment) { 'use strict';
  38638. //! moment.js locale configuration
  38639. var suffixes = {
  38640. 1: '-inci',
  38641. 5: '-inci',
  38642. 8: '-inci',
  38643. 70: '-inci',
  38644. 80: '-inci',
  38645. 2: '-nci',
  38646. 7: '-nci',
  38647. 20: '-nci',
  38648. 50: '-nci',
  38649. 3: '-üncü',
  38650. 4: '-üncü',
  38651. 100: '-üncü',
  38652. 6: '-ncı',
  38653. 9: '-uncu',
  38654. 10: '-uncu',
  38655. 30: '-uncu',
  38656. 60: '-ıncı',
  38657. 90: '-ıncı',
  38658. };
  38659. var az = moment.defineLocale('az', {
  38660. months: 'yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr'.split(
  38661. '_'
  38662. ),
  38663. monthsShort: 'yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek'.split('_'),
  38664. weekdays: 'Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə'.split(
  38665. '_'
  38666. ),
  38667. weekdaysShort: 'Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən'.split('_'),
  38668. weekdaysMin: 'Bz_BE_ÇA_Çə_CA_Cü_Şə'.split('_'),
  38669. weekdaysParseExact: true,
  38670. longDateFormat: {
  38671. LT: 'HH:mm',
  38672. LTS: 'HH:mm:ss',
  38673. L: 'DD.MM.YYYY',
  38674. LL: 'D MMMM YYYY',
  38675. LLL: 'D MMMM YYYY HH:mm',
  38676. LLLL: 'dddd, D MMMM YYYY HH:mm',
  38677. },
  38678. calendar: {
  38679. sameDay: '[bugün saat] LT',
  38680. nextDay: '[sabah saat] LT',
  38681. nextWeek: '[gələn həftə] dddd [saat] LT',
  38682. lastDay: '[dünən] LT',
  38683. lastWeek: '[keçən həftə] dddd [saat] LT',
  38684. sameElse: 'L',
  38685. },
  38686. relativeTime: {
  38687. future: '%s sonra',
  38688. past: '%s əvvəl',
  38689. s: 'bir neçə saniyə',
  38690. ss: '%d saniyə',
  38691. m: 'bir dəqiqə',
  38692. mm: '%d dəqiqə',
  38693. h: 'bir saat',
  38694. hh: '%d saat',
  38695. d: 'bir gün',
  38696. dd: '%d gün',
  38697. M: 'bir ay',
  38698. MM: '%d ay',
  38699. y: 'bir il',
  38700. yy: '%d il',
  38701. },
  38702. meridiemParse: /gecə|səhər|gündüz|axşam/,
  38703. isPM: function (input) {
  38704. return /^(gündüz|axşam)$/.test(input);
  38705. },
  38706. meridiem: function (hour, minute, isLower) {
  38707. if (hour < 4) {
  38708. return 'gecə';
  38709. } else if (hour < 12) {
  38710. return 'səhər';
  38711. } else if (hour < 17) {
  38712. return 'gündüz';
  38713. } else {
  38714. return 'axşam';
  38715. }
  38716. },
  38717. dayOfMonthOrdinalParse: /\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,
  38718. ordinal: function (number) {
  38719. if (number === 0) {
  38720. // special case for zero
  38721. return number + '-ıncı';
  38722. }
  38723. var a = number % 10,
  38724. b = (number % 100) - a,
  38725. c = number >= 100 ? 100 : null;
  38726. return number + (suffixes[a] || suffixes[b] || suffixes[c]);
  38727. },
  38728. week: {
  38729. dow: 1, // Monday is the first day of the week.
  38730. doy: 7, // The week that contains Jan 7th is the first week of the year.
  38731. },
  38732. });
  38733. return az;
  38734. })));
  38735. /***/ }),
  38736. /***/ "./node_modules/moment/locale/be.js":
  38737. /*!******************************************!*\
  38738. !*** ./node_modules/moment/locale/be.js ***!
  38739. \******************************************/
  38740. /*! no static exports found */
  38741. /***/ (function(module, exports, __webpack_require__) {
  38742. //! moment.js locale configuration
  38743. //! locale : Belarusian [be]
  38744. //! author : Dmitry Demidov : https://github.com/demidov91
  38745. //! author: Praleska: http://praleska.pro/
  38746. //! Author : Menelion Elensúle : https://github.com/Oire
  38747. ;(function (global, factory) {
  38748. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  38749. undefined
  38750. }(this, (function (moment) { 'use strict';
  38751. //! moment.js locale configuration
  38752. function plural(word, num) {
  38753. var forms = word.split('_');
  38754. return num % 10 === 1 && num % 100 !== 11
  38755. ? forms[0]
  38756. : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20)
  38757. ? forms[1]
  38758. : forms[2];
  38759. }
  38760. function relativeTimeWithPlural(number, withoutSuffix, key) {
  38761. var format = {
  38762. ss: withoutSuffix ? 'секунда_секунды_секунд' : 'секунду_секунды_секунд',
  38763. mm: withoutSuffix ? 'хвіліна_хвіліны_хвілін' : 'хвіліну_хвіліны_хвілін',
  38764. hh: withoutSuffix ? 'гадзіна_гадзіны_гадзін' : 'гадзіну_гадзіны_гадзін',
  38765. dd: 'дзень_дні_дзён',
  38766. MM: 'месяц_месяцы_месяцаў',
  38767. yy: 'год_гады_гадоў',
  38768. };
  38769. if (key === 'm') {
  38770. return withoutSuffix ? 'хвіліна' : 'хвіліну';
  38771. } else if (key === 'h') {
  38772. return withoutSuffix ? 'гадзіна' : 'гадзіну';
  38773. } else {
  38774. return number + ' ' + plural(format[key], +number);
  38775. }
  38776. }
  38777. var be = moment.defineLocale('be', {
  38778. months: {
  38779. format: 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split(
  38780. '_'
  38781. ),
  38782. standalone: 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split(
  38783. '_'
  38784. ),
  38785. },
  38786. monthsShort: 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split(
  38787. '_'
  38788. ),
  38789. weekdays: {
  38790. format: 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split(
  38791. '_'
  38792. ),
  38793. standalone: 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split(
  38794. '_'
  38795. ),
  38796. isFormat: /\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/,
  38797. },
  38798. weekdaysShort: 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
  38799. weekdaysMin: 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
  38800. longDateFormat: {
  38801. LT: 'HH:mm',
  38802. LTS: 'HH:mm:ss',
  38803. L: 'DD.MM.YYYY',
  38804. LL: 'D MMMM YYYY г.',
  38805. LLL: 'D MMMM YYYY г., HH:mm',
  38806. LLLL: 'dddd, D MMMM YYYY г., HH:mm',
  38807. },
  38808. calendar: {
  38809. sameDay: '[Сёння ў] LT',
  38810. nextDay: '[Заўтра ў] LT',
  38811. lastDay: '[Учора ў] LT',
  38812. nextWeek: function () {
  38813. return '[У] dddd [ў] LT';
  38814. },
  38815. lastWeek: function () {
  38816. switch (this.day()) {
  38817. case 0:
  38818. case 3:
  38819. case 5:
  38820. case 6:
  38821. return '[У мінулую] dddd [ў] LT';
  38822. case 1:
  38823. case 2:
  38824. case 4:
  38825. return '[У мінулы] dddd [ў] LT';
  38826. }
  38827. },
  38828. sameElse: 'L',
  38829. },
  38830. relativeTime: {
  38831. future: 'праз %s',
  38832. past: '%s таму',
  38833. s: 'некалькі секунд',
  38834. m: relativeTimeWithPlural,
  38835. mm: relativeTimeWithPlural,
  38836. h: relativeTimeWithPlural,
  38837. hh: relativeTimeWithPlural,
  38838. d: 'дзень',
  38839. dd: relativeTimeWithPlural,
  38840. M: 'месяц',
  38841. MM: relativeTimeWithPlural,
  38842. y: 'год',
  38843. yy: relativeTimeWithPlural,
  38844. },
  38845. meridiemParse: /ночы|раніцы|дня|вечара/,
  38846. isPM: function (input) {
  38847. return /^(дня|вечара)$/.test(input);
  38848. },
  38849. meridiem: function (hour, minute, isLower) {
  38850. if (hour < 4) {
  38851. return 'ночы';
  38852. } else if (hour < 12) {
  38853. return 'раніцы';
  38854. } else if (hour < 17) {
  38855. return 'дня';
  38856. } else {
  38857. return 'вечара';
  38858. }
  38859. },
  38860. dayOfMonthOrdinalParse: /\d{1,2}-(і|ы|га)/,
  38861. ordinal: function (number, period) {
  38862. switch (period) {
  38863. case 'M':
  38864. case 'd':
  38865. case 'DDD':
  38866. case 'w':
  38867. case 'W':
  38868. return (number % 10 === 2 || number % 10 === 3) &&
  38869. number % 100 !== 12 &&
  38870. number % 100 !== 13
  38871. ? number + '-і'
  38872. : number + '-ы';
  38873. case 'D':
  38874. return number + '-га';
  38875. default:
  38876. return number;
  38877. }
  38878. },
  38879. week: {
  38880. dow: 1, // Monday is the first day of the week.
  38881. doy: 7, // The week that contains Jan 7th is the first week of the year.
  38882. },
  38883. });
  38884. return be;
  38885. })));
  38886. /***/ }),
  38887. /***/ "./node_modules/moment/locale/bg.js":
  38888. /*!******************************************!*\
  38889. !*** ./node_modules/moment/locale/bg.js ***!
  38890. \******************************************/
  38891. /*! no static exports found */
  38892. /***/ (function(module, exports, __webpack_require__) {
  38893. //! moment.js locale configuration
  38894. //! locale : Bulgarian [bg]
  38895. //! author : Krasen Borisov : https://github.com/kraz
  38896. ;(function (global, factory) {
  38897. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  38898. undefined
  38899. }(this, (function (moment) { 'use strict';
  38900. //! moment.js locale configuration
  38901. var bg = moment.defineLocale('bg', {
  38902. months: 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split(
  38903. '_'
  38904. ),
  38905. monthsShort: 'яну_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'),
  38906. weekdays: 'неделя_понеделник_вторник_сряда_четвъртък_петък_събота'.split(
  38907. '_'
  38908. ),
  38909. weekdaysShort: 'нед_пон_вто_сря_чет_пет_съб'.split('_'),
  38910. weekdaysMin: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
  38911. longDateFormat: {
  38912. LT: 'H:mm',
  38913. LTS: 'H:mm:ss',
  38914. L: 'D.MM.YYYY',
  38915. LL: 'D MMMM YYYY',
  38916. LLL: 'D MMMM YYYY H:mm',
  38917. LLLL: 'dddd, D MMMM YYYY H:mm',
  38918. },
  38919. calendar: {
  38920. sameDay: '[Днес в] LT',
  38921. nextDay: '[Утре в] LT',
  38922. nextWeek: 'dddd [в] LT',
  38923. lastDay: '[Вчера в] LT',
  38924. lastWeek: function () {
  38925. switch (this.day()) {
  38926. case 0:
  38927. case 3:
  38928. case 6:
  38929. return '[Миналата] dddd [в] LT';
  38930. case 1:
  38931. case 2:
  38932. case 4:
  38933. case 5:
  38934. return '[Миналия] dddd [в] LT';
  38935. }
  38936. },
  38937. sameElse: 'L',
  38938. },
  38939. relativeTime: {
  38940. future: 'след %s',
  38941. past: 'преди %s',
  38942. s: 'няколко секунди',
  38943. ss: '%d секунди',
  38944. m: 'минута',
  38945. mm: '%d минути',
  38946. h: 'час',
  38947. hh: '%d часа',
  38948. d: 'ден',
  38949. dd: '%d дена',
  38950. M: 'месец',
  38951. MM: '%d месеца',
  38952. y: 'година',
  38953. yy: '%d години',
  38954. },
  38955. dayOfMonthOrdinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/,
  38956. ordinal: function (number) {
  38957. var lastDigit = number % 10,
  38958. last2Digits = number % 100;
  38959. if (number === 0) {
  38960. return number + '-ев';
  38961. } else if (last2Digits === 0) {
  38962. return number + '-ен';
  38963. } else if (last2Digits > 10 && last2Digits < 20) {
  38964. return number + '-ти';
  38965. } else if (lastDigit === 1) {
  38966. return number + '-ви';
  38967. } else if (lastDigit === 2) {
  38968. return number + '-ри';
  38969. } else if (lastDigit === 7 || lastDigit === 8) {
  38970. return number + '-ми';
  38971. } else {
  38972. return number + '-ти';
  38973. }
  38974. },
  38975. week: {
  38976. dow: 1, // Monday is the first day of the week.
  38977. doy: 7, // The week that contains Jan 7th is the first week of the year.
  38978. },
  38979. });
  38980. return bg;
  38981. })));
  38982. /***/ }),
  38983. /***/ "./node_modules/moment/locale/bm.js":
  38984. /*!******************************************!*\
  38985. !*** ./node_modules/moment/locale/bm.js ***!
  38986. \******************************************/
  38987. /*! no static exports found */
  38988. /***/ (function(module, exports, __webpack_require__) {
  38989. //! moment.js locale configuration
  38990. //! locale : Bambara [bm]
  38991. //! author : Estelle Comment : https://github.com/estellecomment
  38992. ;(function (global, factory) {
  38993. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  38994. undefined
  38995. }(this, (function (moment) { 'use strict';
  38996. //! moment.js locale configuration
  38997. var bm = moment.defineLocale('bm', {
  38998. months: 'Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo'.split(
  38999. '_'
  39000. ),
  39001. monthsShort: 'Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des'.split('_'),
  39002. weekdays: 'Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri'.split('_'),
  39003. weekdaysShort: 'Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib'.split('_'),
  39004. weekdaysMin: 'Ka_Nt_Ta_Ar_Al_Ju_Si'.split('_'),
  39005. longDateFormat: {
  39006. LT: 'HH:mm',
  39007. LTS: 'HH:mm:ss',
  39008. L: 'DD/MM/YYYY',
  39009. LL: 'MMMM [tile] D [san] YYYY',
  39010. LLL: 'MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm',
  39011. LLLL: 'dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm',
  39012. },
  39013. calendar: {
  39014. sameDay: '[Bi lɛrɛ] LT',
  39015. nextDay: '[Sini lɛrɛ] LT',
  39016. nextWeek: 'dddd [don lɛrɛ] LT',
  39017. lastDay: '[Kunu lɛrɛ] LT',
  39018. lastWeek: 'dddd [tɛmɛnen lɛrɛ] LT',
  39019. sameElse: 'L',
  39020. },
  39021. relativeTime: {
  39022. future: '%s kɔnɔ',
  39023. past: 'a bɛ %s bɔ',
  39024. s: 'sanga dama dama',
  39025. ss: 'sekondi %d',
  39026. m: 'miniti kelen',
  39027. mm: 'miniti %d',
  39028. h: 'lɛrɛ kelen',
  39029. hh: 'lɛrɛ %d',
  39030. d: 'tile kelen',
  39031. dd: 'tile %d',
  39032. M: 'kalo kelen',
  39033. MM: 'kalo %d',
  39034. y: 'san kelen',
  39035. yy: 'san %d',
  39036. },
  39037. week: {
  39038. dow: 1, // Monday is the first day of the week.
  39039. doy: 4, // The week that contains Jan 4th is the first week of the year.
  39040. },
  39041. });
  39042. return bm;
  39043. })));
  39044. /***/ }),
  39045. /***/ "./node_modules/moment/locale/bn.js":
  39046. /*!******************************************!*\
  39047. !*** ./node_modules/moment/locale/bn.js ***!
  39048. \******************************************/
  39049. /*! no static exports found */
  39050. /***/ (function(module, exports, __webpack_require__) {
  39051. //! moment.js locale configuration
  39052. //! locale : Bengali [bn]
  39053. //! author : Kaushik Gandhi : https://github.com/kaushikgandhi
  39054. ;(function (global, factory) {
  39055. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  39056. undefined
  39057. }(this, (function (moment) { 'use strict';
  39058. //! moment.js locale configuration
  39059. var symbolMap = {
  39060. '1': '১',
  39061. '2': '২',
  39062. '3': '৩',
  39063. '4': '৪',
  39064. '5': '৫',
  39065. '6': '৬',
  39066. '7': '৭',
  39067. '8': '৮',
  39068. '9': '৯',
  39069. '0': '০',
  39070. },
  39071. numberMap = {
  39072. '১': '1',
  39073. '২': '2',
  39074. '৩': '3',
  39075. '৪': '4',
  39076. '৫': '5',
  39077. '৬': '6',
  39078. '৭': '7',
  39079. '৮': '8',
  39080. '৯': '9',
  39081. '০': '0',
  39082. };
  39083. var bn = moment.defineLocale('bn', {
  39084. months: 'জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split(
  39085. '_'
  39086. ),
  39087. monthsShort: 'জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে'.split(
  39088. '_'
  39089. ),
  39090. weekdays: 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার'.split(
  39091. '_'
  39092. ),
  39093. weekdaysShort: 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি'.split('_'),
  39094. weekdaysMin: 'রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি'.split('_'),
  39095. longDateFormat: {
  39096. LT: 'A h:mm সময়',
  39097. LTS: 'A h:mm:ss সময়',
  39098. L: 'DD/MM/YYYY',
  39099. LL: 'D MMMM YYYY',
  39100. LLL: 'D MMMM YYYY, A h:mm সময়',
  39101. LLLL: 'dddd, D MMMM YYYY, A h:mm সময়',
  39102. },
  39103. calendar: {
  39104. sameDay: '[আজ] LT',
  39105. nextDay: '[আগামীকাল] LT',
  39106. nextWeek: 'dddd, LT',
  39107. lastDay: '[গতকাল] LT',
  39108. lastWeek: '[গত] dddd, LT',
  39109. sameElse: 'L',
  39110. },
  39111. relativeTime: {
  39112. future: '%s পরে',
  39113. past: '%s আগে',
  39114. s: 'কয়েক সেকেন্ড',
  39115. ss: '%d সেকেন্ড',
  39116. m: 'এক মিনিট',
  39117. mm: '%d মিনিট',
  39118. h: 'এক ঘন্টা',
  39119. hh: '%d ঘন্টা',
  39120. d: 'এক দিন',
  39121. dd: '%d দিন',
  39122. M: 'এক মাস',
  39123. MM: '%d মাস',
  39124. y: 'এক বছর',
  39125. yy: '%d বছর',
  39126. },
  39127. preparse: function (string) {
  39128. return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) {
  39129. return numberMap[match];
  39130. });
  39131. },
  39132. postformat: function (string) {
  39133. return string.replace(/\d/g, function (match) {
  39134. return symbolMap[match];
  39135. });
  39136. },
  39137. meridiemParse: /রাত|সকাল|দুপুর|বিকাল|রাত/,
  39138. meridiemHour: function (hour, meridiem) {
  39139. if (hour === 12) {
  39140. hour = 0;
  39141. }
  39142. if (
  39143. (meridiem === 'রাত' && hour >= 4) ||
  39144. (meridiem === 'দুপুর' && hour < 5) ||
  39145. meridiem === 'বিকাল'
  39146. ) {
  39147. return hour + 12;
  39148. } else {
  39149. return hour;
  39150. }
  39151. },
  39152. meridiem: function (hour, minute, isLower) {
  39153. if (hour < 4) {
  39154. return 'রাত';
  39155. } else if (hour < 10) {
  39156. return 'সকাল';
  39157. } else if (hour < 17) {
  39158. return 'দুপুর';
  39159. } else if (hour < 20) {
  39160. return 'বিকাল';
  39161. } else {
  39162. return 'রাত';
  39163. }
  39164. },
  39165. week: {
  39166. dow: 0, // Sunday is the first day of the week.
  39167. doy: 6, // The week that contains Jan 6th is the first week of the year.
  39168. },
  39169. });
  39170. return bn;
  39171. })));
  39172. /***/ }),
  39173. /***/ "./node_modules/moment/locale/bo.js":
  39174. /*!******************************************!*\
  39175. !*** ./node_modules/moment/locale/bo.js ***!
  39176. \******************************************/
  39177. /*! no static exports found */
  39178. /***/ (function(module, exports, __webpack_require__) {
  39179. //! moment.js locale configuration
  39180. //! locale : Tibetan [bo]
  39181. //! author : Thupten N. Chakrishar : https://github.com/vajradog
  39182. ;(function (global, factory) {
  39183. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  39184. undefined
  39185. }(this, (function (moment) { 'use strict';
  39186. //! moment.js locale configuration
  39187. var symbolMap = {
  39188. '1': '༡',
  39189. '2': '༢',
  39190. '3': '༣',
  39191. '4': '༤',
  39192. '5': '༥',
  39193. '6': '༦',
  39194. '7': '༧',
  39195. '8': '༨',
  39196. '9': '༩',
  39197. '0': '༠',
  39198. },
  39199. numberMap = {
  39200. '༡': '1',
  39201. '༢': '2',
  39202. '༣': '3',
  39203. '༤': '4',
  39204. '༥': '5',
  39205. '༦': '6',
  39206. '༧': '7',
  39207. '༨': '8',
  39208. '༩': '9',
  39209. '༠': '0',
  39210. };
  39211. var bo = moment.defineLocale('bo', {
  39212. months: 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split(
  39213. '_'
  39214. ),
  39215. monthsShort: 'ཟླ་1_ཟླ་2_ཟླ་3_ཟླ་4_ཟླ་5_ཟླ་6_ཟླ་7_ཟླ་8_ཟླ་9_ཟླ་10_ཟླ་11_ཟླ་12'.split(
  39216. '_'
  39217. ),
  39218. monthsShortRegex: /^(ཟླ་\d{1,2})/,
  39219. monthsParseExact: true,
  39220. weekdays: 'གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་'.split(
  39221. '_'
  39222. ),
  39223. weekdaysShort: 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split(
  39224. '_'
  39225. ),
  39226. weekdaysMin: 'ཉི_ཟླ_མིག_ལྷག_ཕུར_སངས_སྤེན'.split('_'),
  39227. longDateFormat: {
  39228. LT: 'A h:mm',
  39229. LTS: 'A h:mm:ss',
  39230. L: 'DD/MM/YYYY',
  39231. LL: 'D MMMM YYYY',
  39232. LLL: 'D MMMM YYYY, A h:mm',
  39233. LLLL: 'dddd, D MMMM YYYY, A h:mm',
  39234. },
  39235. calendar: {
  39236. sameDay: '[དི་རིང] LT',
  39237. nextDay: '[སང་ཉིན] LT',
  39238. nextWeek: '[བདུན་ཕྲག་རྗེས་མ], LT',
  39239. lastDay: '[ཁ་སང] LT',
  39240. lastWeek: '[བདུན་ཕྲག་མཐའ་མ] dddd, LT',
  39241. sameElse: 'L',
  39242. },
  39243. relativeTime: {
  39244. future: '%s ལ་',
  39245. past: '%s སྔན་ལ',
  39246. s: 'ལམ་སང',
  39247. ss: '%d སྐར་ཆ།',
  39248. m: 'སྐར་མ་གཅིག',
  39249. mm: '%d སྐར་མ',
  39250. h: 'ཆུ་ཚོད་གཅིག',
  39251. hh: '%d ཆུ་ཚོད',
  39252. d: 'ཉིན་གཅིག',
  39253. dd: '%d ཉིན་',
  39254. M: 'ཟླ་བ་གཅིག',
  39255. MM: '%d ཟླ་བ',
  39256. y: 'ལོ་གཅིག',
  39257. yy: '%d ལོ',
  39258. },
  39259. preparse: function (string) {
  39260. return string.replace(/[༡༢༣༤༥༦༧༨༩༠]/g, function (match) {
  39261. return numberMap[match];
  39262. });
  39263. },
  39264. postformat: function (string) {
  39265. return string.replace(/\d/g, function (match) {
  39266. return symbolMap[match];
  39267. });
  39268. },
  39269. meridiemParse: /མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,
  39270. meridiemHour: function (hour, meridiem) {
  39271. if (hour === 12) {
  39272. hour = 0;
  39273. }
  39274. if (
  39275. (meridiem === 'མཚན་མོ' && hour >= 4) ||
  39276. (meridiem === 'ཉིན་གུང' && hour < 5) ||
  39277. meridiem === 'དགོང་དག'
  39278. ) {
  39279. return hour + 12;
  39280. } else {
  39281. return hour;
  39282. }
  39283. },
  39284. meridiem: function (hour, minute, isLower) {
  39285. if (hour < 4) {
  39286. return 'མཚན་མོ';
  39287. } else if (hour < 10) {
  39288. return 'ཞོགས་ཀས';
  39289. } else if (hour < 17) {
  39290. return 'ཉིན་གུང';
  39291. } else if (hour < 20) {
  39292. return 'དགོང་དག';
  39293. } else {
  39294. return 'མཚན་མོ';
  39295. }
  39296. },
  39297. week: {
  39298. dow: 0, // Sunday is the first day of the week.
  39299. doy: 6, // The week that contains Jan 6th is the first week of the year.
  39300. },
  39301. });
  39302. return bo;
  39303. })));
  39304. /***/ }),
  39305. /***/ "./node_modules/moment/locale/br.js":
  39306. /*!******************************************!*\
  39307. !*** ./node_modules/moment/locale/br.js ***!
  39308. \******************************************/
  39309. /*! no static exports found */
  39310. /***/ (function(module, exports, __webpack_require__) {
  39311. //! moment.js locale configuration
  39312. //! locale : Breton [br]
  39313. //! author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou
  39314. ;(function (global, factory) {
  39315. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  39316. undefined
  39317. }(this, (function (moment) { 'use strict';
  39318. //! moment.js locale configuration
  39319. function relativeTimeWithMutation(number, withoutSuffix, key) {
  39320. var format = {
  39321. mm: 'munutenn',
  39322. MM: 'miz',
  39323. dd: 'devezh',
  39324. };
  39325. return number + ' ' + mutation(format[key], number);
  39326. }
  39327. function specialMutationForYears(number) {
  39328. switch (lastNumber(number)) {
  39329. case 1:
  39330. case 3:
  39331. case 4:
  39332. case 5:
  39333. case 9:
  39334. return number + ' bloaz';
  39335. default:
  39336. return number + ' vloaz';
  39337. }
  39338. }
  39339. function lastNumber(number) {
  39340. if (number > 9) {
  39341. return lastNumber(number % 10);
  39342. }
  39343. return number;
  39344. }
  39345. function mutation(text, number) {
  39346. if (number === 2) {
  39347. return softMutation(text);
  39348. }
  39349. return text;
  39350. }
  39351. function softMutation(text) {
  39352. var mutationTable = {
  39353. m: 'v',
  39354. b: 'v',
  39355. d: 'z',
  39356. };
  39357. if (mutationTable[text.charAt(0)] === undefined) {
  39358. return text;
  39359. }
  39360. return mutationTable[text.charAt(0)] + text.substring(1);
  39361. }
  39362. var monthsParse = [
  39363. /^gen/i,
  39364. /^c[ʼ\']hwe/i,
  39365. /^meu/i,
  39366. /^ebr/i,
  39367. /^mae/i,
  39368. /^(mez|eve)/i,
  39369. /^gou/i,
  39370. /^eos/i,
  39371. /^gwe/i,
  39372. /^her/i,
  39373. /^du/i,
  39374. /^ker/i,
  39375. ],
  39376. monthsRegex = /^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,
  39377. monthsStrictRegex = /^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,
  39378. monthsShortStrictRegex = /^(gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,
  39379. fullWeekdaysParse = [
  39380. /^sul/i,
  39381. /^lun/i,
  39382. /^meurzh/i,
  39383. /^merc[ʼ\']her/i,
  39384. /^yaou/i,
  39385. /^gwener/i,
  39386. /^sadorn/i,
  39387. ],
  39388. shortWeekdaysParse = [
  39389. /^Sul/i,
  39390. /^Lun/i,
  39391. /^Meu/i,
  39392. /^Mer/i,
  39393. /^Yao/i,
  39394. /^Gwe/i,
  39395. /^Sad/i,
  39396. ],
  39397. minWeekdaysParse = [
  39398. /^Su/i,
  39399. /^Lu/i,
  39400. /^Me([^r]|$)/i,
  39401. /^Mer/i,
  39402. /^Ya/i,
  39403. /^Gw/i,
  39404. /^Sa/i,
  39405. ];
  39406. var br = moment.defineLocale('br', {
  39407. months: 'Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu'.split(
  39408. '_'
  39409. ),
  39410. monthsShort: 'Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker'.split('_'),
  39411. weekdays: 'Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn'.split('_'),
  39412. weekdaysShort: 'Sul_Lun_Meu_Mer_Yao_Gwe_Sad'.split('_'),
  39413. weekdaysMin: 'Su_Lu_Me_Mer_Ya_Gw_Sa'.split('_'),
  39414. weekdaysParse: minWeekdaysParse,
  39415. fullWeekdaysParse: fullWeekdaysParse,
  39416. shortWeekdaysParse: shortWeekdaysParse,
  39417. minWeekdaysParse: minWeekdaysParse,
  39418. monthsRegex: monthsRegex,
  39419. monthsShortRegex: monthsRegex,
  39420. monthsStrictRegex: monthsStrictRegex,
  39421. monthsShortStrictRegex: monthsShortStrictRegex,
  39422. monthsParse: monthsParse,
  39423. longMonthsParse: monthsParse,
  39424. shortMonthsParse: monthsParse,
  39425. longDateFormat: {
  39426. LT: 'HH:mm',
  39427. LTS: 'HH:mm:ss',
  39428. L: 'DD/MM/YYYY',
  39429. LL: 'D [a viz] MMMM YYYY',
  39430. LLL: 'D [a viz] MMMM YYYY HH:mm',
  39431. LLLL: 'dddd, D [a viz] MMMM YYYY HH:mm',
  39432. },
  39433. calendar: {
  39434. sameDay: '[Hiziv da] LT',
  39435. nextDay: '[Warcʼhoazh da] LT',
  39436. nextWeek: 'dddd [da] LT',
  39437. lastDay: '[Decʼh da] LT',
  39438. lastWeek: 'dddd [paset da] LT',
  39439. sameElse: 'L',
  39440. },
  39441. relativeTime: {
  39442. future: 'a-benn %s',
  39443. past: '%s ʼzo',
  39444. s: 'un nebeud segondennoù',
  39445. ss: '%d eilenn',
  39446. m: 'ur vunutenn',
  39447. mm: relativeTimeWithMutation,
  39448. h: 'un eur',
  39449. hh: '%d eur',
  39450. d: 'un devezh',
  39451. dd: relativeTimeWithMutation,
  39452. M: 'ur miz',
  39453. MM: relativeTimeWithMutation,
  39454. y: 'ur bloaz',
  39455. yy: specialMutationForYears,
  39456. },
  39457. dayOfMonthOrdinalParse: /\d{1,2}(añ|vet)/,
  39458. ordinal: function (number) {
  39459. var output = number === 1 ? 'añ' : 'vet';
  39460. return number + output;
  39461. },
  39462. week: {
  39463. dow: 1, // Monday is the first day of the week.
  39464. doy: 4, // The week that contains Jan 4th is the first week of the year.
  39465. },
  39466. meridiemParse: /a.m.|g.m./, // goude merenn | a-raok merenn
  39467. isPM: function (token) {
  39468. return token === 'g.m.';
  39469. },
  39470. meridiem: function (hour, minute, isLower) {
  39471. return hour < 12 ? 'a.m.' : 'g.m.';
  39472. },
  39473. });
  39474. return br;
  39475. })));
  39476. /***/ }),
  39477. /***/ "./node_modules/moment/locale/bs.js":
  39478. /*!******************************************!*\
  39479. !*** ./node_modules/moment/locale/bs.js ***!
  39480. \******************************************/
  39481. /*! no static exports found */
  39482. /***/ (function(module, exports, __webpack_require__) {
  39483. //! moment.js locale configuration
  39484. //! locale : Bosnian [bs]
  39485. //! author : Nedim Cholich : https://github.com/frontyard
  39486. //! based on (hr) translation by Bojan Marković
  39487. ;(function (global, factory) {
  39488. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  39489. undefined
  39490. }(this, (function (moment) { 'use strict';
  39491. //! moment.js locale configuration
  39492. function translate(number, withoutSuffix, key) {
  39493. var result = number + ' ';
  39494. switch (key) {
  39495. case 'ss':
  39496. if (number === 1) {
  39497. result += 'sekunda';
  39498. } else if (number === 2 || number === 3 || number === 4) {
  39499. result += 'sekunde';
  39500. } else {
  39501. result += 'sekundi';
  39502. }
  39503. return result;
  39504. case 'm':
  39505. return withoutSuffix ? 'jedna minuta' : 'jedne minute';
  39506. case 'mm':
  39507. if (number === 1) {
  39508. result += 'minuta';
  39509. } else if (number === 2 || number === 3 || number === 4) {
  39510. result += 'minute';
  39511. } else {
  39512. result += 'minuta';
  39513. }
  39514. return result;
  39515. case 'h':
  39516. return withoutSuffix ? 'jedan sat' : 'jednog sata';
  39517. case 'hh':
  39518. if (number === 1) {
  39519. result += 'sat';
  39520. } else if (number === 2 || number === 3 || number === 4) {
  39521. result += 'sata';
  39522. } else {
  39523. result += 'sati';
  39524. }
  39525. return result;
  39526. case 'dd':
  39527. if (number === 1) {
  39528. result += 'dan';
  39529. } else {
  39530. result += 'dana';
  39531. }
  39532. return result;
  39533. case 'MM':
  39534. if (number === 1) {
  39535. result += 'mjesec';
  39536. } else if (number === 2 || number === 3 || number === 4) {
  39537. result += 'mjeseca';
  39538. } else {
  39539. result += 'mjeseci';
  39540. }
  39541. return result;
  39542. case 'yy':
  39543. if (number === 1) {
  39544. result += 'godina';
  39545. } else if (number === 2 || number === 3 || number === 4) {
  39546. result += 'godine';
  39547. } else {
  39548. result += 'godina';
  39549. }
  39550. return result;
  39551. }
  39552. }
  39553. var bs = moment.defineLocale('bs', {
  39554. months: 'januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar'.split(
  39555. '_'
  39556. ),
  39557. monthsShort: 'jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.'.split(
  39558. '_'
  39559. ),
  39560. monthsParseExact: true,
  39561. weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split(
  39562. '_'
  39563. ),
  39564. weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
  39565. weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
  39566. weekdaysParseExact: true,
  39567. longDateFormat: {
  39568. LT: 'H:mm',
  39569. LTS: 'H:mm:ss',
  39570. L: 'DD.MM.YYYY',
  39571. LL: 'D. MMMM YYYY',
  39572. LLL: 'D. MMMM YYYY H:mm',
  39573. LLLL: 'dddd, D. MMMM YYYY H:mm',
  39574. },
  39575. calendar: {
  39576. sameDay: '[danas u] LT',
  39577. nextDay: '[sutra u] LT',
  39578. nextWeek: function () {
  39579. switch (this.day()) {
  39580. case 0:
  39581. return '[u] [nedjelju] [u] LT';
  39582. case 3:
  39583. return '[u] [srijedu] [u] LT';
  39584. case 6:
  39585. return '[u] [subotu] [u] LT';
  39586. case 1:
  39587. case 2:
  39588. case 4:
  39589. case 5:
  39590. return '[u] dddd [u] LT';
  39591. }
  39592. },
  39593. lastDay: '[jučer u] LT',
  39594. lastWeek: function () {
  39595. switch (this.day()) {
  39596. case 0:
  39597. case 3:
  39598. return '[prošlu] dddd [u] LT';
  39599. case 6:
  39600. return '[prošle] [subote] [u] LT';
  39601. case 1:
  39602. case 2:
  39603. case 4:
  39604. case 5:
  39605. return '[prošli] dddd [u] LT';
  39606. }
  39607. },
  39608. sameElse: 'L',
  39609. },
  39610. relativeTime: {
  39611. future: 'za %s',
  39612. past: 'prije %s',
  39613. s: 'par sekundi',
  39614. ss: translate,
  39615. m: translate,
  39616. mm: translate,
  39617. h: translate,
  39618. hh: translate,
  39619. d: 'dan',
  39620. dd: translate,
  39621. M: 'mjesec',
  39622. MM: translate,
  39623. y: 'godinu',
  39624. yy: translate,
  39625. },
  39626. dayOfMonthOrdinalParse: /\d{1,2}\./,
  39627. ordinal: '%d.',
  39628. week: {
  39629. dow: 1, // Monday is the first day of the week.
  39630. doy: 7, // The week that contains Jan 7th is the first week of the year.
  39631. },
  39632. });
  39633. return bs;
  39634. })));
  39635. /***/ }),
  39636. /***/ "./node_modules/moment/locale/ca.js":
  39637. /*!******************************************!*\
  39638. !*** ./node_modules/moment/locale/ca.js ***!
  39639. \******************************************/
  39640. /*! no static exports found */
  39641. /***/ (function(module, exports, __webpack_require__) {
  39642. //! moment.js locale configuration
  39643. //! locale : Catalan [ca]
  39644. //! author : Juan G. Hurtado : https://github.com/juanghurtado
  39645. ;(function (global, factory) {
  39646. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  39647. undefined
  39648. }(this, (function (moment) { 'use strict';
  39649. //! moment.js locale configuration
  39650. var ca = moment.defineLocale('ca', {
  39651. months: {
  39652. standalone: 'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split(
  39653. '_'
  39654. ),
  39655. format: "de gener_de febrer_de març_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split(
  39656. '_'
  39657. ),
  39658. isFormat: /D[oD]?(\s)+MMMM/,
  39659. },
  39660. monthsShort: 'gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.'.split(
  39661. '_'
  39662. ),
  39663. monthsParseExact: true,
  39664. weekdays: 'diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte'.split(
  39665. '_'
  39666. ),
  39667. weekdaysShort: 'dg._dl._dt._dc._dj._dv._ds.'.split('_'),
  39668. weekdaysMin: 'dg_dl_dt_dc_dj_dv_ds'.split('_'),
  39669. weekdaysParseExact: true,
  39670. longDateFormat: {
  39671. LT: 'H:mm',
  39672. LTS: 'H:mm:ss',
  39673. L: 'DD/MM/YYYY',
  39674. LL: 'D MMMM [de] YYYY',
  39675. ll: 'D MMM YYYY',
  39676. LLL: 'D MMMM [de] YYYY [a les] H:mm',
  39677. lll: 'D MMM YYYY, H:mm',
  39678. LLLL: 'dddd D MMMM [de] YYYY [a les] H:mm',
  39679. llll: 'ddd D MMM YYYY, H:mm',
  39680. },
  39681. calendar: {
  39682. sameDay: function () {
  39683. return '[avui a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';
  39684. },
  39685. nextDay: function () {
  39686. return '[demà a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';
  39687. },
  39688. nextWeek: function () {
  39689. return 'dddd [a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';
  39690. },
  39691. lastDay: function () {
  39692. return '[ahir a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';
  39693. },
  39694. lastWeek: function () {
  39695. return (
  39696. '[el] dddd [passat a ' +
  39697. (this.hours() !== 1 ? 'les' : 'la') +
  39698. '] LT'
  39699. );
  39700. },
  39701. sameElse: 'L',
  39702. },
  39703. relativeTime: {
  39704. future: "d'aquí %s",
  39705. past: 'fa %s',
  39706. s: 'uns segons',
  39707. ss: '%d segons',
  39708. m: 'un minut',
  39709. mm: '%d minuts',
  39710. h: 'una hora',
  39711. hh: '%d hores',
  39712. d: 'un dia',
  39713. dd: '%d dies',
  39714. M: 'un mes',
  39715. MM: '%d mesos',
  39716. y: 'un any',
  39717. yy: '%d anys',
  39718. },
  39719. dayOfMonthOrdinalParse: /\d{1,2}(r|n|t|è|a)/,
  39720. ordinal: function (number, period) {
  39721. var output =
  39722. number === 1
  39723. ? 'r'
  39724. : number === 2
  39725. ? 'n'
  39726. : number === 3
  39727. ? 'r'
  39728. : number === 4
  39729. ? 't'
  39730. : 'è';
  39731. if (period === 'w' || period === 'W') {
  39732. output = 'a';
  39733. }
  39734. return number + output;
  39735. },
  39736. week: {
  39737. dow: 1, // Monday is the first day of the week.
  39738. doy: 4, // The week that contains Jan 4th is the first week of the year.
  39739. },
  39740. });
  39741. return ca;
  39742. })));
  39743. /***/ }),
  39744. /***/ "./node_modules/moment/locale/cs.js":
  39745. /*!******************************************!*\
  39746. !*** ./node_modules/moment/locale/cs.js ***!
  39747. \******************************************/
  39748. /*! no static exports found */
  39749. /***/ (function(module, exports, __webpack_require__) {
  39750. //! moment.js locale configuration
  39751. //! locale : Czech [cs]
  39752. //! author : petrbela : https://github.com/petrbela
  39753. ;(function (global, factory) {
  39754. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  39755. undefined
  39756. }(this, (function (moment) { 'use strict';
  39757. //! moment.js locale configuration
  39758. var months = 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split(
  39759. '_'
  39760. ),
  39761. monthsShort = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_'),
  39762. monthsParse = [
  39763. /^led/i,
  39764. /^úno/i,
  39765. /^bře/i,
  39766. /^dub/i,
  39767. /^kvě/i,
  39768. /^(čvn|červen$|června)/i,
  39769. /^(čvc|červenec|července)/i,
  39770. /^srp/i,
  39771. /^zář/i,
  39772. /^říj/i,
  39773. /^lis/i,
  39774. /^pro/i,
  39775. ],
  39776. // NOTE: 'červen' is substring of 'červenec'; therefore 'červenec' must precede 'červen' in the regex to be fully matched.
  39777. // Otherwise parser matches '1. červenec' as '1. červen' + 'ec'.
  39778. monthsRegex = /^(leden|únor|březen|duben|květen|červenec|července|červen|června|srpen|září|říjen|listopad|prosinec|led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i;
  39779. function plural(n) {
  39780. return n > 1 && n < 5 && ~~(n / 10) !== 1;
  39781. }
  39782. function translate(number, withoutSuffix, key, isFuture) {
  39783. var result = number + ' ';
  39784. switch (key) {
  39785. case 's': // a few seconds / in a few seconds / a few seconds ago
  39786. return withoutSuffix || isFuture ? 'pár sekund' : 'pár sekundami';
  39787. case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago
  39788. if (withoutSuffix || isFuture) {
  39789. return result + (plural(number) ? 'sekundy' : 'sekund');
  39790. } else {
  39791. return result + 'sekundami';
  39792. }
  39793. case 'm': // a minute / in a minute / a minute ago
  39794. return withoutSuffix ? 'minuta' : isFuture ? 'minutu' : 'minutou';
  39795. case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
  39796. if (withoutSuffix || isFuture) {
  39797. return result + (plural(number) ? 'minuty' : 'minut');
  39798. } else {
  39799. return result + 'minutami';
  39800. }
  39801. case 'h': // an hour / in an hour / an hour ago
  39802. return withoutSuffix ? 'hodina' : isFuture ? 'hodinu' : 'hodinou';
  39803. case 'hh': // 9 hours / in 9 hours / 9 hours ago
  39804. if (withoutSuffix || isFuture) {
  39805. return result + (plural(number) ? 'hodiny' : 'hodin');
  39806. } else {
  39807. return result + 'hodinami';
  39808. }
  39809. case 'd': // a day / in a day / a day ago
  39810. return withoutSuffix || isFuture ? 'den' : 'dnem';
  39811. case 'dd': // 9 days / in 9 days / 9 days ago
  39812. if (withoutSuffix || isFuture) {
  39813. return result + (plural(number) ? 'dny' : 'dní');
  39814. } else {
  39815. return result + 'dny';
  39816. }
  39817. case 'M': // a month / in a month / a month ago
  39818. return withoutSuffix || isFuture ? 'měsíc' : 'měsícem';
  39819. case 'MM': // 9 months / in 9 months / 9 months ago
  39820. if (withoutSuffix || isFuture) {
  39821. return result + (plural(number) ? 'měsíce' : 'měsíců');
  39822. } else {
  39823. return result + 'měsíci';
  39824. }
  39825. case 'y': // a year / in a year / a year ago
  39826. return withoutSuffix || isFuture ? 'rok' : 'rokem';
  39827. case 'yy': // 9 years / in 9 years / 9 years ago
  39828. if (withoutSuffix || isFuture) {
  39829. return result + (plural(number) ? 'roky' : 'let');
  39830. } else {
  39831. return result + 'lety';
  39832. }
  39833. }
  39834. }
  39835. var cs = moment.defineLocale('cs', {
  39836. months: months,
  39837. monthsShort: monthsShort,
  39838. monthsRegex: monthsRegex,
  39839. monthsShortRegex: monthsRegex,
  39840. // NOTE: 'červen' is substring of 'červenec'; therefore 'červenec' must precede 'červen' in the regex to be fully matched.
  39841. // Otherwise parser matches '1. červenec' as '1. červen' + 'ec'.
  39842. monthsStrictRegex: /^(leden|ledna|února|únor|březen|března|duben|dubna|květen|května|červenec|července|červen|června|srpen|srpna|září|říjen|října|listopadu|listopad|prosinec|prosince)/i,
  39843. monthsShortStrictRegex: /^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i,
  39844. monthsParse: monthsParse,
  39845. longMonthsParse: monthsParse,
  39846. shortMonthsParse: monthsParse,
  39847. weekdays: 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'),
  39848. weekdaysShort: 'ne_po_út_st_čt_pá_so'.split('_'),
  39849. weekdaysMin: 'ne_po_út_st_čt_pá_so'.split('_'),
  39850. longDateFormat: {
  39851. LT: 'H:mm',
  39852. LTS: 'H:mm:ss',
  39853. L: 'DD.MM.YYYY',
  39854. LL: 'D. MMMM YYYY',
  39855. LLL: 'D. MMMM YYYY H:mm',
  39856. LLLL: 'dddd D. MMMM YYYY H:mm',
  39857. l: 'D. M. YYYY',
  39858. },
  39859. calendar: {
  39860. sameDay: '[dnes v] LT',
  39861. nextDay: '[zítra v] LT',
  39862. nextWeek: function () {
  39863. switch (this.day()) {
  39864. case 0:
  39865. return '[v neděli v] LT';
  39866. case 1:
  39867. case 2:
  39868. return '[v] dddd [v] LT';
  39869. case 3:
  39870. return '[ve středu v] LT';
  39871. case 4:
  39872. return '[ve čtvrtek v] LT';
  39873. case 5:
  39874. return '[v pátek v] LT';
  39875. case 6:
  39876. return '[v sobotu v] LT';
  39877. }
  39878. },
  39879. lastDay: '[včera v] LT',
  39880. lastWeek: function () {
  39881. switch (this.day()) {
  39882. case 0:
  39883. return '[minulou neděli v] LT';
  39884. case 1:
  39885. case 2:
  39886. return '[minulé] dddd [v] LT';
  39887. case 3:
  39888. return '[minulou středu v] LT';
  39889. case 4:
  39890. case 5:
  39891. return '[minulý] dddd [v] LT';
  39892. case 6:
  39893. return '[minulou sobotu v] LT';
  39894. }
  39895. },
  39896. sameElse: 'L',
  39897. },
  39898. relativeTime: {
  39899. future: 'za %s',
  39900. past: 'před %s',
  39901. s: translate,
  39902. ss: translate,
  39903. m: translate,
  39904. mm: translate,
  39905. h: translate,
  39906. hh: translate,
  39907. d: translate,
  39908. dd: translate,
  39909. M: translate,
  39910. MM: translate,
  39911. y: translate,
  39912. yy: translate,
  39913. },
  39914. dayOfMonthOrdinalParse: /\d{1,2}\./,
  39915. ordinal: '%d.',
  39916. week: {
  39917. dow: 1, // Monday is the first day of the week.
  39918. doy: 4, // The week that contains Jan 4th is the first week of the year.
  39919. },
  39920. });
  39921. return cs;
  39922. })));
  39923. /***/ }),
  39924. /***/ "./node_modules/moment/locale/cv.js":
  39925. /*!******************************************!*\
  39926. !*** ./node_modules/moment/locale/cv.js ***!
  39927. \******************************************/
  39928. /*! no static exports found */
  39929. /***/ (function(module, exports, __webpack_require__) {
  39930. //! moment.js locale configuration
  39931. //! locale : Chuvash [cv]
  39932. //! author : Anatoly Mironov : https://github.com/mirontoli
  39933. ;(function (global, factory) {
  39934. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  39935. undefined
  39936. }(this, (function (moment) { 'use strict';
  39937. //! moment.js locale configuration
  39938. var cv = moment.defineLocale('cv', {
  39939. months: 'кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав'.split(
  39940. '_'
  39941. ),
  39942. monthsShort: 'кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш'.split('_'),
  39943. weekdays: 'вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун'.split(
  39944. '_'
  39945. ),
  39946. weekdaysShort: 'выр_тун_ытл_юн_кӗҫ_эрн_шӑм'.split('_'),
  39947. weekdaysMin: 'вр_тн_ыт_юн_кҫ_эр_шм'.split('_'),
  39948. longDateFormat: {
  39949. LT: 'HH:mm',
  39950. LTS: 'HH:mm:ss',
  39951. L: 'DD-MM-YYYY',
  39952. LL: 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]',
  39953. LLL: 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm',
  39954. LLLL: 'dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm',
  39955. },
  39956. calendar: {
  39957. sameDay: '[Паян] LT [сехетре]',
  39958. nextDay: '[Ыран] LT [сехетре]',
  39959. lastDay: '[Ӗнер] LT [сехетре]',
  39960. nextWeek: '[Ҫитес] dddd LT [сехетре]',
  39961. lastWeek: '[Иртнӗ] dddd LT [сехетре]',
  39962. sameElse: 'L',
  39963. },
  39964. relativeTime: {
  39965. future: function (output) {
  39966. var affix = /сехет$/i.exec(output)
  39967. ? 'рен'
  39968. : /ҫул$/i.exec(output)
  39969. ? 'тан'
  39970. : 'ран';
  39971. return output + affix;
  39972. },
  39973. past: '%s каялла',
  39974. s: 'пӗр-ик ҫеккунт',
  39975. ss: '%d ҫеккунт',
  39976. m: 'пӗр минут',
  39977. mm: '%d минут',
  39978. h: 'пӗр сехет',
  39979. hh: '%d сехет',
  39980. d: 'пӗр кун',
  39981. dd: '%d кун',
  39982. M: 'пӗр уйӑх',
  39983. MM: '%d уйӑх',
  39984. y: 'пӗр ҫул',
  39985. yy: '%d ҫул',
  39986. },
  39987. dayOfMonthOrdinalParse: /\d{1,2}-мӗш/,
  39988. ordinal: '%d-мӗш',
  39989. week: {
  39990. dow: 1, // Monday is the first day of the week.
  39991. doy: 7, // The week that contains Jan 7th is the first week of the year.
  39992. },
  39993. });
  39994. return cv;
  39995. })));
  39996. /***/ }),
  39997. /***/ "./node_modules/moment/locale/cy.js":
  39998. /*!******************************************!*\
  39999. !*** ./node_modules/moment/locale/cy.js ***!
  40000. \******************************************/
  40001. /*! no static exports found */
  40002. /***/ (function(module, exports, __webpack_require__) {
  40003. //! moment.js locale configuration
  40004. //! locale : Welsh [cy]
  40005. //! author : Robert Allen : https://github.com/robgallen
  40006. //! author : https://github.com/ryangreaves
  40007. ;(function (global, factory) {
  40008. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  40009. undefined
  40010. }(this, (function (moment) { 'use strict';
  40011. //! moment.js locale configuration
  40012. var cy = moment.defineLocale('cy', {
  40013. months: 'Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr'.split(
  40014. '_'
  40015. ),
  40016. monthsShort: 'Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag'.split(
  40017. '_'
  40018. ),
  40019. weekdays: 'Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn'.split(
  40020. '_'
  40021. ),
  40022. weekdaysShort: 'Sul_Llun_Maw_Mer_Iau_Gwe_Sad'.split('_'),
  40023. weekdaysMin: 'Su_Ll_Ma_Me_Ia_Gw_Sa'.split('_'),
  40024. weekdaysParseExact: true,
  40025. // time formats are the same as en-gb
  40026. longDateFormat: {
  40027. LT: 'HH:mm',
  40028. LTS: 'HH:mm:ss',
  40029. L: 'DD/MM/YYYY',
  40030. LL: 'D MMMM YYYY',
  40031. LLL: 'D MMMM YYYY HH:mm',
  40032. LLLL: 'dddd, D MMMM YYYY HH:mm',
  40033. },
  40034. calendar: {
  40035. sameDay: '[Heddiw am] LT',
  40036. nextDay: '[Yfory am] LT',
  40037. nextWeek: 'dddd [am] LT',
  40038. lastDay: '[Ddoe am] LT',
  40039. lastWeek: 'dddd [diwethaf am] LT',
  40040. sameElse: 'L',
  40041. },
  40042. relativeTime: {
  40043. future: 'mewn %s',
  40044. past: '%s yn ôl',
  40045. s: 'ychydig eiliadau',
  40046. ss: '%d eiliad',
  40047. m: 'munud',
  40048. mm: '%d munud',
  40049. h: 'awr',
  40050. hh: '%d awr',
  40051. d: 'diwrnod',
  40052. dd: '%d diwrnod',
  40053. M: 'mis',
  40054. MM: '%d mis',
  40055. y: 'blwyddyn',
  40056. yy: '%d flynedd',
  40057. },
  40058. dayOfMonthOrdinalParse: /\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,
  40059. // traditional ordinal numbers above 31 are not commonly used in colloquial Welsh
  40060. ordinal: function (number) {
  40061. var b = number,
  40062. output = '',
  40063. lookup = [
  40064. '',
  40065. 'af',
  40066. 'il',
  40067. 'ydd',
  40068. 'ydd',
  40069. 'ed',
  40070. 'ed',
  40071. 'ed',
  40072. 'fed',
  40073. 'fed',
  40074. 'fed', // 1af to 10fed
  40075. 'eg',
  40076. 'fed',
  40077. 'eg',
  40078. 'eg',
  40079. 'fed',
  40080. 'eg',
  40081. 'eg',
  40082. 'fed',
  40083. 'eg',
  40084. 'fed', // 11eg to 20fed
  40085. ];
  40086. if (b > 20) {
  40087. if (b === 40 || b === 50 || b === 60 || b === 80 || b === 100) {
  40088. output = 'fed'; // not 30ain, 70ain or 90ain
  40089. } else {
  40090. output = 'ain';
  40091. }
  40092. } else if (b > 0) {
  40093. output = lookup[b];
  40094. }
  40095. return number + output;
  40096. },
  40097. week: {
  40098. dow: 1, // Monday is the first day of the week.
  40099. doy: 4, // The week that contains Jan 4th is the first week of the year.
  40100. },
  40101. });
  40102. return cy;
  40103. })));
  40104. /***/ }),
  40105. /***/ "./node_modules/moment/locale/da.js":
  40106. /*!******************************************!*\
  40107. !*** ./node_modules/moment/locale/da.js ***!
  40108. \******************************************/
  40109. /*! no static exports found */
  40110. /***/ (function(module, exports, __webpack_require__) {
  40111. //! moment.js locale configuration
  40112. //! locale : Danish [da]
  40113. //! author : Ulrik Nielsen : https://github.com/mrbase
  40114. ;(function (global, factory) {
  40115. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  40116. undefined
  40117. }(this, (function (moment) { 'use strict';
  40118. //! moment.js locale configuration
  40119. var da = moment.defineLocale('da', {
  40120. months: 'januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december'.split(
  40121. '_'
  40122. ),
  40123. monthsShort: 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),
  40124. weekdays: 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),
  40125. weekdaysShort: 'søn_man_tir_ons_tor_fre_lør'.split('_'),
  40126. weekdaysMin: 'sø_ma_ti_on_to_fr_lø'.split('_'),
  40127. longDateFormat: {
  40128. LT: 'HH:mm',
  40129. LTS: 'HH:mm:ss',
  40130. L: 'DD.MM.YYYY',
  40131. LL: 'D. MMMM YYYY',
  40132. LLL: 'D. MMMM YYYY HH:mm',
  40133. LLLL: 'dddd [d.] D. MMMM YYYY [kl.] HH:mm',
  40134. },
  40135. calendar: {
  40136. sameDay: '[i dag kl.] LT',
  40137. nextDay: '[i morgen kl.] LT',
  40138. nextWeek: 'på dddd [kl.] LT',
  40139. lastDay: '[i går kl.] LT',
  40140. lastWeek: '[i] dddd[s kl.] LT',
  40141. sameElse: 'L',
  40142. },
  40143. relativeTime: {
  40144. future: 'om %s',
  40145. past: '%s siden',
  40146. s: 'få sekunder',
  40147. ss: '%d sekunder',
  40148. m: 'et minut',
  40149. mm: '%d minutter',
  40150. h: 'en time',
  40151. hh: '%d timer',
  40152. d: 'en dag',
  40153. dd: '%d dage',
  40154. M: 'en måned',
  40155. MM: '%d måneder',
  40156. y: 'et år',
  40157. yy: '%d år',
  40158. },
  40159. dayOfMonthOrdinalParse: /\d{1,2}\./,
  40160. ordinal: '%d.',
  40161. week: {
  40162. dow: 1, // Monday is the first day of the week.
  40163. doy: 4, // The week that contains Jan 4th is the first week of the year.
  40164. },
  40165. });
  40166. return da;
  40167. })));
  40168. /***/ }),
  40169. /***/ "./node_modules/moment/locale/de-at.js":
  40170. /*!*********************************************!*\
  40171. !*** ./node_modules/moment/locale/de-at.js ***!
  40172. \*********************************************/
  40173. /*! no static exports found */
  40174. /***/ (function(module, exports, __webpack_require__) {
  40175. //! moment.js locale configuration
  40176. //! locale : German (Austria) [de-at]
  40177. //! author : lluchs : https://github.com/lluchs
  40178. //! author: Menelion Elensúle: https://github.com/Oire
  40179. //! author : Martin Groller : https://github.com/MadMG
  40180. //! author : Mikolaj Dadela : https://github.com/mik01aj
  40181. ;(function (global, factory) {
  40182. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  40183. undefined
  40184. }(this, (function (moment) { 'use strict';
  40185. //! moment.js locale configuration
  40186. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  40187. var format = {
  40188. m: ['eine Minute', 'einer Minute'],
  40189. h: ['eine Stunde', 'einer Stunde'],
  40190. d: ['ein Tag', 'einem Tag'],
  40191. dd: [number + ' Tage', number + ' Tagen'],
  40192. w: ['eine Woche', 'einer Woche'],
  40193. M: ['ein Monat', 'einem Monat'],
  40194. MM: [number + ' Monate', number + ' Monaten'],
  40195. y: ['ein Jahr', 'einem Jahr'],
  40196. yy: [number + ' Jahre', number + ' Jahren'],
  40197. };
  40198. return withoutSuffix ? format[key][0] : format[key][1];
  40199. }
  40200. var deAt = moment.defineLocale('de-at', {
  40201. months: 'Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split(
  40202. '_'
  40203. ),
  40204. monthsShort: 'Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split(
  40205. '_'
  40206. ),
  40207. monthsParseExact: true,
  40208. weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split(
  40209. '_'
  40210. ),
  40211. weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
  40212. weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
  40213. weekdaysParseExact: true,
  40214. longDateFormat: {
  40215. LT: 'HH:mm',
  40216. LTS: 'HH:mm:ss',
  40217. L: 'DD.MM.YYYY',
  40218. LL: 'D. MMMM YYYY',
  40219. LLL: 'D. MMMM YYYY HH:mm',
  40220. LLLL: 'dddd, D. MMMM YYYY HH:mm',
  40221. },
  40222. calendar: {
  40223. sameDay: '[heute um] LT [Uhr]',
  40224. sameElse: 'L',
  40225. nextDay: '[morgen um] LT [Uhr]',
  40226. nextWeek: 'dddd [um] LT [Uhr]',
  40227. lastDay: '[gestern um] LT [Uhr]',
  40228. lastWeek: '[letzten] dddd [um] LT [Uhr]',
  40229. },
  40230. relativeTime: {
  40231. future: 'in %s',
  40232. past: 'vor %s',
  40233. s: 'ein paar Sekunden',
  40234. ss: '%d Sekunden',
  40235. m: processRelativeTime,
  40236. mm: '%d Minuten',
  40237. h: processRelativeTime,
  40238. hh: '%d Stunden',
  40239. d: processRelativeTime,
  40240. dd: processRelativeTime,
  40241. w: processRelativeTime,
  40242. ww: '%d Wochen',
  40243. M: processRelativeTime,
  40244. MM: processRelativeTime,
  40245. y: processRelativeTime,
  40246. yy: processRelativeTime,
  40247. },
  40248. dayOfMonthOrdinalParse: /\d{1,2}\./,
  40249. ordinal: '%d.',
  40250. week: {
  40251. dow: 1, // Monday is the first day of the week.
  40252. doy: 4, // The week that contains Jan 4th is the first week of the year.
  40253. },
  40254. });
  40255. return deAt;
  40256. })));
  40257. /***/ }),
  40258. /***/ "./node_modules/moment/locale/de-ch.js":
  40259. /*!*********************************************!*\
  40260. !*** ./node_modules/moment/locale/de-ch.js ***!
  40261. \*********************************************/
  40262. /*! no static exports found */
  40263. /***/ (function(module, exports, __webpack_require__) {
  40264. //! moment.js locale configuration
  40265. //! locale : German (Switzerland) [de-ch]
  40266. //! author : sschueller : https://github.com/sschueller
  40267. ;(function (global, factory) {
  40268. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  40269. undefined
  40270. }(this, (function (moment) { 'use strict';
  40271. //! moment.js locale configuration
  40272. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  40273. var format = {
  40274. m: ['eine Minute', 'einer Minute'],
  40275. h: ['eine Stunde', 'einer Stunde'],
  40276. d: ['ein Tag', 'einem Tag'],
  40277. dd: [number + ' Tage', number + ' Tagen'],
  40278. w: ['eine Woche', 'einer Woche'],
  40279. M: ['ein Monat', 'einem Monat'],
  40280. MM: [number + ' Monate', number + ' Monaten'],
  40281. y: ['ein Jahr', 'einem Jahr'],
  40282. yy: [number + ' Jahre', number + ' Jahren'],
  40283. };
  40284. return withoutSuffix ? format[key][0] : format[key][1];
  40285. }
  40286. var deCh = moment.defineLocale('de-ch', {
  40287. months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split(
  40288. '_'
  40289. ),
  40290. monthsShort: 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split(
  40291. '_'
  40292. ),
  40293. monthsParseExact: true,
  40294. weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split(
  40295. '_'
  40296. ),
  40297. weekdaysShort: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
  40298. weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
  40299. weekdaysParseExact: true,
  40300. longDateFormat: {
  40301. LT: 'HH:mm',
  40302. LTS: 'HH:mm:ss',
  40303. L: 'DD.MM.YYYY',
  40304. LL: 'D. MMMM YYYY',
  40305. LLL: 'D. MMMM YYYY HH:mm',
  40306. LLLL: 'dddd, D. MMMM YYYY HH:mm',
  40307. },
  40308. calendar: {
  40309. sameDay: '[heute um] LT [Uhr]',
  40310. sameElse: 'L',
  40311. nextDay: '[morgen um] LT [Uhr]',
  40312. nextWeek: 'dddd [um] LT [Uhr]',
  40313. lastDay: '[gestern um] LT [Uhr]',
  40314. lastWeek: '[letzten] dddd [um] LT [Uhr]',
  40315. },
  40316. relativeTime: {
  40317. future: 'in %s',
  40318. past: 'vor %s',
  40319. s: 'ein paar Sekunden',
  40320. ss: '%d Sekunden',
  40321. m: processRelativeTime,
  40322. mm: '%d Minuten',
  40323. h: processRelativeTime,
  40324. hh: '%d Stunden',
  40325. d: processRelativeTime,
  40326. dd: processRelativeTime,
  40327. w: processRelativeTime,
  40328. ww: '%d Wochen',
  40329. M: processRelativeTime,
  40330. MM: processRelativeTime,
  40331. y: processRelativeTime,
  40332. yy: processRelativeTime,
  40333. },
  40334. dayOfMonthOrdinalParse: /\d{1,2}\./,
  40335. ordinal: '%d.',
  40336. week: {
  40337. dow: 1, // Monday is the first day of the week.
  40338. doy: 4, // The week that contains Jan 4th is the first week of the year.
  40339. },
  40340. });
  40341. return deCh;
  40342. })));
  40343. /***/ }),
  40344. /***/ "./node_modules/moment/locale/de.js":
  40345. /*!******************************************!*\
  40346. !*** ./node_modules/moment/locale/de.js ***!
  40347. \******************************************/
  40348. /*! no static exports found */
  40349. /***/ (function(module, exports, __webpack_require__) {
  40350. //! moment.js locale configuration
  40351. //! locale : German [de]
  40352. //! author : lluchs : https://github.com/lluchs
  40353. //! author: Menelion Elensúle: https://github.com/Oire
  40354. //! author : Mikolaj Dadela : https://github.com/mik01aj
  40355. ;(function (global, factory) {
  40356. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  40357. undefined
  40358. }(this, (function (moment) { 'use strict';
  40359. //! moment.js locale configuration
  40360. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  40361. var format = {
  40362. m: ['eine Minute', 'einer Minute'],
  40363. h: ['eine Stunde', 'einer Stunde'],
  40364. d: ['ein Tag', 'einem Tag'],
  40365. dd: [number + ' Tage', number + ' Tagen'],
  40366. w: ['eine Woche', 'einer Woche'],
  40367. M: ['ein Monat', 'einem Monat'],
  40368. MM: [number + ' Monate', number + ' Monaten'],
  40369. y: ['ein Jahr', 'einem Jahr'],
  40370. yy: [number + ' Jahre', number + ' Jahren'],
  40371. };
  40372. return withoutSuffix ? format[key][0] : format[key][1];
  40373. }
  40374. var de = moment.defineLocale('de', {
  40375. months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split(
  40376. '_'
  40377. ),
  40378. monthsShort: 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split(
  40379. '_'
  40380. ),
  40381. monthsParseExact: true,
  40382. weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split(
  40383. '_'
  40384. ),
  40385. weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
  40386. weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
  40387. weekdaysParseExact: true,
  40388. longDateFormat: {
  40389. LT: 'HH:mm',
  40390. LTS: 'HH:mm:ss',
  40391. L: 'DD.MM.YYYY',
  40392. LL: 'D. MMMM YYYY',
  40393. LLL: 'D. MMMM YYYY HH:mm',
  40394. LLLL: 'dddd, D. MMMM YYYY HH:mm',
  40395. },
  40396. calendar: {
  40397. sameDay: '[heute um] LT [Uhr]',
  40398. sameElse: 'L',
  40399. nextDay: '[morgen um] LT [Uhr]',
  40400. nextWeek: 'dddd [um] LT [Uhr]',
  40401. lastDay: '[gestern um] LT [Uhr]',
  40402. lastWeek: '[letzten] dddd [um] LT [Uhr]',
  40403. },
  40404. relativeTime: {
  40405. future: 'in %s',
  40406. past: 'vor %s',
  40407. s: 'ein paar Sekunden',
  40408. ss: '%d Sekunden',
  40409. m: processRelativeTime,
  40410. mm: '%d Minuten',
  40411. h: processRelativeTime,
  40412. hh: '%d Stunden',
  40413. d: processRelativeTime,
  40414. dd: processRelativeTime,
  40415. w: processRelativeTime,
  40416. ww: '%d Wochen',
  40417. M: processRelativeTime,
  40418. MM: processRelativeTime,
  40419. y: processRelativeTime,
  40420. yy: processRelativeTime,
  40421. },
  40422. dayOfMonthOrdinalParse: /\d{1,2}\./,
  40423. ordinal: '%d.',
  40424. week: {
  40425. dow: 1, // Monday is the first day of the week.
  40426. doy: 4, // The week that contains Jan 4th is the first week of the year.
  40427. },
  40428. });
  40429. return de;
  40430. })));
  40431. /***/ }),
  40432. /***/ "./node_modules/moment/locale/dv.js":
  40433. /*!******************************************!*\
  40434. !*** ./node_modules/moment/locale/dv.js ***!
  40435. \******************************************/
  40436. /*! no static exports found */
  40437. /***/ (function(module, exports, __webpack_require__) {
  40438. //! moment.js locale configuration
  40439. //! locale : Maldivian [dv]
  40440. //! author : Jawish Hameed : https://github.com/jawish
  40441. ;(function (global, factory) {
  40442. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  40443. undefined
  40444. }(this, (function (moment) { 'use strict';
  40445. //! moment.js locale configuration
  40446. var months = [
  40447. 'ޖެނުއަރީ',
  40448. 'ފެބްރުއަރީ',
  40449. 'މާރިޗު',
  40450. 'އޭޕްރީލު',
  40451. 'މޭ',
  40452. 'ޖޫން',
  40453. 'ޖުލައި',
  40454. 'އޯގަސްޓު',
  40455. 'ސެޕްޓެމްބަރު',
  40456. 'އޮކްޓޯބަރު',
  40457. 'ނޮވެމްބަރު',
  40458. 'ޑިސެމްބަރު',
  40459. ],
  40460. weekdays = [
  40461. 'އާދިއްތަ',
  40462. 'ހޯމަ',
  40463. 'އަންގާރަ',
  40464. 'ބުދަ',
  40465. 'ބުރާސްފަތި',
  40466. 'ހުކުރު',
  40467. 'ހޮނިހިރު',
  40468. ];
  40469. var dv = moment.defineLocale('dv', {
  40470. months: months,
  40471. monthsShort: months,
  40472. weekdays: weekdays,
  40473. weekdaysShort: weekdays,
  40474. weekdaysMin: 'އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި'.split('_'),
  40475. longDateFormat: {
  40476. LT: 'HH:mm',
  40477. LTS: 'HH:mm:ss',
  40478. L: 'D/M/YYYY',
  40479. LL: 'D MMMM YYYY',
  40480. LLL: 'D MMMM YYYY HH:mm',
  40481. LLLL: 'dddd D MMMM YYYY HH:mm',
  40482. },
  40483. meridiemParse: /މކ|މފ/,
  40484. isPM: function (input) {
  40485. return 'މފ' === input;
  40486. },
  40487. meridiem: function (hour, minute, isLower) {
  40488. if (hour < 12) {
  40489. return 'މކ';
  40490. } else {
  40491. return 'މފ';
  40492. }
  40493. },
  40494. calendar: {
  40495. sameDay: '[މިއަދު] LT',
  40496. nextDay: '[މާދަމާ] LT',
  40497. nextWeek: 'dddd LT',
  40498. lastDay: '[އިއްޔެ] LT',
  40499. lastWeek: '[ފާއިތުވި] dddd LT',
  40500. sameElse: 'L',
  40501. },
  40502. relativeTime: {
  40503. future: 'ތެރޭގައި %s',
  40504. past: 'ކުރިން %s',
  40505. s: 'ސިކުންތުކޮޅެއް',
  40506. ss: 'd% ސިކުންތު',
  40507. m: 'މިނިޓެއް',
  40508. mm: 'މިނިޓު %d',
  40509. h: 'ގަޑިއިރެއް',
  40510. hh: 'ގަޑިއިރު %d',
  40511. d: 'ދުވަހެއް',
  40512. dd: 'ދުވަސް %d',
  40513. M: 'މަހެއް',
  40514. MM: 'މަސް %d',
  40515. y: 'އަހަރެއް',
  40516. yy: 'އަހަރު %d',
  40517. },
  40518. preparse: function (string) {
  40519. return string.replace(/،/g, ',');
  40520. },
  40521. postformat: function (string) {
  40522. return string.replace(/,/g, '،');
  40523. },
  40524. week: {
  40525. dow: 7, // Sunday is the first day of the week.
  40526. doy: 12, // The week that contains Jan 12th is the first week of the year.
  40527. },
  40528. });
  40529. return dv;
  40530. })));
  40531. /***/ }),
  40532. /***/ "./node_modules/moment/locale/el.js":
  40533. /*!******************************************!*\
  40534. !*** ./node_modules/moment/locale/el.js ***!
  40535. \******************************************/
  40536. /*! no static exports found */
  40537. /***/ (function(module, exports, __webpack_require__) {
  40538. //! moment.js locale configuration
  40539. //! locale : Greek [el]
  40540. //! author : Aggelos Karalias : https://github.com/mehiel
  40541. ;(function (global, factory) {
  40542. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  40543. undefined
  40544. }(this, (function (moment) { 'use strict';
  40545. //! moment.js locale configuration
  40546. function isFunction(input) {
  40547. return (
  40548. (typeof Function !== 'undefined' && input instanceof Function) ||
  40549. Object.prototype.toString.call(input) === '[object Function]'
  40550. );
  40551. }
  40552. var el = moment.defineLocale('el', {
  40553. monthsNominativeEl: 'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split(
  40554. '_'
  40555. ),
  40556. monthsGenitiveEl: 'Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου'.split(
  40557. '_'
  40558. ),
  40559. months: function (momentToFormat, format) {
  40560. if (!momentToFormat) {
  40561. return this._monthsNominativeEl;
  40562. } else if (
  40563. typeof format === 'string' &&
  40564. /D/.test(format.substring(0, format.indexOf('MMMM')))
  40565. ) {
  40566. // if there is a day number before 'MMMM'
  40567. return this._monthsGenitiveEl[momentToFormat.month()];
  40568. } else {
  40569. return this._monthsNominativeEl[momentToFormat.month()];
  40570. }
  40571. },
  40572. monthsShort: 'Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ'.split('_'),
  40573. weekdays: 'Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο'.split(
  40574. '_'
  40575. ),
  40576. weekdaysShort: 'Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ'.split('_'),
  40577. weekdaysMin: 'Κυ_Δε_Τρ_Τε_Πε_Πα_Σα'.split('_'),
  40578. meridiem: function (hours, minutes, isLower) {
  40579. if (hours > 11) {
  40580. return isLower ? 'μμ' : 'ΜΜ';
  40581. } else {
  40582. return isLower ? 'πμ' : 'ΠΜ';
  40583. }
  40584. },
  40585. isPM: function (input) {
  40586. return (input + '').toLowerCase()[0] === 'μ';
  40587. },
  40588. meridiemParse: /[ΠΜ]\.?Μ?\.?/i,
  40589. longDateFormat: {
  40590. LT: 'h:mm A',
  40591. LTS: 'h:mm:ss A',
  40592. L: 'DD/MM/YYYY',
  40593. LL: 'D MMMM YYYY',
  40594. LLL: 'D MMMM YYYY h:mm A',
  40595. LLLL: 'dddd, D MMMM YYYY h:mm A',
  40596. },
  40597. calendarEl: {
  40598. sameDay: '[Σήμερα {}] LT',
  40599. nextDay: '[Αύριο {}] LT',
  40600. nextWeek: 'dddd [{}] LT',
  40601. lastDay: '[Χθες {}] LT',
  40602. lastWeek: function () {
  40603. switch (this.day()) {
  40604. case 6:
  40605. return '[το προηγούμενο] dddd [{}] LT';
  40606. default:
  40607. return '[την προηγούμενη] dddd [{}] LT';
  40608. }
  40609. },
  40610. sameElse: 'L',
  40611. },
  40612. calendar: function (key, mom) {
  40613. var output = this._calendarEl[key],
  40614. hours = mom && mom.hours();
  40615. if (isFunction(output)) {
  40616. output = output.apply(mom);
  40617. }
  40618. return output.replace('{}', hours % 12 === 1 ? 'στη' : 'στις');
  40619. },
  40620. relativeTime: {
  40621. future: 'σε %s',
  40622. past: '%s πριν',
  40623. s: 'λίγα δευτερόλεπτα',
  40624. ss: '%d δευτερόλεπτα',
  40625. m: 'ένα λεπτό',
  40626. mm: '%d λεπτά',
  40627. h: 'μία ώρα',
  40628. hh: '%d ώρες',
  40629. d: 'μία μέρα',
  40630. dd: '%d μέρες',
  40631. M: 'ένας μήνας',
  40632. MM: '%d μήνες',
  40633. y: 'ένας χρόνος',
  40634. yy: '%d χρόνια',
  40635. },
  40636. dayOfMonthOrdinalParse: /\d{1,2}η/,
  40637. ordinal: '%dη',
  40638. week: {
  40639. dow: 1, // Monday is the first day of the week.
  40640. doy: 4, // The week that contains Jan 4st is the first week of the year.
  40641. },
  40642. });
  40643. return el;
  40644. })));
  40645. /***/ }),
  40646. /***/ "./node_modules/moment/locale/en-au.js":
  40647. /*!*********************************************!*\
  40648. !*** ./node_modules/moment/locale/en-au.js ***!
  40649. \*********************************************/
  40650. /*! no static exports found */
  40651. /***/ (function(module, exports, __webpack_require__) {
  40652. //! moment.js locale configuration
  40653. //! locale : English (Australia) [en-au]
  40654. //! author : Jared Morse : https://github.com/jarcoal
  40655. ;(function (global, factory) {
  40656. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  40657. undefined
  40658. }(this, (function (moment) { 'use strict';
  40659. //! moment.js locale configuration
  40660. var enAu = moment.defineLocale('en-au', {
  40661. months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
  40662. '_'
  40663. ),
  40664. monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  40665. weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
  40666. '_'
  40667. ),
  40668. weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  40669. weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  40670. longDateFormat: {
  40671. LT: 'h:mm A',
  40672. LTS: 'h:mm:ss A',
  40673. L: 'DD/MM/YYYY',
  40674. LL: 'D MMMM YYYY',
  40675. LLL: 'D MMMM YYYY h:mm A',
  40676. LLLL: 'dddd, D MMMM YYYY h:mm A',
  40677. },
  40678. calendar: {
  40679. sameDay: '[Today at] LT',
  40680. nextDay: '[Tomorrow at] LT',
  40681. nextWeek: 'dddd [at] LT',
  40682. lastDay: '[Yesterday at] LT',
  40683. lastWeek: '[Last] dddd [at] LT',
  40684. sameElse: 'L',
  40685. },
  40686. relativeTime: {
  40687. future: 'in %s',
  40688. past: '%s ago',
  40689. s: 'a few seconds',
  40690. ss: '%d seconds',
  40691. m: 'a minute',
  40692. mm: '%d minutes',
  40693. h: 'an hour',
  40694. hh: '%d hours',
  40695. d: 'a day',
  40696. dd: '%d days',
  40697. M: 'a month',
  40698. MM: '%d months',
  40699. y: 'a year',
  40700. yy: '%d years',
  40701. },
  40702. dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
  40703. ordinal: function (number) {
  40704. var b = number % 10,
  40705. output =
  40706. ~~((number % 100) / 10) === 1
  40707. ? 'th'
  40708. : b === 1
  40709. ? 'st'
  40710. : b === 2
  40711. ? 'nd'
  40712. : b === 3
  40713. ? 'rd'
  40714. : 'th';
  40715. return number + output;
  40716. },
  40717. week: {
  40718. dow: 0, // Sunday is the first day of the week.
  40719. doy: 4, // The week that contains Jan 4th is the first week of the year.
  40720. },
  40721. });
  40722. return enAu;
  40723. })));
  40724. /***/ }),
  40725. /***/ "./node_modules/moment/locale/en-ca.js":
  40726. /*!*********************************************!*\
  40727. !*** ./node_modules/moment/locale/en-ca.js ***!
  40728. \*********************************************/
  40729. /*! no static exports found */
  40730. /***/ (function(module, exports, __webpack_require__) {
  40731. //! moment.js locale configuration
  40732. //! locale : English (Canada) [en-ca]
  40733. //! author : Jonathan Abourbih : https://github.com/jonbca
  40734. ;(function (global, factory) {
  40735. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  40736. undefined
  40737. }(this, (function (moment) { 'use strict';
  40738. //! moment.js locale configuration
  40739. var enCa = moment.defineLocale('en-ca', {
  40740. months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
  40741. '_'
  40742. ),
  40743. monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  40744. weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
  40745. '_'
  40746. ),
  40747. weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  40748. weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  40749. longDateFormat: {
  40750. LT: 'h:mm A',
  40751. LTS: 'h:mm:ss A',
  40752. L: 'YYYY-MM-DD',
  40753. LL: 'MMMM D, YYYY',
  40754. LLL: 'MMMM D, YYYY h:mm A',
  40755. LLLL: 'dddd, MMMM D, YYYY h:mm A',
  40756. },
  40757. calendar: {
  40758. sameDay: '[Today at] LT',
  40759. nextDay: '[Tomorrow at] LT',
  40760. nextWeek: 'dddd [at] LT',
  40761. lastDay: '[Yesterday at] LT',
  40762. lastWeek: '[Last] dddd [at] LT',
  40763. sameElse: 'L',
  40764. },
  40765. relativeTime: {
  40766. future: 'in %s',
  40767. past: '%s ago',
  40768. s: 'a few seconds',
  40769. ss: '%d seconds',
  40770. m: 'a minute',
  40771. mm: '%d minutes',
  40772. h: 'an hour',
  40773. hh: '%d hours',
  40774. d: 'a day',
  40775. dd: '%d days',
  40776. M: 'a month',
  40777. MM: '%d months',
  40778. y: 'a year',
  40779. yy: '%d years',
  40780. },
  40781. dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
  40782. ordinal: function (number) {
  40783. var b = number % 10,
  40784. output =
  40785. ~~((number % 100) / 10) === 1
  40786. ? 'th'
  40787. : b === 1
  40788. ? 'st'
  40789. : b === 2
  40790. ? 'nd'
  40791. : b === 3
  40792. ? 'rd'
  40793. : 'th';
  40794. return number + output;
  40795. },
  40796. });
  40797. return enCa;
  40798. })));
  40799. /***/ }),
  40800. /***/ "./node_modules/moment/locale/en-gb.js":
  40801. /*!*********************************************!*\
  40802. !*** ./node_modules/moment/locale/en-gb.js ***!
  40803. \*********************************************/
  40804. /*! no static exports found */
  40805. /***/ (function(module, exports, __webpack_require__) {
  40806. //! moment.js locale configuration
  40807. //! locale : English (United Kingdom) [en-gb]
  40808. //! author : Chris Gedrim : https://github.com/chrisgedrim
  40809. ;(function (global, factory) {
  40810. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  40811. undefined
  40812. }(this, (function (moment) { 'use strict';
  40813. //! moment.js locale configuration
  40814. var enGb = moment.defineLocale('en-gb', {
  40815. months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
  40816. '_'
  40817. ),
  40818. monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  40819. weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
  40820. '_'
  40821. ),
  40822. weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  40823. weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  40824. longDateFormat: {
  40825. LT: 'HH:mm',
  40826. LTS: 'HH:mm:ss',
  40827. L: 'DD/MM/YYYY',
  40828. LL: 'D MMMM YYYY',
  40829. LLL: 'D MMMM YYYY HH:mm',
  40830. LLLL: 'dddd, D MMMM YYYY HH:mm',
  40831. },
  40832. calendar: {
  40833. sameDay: '[Today at] LT',
  40834. nextDay: '[Tomorrow at] LT',
  40835. nextWeek: 'dddd [at] LT',
  40836. lastDay: '[Yesterday at] LT',
  40837. lastWeek: '[Last] dddd [at] LT',
  40838. sameElse: 'L',
  40839. },
  40840. relativeTime: {
  40841. future: 'in %s',
  40842. past: '%s ago',
  40843. s: 'a few seconds',
  40844. ss: '%d seconds',
  40845. m: 'a minute',
  40846. mm: '%d minutes',
  40847. h: 'an hour',
  40848. hh: '%d hours',
  40849. d: 'a day',
  40850. dd: '%d days',
  40851. M: 'a month',
  40852. MM: '%d months',
  40853. y: 'a year',
  40854. yy: '%d years',
  40855. },
  40856. dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
  40857. ordinal: function (number) {
  40858. var b = number % 10,
  40859. output =
  40860. ~~((number % 100) / 10) === 1
  40861. ? 'th'
  40862. : b === 1
  40863. ? 'st'
  40864. : b === 2
  40865. ? 'nd'
  40866. : b === 3
  40867. ? 'rd'
  40868. : 'th';
  40869. return number + output;
  40870. },
  40871. week: {
  40872. dow: 1, // Monday is the first day of the week.
  40873. doy: 4, // The week that contains Jan 4th is the first week of the year.
  40874. },
  40875. });
  40876. return enGb;
  40877. })));
  40878. /***/ }),
  40879. /***/ "./node_modules/moment/locale/en-ie.js":
  40880. /*!*********************************************!*\
  40881. !*** ./node_modules/moment/locale/en-ie.js ***!
  40882. \*********************************************/
  40883. /*! no static exports found */
  40884. /***/ (function(module, exports, __webpack_require__) {
  40885. //! moment.js locale configuration
  40886. //! locale : English (Ireland) [en-ie]
  40887. //! author : Chris Cartlidge : https://github.com/chriscartlidge
  40888. ;(function (global, factory) {
  40889. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  40890. undefined
  40891. }(this, (function (moment) { 'use strict';
  40892. //! moment.js locale configuration
  40893. var enIe = moment.defineLocale('en-ie', {
  40894. months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
  40895. '_'
  40896. ),
  40897. monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  40898. weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
  40899. '_'
  40900. ),
  40901. weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  40902. weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  40903. longDateFormat: {
  40904. LT: 'HH:mm',
  40905. LTS: 'HH:mm:ss',
  40906. L: 'DD/MM/YYYY',
  40907. LL: 'D MMMM YYYY',
  40908. LLL: 'D MMMM YYYY HH:mm',
  40909. LLLL: 'dddd D MMMM YYYY HH:mm',
  40910. },
  40911. calendar: {
  40912. sameDay: '[Today at] LT',
  40913. nextDay: '[Tomorrow at] LT',
  40914. nextWeek: 'dddd [at] LT',
  40915. lastDay: '[Yesterday at] LT',
  40916. lastWeek: '[Last] dddd [at] LT',
  40917. sameElse: 'L',
  40918. },
  40919. relativeTime: {
  40920. future: 'in %s',
  40921. past: '%s ago',
  40922. s: 'a few seconds',
  40923. ss: '%d seconds',
  40924. m: 'a minute',
  40925. mm: '%d minutes',
  40926. h: 'an hour',
  40927. hh: '%d hours',
  40928. d: 'a day',
  40929. dd: '%d days',
  40930. M: 'a month',
  40931. MM: '%d months',
  40932. y: 'a year',
  40933. yy: '%d years',
  40934. },
  40935. dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
  40936. ordinal: function (number) {
  40937. var b = number % 10,
  40938. output =
  40939. ~~((number % 100) / 10) === 1
  40940. ? 'th'
  40941. : b === 1
  40942. ? 'st'
  40943. : b === 2
  40944. ? 'nd'
  40945. : b === 3
  40946. ? 'rd'
  40947. : 'th';
  40948. return number + output;
  40949. },
  40950. week: {
  40951. dow: 1, // Monday is the first day of the week.
  40952. doy: 4, // The week that contains Jan 4th is the first week of the year.
  40953. },
  40954. });
  40955. return enIe;
  40956. })));
  40957. /***/ }),
  40958. /***/ "./node_modules/moment/locale/en-il.js":
  40959. /*!*********************************************!*\
  40960. !*** ./node_modules/moment/locale/en-il.js ***!
  40961. \*********************************************/
  40962. /*! no static exports found */
  40963. /***/ (function(module, exports, __webpack_require__) {
  40964. //! moment.js locale configuration
  40965. //! locale : English (Israel) [en-il]
  40966. //! author : Chris Gedrim : https://github.com/chrisgedrim
  40967. ;(function (global, factory) {
  40968. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  40969. undefined
  40970. }(this, (function (moment) { 'use strict';
  40971. //! moment.js locale configuration
  40972. var enIl = moment.defineLocale('en-il', {
  40973. months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
  40974. '_'
  40975. ),
  40976. monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  40977. weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
  40978. '_'
  40979. ),
  40980. weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  40981. weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  40982. longDateFormat: {
  40983. LT: 'HH:mm',
  40984. LTS: 'HH:mm:ss',
  40985. L: 'DD/MM/YYYY',
  40986. LL: 'D MMMM YYYY',
  40987. LLL: 'D MMMM YYYY HH:mm',
  40988. LLLL: 'dddd, D MMMM YYYY HH:mm',
  40989. },
  40990. calendar: {
  40991. sameDay: '[Today at] LT',
  40992. nextDay: '[Tomorrow at] LT',
  40993. nextWeek: 'dddd [at] LT',
  40994. lastDay: '[Yesterday at] LT',
  40995. lastWeek: '[Last] dddd [at] LT',
  40996. sameElse: 'L',
  40997. },
  40998. relativeTime: {
  40999. future: 'in %s',
  41000. past: '%s ago',
  41001. s: 'a few seconds',
  41002. ss: '%d seconds',
  41003. m: 'a minute',
  41004. mm: '%d minutes',
  41005. h: 'an hour',
  41006. hh: '%d hours',
  41007. d: 'a day',
  41008. dd: '%d days',
  41009. M: 'a month',
  41010. MM: '%d months',
  41011. y: 'a year',
  41012. yy: '%d years',
  41013. },
  41014. dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
  41015. ordinal: function (number) {
  41016. var b = number % 10,
  41017. output =
  41018. ~~((number % 100) / 10) === 1
  41019. ? 'th'
  41020. : b === 1
  41021. ? 'st'
  41022. : b === 2
  41023. ? 'nd'
  41024. : b === 3
  41025. ? 'rd'
  41026. : 'th';
  41027. return number + output;
  41028. },
  41029. });
  41030. return enIl;
  41031. })));
  41032. /***/ }),
  41033. /***/ "./node_modules/moment/locale/en-in.js":
  41034. /*!*********************************************!*\
  41035. !*** ./node_modules/moment/locale/en-in.js ***!
  41036. \*********************************************/
  41037. /*! no static exports found */
  41038. /***/ (function(module, exports, __webpack_require__) {
  41039. //! moment.js locale configuration
  41040. //! locale : English (India) [en-in]
  41041. //! author : Jatin Agrawal : https://github.com/jatinag22
  41042. ;(function (global, factory) {
  41043. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  41044. undefined
  41045. }(this, (function (moment) { 'use strict';
  41046. //! moment.js locale configuration
  41047. var enIn = moment.defineLocale('en-in', {
  41048. months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
  41049. '_'
  41050. ),
  41051. monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  41052. weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
  41053. '_'
  41054. ),
  41055. weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  41056. weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  41057. longDateFormat: {
  41058. LT: 'h:mm A',
  41059. LTS: 'h:mm:ss A',
  41060. L: 'DD/MM/YYYY',
  41061. LL: 'D MMMM YYYY',
  41062. LLL: 'D MMMM YYYY h:mm A',
  41063. LLLL: 'dddd, D MMMM YYYY h:mm A',
  41064. },
  41065. calendar: {
  41066. sameDay: '[Today at] LT',
  41067. nextDay: '[Tomorrow at] LT',
  41068. nextWeek: 'dddd [at] LT',
  41069. lastDay: '[Yesterday at] LT',
  41070. lastWeek: '[Last] dddd [at] LT',
  41071. sameElse: 'L',
  41072. },
  41073. relativeTime: {
  41074. future: 'in %s',
  41075. past: '%s ago',
  41076. s: 'a few seconds',
  41077. ss: '%d seconds',
  41078. m: 'a minute',
  41079. mm: '%d minutes',
  41080. h: 'an hour',
  41081. hh: '%d hours',
  41082. d: 'a day',
  41083. dd: '%d days',
  41084. M: 'a month',
  41085. MM: '%d months',
  41086. y: 'a year',
  41087. yy: '%d years',
  41088. },
  41089. dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
  41090. ordinal: function (number) {
  41091. var b = number % 10,
  41092. output =
  41093. ~~((number % 100) / 10) === 1
  41094. ? 'th'
  41095. : b === 1
  41096. ? 'st'
  41097. : b === 2
  41098. ? 'nd'
  41099. : b === 3
  41100. ? 'rd'
  41101. : 'th';
  41102. return number + output;
  41103. },
  41104. week: {
  41105. dow: 0, // Sunday is the first day of the week.
  41106. doy: 6, // The week that contains Jan 1st is the first week of the year.
  41107. },
  41108. });
  41109. return enIn;
  41110. })));
  41111. /***/ }),
  41112. /***/ "./node_modules/moment/locale/en-nz.js":
  41113. /*!*********************************************!*\
  41114. !*** ./node_modules/moment/locale/en-nz.js ***!
  41115. \*********************************************/
  41116. /*! no static exports found */
  41117. /***/ (function(module, exports, __webpack_require__) {
  41118. //! moment.js locale configuration
  41119. //! locale : English (New Zealand) [en-nz]
  41120. //! author : Luke McGregor : https://github.com/lukemcgregor
  41121. ;(function (global, factory) {
  41122. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  41123. undefined
  41124. }(this, (function (moment) { 'use strict';
  41125. //! moment.js locale configuration
  41126. var enNz = moment.defineLocale('en-nz', {
  41127. months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
  41128. '_'
  41129. ),
  41130. monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  41131. weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
  41132. '_'
  41133. ),
  41134. weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  41135. weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  41136. longDateFormat: {
  41137. LT: 'h:mm A',
  41138. LTS: 'h:mm:ss A',
  41139. L: 'DD/MM/YYYY',
  41140. LL: 'D MMMM YYYY',
  41141. LLL: 'D MMMM YYYY h:mm A',
  41142. LLLL: 'dddd, D MMMM YYYY h:mm A',
  41143. },
  41144. calendar: {
  41145. sameDay: '[Today at] LT',
  41146. nextDay: '[Tomorrow at] LT',
  41147. nextWeek: 'dddd [at] LT',
  41148. lastDay: '[Yesterday at] LT',
  41149. lastWeek: '[Last] dddd [at] LT',
  41150. sameElse: 'L',
  41151. },
  41152. relativeTime: {
  41153. future: 'in %s',
  41154. past: '%s ago',
  41155. s: 'a few seconds',
  41156. ss: '%d seconds',
  41157. m: 'a minute',
  41158. mm: '%d minutes',
  41159. h: 'an hour',
  41160. hh: '%d hours',
  41161. d: 'a day',
  41162. dd: '%d days',
  41163. M: 'a month',
  41164. MM: '%d months',
  41165. y: 'a year',
  41166. yy: '%d years',
  41167. },
  41168. dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
  41169. ordinal: function (number) {
  41170. var b = number % 10,
  41171. output =
  41172. ~~((number % 100) / 10) === 1
  41173. ? 'th'
  41174. : b === 1
  41175. ? 'st'
  41176. : b === 2
  41177. ? 'nd'
  41178. : b === 3
  41179. ? 'rd'
  41180. : 'th';
  41181. return number + output;
  41182. },
  41183. week: {
  41184. dow: 1, // Monday is the first day of the week.
  41185. doy: 4, // The week that contains Jan 4th is the first week of the year.
  41186. },
  41187. });
  41188. return enNz;
  41189. })));
  41190. /***/ }),
  41191. /***/ "./node_modules/moment/locale/en-sg.js":
  41192. /*!*********************************************!*\
  41193. !*** ./node_modules/moment/locale/en-sg.js ***!
  41194. \*********************************************/
  41195. /*! no static exports found */
  41196. /***/ (function(module, exports, __webpack_require__) {
  41197. //! moment.js locale configuration
  41198. //! locale : English (Singapore) [en-sg]
  41199. //! author : Matthew Castrillon-Madrigal : https://github.com/techdimension
  41200. ;(function (global, factory) {
  41201. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  41202. undefined
  41203. }(this, (function (moment) { 'use strict';
  41204. //! moment.js locale configuration
  41205. var enSg = moment.defineLocale('en-sg', {
  41206. months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
  41207. '_'
  41208. ),
  41209. monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  41210. weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
  41211. '_'
  41212. ),
  41213. weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  41214. weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  41215. longDateFormat: {
  41216. LT: 'HH:mm',
  41217. LTS: 'HH:mm:ss',
  41218. L: 'DD/MM/YYYY',
  41219. LL: 'D MMMM YYYY',
  41220. LLL: 'D MMMM YYYY HH:mm',
  41221. LLLL: 'dddd, D MMMM YYYY HH:mm',
  41222. },
  41223. calendar: {
  41224. sameDay: '[Today at] LT',
  41225. nextDay: '[Tomorrow at] LT',
  41226. nextWeek: 'dddd [at] LT',
  41227. lastDay: '[Yesterday at] LT',
  41228. lastWeek: '[Last] dddd [at] LT',
  41229. sameElse: 'L',
  41230. },
  41231. relativeTime: {
  41232. future: 'in %s',
  41233. past: '%s ago',
  41234. s: 'a few seconds',
  41235. ss: '%d seconds',
  41236. m: 'a minute',
  41237. mm: '%d minutes',
  41238. h: 'an hour',
  41239. hh: '%d hours',
  41240. d: 'a day',
  41241. dd: '%d days',
  41242. M: 'a month',
  41243. MM: '%d months',
  41244. y: 'a year',
  41245. yy: '%d years',
  41246. },
  41247. dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
  41248. ordinal: function (number) {
  41249. var b = number % 10,
  41250. output =
  41251. ~~((number % 100) / 10) === 1
  41252. ? 'th'
  41253. : b === 1
  41254. ? 'st'
  41255. : b === 2
  41256. ? 'nd'
  41257. : b === 3
  41258. ? 'rd'
  41259. : 'th';
  41260. return number + output;
  41261. },
  41262. week: {
  41263. dow: 1, // Monday is the first day of the week.
  41264. doy: 4, // The week that contains Jan 4th is the first week of the year.
  41265. },
  41266. });
  41267. return enSg;
  41268. })));
  41269. /***/ }),
  41270. /***/ "./node_modules/moment/locale/eo.js":
  41271. /*!******************************************!*\
  41272. !*** ./node_modules/moment/locale/eo.js ***!
  41273. \******************************************/
  41274. /*! no static exports found */
  41275. /***/ (function(module, exports, __webpack_require__) {
  41276. //! moment.js locale configuration
  41277. //! locale : Esperanto [eo]
  41278. //! author : Colin Dean : https://github.com/colindean
  41279. //! author : Mia Nordentoft Imperatori : https://github.com/miestasmia
  41280. //! comment : miestasmia corrected the translation by colindean
  41281. //! comment : Vivakvo corrected the translation by colindean and miestasmia
  41282. ;(function (global, factory) {
  41283. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  41284. undefined
  41285. }(this, (function (moment) { 'use strict';
  41286. //! moment.js locale configuration
  41287. var eo = moment.defineLocale('eo', {
  41288. months: 'januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro'.split(
  41289. '_'
  41290. ),
  41291. monthsShort: 'jan_feb_mart_apr_maj_jun_jul_aŭg_sept_okt_nov_dec'.split('_'),
  41292. weekdays: 'dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato'.split('_'),
  41293. weekdaysShort: 'dim_lun_mard_merk_ĵaŭ_ven_sab'.split('_'),
  41294. weekdaysMin: 'di_lu_ma_me_ĵa_ve_sa'.split('_'),
  41295. longDateFormat: {
  41296. LT: 'HH:mm',
  41297. LTS: 'HH:mm:ss',
  41298. L: 'YYYY-MM-DD',
  41299. LL: '[la] D[-an de] MMMM, YYYY',
  41300. LLL: '[la] D[-an de] MMMM, YYYY HH:mm',
  41301. LLLL: 'dddd[n], [la] D[-an de] MMMM, YYYY HH:mm',
  41302. llll: 'ddd, [la] D[-an de] MMM, YYYY HH:mm',
  41303. },
  41304. meridiemParse: /[ap]\.t\.m/i,
  41305. isPM: function (input) {
  41306. return input.charAt(0).toLowerCase() === 'p';
  41307. },
  41308. meridiem: function (hours, minutes, isLower) {
  41309. if (hours > 11) {
  41310. return isLower ? 'p.t.m.' : 'P.T.M.';
  41311. } else {
  41312. return isLower ? 'a.t.m.' : 'A.T.M.';
  41313. }
  41314. },
  41315. calendar: {
  41316. sameDay: '[Hodiaŭ je] LT',
  41317. nextDay: '[Morgaŭ je] LT',
  41318. nextWeek: 'dddd[n je] LT',
  41319. lastDay: '[Hieraŭ je] LT',
  41320. lastWeek: '[pasintan] dddd[n je] LT',
  41321. sameElse: 'L',
  41322. },
  41323. relativeTime: {
  41324. future: 'post %s',
  41325. past: 'antaŭ %s',
  41326. s: 'kelkaj sekundoj',
  41327. ss: '%d sekundoj',
  41328. m: 'unu minuto',
  41329. mm: '%d minutoj',
  41330. h: 'unu horo',
  41331. hh: '%d horoj',
  41332. d: 'unu tago', //ne 'diurno', ĉar estas uzita por proksimumo
  41333. dd: '%d tagoj',
  41334. M: 'unu monato',
  41335. MM: '%d monatoj',
  41336. y: 'unu jaro',
  41337. yy: '%d jaroj',
  41338. },
  41339. dayOfMonthOrdinalParse: /\d{1,2}a/,
  41340. ordinal: '%da',
  41341. week: {
  41342. dow: 1, // Monday is the first day of the week.
  41343. doy: 7, // The week that contains Jan 7th is the first week of the year.
  41344. },
  41345. });
  41346. return eo;
  41347. })));
  41348. /***/ }),
  41349. /***/ "./node_modules/moment/locale/es-do.js":
  41350. /*!*********************************************!*\
  41351. !*** ./node_modules/moment/locale/es-do.js ***!
  41352. \*********************************************/
  41353. /*! no static exports found */
  41354. /***/ (function(module, exports, __webpack_require__) {
  41355. //! moment.js locale configuration
  41356. //! locale : Spanish (Dominican Republic) [es-do]
  41357. ;(function (global, factory) {
  41358. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  41359. undefined
  41360. }(this, (function (moment) { 'use strict';
  41361. //! moment.js locale configuration
  41362. var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split(
  41363. '_'
  41364. ),
  41365. monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),
  41366. monthsParse = [
  41367. /^ene/i,
  41368. /^feb/i,
  41369. /^mar/i,
  41370. /^abr/i,
  41371. /^may/i,
  41372. /^jun/i,
  41373. /^jul/i,
  41374. /^ago/i,
  41375. /^sep/i,
  41376. /^oct/i,
  41377. /^nov/i,
  41378. /^dic/i,
  41379. ],
  41380. monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;
  41381. var esDo = moment.defineLocale('es-do', {
  41382. months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split(
  41383. '_'
  41384. ),
  41385. monthsShort: function (m, format) {
  41386. if (!m) {
  41387. return monthsShortDot;
  41388. } else if (/-MMM-/.test(format)) {
  41389. return monthsShort[m.month()];
  41390. } else {
  41391. return monthsShortDot[m.month()];
  41392. }
  41393. },
  41394. monthsRegex: monthsRegex,
  41395. monthsShortRegex: monthsRegex,
  41396. monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,
  41397. monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,
  41398. monthsParse: monthsParse,
  41399. longMonthsParse: monthsParse,
  41400. shortMonthsParse: monthsParse,
  41401. weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
  41402. weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
  41403. weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
  41404. weekdaysParseExact: true,
  41405. longDateFormat: {
  41406. LT: 'h:mm A',
  41407. LTS: 'h:mm:ss A',
  41408. L: 'DD/MM/YYYY',
  41409. LL: 'D [de] MMMM [de] YYYY',
  41410. LLL: 'D [de] MMMM [de] YYYY h:mm A',
  41411. LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A',
  41412. },
  41413. calendar: {
  41414. sameDay: function () {
  41415. return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  41416. },
  41417. nextDay: function () {
  41418. return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  41419. },
  41420. nextWeek: function () {
  41421. return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  41422. },
  41423. lastDay: function () {
  41424. return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  41425. },
  41426. lastWeek: function () {
  41427. return (
  41428. '[el] dddd [pasado a la' +
  41429. (this.hours() !== 1 ? 's' : '') +
  41430. '] LT'
  41431. );
  41432. },
  41433. sameElse: 'L',
  41434. },
  41435. relativeTime: {
  41436. future: 'en %s',
  41437. past: 'hace %s',
  41438. s: 'unos segundos',
  41439. ss: '%d segundos',
  41440. m: 'un minuto',
  41441. mm: '%d minutos',
  41442. h: 'una hora',
  41443. hh: '%d horas',
  41444. d: 'un día',
  41445. dd: '%d días',
  41446. M: 'un mes',
  41447. MM: '%d meses',
  41448. y: 'un año',
  41449. yy: '%d años',
  41450. },
  41451. dayOfMonthOrdinalParse: /\d{1,2}º/,
  41452. ordinal: '%dº',
  41453. week: {
  41454. dow: 1, // Monday is the first day of the week.
  41455. doy: 4, // The week that contains Jan 4th is the first week of the year.
  41456. },
  41457. });
  41458. return esDo;
  41459. })));
  41460. /***/ }),
  41461. /***/ "./node_modules/moment/locale/es-us.js":
  41462. /*!*********************************************!*\
  41463. !*** ./node_modules/moment/locale/es-us.js ***!
  41464. \*********************************************/
  41465. /*! no static exports found */
  41466. /***/ (function(module, exports, __webpack_require__) {
  41467. //! moment.js locale configuration
  41468. //! locale : Spanish (United States) [es-us]
  41469. //! author : bustta : https://github.com/bustta
  41470. //! author : chrisrodz : https://github.com/chrisrodz
  41471. ;(function (global, factory) {
  41472. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  41473. undefined
  41474. }(this, (function (moment) { 'use strict';
  41475. //! moment.js locale configuration
  41476. var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split(
  41477. '_'
  41478. ),
  41479. monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),
  41480. monthsParse = [
  41481. /^ene/i,
  41482. /^feb/i,
  41483. /^mar/i,
  41484. /^abr/i,
  41485. /^may/i,
  41486. /^jun/i,
  41487. /^jul/i,
  41488. /^ago/i,
  41489. /^sep/i,
  41490. /^oct/i,
  41491. /^nov/i,
  41492. /^dic/i,
  41493. ],
  41494. monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;
  41495. var esUs = moment.defineLocale('es-us', {
  41496. months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split(
  41497. '_'
  41498. ),
  41499. monthsShort: function (m, format) {
  41500. if (!m) {
  41501. return monthsShortDot;
  41502. } else if (/-MMM-/.test(format)) {
  41503. return monthsShort[m.month()];
  41504. } else {
  41505. return monthsShortDot[m.month()];
  41506. }
  41507. },
  41508. monthsRegex: monthsRegex,
  41509. monthsShortRegex: monthsRegex,
  41510. monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,
  41511. monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,
  41512. monthsParse: monthsParse,
  41513. longMonthsParse: monthsParse,
  41514. shortMonthsParse: monthsParse,
  41515. weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
  41516. weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
  41517. weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
  41518. weekdaysParseExact: true,
  41519. longDateFormat: {
  41520. LT: 'h:mm A',
  41521. LTS: 'h:mm:ss A',
  41522. L: 'MM/DD/YYYY',
  41523. LL: 'D [de] MMMM [de] YYYY',
  41524. LLL: 'D [de] MMMM [de] YYYY h:mm A',
  41525. LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A',
  41526. },
  41527. calendar: {
  41528. sameDay: function () {
  41529. return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  41530. },
  41531. nextDay: function () {
  41532. return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  41533. },
  41534. nextWeek: function () {
  41535. return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  41536. },
  41537. lastDay: function () {
  41538. return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  41539. },
  41540. lastWeek: function () {
  41541. return (
  41542. '[el] dddd [pasado a la' +
  41543. (this.hours() !== 1 ? 's' : '') +
  41544. '] LT'
  41545. );
  41546. },
  41547. sameElse: 'L',
  41548. },
  41549. relativeTime: {
  41550. future: 'en %s',
  41551. past: 'hace %s',
  41552. s: 'unos segundos',
  41553. ss: '%d segundos',
  41554. m: 'un minuto',
  41555. mm: '%d minutos',
  41556. h: 'una hora',
  41557. hh: '%d horas',
  41558. d: 'un día',
  41559. dd: '%d días',
  41560. M: 'un mes',
  41561. MM: '%d meses',
  41562. y: 'un año',
  41563. yy: '%d años',
  41564. },
  41565. dayOfMonthOrdinalParse: /\d{1,2}º/,
  41566. ordinal: '%dº',
  41567. week: {
  41568. dow: 0, // Sunday is the first day of the week.
  41569. doy: 6, // The week that contains Jan 6th is the first week of the year.
  41570. },
  41571. });
  41572. return esUs;
  41573. })));
  41574. /***/ }),
  41575. /***/ "./node_modules/moment/locale/es.js":
  41576. /*!******************************************!*\
  41577. !*** ./node_modules/moment/locale/es.js ***!
  41578. \******************************************/
  41579. /*! no static exports found */
  41580. /***/ (function(module, exports, __webpack_require__) {
  41581. //! moment.js locale configuration
  41582. //! locale : Spanish [es]
  41583. //! author : Julio Napurí : https://github.com/julionc
  41584. ;(function (global, factory) {
  41585. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  41586. undefined
  41587. }(this, (function (moment) { 'use strict';
  41588. //! moment.js locale configuration
  41589. var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split(
  41590. '_'
  41591. ),
  41592. monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),
  41593. monthsParse = [
  41594. /^ene/i,
  41595. /^feb/i,
  41596. /^mar/i,
  41597. /^abr/i,
  41598. /^may/i,
  41599. /^jun/i,
  41600. /^jul/i,
  41601. /^ago/i,
  41602. /^sep/i,
  41603. /^oct/i,
  41604. /^nov/i,
  41605. /^dic/i,
  41606. ],
  41607. monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;
  41608. var es = moment.defineLocale('es', {
  41609. months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split(
  41610. '_'
  41611. ),
  41612. monthsShort: function (m, format) {
  41613. if (!m) {
  41614. return monthsShortDot;
  41615. } else if (/-MMM-/.test(format)) {
  41616. return monthsShort[m.month()];
  41617. } else {
  41618. return monthsShortDot[m.month()];
  41619. }
  41620. },
  41621. monthsRegex: monthsRegex,
  41622. monthsShortRegex: monthsRegex,
  41623. monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,
  41624. monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,
  41625. monthsParse: monthsParse,
  41626. longMonthsParse: monthsParse,
  41627. shortMonthsParse: monthsParse,
  41628. weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
  41629. weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
  41630. weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
  41631. weekdaysParseExact: true,
  41632. longDateFormat: {
  41633. LT: 'H:mm',
  41634. LTS: 'H:mm:ss',
  41635. L: 'DD/MM/YYYY',
  41636. LL: 'D [de] MMMM [de] YYYY',
  41637. LLL: 'D [de] MMMM [de] YYYY H:mm',
  41638. LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm',
  41639. },
  41640. calendar: {
  41641. sameDay: function () {
  41642. return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  41643. },
  41644. nextDay: function () {
  41645. return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  41646. },
  41647. nextWeek: function () {
  41648. return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  41649. },
  41650. lastDay: function () {
  41651. return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  41652. },
  41653. lastWeek: function () {
  41654. return (
  41655. '[el] dddd [pasado a la' +
  41656. (this.hours() !== 1 ? 's' : '') +
  41657. '] LT'
  41658. );
  41659. },
  41660. sameElse: 'L',
  41661. },
  41662. relativeTime: {
  41663. future: 'en %s',
  41664. past: 'hace %s',
  41665. s: 'unos segundos',
  41666. ss: '%d segundos',
  41667. m: 'un minuto',
  41668. mm: '%d minutos',
  41669. h: 'una hora',
  41670. hh: '%d horas',
  41671. d: 'un día',
  41672. dd: '%d días',
  41673. M: 'un mes',
  41674. MM: '%d meses',
  41675. y: 'un año',
  41676. yy: '%d años',
  41677. },
  41678. dayOfMonthOrdinalParse: /\d{1,2}º/,
  41679. ordinal: '%dº',
  41680. week: {
  41681. dow: 1, // Monday is the first day of the week.
  41682. doy: 4, // The week that contains Jan 4th is the first week of the year.
  41683. },
  41684. invalidDate: 'Fecha inválida',
  41685. });
  41686. return es;
  41687. })));
  41688. /***/ }),
  41689. /***/ "./node_modules/moment/locale/et.js":
  41690. /*!******************************************!*\
  41691. !*** ./node_modules/moment/locale/et.js ***!
  41692. \******************************************/
  41693. /*! no static exports found */
  41694. /***/ (function(module, exports, __webpack_require__) {
  41695. //! moment.js locale configuration
  41696. //! locale : Estonian [et]
  41697. //! author : Henry Kehlmann : https://github.com/madhenry
  41698. //! improvements : Illimar Tambek : https://github.com/ragulka
  41699. ;(function (global, factory) {
  41700. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  41701. undefined
  41702. }(this, (function (moment) { 'use strict';
  41703. //! moment.js locale configuration
  41704. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  41705. var format = {
  41706. s: ['mõne sekundi', 'mõni sekund', 'paar sekundit'],
  41707. ss: [number + 'sekundi', number + 'sekundit'],
  41708. m: ['ühe minuti', 'üks minut'],
  41709. mm: [number + ' minuti', number + ' minutit'],
  41710. h: ['ühe tunni', 'tund aega', 'üks tund'],
  41711. hh: [number + ' tunni', number + ' tundi'],
  41712. d: ['ühe päeva', 'üks päev'],
  41713. M: ['kuu aja', 'kuu aega', 'üks kuu'],
  41714. MM: [number + ' kuu', number + ' kuud'],
  41715. y: ['ühe aasta', 'aasta', 'üks aasta'],
  41716. yy: [number + ' aasta', number + ' aastat'],
  41717. };
  41718. if (withoutSuffix) {
  41719. return format[key][2] ? format[key][2] : format[key][1];
  41720. }
  41721. return isFuture ? format[key][0] : format[key][1];
  41722. }
  41723. var et = moment.defineLocale('et', {
  41724. months: 'jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember'.split(
  41725. '_'
  41726. ),
  41727. monthsShort: 'jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets'.split(
  41728. '_'
  41729. ),
  41730. weekdays: 'pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev'.split(
  41731. '_'
  41732. ),
  41733. weekdaysShort: 'P_E_T_K_N_R_L'.split('_'),
  41734. weekdaysMin: 'P_E_T_K_N_R_L'.split('_'),
  41735. longDateFormat: {
  41736. LT: 'H:mm',
  41737. LTS: 'H:mm:ss',
  41738. L: 'DD.MM.YYYY',
  41739. LL: 'D. MMMM YYYY',
  41740. LLL: 'D. MMMM YYYY H:mm',
  41741. LLLL: 'dddd, D. MMMM YYYY H:mm',
  41742. },
  41743. calendar: {
  41744. sameDay: '[Täna,] LT',
  41745. nextDay: '[Homme,] LT',
  41746. nextWeek: '[Järgmine] dddd LT',
  41747. lastDay: '[Eile,] LT',
  41748. lastWeek: '[Eelmine] dddd LT',
  41749. sameElse: 'L',
  41750. },
  41751. relativeTime: {
  41752. future: '%s pärast',
  41753. past: '%s tagasi',
  41754. s: processRelativeTime,
  41755. ss: processRelativeTime,
  41756. m: processRelativeTime,
  41757. mm: processRelativeTime,
  41758. h: processRelativeTime,
  41759. hh: processRelativeTime,
  41760. d: processRelativeTime,
  41761. dd: '%d päeva',
  41762. M: processRelativeTime,
  41763. MM: processRelativeTime,
  41764. y: processRelativeTime,
  41765. yy: processRelativeTime,
  41766. },
  41767. dayOfMonthOrdinalParse: /\d{1,2}\./,
  41768. ordinal: '%d.',
  41769. week: {
  41770. dow: 1, // Monday is the first day of the week.
  41771. doy: 4, // The week that contains Jan 4th is the first week of the year.
  41772. },
  41773. });
  41774. return et;
  41775. })));
  41776. /***/ }),
  41777. /***/ "./node_modules/moment/locale/eu.js":
  41778. /*!******************************************!*\
  41779. !*** ./node_modules/moment/locale/eu.js ***!
  41780. \******************************************/
  41781. /*! no static exports found */
  41782. /***/ (function(module, exports, __webpack_require__) {
  41783. //! moment.js locale configuration
  41784. //! locale : Basque [eu]
  41785. //! author : Eneko Illarramendi : https://github.com/eillarra
  41786. ;(function (global, factory) {
  41787. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  41788. undefined
  41789. }(this, (function (moment) { 'use strict';
  41790. //! moment.js locale configuration
  41791. var eu = moment.defineLocale('eu', {
  41792. months: 'urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua'.split(
  41793. '_'
  41794. ),
  41795. monthsShort: 'urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.'.split(
  41796. '_'
  41797. ),
  41798. monthsParseExact: true,
  41799. weekdays: 'igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata'.split(
  41800. '_'
  41801. ),
  41802. weekdaysShort: 'ig._al._ar._az._og._ol._lr.'.split('_'),
  41803. weekdaysMin: 'ig_al_ar_az_og_ol_lr'.split('_'),
  41804. weekdaysParseExact: true,
  41805. longDateFormat: {
  41806. LT: 'HH:mm',
  41807. LTS: 'HH:mm:ss',
  41808. L: 'YYYY-MM-DD',
  41809. LL: 'YYYY[ko] MMMM[ren] D[a]',
  41810. LLL: 'YYYY[ko] MMMM[ren] D[a] HH:mm',
  41811. LLLL: 'dddd, YYYY[ko] MMMM[ren] D[a] HH:mm',
  41812. l: 'YYYY-M-D',
  41813. ll: 'YYYY[ko] MMM D[a]',
  41814. lll: 'YYYY[ko] MMM D[a] HH:mm',
  41815. llll: 'ddd, YYYY[ko] MMM D[a] HH:mm',
  41816. },
  41817. calendar: {
  41818. sameDay: '[gaur] LT[etan]',
  41819. nextDay: '[bihar] LT[etan]',
  41820. nextWeek: 'dddd LT[etan]',
  41821. lastDay: '[atzo] LT[etan]',
  41822. lastWeek: '[aurreko] dddd LT[etan]',
  41823. sameElse: 'L',
  41824. },
  41825. relativeTime: {
  41826. future: '%s barru',
  41827. past: 'duela %s',
  41828. s: 'segundo batzuk',
  41829. ss: '%d segundo',
  41830. m: 'minutu bat',
  41831. mm: '%d minutu',
  41832. h: 'ordu bat',
  41833. hh: '%d ordu',
  41834. d: 'egun bat',
  41835. dd: '%d egun',
  41836. M: 'hilabete bat',
  41837. MM: '%d hilabete',
  41838. y: 'urte bat',
  41839. yy: '%d urte',
  41840. },
  41841. dayOfMonthOrdinalParse: /\d{1,2}\./,
  41842. ordinal: '%d.',
  41843. week: {
  41844. dow: 1, // Monday is the first day of the week.
  41845. doy: 7, // The week that contains Jan 7th is the first week of the year.
  41846. },
  41847. });
  41848. return eu;
  41849. })));
  41850. /***/ }),
  41851. /***/ "./node_modules/moment/locale/fa.js":
  41852. /*!******************************************!*\
  41853. !*** ./node_modules/moment/locale/fa.js ***!
  41854. \******************************************/
  41855. /*! no static exports found */
  41856. /***/ (function(module, exports, __webpack_require__) {
  41857. //! moment.js locale configuration
  41858. //! locale : Persian [fa]
  41859. //! author : Ebrahim Byagowi : https://github.com/ebraminio
  41860. ;(function (global, factory) {
  41861. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  41862. undefined
  41863. }(this, (function (moment) { 'use strict';
  41864. //! moment.js locale configuration
  41865. var symbolMap = {
  41866. '1': '۱',
  41867. '2': '۲',
  41868. '3': '۳',
  41869. '4': '۴',
  41870. '5': '۵',
  41871. '6': '۶',
  41872. '7': '۷',
  41873. '8': '۸',
  41874. '9': '۹',
  41875. '0': '۰',
  41876. },
  41877. numberMap = {
  41878. '۱': '1',
  41879. '۲': '2',
  41880. '۳': '3',
  41881. '۴': '4',
  41882. '۵': '5',
  41883. '۶': '6',
  41884. '۷': '7',
  41885. '۸': '8',
  41886. '۹': '9',
  41887. '۰': '0',
  41888. };
  41889. var fa = moment.defineLocale('fa', {
  41890. months: 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split(
  41891. '_'
  41892. ),
  41893. monthsShort: 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split(
  41894. '_'
  41895. ),
  41896. weekdays: 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split(
  41897. '_'
  41898. ),
  41899. weekdaysShort: 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split(
  41900. '_'
  41901. ),
  41902. weekdaysMin: 'ی_د_س_چ_پ_ج_ش'.split('_'),
  41903. weekdaysParseExact: true,
  41904. longDateFormat: {
  41905. LT: 'HH:mm',
  41906. LTS: 'HH:mm:ss',
  41907. L: 'DD/MM/YYYY',
  41908. LL: 'D MMMM YYYY',
  41909. LLL: 'D MMMM YYYY HH:mm',
  41910. LLLL: 'dddd, D MMMM YYYY HH:mm',
  41911. },
  41912. meridiemParse: /قبل از ظهر|بعد از ظهر/,
  41913. isPM: function (input) {
  41914. return /بعد از ظهر/.test(input);
  41915. },
  41916. meridiem: function (hour, minute, isLower) {
  41917. if (hour < 12) {
  41918. return 'قبل از ظهر';
  41919. } else {
  41920. return 'بعد از ظهر';
  41921. }
  41922. },
  41923. calendar: {
  41924. sameDay: '[امروز ساعت] LT',
  41925. nextDay: '[فردا ساعت] LT',
  41926. nextWeek: 'dddd [ساعت] LT',
  41927. lastDay: '[دیروز ساعت] LT',
  41928. lastWeek: 'dddd [پیش] [ساعت] LT',
  41929. sameElse: 'L',
  41930. },
  41931. relativeTime: {
  41932. future: 'در %s',
  41933. past: '%s پیش',
  41934. s: 'چند ثانیه',
  41935. ss: '%d ثانیه',
  41936. m: 'یک دقیقه',
  41937. mm: '%d دقیقه',
  41938. h: 'یک ساعت',
  41939. hh: '%d ساعت',
  41940. d: 'یک روز',
  41941. dd: '%d روز',
  41942. M: 'یک ماه',
  41943. MM: '%d ماه',
  41944. y: 'یک سال',
  41945. yy: '%d سال',
  41946. },
  41947. preparse: function (string) {
  41948. return string
  41949. .replace(/[۰-۹]/g, function (match) {
  41950. return numberMap[match];
  41951. })
  41952. .replace(/،/g, ',');
  41953. },
  41954. postformat: function (string) {
  41955. return string
  41956. .replace(/\d/g, function (match) {
  41957. return symbolMap[match];
  41958. })
  41959. .replace(/,/g, '،');
  41960. },
  41961. dayOfMonthOrdinalParse: /\d{1,2}م/,
  41962. ordinal: '%dم',
  41963. week: {
  41964. dow: 6, // Saturday is the first day of the week.
  41965. doy: 12, // The week that contains Jan 12th is the first week of the year.
  41966. },
  41967. });
  41968. return fa;
  41969. })));
  41970. /***/ }),
  41971. /***/ "./node_modules/moment/locale/fi.js":
  41972. /*!******************************************!*\
  41973. !*** ./node_modules/moment/locale/fi.js ***!
  41974. \******************************************/
  41975. /*! no static exports found */
  41976. /***/ (function(module, exports, __webpack_require__) {
  41977. //! moment.js locale configuration
  41978. //! locale : Finnish [fi]
  41979. //! author : Tarmo Aidantausta : https://github.com/bleadof
  41980. ;(function (global, factory) {
  41981. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  41982. undefined
  41983. }(this, (function (moment) { 'use strict';
  41984. //! moment.js locale configuration
  41985. var numbersPast = 'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split(
  41986. ' '
  41987. ),
  41988. numbersFuture = [
  41989. 'nolla',
  41990. 'yhden',
  41991. 'kahden',
  41992. 'kolmen',
  41993. 'neljän',
  41994. 'viiden',
  41995. 'kuuden',
  41996. numbersPast[7],
  41997. numbersPast[8],
  41998. numbersPast[9],
  41999. ];
  42000. function translate(number, withoutSuffix, key, isFuture) {
  42001. var result = '';
  42002. switch (key) {
  42003. case 's':
  42004. return isFuture ? 'muutaman sekunnin' : 'muutama sekunti';
  42005. case 'ss':
  42006. result = isFuture ? 'sekunnin' : 'sekuntia';
  42007. break;
  42008. case 'm':
  42009. return isFuture ? 'minuutin' : 'minuutti';
  42010. case 'mm':
  42011. result = isFuture ? 'minuutin' : 'minuuttia';
  42012. break;
  42013. case 'h':
  42014. return isFuture ? 'tunnin' : 'tunti';
  42015. case 'hh':
  42016. result = isFuture ? 'tunnin' : 'tuntia';
  42017. break;
  42018. case 'd':
  42019. return isFuture ? 'päivän' : 'päivä';
  42020. case 'dd':
  42021. result = isFuture ? 'päivän' : 'päivää';
  42022. break;
  42023. case 'M':
  42024. return isFuture ? 'kuukauden' : 'kuukausi';
  42025. case 'MM':
  42026. result = isFuture ? 'kuukauden' : 'kuukautta';
  42027. break;
  42028. case 'y':
  42029. return isFuture ? 'vuoden' : 'vuosi';
  42030. case 'yy':
  42031. result = isFuture ? 'vuoden' : 'vuotta';
  42032. break;
  42033. }
  42034. result = verbalNumber(number, isFuture) + ' ' + result;
  42035. return result;
  42036. }
  42037. function verbalNumber(number, isFuture) {
  42038. return number < 10
  42039. ? isFuture
  42040. ? numbersFuture[number]
  42041. : numbersPast[number]
  42042. : number;
  42043. }
  42044. var fi = moment.defineLocale('fi', {
  42045. months: 'tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu'.split(
  42046. '_'
  42047. ),
  42048. monthsShort: 'tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu'.split(
  42049. '_'
  42050. ),
  42051. weekdays: 'sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai'.split(
  42052. '_'
  42053. ),
  42054. weekdaysShort: 'su_ma_ti_ke_to_pe_la'.split('_'),
  42055. weekdaysMin: 'su_ma_ti_ke_to_pe_la'.split('_'),
  42056. longDateFormat: {
  42057. LT: 'HH.mm',
  42058. LTS: 'HH.mm.ss',
  42059. L: 'DD.MM.YYYY',
  42060. LL: 'Do MMMM[ta] YYYY',
  42061. LLL: 'Do MMMM[ta] YYYY, [klo] HH.mm',
  42062. LLLL: 'dddd, Do MMMM[ta] YYYY, [klo] HH.mm',
  42063. l: 'D.M.YYYY',
  42064. ll: 'Do MMM YYYY',
  42065. lll: 'Do MMM YYYY, [klo] HH.mm',
  42066. llll: 'ddd, Do MMM YYYY, [klo] HH.mm',
  42067. },
  42068. calendar: {
  42069. sameDay: '[tänään] [klo] LT',
  42070. nextDay: '[huomenna] [klo] LT',
  42071. nextWeek: 'dddd [klo] LT',
  42072. lastDay: '[eilen] [klo] LT',
  42073. lastWeek: '[viime] dddd[na] [klo] LT',
  42074. sameElse: 'L',
  42075. },
  42076. relativeTime: {
  42077. future: '%s päästä',
  42078. past: '%s sitten',
  42079. s: translate,
  42080. ss: translate,
  42081. m: translate,
  42082. mm: translate,
  42083. h: translate,
  42084. hh: translate,
  42085. d: translate,
  42086. dd: translate,
  42087. M: translate,
  42088. MM: translate,
  42089. y: translate,
  42090. yy: translate,
  42091. },
  42092. dayOfMonthOrdinalParse: /\d{1,2}\./,
  42093. ordinal: '%d.',
  42094. week: {
  42095. dow: 1, // Monday is the first day of the week.
  42096. doy: 4, // The week that contains Jan 4th is the first week of the year.
  42097. },
  42098. });
  42099. return fi;
  42100. })));
  42101. /***/ }),
  42102. /***/ "./node_modules/moment/locale/fil.js":
  42103. /*!*******************************************!*\
  42104. !*** ./node_modules/moment/locale/fil.js ***!
  42105. \*******************************************/
  42106. /*! no static exports found */
  42107. /***/ (function(module, exports, __webpack_require__) {
  42108. //! moment.js locale configuration
  42109. //! locale : Filipino [fil]
  42110. //! author : Dan Hagman : https://github.com/hagmandan
  42111. //! author : Matthew Co : https://github.com/matthewdeeco
  42112. ;(function (global, factory) {
  42113. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  42114. undefined
  42115. }(this, (function (moment) { 'use strict';
  42116. //! moment.js locale configuration
  42117. var fil = moment.defineLocale('fil', {
  42118. months: 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split(
  42119. '_'
  42120. ),
  42121. monthsShort: 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'),
  42122. weekdays: 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split(
  42123. '_'
  42124. ),
  42125. weekdaysShort: 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'),
  42126. weekdaysMin: 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'),
  42127. longDateFormat: {
  42128. LT: 'HH:mm',
  42129. LTS: 'HH:mm:ss',
  42130. L: 'MM/D/YYYY',
  42131. LL: 'MMMM D, YYYY',
  42132. LLL: 'MMMM D, YYYY HH:mm',
  42133. LLLL: 'dddd, MMMM DD, YYYY HH:mm',
  42134. },
  42135. calendar: {
  42136. sameDay: 'LT [ngayong araw]',
  42137. nextDay: '[Bukas ng] LT',
  42138. nextWeek: 'LT [sa susunod na] dddd',
  42139. lastDay: 'LT [kahapon]',
  42140. lastWeek: 'LT [noong nakaraang] dddd',
  42141. sameElse: 'L',
  42142. },
  42143. relativeTime: {
  42144. future: 'sa loob ng %s',
  42145. past: '%s ang nakalipas',
  42146. s: 'ilang segundo',
  42147. ss: '%d segundo',
  42148. m: 'isang minuto',
  42149. mm: '%d minuto',
  42150. h: 'isang oras',
  42151. hh: '%d oras',
  42152. d: 'isang araw',
  42153. dd: '%d araw',
  42154. M: 'isang buwan',
  42155. MM: '%d buwan',
  42156. y: 'isang taon',
  42157. yy: '%d taon',
  42158. },
  42159. dayOfMonthOrdinalParse: /\d{1,2}/,
  42160. ordinal: function (number) {
  42161. return number;
  42162. },
  42163. week: {
  42164. dow: 1, // Monday is the first day of the week.
  42165. doy: 4, // The week that contains Jan 4th is the first week of the year.
  42166. },
  42167. });
  42168. return fil;
  42169. })));
  42170. /***/ }),
  42171. /***/ "./node_modules/moment/locale/fo.js":
  42172. /*!******************************************!*\
  42173. !*** ./node_modules/moment/locale/fo.js ***!
  42174. \******************************************/
  42175. /*! no static exports found */
  42176. /***/ (function(module, exports, __webpack_require__) {
  42177. //! moment.js locale configuration
  42178. //! locale : Faroese [fo]
  42179. //! author : Ragnar Johannesen : https://github.com/ragnar123
  42180. //! author : Kristian Sakarisson : https://github.com/sakarisson
  42181. ;(function (global, factory) {
  42182. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  42183. undefined
  42184. }(this, (function (moment) { 'use strict';
  42185. //! moment.js locale configuration
  42186. var fo = moment.defineLocale('fo', {
  42187. months: 'januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember'.split(
  42188. '_'
  42189. ),
  42190. monthsShort: 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),
  42191. weekdays: 'sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur'.split(
  42192. '_'
  42193. ),
  42194. weekdaysShort: 'sun_mán_týs_mik_hós_frí_ley'.split('_'),
  42195. weekdaysMin: 'su_má_tý_mi_hó_fr_le'.split('_'),
  42196. longDateFormat: {
  42197. LT: 'HH:mm',
  42198. LTS: 'HH:mm:ss',
  42199. L: 'DD/MM/YYYY',
  42200. LL: 'D MMMM YYYY',
  42201. LLL: 'D MMMM YYYY HH:mm',
  42202. LLLL: 'dddd D. MMMM, YYYY HH:mm',
  42203. },
  42204. calendar: {
  42205. sameDay: '[Í dag kl.] LT',
  42206. nextDay: '[Í morgin kl.] LT',
  42207. nextWeek: 'dddd [kl.] LT',
  42208. lastDay: '[Í gjár kl.] LT',
  42209. lastWeek: '[síðstu] dddd [kl] LT',
  42210. sameElse: 'L',
  42211. },
  42212. relativeTime: {
  42213. future: 'um %s',
  42214. past: '%s síðani',
  42215. s: 'fá sekund',
  42216. ss: '%d sekundir',
  42217. m: 'ein minuttur',
  42218. mm: '%d minuttir',
  42219. h: 'ein tími',
  42220. hh: '%d tímar',
  42221. d: 'ein dagur',
  42222. dd: '%d dagar',
  42223. M: 'ein mánaður',
  42224. MM: '%d mánaðir',
  42225. y: 'eitt ár',
  42226. yy: '%d ár',
  42227. },
  42228. dayOfMonthOrdinalParse: /\d{1,2}\./,
  42229. ordinal: '%d.',
  42230. week: {
  42231. dow: 1, // Monday is the first day of the week.
  42232. doy: 4, // The week that contains Jan 4th is the first week of the year.
  42233. },
  42234. });
  42235. return fo;
  42236. })));
  42237. /***/ }),
  42238. /***/ "./node_modules/moment/locale/fr-ca.js":
  42239. /*!*********************************************!*\
  42240. !*** ./node_modules/moment/locale/fr-ca.js ***!
  42241. \*********************************************/
  42242. /*! no static exports found */
  42243. /***/ (function(module, exports, __webpack_require__) {
  42244. //! moment.js locale configuration
  42245. //! locale : French (Canada) [fr-ca]
  42246. //! author : Jonathan Abourbih : https://github.com/jonbca
  42247. ;(function (global, factory) {
  42248. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  42249. undefined
  42250. }(this, (function (moment) { 'use strict';
  42251. //! moment.js locale configuration
  42252. var frCa = moment.defineLocale('fr-ca', {
  42253. months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split(
  42254. '_'
  42255. ),
  42256. monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split(
  42257. '_'
  42258. ),
  42259. monthsParseExact: true,
  42260. weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
  42261. weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
  42262. weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),
  42263. weekdaysParseExact: true,
  42264. longDateFormat: {
  42265. LT: 'HH:mm',
  42266. LTS: 'HH:mm:ss',
  42267. L: 'YYYY-MM-DD',
  42268. LL: 'D MMMM YYYY',
  42269. LLL: 'D MMMM YYYY HH:mm',
  42270. LLLL: 'dddd D MMMM YYYY HH:mm',
  42271. },
  42272. calendar: {
  42273. sameDay: '[Aujourd’hui à] LT',
  42274. nextDay: '[Demain à] LT',
  42275. nextWeek: 'dddd [à] LT',
  42276. lastDay: '[Hier à] LT',
  42277. lastWeek: 'dddd [dernier à] LT',
  42278. sameElse: 'L',
  42279. },
  42280. relativeTime: {
  42281. future: 'dans %s',
  42282. past: 'il y a %s',
  42283. s: 'quelques secondes',
  42284. ss: '%d secondes',
  42285. m: 'une minute',
  42286. mm: '%d minutes',
  42287. h: 'une heure',
  42288. hh: '%d heures',
  42289. d: 'un jour',
  42290. dd: '%d jours',
  42291. M: 'un mois',
  42292. MM: '%d mois',
  42293. y: 'un an',
  42294. yy: '%d ans',
  42295. },
  42296. dayOfMonthOrdinalParse: /\d{1,2}(er|e)/,
  42297. ordinal: function (number, period) {
  42298. switch (period) {
  42299. // Words with masculine grammatical gender: mois, trimestre, jour
  42300. default:
  42301. case 'M':
  42302. case 'Q':
  42303. case 'D':
  42304. case 'DDD':
  42305. case 'd':
  42306. return number + (number === 1 ? 'er' : 'e');
  42307. // Words with feminine grammatical gender: semaine
  42308. case 'w':
  42309. case 'W':
  42310. return number + (number === 1 ? 're' : 'e');
  42311. }
  42312. },
  42313. });
  42314. return frCa;
  42315. })));
  42316. /***/ }),
  42317. /***/ "./node_modules/moment/locale/fr-ch.js":
  42318. /*!*********************************************!*\
  42319. !*** ./node_modules/moment/locale/fr-ch.js ***!
  42320. \*********************************************/
  42321. /*! no static exports found */
  42322. /***/ (function(module, exports, __webpack_require__) {
  42323. //! moment.js locale configuration
  42324. //! locale : French (Switzerland) [fr-ch]
  42325. //! author : Gaspard Bucher : https://github.com/gaspard
  42326. ;(function (global, factory) {
  42327. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  42328. undefined
  42329. }(this, (function (moment) { 'use strict';
  42330. //! moment.js locale configuration
  42331. var frCh = moment.defineLocale('fr-ch', {
  42332. months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split(
  42333. '_'
  42334. ),
  42335. monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split(
  42336. '_'
  42337. ),
  42338. monthsParseExact: true,
  42339. weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
  42340. weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
  42341. weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),
  42342. weekdaysParseExact: true,
  42343. longDateFormat: {
  42344. LT: 'HH:mm',
  42345. LTS: 'HH:mm:ss',
  42346. L: 'DD.MM.YYYY',
  42347. LL: 'D MMMM YYYY',
  42348. LLL: 'D MMMM YYYY HH:mm',
  42349. LLLL: 'dddd D MMMM YYYY HH:mm',
  42350. },
  42351. calendar: {
  42352. sameDay: '[Aujourd’hui à] LT',
  42353. nextDay: '[Demain à] LT',
  42354. nextWeek: 'dddd [à] LT',
  42355. lastDay: '[Hier à] LT',
  42356. lastWeek: 'dddd [dernier à] LT',
  42357. sameElse: 'L',
  42358. },
  42359. relativeTime: {
  42360. future: 'dans %s',
  42361. past: 'il y a %s',
  42362. s: 'quelques secondes',
  42363. ss: '%d secondes',
  42364. m: 'une minute',
  42365. mm: '%d minutes',
  42366. h: 'une heure',
  42367. hh: '%d heures',
  42368. d: 'un jour',
  42369. dd: '%d jours',
  42370. M: 'un mois',
  42371. MM: '%d mois',
  42372. y: 'un an',
  42373. yy: '%d ans',
  42374. },
  42375. dayOfMonthOrdinalParse: /\d{1,2}(er|e)/,
  42376. ordinal: function (number, period) {
  42377. switch (period) {
  42378. // Words with masculine grammatical gender: mois, trimestre, jour
  42379. default:
  42380. case 'M':
  42381. case 'Q':
  42382. case 'D':
  42383. case 'DDD':
  42384. case 'd':
  42385. return number + (number === 1 ? 'er' : 'e');
  42386. // Words with feminine grammatical gender: semaine
  42387. case 'w':
  42388. case 'W':
  42389. return number + (number === 1 ? 're' : 'e');
  42390. }
  42391. },
  42392. week: {
  42393. dow: 1, // Monday is the first day of the week.
  42394. doy: 4, // The week that contains Jan 4th is the first week of the year.
  42395. },
  42396. });
  42397. return frCh;
  42398. })));
  42399. /***/ }),
  42400. /***/ "./node_modules/moment/locale/fr.js":
  42401. /*!******************************************!*\
  42402. !*** ./node_modules/moment/locale/fr.js ***!
  42403. \******************************************/
  42404. /*! no static exports found */
  42405. /***/ (function(module, exports, __webpack_require__) {
  42406. //! moment.js locale configuration
  42407. //! locale : French [fr]
  42408. //! author : John Fischer : https://github.com/jfroffice
  42409. ;(function (global, factory) {
  42410. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  42411. undefined
  42412. }(this, (function (moment) { 'use strict';
  42413. //! moment.js locale configuration
  42414. var monthsStrictRegex = /^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,
  42415. monthsShortStrictRegex = /(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?)/i,
  42416. monthsRegex = /(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,
  42417. monthsParse = [
  42418. /^janv/i,
  42419. /^févr/i,
  42420. /^mars/i,
  42421. /^avr/i,
  42422. /^mai/i,
  42423. /^juin/i,
  42424. /^juil/i,
  42425. /^août/i,
  42426. /^sept/i,
  42427. /^oct/i,
  42428. /^nov/i,
  42429. /^déc/i,
  42430. ];
  42431. var fr = moment.defineLocale('fr', {
  42432. months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split(
  42433. '_'
  42434. ),
  42435. monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split(
  42436. '_'
  42437. ),
  42438. monthsRegex: monthsRegex,
  42439. monthsShortRegex: monthsRegex,
  42440. monthsStrictRegex: monthsStrictRegex,
  42441. monthsShortStrictRegex: monthsShortStrictRegex,
  42442. monthsParse: monthsParse,
  42443. longMonthsParse: monthsParse,
  42444. shortMonthsParse: monthsParse,
  42445. weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
  42446. weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
  42447. weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),
  42448. weekdaysParseExact: true,
  42449. longDateFormat: {
  42450. LT: 'HH:mm',
  42451. LTS: 'HH:mm:ss',
  42452. L: 'DD/MM/YYYY',
  42453. LL: 'D MMMM YYYY',
  42454. LLL: 'D MMMM YYYY HH:mm',
  42455. LLLL: 'dddd D MMMM YYYY HH:mm',
  42456. },
  42457. calendar: {
  42458. sameDay: '[Aujourd’hui à] LT',
  42459. nextDay: '[Demain à] LT',
  42460. nextWeek: 'dddd [à] LT',
  42461. lastDay: '[Hier à] LT',
  42462. lastWeek: 'dddd [dernier à] LT',
  42463. sameElse: 'L',
  42464. },
  42465. relativeTime: {
  42466. future: 'dans %s',
  42467. past: 'il y a %s',
  42468. s: 'quelques secondes',
  42469. ss: '%d secondes',
  42470. m: 'une minute',
  42471. mm: '%d minutes',
  42472. h: 'une heure',
  42473. hh: '%d heures',
  42474. d: 'un jour',
  42475. dd: '%d jours',
  42476. M: 'un mois',
  42477. MM: '%d mois',
  42478. y: 'un an',
  42479. yy: '%d ans',
  42480. },
  42481. dayOfMonthOrdinalParse: /\d{1,2}(er|)/,
  42482. ordinal: function (number, period) {
  42483. switch (period) {
  42484. // TODO: Return 'e' when day of month > 1. Move this case inside
  42485. // block for masculine words below.
  42486. // See https://github.com/moment/moment/issues/3375
  42487. case 'D':
  42488. return number + (number === 1 ? 'er' : '');
  42489. // Words with masculine grammatical gender: mois, trimestre, jour
  42490. default:
  42491. case 'M':
  42492. case 'Q':
  42493. case 'DDD':
  42494. case 'd':
  42495. return number + (number === 1 ? 'er' : 'e');
  42496. // Words with feminine grammatical gender: semaine
  42497. case 'w':
  42498. case 'W':
  42499. return number + (number === 1 ? 're' : 'e');
  42500. }
  42501. },
  42502. week: {
  42503. dow: 1, // Monday is the first day of the week.
  42504. doy: 4, // The week that contains Jan 4th is the first week of the year.
  42505. },
  42506. });
  42507. return fr;
  42508. })));
  42509. /***/ }),
  42510. /***/ "./node_modules/moment/locale/fy.js":
  42511. /*!******************************************!*\
  42512. !*** ./node_modules/moment/locale/fy.js ***!
  42513. \******************************************/
  42514. /*! no static exports found */
  42515. /***/ (function(module, exports, __webpack_require__) {
  42516. //! moment.js locale configuration
  42517. //! locale : Frisian [fy]
  42518. //! author : Robin van der Vliet : https://github.com/robin0van0der0v
  42519. ;(function (global, factory) {
  42520. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  42521. undefined
  42522. }(this, (function (moment) { 'use strict';
  42523. //! moment.js locale configuration
  42524. var monthsShortWithDots = 'jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.'.split(
  42525. '_'
  42526. ),
  42527. monthsShortWithoutDots = 'jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des'.split(
  42528. '_'
  42529. );
  42530. var fy = moment.defineLocale('fy', {
  42531. months: 'jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber'.split(
  42532. '_'
  42533. ),
  42534. monthsShort: function (m, format) {
  42535. if (!m) {
  42536. return monthsShortWithDots;
  42537. } else if (/-MMM-/.test(format)) {
  42538. return monthsShortWithoutDots[m.month()];
  42539. } else {
  42540. return monthsShortWithDots[m.month()];
  42541. }
  42542. },
  42543. monthsParseExact: true,
  42544. weekdays: 'snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon'.split(
  42545. '_'
  42546. ),
  42547. weekdaysShort: 'si._mo._ti._wo._to._fr._so.'.split('_'),
  42548. weekdaysMin: 'Si_Mo_Ti_Wo_To_Fr_So'.split('_'),
  42549. weekdaysParseExact: true,
  42550. longDateFormat: {
  42551. LT: 'HH:mm',
  42552. LTS: 'HH:mm:ss',
  42553. L: 'DD-MM-YYYY',
  42554. LL: 'D MMMM YYYY',
  42555. LLL: 'D MMMM YYYY HH:mm',
  42556. LLLL: 'dddd D MMMM YYYY HH:mm',
  42557. },
  42558. calendar: {
  42559. sameDay: '[hjoed om] LT',
  42560. nextDay: '[moarn om] LT',
  42561. nextWeek: 'dddd [om] LT',
  42562. lastDay: '[juster om] LT',
  42563. lastWeek: '[ôfrûne] dddd [om] LT',
  42564. sameElse: 'L',
  42565. },
  42566. relativeTime: {
  42567. future: 'oer %s',
  42568. past: '%s lyn',
  42569. s: 'in pear sekonden',
  42570. ss: '%d sekonden',
  42571. m: 'ien minút',
  42572. mm: '%d minuten',
  42573. h: 'ien oere',
  42574. hh: '%d oeren',
  42575. d: 'ien dei',
  42576. dd: '%d dagen',
  42577. M: 'ien moanne',
  42578. MM: '%d moannen',
  42579. y: 'ien jier',
  42580. yy: '%d jierren',
  42581. },
  42582. dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
  42583. ordinal: function (number) {
  42584. return (
  42585. number +
  42586. (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de')
  42587. );
  42588. },
  42589. week: {
  42590. dow: 1, // Monday is the first day of the week.
  42591. doy: 4, // The week that contains Jan 4th is the first week of the year.
  42592. },
  42593. });
  42594. return fy;
  42595. })));
  42596. /***/ }),
  42597. /***/ "./node_modules/moment/locale/ga.js":
  42598. /*!******************************************!*\
  42599. !*** ./node_modules/moment/locale/ga.js ***!
  42600. \******************************************/
  42601. /*! no static exports found */
  42602. /***/ (function(module, exports, __webpack_require__) {
  42603. //! moment.js locale configuration
  42604. //! locale : Irish or Irish Gaelic [ga]
  42605. //! author : André Silva : https://github.com/askpt
  42606. ;(function (global, factory) {
  42607. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  42608. undefined
  42609. }(this, (function (moment) { 'use strict';
  42610. //! moment.js locale configuration
  42611. var months = [
  42612. 'Eanáir',
  42613. 'Feabhra',
  42614. 'Márta',
  42615. 'Aibreán',
  42616. 'Bealtaine',
  42617. 'Meitheamh',
  42618. 'Iúil',
  42619. 'Lúnasa',
  42620. 'Meán Fómhair',
  42621. 'Deireadh Fómhair',
  42622. 'Samhain',
  42623. 'Nollaig',
  42624. ],
  42625. monthsShort = [
  42626. 'Ean',
  42627. 'Feabh',
  42628. 'Márt',
  42629. 'Aib',
  42630. 'Beal',
  42631. 'Meith',
  42632. 'Iúil',
  42633. 'Lún',
  42634. 'M.F.',
  42635. 'D.F.',
  42636. 'Samh',
  42637. 'Noll',
  42638. ],
  42639. weekdays = [
  42640. 'Dé Domhnaigh',
  42641. 'Dé Luain',
  42642. 'Dé Máirt',
  42643. 'Dé Céadaoin',
  42644. 'Déardaoin',
  42645. 'Dé hAoine',
  42646. 'Dé Sathairn',
  42647. ],
  42648. weekdaysShort = ['Domh', 'Luan', 'Máirt', 'Céad', 'Déar', 'Aoine', 'Sath'],
  42649. weekdaysMin = ['Do', 'Lu', 'Má', 'Cé', 'Dé', 'A', 'Sa'];
  42650. var ga = moment.defineLocale('ga', {
  42651. months: months,
  42652. monthsShort: monthsShort,
  42653. monthsParseExact: true,
  42654. weekdays: weekdays,
  42655. weekdaysShort: weekdaysShort,
  42656. weekdaysMin: weekdaysMin,
  42657. longDateFormat: {
  42658. LT: 'HH:mm',
  42659. LTS: 'HH:mm:ss',
  42660. L: 'DD/MM/YYYY',
  42661. LL: 'D MMMM YYYY',
  42662. LLL: 'D MMMM YYYY HH:mm',
  42663. LLLL: 'dddd, D MMMM YYYY HH:mm',
  42664. },
  42665. calendar: {
  42666. sameDay: '[Inniu ag] LT',
  42667. nextDay: '[Amárach ag] LT',
  42668. nextWeek: 'dddd [ag] LT',
  42669. lastDay: '[Inné ag] LT',
  42670. lastWeek: 'dddd [seo caite] [ag] LT',
  42671. sameElse: 'L',
  42672. },
  42673. relativeTime: {
  42674. future: 'i %s',
  42675. past: '%s ó shin',
  42676. s: 'cúpla soicind',
  42677. ss: '%d soicind',
  42678. m: 'nóiméad',
  42679. mm: '%d nóiméad',
  42680. h: 'uair an chloig',
  42681. hh: '%d uair an chloig',
  42682. d: 'lá',
  42683. dd: '%d lá',
  42684. M: 'mí',
  42685. MM: '%d míonna',
  42686. y: 'bliain',
  42687. yy: '%d bliain',
  42688. },
  42689. dayOfMonthOrdinalParse: /\d{1,2}(d|na|mh)/,
  42690. ordinal: function (number) {
  42691. var output = number === 1 ? 'd' : number % 10 === 2 ? 'na' : 'mh';
  42692. return number + output;
  42693. },
  42694. week: {
  42695. dow: 1, // Monday is the first day of the week.
  42696. doy: 4, // The week that contains Jan 4th is the first week of the year.
  42697. },
  42698. });
  42699. return ga;
  42700. })));
  42701. /***/ }),
  42702. /***/ "./node_modules/moment/locale/gd.js":
  42703. /*!******************************************!*\
  42704. !*** ./node_modules/moment/locale/gd.js ***!
  42705. \******************************************/
  42706. /*! no static exports found */
  42707. /***/ (function(module, exports, __webpack_require__) {
  42708. //! moment.js locale configuration
  42709. //! locale : Scottish Gaelic [gd]
  42710. //! author : Jon Ashdown : https://github.com/jonashdown
  42711. ;(function (global, factory) {
  42712. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  42713. undefined
  42714. }(this, (function (moment) { 'use strict';
  42715. //! moment.js locale configuration
  42716. var months = [
  42717. 'Am Faoilleach',
  42718. 'An Gearran',
  42719. 'Am Màrt',
  42720. 'An Giblean',
  42721. 'An Cèitean',
  42722. 'An t-Ògmhios',
  42723. 'An t-Iuchar',
  42724. 'An Lùnastal',
  42725. 'An t-Sultain',
  42726. 'An Dàmhair',
  42727. 'An t-Samhain',
  42728. 'An Dùbhlachd',
  42729. ],
  42730. monthsShort = [
  42731. 'Faoi',
  42732. 'Gear',
  42733. 'Màrt',
  42734. 'Gibl',
  42735. 'Cèit',
  42736. 'Ògmh',
  42737. 'Iuch',
  42738. 'Lùn',
  42739. 'Sult',
  42740. 'Dàmh',
  42741. 'Samh',
  42742. 'Dùbh',
  42743. ],
  42744. weekdays = [
  42745. 'Didòmhnaich',
  42746. 'Diluain',
  42747. 'Dimàirt',
  42748. 'Diciadain',
  42749. 'Diardaoin',
  42750. 'Dihaoine',
  42751. 'Disathairne',
  42752. ],
  42753. weekdaysShort = ['Did', 'Dil', 'Dim', 'Dic', 'Dia', 'Dih', 'Dis'],
  42754. weekdaysMin = ['Dò', 'Lu', 'Mà', 'Ci', 'Ar', 'Ha', 'Sa'];
  42755. var gd = moment.defineLocale('gd', {
  42756. months: months,
  42757. monthsShort: monthsShort,
  42758. monthsParseExact: true,
  42759. weekdays: weekdays,
  42760. weekdaysShort: weekdaysShort,
  42761. weekdaysMin: weekdaysMin,
  42762. longDateFormat: {
  42763. LT: 'HH:mm',
  42764. LTS: 'HH:mm:ss',
  42765. L: 'DD/MM/YYYY',
  42766. LL: 'D MMMM YYYY',
  42767. LLL: 'D MMMM YYYY HH:mm',
  42768. LLLL: 'dddd, D MMMM YYYY HH:mm',
  42769. },
  42770. calendar: {
  42771. sameDay: '[An-diugh aig] LT',
  42772. nextDay: '[A-màireach aig] LT',
  42773. nextWeek: 'dddd [aig] LT',
  42774. lastDay: '[An-dè aig] LT',
  42775. lastWeek: 'dddd [seo chaidh] [aig] LT',
  42776. sameElse: 'L',
  42777. },
  42778. relativeTime: {
  42779. future: 'ann an %s',
  42780. past: 'bho chionn %s',
  42781. s: 'beagan diogan',
  42782. ss: '%d diogan',
  42783. m: 'mionaid',
  42784. mm: '%d mionaidean',
  42785. h: 'uair',
  42786. hh: '%d uairean',
  42787. d: 'latha',
  42788. dd: '%d latha',
  42789. M: 'mìos',
  42790. MM: '%d mìosan',
  42791. y: 'bliadhna',
  42792. yy: '%d bliadhna',
  42793. },
  42794. dayOfMonthOrdinalParse: /\d{1,2}(d|na|mh)/,
  42795. ordinal: function (number) {
  42796. var output = number === 1 ? 'd' : number % 10 === 2 ? 'na' : 'mh';
  42797. return number + output;
  42798. },
  42799. week: {
  42800. dow: 1, // Monday is the first day of the week.
  42801. doy: 4, // The week that contains Jan 4th is the first week of the year.
  42802. },
  42803. });
  42804. return gd;
  42805. })));
  42806. /***/ }),
  42807. /***/ "./node_modules/moment/locale/gl.js":
  42808. /*!******************************************!*\
  42809. !*** ./node_modules/moment/locale/gl.js ***!
  42810. \******************************************/
  42811. /*! no static exports found */
  42812. /***/ (function(module, exports, __webpack_require__) {
  42813. //! moment.js locale configuration
  42814. //! locale : Galician [gl]
  42815. //! author : Juan G. Hurtado : https://github.com/juanghurtado
  42816. ;(function (global, factory) {
  42817. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  42818. undefined
  42819. }(this, (function (moment) { 'use strict';
  42820. //! moment.js locale configuration
  42821. var gl = moment.defineLocale('gl', {
  42822. months: 'xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro'.split(
  42823. '_'
  42824. ),
  42825. monthsShort: 'xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.'.split(
  42826. '_'
  42827. ),
  42828. monthsParseExact: true,
  42829. weekdays: 'domingo_luns_martes_mércores_xoves_venres_sábado'.split('_'),
  42830. weekdaysShort: 'dom._lun._mar._mér._xov._ven._sáb.'.split('_'),
  42831. weekdaysMin: 'do_lu_ma_mé_xo_ve_sá'.split('_'),
  42832. weekdaysParseExact: true,
  42833. longDateFormat: {
  42834. LT: 'H:mm',
  42835. LTS: 'H:mm:ss',
  42836. L: 'DD/MM/YYYY',
  42837. LL: 'D [de] MMMM [de] YYYY',
  42838. LLL: 'D [de] MMMM [de] YYYY H:mm',
  42839. LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm',
  42840. },
  42841. calendar: {
  42842. sameDay: function () {
  42843. return '[hoxe ' + (this.hours() !== 1 ? 'ás' : 'á') + '] LT';
  42844. },
  42845. nextDay: function () {
  42846. return '[mañá ' + (this.hours() !== 1 ? 'ás' : 'á') + '] LT';
  42847. },
  42848. nextWeek: function () {
  42849. return 'dddd [' + (this.hours() !== 1 ? 'ás' : 'a') + '] LT';
  42850. },
  42851. lastDay: function () {
  42852. return '[onte ' + (this.hours() !== 1 ? 'á' : 'a') + '] LT';
  42853. },
  42854. lastWeek: function () {
  42855. return (
  42856. '[o] dddd [pasado ' + (this.hours() !== 1 ? 'ás' : 'a') + '] LT'
  42857. );
  42858. },
  42859. sameElse: 'L',
  42860. },
  42861. relativeTime: {
  42862. future: function (str) {
  42863. if (str.indexOf('un') === 0) {
  42864. return 'n' + str;
  42865. }
  42866. return 'en ' + str;
  42867. },
  42868. past: 'hai %s',
  42869. s: 'uns segundos',
  42870. ss: '%d segundos',
  42871. m: 'un minuto',
  42872. mm: '%d minutos',
  42873. h: 'unha hora',
  42874. hh: '%d horas',
  42875. d: 'un día',
  42876. dd: '%d días',
  42877. M: 'un mes',
  42878. MM: '%d meses',
  42879. y: 'un ano',
  42880. yy: '%d anos',
  42881. },
  42882. dayOfMonthOrdinalParse: /\d{1,2}º/,
  42883. ordinal: '%dº',
  42884. week: {
  42885. dow: 1, // Monday is the first day of the week.
  42886. doy: 4, // The week that contains Jan 4th is the first week of the year.
  42887. },
  42888. });
  42889. return gl;
  42890. })));
  42891. /***/ }),
  42892. /***/ "./node_modules/moment/locale/gom-deva.js":
  42893. /*!************************************************!*\
  42894. !*** ./node_modules/moment/locale/gom-deva.js ***!
  42895. \************************************************/
  42896. /*! no static exports found */
  42897. /***/ (function(module, exports, __webpack_require__) {
  42898. //! moment.js locale configuration
  42899. //! locale : Konkani Devanagari script [gom-deva]
  42900. //! author : The Discoverer : https://github.com/WikiDiscoverer
  42901. ;(function (global, factory) {
  42902. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  42903. undefined
  42904. }(this, (function (moment) { 'use strict';
  42905. //! moment.js locale configuration
  42906. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  42907. var format = {
  42908. s: ['थोडया सॅकंडांनी', 'थोडे सॅकंड'],
  42909. ss: [number + ' सॅकंडांनी', number + ' सॅकंड'],
  42910. m: ['एका मिणटान', 'एक मिनूट'],
  42911. mm: [number + ' मिणटांनी', number + ' मिणटां'],
  42912. h: ['एका वरान', 'एक वर'],
  42913. hh: [number + ' वरांनी', number + ' वरां'],
  42914. d: ['एका दिसान', 'एक दीस'],
  42915. dd: [number + ' दिसांनी', number + ' दीस'],
  42916. M: ['एका म्हयन्यान', 'एक म्हयनो'],
  42917. MM: [number + ' म्हयन्यानी', number + ' म्हयने'],
  42918. y: ['एका वर्सान', 'एक वर्स'],
  42919. yy: [number + ' वर्सांनी', number + ' वर्सां'],
  42920. };
  42921. return isFuture ? format[key][0] : format[key][1];
  42922. }
  42923. var gomDeva = moment.defineLocale('gom-deva', {
  42924. months: {
  42925. standalone: 'जानेवारी_फेब्रुवारी_मार्च_एप्रील_मे_जून_जुलय_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split(
  42926. '_'
  42927. ),
  42928. format: 'जानेवारीच्या_फेब्रुवारीच्या_मार्चाच्या_एप्रीलाच्या_मेयाच्या_जूनाच्या_जुलयाच्या_ऑगस्टाच्या_सप्टेंबराच्या_ऑक्टोबराच्या_नोव्हेंबराच्या_डिसेंबराच्या'.split(
  42929. '_'
  42930. ),
  42931. isFormat: /MMMM(\s)+D[oD]?/,
  42932. },
  42933. monthsShort: 'जाने._फेब्रु._मार्च_एप्री._मे_जून_जुल._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split(
  42934. '_'
  42935. ),
  42936. monthsParseExact: true,
  42937. weekdays: 'आयतार_सोमार_मंगळार_बुधवार_बिरेस्तार_सुक्रार_शेनवार'.split('_'),
  42938. weekdaysShort: 'आयत._सोम._मंगळ._बुध._ब्रेस्त._सुक्र._शेन.'.split('_'),
  42939. weekdaysMin: 'आ_सो_मं_बु_ब्रे_सु_शे'.split('_'),
  42940. weekdaysParseExact: true,
  42941. longDateFormat: {
  42942. LT: 'A h:mm [वाजतां]',
  42943. LTS: 'A h:mm:ss [वाजतां]',
  42944. L: 'DD-MM-YYYY',
  42945. LL: 'D MMMM YYYY',
  42946. LLL: 'D MMMM YYYY A h:mm [वाजतां]',
  42947. LLLL: 'dddd, MMMM Do, YYYY, A h:mm [वाजतां]',
  42948. llll: 'ddd, D MMM YYYY, A h:mm [वाजतां]',
  42949. },
  42950. calendar: {
  42951. sameDay: '[आयज] LT',
  42952. nextDay: '[फाल्यां] LT',
  42953. nextWeek: '[फुडलो] dddd[,] LT',
  42954. lastDay: '[काल] LT',
  42955. lastWeek: '[फाटलो] dddd[,] LT',
  42956. sameElse: 'L',
  42957. },
  42958. relativeTime: {
  42959. future: '%s',
  42960. past: '%s आदीं',
  42961. s: processRelativeTime,
  42962. ss: processRelativeTime,
  42963. m: processRelativeTime,
  42964. mm: processRelativeTime,
  42965. h: processRelativeTime,
  42966. hh: processRelativeTime,
  42967. d: processRelativeTime,
  42968. dd: processRelativeTime,
  42969. M: processRelativeTime,
  42970. MM: processRelativeTime,
  42971. y: processRelativeTime,
  42972. yy: processRelativeTime,
  42973. },
  42974. dayOfMonthOrdinalParse: /\d{1,2}(वेर)/,
  42975. ordinal: function (number, period) {
  42976. switch (period) {
  42977. // the ordinal 'वेर' only applies to day of the month
  42978. case 'D':
  42979. return number + 'वेर';
  42980. default:
  42981. case 'M':
  42982. case 'Q':
  42983. case 'DDD':
  42984. case 'd':
  42985. case 'w':
  42986. case 'W':
  42987. return number;
  42988. }
  42989. },
  42990. week: {
  42991. dow: 0, // Sunday is the first day of the week
  42992. doy: 3, // The week that contains Jan 4th is the first week of the year (7 + 0 - 4)
  42993. },
  42994. meridiemParse: /राती|सकाळीं|दनपारां|सांजे/,
  42995. meridiemHour: function (hour, meridiem) {
  42996. if (hour === 12) {
  42997. hour = 0;
  42998. }
  42999. if (meridiem === 'राती') {
  43000. return hour < 4 ? hour : hour + 12;
  43001. } else if (meridiem === 'सकाळीं') {
  43002. return hour;
  43003. } else if (meridiem === 'दनपारां') {
  43004. return hour > 12 ? hour : hour + 12;
  43005. } else if (meridiem === 'सांजे') {
  43006. return hour + 12;
  43007. }
  43008. },
  43009. meridiem: function (hour, minute, isLower) {
  43010. if (hour < 4) {
  43011. return 'राती';
  43012. } else if (hour < 12) {
  43013. return 'सकाळीं';
  43014. } else if (hour < 16) {
  43015. return 'दनपारां';
  43016. } else if (hour < 20) {
  43017. return 'सांजे';
  43018. } else {
  43019. return 'राती';
  43020. }
  43021. },
  43022. });
  43023. return gomDeva;
  43024. })));
  43025. /***/ }),
  43026. /***/ "./node_modules/moment/locale/gom-latn.js":
  43027. /*!************************************************!*\
  43028. !*** ./node_modules/moment/locale/gom-latn.js ***!
  43029. \************************************************/
  43030. /*! no static exports found */
  43031. /***/ (function(module, exports, __webpack_require__) {
  43032. //! moment.js locale configuration
  43033. //! locale : Konkani Latin script [gom-latn]
  43034. //! author : The Discoverer : https://github.com/WikiDiscoverer
  43035. ;(function (global, factory) {
  43036. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  43037. undefined
  43038. }(this, (function (moment) { 'use strict';
  43039. //! moment.js locale configuration
  43040. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  43041. var format = {
  43042. s: ['thoddea sekondamni', 'thodde sekond'],
  43043. ss: [number + ' sekondamni', number + ' sekond'],
  43044. m: ['eka mintan', 'ek minut'],
  43045. mm: [number + ' mintamni', number + ' mintam'],
  43046. h: ['eka voran', 'ek vor'],
  43047. hh: [number + ' voramni', number + ' voram'],
  43048. d: ['eka disan', 'ek dis'],
  43049. dd: [number + ' disamni', number + ' dis'],
  43050. M: ['eka mhoinean', 'ek mhoino'],
  43051. MM: [number + ' mhoineamni', number + ' mhoine'],
  43052. y: ['eka vorsan', 'ek voros'],
  43053. yy: [number + ' vorsamni', number + ' vorsam'],
  43054. };
  43055. return isFuture ? format[key][0] : format[key][1];
  43056. }
  43057. var gomLatn = moment.defineLocale('gom-latn', {
  43058. months: {
  43059. standalone: 'Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr'.split(
  43060. '_'
  43061. ),
  43062. format: 'Janerachea_Febrerachea_Marsachea_Abrilachea_Maiachea_Junachea_Julaiachea_Agostachea_Setembrachea_Otubrachea_Novembrachea_Dezembrachea'.split(
  43063. '_'
  43064. ),
  43065. isFormat: /MMMM(\s)+D[oD]?/,
  43066. },
  43067. monthsShort: 'Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.'.split(
  43068. '_'
  43069. ),
  43070. monthsParseExact: true,
  43071. weekdays: "Aitar_Somar_Mongllar_Budhvar_Birestar_Sukrar_Son'var".split('_'),
  43072. weekdaysShort: 'Ait._Som._Mon._Bud._Bre._Suk._Son.'.split('_'),
  43073. weekdaysMin: 'Ai_Sm_Mo_Bu_Br_Su_Sn'.split('_'),
  43074. weekdaysParseExact: true,
  43075. longDateFormat: {
  43076. LT: 'A h:mm [vazta]',
  43077. LTS: 'A h:mm:ss [vazta]',
  43078. L: 'DD-MM-YYYY',
  43079. LL: 'D MMMM YYYY',
  43080. LLL: 'D MMMM YYYY A h:mm [vazta]',
  43081. LLLL: 'dddd, MMMM Do, YYYY, A h:mm [vazta]',
  43082. llll: 'ddd, D MMM YYYY, A h:mm [vazta]',
  43083. },
  43084. calendar: {
  43085. sameDay: '[Aiz] LT',
  43086. nextDay: '[Faleam] LT',
  43087. nextWeek: '[Fuddlo] dddd[,] LT',
  43088. lastDay: '[Kal] LT',
  43089. lastWeek: '[Fattlo] dddd[,] LT',
  43090. sameElse: 'L',
  43091. },
  43092. relativeTime: {
  43093. future: '%s',
  43094. past: '%s adim',
  43095. s: processRelativeTime,
  43096. ss: processRelativeTime,
  43097. m: processRelativeTime,
  43098. mm: processRelativeTime,
  43099. h: processRelativeTime,
  43100. hh: processRelativeTime,
  43101. d: processRelativeTime,
  43102. dd: processRelativeTime,
  43103. M: processRelativeTime,
  43104. MM: processRelativeTime,
  43105. y: processRelativeTime,
  43106. yy: processRelativeTime,
  43107. },
  43108. dayOfMonthOrdinalParse: /\d{1,2}(er)/,
  43109. ordinal: function (number, period) {
  43110. switch (period) {
  43111. // the ordinal 'er' only applies to day of the month
  43112. case 'D':
  43113. return number + 'er';
  43114. default:
  43115. case 'M':
  43116. case 'Q':
  43117. case 'DDD':
  43118. case 'd':
  43119. case 'w':
  43120. case 'W':
  43121. return number;
  43122. }
  43123. },
  43124. week: {
  43125. dow: 0, // Sunday is the first day of the week
  43126. doy: 3, // The week that contains Jan 4th is the first week of the year (7 + 0 - 4)
  43127. },
  43128. meridiemParse: /rati|sokallim|donparam|sanje/,
  43129. meridiemHour: function (hour, meridiem) {
  43130. if (hour === 12) {
  43131. hour = 0;
  43132. }
  43133. if (meridiem === 'rati') {
  43134. return hour < 4 ? hour : hour + 12;
  43135. } else if (meridiem === 'sokallim') {
  43136. return hour;
  43137. } else if (meridiem === 'donparam') {
  43138. return hour > 12 ? hour : hour + 12;
  43139. } else if (meridiem === 'sanje') {
  43140. return hour + 12;
  43141. }
  43142. },
  43143. meridiem: function (hour, minute, isLower) {
  43144. if (hour < 4) {
  43145. return 'rati';
  43146. } else if (hour < 12) {
  43147. return 'sokallim';
  43148. } else if (hour < 16) {
  43149. return 'donparam';
  43150. } else if (hour < 20) {
  43151. return 'sanje';
  43152. } else {
  43153. return 'rati';
  43154. }
  43155. },
  43156. });
  43157. return gomLatn;
  43158. })));
  43159. /***/ }),
  43160. /***/ "./node_modules/moment/locale/gu.js":
  43161. /*!******************************************!*\
  43162. !*** ./node_modules/moment/locale/gu.js ***!
  43163. \******************************************/
  43164. /*! no static exports found */
  43165. /***/ (function(module, exports, __webpack_require__) {
  43166. //! moment.js locale configuration
  43167. //! locale : Gujarati [gu]
  43168. //! author : Kaushik Thanki : https://github.com/Kaushik1987
  43169. ;(function (global, factory) {
  43170. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  43171. undefined
  43172. }(this, (function (moment) { 'use strict';
  43173. //! moment.js locale configuration
  43174. var symbolMap = {
  43175. '1': '૧',
  43176. '2': '૨',
  43177. '3': '૩',
  43178. '4': '૪',
  43179. '5': '૫',
  43180. '6': '૬',
  43181. '7': '૭',
  43182. '8': '૮',
  43183. '9': '૯',
  43184. '0': '૦',
  43185. },
  43186. numberMap = {
  43187. '૧': '1',
  43188. '૨': '2',
  43189. '૩': '3',
  43190. '૪': '4',
  43191. '૫': '5',
  43192. '૬': '6',
  43193. '૭': '7',
  43194. '૮': '8',
  43195. '૯': '9',
  43196. '૦': '0',
  43197. };
  43198. var gu = moment.defineLocale('gu', {
  43199. months: 'જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર'.split(
  43200. '_'
  43201. ),
  43202. monthsShort: 'જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.'.split(
  43203. '_'
  43204. ),
  43205. monthsParseExact: true,
  43206. weekdays: 'રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર'.split(
  43207. '_'
  43208. ),
  43209. weekdaysShort: 'રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ'.split('_'),
  43210. weekdaysMin: 'ર_સો_મં_બુ_ગુ_શુ_શ'.split('_'),
  43211. longDateFormat: {
  43212. LT: 'A h:mm વાગ્યે',
  43213. LTS: 'A h:mm:ss વાગ્યે',
  43214. L: 'DD/MM/YYYY',
  43215. LL: 'D MMMM YYYY',
  43216. LLL: 'D MMMM YYYY, A h:mm વાગ્યે',
  43217. LLLL: 'dddd, D MMMM YYYY, A h:mm વાગ્યે',
  43218. },
  43219. calendar: {
  43220. sameDay: '[આજ] LT',
  43221. nextDay: '[કાલે] LT',
  43222. nextWeek: 'dddd, LT',
  43223. lastDay: '[ગઇકાલે] LT',
  43224. lastWeek: '[પાછલા] dddd, LT',
  43225. sameElse: 'L',
  43226. },
  43227. relativeTime: {
  43228. future: '%s મા',
  43229. past: '%s પહેલા',
  43230. s: 'અમુક પળો',
  43231. ss: '%d સેકંડ',
  43232. m: 'એક મિનિટ',
  43233. mm: '%d મિનિટ',
  43234. h: 'એક કલાક',
  43235. hh: '%d કલાક',
  43236. d: 'એક દિવસ',
  43237. dd: '%d દિવસ',
  43238. M: 'એક મહિનો',
  43239. MM: '%d મહિનો',
  43240. y: 'એક વર્ષ',
  43241. yy: '%d વર્ષ',
  43242. },
  43243. preparse: function (string) {
  43244. return string.replace(/[૧૨૩૪૫૬૭૮૯૦]/g, function (match) {
  43245. return numberMap[match];
  43246. });
  43247. },
  43248. postformat: function (string) {
  43249. return string.replace(/\d/g, function (match) {
  43250. return symbolMap[match];
  43251. });
  43252. },
  43253. // Gujarati notation for meridiems are quite fuzzy in practice. While there exists
  43254. // a rigid notion of a 'Pahar' it is not used as rigidly in modern Gujarati.
  43255. meridiemParse: /રાત|બપોર|સવાર|સાંજ/,
  43256. meridiemHour: function (hour, meridiem) {
  43257. if (hour === 12) {
  43258. hour = 0;
  43259. }
  43260. if (meridiem === 'રાત') {
  43261. return hour < 4 ? hour : hour + 12;
  43262. } else if (meridiem === 'સવાર') {
  43263. return hour;
  43264. } else if (meridiem === 'બપોર') {
  43265. return hour >= 10 ? hour : hour + 12;
  43266. } else if (meridiem === 'સાંજ') {
  43267. return hour + 12;
  43268. }
  43269. },
  43270. meridiem: function (hour, minute, isLower) {
  43271. if (hour < 4) {
  43272. return 'રાત';
  43273. } else if (hour < 10) {
  43274. return 'સવાર';
  43275. } else if (hour < 17) {
  43276. return 'બપોર';
  43277. } else if (hour < 20) {
  43278. return 'સાંજ';
  43279. } else {
  43280. return 'રાત';
  43281. }
  43282. },
  43283. week: {
  43284. dow: 0, // Sunday is the first day of the week.
  43285. doy: 6, // The week that contains Jan 6th is the first week of the year.
  43286. },
  43287. });
  43288. return gu;
  43289. })));
  43290. /***/ }),
  43291. /***/ "./node_modules/moment/locale/he.js":
  43292. /*!******************************************!*\
  43293. !*** ./node_modules/moment/locale/he.js ***!
  43294. \******************************************/
  43295. /*! no static exports found */
  43296. /***/ (function(module, exports, __webpack_require__) {
  43297. //! moment.js locale configuration
  43298. //! locale : Hebrew [he]
  43299. //! author : Tomer Cohen : https://github.com/tomer
  43300. //! author : Moshe Simantov : https://github.com/DevelopmentIL
  43301. //! author : Tal Ater : https://github.com/TalAter
  43302. ;(function (global, factory) {
  43303. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  43304. undefined
  43305. }(this, (function (moment) { 'use strict';
  43306. //! moment.js locale configuration
  43307. var he = moment.defineLocale('he', {
  43308. months: 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split(
  43309. '_'
  43310. ),
  43311. monthsShort: 'ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳'.split(
  43312. '_'
  43313. ),
  43314. weekdays: 'ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת'.split('_'),
  43315. weekdaysShort: 'א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳'.split('_'),
  43316. weekdaysMin: 'א_ב_ג_ד_ה_ו_ש'.split('_'),
  43317. longDateFormat: {
  43318. LT: 'HH:mm',
  43319. LTS: 'HH:mm:ss',
  43320. L: 'DD/MM/YYYY',
  43321. LL: 'D [ב]MMMM YYYY',
  43322. LLL: 'D [ב]MMMM YYYY HH:mm',
  43323. LLLL: 'dddd, D [ב]MMMM YYYY HH:mm',
  43324. l: 'D/M/YYYY',
  43325. ll: 'D MMM YYYY',
  43326. lll: 'D MMM YYYY HH:mm',
  43327. llll: 'ddd, D MMM YYYY HH:mm',
  43328. },
  43329. calendar: {
  43330. sameDay: '[היום ב־]LT',
  43331. nextDay: '[מחר ב־]LT',
  43332. nextWeek: 'dddd [בשעה] LT',
  43333. lastDay: '[אתמול ב־]LT',
  43334. lastWeek: '[ביום] dddd [האחרון בשעה] LT',
  43335. sameElse: 'L',
  43336. },
  43337. relativeTime: {
  43338. future: 'בעוד %s',
  43339. past: 'לפני %s',
  43340. s: 'מספר שניות',
  43341. ss: '%d שניות',
  43342. m: 'דקה',
  43343. mm: '%d דקות',
  43344. h: 'שעה',
  43345. hh: function (number) {
  43346. if (number === 2) {
  43347. return 'שעתיים';
  43348. }
  43349. return number + ' שעות';
  43350. },
  43351. d: 'יום',
  43352. dd: function (number) {
  43353. if (number === 2) {
  43354. return 'יומיים';
  43355. }
  43356. return number + ' ימים';
  43357. },
  43358. M: 'חודש',
  43359. MM: function (number) {
  43360. if (number === 2) {
  43361. return 'חודשיים';
  43362. }
  43363. return number + ' חודשים';
  43364. },
  43365. y: 'שנה',
  43366. yy: function (number) {
  43367. if (number === 2) {
  43368. return 'שנתיים';
  43369. } else if (number % 10 === 0 && number !== 10) {
  43370. return number + ' שנה';
  43371. }
  43372. return number + ' שנים';
  43373. },
  43374. },
  43375. meridiemParse: /אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,
  43376. isPM: function (input) {
  43377. return /^(אחה"צ|אחרי הצהריים|בערב)$/.test(input);
  43378. },
  43379. meridiem: function (hour, minute, isLower) {
  43380. if (hour < 5) {
  43381. return 'לפנות בוקר';
  43382. } else if (hour < 10) {
  43383. return 'בבוקר';
  43384. } else if (hour < 12) {
  43385. return isLower ? 'לפנה"צ' : 'לפני הצהריים';
  43386. } else if (hour < 18) {
  43387. return isLower ? 'אחה"צ' : 'אחרי הצהריים';
  43388. } else {
  43389. return 'בערב';
  43390. }
  43391. },
  43392. });
  43393. return he;
  43394. })));
  43395. /***/ }),
  43396. /***/ "./node_modules/moment/locale/hi.js":
  43397. /*!******************************************!*\
  43398. !*** ./node_modules/moment/locale/hi.js ***!
  43399. \******************************************/
  43400. /*! no static exports found */
  43401. /***/ (function(module, exports, __webpack_require__) {
  43402. //! moment.js locale configuration
  43403. //! locale : Hindi [hi]
  43404. //! author : Mayank Singhal : https://github.com/mayanksinghal
  43405. ;(function (global, factory) {
  43406. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  43407. undefined
  43408. }(this, (function (moment) { 'use strict';
  43409. //! moment.js locale configuration
  43410. var symbolMap = {
  43411. '1': '१',
  43412. '2': '२',
  43413. '3': '३',
  43414. '4': '४',
  43415. '5': '५',
  43416. '6': '६',
  43417. '7': '७',
  43418. '8': '८',
  43419. '9': '९',
  43420. '0': '०',
  43421. },
  43422. numberMap = {
  43423. '१': '1',
  43424. '२': '2',
  43425. '३': '3',
  43426. '४': '4',
  43427. '५': '5',
  43428. '६': '6',
  43429. '७': '7',
  43430. '८': '8',
  43431. '९': '9',
  43432. '०': '0',
  43433. };
  43434. var hi = moment.defineLocale('hi', {
  43435. months: 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split(
  43436. '_'
  43437. ),
  43438. monthsShort: 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split(
  43439. '_'
  43440. ),
  43441. monthsParseExact: true,
  43442. weekdays: 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),
  43443. weekdaysShort: 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split('_'),
  43444. weekdaysMin: 'र_सो_मं_बु_गु_शु_श'.split('_'),
  43445. longDateFormat: {
  43446. LT: 'A h:mm बजे',
  43447. LTS: 'A h:mm:ss बजे',
  43448. L: 'DD/MM/YYYY',
  43449. LL: 'D MMMM YYYY',
  43450. LLL: 'D MMMM YYYY, A h:mm बजे',
  43451. LLLL: 'dddd, D MMMM YYYY, A h:mm बजे',
  43452. },
  43453. calendar: {
  43454. sameDay: '[आज] LT',
  43455. nextDay: '[कल] LT',
  43456. nextWeek: 'dddd, LT',
  43457. lastDay: '[कल] LT',
  43458. lastWeek: '[पिछले] dddd, LT',
  43459. sameElse: 'L',
  43460. },
  43461. relativeTime: {
  43462. future: '%s में',
  43463. past: '%s पहले',
  43464. s: 'कुछ ही क्षण',
  43465. ss: '%d सेकंड',
  43466. m: 'एक मिनट',
  43467. mm: '%d मिनट',
  43468. h: 'एक घंटा',
  43469. hh: '%d घंटे',
  43470. d: 'एक दिन',
  43471. dd: '%d दिन',
  43472. M: 'एक महीने',
  43473. MM: '%d महीने',
  43474. y: 'एक वर्ष',
  43475. yy: '%d वर्ष',
  43476. },
  43477. preparse: function (string) {
  43478. return string.replace(/[१२३४५६७८९०]/g, function (match) {
  43479. return numberMap[match];
  43480. });
  43481. },
  43482. postformat: function (string) {
  43483. return string.replace(/\d/g, function (match) {
  43484. return symbolMap[match];
  43485. });
  43486. },
  43487. // Hindi notation for meridiems are quite fuzzy in practice. While there exists
  43488. // a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi.
  43489. meridiemParse: /रात|सुबह|दोपहर|शाम/,
  43490. meridiemHour: function (hour, meridiem) {
  43491. if (hour === 12) {
  43492. hour = 0;
  43493. }
  43494. if (meridiem === 'रात') {
  43495. return hour < 4 ? hour : hour + 12;
  43496. } else if (meridiem === 'सुबह') {
  43497. return hour;
  43498. } else if (meridiem === 'दोपहर') {
  43499. return hour >= 10 ? hour : hour + 12;
  43500. } else if (meridiem === 'शाम') {
  43501. return hour + 12;
  43502. }
  43503. },
  43504. meridiem: function (hour, minute, isLower) {
  43505. if (hour < 4) {
  43506. return 'रात';
  43507. } else if (hour < 10) {
  43508. return 'सुबह';
  43509. } else if (hour < 17) {
  43510. return 'दोपहर';
  43511. } else if (hour < 20) {
  43512. return 'शाम';
  43513. } else {
  43514. return 'रात';
  43515. }
  43516. },
  43517. week: {
  43518. dow: 0, // Sunday is the first day of the week.
  43519. doy: 6, // The week that contains Jan 6th is the first week of the year.
  43520. },
  43521. });
  43522. return hi;
  43523. })));
  43524. /***/ }),
  43525. /***/ "./node_modules/moment/locale/hr.js":
  43526. /*!******************************************!*\
  43527. !*** ./node_modules/moment/locale/hr.js ***!
  43528. \******************************************/
  43529. /*! no static exports found */
  43530. /***/ (function(module, exports, __webpack_require__) {
  43531. //! moment.js locale configuration
  43532. //! locale : Croatian [hr]
  43533. //! author : Bojan Marković : https://github.com/bmarkovic
  43534. ;(function (global, factory) {
  43535. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  43536. undefined
  43537. }(this, (function (moment) { 'use strict';
  43538. //! moment.js locale configuration
  43539. function translate(number, withoutSuffix, key) {
  43540. var result = number + ' ';
  43541. switch (key) {
  43542. case 'ss':
  43543. if (number === 1) {
  43544. result += 'sekunda';
  43545. } else if (number === 2 || number === 3 || number === 4) {
  43546. result += 'sekunde';
  43547. } else {
  43548. result += 'sekundi';
  43549. }
  43550. return result;
  43551. case 'm':
  43552. return withoutSuffix ? 'jedna minuta' : 'jedne minute';
  43553. case 'mm':
  43554. if (number === 1) {
  43555. result += 'minuta';
  43556. } else if (number === 2 || number === 3 || number === 4) {
  43557. result += 'minute';
  43558. } else {
  43559. result += 'minuta';
  43560. }
  43561. return result;
  43562. case 'h':
  43563. return withoutSuffix ? 'jedan sat' : 'jednog sata';
  43564. case 'hh':
  43565. if (number === 1) {
  43566. result += 'sat';
  43567. } else if (number === 2 || number === 3 || number === 4) {
  43568. result += 'sata';
  43569. } else {
  43570. result += 'sati';
  43571. }
  43572. return result;
  43573. case 'dd':
  43574. if (number === 1) {
  43575. result += 'dan';
  43576. } else {
  43577. result += 'dana';
  43578. }
  43579. return result;
  43580. case 'MM':
  43581. if (number === 1) {
  43582. result += 'mjesec';
  43583. } else if (number === 2 || number === 3 || number === 4) {
  43584. result += 'mjeseca';
  43585. } else {
  43586. result += 'mjeseci';
  43587. }
  43588. return result;
  43589. case 'yy':
  43590. if (number === 1) {
  43591. result += 'godina';
  43592. } else if (number === 2 || number === 3 || number === 4) {
  43593. result += 'godine';
  43594. } else {
  43595. result += 'godina';
  43596. }
  43597. return result;
  43598. }
  43599. }
  43600. var hr = moment.defineLocale('hr', {
  43601. months: {
  43602. format: 'siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca'.split(
  43603. '_'
  43604. ),
  43605. standalone: 'siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split(
  43606. '_'
  43607. ),
  43608. },
  43609. monthsShort: 'sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.'.split(
  43610. '_'
  43611. ),
  43612. monthsParseExact: true,
  43613. weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split(
  43614. '_'
  43615. ),
  43616. weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
  43617. weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
  43618. weekdaysParseExact: true,
  43619. longDateFormat: {
  43620. LT: 'H:mm',
  43621. LTS: 'H:mm:ss',
  43622. L: 'DD.MM.YYYY',
  43623. LL: 'Do MMMM YYYY',
  43624. LLL: 'Do MMMM YYYY H:mm',
  43625. LLLL: 'dddd, Do MMMM YYYY H:mm',
  43626. },
  43627. calendar: {
  43628. sameDay: '[danas u] LT',
  43629. nextDay: '[sutra u] LT',
  43630. nextWeek: function () {
  43631. switch (this.day()) {
  43632. case 0:
  43633. return '[u] [nedjelju] [u] LT';
  43634. case 3:
  43635. return '[u] [srijedu] [u] LT';
  43636. case 6:
  43637. return '[u] [subotu] [u] LT';
  43638. case 1:
  43639. case 2:
  43640. case 4:
  43641. case 5:
  43642. return '[u] dddd [u] LT';
  43643. }
  43644. },
  43645. lastDay: '[jučer u] LT',
  43646. lastWeek: function () {
  43647. switch (this.day()) {
  43648. case 0:
  43649. return '[prošlu] [nedjelju] [u] LT';
  43650. case 3:
  43651. return '[prošlu] [srijedu] [u] LT';
  43652. case 6:
  43653. return '[prošle] [subote] [u] LT';
  43654. case 1:
  43655. case 2:
  43656. case 4:
  43657. case 5:
  43658. return '[prošli] dddd [u] LT';
  43659. }
  43660. },
  43661. sameElse: 'L',
  43662. },
  43663. relativeTime: {
  43664. future: 'za %s',
  43665. past: 'prije %s',
  43666. s: 'par sekundi',
  43667. ss: translate,
  43668. m: translate,
  43669. mm: translate,
  43670. h: translate,
  43671. hh: translate,
  43672. d: 'dan',
  43673. dd: translate,
  43674. M: 'mjesec',
  43675. MM: translate,
  43676. y: 'godinu',
  43677. yy: translate,
  43678. },
  43679. dayOfMonthOrdinalParse: /\d{1,2}\./,
  43680. ordinal: '%d.',
  43681. week: {
  43682. dow: 1, // Monday is the first day of the week.
  43683. doy: 7, // The week that contains Jan 7th is the first week of the year.
  43684. },
  43685. });
  43686. return hr;
  43687. })));
  43688. /***/ }),
  43689. /***/ "./node_modules/moment/locale/hu.js":
  43690. /*!******************************************!*\
  43691. !*** ./node_modules/moment/locale/hu.js ***!
  43692. \******************************************/
  43693. /*! no static exports found */
  43694. /***/ (function(module, exports, __webpack_require__) {
  43695. //! moment.js locale configuration
  43696. //! locale : Hungarian [hu]
  43697. //! author : Adam Brunner : https://github.com/adambrunner
  43698. ;(function (global, factory) {
  43699. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  43700. undefined
  43701. }(this, (function (moment) { 'use strict';
  43702. //! moment.js locale configuration
  43703. var weekEndings = 'vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton'.split(
  43704. ' '
  43705. );
  43706. function translate(number, withoutSuffix, key, isFuture) {
  43707. var num = number;
  43708. switch (key) {
  43709. case 's':
  43710. return isFuture || withoutSuffix
  43711. ? 'néhány másodperc'
  43712. : 'néhány másodperce';
  43713. case 'ss':
  43714. return num + (isFuture || withoutSuffix)
  43715. ? ' másodperc'
  43716. : ' másodperce';
  43717. case 'm':
  43718. return 'egy' + (isFuture || withoutSuffix ? ' perc' : ' perce');
  43719. case 'mm':
  43720. return num + (isFuture || withoutSuffix ? ' perc' : ' perce');
  43721. case 'h':
  43722. return 'egy' + (isFuture || withoutSuffix ? ' óra' : ' órája');
  43723. case 'hh':
  43724. return num + (isFuture || withoutSuffix ? ' óra' : ' órája');
  43725. case 'd':
  43726. return 'egy' + (isFuture || withoutSuffix ? ' nap' : ' napja');
  43727. case 'dd':
  43728. return num + (isFuture || withoutSuffix ? ' nap' : ' napja');
  43729. case 'M':
  43730. return 'egy' + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');
  43731. case 'MM':
  43732. return num + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');
  43733. case 'y':
  43734. return 'egy' + (isFuture || withoutSuffix ? ' év' : ' éve');
  43735. case 'yy':
  43736. return num + (isFuture || withoutSuffix ? ' év' : ' éve');
  43737. }
  43738. return '';
  43739. }
  43740. function week(isFuture) {
  43741. return (
  43742. (isFuture ? '' : '[múlt] ') +
  43743. '[' +
  43744. weekEndings[this.day()] +
  43745. '] LT[-kor]'
  43746. );
  43747. }
  43748. var hu = moment.defineLocale('hu', {
  43749. months: 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split(
  43750. '_'
  43751. ),
  43752. monthsShort: 'jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec'.split(
  43753. '_'
  43754. ),
  43755. weekdays: 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'),
  43756. weekdaysShort: 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'),
  43757. weekdaysMin: 'v_h_k_sze_cs_p_szo'.split('_'),
  43758. longDateFormat: {
  43759. LT: 'H:mm',
  43760. LTS: 'H:mm:ss',
  43761. L: 'YYYY.MM.DD.',
  43762. LL: 'YYYY. MMMM D.',
  43763. LLL: 'YYYY. MMMM D. H:mm',
  43764. LLLL: 'YYYY. MMMM D., dddd H:mm',
  43765. },
  43766. meridiemParse: /de|du/i,
  43767. isPM: function (input) {
  43768. return input.charAt(1).toLowerCase() === 'u';
  43769. },
  43770. meridiem: function (hours, minutes, isLower) {
  43771. if (hours < 12) {
  43772. return isLower === true ? 'de' : 'DE';
  43773. } else {
  43774. return isLower === true ? 'du' : 'DU';
  43775. }
  43776. },
  43777. calendar: {
  43778. sameDay: '[ma] LT[-kor]',
  43779. nextDay: '[holnap] LT[-kor]',
  43780. nextWeek: function () {
  43781. return week.call(this, true);
  43782. },
  43783. lastDay: '[tegnap] LT[-kor]',
  43784. lastWeek: function () {
  43785. return week.call(this, false);
  43786. },
  43787. sameElse: 'L',
  43788. },
  43789. relativeTime: {
  43790. future: '%s múlva',
  43791. past: '%s',
  43792. s: translate,
  43793. ss: translate,
  43794. m: translate,
  43795. mm: translate,
  43796. h: translate,
  43797. hh: translate,
  43798. d: translate,
  43799. dd: translate,
  43800. M: translate,
  43801. MM: translate,
  43802. y: translate,
  43803. yy: translate,
  43804. },
  43805. dayOfMonthOrdinalParse: /\d{1,2}\./,
  43806. ordinal: '%d.',
  43807. week: {
  43808. dow: 1, // Monday is the first day of the week.
  43809. doy: 4, // The week that contains Jan 4th is the first week of the year.
  43810. },
  43811. });
  43812. return hu;
  43813. })));
  43814. /***/ }),
  43815. /***/ "./node_modules/moment/locale/hy-am.js":
  43816. /*!*********************************************!*\
  43817. !*** ./node_modules/moment/locale/hy-am.js ***!
  43818. \*********************************************/
  43819. /*! no static exports found */
  43820. /***/ (function(module, exports, __webpack_require__) {
  43821. //! moment.js locale configuration
  43822. //! locale : Armenian [hy-am]
  43823. //! author : Armendarabyan : https://github.com/armendarabyan
  43824. ;(function (global, factory) {
  43825. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  43826. undefined
  43827. }(this, (function (moment) { 'use strict';
  43828. //! moment.js locale configuration
  43829. var hyAm = moment.defineLocale('hy-am', {
  43830. months: {
  43831. format: 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split(
  43832. '_'
  43833. ),
  43834. standalone: 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split(
  43835. '_'
  43836. ),
  43837. },
  43838. monthsShort: 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'),
  43839. weekdays: 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split(
  43840. '_'
  43841. ),
  43842. weekdaysShort: 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),
  43843. weekdaysMin: 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),
  43844. longDateFormat: {
  43845. LT: 'HH:mm',
  43846. LTS: 'HH:mm:ss',
  43847. L: 'DD.MM.YYYY',
  43848. LL: 'D MMMM YYYY թ.',
  43849. LLL: 'D MMMM YYYY թ., HH:mm',
  43850. LLLL: 'dddd, D MMMM YYYY թ., HH:mm',
  43851. },
  43852. calendar: {
  43853. sameDay: '[այսօր] LT',
  43854. nextDay: '[վաղը] LT',
  43855. lastDay: '[երեկ] LT',
  43856. nextWeek: function () {
  43857. return 'dddd [օրը ժամը] LT';
  43858. },
  43859. lastWeek: function () {
  43860. return '[անցած] dddd [օրը ժամը] LT';
  43861. },
  43862. sameElse: 'L',
  43863. },
  43864. relativeTime: {
  43865. future: '%s հետո',
  43866. past: '%s առաջ',
  43867. s: 'մի քանի վայրկյան',
  43868. ss: '%d վայրկյան',
  43869. m: 'րոպե',
  43870. mm: '%d րոպե',
  43871. h: 'ժամ',
  43872. hh: '%d ժամ',
  43873. d: 'օր',
  43874. dd: '%d օր',
  43875. M: 'ամիս',
  43876. MM: '%d ամիս',
  43877. y: 'տարի',
  43878. yy: '%d տարի',
  43879. },
  43880. meridiemParse: /գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,
  43881. isPM: function (input) {
  43882. return /^(ցերեկվա|երեկոյան)$/.test(input);
  43883. },
  43884. meridiem: function (hour) {
  43885. if (hour < 4) {
  43886. return 'գիշերվա';
  43887. } else if (hour < 12) {
  43888. return 'առավոտվա';
  43889. } else if (hour < 17) {
  43890. return 'ցերեկվա';
  43891. } else {
  43892. return 'երեկոյան';
  43893. }
  43894. },
  43895. dayOfMonthOrdinalParse: /\d{1,2}|\d{1,2}-(ին|րդ)/,
  43896. ordinal: function (number, period) {
  43897. switch (period) {
  43898. case 'DDD':
  43899. case 'w':
  43900. case 'W':
  43901. case 'DDDo':
  43902. if (number === 1) {
  43903. return number + '-ին';
  43904. }
  43905. return number + '-րդ';
  43906. default:
  43907. return number;
  43908. }
  43909. },
  43910. week: {
  43911. dow: 1, // Monday is the first day of the week.
  43912. doy: 7, // The week that contains Jan 7th is the first week of the year.
  43913. },
  43914. });
  43915. return hyAm;
  43916. })));
  43917. /***/ }),
  43918. /***/ "./node_modules/moment/locale/id.js":
  43919. /*!******************************************!*\
  43920. !*** ./node_modules/moment/locale/id.js ***!
  43921. \******************************************/
  43922. /*! no static exports found */
  43923. /***/ (function(module, exports, __webpack_require__) {
  43924. //! moment.js locale configuration
  43925. //! locale : Indonesian [id]
  43926. //! author : Mohammad Satrio Utomo : https://github.com/tyok
  43927. //! reference: http://id.wikisource.org/wiki/Pedoman_Umum_Ejaan_Bahasa_Indonesia_yang_Disempurnakan
  43928. ;(function (global, factory) {
  43929. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  43930. undefined
  43931. }(this, (function (moment) { 'use strict';
  43932. //! moment.js locale configuration
  43933. var id = moment.defineLocale('id', {
  43934. months: 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split(
  43935. '_'
  43936. ),
  43937. monthsShort: 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des'.split('_'),
  43938. weekdays: 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'),
  43939. weekdaysShort: 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'),
  43940. weekdaysMin: 'Mg_Sn_Sl_Rb_Km_Jm_Sb'.split('_'),
  43941. longDateFormat: {
  43942. LT: 'HH.mm',
  43943. LTS: 'HH.mm.ss',
  43944. L: 'DD/MM/YYYY',
  43945. LL: 'D MMMM YYYY',
  43946. LLL: 'D MMMM YYYY [pukul] HH.mm',
  43947. LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm',
  43948. },
  43949. meridiemParse: /pagi|siang|sore|malam/,
  43950. meridiemHour: function (hour, meridiem) {
  43951. if (hour === 12) {
  43952. hour = 0;
  43953. }
  43954. if (meridiem === 'pagi') {
  43955. return hour;
  43956. } else if (meridiem === 'siang') {
  43957. return hour >= 11 ? hour : hour + 12;
  43958. } else if (meridiem === 'sore' || meridiem === 'malam') {
  43959. return hour + 12;
  43960. }
  43961. },
  43962. meridiem: function (hours, minutes, isLower) {
  43963. if (hours < 11) {
  43964. return 'pagi';
  43965. } else if (hours < 15) {
  43966. return 'siang';
  43967. } else if (hours < 19) {
  43968. return 'sore';
  43969. } else {
  43970. return 'malam';
  43971. }
  43972. },
  43973. calendar: {
  43974. sameDay: '[Hari ini pukul] LT',
  43975. nextDay: '[Besok pukul] LT',
  43976. nextWeek: 'dddd [pukul] LT',
  43977. lastDay: '[Kemarin pukul] LT',
  43978. lastWeek: 'dddd [lalu pukul] LT',
  43979. sameElse: 'L',
  43980. },
  43981. relativeTime: {
  43982. future: 'dalam %s',
  43983. past: '%s yang lalu',
  43984. s: 'beberapa detik',
  43985. ss: '%d detik',
  43986. m: 'semenit',
  43987. mm: '%d menit',
  43988. h: 'sejam',
  43989. hh: '%d jam',
  43990. d: 'sehari',
  43991. dd: '%d hari',
  43992. M: 'sebulan',
  43993. MM: '%d bulan',
  43994. y: 'setahun',
  43995. yy: '%d tahun',
  43996. },
  43997. week: {
  43998. dow: 0, // Sunday is the first day of the week.
  43999. doy: 6, // The week that contains Jan 6th is the first week of the year.
  44000. },
  44001. });
  44002. return id;
  44003. })));
  44004. /***/ }),
  44005. /***/ "./node_modules/moment/locale/is.js":
  44006. /*!******************************************!*\
  44007. !*** ./node_modules/moment/locale/is.js ***!
  44008. \******************************************/
  44009. /*! no static exports found */
  44010. /***/ (function(module, exports, __webpack_require__) {
  44011. //! moment.js locale configuration
  44012. //! locale : Icelandic [is]
  44013. //! author : Hinrik Örn Sigurðsson : https://github.com/hinrik
  44014. ;(function (global, factory) {
  44015. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  44016. undefined
  44017. }(this, (function (moment) { 'use strict';
  44018. //! moment.js locale configuration
  44019. function plural(n) {
  44020. if (n % 100 === 11) {
  44021. return true;
  44022. } else if (n % 10 === 1) {
  44023. return false;
  44024. }
  44025. return true;
  44026. }
  44027. function translate(number, withoutSuffix, key, isFuture) {
  44028. var result = number + ' ';
  44029. switch (key) {
  44030. case 's':
  44031. return withoutSuffix || isFuture
  44032. ? 'nokkrar sekúndur'
  44033. : 'nokkrum sekúndum';
  44034. case 'ss':
  44035. if (plural(number)) {
  44036. return (
  44037. result +
  44038. (withoutSuffix || isFuture ? 'sekúndur' : 'sekúndum')
  44039. );
  44040. }
  44041. return result + 'sekúnda';
  44042. case 'm':
  44043. return withoutSuffix ? 'mínúta' : 'mínútu';
  44044. case 'mm':
  44045. if (plural(number)) {
  44046. return (
  44047. result + (withoutSuffix || isFuture ? 'mínútur' : 'mínútum')
  44048. );
  44049. } else if (withoutSuffix) {
  44050. return result + 'mínúta';
  44051. }
  44052. return result + 'mínútu';
  44053. case 'hh':
  44054. if (plural(number)) {
  44055. return (
  44056. result +
  44057. (withoutSuffix || isFuture
  44058. ? 'klukkustundir'
  44059. : 'klukkustundum')
  44060. );
  44061. }
  44062. return result + 'klukkustund';
  44063. case 'd':
  44064. if (withoutSuffix) {
  44065. return 'dagur';
  44066. }
  44067. return isFuture ? 'dag' : 'degi';
  44068. case 'dd':
  44069. if (plural(number)) {
  44070. if (withoutSuffix) {
  44071. return result + 'dagar';
  44072. }
  44073. return result + (isFuture ? 'daga' : 'dögum');
  44074. } else if (withoutSuffix) {
  44075. return result + 'dagur';
  44076. }
  44077. return result + (isFuture ? 'dag' : 'degi');
  44078. case 'M':
  44079. if (withoutSuffix) {
  44080. return 'mánuður';
  44081. }
  44082. return isFuture ? 'mánuð' : 'mánuði';
  44083. case 'MM':
  44084. if (plural(number)) {
  44085. if (withoutSuffix) {
  44086. return result + 'mánuðir';
  44087. }
  44088. return result + (isFuture ? 'mánuði' : 'mánuðum');
  44089. } else if (withoutSuffix) {
  44090. return result + 'mánuður';
  44091. }
  44092. return result + (isFuture ? 'mánuð' : 'mánuði');
  44093. case 'y':
  44094. return withoutSuffix || isFuture ? 'ár' : 'ári';
  44095. case 'yy':
  44096. if (plural(number)) {
  44097. return result + (withoutSuffix || isFuture ? 'ár' : 'árum');
  44098. }
  44099. return result + (withoutSuffix || isFuture ? 'ár' : 'ári');
  44100. }
  44101. }
  44102. var is = moment.defineLocale('is', {
  44103. months: 'janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember'.split(
  44104. '_'
  44105. ),
  44106. monthsShort: 'jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des'.split('_'),
  44107. weekdays: 'sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur'.split(
  44108. '_'
  44109. ),
  44110. weekdaysShort: 'sun_mán_þri_mið_fim_fös_lau'.split('_'),
  44111. weekdaysMin: 'Su_Má_Þr_Mi_Fi_Fö_La'.split('_'),
  44112. longDateFormat: {
  44113. LT: 'H:mm',
  44114. LTS: 'H:mm:ss',
  44115. L: 'DD.MM.YYYY',
  44116. LL: 'D. MMMM YYYY',
  44117. LLL: 'D. MMMM YYYY [kl.] H:mm',
  44118. LLLL: 'dddd, D. MMMM YYYY [kl.] H:mm',
  44119. },
  44120. calendar: {
  44121. sameDay: '[í dag kl.] LT',
  44122. nextDay: '[á morgun kl.] LT',
  44123. nextWeek: 'dddd [kl.] LT',
  44124. lastDay: '[í gær kl.] LT',
  44125. lastWeek: '[síðasta] dddd [kl.] LT',
  44126. sameElse: 'L',
  44127. },
  44128. relativeTime: {
  44129. future: 'eftir %s',
  44130. past: 'fyrir %s síðan',
  44131. s: translate,
  44132. ss: translate,
  44133. m: translate,
  44134. mm: translate,
  44135. h: 'klukkustund',
  44136. hh: translate,
  44137. d: translate,
  44138. dd: translate,
  44139. M: translate,
  44140. MM: translate,
  44141. y: translate,
  44142. yy: translate,
  44143. },
  44144. dayOfMonthOrdinalParse: /\d{1,2}\./,
  44145. ordinal: '%d.',
  44146. week: {
  44147. dow: 1, // Monday is the first day of the week.
  44148. doy: 4, // The week that contains Jan 4th is the first week of the year.
  44149. },
  44150. });
  44151. return is;
  44152. })));
  44153. /***/ }),
  44154. /***/ "./node_modules/moment/locale/it-ch.js":
  44155. /*!*********************************************!*\
  44156. !*** ./node_modules/moment/locale/it-ch.js ***!
  44157. \*********************************************/
  44158. /*! no static exports found */
  44159. /***/ (function(module, exports, __webpack_require__) {
  44160. //! moment.js locale configuration
  44161. //! locale : Italian (Switzerland) [it-ch]
  44162. //! author : xfh : https://github.com/xfh
  44163. ;(function (global, factory) {
  44164. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  44165. undefined
  44166. }(this, (function (moment) { 'use strict';
  44167. //! moment.js locale configuration
  44168. var itCh = moment.defineLocale('it-ch', {
  44169. months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split(
  44170. '_'
  44171. ),
  44172. monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),
  44173. weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split(
  44174. '_'
  44175. ),
  44176. weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'),
  44177. weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'),
  44178. longDateFormat: {
  44179. LT: 'HH:mm',
  44180. LTS: 'HH:mm:ss',
  44181. L: 'DD.MM.YYYY',
  44182. LL: 'D MMMM YYYY',
  44183. LLL: 'D MMMM YYYY HH:mm',
  44184. LLLL: 'dddd D MMMM YYYY HH:mm',
  44185. },
  44186. calendar: {
  44187. sameDay: '[Oggi alle] LT',
  44188. nextDay: '[Domani alle] LT',
  44189. nextWeek: 'dddd [alle] LT',
  44190. lastDay: '[Ieri alle] LT',
  44191. lastWeek: function () {
  44192. switch (this.day()) {
  44193. case 0:
  44194. return '[la scorsa] dddd [alle] LT';
  44195. default:
  44196. return '[lo scorso] dddd [alle] LT';
  44197. }
  44198. },
  44199. sameElse: 'L',
  44200. },
  44201. relativeTime: {
  44202. future: function (s) {
  44203. return (/^[0-9].+$/.test(s) ? 'tra' : 'in') + ' ' + s;
  44204. },
  44205. past: '%s fa',
  44206. s: 'alcuni secondi',
  44207. ss: '%d secondi',
  44208. m: 'un minuto',
  44209. mm: '%d minuti',
  44210. h: "un'ora",
  44211. hh: '%d ore',
  44212. d: 'un giorno',
  44213. dd: '%d giorni',
  44214. M: 'un mese',
  44215. MM: '%d mesi',
  44216. y: 'un anno',
  44217. yy: '%d anni',
  44218. },
  44219. dayOfMonthOrdinalParse: /\d{1,2}º/,
  44220. ordinal: '%dº',
  44221. week: {
  44222. dow: 1, // Monday is the first day of the week.
  44223. doy: 4, // The week that contains Jan 4th is the first week of the year.
  44224. },
  44225. });
  44226. return itCh;
  44227. })));
  44228. /***/ }),
  44229. /***/ "./node_modules/moment/locale/it.js":
  44230. /*!******************************************!*\
  44231. !*** ./node_modules/moment/locale/it.js ***!
  44232. \******************************************/
  44233. /*! no static exports found */
  44234. /***/ (function(module, exports, __webpack_require__) {
  44235. //! moment.js locale configuration
  44236. //! locale : Italian [it]
  44237. //! author : Lorenzo : https://github.com/aliem
  44238. //! author: Mattia Larentis: https://github.com/nostalgiaz
  44239. //! author: Marco : https://github.com/Manfre98
  44240. ;(function (global, factory) {
  44241. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  44242. undefined
  44243. }(this, (function (moment) { 'use strict';
  44244. //! moment.js locale configuration
  44245. var it = moment.defineLocale('it', {
  44246. months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split(
  44247. '_'
  44248. ),
  44249. monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),
  44250. weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split(
  44251. '_'
  44252. ),
  44253. weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'),
  44254. weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'),
  44255. longDateFormat: {
  44256. LT: 'HH:mm',
  44257. LTS: 'HH:mm:ss',
  44258. L: 'DD/MM/YYYY',
  44259. LL: 'D MMMM YYYY',
  44260. LLL: 'D MMMM YYYY HH:mm',
  44261. LLLL: 'dddd D MMMM YYYY HH:mm',
  44262. },
  44263. calendar: {
  44264. sameDay: function () {
  44265. return (
  44266. '[Oggi a' +
  44267. (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") +
  44268. ']LT'
  44269. );
  44270. },
  44271. nextDay: function () {
  44272. return (
  44273. '[Domani a' +
  44274. (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") +
  44275. ']LT'
  44276. );
  44277. },
  44278. nextWeek: function () {
  44279. return (
  44280. 'dddd [a' +
  44281. (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") +
  44282. ']LT'
  44283. );
  44284. },
  44285. lastDay: function () {
  44286. return (
  44287. '[Ieri a' +
  44288. (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") +
  44289. ']LT'
  44290. );
  44291. },
  44292. lastWeek: function () {
  44293. switch (this.day()) {
  44294. case 0:
  44295. return (
  44296. '[La scorsa] dddd [a' +
  44297. (this.hours() > 1
  44298. ? 'lle '
  44299. : this.hours() === 0
  44300. ? ' '
  44301. : "ll'") +
  44302. ']LT'
  44303. );
  44304. default:
  44305. return (
  44306. '[Lo scorso] dddd [a' +
  44307. (this.hours() > 1
  44308. ? 'lle '
  44309. : this.hours() === 0
  44310. ? ' '
  44311. : "ll'") +
  44312. ']LT'
  44313. );
  44314. }
  44315. },
  44316. sameElse: 'L',
  44317. },
  44318. relativeTime: {
  44319. future: 'tra %s',
  44320. past: '%s fa',
  44321. s: 'alcuni secondi',
  44322. ss: '%d secondi',
  44323. m: 'un minuto',
  44324. mm: '%d minuti',
  44325. h: "un'ora",
  44326. hh: '%d ore',
  44327. d: 'un giorno',
  44328. dd: '%d giorni',
  44329. M: 'un mese',
  44330. MM: '%d mesi',
  44331. y: 'un anno',
  44332. yy: '%d anni',
  44333. },
  44334. dayOfMonthOrdinalParse: /\d{1,2}º/,
  44335. ordinal: '%dº',
  44336. week: {
  44337. dow: 1, // Monday is the first day of the week.
  44338. doy: 4, // The week that contains Jan 4th is the first week of the year.
  44339. },
  44340. });
  44341. return it;
  44342. })));
  44343. /***/ }),
  44344. /***/ "./node_modules/moment/locale/ja.js":
  44345. /*!******************************************!*\
  44346. !*** ./node_modules/moment/locale/ja.js ***!
  44347. \******************************************/
  44348. /*! no static exports found */
  44349. /***/ (function(module, exports, __webpack_require__) {
  44350. //! moment.js locale configuration
  44351. //! locale : Japanese [ja]
  44352. //! author : LI Long : https://github.com/baryon
  44353. ;(function (global, factory) {
  44354. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  44355. undefined
  44356. }(this, (function (moment) { 'use strict';
  44357. //! moment.js locale configuration
  44358. var ja = moment.defineLocale('ja', {
  44359. eras: [
  44360. {
  44361. since: '2019-05-01',
  44362. offset: 1,
  44363. name: '令和',
  44364. narrow: '㋿',
  44365. abbr: 'R',
  44366. },
  44367. {
  44368. since: '1989-01-08',
  44369. until: '2019-04-30',
  44370. offset: 1,
  44371. name: '平成',
  44372. narrow: '㍻',
  44373. abbr: 'H',
  44374. },
  44375. {
  44376. since: '1926-12-25',
  44377. until: '1989-01-07',
  44378. offset: 1,
  44379. name: '昭和',
  44380. narrow: '㍼',
  44381. abbr: 'S',
  44382. },
  44383. {
  44384. since: '1912-07-30',
  44385. until: '1926-12-24',
  44386. offset: 1,
  44387. name: '大正',
  44388. narrow: '㍽',
  44389. abbr: 'T',
  44390. },
  44391. {
  44392. since: '1873-01-01',
  44393. until: '1912-07-29',
  44394. offset: 6,
  44395. name: '明治',
  44396. narrow: '㍾',
  44397. abbr: 'M',
  44398. },
  44399. {
  44400. since: '0001-01-01',
  44401. until: '1873-12-31',
  44402. offset: 1,
  44403. name: '西暦',
  44404. narrow: 'AD',
  44405. abbr: 'AD',
  44406. },
  44407. {
  44408. since: '0000-12-31',
  44409. until: -Infinity,
  44410. offset: 1,
  44411. name: '紀元前',
  44412. narrow: 'BC',
  44413. abbr: 'BC',
  44414. },
  44415. ],
  44416. eraYearOrdinalRegex: /(元|\d+)年/,
  44417. eraYearOrdinalParse: function (input, match) {
  44418. return match[1] === '元' ? 1 : parseInt(match[1] || input, 10);
  44419. },
  44420. months: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
  44421. monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(
  44422. '_'
  44423. ),
  44424. weekdays: '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'),
  44425. weekdaysShort: '日_月_火_水_木_金_土'.split('_'),
  44426. weekdaysMin: '日_月_火_水_木_金_土'.split('_'),
  44427. longDateFormat: {
  44428. LT: 'HH:mm',
  44429. LTS: 'HH:mm:ss',
  44430. L: 'YYYY/MM/DD',
  44431. LL: 'YYYY年M月D日',
  44432. LLL: 'YYYY年M月D日 HH:mm',
  44433. LLLL: 'YYYY年M月D日 dddd HH:mm',
  44434. l: 'YYYY/MM/DD',
  44435. ll: 'YYYY年M月D日',
  44436. lll: 'YYYY年M月D日 HH:mm',
  44437. llll: 'YYYY年M月D日(ddd) HH:mm',
  44438. },
  44439. meridiemParse: /午前|午後/i,
  44440. isPM: function (input) {
  44441. return input === '午後';
  44442. },
  44443. meridiem: function (hour, minute, isLower) {
  44444. if (hour < 12) {
  44445. return '午前';
  44446. } else {
  44447. return '午後';
  44448. }
  44449. },
  44450. calendar: {
  44451. sameDay: '[今日] LT',
  44452. nextDay: '[明日] LT',
  44453. nextWeek: function (now) {
  44454. if (now.week() !== this.week()) {
  44455. return '[来週]dddd LT';
  44456. } else {
  44457. return 'dddd LT';
  44458. }
  44459. },
  44460. lastDay: '[昨日] LT',
  44461. lastWeek: function (now) {
  44462. if (this.week() !== now.week()) {
  44463. return '[先週]dddd LT';
  44464. } else {
  44465. return 'dddd LT';
  44466. }
  44467. },
  44468. sameElse: 'L',
  44469. },
  44470. dayOfMonthOrdinalParse: /\d{1,2}日/,
  44471. ordinal: function (number, period) {
  44472. switch (period) {
  44473. case 'y':
  44474. return number === 1 ? '元年' : number + '年';
  44475. case 'd':
  44476. case 'D':
  44477. case 'DDD':
  44478. return number + '日';
  44479. default:
  44480. return number;
  44481. }
  44482. },
  44483. relativeTime: {
  44484. future: '%s後',
  44485. past: '%s前',
  44486. s: '数秒',
  44487. ss: '%d秒',
  44488. m: '1分',
  44489. mm: '%d分',
  44490. h: '1時間',
  44491. hh: '%d時間',
  44492. d: '1日',
  44493. dd: '%d日',
  44494. M: '1ヶ月',
  44495. MM: '%dヶ月',
  44496. y: '1年',
  44497. yy: '%d年',
  44498. },
  44499. });
  44500. return ja;
  44501. })));
  44502. /***/ }),
  44503. /***/ "./node_modules/moment/locale/jv.js":
  44504. /*!******************************************!*\
  44505. !*** ./node_modules/moment/locale/jv.js ***!
  44506. \******************************************/
  44507. /*! no static exports found */
  44508. /***/ (function(module, exports, __webpack_require__) {
  44509. //! moment.js locale configuration
  44510. //! locale : Javanese [jv]
  44511. //! author : Rony Lantip : https://github.com/lantip
  44512. //! reference: http://jv.wikipedia.org/wiki/Basa_Jawa
  44513. ;(function (global, factory) {
  44514. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  44515. undefined
  44516. }(this, (function (moment) { 'use strict';
  44517. //! moment.js locale configuration
  44518. var jv = moment.defineLocale('jv', {
  44519. months: 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember'.split(
  44520. '_'
  44521. ),
  44522. monthsShort: 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des'.split('_'),
  44523. weekdays: 'Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu'.split('_'),
  44524. weekdaysShort: 'Min_Sen_Sel_Reb_Kem_Jem_Sep'.split('_'),
  44525. weekdaysMin: 'Mg_Sn_Sl_Rb_Km_Jm_Sp'.split('_'),
  44526. longDateFormat: {
  44527. LT: 'HH.mm',
  44528. LTS: 'HH.mm.ss',
  44529. L: 'DD/MM/YYYY',
  44530. LL: 'D MMMM YYYY',
  44531. LLL: 'D MMMM YYYY [pukul] HH.mm',
  44532. LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm',
  44533. },
  44534. meridiemParse: /enjing|siyang|sonten|ndalu/,
  44535. meridiemHour: function (hour, meridiem) {
  44536. if (hour === 12) {
  44537. hour = 0;
  44538. }
  44539. if (meridiem === 'enjing') {
  44540. return hour;
  44541. } else if (meridiem === 'siyang') {
  44542. return hour >= 11 ? hour : hour + 12;
  44543. } else if (meridiem === 'sonten' || meridiem === 'ndalu') {
  44544. return hour + 12;
  44545. }
  44546. },
  44547. meridiem: function (hours, minutes, isLower) {
  44548. if (hours < 11) {
  44549. return 'enjing';
  44550. } else if (hours < 15) {
  44551. return 'siyang';
  44552. } else if (hours < 19) {
  44553. return 'sonten';
  44554. } else {
  44555. return 'ndalu';
  44556. }
  44557. },
  44558. calendar: {
  44559. sameDay: '[Dinten puniko pukul] LT',
  44560. nextDay: '[Mbenjang pukul] LT',
  44561. nextWeek: 'dddd [pukul] LT',
  44562. lastDay: '[Kala wingi pukul] LT',
  44563. lastWeek: 'dddd [kepengker pukul] LT',
  44564. sameElse: 'L',
  44565. },
  44566. relativeTime: {
  44567. future: 'wonten ing %s',
  44568. past: '%s ingkang kepengker',
  44569. s: 'sawetawis detik',
  44570. ss: '%d detik',
  44571. m: 'setunggal menit',
  44572. mm: '%d menit',
  44573. h: 'setunggal jam',
  44574. hh: '%d jam',
  44575. d: 'sedinten',
  44576. dd: '%d dinten',
  44577. M: 'sewulan',
  44578. MM: '%d wulan',
  44579. y: 'setaun',
  44580. yy: '%d taun',
  44581. },
  44582. week: {
  44583. dow: 1, // Monday is the first day of the week.
  44584. doy: 7, // The week that contains Jan 7th is the first week of the year.
  44585. },
  44586. });
  44587. return jv;
  44588. })));
  44589. /***/ }),
  44590. /***/ "./node_modules/moment/locale/ka.js":
  44591. /*!******************************************!*\
  44592. !*** ./node_modules/moment/locale/ka.js ***!
  44593. \******************************************/
  44594. /*! no static exports found */
  44595. /***/ (function(module, exports, __webpack_require__) {
  44596. //! moment.js locale configuration
  44597. //! locale : Georgian [ka]
  44598. //! author : Irakli Janiashvili : https://github.com/IrakliJani
  44599. ;(function (global, factory) {
  44600. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  44601. undefined
  44602. }(this, (function (moment) { 'use strict';
  44603. //! moment.js locale configuration
  44604. var ka = moment.defineLocale('ka', {
  44605. months: 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split(
  44606. '_'
  44607. ),
  44608. monthsShort: 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'),
  44609. weekdays: {
  44610. standalone: 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split(
  44611. '_'
  44612. ),
  44613. format: 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split(
  44614. '_'
  44615. ),
  44616. isFormat: /(წინა|შემდეგ)/,
  44617. },
  44618. weekdaysShort: 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'),
  44619. weekdaysMin: 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'),
  44620. longDateFormat: {
  44621. LT: 'HH:mm',
  44622. LTS: 'HH:mm:ss',
  44623. L: 'DD/MM/YYYY',
  44624. LL: 'D MMMM YYYY',
  44625. LLL: 'D MMMM YYYY HH:mm',
  44626. LLLL: 'dddd, D MMMM YYYY HH:mm',
  44627. },
  44628. calendar: {
  44629. sameDay: '[დღეს] LT[-ზე]',
  44630. nextDay: '[ხვალ] LT[-ზე]',
  44631. lastDay: '[გუშინ] LT[-ზე]',
  44632. nextWeek: '[შემდეგ] dddd LT[-ზე]',
  44633. lastWeek: '[წინა] dddd LT-ზე',
  44634. sameElse: 'L',
  44635. },
  44636. relativeTime: {
  44637. future: function (s) {
  44638. return s.replace(/(წამ|წუთ|საათ|წელ|დღ|თვ)(ი|ე)/, function (
  44639. $0,
  44640. $1,
  44641. $2
  44642. ) {
  44643. return $2 === 'ი' ? $1 + 'ში' : $1 + $2 + 'ში';
  44644. });
  44645. },
  44646. past: function (s) {
  44647. if (/(წამი|წუთი|საათი|დღე|თვე)/.test(s)) {
  44648. return s.replace(/(ი|ე)$/, 'ის წინ');
  44649. }
  44650. if (/წელი/.test(s)) {
  44651. return s.replace(/წელი$/, 'წლის წინ');
  44652. }
  44653. return s;
  44654. },
  44655. s: 'რამდენიმე წამი',
  44656. ss: '%d წამი',
  44657. m: 'წუთი',
  44658. mm: '%d წუთი',
  44659. h: 'საათი',
  44660. hh: '%d საათი',
  44661. d: 'დღე',
  44662. dd: '%d დღე',
  44663. M: 'თვე',
  44664. MM: '%d თვე',
  44665. y: 'წელი',
  44666. yy: '%d წელი',
  44667. },
  44668. dayOfMonthOrdinalParse: /0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,
  44669. ordinal: function (number) {
  44670. if (number === 0) {
  44671. return number;
  44672. }
  44673. if (number === 1) {
  44674. return number + '-ლი';
  44675. }
  44676. if (
  44677. number < 20 ||
  44678. (number <= 100 && number % 20 === 0) ||
  44679. number % 100 === 0
  44680. ) {
  44681. return 'მე-' + number;
  44682. }
  44683. return number + '-ე';
  44684. },
  44685. week: {
  44686. dow: 1,
  44687. doy: 7,
  44688. },
  44689. });
  44690. return ka;
  44691. })));
  44692. /***/ }),
  44693. /***/ "./node_modules/moment/locale/kk.js":
  44694. /*!******************************************!*\
  44695. !*** ./node_modules/moment/locale/kk.js ***!
  44696. \******************************************/
  44697. /*! no static exports found */
  44698. /***/ (function(module, exports, __webpack_require__) {
  44699. //! moment.js locale configuration
  44700. //! locale : Kazakh [kk]
  44701. //! authors : Nurlan Rakhimzhanov : https://github.com/nurlan
  44702. ;(function (global, factory) {
  44703. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  44704. undefined
  44705. }(this, (function (moment) { 'use strict';
  44706. //! moment.js locale configuration
  44707. var suffixes = {
  44708. 0: '-ші',
  44709. 1: '-ші',
  44710. 2: '-ші',
  44711. 3: '-ші',
  44712. 4: '-ші',
  44713. 5: '-ші',
  44714. 6: '-шы',
  44715. 7: '-ші',
  44716. 8: '-ші',
  44717. 9: '-шы',
  44718. 10: '-шы',
  44719. 20: '-шы',
  44720. 30: '-шы',
  44721. 40: '-шы',
  44722. 50: '-ші',
  44723. 60: '-шы',
  44724. 70: '-ші',
  44725. 80: '-ші',
  44726. 90: '-шы',
  44727. 100: '-ші',
  44728. };
  44729. var kk = moment.defineLocale('kk', {
  44730. months: 'қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан'.split(
  44731. '_'
  44732. ),
  44733. monthsShort: 'қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел'.split('_'),
  44734. weekdays: 'жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі'.split(
  44735. '_'
  44736. ),
  44737. weekdaysShort: 'жек_дүй_сей_сәр_бей_жұм_сен'.split('_'),
  44738. weekdaysMin: 'жк_дй_сй_ср_бй_жм_сн'.split('_'),
  44739. longDateFormat: {
  44740. LT: 'HH:mm',
  44741. LTS: 'HH:mm:ss',
  44742. L: 'DD.MM.YYYY',
  44743. LL: 'D MMMM YYYY',
  44744. LLL: 'D MMMM YYYY HH:mm',
  44745. LLLL: 'dddd, D MMMM YYYY HH:mm',
  44746. },
  44747. calendar: {
  44748. sameDay: '[Бүгін сағат] LT',
  44749. nextDay: '[Ертең сағат] LT',
  44750. nextWeek: 'dddd [сағат] LT',
  44751. lastDay: '[Кеше сағат] LT',
  44752. lastWeek: '[Өткен аптаның] dddd [сағат] LT',
  44753. sameElse: 'L',
  44754. },
  44755. relativeTime: {
  44756. future: '%s ішінде',
  44757. past: '%s бұрын',
  44758. s: 'бірнеше секунд',
  44759. ss: '%d секунд',
  44760. m: 'бір минут',
  44761. mm: '%d минут',
  44762. h: 'бір сағат',
  44763. hh: '%d сағат',
  44764. d: 'бір күн',
  44765. dd: '%d күн',
  44766. M: 'бір ай',
  44767. MM: '%d ай',
  44768. y: 'бір жыл',
  44769. yy: '%d жыл',
  44770. },
  44771. dayOfMonthOrdinalParse: /\d{1,2}-(ші|шы)/,
  44772. ordinal: function (number) {
  44773. var a = number % 10,
  44774. b = number >= 100 ? 100 : null;
  44775. return number + (suffixes[number] || suffixes[a] || suffixes[b]);
  44776. },
  44777. week: {
  44778. dow: 1, // Monday is the first day of the week.
  44779. doy: 7, // The week that contains Jan 7th is the first week of the year.
  44780. },
  44781. });
  44782. return kk;
  44783. })));
  44784. /***/ }),
  44785. /***/ "./node_modules/moment/locale/km.js":
  44786. /*!******************************************!*\
  44787. !*** ./node_modules/moment/locale/km.js ***!
  44788. \******************************************/
  44789. /*! no static exports found */
  44790. /***/ (function(module, exports, __webpack_require__) {
  44791. //! moment.js locale configuration
  44792. //! locale : Cambodian [km]
  44793. //! author : Kruy Vanna : https://github.com/kruyvanna
  44794. ;(function (global, factory) {
  44795. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  44796. undefined
  44797. }(this, (function (moment) { 'use strict';
  44798. //! moment.js locale configuration
  44799. var symbolMap = {
  44800. '1': '១',
  44801. '2': '២',
  44802. '3': '៣',
  44803. '4': '៤',
  44804. '5': '៥',
  44805. '6': '៦',
  44806. '7': '៧',
  44807. '8': '៨',
  44808. '9': '៩',
  44809. '0': '០',
  44810. },
  44811. numberMap = {
  44812. '១': '1',
  44813. '២': '2',
  44814. '៣': '3',
  44815. '៤': '4',
  44816. '៥': '5',
  44817. '៦': '6',
  44818. '៧': '7',
  44819. '៨': '8',
  44820. '៩': '9',
  44821. '០': '0',
  44822. };
  44823. var km = moment.defineLocale('km', {
  44824. months: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split(
  44825. '_'
  44826. ),
  44827. monthsShort: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split(
  44828. '_'
  44829. ),
  44830. weekdays: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),
  44831. weekdaysShort: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'),
  44832. weekdaysMin: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'),
  44833. weekdaysParseExact: true,
  44834. longDateFormat: {
  44835. LT: 'HH:mm',
  44836. LTS: 'HH:mm:ss',
  44837. L: 'DD/MM/YYYY',
  44838. LL: 'D MMMM YYYY',
  44839. LLL: 'D MMMM YYYY HH:mm',
  44840. LLLL: 'dddd, D MMMM YYYY HH:mm',
  44841. },
  44842. meridiemParse: /ព្រឹក|ល្ងាច/,
  44843. isPM: function (input) {
  44844. return input === 'ល្ងាច';
  44845. },
  44846. meridiem: function (hour, minute, isLower) {
  44847. if (hour < 12) {
  44848. return 'ព្រឹក';
  44849. } else {
  44850. return 'ល្ងាច';
  44851. }
  44852. },
  44853. calendar: {
  44854. sameDay: '[ថ្ងៃនេះ ម៉ោង] LT',
  44855. nextDay: '[ស្អែក ម៉ោង] LT',
  44856. nextWeek: 'dddd [ម៉ោង] LT',
  44857. lastDay: '[ម្សិលមិញ ម៉ោង] LT',
  44858. lastWeek: 'dddd [សប្តាហ៍មុន] [ម៉ោង] LT',
  44859. sameElse: 'L',
  44860. },
  44861. relativeTime: {
  44862. future: '%sទៀត',
  44863. past: '%sមុន',
  44864. s: 'ប៉ុន្មានវិនាទី',
  44865. ss: '%d វិនាទី',
  44866. m: 'មួយនាទី',
  44867. mm: '%d នាទី',
  44868. h: 'មួយម៉ោង',
  44869. hh: '%d ម៉ោង',
  44870. d: 'មួយថ្ងៃ',
  44871. dd: '%d ថ្ងៃ',
  44872. M: 'មួយខែ',
  44873. MM: '%d ខែ',
  44874. y: 'មួយឆ្នាំ',
  44875. yy: '%d ឆ្នាំ',
  44876. },
  44877. dayOfMonthOrdinalParse: /ទី\d{1,2}/,
  44878. ordinal: 'ទី%d',
  44879. preparse: function (string) {
  44880. return string.replace(/[១២៣៤៥៦៧៨៩០]/g, function (match) {
  44881. return numberMap[match];
  44882. });
  44883. },
  44884. postformat: function (string) {
  44885. return string.replace(/\d/g, function (match) {
  44886. return symbolMap[match];
  44887. });
  44888. },
  44889. week: {
  44890. dow: 1, // Monday is the first day of the week.
  44891. doy: 4, // The week that contains Jan 4th is the first week of the year.
  44892. },
  44893. });
  44894. return km;
  44895. })));
  44896. /***/ }),
  44897. /***/ "./node_modules/moment/locale/kn.js":
  44898. /*!******************************************!*\
  44899. !*** ./node_modules/moment/locale/kn.js ***!
  44900. \******************************************/
  44901. /*! no static exports found */
  44902. /***/ (function(module, exports, __webpack_require__) {
  44903. //! moment.js locale configuration
  44904. //! locale : Kannada [kn]
  44905. //! author : Rajeev Naik : https://github.com/rajeevnaikte
  44906. ;(function (global, factory) {
  44907. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  44908. undefined
  44909. }(this, (function (moment) { 'use strict';
  44910. //! moment.js locale configuration
  44911. var symbolMap = {
  44912. '1': '೧',
  44913. '2': '೨',
  44914. '3': '೩',
  44915. '4': '೪',
  44916. '5': '೫',
  44917. '6': '೬',
  44918. '7': '೭',
  44919. '8': '೮',
  44920. '9': '೯',
  44921. '0': '೦',
  44922. },
  44923. numberMap = {
  44924. '೧': '1',
  44925. '೨': '2',
  44926. '೩': '3',
  44927. '೪': '4',
  44928. '೫': '5',
  44929. '೬': '6',
  44930. '೭': '7',
  44931. '೮': '8',
  44932. '೯': '9',
  44933. '೦': '0',
  44934. };
  44935. var kn = moment.defineLocale('kn', {
  44936. months: 'ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್'.split(
  44937. '_'
  44938. ),
  44939. monthsShort: 'ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ'.split(
  44940. '_'
  44941. ),
  44942. monthsParseExact: true,
  44943. weekdays: 'ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ'.split(
  44944. '_'
  44945. ),
  44946. weekdaysShort: 'ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ'.split('_'),
  44947. weekdaysMin: 'ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ'.split('_'),
  44948. longDateFormat: {
  44949. LT: 'A h:mm',
  44950. LTS: 'A h:mm:ss',
  44951. L: 'DD/MM/YYYY',
  44952. LL: 'D MMMM YYYY',
  44953. LLL: 'D MMMM YYYY, A h:mm',
  44954. LLLL: 'dddd, D MMMM YYYY, A h:mm',
  44955. },
  44956. calendar: {
  44957. sameDay: '[ಇಂದು] LT',
  44958. nextDay: '[ನಾಳೆ] LT',
  44959. nextWeek: 'dddd, LT',
  44960. lastDay: '[ನಿನ್ನೆ] LT',
  44961. lastWeek: '[ಕೊನೆಯ] dddd, LT',
  44962. sameElse: 'L',
  44963. },
  44964. relativeTime: {
  44965. future: '%s ನಂತರ',
  44966. past: '%s ಹಿಂದೆ',
  44967. s: 'ಕೆಲವು ಕ್ಷಣಗಳು',
  44968. ss: '%d ಸೆಕೆಂಡುಗಳು',
  44969. m: 'ಒಂದು ನಿಮಿಷ',
  44970. mm: '%d ನಿಮಿಷ',
  44971. h: 'ಒಂದು ಗಂಟೆ',
  44972. hh: '%d ಗಂಟೆ',
  44973. d: 'ಒಂದು ದಿನ',
  44974. dd: '%d ದಿನ',
  44975. M: 'ಒಂದು ತಿಂಗಳು',
  44976. MM: '%d ತಿಂಗಳು',
  44977. y: 'ಒಂದು ವರ್ಷ',
  44978. yy: '%d ವರ್ಷ',
  44979. },
  44980. preparse: function (string) {
  44981. return string.replace(/[೧೨೩೪೫೬೭೮೯೦]/g, function (match) {
  44982. return numberMap[match];
  44983. });
  44984. },
  44985. postformat: function (string) {
  44986. return string.replace(/\d/g, function (match) {
  44987. return symbolMap[match];
  44988. });
  44989. },
  44990. meridiemParse: /ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/,
  44991. meridiemHour: function (hour, meridiem) {
  44992. if (hour === 12) {
  44993. hour = 0;
  44994. }
  44995. if (meridiem === 'ರಾತ್ರಿ') {
  44996. return hour < 4 ? hour : hour + 12;
  44997. } else if (meridiem === 'ಬೆಳಿಗ್ಗೆ') {
  44998. return hour;
  44999. } else if (meridiem === 'ಮಧ್ಯಾಹ್ನ') {
  45000. return hour >= 10 ? hour : hour + 12;
  45001. } else if (meridiem === 'ಸಂಜೆ') {
  45002. return hour + 12;
  45003. }
  45004. },
  45005. meridiem: function (hour, minute, isLower) {
  45006. if (hour < 4) {
  45007. return 'ರಾತ್ರಿ';
  45008. } else if (hour < 10) {
  45009. return 'ಬೆಳಿಗ್ಗೆ';
  45010. } else if (hour < 17) {
  45011. return 'ಮಧ್ಯಾಹ್ನ';
  45012. } else if (hour < 20) {
  45013. return 'ಸಂಜೆ';
  45014. } else {
  45015. return 'ರಾತ್ರಿ';
  45016. }
  45017. },
  45018. dayOfMonthOrdinalParse: /\d{1,2}(ನೇ)/,
  45019. ordinal: function (number) {
  45020. return number + 'ನೇ';
  45021. },
  45022. week: {
  45023. dow: 0, // Sunday is the first day of the week.
  45024. doy: 6, // The week that contains Jan 6th is the first week of the year.
  45025. },
  45026. });
  45027. return kn;
  45028. })));
  45029. /***/ }),
  45030. /***/ "./node_modules/moment/locale/ko.js":
  45031. /*!******************************************!*\
  45032. !*** ./node_modules/moment/locale/ko.js ***!
  45033. \******************************************/
  45034. /*! no static exports found */
  45035. /***/ (function(module, exports, __webpack_require__) {
  45036. //! moment.js locale configuration
  45037. //! locale : Korean [ko]
  45038. //! author : Kyungwook, Park : https://github.com/kyungw00k
  45039. //! author : Jeeeyul Lee <jeeeyul@gmail.com>
  45040. ;(function (global, factory) {
  45041. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  45042. undefined
  45043. }(this, (function (moment) { 'use strict';
  45044. //! moment.js locale configuration
  45045. var ko = moment.defineLocale('ko', {
  45046. months: '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),
  45047. monthsShort: '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split(
  45048. '_'
  45049. ),
  45050. weekdays: '일요일_월요일_화요일_수요일_목요일_금요일_토요일'.split('_'),
  45051. weekdaysShort: '일_월_화_수_목_금_토'.split('_'),
  45052. weekdaysMin: '일_월_화_수_목_금_토'.split('_'),
  45053. longDateFormat: {
  45054. LT: 'A h:mm',
  45055. LTS: 'A h:mm:ss',
  45056. L: 'YYYY.MM.DD.',
  45057. LL: 'YYYY년 MMMM D일',
  45058. LLL: 'YYYY년 MMMM D일 A h:mm',
  45059. LLLL: 'YYYY년 MMMM D일 dddd A h:mm',
  45060. l: 'YYYY.MM.DD.',
  45061. ll: 'YYYY년 MMMM D일',
  45062. lll: 'YYYY년 MMMM D일 A h:mm',
  45063. llll: 'YYYY년 MMMM D일 dddd A h:mm',
  45064. },
  45065. calendar: {
  45066. sameDay: '오늘 LT',
  45067. nextDay: '내일 LT',
  45068. nextWeek: 'dddd LT',
  45069. lastDay: '어제 LT',
  45070. lastWeek: '지난주 dddd LT',
  45071. sameElse: 'L',
  45072. },
  45073. relativeTime: {
  45074. future: '%s 후',
  45075. past: '%s 전',
  45076. s: '몇 초',
  45077. ss: '%d초',
  45078. m: '1분',
  45079. mm: '%d분',
  45080. h: '한 시간',
  45081. hh: '%d시간',
  45082. d: '하루',
  45083. dd: '%d일',
  45084. M: '한 달',
  45085. MM: '%d달',
  45086. y: '일 년',
  45087. yy: '%d년',
  45088. },
  45089. dayOfMonthOrdinalParse: /\d{1,2}(일|월|주)/,
  45090. ordinal: function (number, period) {
  45091. switch (period) {
  45092. case 'd':
  45093. case 'D':
  45094. case 'DDD':
  45095. return number + '일';
  45096. case 'M':
  45097. return number + '월';
  45098. case 'w':
  45099. case 'W':
  45100. return number + '주';
  45101. default:
  45102. return number;
  45103. }
  45104. },
  45105. meridiemParse: /오전|오후/,
  45106. isPM: function (token) {
  45107. return token === '오후';
  45108. },
  45109. meridiem: function (hour, minute, isUpper) {
  45110. return hour < 12 ? '오전' : '오후';
  45111. },
  45112. });
  45113. return ko;
  45114. })));
  45115. /***/ }),
  45116. /***/ "./node_modules/moment/locale/ku.js":
  45117. /*!******************************************!*\
  45118. !*** ./node_modules/moment/locale/ku.js ***!
  45119. \******************************************/
  45120. /*! no static exports found */
  45121. /***/ (function(module, exports, __webpack_require__) {
  45122. //! moment.js locale configuration
  45123. //! locale : Kurdish [ku]
  45124. //! author : Shahram Mebashar : https://github.com/ShahramMebashar
  45125. ;(function (global, factory) {
  45126. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  45127. undefined
  45128. }(this, (function (moment) { 'use strict';
  45129. //! moment.js locale configuration
  45130. var symbolMap = {
  45131. '1': '١',
  45132. '2': '٢',
  45133. '3': '٣',
  45134. '4': '٤',
  45135. '5': '٥',
  45136. '6': '٦',
  45137. '7': '٧',
  45138. '8': '٨',
  45139. '9': '٩',
  45140. '0': '٠',
  45141. },
  45142. numberMap = {
  45143. '١': '1',
  45144. '٢': '2',
  45145. '٣': '3',
  45146. '٤': '4',
  45147. '٥': '5',
  45148. '٦': '6',
  45149. '٧': '7',
  45150. '٨': '8',
  45151. '٩': '9',
  45152. '٠': '0',
  45153. },
  45154. months = [
  45155. 'کانونی دووەم',
  45156. 'شوبات',
  45157. 'ئازار',
  45158. 'نیسان',
  45159. 'ئایار',
  45160. 'حوزەیران',
  45161. 'تەمموز',
  45162. 'ئاب',
  45163. 'ئەیلوول',
  45164. 'تشرینی یەكەم',
  45165. 'تشرینی دووەم',
  45166. 'كانونی یەکەم',
  45167. ];
  45168. var ku = moment.defineLocale('ku', {
  45169. months: months,
  45170. monthsShort: months,
  45171. weekdays: 'یه‌كشه‌ممه‌_دووشه‌ممه‌_سێشه‌ممه‌_چوارشه‌ممه‌_پێنجشه‌ممه‌_هه‌ینی_شه‌ممه‌'.split(
  45172. '_'
  45173. ),
  45174. weekdaysShort: 'یه‌كشه‌م_دووشه‌م_سێشه‌م_چوارشه‌م_پێنجشه‌م_هه‌ینی_شه‌ممه‌'.split(
  45175. '_'
  45176. ),
  45177. weekdaysMin: 'ی_د_س_چ_پ_ه_ش'.split('_'),
  45178. weekdaysParseExact: true,
  45179. longDateFormat: {
  45180. LT: 'HH:mm',
  45181. LTS: 'HH:mm:ss',
  45182. L: 'DD/MM/YYYY',
  45183. LL: 'D MMMM YYYY',
  45184. LLL: 'D MMMM YYYY HH:mm',
  45185. LLLL: 'dddd, D MMMM YYYY HH:mm',
  45186. },
  45187. meridiemParse: /ئێواره‌|به‌یانی/,
  45188. isPM: function (input) {
  45189. return /ئێواره‌/.test(input);
  45190. },
  45191. meridiem: function (hour, minute, isLower) {
  45192. if (hour < 12) {
  45193. return 'به‌یانی';
  45194. } else {
  45195. return 'ئێواره‌';
  45196. }
  45197. },
  45198. calendar: {
  45199. sameDay: '[ئه‌مرۆ كاتژمێر] LT',
  45200. nextDay: '[به‌یانی كاتژمێر] LT',
  45201. nextWeek: 'dddd [كاتژمێر] LT',
  45202. lastDay: '[دوێنێ كاتژمێر] LT',
  45203. lastWeek: 'dddd [كاتژمێر] LT',
  45204. sameElse: 'L',
  45205. },
  45206. relativeTime: {
  45207. future: 'له‌ %s',
  45208. past: '%s',
  45209. s: 'چه‌ند چركه‌یه‌ك',
  45210. ss: 'چركه‌ %d',
  45211. m: 'یه‌ك خوله‌ك',
  45212. mm: '%d خوله‌ك',
  45213. h: 'یه‌ك كاتژمێر',
  45214. hh: '%d كاتژمێر',
  45215. d: 'یه‌ك ڕۆژ',
  45216. dd: '%d ڕۆژ',
  45217. M: 'یه‌ك مانگ',
  45218. MM: '%d مانگ',
  45219. y: 'یه‌ك ساڵ',
  45220. yy: '%d ساڵ',
  45221. },
  45222. preparse: function (string) {
  45223. return string
  45224. .replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
  45225. return numberMap[match];
  45226. })
  45227. .replace(/،/g, ',');
  45228. },
  45229. postformat: function (string) {
  45230. return string
  45231. .replace(/\d/g, function (match) {
  45232. return symbolMap[match];
  45233. })
  45234. .replace(/,/g, '،');
  45235. },
  45236. week: {
  45237. dow: 6, // Saturday is the first day of the week.
  45238. doy: 12, // The week that contains Jan 12th is the first week of the year.
  45239. },
  45240. });
  45241. return ku;
  45242. })));
  45243. /***/ }),
  45244. /***/ "./node_modules/moment/locale/ky.js":
  45245. /*!******************************************!*\
  45246. !*** ./node_modules/moment/locale/ky.js ***!
  45247. \******************************************/
  45248. /*! no static exports found */
  45249. /***/ (function(module, exports, __webpack_require__) {
  45250. //! moment.js locale configuration
  45251. //! locale : Kyrgyz [ky]
  45252. //! author : Chyngyz Arystan uulu : https://github.com/chyngyz
  45253. ;(function (global, factory) {
  45254. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  45255. undefined
  45256. }(this, (function (moment) { 'use strict';
  45257. //! moment.js locale configuration
  45258. var suffixes = {
  45259. 0: '-чү',
  45260. 1: '-чи',
  45261. 2: '-чи',
  45262. 3: '-чү',
  45263. 4: '-чү',
  45264. 5: '-чи',
  45265. 6: '-чы',
  45266. 7: '-чи',
  45267. 8: '-чи',
  45268. 9: '-чу',
  45269. 10: '-чу',
  45270. 20: '-чы',
  45271. 30: '-чу',
  45272. 40: '-чы',
  45273. 50: '-чү',
  45274. 60: '-чы',
  45275. 70: '-чи',
  45276. 80: '-чи',
  45277. 90: '-чу',
  45278. 100: '-чү',
  45279. };
  45280. var ky = moment.defineLocale('ky', {
  45281. months: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split(
  45282. '_'
  45283. ),
  45284. monthsShort: 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split(
  45285. '_'
  45286. ),
  45287. weekdays: 'Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби'.split(
  45288. '_'
  45289. ),
  45290. weekdaysShort: 'Жек_Дүй_Шей_Шар_Бей_Жум_Ише'.split('_'),
  45291. weekdaysMin: 'Жк_Дй_Шй_Шр_Бй_Жм_Иш'.split('_'),
  45292. longDateFormat: {
  45293. LT: 'HH:mm',
  45294. LTS: 'HH:mm:ss',
  45295. L: 'DD.MM.YYYY',
  45296. LL: 'D MMMM YYYY',
  45297. LLL: 'D MMMM YYYY HH:mm',
  45298. LLLL: 'dddd, D MMMM YYYY HH:mm',
  45299. },
  45300. calendar: {
  45301. sameDay: '[Бүгүн саат] LT',
  45302. nextDay: '[Эртең саат] LT',
  45303. nextWeek: 'dddd [саат] LT',
  45304. lastDay: '[Кечээ саат] LT',
  45305. lastWeek: '[Өткөн аптанын] dddd [күнү] [саат] LT',
  45306. sameElse: 'L',
  45307. },
  45308. relativeTime: {
  45309. future: '%s ичинде',
  45310. past: '%s мурун',
  45311. s: 'бирнече секунд',
  45312. ss: '%d секунд',
  45313. m: 'бир мүнөт',
  45314. mm: '%d мүнөт',
  45315. h: 'бир саат',
  45316. hh: '%d саат',
  45317. d: 'бир күн',
  45318. dd: '%d күн',
  45319. M: 'бир ай',
  45320. MM: '%d ай',
  45321. y: 'бир жыл',
  45322. yy: '%d жыл',
  45323. },
  45324. dayOfMonthOrdinalParse: /\d{1,2}-(чи|чы|чү|чу)/,
  45325. ordinal: function (number) {
  45326. var a = number % 10,
  45327. b = number >= 100 ? 100 : null;
  45328. return number + (suffixes[number] || suffixes[a] || suffixes[b]);
  45329. },
  45330. week: {
  45331. dow: 1, // Monday is the first day of the week.
  45332. doy: 7, // The week that contains Jan 7th is the first week of the year.
  45333. },
  45334. });
  45335. return ky;
  45336. })));
  45337. /***/ }),
  45338. /***/ "./node_modules/moment/locale/lb.js":
  45339. /*!******************************************!*\
  45340. !*** ./node_modules/moment/locale/lb.js ***!
  45341. \******************************************/
  45342. /*! no static exports found */
  45343. /***/ (function(module, exports, __webpack_require__) {
  45344. //! moment.js locale configuration
  45345. //! locale : Luxembourgish [lb]
  45346. //! author : mweimerskirch : https://github.com/mweimerskirch
  45347. //! author : David Raison : https://github.com/kwisatz
  45348. ;(function (global, factory) {
  45349. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  45350. undefined
  45351. }(this, (function (moment) { 'use strict';
  45352. //! moment.js locale configuration
  45353. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  45354. var format = {
  45355. m: ['eng Minutt', 'enger Minutt'],
  45356. h: ['eng Stonn', 'enger Stonn'],
  45357. d: ['een Dag', 'engem Dag'],
  45358. M: ['ee Mount', 'engem Mount'],
  45359. y: ['ee Joer', 'engem Joer'],
  45360. };
  45361. return withoutSuffix ? format[key][0] : format[key][1];
  45362. }
  45363. function processFutureTime(string) {
  45364. var number = string.substr(0, string.indexOf(' '));
  45365. if (eifelerRegelAppliesToNumber(number)) {
  45366. return 'a ' + string;
  45367. }
  45368. return 'an ' + string;
  45369. }
  45370. function processPastTime(string) {
  45371. var number = string.substr(0, string.indexOf(' '));
  45372. if (eifelerRegelAppliesToNumber(number)) {
  45373. return 'viru ' + string;
  45374. }
  45375. return 'virun ' + string;
  45376. }
  45377. /**
  45378. * Returns true if the word before the given number loses the '-n' ending.
  45379. * e.g. 'an 10 Deeg' but 'a 5 Deeg'
  45380. *
  45381. * @param number {integer}
  45382. * @returns {boolean}
  45383. */
  45384. function eifelerRegelAppliesToNumber(number) {
  45385. number = parseInt(number, 10);
  45386. if (isNaN(number)) {
  45387. return false;
  45388. }
  45389. if (number < 0) {
  45390. // Negative Number --> always true
  45391. return true;
  45392. } else if (number < 10) {
  45393. // Only 1 digit
  45394. if (4 <= number && number <= 7) {
  45395. return true;
  45396. }
  45397. return false;
  45398. } else if (number < 100) {
  45399. // 2 digits
  45400. var lastDigit = number % 10,
  45401. firstDigit = number / 10;
  45402. if (lastDigit === 0) {
  45403. return eifelerRegelAppliesToNumber(firstDigit);
  45404. }
  45405. return eifelerRegelAppliesToNumber(lastDigit);
  45406. } else if (number < 10000) {
  45407. // 3 or 4 digits --> recursively check first digit
  45408. while (number >= 10) {
  45409. number = number / 10;
  45410. }
  45411. return eifelerRegelAppliesToNumber(number);
  45412. } else {
  45413. // Anything larger than 4 digits: recursively check first n-3 digits
  45414. number = number / 1000;
  45415. return eifelerRegelAppliesToNumber(number);
  45416. }
  45417. }
  45418. var lb = moment.defineLocale('lb', {
  45419. months: 'Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember'.split(
  45420. '_'
  45421. ),
  45422. monthsShort: 'Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split(
  45423. '_'
  45424. ),
  45425. monthsParseExact: true,
  45426. weekdays: 'Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg'.split(
  45427. '_'
  45428. ),
  45429. weekdaysShort: 'So._Mé._Dë._Më._Do._Fr._Sa.'.split('_'),
  45430. weekdaysMin: 'So_Mé_Dë_Më_Do_Fr_Sa'.split('_'),
  45431. weekdaysParseExact: true,
  45432. longDateFormat: {
  45433. LT: 'H:mm [Auer]',
  45434. LTS: 'H:mm:ss [Auer]',
  45435. L: 'DD.MM.YYYY',
  45436. LL: 'D. MMMM YYYY',
  45437. LLL: 'D. MMMM YYYY H:mm [Auer]',
  45438. LLLL: 'dddd, D. MMMM YYYY H:mm [Auer]',
  45439. },
  45440. calendar: {
  45441. sameDay: '[Haut um] LT',
  45442. sameElse: 'L',
  45443. nextDay: '[Muer um] LT',
  45444. nextWeek: 'dddd [um] LT',
  45445. lastDay: '[Gëschter um] LT',
  45446. lastWeek: function () {
  45447. // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule
  45448. switch (this.day()) {
  45449. case 2:
  45450. case 4:
  45451. return '[Leschten] dddd [um] LT';
  45452. default:
  45453. return '[Leschte] dddd [um] LT';
  45454. }
  45455. },
  45456. },
  45457. relativeTime: {
  45458. future: processFutureTime,
  45459. past: processPastTime,
  45460. s: 'e puer Sekonnen',
  45461. ss: '%d Sekonnen',
  45462. m: processRelativeTime,
  45463. mm: '%d Minutten',
  45464. h: processRelativeTime,
  45465. hh: '%d Stonnen',
  45466. d: processRelativeTime,
  45467. dd: '%d Deeg',
  45468. M: processRelativeTime,
  45469. MM: '%d Méint',
  45470. y: processRelativeTime,
  45471. yy: '%d Joer',
  45472. },
  45473. dayOfMonthOrdinalParse: /\d{1,2}\./,
  45474. ordinal: '%d.',
  45475. week: {
  45476. dow: 1, // Monday is the first day of the week.
  45477. doy: 4, // The week that contains Jan 4th is the first week of the year.
  45478. },
  45479. });
  45480. return lb;
  45481. })));
  45482. /***/ }),
  45483. /***/ "./node_modules/moment/locale/lo.js":
  45484. /*!******************************************!*\
  45485. !*** ./node_modules/moment/locale/lo.js ***!
  45486. \******************************************/
  45487. /*! no static exports found */
  45488. /***/ (function(module, exports, __webpack_require__) {
  45489. //! moment.js locale configuration
  45490. //! locale : Lao [lo]
  45491. //! author : Ryan Hart : https://github.com/ryanhart2
  45492. ;(function (global, factory) {
  45493. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  45494. undefined
  45495. }(this, (function (moment) { 'use strict';
  45496. //! moment.js locale configuration
  45497. var lo = moment.defineLocale('lo', {
  45498. months: 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split(
  45499. '_'
  45500. ),
  45501. monthsShort: 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split(
  45502. '_'
  45503. ),
  45504. weekdays: 'ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'),
  45505. weekdaysShort: 'ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'),
  45506. weekdaysMin: 'ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ'.split('_'),
  45507. weekdaysParseExact: true,
  45508. longDateFormat: {
  45509. LT: 'HH:mm',
  45510. LTS: 'HH:mm:ss',
  45511. L: 'DD/MM/YYYY',
  45512. LL: 'D MMMM YYYY',
  45513. LLL: 'D MMMM YYYY HH:mm',
  45514. LLLL: 'ວັນdddd D MMMM YYYY HH:mm',
  45515. },
  45516. meridiemParse: /ຕອນເຊົ້າ|ຕອນແລງ/,
  45517. isPM: function (input) {
  45518. return input === 'ຕອນແລງ';
  45519. },
  45520. meridiem: function (hour, minute, isLower) {
  45521. if (hour < 12) {
  45522. return 'ຕອນເຊົ້າ';
  45523. } else {
  45524. return 'ຕອນແລງ';
  45525. }
  45526. },
  45527. calendar: {
  45528. sameDay: '[ມື້ນີ້ເວລາ] LT',
  45529. nextDay: '[ມື້ອື່ນເວລາ] LT',
  45530. nextWeek: '[ວັນ]dddd[ໜ້າເວລາ] LT',
  45531. lastDay: '[ມື້ວານນີ້ເວລາ] LT',
  45532. lastWeek: '[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT',
  45533. sameElse: 'L',
  45534. },
  45535. relativeTime: {
  45536. future: 'ອີກ %s',
  45537. past: '%sຜ່ານມາ',
  45538. s: 'ບໍ່ເທົ່າໃດວິນາທີ',
  45539. ss: '%d ວິນາທີ',
  45540. m: '1 ນາທີ',
  45541. mm: '%d ນາທີ',
  45542. h: '1 ຊົ່ວໂມງ',
  45543. hh: '%d ຊົ່ວໂມງ',
  45544. d: '1 ມື້',
  45545. dd: '%d ມື້',
  45546. M: '1 ເດືອນ',
  45547. MM: '%d ເດືອນ',
  45548. y: '1 ປີ',
  45549. yy: '%d ປີ',
  45550. },
  45551. dayOfMonthOrdinalParse: /(ທີ່)\d{1,2}/,
  45552. ordinal: function (number) {
  45553. return 'ທີ່' + number;
  45554. },
  45555. });
  45556. return lo;
  45557. })));
  45558. /***/ }),
  45559. /***/ "./node_modules/moment/locale/lt.js":
  45560. /*!******************************************!*\
  45561. !*** ./node_modules/moment/locale/lt.js ***!
  45562. \******************************************/
  45563. /*! no static exports found */
  45564. /***/ (function(module, exports, __webpack_require__) {
  45565. //! moment.js locale configuration
  45566. //! locale : Lithuanian [lt]
  45567. //! author : Mindaugas Mozūras : https://github.com/mmozuras
  45568. ;(function (global, factory) {
  45569. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  45570. undefined
  45571. }(this, (function (moment) { 'use strict';
  45572. //! moment.js locale configuration
  45573. var units = {
  45574. ss: 'sekundė_sekundžių_sekundes',
  45575. m: 'minutė_minutės_minutę',
  45576. mm: 'minutės_minučių_minutes',
  45577. h: 'valanda_valandos_valandą',
  45578. hh: 'valandos_valandų_valandas',
  45579. d: 'diena_dienos_dieną',
  45580. dd: 'dienos_dienų_dienas',
  45581. M: 'mėnuo_mėnesio_mėnesį',
  45582. MM: 'mėnesiai_mėnesių_mėnesius',
  45583. y: 'metai_metų_metus',
  45584. yy: 'metai_metų_metus',
  45585. };
  45586. function translateSeconds(number, withoutSuffix, key, isFuture) {
  45587. if (withoutSuffix) {
  45588. return 'kelios sekundės';
  45589. } else {
  45590. return isFuture ? 'kelių sekundžių' : 'kelias sekundes';
  45591. }
  45592. }
  45593. function translateSingular(number, withoutSuffix, key, isFuture) {
  45594. return withoutSuffix
  45595. ? forms(key)[0]
  45596. : isFuture
  45597. ? forms(key)[1]
  45598. : forms(key)[2];
  45599. }
  45600. function special(number) {
  45601. return number % 10 === 0 || (number > 10 && number < 20);
  45602. }
  45603. function forms(key) {
  45604. return units[key].split('_');
  45605. }
  45606. function translate(number, withoutSuffix, key, isFuture) {
  45607. var result = number + ' ';
  45608. if (number === 1) {
  45609. return (
  45610. result + translateSingular(number, withoutSuffix, key[0], isFuture)
  45611. );
  45612. } else if (withoutSuffix) {
  45613. return result + (special(number) ? forms(key)[1] : forms(key)[0]);
  45614. } else {
  45615. if (isFuture) {
  45616. return result + forms(key)[1];
  45617. } else {
  45618. return result + (special(number) ? forms(key)[1] : forms(key)[2]);
  45619. }
  45620. }
  45621. }
  45622. var lt = moment.defineLocale('lt', {
  45623. months: {
  45624. format: 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split(
  45625. '_'
  45626. ),
  45627. standalone: 'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis'.split(
  45628. '_'
  45629. ),
  45630. isFormat: /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/,
  45631. },
  45632. monthsShort: 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'),
  45633. weekdays: {
  45634. format: 'sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį'.split(
  45635. '_'
  45636. ),
  45637. standalone: 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split(
  45638. '_'
  45639. ),
  45640. isFormat: /dddd HH:mm/,
  45641. },
  45642. weekdaysShort: 'Sek_Pir_Ant_Tre_Ket_Pen_Šeš'.split('_'),
  45643. weekdaysMin: 'S_P_A_T_K_Pn_Š'.split('_'),
  45644. weekdaysParseExact: true,
  45645. longDateFormat: {
  45646. LT: 'HH:mm',
  45647. LTS: 'HH:mm:ss',
  45648. L: 'YYYY-MM-DD',
  45649. LL: 'YYYY [m.] MMMM D [d.]',
  45650. LLL: 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
  45651. LLLL: 'YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]',
  45652. l: 'YYYY-MM-DD',
  45653. ll: 'YYYY [m.] MMMM D [d.]',
  45654. lll: 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
  45655. llll: 'YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]',
  45656. },
  45657. calendar: {
  45658. sameDay: '[Šiandien] LT',
  45659. nextDay: '[Rytoj] LT',
  45660. nextWeek: 'dddd LT',
  45661. lastDay: '[Vakar] LT',
  45662. lastWeek: '[Praėjusį] dddd LT',
  45663. sameElse: 'L',
  45664. },
  45665. relativeTime: {
  45666. future: 'po %s',
  45667. past: 'prieš %s',
  45668. s: translateSeconds,
  45669. ss: translate,
  45670. m: translateSingular,
  45671. mm: translate,
  45672. h: translateSingular,
  45673. hh: translate,
  45674. d: translateSingular,
  45675. dd: translate,
  45676. M: translateSingular,
  45677. MM: translate,
  45678. y: translateSingular,
  45679. yy: translate,
  45680. },
  45681. dayOfMonthOrdinalParse: /\d{1,2}-oji/,
  45682. ordinal: function (number) {
  45683. return number + '-oji';
  45684. },
  45685. week: {
  45686. dow: 1, // Monday is the first day of the week.
  45687. doy: 4, // The week that contains Jan 4th is the first week of the year.
  45688. },
  45689. });
  45690. return lt;
  45691. })));
  45692. /***/ }),
  45693. /***/ "./node_modules/moment/locale/lv.js":
  45694. /*!******************************************!*\
  45695. !*** ./node_modules/moment/locale/lv.js ***!
  45696. \******************************************/
  45697. /*! no static exports found */
  45698. /***/ (function(module, exports, __webpack_require__) {
  45699. //! moment.js locale configuration
  45700. //! locale : Latvian [lv]
  45701. //! author : Kristaps Karlsons : https://github.com/skakri
  45702. //! author : Jānis Elmeris : https://github.com/JanisE
  45703. ;(function (global, factory) {
  45704. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  45705. undefined
  45706. }(this, (function (moment) { 'use strict';
  45707. //! moment.js locale configuration
  45708. var units = {
  45709. ss: 'sekundes_sekundēm_sekunde_sekundes'.split('_'),
  45710. m: 'minūtes_minūtēm_minūte_minūtes'.split('_'),
  45711. mm: 'minūtes_minūtēm_minūte_minūtes'.split('_'),
  45712. h: 'stundas_stundām_stunda_stundas'.split('_'),
  45713. hh: 'stundas_stundām_stunda_stundas'.split('_'),
  45714. d: 'dienas_dienām_diena_dienas'.split('_'),
  45715. dd: 'dienas_dienām_diena_dienas'.split('_'),
  45716. M: 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),
  45717. MM: 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),
  45718. y: 'gada_gadiem_gads_gadi'.split('_'),
  45719. yy: 'gada_gadiem_gads_gadi'.split('_'),
  45720. };
  45721. /**
  45722. * @param withoutSuffix boolean true = a length of time; false = before/after a period of time.
  45723. */
  45724. function format(forms, number, withoutSuffix) {
  45725. if (withoutSuffix) {
  45726. // E.g. "21 minūte", "3 minūtes".
  45727. return number % 10 === 1 && number % 100 !== 11 ? forms[2] : forms[3];
  45728. } else {
  45729. // E.g. "21 minūtes" as in "pēc 21 minūtes".
  45730. // E.g. "3 minūtēm" as in "pēc 3 minūtēm".
  45731. return number % 10 === 1 && number % 100 !== 11 ? forms[0] : forms[1];
  45732. }
  45733. }
  45734. function relativeTimeWithPlural(number, withoutSuffix, key) {
  45735. return number + ' ' + format(units[key], number, withoutSuffix);
  45736. }
  45737. function relativeTimeWithSingular(number, withoutSuffix, key) {
  45738. return format(units[key], number, withoutSuffix);
  45739. }
  45740. function relativeSeconds(number, withoutSuffix) {
  45741. return withoutSuffix ? 'dažas sekundes' : 'dažām sekundēm';
  45742. }
  45743. var lv = moment.defineLocale('lv', {
  45744. months: 'janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris'.split(
  45745. '_'
  45746. ),
  45747. monthsShort: 'jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec'.split('_'),
  45748. weekdays: 'svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena'.split(
  45749. '_'
  45750. ),
  45751. weekdaysShort: 'Sv_P_O_T_C_Pk_S'.split('_'),
  45752. weekdaysMin: 'Sv_P_O_T_C_Pk_S'.split('_'),
  45753. weekdaysParseExact: true,
  45754. longDateFormat: {
  45755. LT: 'HH:mm',
  45756. LTS: 'HH:mm:ss',
  45757. L: 'DD.MM.YYYY.',
  45758. LL: 'YYYY. [gada] D. MMMM',
  45759. LLL: 'YYYY. [gada] D. MMMM, HH:mm',
  45760. LLLL: 'YYYY. [gada] D. MMMM, dddd, HH:mm',
  45761. },
  45762. calendar: {
  45763. sameDay: '[Šodien pulksten] LT',
  45764. nextDay: '[Rīt pulksten] LT',
  45765. nextWeek: 'dddd [pulksten] LT',
  45766. lastDay: '[Vakar pulksten] LT',
  45767. lastWeek: '[Pagājušā] dddd [pulksten] LT',
  45768. sameElse: 'L',
  45769. },
  45770. relativeTime: {
  45771. future: 'pēc %s',
  45772. past: 'pirms %s',
  45773. s: relativeSeconds,
  45774. ss: relativeTimeWithPlural,
  45775. m: relativeTimeWithSingular,
  45776. mm: relativeTimeWithPlural,
  45777. h: relativeTimeWithSingular,
  45778. hh: relativeTimeWithPlural,
  45779. d: relativeTimeWithSingular,
  45780. dd: relativeTimeWithPlural,
  45781. M: relativeTimeWithSingular,
  45782. MM: relativeTimeWithPlural,
  45783. y: relativeTimeWithSingular,
  45784. yy: relativeTimeWithPlural,
  45785. },
  45786. dayOfMonthOrdinalParse: /\d{1,2}\./,
  45787. ordinal: '%d.',
  45788. week: {
  45789. dow: 1, // Monday is the first day of the week.
  45790. doy: 4, // The week that contains Jan 4th is the first week of the year.
  45791. },
  45792. });
  45793. return lv;
  45794. })));
  45795. /***/ }),
  45796. /***/ "./node_modules/moment/locale/me.js":
  45797. /*!******************************************!*\
  45798. !*** ./node_modules/moment/locale/me.js ***!
  45799. \******************************************/
  45800. /*! no static exports found */
  45801. /***/ (function(module, exports, __webpack_require__) {
  45802. //! moment.js locale configuration
  45803. //! locale : Montenegrin [me]
  45804. //! author : Miodrag Nikač <miodrag@restartit.me> : https://github.com/miodragnikac
  45805. ;(function (global, factory) {
  45806. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  45807. undefined
  45808. }(this, (function (moment) { 'use strict';
  45809. //! moment.js locale configuration
  45810. var translator = {
  45811. words: {
  45812. //Different grammatical cases
  45813. ss: ['sekund', 'sekunda', 'sekundi'],
  45814. m: ['jedan minut', 'jednog minuta'],
  45815. mm: ['minut', 'minuta', 'minuta'],
  45816. h: ['jedan sat', 'jednog sata'],
  45817. hh: ['sat', 'sata', 'sati'],
  45818. dd: ['dan', 'dana', 'dana'],
  45819. MM: ['mjesec', 'mjeseca', 'mjeseci'],
  45820. yy: ['godina', 'godine', 'godina'],
  45821. },
  45822. correctGrammaticalCase: function (number, wordKey) {
  45823. return number === 1
  45824. ? wordKey[0]
  45825. : number >= 2 && number <= 4
  45826. ? wordKey[1]
  45827. : wordKey[2];
  45828. },
  45829. translate: function (number, withoutSuffix, key) {
  45830. var wordKey = translator.words[key];
  45831. if (key.length === 1) {
  45832. return withoutSuffix ? wordKey[0] : wordKey[1];
  45833. } else {
  45834. return (
  45835. number +
  45836. ' ' +
  45837. translator.correctGrammaticalCase(number, wordKey)
  45838. );
  45839. }
  45840. },
  45841. };
  45842. var me = moment.defineLocale('me', {
  45843. months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split(
  45844. '_'
  45845. ),
  45846. monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split(
  45847. '_'
  45848. ),
  45849. monthsParseExact: true,
  45850. weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split(
  45851. '_'
  45852. ),
  45853. weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
  45854. weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
  45855. weekdaysParseExact: true,
  45856. longDateFormat: {
  45857. LT: 'H:mm',
  45858. LTS: 'H:mm:ss',
  45859. L: 'DD.MM.YYYY',
  45860. LL: 'D. MMMM YYYY',
  45861. LLL: 'D. MMMM YYYY H:mm',
  45862. LLLL: 'dddd, D. MMMM YYYY H:mm',
  45863. },
  45864. calendar: {
  45865. sameDay: '[danas u] LT',
  45866. nextDay: '[sjutra u] LT',
  45867. nextWeek: function () {
  45868. switch (this.day()) {
  45869. case 0:
  45870. return '[u] [nedjelju] [u] LT';
  45871. case 3:
  45872. return '[u] [srijedu] [u] LT';
  45873. case 6:
  45874. return '[u] [subotu] [u] LT';
  45875. case 1:
  45876. case 2:
  45877. case 4:
  45878. case 5:
  45879. return '[u] dddd [u] LT';
  45880. }
  45881. },
  45882. lastDay: '[juče u] LT',
  45883. lastWeek: function () {
  45884. var lastWeekDays = [
  45885. '[prošle] [nedjelje] [u] LT',
  45886. '[prošlog] [ponedjeljka] [u] LT',
  45887. '[prošlog] [utorka] [u] LT',
  45888. '[prošle] [srijede] [u] LT',
  45889. '[prošlog] [četvrtka] [u] LT',
  45890. '[prošlog] [petka] [u] LT',
  45891. '[prošle] [subote] [u] LT',
  45892. ];
  45893. return lastWeekDays[this.day()];
  45894. },
  45895. sameElse: 'L',
  45896. },
  45897. relativeTime: {
  45898. future: 'za %s',
  45899. past: 'prije %s',
  45900. s: 'nekoliko sekundi',
  45901. ss: translator.translate,
  45902. m: translator.translate,
  45903. mm: translator.translate,
  45904. h: translator.translate,
  45905. hh: translator.translate,
  45906. d: 'dan',
  45907. dd: translator.translate,
  45908. M: 'mjesec',
  45909. MM: translator.translate,
  45910. y: 'godinu',
  45911. yy: translator.translate,
  45912. },
  45913. dayOfMonthOrdinalParse: /\d{1,2}\./,
  45914. ordinal: '%d.',
  45915. week: {
  45916. dow: 1, // Monday is the first day of the week.
  45917. doy: 7, // The week that contains Jan 7th is the first week of the year.
  45918. },
  45919. });
  45920. return me;
  45921. })));
  45922. /***/ }),
  45923. /***/ "./node_modules/moment/locale/mi.js":
  45924. /*!******************************************!*\
  45925. !*** ./node_modules/moment/locale/mi.js ***!
  45926. \******************************************/
  45927. /*! no static exports found */
  45928. /***/ (function(module, exports, __webpack_require__) {
  45929. //! moment.js locale configuration
  45930. //! locale : Maori [mi]
  45931. //! author : John Corrigan <robbiecloset@gmail.com> : https://github.com/johnideal
  45932. ;(function (global, factory) {
  45933. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  45934. undefined
  45935. }(this, (function (moment) { 'use strict';
  45936. //! moment.js locale configuration
  45937. var mi = moment.defineLocale('mi', {
  45938. 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(
  45939. '_'
  45940. ),
  45941. monthsShort: 'Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki'.split(
  45942. '_'
  45943. ),
  45944. monthsRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,
  45945. monthsStrictRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,
  45946. monthsShortRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,
  45947. monthsShortStrictRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,
  45948. weekdays: 'Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei'.split('_'),
  45949. weekdaysShort: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'),
  45950. weekdaysMin: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'),
  45951. longDateFormat: {
  45952. LT: 'HH:mm',
  45953. LTS: 'HH:mm:ss',
  45954. L: 'DD/MM/YYYY',
  45955. LL: 'D MMMM YYYY',
  45956. LLL: 'D MMMM YYYY [i] HH:mm',
  45957. LLLL: 'dddd, D MMMM YYYY [i] HH:mm',
  45958. },
  45959. calendar: {
  45960. sameDay: '[i teie mahana, i] LT',
  45961. nextDay: '[apopo i] LT',
  45962. nextWeek: 'dddd [i] LT',
  45963. lastDay: '[inanahi i] LT',
  45964. lastWeek: 'dddd [whakamutunga i] LT',
  45965. sameElse: 'L',
  45966. },
  45967. relativeTime: {
  45968. future: 'i roto i %s',
  45969. past: '%s i mua',
  45970. s: 'te hēkona ruarua',
  45971. ss: '%d hēkona',
  45972. m: 'he meneti',
  45973. mm: '%d meneti',
  45974. h: 'te haora',
  45975. hh: '%d haora',
  45976. d: 'he ra',
  45977. dd: '%d ra',
  45978. M: 'he marama',
  45979. MM: '%d marama',
  45980. y: 'he tau',
  45981. yy: '%d tau',
  45982. },
  45983. dayOfMonthOrdinalParse: /\d{1,2}º/,
  45984. ordinal: '%dº',
  45985. week: {
  45986. dow: 1, // Monday is the first day of the week.
  45987. doy: 4, // The week that contains Jan 4th is the first week of the year.
  45988. },
  45989. });
  45990. return mi;
  45991. })));
  45992. /***/ }),
  45993. /***/ "./node_modules/moment/locale/mk.js":
  45994. /*!******************************************!*\
  45995. !*** ./node_modules/moment/locale/mk.js ***!
  45996. \******************************************/
  45997. /*! no static exports found */
  45998. /***/ (function(module, exports, __webpack_require__) {
  45999. //! moment.js locale configuration
  46000. //! locale : Macedonian [mk]
  46001. //! author : Borislav Mickov : https://github.com/B0k0
  46002. //! author : Sashko Todorov : https://github.com/bkyceh
  46003. ;(function (global, factory) {
  46004. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  46005. undefined
  46006. }(this, (function (moment) { 'use strict';
  46007. //! moment.js locale configuration
  46008. var mk = moment.defineLocale('mk', {
  46009. months: 'јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември'.split(
  46010. '_'
  46011. ),
  46012. monthsShort: 'јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек'.split('_'),
  46013. weekdays: 'недела_понеделник_вторник_среда_четврток_петок_сабота'.split(
  46014. '_'
  46015. ),
  46016. weekdaysShort: 'нед_пон_вто_сре_чет_пет_саб'.split('_'),
  46017. weekdaysMin: 'нe_пo_вт_ср_че_пе_сa'.split('_'),
  46018. longDateFormat: {
  46019. LT: 'H:mm',
  46020. LTS: 'H:mm:ss',
  46021. L: 'D.MM.YYYY',
  46022. LL: 'D MMMM YYYY',
  46023. LLL: 'D MMMM YYYY H:mm',
  46024. LLLL: 'dddd, D MMMM YYYY H:mm',
  46025. },
  46026. calendar: {
  46027. sameDay: '[Денес во] LT',
  46028. nextDay: '[Утре во] LT',
  46029. nextWeek: '[Во] dddd [во] LT',
  46030. lastDay: '[Вчера во] LT',
  46031. lastWeek: function () {
  46032. switch (this.day()) {
  46033. case 0:
  46034. case 3:
  46035. case 6:
  46036. return '[Изминатата] dddd [во] LT';
  46037. case 1:
  46038. case 2:
  46039. case 4:
  46040. case 5:
  46041. return '[Изминатиот] dddd [во] LT';
  46042. }
  46043. },
  46044. sameElse: 'L',
  46045. },
  46046. relativeTime: {
  46047. future: 'за %s',
  46048. past: 'пред %s',
  46049. s: 'неколку секунди',
  46050. ss: '%d секунди',
  46051. m: 'една минута',
  46052. mm: '%d минути',
  46053. h: 'еден час',
  46054. hh: '%d часа',
  46055. d: 'еден ден',
  46056. dd: '%d дена',
  46057. M: 'еден месец',
  46058. MM: '%d месеци',
  46059. y: 'една година',
  46060. yy: '%d години',
  46061. },
  46062. dayOfMonthOrdinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/,
  46063. ordinal: function (number) {
  46064. var lastDigit = number % 10,
  46065. last2Digits = number % 100;
  46066. if (number === 0) {
  46067. return number + '-ев';
  46068. } else if (last2Digits === 0) {
  46069. return number + '-ен';
  46070. } else if (last2Digits > 10 && last2Digits < 20) {
  46071. return number + '-ти';
  46072. } else if (lastDigit === 1) {
  46073. return number + '-ви';
  46074. } else if (lastDigit === 2) {
  46075. return number + '-ри';
  46076. } else if (lastDigit === 7 || lastDigit === 8) {
  46077. return number + '-ми';
  46078. } else {
  46079. return number + '-ти';
  46080. }
  46081. },
  46082. week: {
  46083. dow: 1, // Monday is the first day of the week.
  46084. doy: 7, // The week that contains Jan 7th is the first week of the year.
  46085. },
  46086. });
  46087. return mk;
  46088. })));
  46089. /***/ }),
  46090. /***/ "./node_modules/moment/locale/ml.js":
  46091. /*!******************************************!*\
  46092. !*** ./node_modules/moment/locale/ml.js ***!
  46093. \******************************************/
  46094. /*! no static exports found */
  46095. /***/ (function(module, exports, __webpack_require__) {
  46096. //! moment.js locale configuration
  46097. //! locale : Malayalam [ml]
  46098. //! author : Floyd Pink : https://github.com/floydpink
  46099. ;(function (global, factory) {
  46100. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  46101. undefined
  46102. }(this, (function (moment) { 'use strict';
  46103. //! moment.js locale configuration
  46104. var ml = moment.defineLocale('ml', {
  46105. months: 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split(
  46106. '_'
  46107. ),
  46108. monthsShort: 'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split(
  46109. '_'
  46110. ),
  46111. monthsParseExact: true,
  46112. weekdays: 'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split(
  46113. '_'
  46114. ),
  46115. weekdaysShort: 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split('_'),
  46116. weekdaysMin: 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split('_'),
  46117. longDateFormat: {
  46118. LT: 'A h:mm -നു',
  46119. LTS: 'A h:mm:ss -നു',
  46120. L: 'DD/MM/YYYY',
  46121. LL: 'D MMMM YYYY',
  46122. LLL: 'D MMMM YYYY, A h:mm -നു',
  46123. LLLL: 'dddd, D MMMM YYYY, A h:mm -നു',
  46124. },
  46125. calendar: {
  46126. sameDay: '[ഇന്ന്] LT',
  46127. nextDay: '[നാളെ] LT',
  46128. nextWeek: 'dddd, LT',
  46129. lastDay: '[ഇന്നലെ] LT',
  46130. lastWeek: '[കഴിഞ്ഞ] dddd, LT',
  46131. sameElse: 'L',
  46132. },
  46133. relativeTime: {
  46134. future: '%s കഴിഞ്ഞ്',
  46135. past: '%s മുൻപ്',
  46136. s: 'അൽപ നിമിഷങ്ങൾ',
  46137. ss: '%d സെക്കൻഡ്',
  46138. m: 'ഒരു മിനിറ്റ്',
  46139. mm: '%d മിനിറ്റ്',
  46140. h: 'ഒരു മണിക്കൂർ',
  46141. hh: '%d മണിക്കൂർ',
  46142. d: 'ഒരു ദിവസം',
  46143. dd: '%d ദിവസം',
  46144. M: 'ഒരു മാസം',
  46145. MM: '%d മാസം',
  46146. y: 'ഒരു വർഷം',
  46147. yy: '%d വർഷം',
  46148. },
  46149. meridiemParse: /രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,
  46150. meridiemHour: function (hour, meridiem) {
  46151. if (hour === 12) {
  46152. hour = 0;
  46153. }
  46154. if (
  46155. (meridiem === 'രാത്രി' && hour >= 4) ||
  46156. meridiem === 'ഉച്ച കഴിഞ്ഞ്' ||
  46157. meridiem === 'വൈകുന്നേരം'
  46158. ) {
  46159. return hour + 12;
  46160. } else {
  46161. return hour;
  46162. }
  46163. },
  46164. meridiem: function (hour, minute, isLower) {
  46165. if (hour < 4) {
  46166. return 'രാത്രി';
  46167. } else if (hour < 12) {
  46168. return 'രാവിലെ';
  46169. } else if (hour < 17) {
  46170. return 'ഉച്ച കഴിഞ്ഞ്';
  46171. } else if (hour < 20) {
  46172. return 'വൈകുന്നേരം';
  46173. } else {
  46174. return 'രാത്രി';
  46175. }
  46176. },
  46177. });
  46178. return ml;
  46179. })));
  46180. /***/ }),
  46181. /***/ "./node_modules/moment/locale/mn.js":
  46182. /*!******************************************!*\
  46183. !*** ./node_modules/moment/locale/mn.js ***!
  46184. \******************************************/
  46185. /*! no static exports found */
  46186. /***/ (function(module, exports, __webpack_require__) {
  46187. //! moment.js locale configuration
  46188. //! locale : Mongolian [mn]
  46189. //! author : Javkhlantugs Nyamdorj : https://github.com/javkhaanj7
  46190. ;(function (global, factory) {
  46191. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  46192. undefined
  46193. }(this, (function (moment) { 'use strict';
  46194. //! moment.js locale configuration
  46195. function translate(number, withoutSuffix, key, isFuture) {
  46196. switch (key) {
  46197. case 's':
  46198. return withoutSuffix ? 'хэдхэн секунд' : 'хэдхэн секундын';
  46199. case 'ss':
  46200. return number + (withoutSuffix ? ' секунд' : ' секундын');
  46201. case 'm':
  46202. case 'mm':
  46203. return number + (withoutSuffix ? ' минут' : ' минутын');
  46204. case 'h':
  46205. case 'hh':
  46206. return number + (withoutSuffix ? ' цаг' : ' цагийн');
  46207. case 'd':
  46208. case 'dd':
  46209. return number + (withoutSuffix ? ' өдөр' : ' өдрийн');
  46210. case 'M':
  46211. case 'MM':
  46212. return number + (withoutSuffix ? ' сар' : ' сарын');
  46213. case 'y':
  46214. case 'yy':
  46215. return number + (withoutSuffix ? ' жил' : ' жилийн');
  46216. default:
  46217. return number;
  46218. }
  46219. }
  46220. var mn = moment.defineLocale('mn', {
  46221. months: 'Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар'.split(
  46222. '_'
  46223. ),
  46224. monthsShort: '1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар'.split(
  46225. '_'
  46226. ),
  46227. monthsParseExact: true,
  46228. weekdays: 'Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба'.split('_'),
  46229. weekdaysShort: 'Ням_Дав_Мяг_Лха_Пүр_Баа_Бям'.split('_'),
  46230. weekdaysMin: 'Ня_Да_Мя_Лх_Пү_Ба_Бя'.split('_'),
  46231. weekdaysParseExact: true,
  46232. longDateFormat: {
  46233. LT: 'HH:mm',
  46234. LTS: 'HH:mm:ss',
  46235. L: 'YYYY-MM-DD',
  46236. LL: 'YYYY оны MMMMын D',
  46237. LLL: 'YYYY оны MMMMын D HH:mm',
  46238. LLLL: 'dddd, YYYY оны MMMMын D HH:mm',
  46239. },
  46240. meridiemParse: /ҮӨ|ҮХ/i,
  46241. isPM: function (input) {
  46242. return input === 'ҮХ';
  46243. },
  46244. meridiem: function (hour, minute, isLower) {
  46245. if (hour < 12) {
  46246. return 'ҮӨ';
  46247. } else {
  46248. return 'ҮХ';
  46249. }
  46250. },
  46251. calendar: {
  46252. sameDay: '[Өнөөдөр] LT',
  46253. nextDay: '[Маргааш] LT',
  46254. nextWeek: '[Ирэх] dddd LT',
  46255. lastDay: '[Өчигдөр] LT',
  46256. lastWeek: '[Өнгөрсөн] dddd LT',
  46257. sameElse: 'L',
  46258. },
  46259. relativeTime: {
  46260. future: '%s дараа',
  46261. past: '%s өмнө',
  46262. s: translate,
  46263. ss: translate,
  46264. m: translate,
  46265. mm: translate,
  46266. h: translate,
  46267. hh: translate,
  46268. d: translate,
  46269. dd: translate,
  46270. M: translate,
  46271. MM: translate,
  46272. y: translate,
  46273. yy: translate,
  46274. },
  46275. dayOfMonthOrdinalParse: /\d{1,2} өдөр/,
  46276. ordinal: function (number, period) {
  46277. switch (period) {
  46278. case 'd':
  46279. case 'D':
  46280. case 'DDD':
  46281. return number + ' өдөр';
  46282. default:
  46283. return number;
  46284. }
  46285. },
  46286. });
  46287. return mn;
  46288. })));
  46289. /***/ }),
  46290. /***/ "./node_modules/moment/locale/mr.js":
  46291. /*!******************************************!*\
  46292. !*** ./node_modules/moment/locale/mr.js ***!
  46293. \******************************************/
  46294. /*! no static exports found */
  46295. /***/ (function(module, exports, __webpack_require__) {
  46296. //! moment.js locale configuration
  46297. //! locale : Marathi [mr]
  46298. //! author : Harshad Kale : https://github.com/kalehv
  46299. //! author : Vivek Athalye : https://github.com/vnathalye
  46300. ;(function (global, factory) {
  46301. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  46302. undefined
  46303. }(this, (function (moment) { 'use strict';
  46304. //! moment.js locale configuration
  46305. var symbolMap = {
  46306. '1': '१',
  46307. '2': '२',
  46308. '3': '३',
  46309. '4': '४',
  46310. '5': '५',
  46311. '6': '६',
  46312. '7': '७',
  46313. '8': '८',
  46314. '9': '९',
  46315. '0': '०',
  46316. },
  46317. numberMap = {
  46318. '१': '1',
  46319. '२': '2',
  46320. '३': '3',
  46321. '४': '4',
  46322. '५': '5',
  46323. '६': '6',
  46324. '७': '7',
  46325. '८': '8',
  46326. '९': '9',
  46327. '०': '0',
  46328. };
  46329. function relativeTimeMr(number, withoutSuffix, string, isFuture) {
  46330. var output = '';
  46331. if (withoutSuffix) {
  46332. switch (string) {
  46333. case 's':
  46334. output = 'काही सेकंद';
  46335. break;
  46336. case 'ss':
  46337. output = '%d सेकंद';
  46338. break;
  46339. case 'm':
  46340. output = 'एक मिनिट';
  46341. break;
  46342. case 'mm':
  46343. output = '%d मिनिटे';
  46344. break;
  46345. case 'h':
  46346. output = 'एक तास';
  46347. break;
  46348. case 'hh':
  46349. output = '%d तास';
  46350. break;
  46351. case 'd':
  46352. output = 'एक दिवस';
  46353. break;
  46354. case 'dd':
  46355. output = '%d दिवस';
  46356. break;
  46357. case 'M':
  46358. output = 'एक महिना';
  46359. break;
  46360. case 'MM':
  46361. output = '%d महिने';
  46362. break;
  46363. case 'y':
  46364. output = 'एक वर्ष';
  46365. break;
  46366. case 'yy':
  46367. output = '%d वर्षे';
  46368. break;
  46369. }
  46370. } else {
  46371. switch (string) {
  46372. case 's':
  46373. output = 'काही सेकंदां';
  46374. break;
  46375. case 'ss':
  46376. output = '%d सेकंदां';
  46377. break;
  46378. case 'm':
  46379. output = 'एका मिनिटा';
  46380. break;
  46381. case 'mm':
  46382. output = '%d मिनिटां';
  46383. break;
  46384. case 'h':
  46385. output = 'एका तासा';
  46386. break;
  46387. case 'hh':
  46388. output = '%d तासां';
  46389. break;
  46390. case 'd':
  46391. output = 'एका दिवसा';
  46392. break;
  46393. case 'dd':
  46394. output = '%d दिवसां';
  46395. break;
  46396. case 'M':
  46397. output = 'एका महिन्या';
  46398. break;
  46399. case 'MM':
  46400. output = '%d महिन्यां';
  46401. break;
  46402. case 'y':
  46403. output = 'एका वर्षा';
  46404. break;
  46405. case 'yy':
  46406. output = '%d वर्षां';
  46407. break;
  46408. }
  46409. }
  46410. return output.replace(/%d/i, number);
  46411. }
  46412. var mr = moment.defineLocale('mr', {
  46413. months: 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split(
  46414. '_'
  46415. ),
  46416. monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split(
  46417. '_'
  46418. ),
  46419. monthsParseExact: true,
  46420. weekdays: 'रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),
  46421. weekdaysShort: 'रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि'.split('_'),
  46422. weekdaysMin: 'र_सो_मं_बु_गु_शु_श'.split('_'),
  46423. longDateFormat: {
  46424. LT: 'A h:mm वाजता',
  46425. LTS: 'A h:mm:ss वाजता',
  46426. L: 'DD/MM/YYYY',
  46427. LL: 'D MMMM YYYY',
  46428. LLL: 'D MMMM YYYY, A h:mm वाजता',
  46429. LLLL: 'dddd, D MMMM YYYY, A h:mm वाजता',
  46430. },
  46431. calendar: {
  46432. sameDay: '[आज] LT',
  46433. nextDay: '[उद्या] LT',
  46434. nextWeek: 'dddd, LT',
  46435. lastDay: '[काल] LT',
  46436. lastWeek: '[मागील] dddd, LT',
  46437. sameElse: 'L',
  46438. },
  46439. relativeTime: {
  46440. future: '%sमध्ये',
  46441. past: '%sपूर्वी',
  46442. s: relativeTimeMr,
  46443. ss: relativeTimeMr,
  46444. m: relativeTimeMr,
  46445. mm: relativeTimeMr,
  46446. h: relativeTimeMr,
  46447. hh: relativeTimeMr,
  46448. d: relativeTimeMr,
  46449. dd: relativeTimeMr,
  46450. M: relativeTimeMr,
  46451. MM: relativeTimeMr,
  46452. y: relativeTimeMr,
  46453. yy: relativeTimeMr,
  46454. },
  46455. preparse: function (string) {
  46456. return string.replace(/[१२३४५६७८९०]/g, function (match) {
  46457. return numberMap[match];
  46458. });
  46459. },
  46460. postformat: function (string) {
  46461. return string.replace(/\d/g, function (match) {
  46462. return symbolMap[match];
  46463. });
  46464. },
  46465. meridiemParse: /पहाटे|सकाळी|दुपारी|सायंकाळी|रात्री/,
  46466. meridiemHour: function (hour, meridiem) {
  46467. if (hour === 12) {
  46468. hour = 0;
  46469. }
  46470. if (meridiem === 'पहाटे' || meridiem === 'सकाळी') {
  46471. return hour;
  46472. } else if (
  46473. meridiem === 'दुपारी' ||
  46474. meridiem === 'सायंकाळी' ||
  46475. meridiem === 'रात्री'
  46476. ) {
  46477. return hour >= 12 ? hour : hour + 12;
  46478. }
  46479. },
  46480. meridiem: function (hour, minute, isLower) {
  46481. if (hour >= 0 && hour < 6) {
  46482. return 'पहाटे';
  46483. } else if (hour < 12) {
  46484. return 'सकाळी';
  46485. } else if (hour < 17) {
  46486. return 'दुपारी';
  46487. } else if (hour < 20) {
  46488. return 'सायंकाळी';
  46489. } else {
  46490. return 'रात्री';
  46491. }
  46492. },
  46493. week: {
  46494. dow: 0, // Sunday is the first day of the week.
  46495. doy: 6, // The week that contains Jan 6th is the first week of the year.
  46496. },
  46497. });
  46498. return mr;
  46499. })));
  46500. /***/ }),
  46501. /***/ "./node_modules/moment/locale/ms-my.js":
  46502. /*!*********************************************!*\
  46503. !*** ./node_modules/moment/locale/ms-my.js ***!
  46504. \*********************************************/
  46505. /*! no static exports found */
  46506. /***/ (function(module, exports, __webpack_require__) {
  46507. //! moment.js locale configuration
  46508. //! locale : Malay [ms-my]
  46509. //! note : DEPRECATED, the correct one is [ms]
  46510. //! author : Weldan Jamili : https://github.com/weldan
  46511. ;(function (global, factory) {
  46512. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  46513. undefined
  46514. }(this, (function (moment) { 'use strict';
  46515. //! moment.js locale configuration
  46516. var msMy = moment.defineLocale('ms-my', {
  46517. months: 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split(
  46518. '_'
  46519. ),
  46520. monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),
  46521. weekdays: 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),
  46522. weekdaysShort: 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),
  46523. weekdaysMin: 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),
  46524. longDateFormat: {
  46525. LT: 'HH.mm',
  46526. LTS: 'HH.mm.ss',
  46527. L: 'DD/MM/YYYY',
  46528. LL: 'D MMMM YYYY',
  46529. LLL: 'D MMMM YYYY [pukul] HH.mm',
  46530. LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm',
  46531. },
  46532. meridiemParse: /pagi|tengahari|petang|malam/,
  46533. meridiemHour: function (hour, meridiem) {
  46534. if (hour === 12) {
  46535. hour = 0;
  46536. }
  46537. if (meridiem === 'pagi') {
  46538. return hour;
  46539. } else if (meridiem === 'tengahari') {
  46540. return hour >= 11 ? hour : hour + 12;
  46541. } else if (meridiem === 'petang' || meridiem === 'malam') {
  46542. return hour + 12;
  46543. }
  46544. },
  46545. meridiem: function (hours, minutes, isLower) {
  46546. if (hours < 11) {
  46547. return 'pagi';
  46548. } else if (hours < 15) {
  46549. return 'tengahari';
  46550. } else if (hours < 19) {
  46551. return 'petang';
  46552. } else {
  46553. return 'malam';
  46554. }
  46555. },
  46556. calendar: {
  46557. sameDay: '[Hari ini pukul] LT',
  46558. nextDay: '[Esok pukul] LT',
  46559. nextWeek: 'dddd [pukul] LT',
  46560. lastDay: '[Kelmarin pukul] LT',
  46561. lastWeek: 'dddd [lepas pukul] LT',
  46562. sameElse: 'L',
  46563. },
  46564. relativeTime: {
  46565. future: 'dalam %s',
  46566. past: '%s yang lepas',
  46567. s: 'beberapa saat',
  46568. ss: '%d saat',
  46569. m: 'seminit',
  46570. mm: '%d minit',
  46571. h: 'sejam',
  46572. hh: '%d jam',
  46573. d: 'sehari',
  46574. dd: '%d hari',
  46575. M: 'sebulan',
  46576. MM: '%d bulan',
  46577. y: 'setahun',
  46578. yy: '%d tahun',
  46579. },
  46580. week: {
  46581. dow: 1, // Monday is the first day of the week.
  46582. doy: 7, // The week that contains Jan 7th is the first week of the year.
  46583. },
  46584. });
  46585. return msMy;
  46586. })));
  46587. /***/ }),
  46588. /***/ "./node_modules/moment/locale/ms.js":
  46589. /*!******************************************!*\
  46590. !*** ./node_modules/moment/locale/ms.js ***!
  46591. \******************************************/
  46592. /*! no static exports found */
  46593. /***/ (function(module, exports, __webpack_require__) {
  46594. //! moment.js locale configuration
  46595. //! locale : Malay [ms]
  46596. //! author : Weldan Jamili : https://github.com/weldan
  46597. ;(function (global, factory) {
  46598. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  46599. undefined
  46600. }(this, (function (moment) { 'use strict';
  46601. //! moment.js locale configuration
  46602. var ms = moment.defineLocale('ms', {
  46603. months: 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split(
  46604. '_'
  46605. ),
  46606. monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),
  46607. weekdays: 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),
  46608. weekdaysShort: 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),
  46609. weekdaysMin: 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),
  46610. longDateFormat: {
  46611. LT: 'HH.mm',
  46612. LTS: 'HH.mm.ss',
  46613. L: 'DD/MM/YYYY',
  46614. LL: 'D MMMM YYYY',
  46615. LLL: 'D MMMM YYYY [pukul] HH.mm',
  46616. LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm',
  46617. },
  46618. meridiemParse: /pagi|tengahari|petang|malam/,
  46619. meridiemHour: function (hour, meridiem) {
  46620. if (hour === 12) {
  46621. hour = 0;
  46622. }
  46623. if (meridiem === 'pagi') {
  46624. return hour;
  46625. } else if (meridiem === 'tengahari') {
  46626. return hour >= 11 ? hour : hour + 12;
  46627. } else if (meridiem === 'petang' || meridiem === 'malam') {
  46628. return hour + 12;
  46629. }
  46630. },
  46631. meridiem: function (hours, minutes, isLower) {
  46632. if (hours < 11) {
  46633. return 'pagi';
  46634. } else if (hours < 15) {
  46635. return 'tengahari';
  46636. } else if (hours < 19) {
  46637. return 'petang';
  46638. } else {
  46639. return 'malam';
  46640. }
  46641. },
  46642. calendar: {
  46643. sameDay: '[Hari ini pukul] LT',
  46644. nextDay: '[Esok pukul] LT',
  46645. nextWeek: 'dddd [pukul] LT',
  46646. lastDay: '[Kelmarin pukul] LT',
  46647. lastWeek: 'dddd [lepas pukul] LT',
  46648. sameElse: 'L',
  46649. },
  46650. relativeTime: {
  46651. future: 'dalam %s',
  46652. past: '%s yang lepas',
  46653. s: 'beberapa saat',
  46654. ss: '%d saat',
  46655. m: 'seminit',
  46656. mm: '%d minit',
  46657. h: 'sejam',
  46658. hh: '%d jam',
  46659. d: 'sehari',
  46660. dd: '%d hari',
  46661. M: 'sebulan',
  46662. MM: '%d bulan',
  46663. y: 'setahun',
  46664. yy: '%d tahun',
  46665. },
  46666. week: {
  46667. dow: 1, // Monday is the first day of the week.
  46668. doy: 7, // The week that contains Jan 7th is the first week of the year.
  46669. },
  46670. });
  46671. return ms;
  46672. })));
  46673. /***/ }),
  46674. /***/ "./node_modules/moment/locale/mt.js":
  46675. /*!******************************************!*\
  46676. !*** ./node_modules/moment/locale/mt.js ***!
  46677. \******************************************/
  46678. /*! no static exports found */
  46679. /***/ (function(module, exports, __webpack_require__) {
  46680. //! moment.js locale configuration
  46681. //! locale : Maltese (Malta) [mt]
  46682. //! author : Alessandro Maruccia : https://github.com/alesma
  46683. ;(function (global, factory) {
  46684. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  46685. undefined
  46686. }(this, (function (moment) { 'use strict';
  46687. //! moment.js locale configuration
  46688. var mt = moment.defineLocale('mt', {
  46689. months: 'Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru'.split(
  46690. '_'
  46691. ),
  46692. monthsShort: 'Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ'.split('_'),
  46693. weekdays: 'Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt'.split(
  46694. '_'
  46695. ),
  46696. weekdaysShort: 'Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib'.split('_'),
  46697. weekdaysMin: 'Ħa_Tn_Tl_Er_Ħa_Ġi_Si'.split('_'),
  46698. longDateFormat: {
  46699. LT: 'HH:mm',
  46700. LTS: 'HH:mm:ss',
  46701. L: 'DD/MM/YYYY',
  46702. LL: 'D MMMM YYYY',
  46703. LLL: 'D MMMM YYYY HH:mm',
  46704. LLLL: 'dddd, D MMMM YYYY HH:mm',
  46705. },
  46706. calendar: {
  46707. sameDay: '[Illum fil-]LT',
  46708. nextDay: '[Għada fil-]LT',
  46709. nextWeek: 'dddd [fil-]LT',
  46710. lastDay: '[Il-bieraħ fil-]LT',
  46711. lastWeek: 'dddd [li għadda] [fil-]LT',
  46712. sameElse: 'L',
  46713. },
  46714. relativeTime: {
  46715. future: 'f’ %s',
  46716. past: '%s ilu',
  46717. s: 'ftit sekondi',
  46718. ss: '%d sekondi',
  46719. m: 'minuta',
  46720. mm: '%d minuti',
  46721. h: 'siegħa',
  46722. hh: '%d siegħat',
  46723. d: 'ġurnata',
  46724. dd: '%d ġranet',
  46725. M: 'xahar',
  46726. MM: '%d xhur',
  46727. y: 'sena',
  46728. yy: '%d sni',
  46729. },
  46730. dayOfMonthOrdinalParse: /\d{1,2}º/,
  46731. ordinal: '%dº',
  46732. week: {
  46733. dow: 1, // Monday is the first day of the week.
  46734. doy: 4, // The week that contains Jan 4th is the first week of the year.
  46735. },
  46736. });
  46737. return mt;
  46738. })));
  46739. /***/ }),
  46740. /***/ "./node_modules/moment/locale/my.js":
  46741. /*!******************************************!*\
  46742. !*** ./node_modules/moment/locale/my.js ***!
  46743. \******************************************/
  46744. /*! no static exports found */
  46745. /***/ (function(module, exports, __webpack_require__) {
  46746. //! moment.js locale configuration
  46747. //! locale : Burmese [my]
  46748. //! author : Squar team, mysquar.com
  46749. //! author : David Rossellat : https://github.com/gholadr
  46750. //! author : Tin Aung Lin : https://github.com/thanyawzinmin
  46751. ;(function (global, factory) {
  46752. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  46753. undefined
  46754. }(this, (function (moment) { 'use strict';
  46755. //! moment.js locale configuration
  46756. var symbolMap = {
  46757. '1': '၁',
  46758. '2': '၂',
  46759. '3': '၃',
  46760. '4': '၄',
  46761. '5': '၅',
  46762. '6': '၆',
  46763. '7': '၇',
  46764. '8': '၈',
  46765. '9': '၉',
  46766. '0': '၀',
  46767. },
  46768. numberMap = {
  46769. '၁': '1',
  46770. '၂': '2',
  46771. '၃': '3',
  46772. '၄': '4',
  46773. '၅': '5',
  46774. '၆': '6',
  46775. '၇': '7',
  46776. '၈': '8',
  46777. '၉': '9',
  46778. '၀': '0',
  46779. };
  46780. var my = moment.defineLocale('my', {
  46781. months: 'ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ'.split(
  46782. '_'
  46783. ),
  46784. monthsShort: 'ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ'.split('_'),
  46785. weekdays: 'တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ'.split(
  46786. '_'
  46787. ),
  46788. weekdaysShort: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),
  46789. weekdaysMin: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),
  46790. longDateFormat: {
  46791. LT: 'HH:mm',
  46792. LTS: 'HH:mm:ss',
  46793. L: 'DD/MM/YYYY',
  46794. LL: 'D MMMM YYYY',
  46795. LLL: 'D MMMM YYYY HH:mm',
  46796. LLLL: 'dddd D MMMM YYYY HH:mm',
  46797. },
  46798. calendar: {
  46799. sameDay: '[ယနေ.] LT [မှာ]',
  46800. nextDay: '[မနက်ဖြန်] LT [မှာ]',
  46801. nextWeek: 'dddd LT [မှာ]',
  46802. lastDay: '[မနေ.က] LT [မှာ]',
  46803. lastWeek: '[ပြီးခဲ့သော] dddd LT [မှာ]',
  46804. sameElse: 'L',
  46805. },
  46806. relativeTime: {
  46807. future: 'လာမည့် %s မှာ',
  46808. past: 'လွန်ခဲ့သော %s က',
  46809. s: 'စက္ကန်.အနည်းငယ်',
  46810. ss: '%d စက္ကန့်',
  46811. m: 'တစ်မိနစ်',
  46812. mm: '%d မိနစ်',
  46813. h: 'တစ်နာရီ',
  46814. hh: '%d နာရီ',
  46815. d: 'တစ်ရက်',
  46816. dd: '%d ရက်',
  46817. M: 'တစ်လ',
  46818. MM: '%d လ',
  46819. y: 'တစ်နှစ်',
  46820. yy: '%d နှစ်',
  46821. },
  46822. preparse: function (string) {
  46823. return string.replace(/[၁၂၃၄၅၆၇၈၉၀]/g, function (match) {
  46824. return numberMap[match];
  46825. });
  46826. },
  46827. postformat: function (string) {
  46828. return string.replace(/\d/g, function (match) {
  46829. return symbolMap[match];
  46830. });
  46831. },
  46832. week: {
  46833. dow: 1, // Monday is the first day of the week.
  46834. doy: 4, // The week that contains Jan 4th is the first week of the year.
  46835. },
  46836. });
  46837. return my;
  46838. })));
  46839. /***/ }),
  46840. /***/ "./node_modules/moment/locale/nb.js":
  46841. /*!******************************************!*\
  46842. !*** ./node_modules/moment/locale/nb.js ***!
  46843. \******************************************/
  46844. /*! no static exports found */
  46845. /***/ (function(module, exports, __webpack_require__) {
  46846. //! moment.js locale configuration
  46847. //! locale : Norwegian Bokmål [nb]
  46848. //! authors : Espen Hovlandsdal : https://github.com/rexxars
  46849. //! Sigurd Gartmann : https://github.com/sigurdga
  46850. //! Stephen Ramthun : https://github.com/stephenramthun
  46851. ;(function (global, factory) {
  46852. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  46853. undefined
  46854. }(this, (function (moment) { 'use strict';
  46855. //! moment.js locale configuration
  46856. var nb = moment.defineLocale('nb', {
  46857. months: 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split(
  46858. '_'
  46859. ),
  46860. monthsShort: 'jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.'.split(
  46861. '_'
  46862. ),
  46863. monthsParseExact: true,
  46864. weekdays: 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),
  46865. weekdaysShort: 'sø._ma._ti._on._to._fr._lø.'.split('_'),
  46866. weekdaysMin: 'sø_ma_ti_on_to_fr_lø'.split('_'),
  46867. weekdaysParseExact: true,
  46868. longDateFormat: {
  46869. LT: 'HH:mm',
  46870. LTS: 'HH:mm:ss',
  46871. L: 'DD.MM.YYYY',
  46872. LL: 'D. MMMM YYYY',
  46873. LLL: 'D. MMMM YYYY [kl.] HH:mm',
  46874. LLLL: 'dddd D. MMMM YYYY [kl.] HH:mm',
  46875. },
  46876. calendar: {
  46877. sameDay: '[i dag kl.] LT',
  46878. nextDay: '[i morgen kl.] LT',
  46879. nextWeek: 'dddd [kl.] LT',
  46880. lastDay: '[i går kl.] LT',
  46881. lastWeek: '[forrige] dddd [kl.] LT',
  46882. sameElse: 'L',
  46883. },
  46884. relativeTime: {
  46885. future: 'om %s',
  46886. past: '%s siden',
  46887. s: 'noen sekunder',
  46888. ss: '%d sekunder',
  46889. m: 'ett minutt',
  46890. mm: '%d minutter',
  46891. h: 'en time',
  46892. hh: '%d timer',
  46893. d: 'en dag',
  46894. dd: '%d dager',
  46895. M: 'en måned',
  46896. MM: '%d måneder',
  46897. y: 'ett år',
  46898. yy: '%d år',
  46899. },
  46900. dayOfMonthOrdinalParse: /\d{1,2}\./,
  46901. ordinal: '%d.',
  46902. week: {
  46903. dow: 1, // Monday is the first day of the week.
  46904. doy: 4, // The week that contains Jan 4th is the first week of the year.
  46905. },
  46906. });
  46907. return nb;
  46908. })));
  46909. /***/ }),
  46910. /***/ "./node_modules/moment/locale/ne.js":
  46911. /*!******************************************!*\
  46912. !*** ./node_modules/moment/locale/ne.js ***!
  46913. \******************************************/
  46914. /*! no static exports found */
  46915. /***/ (function(module, exports, __webpack_require__) {
  46916. //! moment.js locale configuration
  46917. //! locale : Nepalese [ne]
  46918. //! author : suvash : https://github.com/suvash
  46919. ;(function (global, factory) {
  46920. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  46921. undefined
  46922. }(this, (function (moment) { 'use strict';
  46923. //! moment.js locale configuration
  46924. var symbolMap = {
  46925. '1': '१',
  46926. '2': '२',
  46927. '3': '३',
  46928. '4': '४',
  46929. '5': '५',
  46930. '6': '६',
  46931. '7': '७',
  46932. '8': '८',
  46933. '9': '९',
  46934. '0': '०',
  46935. },
  46936. numberMap = {
  46937. '१': '1',
  46938. '२': '2',
  46939. '३': '3',
  46940. '४': '4',
  46941. '५': '5',
  46942. '६': '6',
  46943. '७': '7',
  46944. '८': '8',
  46945. '९': '9',
  46946. '०': '0',
  46947. };
  46948. var ne = moment.defineLocale('ne', {
  46949. months: 'जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर'.split(
  46950. '_'
  46951. ),
  46952. monthsShort: 'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split(
  46953. '_'
  46954. ),
  46955. monthsParseExact: true,
  46956. weekdays: 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split(
  46957. '_'
  46958. ),
  46959. weekdaysShort: 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split('_'),
  46960. weekdaysMin: 'आ._सो._मं._बु._बि._शु._श.'.split('_'),
  46961. weekdaysParseExact: true,
  46962. longDateFormat: {
  46963. LT: 'Aको h:mm बजे',
  46964. LTS: 'Aको h:mm:ss बजे',
  46965. L: 'DD/MM/YYYY',
  46966. LL: 'D MMMM YYYY',
  46967. LLL: 'D MMMM YYYY, Aको h:mm बजे',
  46968. LLLL: 'dddd, D MMMM YYYY, Aको h:mm बजे',
  46969. },
  46970. preparse: function (string) {
  46971. return string.replace(/[१२३४५६७८९०]/g, function (match) {
  46972. return numberMap[match];
  46973. });
  46974. },
  46975. postformat: function (string) {
  46976. return string.replace(/\d/g, function (match) {
  46977. return symbolMap[match];
  46978. });
  46979. },
  46980. meridiemParse: /राति|बिहान|दिउँसो|साँझ/,
  46981. meridiemHour: function (hour, meridiem) {
  46982. if (hour === 12) {
  46983. hour = 0;
  46984. }
  46985. if (meridiem === 'राति') {
  46986. return hour < 4 ? hour : hour + 12;
  46987. } else if (meridiem === 'बिहान') {
  46988. return hour;
  46989. } else if (meridiem === 'दिउँसो') {
  46990. return hour >= 10 ? hour : hour + 12;
  46991. } else if (meridiem === 'साँझ') {
  46992. return hour + 12;
  46993. }
  46994. },
  46995. meridiem: function (hour, minute, isLower) {
  46996. if (hour < 3) {
  46997. return 'राति';
  46998. } else if (hour < 12) {
  46999. return 'बिहान';
  47000. } else if (hour < 16) {
  47001. return 'दिउँसो';
  47002. } else if (hour < 20) {
  47003. return 'साँझ';
  47004. } else {
  47005. return 'राति';
  47006. }
  47007. },
  47008. calendar: {
  47009. sameDay: '[आज] LT',
  47010. nextDay: '[भोलि] LT',
  47011. nextWeek: '[आउँदो] dddd[,] LT',
  47012. lastDay: '[हिजो] LT',
  47013. lastWeek: '[गएको] dddd[,] LT',
  47014. sameElse: 'L',
  47015. },
  47016. relativeTime: {
  47017. future: '%sमा',
  47018. past: '%s अगाडि',
  47019. s: 'केही क्षण',
  47020. ss: '%d सेकेण्ड',
  47021. m: 'एक मिनेट',
  47022. mm: '%d मिनेट',
  47023. h: 'एक घण्टा',
  47024. hh: '%d घण्टा',
  47025. d: 'एक दिन',
  47026. dd: '%d दिन',
  47027. M: 'एक महिना',
  47028. MM: '%d महिना',
  47029. y: 'एक बर्ष',
  47030. yy: '%d बर्ष',
  47031. },
  47032. week: {
  47033. dow: 0, // Sunday is the first day of the week.
  47034. doy: 6, // The week that contains Jan 6th is the first week of the year.
  47035. },
  47036. });
  47037. return ne;
  47038. })));
  47039. /***/ }),
  47040. /***/ "./node_modules/moment/locale/nl-be.js":
  47041. /*!*********************************************!*\
  47042. !*** ./node_modules/moment/locale/nl-be.js ***!
  47043. \*********************************************/
  47044. /*! no static exports found */
  47045. /***/ (function(module, exports, __webpack_require__) {
  47046. //! moment.js locale configuration
  47047. //! locale : Dutch (Belgium) [nl-be]
  47048. //! author : Joris Röling : https://github.com/jorisroling
  47049. //! author : Jacob Middag : https://github.com/middagj
  47050. ;(function (global, factory) {
  47051. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  47052. undefined
  47053. }(this, (function (moment) { 'use strict';
  47054. //! moment.js locale configuration
  47055. var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split(
  47056. '_'
  47057. ),
  47058. monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split(
  47059. '_'
  47060. ),
  47061. monthsParse = [
  47062. /^jan/i,
  47063. /^feb/i,
  47064. /^maart|mrt.?$/i,
  47065. /^apr/i,
  47066. /^mei$/i,
  47067. /^jun[i.]?$/i,
  47068. /^jul[i.]?$/i,
  47069. /^aug/i,
  47070. /^sep/i,
  47071. /^okt/i,
  47072. /^nov/i,
  47073. /^dec/i,
  47074. ],
  47075. monthsRegex = /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;
  47076. var nlBe = moment.defineLocale('nl-be', {
  47077. months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split(
  47078. '_'
  47079. ),
  47080. monthsShort: function (m, format) {
  47081. if (!m) {
  47082. return monthsShortWithDots;
  47083. } else if (/-MMM-/.test(format)) {
  47084. return monthsShortWithoutDots[m.month()];
  47085. } else {
  47086. return monthsShortWithDots[m.month()];
  47087. }
  47088. },
  47089. monthsRegex: monthsRegex,
  47090. monthsShortRegex: monthsRegex,
  47091. monthsStrictRegex: /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,
  47092. monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,
  47093. monthsParse: monthsParse,
  47094. longMonthsParse: monthsParse,
  47095. shortMonthsParse: monthsParse,
  47096. weekdays: 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split(
  47097. '_'
  47098. ),
  47099. weekdaysShort: 'zo._ma._di._wo._do._vr._za.'.split('_'),
  47100. weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'),
  47101. weekdaysParseExact: true,
  47102. longDateFormat: {
  47103. LT: 'HH:mm',
  47104. LTS: 'HH:mm:ss',
  47105. L: 'DD/MM/YYYY',
  47106. LL: 'D MMMM YYYY',
  47107. LLL: 'D MMMM YYYY HH:mm',
  47108. LLLL: 'dddd D MMMM YYYY HH:mm',
  47109. },
  47110. calendar: {
  47111. sameDay: '[vandaag om] LT',
  47112. nextDay: '[morgen om] LT',
  47113. nextWeek: 'dddd [om] LT',
  47114. lastDay: '[gisteren om] LT',
  47115. lastWeek: '[afgelopen] dddd [om] LT',
  47116. sameElse: 'L',
  47117. },
  47118. relativeTime: {
  47119. future: 'over %s',
  47120. past: '%s geleden',
  47121. s: 'een paar seconden',
  47122. ss: '%d seconden',
  47123. m: 'één minuut',
  47124. mm: '%d minuten',
  47125. h: 'één uur',
  47126. hh: '%d uur',
  47127. d: 'één dag',
  47128. dd: '%d dagen',
  47129. M: 'één maand',
  47130. MM: '%d maanden',
  47131. y: 'één jaar',
  47132. yy: '%d jaar',
  47133. },
  47134. dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
  47135. ordinal: function (number) {
  47136. return (
  47137. number +
  47138. (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de')
  47139. );
  47140. },
  47141. week: {
  47142. dow: 1, // Monday is the first day of the week.
  47143. doy: 4, // The week that contains Jan 4th is the first week of the year.
  47144. },
  47145. });
  47146. return nlBe;
  47147. })));
  47148. /***/ }),
  47149. /***/ "./node_modules/moment/locale/nl.js":
  47150. /*!******************************************!*\
  47151. !*** ./node_modules/moment/locale/nl.js ***!
  47152. \******************************************/
  47153. /*! no static exports found */
  47154. /***/ (function(module, exports, __webpack_require__) {
  47155. //! moment.js locale configuration
  47156. //! locale : Dutch [nl]
  47157. //! author : Joris Röling : https://github.com/jorisroling
  47158. //! author : Jacob Middag : https://github.com/middagj
  47159. ;(function (global, factory) {
  47160. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  47161. undefined
  47162. }(this, (function (moment) { 'use strict';
  47163. //! moment.js locale configuration
  47164. var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split(
  47165. '_'
  47166. ),
  47167. monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split(
  47168. '_'
  47169. ),
  47170. monthsParse = [
  47171. /^jan/i,
  47172. /^feb/i,
  47173. /^maart|mrt.?$/i,
  47174. /^apr/i,
  47175. /^mei$/i,
  47176. /^jun[i.]?$/i,
  47177. /^jul[i.]?$/i,
  47178. /^aug/i,
  47179. /^sep/i,
  47180. /^okt/i,
  47181. /^nov/i,
  47182. /^dec/i,
  47183. ],
  47184. monthsRegex = /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;
  47185. var nl = moment.defineLocale('nl', {
  47186. months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split(
  47187. '_'
  47188. ),
  47189. monthsShort: function (m, format) {
  47190. if (!m) {
  47191. return monthsShortWithDots;
  47192. } else if (/-MMM-/.test(format)) {
  47193. return monthsShortWithoutDots[m.month()];
  47194. } else {
  47195. return monthsShortWithDots[m.month()];
  47196. }
  47197. },
  47198. monthsRegex: monthsRegex,
  47199. monthsShortRegex: monthsRegex,
  47200. monthsStrictRegex: /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,
  47201. monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,
  47202. monthsParse: monthsParse,
  47203. longMonthsParse: monthsParse,
  47204. shortMonthsParse: monthsParse,
  47205. weekdays: 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split(
  47206. '_'
  47207. ),
  47208. weekdaysShort: 'zo._ma._di._wo._do._vr._za.'.split('_'),
  47209. weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'),
  47210. weekdaysParseExact: true,
  47211. longDateFormat: {
  47212. LT: 'HH:mm',
  47213. LTS: 'HH:mm:ss',
  47214. L: 'DD-MM-YYYY',
  47215. LL: 'D MMMM YYYY',
  47216. LLL: 'D MMMM YYYY HH:mm',
  47217. LLLL: 'dddd D MMMM YYYY HH:mm',
  47218. },
  47219. calendar: {
  47220. sameDay: '[vandaag om] LT',
  47221. nextDay: '[morgen om] LT',
  47222. nextWeek: 'dddd [om] LT',
  47223. lastDay: '[gisteren om] LT',
  47224. lastWeek: '[afgelopen] dddd [om] LT',
  47225. sameElse: 'L',
  47226. },
  47227. relativeTime: {
  47228. future: 'over %s',
  47229. past: '%s geleden',
  47230. s: 'een paar seconden',
  47231. ss: '%d seconden',
  47232. m: 'één minuut',
  47233. mm: '%d minuten',
  47234. h: 'één uur',
  47235. hh: '%d uur',
  47236. d: 'één dag',
  47237. dd: '%d dagen',
  47238. M: 'één maand',
  47239. MM: '%d maanden',
  47240. y: 'één jaar',
  47241. yy: '%d jaar',
  47242. },
  47243. dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
  47244. ordinal: function (number) {
  47245. return (
  47246. number +
  47247. (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de')
  47248. );
  47249. },
  47250. week: {
  47251. dow: 1, // Monday is the first day of the week.
  47252. doy: 4, // The week that contains Jan 4th is the first week of the year.
  47253. },
  47254. });
  47255. return nl;
  47256. })));
  47257. /***/ }),
  47258. /***/ "./node_modules/moment/locale/nn.js":
  47259. /*!******************************************!*\
  47260. !*** ./node_modules/moment/locale/nn.js ***!
  47261. \******************************************/
  47262. /*! no static exports found */
  47263. /***/ (function(module, exports, __webpack_require__) {
  47264. //! moment.js locale configuration
  47265. //! locale : Nynorsk [nn]
  47266. //! authors : https://github.com/mechuwind
  47267. //! Stephen Ramthun : https://github.com/stephenramthun
  47268. ;(function (global, factory) {
  47269. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  47270. undefined
  47271. }(this, (function (moment) { 'use strict';
  47272. //! moment.js locale configuration
  47273. var nn = moment.defineLocale('nn', {
  47274. months: 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split(
  47275. '_'
  47276. ),
  47277. monthsShort: 'jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.'.split(
  47278. '_'
  47279. ),
  47280. monthsParseExact: true,
  47281. weekdays: 'sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag'.split('_'),
  47282. weekdaysShort: 'su._må._ty._on._to._fr._lau.'.split('_'),
  47283. weekdaysMin: 'su_må_ty_on_to_fr_la'.split('_'),
  47284. weekdaysParseExact: true,
  47285. longDateFormat: {
  47286. LT: 'HH:mm',
  47287. LTS: 'HH:mm:ss',
  47288. L: 'DD.MM.YYYY',
  47289. LL: 'D. MMMM YYYY',
  47290. LLL: 'D. MMMM YYYY [kl.] H:mm',
  47291. LLLL: 'dddd D. MMMM YYYY [kl.] HH:mm',
  47292. },
  47293. calendar: {
  47294. sameDay: '[I dag klokka] LT',
  47295. nextDay: '[I morgon klokka] LT',
  47296. nextWeek: 'dddd [klokka] LT',
  47297. lastDay: '[I går klokka] LT',
  47298. lastWeek: '[Føregåande] dddd [klokka] LT',
  47299. sameElse: 'L',
  47300. },
  47301. relativeTime: {
  47302. future: 'om %s',
  47303. past: '%s sidan',
  47304. s: 'nokre sekund',
  47305. ss: '%d sekund',
  47306. m: 'eit minutt',
  47307. mm: '%d minutt',
  47308. h: 'ein time',
  47309. hh: '%d timar',
  47310. d: 'ein dag',
  47311. dd: '%d dagar',
  47312. M: 'ein månad',
  47313. MM: '%d månader',
  47314. y: 'eit år',
  47315. yy: '%d år',
  47316. },
  47317. dayOfMonthOrdinalParse: /\d{1,2}\./,
  47318. ordinal: '%d.',
  47319. week: {
  47320. dow: 1, // Monday is the first day of the week.
  47321. doy: 4, // The week that contains Jan 4th is the first week of the year.
  47322. },
  47323. });
  47324. return nn;
  47325. })));
  47326. /***/ }),
  47327. /***/ "./node_modules/moment/locale/oc-lnc.js":
  47328. /*!**********************************************!*\
  47329. !*** ./node_modules/moment/locale/oc-lnc.js ***!
  47330. \**********************************************/
  47331. /*! no static exports found */
  47332. /***/ (function(module, exports, __webpack_require__) {
  47333. //! moment.js locale configuration
  47334. //! locale : Occitan, lengadocian dialecte [oc-lnc]
  47335. //! author : Quentin PAGÈS : https://github.com/Quenty31
  47336. ;(function (global, factory) {
  47337. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  47338. undefined
  47339. }(this, (function (moment) { 'use strict';
  47340. //! moment.js locale configuration
  47341. var ocLnc = moment.defineLocale('oc-lnc', {
  47342. months: {
  47343. standalone: 'genièr_febrièr_març_abril_mai_junh_julhet_agost_setembre_octòbre_novembre_decembre'.split(
  47344. '_'
  47345. ),
  47346. format: "de genièr_de febrièr_de març_d'abril_de mai_de junh_de julhet_d'agost_de setembre_d'octòbre_de novembre_de decembre".split(
  47347. '_'
  47348. ),
  47349. isFormat: /D[oD]?(\s)+MMMM/,
  47350. },
  47351. monthsShort: 'gen._febr._març_abr._mai_junh_julh._ago._set._oct._nov._dec.'.split(
  47352. '_'
  47353. ),
  47354. monthsParseExact: true,
  47355. weekdays: 'dimenge_diluns_dimars_dimècres_dijòus_divendres_dissabte'.split(
  47356. '_'
  47357. ),
  47358. weekdaysShort: 'dg._dl._dm._dc._dj._dv._ds.'.split('_'),
  47359. weekdaysMin: 'dg_dl_dm_dc_dj_dv_ds'.split('_'),
  47360. weekdaysParseExact: true,
  47361. longDateFormat: {
  47362. LT: 'H:mm',
  47363. LTS: 'H:mm:ss',
  47364. L: 'DD/MM/YYYY',
  47365. LL: 'D MMMM [de] YYYY',
  47366. ll: 'D MMM YYYY',
  47367. LLL: 'D MMMM [de] YYYY [a] H:mm',
  47368. lll: 'D MMM YYYY, H:mm',
  47369. LLLL: 'dddd D MMMM [de] YYYY [a] H:mm',
  47370. llll: 'ddd D MMM YYYY, H:mm',
  47371. },
  47372. calendar: {
  47373. sameDay: '[uèi a] LT',
  47374. nextDay: '[deman a] LT',
  47375. nextWeek: 'dddd [a] LT',
  47376. lastDay: '[ièr a] LT',
  47377. lastWeek: 'dddd [passat a] LT',
  47378. sameElse: 'L',
  47379. },
  47380. relativeTime: {
  47381. future: "d'aquí %s",
  47382. past: 'fa %s',
  47383. s: 'unas segondas',
  47384. ss: '%d segondas',
  47385. m: 'una minuta',
  47386. mm: '%d minutas',
  47387. h: 'una ora',
  47388. hh: '%d oras',
  47389. d: 'un jorn',
  47390. dd: '%d jorns',
  47391. M: 'un mes',
  47392. MM: '%d meses',
  47393. y: 'un an',
  47394. yy: '%d ans',
  47395. },
  47396. dayOfMonthOrdinalParse: /\d{1,2}(r|n|t|è|a)/,
  47397. ordinal: function (number, period) {
  47398. var output =
  47399. number === 1
  47400. ? 'r'
  47401. : number === 2
  47402. ? 'n'
  47403. : number === 3
  47404. ? 'r'
  47405. : number === 4
  47406. ? 't'
  47407. : 'è';
  47408. if (period === 'w' || period === 'W') {
  47409. output = 'a';
  47410. }
  47411. return number + output;
  47412. },
  47413. week: {
  47414. dow: 1, // Monday is the first day of the week.
  47415. doy: 4,
  47416. },
  47417. });
  47418. return ocLnc;
  47419. })));
  47420. /***/ }),
  47421. /***/ "./node_modules/moment/locale/pa-in.js":
  47422. /*!*********************************************!*\
  47423. !*** ./node_modules/moment/locale/pa-in.js ***!
  47424. \*********************************************/
  47425. /*! no static exports found */
  47426. /***/ (function(module, exports, __webpack_require__) {
  47427. //! moment.js locale configuration
  47428. //! locale : Punjabi (India) [pa-in]
  47429. //! author : Harpreet Singh : https://github.com/harpreetkhalsagtbit
  47430. ;(function (global, factory) {
  47431. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  47432. undefined
  47433. }(this, (function (moment) { 'use strict';
  47434. //! moment.js locale configuration
  47435. var symbolMap = {
  47436. '1': '੧',
  47437. '2': '੨',
  47438. '3': '੩',
  47439. '4': '੪',
  47440. '5': '੫',
  47441. '6': '੬',
  47442. '7': '੭',
  47443. '8': '੮',
  47444. '9': '੯',
  47445. '0': '੦',
  47446. },
  47447. numberMap = {
  47448. '੧': '1',
  47449. '੨': '2',
  47450. '੩': '3',
  47451. '੪': '4',
  47452. '੫': '5',
  47453. '੬': '6',
  47454. '੭': '7',
  47455. '੮': '8',
  47456. '੯': '9',
  47457. '੦': '0',
  47458. };
  47459. var paIn = moment.defineLocale('pa-in', {
  47460. // There are months name as per Nanakshahi Calendar but they are not used as rigidly in modern Punjabi.
  47461. months: 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split(
  47462. '_'
  47463. ),
  47464. monthsShort: 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split(
  47465. '_'
  47466. ),
  47467. weekdays: 'ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ'.split(
  47468. '_'
  47469. ),
  47470. weekdaysShort: 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'),
  47471. weekdaysMin: 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'),
  47472. longDateFormat: {
  47473. LT: 'A h:mm ਵਜੇ',
  47474. LTS: 'A h:mm:ss ਵਜੇ',
  47475. L: 'DD/MM/YYYY',
  47476. LL: 'D MMMM YYYY',
  47477. LLL: 'D MMMM YYYY, A h:mm ਵਜੇ',
  47478. LLLL: 'dddd, D MMMM YYYY, A h:mm ਵਜੇ',
  47479. },
  47480. calendar: {
  47481. sameDay: '[ਅਜ] LT',
  47482. nextDay: '[ਕਲ] LT',
  47483. nextWeek: '[ਅਗਲਾ] dddd, LT',
  47484. lastDay: '[ਕਲ] LT',
  47485. lastWeek: '[ਪਿਛਲੇ] dddd, LT',
  47486. sameElse: 'L',
  47487. },
  47488. relativeTime: {
  47489. future: '%s ਵਿੱਚ',
  47490. past: '%s ਪਿਛਲੇ',
  47491. s: 'ਕੁਝ ਸਕਿੰਟ',
  47492. ss: '%d ਸਕਿੰਟ',
  47493. m: 'ਇਕ ਮਿੰਟ',
  47494. mm: '%d ਮਿੰਟ',
  47495. h: 'ਇੱਕ ਘੰਟਾ',
  47496. hh: '%d ਘੰਟੇ',
  47497. d: 'ਇੱਕ ਦਿਨ',
  47498. dd: '%d ਦਿਨ',
  47499. M: 'ਇੱਕ ਮਹੀਨਾ',
  47500. MM: '%d ਮਹੀਨੇ',
  47501. y: 'ਇੱਕ ਸਾਲ',
  47502. yy: '%d ਸਾਲ',
  47503. },
  47504. preparse: function (string) {
  47505. return string.replace(/[੧੨੩੪੫੬੭੮੯੦]/g, function (match) {
  47506. return numberMap[match];
  47507. });
  47508. },
  47509. postformat: function (string) {
  47510. return string.replace(/\d/g, function (match) {
  47511. return symbolMap[match];
  47512. });
  47513. },
  47514. // Punjabi notation for meridiems are quite fuzzy in practice. While there exists
  47515. // a rigid notion of a 'Pahar' it is not used as rigidly in modern Punjabi.
  47516. meridiemParse: /ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,
  47517. meridiemHour: function (hour, meridiem) {
  47518. if (hour === 12) {
  47519. hour = 0;
  47520. }
  47521. if (meridiem === 'ਰਾਤ') {
  47522. return hour < 4 ? hour : hour + 12;
  47523. } else if (meridiem === 'ਸਵੇਰ') {
  47524. return hour;
  47525. } else if (meridiem === 'ਦੁਪਹਿਰ') {
  47526. return hour >= 10 ? hour : hour + 12;
  47527. } else if (meridiem === 'ਸ਼ਾਮ') {
  47528. return hour + 12;
  47529. }
  47530. },
  47531. meridiem: function (hour, minute, isLower) {
  47532. if (hour < 4) {
  47533. return 'ਰਾਤ';
  47534. } else if (hour < 10) {
  47535. return 'ਸਵੇਰ';
  47536. } else if (hour < 17) {
  47537. return 'ਦੁਪਹਿਰ';
  47538. } else if (hour < 20) {
  47539. return 'ਸ਼ਾਮ';
  47540. } else {
  47541. return 'ਰਾਤ';
  47542. }
  47543. },
  47544. week: {
  47545. dow: 0, // Sunday is the first day of the week.
  47546. doy: 6, // The week that contains Jan 6th is the first week of the year.
  47547. },
  47548. });
  47549. return paIn;
  47550. })));
  47551. /***/ }),
  47552. /***/ "./node_modules/moment/locale/pl.js":
  47553. /*!******************************************!*\
  47554. !*** ./node_modules/moment/locale/pl.js ***!
  47555. \******************************************/
  47556. /*! no static exports found */
  47557. /***/ (function(module, exports, __webpack_require__) {
  47558. //! moment.js locale configuration
  47559. //! locale : Polish [pl]
  47560. //! author : Rafal Hirsz : https://github.com/evoL
  47561. ;(function (global, factory) {
  47562. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  47563. undefined
  47564. }(this, (function (moment) { 'use strict';
  47565. //! moment.js locale configuration
  47566. var monthsNominative = 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split(
  47567. '_'
  47568. ),
  47569. monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split(
  47570. '_'
  47571. );
  47572. function plural(n) {
  47573. return n % 10 < 5 && n % 10 > 1 && ~~(n / 10) % 10 !== 1;
  47574. }
  47575. function translate(number, withoutSuffix, key) {
  47576. var result = number + ' ';
  47577. switch (key) {
  47578. case 'ss':
  47579. return result + (plural(number) ? 'sekundy' : 'sekund');
  47580. case 'm':
  47581. return withoutSuffix ? 'minuta' : 'minutę';
  47582. case 'mm':
  47583. return result + (plural(number) ? 'minuty' : 'minut');
  47584. case 'h':
  47585. return withoutSuffix ? 'godzina' : 'godzinę';
  47586. case 'hh':
  47587. return result + (plural(number) ? 'godziny' : 'godzin');
  47588. case 'MM':
  47589. return result + (plural(number) ? 'miesiące' : 'miesięcy');
  47590. case 'yy':
  47591. return result + (plural(number) ? 'lata' : 'lat');
  47592. }
  47593. }
  47594. var pl = moment.defineLocale('pl', {
  47595. months: function (momentToFormat, format) {
  47596. if (!momentToFormat) {
  47597. return monthsNominative;
  47598. } else if (format === '') {
  47599. // Hack: if format empty we know this is used to generate
  47600. // RegExp by moment. Give then back both valid forms of months
  47601. // in RegExp ready format.
  47602. return (
  47603. '(' +
  47604. monthsSubjective[momentToFormat.month()] +
  47605. '|' +
  47606. monthsNominative[momentToFormat.month()] +
  47607. ')'
  47608. );
  47609. } else if (/D MMMM/.test(format)) {
  47610. return monthsSubjective[momentToFormat.month()];
  47611. } else {
  47612. return monthsNominative[momentToFormat.month()];
  47613. }
  47614. },
  47615. monthsShort: 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'),
  47616. weekdays: 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split(
  47617. '_'
  47618. ),
  47619. weekdaysShort: 'ndz_pon_wt_śr_czw_pt_sob'.split('_'),
  47620. weekdaysMin: 'Nd_Pn_Wt_Śr_Cz_Pt_So'.split('_'),
  47621. longDateFormat: {
  47622. LT: 'HH:mm',
  47623. LTS: 'HH:mm:ss',
  47624. L: 'DD.MM.YYYY',
  47625. LL: 'D MMMM YYYY',
  47626. LLL: 'D MMMM YYYY HH:mm',
  47627. LLLL: 'dddd, D MMMM YYYY HH:mm',
  47628. },
  47629. calendar: {
  47630. sameDay: '[Dziś o] LT',
  47631. nextDay: '[Jutro o] LT',
  47632. nextWeek: function () {
  47633. switch (this.day()) {
  47634. case 0:
  47635. return '[W niedzielę o] LT';
  47636. case 2:
  47637. return '[We wtorek o] LT';
  47638. case 3:
  47639. return '[W środę o] LT';
  47640. case 6:
  47641. return '[W sobotę o] LT';
  47642. default:
  47643. return '[W] dddd [o] LT';
  47644. }
  47645. },
  47646. lastDay: '[Wczoraj o] LT',
  47647. lastWeek: function () {
  47648. switch (this.day()) {
  47649. case 0:
  47650. return '[W zeszłą niedzielę o] LT';
  47651. case 3:
  47652. return '[W zeszłą środę o] LT';
  47653. case 6:
  47654. return '[W zeszłą sobotę o] LT';
  47655. default:
  47656. return '[W zeszły] dddd [o] LT';
  47657. }
  47658. },
  47659. sameElse: 'L',
  47660. },
  47661. relativeTime: {
  47662. future: 'za %s',
  47663. past: '%s temu',
  47664. s: 'kilka sekund',
  47665. ss: translate,
  47666. m: translate,
  47667. mm: translate,
  47668. h: translate,
  47669. hh: translate,
  47670. d: '1 dzień',
  47671. dd: '%d dni',
  47672. M: 'miesiąc',
  47673. MM: translate,
  47674. y: 'rok',
  47675. yy: translate,
  47676. },
  47677. dayOfMonthOrdinalParse: /\d{1,2}\./,
  47678. ordinal: '%d.',
  47679. week: {
  47680. dow: 1, // Monday is the first day of the week.
  47681. doy: 4, // The week that contains Jan 4th is the first week of the year.
  47682. },
  47683. });
  47684. return pl;
  47685. })));
  47686. /***/ }),
  47687. /***/ "./node_modules/moment/locale/pt-br.js":
  47688. /*!*********************************************!*\
  47689. !*** ./node_modules/moment/locale/pt-br.js ***!
  47690. \*********************************************/
  47691. /*! no static exports found */
  47692. /***/ (function(module, exports, __webpack_require__) {
  47693. //! moment.js locale configuration
  47694. //! locale : Portuguese (Brazil) [pt-br]
  47695. //! author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira
  47696. ;(function (global, factory) {
  47697. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  47698. undefined
  47699. }(this, (function (moment) { 'use strict';
  47700. //! moment.js locale configuration
  47701. var ptBr = moment.defineLocale('pt-br', {
  47702. months: 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split(
  47703. '_'
  47704. ),
  47705. monthsShort: 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'),
  47706. weekdays: 'domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado'.split(
  47707. '_'
  47708. ),
  47709. weekdaysShort: 'dom_seg_ter_qua_qui_sex_sáb'.split('_'),
  47710. weekdaysMin: 'do_2ª_3ª_4ª_5ª_6ª_sá'.split('_'),
  47711. weekdaysParseExact: true,
  47712. longDateFormat: {
  47713. LT: 'HH:mm',
  47714. LTS: 'HH:mm:ss',
  47715. L: 'DD/MM/YYYY',
  47716. LL: 'D [de] MMMM [de] YYYY',
  47717. LLL: 'D [de] MMMM [de] YYYY [às] HH:mm',
  47718. LLLL: 'dddd, D [de] MMMM [de] YYYY [às] HH:mm',
  47719. },
  47720. calendar: {
  47721. sameDay: '[Hoje às] LT',
  47722. nextDay: '[Amanhã às] LT',
  47723. nextWeek: 'dddd [às] LT',
  47724. lastDay: '[Ontem às] LT',
  47725. lastWeek: function () {
  47726. return this.day() === 0 || this.day() === 6
  47727. ? '[Último] dddd [às] LT' // Saturday + Sunday
  47728. : '[Última] dddd [às] LT'; // Monday - Friday
  47729. },
  47730. sameElse: 'L',
  47731. },
  47732. relativeTime: {
  47733. future: 'em %s',
  47734. past: 'há %s',
  47735. s: 'poucos segundos',
  47736. ss: '%d segundos',
  47737. m: 'um minuto',
  47738. mm: '%d minutos',
  47739. h: 'uma hora',
  47740. hh: '%d horas',
  47741. d: 'um dia',
  47742. dd: '%d dias',
  47743. M: 'um mês',
  47744. MM: '%d meses',
  47745. y: 'um ano',
  47746. yy: '%d anos',
  47747. },
  47748. dayOfMonthOrdinalParse: /\d{1,2}º/,
  47749. ordinal: '%dº',
  47750. });
  47751. return ptBr;
  47752. })));
  47753. /***/ }),
  47754. /***/ "./node_modules/moment/locale/pt.js":
  47755. /*!******************************************!*\
  47756. !*** ./node_modules/moment/locale/pt.js ***!
  47757. \******************************************/
  47758. /*! no static exports found */
  47759. /***/ (function(module, exports, __webpack_require__) {
  47760. //! moment.js locale configuration
  47761. //! locale : Portuguese [pt]
  47762. //! author : Jefferson : https://github.com/jalex79
  47763. ;(function (global, factory) {
  47764. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  47765. undefined
  47766. }(this, (function (moment) { 'use strict';
  47767. //! moment.js locale configuration
  47768. var pt = moment.defineLocale('pt', {
  47769. months: 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split(
  47770. '_'
  47771. ),
  47772. monthsShort: 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'),
  47773. weekdays: 'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split(
  47774. '_'
  47775. ),
  47776. weekdaysShort: 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'),
  47777. weekdaysMin: 'Do_2ª_3ª_4ª_5ª_6ª_Sá'.split('_'),
  47778. weekdaysParseExact: true,
  47779. longDateFormat: {
  47780. LT: 'HH:mm',
  47781. LTS: 'HH:mm:ss',
  47782. L: 'DD/MM/YYYY',
  47783. LL: 'D [de] MMMM [de] YYYY',
  47784. LLL: 'D [de] MMMM [de] YYYY HH:mm',
  47785. LLLL: 'dddd, D [de] MMMM [de] YYYY HH:mm',
  47786. },
  47787. calendar: {
  47788. sameDay: '[Hoje às] LT',
  47789. nextDay: '[Amanhã às] LT',
  47790. nextWeek: 'dddd [às] LT',
  47791. lastDay: '[Ontem às] LT',
  47792. lastWeek: function () {
  47793. return this.day() === 0 || this.day() === 6
  47794. ? '[Último] dddd [às] LT' // Saturday + Sunday
  47795. : '[Última] dddd [às] LT'; // Monday - Friday
  47796. },
  47797. sameElse: 'L',
  47798. },
  47799. relativeTime: {
  47800. future: 'em %s',
  47801. past: 'há %s',
  47802. s: 'segundos',
  47803. ss: '%d segundos',
  47804. m: 'um minuto',
  47805. mm: '%d minutos',
  47806. h: 'uma hora',
  47807. hh: '%d horas',
  47808. d: 'um dia',
  47809. dd: '%d dias',
  47810. M: 'um mês',
  47811. MM: '%d meses',
  47812. y: 'um ano',
  47813. yy: '%d anos',
  47814. },
  47815. dayOfMonthOrdinalParse: /\d{1,2}º/,
  47816. ordinal: '%dº',
  47817. week: {
  47818. dow: 1, // Monday is the first day of the week.
  47819. doy: 4, // The week that contains Jan 4th is the first week of the year.
  47820. },
  47821. });
  47822. return pt;
  47823. })));
  47824. /***/ }),
  47825. /***/ "./node_modules/moment/locale/ro.js":
  47826. /*!******************************************!*\
  47827. !*** ./node_modules/moment/locale/ro.js ***!
  47828. \******************************************/
  47829. /*! no static exports found */
  47830. /***/ (function(module, exports, __webpack_require__) {
  47831. //! moment.js locale configuration
  47832. //! locale : Romanian [ro]
  47833. //! author : Vlad Gurdiga : https://github.com/gurdiga
  47834. //! author : Valentin Agachi : https://github.com/avaly
  47835. //! author : Emanuel Cepoi : https://github.com/cepem
  47836. ;(function (global, factory) {
  47837. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  47838. undefined
  47839. }(this, (function (moment) { 'use strict';
  47840. //! moment.js locale configuration
  47841. function relativeTimeWithPlural(number, withoutSuffix, key) {
  47842. var format = {
  47843. ss: 'secunde',
  47844. mm: 'minute',
  47845. hh: 'ore',
  47846. dd: 'zile',
  47847. MM: 'luni',
  47848. yy: 'ani',
  47849. },
  47850. separator = ' ';
  47851. if (number % 100 >= 20 || (number >= 100 && number % 100 === 0)) {
  47852. separator = ' de ';
  47853. }
  47854. return number + separator + format[key];
  47855. }
  47856. var ro = moment.defineLocale('ro', {
  47857. months: 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split(
  47858. '_'
  47859. ),
  47860. monthsShort: 'ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split(
  47861. '_'
  47862. ),
  47863. monthsParseExact: true,
  47864. weekdays: 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'),
  47865. weekdaysShort: 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'),
  47866. weekdaysMin: 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'),
  47867. longDateFormat: {
  47868. LT: 'H:mm',
  47869. LTS: 'H:mm:ss',
  47870. L: 'DD.MM.YYYY',
  47871. LL: 'D MMMM YYYY',
  47872. LLL: 'D MMMM YYYY H:mm',
  47873. LLLL: 'dddd, D MMMM YYYY H:mm',
  47874. },
  47875. calendar: {
  47876. sameDay: '[azi la] LT',
  47877. nextDay: '[mâine la] LT',
  47878. nextWeek: 'dddd [la] LT',
  47879. lastDay: '[ieri la] LT',
  47880. lastWeek: '[fosta] dddd [la] LT',
  47881. sameElse: 'L',
  47882. },
  47883. relativeTime: {
  47884. future: 'peste %s',
  47885. past: '%s în urmă',
  47886. s: 'câteva secunde',
  47887. ss: relativeTimeWithPlural,
  47888. m: 'un minut',
  47889. mm: relativeTimeWithPlural,
  47890. h: 'o oră',
  47891. hh: relativeTimeWithPlural,
  47892. d: 'o zi',
  47893. dd: relativeTimeWithPlural,
  47894. M: 'o lună',
  47895. MM: relativeTimeWithPlural,
  47896. y: 'un an',
  47897. yy: relativeTimeWithPlural,
  47898. },
  47899. week: {
  47900. dow: 1, // Monday is the first day of the week.
  47901. doy: 7, // The week that contains Jan 7th is the first week of the year.
  47902. },
  47903. });
  47904. return ro;
  47905. })));
  47906. /***/ }),
  47907. /***/ "./node_modules/moment/locale/ru.js":
  47908. /*!******************************************!*\
  47909. !*** ./node_modules/moment/locale/ru.js ***!
  47910. \******************************************/
  47911. /*! no static exports found */
  47912. /***/ (function(module, exports, __webpack_require__) {
  47913. //! moment.js locale configuration
  47914. //! locale : Russian [ru]
  47915. //! author : Viktorminator : https://github.com/Viktorminator
  47916. //! author : Menelion Elensúle : https://github.com/Oire
  47917. //! author : Коренберг Марк : https://github.com/socketpair
  47918. ;(function (global, factory) {
  47919. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  47920. undefined
  47921. }(this, (function (moment) { 'use strict';
  47922. //! moment.js locale configuration
  47923. function plural(word, num) {
  47924. var forms = word.split('_');
  47925. return num % 10 === 1 && num % 100 !== 11
  47926. ? forms[0]
  47927. : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20)
  47928. ? forms[1]
  47929. : forms[2];
  47930. }
  47931. function relativeTimeWithPlural(number, withoutSuffix, key) {
  47932. var format = {
  47933. ss: withoutSuffix ? 'секунда_секунды_секунд' : 'секунду_секунды_секунд',
  47934. mm: withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут',
  47935. hh: 'час_часа_часов',
  47936. dd: 'день_дня_дней',
  47937. MM: 'месяц_месяца_месяцев',
  47938. yy: 'год_года_лет',
  47939. };
  47940. if (key === 'm') {
  47941. return withoutSuffix ? 'минута' : 'минуту';
  47942. } else {
  47943. return number + ' ' + plural(format[key], +number);
  47944. }
  47945. }
  47946. var monthsParse = [
  47947. /^янв/i,
  47948. /^фев/i,
  47949. /^мар/i,
  47950. /^апр/i,
  47951. /^ма[йя]/i,
  47952. /^июн/i,
  47953. /^июл/i,
  47954. /^авг/i,
  47955. /^сен/i,
  47956. /^окт/i,
  47957. /^ноя/i,
  47958. /^дек/i,
  47959. ];
  47960. // http://new.gramota.ru/spravka/rules/139-prop : § 103
  47961. // Сокращения месяцев: http://new.gramota.ru/spravka/buro/search-answer?s=242637
  47962. // CLDR data: http://www.unicode.org/cldr/charts/28/summary/ru.html#1753
  47963. var ru = moment.defineLocale('ru', {
  47964. months: {
  47965. format: 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split(
  47966. '_'
  47967. ),
  47968. standalone: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split(
  47969. '_'
  47970. ),
  47971. },
  47972. monthsShort: {
  47973. // по CLDR именно "июл." и "июн.", но какой смысл менять букву на точку?
  47974. format: 'янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.'.split(
  47975. '_'
  47976. ),
  47977. standalone: 'янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.'.split(
  47978. '_'
  47979. ),
  47980. },
  47981. weekdays: {
  47982. standalone: 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split(
  47983. '_'
  47984. ),
  47985. format: 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split(
  47986. '_'
  47987. ),
  47988. isFormat: /\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?] ?dddd/,
  47989. },
  47990. weekdaysShort: 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
  47991. weekdaysMin: 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
  47992. monthsParse: monthsParse,
  47993. longMonthsParse: monthsParse,
  47994. shortMonthsParse: monthsParse,
  47995. // полные названия с падежами, по три буквы, для некоторых, по 4 буквы, сокращения с точкой и без точки
  47996. monthsRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,
  47997. // копия предыдущего
  47998. monthsShortRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,
  47999. // полные названия с падежами
  48000. monthsStrictRegex: /^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,
  48001. // Выражение, которое соответствует только сокращённым формам
  48002. monthsShortStrictRegex: /^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,
  48003. longDateFormat: {
  48004. LT: 'H:mm',
  48005. LTS: 'H:mm:ss',
  48006. L: 'DD.MM.YYYY',
  48007. LL: 'D MMMM YYYY г.',
  48008. LLL: 'D MMMM YYYY г., H:mm',
  48009. LLLL: 'dddd, D MMMM YYYY г., H:mm',
  48010. },
  48011. calendar: {
  48012. sameDay: '[Сегодня, в] LT',
  48013. nextDay: '[Завтра, в] LT',
  48014. lastDay: '[Вчера, в] LT',
  48015. nextWeek: function (now) {
  48016. if (now.week() !== this.week()) {
  48017. switch (this.day()) {
  48018. case 0:
  48019. return '[В следующее] dddd, [в] LT';
  48020. case 1:
  48021. case 2:
  48022. case 4:
  48023. return '[В следующий] dddd, [в] LT';
  48024. case 3:
  48025. case 5:
  48026. case 6:
  48027. return '[В следующую] dddd, [в] LT';
  48028. }
  48029. } else {
  48030. if (this.day() === 2) {
  48031. return '[Во] dddd, [в] LT';
  48032. } else {
  48033. return '[В] dddd, [в] LT';
  48034. }
  48035. }
  48036. },
  48037. lastWeek: function (now) {
  48038. if (now.week() !== this.week()) {
  48039. switch (this.day()) {
  48040. case 0:
  48041. return '[В прошлое] dddd, [в] LT';
  48042. case 1:
  48043. case 2:
  48044. case 4:
  48045. return '[В прошлый] dddd, [в] LT';
  48046. case 3:
  48047. case 5:
  48048. case 6:
  48049. return '[В прошлую] dddd, [в] LT';
  48050. }
  48051. } else {
  48052. if (this.day() === 2) {
  48053. return '[Во] dddd, [в] LT';
  48054. } else {
  48055. return '[В] dddd, [в] LT';
  48056. }
  48057. }
  48058. },
  48059. sameElse: 'L',
  48060. },
  48061. relativeTime: {
  48062. future: 'через %s',
  48063. past: '%s назад',
  48064. s: 'несколько секунд',
  48065. ss: relativeTimeWithPlural,
  48066. m: relativeTimeWithPlural,
  48067. mm: relativeTimeWithPlural,
  48068. h: 'час',
  48069. hh: relativeTimeWithPlural,
  48070. d: 'день',
  48071. dd: relativeTimeWithPlural,
  48072. M: 'месяц',
  48073. MM: relativeTimeWithPlural,
  48074. y: 'год',
  48075. yy: relativeTimeWithPlural,
  48076. },
  48077. meridiemParse: /ночи|утра|дня|вечера/i,
  48078. isPM: function (input) {
  48079. return /^(дня|вечера)$/.test(input);
  48080. },
  48081. meridiem: function (hour, minute, isLower) {
  48082. if (hour < 4) {
  48083. return 'ночи';
  48084. } else if (hour < 12) {
  48085. return 'утра';
  48086. } else if (hour < 17) {
  48087. return 'дня';
  48088. } else {
  48089. return 'вечера';
  48090. }
  48091. },
  48092. dayOfMonthOrdinalParse: /\d{1,2}-(й|го|я)/,
  48093. ordinal: function (number, period) {
  48094. switch (period) {
  48095. case 'M':
  48096. case 'd':
  48097. case 'DDD':
  48098. return number + '-й';
  48099. case 'D':
  48100. return number + '-го';
  48101. case 'w':
  48102. case 'W':
  48103. return number + '-я';
  48104. default:
  48105. return number;
  48106. }
  48107. },
  48108. week: {
  48109. dow: 1, // Monday is the first day of the week.
  48110. doy: 4, // The week that contains Jan 4th is the first week of the year.
  48111. },
  48112. });
  48113. return ru;
  48114. })));
  48115. /***/ }),
  48116. /***/ "./node_modules/moment/locale/sd.js":
  48117. /*!******************************************!*\
  48118. !*** ./node_modules/moment/locale/sd.js ***!
  48119. \******************************************/
  48120. /*! no static exports found */
  48121. /***/ (function(module, exports, __webpack_require__) {
  48122. //! moment.js locale configuration
  48123. //! locale : Sindhi [sd]
  48124. //! author : Narain Sagar : https://github.com/narainsagar
  48125. ;(function (global, factory) {
  48126. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  48127. undefined
  48128. }(this, (function (moment) { 'use strict';
  48129. //! moment.js locale configuration
  48130. var months = [
  48131. 'جنوري',
  48132. 'فيبروري',
  48133. 'مارچ',
  48134. 'اپريل',
  48135. 'مئي',
  48136. 'جون',
  48137. 'جولاءِ',
  48138. 'آگسٽ',
  48139. 'سيپٽمبر',
  48140. 'آڪٽوبر',
  48141. 'نومبر',
  48142. 'ڊسمبر',
  48143. ],
  48144. days = ['آچر', 'سومر', 'اڱارو', 'اربع', 'خميس', 'جمع', 'ڇنڇر'];
  48145. var sd = moment.defineLocale('sd', {
  48146. months: months,
  48147. monthsShort: months,
  48148. weekdays: days,
  48149. weekdaysShort: days,
  48150. weekdaysMin: days,
  48151. longDateFormat: {
  48152. LT: 'HH:mm',
  48153. LTS: 'HH:mm:ss',
  48154. L: 'DD/MM/YYYY',
  48155. LL: 'D MMMM YYYY',
  48156. LLL: 'D MMMM YYYY HH:mm',
  48157. LLLL: 'dddd، D MMMM YYYY HH:mm',
  48158. },
  48159. meridiemParse: /صبح|شام/,
  48160. isPM: function (input) {
  48161. return 'شام' === input;
  48162. },
  48163. meridiem: function (hour, minute, isLower) {
  48164. if (hour < 12) {
  48165. return 'صبح';
  48166. }
  48167. return 'شام';
  48168. },
  48169. calendar: {
  48170. sameDay: '[اڄ] LT',
  48171. nextDay: '[سڀاڻي] LT',
  48172. nextWeek: 'dddd [اڳين هفتي تي] LT',
  48173. lastDay: '[ڪالهه] LT',
  48174. lastWeek: '[گزريل هفتي] dddd [تي] LT',
  48175. sameElse: 'L',
  48176. },
  48177. relativeTime: {
  48178. future: '%s پوء',
  48179. past: '%s اڳ',
  48180. s: 'چند سيڪنڊ',
  48181. ss: '%d سيڪنڊ',
  48182. m: 'هڪ منٽ',
  48183. mm: '%d منٽ',
  48184. h: 'هڪ ڪلاڪ',
  48185. hh: '%d ڪلاڪ',
  48186. d: 'هڪ ڏينهن',
  48187. dd: '%d ڏينهن',
  48188. M: 'هڪ مهينو',
  48189. MM: '%d مهينا',
  48190. y: 'هڪ سال',
  48191. yy: '%d سال',
  48192. },
  48193. preparse: function (string) {
  48194. return string.replace(/،/g, ',');
  48195. },
  48196. postformat: function (string) {
  48197. return string.replace(/,/g, '،');
  48198. },
  48199. week: {
  48200. dow: 1, // Monday is the first day of the week.
  48201. doy: 4, // The week that contains Jan 4th is the first week of the year.
  48202. },
  48203. });
  48204. return sd;
  48205. })));
  48206. /***/ }),
  48207. /***/ "./node_modules/moment/locale/se.js":
  48208. /*!******************************************!*\
  48209. !*** ./node_modules/moment/locale/se.js ***!
  48210. \******************************************/
  48211. /*! no static exports found */
  48212. /***/ (function(module, exports, __webpack_require__) {
  48213. //! moment.js locale configuration
  48214. //! locale : Northern Sami [se]
  48215. //! authors : Bård Rolstad Henriksen : https://github.com/karamell
  48216. ;(function (global, factory) {
  48217. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  48218. undefined
  48219. }(this, (function (moment) { 'use strict';
  48220. //! moment.js locale configuration
  48221. var se = moment.defineLocale('se', {
  48222. 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(
  48223. '_'
  48224. ),
  48225. monthsShort: 'ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov'.split(
  48226. '_'
  48227. ),
  48228. weekdays: 'sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat'.split(
  48229. '_'
  48230. ),
  48231. weekdaysShort: 'sotn_vuos_maŋ_gask_duor_bear_láv'.split('_'),
  48232. weekdaysMin: 's_v_m_g_d_b_L'.split('_'),
  48233. longDateFormat: {
  48234. LT: 'HH:mm',
  48235. LTS: 'HH:mm:ss',
  48236. L: 'DD.MM.YYYY',
  48237. LL: 'MMMM D. [b.] YYYY',
  48238. LLL: 'MMMM D. [b.] YYYY [ti.] HH:mm',
  48239. LLLL: 'dddd, MMMM D. [b.] YYYY [ti.] HH:mm',
  48240. },
  48241. calendar: {
  48242. sameDay: '[otne ti] LT',
  48243. nextDay: '[ihttin ti] LT',
  48244. nextWeek: 'dddd [ti] LT',
  48245. lastDay: '[ikte ti] LT',
  48246. lastWeek: '[ovddit] dddd [ti] LT',
  48247. sameElse: 'L',
  48248. },
  48249. relativeTime: {
  48250. future: '%s geažes',
  48251. past: 'maŋit %s',
  48252. s: 'moadde sekunddat',
  48253. ss: '%d sekunddat',
  48254. m: 'okta minuhta',
  48255. mm: '%d minuhtat',
  48256. h: 'okta diimmu',
  48257. hh: '%d diimmut',
  48258. d: 'okta beaivi',
  48259. dd: '%d beaivvit',
  48260. M: 'okta mánnu',
  48261. MM: '%d mánut',
  48262. y: 'okta jahki',
  48263. yy: '%d jagit',
  48264. },
  48265. dayOfMonthOrdinalParse: /\d{1,2}\./,
  48266. ordinal: '%d.',
  48267. week: {
  48268. dow: 1, // Monday is the first day of the week.
  48269. doy: 4, // The week that contains Jan 4th is the first week of the year.
  48270. },
  48271. });
  48272. return se;
  48273. })));
  48274. /***/ }),
  48275. /***/ "./node_modules/moment/locale/si.js":
  48276. /*!******************************************!*\
  48277. !*** ./node_modules/moment/locale/si.js ***!
  48278. \******************************************/
  48279. /*! no static exports found */
  48280. /***/ (function(module, exports, __webpack_require__) {
  48281. //! moment.js locale configuration
  48282. //! locale : Sinhalese [si]
  48283. //! author : Sampath Sitinamaluwa : https://github.com/sampathsris
  48284. ;(function (global, factory) {
  48285. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  48286. undefined
  48287. }(this, (function (moment) { 'use strict';
  48288. //! moment.js locale configuration
  48289. /*jshint -W100*/
  48290. var si = moment.defineLocale('si', {
  48291. months: 'ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්'.split(
  48292. '_'
  48293. ),
  48294. monthsShort: 'ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ'.split(
  48295. '_'
  48296. ),
  48297. weekdays: 'ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා'.split(
  48298. '_'
  48299. ),
  48300. weekdaysShort: 'ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන'.split('_'),
  48301. weekdaysMin: 'ඉ_ස_අ_බ_බ්‍ර_සි_සෙ'.split('_'),
  48302. weekdaysParseExact: true,
  48303. longDateFormat: {
  48304. LT: 'a h:mm',
  48305. LTS: 'a h:mm:ss',
  48306. L: 'YYYY/MM/DD',
  48307. LL: 'YYYY MMMM D',
  48308. LLL: 'YYYY MMMM D, a h:mm',
  48309. LLLL: 'YYYY MMMM D [වැනි] dddd, a h:mm:ss',
  48310. },
  48311. calendar: {
  48312. sameDay: '[අද] LT[ට]',
  48313. nextDay: '[හෙට] LT[ට]',
  48314. nextWeek: 'dddd LT[ට]',
  48315. lastDay: '[ඊයේ] LT[ට]',
  48316. lastWeek: '[පසුගිය] dddd LT[ට]',
  48317. sameElse: 'L',
  48318. },
  48319. relativeTime: {
  48320. future: '%sකින්',
  48321. past: '%sකට පෙර',
  48322. s: 'තත්පර කිහිපය',
  48323. ss: 'තත්පර %d',
  48324. m: 'මිනිත්තුව',
  48325. mm: 'මිනිත්තු %d',
  48326. h: 'පැය',
  48327. hh: 'පැය %d',
  48328. d: 'දිනය',
  48329. dd: 'දින %d',
  48330. M: 'මාසය',
  48331. MM: 'මාස %d',
  48332. y: 'වසර',
  48333. yy: 'වසර %d',
  48334. },
  48335. dayOfMonthOrdinalParse: /\d{1,2} වැනි/,
  48336. ordinal: function (number) {
  48337. return number + ' වැනි';
  48338. },
  48339. meridiemParse: /පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,
  48340. isPM: function (input) {
  48341. return input === 'ප.ව.' || input === 'පස් වරු';
  48342. },
  48343. meridiem: function (hours, minutes, isLower) {
  48344. if (hours > 11) {
  48345. return isLower ? 'ප.ව.' : 'පස් වරු';
  48346. } else {
  48347. return isLower ? 'පෙ.ව.' : 'පෙර වරු';
  48348. }
  48349. },
  48350. });
  48351. return si;
  48352. })));
  48353. /***/ }),
  48354. /***/ "./node_modules/moment/locale/sk.js":
  48355. /*!******************************************!*\
  48356. !*** ./node_modules/moment/locale/sk.js ***!
  48357. \******************************************/
  48358. /*! no static exports found */
  48359. /***/ (function(module, exports, __webpack_require__) {
  48360. //! moment.js locale configuration
  48361. //! locale : Slovak [sk]
  48362. //! author : Martin Minka : https://github.com/k2s
  48363. //! based on work of petrbela : https://github.com/petrbela
  48364. ;(function (global, factory) {
  48365. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  48366. undefined
  48367. }(this, (function (moment) { 'use strict';
  48368. //! moment.js locale configuration
  48369. var months = 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split(
  48370. '_'
  48371. ),
  48372. monthsShort = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_');
  48373. function plural(n) {
  48374. return n > 1 && n < 5;
  48375. }
  48376. function translate(number, withoutSuffix, key, isFuture) {
  48377. var result = number + ' ';
  48378. switch (key) {
  48379. case 's': // a few seconds / in a few seconds / a few seconds ago
  48380. return withoutSuffix || isFuture ? 'pár sekúnd' : 'pár sekundami';
  48381. case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago
  48382. if (withoutSuffix || isFuture) {
  48383. return result + (plural(number) ? 'sekundy' : 'sekúnd');
  48384. } else {
  48385. return result + 'sekundami';
  48386. }
  48387. case 'm': // a minute / in a minute / a minute ago
  48388. return withoutSuffix ? 'minúta' : isFuture ? 'minútu' : 'minútou';
  48389. case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
  48390. if (withoutSuffix || isFuture) {
  48391. return result + (plural(number) ? 'minúty' : 'minút');
  48392. } else {
  48393. return result + 'minútami';
  48394. }
  48395. case 'h': // an hour / in an hour / an hour ago
  48396. return withoutSuffix ? 'hodina' : isFuture ? 'hodinu' : 'hodinou';
  48397. case 'hh': // 9 hours / in 9 hours / 9 hours ago
  48398. if (withoutSuffix || isFuture) {
  48399. return result + (plural(number) ? 'hodiny' : 'hodín');
  48400. } else {
  48401. return result + 'hodinami';
  48402. }
  48403. case 'd': // a day / in a day / a day ago
  48404. return withoutSuffix || isFuture ? 'deň' : 'dňom';
  48405. case 'dd': // 9 days / in 9 days / 9 days ago
  48406. if (withoutSuffix || isFuture) {
  48407. return result + (plural(number) ? 'dni' : 'dní');
  48408. } else {
  48409. return result + 'dňami';
  48410. }
  48411. case 'M': // a month / in a month / a month ago
  48412. return withoutSuffix || isFuture ? 'mesiac' : 'mesiacom';
  48413. case 'MM': // 9 months / in 9 months / 9 months ago
  48414. if (withoutSuffix || isFuture) {
  48415. return result + (plural(number) ? 'mesiace' : 'mesiacov');
  48416. } else {
  48417. return result + 'mesiacmi';
  48418. }
  48419. case 'y': // a year / in a year / a year ago
  48420. return withoutSuffix || isFuture ? 'rok' : 'rokom';
  48421. case 'yy': // 9 years / in 9 years / 9 years ago
  48422. if (withoutSuffix || isFuture) {
  48423. return result + (plural(number) ? 'roky' : 'rokov');
  48424. } else {
  48425. return result + 'rokmi';
  48426. }
  48427. }
  48428. }
  48429. var sk = moment.defineLocale('sk', {
  48430. months: months,
  48431. monthsShort: monthsShort,
  48432. weekdays: 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'),
  48433. weekdaysShort: 'ne_po_ut_st_št_pi_so'.split('_'),
  48434. weekdaysMin: 'ne_po_ut_st_št_pi_so'.split('_'),
  48435. longDateFormat: {
  48436. LT: 'H:mm',
  48437. LTS: 'H:mm:ss',
  48438. L: 'DD.MM.YYYY',
  48439. LL: 'D. MMMM YYYY',
  48440. LLL: 'D. MMMM YYYY H:mm',
  48441. LLLL: 'dddd D. MMMM YYYY H:mm',
  48442. },
  48443. calendar: {
  48444. sameDay: '[dnes o] LT',
  48445. nextDay: '[zajtra o] LT',
  48446. nextWeek: function () {
  48447. switch (this.day()) {
  48448. case 0:
  48449. return '[v nedeľu o] LT';
  48450. case 1:
  48451. case 2:
  48452. return '[v] dddd [o] LT';
  48453. case 3:
  48454. return '[v stredu o] LT';
  48455. case 4:
  48456. return '[vo štvrtok o] LT';
  48457. case 5:
  48458. return '[v piatok o] LT';
  48459. case 6:
  48460. return '[v sobotu o] LT';
  48461. }
  48462. },
  48463. lastDay: '[včera o] LT',
  48464. lastWeek: function () {
  48465. switch (this.day()) {
  48466. case 0:
  48467. return '[minulú nedeľu o] LT';
  48468. case 1:
  48469. case 2:
  48470. return '[minulý] dddd [o] LT';
  48471. case 3:
  48472. return '[minulú stredu o] LT';
  48473. case 4:
  48474. case 5:
  48475. return '[minulý] dddd [o] LT';
  48476. case 6:
  48477. return '[minulú sobotu o] LT';
  48478. }
  48479. },
  48480. sameElse: 'L',
  48481. },
  48482. relativeTime: {
  48483. future: 'za %s',
  48484. past: 'pred %s',
  48485. s: translate,
  48486. ss: translate,
  48487. m: translate,
  48488. mm: translate,
  48489. h: translate,
  48490. hh: translate,
  48491. d: translate,
  48492. dd: translate,
  48493. M: translate,
  48494. MM: translate,
  48495. y: translate,
  48496. yy: translate,
  48497. },
  48498. dayOfMonthOrdinalParse: /\d{1,2}\./,
  48499. ordinal: '%d.',
  48500. week: {
  48501. dow: 1, // Monday is the first day of the week.
  48502. doy: 4, // The week that contains Jan 4th is the first week of the year.
  48503. },
  48504. });
  48505. return sk;
  48506. })));
  48507. /***/ }),
  48508. /***/ "./node_modules/moment/locale/sl.js":
  48509. /*!******************************************!*\
  48510. !*** ./node_modules/moment/locale/sl.js ***!
  48511. \******************************************/
  48512. /*! no static exports found */
  48513. /***/ (function(module, exports, __webpack_require__) {
  48514. //! moment.js locale configuration
  48515. //! locale : Slovenian [sl]
  48516. //! author : Robert Sedovšek : https://github.com/sedovsek
  48517. ;(function (global, factory) {
  48518. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  48519. undefined
  48520. }(this, (function (moment) { 'use strict';
  48521. //! moment.js locale configuration
  48522. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  48523. var result = number + ' ';
  48524. switch (key) {
  48525. case 's':
  48526. return withoutSuffix || isFuture
  48527. ? 'nekaj sekund'
  48528. : 'nekaj sekundami';
  48529. case 'ss':
  48530. if (number === 1) {
  48531. result += withoutSuffix ? 'sekundo' : 'sekundi';
  48532. } else if (number === 2) {
  48533. result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';
  48534. } else if (number < 5) {
  48535. result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';
  48536. } else {
  48537. result += 'sekund';
  48538. }
  48539. return result;
  48540. case 'm':
  48541. return withoutSuffix ? 'ena minuta' : 'eno minuto';
  48542. case 'mm':
  48543. if (number === 1) {
  48544. result += withoutSuffix ? 'minuta' : 'minuto';
  48545. } else if (number === 2) {
  48546. result += withoutSuffix || isFuture ? 'minuti' : 'minutama';
  48547. } else if (number < 5) {
  48548. result += withoutSuffix || isFuture ? 'minute' : 'minutami';
  48549. } else {
  48550. result += withoutSuffix || isFuture ? 'minut' : 'minutami';
  48551. }
  48552. return result;
  48553. case 'h':
  48554. return withoutSuffix ? 'ena ura' : 'eno uro';
  48555. case 'hh':
  48556. if (number === 1) {
  48557. result += withoutSuffix ? 'ura' : 'uro';
  48558. } else if (number === 2) {
  48559. result += withoutSuffix || isFuture ? 'uri' : 'urama';
  48560. } else if (number < 5) {
  48561. result += withoutSuffix || isFuture ? 'ure' : 'urami';
  48562. } else {
  48563. result += withoutSuffix || isFuture ? 'ur' : 'urami';
  48564. }
  48565. return result;
  48566. case 'd':
  48567. return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';
  48568. case 'dd':
  48569. if (number === 1) {
  48570. result += withoutSuffix || isFuture ? 'dan' : 'dnem';
  48571. } else if (number === 2) {
  48572. result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';
  48573. } else {
  48574. result += withoutSuffix || isFuture ? 'dni' : 'dnevi';
  48575. }
  48576. return result;
  48577. case 'M':
  48578. return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';
  48579. case 'MM':
  48580. if (number === 1) {
  48581. result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';
  48582. } else if (number === 2) {
  48583. result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';
  48584. } else if (number < 5) {
  48585. result += withoutSuffix || isFuture ? 'mesece' : 'meseci';
  48586. } else {
  48587. result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';
  48588. }
  48589. return result;
  48590. case 'y':
  48591. return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';
  48592. case 'yy':
  48593. if (number === 1) {
  48594. result += withoutSuffix || isFuture ? 'leto' : 'letom';
  48595. } else if (number === 2) {
  48596. result += withoutSuffix || isFuture ? 'leti' : 'letoma';
  48597. } else if (number < 5) {
  48598. result += withoutSuffix || isFuture ? 'leta' : 'leti';
  48599. } else {
  48600. result += withoutSuffix || isFuture ? 'let' : 'leti';
  48601. }
  48602. return result;
  48603. }
  48604. }
  48605. var sl = moment.defineLocale('sl', {
  48606. months: 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split(
  48607. '_'
  48608. ),
  48609. monthsShort: 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split(
  48610. '_'
  48611. ),
  48612. monthsParseExact: true,
  48613. weekdays: 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'),
  48614. weekdaysShort: 'ned._pon._tor._sre._čet._pet._sob.'.split('_'),
  48615. weekdaysMin: 'ne_po_to_sr_če_pe_so'.split('_'),
  48616. weekdaysParseExact: true,
  48617. longDateFormat: {
  48618. LT: 'H:mm',
  48619. LTS: 'H:mm:ss',
  48620. L: 'DD. MM. YYYY',
  48621. LL: 'D. MMMM YYYY',
  48622. LLL: 'D. MMMM YYYY H:mm',
  48623. LLLL: 'dddd, D. MMMM YYYY H:mm',
  48624. },
  48625. calendar: {
  48626. sameDay: '[danes ob] LT',
  48627. nextDay: '[jutri ob] LT',
  48628. nextWeek: function () {
  48629. switch (this.day()) {
  48630. case 0:
  48631. return '[v] [nedeljo] [ob] LT';
  48632. case 3:
  48633. return '[v] [sredo] [ob] LT';
  48634. case 6:
  48635. return '[v] [soboto] [ob] LT';
  48636. case 1:
  48637. case 2:
  48638. case 4:
  48639. case 5:
  48640. return '[v] dddd [ob] LT';
  48641. }
  48642. },
  48643. lastDay: '[včeraj ob] LT',
  48644. lastWeek: function () {
  48645. switch (this.day()) {
  48646. case 0:
  48647. return '[prejšnjo] [nedeljo] [ob] LT';
  48648. case 3:
  48649. return '[prejšnjo] [sredo] [ob] LT';
  48650. case 6:
  48651. return '[prejšnjo] [soboto] [ob] LT';
  48652. case 1:
  48653. case 2:
  48654. case 4:
  48655. case 5:
  48656. return '[prejšnji] dddd [ob] LT';
  48657. }
  48658. },
  48659. sameElse: 'L',
  48660. },
  48661. relativeTime: {
  48662. future: 'čez %s',
  48663. past: 'pred %s',
  48664. s: processRelativeTime,
  48665. ss: processRelativeTime,
  48666. m: processRelativeTime,
  48667. mm: processRelativeTime,
  48668. h: processRelativeTime,
  48669. hh: processRelativeTime,
  48670. d: processRelativeTime,
  48671. dd: processRelativeTime,
  48672. M: processRelativeTime,
  48673. MM: processRelativeTime,
  48674. y: processRelativeTime,
  48675. yy: processRelativeTime,
  48676. },
  48677. dayOfMonthOrdinalParse: /\d{1,2}\./,
  48678. ordinal: '%d.',
  48679. week: {
  48680. dow: 1, // Monday is the first day of the week.
  48681. doy: 7, // The week that contains Jan 7th is the first week of the year.
  48682. },
  48683. });
  48684. return sl;
  48685. })));
  48686. /***/ }),
  48687. /***/ "./node_modules/moment/locale/sq.js":
  48688. /*!******************************************!*\
  48689. !*** ./node_modules/moment/locale/sq.js ***!
  48690. \******************************************/
  48691. /*! no static exports found */
  48692. /***/ (function(module, exports, __webpack_require__) {
  48693. //! moment.js locale configuration
  48694. //! locale : Albanian [sq]
  48695. //! author : Flakërim Ismani : https://github.com/flakerimi
  48696. //! author : Menelion Elensúle : https://github.com/Oire
  48697. //! author : Oerd Cukalla : https://github.com/oerd
  48698. ;(function (global, factory) {
  48699. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  48700. undefined
  48701. }(this, (function (moment) { 'use strict';
  48702. //! moment.js locale configuration
  48703. var sq = moment.defineLocale('sq', {
  48704. months: 'Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor'.split(
  48705. '_'
  48706. ),
  48707. monthsShort: 'Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj'.split('_'),
  48708. weekdays: 'E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë'.split(
  48709. '_'
  48710. ),
  48711. weekdaysShort: 'Die_Hën_Mar_Mër_Enj_Pre_Sht'.split('_'),
  48712. weekdaysMin: 'D_H_Ma_Më_E_P_Sh'.split('_'),
  48713. weekdaysParseExact: true,
  48714. meridiemParse: /PD|MD/,
  48715. isPM: function (input) {
  48716. return input.charAt(0) === 'M';
  48717. },
  48718. meridiem: function (hours, minutes, isLower) {
  48719. return hours < 12 ? 'PD' : 'MD';
  48720. },
  48721. longDateFormat: {
  48722. LT: 'HH:mm',
  48723. LTS: 'HH:mm:ss',
  48724. L: 'DD/MM/YYYY',
  48725. LL: 'D MMMM YYYY',
  48726. LLL: 'D MMMM YYYY HH:mm',
  48727. LLLL: 'dddd, D MMMM YYYY HH:mm',
  48728. },
  48729. calendar: {
  48730. sameDay: '[Sot në] LT',
  48731. nextDay: '[Nesër në] LT',
  48732. nextWeek: 'dddd [në] LT',
  48733. lastDay: '[Dje në] LT',
  48734. lastWeek: 'dddd [e kaluar në] LT',
  48735. sameElse: 'L',
  48736. },
  48737. relativeTime: {
  48738. future: 'në %s',
  48739. past: '%s më parë',
  48740. s: 'disa sekonda',
  48741. ss: '%d sekonda',
  48742. m: 'një minutë',
  48743. mm: '%d minuta',
  48744. h: 'një orë',
  48745. hh: '%d orë',
  48746. d: 'një ditë',
  48747. dd: '%d ditë',
  48748. M: 'një muaj',
  48749. MM: '%d muaj',
  48750. y: 'një vit',
  48751. yy: '%d vite',
  48752. },
  48753. dayOfMonthOrdinalParse: /\d{1,2}\./,
  48754. ordinal: '%d.',
  48755. week: {
  48756. dow: 1, // Monday is the first day of the week.
  48757. doy: 4, // The week that contains Jan 4th is the first week of the year.
  48758. },
  48759. });
  48760. return sq;
  48761. })));
  48762. /***/ }),
  48763. /***/ "./node_modules/moment/locale/sr-cyrl.js":
  48764. /*!***********************************************!*\
  48765. !*** ./node_modules/moment/locale/sr-cyrl.js ***!
  48766. \***********************************************/
  48767. /*! no static exports found */
  48768. /***/ (function(module, exports, __webpack_require__) {
  48769. //! moment.js locale configuration
  48770. //! locale : Serbian Cyrillic [sr-cyrl]
  48771. //! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j
  48772. ;(function (global, factory) {
  48773. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  48774. undefined
  48775. }(this, (function (moment) { 'use strict';
  48776. //! moment.js locale configuration
  48777. var translator = {
  48778. words: {
  48779. //Different grammatical cases
  48780. ss: ['секунда', 'секунде', 'секунди'],
  48781. m: ['један минут', 'једне минуте'],
  48782. mm: ['минут', 'минуте', 'минута'],
  48783. h: ['један сат', 'једног сата'],
  48784. hh: ['сат', 'сата', 'сати'],
  48785. dd: ['дан', 'дана', 'дана'],
  48786. MM: ['месец', 'месеца', 'месеци'],
  48787. yy: ['година', 'године', 'година'],
  48788. },
  48789. correctGrammaticalCase: function (number, wordKey) {
  48790. return number === 1
  48791. ? wordKey[0]
  48792. : number >= 2 && number <= 4
  48793. ? wordKey[1]
  48794. : wordKey[2];
  48795. },
  48796. translate: function (number, withoutSuffix, key) {
  48797. var wordKey = translator.words[key];
  48798. if (key.length === 1) {
  48799. return withoutSuffix ? wordKey[0] : wordKey[1];
  48800. } else {
  48801. return (
  48802. number +
  48803. ' ' +
  48804. translator.correctGrammaticalCase(number, wordKey)
  48805. );
  48806. }
  48807. },
  48808. };
  48809. var srCyrl = moment.defineLocale('sr-cyrl', {
  48810. months: 'јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар'.split(
  48811. '_'
  48812. ),
  48813. monthsShort: 'јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.'.split(
  48814. '_'
  48815. ),
  48816. monthsParseExact: true,
  48817. weekdays: 'недеља_понедељак_уторак_среда_четвртак_петак_субота'.split('_'),
  48818. weekdaysShort: 'нед._пон._уто._сре._чет._пет._суб.'.split('_'),
  48819. weekdaysMin: 'не_по_ут_ср_че_пе_су'.split('_'),
  48820. weekdaysParseExact: true,
  48821. longDateFormat: {
  48822. LT: 'H:mm',
  48823. LTS: 'H:mm:ss',
  48824. L: 'DD.MM.YYYY',
  48825. LL: 'D. MMMM YYYY',
  48826. LLL: 'D. MMMM YYYY H:mm',
  48827. LLLL: 'dddd, D. MMMM YYYY H:mm',
  48828. },
  48829. calendar: {
  48830. sameDay: '[данас у] LT',
  48831. nextDay: '[сутра у] LT',
  48832. nextWeek: function () {
  48833. switch (this.day()) {
  48834. case 0:
  48835. return '[у] [недељу] [у] LT';
  48836. case 3:
  48837. return '[у] [среду] [у] LT';
  48838. case 6:
  48839. return '[у] [суботу] [у] LT';
  48840. case 1:
  48841. case 2:
  48842. case 4:
  48843. case 5:
  48844. return '[у] dddd [у] LT';
  48845. }
  48846. },
  48847. lastDay: '[јуче у] LT',
  48848. lastWeek: function () {
  48849. var lastWeekDays = [
  48850. '[прошле] [недеље] [у] LT',
  48851. '[прошлог] [понедељка] [у] LT',
  48852. '[прошлог] [уторка] [у] LT',
  48853. '[прошле] [среде] [у] LT',
  48854. '[прошлог] [четвртка] [у] LT',
  48855. '[прошлог] [петка] [у] LT',
  48856. '[прошле] [суботе] [у] LT',
  48857. ];
  48858. return lastWeekDays[this.day()];
  48859. },
  48860. sameElse: 'L',
  48861. },
  48862. relativeTime: {
  48863. future: 'за %s',
  48864. past: 'пре %s',
  48865. s: 'неколико секунди',
  48866. ss: translator.translate,
  48867. m: translator.translate,
  48868. mm: translator.translate,
  48869. h: translator.translate,
  48870. hh: translator.translate,
  48871. d: 'дан',
  48872. dd: translator.translate,
  48873. M: 'месец',
  48874. MM: translator.translate,
  48875. y: 'годину',
  48876. yy: translator.translate,
  48877. },
  48878. dayOfMonthOrdinalParse: /\d{1,2}\./,
  48879. ordinal: '%d.',
  48880. week: {
  48881. dow: 1, // Monday is the first day of the week.
  48882. doy: 7, // The week that contains Jan 7th is the first week of the year.
  48883. },
  48884. });
  48885. return srCyrl;
  48886. })));
  48887. /***/ }),
  48888. /***/ "./node_modules/moment/locale/sr.js":
  48889. /*!******************************************!*\
  48890. !*** ./node_modules/moment/locale/sr.js ***!
  48891. \******************************************/
  48892. /*! no static exports found */
  48893. /***/ (function(module, exports, __webpack_require__) {
  48894. //! moment.js locale configuration
  48895. //! locale : Serbian [sr]
  48896. //! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j
  48897. ;(function (global, factory) {
  48898. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  48899. undefined
  48900. }(this, (function (moment) { 'use strict';
  48901. //! moment.js locale configuration
  48902. var translator = {
  48903. words: {
  48904. //Different grammatical cases
  48905. ss: ['sekunda', 'sekunde', 'sekundi'],
  48906. m: ['jedan minut', 'jedne minute'],
  48907. mm: ['minut', 'minute', 'minuta'],
  48908. h: ['jedan sat', 'jednog sata'],
  48909. hh: ['sat', 'sata', 'sati'],
  48910. dd: ['dan', 'dana', 'dana'],
  48911. MM: ['mesec', 'meseca', 'meseci'],
  48912. yy: ['godina', 'godine', 'godina'],
  48913. },
  48914. correctGrammaticalCase: function (number, wordKey) {
  48915. return number === 1
  48916. ? wordKey[0]
  48917. : number >= 2 && number <= 4
  48918. ? wordKey[1]
  48919. : wordKey[2];
  48920. },
  48921. translate: function (number, withoutSuffix, key) {
  48922. var wordKey = translator.words[key];
  48923. if (key.length === 1) {
  48924. return withoutSuffix ? wordKey[0] : wordKey[1];
  48925. } else {
  48926. return (
  48927. number +
  48928. ' ' +
  48929. translator.correctGrammaticalCase(number, wordKey)
  48930. );
  48931. }
  48932. },
  48933. };
  48934. var sr = moment.defineLocale('sr', {
  48935. months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split(
  48936. '_'
  48937. ),
  48938. monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split(
  48939. '_'
  48940. ),
  48941. monthsParseExact: true,
  48942. weekdays: 'nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota'.split(
  48943. '_'
  48944. ),
  48945. weekdaysShort: 'ned._pon._uto._sre._čet._pet._sub.'.split('_'),
  48946. weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
  48947. weekdaysParseExact: true,
  48948. longDateFormat: {
  48949. LT: 'H:mm',
  48950. LTS: 'H:mm:ss',
  48951. L: 'DD.MM.YYYY',
  48952. LL: 'D. MMMM YYYY',
  48953. LLL: 'D. MMMM YYYY H:mm',
  48954. LLLL: 'dddd, D. MMMM YYYY H:mm',
  48955. },
  48956. calendar: {
  48957. sameDay: '[danas u] LT',
  48958. nextDay: '[sutra u] LT',
  48959. nextWeek: function () {
  48960. switch (this.day()) {
  48961. case 0:
  48962. return '[u] [nedelju] [u] LT';
  48963. case 3:
  48964. return '[u] [sredu] [u] LT';
  48965. case 6:
  48966. return '[u] [subotu] [u] LT';
  48967. case 1:
  48968. case 2:
  48969. case 4:
  48970. case 5:
  48971. return '[u] dddd [u] LT';
  48972. }
  48973. },
  48974. lastDay: '[juče u] LT',
  48975. lastWeek: function () {
  48976. var lastWeekDays = [
  48977. '[prošle] [nedelje] [u] LT',
  48978. '[prošlog] [ponedeljka] [u] LT',
  48979. '[prošlog] [utorka] [u] LT',
  48980. '[prošle] [srede] [u] LT',
  48981. '[prošlog] [četvrtka] [u] LT',
  48982. '[prošlog] [petka] [u] LT',
  48983. '[prošle] [subote] [u] LT',
  48984. ];
  48985. return lastWeekDays[this.day()];
  48986. },
  48987. sameElse: 'L',
  48988. },
  48989. relativeTime: {
  48990. future: 'za %s',
  48991. past: 'pre %s',
  48992. s: 'nekoliko sekundi',
  48993. ss: translator.translate,
  48994. m: translator.translate,
  48995. mm: translator.translate,
  48996. h: translator.translate,
  48997. hh: translator.translate,
  48998. d: 'dan',
  48999. dd: translator.translate,
  49000. M: 'mesec',
  49001. MM: translator.translate,
  49002. y: 'godinu',
  49003. yy: translator.translate,
  49004. },
  49005. dayOfMonthOrdinalParse: /\d{1,2}\./,
  49006. ordinal: '%d.',
  49007. week: {
  49008. dow: 1, // Monday is the first day of the week.
  49009. doy: 7, // The week that contains Jan 7th is the first week of the year.
  49010. },
  49011. });
  49012. return sr;
  49013. })));
  49014. /***/ }),
  49015. /***/ "./node_modules/moment/locale/ss.js":
  49016. /*!******************************************!*\
  49017. !*** ./node_modules/moment/locale/ss.js ***!
  49018. \******************************************/
  49019. /*! no static exports found */
  49020. /***/ (function(module, exports, __webpack_require__) {
  49021. //! moment.js locale configuration
  49022. //! locale : siSwati [ss]
  49023. //! author : Nicolai Davies<mail@nicolai.io> : https://github.com/nicolaidavies
  49024. ;(function (global, factory) {
  49025. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  49026. undefined
  49027. }(this, (function (moment) { 'use strict';
  49028. //! moment.js locale configuration
  49029. var ss = moment.defineLocale('ss', {
  49030. months: "Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split(
  49031. '_'
  49032. ),
  49033. monthsShort: 'Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo'.split('_'),
  49034. weekdays: 'Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo'.split(
  49035. '_'
  49036. ),
  49037. weekdaysShort: 'Lis_Umb_Lsb_Les_Lsi_Lsh_Umg'.split('_'),
  49038. weekdaysMin: 'Li_Us_Lb_Lt_Ls_Lh_Ug'.split('_'),
  49039. weekdaysParseExact: true,
  49040. longDateFormat: {
  49041. LT: 'h:mm A',
  49042. LTS: 'h:mm:ss A',
  49043. L: 'DD/MM/YYYY',
  49044. LL: 'D MMMM YYYY',
  49045. LLL: 'D MMMM YYYY h:mm A',
  49046. LLLL: 'dddd, D MMMM YYYY h:mm A',
  49047. },
  49048. calendar: {
  49049. sameDay: '[Namuhla nga] LT',
  49050. nextDay: '[Kusasa nga] LT',
  49051. nextWeek: 'dddd [nga] LT',
  49052. lastDay: '[Itolo nga] LT',
  49053. lastWeek: 'dddd [leliphelile] [nga] LT',
  49054. sameElse: 'L',
  49055. },
  49056. relativeTime: {
  49057. future: 'nga %s',
  49058. past: 'wenteka nga %s',
  49059. s: 'emizuzwana lomcane',
  49060. ss: '%d mzuzwana',
  49061. m: 'umzuzu',
  49062. mm: '%d emizuzu',
  49063. h: 'lihora',
  49064. hh: '%d emahora',
  49065. d: 'lilanga',
  49066. dd: '%d emalanga',
  49067. M: 'inyanga',
  49068. MM: '%d tinyanga',
  49069. y: 'umnyaka',
  49070. yy: '%d iminyaka',
  49071. },
  49072. meridiemParse: /ekuseni|emini|entsambama|ebusuku/,
  49073. meridiem: function (hours, minutes, isLower) {
  49074. if (hours < 11) {
  49075. return 'ekuseni';
  49076. } else if (hours < 15) {
  49077. return 'emini';
  49078. } else if (hours < 19) {
  49079. return 'entsambama';
  49080. } else {
  49081. return 'ebusuku';
  49082. }
  49083. },
  49084. meridiemHour: function (hour, meridiem) {
  49085. if (hour === 12) {
  49086. hour = 0;
  49087. }
  49088. if (meridiem === 'ekuseni') {
  49089. return hour;
  49090. } else if (meridiem === 'emini') {
  49091. return hour >= 11 ? hour : hour + 12;
  49092. } else if (meridiem === 'entsambama' || meridiem === 'ebusuku') {
  49093. if (hour === 0) {
  49094. return 0;
  49095. }
  49096. return hour + 12;
  49097. }
  49098. },
  49099. dayOfMonthOrdinalParse: /\d{1,2}/,
  49100. ordinal: '%d',
  49101. week: {
  49102. dow: 1, // Monday is the first day of the week.
  49103. doy: 4, // The week that contains Jan 4th is the first week of the year.
  49104. },
  49105. });
  49106. return ss;
  49107. })));
  49108. /***/ }),
  49109. /***/ "./node_modules/moment/locale/sv.js":
  49110. /*!******************************************!*\
  49111. !*** ./node_modules/moment/locale/sv.js ***!
  49112. \******************************************/
  49113. /*! no static exports found */
  49114. /***/ (function(module, exports, __webpack_require__) {
  49115. //! moment.js locale configuration
  49116. //! locale : Swedish [sv]
  49117. //! author : Jens Alm : https://github.com/ulmus
  49118. ;(function (global, factory) {
  49119. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  49120. undefined
  49121. }(this, (function (moment) { 'use strict';
  49122. //! moment.js locale configuration
  49123. var sv = moment.defineLocale('sv', {
  49124. months: 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split(
  49125. '_'
  49126. ),
  49127. monthsShort: 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),
  49128. weekdays: 'söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'),
  49129. weekdaysShort: 'sön_mån_tis_ons_tor_fre_lör'.split('_'),
  49130. weekdaysMin: 'sö_må_ti_on_to_fr_lö'.split('_'),
  49131. longDateFormat: {
  49132. LT: 'HH:mm',
  49133. LTS: 'HH:mm:ss',
  49134. L: 'YYYY-MM-DD',
  49135. LL: 'D MMMM YYYY',
  49136. LLL: 'D MMMM YYYY [kl.] HH:mm',
  49137. LLLL: 'dddd D MMMM YYYY [kl.] HH:mm',
  49138. lll: 'D MMM YYYY HH:mm',
  49139. llll: 'ddd D MMM YYYY HH:mm',
  49140. },
  49141. calendar: {
  49142. sameDay: '[Idag] LT',
  49143. nextDay: '[Imorgon] LT',
  49144. lastDay: '[Igår] LT',
  49145. nextWeek: '[På] dddd LT',
  49146. lastWeek: '[I] dddd[s] LT',
  49147. sameElse: 'L',
  49148. },
  49149. relativeTime: {
  49150. future: 'om %s',
  49151. past: 'för %s sedan',
  49152. s: 'några sekunder',
  49153. ss: '%d sekunder',
  49154. m: 'en minut',
  49155. mm: '%d minuter',
  49156. h: 'en timme',
  49157. hh: '%d timmar',
  49158. d: 'en dag',
  49159. dd: '%d dagar',
  49160. M: 'en månad',
  49161. MM: '%d månader',
  49162. y: 'ett år',
  49163. yy: '%d år',
  49164. },
  49165. dayOfMonthOrdinalParse: /\d{1,2}(\:e|\:a)/,
  49166. ordinal: function (number) {
  49167. var b = number % 10,
  49168. output =
  49169. ~~((number % 100) / 10) === 1
  49170. ? ':e'
  49171. : b === 1
  49172. ? ':a'
  49173. : b === 2
  49174. ? ':a'
  49175. : b === 3
  49176. ? ':e'
  49177. : ':e';
  49178. return number + output;
  49179. },
  49180. week: {
  49181. dow: 1, // Monday is the first day of the week.
  49182. doy: 4, // The week that contains Jan 4th is the first week of the year.
  49183. },
  49184. });
  49185. return sv;
  49186. })));
  49187. /***/ }),
  49188. /***/ "./node_modules/moment/locale/sw.js":
  49189. /*!******************************************!*\
  49190. !*** ./node_modules/moment/locale/sw.js ***!
  49191. \******************************************/
  49192. /*! no static exports found */
  49193. /***/ (function(module, exports, __webpack_require__) {
  49194. //! moment.js locale configuration
  49195. //! locale : Swahili [sw]
  49196. //! author : Fahad Kassim : https://github.com/fadsel
  49197. ;(function (global, factory) {
  49198. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  49199. undefined
  49200. }(this, (function (moment) { 'use strict';
  49201. //! moment.js locale configuration
  49202. var sw = moment.defineLocale('sw', {
  49203. months: 'Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba'.split(
  49204. '_'
  49205. ),
  49206. monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des'.split('_'),
  49207. weekdays: 'Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi'.split(
  49208. '_'
  49209. ),
  49210. weekdaysShort: 'Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos'.split('_'),
  49211. weekdaysMin: 'J2_J3_J4_J5_Al_Ij_J1'.split('_'),
  49212. weekdaysParseExact: true,
  49213. longDateFormat: {
  49214. LT: 'hh:mm A',
  49215. LTS: 'HH:mm:ss',
  49216. L: 'DD.MM.YYYY',
  49217. LL: 'D MMMM YYYY',
  49218. LLL: 'D MMMM YYYY HH:mm',
  49219. LLLL: 'dddd, D MMMM YYYY HH:mm',
  49220. },
  49221. calendar: {
  49222. sameDay: '[leo saa] LT',
  49223. nextDay: '[kesho saa] LT',
  49224. nextWeek: '[wiki ijayo] dddd [saat] LT',
  49225. lastDay: '[jana] LT',
  49226. lastWeek: '[wiki iliyopita] dddd [saat] LT',
  49227. sameElse: 'L',
  49228. },
  49229. relativeTime: {
  49230. future: '%s baadaye',
  49231. past: 'tokea %s',
  49232. s: 'hivi punde',
  49233. ss: 'sekunde %d',
  49234. m: 'dakika moja',
  49235. mm: 'dakika %d',
  49236. h: 'saa limoja',
  49237. hh: 'masaa %d',
  49238. d: 'siku moja',
  49239. dd: 'siku %d',
  49240. M: 'mwezi mmoja',
  49241. MM: 'miezi %d',
  49242. y: 'mwaka mmoja',
  49243. yy: 'miaka %d',
  49244. },
  49245. week: {
  49246. dow: 1, // Monday is the first day of the week.
  49247. doy: 7, // The week that contains Jan 7th is the first week of the year.
  49248. },
  49249. });
  49250. return sw;
  49251. })));
  49252. /***/ }),
  49253. /***/ "./node_modules/moment/locale/ta.js":
  49254. /*!******************************************!*\
  49255. !*** ./node_modules/moment/locale/ta.js ***!
  49256. \******************************************/
  49257. /*! no static exports found */
  49258. /***/ (function(module, exports, __webpack_require__) {
  49259. //! moment.js locale configuration
  49260. //! locale : Tamil [ta]
  49261. //! author : Arjunkumar Krishnamoorthy : https://github.com/tk120404
  49262. ;(function (global, factory) {
  49263. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  49264. undefined
  49265. }(this, (function (moment) { 'use strict';
  49266. //! moment.js locale configuration
  49267. var symbolMap = {
  49268. '1': '௧',
  49269. '2': '௨',
  49270. '3': '௩',
  49271. '4': '௪',
  49272. '5': '௫',
  49273. '6': '௬',
  49274. '7': '௭',
  49275. '8': '௮',
  49276. '9': '௯',
  49277. '0': '௦',
  49278. },
  49279. numberMap = {
  49280. '௧': '1',
  49281. '௨': '2',
  49282. '௩': '3',
  49283. '௪': '4',
  49284. '௫': '5',
  49285. '௬': '6',
  49286. '௭': '7',
  49287. '௮': '8',
  49288. '௯': '9',
  49289. '௦': '0',
  49290. };
  49291. var ta = moment.defineLocale('ta', {
  49292. months: 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split(
  49293. '_'
  49294. ),
  49295. monthsShort: 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split(
  49296. '_'
  49297. ),
  49298. weekdays: 'ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை'.split(
  49299. '_'
  49300. ),
  49301. weekdaysShort: 'ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி'.split(
  49302. '_'
  49303. ),
  49304. weekdaysMin: 'ஞா_தி_செ_பு_வி_வெ_ச'.split('_'),
  49305. longDateFormat: {
  49306. LT: 'HH:mm',
  49307. LTS: 'HH:mm:ss',
  49308. L: 'DD/MM/YYYY',
  49309. LL: 'D MMMM YYYY',
  49310. LLL: 'D MMMM YYYY, HH:mm',
  49311. LLLL: 'dddd, D MMMM YYYY, HH:mm',
  49312. },
  49313. calendar: {
  49314. sameDay: '[இன்று] LT',
  49315. nextDay: '[நாளை] LT',
  49316. nextWeek: 'dddd, LT',
  49317. lastDay: '[நேற்று] LT',
  49318. lastWeek: '[கடந்த வாரம்] dddd, LT',
  49319. sameElse: 'L',
  49320. },
  49321. relativeTime: {
  49322. future: '%s இல்',
  49323. past: '%s முன்',
  49324. s: 'ஒரு சில விநாடிகள்',
  49325. ss: '%d விநாடிகள்',
  49326. m: 'ஒரு நிமிடம்',
  49327. mm: '%d நிமிடங்கள்',
  49328. h: 'ஒரு மணி நேரம்',
  49329. hh: '%d மணி நேரம்',
  49330. d: 'ஒரு நாள்',
  49331. dd: '%d நாட்கள்',
  49332. M: 'ஒரு மாதம்',
  49333. MM: '%d மாதங்கள்',
  49334. y: 'ஒரு வருடம்',
  49335. yy: '%d ஆண்டுகள்',
  49336. },
  49337. dayOfMonthOrdinalParse: /\d{1,2}வது/,
  49338. ordinal: function (number) {
  49339. return number + 'வது';
  49340. },
  49341. preparse: function (string) {
  49342. return string.replace(/[௧௨௩௪௫௬௭௮௯௦]/g, function (match) {
  49343. return numberMap[match];
  49344. });
  49345. },
  49346. postformat: function (string) {
  49347. return string.replace(/\d/g, function (match) {
  49348. return symbolMap[match];
  49349. });
  49350. },
  49351. // refer http://ta.wikipedia.org/s/1er1
  49352. meridiemParse: /யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,
  49353. meridiem: function (hour, minute, isLower) {
  49354. if (hour < 2) {
  49355. return ' யாமம்';
  49356. } else if (hour < 6) {
  49357. return ' வைகறை'; // வைகறை
  49358. } else if (hour < 10) {
  49359. return ' காலை'; // காலை
  49360. } else if (hour < 14) {
  49361. return ' நண்பகல்'; // நண்பகல்
  49362. } else if (hour < 18) {
  49363. return ' எற்பாடு'; // எற்பாடு
  49364. } else if (hour < 22) {
  49365. return ' மாலை'; // மாலை
  49366. } else {
  49367. return ' யாமம்';
  49368. }
  49369. },
  49370. meridiemHour: function (hour, meridiem) {
  49371. if (hour === 12) {
  49372. hour = 0;
  49373. }
  49374. if (meridiem === 'யாமம்') {
  49375. return hour < 2 ? hour : hour + 12;
  49376. } else if (meridiem === 'வைகறை' || meridiem === 'காலை') {
  49377. return hour;
  49378. } else if (meridiem === 'நண்பகல்') {
  49379. return hour >= 10 ? hour : hour + 12;
  49380. } else {
  49381. return hour + 12;
  49382. }
  49383. },
  49384. week: {
  49385. dow: 0, // Sunday is the first day of the week.
  49386. doy: 6, // The week that contains Jan 6th is the first week of the year.
  49387. },
  49388. });
  49389. return ta;
  49390. })));
  49391. /***/ }),
  49392. /***/ "./node_modules/moment/locale/te.js":
  49393. /*!******************************************!*\
  49394. !*** ./node_modules/moment/locale/te.js ***!
  49395. \******************************************/
  49396. /*! no static exports found */
  49397. /***/ (function(module, exports, __webpack_require__) {
  49398. //! moment.js locale configuration
  49399. //! locale : Telugu [te]
  49400. //! author : Krishna Chaitanya Thota : https://github.com/kcthota
  49401. ;(function (global, factory) {
  49402. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  49403. undefined
  49404. }(this, (function (moment) { 'use strict';
  49405. //! moment.js locale configuration
  49406. var te = moment.defineLocale('te', {
  49407. months: 'జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్'.split(
  49408. '_'
  49409. ),
  49410. monthsShort: 'జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.'.split(
  49411. '_'
  49412. ),
  49413. monthsParseExact: true,
  49414. weekdays: 'ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం'.split(
  49415. '_'
  49416. ),
  49417. weekdaysShort: 'ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని'.split('_'),
  49418. weekdaysMin: 'ఆ_సో_మం_బు_గు_శు_శ'.split('_'),
  49419. longDateFormat: {
  49420. LT: 'A h:mm',
  49421. LTS: 'A h:mm:ss',
  49422. L: 'DD/MM/YYYY',
  49423. LL: 'D MMMM YYYY',
  49424. LLL: 'D MMMM YYYY, A h:mm',
  49425. LLLL: 'dddd, D MMMM YYYY, A h:mm',
  49426. },
  49427. calendar: {
  49428. sameDay: '[నేడు] LT',
  49429. nextDay: '[రేపు] LT',
  49430. nextWeek: 'dddd, LT',
  49431. lastDay: '[నిన్న] LT',
  49432. lastWeek: '[గత] dddd, LT',
  49433. sameElse: 'L',
  49434. },
  49435. relativeTime: {
  49436. future: '%s లో',
  49437. past: '%s క్రితం',
  49438. s: 'కొన్ని క్షణాలు',
  49439. ss: '%d సెకన్లు',
  49440. m: 'ఒక నిమిషం',
  49441. mm: '%d నిమిషాలు',
  49442. h: 'ఒక గంట',
  49443. hh: '%d గంటలు',
  49444. d: 'ఒక రోజు',
  49445. dd: '%d రోజులు',
  49446. M: 'ఒక నెల',
  49447. MM: '%d నెలలు',
  49448. y: 'ఒక సంవత్సరం',
  49449. yy: '%d సంవత్సరాలు',
  49450. },
  49451. dayOfMonthOrdinalParse: /\d{1,2}వ/,
  49452. ordinal: '%dవ',
  49453. meridiemParse: /రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,
  49454. meridiemHour: function (hour, meridiem) {
  49455. if (hour === 12) {
  49456. hour = 0;
  49457. }
  49458. if (meridiem === 'రాత్రి') {
  49459. return hour < 4 ? hour : hour + 12;
  49460. } else if (meridiem === 'ఉదయం') {
  49461. return hour;
  49462. } else if (meridiem === 'మధ్యాహ్నం') {
  49463. return hour >= 10 ? hour : hour + 12;
  49464. } else if (meridiem === 'సాయంత్రం') {
  49465. return hour + 12;
  49466. }
  49467. },
  49468. meridiem: function (hour, minute, isLower) {
  49469. if (hour < 4) {
  49470. return 'రాత్రి';
  49471. } else if (hour < 10) {
  49472. return 'ఉదయం';
  49473. } else if (hour < 17) {
  49474. return 'మధ్యాహ్నం';
  49475. } else if (hour < 20) {
  49476. return 'సాయంత్రం';
  49477. } else {
  49478. return 'రాత్రి';
  49479. }
  49480. },
  49481. week: {
  49482. dow: 0, // Sunday is the first day of the week.
  49483. doy: 6, // The week that contains Jan 6th is the first week of the year.
  49484. },
  49485. });
  49486. return te;
  49487. })));
  49488. /***/ }),
  49489. /***/ "./node_modules/moment/locale/tet.js":
  49490. /*!*******************************************!*\
  49491. !*** ./node_modules/moment/locale/tet.js ***!
  49492. \*******************************************/
  49493. /*! no static exports found */
  49494. /***/ (function(module, exports, __webpack_require__) {
  49495. //! moment.js locale configuration
  49496. //! locale : Tetun Dili (East Timor) [tet]
  49497. //! author : Joshua Brooks : https://github.com/joshbrooks
  49498. //! author : Onorio De J. Afonso : https://github.com/marobo
  49499. //! author : Sonia Simoes : https://github.com/soniasimoes
  49500. ;(function (global, factory) {
  49501. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  49502. undefined
  49503. }(this, (function (moment) { 'use strict';
  49504. //! moment.js locale configuration
  49505. var tet = moment.defineLocale('tet', {
  49506. months: 'Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru'.split(
  49507. '_'
  49508. ),
  49509. monthsShort: 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'),
  49510. weekdays: 'Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu'.split('_'),
  49511. weekdaysShort: 'Dom_Seg_Ters_Kua_Kint_Sest_Sab'.split('_'),
  49512. weekdaysMin: 'Do_Seg_Te_Ku_Ki_Ses_Sa'.split('_'),
  49513. longDateFormat: {
  49514. LT: 'HH:mm',
  49515. LTS: 'HH:mm:ss',
  49516. L: 'DD/MM/YYYY',
  49517. LL: 'D MMMM YYYY',
  49518. LLL: 'D MMMM YYYY HH:mm',
  49519. LLLL: 'dddd, D MMMM YYYY HH:mm',
  49520. },
  49521. calendar: {
  49522. sameDay: '[Ohin iha] LT',
  49523. nextDay: '[Aban iha] LT',
  49524. nextWeek: 'dddd [iha] LT',
  49525. lastDay: '[Horiseik iha] LT',
  49526. lastWeek: 'dddd [semana kotuk] [iha] LT',
  49527. sameElse: 'L',
  49528. },
  49529. relativeTime: {
  49530. future: 'iha %s',
  49531. past: '%s liuba',
  49532. s: 'segundu balun',
  49533. ss: 'segundu %d',
  49534. m: 'minutu ida',
  49535. mm: 'minutu %d',
  49536. h: 'oras ida',
  49537. hh: 'oras %d',
  49538. d: 'loron ida',
  49539. dd: 'loron %d',
  49540. M: 'fulan ida',
  49541. MM: 'fulan %d',
  49542. y: 'tinan ida',
  49543. yy: 'tinan %d',
  49544. },
  49545. dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
  49546. ordinal: function (number) {
  49547. var b = number % 10,
  49548. output =
  49549. ~~((number % 100) / 10) === 1
  49550. ? 'th'
  49551. : b === 1
  49552. ? 'st'
  49553. : b === 2
  49554. ? 'nd'
  49555. : b === 3
  49556. ? 'rd'
  49557. : 'th';
  49558. return number + output;
  49559. },
  49560. week: {
  49561. dow: 1, // Monday is the first day of the week.
  49562. doy: 4, // The week that contains Jan 4th is the first week of the year.
  49563. },
  49564. });
  49565. return tet;
  49566. })));
  49567. /***/ }),
  49568. /***/ "./node_modules/moment/locale/tg.js":
  49569. /*!******************************************!*\
  49570. !*** ./node_modules/moment/locale/tg.js ***!
  49571. \******************************************/
  49572. /*! no static exports found */
  49573. /***/ (function(module, exports, __webpack_require__) {
  49574. //! moment.js locale configuration
  49575. //! locale : Tajik [tg]
  49576. //! author : Orif N. Jr. : https://github.com/orif-jr
  49577. ;(function (global, factory) {
  49578. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  49579. undefined
  49580. }(this, (function (moment) { 'use strict';
  49581. //! moment.js locale configuration
  49582. var suffixes = {
  49583. 0: '-ум',
  49584. 1: '-ум',
  49585. 2: '-юм',
  49586. 3: '-юм',
  49587. 4: '-ум',
  49588. 5: '-ум',
  49589. 6: '-ум',
  49590. 7: '-ум',
  49591. 8: '-ум',
  49592. 9: '-ум',
  49593. 10: '-ум',
  49594. 12: '-ум',
  49595. 13: '-ум',
  49596. 20: '-ум',
  49597. 30: '-юм',
  49598. 40: '-ум',
  49599. 50: '-ум',
  49600. 60: '-ум',
  49601. 70: '-ум',
  49602. 80: '-ум',
  49603. 90: '-ум',
  49604. 100: '-ум',
  49605. };
  49606. var tg = moment.defineLocale('tg', {
  49607. months: 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split(
  49608. '_'
  49609. ),
  49610. monthsShort: 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),
  49611. weekdays: 'якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе'.split(
  49612. '_'
  49613. ),
  49614. weekdaysShort: 'яшб_дшб_сшб_чшб_пшб_ҷум_шнб'.split('_'),
  49615. weekdaysMin: 'яш_дш_сш_чш_пш_ҷм_шб'.split('_'),
  49616. longDateFormat: {
  49617. LT: 'HH:mm',
  49618. LTS: 'HH:mm:ss',
  49619. L: 'DD/MM/YYYY',
  49620. LL: 'D MMMM YYYY',
  49621. LLL: 'D MMMM YYYY HH:mm',
  49622. LLLL: 'dddd, D MMMM YYYY HH:mm',
  49623. },
  49624. calendar: {
  49625. sameDay: '[Имрӯз соати] LT',
  49626. nextDay: '[Пагоҳ соати] LT',
  49627. lastDay: '[Дирӯз соати] LT',
  49628. nextWeek: 'dddd[и] [ҳафтаи оянда соати] LT',
  49629. lastWeek: 'dddd[и] [ҳафтаи гузашта соати] LT',
  49630. sameElse: 'L',
  49631. },
  49632. relativeTime: {
  49633. future: 'баъди %s',
  49634. past: '%s пеш',
  49635. s: 'якчанд сония',
  49636. m: 'як дақиқа',
  49637. mm: '%d дақиқа',
  49638. h: 'як соат',
  49639. hh: '%d соат',
  49640. d: 'як рӯз',
  49641. dd: '%d рӯз',
  49642. M: 'як моҳ',
  49643. MM: '%d моҳ',
  49644. y: 'як сол',
  49645. yy: '%d сол',
  49646. },
  49647. meridiemParse: /шаб|субҳ|рӯз|бегоҳ/,
  49648. meridiemHour: function (hour, meridiem) {
  49649. if (hour === 12) {
  49650. hour = 0;
  49651. }
  49652. if (meridiem === 'шаб') {
  49653. return hour < 4 ? hour : hour + 12;
  49654. } else if (meridiem === 'субҳ') {
  49655. return hour;
  49656. } else if (meridiem === 'рӯз') {
  49657. return hour >= 11 ? hour : hour + 12;
  49658. } else if (meridiem === 'бегоҳ') {
  49659. return hour + 12;
  49660. }
  49661. },
  49662. meridiem: function (hour, minute, isLower) {
  49663. if (hour < 4) {
  49664. return 'шаб';
  49665. } else if (hour < 11) {
  49666. return 'субҳ';
  49667. } else if (hour < 16) {
  49668. return 'рӯз';
  49669. } else if (hour < 19) {
  49670. return 'бегоҳ';
  49671. } else {
  49672. return 'шаб';
  49673. }
  49674. },
  49675. dayOfMonthOrdinalParse: /\d{1,2}-(ум|юм)/,
  49676. ordinal: function (number) {
  49677. var a = number % 10,
  49678. b = number >= 100 ? 100 : null;
  49679. return number + (suffixes[number] || suffixes[a] || suffixes[b]);
  49680. },
  49681. week: {
  49682. dow: 1, // Monday is the first day of the week.
  49683. doy: 7, // The week that contains Jan 1th is the first week of the year.
  49684. },
  49685. });
  49686. return tg;
  49687. })));
  49688. /***/ }),
  49689. /***/ "./node_modules/moment/locale/th.js":
  49690. /*!******************************************!*\
  49691. !*** ./node_modules/moment/locale/th.js ***!
  49692. \******************************************/
  49693. /*! no static exports found */
  49694. /***/ (function(module, exports, __webpack_require__) {
  49695. //! moment.js locale configuration
  49696. //! locale : Thai [th]
  49697. //! author : Kridsada Thanabulpong : https://github.com/sirn
  49698. ;(function (global, factory) {
  49699. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  49700. undefined
  49701. }(this, (function (moment) { 'use strict';
  49702. //! moment.js locale configuration
  49703. var th = moment.defineLocale('th', {
  49704. months: 'มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม'.split(
  49705. '_'
  49706. ),
  49707. monthsShort: 'ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.'.split(
  49708. '_'
  49709. ),
  49710. monthsParseExact: true,
  49711. weekdays: 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์'.split('_'),
  49712. weekdaysShort: 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์'.split('_'), // yes, three characters difference
  49713. weekdaysMin: 'อา._จ._อ._พ._พฤ._ศ._ส.'.split('_'),
  49714. weekdaysParseExact: true,
  49715. longDateFormat: {
  49716. LT: 'H:mm',
  49717. LTS: 'H:mm:ss',
  49718. L: 'DD/MM/YYYY',
  49719. LL: 'D MMMM YYYY',
  49720. LLL: 'D MMMM YYYY เวลา H:mm',
  49721. LLLL: 'วันddddที่ D MMMM YYYY เวลา H:mm',
  49722. },
  49723. meridiemParse: /ก่อนเที่ยง|หลังเที่ยง/,
  49724. isPM: function (input) {
  49725. return input === 'หลังเที่ยง';
  49726. },
  49727. meridiem: function (hour, minute, isLower) {
  49728. if (hour < 12) {
  49729. return 'ก่อนเที่ยง';
  49730. } else {
  49731. return 'หลังเที่ยง';
  49732. }
  49733. },
  49734. calendar: {
  49735. sameDay: '[วันนี้ เวลา] LT',
  49736. nextDay: '[พรุ่งนี้ เวลา] LT',
  49737. nextWeek: 'dddd[หน้า เวลา] LT',
  49738. lastDay: '[เมื่อวานนี้ เวลา] LT',
  49739. lastWeek: '[วัน]dddd[ที่แล้ว เวลา] LT',
  49740. sameElse: 'L',
  49741. },
  49742. relativeTime: {
  49743. future: 'อีก %s',
  49744. past: '%sที่แล้ว',
  49745. s: 'ไม่กี่วินาที',
  49746. ss: '%d วินาที',
  49747. m: '1 นาที',
  49748. mm: '%d นาที',
  49749. h: '1 ชั่วโมง',
  49750. hh: '%d ชั่วโมง',
  49751. d: '1 วัน',
  49752. dd: '%d วัน',
  49753. M: '1 เดือน',
  49754. MM: '%d เดือน',
  49755. y: '1 ปี',
  49756. yy: '%d ปี',
  49757. },
  49758. });
  49759. return th;
  49760. })));
  49761. /***/ }),
  49762. /***/ "./node_modules/moment/locale/tk.js":
  49763. /*!******************************************!*\
  49764. !*** ./node_modules/moment/locale/tk.js ***!
  49765. \******************************************/
  49766. /*! no static exports found */
  49767. /***/ (function(module, exports, __webpack_require__) {
  49768. //! moment.js locale configuration
  49769. //! locale : Turkmen [tk]
  49770. //! author : Atamyrat Abdyrahmanov : https://github.com/atamyratabdy
  49771. ;(function (global, factory) {
  49772. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  49773. undefined
  49774. }(this, (function (moment) { 'use strict';
  49775. //! moment.js locale configuration
  49776. var suffixes = {
  49777. 1: "'inji",
  49778. 5: "'inji",
  49779. 8: "'inji",
  49780. 70: "'inji",
  49781. 80: "'inji",
  49782. 2: "'nji",
  49783. 7: "'nji",
  49784. 20: "'nji",
  49785. 50: "'nji",
  49786. 3: "'ünji",
  49787. 4: "'ünji",
  49788. 100: "'ünji",
  49789. 6: "'njy",
  49790. 9: "'unjy",
  49791. 10: "'unjy",
  49792. 30: "'unjy",
  49793. 60: "'ynjy",
  49794. 90: "'ynjy",
  49795. };
  49796. var tk = moment.defineLocale('tk', {
  49797. months: 'Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr'.split(
  49798. '_'
  49799. ),
  49800. monthsShort: 'Ýan_Few_Mar_Apr_Maý_Iýn_Iýl_Awg_Sen_Okt_Noý_Dek'.split('_'),
  49801. weekdays: 'Ýekşenbe_Duşenbe_Sişenbe_Çarşenbe_Penşenbe_Anna_Şenbe'.split(
  49802. '_'
  49803. ),
  49804. weekdaysShort: 'Ýek_Duş_Siş_Çar_Pen_Ann_Şen'.split('_'),
  49805. weekdaysMin: 'Ýk_Dş_Sş_Çr_Pn_An_Şn'.split('_'),
  49806. longDateFormat: {
  49807. LT: 'HH:mm',
  49808. LTS: 'HH:mm:ss',
  49809. L: 'DD.MM.YYYY',
  49810. LL: 'D MMMM YYYY',
  49811. LLL: 'D MMMM YYYY HH:mm',
  49812. LLLL: 'dddd, D MMMM YYYY HH:mm',
  49813. },
  49814. calendar: {
  49815. sameDay: '[bugün sagat] LT',
  49816. nextDay: '[ertir sagat] LT',
  49817. nextWeek: '[indiki] dddd [sagat] LT',
  49818. lastDay: '[düýn] LT',
  49819. lastWeek: '[geçen] dddd [sagat] LT',
  49820. sameElse: 'L',
  49821. },
  49822. relativeTime: {
  49823. future: '%s soň',
  49824. past: '%s öň',
  49825. s: 'birnäçe sekunt',
  49826. m: 'bir minut',
  49827. mm: '%d minut',
  49828. h: 'bir sagat',
  49829. hh: '%d sagat',
  49830. d: 'bir gün',
  49831. dd: '%d gün',
  49832. M: 'bir aý',
  49833. MM: '%d aý',
  49834. y: 'bir ýyl',
  49835. yy: '%d ýyl',
  49836. },
  49837. ordinal: function (number, period) {
  49838. switch (period) {
  49839. case 'd':
  49840. case 'D':
  49841. case 'Do':
  49842. case 'DD':
  49843. return number;
  49844. default:
  49845. if (number === 0) {
  49846. // special case for zero
  49847. return number + "'unjy";
  49848. }
  49849. var a = number % 10,
  49850. b = (number % 100) - a,
  49851. c = number >= 100 ? 100 : null;
  49852. return number + (suffixes[a] || suffixes[b] || suffixes[c]);
  49853. }
  49854. },
  49855. week: {
  49856. dow: 1, // Monday is the first day of the week.
  49857. doy: 7, // The week that contains Jan 7th is the first week of the year.
  49858. },
  49859. });
  49860. return tk;
  49861. })));
  49862. /***/ }),
  49863. /***/ "./node_modules/moment/locale/tl-ph.js":
  49864. /*!*********************************************!*\
  49865. !*** ./node_modules/moment/locale/tl-ph.js ***!
  49866. \*********************************************/
  49867. /*! no static exports found */
  49868. /***/ (function(module, exports, __webpack_require__) {
  49869. //! moment.js locale configuration
  49870. //! locale : Tagalog (Philippines) [tl-ph]
  49871. //! author : Dan Hagman : https://github.com/hagmandan
  49872. ;(function (global, factory) {
  49873. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  49874. undefined
  49875. }(this, (function (moment) { 'use strict';
  49876. //! moment.js locale configuration
  49877. var tlPh = moment.defineLocale('tl-ph', {
  49878. months: 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split(
  49879. '_'
  49880. ),
  49881. monthsShort: 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'),
  49882. weekdays: 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split(
  49883. '_'
  49884. ),
  49885. weekdaysShort: 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'),
  49886. weekdaysMin: 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'),
  49887. longDateFormat: {
  49888. LT: 'HH:mm',
  49889. LTS: 'HH:mm:ss',
  49890. L: 'MM/D/YYYY',
  49891. LL: 'MMMM D, YYYY',
  49892. LLL: 'MMMM D, YYYY HH:mm',
  49893. LLLL: 'dddd, MMMM DD, YYYY HH:mm',
  49894. },
  49895. calendar: {
  49896. sameDay: 'LT [ngayong araw]',
  49897. nextDay: '[Bukas ng] LT',
  49898. nextWeek: 'LT [sa susunod na] dddd',
  49899. lastDay: 'LT [kahapon]',
  49900. lastWeek: 'LT [noong nakaraang] dddd',
  49901. sameElse: 'L',
  49902. },
  49903. relativeTime: {
  49904. future: 'sa loob ng %s',
  49905. past: '%s ang nakalipas',
  49906. s: 'ilang segundo',
  49907. ss: '%d segundo',
  49908. m: 'isang minuto',
  49909. mm: '%d minuto',
  49910. h: 'isang oras',
  49911. hh: '%d oras',
  49912. d: 'isang araw',
  49913. dd: '%d araw',
  49914. M: 'isang buwan',
  49915. MM: '%d buwan',
  49916. y: 'isang taon',
  49917. yy: '%d taon',
  49918. },
  49919. dayOfMonthOrdinalParse: /\d{1,2}/,
  49920. ordinal: function (number) {
  49921. return number;
  49922. },
  49923. week: {
  49924. dow: 1, // Monday is the first day of the week.
  49925. doy: 4, // The week that contains Jan 4th is the first week of the year.
  49926. },
  49927. });
  49928. return tlPh;
  49929. })));
  49930. /***/ }),
  49931. /***/ "./node_modules/moment/locale/tlh.js":
  49932. /*!*******************************************!*\
  49933. !*** ./node_modules/moment/locale/tlh.js ***!
  49934. \*******************************************/
  49935. /*! no static exports found */
  49936. /***/ (function(module, exports, __webpack_require__) {
  49937. //! moment.js locale configuration
  49938. //! locale : Klingon [tlh]
  49939. //! author : Dominika Kruk : https://github.com/amaranthrose
  49940. ;(function (global, factory) {
  49941. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  49942. undefined
  49943. }(this, (function (moment) { 'use strict';
  49944. //! moment.js locale configuration
  49945. var numbersNouns = 'pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut'.split('_');
  49946. function translateFuture(output) {
  49947. var time = output;
  49948. time =
  49949. output.indexOf('jaj') !== -1
  49950. ? time.slice(0, -3) + 'leS'
  49951. : output.indexOf('jar') !== -1
  49952. ? time.slice(0, -3) + 'waQ'
  49953. : output.indexOf('DIS') !== -1
  49954. ? time.slice(0, -3) + 'nem'
  49955. : time + ' pIq';
  49956. return time;
  49957. }
  49958. function translatePast(output) {
  49959. var time = output;
  49960. time =
  49961. output.indexOf('jaj') !== -1
  49962. ? time.slice(0, -3) + 'Hu’'
  49963. : output.indexOf('jar') !== -1
  49964. ? time.slice(0, -3) + 'wen'
  49965. : output.indexOf('DIS') !== -1
  49966. ? time.slice(0, -3) + 'ben'
  49967. : time + ' ret';
  49968. return time;
  49969. }
  49970. function translate(number, withoutSuffix, string, isFuture) {
  49971. var numberNoun = numberAsNoun(number);
  49972. switch (string) {
  49973. case 'ss':
  49974. return numberNoun + ' lup';
  49975. case 'mm':
  49976. return numberNoun + ' tup';
  49977. case 'hh':
  49978. return numberNoun + ' rep';
  49979. case 'dd':
  49980. return numberNoun + ' jaj';
  49981. case 'MM':
  49982. return numberNoun + ' jar';
  49983. case 'yy':
  49984. return numberNoun + ' DIS';
  49985. }
  49986. }
  49987. function numberAsNoun(number) {
  49988. var hundred = Math.floor((number % 1000) / 100),
  49989. ten = Math.floor((number % 100) / 10),
  49990. one = number % 10,
  49991. word = '';
  49992. if (hundred > 0) {
  49993. word += numbersNouns[hundred] + 'vatlh';
  49994. }
  49995. if (ten > 0) {
  49996. word += (word !== '' ? ' ' : '') + numbersNouns[ten] + 'maH';
  49997. }
  49998. if (one > 0) {
  49999. word += (word !== '' ? ' ' : '') + numbersNouns[one];
  50000. }
  50001. return word === '' ? 'pagh' : word;
  50002. }
  50003. var tlh = moment.defineLocale('tlh', {
  50004. 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(
  50005. '_'
  50006. ),
  50007. 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(
  50008. '_'
  50009. ),
  50010. monthsParseExact: true,
  50011. weekdays: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split(
  50012. '_'
  50013. ),
  50014. weekdaysShort: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split(
  50015. '_'
  50016. ),
  50017. weekdaysMin: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split(
  50018. '_'
  50019. ),
  50020. longDateFormat: {
  50021. LT: 'HH:mm',
  50022. LTS: 'HH:mm:ss',
  50023. L: 'DD.MM.YYYY',
  50024. LL: 'D MMMM YYYY',
  50025. LLL: 'D MMMM YYYY HH:mm',
  50026. LLLL: 'dddd, D MMMM YYYY HH:mm',
  50027. },
  50028. calendar: {
  50029. sameDay: '[DaHjaj] LT',
  50030. nextDay: '[wa’leS] LT',
  50031. nextWeek: 'LLL',
  50032. lastDay: '[wa’Hu’] LT',
  50033. lastWeek: 'LLL',
  50034. sameElse: 'L',
  50035. },
  50036. relativeTime: {
  50037. future: translateFuture,
  50038. past: translatePast,
  50039. s: 'puS lup',
  50040. ss: translate,
  50041. m: 'wa’ tup',
  50042. mm: translate,
  50043. h: 'wa’ rep',
  50044. hh: translate,
  50045. d: 'wa’ jaj',
  50046. dd: translate,
  50047. M: 'wa’ jar',
  50048. MM: translate,
  50049. y: 'wa’ DIS',
  50050. yy: translate,
  50051. },
  50052. dayOfMonthOrdinalParse: /\d{1,2}\./,
  50053. ordinal: '%d.',
  50054. week: {
  50055. dow: 1, // Monday is the first day of the week.
  50056. doy: 4, // The week that contains Jan 4th is the first week of the year.
  50057. },
  50058. });
  50059. return tlh;
  50060. })));
  50061. /***/ }),
  50062. /***/ "./node_modules/moment/locale/tr.js":
  50063. /*!******************************************!*\
  50064. !*** ./node_modules/moment/locale/tr.js ***!
  50065. \******************************************/
  50066. /*! no static exports found */
  50067. /***/ (function(module, exports, __webpack_require__) {
  50068. //! moment.js locale configuration
  50069. //! locale : Turkish [tr]
  50070. //! authors : Erhan Gundogan : https://github.com/erhangundogan,
  50071. //! Burak Yiğit Kaya: https://github.com/BYK
  50072. ;(function (global, factory) {
  50073. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  50074. undefined
  50075. }(this, (function (moment) { 'use strict';
  50076. //! moment.js locale configuration
  50077. var suffixes = {
  50078. 1: "'inci",
  50079. 5: "'inci",
  50080. 8: "'inci",
  50081. 70: "'inci",
  50082. 80: "'inci",
  50083. 2: "'nci",
  50084. 7: "'nci",
  50085. 20: "'nci",
  50086. 50: "'nci",
  50087. 3: "'üncü",
  50088. 4: "'üncü",
  50089. 100: "'üncü",
  50090. 6: "'ncı",
  50091. 9: "'uncu",
  50092. 10: "'uncu",
  50093. 30: "'uncu",
  50094. 60: "'ıncı",
  50095. 90: "'ıncı",
  50096. };
  50097. var tr = moment.defineLocale('tr', {
  50098. months: 'Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık'.split(
  50099. '_'
  50100. ),
  50101. monthsShort: 'Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara'.split('_'),
  50102. weekdays: 'Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi'.split(
  50103. '_'
  50104. ),
  50105. weekdaysShort: 'Paz_Pts_Sal_Çar_Per_Cum_Cts'.split('_'),
  50106. weekdaysMin: 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split('_'),
  50107. meridiem: function (hours, minutes, isLower) {
  50108. if (hours < 12) {
  50109. return isLower ? 'öö' : 'ÖÖ';
  50110. } else {
  50111. return isLower ? 'ös' : 'ÖS';
  50112. }
  50113. },
  50114. meridiemParse: /öö|ÖÖ|ös|ÖS/,
  50115. isPM: function (input) {
  50116. return input === 'ös' || input === 'ÖS';
  50117. },
  50118. longDateFormat: {
  50119. LT: 'HH:mm',
  50120. LTS: 'HH:mm:ss',
  50121. L: 'DD.MM.YYYY',
  50122. LL: 'D MMMM YYYY',
  50123. LLL: 'D MMMM YYYY HH:mm',
  50124. LLLL: 'dddd, D MMMM YYYY HH:mm',
  50125. },
  50126. calendar: {
  50127. sameDay: '[bugün saat] LT',
  50128. nextDay: '[yarın saat] LT',
  50129. nextWeek: '[gelecek] dddd [saat] LT',
  50130. lastDay: '[dün] LT',
  50131. lastWeek: '[geçen] dddd [saat] LT',
  50132. sameElse: 'L',
  50133. },
  50134. relativeTime: {
  50135. future: '%s sonra',
  50136. past: '%s önce',
  50137. s: 'birkaç saniye',
  50138. ss: '%d saniye',
  50139. m: 'bir dakika',
  50140. mm: '%d dakika',
  50141. h: 'bir saat',
  50142. hh: '%d saat',
  50143. d: 'bir gün',
  50144. dd: '%d gün',
  50145. M: 'bir ay',
  50146. MM: '%d ay',
  50147. y: 'bir yıl',
  50148. yy: '%d yıl',
  50149. },
  50150. ordinal: function (number, period) {
  50151. switch (period) {
  50152. case 'd':
  50153. case 'D':
  50154. case 'Do':
  50155. case 'DD':
  50156. return number;
  50157. default:
  50158. if (number === 0) {
  50159. // special case for zero
  50160. return number + "'ıncı";
  50161. }
  50162. var a = number % 10,
  50163. b = (number % 100) - a,
  50164. c = number >= 100 ? 100 : null;
  50165. return number + (suffixes[a] || suffixes[b] || suffixes[c]);
  50166. }
  50167. },
  50168. week: {
  50169. dow: 1, // Monday is the first day of the week.
  50170. doy: 7, // The week that contains Jan 7th is the first week of the year.
  50171. },
  50172. });
  50173. return tr;
  50174. })));
  50175. /***/ }),
  50176. /***/ "./node_modules/moment/locale/tzl.js":
  50177. /*!*******************************************!*\
  50178. !*** ./node_modules/moment/locale/tzl.js ***!
  50179. \*******************************************/
  50180. /*! no static exports found */
  50181. /***/ (function(module, exports, __webpack_require__) {
  50182. //! moment.js locale configuration
  50183. //! locale : Talossan [tzl]
  50184. //! author : Robin van der Vliet : https://github.com/robin0van0der0v
  50185. //! author : Iustì Canun
  50186. ;(function (global, factory) {
  50187. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  50188. undefined
  50189. }(this, (function (moment) { 'use strict';
  50190. //! moment.js locale configuration
  50191. // After the year there should be a slash and the amount of years since December 26, 1979 in Roman numerals.
  50192. // This is currently too difficult (maybe even impossible) to add.
  50193. var tzl = moment.defineLocale('tzl', {
  50194. months: 'Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar'.split(
  50195. '_'
  50196. ),
  50197. monthsShort: 'Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec'.split('_'),
  50198. weekdays: 'Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi'.split('_'),
  50199. weekdaysShort: 'Súl_Lún_Mai_Már_Xhú_Vié_Sát'.split('_'),
  50200. weekdaysMin: 'Sú_Lú_Ma_Má_Xh_Vi_Sá'.split('_'),
  50201. longDateFormat: {
  50202. LT: 'HH.mm',
  50203. LTS: 'HH.mm.ss',
  50204. L: 'DD.MM.YYYY',
  50205. LL: 'D. MMMM [dallas] YYYY',
  50206. LLL: 'D. MMMM [dallas] YYYY HH.mm',
  50207. LLLL: 'dddd, [li] D. MMMM [dallas] YYYY HH.mm',
  50208. },
  50209. meridiemParse: /d\'o|d\'a/i,
  50210. isPM: function (input) {
  50211. return "d'o" === input.toLowerCase();
  50212. },
  50213. meridiem: function (hours, minutes, isLower) {
  50214. if (hours > 11) {
  50215. return isLower ? "d'o" : "D'O";
  50216. } else {
  50217. return isLower ? "d'a" : "D'A";
  50218. }
  50219. },
  50220. calendar: {
  50221. sameDay: '[oxhi à] LT',
  50222. nextDay: '[demà à] LT',
  50223. nextWeek: 'dddd [à] LT',
  50224. lastDay: '[ieiri à] LT',
  50225. lastWeek: '[sür el] dddd [lasteu à] LT',
  50226. sameElse: 'L',
  50227. },
  50228. relativeTime: {
  50229. future: 'osprei %s',
  50230. past: 'ja%s',
  50231. s: processRelativeTime,
  50232. ss: processRelativeTime,
  50233. m: processRelativeTime,
  50234. mm: processRelativeTime,
  50235. h: processRelativeTime,
  50236. hh: processRelativeTime,
  50237. d: processRelativeTime,
  50238. dd: processRelativeTime,
  50239. M: processRelativeTime,
  50240. MM: processRelativeTime,
  50241. y: processRelativeTime,
  50242. yy: processRelativeTime,
  50243. },
  50244. dayOfMonthOrdinalParse: /\d{1,2}\./,
  50245. ordinal: '%d.',
  50246. week: {
  50247. dow: 1, // Monday is the first day of the week.
  50248. doy: 4, // The week that contains Jan 4th is the first week of the year.
  50249. },
  50250. });
  50251. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  50252. var format = {
  50253. s: ['viensas secunds', "'iensas secunds"],
  50254. ss: [number + ' secunds', '' + number + ' secunds'],
  50255. m: ["'n míut", "'iens míut"],
  50256. mm: [number + ' míuts', '' + number + ' míuts'],
  50257. h: ["'n þora", "'iensa þora"],
  50258. hh: [number + ' þoras', '' + number + ' þoras'],
  50259. d: ["'n ziua", "'iensa ziua"],
  50260. dd: [number + ' ziuas', '' + number + ' ziuas'],
  50261. M: ["'n mes", "'iens mes"],
  50262. MM: [number + ' mesen', '' + number + ' mesen'],
  50263. y: ["'n ar", "'iens ar"],
  50264. yy: [number + ' ars', '' + number + ' ars'],
  50265. };
  50266. return isFuture
  50267. ? format[key][0]
  50268. : withoutSuffix
  50269. ? format[key][0]
  50270. : format[key][1];
  50271. }
  50272. return tzl;
  50273. })));
  50274. /***/ }),
  50275. /***/ "./node_modules/moment/locale/tzm-latn.js":
  50276. /*!************************************************!*\
  50277. !*** ./node_modules/moment/locale/tzm-latn.js ***!
  50278. \************************************************/
  50279. /*! no static exports found */
  50280. /***/ (function(module, exports, __webpack_require__) {
  50281. //! moment.js locale configuration
  50282. //! locale : Central Atlas Tamazight Latin [tzm-latn]
  50283. //! author : Abdel Said : https://github.com/abdelsaid
  50284. ;(function (global, factory) {
  50285. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  50286. undefined
  50287. }(this, (function (moment) { 'use strict';
  50288. //! moment.js locale configuration
  50289. var tzmLatn = moment.defineLocale('tzm-latn', {
  50290. months: 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split(
  50291. '_'
  50292. ),
  50293. monthsShort: 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split(
  50294. '_'
  50295. ),
  50296. weekdays: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
  50297. weekdaysShort: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
  50298. weekdaysMin: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
  50299. longDateFormat: {
  50300. LT: 'HH:mm',
  50301. LTS: 'HH:mm:ss',
  50302. L: 'DD/MM/YYYY',
  50303. LL: 'D MMMM YYYY',
  50304. LLL: 'D MMMM YYYY HH:mm',
  50305. LLLL: 'dddd D MMMM YYYY HH:mm',
  50306. },
  50307. calendar: {
  50308. sameDay: '[asdkh g] LT',
  50309. nextDay: '[aska g] LT',
  50310. nextWeek: 'dddd [g] LT',
  50311. lastDay: '[assant g] LT',
  50312. lastWeek: 'dddd [g] LT',
  50313. sameElse: 'L',
  50314. },
  50315. relativeTime: {
  50316. future: 'dadkh s yan %s',
  50317. past: 'yan %s',
  50318. s: 'imik',
  50319. ss: '%d imik',
  50320. m: 'minuḍ',
  50321. mm: '%d minuḍ',
  50322. h: 'saɛa',
  50323. hh: '%d tassaɛin',
  50324. d: 'ass',
  50325. dd: '%d ossan',
  50326. M: 'ayowr',
  50327. MM: '%d iyyirn',
  50328. y: 'asgas',
  50329. yy: '%d isgasn',
  50330. },
  50331. week: {
  50332. dow: 6, // Saturday is the first day of the week.
  50333. doy: 12, // The week that contains Jan 12th is the first week of the year.
  50334. },
  50335. });
  50336. return tzmLatn;
  50337. })));
  50338. /***/ }),
  50339. /***/ "./node_modules/moment/locale/tzm.js":
  50340. /*!*******************************************!*\
  50341. !*** ./node_modules/moment/locale/tzm.js ***!
  50342. \*******************************************/
  50343. /*! no static exports found */
  50344. /***/ (function(module, exports, __webpack_require__) {
  50345. //! moment.js locale configuration
  50346. //! locale : Central Atlas Tamazight [tzm]
  50347. //! author : Abdel Said : https://github.com/abdelsaid
  50348. ;(function (global, factory) {
  50349. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  50350. undefined
  50351. }(this, (function (moment) { 'use strict';
  50352. //! moment.js locale configuration
  50353. var tzm = moment.defineLocale('tzm', {
  50354. months: 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split(
  50355. '_'
  50356. ),
  50357. monthsShort: 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split(
  50358. '_'
  50359. ),
  50360. weekdays: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
  50361. weekdaysShort: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
  50362. weekdaysMin: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
  50363. longDateFormat: {
  50364. LT: 'HH:mm',
  50365. LTS: 'HH:mm:ss',
  50366. L: 'DD/MM/YYYY',
  50367. LL: 'D MMMM YYYY',
  50368. LLL: 'D MMMM YYYY HH:mm',
  50369. LLLL: 'dddd D MMMM YYYY HH:mm',
  50370. },
  50371. calendar: {
  50372. sameDay: '[ⴰⵙⴷⵅ ⴴ] LT',
  50373. nextDay: '[ⴰⵙⴽⴰ ⴴ] LT',
  50374. nextWeek: 'dddd [ⴴ] LT',
  50375. lastDay: '[ⴰⵚⴰⵏⵜ ⴴ] LT',
  50376. lastWeek: 'dddd [ⴴ] LT',
  50377. sameElse: 'L',
  50378. },
  50379. relativeTime: {
  50380. future: 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s',
  50381. past: 'ⵢⴰⵏ %s',
  50382. s: 'ⵉⵎⵉⴽ',
  50383. ss: '%d ⵉⵎⵉⴽ',
  50384. m: 'ⵎⵉⵏⵓⴺ',
  50385. mm: '%d ⵎⵉⵏⵓⴺ',
  50386. h: 'ⵙⴰⵄⴰ',
  50387. hh: '%d ⵜⴰⵙⵙⴰⵄⵉⵏ',
  50388. d: 'ⴰⵙⵙ',
  50389. dd: '%d oⵙⵙⴰⵏ',
  50390. M: 'ⴰⵢoⵓⵔ',
  50391. MM: '%d ⵉⵢⵢⵉⵔⵏ',
  50392. y: 'ⴰⵙⴳⴰⵙ',
  50393. yy: '%d ⵉⵙⴳⴰⵙⵏ',
  50394. },
  50395. week: {
  50396. dow: 6, // Saturday is the first day of the week.
  50397. doy: 12, // The week that contains Jan 12th is the first week of the year.
  50398. },
  50399. });
  50400. return tzm;
  50401. })));
  50402. /***/ }),
  50403. /***/ "./node_modules/moment/locale/ug-cn.js":
  50404. /*!*********************************************!*\
  50405. !*** ./node_modules/moment/locale/ug-cn.js ***!
  50406. \*********************************************/
  50407. /*! no static exports found */
  50408. /***/ (function(module, exports, __webpack_require__) {
  50409. //! moment.js locale configuration
  50410. //! locale : Uyghur (China) [ug-cn]
  50411. //! author: boyaq : https://github.com/boyaq
  50412. ;(function (global, factory) {
  50413. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  50414. undefined
  50415. }(this, (function (moment) { 'use strict';
  50416. //! moment.js locale configuration
  50417. var ugCn = moment.defineLocale('ug-cn', {
  50418. months: 'يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر'.split(
  50419. '_'
  50420. ),
  50421. monthsShort: 'يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر'.split(
  50422. '_'
  50423. ),
  50424. weekdays: 'يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە'.split(
  50425. '_'
  50426. ),
  50427. weekdaysShort: 'يە_دۈ_سە_چا_پە_جۈ_شە'.split('_'),
  50428. weekdaysMin: 'يە_دۈ_سە_چا_پە_جۈ_شە'.split('_'),
  50429. longDateFormat: {
  50430. LT: 'HH:mm',
  50431. LTS: 'HH:mm:ss',
  50432. L: 'YYYY-MM-DD',
  50433. LL: 'YYYY-يىلىM-ئاينىڭD-كۈنى',
  50434. LLL: 'YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm',
  50435. LLLL: 'dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm',
  50436. },
  50437. meridiemParse: /يېرىم كېچە|سەھەر|چۈشتىن بۇرۇن|چۈش|چۈشتىن كېيىن|كەچ/,
  50438. meridiemHour: function (hour, meridiem) {
  50439. if (hour === 12) {
  50440. hour = 0;
  50441. }
  50442. if (
  50443. meridiem === 'يېرىم كېچە' ||
  50444. meridiem === 'سەھەر' ||
  50445. meridiem === 'چۈشتىن بۇرۇن'
  50446. ) {
  50447. return hour;
  50448. } else if (meridiem === 'چۈشتىن كېيىن' || meridiem === 'كەچ') {
  50449. return hour + 12;
  50450. } else {
  50451. return hour >= 11 ? hour : hour + 12;
  50452. }
  50453. },
  50454. meridiem: function (hour, minute, isLower) {
  50455. var hm = hour * 100 + minute;
  50456. if (hm < 600) {
  50457. return 'يېرىم كېچە';
  50458. } else if (hm < 900) {
  50459. return 'سەھەر';
  50460. } else if (hm < 1130) {
  50461. return 'چۈشتىن بۇرۇن';
  50462. } else if (hm < 1230) {
  50463. return 'چۈش';
  50464. } else if (hm < 1800) {
  50465. return 'چۈشتىن كېيىن';
  50466. } else {
  50467. return 'كەچ';
  50468. }
  50469. },
  50470. calendar: {
  50471. sameDay: '[بۈگۈن سائەت] LT',
  50472. nextDay: '[ئەتە سائەت] LT',
  50473. nextWeek: '[كېلەركى] dddd [سائەت] LT',
  50474. lastDay: '[تۆنۈگۈن] LT',
  50475. lastWeek: '[ئالدىنقى] dddd [سائەت] LT',
  50476. sameElse: 'L',
  50477. },
  50478. relativeTime: {
  50479. future: '%s كېيىن',
  50480. past: '%s بۇرۇن',
  50481. s: 'نەچچە سېكونت',
  50482. ss: '%d سېكونت',
  50483. m: 'بىر مىنۇت',
  50484. mm: '%d مىنۇت',
  50485. h: 'بىر سائەت',
  50486. hh: '%d سائەت',
  50487. d: 'بىر كۈن',
  50488. dd: '%d كۈن',
  50489. M: 'بىر ئاي',
  50490. MM: '%d ئاي',
  50491. y: 'بىر يىل',
  50492. yy: '%d يىل',
  50493. },
  50494. dayOfMonthOrdinalParse: /\d{1,2}(-كۈنى|-ئاي|-ھەپتە)/,
  50495. ordinal: function (number, period) {
  50496. switch (period) {
  50497. case 'd':
  50498. case 'D':
  50499. case 'DDD':
  50500. return number + '-كۈنى';
  50501. case 'w':
  50502. case 'W':
  50503. return number + '-ھەپتە';
  50504. default:
  50505. return number;
  50506. }
  50507. },
  50508. preparse: function (string) {
  50509. return string.replace(/،/g, ',');
  50510. },
  50511. postformat: function (string) {
  50512. return string.replace(/,/g, '،');
  50513. },
  50514. week: {
  50515. // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效
  50516. dow: 1, // Monday is the first day of the week.
  50517. doy: 7, // The week that contains Jan 1st is the first week of the year.
  50518. },
  50519. });
  50520. return ugCn;
  50521. })));
  50522. /***/ }),
  50523. /***/ "./node_modules/moment/locale/uk.js":
  50524. /*!******************************************!*\
  50525. !*** ./node_modules/moment/locale/uk.js ***!
  50526. \******************************************/
  50527. /*! no static exports found */
  50528. /***/ (function(module, exports, __webpack_require__) {
  50529. //! moment.js locale configuration
  50530. //! locale : Ukrainian [uk]
  50531. //! author : zemlanin : https://github.com/zemlanin
  50532. //! Author : Menelion Elensúle : https://github.com/Oire
  50533. ;(function (global, factory) {
  50534. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  50535. undefined
  50536. }(this, (function (moment) { 'use strict';
  50537. //! moment.js locale configuration
  50538. function plural(word, num) {
  50539. var forms = word.split('_');
  50540. return num % 10 === 1 && num % 100 !== 11
  50541. ? forms[0]
  50542. : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20)
  50543. ? forms[1]
  50544. : forms[2];
  50545. }
  50546. function relativeTimeWithPlural(number, withoutSuffix, key) {
  50547. var format = {
  50548. ss: withoutSuffix ? 'секунда_секунди_секунд' : 'секунду_секунди_секунд',
  50549. mm: withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин',
  50550. hh: withoutSuffix ? 'година_години_годин' : 'годину_години_годин',
  50551. dd: 'день_дні_днів',
  50552. MM: 'місяць_місяці_місяців',
  50553. yy: 'рік_роки_років',
  50554. };
  50555. if (key === 'm') {
  50556. return withoutSuffix ? 'хвилина' : 'хвилину';
  50557. } else if (key === 'h') {
  50558. return withoutSuffix ? 'година' : 'годину';
  50559. } else {
  50560. return number + ' ' + plural(format[key], +number);
  50561. }
  50562. }
  50563. function weekdaysCaseReplace(m, format) {
  50564. var weekdays = {
  50565. nominative: 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split(
  50566. '_'
  50567. ),
  50568. accusative: 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split(
  50569. '_'
  50570. ),
  50571. genitive: 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split(
  50572. '_'
  50573. ),
  50574. },
  50575. nounCase;
  50576. if (m === true) {
  50577. return weekdays['nominative']
  50578. .slice(1, 7)
  50579. .concat(weekdays['nominative'].slice(0, 1));
  50580. }
  50581. if (!m) {
  50582. return weekdays['nominative'];
  50583. }
  50584. nounCase = /(\[[ВвУу]\]) ?dddd/.test(format)
  50585. ? 'accusative'
  50586. : /\[?(?:минулої|наступної)? ?\] ?dddd/.test(format)
  50587. ? 'genitive'
  50588. : 'nominative';
  50589. return weekdays[nounCase][m.day()];
  50590. }
  50591. function processHoursFunction(str) {
  50592. return function () {
  50593. return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT';
  50594. };
  50595. }
  50596. var uk = moment.defineLocale('uk', {
  50597. months: {
  50598. format: 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split(
  50599. '_'
  50600. ),
  50601. standalone: 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split(
  50602. '_'
  50603. ),
  50604. },
  50605. monthsShort: 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split(
  50606. '_'
  50607. ),
  50608. weekdays: weekdaysCaseReplace,
  50609. weekdaysShort: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
  50610. weekdaysMin: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
  50611. longDateFormat: {
  50612. LT: 'HH:mm',
  50613. LTS: 'HH:mm:ss',
  50614. L: 'DD.MM.YYYY',
  50615. LL: 'D MMMM YYYY р.',
  50616. LLL: 'D MMMM YYYY р., HH:mm',
  50617. LLLL: 'dddd, D MMMM YYYY р., HH:mm',
  50618. },
  50619. calendar: {
  50620. sameDay: processHoursFunction('[Сьогодні '),
  50621. nextDay: processHoursFunction('[Завтра '),
  50622. lastDay: processHoursFunction('[Вчора '),
  50623. nextWeek: processHoursFunction('[У] dddd ['),
  50624. lastWeek: function () {
  50625. switch (this.day()) {
  50626. case 0:
  50627. case 3:
  50628. case 5:
  50629. case 6:
  50630. return processHoursFunction('[Минулої] dddd [').call(this);
  50631. case 1:
  50632. case 2:
  50633. case 4:
  50634. return processHoursFunction('[Минулого] dddd [').call(this);
  50635. }
  50636. },
  50637. sameElse: 'L',
  50638. },
  50639. relativeTime: {
  50640. future: 'за %s',
  50641. past: '%s тому',
  50642. s: 'декілька секунд',
  50643. ss: relativeTimeWithPlural,
  50644. m: relativeTimeWithPlural,
  50645. mm: relativeTimeWithPlural,
  50646. h: 'годину',
  50647. hh: relativeTimeWithPlural,
  50648. d: 'день',
  50649. dd: relativeTimeWithPlural,
  50650. M: 'місяць',
  50651. MM: relativeTimeWithPlural,
  50652. y: 'рік',
  50653. yy: relativeTimeWithPlural,
  50654. },
  50655. // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason
  50656. meridiemParse: /ночі|ранку|дня|вечора/,
  50657. isPM: function (input) {
  50658. return /^(дня|вечора)$/.test(input);
  50659. },
  50660. meridiem: function (hour, minute, isLower) {
  50661. if (hour < 4) {
  50662. return 'ночі';
  50663. } else if (hour < 12) {
  50664. return 'ранку';
  50665. } else if (hour < 17) {
  50666. return 'дня';
  50667. } else {
  50668. return 'вечора';
  50669. }
  50670. },
  50671. dayOfMonthOrdinalParse: /\d{1,2}-(й|го)/,
  50672. ordinal: function (number, period) {
  50673. switch (period) {
  50674. case 'M':
  50675. case 'd':
  50676. case 'DDD':
  50677. case 'w':
  50678. case 'W':
  50679. return number + '-й';
  50680. case 'D':
  50681. return number + '-го';
  50682. default:
  50683. return number;
  50684. }
  50685. },
  50686. week: {
  50687. dow: 1, // Monday is the first day of the week.
  50688. doy: 7, // The week that contains Jan 7th is the first week of the year.
  50689. },
  50690. });
  50691. return uk;
  50692. })));
  50693. /***/ }),
  50694. /***/ "./node_modules/moment/locale/ur.js":
  50695. /*!******************************************!*\
  50696. !*** ./node_modules/moment/locale/ur.js ***!
  50697. \******************************************/
  50698. /*! no static exports found */
  50699. /***/ (function(module, exports, __webpack_require__) {
  50700. //! moment.js locale configuration
  50701. //! locale : Urdu [ur]
  50702. //! author : Sawood Alam : https://github.com/ibnesayeed
  50703. //! author : Zack : https://github.com/ZackVision
  50704. ;(function (global, factory) {
  50705. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  50706. undefined
  50707. }(this, (function (moment) { 'use strict';
  50708. //! moment.js locale configuration
  50709. var months = [
  50710. 'جنوری',
  50711. 'فروری',
  50712. 'مارچ',
  50713. 'اپریل',
  50714. 'مئی',
  50715. 'جون',
  50716. 'جولائی',
  50717. 'اگست',
  50718. 'ستمبر',
  50719. 'اکتوبر',
  50720. 'نومبر',
  50721. 'دسمبر',
  50722. ],
  50723. days = ['اتوار', 'پیر', 'منگل', 'بدھ', 'جمعرات', 'جمعہ', 'ہفتہ'];
  50724. var ur = moment.defineLocale('ur', {
  50725. months: months,
  50726. monthsShort: months,
  50727. weekdays: days,
  50728. weekdaysShort: days,
  50729. weekdaysMin: days,
  50730. longDateFormat: {
  50731. LT: 'HH:mm',
  50732. LTS: 'HH:mm:ss',
  50733. L: 'DD/MM/YYYY',
  50734. LL: 'D MMMM YYYY',
  50735. LLL: 'D MMMM YYYY HH:mm',
  50736. LLLL: 'dddd، D MMMM YYYY HH:mm',
  50737. },
  50738. meridiemParse: /صبح|شام/,
  50739. isPM: function (input) {
  50740. return 'شام' === input;
  50741. },
  50742. meridiem: function (hour, minute, isLower) {
  50743. if (hour < 12) {
  50744. return 'صبح';
  50745. }
  50746. return 'شام';
  50747. },
  50748. calendar: {
  50749. sameDay: '[آج بوقت] LT',
  50750. nextDay: '[کل بوقت] LT',
  50751. nextWeek: 'dddd [بوقت] LT',
  50752. lastDay: '[گذشتہ روز بوقت] LT',
  50753. lastWeek: '[گذشتہ] dddd [بوقت] LT',
  50754. sameElse: 'L',
  50755. },
  50756. relativeTime: {
  50757. future: '%s بعد',
  50758. past: '%s قبل',
  50759. s: 'چند سیکنڈ',
  50760. ss: '%d سیکنڈ',
  50761. m: 'ایک منٹ',
  50762. mm: '%d منٹ',
  50763. h: 'ایک گھنٹہ',
  50764. hh: '%d گھنٹے',
  50765. d: 'ایک دن',
  50766. dd: '%d دن',
  50767. M: 'ایک ماہ',
  50768. MM: '%d ماہ',
  50769. y: 'ایک سال',
  50770. yy: '%d سال',
  50771. },
  50772. preparse: function (string) {
  50773. return string.replace(/،/g, ',');
  50774. },
  50775. postformat: function (string) {
  50776. return string.replace(/,/g, '،');
  50777. },
  50778. week: {
  50779. dow: 1, // Monday is the first day of the week.
  50780. doy: 4, // The week that contains Jan 4th is the first week of the year.
  50781. },
  50782. });
  50783. return ur;
  50784. })));
  50785. /***/ }),
  50786. /***/ "./node_modules/moment/locale/uz-latn.js":
  50787. /*!***********************************************!*\
  50788. !*** ./node_modules/moment/locale/uz-latn.js ***!
  50789. \***********************************************/
  50790. /*! no static exports found */
  50791. /***/ (function(module, exports, __webpack_require__) {
  50792. //! moment.js locale configuration
  50793. //! locale : Uzbek Latin [uz-latn]
  50794. //! author : Rasulbek Mirzayev : github.com/Rasulbeeek
  50795. ;(function (global, factory) {
  50796. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  50797. undefined
  50798. }(this, (function (moment) { 'use strict';
  50799. //! moment.js locale configuration
  50800. var uzLatn = moment.defineLocale('uz-latn', {
  50801. months: 'Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr'.split(
  50802. '_'
  50803. ),
  50804. monthsShort: 'Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek'.split('_'),
  50805. weekdays: 'Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba'.split(
  50806. '_'
  50807. ),
  50808. weekdaysShort: 'Yak_Dush_Sesh_Chor_Pay_Jum_Shan'.split('_'),
  50809. weekdaysMin: 'Ya_Du_Se_Cho_Pa_Ju_Sha'.split('_'),
  50810. longDateFormat: {
  50811. LT: 'HH:mm',
  50812. LTS: 'HH:mm:ss',
  50813. L: 'DD/MM/YYYY',
  50814. LL: 'D MMMM YYYY',
  50815. LLL: 'D MMMM YYYY HH:mm',
  50816. LLLL: 'D MMMM YYYY, dddd HH:mm',
  50817. },
  50818. calendar: {
  50819. sameDay: '[Bugun soat] LT [da]',
  50820. nextDay: '[Ertaga] LT [da]',
  50821. nextWeek: 'dddd [kuni soat] LT [da]',
  50822. lastDay: '[Kecha soat] LT [da]',
  50823. lastWeek: "[O'tgan] dddd [kuni soat] LT [da]",
  50824. sameElse: 'L',
  50825. },
  50826. relativeTime: {
  50827. future: 'Yaqin %s ichida',
  50828. past: 'Bir necha %s oldin',
  50829. s: 'soniya',
  50830. ss: '%d soniya',
  50831. m: 'bir daqiqa',
  50832. mm: '%d daqiqa',
  50833. h: 'bir soat',
  50834. hh: '%d soat',
  50835. d: 'bir kun',
  50836. dd: '%d kun',
  50837. M: 'bir oy',
  50838. MM: '%d oy',
  50839. y: 'bir yil',
  50840. yy: '%d yil',
  50841. },
  50842. week: {
  50843. dow: 1, // Monday is the first day of the week.
  50844. doy: 7, // The week that contains Jan 7th is the first week of the year.
  50845. },
  50846. });
  50847. return uzLatn;
  50848. })));
  50849. /***/ }),
  50850. /***/ "./node_modules/moment/locale/uz.js":
  50851. /*!******************************************!*\
  50852. !*** ./node_modules/moment/locale/uz.js ***!
  50853. \******************************************/
  50854. /*! no static exports found */
  50855. /***/ (function(module, exports, __webpack_require__) {
  50856. //! moment.js locale configuration
  50857. //! locale : Uzbek [uz]
  50858. //! author : Sardor Muminov : https://github.com/muminoff
  50859. ;(function (global, factory) {
  50860. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  50861. undefined
  50862. }(this, (function (moment) { 'use strict';
  50863. //! moment.js locale configuration
  50864. var uz = moment.defineLocale('uz', {
  50865. months: 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split(
  50866. '_'
  50867. ),
  50868. monthsShort: 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),
  50869. weekdays: 'Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба'.split('_'),
  50870. weekdaysShort: 'Якш_Душ_Сеш_Чор_Пай_Жум_Шан'.split('_'),
  50871. weekdaysMin: 'Як_Ду_Се_Чо_Па_Жу_Ша'.split('_'),
  50872. longDateFormat: {
  50873. LT: 'HH:mm',
  50874. LTS: 'HH:mm:ss',
  50875. L: 'DD/MM/YYYY',
  50876. LL: 'D MMMM YYYY',
  50877. LLL: 'D MMMM YYYY HH:mm',
  50878. LLLL: 'D MMMM YYYY, dddd HH:mm',
  50879. },
  50880. calendar: {
  50881. sameDay: '[Бугун соат] LT [да]',
  50882. nextDay: '[Эртага] LT [да]',
  50883. nextWeek: 'dddd [куни соат] LT [да]',
  50884. lastDay: '[Кеча соат] LT [да]',
  50885. lastWeek: '[Утган] dddd [куни соат] LT [да]',
  50886. sameElse: 'L',
  50887. },
  50888. relativeTime: {
  50889. future: 'Якин %s ичида',
  50890. past: 'Бир неча %s олдин',
  50891. s: 'фурсат',
  50892. ss: '%d фурсат',
  50893. m: 'бир дакика',
  50894. mm: '%d дакика',
  50895. h: 'бир соат',
  50896. hh: '%d соат',
  50897. d: 'бир кун',
  50898. dd: '%d кун',
  50899. M: 'бир ой',
  50900. MM: '%d ой',
  50901. y: 'бир йил',
  50902. yy: '%d йил',
  50903. },
  50904. week: {
  50905. dow: 1, // Monday is the first day of the week.
  50906. doy: 7, // The week that contains Jan 4th is the first week of the year.
  50907. },
  50908. });
  50909. return uz;
  50910. })));
  50911. /***/ }),
  50912. /***/ "./node_modules/moment/locale/vi.js":
  50913. /*!******************************************!*\
  50914. !*** ./node_modules/moment/locale/vi.js ***!
  50915. \******************************************/
  50916. /*! no static exports found */
  50917. /***/ (function(module, exports, __webpack_require__) {
  50918. //! moment.js locale configuration
  50919. //! locale : Vietnamese [vi]
  50920. //! author : Bang Nguyen : https://github.com/bangnk
  50921. //! author : Chien Kira : https://github.com/chienkira
  50922. ;(function (global, factory) {
  50923. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  50924. undefined
  50925. }(this, (function (moment) { 'use strict';
  50926. //! moment.js locale configuration
  50927. var vi = moment.defineLocale('vi', {
  50928. 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(
  50929. '_'
  50930. ),
  50931. monthsShort: 'Thg 01_Thg 02_Thg 03_Thg 04_Thg 05_Thg 06_Thg 07_Thg 08_Thg 09_Thg 10_Thg 11_Thg 12'.split(
  50932. '_'
  50933. ),
  50934. monthsParseExact: true,
  50935. weekdays: 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split(
  50936. '_'
  50937. ),
  50938. weekdaysShort: 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
  50939. weekdaysMin: 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
  50940. weekdaysParseExact: true,
  50941. meridiemParse: /sa|ch/i,
  50942. isPM: function (input) {
  50943. return /^ch$/i.test(input);
  50944. },
  50945. meridiem: function (hours, minutes, isLower) {
  50946. if (hours < 12) {
  50947. return isLower ? 'sa' : 'SA';
  50948. } else {
  50949. return isLower ? 'ch' : 'CH';
  50950. }
  50951. },
  50952. longDateFormat: {
  50953. LT: 'HH:mm',
  50954. LTS: 'HH:mm:ss',
  50955. L: 'DD/MM/YYYY',
  50956. LL: 'D MMMM [năm] YYYY',
  50957. LLL: 'D MMMM [năm] YYYY HH:mm',
  50958. LLLL: 'dddd, D MMMM [năm] YYYY HH:mm',
  50959. l: 'DD/M/YYYY',
  50960. ll: 'D MMM YYYY',
  50961. lll: 'D MMM YYYY HH:mm',
  50962. llll: 'ddd, D MMM YYYY HH:mm',
  50963. },
  50964. calendar: {
  50965. sameDay: '[Hôm nay lúc] LT',
  50966. nextDay: '[Ngày mai lúc] LT',
  50967. nextWeek: 'dddd [tuần tới lúc] LT',
  50968. lastDay: '[Hôm qua lúc] LT',
  50969. lastWeek: 'dddd [tuần trước lúc] LT',
  50970. sameElse: 'L',
  50971. },
  50972. relativeTime: {
  50973. future: '%s tới',
  50974. past: '%s trước',
  50975. s: 'vài giây',
  50976. ss: '%d giây',
  50977. m: 'một phút',
  50978. mm: '%d phút',
  50979. h: 'một giờ',
  50980. hh: '%d giờ',
  50981. d: 'một ngày',
  50982. dd: '%d ngày',
  50983. M: 'một tháng',
  50984. MM: '%d tháng',
  50985. y: 'một năm',
  50986. yy: '%d năm',
  50987. },
  50988. dayOfMonthOrdinalParse: /\d{1,2}/,
  50989. ordinal: function (number) {
  50990. return number;
  50991. },
  50992. week: {
  50993. dow: 1, // Monday is the first day of the week.
  50994. doy: 4, // The week that contains Jan 4th is the first week of the year.
  50995. },
  50996. });
  50997. return vi;
  50998. })));
  50999. /***/ }),
  51000. /***/ "./node_modules/moment/locale/x-pseudo.js":
  51001. /*!************************************************!*\
  51002. !*** ./node_modules/moment/locale/x-pseudo.js ***!
  51003. \************************************************/
  51004. /*! no static exports found */
  51005. /***/ (function(module, exports, __webpack_require__) {
  51006. //! moment.js locale configuration
  51007. //! locale : Pseudo [x-pseudo]
  51008. //! author : Andrew Hood : https://github.com/andrewhood125
  51009. ;(function (global, factory) {
  51010. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  51011. undefined
  51012. }(this, (function (moment) { 'use strict';
  51013. //! moment.js locale configuration
  51014. var xPseudo = moment.defineLocale('x-pseudo', {
  51015. 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(
  51016. '_'
  51017. ),
  51018. monthsShort: 'J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc'.split(
  51019. '_'
  51020. ),
  51021. monthsParseExact: true,
  51022. weekdays: 'S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý'.split(
  51023. '_'
  51024. ),
  51025. weekdaysShort: 'S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát'.split('_'),
  51026. weekdaysMin: 'S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá'.split('_'),
  51027. weekdaysParseExact: true,
  51028. longDateFormat: {
  51029. LT: 'HH:mm',
  51030. L: 'DD/MM/YYYY',
  51031. LL: 'D MMMM YYYY',
  51032. LLL: 'D MMMM YYYY HH:mm',
  51033. LLLL: 'dddd, D MMMM YYYY HH:mm',
  51034. },
  51035. calendar: {
  51036. sameDay: '[T~ódá~ý át] LT',
  51037. nextDay: '[T~ómó~rró~w át] LT',
  51038. nextWeek: 'dddd [át] LT',
  51039. lastDay: '[Ý~ést~érdá~ý át] LT',
  51040. lastWeek: '[L~ást] dddd [át] LT',
  51041. sameElse: 'L',
  51042. },
  51043. relativeTime: {
  51044. future: 'í~ñ %s',
  51045. past: '%s á~gó',
  51046. s: 'á ~féw ~sécó~ñds',
  51047. ss: '%d s~écóñ~ds',
  51048. m: 'á ~míñ~úté',
  51049. mm: '%d m~íñú~tés',
  51050. h: 'á~ñ hó~úr',
  51051. hh: '%d h~óúrs',
  51052. d: 'á ~dáý',
  51053. dd: '%d d~áýs',
  51054. M: 'á ~móñ~th',
  51055. MM: '%d m~óñt~hs',
  51056. y: 'á ~ýéár',
  51057. yy: '%d ý~éárs',
  51058. },
  51059. dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
  51060. ordinal: function (number) {
  51061. var b = number % 10,
  51062. output =
  51063. ~~((number % 100) / 10) === 1
  51064. ? 'th'
  51065. : b === 1
  51066. ? 'st'
  51067. : b === 2
  51068. ? 'nd'
  51069. : b === 3
  51070. ? 'rd'
  51071. : 'th';
  51072. return number + output;
  51073. },
  51074. week: {
  51075. dow: 1, // Monday is the first day of the week.
  51076. doy: 4, // The week that contains Jan 4th is the first week of the year.
  51077. },
  51078. });
  51079. return xPseudo;
  51080. })));
  51081. /***/ }),
  51082. /***/ "./node_modules/moment/locale/yo.js":
  51083. /*!******************************************!*\
  51084. !*** ./node_modules/moment/locale/yo.js ***!
  51085. \******************************************/
  51086. /*! no static exports found */
  51087. /***/ (function(module, exports, __webpack_require__) {
  51088. //! moment.js locale configuration
  51089. //! locale : Yoruba Nigeria [yo]
  51090. //! author : Atolagbe Abisoye : https://github.com/andela-batolagbe
  51091. ;(function (global, factory) {
  51092. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  51093. undefined
  51094. }(this, (function (moment) { 'use strict';
  51095. //! moment.js locale configuration
  51096. var yo = moment.defineLocale('yo', {
  51097. months: 'Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀'.split(
  51098. '_'
  51099. ),
  51100. monthsShort: 'Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀'.split('_'),
  51101. weekdays: 'Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta'.split('_'),
  51102. weekdaysShort: 'Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá'.split('_'),
  51103. weekdaysMin: 'Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb'.split('_'),
  51104. longDateFormat: {
  51105. LT: 'h:mm A',
  51106. LTS: 'h:mm:ss A',
  51107. L: 'DD/MM/YYYY',
  51108. LL: 'D MMMM YYYY',
  51109. LLL: 'D MMMM YYYY h:mm A',
  51110. LLLL: 'dddd, D MMMM YYYY h:mm A',
  51111. },
  51112. calendar: {
  51113. sameDay: '[Ònì ni] LT',
  51114. nextDay: '[Ọ̀la ni] LT',
  51115. nextWeek: "dddd [Ọsẹ̀ tón'bọ] [ni] LT",
  51116. lastDay: '[Àna ni] LT',
  51117. lastWeek: 'dddd [Ọsẹ̀ tólọ́] [ni] LT',
  51118. sameElse: 'L',
  51119. },
  51120. relativeTime: {
  51121. future: 'ní %s',
  51122. past: '%s kọjá',
  51123. s: 'ìsẹjú aayá die',
  51124. ss: 'aayá %d',
  51125. m: 'ìsẹjú kan',
  51126. mm: 'ìsẹjú %d',
  51127. h: 'wákati kan',
  51128. hh: 'wákati %d',
  51129. d: 'ọjọ́ kan',
  51130. dd: 'ọjọ́ %d',
  51131. M: 'osù kan',
  51132. MM: 'osù %d',
  51133. y: 'ọdún kan',
  51134. yy: 'ọdún %d',
  51135. },
  51136. dayOfMonthOrdinalParse: /ọjọ́\s\d{1,2}/,
  51137. ordinal: 'ọjọ́ %d',
  51138. week: {
  51139. dow: 1, // Monday is the first day of the week.
  51140. doy: 4, // The week that contains Jan 4th is the first week of the year.
  51141. },
  51142. });
  51143. return yo;
  51144. })));
  51145. /***/ }),
  51146. /***/ "./node_modules/moment/locale/zh-cn.js":
  51147. /*!*********************************************!*\
  51148. !*** ./node_modules/moment/locale/zh-cn.js ***!
  51149. \*********************************************/
  51150. /*! no static exports found */
  51151. /***/ (function(module, exports, __webpack_require__) {
  51152. //! moment.js locale configuration
  51153. //! locale : Chinese (China) [zh-cn]
  51154. //! author : suupic : https://github.com/suupic
  51155. //! author : Zeno Zeng : https://github.com/zenozeng
  51156. //! author : uu109 : https://github.com/uu109
  51157. ;(function (global, factory) {
  51158. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  51159. undefined
  51160. }(this, (function (moment) { 'use strict';
  51161. //! moment.js locale configuration
  51162. var zhCn = moment.defineLocale('zh-cn', {
  51163. months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split(
  51164. '_'
  51165. ),
  51166. monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(
  51167. '_'
  51168. ),
  51169. weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
  51170. weekdaysShort: '周日_周一_周二_周三_周四_周五_周六'.split('_'),
  51171. weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
  51172. longDateFormat: {
  51173. LT: 'HH:mm',
  51174. LTS: 'HH:mm:ss',
  51175. L: 'YYYY/MM/DD',
  51176. LL: 'YYYY年M月D日',
  51177. LLL: 'YYYY年M月D日Ah点mm分',
  51178. LLLL: 'YYYY年M月D日ddddAh点mm分',
  51179. l: 'YYYY/M/D',
  51180. ll: 'YYYY年M月D日',
  51181. lll: 'YYYY年M月D日 HH:mm',
  51182. llll: 'YYYY年M月D日dddd HH:mm',
  51183. },
  51184. meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
  51185. meridiemHour: function (hour, meridiem) {
  51186. if (hour === 12) {
  51187. hour = 0;
  51188. }
  51189. if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
  51190. return hour;
  51191. } else if (meridiem === '下午' || meridiem === '晚上') {
  51192. return hour + 12;
  51193. } else {
  51194. // '中午'
  51195. return hour >= 11 ? hour : hour + 12;
  51196. }
  51197. },
  51198. meridiem: function (hour, minute, isLower) {
  51199. var hm = hour * 100 + minute;
  51200. if (hm < 600) {
  51201. return '凌晨';
  51202. } else if (hm < 900) {
  51203. return '早上';
  51204. } else if (hm < 1130) {
  51205. return '上午';
  51206. } else if (hm < 1230) {
  51207. return '中午';
  51208. } else if (hm < 1800) {
  51209. return '下午';
  51210. } else {
  51211. return '晚上';
  51212. }
  51213. },
  51214. calendar: {
  51215. sameDay: '[今天]LT',
  51216. nextDay: '[明天]LT',
  51217. nextWeek: function (now) {
  51218. if (now.week() !== this.week()) {
  51219. return '[下]dddLT';
  51220. } else {
  51221. return '[本]dddLT';
  51222. }
  51223. },
  51224. lastDay: '[昨天]LT',
  51225. lastWeek: function (now) {
  51226. if (this.week() !== now.week()) {
  51227. return '[上]dddLT';
  51228. } else {
  51229. return '[本]dddLT';
  51230. }
  51231. },
  51232. sameElse: 'L',
  51233. },
  51234. dayOfMonthOrdinalParse: /\d{1,2}(日|月|周)/,
  51235. ordinal: function (number, period) {
  51236. switch (period) {
  51237. case 'd':
  51238. case 'D':
  51239. case 'DDD':
  51240. return number + '日';
  51241. case 'M':
  51242. return number + '月';
  51243. case 'w':
  51244. case 'W':
  51245. return number + '周';
  51246. default:
  51247. return number;
  51248. }
  51249. },
  51250. relativeTime: {
  51251. future: '%s后',
  51252. past: '%s前',
  51253. s: '几秒',
  51254. ss: '%d 秒',
  51255. m: '1 分钟',
  51256. mm: '%d 分钟',
  51257. h: '1 小时',
  51258. hh: '%d 小时',
  51259. d: '1 天',
  51260. dd: '%d 天',
  51261. M: '1 个月',
  51262. MM: '%d 个月',
  51263. y: '1 年',
  51264. yy: '%d 年',
  51265. },
  51266. week: {
  51267. // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效
  51268. dow: 1, // Monday is the first day of the week.
  51269. doy: 4, // The week that contains Jan 4th is the first week of the year.
  51270. },
  51271. });
  51272. return zhCn;
  51273. })));
  51274. /***/ }),
  51275. /***/ "./node_modules/moment/locale/zh-hk.js":
  51276. /*!*********************************************!*\
  51277. !*** ./node_modules/moment/locale/zh-hk.js ***!
  51278. \*********************************************/
  51279. /*! no static exports found */
  51280. /***/ (function(module, exports, __webpack_require__) {
  51281. //! moment.js locale configuration
  51282. //! locale : Chinese (Hong Kong) [zh-hk]
  51283. //! author : Ben : https://github.com/ben-lin
  51284. //! author : Chris Lam : https://github.com/hehachris
  51285. //! author : Konstantin : https://github.com/skfd
  51286. //! author : Anthony : https://github.com/anthonylau
  51287. ;(function (global, factory) {
  51288. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  51289. undefined
  51290. }(this, (function (moment) { 'use strict';
  51291. //! moment.js locale configuration
  51292. var zhHk = moment.defineLocale('zh-hk', {
  51293. months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split(
  51294. '_'
  51295. ),
  51296. monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(
  51297. '_'
  51298. ),
  51299. weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
  51300. weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'),
  51301. weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
  51302. longDateFormat: {
  51303. LT: 'HH:mm',
  51304. LTS: 'HH:mm:ss',
  51305. L: 'YYYY/MM/DD',
  51306. LL: 'YYYY年M月D日',
  51307. LLL: 'YYYY年M月D日 HH:mm',
  51308. LLLL: 'YYYY年M月D日dddd HH:mm',
  51309. l: 'YYYY/M/D',
  51310. ll: 'YYYY年M月D日',
  51311. lll: 'YYYY年M月D日 HH:mm',
  51312. llll: 'YYYY年M月D日dddd HH:mm',
  51313. },
  51314. meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
  51315. meridiemHour: function (hour, meridiem) {
  51316. if (hour === 12) {
  51317. hour = 0;
  51318. }
  51319. if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
  51320. return hour;
  51321. } else if (meridiem === '中午') {
  51322. return hour >= 11 ? hour : hour + 12;
  51323. } else if (meridiem === '下午' || meridiem === '晚上') {
  51324. return hour + 12;
  51325. }
  51326. },
  51327. meridiem: function (hour, minute, isLower) {
  51328. var hm = hour * 100 + minute;
  51329. if (hm < 600) {
  51330. return '凌晨';
  51331. } else if (hm < 900) {
  51332. return '早上';
  51333. } else if (hm < 1200) {
  51334. return '上午';
  51335. } else if (hm === 1200) {
  51336. return '中午';
  51337. } else if (hm < 1800) {
  51338. return '下午';
  51339. } else {
  51340. return '晚上';
  51341. }
  51342. },
  51343. calendar: {
  51344. sameDay: '[今天]LT',
  51345. nextDay: '[明天]LT',
  51346. nextWeek: '[下]ddddLT',
  51347. lastDay: '[昨天]LT',
  51348. lastWeek: '[上]ddddLT',
  51349. sameElse: 'L',
  51350. },
  51351. dayOfMonthOrdinalParse: /\d{1,2}(日|月|週)/,
  51352. ordinal: function (number, period) {
  51353. switch (period) {
  51354. case 'd':
  51355. case 'D':
  51356. case 'DDD':
  51357. return number + '日';
  51358. case 'M':
  51359. return number + '月';
  51360. case 'w':
  51361. case 'W':
  51362. return number + '週';
  51363. default:
  51364. return number;
  51365. }
  51366. },
  51367. relativeTime: {
  51368. future: '%s後',
  51369. past: '%s前',
  51370. s: '幾秒',
  51371. ss: '%d 秒',
  51372. m: '1 分鐘',
  51373. mm: '%d 分鐘',
  51374. h: '1 小時',
  51375. hh: '%d 小時',
  51376. d: '1 天',
  51377. dd: '%d 天',
  51378. M: '1 個月',
  51379. MM: '%d 個月',
  51380. y: '1 年',
  51381. yy: '%d 年',
  51382. },
  51383. });
  51384. return zhHk;
  51385. })));
  51386. /***/ }),
  51387. /***/ "./node_modules/moment/locale/zh-mo.js":
  51388. /*!*********************************************!*\
  51389. !*** ./node_modules/moment/locale/zh-mo.js ***!
  51390. \*********************************************/
  51391. /*! no static exports found */
  51392. /***/ (function(module, exports, __webpack_require__) {
  51393. //! moment.js locale configuration
  51394. //! locale : Chinese (Macau) [zh-mo]
  51395. //! author : Ben : https://github.com/ben-lin
  51396. //! author : Chris Lam : https://github.com/hehachris
  51397. //! author : Tan Yuanhong : https://github.com/le0tan
  51398. ;(function (global, factory) {
  51399. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  51400. undefined
  51401. }(this, (function (moment) { 'use strict';
  51402. //! moment.js locale configuration
  51403. var zhMo = moment.defineLocale('zh-mo', {
  51404. months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split(
  51405. '_'
  51406. ),
  51407. monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(
  51408. '_'
  51409. ),
  51410. weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
  51411. weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'),
  51412. weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
  51413. longDateFormat: {
  51414. LT: 'HH:mm',
  51415. LTS: 'HH:mm:ss',
  51416. L: 'DD/MM/YYYY',
  51417. LL: 'YYYY年M月D日',
  51418. LLL: 'YYYY年M月D日 HH:mm',
  51419. LLLL: 'YYYY年M月D日dddd HH:mm',
  51420. l: 'D/M/YYYY',
  51421. ll: 'YYYY年M月D日',
  51422. lll: 'YYYY年M月D日 HH:mm',
  51423. llll: 'YYYY年M月D日dddd HH:mm',
  51424. },
  51425. meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
  51426. meridiemHour: function (hour, meridiem) {
  51427. if (hour === 12) {
  51428. hour = 0;
  51429. }
  51430. if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
  51431. return hour;
  51432. } else if (meridiem === '中午') {
  51433. return hour >= 11 ? hour : hour + 12;
  51434. } else if (meridiem === '下午' || meridiem === '晚上') {
  51435. return hour + 12;
  51436. }
  51437. },
  51438. meridiem: function (hour, minute, isLower) {
  51439. var hm = hour * 100 + minute;
  51440. if (hm < 600) {
  51441. return '凌晨';
  51442. } else if (hm < 900) {
  51443. return '早上';
  51444. } else if (hm < 1130) {
  51445. return '上午';
  51446. } else if (hm < 1230) {
  51447. return '中午';
  51448. } else if (hm < 1800) {
  51449. return '下午';
  51450. } else {
  51451. return '晚上';
  51452. }
  51453. },
  51454. calendar: {
  51455. sameDay: '[今天] LT',
  51456. nextDay: '[明天] LT',
  51457. nextWeek: '[下]dddd LT',
  51458. lastDay: '[昨天] LT',
  51459. lastWeek: '[上]dddd LT',
  51460. sameElse: 'L',
  51461. },
  51462. dayOfMonthOrdinalParse: /\d{1,2}(日|月|週)/,
  51463. ordinal: function (number, period) {
  51464. switch (period) {
  51465. case 'd':
  51466. case 'D':
  51467. case 'DDD':
  51468. return number + '日';
  51469. case 'M':
  51470. return number + '月';
  51471. case 'w':
  51472. case 'W':
  51473. return number + '週';
  51474. default:
  51475. return number;
  51476. }
  51477. },
  51478. relativeTime: {
  51479. future: '%s內',
  51480. past: '%s前',
  51481. s: '幾秒',
  51482. ss: '%d 秒',
  51483. m: '1 分鐘',
  51484. mm: '%d 分鐘',
  51485. h: '1 小時',
  51486. hh: '%d 小時',
  51487. d: '1 天',
  51488. dd: '%d 天',
  51489. M: '1 個月',
  51490. MM: '%d 個月',
  51491. y: '1 年',
  51492. yy: '%d 年',
  51493. },
  51494. });
  51495. return zhMo;
  51496. })));
  51497. /***/ }),
  51498. /***/ "./node_modules/moment/locale/zh-tw.js":
  51499. /*!*********************************************!*\
  51500. !*** ./node_modules/moment/locale/zh-tw.js ***!
  51501. \*********************************************/
  51502. /*! no static exports found */
  51503. /***/ (function(module, exports, __webpack_require__) {
  51504. //! moment.js locale configuration
  51505. //! locale : Chinese (Taiwan) [zh-tw]
  51506. //! author : Ben : https://github.com/ben-lin
  51507. //! author : Chris Lam : https://github.com/hehachris
  51508. ;(function (global, factory) {
  51509. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  51510. undefined
  51511. }(this, (function (moment) { 'use strict';
  51512. //! moment.js locale configuration
  51513. var zhTw = moment.defineLocale('zh-tw', {
  51514. months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split(
  51515. '_'
  51516. ),
  51517. monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(
  51518. '_'
  51519. ),
  51520. weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
  51521. weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'),
  51522. weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
  51523. longDateFormat: {
  51524. LT: 'HH:mm',
  51525. LTS: 'HH:mm:ss',
  51526. L: 'YYYY/MM/DD',
  51527. LL: 'YYYY年M月D日',
  51528. LLL: 'YYYY年M月D日 HH:mm',
  51529. LLLL: 'YYYY年M月D日dddd HH:mm',
  51530. l: 'YYYY/M/D',
  51531. ll: 'YYYY年M月D日',
  51532. lll: 'YYYY年M月D日 HH:mm',
  51533. llll: 'YYYY年M月D日dddd HH:mm',
  51534. },
  51535. meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
  51536. meridiemHour: function (hour, meridiem) {
  51537. if (hour === 12) {
  51538. hour = 0;
  51539. }
  51540. if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
  51541. return hour;
  51542. } else if (meridiem === '中午') {
  51543. return hour >= 11 ? hour : hour + 12;
  51544. } else if (meridiem === '下午' || meridiem === '晚上') {
  51545. return hour + 12;
  51546. }
  51547. },
  51548. meridiem: function (hour, minute, isLower) {
  51549. var hm = hour * 100 + minute;
  51550. if (hm < 600) {
  51551. return '凌晨';
  51552. } else if (hm < 900) {
  51553. return '早上';
  51554. } else if (hm < 1130) {
  51555. return '上午';
  51556. } else if (hm < 1230) {
  51557. return '中午';
  51558. } else if (hm < 1800) {
  51559. return '下午';
  51560. } else {
  51561. return '晚上';
  51562. }
  51563. },
  51564. calendar: {
  51565. sameDay: '[今天] LT',
  51566. nextDay: '[明天] LT',
  51567. nextWeek: '[下]dddd LT',
  51568. lastDay: '[昨天] LT',
  51569. lastWeek: '[上]dddd LT',
  51570. sameElse: 'L',
  51571. },
  51572. dayOfMonthOrdinalParse: /\d{1,2}(日|月|週)/,
  51573. ordinal: function (number, period) {
  51574. switch (period) {
  51575. case 'd':
  51576. case 'D':
  51577. case 'DDD':
  51578. return number + '日';
  51579. case 'M':
  51580. return number + '月';
  51581. case 'w':
  51582. case 'W':
  51583. return number + '週';
  51584. default:
  51585. return number;
  51586. }
  51587. },
  51588. relativeTime: {
  51589. future: '%s後',
  51590. past: '%s前',
  51591. s: '幾秒',
  51592. ss: '%d 秒',
  51593. m: '1 分鐘',
  51594. mm: '%d 分鐘',
  51595. h: '1 小時',
  51596. hh: '%d 小時',
  51597. d: '1 天',
  51598. dd: '%d 天',
  51599. M: '1 個月',
  51600. MM: '%d 個月',
  51601. y: '1 年',
  51602. yy: '%d 年',
  51603. },
  51604. });
  51605. return zhTw;
  51606. })));
  51607. /***/ }),
  51608. /***/ "./node_modules/moment/moment.js":
  51609. /*!***************************************!*\
  51610. !*** ./node_modules/moment/moment.js ***!
  51611. \***************************************/
  51612. /*! no static exports found */
  51613. /***/ (function(module, exports, __webpack_require__) {
  51614. /* WEBPACK VAR INJECTION */(function(module) {var require;//! moment.js
  51615. //! version : 2.28.0
  51616. //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
  51617. //! license : MIT
  51618. //! momentjs.com
  51619. ;(function (global, factory) {
  51620. true ? module.exports = factory() :
  51621. undefined
  51622. }(this, (function () { 'use strict';
  51623. var hookCallback;
  51624. function hooks() {
  51625. return hookCallback.apply(null, arguments);
  51626. }
  51627. // This is done to register the method called with moment()
  51628. // without creating circular dependencies.
  51629. function setHookCallback(callback) {
  51630. hookCallback = callback;
  51631. }
  51632. function isArray(input) {
  51633. return (
  51634. input instanceof Array ||
  51635. Object.prototype.toString.call(input) === '[object Array]'
  51636. );
  51637. }
  51638. function isObject(input) {
  51639. // IE8 will treat undefined and null as object if it wasn't for
  51640. // input != null
  51641. return (
  51642. input != null &&
  51643. Object.prototype.toString.call(input) === '[object Object]'
  51644. );
  51645. }
  51646. function hasOwnProp(a, b) {
  51647. return Object.prototype.hasOwnProperty.call(a, b);
  51648. }
  51649. function isObjectEmpty(obj) {
  51650. if (Object.getOwnPropertyNames) {
  51651. return Object.getOwnPropertyNames(obj).length === 0;
  51652. } else {
  51653. var k;
  51654. for (k in obj) {
  51655. if (hasOwnProp(obj, k)) {
  51656. return false;
  51657. }
  51658. }
  51659. return true;
  51660. }
  51661. }
  51662. function isUndefined(input) {
  51663. return input === void 0;
  51664. }
  51665. function isNumber(input) {
  51666. return (
  51667. typeof input === 'number' ||
  51668. Object.prototype.toString.call(input) === '[object Number]'
  51669. );
  51670. }
  51671. function isDate(input) {
  51672. return (
  51673. input instanceof Date ||
  51674. Object.prototype.toString.call(input) === '[object Date]'
  51675. );
  51676. }
  51677. function map(arr, fn) {
  51678. var res = [],
  51679. i;
  51680. for (i = 0; i < arr.length; ++i) {
  51681. res.push(fn(arr[i], i));
  51682. }
  51683. return res;
  51684. }
  51685. function extend(a, b) {
  51686. for (var i in b) {
  51687. if (hasOwnProp(b, i)) {
  51688. a[i] = b[i];
  51689. }
  51690. }
  51691. if (hasOwnProp(b, 'toString')) {
  51692. a.toString = b.toString;
  51693. }
  51694. if (hasOwnProp(b, 'valueOf')) {
  51695. a.valueOf = b.valueOf;
  51696. }
  51697. return a;
  51698. }
  51699. function createUTC(input, format, locale, strict) {
  51700. return createLocalOrUTC(input, format, locale, strict, true).utc();
  51701. }
  51702. function defaultParsingFlags() {
  51703. // We need to deep clone this object.
  51704. return {
  51705. empty: false,
  51706. unusedTokens: [],
  51707. unusedInput: [],
  51708. overflow: -2,
  51709. charsLeftOver: 0,
  51710. nullInput: false,
  51711. invalidEra: null,
  51712. invalidMonth: null,
  51713. invalidFormat: false,
  51714. userInvalidated: false,
  51715. iso: false,
  51716. parsedDateParts: [],
  51717. era: null,
  51718. meridiem: null,
  51719. rfc2822: false,
  51720. weekdayMismatch: false,
  51721. };
  51722. }
  51723. function getParsingFlags(m) {
  51724. if (m._pf == null) {
  51725. m._pf = defaultParsingFlags();
  51726. }
  51727. return m._pf;
  51728. }
  51729. var some;
  51730. if (Array.prototype.some) {
  51731. some = Array.prototype.some;
  51732. } else {
  51733. some = function (fun) {
  51734. var t = Object(this),
  51735. len = t.length >>> 0,
  51736. i;
  51737. for (i = 0; i < len; i++) {
  51738. if (i in t && fun.call(this, t[i], i, t)) {
  51739. return true;
  51740. }
  51741. }
  51742. return false;
  51743. };
  51744. }
  51745. function isValid(m) {
  51746. if (m._isValid == null) {
  51747. var flags = getParsingFlags(m),
  51748. parsedParts = some.call(flags.parsedDateParts, function (i) {
  51749. return i != null;
  51750. }),
  51751. isNowValid =
  51752. !isNaN(m._d.getTime()) &&
  51753. flags.overflow < 0 &&
  51754. !flags.empty &&
  51755. !flags.invalidEra &&
  51756. !flags.invalidMonth &&
  51757. !flags.invalidWeekday &&
  51758. !flags.weekdayMismatch &&
  51759. !flags.nullInput &&
  51760. !flags.invalidFormat &&
  51761. !flags.userInvalidated &&
  51762. (!flags.meridiem || (flags.meridiem && parsedParts));
  51763. if (m._strict) {
  51764. isNowValid =
  51765. isNowValid &&
  51766. flags.charsLeftOver === 0 &&
  51767. flags.unusedTokens.length === 0 &&
  51768. flags.bigHour === undefined;
  51769. }
  51770. if (Object.isFrozen == null || !Object.isFrozen(m)) {
  51771. m._isValid = isNowValid;
  51772. } else {
  51773. return isNowValid;
  51774. }
  51775. }
  51776. return m._isValid;
  51777. }
  51778. function createInvalid(flags) {
  51779. var m = createUTC(NaN);
  51780. if (flags != null) {
  51781. extend(getParsingFlags(m), flags);
  51782. } else {
  51783. getParsingFlags(m).userInvalidated = true;
  51784. }
  51785. return m;
  51786. }
  51787. // Plugins that add properties should also add the key here (null value),
  51788. // so we can properly clone ourselves.
  51789. var momentProperties = (hooks.momentProperties = []),
  51790. updateInProgress = false;
  51791. function copyConfig(to, from) {
  51792. var i, prop, val;
  51793. if (!isUndefined(from._isAMomentObject)) {
  51794. to._isAMomentObject = from._isAMomentObject;
  51795. }
  51796. if (!isUndefined(from._i)) {
  51797. to._i = from._i;
  51798. }
  51799. if (!isUndefined(from._f)) {
  51800. to._f = from._f;
  51801. }
  51802. if (!isUndefined(from._l)) {
  51803. to._l = from._l;
  51804. }
  51805. if (!isUndefined(from._strict)) {
  51806. to._strict = from._strict;
  51807. }
  51808. if (!isUndefined(from._tzm)) {
  51809. to._tzm = from._tzm;
  51810. }
  51811. if (!isUndefined(from._isUTC)) {
  51812. to._isUTC = from._isUTC;
  51813. }
  51814. if (!isUndefined(from._offset)) {
  51815. to._offset = from._offset;
  51816. }
  51817. if (!isUndefined(from._pf)) {
  51818. to._pf = getParsingFlags(from);
  51819. }
  51820. if (!isUndefined(from._locale)) {
  51821. to._locale = from._locale;
  51822. }
  51823. if (momentProperties.length > 0) {
  51824. for (i = 0; i < momentProperties.length; i++) {
  51825. prop = momentProperties[i];
  51826. val = from[prop];
  51827. if (!isUndefined(val)) {
  51828. to[prop] = val;
  51829. }
  51830. }
  51831. }
  51832. return to;
  51833. }
  51834. // Moment prototype object
  51835. function Moment(config) {
  51836. copyConfig(this, config);
  51837. this._d = new Date(config._d != null ? config._d.getTime() : NaN);
  51838. if (!this.isValid()) {
  51839. this._d = new Date(NaN);
  51840. }
  51841. // Prevent infinite loop in case updateOffset creates new moment
  51842. // objects.
  51843. if (updateInProgress === false) {
  51844. updateInProgress = true;
  51845. hooks.updateOffset(this);
  51846. updateInProgress = false;
  51847. }
  51848. }
  51849. function isMoment(obj) {
  51850. return (
  51851. obj instanceof Moment || (obj != null && obj._isAMomentObject != null)
  51852. );
  51853. }
  51854. function warn(msg) {
  51855. if (
  51856. hooks.suppressDeprecationWarnings === false &&
  51857. typeof console !== 'undefined' &&
  51858. console.warn
  51859. ) {
  51860. console.warn('Deprecation warning: ' + msg);
  51861. }
  51862. }
  51863. function deprecate(msg, fn) {
  51864. var firstTime = true;
  51865. return extend(function () {
  51866. if (hooks.deprecationHandler != null) {
  51867. hooks.deprecationHandler(null, msg);
  51868. }
  51869. if (firstTime) {
  51870. var args = [],
  51871. arg,
  51872. i,
  51873. key;
  51874. for (i = 0; i < arguments.length; i++) {
  51875. arg = '';
  51876. if (typeof arguments[i] === 'object') {
  51877. arg += '\n[' + i + '] ';
  51878. for (key in arguments[0]) {
  51879. if (hasOwnProp(arguments[0], key)) {
  51880. arg += key + ': ' + arguments[0][key] + ', ';
  51881. }
  51882. }
  51883. arg = arg.slice(0, -2); // Remove trailing comma and space
  51884. } else {
  51885. arg = arguments[i];
  51886. }
  51887. args.push(arg);
  51888. }
  51889. warn(
  51890. msg +
  51891. '\nArguments: ' +
  51892. Array.prototype.slice.call(args).join('') +
  51893. '\n' +
  51894. new Error().stack
  51895. );
  51896. firstTime = false;
  51897. }
  51898. return fn.apply(this, arguments);
  51899. }, fn);
  51900. }
  51901. var deprecations = {};
  51902. function deprecateSimple(name, msg) {
  51903. if (hooks.deprecationHandler != null) {
  51904. hooks.deprecationHandler(name, msg);
  51905. }
  51906. if (!deprecations[name]) {
  51907. warn(msg);
  51908. deprecations[name] = true;
  51909. }
  51910. }
  51911. hooks.suppressDeprecationWarnings = false;
  51912. hooks.deprecationHandler = null;
  51913. function isFunction(input) {
  51914. return (
  51915. (typeof Function !== 'undefined' && input instanceof Function) ||
  51916. Object.prototype.toString.call(input) === '[object Function]'
  51917. );
  51918. }
  51919. function set(config) {
  51920. var prop, i;
  51921. for (i in config) {
  51922. if (hasOwnProp(config, i)) {
  51923. prop = config[i];
  51924. if (isFunction(prop)) {
  51925. this[i] = prop;
  51926. } else {
  51927. this['_' + i] = prop;
  51928. }
  51929. }
  51930. }
  51931. this._config = config;
  51932. // Lenient ordinal parsing accepts just a number in addition to
  51933. // number + (possibly) stuff coming from _dayOfMonthOrdinalParse.
  51934. // TODO: Remove "ordinalParse" fallback in next major release.
  51935. this._dayOfMonthOrdinalParseLenient = new RegExp(
  51936. (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +
  51937. '|' +
  51938. /\d{1,2}/.source
  51939. );
  51940. }
  51941. function mergeConfigs(parentConfig, childConfig) {
  51942. var res = extend({}, parentConfig),
  51943. prop;
  51944. for (prop in childConfig) {
  51945. if (hasOwnProp(childConfig, prop)) {
  51946. if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
  51947. res[prop] = {};
  51948. extend(res[prop], parentConfig[prop]);
  51949. extend(res[prop], childConfig[prop]);
  51950. } else if (childConfig[prop] != null) {
  51951. res[prop] = childConfig[prop];
  51952. } else {
  51953. delete res[prop];
  51954. }
  51955. }
  51956. }
  51957. for (prop in parentConfig) {
  51958. if (
  51959. hasOwnProp(parentConfig, prop) &&
  51960. !hasOwnProp(childConfig, prop) &&
  51961. isObject(parentConfig[prop])
  51962. ) {
  51963. // make sure changes to properties don't modify parent config
  51964. res[prop] = extend({}, res[prop]);
  51965. }
  51966. }
  51967. return res;
  51968. }
  51969. function Locale(config) {
  51970. if (config != null) {
  51971. this.set(config);
  51972. }
  51973. }
  51974. var keys;
  51975. if (Object.keys) {
  51976. keys = Object.keys;
  51977. } else {
  51978. keys = function (obj) {
  51979. var i,
  51980. res = [];
  51981. for (i in obj) {
  51982. if (hasOwnProp(obj, i)) {
  51983. res.push(i);
  51984. }
  51985. }
  51986. return res;
  51987. };
  51988. }
  51989. var defaultCalendar = {
  51990. sameDay: '[Today at] LT',
  51991. nextDay: '[Tomorrow at] LT',
  51992. nextWeek: 'dddd [at] LT',
  51993. lastDay: '[Yesterday at] LT',
  51994. lastWeek: '[Last] dddd [at] LT',
  51995. sameElse: 'L',
  51996. };
  51997. function calendar(key, mom, now) {
  51998. var output = this._calendar[key] || this._calendar['sameElse'];
  51999. return isFunction(output) ? output.call(mom, now) : output;
  52000. }
  52001. function zeroFill(number, targetLength, forceSign) {
  52002. var absNumber = '' + Math.abs(number),
  52003. zerosToFill = targetLength - absNumber.length,
  52004. sign = number >= 0;
  52005. return (
  52006. (sign ? (forceSign ? '+' : '') : '-') +
  52007. Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) +
  52008. absNumber
  52009. );
  52010. }
  52011. var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,
  52012. localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,
  52013. formatFunctions = {},
  52014. formatTokenFunctions = {};
  52015. // token: 'M'
  52016. // padded: ['MM', 2]
  52017. // ordinal: 'Mo'
  52018. // callback: function () { this.month() + 1 }
  52019. function addFormatToken(token, padded, ordinal, callback) {
  52020. var func = callback;
  52021. if (typeof callback === 'string') {
  52022. func = function () {
  52023. return this[callback]();
  52024. };
  52025. }
  52026. if (token) {
  52027. formatTokenFunctions[token] = func;
  52028. }
  52029. if (padded) {
  52030. formatTokenFunctions[padded[0]] = function () {
  52031. return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
  52032. };
  52033. }
  52034. if (ordinal) {
  52035. formatTokenFunctions[ordinal] = function () {
  52036. return this.localeData().ordinal(
  52037. func.apply(this, arguments),
  52038. token
  52039. );
  52040. };
  52041. }
  52042. }
  52043. function removeFormattingTokens(input) {
  52044. if (input.match(/\[[\s\S]/)) {
  52045. return input.replace(/^\[|\]$/g, '');
  52046. }
  52047. return input.replace(/\\/g, '');
  52048. }
  52049. function makeFormatFunction(format) {
  52050. var array = format.match(formattingTokens),
  52051. i,
  52052. length;
  52053. for (i = 0, length = array.length; i < length; i++) {
  52054. if (formatTokenFunctions[array[i]]) {
  52055. array[i] = formatTokenFunctions[array[i]];
  52056. } else {
  52057. array[i] = removeFormattingTokens(array[i]);
  52058. }
  52059. }
  52060. return function (mom) {
  52061. var output = '',
  52062. i;
  52063. for (i = 0; i < length; i++) {
  52064. output += isFunction(array[i])
  52065. ? array[i].call(mom, format)
  52066. : array[i];
  52067. }
  52068. return output;
  52069. };
  52070. }
  52071. // format date using native date object
  52072. function formatMoment(m, format) {
  52073. if (!m.isValid()) {
  52074. return m.localeData().invalidDate();
  52075. }
  52076. format = expandFormat(format, m.localeData());
  52077. formatFunctions[format] =
  52078. formatFunctions[format] || makeFormatFunction(format);
  52079. return formatFunctions[format](m);
  52080. }
  52081. function expandFormat(format, locale) {
  52082. var i = 5;
  52083. function replaceLongDateFormatTokens(input) {
  52084. return locale.longDateFormat(input) || input;
  52085. }
  52086. localFormattingTokens.lastIndex = 0;
  52087. while (i >= 0 && localFormattingTokens.test(format)) {
  52088. format = format.replace(
  52089. localFormattingTokens,
  52090. replaceLongDateFormatTokens
  52091. );
  52092. localFormattingTokens.lastIndex = 0;
  52093. i -= 1;
  52094. }
  52095. return format;
  52096. }
  52097. var defaultLongDateFormat = {
  52098. LTS: 'h:mm:ss A',
  52099. LT: 'h:mm A',
  52100. L: 'MM/DD/YYYY',
  52101. LL: 'MMMM D, YYYY',
  52102. LLL: 'MMMM D, YYYY h:mm A',
  52103. LLLL: 'dddd, MMMM D, YYYY h:mm A',
  52104. };
  52105. function longDateFormat(key) {
  52106. var format = this._longDateFormat[key],
  52107. formatUpper = this._longDateFormat[key.toUpperCase()];
  52108. if (format || !formatUpper) {
  52109. return format;
  52110. }
  52111. this._longDateFormat[key] = formatUpper
  52112. .match(formattingTokens)
  52113. .map(function (tok) {
  52114. if (
  52115. tok === 'MMMM' ||
  52116. tok === 'MM' ||
  52117. tok === 'DD' ||
  52118. tok === 'dddd'
  52119. ) {
  52120. return tok.slice(1);
  52121. }
  52122. return tok;
  52123. })
  52124. .join('');
  52125. return this._longDateFormat[key];
  52126. }
  52127. var defaultInvalidDate = 'Invalid date';
  52128. function invalidDate() {
  52129. return this._invalidDate;
  52130. }
  52131. var defaultOrdinal = '%d',
  52132. defaultDayOfMonthOrdinalParse = /\d{1,2}/;
  52133. function ordinal(number) {
  52134. return this._ordinal.replace('%d', number);
  52135. }
  52136. var defaultRelativeTime = {
  52137. future: 'in %s',
  52138. past: '%s ago',
  52139. s: 'a few seconds',
  52140. ss: '%d seconds',
  52141. m: 'a minute',
  52142. mm: '%d minutes',
  52143. h: 'an hour',
  52144. hh: '%d hours',
  52145. d: 'a day',
  52146. dd: '%d days',
  52147. w: 'a week',
  52148. ww: '%d weeks',
  52149. M: 'a month',
  52150. MM: '%d months',
  52151. y: 'a year',
  52152. yy: '%d years',
  52153. };
  52154. function relativeTime(number, withoutSuffix, string, isFuture) {
  52155. var output = this._relativeTime[string];
  52156. return isFunction(output)
  52157. ? output(number, withoutSuffix, string, isFuture)
  52158. : output.replace(/%d/i, number);
  52159. }
  52160. function pastFuture(diff, output) {
  52161. var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
  52162. return isFunction(format) ? format(output) : format.replace(/%s/i, output);
  52163. }
  52164. var aliases = {};
  52165. function addUnitAlias(unit, shorthand) {
  52166. var lowerCase = unit.toLowerCase();
  52167. aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
  52168. }
  52169. function normalizeUnits(units) {
  52170. return typeof units === 'string'
  52171. ? aliases[units] || aliases[units.toLowerCase()]
  52172. : undefined;
  52173. }
  52174. function normalizeObjectUnits(inputObject) {
  52175. var normalizedInput = {},
  52176. normalizedProp,
  52177. prop;
  52178. for (prop in inputObject) {
  52179. if (hasOwnProp(inputObject, prop)) {
  52180. normalizedProp = normalizeUnits(prop);
  52181. if (normalizedProp) {
  52182. normalizedInput[normalizedProp] = inputObject[prop];
  52183. }
  52184. }
  52185. }
  52186. return normalizedInput;
  52187. }
  52188. var priorities = {};
  52189. function addUnitPriority(unit, priority) {
  52190. priorities[unit] = priority;
  52191. }
  52192. function getPrioritizedUnits(unitsObj) {
  52193. var units = [],
  52194. u;
  52195. for (u in unitsObj) {
  52196. if (hasOwnProp(unitsObj, u)) {
  52197. units.push({ unit: u, priority: priorities[u] });
  52198. }
  52199. }
  52200. units.sort(function (a, b) {
  52201. return a.priority - b.priority;
  52202. });
  52203. return units;
  52204. }
  52205. function isLeapYear(year) {
  52206. return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
  52207. }
  52208. function absFloor(number) {
  52209. if (number < 0) {
  52210. // -0 -> 0
  52211. return Math.ceil(number) || 0;
  52212. } else {
  52213. return Math.floor(number);
  52214. }
  52215. }
  52216. function toInt(argumentForCoercion) {
  52217. var coercedNumber = +argumentForCoercion,
  52218. value = 0;
  52219. if (coercedNumber !== 0 && isFinite(coercedNumber)) {
  52220. value = absFloor(coercedNumber);
  52221. }
  52222. return value;
  52223. }
  52224. function makeGetSet(unit, keepTime) {
  52225. return function (value) {
  52226. if (value != null) {
  52227. set$1(this, unit, value);
  52228. hooks.updateOffset(this, keepTime);
  52229. return this;
  52230. } else {
  52231. return get(this, unit);
  52232. }
  52233. };
  52234. }
  52235. function get(mom, unit) {
  52236. return mom.isValid()
  52237. ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]()
  52238. : NaN;
  52239. }
  52240. function set$1(mom, unit, value) {
  52241. if (mom.isValid() && !isNaN(value)) {
  52242. if (
  52243. unit === 'FullYear' &&
  52244. isLeapYear(mom.year()) &&
  52245. mom.month() === 1 &&
  52246. mom.date() === 29
  52247. ) {
  52248. value = toInt(value);
  52249. mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](
  52250. value,
  52251. mom.month(),
  52252. daysInMonth(value, mom.month())
  52253. );
  52254. } else {
  52255. mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
  52256. }
  52257. }
  52258. }
  52259. // MOMENTS
  52260. function stringGet(units) {
  52261. units = normalizeUnits(units);
  52262. if (isFunction(this[units])) {
  52263. return this[units]();
  52264. }
  52265. return this;
  52266. }
  52267. function stringSet(units, value) {
  52268. if (typeof units === 'object') {
  52269. units = normalizeObjectUnits(units);
  52270. var prioritized = getPrioritizedUnits(units),
  52271. i;
  52272. for (i = 0; i < prioritized.length; i++) {
  52273. this[prioritized[i].unit](units[prioritized[i].unit]);
  52274. }
  52275. } else {
  52276. units = normalizeUnits(units);
  52277. if (isFunction(this[units])) {
  52278. return this[units](value);
  52279. }
  52280. }
  52281. return this;
  52282. }
  52283. var match1 = /\d/, // 0 - 9
  52284. match2 = /\d\d/, // 00 - 99
  52285. match3 = /\d{3}/, // 000 - 999
  52286. match4 = /\d{4}/, // 0000 - 9999
  52287. match6 = /[+-]?\d{6}/, // -999999 - 999999
  52288. match1to2 = /\d\d?/, // 0 - 99
  52289. match3to4 = /\d\d\d\d?/, // 999 - 9999
  52290. match5to6 = /\d\d\d\d\d\d?/, // 99999 - 999999
  52291. match1to3 = /\d{1,3}/, // 0 - 999
  52292. match1to4 = /\d{1,4}/, // 0 - 9999
  52293. match1to6 = /[+-]?\d{1,6}/, // -999999 - 999999
  52294. matchUnsigned = /\d+/, // 0 - inf
  52295. matchSigned = /[+-]?\d+/, // -inf - inf
  52296. matchOffset = /Z|[+-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z
  52297. matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, // +00 -00 +00:00 -00:00 +0000 -0000 or Z
  52298. matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123
  52299. // any word (or two) characters or numbers including two/three word month in arabic.
  52300. // includes scottish gaelic two word and hyphenated months
  52301. matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,
  52302. regexes;
  52303. regexes = {};
  52304. function addRegexToken(token, regex, strictRegex) {
  52305. regexes[token] = isFunction(regex)
  52306. ? regex
  52307. : function (isStrict, localeData) {
  52308. return isStrict && strictRegex ? strictRegex : regex;
  52309. };
  52310. }
  52311. function getParseRegexForToken(token, config) {
  52312. if (!hasOwnProp(regexes, token)) {
  52313. return new RegExp(unescapeFormat(token));
  52314. }
  52315. return regexes[token](config._strict, config._locale);
  52316. }
  52317. // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
  52318. function unescapeFormat(s) {
  52319. return regexEscape(
  52320. s
  52321. .replace('\\', '')
  52322. .replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (
  52323. matched,
  52324. p1,
  52325. p2,
  52326. p3,
  52327. p4
  52328. ) {
  52329. return p1 || p2 || p3 || p4;
  52330. })
  52331. );
  52332. }
  52333. function regexEscape(s) {
  52334. return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
  52335. }
  52336. var tokens = {};
  52337. function addParseToken(token, callback) {
  52338. var i,
  52339. func = callback;
  52340. if (typeof token === 'string') {
  52341. token = [token];
  52342. }
  52343. if (isNumber(callback)) {
  52344. func = function (input, array) {
  52345. array[callback] = toInt(input);
  52346. };
  52347. }
  52348. for (i = 0; i < token.length; i++) {
  52349. tokens[token[i]] = func;
  52350. }
  52351. }
  52352. function addWeekParseToken(token, callback) {
  52353. addParseToken(token, function (input, array, config, token) {
  52354. config._w = config._w || {};
  52355. callback(input, config._w, config, token);
  52356. });
  52357. }
  52358. function addTimeToArrayFromToken(token, input, config) {
  52359. if (input != null && hasOwnProp(tokens, token)) {
  52360. tokens[token](input, config._a, config, token);
  52361. }
  52362. }
  52363. var YEAR = 0,
  52364. MONTH = 1,
  52365. DATE = 2,
  52366. HOUR = 3,
  52367. MINUTE = 4,
  52368. SECOND = 5,
  52369. MILLISECOND = 6,
  52370. WEEK = 7,
  52371. WEEKDAY = 8;
  52372. function mod(n, x) {
  52373. return ((n % x) + x) % x;
  52374. }
  52375. var indexOf;
  52376. if (Array.prototype.indexOf) {
  52377. indexOf = Array.prototype.indexOf;
  52378. } else {
  52379. indexOf = function (o) {
  52380. // I know
  52381. var i;
  52382. for (i = 0; i < this.length; ++i) {
  52383. if (this[i] === o) {
  52384. return i;
  52385. }
  52386. }
  52387. return -1;
  52388. };
  52389. }
  52390. function daysInMonth(year, month) {
  52391. if (isNaN(year) || isNaN(month)) {
  52392. return NaN;
  52393. }
  52394. var modMonth = mod(month, 12);
  52395. year += (month - modMonth) / 12;
  52396. return modMonth === 1
  52397. ? isLeapYear(year)
  52398. ? 29
  52399. : 28
  52400. : 31 - ((modMonth % 7) % 2);
  52401. }
  52402. // FORMATTING
  52403. addFormatToken('M', ['MM', 2], 'Mo', function () {
  52404. return this.month() + 1;
  52405. });
  52406. addFormatToken('MMM', 0, 0, function (format) {
  52407. return this.localeData().monthsShort(this, format);
  52408. });
  52409. addFormatToken('MMMM', 0, 0, function (format) {
  52410. return this.localeData().months(this, format);
  52411. });
  52412. // ALIASES
  52413. addUnitAlias('month', 'M');
  52414. // PRIORITY
  52415. addUnitPriority('month', 8);
  52416. // PARSING
  52417. addRegexToken('M', match1to2);
  52418. addRegexToken('MM', match1to2, match2);
  52419. addRegexToken('MMM', function (isStrict, locale) {
  52420. return locale.monthsShortRegex(isStrict);
  52421. });
  52422. addRegexToken('MMMM', function (isStrict, locale) {
  52423. return locale.monthsRegex(isStrict);
  52424. });
  52425. addParseToken(['M', 'MM'], function (input, array) {
  52426. array[MONTH] = toInt(input) - 1;
  52427. });
  52428. addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
  52429. var month = config._locale.monthsParse(input, token, config._strict);
  52430. // if we didn't find a month name, mark the date as invalid.
  52431. if (month != null) {
  52432. array[MONTH] = month;
  52433. } else {
  52434. getParsingFlags(config).invalidMonth = input;
  52435. }
  52436. });
  52437. // LOCALES
  52438. var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
  52439. '_'
  52440. ),
  52441. defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split(
  52442. '_'
  52443. ),
  52444. MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,
  52445. defaultMonthsShortRegex = matchWord,
  52446. defaultMonthsRegex = matchWord;
  52447. function localeMonths(m, format) {
  52448. if (!m) {
  52449. return isArray(this._months)
  52450. ? this._months
  52451. : this._months['standalone'];
  52452. }
  52453. return isArray(this._months)
  52454. ? this._months[m.month()]
  52455. : this._months[
  52456. (this._months.isFormat || MONTHS_IN_FORMAT).test(format)
  52457. ? 'format'
  52458. : 'standalone'
  52459. ][m.month()];
  52460. }
  52461. function localeMonthsShort(m, format) {
  52462. if (!m) {
  52463. return isArray(this._monthsShort)
  52464. ? this._monthsShort
  52465. : this._monthsShort['standalone'];
  52466. }
  52467. return isArray(this._monthsShort)
  52468. ? this._monthsShort[m.month()]
  52469. : this._monthsShort[
  52470. MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'
  52471. ][m.month()];
  52472. }
  52473. function handleStrictParse(monthName, format, strict) {
  52474. var i,
  52475. ii,
  52476. mom,
  52477. llc = monthName.toLocaleLowerCase();
  52478. if (!this._monthsParse) {
  52479. // this is not used
  52480. this._monthsParse = [];
  52481. this._longMonthsParse = [];
  52482. this._shortMonthsParse = [];
  52483. for (i = 0; i < 12; ++i) {
  52484. mom = createUTC([2000, i]);
  52485. this._shortMonthsParse[i] = this.monthsShort(
  52486. mom,
  52487. ''
  52488. ).toLocaleLowerCase();
  52489. this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
  52490. }
  52491. }
  52492. if (strict) {
  52493. if (format === 'MMM') {
  52494. ii = indexOf.call(this._shortMonthsParse, llc);
  52495. return ii !== -1 ? ii : null;
  52496. } else {
  52497. ii = indexOf.call(this._longMonthsParse, llc);
  52498. return ii !== -1 ? ii : null;
  52499. }
  52500. } else {
  52501. if (format === 'MMM') {
  52502. ii = indexOf.call(this._shortMonthsParse, llc);
  52503. if (ii !== -1) {
  52504. return ii;
  52505. }
  52506. ii = indexOf.call(this._longMonthsParse, llc);
  52507. return ii !== -1 ? ii : null;
  52508. } else {
  52509. ii = indexOf.call(this._longMonthsParse, llc);
  52510. if (ii !== -1) {
  52511. return ii;
  52512. }
  52513. ii = indexOf.call(this._shortMonthsParse, llc);
  52514. return ii !== -1 ? ii : null;
  52515. }
  52516. }
  52517. }
  52518. function localeMonthsParse(monthName, format, strict) {
  52519. var i, mom, regex;
  52520. if (this._monthsParseExact) {
  52521. return handleStrictParse.call(this, monthName, format, strict);
  52522. }
  52523. if (!this._monthsParse) {
  52524. this._monthsParse = [];
  52525. this._longMonthsParse = [];
  52526. this._shortMonthsParse = [];
  52527. }
  52528. // TODO: add sorting
  52529. // Sorting makes sure if one month (or abbr) is a prefix of another
  52530. // see sorting in computeMonthsParse
  52531. for (i = 0; i < 12; i++) {
  52532. // make the regex if we don't have it already
  52533. mom = createUTC([2000, i]);
  52534. if (strict && !this._longMonthsParse[i]) {
  52535. this._longMonthsParse[i] = new RegExp(
  52536. '^' + this.months(mom, '').replace('.', '') + '$',
  52537. 'i'
  52538. );
  52539. this._shortMonthsParse[i] = new RegExp(
  52540. '^' + this.monthsShort(mom, '').replace('.', '') + '$',
  52541. 'i'
  52542. );
  52543. }
  52544. if (!strict && !this._monthsParse[i]) {
  52545. regex =
  52546. '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
  52547. this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
  52548. }
  52549. // test the regex
  52550. if (
  52551. strict &&
  52552. format === 'MMMM' &&
  52553. this._longMonthsParse[i].test(monthName)
  52554. ) {
  52555. return i;
  52556. } else if (
  52557. strict &&
  52558. format === 'MMM' &&
  52559. this._shortMonthsParse[i].test(monthName)
  52560. ) {
  52561. return i;
  52562. } else if (!strict && this._monthsParse[i].test(monthName)) {
  52563. return i;
  52564. }
  52565. }
  52566. }
  52567. // MOMENTS
  52568. function setMonth(mom, value) {
  52569. var dayOfMonth;
  52570. if (!mom.isValid()) {
  52571. // No op
  52572. return mom;
  52573. }
  52574. if (typeof value === 'string') {
  52575. if (/^\d+$/.test(value)) {
  52576. value = toInt(value);
  52577. } else {
  52578. value = mom.localeData().monthsParse(value);
  52579. // TODO: Another silent failure?
  52580. if (!isNumber(value)) {
  52581. return mom;
  52582. }
  52583. }
  52584. }
  52585. dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
  52586. mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
  52587. return mom;
  52588. }
  52589. function getSetMonth(value) {
  52590. if (value != null) {
  52591. setMonth(this, value);
  52592. hooks.updateOffset(this, true);
  52593. return this;
  52594. } else {
  52595. return get(this, 'Month');
  52596. }
  52597. }
  52598. function getDaysInMonth() {
  52599. return daysInMonth(this.year(), this.month());
  52600. }
  52601. function monthsShortRegex(isStrict) {
  52602. if (this._monthsParseExact) {
  52603. if (!hasOwnProp(this, '_monthsRegex')) {
  52604. computeMonthsParse.call(this);
  52605. }
  52606. if (isStrict) {
  52607. return this._monthsShortStrictRegex;
  52608. } else {
  52609. return this._monthsShortRegex;
  52610. }
  52611. } else {
  52612. if (!hasOwnProp(this, '_monthsShortRegex')) {
  52613. this._monthsShortRegex = defaultMonthsShortRegex;
  52614. }
  52615. return this._monthsShortStrictRegex && isStrict
  52616. ? this._monthsShortStrictRegex
  52617. : this._monthsShortRegex;
  52618. }
  52619. }
  52620. function monthsRegex(isStrict) {
  52621. if (this._monthsParseExact) {
  52622. if (!hasOwnProp(this, '_monthsRegex')) {
  52623. computeMonthsParse.call(this);
  52624. }
  52625. if (isStrict) {
  52626. return this._monthsStrictRegex;
  52627. } else {
  52628. return this._monthsRegex;
  52629. }
  52630. } else {
  52631. if (!hasOwnProp(this, '_monthsRegex')) {
  52632. this._monthsRegex = defaultMonthsRegex;
  52633. }
  52634. return this._monthsStrictRegex && isStrict
  52635. ? this._monthsStrictRegex
  52636. : this._monthsRegex;
  52637. }
  52638. }
  52639. function computeMonthsParse() {
  52640. function cmpLenRev(a, b) {
  52641. return b.length - a.length;
  52642. }
  52643. var shortPieces = [],
  52644. longPieces = [],
  52645. mixedPieces = [],
  52646. i,
  52647. mom;
  52648. for (i = 0; i < 12; i++) {
  52649. // make the regex if we don't have it already
  52650. mom = createUTC([2000, i]);
  52651. shortPieces.push(this.monthsShort(mom, ''));
  52652. longPieces.push(this.months(mom, ''));
  52653. mixedPieces.push(this.months(mom, ''));
  52654. mixedPieces.push(this.monthsShort(mom, ''));
  52655. }
  52656. // Sorting makes sure if one month (or abbr) is a prefix of another it
  52657. // will match the longer piece.
  52658. shortPieces.sort(cmpLenRev);
  52659. longPieces.sort(cmpLenRev);
  52660. mixedPieces.sort(cmpLenRev);
  52661. for (i = 0; i < 12; i++) {
  52662. shortPieces[i] = regexEscape(shortPieces[i]);
  52663. longPieces[i] = regexEscape(longPieces[i]);
  52664. }
  52665. for (i = 0; i < 24; i++) {
  52666. mixedPieces[i] = regexEscape(mixedPieces[i]);
  52667. }
  52668. this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  52669. this._monthsShortRegex = this._monthsRegex;
  52670. this._monthsStrictRegex = new RegExp(
  52671. '^(' + longPieces.join('|') + ')',
  52672. 'i'
  52673. );
  52674. this._monthsShortStrictRegex = new RegExp(
  52675. '^(' + shortPieces.join('|') + ')',
  52676. 'i'
  52677. );
  52678. }
  52679. // FORMATTING
  52680. addFormatToken('Y', 0, 0, function () {
  52681. var y = this.year();
  52682. return y <= 9999 ? zeroFill(y, 4) : '+' + y;
  52683. });
  52684. addFormatToken(0, ['YY', 2], 0, function () {
  52685. return this.year() % 100;
  52686. });
  52687. addFormatToken(0, ['YYYY', 4], 0, 'year');
  52688. addFormatToken(0, ['YYYYY', 5], 0, 'year');
  52689. addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
  52690. // ALIASES
  52691. addUnitAlias('year', 'y');
  52692. // PRIORITIES
  52693. addUnitPriority('year', 1);
  52694. // PARSING
  52695. addRegexToken('Y', matchSigned);
  52696. addRegexToken('YY', match1to2, match2);
  52697. addRegexToken('YYYY', match1to4, match4);
  52698. addRegexToken('YYYYY', match1to6, match6);
  52699. addRegexToken('YYYYYY', match1to6, match6);
  52700. addParseToken(['YYYYY', 'YYYYYY'], YEAR);
  52701. addParseToken('YYYY', function (input, array) {
  52702. array[YEAR] =
  52703. input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
  52704. });
  52705. addParseToken('YY', function (input, array) {
  52706. array[YEAR] = hooks.parseTwoDigitYear(input);
  52707. });
  52708. addParseToken('Y', function (input, array) {
  52709. array[YEAR] = parseInt(input, 10);
  52710. });
  52711. // HELPERS
  52712. function daysInYear(year) {
  52713. return isLeapYear(year) ? 366 : 365;
  52714. }
  52715. // HOOKS
  52716. hooks.parseTwoDigitYear = function (input) {
  52717. return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
  52718. };
  52719. // MOMENTS
  52720. var getSetYear = makeGetSet('FullYear', true);
  52721. function getIsLeapYear() {
  52722. return isLeapYear(this.year());
  52723. }
  52724. function createDate(y, m, d, h, M, s, ms) {
  52725. // can't just apply() to create a date:
  52726. // https://stackoverflow.com/q/181348
  52727. var date;
  52728. // the date constructor remaps years 0-99 to 1900-1999
  52729. if (y < 100 && y >= 0) {
  52730. // preserve leap years using a full 400 year cycle, then reset
  52731. date = new Date(y + 400, m, d, h, M, s, ms);
  52732. if (isFinite(date.getFullYear())) {
  52733. date.setFullYear(y);
  52734. }
  52735. } else {
  52736. date = new Date(y, m, d, h, M, s, ms);
  52737. }
  52738. return date;
  52739. }
  52740. function createUTCDate(y) {
  52741. var date, args;
  52742. // the Date.UTC function remaps years 0-99 to 1900-1999
  52743. if (y < 100 && y >= 0) {
  52744. args = Array.prototype.slice.call(arguments);
  52745. // preserve leap years using a full 400 year cycle, then reset
  52746. args[0] = y + 400;
  52747. date = new Date(Date.UTC.apply(null, args));
  52748. if (isFinite(date.getUTCFullYear())) {
  52749. date.setUTCFullYear(y);
  52750. }
  52751. } else {
  52752. date = new Date(Date.UTC.apply(null, arguments));
  52753. }
  52754. return date;
  52755. }
  52756. // start-of-first-week - start-of-year
  52757. function firstWeekOffset(year, dow, doy) {
  52758. var // first-week day -- which january is always in the first week (4 for iso, 1 for other)
  52759. fwd = 7 + dow - doy,
  52760. // first-week day local weekday -- which local weekday is fwd
  52761. fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
  52762. return -fwdlw + fwd - 1;
  52763. }
  52764. // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
  52765. function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
  52766. var localWeekday = (7 + weekday - dow) % 7,
  52767. weekOffset = firstWeekOffset(year, dow, doy),
  52768. dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
  52769. resYear,
  52770. resDayOfYear;
  52771. if (dayOfYear <= 0) {
  52772. resYear = year - 1;
  52773. resDayOfYear = daysInYear(resYear) + dayOfYear;
  52774. } else if (dayOfYear > daysInYear(year)) {
  52775. resYear = year + 1;
  52776. resDayOfYear = dayOfYear - daysInYear(year);
  52777. } else {
  52778. resYear = year;
  52779. resDayOfYear = dayOfYear;
  52780. }
  52781. return {
  52782. year: resYear,
  52783. dayOfYear: resDayOfYear,
  52784. };
  52785. }
  52786. function weekOfYear(mom, dow, doy) {
  52787. var weekOffset = firstWeekOffset(mom.year(), dow, doy),
  52788. week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
  52789. resWeek,
  52790. resYear;
  52791. if (week < 1) {
  52792. resYear = mom.year() - 1;
  52793. resWeek = week + weeksInYear(resYear, dow, doy);
  52794. } else if (week > weeksInYear(mom.year(), dow, doy)) {
  52795. resWeek = week - weeksInYear(mom.year(), dow, doy);
  52796. resYear = mom.year() + 1;
  52797. } else {
  52798. resYear = mom.year();
  52799. resWeek = week;
  52800. }
  52801. return {
  52802. week: resWeek,
  52803. year: resYear,
  52804. };
  52805. }
  52806. function weeksInYear(year, dow, doy) {
  52807. var weekOffset = firstWeekOffset(year, dow, doy),
  52808. weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
  52809. return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
  52810. }
  52811. // FORMATTING
  52812. addFormatToken('w', ['ww', 2], 'wo', 'week');
  52813. addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
  52814. // ALIASES
  52815. addUnitAlias('week', 'w');
  52816. addUnitAlias('isoWeek', 'W');
  52817. // PRIORITIES
  52818. addUnitPriority('week', 5);
  52819. addUnitPriority('isoWeek', 5);
  52820. // PARSING
  52821. addRegexToken('w', match1to2);
  52822. addRegexToken('ww', match1to2, match2);
  52823. addRegexToken('W', match1to2);
  52824. addRegexToken('WW', match1to2, match2);
  52825. addWeekParseToken(['w', 'ww', 'W', 'WW'], function (
  52826. input,
  52827. week,
  52828. config,
  52829. token
  52830. ) {
  52831. week[token.substr(0, 1)] = toInt(input);
  52832. });
  52833. // HELPERS
  52834. // LOCALES
  52835. function localeWeek(mom) {
  52836. return weekOfYear(mom, this._week.dow, this._week.doy).week;
  52837. }
  52838. var defaultLocaleWeek = {
  52839. dow: 0, // Sunday is the first day of the week.
  52840. doy: 6, // The week that contains Jan 6th is the first week of the year.
  52841. };
  52842. function localeFirstDayOfWeek() {
  52843. return this._week.dow;
  52844. }
  52845. function localeFirstDayOfYear() {
  52846. return this._week.doy;
  52847. }
  52848. // MOMENTS
  52849. function getSetWeek(input) {
  52850. var week = this.localeData().week(this);
  52851. return input == null ? week : this.add((input - week) * 7, 'd');
  52852. }
  52853. function getSetISOWeek(input) {
  52854. var week = weekOfYear(this, 1, 4).week;
  52855. return input == null ? week : this.add((input - week) * 7, 'd');
  52856. }
  52857. // FORMATTING
  52858. addFormatToken('d', 0, 'do', 'day');
  52859. addFormatToken('dd', 0, 0, function (format) {
  52860. return this.localeData().weekdaysMin(this, format);
  52861. });
  52862. addFormatToken('ddd', 0, 0, function (format) {
  52863. return this.localeData().weekdaysShort(this, format);
  52864. });
  52865. addFormatToken('dddd', 0, 0, function (format) {
  52866. return this.localeData().weekdays(this, format);
  52867. });
  52868. addFormatToken('e', 0, 0, 'weekday');
  52869. addFormatToken('E', 0, 0, 'isoWeekday');
  52870. // ALIASES
  52871. addUnitAlias('day', 'd');
  52872. addUnitAlias('weekday', 'e');
  52873. addUnitAlias('isoWeekday', 'E');
  52874. // PRIORITY
  52875. addUnitPriority('day', 11);
  52876. addUnitPriority('weekday', 11);
  52877. addUnitPriority('isoWeekday', 11);
  52878. // PARSING
  52879. addRegexToken('d', match1to2);
  52880. addRegexToken('e', match1to2);
  52881. addRegexToken('E', match1to2);
  52882. addRegexToken('dd', function (isStrict, locale) {
  52883. return locale.weekdaysMinRegex(isStrict);
  52884. });
  52885. addRegexToken('ddd', function (isStrict, locale) {
  52886. return locale.weekdaysShortRegex(isStrict);
  52887. });
  52888. addRegexToken('dddd', function (isStrict, locale) {
  52889. return locale.weekdaysRegex(isStrict);
  52890. });
  52891. addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
  52892. var weekday = config._locale.weekdaysParse(input, token, config._strict);
  52893. // if we didn't get a weekday name, mark the date as invalid
  52894. if (weekday != null) {
  52895. week.d = weekday;
  52896. } else {
  52897. getParsingFlags(config).invalidWeekday = input;
  52898. }
  52899. });
  52900. addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
  52901. week[token] = toInt(input);
  52902. });
  52903. // HELPERS
  52904. function parseWeekday(input, locale) {
  52905. if (typeof input !== 'string') {
  52906. return input;
  52907. }
  52908. if (!isNaN(input)) {
  52909. return parseInt(input, 10);
  52910. }
  52911. input = locale.weekdaysParse(input);
  52912. if (typeof input === 'number') {
  52913. return input;
  52914. }
  52915. return null;
  52916. }
  52917. function parseIsoWeekday(input, locale) {
  52918. if (typeof input === 'string') {
  52919. return locale.weekdaysParse(input) % 7 || 7;
  52920. }
  52921. return isNaN(input) ? null : input;
  52922. }
  52923. // LOCALES
  52924. function shiftWeekdays(ws, n) {
  52925. return ws.slice(n, 7).concat(ws.slice(0, n));
  52926. }
  52927. var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
  52928. '_'
  52929. ),
  52930. defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  52931. defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  52932. defaultWeekdaysRegex = matchWord,
  52933. defaultWeekdaysShortRegex = matchWord,
  52934. defaultWeekdaysMinRegex = matchWord;
  52935. function localeWeekdays(m, format) {
  52936. var weekdays = isArray(this._weekdays)
  52937. ? this._weekdays
  52938. : this._weekdays[
  52939. m && m !== true && this._weekdays.isFormat.test(format)
  52940. ? 'format'
  52941. : 'standalone'
  52942. ];
  52943. return m === true
  52944. ? shiftWeekdays(weekdays, this._week.dow)
  52945. : m
  52946. ? weekdays[m.day()]
  52947. : weekdays;
  52948. }
  52949. function localeWeekdaysShort(m) {
  52950. return m === true
  52951. ? shiftWeekdays(this._weekdaysShort, this._week.dow)
  52952. : m
  52953. ? this._weekdaysShort[m.day()]
  52954. : this._weekdaysShort;
  52955. }
  52956. function localeWeekdaysMin(m) {
  52957. return m === true
  52958. ? shiftWeekdays(this._weekdaysMin, this._week.dow)
  52959. : m
  52960. ? this._weekdaysMin[m.day()]
  52961. : this._weekdaysMin;
  52962. }
  52963. function handleStrictParse$1(weekdayName, format, strict) {
  52964. var i,
  52965. ii,
  52966. mom,
  52967. llc = weekdayName.toLocaleLowerCase();
  52968. if (!this._weekdaysParse) {
  52969. this._weekdaysParse = [];
  52970. this._shortWeekdaysParse = [];
  52971. this._minWeekdaysParse = [];
  52972. for (i = 0; i < 7; ++i) {
  52973. mom = createUTC([2000, 1]).day(i);
  52974. this._minWeekdaysParse[i] = this.weekdaysMin(
  52975. mom,
  52976. ''
  52977. ).toLocaleLowerCase();
  52978. this._shortWeekdaysParse[i] = this.weekdaysShort(
  52979. mom,
  52980. ''
  52981. ).toLocaleLowerCase();
  52982. this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
  52983. }
  52984. }
  52985. if (strict) {
  52986. if (format === 'dddd') {
  52987. ii = indexOf.call(this._weekdaysParse, llc);
  52988. return ii !== -1 ? ii : null;
  52989. } else if (format === 'ddd') {
  52990. ii = indexOf.call(this._shortWeekdaysParse, llc);
  52991. return ii !== -1 ? ii : null;
  52992. } else {
  52993. ii = indexOf.call(this._minWeekdaysParse, llc);
  52994. return ii !== -1 ? ii : null;
  52995. }
  52996. } else {
  52997. if (format === 'dddd') {
  52998. ii = indexOf.call(this._weekdaysParse, llc);
  52999. if (ii !== -1) {
  53000. return ii;
  53001. }
  53002. ii = indexOf.call(this._shortWeekdaysParse, llc);
  53003. if (ii !== -1) {
  53004. return ii;
  53005. }
  53006. ii = indexOf.call(this._minWeekdaysParse, llc);
  53007. return ii !== -1 ? ii : null;
  53008. } else if (format === 'ddd') {
  53009. ii = indexOf.call(this._shortWeekdaysParse, llc);
  53010. if (ii !== -1) {
  53011. return ii;
  53012. }
  53013. ii = indexOf.call(this._weekdaysParse, llc);
  53014. if (ii !== -1) {
  53015. return ii;
  53016. }
  53017. ii = indexOf.call(this._minWeekdaysParse, llc);
  53018. return ii !== -1 ? ii : null;
  53019. } else {
  53020. ii = indexOf.call(this._minWeekdaysParse, llc);
  53021. if (ii !== -1) {
  53022. return ii;
  53023. }
  53024. ii = indexOf.call(this._weekdaysParse, llc);
  53025. if (ii !== -1) {
  53026. return ii;
  53027. }
  53028. ii = indexOf.call(this._shortWeekdaysParse, llc);
  53029. return ii !== -1 ? ii : null;
  53030. }
  53031. }
  53032. }
  53033. function localeWeekdaysParse(weekdayName, format, strict) {
  53034. var i, mom, regex;
  53035. if (this._weekdaysParseExact) {
  53036. return handleStrictParse$1.call(this, weekdayName, format, strict);
  53037. }
  53038. if (!this._weekdaysParse) {
  53039. this._weekdaysParse = [];
  53040. this._minWeekdaysParse = [];
  53041. this._shortWeekdaysParse = [];
  53042. this._fullWeekdaysParse = [];
  53043. }
  53044. for (i = 0; i < 7; i++) {
  53045. // make the regex if we don't have it already
  53046. mom = createUTC([2000, 1]).day(i);
  53047. if (strict && !this._fullWeekdaysParse[i]) {
  53048. this._fullWeekdaysParse[i] = new RegExp(
  53049. '^' + this.weekdays(mom, '').replace('.', '\\.?') + '$',
  53050. 'i'
  53051. );
  53052. this._shortWeekdaysParse[i] = new RegExp(
  53053. '^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$',
  53054. 'i'
  53055. );
  53056. this._minWeekdaysParse[i] = new RegExp(
  53057. '^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$',
  53058. 'i'
  53059. );
  53060. }
  53061. if (!this._weekdaysParse[i]) {
  53062. regex =
  53063. '^' +
  53064. this.weekdays(mom, '') +
  53065. '|^' +
  53066. this.weekdaysShort(mom, '') +
  53067. '|^' +
  53068. this.weekdaysMin(mom, '');
  53069. this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
  53070. }
  53071. // test the regex
  53072. if (
  53073. strict &&
  53074. format === 'dddd' &&
  53075. this._fullWeekdaysParse[i].test(weekdayName)
  53076. ) {
  53077. return i;
  53078. } else if (
  53079. strict &&
  53080. format === 'ddd' &&
  53081. this._shortWeekdaysParse[i].test(weekdayName)
  53082. ) {
  53083. return i;
  53084. } else if (
  53085. strict &&
  53086. format === 'dd' &&
  53087. this._minWeekdaysParse[i].test(weekdayName)
  53088. ) {
  53089. return i;
  53090. } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
  53091. return i;
  53092. }
  53093. }
  53094. }
  53095. // MOMENTS
  53096. function getSetDayOfWeek(input) {
  53097. if (!this.isValid()) {
  53098. return input != null ? this : NaN;
  53099. }
  53100. var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
  53101. if (input != null) {
  53102. input = parseWeekday(input, this.localeData());
  53103. return this.add(input - day, 'd');
  53104. } else {
  53105. return day;
  53106. }
  53107. }
  53108. function getSetLocaleDayOfWeek(input) {
  53109. if (!this.isValid()) {
  53110. return input != null ? this : NaN;
  53111. }
  53112. var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
  53113. return input == null ? weekday : this.add(input - weekday, 'd');
  53114. }
  53115. function getSetISODayOfWeek(input) {
  53116. if (!this.isValid()) {
  53117. return input != null ? this : NaN;
  53118. }
  53119. // behaves the same as moment#day except
  53120. // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
  53121. // as a setter, sunday should belong to the previous week.
  53122. if (input != null) {
  53123. var weekday = parseIsoWeekday(input, this.localeData());
  53124. return this.day(this.day() % 7 ? weekday : weekday - 7);
  53125. } else {
  53126. return this.day() || 7;
  53127. }
  53128. }
  53129. function weekdaysRegex(isStrict) {
  53130. if (this._weekdaysParseExact) {
  53131. if (!hasOwnProp(this, '_weekdaysRegex')) {
  53132. computeWeekdaysParse.call(this);
  53133. }
  53134. if (isStrict) {
  53135. return this._weekdaysStrictRegex;
  53136. } else {
  53137. return this._weekdaysRegex;
  53138. }
  53139. } else {
  53140. if (!hasOwnProp(this, '_weekdaysRegex')) {
  53141. this._weekdaysRegex = defaultWeekdaysRegex;
  53142. }
  53143. return this._weekdaysStrictRegex && isStrict
  53144. ? this._weekdaysStrictRegex
  53145. : this._weekdaysRegex;
  53146. }
  53147. }
  53148. function weekdaysShortRegex(isStrict) {
  53149. if (this._weekdaysParseExact) {
  53150. if (!hasOwnProp(this, '_weekdaysRegex')) {
  53151. computeWeekdaysParse.call(this);
  53152. }
  53153. if (isStrict) {
  53154. return this._weekdaysShortStrictRegex;
  53155. } else {
  53156. return this._weekdaysShortRegex;
  53157. }
  53158. } else {
  53159. if (!hasOwnProp(this, '_weekdaysShortRegex')) {
  53160. this._weekdaysShortRegex = defaultWeekdaysShortRegex;
  53161. }
  53162. return this._weekdaysShortStrictRegex && isStrict
  53163. ? this._weekdaysShortStrictRegex
  53164. : this._weekdaysShortRegex;
  53165. }
  53166. }
  53167. function weekdaysMinRegex(isStrict) {
  53168. if (this._weekdaysParseExact) {
  53169. if (!hasOwnProp(this, '_weekdaysRegex')) {
  53170. computeWeekdaysParse.call(this);
  53171. }
  53172. if (isStrict) {
  53173. return this._weekdaysMinStrictRegex;
  53174. } else {
  53175. return this._weekdaysMinRegex;
  53176. }
  53177. } else {
  53178. if (!hasOwnProp(this, '_weekdaysMinRegex')) {
  53179. this._weekdaysMinRegex = defaultWeekdaysMinRegex;
  53180. }
  53181. return this._weekdaysMinStrictRegex && isStrict
  53182. ? this._weekdaysMinStrictRegex
  53183. : this._weekdaysMinRegex;
  53184. }
  53185. }
  53186. function computeWeekdaysParse() {
  53187. function cmpLenRev(a, b) {
  53188. return b.length - a.length;
  53189. }
  53190. var minPieces = [],
  53191. shortPieces = [],
  53192. longPieces = [],
  53193. mixedPieces = [],
  53194. i,
  53195. mom,
  53196. minp,
  53197. shortp,
  53198. longp;
  53199. for (i = 0; i < 7; i++) {
  53200. // make the regex if we don't have it already
  53201. mom = createUTC([2000, 1]).day(i);
  53202. minp = regexEscape(this.weekdaysMin(mom, ''));
  53203. shortp = regexEscape(this.weekdaysShort(mom, ''));
  53204. longp = regexEscape(this.weekdays(mom, ''));
  53205. minPieces.push(minp);
  53206. shortPieces.push(shortp);
  53207. longPieces.push(longp);
  53208. mixedPieces.push(minp);
  53209. mixedPieces.push(shortp);
  53210. mixedPieces.push(longp);
  53211. }
  53212. // Sorting makes sure if one weekday (or abbr) is a prefix of another it
  53213. // will match the longer piece.
  53214. minPieces.sort(cmpLenRev);
  53215. shortPieces.sort(cmpLenRev);
  53216. longPieces.sort(cmpLenRev);
  53217. mixedPieces.sort(cmpLenRev);
  53218. this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  53219. this._weekdaysShortRegex = this._weekdaysRegex;
  53220. this._weekdaysMinRegex = this._weekdaysRegex;
  53221. this._weekdaysStrictRegex = new RegExp(
  53222. '^(' + longPieces.join('|') + ')',
  53223. 'i'
  53224. );
  53225. this._weekdaysShortStrictRegex = new RegExp(
  53226. '^(' + shortPieces.join('|') + ')',
  53227. 'i'
  53228. );
  53229. this._weekdaysMinStrictRegex = new RegExp(
  53230. '^(' + minPieces.join('|') + ')',
  53231. 'i'
  53232. );
  53233. }
  53234. // FORMATTING
  53235. function hFormat() {
  53236. return this.hours() % 12 || 12;
  53237. }
  53238. function kFormat() {
  53239. return this.hours() || 24;
  53240. }
  53241. addFormatToken('H', ['HH', 2], 0, 'hour');
  53242. addFormatToken('h', ['hh', 2], 0, hFormat);
  53243. addFormatToken('k', ['kk', 2], 0, kFormat);
  53244. addFormatToken('hmm', 0, 0, function () {
  53245. return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
  53246. });
  53247. addFormatToken('hmmss', 0, 0, function () {
  53248. return (
  53249. '' +
  53250. hFormat.apply(this) +
  53251. zeroFill(this.minutes(), 2) +
  53252. zeroFill(this.seconds(), 2)
  53253. );
  53254. });
  53255. addFormatToken('Hmm', 0, 0, function () {
  53256. return '' + this.hours() + zeroFill(this.minutes(), 2);
  53257. });
  53258. addFormatToken('Hmmss', 0, 0, function () {
  53259. return (
  53260. '' +
  53261. this.hours() +
  53262. zeroFill(this.minutes(), 2) +
  53263. zeroFill(this.seconds(), 2)
  53264. );
  53265. });
  53266. function meridiem(token, lowercase) {
  53267. addFormatToken(token, 0, 0, function () {
  53268. return this.localeData().meridiem(
  53269. this.hours(),
  53270. this.minutes(),
  53271. lowercase
  53272. );
  53273. });
  53274. }
  53275. meridiem('a', true);
  53276. meridiem('A', false);
  53277. // ALIASES
  53278. addUnitAlias('hour', 'h');
  53279. // PRIORITY
  53280. addUnitPriority('hour', 13);
  53281. // PARSING
  53282. function matchMeridiem(isStrict, locale) {
  53283. return locale._meridiemParse;
  53284. }
  53285. addRegexToken('a', matchMeridiem);
  53286. addRegexToken('A', matchMeridiem);
  53287. addRegexToken('H', match1to2);
  53288. addRegexToken('h', match1to2);
  53289. addRegexToken('k', match1to2);
  53290. addRegexToken('HH', match1to2, match2);
  53291. addRegexToken('hh', match1to2, match2);
  53292. addRegexToken('kk', match1to2, match2);
  53293. addRegexToken('hmm', match3to4);
  53294. addRegexToken('hmmss', match5to6);
  53295. addRegexToken('Hmm', match3to4);
  53296. addRegexToken('Hmmss', match5to6);
  53297. addParseToken(['H', 'HH'], HOUR);
  53298. addParseToken(['k', 'kk'], function (input, array, config) {
  53299. var kInput = toInt(input);
  53300. array[HOUR] = kInput === 24 ? 0 : kInput;
  53301. });
  53302. addParseToken(['a', 'A'], function (input, array, config) {
  53303. config._isPm = config._locale.isPM(input);
  53304. config._meridiem = input;
  53305. });
  53306. addParseToken(['h', 'hh'], function (input, array, config) {
  53307. array[HOUR] = toInt(input);
  53308. getParsingFlags(config).bigHour = true;
  53309. });
  53310. addParseToken('hmm', function (input, array, config) {
  53311. var pos = input.length - 2;
  53312. array[HOUR] = toInt(input.substr(0, pos));
  53313. array[MINUTE] = toInt(input.substr(pos));
  53314. getParsingFlags(config).bigHour = true;
  53315. });
  53316. addParseToken('hmmss', function (input, array, config) {
  53317. var pos1 = input.length - 4,
  53318. pos2 = input.length - 2;
  53319. array[HOUR] = toInt(input.substr(0, pos1));
  53320. array[MINUTE] = toInt(input.substr(pos1, 2));
  53321. array[SECOND] = toInt(input.substr(pos2));
  53322. getParsingFlags(config).bigHour = true;
  53323. });
  53324. addParseToken('Hmm', function (input, array, config) {
  53325. var pos = input.length - 2;
  53326. array[HOUR] = toInt(input.substr(0, pos));
  53327. array[MINUTE] = toInt(input.substr(pos));
  53328. });
  53329. addParseToken('Hmmss', function (input, array, config) {
  53330. var pos1 = input.length - 4,
  53331. pos2 = input.length - 2;
  53332. array[HOUR] = toInt(input.substr(0, pos1));
  53333. array[MINUTE] = toInt(input.substr(pos1, 2));
  53334. array[SECOND] = toInt(input.substr(pos2));
  53335. });
  53336. // LOCALES
  53337. function localeIsPM(input) {
  53338. // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
  53339. // Using charAt should be more compatible.
  53340. return (input + '').toLowerCase().charAt(0) === 'p';
  53341. }
  53342. var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i,
  53343. // Setting the hour should keep the time, because the user explicitly
  53344. // specified which hour they want. So trying to maintain the same hour (in
  53345. // a new timezone) makes sense. Adding/subtracting hours does not follow
  53346. // this rule.
  53347. getSetHour = makeGetSet('Hours', true);
  53348. function localeMeridiem(hours, minutes, isLower) {
  53349. if (hours > 11) {
  53350. return isLower ? 'pm' : 'PM';
  53351. } else {
  53352. return isLower ? 'am' : 'AM';
  53353. }
  53354. }
  53355. var baseConfig = {
  53356. calendar: defaultCalendar,
  53357. longDateFormat: defaultLongDateFormat,
  53358. invalidDate: defaultInvalidDate,
  53359. ordinal: defaultOrdinal,
  53360. dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,
  53361. relativeTime: defaultRelativeTime,
  53362. months: defaultLocaleMonths,
  53363. monthsShort: defaultLocaleMonthsShort,
  53364. week: defaultLocaleWeek,
  53365. weekdays: defaultLocaleWeekdays,
  53366. weekdaysMin: defaultLocaleWeekdaysMin,
  53367. weekdaysShort: defaultLocaleWeekdaysShort,
  53368. meridiemParse: defaultLocaleMeridiemParse,
  53369. };
  53370. // internal storage for locale config files
  53371. var locales = {},
  53372. localeFamilies = {},
  53373. globalLocale;
  53374. function commonPrefix(arr1, arr2) {
  53375. var i,
  53376. minl = Math.min(arr1.length, arr2.length);
  53377. for (i = 0; i < minl; i += 1) {
  53378. if (arr1[i] !== arr2[i]) {
  53379. return i;
  53380. }
  53381. }
  53382. return minl;
  53383. }
  53384. function normalizeLocale(key) {
  53385. return key ? key.toLowerCase().replace('_', '-') : key;
  53386. }
  53387. // pick the locale from the array
  53388. // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
  53389. // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
  53390. function chooseLocale(names) {
  53391. var i = 0,
  53392. j,
  53393. next,
  53394. locale,
  53395. split;
  53396. while (i < names.length) {
  53397. split = normalizeLocale(names[i]).split('-');
  53398. j = split.length;
  53399. next = normalizeLocale(names[i + 1]);
  53400. next = next ? next.split('-') : null;
  53401. while (j > 0) {
  53402. locale = loadLocale(split.slice(0, j).join('-'));
  53403. if (locale) {
  53404. return locale;
  53405. }
  53406. if (
  53407. next &&
  53408. next.length >= j &&
  53409. commonPrefix(split, next) >= j - 1
  53410. ) {
  53411. //the next array item is better than a shallower substring of this one
  53412. break;
  53413. }
  53414. j--;
  53415. }
  53416. i++;
  53417. }
  53418. return globalLocale;
  53419. }
  53420. function loadLocale(name) {
  53421. var oldLocale = null,
  53422. aliasedRequire;
  53423. // TODO: Find a better way to register and load all the locales in Node
  53424. if (
  53425. locales[name] === undefined &&
  53426. typeof module !== 'undefined' &&
  53427. module &&
  53428. module.exports
  53429. ) {
  53430. try {
  53431. oldLocale = globalLocale._abbr;
  53432. aliasedRequire = require;
  53433. __webpack_require__("./node_modules/moment/locale sync recursive ^\\.\\/.*$")("./" + name);
  53434. getSetGlobalLocale(oldLocale);
  53435. } catch (e) {
  53436. // mark as not found to avoid repeating expensive file require call causing high CPU
  53437. // when trying to find en-US, en_US, en-us for every format call
  53438. locales[name] = null; // null means not found
  53439. }
  53440. }
  53441. return locales[name];
  53442. }
  53443. // This function will load locale and then set the global locale. If
  53444. // no arguments are passed in, it will simply return the current global
  53445. // locale key.
  53446. function getSetGlobalLocale(key, values) {
  53447. var data;
  53448. if (key) {
  53449. if (isUndefined(values)) {
  53450. data = getLocale(key);
  53451. } else {
  53452. data = defineLocale(key, values);
  53453. }
  53454. if (data) {
  53455. // moment.duration._locale = moment._locale = data;
  53456. globalLocale = data;
  53457. } else {
  53458. if (typeof console !== 'undefined' && console.warn) {
  53459. //warn user if arguments are passed but the locale could not be set
  53460. console.warn(
  53461. 'Locale ' + key + ' not found. Did you forget to load it?'
  53462. );
  53463. }
  53464. }
  53465. }
  53466. return globalLocale._abbr;
  53467. }
  53468. function defineLocale(name, config) {
  53469. if (config !== null) {
  53470. var locale,
  53471. parentConfig = baseConfig;
  53472. config.abbr = name;
  53473. if (locales[name] != null) {
  53474. deprecateSimple(
  53475. 'defineLocaleOverride',
  53476. 'use moment.updateLocale(localeName, config) to change ' +
  53477. 'an existing locale. moment.defineLocale(localeName, ' +
  53478. 'config) should only be used for creating a new locale ' +
  53479. 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.'
  53480. );
  53481. parentConfig = locales[name]._config;
  53482. } else if (config.parentLocale != null) {
  53483. if (locales[config.parentLocale] != null) {
  53484. parentConfig = locales[config.parentLocale]._config;
  53485. } else {
  53486. locale = loadLocale(config.parentLocale);
  53487. if (locale != null) {
  53488. parentConfig = locale._config;
  53489. } else {
  53490. if (!localeFamilies[config.parentLocale]) {
  53491. localeFamilies[config.parentLocale] = [];
  53492. }
  53493. localeFamilies[config.parentLocale].push({
  53494. name: name,
  53495. config: config,
  53496. });
  53497. return null;
  53498. }
  53499. }
  53500. }
  53501. locales[name] = new Locale(mergeConfigs(parentConfig, config));
  53502. if (localeFamilies[name]) {
  53503. localeFamilies[name].forEach(function (x) {
  53504. defineLocale(x.name, x.config);
  53505. });
  53506. }
  53507. // backwards compat for now: also set the locale
  53508. // make sure we set the locale AFTER all child locales have been
  53509. // created, so we won't end up with the child locale set.
  53510. getSetGlobalLocale(name);
  53511. return locales[name];
  53512. } else {
  53513. // useful for testing
  53514. delete locales[name];
  53515. return null;
  53516. }
  53517. }
  53518. function updateLocale(name, config) {
  53519. if (config != null) {
  53520. var locale,
  53521. tmpLocale,
  53522. parentConfig = baseConfig;
  53523. if (locales[name] != null && locales[name].parentLocale != null) {
  53524. // Update existing child locale in-place to avoid memory-leaks
  53525. locales[name].set(mergeConfigs(locales[name]._config, config));
  53526. } else {
  53527. // MERGE
  53528. tmpLocale = loadLocale(name);
  53529. if (tmpLocale != null) {
  53530. parentConfig = tmpLocale._config;
  53531. }
  53532. config = mergeConfigs(parentConfig, config);
  53533. if (tmpLocale == null) {
  53534. // updateLocale is called for creating a new locale
  53535. // Set abbr so it will have a name (getters return
  53536. // undefined otherwise).
  53537. config.abbr = name;
  53538. }
  53539. locale = new Locale(config);
  53540. locale.parentLocale = locales[name];
  53541. locales[name] = locale;
  53542. }
  53543. // backwards compat for now: also set the locale
  53544. getSetGlobalLocale(name);
  53545. } else {
  53546. // pass null for config to unupdate, useful for tests
  53547. if (locales[name] != null) {
  53548. if (locales[name].parentLocale != null) {
  53549. locales[name] = locales[name].parentLocale;
  53550. if (name === getSetGlobalLocale()) {
  53551. getSetGlobalLocale(name);
  53552. }
  53553. } else if (locales[name] != null) {
  53554. delete locales[name];
  53555. }
  53556. }
  53557. }
  53558. return locales[name];
  53559. }
  53560. // returns locale data
  53561. function getLocale(key) {
  53562. var locale;
  53563. if (key && key._locale && key._locale._abbr) {
  53564. key = key._locale._abbr;
  53565. }
  53566. if (!key) {
  53567. return globalLocale;
  53568. }
  53569. if (!isArray(key)) {
  53570. //short-circuit everything else
  53571. locale = loadLocale(key);
  53572. if (locale) {
  53573. return locale;
  53574. }
  53575. key = [key];
  53576. }
  53577. return chooseLocale(key);
  53578. }
  53579. function listLocales() {
  53580. return keys(locales);
  53581. }
  53582. function checkOverflow(m) {
  53583. var overflow,
  53584. a = m._a;
  53585. if (a && getParsingFlags(m).overflow === -2) {
  53586. overflow =
  53587. a[MONTH] < 0 || a[MONTH] > 11
  53588. ? MONTH
  53589. : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH])
  53590. ? DATE
  53591. : a[HOUR] < 0 ||
  53592. a[HOUR] > 24 ||
  53593. (a[HOUR] === 24 &&
  53594. (a[MINUTE] !== 0 ||
  53595. a[SECOND] !== 0 ||
  53596. a[MILLISECOND] !== 0))
  53597. ? HOUR
  53598. : a[MINUTE] < 0 || a[MINUTE] > 59
  53599. ? MINUTE
  53600. : a[SECOND] < 0 || a[SECOND] > 59
  53601. ? SECOND
  53602. : a[MILLISECOND] < 0 || a[MILLISECOND] > 999
  53603. ? MILLISECOND
  53604. : -1;
  53605. if (
  53606. getParsingFlags(m)._overflowDayOfYear &&
  53607. (overflow < YEAR || overflow > DATE)
  53608. ) {
  53609. overflow = DATE;
  53610. }
  53611. if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
  53612. overflow = WEEK;
  53613. }
  53614. if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
  53615. overflow = WEEKDAY;
  53616. }
  53617. getParsingFlags(m).overflow = overflow;
  53618. }
  53619. return m;
  53620. }
  53621. // iso 8601 regex
  53622. // 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)
  53623. 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)?)?$/,
  53624. 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)?)?$/,
  53625. tzRegex = /Z|[+-]\d\d(?::?\d\d)?/,
  53626. isoDates = [
  53627. ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
  53628. ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/],
  53629. ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/],
  53630. ['GGGG-[W]WW', /\d{4}-W\d\d/, false],
  53631. ['YYYY-DDD', /\d{4}-\d{3}/],
  53632. ['YYYY-MM', /\d{4}-\d\d/, false],
  53633. ['YYYYYYMMDD', /[+-]\d{10}/],
  53634. ['YYYYMMDD', /\d{8}/],
  53635. ['GGGG[W]WWE', /\d{4}W\d{3}/],
  53636. ['GGGG[W]WW', /\d{4}W\d{2}/, false],
  53637. ['YYYYDDD', /\d{7}/],
  53638. ['YYYYMM', /\d{6}/, false],
  53639. ['YYYY', /\d{4}/, false],
  53640. ],
  53641. // iso time formats and regexes
  53642. isoTimes = [
  53643. ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/],
  53644. ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/],
  53645. ['HH:mm:ss', /\d\d:\d\d:\d\d/],
  53646. ['HH:mm', /\d\d:\d\d/],
  53647. ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/],
  53648. ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/],
  53649. ['HHmmss', /\d\d\d\d\d\d/],
  53650. ['HHmm', /\d\d\d\d/],
  53651. ['HH', /\d\d/],
  53652. ],
  53653. aspNetJsonRegex = /^\/?Date\((-?\d+)/i,
  53654. // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3
  53655. rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,
  53656. obsOffsets = {
  53657. UT: 0,
  53658. GMT: 0,
  53659. EDT: -4 * 60,
  53660. EST: -5 * 60,
  53661. CDT: -5 * 60,
  53662. CST: -6 * 60,
  53663. MDT: -6 * 60,
  53664. MST: -7 * 60,
  53665. PDT: -7 * 60,
  53666. PST: -8 * 60,
  53667. };
  53668. // date from iso format
  53669. function configFromISO(config) {
  53670. var i,
  53671. l,
  53672. string = config._i,
  53673. match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
  53674. allowTime,
  53675. dateFormat,
  53676. timeFormat,
  53677. tzFormat;
  53678. if (match) {
  53679. getParsingFlags(config).iso = true;
  53680. for (i = 0, l = isoDates.length; i < l; i++) {
  53681. if (isoDates[i][1].exec(match[1])) {
  53682. dateFormat = isoDates[i][0];
  53683. allowTime = isoDates[i][2] !== false;
  53684. break;
  53685. }
  53686. }
  53687. if (dateFormat == null) {
  53688. config._isValid = false;
  53689. return;
  53690. }
  53691. if (match[3]) {
  53692. for (i = 0, l = isoTimes.length; i < l; i++) {
  53693. if (isoTimes[i][1].exec(match[3])) {
  53694. // match[2] should be 'T' or space
  53695. timeFormat = (match[2] || ' ') + isoTimes[i][0];
  53696. break;
  53697. }
  53698. }
  53699. if (timeFormat == null) {
  53700. config._isValid = false;
  53701. return;
  53702. }
  53703. }
  53704. if (!allowTime && timeFormat != null) {
  53705. config._isValid = false;
  53706. return;
  53707. }
  53708. if (match[4]) {
  53709. if (tzRegex.exec(match[4])) {
  53710. tzFormat = 'Z';
  53711. } else {
  53712. config._isValid = false;
  53713. return;
  53714. }
  53715. }
  53716. config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
  53717. configFromStringAndFormat(config);
  53718. } else {
  53719. config._isValid = false;
  53720. }
  53721. }
  53722. function extractFromRFC2822Strings(
  53723. yearStr,
  53724. monthStr,
  53725. dayStr,
  53726. hourStr,
  53727. minuteStr,
  53728. secondStr
  53729. ) {
  53730. var result = [
  53731. untruncateYear(yearStr),
  53732. defaultLocaleMonthsShort.indexOf(monthStr),
  53733. parseInt(dayStr, 10),
  53734. parseInt(hourStr, 10),
  53735. parseInt(minuteStr, 10),
  53736. ];
  53737. if (secondStr) {
  53738. result.push(parseInt(secondStr, 10));
  53739. }
  53740. return result;
  53741. }
  53742. function untruncateYear(yearStr) {
  53743. var year = parseInt(yearStr, 10);
  53744. if (year <= 49) {
  53745. return 2000 + year;
  53746. } else if (year <= 999) {
  53747. return 1900 + year;
  53748. }
  53749. return year;
  53750. }
  53751. function preprocessRFC2822(s) {
  53752. // Remove comments and folding whitespace and replace multiple-spaces with a single space
  53753. return s
  53754. .replace(/\([^)]*\)|[\n\t]/g, ' ')
  53755. .replace(/(\s\s+)/g, ' ')
  53756. .replace(/^\s\s*/, '')
  53757. .replace(/\s\s*$/, '');
  53758. }
  53759. function checkWeekday(weekdayStr, parsedInput, config) {
  53760. if (weekdayStr) {
  53761. // TODO: Replace the vanilla JS Date object with an independent day-of-week check.
  53762. var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),
  53763. weekdayActual = new Date(
  53764. parsedInput[0],
  53765. parsedInput[1],
  53766. parsedInput[2]
  53767. ).getDay();
  53768. if (weekdayProvided !== weekdayActual) {
  53769. getParsingFlags(config).weekdayMismatch = true;
  53770. config._isValid = false;
  53771. return false;
  53772. }
  53773. }
  53774. return true;
  53775. }
  53776. function calculateOffset(obsOffset, militaryOffset, numOffset) {
  53777. if (obsOffset) {
  53778. return obsOffsets[obsOffset];
  53779. } else if (militaryOffset) {
  53780. // the only allowed military tz is Z
  53781. return 0;
  53782. } else {
  53783. var hm = parseInt(numOffset, 10),
  53784. m = hm % 100,
  53785. h = (hm - m) / 100;
  53786. return h * 60 + m;
  53787. }
  53788. }
  53789. // date and time from ref 2822 format
  53790. function configFromRFC2822(config) {
  53791. var match = rfc2822.exec(preprocessRFC2822(config._i)),
  53792. parsedArray;
  53793. if (match) {
  53794. parsedArray = extractFromRFC2822Strings(
  53795. match[4],
  53796. match[3],
  53797. match[2],
  53798. match[5],
  53799. match[6],
  53800. match[7]
  53801. );
  53802. if (!checkWeekday(match[1], parsedArray, config)) {
  53803. return;
  53804. }
  53805. config._a = parsedArray;
  53806. config._tzm = calculateOffset(match[8], match[9], match[10]);
  53807. config._d = createUTCDate.apply(null, config._a);
  53808. config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
  53809. getParsingFlags(config).rfc2822 = true;
  53810. } else {
  53811. config._isValid = false;
  53812. }
  53813. }
  53814. // date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict
  53815. function configFromString(config) {
  53816. var matched = aspNetJsonRegex.exec(config._i);
  53817. if (matched !== null) {
  53818. config._d = new Date(+matched[1]);
  53819. return;
  53820. }
  53821. configFromISO(config);
  53822. if (config._isValid === false) {
  53823. delete config._isValid;
  53824. } else {
  53825. return;
  53826. }
  53827. configFromRFC2822(config);
  53828. if (config._isValid === false) {
  53829. delete config._isValid;
  53830. } else {
  53831. return;
  53832. }
  53833. if (config._strict) {
  53834. config._isValid = false;
  53835. } else {
  53836. // Final attempt, use Input Fallback
  53837. hooks.createFromInputFallback(config);
  53838. }
  53839. }
  53840. hooks.createFromInputFallback = deprecate(
  53841. 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +
  53842. 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +
  53843. 'discouraged and will be removed in an upcoming major release. Please refer to ' +
  53844. 'http://momentjs.com/guides/#/warnings/js-date/ for more info.',
  53845. function (config) {
  53846. config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
  53847. }
  53848. );
  53849. // Pick the first defined of two or three arguments.
  53850. function defaults(a, b, c) {
  53851. if (a != null) {
  53852. return a;
  53853. }
  53854. if (b != null) {
  53855. return b;
  53856. }
  53857. return c;
  53858. }
  53859. function currentDateArray(config) {
  53860. // hooks is actually the exported moment object
  53861. var nowValue = new Date(hooks.now());
  53862. if (config._useUTC) {
  53863. return [
  53864. nowValue.getUTCFullYear(),
  53865. nowValue.getUTCMonth(),
  53866. nowValue.getUTCDate(),
  53867. ];
  53868. }
  53869. return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
  53870. }
  53871. // convert an array to a date.
  53872. // the array should mirror the parameters below
  53873. // note: all values past the year are optional and will default to the lowest possible value.
  53874. // [year, month, day , hour, minute, second, millisecond]
  53875. function configFromArray(config) {
  53876. var i,
  53877. date,
  53878. input = [],
  53879. currentDate,
  53880. expectedWeekday,
  53881. yearToUse;
  53882. if (config._d) {
  53883. return;
  53884. }
  53885. currentDate = currentDateArray(config);
  53886. //compute day of the year from weeks and weekdays
  53887. if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
  53888. dayOfYearFromWeekInfo(config);
  53889. }
  53890. //if the day of the year is set, figure out what it is
  53891. if (config._dayOfYear != null) {
  53892. yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
  53893. if (
  53894. config._dayOfYear > daysInYear(yearToUse) ||
  53895. config._dayOfYear === 0
  53896. ) {
  53897. getParsingFlags(config)._overflowDayOfYear = true;
  53898. }
  53899. date = createUTCDate(yearToUse, 0, config._dayOfYear);
  53900. config._a[MONTH] = date.getUTCMonth();
  53901. config._a[DATE] = date.getUTCDate();
  53902. }
  53903. // Default to current date.
  53904. // * if no year, month, day of month are given, default to today
  53905. // * if day of month is given, default month and year
  53906. // * if month is given, default only year
  53907. // * if year is given, don't default anything
  53908. for (i = 0; i < 3 && config._a[i] == null; ++i) {
  53909. config._a[i] = input[i] = currentDate[i];
  53910. }
  53911. // Zero out whatever was not defaulted, including time
  53912. for (; i < 7; i++) {
  53913. config._a[i] = input[i] =
  53914. config._a[i] == null ? (i === 2 ? 1 : 0) : config._a[i];
  53915. }
  53916. // Check for 24:00:00.000
  53917. if (
  53918. config._a[HOUR] === 24 &&
  53919. config._a[MINUTE] === 0 &&
  53920. config._a[SECOND] === 0 &&
  53921. config._a[MILLISECOND] === 0
  53922. ) {
  53923. config._nextDay = true;
  53924. config._a[HOUR] = 0;
  53925. }
  53926. config._d = (config._useUTC ? createUTCDate : createDate).apply(
  53927. null,
  53928. input
  53929. );
  53930. expectedWeekday = config._useUTC
  53931. ? config._d.getUTCDay()
  53932. : config._d.getDay();
  53933. // Apply timezone offset from input. The actual utcOffset can be changed
  53934. // with parseZone.
  53935. if (config._tzm != null) {
  53936. config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
  53937. }
  53938. if (config._nextDay) {
  53939. config._a[HOUR] = 24;
  53940. }
  53941. // check for mismatching day of week
  53942. if (
  53943. config._w &&
  53944. typeof config._w.d !== 'undefined' &&
  53945. config._w.d !== expectedWeekday
  53946. ) {
  53947. getParsingFlags(config).weekdayMismatch = true;
  53948. }
  53949. }
  53950. function dayOfYearFromWeekInfo(config) {
  53951. var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek;
  53952. w = config._w;
  53953. if (w.GG != null || w.W != null || w.E != null) {
  53954. dow = 1;
  53955. doy = 4;
  53956. // TODO: We need to take the current isoWeekYear, but that depends on
  53957. // how we interpret now (local, utc, fixed offset). So create
  53958. // a now version of current config (take local/utc/offset flags, and
  53959. // create now).
  53960. weekYear = defaults(
  53961. w.GG,
  53962. config._a[YEAR],
  53963. weekOfYear(createLocal(), 1, 4).year
  53964. );
  53965. week = defaults(w.W, 1);
  53966. weekday = defaults(w.E, 1);
  53967. if (weekday < 1 || weekday > 7) {
  53968. weekdayOverflow = true;
  53969. }
  53970. } else {
  53971. dow = config._locale._week.dow;
  53972. doy = config._locale._week.doy;
  53973. curWeek = weekOfYear(createLocal(), dow, doy);
  53974. weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
  53975. // Default to current week.
  53976. week = defaults(w.w, curWeek.week);
  53977. if (w.d != null) {
  53978. // weekday -- low day numbers are considered next week
  53979. weekday = w.d;
  53980. if (weekday < 0 || weekday > 6) {
  53981. weekdayOverflow = true;
  53982. }
  53983. } else if (w.e != null) {
  53984. // local weekday -- counting starts from beginning of week
  53985. weekday = w.e + dow;
  53986. if (w.e < 0 || w.e > 6) {
  53987. weekdayOverflow = true;
  53988. }
  53989. } else {
  53990. // default to beginning of week
  53991. weekday = dow;
  53992. }
  53993. }
  53994. if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
  53995. getParsingFlags(config)._overflowWeeks = true;
  53996. } else if (weekdayOverflow != null) {
  53997. getParsingFlags(config)._overflowWeekday = true;
  53998. } else {
  53999. temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
  54000. config._a[YEAR] = temp.year;
  54001. config._dayOfYear = temp.dayOfYear;
  54002. }
  54003. }
  54004. // constant that refers to the ISO standard
  54005. hooks.ISO_8601 = function () {};
  54006. // constant that refers to the RFC 2822 form
  54007. hooks.RFC_2822 = function () {};
  54008. // date from string and format string
  54009. function configFromStringAndFormat(config) {
  54010. // TODO: Move this to another part of the creation flow to prevent circular deps
  54011. if (config._f === hooks.ISO_8601) {
  54012. configFromISO(config);
  54013. return;
  54014. }
  54015. if (config._f === hooks.RFC_2822) {
  54016. configFromRFC2822(config);
  54017. return;
  54018. }
  54019. config._a = [];
  54020. getParsingFlags(config).empty = true;
  54021. // This array is used to make a Date, either with `new Date` or `Date.UTC`
  54022. var string = '' + config._i,
  54023. i,
  54024. parsedInput,
  54025. tokens,
  54026. token,
  54027. skipped,
  54028. stringLength = string.length,
  54029. totalParsedInputLength = 0,
  54030. era;
  54031. tokens =
  54032. expandFormat(config._f, config._locale).match(formattingTokens) || [];
  54033. for (i = 0; i < tokens.length; i++) {
  54034. token = tokens[i];
  54035. parsedInput = (string.match(getParseRegexForToken(token, config)) ||
  54036. [])[0];
  54037. if (parsedInput) {
  54038. skipped = string.substr(0, string.indexOf(parsedInput));
  54039. if (skipped.length > 0) {
  54040. getParsingFlags(config).unusedInput.push(skipped);
  54041. }
  54042. string = string.slice(
  54043. string.indexOf(parsedInput) + parsedInput.length
  54044. );
  54045. totalParsedInputLength += parsedInput.length;
  54046. }
  54047. // don't parse if it's not a known token
  54048. if (formatTokenFunctions[token]) {
  54049. if (parsedInput) {
  54050. getParsingFlags(config).empty = false;
  54051. } else {
  54052. getParsingFlags(config).unusedTokens.push(token);
  54053. }
  54054. addTimeToArrayFromToken(token, parsedInput, config);
  54055. } else if (config._strict && !parsedInput) {
  54056. getParsingFlags(config).unusedTokens.push(token);
  54057. }
  54058. }
  54059. // add remaining unparsed input length to the string
  54060. getParsingFlags(config).charsLeftOver =
  54061. stringLength - totalParsedInputLength;
  54062. if (string.length > 0) {
  54063. getParsingFlags(config).unusedInput.push(string);
  54064. }
  54065. // clear _12h flag if hour is <= 12
  54066. if (
  54067. config._a[HOUR] <= 12 &&
  54068. getParsingFlags(config).bigHour === true &&
  54069. config._a[HOUR] > 0
  54070. ) {
  54071. getParsingFlags(config).bigHour = undefined;
  54072. }
  54073. getParsingFlags(config).parsedDateParts = config._a.slice(0);
  54074. getParsingFlags(config).meridiem = config._meridiem;
  54075. // handle meridiem
  54076. config._a[HOUR] = meridiemFixWrap(
  54077. config._locale,
  54078. config._a[HOUR],
  54079. config._meridiem
  54080. );
  54081. // handle era
  54082. era = getParsingFlags(config).era;
  54083. if (era !== null) {
  54084. config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]);
  54085. }
  54086. configFromArray(config);
  54087. checkOverflow(config);
  54088. }
  54089. function meridiemFixWrap(locale, hour, meridiem) {
  54090. var isPm;
  54091. if (meridiem == null) {
  54092. // nothing to do
  54093. return hour;
  54094. }
  54095. if (locale.meridiemHour != null) {
  54096. return locale.meridiemHour(hour, meridiem);
  54097. } else if (locale.isPM != null) {
  54098. // Fallback
  54099. isPm = locale.isPM(meridiem);
  54100. if (isPm && hour < 12) {
  54101. hour += 12;
  54102. }
  54103. if (!isPm && hour === 12) {
  54104. hour = 0;
  54105. }
  54106. return hour;
  54107. } else {
  54108. // this is not supposed to happen
  54109. return hour;
  54110. }
  54111. }
  54112. // date from string and array of format strings
  54113. function configFromStringAndArray(config) {
  54114. var tempConfig,
  54115. bestMoment,
  54116. scoreToBeat,
  54117. i,
  54118. currentScore,
  54119. validFormatFound,
  54120. bestFormatIsValid = false;
  54121. if (config._f.length === 0) {
  54122. getParsingFlags(config).invalidFormat = true;
  54123. config._d = new Date(NaN);
  54124. return;
  54125. }
  54126. for (i = 0; i < config._f.length; i++) {
  54127. currentScore = 0;
  54128. validFormatFound = false;
  54129. tempConfig = copyConfig({}, config);
  54130. if (config._useUTC != null) {
  54131. tempConfig._useUTC = config._useUTC;
  54132. }
  54133. tempConfig._f = config._f[i];
  54134. configFromStringAndFormat(tempConfig);
  54135. if (isValid(tempConfig)) {
  54136. validFormatFound = true;
  54137. }
  54138. // if there is any input that was not parsed add a penalty for that format
  54139. currentScore += getParsingFlags(tempConfig).charsLeftOver;
  54140. //or tokens
  54141. currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
  54142. getParsingFlags(tempConfig).score = currentScore;
  54143. if (!bestFormatIsValid) {
  54144. if (
  54145. scoreToBeat == null ||
  54146. currentScore < scoreToBeat ||
  54147. validFormatFound
  54148. ) {
  54149. scoreToBeat = currentScore;
  54150. bestMoment = tempConfig;
  54151. if (validFormatFound) {
  54152. bestFormatIsValid = true;
  54153. }
  54154. }
  54155. } else {
  54156. if (currentScore < scoreToBeat) {
  54157. scoreToBeat = currentScore;
  54158. bestMoment = tempConfig;
  54159. }
  54160. }
  54161. }
  54162. extend(config, bestMoment || tempConfig);
  54163. }
  54164. function configFromObject(config) {
  54165. if (config._d) {
  54166. return;
  54167. }
  54168. var i = normalizeObjectUnits(config._i),
  54169. dayOrDate = i.day === undefined ? i.date : i.day;
  54170. config._a = map(
  54171. [i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond],
  54172. function (obj) {
  54173. return obj && parseInt(obj, 10);
  54174. }
  54175. );
  54176. configFromArray(config);
  54177. }
  54178. function createFromConfig(config) {
  54179. var res = new Moment(checkOverflow(prepareConfig(config)));
  54180. if (res._nextDay) {
  54181. // Adding is smart enough around DST
  54182. res.add(1, 'd');
  54183. res._nextDay = undefined;
  54184. }
  54185. return res;
  54186. }
  54187. function prepareConfig(config) {
  54188. var input = config._i,
  54189. format = config._f;
  54190. config._locale = config._locale || getLocale(config._l);
  54191. if (input === null || (format === undefined && input === '')) {
  54192. return createInvalid({ nullInput: true });
  54193. }
  54194. if (typeof input === 'string') {
  54195. config._i = input = config._locale.preparse(input);
  54196. }
  54197. if (isMoment(input)) {
  54198. return new Moment(checkOverflow(input));
  54199. } else if (isDate(input)) {
  54200. config._d = input;
  54201. } else if (isArray(format)) {
  54202. configFromStringAndArray(config);
  54203. } else if (format) {
  54204. configFromStringAndFormat(config);
  54205. } else {
  54206. configFromInput(config);
  54207. }
  54208. if (!isValid(config)) {
  54209. config._d = null;
  54210. }
  54211. return config;
  54212. }
  54213. function configFromInput(config) {
  54214. var input = config._i;
  54215. if (isUndefined(input)) {
  54216. config._d = new Date(hooks.now());
  54217. } else if (isDate(input)) {
  54218. config._d = new Date(input.valueOf());
  54219. } else if (typeof input === 'string') {
  54220. configFromString(config);
  54221. } else if (isArray(input)) {
  54222. config._a = map(input.slice(0), function (obj) {
  54223. return parseInt(obj, 10);
  54224. });
  54225. configFromArray(config);
  54226. } else if (isObject(input)) {
  54227. configFromObject(config);
  54228. } else if (isNumber(input)) {
  54229. // from milliseconds
  54230. config._d = new Date(input);
  54231. } else {
  54232. hooks.createFromInputFallback(config);
  54233. }
  54234. }
  54235. function createLocalOrUTC(input, format, locale, strict, isUTC) {
  54236. var c = {};
  54237. if (format === true || format === false) {
  54238. strict = format;
  54239. format = undefined;
  54240. }
  54241. if (locale === true || locale === false) {
  54242. strict = locale;
  54243. locale = undefined;
  54244. }
  54245. if (
  54246. (isObject(input) && isObjectEmpty(input)) ||
  54247. (isArray(input) && input.length === 0)
  54248. ) {
  54249. input = undefined;
  54250. }
  54251. // object construction must be done this way.
  54252. // https://github.com/moment/moment/issues/1423
  54253. c._isAMomentObject = true;
  54254. c._useUTC = c._isUTC = isUTC;
  54255. c._l = locale;
  54256. c._i = input;
  54257. c._f = format;
  54258. c._strict = strict;
  54259. return createFromConfig(c);
  54260. }
  54261. function createLocal(input, format, locale, strict) {
  54262. return createLocalOrUTC(input, format, locale, strict, false);
  54263. }
  54264. var prototypeMin = deprecate(
  54265. 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',
  54266. function () {
  54267. var other = createLocal.apply(null, arguments);
  54268. if (this.isValid() && other.isValid()) {
  54269. return other < this ? this : other;
  54270. } else {
  54271. return createInvalid();
  54272. }
  54273. }
  54274. ),
  54275. prototypeMax = deprecate(
  54276. 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',
  54277. function () {
  54278. var other = createLocal.apply(null, arguments);
  54279. if (this.isValid() && other.isValid()) {
  54280. return other > this ? this : other;
  54281. } else {
  54282. return createInvalid();
  54283. }
  54284. }
  54285. );
  54286. // Pick a moment m from moments so that m[fn](other) is true for all
  54287. // other. This relies on the function fn to be transitive.
  54288. //
  54289. // moments should either be an array of moment objects or an array, whose
  54290. // first element is an array of moment objects.
  54291. function pickBy(fn, moments) {
  54292. var res, i;
  54293. if (moments.length === 1 && isArray(moments[0])) {
  54294. moments = moments[0];
  54295. }
  54296. if (!moments.length) {
  54297. return createLocal();
  54298. }
  54299. res = moments[0];
  54300. for (i = 1; i < moments.length; ++i) {
  54301. if (!moments[i].isValid() || moments[i][fn](res)) {
  54302. res = moments[i];
  54303. }
  54304. }
  54305. return res;
  54306. }
  54307. // TODO: Use [].sort instead?
  54308. function min() {
  54309. var args = [].slice.call(arguments, 0);
  54310. return pickBy('isBefore', args);
  54311. }
  54312. function max() {
  54313. var args = [].slice.call(arguments, 0);
  54314. return pickBy('isAfter', args);
  54315. }
  54316. var now = function () {
  54317. return Date.now ? Date.now() : +new Date();
  54318. };
  54319. var ordering = [
  54320. 'year',
  54321. 'quarter',
  54322. 'month',
  54323. 'week',
  54324. 'day',
  54325. 'hour',
  54326. 'minute',
  54327. 'second',
  54328. 'millisecond',
  54329. ];
  54330. function isDurationValid(m) {
  54331. var key,
  54332. unitHasDecimal = false,
  54333. i;
  54334. for (key in m) {
  54335. if (
  54336. hasOwnProp(m, key) &&
  54337. !(
  54338. indexOf.call(ordering, key) !== -1 &&
  54339. (m[key] == null || !isNaN(m[key]))
  54340. )
  54341. ) {
  54342. return false;
  54343. }
  54344. }
  54345. for (i = 0; i < ordering.length; ++i) {
  54346. if (m[ordering[i]]) {
  54347. if (unitHasDecimal) {
  54348. return false; // only allow non-integers for smallest unit
  54349. }
  54350. if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {
  54351. unitHasDecimal = true;
  54352. }
  54353. }
  54354. }
  54355. return true;
  54356. }
  54357. function isValid$1() {
  54358. return this._isValid;
  54359. }
  54360. function createInvalid$1() {
  54361. return createDuration(NaN);
  54362. }
  54363. function Duration(duration) {
  54364. var normalizedInput = normalizeObjectUnits(duration),
  54365. years = normalizedInput.year || 0,
  54366. quarters = normalizedInput.quarter || 0,
  54367. months = normalizedInput.month || 0,
  54368. weeks = normalizedInput.week || normalizedInput.isoWeek || 0,
  54369. days = normalizedInput.day || 0,
  54370. hours = normalizedInput.hour || 0,
  54371. minutes = normalizedInput.minute || 0,
  54372. seconds = normalizedInput.second || 0,
  54373. milliseconds = normalizedInput.millisecond || 0;
  54374. this._isValid = isDurationValid(normalizedInput);
  54375. // representation for dateAddRemove
  54376. this._milliseconds =
  54377. +milliseconds +
  54378. seconds * 1e3 + // 1000
  54379. minutes * 6e4 + // 1000 * 60
  54380. hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
  54381. // Because of dateAddRemove treats 24 hours as different from a
  54382. // day when working around DST, we need to store them separately
  54383. this._days = +days + weeks * 7;
  54384. // It is impossible to translate months into days without knowing
  54385. // which months you are are talking about, so we have to store
  54386. // it separately.
  54387. this._months = +months + quarters * 3 + years * 12;
  54388. this._data = {};
  54389. this._locale = getLocale();
  54390. this._bubble();
  54391. }
  54392. function isDuration(obj) {
  54393. return obj instanceof Duration;
  54394. }
  54395. function absRound(number) {
  54396. if (number < 0) {
  54397. return Math.round(-1 * number) * -1;
  54398. } else {
  54399. return Math.round(number);
  54400. }
  54401. }
  54402. // compare two arrays, return the number of differences
  54403. function compareArrays(array1, array2, dontConvert) {
  54404. var len = Math.min(array1.length, array2.length),
  54405. lengthDiff = Math.abs(array1.length - array2.length),
  54406. diffs = 0,
  54407. i;
  54408. for (i = 0; i < len; i++) {
  54409. if (
  54410. (dontConvert && array1[i] !== array2[i]) ||
  54411. (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))
  54412. ) {
  54413. diffs++;
  54414. }
  54415. }
  54416. return diffs + lengthDiff;
  54417. }
  54418. // FORMATTING
  54419. function offset(token, separator) {
  54420. addFormatToken(token, 0, 0, function () {
  54421. var offset = this.utcOffset(),
  54422. sign = '+';
  54423. if (offset < 0) {
  54424. offset = -offset;
  54425. sign = '-';
  54426. }
  54427. return (
  54428. sign +
  54429. zeroFill(~~(offset / 60), 2) +
  54430. separator +
  54431. zeroFill(~~offset % 60, 2)
  54432. );
  54433. });
  54434. }
  54435. offset('Z', ':');
  54436. offset('ZZ', '');
  54437. // PARSING
  54438. addRegexToken('Z', matchShortOffset);
  54439. addRegexToken('ZZ', matchShortOffset);
  54440. addParseToken(['Z', 'ZZ'], function (input, array, config) {
  54441. config._useUTC = true;
  54442. config._tzm = offsetFromString(matchShortOffset, input);
  54443. });
  54444. // HELPERS
  54445. // timezone chunker
  54446. // '+10:00' > ['10', '00']
  54447. // '-1530' > ['-15', '30']
  54448. var chunkOffset = /([\+\-]|\d\d)/gi;
  54449. function offsetFromString(matcher, string) {
  54450. var matches = (string || '').match(matcher),
  54451. chunk,
  54452. parts,
  54453. minutes;
  54454. if (matches === null) {
  54455. return null;
  54456. }
  54457. chunk = matches[matches.length - 1] || [];
  54458. parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
  54459. minutes = +(parts[1] * 60) + toInt(parts[2]);
  54460. return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes;
  54461. }
  54462. // Return a moment from input, that is local/utc/zone equivalent to model.
  54463. function cloneWithOffset(input, model) {
  54464. var res, diff;
  54465. if (model._isUTC) {
  54466. res = model.clone();
  54467. diff =
  54468. (isMoment(input) || isDate(input)
  54469. ? input.valueOf()
  54470. : createLocal(input).valueOf()) - res.valueOf();
  54471. // Use low-level api, because this fn is low-level api.
  54472. res._d.setTime(res._d.valueOf() + diff);
  54473. hooks.updateOffset(res, false);
  54474. return res;
  54475. } else {
  54476. return createLocal(input).local();
  54477. }
  54478. }
  54479. function getDateOffset(m) {
  54480. // On Firefox.24 Date#getTimezoneOffset returns a floating point.
  54481. // https://github.com/moment/moment/pull/1871
  54482. return -Math.round(m._d.getTimezoneOffset());
  54483. }
  54484. // HOOKS
  54485. // This function will be called whenever a moment is mutated.
  54486. // It is intended to keep the offset in sync with the timezone.
  54487. hooks.updateOffset = function () {};
  54488. // MOMENTS
  54489. // keepLocalTime = true means only change the timezone, without
  54490. // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
  54491. // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
  54492. // +0200, so we adjust the time as needed, to be valid.
  54493. //
  54494. // Keeping the time actually adds/subtracts (one hour)
  54495. // from the actual represented time. That is why we call updateOffset
  54496. // a second time. In case it wants us to change the offset again
  54497. // _changeInProgress == true case, then we have to adjust, because
  54498. // there is no such time in the given timezone.
  54499. function getSetOffset(input, keepLocalTime, keepMinutes) {
  54500. var offset = this._offset || 0,
  54501. localAdjust;
  54502. if (!this.isValid()) {
  54503. return input != null ? this : NaN;
  54504. }
  54505. if (input != null) {
  54506. if (typeof input === 'string') {
  54507. input = offsetFromString(matchShortOffset, input);
  54508. if (input === null) {
  54509. return this;
  54510. }
  54511. } else if (Math.abs(input) < 16 && !keepMinutes) {
  54512. input = input * 60;
  54513. }
  54514. if (!this._isUTC && keepLocalTime) {
  54515. localAdjust = getDateOffset(this);
  54516. }
  54517. this._offset = input;
  54518. this._isUTC = true;
  54519. if (localAdjust != null) {
  54520. this.add(localAdjust, 'm');
  54521. }
  54522. if (offset !== input) {
  54523. if (!keepLocalTime || this._changeInProgress) {
  54524. addSubtract(
  54525. this,
  54526. createDuration(input - offset, 'm'),
  54527. 1,
  54528. false
  54529. );
  54530. } else if (!this._changeInProgress) {
  54531. this._changeInProgress = true;
  54532. hooks.updateOffset(this, true);
  54533. this._changeInProgress = null;
  54534. }
  54535. }
  54536. return this;
  54537. } else {
  54538. return this._isUTC ? offset : getDateOffset(this);
  54539. }
  54540. }
  54541. function getSetZone(input, keepLocalTime) {
  54542. if (input != null) {
  54543. if (typeof input !== 'string') {
  54544. input = -input;
  54545. }
  54546. this.utcOffset(input, keepLocalTime);
  54547. return this;
  54548. } else {
  54549. return -this.utcOffset();
  54550. }
  54551. }
  54552. function setOffsetToUTC(keepLocalTime) {
  54553. return this.utcOffset(0, keepLocalTime);
  54554. }
  54555. function setOffsetToLocal(keepLocalTime) {
  54556. if (this._isUTC) {
  54557. this.utcOffset(0, keepLocalTime);
  54558. this._isUTC = false;
  54559. if (keepLocalTime) {
  54560. this.subtract(getDateOffset(this), 'm');
  54561. }
  54562. }
  54563. return this;
  54564. }
  54565. function setOffsetToParsedOffset() {
  54566. if (this._tzm != null) {
  54567. this.utcOffset(this._tzm, false, true);
  54568. } else if (typeof this._i === 'string') {
  54569. var tZone = offsetFromString(matchOffset, this._i);
  54570. if (tZone != null) {
  54571. this.utcOffset(tZone);
  54572. } else {
  54573. this.utcOffset(0, true);
  54574. }
  54575. }
  54576. return this;
  54577. }
  54578. function hasAlignedHourOffset(input) {
  54579. if (!this.isValid()) {
  54580. return false;
  54581. }
  54582. input = input ? createLocal(input).utcOffset() : 0;
  54583. return (this.utcOffset() - input) % 60 === 0;
  54584. }
  54585. function isDaylightSavingTime() {
  54586. return (
  54587. this.utcOffset() > this.clone().month(0).utcOffset() ||
  54588. this.utcOffset() > this.clone().month(5).utcOffset()
  54589. );
  54590. }
  54591. function isDaylightSavingTimeShifted() {
  54592. if (!isUndefined(this._isDSTShifted)) {
  54593. return this._isDSTShifted;
  54594. }
  54595. var c = {},
  54596. other;
  54597. copyConfig(c, this);
  54598. c = prepareConfig(c);
  54599. if (c._a) {
  54600. other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
  54601. this._isDSTShifted =
  54602. this.isValid() && compareArrays(c._a, other.toArray()) > 0;
  54603. } else {
  54604. this._isDSTShifted = false;
  54605. }
  54606. return this._isDSTShifted;
  54607. }
  54608. function isLocal() {
  54609. return this.isValid() ? !this._isUTC : false;
  54610. }
  54611. function isUtcOffset() {
  54612. return this.isValid() ? this._isUTC : false;
  54613. }
  54614. function isUtc() {
  54615. return this.isValid() ? this._isUTC && this._offset === 0 : false;
  54616. }
  54617. // ASP.NET json date format regex
  54618. var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,
  54619. // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
  54620. // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
  54621. // and further modified to allow for strings containing both week and day
  54622. isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
  54623. function createDuration(input, key) {
  54624. var duration = input,
  54625. // matching against regexp is expensive, do it on demand
  54626. match = null,
  54627. sign,
  54628. ret,
  54629. diffRes;
  54630. if (isDuration(input)) {
  54631. duration = {
  54632. ms: input._milliseconds,
  54633. d: input._days,
  54634. M: input._months,
  54635. };
  54636. } else if (isNumber(input) || !isNaN(+input)) {
  54637. duration = {};
  54638. if (key) {
  54639. duration[key] = +input;
  54640. } else {
  54641. duration.milliseconds = +input;
  54642. }
  54643. } else if ((match = aspNetRegex.exec(input))) {
  54644. sign = match[1] === '-' ? -1 : 1;
  54645. duration = {
  54646. y: 0,
  54647. d: toInt(match[DATE]) * sign,
  54648. h: toInt(match[HOUR]) * sign,
  54649. m: toInt(match[MINUTE]) * sign,
  54650. s: toInt(match[SECOND]) * sign,
  54651. ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign, // the millisecond decimal point is included in the match
  54652. };
  54653. } else if ((match = isoRegex.exec(input))) {
  54654. sign = match[1] === '-' ? -1 : 1;
  54655. duration = {
  54656. y: parseIso(match[2], sign),
  54657. M: parseIso(match[3], sign),
  54658. w: parseIso(match[4], sign),
  54659. d: parseIso(match[5], sign),
  54660. h: parseIso(match[6], sign),
  54661. m: parseIso(match[7], sign),
  54662. s: parseIso(match[8], sign),
  54663. };
  54664. } else if (duration == null) {
  54665. // checks for null or undefined
  54666. duration = {};
  54667. } else if (
  54668. typeof duration === 'object' &&
  54669. ('from' in duration || 'to' in duration)
  54670. ) {
  54671. diffRes = momentsDifference(
  54672. createLocal(duration.from),
  54673. createLocal(duration.to)
  54674. );
  54675. duration = {};
  54676. duration.ms = diffRes.milliseconds;
  54677. duration.M = diffRes.months;
  54678. }
  54679. ret = new Duration(duration);
  54680. if (isDuration(input) && hasOwnProp(input, '_locale')) {
  54681. ret._locale = input._locale;
  54682. }
  54683. if (isDuration(input) && hasOwnProp(input, '_isValid')) {
  54684. ret._isValid = input._isValid;
  54685. }
  54686. return ret;
  54687. }
  54688. createDuration.fn = Duration.prototype;
  54689. createDuration.invalid = createInvalid$1;
  54690. function parseIso(inp, sign) {
  54691. // We'd normally use ~~inp for this, but unfortunately it also
  54692. // converts floats to ints.
  54693. // inp may be undefined, so careful calling replace on it.
  54694. var res = inp && parseFloat(inp.replace(',', '.'));
  54695. // apply sign while we're at it
  54696. return (isNaN(res) ? 0 : res) * sign;
  54697. }
  54698. function positiveMomentsDifference(base, other) {
  54699. var res = {};
  54700. res.months =
  54701. other.month() - base.month() + (other.year() - base.year()) * 12;
  54702. if (base.clone().add(res.months, 'M').isAfter(other)) {
  54703. --res.months;
  54704. }
  54705. res.milliseconds = +other - +base.clone().add(res.months, 'M');
  54706. return res;
  54707. }
  54708. function momentsDifference(base, other) {
  54709. var res;
  54710. if (!(base.isValid() && other.isValid())) {
  54711. return { milliseconds: 0, months: 0 };
  54712. }
  54713. other = cloneWithOffset(other, base);
  54714. if (base.isBefore(other)) {
  54715. res = positiveMomentsDifference(base, other);
  54716. } else {
  54717. res = positiveMomentsDifference(other, base);
  54718. res.milliseconds = -res.milliseconds;
  54719. res.months = -res.months;
  54720. }
  54721. return res;
  54722. }
  54723. // TODO: remove 'name' arg after deprecation is removed
  54724. function createAdder(direction, name) {
  54725. return function (val, period) {
  54726. var dur, tmp;
  54727. //invert the arguments, but complain about it
  54728. if (period !== null && !isNaN(+period)) {
  54729. deprecateSimple(
  54730. name,
  54731. 'moment().' +
  54732. name +
  54733. '(period, number) is deprecated. Please use moment().' +
  54734. name +
  54735. '(number, period). ' +
  54736. 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'
  54737. );
  54738. tmp = val;
  54739. val = period;
  54740. period = tmp;
  54741. }
  54742. dur = createDuration(val, period);
  54743. addSubtract(this, dur, direction);
  54744. return this;
  54745. };
  54746. }
  54747. function addSubtract(mom, duration, isAdding, updateOffset) {
  54748. var milliseconds = duration._milliseconds,
  54749. days = absRound(duration._days),
  54750. months = absRound(duration._months);
  54751. if (!mom.isValid()) {
  54752. // No op
  54753. return;
  54754. }
  54755. updateOffset = updateOffset == null ? true : updateOffset;
  54756. if (months) {
  54757. setMonth(mom, get(mom, 'Month') + months * isAdding);
  54758. }
  54759. if (days) {
  54760. set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);
  54761. }
  54762. if (milliseconds) {
  54763. mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
  54764. }
  54765. if (updateOffset) {
  54766. hooks.updateOffset(mom, days || months);
  54767. }
  54768. }
  54769. var add = createAdder(1, 'add'),
  54770. subtract = createAdder(-1, 'subtract');
  54771. function isString(input) {
  54772. return typeof input === 'string' || input instanceof String;
  54773. }
  54774. // type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined
  54775. function isMomentInput(input) {
  54776. return (
  54777. isMoment(input) ||
  54778. isDate(input) ||
  54779. isString(input) ||
  54780. isNumber(input) ||
  54781. isNumberOrStringArray(input) ||
  54782. isMomentInputObject(input) ||
  54783. input === null ||
  54784. input === undefined
  54785. );
  54786. }
  54787. function isMomentInputObject(input) {
  54788. var objectTest = isObject(input) && !isObjectEmpty(input),
  54789. propertyTest = false,
  54790. properties = [
  54791. 'years',
  54792. 'year',
  54793. 'y',
  54794. 'months',
  54795. 'month',
  54796. 'M',
  54797. 'days',
  54798. 'day',
  54799. 'd',
  54800. 'dates',
  54801. 'date',
  54802. 'D',
  54803. 'hours',
  54804. 'hour',
  54805. 'h',
  54806. 'minutes',
  54807. 'minute',
  54808. 'm',
  54809. 'seconds',
  54810. 'second',
  54811. 's',
  54812. 'milliseconds',
  54813. 'millisecond',
  54814. 'ms',
  54815. ],
  54816. i,
  54817. property;
  54818. for (i = 0; i < properties.length; i += 1) {
  54819. property = properties[i];
  54820. propertyTest = propertyTest || hasOwnProp(input, property);
  54821. }
  54822. return objectTest && propertyTest;
  54823. }
  54824. function isNumberOrStringArray(input) {
  54825. var arrayTest = isArray(input),
  54826. dataTypeTest = false;
  54827. if (arrayTest) {
  54828. dataTypeTest =
  54829. input.filter(function (item) {
  54830. return !isNumber(item) && isString(input);
  54831. }).length === 0;
  54832. }
  54833. return arrayTest && dataTypeTest;
  54834. }
  54835. function isCalendarSpec(input) {
  54836. var objectTest = isObject(input) && !isObjectEmpty(input),
  54837. propertyTest = false,
  54838. properties = [
  54839. 'sameDay',
  54840. 'nextDay',
  54841. 'lastDay',
  54842. 'nextWeek',
  54843. 'lastWeek',
  54844. 'sameElse',
  54845. ],
  54846. i,
  54847. property;
  54848. for (i = 0; i < properties.length; i += 1) {
  54849. property = properties[i];
  54850. propertyTest = propertyTest || hasOwnProp(input, property);
  54851. }
  54852. return objectTest && propertyTest;
  54853. }
  54854. function getCalendarFormat(myMoment, now) {
  54855. var diff = myMoment.diff(now, 'days', true);
  54856. return diff < -6
  54857. ? 'sameElse'
  54858. : diff < -1
  54859. ? 'lastWeek'
  54860. : diff < 0
  54861. ? 'lastDay'
  54862. : diff < 1
  54863. ? 'sameDay'
  54864. : diff < 2
  54865. ? 'nextDay'
  54866. : diff < 7
  54867. ? 'nextWeek'
  54868. : 'sameElse';
  54869. }
  54870. function calendar$1(time, formats) {
  54871. // Support for single parameter, formats only overload to the calendar function
  54872. if (arguments.length === 1) {
  54873. if (isMomentInput(arguments[0])) {
  54874. time = arguments[0];
  54875. formats = undefined;
  54876. } else if (isCalendarSpec(arguments[0])) {
  54877. formats = arguments[0];
  54878. time = undefined;
  54879. }
  54880. }
  54881. // We want to compare the start of today, vs this.
  54882. // Getting start-of-today depends on whether we're local/utc/offset or not.
  54883. var now = time || createLocal(),
  54884. sod = cloneWithOffset(now, this).startOf('day'),
  54885. format = hooks.calendarFormat(this, sod) || 'sameElse',
  54886. output =
  54887. formats &&
  54888. (isFunction(formats[format])
  54889. ? formats[format].call(this, now)
  54890. : formats[format]);
  54891. return this.format(
  54892. output || this.localeData().calendar(format, this, createLocal(now))
  54893. );
  54894. }
  54895. function clone() {
  54896. return new Moment(this);
  54897. }
  54898. function isAfter(input, units) {
  54899. var localInput = isMoment(input) ? input : createLocal(input);
  54900. if (!(this.isValid() && localInput.isValid())) {
  54901. return false;
  54902. }
  54903. units = normalizeUnits(units) || 'millisecond';
  54904. if (units === 'millisecond') {
  54905. return this.valueOf() > localInput.valueOf();
  54906. } else {
  54907. return localInput.valueOf() < this.clone().startOf(units).valueOf();
  54908. }
  54909. }
  54910. function isBefore(input, units) {
  54911. var localInput = isMoment(input) ? input : createLocal(input);
  54912. if (!(this.isValid() && localInput.isValid())) {
  54913. return false;
  54914. }
  54915. units = normalizeUnits(units) || 'millisecond';
  54916. if (units === 'millisecond') {
  54917. return this.valueOf() < localInput.valueOf();
  54918. } else {
  54919. return this.clone().endOf(units).valueOf() < localInput.valueOf();
  54920. }
  54921. }
  54922. function isBetween(from, to, units, inclusivity) {
  54923. var localFrom = isMoment(from) ? from : createLocal(from),
  54924. localTo = isMoment(to) ? to : createLocal(to);
  54925. if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {
  54926. return false;
  54927. }
  54928. inclusivity = inclusivity || '()';
  54929. return (
  54930. (inclusivity[0] === '('
  54931. ? this.isAfter(localFrom, units)
  54932. : !this.isBefore(localFrom, units)) &&
  54933. (inclusivity[1] === ')'
  54934. ? this.isBefore(localTo, units)
  54935. : !this.isAfter(localTo, units))
  54936. );
  54937. }
  54938. function isSame(input, units) {
  54939. var localInput = isMoment(input) ? input : createLocal(input),
  54940. inputMs;
  54941. if (!(this.isValid() && localInput.isValid())) {
  54942. return false;
  54943. }
  54944. units = normalizeUnits(units) || 'millisecond';
  54945. if (units === 'millisecond') {
  54946. return this.valueOf() === localInput.valueOf();
  54947. } else {
  54948. inputMs = localInput.valueOf();
  54949. return (
  54950. this.clone().startOf(units).valueOf() <= inputMs &&
  54951. inputMs <= this.clone().endOf(units).valueOf()
  54952. );
  54953. }
  54954. }
  54955. function isSameOrAfter(input, units) {
  54956. return this.isSame(input, units) || this.isAfter(input, units);
  54957. }
  54958. function isSameOrBefore(input, units) {
  54959. return this.isSame(input, units) || this.isBefore(input, units);
  54960. }
  54961. function diff(input, units, asFloat) {
  54962. var that, zoneDelta, output;
  54963. if (!this.isValid()) {
  54964. return NaN;
  54965. }
  54966. that = cloneWithOffset(input, this);
  54967. if (!that.isValid()) {
  54968. return NaN;
  54969. }
  54970. zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
  54971. units = normalizeUnits(units);
  54972. switch (units) {
  54973. case 'year':
  54974. output = monthDiff(this, that) / 12;
  54975. break;
  54976. case 'month':
  54977. output = monthDiff(this, that);
  54978. break;
  54979. case 'quarter':
  54980. output = monthDiff(this, that) / 3;
  54981. break;
  54982. case 'second':
  54983. output = (this - that) / 1e3;
  54984. break; // 1000
  54985. case 'minute':
  54986. output = (this - that) / 6e4;
  54987. break; // 1000 * 60
  54988. case 'hour':
  54989. output = (this - that) / 36e5;
  54990. break; // 1000 * 60 * 60
  54991. case 'day':
  54992. output = (this - that - zoneDelta) / 864e5;
  54993. break; // 1000 * 60 * 60 * 24, negate dst
  54994. case 'week':
  54995. output = (this - that - zoneDelta) / 6048e5;
  54996. break; // 1000 * 60 * 60 * 24 * 7, negate dst
  54997. default:
  54998. output = this - that;
  54999. }
  55000. return asFloat ? output : absFloor(output);
  55001. }
  55002. function monthDiff(a, b) {
  55003. if (a.date() < b.date()) {
  55004. // end-of-month calculations work correct when the start month has more
  55005. // days than the end month.
  55006. return -monthDiff(b, a);
  55007. }
  55008. // difference in months
  55009. var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()),
  55010. // b is in (anchor - 1 month, anchor + 1 month)
  55011. anchor = a.clone().add(wholeMonthDiff, 'months'),
  55012. anchor2,
  55013. adjust;
  55014. if (b - anchor < 0) {
  55015. anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
  55016. // linear across the month
  55017. adjust = (b - anchor) / (anchor - anchor2);
  55018. } else {
  55019. anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
  55020. // linear across the month
  55021. adjust = (b - anchor) / (anchor2 - anchor);
  55022. }
  55023. //check for negative zero, return zero if negative zero
  55024. return -(wholeMonthDiff + adjust) || 0;
  55025. }
  55026. hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
  55027. hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
  55028. function toString() {
  55029. return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
  55030. }
  55031. function toISOString(keepOffset) {
  55032. if (!this.isValid()) {
  55033. return null;
  55034. }
  55035. var utc = keepOffset !== true,
  55036. m = utc ? this.clone().utc() : this;
  55037. if (m.year() < 0 || m.year() > 9999) {
  55038. return formatMoment(
  55039. m,
  55040. utc
  55041. ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'
  55042. : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ'
  55043. );
  55044. }
  55045. if (isFunction(Date.prototype.toISOString)) {
  55046. // native implementation is ~50x faster, use it when we can
  55047. if (utc) {
  55048. return this.toDate().toISOString();
  55049. } else {
  55050. return new Date(this.valueOf() + this.utcOffset() * 60 * 1000)
  55051. .toISOString()
  55052. .replace('Z', formatMoment(m, 'Z'));
  55053. }
  55054. }
  55055. return formatMoment(
  55056. m,
  55057. utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ'
  55058. );
  55059. }
  55060. /**
  55061. * Return a human readable representation of a moment that can
  55062. * also be evaluated to get a new moment which is the same
  55063. *
  55064. * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
  55065. */
  55066. function inspect() {
  55067. if (!this.isValid()) {
  55068. return 'moment.invalid(/* ' + this._i + ' */)';
  55069. }
  55070. var func = 'moment',
  55071. zone = '',
  55072. prefix,
  55073. year,
  55074. datetime,
  55075. suffix;
  55076. if (!this.isLocal()) {
  55077. func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';
  55078. zone = 'Z';
  55079. }
  55080. prefix = '[' + func + '("]';
  55081. year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY';
  55082. datetime = '-MM-DD[T]HH:mm:ss.SSS';
  55083. suffix = zone + '[")]';
  55084. return this.format(prefix + year + datetime + suffix);
  55085. }
  55086. function format(inputString) {
  55087. if (!inputString) {
  55088. inputString = this.isUtc()
  55089. ? hooks.defaultFormatUtc
  55090. : hooks.defaultFormat;
  55091. }
  55092. var output = formatMoment(this, inputString);
  55093. return this.localeData().postformat(output);
  55094. }
  55095. function from(time, withoutSuffix) {
  55096. if (
  55097. this.isValid() &&
  55098. ((isMoment(time) && time.isValid()) || createLocal(time).isValid())
  55099. ) {
  55100. return createDuration({ to: this, from: time })
  55101. .locale(this.locale())
  55102. .humanize(!withoutSuffix);
  55103. } else {
  55104. return this.localeData().invalidDate();
  55105. }
  55106. }
  55107. function fromNow(withoutSuffix) {
  55108. return this.from(createLocal(), withoutSuffix);
  55109. }
  55110. function to(time, withoutSuffix) {
  55111. if (
  55112. this.isValid() &&
  55113. ((isMoment(time) && time.isValid()) || createLocal(time).isValid())
  55114. ) {
  55115. return createDuration({ from: this, to: time })
  55116. .locale(this.locale())
  55117. .humanize(!withoutSuffix);
  55118. } else {
  55119. return this.localeData().invalidDate();
  55120. }
  55121. }
  55122. function toNow(withoutSuffix) {
  55123. return this.to(createLocal(), withoutSuffix);
  55124. }
  55125. // If passed a locale key, it will set the locale for this
  55126. // instance. Otherwise, it will return the locale configuration
  55127. // variables for this instance.
  55128. function locale(key) {
  55129. var newLocaleData;
  55130. if (key === undefined) {
  55131. return this._locale._abbr;
  55132. } else {
  55133. newLocaleData = getLocale(key);
  55134. if (newLocaleData != null) {
  55135. this._locale = newLocaleData;
  55136. }
  55137. return this;
  55138. }
  55139. }
  55140. var lang = deprecate(
  55141. 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
  55142. function (key) {
  55143. if (key === undefined) {
  55144. return this.localeData();
  55145. } else {
  55146. return this.locale(key);
  55147. }
  55148. }
  55149. );
  55150. function localeData() {
  55151. return this._locale;
  55152. }
  55153. var MS_PER_SECOND = 1000,
  55154. MS_PER_MINUTE = 60 * MS_PER_SECOND,
  55155. MS_PER_HOUR = 60 * MS_PER_MINUTE,
  55156. MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;
  55157. // actual modulo - handles negative numbers (for dates before 1970):
  55158. function mod$1(dividend, divisor) {
  55159. return ((dividend % divisor) + divisor) % divisor;
  55160. }
  55161. function localStartOfDate(y, m, d) {
  55162. // the date constructor remaps years 0-99 to 1900-1999
  55163. if (y < 100 && y >= 0) {
  55164. // preserve leap years using a full 400 year cycle, then reset
  55165. return new Date(y + 400, m, d) - MS_PER_400_YEARS;
  55166. } else {
  55167. return new Date(y, m, d).valueOf();
  55168. }
  55169. }
  55170. function utcStartOfDate(y, m, d) {
  55171. // Date.UTC remaps years 0-99 to 1900-1999
  55172. if (y < 100 && y >= 0) {
  55173. // preserve leap years using a full 400 year cycle, then reset
  55174. return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;
  55175. } else {
  55176. return Date.UTC(y, m, d);
  55177. }
  55178. }
  55179. function startOf(units) {
  55180. var time, startOfDate;
  55181. units = normalizeUnits(units);
  55182. if (units === undefined || units === 'millisecond' || !this.isValid()) {
  55183. return this;
  55184. }
  55185. startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
  55186. switch (units) {
  55187. case 'year':
  55188. time = startOfDate(this.year(), 0, 1);
  55189. break;
  55190. case 'quarter':
  55191. time = startOfDate(
  55192. this.year(),
  55193. this.month() - (this.month() % 3),
  55194. 1
  55195. );
  55196. break;
  55197. case 'month':
  55198. time = startOfDate(this.year(), this.month(), 1);
  55199. break;
  55200. case 'week':
  55201. time = startOfDate(
  55202. this.year(),
  55203. this.month(),
  55204. this.date() - this.weekday()
  55205. );
  55206. break;
  55207. case 'isoWeek':
  55208. time = startOfDate(
  55209. this.year(),
  55210. this.month(),
  55211. this.date() - (this.isoWeekday() - 1)
  55212. );
  55213. break;
  55214. case 'day':
  55215. case 'date':
  55216. time = startOfDate(this.year(), this.month(), this.date());
  55217. break;
  55218. case 'hour':
  55219. time = this._d.valueOf();
  55220. time -= mod$1(
  55221. time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
  55222. MS_PER_HOUR
  55223. );
  55224. break;
  55225. case 'minute':
  55226. time = this._d.valueOf();
  55227. time -= mod$1(time, MS_PER_MINUTE);
  55228. break;
  55229. case 'second':
  55230. time = this._d.valueOf();
  55231. time -= mod$1(time, MS_PER_SECOND);
  55232. break;
  55233. }
  55234. this._d.setTime(time);
  55235. hooks.updateOffset(this, true);
  55236. return this;
  55237. }
  55238. function endOf(units) {
  55239. var time, startOfDate;
  55240. units = normalizeUnits(units);
  55241. if (units === undefined || units === 'millisecond' || !this.isValid()) {
  55242. return this;
  55243. }
  55244. startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
  55245. switch (units) {
  55246. case 'year':
  55247. time = startOfDate(this.year() + 1, 0, 1) - 1;
  55248. break;
  55249. case 'quarter':
  55250. time =
  55251. startOfDate(
  55252. this.year(),
  55253. this.month() - (this.month() % 3) + 3,
  55254. 1
  55255. ) - 1;
  55256. break;
  55257. case 'month':
  55258. time = startOfDate(this.year(), this.month() + 1, 1) - 1;
  55259. break;
  55260. case 'week':
  55261. time =
  55262. startOfDate(
  55263. this.year(),
  55264. this.month(),
  55265. this.date() - this.weekday() + 7
  55266. ) - 1;
  55267. break;
  55268. case 'isoWeek':
  55269. time =
  55270. startOfDate(
  55271. this.year(),
  55272. this.month(),
  55273. this.date() - (this.isoWeekday() - 1) + 7
  55274. ) - 1;
  55275. break;
  55276. case 'day':
  55277. case 'date':
  55278. time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;
  55279. break;
  55280. case 'hour':
  55281. time = this._d.valueOf();
  55282. time +=
  55283. MS_PER_HOUR -
  55284. mod$1(
  55285. time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
  55286. MS_PER_HOUR
  55287. ) -
  55288. 1;
  55289. break;
  55290. case 'minute':
  55291. time = this._d.valueOf();
  55292. time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;
  55293. break;
  55294. case 'second':
  55295. time = this._d.valueOf();
  55296. time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;
  55297. break;
  55298. }
  55299. this._d.setTime(time);
  55300. hooks.updateOffset(this, true);
  55301. return this;
  55302. }
  55303. function valueOf() {
  55304. return this._d.valueOf() - (this._offset || 0) * 60000;
  55305. }
  55306. function unix() {
  55307. return Math.floor(this.valueOf() / 1000);
  55308. }
  55309. function toDate() {
  55310. return new Date(this.valueOf());
  55311. }
  55312. function toArray() {
  55313. var m = this;
  55314. return [
  55315. m.year(),
  55316. m.month(),
  55317. m.date(),
  55318. m.hour(),
  55319. m.minute(),
  55320. m.second(),
  55321. m.millisecond(),
  55322. ];
  55323. }
  55324. function toObject() {
  55325. var m = this;
  55326. return {
  55327. years: m.year(),
  55328. months: m.month(),
  55329. date: m.date(),
  55330. hours: m.hours(),
  55331. minutes: m.minutes(),
  55332. seconds: m.seconds(),
  55333. milliseconds: m.milliseconds(),
  55334. };
  55335. }
  55336. function toJSON() {
  55337. // new Date(NaN).toJSON() === null
  55338. return this.isValid() ? this.toISOString() : null;
  55339. }
  55340. function isValid$2() {
  55341. return isValid(this);
  55342. }
  55343. function parsingFlags() {
  55344. return extend({}, getParsingFlags(this));
  55345. }
  55346. function invalidAt() {
  55347. return getParsingFlags(this).overflow;
  55348. }
  55349. function creationData() {
  55350. return {
  55351. input: this._i,
  55352. format: this._f,
  55353. locale: this._locale,
  55354. isUTC: this._isUTC,
  55355. strict: this._strict,
  55356. };
  55357. }
  55358. addFormatToken('N', 0, 0, 'eraAbbr');
  55359. addFormatToken('NN', 0, 0, 'eraAbbr');
  55360. addFormatToken('NNN', 0, 0, 'eraAbbr');
  55361. addFormatToken('NNNN', 0, 0, 'eraName');
  55362. addFormatToken('NNNNN', 0, 0, 'eraNarrow');
  55363. addFormatToken('y', ['y', 1], 'yo', 'eraYear');
  55364. addFormatToken('y', ['yy', 2], 0, 'eraYear');
  55365. addFormatToken('y', ['yyy', 3], 0, 'eraYear');
  55366. addFormatToken('y', ['yyyy', 4], 0, 'eraYear');
  55367. addRegexToken('N', matchEraAbbr);
  55368. addRegexToken('NN', matchEraAbbr);
  55369. addRegexToken('NNN', matchEraAbbr);
  55370. addRegexToken('NNNN', matchEraName);
  55371. addRegexToken('NNNNN', matchEraNarrow);
  55372. addParseToken(['N', 'NN', 'NNN', 'NNNN', 'NNNNN'], function (
  55373. input,
  55374. array,
  55375. config,
  55376. token
  55377. ) {
  55378. var era = config._locale.erasParse(input, token, config._strict);
  55379. if (era) {
  55380. getParsingFlags(config).era = era;
  55381. } else {
  55382. getParsingFlags(config).invalidEra = input;
  55383. }
  55384. });
  55385. addRegexToken('y', matchUnsigned);
  55386. addRegexToken('yy', matchUnsigned);
  55387. addRegexToken('yyy', matchUnsigned);
  55388. addRegexToken('yyyy', matchUnsigned);
  55389. addRegexToken('yo', matchEraYearOrdinal);
  55390. addParseToken(['y', 'yy', 'yyy', 'yyyy'], YEAR);
  55391. addParseToken(['yo'], function (input, array, config, token) {
  55392. var match;
  55393. if (config._locale._eraYearOrdinalRegex) {
  55394. match = input.match(config._locale._eraYearOrdinalRegex);
  55395. }
  55396. if (config._locale.eraYearOrdinalParse) {
  55397. array[YEAR] = config._locale.eraYearOrdinalParse(input, match);
  55398. } else {
  55399. array[YEAR] = parseInt(input, 10);
  55400. }
  55401. });
  55402. function localeEras(m, format) {
  55403. var i,
  55404. l,
  55405. date,
  55406. eras = this._eras || getLocale('en')._eras;
  55407. for (i = 0, l = eras.length; i < l; ++i) {
  55408. switch (typeof eras[i].since) {
  55409. case 'string':
  55410. // truncate time
  55411. date = hooks(eras[i].since).startOf('day');
  55412. eras[i].since = date.valueOf();
  55413. break;
  55414. }
  55415. switch (typeof eras[i].until) {
  55416. case 'undefined':
  55417. eras[i].until = +Infinity;
  55418. break;
  55419. case 'string':
  55420. // truncate time
  55421. date = hooks(eras[i].until).startOf('day').valueOf();
  55422. eras[i].until = date.valueOf();
  55423. break;
  55424. }
  55425. }
  55426. return eras;
  55427. }
  55428. function localeErasParse(eraName, format, strict) {
  55429. var i,
  55430. l,
  55431. eras = this.eras(),
  55432. name,
  55433. abbr,
  55434. narrow;
  55435. eraName = eraName.toUpperCase();
  55436. for (i = 0, l = eras.length; i < l; ++i) {
  55437. name = eras[i].name.toUpperCase();
  55438. abbr = eras[i].abbr.toUpperCase();
  55439. narrow = eras[i].narrow.toUpperCase();
  55440. if (strict) {
  55441. switch (format) {
  55442. case 'N':
  55443. case 'NN':
  55444. case 'NNN':
  55445. if (abbr === eraName) {
  55446. return eras[i];
  55447. }
  55448. break;
  55449. case 'NNNN':
  55450. if (name === eraName) {
  55451. return eras[i];
  55452. }
  55453. break;
  55454. case 'NNNNN':
  55455. if (narrow === eraName) {
  55456. return eras[i];
  55457. }
  55458. break;
  55459. }
  55460. } else if ([name, abbr, narrow].indexOf(eraName) >= 0) {
  55461. return eras[i];
  55462. }
  55463. }
  55464. }
  55465. function localeErasConvertYear(era, year) {
  55466. var dir = era.since <= era.until ? +1 : -1;
  55467. if (year === undefined) {
  55468. return hooks(era.since).year();
  55469. } else {
  55470. return hooks(era.since).year() + (year - era.offset) * dir;
  55471. }
  55472. }
  55473. function getEraName() {
  55474. var i,
  55475. l,
  55476. val,
  55477. eras = this.localeData().eras();
  55478. for (i = 0, l = eras.length; i < l; ++i) {
  55479. // truncate time
  55480. val = this.clone().startOf('day').valueOf();
  55481. if (eras[i].since <= val && val <= eras[i].until) {
  55482. return eras[i].name;
  55483. }
  55484. if (eras[i].until <= val && val <= eras[i].since) {
  55485. return eras[i].name;
  55486. }
  55487. }
  55488. return '';
  55489. }
  55490. function getEraNarrow() {
  55491. var i,
  55492. l,
  55493. val,
  55494. eras = this.localeData().eras();
  55495. for (i = 0, l = eras.length; i < l; ++i) {
  55496. // truncate time
  55497. val = this.clone().startOf('day').valueOf();
  55498. if (eras[i].since <= val && val <= eras[i].until) {
  55499. return eras[i].narrow;
  55500. }
  55501. if (eras[i].until <= val && val <= eras[i].since) {
  55502. return eras[i].narrow;
  55503. }
  55504. }
  55505. return '';
  55506. }
  55507. function getEraAbbr() {
  55508. var i,
  55509. l,
  55510. val,
  55511. eras = this.localeData().eras();
  55512. for (i = 0, l = eras.length; i < l; ++i) {
  55513. // truncate time
  55514. val = this.clone().startOf('day').valueOf();
  55515. if (eras[i].since <= val && val <= eras[i].until) {
  55516. return eras[i].abbr;
  55517. }
  55518. if (eras[i].until <= val && val <= eras[i].since) {
  55519. return eras[i].abbr;
  55520. }
  55521. }
  55522. return '';
  55523. }
  55524. function getEraYear() {
  55525. var i,
  55526. l,
  55527. dir,
  55528. val,
  55529. eras = this.localeData().eras();
  55530. for (i = 0, l = eras.length; i < l; ++i) {
  55531. dir = eras[i].since <= eras[i].until ? +1 : -1;
  55532. // truncate time
  55533. val = this.clone().startOf('day').valueOf();
  55534. if (
  55535. (eras[i].since <= val && val <= eras[i].until) ||
  55536. (eras[i].until <= val && val <= eras[i].since)
  55537. ) {
  55538. return (
  55539. (this.year() - hooks(eras[i].since).year()) * dir +
  55540. eras[i].offset
  55541. );
  55542. }
  55543. }
  55544. return this.year();
  55545. }
  55546. function erasNameRegex(isStrict) {
  55547. if (!hasOwnProp(this, '_erasNameRegex')) {
  55548. computeErasParse.call(this);
  55549. }
  55550. return isStrict ? this._erasNameRegex : this._erasRegex;
  55551. }
  55552. function erasAbbrRegex(isStrict) {
  55553. if (!hasOwnProp(this, '_erasAbbrRegex')) {
  55554. computeErasParse.call(this);
  55555. }
  55556. return isStrict ? this._erasAbbrRegex : this._erasRegex;
  55557. }
  55558. function erasNarrowRegex(isStrict) {
  55559. if (!hasOwnProp(this, '_erasNarrowRegex')) {
  55560. computeErasParse.call(this);
  55561. }
  55562. return isStrict ? this._erasNarrowRegex : this._erasRegex;
  55563. }
  55564. function matchEraAbbr(isStrict, locale) {
  55565. return locale.erasAbbrRegex(isStrict);
  55566. }
  55567. function matchEraName(isStrict, locale) {
  55568. return locale.erasNameRegex(isStrict);
  55569. }
  55570. function matchEraNarrow(isStrict, locale) {
  55571. return locale.erasNarrowRegex(isStrict);
  55572. }
  55573. function matchEraYearOrdinal(isStrict, locale) {
  55574. return locale._eraYearOrdinalRegex || matchUnsigned;
  55575. }
  55576. function computeErasParse() {
  55577. var abbrPieces = [],
  55578. namePieces = [],
  55579. narrowPieces = [],
  55580. mixedPieces = [],
  55581. i,
  55582. l,
  55583. eras = this.eras();
  55584. for (i = 0, l = eras.length; i < l; ++i) {
  55585. namePieces.push(regexEscape(eras[i].name));
  55586. abbrPieces.push(regexEscape(eras[i].abbr));
  55587. narrowPieces.push(regexEscape(eras[i].narrow));
  55588. mixedPieces.push(regexEscape(eras[i].name));
  55589. mixedPieces.push(regexEscape(eras[i].abbr));
  55590. mixedPieces.push(regexEscape(eras[i].narrow));
  55591. }
  55592. this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  55593. this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i');
  55594. this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i');
  55595. this._erasNarrowRegex = new RegExp(
  55596. '^(' + narrowPieces.join('|') + ')',
  55597. 'i'
  55598. );
  55599. }
  55600. // FORMATTING
  55601. addFormatToken(0, ['gg', 2], 0, function () {
  55602. return this.weekYear() % 100;
  55603. });
  55604. addFormatToken(0, ['GG', 2], 0, function () {
  55605. return this.isoWeekYear() % 100;
  55606. });
  55607. function addWeekYearFormatToken(token, getter) {
  55608. addFormatToken(0, [token, token.length], 0, getter);
  55609. }
  55610. addWeekYearFormatToken('gggg', 'weekYear');
  55611. addWeekYearFormatToken('ggggg', 'weekYear');
  55612. addWeekYearFormatToken('GGGG', 'isoWeekYear');
  55613. addWeekYearFormatToken('GGGGG', 'isoWeekYear');
  55614. // ALIASES
  55615. addUnitAlias('weekYear', 'gg');
  55616. addUnitAlias('isoWeekYear', 'GG');
  55617. // PRIORITY
  55618. addUnitPriority('weekYear', 1);
  55619. addUnitPriority('isoWeekYear', 1);
  55620. // PARSING
  55621. addRegexToken('G', matchSigned);
  55622. addRegexToken('g', matchSigned);
  55623. addRegexToken('GG', match1to2, match2);
  55624. addRegexToken('gg', match1to2, match2);
  55625. addRegexToken('GGGG', match1to4, match4);
  55626. addRegexToken('gggg', match1to4, match4);
  55627. addRegexToken('GGGGG', match1to6, match6);
  55628. addRegexToken('ggggg', match1to6, match6);
  55629. addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (
  55630. input,
  55631. week,
  55632. config,
  55633. token
  55634. ) {
  55635. week[token.substr(0, 2)] = toInt(input);
  55636. });
  55637. addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
  55638. week[token] = hooks.parseTwoDigitYear(input);
  55639. });
  55640. // MOMENTS
  55641. function getSetWeekYear(input) {
  55642. return getSetWeekYearHelper.call(
  55643. this,
  55644. input,
  55645. this.week(),
  55646. this.weekday(),
  55647. this.localeData()._week.dow,
  55648. this.localeData()._week.doy
  55649. );
  55650. }
  55651. function getSetISOWeekYear(input) {
  55652. return getSetWeekYearHelper.call(
  55653. this,
  55654. input,
  55655. this.isoWeek(),
  55656. this.isoWeekday(),
  55657. 1,
  55658. 4
  55659. );
  55660. }
  55661. function getISOWeeksInYear() {
  55662. return weeksInYear(this.year(), 1, 4);
  55663. }
  55664. function getISOWeeksInISOWeekYear() {
  55665. return weeksInYear(this.isoWeekYear(), 1, 4);
  55666. }
  55667. function getWeeksInYear() {
  55668. var weekInfo = this.localeData()._week;
  55669. return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
  55670. }
  55671. function getWeeksInWeekYear() {
  55672. var weekInfo = this.localeData()._week;
  55673. return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy);
  55674. }
  55675. function getSetWeekYearHelper(input, week, weekday, dow, doy) {
  55676. var weeksTarget;
  55677. if (input == null) {
  55678. return weekOfYear(this, dow, doy).year;
  55679. } else {
  55680. weeksTarget = weeksInYear(input, dow, doy);
  55681. if (week > weeksTarget) {
  55682. week = weeksTarget;
  55683. }
  55684. return setWeekAll.call(this, input, week, weekday, dow, doy);
  55685. }
  55686. }
  55687. function setWeekAll(weekYear, week, weekday, dow, doy) {
  55688. var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
  55689. date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
  55690. this.year(date.getUTCFullYear());
  55691. this.month(date.getUTCMonth());
  55692. this.date(date.getUTCDate());
  55693. return this;
  55694. }
  55695. // FORMATTING
  55696. addFormatToken('Q', 0, 'Qo', 'quarter');
  55697. // ALIASES
  55698. addUnitAlias('quarter', 'Q');
  55699. // PRIORITY
  55700. addUnitPriority('quarter', 7);
  55701. // PARSING
  55702. addRegexToken('Q', match1);
  55703. addParseToken('Q', function (input, array) {
  55704. array[MONTH] = (toInt(input) - 1) * 3;
  55705. });
  55706. // MOMENTS
  55707. function getSetQuarter(input) {
  55708. return input == null
  55709. ? Math.ceil((this.month() + 1) / 3)
  55710. : this.month((input - 1) * 3 + (this.month() % 3));
  55711. }
  55712. // FORMATTING
  55713. addFormatToken('D', ['DD', 2], 'Do', 'date');
  55714. // ALIASES
  55715. addUnitAlias('date', 'D');
  55716. // PRIORITY
  55717. addUnitPriority('date', 9);
  55718. // PARSING
  55719. addRegexToken('D', match1to2);
  55720. addRegexToken('DD', match1to2, match2);
  55721. addRegexToken('Do', function (isStrict, locale) {
  55722. // TODO: Remove "ordinalParse" fallback in next major release.
  55723. return isStrict
  55724. ? locale._dayOfMonthOrdinalParse || locale._ordinalParse
  55725. : locale._dayOfMonthOrdinalParseLenient;
  55726. });
  55727. addParseToken(['D', 'DD'], DATE);
  55728. addParseToken('Do', function (input, array) {
  55729. array[DATE] = toInt(input.match(match1to2)[0]);
  55730. });
  55731. // MOMENTS
  55732. var getSetDayOfMonth = makeGetSet('Date', true);
  55733. // FORMATTING
  55734. addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
  55735. // ALIASES
  55736. addUnitAlias('dayOfYear', 'DDD');
  55737. // PRIORITY
  55738. addUnitPriority('dayOfYear', 4);
  55739. // PARSING
  55740. addRegexToken('DDD', match1to3);
  55741. addRegexToken('DDDD', match3);
  55742. addParseToken(['DDD', 'DDDD'], function (input, array, config) {
  55743. config._dayOfYear = toInt(input);
  55744. });
  55745. // HELPERS
  55746. // MOMENTS
  55747. function getSetDayOfYear(input) {
  55748. var dayOfYear =
  55749. Math.round(
  55750. (this.clone().startOf('day') - this.clone().startOf('year')) / 864e5
  55751. ) + 1;
  55752. return input == null ? dayOfYear : this.add(input - dayOfYear, 'd');
  55753. }
  55754. // FORMATTING
  55755. addFormatToken('m', ['mm', 2], 0, 'minute');
  55756. // ALIASES
  55757. addUnitAlias('minute', 'm');
  55758. // PRIORITY
  55759. addUnitPriority('minute', 14);
  55760. // PARSING
  55761. addRegexToken('m', match1to2);
  55762. addRegexToken('mm', match1to2, match2);
  55763. addParseToken(['m', 'mm'], MINUTE);
  55764. // MOMENTS
  55765. var getSetMinute = makeGetSet('Minutes', false);
  55766. // FORMATTING
  55767. addFormatToken('s', ['ss', 2], 0, 'second');
  55768. // ALIASES
  55769. addUnitAlias('second', 's');
  55770. // PRIORITY
  55771. addUnitPriority('second', 15);
  55772. // PARSING
  55773. addRegexToken('s', match1to2);
  55774. addRegexToken('ss', match1to2, match2);
  55775. addParseToken(['s', 'ss'], SECOND);
  55776. // MOMENTS
  55777. var getSetSecond = makeGetSet('Seconds', false);
  55778. // FORMATTING
  55779. addFormatToken('S', 0, 0, function () {
  55780. return ~~(this.millisecond() / 100);
  55781. });
  55782. addFormatToken(0, ['SS', 2], 0, function () {
  55783. return ~~(this.millisecond() / 10);
  55784. });
  55785. addFormatToken(0, ['SSS', 3], 0, 'millisecond');
  55786. addFormatToken(0, ['SSSS', 4], 0, function () {
  55787. return this.millisecond() * 10;
  55788. });
  55789. addFormatToken(0, ['SSSSS', 5], 0, function () {
  55790. return this.millisecond() * 100;
  55791. });
  55792. addFormatToken(0, ['SSSSSS', 6], 0, function () {
  55793. return this.millisecond() * 1000;
  55794. });
  55795. addFormatToken(0, ['SSSSSSS', 7], 0, function () {
  55796. return this.millisecond() * 10000;
  55797. });
  55798. addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
  55799. return this.millisecond() * 100000;
  55800. });
  55801. addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
  55802. return this.millisecond() * 1000000;
  55803. });
  55804. // ALIASES
  55805. addUnitAlias('millisecond', 'ms');
  55806. // PRIORITY
  55807. addUnitPriority('millisecond', 16);
  55808. // PARSING
  55809. addRegexToken('S', match1to3, match1);
  55810. addRegexToken('SS', match1to3, match2);
  55811. addRegexToken('SSS', match1to3, match3);
  55812. var token, getSetMillisecond;
  55813. for (token = 'SSSS'; token.length <= 9; token += 'S') {
  55814. addRegexToken(token, matchUnsigned);
  55815. }
  55816. function parseMs(input, array) {
  55817. array[MILLISECOND] = toInt(('0.' + input) * 1000);
  55818. }
  55819. for (token = 'S'; token.length <= 9; token += 'S') {
  55820. addParseToken(token, parseMs);
  55821. }
  55822. getSetMillisecond = makeGetSet('Milliseconds', false);
  55823. // FORMATTING
  55824. addFormatToken('z', 0, 0, 'zoneAbbr');
  55825. addFormatToken('zz', 0, 0, 'zoneName');
  55826. // MOMENTS
  55827. function getZoneAbbr() {
  55828. return this._isUTC ? 'UTC' : '';
  55829. }
  55830. function getZoneName() {
  55831. return this._isUTC ? 'Coordinated Universal Time' : '';
  55832. }
  55833. var proto = Moment.prototype;
  55834. proto.add = add;
  55835. proto.calendar = calendar$1;
  55836. proto.clone = clone;
  55837. proto.diff = diff;
  55838. proto.endOf = endOf;
  55839. proto.format = format;
  55840. proto.from = from;
  55841. proto.fromNow = fromNow;
  55842. proto.to = to;
  55843. proto.toNow = toNow;
  55844. proto.get = stringGet;
  55845. proto.invalidAt = invalidAt;
  55846. proto.isAfter = isAfter;
  55847. proto.isBefore = isBefore;
  55848. proto.isBetween = isBetween;
  55849. proto.isSame = isSame;
  55850. proto.isSameOrAfter = isSameOrAfter;
  55851. proto.isSameOrBefore = isSameOrBefore;
  55852. proto.isValid = isValid$2;
  55853. proto.lang = lang;
  55854. proto.locale = locale;
  55855. proto.localeData = localeData;
  55856. proto.max = prototypeMax;
  55857. proto.min = prototypeMin;
  55858. proto.parsingFlags = parsingFlags;
  55859. proto.set = stringSet;
  55860. proto.startOf = startOf;
  55861. proto.subtract = subtract;
  55862. proto.toArray = toArray;
  55863. proto.toObject = toObject;
  55864. proto.toDate = toDate;
  55865. proto.toISOString = toISOString;
  55866. proto.inspect = inspect;
  55867. if (typeof Symbol !== 'undefined' && Symbol.for != null) {
  55868. proto[Symbol.for('nodejs.util.inspect.custom')] = function () {
  55869. return 'Moment<' + this.format() + '>';
  55870. };
  55871. }
  55872. proto.toJSON = toJSON;
  55873. proto.toString = toString;
  55874. proto.unix = unix;
  55875. proto.valueOf = valueOf;
  55876. proto.creationData = creationData;
  55877. proto.eraName = getEraName;
  55878. proto.eraNarrow = getEraNarrow;
  55879. proto.eraAbbr = getEraAbbr;
  55880. proto.eraYear = getEraYear;
  55881. proto.year = getSetYear;
  55882. proto.isLeapYear = getIsLeapYear;
  55883. proto.weekYear = getSetWeekYear;
  55884. proto.isoWeekYear = getSetISOWeekYear;
  55885. proto.quarter = proto.quarters = getSetQuarter;
  55886. proto.month = getSetMonth;
  55887. proto.daysInMonth = getDaysInMonth;
  55888. proto.week = proto.weeks = getSetWeek;
  55889. proto.isoWeek = proto.isoWeeks = getSetISOWeek;
  55890. proto.weeksInYear = getWeeksInYear;
  55891. proto.weeksInWeekYear = getWeeksInWeekYear;
  55892. proto.isoWeeksInYear = getISOWeeksInYear;
  55893. proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear;
  55894. proto.date = getSetDayOfMonth;
  55895. proto.day = proto.days = getSetDayOfWeek;
  55896. proto.weekday = getSetLocaleDayOfWeek;
  55897. proto.isoWeekday = getSetISODayOfWeek;
  55898. proto.dayOfYear = getSetDayOfYear;
  55899. proto.hour = proto.hours = getSetHour;
  55900. proto.minute = proto.minutes = getSetMinute;
  55901. proto.second = proto.seconds = getSetSecond;
  55902. proto.millisecond = proto.milliseconds = getSetMillisecond;
  55903. proto.utcOffset = getSetOffset;
  55904. proto.utc = setOffsetToUTC;
  55905. proto.local = setOffsetToLocal;
  55906. proto.parseZone = setOffsetToParsedOffset;
  55907. proto.hasAlignedHourOffset = hasAlignedHourOffset;
  55908. proto.isDST = isDaylightSavingTime;
  55909. proto.isLocal = isLocal;
  55910. proto.isUtcOffset = isUtcOffset;
  55911. proto.isUtc = isUtc;
  55912. proto.isUTC = isUtc;
  55913. proto.zoneAbbr = getZoneAbbr;
  55914. proto.zoneName = getZoneName;
  55915. proto.dates = deprecate(
  55916. 'dates accessor is deprecated. Use date instead.',
  55917. getSetDayOfMonth
  55918. );
  55919. proto.months = deprecate(
  55920. 'months accessor is deprecated. Use month instead',
  55921. getSetMonth
  55922. );
  55923. proto.years = deprecate(
  55924. 'years accessor is deprecated. Use year instead',
  55925. getSetYear
  55926. );
  55927. proto.zone = deprecate(
  55928. 'moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/',
  55929. getSetZone
  55930. );
  55931. proto.isDSTShifted = deprecate(
  55932. 'isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information',
  55933. isDaylightSavingTimeShifted
  55934. );
  55935. function createUnix(input) {
  55936. return createLocal(input * 1000);
  55937. }
  55938. function createInZone() {
  55939. return createLocal.apply(null, arguments).parseZone();
  55940. }
  55941. function preParsePostFormat(string) {
  55942. return string;
  55943. }
  55944. var proto$1 = Locale.prototype;
  55945. proto$1.calendar = calendar;
  55946. proto$1.longDateFormat = longDateFormat;
  55947. proto$1.invalidDate = invalidDate;
  55948. proto$1.ordinal = ordinal;
  55949. proto$1.preparse = preParsePostFormat;
  55950. proto$1.postformat = preParsePostFormat;
  55951. proto$1.relativeTime = relativeTime;
  55952. proto$1.pastFuture = pastFuture;
  55953. proto$1.set = set;
  55954. proto$1.eras = localeEras;
  55955. proto$1.erasParse = localeErasParse;
  55956. proto$1.erasConvertYear = localeErasConvertYear;
  55957. proto$1.erasAbbrRegex = erasAbbrRegex;
  55958. proto$1.erasNameRegex = erasNameRegex;
  55959. proto$1.erasNarrowRegex = erasNarrowRegex;
  55960. proto$1.months = localeMonths;
  55961. proto$1.monthsShort = localeMonthsShort;
  55962. proto$1.monthsParse = localeMonthsParse;
  55963. proto$1.monthsRegex = monthsRegex;
  55964. proto$1.monthsShortRegex = monthsShortRegex;
  55965. proto$1.week = localeWeek;
  55966. proto$1.firstDayOfYear = localeFirstDayOfYear;
  55967. proto$1.firstDayOfWeek = localeFirstDayOfWeek;
  55968. proto$1.weekdays = localeWeekdays;
  55969. proto$1.weekdaysMin = localeWeekdaysMin;
  55970. proto$1.weekdaysShort = localeWeekdaysShort;
  55971. proto$1.weekdaysParse = localeWeekdaysParse;
  55972. proto$1.weekdaysRegex = weekdaysRegex;
  55973. proto$1.weekdaysShortRegex = weekdaysShortRegex;
  55974. proto$1.weekdaysMinRegex = weekdaysMinRegex;
  55975. proto$1.isPM = localeIsPM;
  55976. proto$1.meridiem = localeMeridiem;
  55977. function get$1(format, index, field, setter) {
  55978. var locale = getLocale(),
  55979. utc = createUTC().set(setter, index);
  55980. return locale[field](utc, format);
  55981. }
  55982. function listMonthsImpl(format, index, field) {
  55983. if (isNumber(format)) {
  55984. index = format;
  55985. format = undefined;
  55986. }
  55987. format = format || '';
  55988. if (index != null) {
  55989. return get$1(format, index, field, 'month');
  55990. }
  55991. var i,
  55992. out = [];
  55993. for (i = 0; i < 12; i++) {
  55994. out[i] = get$1(format, i, field, 'month');
  55995. }
  55996. return out;
  55997. }
  55998. // ()
  55999. // (5)
  56000. // (fmt, 5)
  56001. // (fmt)
  56002. // (true)
  56003. // (true, 5)
  56004. // (true, fmt, 5)
  56005. // (true, fmt)
  56006. function listWeekdaysImpl(localeSorted, format, index, field) {
  56007. if (typeof localeSorted === 'boolean') {
  56008. if (isNumber(format)) {
  56009. index = format;
  56010. format = undefined;
  56011. }
  56012. format = format || '';
  56013. } else {
  56014. format = localeSorted;
  56015. index = format;
  56016. localeSorted = false;
  56017. if (isNumber(format)) {
  56018. index = format;
  56019. format = undefined;
  56020. }
  56021. format = format || '';
  56022. }
  56023. var locale = getLocale(),
  56024. shift = localeSorted ? locale._week.dow : 0,
  56025. i,
  56026. out = [];
  56027. if (index != null) {
  56028. return get$1(format, (index + shift) % 7, field, 'day');
  56029. }
  56030. for (i = 0; i < 7; i++) {
  56031. out[i] = get$1(format, (i + shift) % 7, field, 'day');
  56032. }
  56033. return out;
  56034. }
  56035. function listMonths(format, index) {
  56036. return listMonthsImpl(format, index, 'months');
  56037. }
  56038. function listMonthsShort(format, index) {
  56039. return listMonthsImpl(format, index, 'monthsShort');
  56040. }
  56041. function listWeekdays(localeSorted, format, index) {
  56042. return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
  56043. }
  56044. function listWeekdaysShort(localeSorted, format, index) {
  56045. return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
  56046. }
  56047. function listWeekdaysMin(localeSorted, format, index) {
  56048. return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
  56049. }
  56050. getSetGlobalLocale('en', {
  56051. eras: [
  56052. {
  56053. since: '0001-01-01',
  56054. until: +Infinity,
  56055. offset: 1,
  56056. name: 'Anno Domini',
  56057. narrow: 'AD',
  56058. abbr: 'AD',
  56059. },
  56060. {
  56061. since: '0000-12-31',
  56062. until: -Infinity,
  56063. offset: 1,
  56064. name: 'Before Christ',
  56065. narrow: 'BC',
  56066. abbr: 'BC',
  56067. },
  56068. ],
  56069. dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
  56070. ordinal: function (number) {
  56071. var b = number % 10,
  56072. output =
  56073. toInt((number % 100) / 10) === 1
  56074. ? 'th'
  56075. : b === 1
  56076. ? 'st'
  56077. : b === 2
  56078. ? 'nd'
  56079. : b === 3
  56080. ? 'rd'
  56081. : 'th';
  56082. return number + output;
  56083. },
  56084. });
  56085. // Side effect imports
  56086. hooks.lang = deprecate(
  56087. 'moment.lang is deprecated. Use moment.locale instead.',
  56088. getSetGlobalLocale
  56089. );
  56090. hooks.langData = deprecate(
  56091. 'moment.langData is deprecated. Use moment.localeData instead.',
  56092. getLocale
  56093. );
  56094. var mathAbs = Math.abs;
  56095. function abs() {
  56096. var data = this._data;
  56097. this._milliseconds = mathAbs(this._milliseconds);
  56098. this._days = mathAbs(this._days);
  56099. this._months = mathAbs(this._months);
  56100. data.milliseconds = mathAbs(data.milliseconds);
  56101. data.seconds = mathAbs(data.seconds);
  56102. data.minutes = mathAbs(data.minutes);
  56103. data.hours = mathAbs(data.hours);
  56104. data.months = mathAbs(data.months);
  56105. data.years = mathAbs(data.years);
  56106. return this;
  56107. }
  56108. function addSubtract$1(duration, input, value, direction) {
  56109. var other = createDuration(input, value);
  56110. duration._milliseconds += direction * other._milliseconds;
  56111. duration._days += direction * other._days;
  56112. duration._months += direction * other._months;
  56113. return duration._bubble();
  56114. }
  56115. // supports only 2.0-style add(1, 's') or add(duration)
  56116. function add$1(input, value) {
  56117. return addSubtract$1(this, input, value, 1);
  56118. }
  56119. // supports only 2.0-style subtract(1, 's') or subtract(duration)
  56120. function subtract$1(input, value) {
  56121. return addSubtract$1(this, input, value, -1);
  56122. }
  56123. function absCeil(number) {
  56124. if (number < 0) {
  56125. return Math.floor(number);
  56126. } else {
  56127. return Math.ceil(number);
  56128. }
  56129. }
  56130. function bubble() {
  56131. var milliseconds = this._milliseconds,
  56132. days = this._days,
  56133. months = this._months,
  56134. data = this._data,
  56135. seconds,
  56136. minutes,
  56137. hours,
  56138. years,
  56139. monthsFromDays;
  56140. // if we have a mix of positive and negative values, bubble down first
  56141. // check: https://github.com/moment/moment/issues/2166
  56142. if (
  56143. !(
  56144. (milliseconds >= 0 && days >= 0 && months >= 0) ||
  56145. (milliseconds <= 0 && days <= 0 && months <= 0)
  56146. )
  56147. ) {
  56148. milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
  56149. days = 0;
  56150. months = 0;
  56151. }
  56152. // The following code bubbles up values, see the tests for
  56153. // examples of what that means.
  56154. data.milliseconds = milliseconds % 1000;
  56155. seconds = absFloor(milliseconds / 1000);
  56156. data.seconds = seconds % 60;
  56157. minutes = absFloor(seconds / 60);
  56158. data.minutes = minutes % 60;
  56159. hours = absFloor(minutes / 60);
  56160. data.hours = hours % 24;
  56161. days += absFloor(hours / 24);
  56162. // convert days to months
  56163. monthsFromDays = absFloor(daysToMonths(days));
  56164. months += monthsFromDays;
  56165. days -= absCeil(monthsToDays(monthsFromDays));
  56166. // 12 months -> 1 year
  56167. years = absFloor(months / 12);
  56168. months %= 12;
  56169. data.days = days;
  56170. data.months = months;
  56171. data.years = years;
  56172. return this;
  56173. }
  56174. function daysToMonths(days) {
  56175. // 400 years have 146097 days (taking into account leap year rules)
  56176. // 400 years have 12 months === 4800
  56177. return (days * 4800) / 146097;
  56178. }
  56179. function monthsToDays(months) {
  56180. // the reverse of daysToMonths
  56181. return (months * 146097) / 4800;
  56182. }
  56183. function as(units) {
  56184. if (!this.isValid()) {
  56185. return NaN;
  56186. }
  56187. var days,
  56188. months,
  56189. milliseconds = this._milliseconds;
  56190. units = normalizeUnits(units);
  56191. if (units === 'month' || units === 'quarter' || units === 'year') {
  56192. days = this._days + milliseconds / 864e5;
  56193. months = this._months + daysToMonths(days);
  56194. switch (units) {
  56195. case 'month':
  56196. return months;
  56197. case 'quarter':
  56198. return months / 3;
  56199. case 'year':
  56200. return months / 12;
  56201. }
  56202. } else {
  56203. // handle milliseconds separately because of floating point math errors (issue #1867)
  56204. days = this._days + Math.round(monthsToDays(this._months));
  56205. switch (units) {
  56206. case 'week':
  56207. return days / 7 + milliseconds / 6048e5;
  56208. case 'day':
  56209. return days + milliseconds / 864e5;
  56210. case 'hour':
  56211. return days * 24 + milliseconds / 36e5;
  56212. case 'minute':
  56213. return days * 1440 + milliseconds / 6e4;
  56214. case 'second':
  56215. return days * 86400 + milliseconds / 1000;
  56216. // Math.floor prevents floating point math errors here
  56217. case 'millisecond':
  56218. return Math.floor(days * 864e5) + milliseconds;
  56219. default:
  56220. throw new Error('Unknown unit ' + units);
  56221. }
  56222. }
  56223. }
  56224. // TODO: Use this.as('ms')?
  56225. function valueOf$1() {
  56226. if (!this.isValid()) {
  56227. return NaN;
  56228. }
  56229. return (
  56230. this._milliseconds +
  56231. this._days * 864e5 +
  56232. (this._months % 12) * 2592e6 +
  56233. toInt(this._months / 12) * 31536e6
  56234. );
  56235. }
  56236. function makeAs(alias) {
  56237. return function () {
  56238. return this.as(alias);
  56239. };
  56240. }
  56241. var asMilliseconds = makeAs('ms'),
  56242. asSeconds = makeAs('s'),
  56243. asMinutes = makeAs('m'),
  56244. asHours = makeAs('h'),
  56245. asDays = makeAs('d'),
  56246. asWeeks = makeAs('w'),
  56247. asMonths = makeAs('M'),
  56248. asQuarters = makeAs('Q'),
  56249. asYears = makeAs('y');
  56250. function clone$1() {
  56251. return createDuration(this);
  56252. }
  56253. function get$2(units) {
  56254. units = normalizeUnits(units);
  56255. return this.isValid() ? this[units + 's']() : NaN;
  56256. }
  56257. function makeGetter(name) {
  56258. return function () {
  56259. return this.isValid() ? this._data[name] : NaN;
  56260. };
  56261. }
  56262. var milliseconds = makeGetter('milliseconds'),
  56263. seconds = makeGetter('seconds'),
  56264. minutes = makeGetter('minutes'),
  56265. hours = makeGetter('hours'),
  56266. days = makeGetter('days'),
  56267. months = makeGetter('months'),
  56268. years = makeGetter('years');
  56269. function weeks() {
  56270. return absFloor(this.days() / 7);
  56271. }
  56272. var round = Math.round,
  56273. thresholds = {
  56274. ss: 44, // a few seconds to seconds
  56275. s: 45, // seconds to minute
  56276. m: 45, // minutes to hour
  56277. h: 22, // hours to day
  56278. d: 26, // days to month/week
  56279. w: null, // weeks to month
  56280. M: 11, // months to year
  56281. };
  56282. // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
  56283. function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
  56284. return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
  56285. }
  56286. function relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) {
  56287. var duration = createDuration(posNegDuration).abs(),
  56288. seconds = round(duration.as('s')),
  56289. minutes = round(duration.as('m')),
  56290. hours = round(duration.as('h')),
  56291. days = round(duration.as('d')),
  56292. months = round(duration.as('M')),
  56293. weeks = round(duration.as('w')),
  56294. years = round(duration.as('y')),
  56295. a =
  56296. (seconds <= thresholds.ss && ['s', seconds]) ||
  56297. (seconds < thresholds.s && ['ss', seconds]) ||
  56298. (minutes <= 1 && ['m']) ||
  56299. (minutes < thresholds.m && ['mm', minutes]) ||
  56300. (hours <= 1 && ['h']) ||
  56301. (hours < thresholds.h && ['hh', hours]) ||
  56302. (days <= 1 && ['d']) ||
  56303. (days < thresholds.d && ['dd', days]);
  56304. if (thresholds.w != null) {
  56305. a =
  56306. a ||
  56307. (weeks <= 1 && ['w']) ||
  56308. (weeks < thresholds.w && ['ww', weeks]);
  56309. }
  56310. a = a ||
  56311. (months <= 1 && ['M']) ||
  56312. (months < thresholds.M && ['MM', months]) ||
  56313. (years <= 1 && ['y']) || ['yy', years];
  56314. a[2] = withoutSuffix;
  56315. a[3] = +posNegDuration > 0;
  56316. a[4] = locale;
  56317. return substituteTimeAgo.apply(null, a);
  56318. }
  56319. // This function allows you to set the rounding function for relative time strings
  56320. function getSetRelativeTimeRounding(roundingFunction) {
  56321. if (roundingFunction === undefined) {
  56322. return round;
  56323. }
  56324. if (typeof roundingFunction === 'function') {
  56325. round = roundingFunction;
  56326. return true;
  56327. }
  56328. return false;
  56329. }
  56330. // This function allows you to set a threshold for relative time strings
  56331. function getSetRelativeTimeThreshold(threshold, limit) {
  56332. if (thresholds[threshold] === undefined) {
  56333. return false;
  56334. }
  56335. if (limit === undefined) {
  56336. return thresholds[threshold];
  56337. }
  56338. thresholds[threshold] = limit;
  56339. if (threshold === 's') {
  56340. thresholds.ss = limit - 1;
  56341. }
  56342. return true;
  56343. }
  56344. function humanize(argWithSuffix, argThresholds) {
  56345. if (!this.isValid()) {
  56346. return this.localeData().invalidDate();
  56347. }
  56348. var withSuffix = false,
  56349. th = thresholds,
  56350. locale,
  56351. output;
  56352. if (typeof argWithSuffix === 'object') {
  56353. argThresholds = argWithSuffix;
  56354. argWithSuffix = false;
  56355. }
  56356. if (typeof argWithSuffix === 'boolean') {
  56357. withSuffix = argWithSuffix;
  56358. }
  56359. if (typeof argThresholds === 'object') {
  56360. th = Object.assign({}, thresholds, argThresholds);
  56361. if (argThresholds.s != null && argThresholds.ss == null) {
  56362. th.ss = argThresholds.s - 1;
  56363. }
  56364. }
  56365. locale = this.localeData();
  56366. output = relativeTime$1(this, !withSuffix, th, locale);
  56367. if (withSuffix) {
  56368. output = locale.pastFuture(+this, output);
  56369. }
  56370. return locale.postformat(output);
  56371. }
  56372. var abs$1 = Math.abs;
  56373. function sign(x) {
  56374. return (x > 0) - (x < 0) || +x;
  56375. }
  56376. function toISOString$1() {
  56377. // for ISO strings we do not use the normal bubbling rules:
  56378. // * milliseconds bubble up until they become hours
  56379. // * days do not bubble at all
  56380. // * months bubble up until they become years
  56381. // This is because there is no context-free conversion between hours and days
  56382. // (think of clock changes)
  56383. // and also not between days and months (28-31 days per month)
  56384. if (!this.isValid()) {
  56385. return this.localeData().invalidDate();
  56386. }
  56387. var seconds = abs$1(this._milliseconds) / 1000,
  56388. days = abs$1(this._days),
  56389. months = abs$1(this._months),
  56390. minutes,
  56391. hours,
  56392. years,
  56393. s,
  56394. total = this.asSeconds(),
  56395. totalSign,
  56396. ymSign,
  56397. daysSign,
  56398. hmsSign;
  56399. if (!total) {
  56400. // this is the same as C#'s (Noda) and python (isodate)...
  56401. // but not other JS (goog.date)
  56402. return 'P0D';
  56403. }
  56404. // 3600 seconds -> 60 minutes -> 1 hour
  56405. minutes = absFloor(seconds / 60);
  56406. hours = absFloor(minutes / 60);
  56407. seconds %= 60;
  56408. minutes %= 60;
  56409. // 12 months -> 1 year
  56410. years = absFloor(months / 12);
  56411. months %= 12;
  56412. // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
  56413. s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : '';
  56414. totalSign = total < 0 ? '-' : '';
  56415. ymSign = sign(this._months) !== sign(total) ? '-' : '';
  56416. daysSign = sign(this._days) !== sign(total) ? '-' : '';
  56417. hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';
  56418. return (
  56419. totalSign +
  56420. 'P' +
  56421. (years ? ymSign + years + 'Y' : '') +
  56422. (months ? ymSign + months + 'M' : '') +
  56423. (days ? daysSign + days + 'D' : '') +
  56424. (hours || minutes || seconds ? 'T' : '') +
  56425. (hours ? hmsSign + hours + 'H' : '') +
  56426. (minutes ? hmsSign + minutes + 'M' : '') +
  56427. (seconds ? hmsSign + s + 'S' : '')
  56428. );
  56429. }
  56430. var proto$2 = Duration.prototype;
  56431. proto$2.isValid = isValid$1;
  56432. proto$2.abs = abs;
  56433. proto$2.add = add$1;
  56434. proto$2.subtract = subtract$1;
  56435. proto$2.as = as;
  56436. proto$2.asMilliseconds = asMilliseconds;
  56437. proto$2.asSeconds = asSeconds;
  56438. proto$2.asMinutes = asMinutes;
  56439. proto$2.asHours = asHours;
  56440. proto$2.asDays = asDays;
  56441. proto$2.asWeeks = asWeeks;
  56442. proto$2.asMonths = asMonths;
  56443. proto$2.asQuarters = asQuarters;
  56444. proto$2.asYears = asYears;
  56445. proto$2.valueOf = valueOf$1;
  56446. proto$2._bubble = bubble;
  56447. proto$2.clone = clone$1;
  56448. proto$2.get = get$2;
  56449. proto$2.milliseconds = milliseconds;
  56450. proto$2.seconds = seconds;
  56451. proto$2.minutes = minutes;
  56452. proto$2.hours = hours;
  56453. proto$2.days = days;
  56454. proto$2.weeks = weeks;
  56455. proto$2.months = months;
  56456. proto$2.years = years;
  56457. proto$2.humanize = humanize;
  56458. proto$2.toISOString = toISOString$1;
  56459. proto$2.toString = toISOString$1;
  56460. proto$2.toJSON = toISOString$1;
  56461. proto$2.locale = locale;
  56462. proto$2.localeData = localeData;
  56463. proto$2.toIsoString = deprecate(
  56464. 'toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)',
  56465. toISOString$1
  56466. );
  56467. proto$2.lang = lang;
  56468. // FORMATTING
  56469. addFormatToken('X', 0, 0, 'unix');
  56470. addFormatToken('x', 0, 0, 'valueOf');
  56471. // PARSING
  56472. addRegexToken('x', matchSigned);
  56473. addRegexToken('X', matchTimestamp);
  56474. addParseToken('X', function (input, array, config) {
  56475. config._d = new Date(parseFloat(input) * 1000);
  56476. });
  56477. addParseToken('x', function (input, array, config) {
  56478. config._d = new Date(toInt(input));
  56479. });
  56480. //! moment.js
  56481. hooks.version = '2.28.0';
  56482. setHookCallback(createLocal);
  56483. hooks.fn = proto;
  56484. hooks.min = min;
  56485. hooks.max = max;
  56486. hooks.now = now;
  56487. hooks.utc = createUTC;
  56488. hooks.unix = createUnix;
  56489. hooks.months = listMonths;
  56490. hooks.isDate = isDate;
  56491. hooks.locale = getSetGlobalLocale;
  56492. hooks.invalid = createInvalid;
  56493. hooks.duration = createDuration;
  56494. hooks.isMoment = isMoment;
  56495. hooks.weekdays = listWeekdays;
  56496. hooks.parseZone = createInZone;
  56497. hooks.localeData = getLocale;
  56498. hooks.isDuration = isDuration;
  56499. hooks.monthsShort = listMonthsShort;
  56500. hooks.weekdaysMin = listWeekdaysMin;
  56501. hooks.defineLocale = defineLocale;
  56502. hooks.updateLocale = updateLocale;
  56503. hooks.locales = listLocales;
  56504. hooks.weekdaysShort = listWeekdaysShort;
  56505. hooks.normalizeUnits = normalizeUnits;
  56506. hooks.relativeTimeRounding = getSetRelativeTimeRounding;
  56507. hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
  56508. hooks.calendarFormat = getCalendarFormat;
  56509. hooks.prototype = proto;
  56510. // currently HTML5 input type only supports 24-hour formats
  56511. hooks.HTML5_FMT = {
  56512. DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // <input type="datetime-local" />
  56513. DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // <input type="datetime-local" step="1" />
  56514. DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // <input type="datetime-local" step="0.001" />
  56515. DATE: 'YYYY-MM-DD', // <input type="date" />
  56516. TIME: 'HH:mm', // <input type="time" />
  56517. TIME_SECONDS: 'HH:mm:ss', // <input type="time" step="1" />
  56518. TIME_MS: 'HH:mm:ss.SSS', // <input type="time" step="0.001" />
  56519. WEEK: 'GGGG-[W]WW', // <input type="week" />
  56520. MONTH: 'YYYY-MM', // <input type="month" />
  56521. };
  56522. return hooks;
  56523. })));
  56524. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
  56525. /***/ }),
  56526. /***/ "./node_modules/ms/index.js":
  56527. /*!**********************************!*\
  56528. !*** ./node_modules/ms/index.js ***!
  56529. \**********************************/
  56530. /*! no static exports found */
  56531. /***/ (function(module, exports) {
  56532. /**
  56533. * Helpers.
  56534. */
  56535. var s = 1000;
  56536. var m = s * 60;
  56537. var h = m * 60;
  56538. var d = h * 24;
  56539. var y = d * 365.25;
  56540. /**
  56541. * Parse or format the given `val`.
  56542. *
  56543. * Options:
  56544. *
  56545. * - `long` verbose formatting [false]
  56546. *
  56547. * @param {String|Number} val
  56548. * @param {Object} [options]
  56549. * @throws {Error} throw an error if val is not a non-empty string or a number
  56550. * @return {String|Number}
  56551. * @api public
  56552. */
  56553. module.exports = function(val, options) {
  56554. options = options || {};
  56555. var type = typeof val;
  56556. if (type === 'string' && val.length > 0) {
  56557. return parse(val);
  56558. } else if (type === 'number' && isNaN(val) === false) {
  56559. return options.long ? fmtLong(val) : fmtShort(val);
  56560. }
  56561. throw new Error(
  56562. 'val is not a non-empty string or a valid number. val=' +
  56563. JSON.stringify(val)
  56564. );
  56565. };
  56566. /**
  56567. * Parse the given `str` and return milliseconds.
  56568. *
  56569. * @param {String} str
  56570. * @return {Number}
  56571. * @api private
  56572. */
  56573. function parse(str) {
  56574. str = String(str);
  56575. if (str.length > 100) {
  56576. return;
  56577. }
  56578. var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
  56579. str
  56580. );
  56581. if (!match) {
  56582. return;
  56583. }
  56584. var n = parseFloat(match[1]);
  56585. var type = (match[2] || 'ms').toLowerCase();
  56586. switch (type) {
  56587. case 'years':
  56588. case 'year':
  56589. case 'yrs':
  56590. case 'yr':
  56591. case 'y':
  56592. return n * y;
  56593. case 'days':
  56594. case 'day':
  56595. case 'd':
  56596. return n * d;
  56597. case 'hours':
  56598. case 'hour':
  56599. case 'hrs':
  56600. case 'hr':
  56601. case 'h':
  56602. return n * h;
  56603. case 'minutes':
  56604. case 'minute':
  56605. case 'mins':
  56606. case 'min':
  56607. case 'm':
  56608. return n * m;
  56609. case 'seconds':
  56610. case 'second':
  56611. case 'secs':
  56612. case 'sec':
  56613. case 's':
  56614. return n * s;
  56615. case 'milliseconds':
  56616. case 'millisecond':
  56617. case 'msecs':
  56618. case 'msec':
  56619. case 'ms':
  56620. return n;
  56621. default:
  56622. return undefined;
  56623. }
  56624. }
  56625. /**
  56626. * Short format for `ms`.
  56627. *
  56628. * @param {Number} ms
  56629. * @return {String}
  56630. * @api private
  56631. */
  56632. function fmtShort(ms) {
  56633. if (ms >= d) {
  56634. return Math.round(ms / d) + 'd';
  56635. }
  56636. if (ms >= h) {
  56637. return Math.round(ms / h) + 'h';
  56638. }
  56639. if (ms >= m) {
  56640. return Math.round(ms / m) + 'm';
  56641. }
  56642. if (ms >= s) {
  56643. return Math.round(ms / s) + 's';
  56644. }
  56645. return ms + 'ms';
  56646. }
  56647. /**
  56648. * Long format for `ms`.
  56649. *
  56650. * @param {Number} ms
  56651. * @return {String}
  56652. * @api private
  56653. */
  56654. function fmtLong(ms) {
  56655. return plural(ms, d, 'day') ||
  56656. plural(ms, h, 'hour') ||
  56657. plural(ms, m, 'minute') ||
  56658. plural(ms, s, 'second') ||
  56659. ms + ' ms';
  56660. }
  56661. /**
  56662. * Pluralization helper.
  56663. */
  56664. function plural(ms, n, name) {
  56665. if (ms < n) {
  56666. return;
  56667. }
  56668. if (ms < n * 1.5) {
  56669. return Math.floor(ms / n) + ' ' + name;
  56670. }
  56671. return Math.ceil(ms / n) + ' ' + name + 's';
  56672. }
  56673. /***/ }),
  56674. /***/ "./node_modules/parseqs/index.js":
  56675. /*!***************************************!*\
  56676. !*** ./node_modules/parseqs/index.js ***!
  56677. \***************************************/
  56678. /*! no static exports found */
  56679. /***/ (function(module, exports) {
  56680. /**
  56681. * Compiles a querystring
  56682. * Returns string representation of the object
  56683. *
  56684. * @param {Object}
  56685. * @api private
  56686. */
  56687. exports.encode = function (obj) {
  56688. var str = '';
  56689. for (var i in obj) {
  56690. if (obj.hasOwnProperty(i)) {
  56691. if (str.length) str += '&';
  56692. str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]);
  56693. }
  56694. }
  56695. return str;
  56696. };
  56697. /**
  56698. * Parses a simple querystring into an object
  56699. *
  56700. * @param {String} qs
  56701. * @api private
  56702. */
  56703. exports.decode = function(qs){
  56704. var qry = {};
  56705. var pairs = qs.split('&');
  56706. for (var i = 0, l = pairs.length; i < l; i++) {
  56707. var pair = pairs[i].split('=');
  56708. qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);
  56709. }
  56710. return qry;
  56711. };
  56712. /***/ }),
  56713. /***/ "./node_modules/parseuri/index.js":
  56714. /*!****************************************!*\
  56715. !*** ./node_modules/parseuri/index.js ***!
  56716. \****************************************/
  56717. /*! no static exports found */
  56718. /***/ (function(module, exports) {
  56719. /**
  56720. * Parses an URI
  56721. *
  56722. * @author Steven Levithan <stevenlevithan.com> (MIT license)
  56723. * @api private
  56724. */
  56725. var re = /^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/;
  56726. var parts = [
  56727. 'source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'
  56728. ];
  56729. module.exports = function parseuri(str) {
  56730. var src = str,
  56731. b = str.indexOf('['),
  56732. e = str.indexOf(']');
  56733. if (b != -1 && e != -1) {
  56734. str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length);
  56735. }
  56736. var m = re.exec(str || ''),
  56737. uri = {},
  56738. i = 14;
  56739. while (i--) {
  56740. uri[parts[i]] = m[i] || '';
  56741. }
  56742. if (b != -1 && e != -1) {
  56743. uri.source = src;
  56744. uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':');
  56745. uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':');
  56746. uri.ipv6uri = true;
  56747. }
  56748. return uri;
  56749. };
  56750. /***/ }),
  56751. /***/ "./node_modules/popper.js/dist/esm/popper.js":
  56752. /*!***************************************************!*\
  56753. !*** ./node_modules/popper.js/dist/esm/popper.js ***!
  56754. \***************************************************/
  56755. /*! exports provided: default */
  56756. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56757. "use strict";
  56758. __webpack_require__.r(__webpack_exports__);
  56759. /* WEBPACK VAR INJECTION */(function(global) {/**!
  56760. * @fileOverview Kickass library to create and place poppers near their reference elements.
  56761. * @version 1.16.1
  56762. * @license
  56763. * Copyright (c) 2016 Federico Zivolo and contributors
  56764. *
  56765. * Permission is hereby granted, free of charge, to any person obtaining a copy
  56766. * of this software and associated documentation files (the "Software"), to deal
  56767. * in the Software without restriction, including without limitation the rights
  56768. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  56769. * copies of the Software, and to permit persons to whom the Software is
  56770. * furnished to do so, subject to the following conditions:
  56771. *
  56772. * The above copyright notice and this permission notice shall be included in all
  56773. * copies or substantial portions of the Software.
  56774. *
  56775. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  56776. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  56777. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  56778. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  56779. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  56780. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  56781. * SOFTWARE.
  56782. */
  56783. var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined';
  56784. var timeoutDuration = function () {
  56785. var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
  56786. for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
  56787. if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
  56788. return 1;
  56789. }
  56790. }
  56791. return 0;
  56792. }();
  56793. function microtaskDebounce(fn) {
  56794. var called = false;
  56795. return function () {
  56796. if (called) {
  56797. return;
  56798. }
  56799. called = true;
  56800. window.Promise.resolve().then(function () {
  56801. called = false;
  56802. fn();
  56803. });
  56804. };
  56805. }
  56806. function taskDebounce(fn) {
  56807. var scheduled = false;
  56808. return function () {
  56809. if (!scheduled) {
  56810. scheduled = true;
  56811. setTimeout(function () {
  56812. scheduled = false;
  56813. fn();
  56814. }, timeoutDuration);
  56815. }
  56816. };
  56817. }
  56818. var supportsMicroTasks = isBrowser && window.Promise;
  56819. /**
  56820. * Create a debounced version of a method, that's asynchronously deferred
  56821. * but called in the minimum time possible.
  56822. *
  56823. * @method
  56824. * @memberof Popper.Utils
  56825. * @argument {Function} fn
  56826. * @returns {Function}
  56827. */
  56828. var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;
  56829. /**
  56830. * Check if the given variable is a function
  56831. * @method
  56832. * @memberof Popper.Utils
  56833. * @argument {Any} functionToCheck - variable to check
  56834. * @returns {Boolean} answer to: is a function?
  56835. */
  56836. function isFunction(functionToCheck) {
  56837. var getType = {};
  56838. return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
  56839. }
  56840. /**
  56841. * Get CSS computed property of the given element
  56842. * @method
  56843. * @memberof Popper.Utils
  56844. * @argument {Eement} element
  56845. * @argument {String} property
  56846. */
  56847. function getStyleComputedProperty(element, property) {
  56848. if (element.nodeType !== 1) {
  56849. return [];
  56850. }
  56851. // NOTE: 1 DOM access here
  56852. var window = element.ownerDocument.defaultView;
  56853. var css = window.getComputedStyle(element, null);
  56854. return property ? css[property] : css;
  56855. }
  56856. /**
  56857. * Returns the parentNode or the host of the element
  56858. * @method
  56859. * @memberof Popper.Utils
  56860. * @argument {Element} element
  56861. * @returns {Element} parent
  56862. */
  56863. function getParentNode(element) {
  56864. if (element.nodeName === 'HTML') {
  56865. return element;
  56866. }
  56867. return element.parentNode || element.host;
  56868. }
  56869. /**
  56870. * Returns the scrolling parent of the given element
  56871. * @method
  56872. * @memberof Popper.Utils
  56873. * @argument {Element} element
  56874. * @returns {Element} scroll parent
  56875. */
  56876. function getScrollParent(element) {
  56877. // Return body, `getScroll` will take care to get the correct `scrollTop` from it
  56878. if (!element) {
  56879. return document.body;
  56880. }
  56881. switch (element.nodeName) {
  56882. case 'HTML':
  56883. case 'BODY':
  56884. return element.ownerDocument.body;
  56885. case '#document':
  56886. return element.body;
  56887. }
  56888. // Firefox want us to check `-x` and `-y` variations as well
  56889. var _getStyleComputedProp = getStyleComputedProperty(element),
  56890. overflow = _getStyleComputedProp.overflow,
  56891. overflowX = _getStyleComputedProp.overflowX,
  56892. overflowY = _getStyleComputedProp.overflowY;
  56893. if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
  56894. return element;
  56895. }
  56896. return getScrollParent(getParentNode(element));
  56897. }
  56898. /**
  56899. * Returns the reference node of the reference object, or the reference object itself.
  56900. * @method
  56901. * @memberof Popper.Utils
  56902. * @param {Element|Object} reference - the reference element (the popper will be relative to this)
  56903. * @returns {Element} parent
  56904. */
  56905. function getReferenceNode(reference) {
  56906. return reference && reference.referenceNode ? reference.referenceNode : reference;
  56907. }
  56908. var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);
  56909. var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);
  56910. /**
  56911. * Determines if the browser is Internet Explorer
  56912. * @method
  56913. * @memberof Popper.Utils
  56914. * @param {Number} version to check
  56915. * @returns {Boolean} isIE
  56916. */
  56917. function isIE(version) {
  56918. if (version === 11) {
  56919. return isIE11;
  56920. }
  56921. if (version === 10) {
  56922. return isIE10;
  56923. }
  56924. return isIE11 || isIE10;
  56925. }
  56926. /**
  56927. * Returns the offset parent of the given element
  56928. * @method
  56929. * @memberof Popper.Utils
  56930. * @argument {Element} element
  56931. * @returns {Element} offset parent
  56932. */
  56933. function getOffsetParent(element) {
  56934. if (!element) {
  56935. return document.documentElement;
  56936. }
  56937. var noOffsetParent = isIE(10) ? document.body : null;
  56938. // NOTE: 1 DOM access here
  56939. var offsetParent = element.offsetParent || null;
  56940. // Skip hidden elements which don't have an offsetParent
  56941. while (offsetParent === noOffsetParent && element.nextElementSibling) {
  56942. offsetParent = (element = element.nextElementSibling).offsetParent;
  56943. }
  56944. var nodeName = offsetParent && offsetParent.nodeName;
  56945. if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
  56946. return element ? element.ownerDocument.documentElement : document.documentElement;
  56947. }
  56948. // .offsetParent will return the closest TH, TD or TABLE in case
  56949. // no offsetParent is present, I hate this job...
  56950. if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {
  56951. return getOffsetParent(offsetParent);
  56952. }
  56953. return offsetParent;
  56954. }
  56955. function isOffsetContainer(element) {
  56956. var nodeName = element.nodeName;
  56957. if (nodeName === 'BODY') {
  56958. return false;
  56959. }
  56960. return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;
  56961. }
  56962. /**
  56963. * Finds the root node (document, shadowDOM root) of the given element
  56964. * @method
  56965. * @memberof Popper.Utils
  56966. * @argument {Element} node
  56967. * @returns {Element} root node
  56968. */
  56969. function getRoot(node) {
  56970. if (node.parentNode !== null) {
  56971. return getRoot(node.parentNode);
  56972. }
  56973. return node;
  56974. }
  56975. /**
  56976. * Finds the offset parent common to the two provided nodes
  56977. * @method
  56978. * @memberof Popper.Utils
  56979. * @argument {Element} element1
  56980. * @argument {Element} element2
  56981. * @returns {Element} common offset parent
  56982. */
  56983. function findCommonOffsetParent(element1, element2) {
  56984. // This check is needed to avoid errors in case one of the elements isn't defined for any reason
  56985. if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
  56986. return document.documentElement;
  56987. }
  56988. // Here we make sure to give as "start" the element that comes first in the DOM
  56989. var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
  56990. var start = order ? element1 : element2;
  56991. var end = order ? element2 : element1;
  56992. // Get common ancestor container
  56993. var range = document.createRange();
  56994. range.setStart(start, 0);
  56995. range.setEnd(end, 0);
  56996. var commonAncestorContainer = range.commonAncestorContainer;
  56997. // Both nodes are inside #document
  56998. if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
  56999. if (isOffsetContainer(commonAncestorContainer)) {
  57000. return commonAncestorContainer;
  57001. }
  57002. return getOffsetParent(commonAncestorContainer);
  57003. }
  57004. // one of the nodes is inside shadowDOM, find which one
  57005. var element1root = getRoot(element1);
  57006. if (element1root.host) {
  57007. return findCommonOffsetParent(element1root.host, element2);
  57008. } else {
  57009. return findCommonOffsetParent(element1, getRoot(element2).host);
  57010. }
  57011. }
  57012. /**
  57013. * Gets the scroll value of the given element in the given side (top and left)
  57014. * @method
  57015. * @memberof Popper.Utils
  57016. * @argument {Element} element
  57017. * @argument {String} side `top` or `left`
  57018. * @returns {number} amount of scrolled pixels
  57019. */
  57020. function getScroll(element) {
  57021. var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
  57022. var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
  57023. var nodeName = element.nodeName;
  57024. if (nodeName === 'BODY' || nodeName === 'HTML') {
  57025. var html = element.ownerDocument.documentElement;
  57026. var scrollingElement = element.ownerDocument.scrollingElement || html;
  57027. return scrollingElement[upperSide];
  57028. }
  57029. return element[upperSide];
  57030. }
  57031. /*
  57032. * Sum or subtract the element scroll values (left and top) from a given rect object
  57033. * @method
  57034. * @memberof Popper.Utils
  57035. * @param {Object} rect - Rect object you want to change
  57036. * @param {HTMLElement} element - The element from the function reads the scroll values
  57037. * @param {Boolean} subtract - set to true if you want to subtract the scroll values
  57038. * @return {Object} rect - The modifier rect object
  57039. */
  57040. function includeScroll(rect, element) {
  57041. var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  57042. var scrollTop = getScroll(element, 'top');
  57043. var scrollLeft = getScroll(element, 'left');
  57044. var modifier = subtract ? -1 : 1;
  57045. rect.top += scrollTop * modifier;
  57046. rect.bottom += scrollTop * modifier;
  57047. rect.left += scrollLeft * modifier;
  57048. rect.right += scrollLeft * modifier;
  57049. return rect;
  57050. }
  57051. /*
  57052. * Helper to detect borders of a given element
  57053. * @method
  57054. * @memberof Popper.Utils
  57055. * @param {CSSStyleDeclaration} styles
  57056. * Result of `getStyleComputedProperty` on the given element
  57057. * @param {String} axis - `x` or `y`
  57058. * @return {number} borders - The borders size of the given axis
  57059. */
  57060. function getBordersSize(styles, axis) {
  57061. var sideA = axis === 'x' ? 'Left' : 'Top';
  57062. var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
  57063. return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']);
  57064. }
  57065. function getSize(axis, body, html, computedStyle) {
  57066. return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0);
  57067. }
  57068. function getWindowSizes(document) {
  57069. var body = document.body;
  57070. var html = document.documentElement;
  57071. var computedStyle = isIE(10) && getComputedStyle(html);
  57072. return {
  57073. height: getSize('Height', body, html, computedStyle),
  57074. width: getSize('Width', body, html, computedStyle)
  57075. };
  57076. }
  57077. var classCallCheck = function (instance, Constructor) {
  57078. if (!(instance instanceof Constructor)) {
  57079. throw new TypeError("Cannot call a class as a function");
  57080. }
  57081. };
  57082. var createClass = function () {
  57083. function defineProperties(target, props) {
  57084. for (var i = 0; i < props.length; i++) {
  57085. var descriptor = props[i];
  57086. descriptor.enumerable = descriptor.enumerable || false;
  57087. descriptor.configurable = true;
  57088. if ("value" in descriptor) descriptor.writable = true;
  57089. Object.defineProperty(target, descriptor.key, descriptor);
  57090. }
  57091. }
  57092. return function (Constructor, protoProps, staticProps) {
  57093. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  57094. if (staticProps) defineProperties(Constructor, staticProps);
  57095. return Constructor;
  57096. };
  57097. }();
  57098. var defineProperty = function (obj, key, value) {
  57099. if (key in obj) {
  57100. Object.defineProperty(obj, key, {
  57101. value: value,
  57102. enumerable: true,
  57103. configurable: true,
  57104. writable: true
  57105. });
  57106. } else {
  57107. obj[key] = value;
  57108. }
  57109. return obj;
  57110. };
  57111. var _extends = Object.assign || function (target) {
  57112. for (var i = 1; i < arguments.length; i++) {
  57113. var source = arguments[i];
  57114. for (var key in source) {
  57115. if (Object.prototype.hasOwnProperty.call(source, key)) {
  57116. target[key] = source[key];
  57117. }
  57118. }
  57119. }
  57120. return target;
  57121. };
  57122. /**
  57123. * Given element offsets, generate an output similar to getBoundingClientRect
  57124. * @method
  57125. * @memberof Popper.Utils
  57126. * @argument {Object} offsets
  57127. * @returns {Object} ClientRect like output
  57128. */
  57129. function getClientRect(offsets) {
  57130. return _extends({}, offsets, {
  57131. right: offsets.left + offsets.width,
  57132. bottom: offsets.top + offsets.height
  57133. });
  57134. }
  57135. /**
  57136. * Get bounding client rect of given element
  57137. * @method
  57138. * @memberof Popper.Utils
  57139. * @param {HTMLElement} element
  57140. * @return {Object} client rect
  57141. */
  57142. function getBoundingClientRect(element) {
  57143. var rect = {};
  57144. // IE10 10 FIX: Please, don't ask, the element isn't
  57145. // considered in DOM in some circumstances...
  57146. // This isn't reproducible in IE10 compatibility mode of IE11
  57147. try {
  57148. if (isIE(10)) {
  57149. rect = element.getBoundingClientRect();
  57150. var scrollTop = getScroll(element, 'top');
  57151. var scrollLeft = getScroll(element, 'left');
  57152. rect.top += scrollTop;
  57153. rect.left += scrollLeft;
  57154. rect.bottom += scrollTop;
  57155. rect.right += scrollLeft;
  57156. } else {
  57157. rect = element.getBoundingClientRect();
  57158. }
  57159. } catch (e) {}
  57160. var result = {
  57161. left: rect.left,
  57162. top: rect.top,
  57163. width: rect.right - rect.left,
  57164. height: rect.bottom - rect.top
  57165. };
  57166. // subtract scrollbar size from sizes
  57167. var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};
  57168. var width = sizes.width || element.clientWidth || result.width;
  57169. var height = sizes.height || element.clientHeight || result.height;
  57170. var horizScrollbar = element.offsetWidth - width;
  57171. var vertScrollbar = element.offsetHeight - height;
  57172. // if an hypothetical scrollbar is detected, we must be sure it's not a `border`
  57173. // we make this check conditional for performance reasons
  57174. if (horizScrollbar || vertScrollbar) {
  57175. var styles = getStyleComputedProperty(element);
  57176. horizScrollbar -= getBordersSize(styles, 'x');
  57177. vertScrollbar -= getBordersSize(styles, 'y');
  57178. result.width -= horizScrollbar;
  57179. result.height -= vertScrollbar;
  57180. }
  57181. return getClientRect(result);
  57182. }
  57183. function getOffsetRectRelativeToArbitraryNode(children, parent) {
  57184. var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  57185. var isIE10 = isIE(10);
  57186. var isHTML = parent.nodeName === 'HTML';
  57187. var childrenRect = getBoundingClientRect(children);
  57188. var parentRect = getBoundingClientRect(parent);
  57189. var scrollParent = getScrollParent(children);
  57190. var styles = getStyleComputedProperty(parent);
  57191. var borderTopWidth = parseFloat(styles.borderTopWidth);
  57192. var borderLeftWidth = parseFloat(styles.borderLeftWidth);
  57193. // In cases where the parent is fixed, we must ignore negative scroll in offset calc
  57194. if (fixedPosition && isHTML) {
  57195. parentRect.top = Math.max(parentRect.top, 0);
  57196. parentRect.left = Math.max(parentRect.left, 0);
  57197. }
  57198. var offsets = getClientRect({
  57199. top: childrenRect.top - parentRect.top - borderTopWidth,
  57200. left: childrenRect.left - parentRect.left - borderLeftWidth,
  57201. width: childrenRect.width,
  57202. height: childrenRect.height
  57203. });
  57204. offsets.marginTop = 0;
  57205. offsets.marginLeft = 0;
  57206. // Subtract margins of documentElement in case it's being used as parent
  57207. // we do this only on HTML because it's the only element that behaves
  57208. // differently when margins are applied to it. The margins are included in
  57209. // the box of the documentElement, in the other cases not.
  57210. if (!isIE10 && isHTML) {
  57211. var marginTop = parseFloat(styles.marginTop);
  57212. var marginLeft = parseFloat(styles.marginLeft);
  57213. offsets.top -= borderTopWidth - marginTop;
  57214. offsets.bottom -= borderTopWidth - marginTop;
  57215. offsets.left -= borderLeftWidth - marginLeft;
  57216. offsets.right -= borderLeftWidth - marginLeft;
  57217. // Attach marginTop and marginLeft because in some circumstances we may need them
  57218. offsets.marginTop = marginTop;
  57219. offsets.marginLeft = marginLeft;
  57220. }
  57221. if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
  57222. offsets = includeScroll(offsets, parent);
  57223. }
  57224. return offsets;
  57225. }
  57226. function getViewportOffsetRectRelativeToArtbitraryNode(element) {
  57227. var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  57228. var html = element.ownerDocument.documentElement;
  57229. var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
  57230. var width = Math.max(html.clientWidth, window.innerWidth || 0);
  57231. var height = Math.max(html.clientHeight, window.innerHeight || 0);
  57232. var scrollTop = !excludeScroll ? getScroll(html) : 0;
  57233. var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;
  57234. var offset = {
  57235. top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
  57236. left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
  57237. width: width,
  57238. height: height
  57239. };
  57240. return getClientRect(offset);
  57241. }
  57242. /**
  57243. * Check if the given element is fixed or is inside a fixed parent
  57244. * @method
  57245. * @memberof Popper.Utils
  57246. * @argument {Element} element
  57247. * @argument {Element} customContainer
  57248. * @returns {Boolean} answer to "isFixed?"
  57249. */
  57250. function isFixed(element) {
  57251. var nodeName = element.nodeName;
  57252. if (nodeName === 'BODY' || nodeName === 'HTML') {
  57253. return false;
  57254. }
  57255. if (getStyleComputedProperty(element, 'position') === 'fixed') {
  57256. return true;
  57257. }
  57258. var parentNode = getParentNode(element);
  57259. if (!parentNode) {
  57260. return false;
  57261. }
  57262. return isFixed(parentNode);
  57263. }
  57264. /**
  57265. * Finds the first parent of an element that has a transformed property defined
  57266. * @method
  57267. * @memberof Popper.Utils
  57268. * @argument {Element} element
  57269. * @returns {Element} first transformed parent or documentElement
  57270. */
  57271. function getFixedPositionOffsetParent(element) {
  57272. // This check is needed to avoid errors in case one of the elements isn't defined for any reason
  57273. if (!element || !element.parentElement || isIE()) {
  57274. return document.documentElement;
  57275. }
  57276. var el = element.parentElement;
  57277. while (el && getStyleComputedProperty(el, 'transform') === 'none') {
  57278. el = el.parentElement;
  57279. }
  57280. return el || document.documentElement;
  57281. }
  57282. /**
  57283. * Computed the boundaries limits and return them
  57284. * @method
  57285. * @memberof Popper.Utils
  57286. * @param {HTMLElement} popper
  57287. * @param {HTMLElement} reference
  57288. * @param {number} padding
  57289. * @param {HTMLElement} boundariesElement - Element used to define the boundaries
  57290. * @param {Boolean} fixedPosition - Is in fixed position mode
  57291. * @returns {Object} Coordinates of the boundaries
  57292. */
  57293. function getBoundaries(popper, reference, padding, boundariesElement) {
  57294. var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  57295. // NOTE: 1 DOM access here
  57296. var boundaries = { top: 0, left: 0 };
  57297. var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));
  57298. // Handle viewport case
  57299. if (boundariesElement === 'viewport') {
  57300. boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);
  57301. } else {
  57302. // Handle other cases based on DOM element used as boundaries
  57303. var boundariesNode = void 0;
  57304. if (boundariesElement === 'scrollParent') {
  57305. boundariesNode = getScrollParent(getParentNode(reference));
  57306. if (boundariesNode.nodeName === 'BODY') {
  57307. boundariesNode = popper.ownerDocument.documentElement;
  57308. }
  57309. } else if (boundariesElement === 'window') {
  57310. boundariesNode = popper.ownerDocument.documentElement;
  57311. } else {
  57312. boundariesNode = boundariesElement;
  57313. }
  57314. var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);
  57315. // In case of HTML, we need a different computation
  57316. if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
  57317. var _getWindowSizes = getWindowSizes(popper.ownerDocument),
  57318. height = _getWindowSizes.height,
  57319. width = _getWindowSizes.width;
  57320. boundaries.top += offsets.top - offsets.marginTop;
  57321. boundaries.bottom = height + offsets.top;
  57322. boundaries.left += offsets.left - offsets.marginLeft;
  57323. boundaries.right = width + offsets.left;
  57324. } else {
  57325. // for all the other DOM elements, this one is good
  57326. boundaries = offsets;
  57327. }
  57328. }
  57329. // Add paddings
  57330. padding = padding || 0;
  57331. var isPaddingNumber = typeof padding === 'number';
  57332. boundaries.left += isPaddingNumber ? padding : padding.left || 0;
  57333. boundaries.top += isPaddingNumber ? padding : padding.top || 0;
  57334. boundaries.right -= isPaddingNumber ? padding : padding.right || 0;
  57335. boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;
  57336. return boundaries;
  57337. }
  57338. function getArea(_ref) {
  57339. var width = _ref.width,
  57340. height = _ref.height;
  57341. return width * height;
  57342. }
  57343. /**
  57344. * Utility used to transform the `auto` placement to the placement with more
  57345. * available space.
  57346. * @method
  57347. * @memberof Popper.Utils
  57348. * @argument {Object} data - The data object generated by update method
  57349. * @argument {Object} options - Modifiers configuration and options
  57350. * @returns {Object} The data object, properly modified
  57351. */
  57352. function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
  57353. var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
  57354. if (placement.indexOf('auto') === -1) {
  57355. return placement;
  57356. }
  57357. var boundaries = getBoundaries(popper, reference, padding, boundariesElement);
  57358. var rects = {
  57359. top: {
  57360. width: boundaries.width,
  57361. height: refRect.top - boundaries.top
  57362. },
  57363. right: {
  57364. width: boundaries.right - refRect.right,
  57365. height: boundaries.height
  57366. },
  57367. bottom: {
  57368. width: boundaries.width,
  57369. height: boundaries.bottom - refRect.bottom
  57370. },
  57371. left: {
  57372. width: refRect.left - boundaries.left,
  57373. height: boundaries.height
  57374. }
  57375. };
  57376. var sortedAreas = Object.keys(rects).map(function (key) {
  57377. return _extends({
  57378. key: key
  57379. }, rects[key], {
  57380. area: getArea(rects[key])
  57381. });
  57382. }).sort(function (a, b) {
  57383. return b.area - a.area;
  57384. });
  57385. var filteredAreas = sortedAreas.filter(function (_ref2) {
  57386. var width = _ref2.width,
  57387. height = _ref2.height;
  57388. return width >= popper.clientWidth && height >= popper.clientHeight;
  57389. });
  57390. var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;
  57391. var variation = placement.split('-')[1];
  57392. return computedPlacement + (variation ? '-' + variation : '');
  57393. }
  57394. /**
  57395. * Get offsets to the reference element
  57396. * @method
  57397. * @memberof Popper.Utils
  57398. * @param {Object} state
  57399. * @param {Element} popper - the popper element
  57400. * @param {Element} reference - the reference element (the popper will be relative to this)
  57401. * @param {Element} fixedPosition - is in fixed position mode
  57402. * @returns {Object} An object containing the offsets which will be applied to the popper
  57403. */
  57404. function getReferenceOffsets(state, popper, reference) {
  57405. var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
  57406. var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));
  57407. return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
  57408. }
  57409. /**
  57410. * Get the outer sizes of the given element (offset size + margins)
  57411. * @method
  57412. * @memberof Popper.Utils
  57413. * @argument {Element} element
  57414. * @returns {Object} object containing width and height properties
  57415. */
  57416. function getOuterSizes(element) {
  57417. var window = element.ownerDocument.defaultView;
  57418. var styles = window.getComputedStyle(element);
  57419. var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);
  57420. var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);
  57421. var result = {
  57422. width: element.offsetWidth + y,
  57423. height: element.offsetHeight + x
  57424. };
  57425. return result;
  57426. }
  57427. /**
  57428. * Get the opposite placement of the given one
  57429. * @method
  57430. * @memberof Popper.Utils
  57431. * @argument {String} placement
  57432. * @returns {String} flipped placement
  57433. */
  57434. function getOppositePlacement(placement) {
  57435. var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
  57436. return placement.replace(/left|right|bottom|top/g, function (matched) {
  57437. return hash[matched];
  57438. });
  57439. }
  57440. /**
  57441. * Get offsets to the popper
  57442. * @method
  57443. * @memberof Popper.Utils
  57444. * @param {Object} position - CSS position the Popper will get applied
  57445. * @param {HTMLElement} popper - the popper element
  57446. * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
  57447. * @param {String} placement - one of the valid placement options
  57448. * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper
  57449. */
  57450. function getPopperOffsets(popper, referenceOffsets, placement) {
  57451. placement = placement.split('-')[0];
  57452. // Get popper node sizes
  57453. var popperRect = getOuterSizes(popper);
  57454. // Add position, width and height to our offsets object
  57455. var popperOffsets = {
  57456. width: popperRect.width,
  57457. height: popperRect.height
  57458. };
  57459. // depending by the popper placement we have to compute its offsets slightly differently
  57460. var isHoriz = ['right', 'left'].indexOf(placement) !== -1;
  57461. var mainSide = isHoriz ? 'top' : 'left';
  57462. var secondarySide = isHoriz ? 'left' : 'top';
  57463. var measurement = isHoriz ? 'height' : 'width';
  57464. var secondaryMeasurement = !isHoriz ? 'height' : 'width';
  57465. popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
  57466. if (placement === secondarySide) {
  57467. popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
  57468. } else {
  57469. popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];
  57470. }
  57471. return popperOffsets;
  57472. }
  57473. /**
  57474. * Mimics the `find` method of Array
  57475. * @method
  57476. * @memberof Popper.Utils
  57477. * @argument {Array} arr
  57478. * @argument prop
  57479. * @argument value
  57480. * @returns index or -1
  57481. */
  57482. function find(arr, check) {
  57483. // use native find if supported
  57484. if (Array.prototype.find) {
  57485. return arr.find(check);
  57486. }
  57487. // use `filter` to obtain the same behavior of `find`
  57488. return arr.filter(check)[0];
  57489. }
  57490. /**
  57491. * Return the index of the matching object
  57492. * @method
  57493. * @memberof Popper.Utils
  57494. * @argument {Array} arr
  57495. * @argument prop
  57496. * @argument value
  57497. * @returns index or -1
  57498. */
  57499. function findIndex(arr, prop, value) {
  57500. // use native findIndex if supported
  57501. if (Array.prototype.findIndex) {
  57502. return arr.findIndex(function (cur) {
  57503. return cur[prop] === value;
  57504. });
  57505. }
  57506. // use `find` + `indexOf` if `findIndex` isn't supported
  57507. var match = find(arr, function (obj) {
  57508. return obj[prop] === value;
  57509. });
  57510. return arr.indexOf(match);
  57511. }
  57512. /**
  57513. * Loop trough the list of modifiers and run them in order,
  57514. * each of them will then edit the data object.
  57515. * @method
  57516. * @memberof Popper.Utils
  57517. * @param {dataObject} data
  57518. * @param {Array} modifiers
  57519. * @param {String} ends - Optional modifier name used as stopper
  57520. * @returns {dataObject}
  57521. */
  57522. function runModifiers(modifiers, data, ends) {
  57523. var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));
  57524. modifiersToRun.forEach(function (modifier) {
  57525. if (modifier['function']) {
  57526. // eslint-disable-line dot-notation
  57527. console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
  57528. }
  57529. var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation
  57530. if (modifier.enabled && isFunction(fn)) {
  57531. // Add properties to offsets to make them a complete clientRect object
  57532. // we do this before each modifier to make sure the previous one doesn't
  57533. // mess with these values
  57534. data.offsets.popper = getClientRect(data.offsets.popper);
  57535. data.offsets.reference = getClientRect(data.offsets.reference);
  57536. data = fn(data, modifier);
  57537. }
  57538. });
  57539. return data;
  57540. }
  57541. /**
  57542. * Updates the position of the popper, computing the new offsets and applying
  57543. * the new style.<br />
  57544. * Prefer `scheduleUpdate` over `update` because of performance reasons.
  57545. * @method
  57546. * @memberof Popper
  57547. */
  57548. function update() {
  57549. // if popper is destroyed, don't perform any further update
  57550. if (this.state.isDestroyed) {
  57551. return;
  57552. }
  57553. var data = {
  57554. instance: this,
  57555. styles: {},
  57556. arrowStyles: {},
  57557. attributes: {},
  57558. flipped: false,
  57559. offsets: {}
  57560. };
  57561. // compute reference element offsets
  57562. data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);
  57563. // compute auto placement, store placement inside the data object,
  57564. // modifiers will be able to edit `placement` if needed
  57565. // and refer to originalPlacement to know the original value
  57566. data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);
  57567. // store the computed placement inside `originalPlacement`
  57568. data.originalPlacement = data.placement;
  57569. data.positionFixed = this.options.positionFixed;
  57570. // compute the popper offsets
  57571. data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
  57572. data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';
  57573. // run the modifiers
  57574. data = runModifiers(this.modifiers, data);
  57575. // the first `update` will call `onCreate` callback
  57576. // the other ones will call `onUpdate` callback
  57577. if (!this.state.isCreated) {
  57578. this.state.isCreated = true;
  57579. this.options.onCreate(data);
  57580. } else {
  57581. this.options.onUpdate(data);
  57582. }
  57583. }
  57584. /**
  57585. * Helper used to know if the given modifier is enabled.
  57586. * @method
  57587. * @memberof Popper.Utils
  57588. * @returns {Boolean}
  57589. */
  57590. function isModifierEnabled(modifiers, modifierName) {
  57591. return modifiers.some(function (_ref) {
  57592. var name = _ref.name,
  57593. enabled = _ref.enabled;
  57594. return enabled && name === modifierName;
  57595. });
  57596. }
  57597. /**
  57598. * Get the prefixed supported property name
  57599. * @method
  57600. * @memberof Popper.Utils
  57601. * @argument {String} property (camelCase)
  57602. * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)
  57603. */
  57604. function getSupportedPropertyName(property) {
  57605. var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
  57606. var upperProp = property.charAt(0).toUpperCase() + property.slice(1);
  57607. for (var i = 0; i < prefixes.length; i++) {
  57608. var prefix = prefixes[i];
  57609. var toCheck = prefix ? '' + prefix + upperProp : property;
  57610. if (typeof document.body.style[toCheck] !== 'undefined') {
  57611. return toCheck;
  57612. }
  57613. }
  57614. return null;
  57615. }
  57616. /**
  57617. * Destroys the popper.
  57618. * @method
  57619. * @memberof Popper
  57620. */
  57621. function destroy() {
  57622. this.state.isDestroyed = true;
  57623. // touch DOM only if `applyStyle` modifier is enabled
  57624. if (isModifierEnabled(this.modifiers, 'applyStyle')) {
  57625. this.popper.removeAttribute('x-placement');
  57626. this.popper.style.position = '';
  57627. this.popper.style.top = '';
  57628. this.popper.style.left = '';
  57629. this.popper.style.right = '';
  57630. this.popper.style.bottom = '';
  57631. this.popper.style.willChange = '';
  57632. this.popper.style[getSupportedPropertyName('transform')] = '';
  57633. }
  57634. this.disableEventListeners();
  57635. // remove the popper if user explicitly asked for the deletion on destroy
  57636. // do not use `remove` because IE11 doesn't support it
  57637. if (this.options.removeOnDestroy) {
  57638. this.popper.parentNode.removeChild(this.popper);
  57639. }
  57640. return this;
  57641. }
  57642. /**
  57643. * Get the window associated with the element
  57644. * @argument {Element} element
  57645. * @returns {Window}
  57646. */
  57647. function getWindow(element) {
  57648. var ownerDocument = element.ownerDocument;
  57649. return ownerDocument ? ownerDocument.defaultView : window;
  57650. }
  57651. function attachToScrollParents(scrollParent, event, callback, scrollParents) {
  57652. var isBody = scrollParent.nodeName === 'BODY';
  57653. var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
  57654. target.addEventListener(event, callback, { passive: true });
  57655. if (!isBody) {
  57656. attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
  57657. }
  57658. scrollParents.push(target);
  57659. }
  57660. /**
  57661. * Setup needed event listeners used to update the popper position
  57662. * @method
  57663. * @memberof Popper.Utils
  57664. * @private
  57665. */
  57666. function setupEventListeners(reference, options, state, updateBound) {
  57667. // Resize event listener on window
  57668. state.updateBound = updateBound;
  57669. getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });
  57670. // Scroll event listener on scroll parents
  57671. var scrollElement = getScrollParent(reference);
  57672. attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
  57673. state.scrollElement = scrollElement;
  57674. state.eventsEnabled = true;
  57675. return state;
  57676. }
  57677. /**
  57678. * It will add resize/scroll events and start recalculating
  57679. * position of the popper element when they are triggered.
  57680. * @method
  57681. * @memberof Popper
  57682. */
  57683. function enableEventListeners() {
  57684. if (!this.state.eventsEnabled) {
  57685. this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
  57686. }
  57687. }
  57688. /**
  57689. * Remove event listeners used to update the popper position
  57690. * @method
  57691. * @memberof Popper.Utils
  57692. * @private
  57693. */
  57694. function removeEventListeners(reference, state) {
  57695. // Remove resize event listener on window
  57696. getWindow(reference).removeEventListener('resize', state.updateBound);
  57697. // Remove scroll event listener on scroll parents
  57698. state.scrollParents.forEach(function (target) {
  57699. target.removeEventListener('scroll', state.updateBound);
  57700. });
  57701. // Reset state
  57702. state.updateBound = null;
  57703. state.scrollParents = [];
  57704. state.scrollElement = null;
  57705. state.eventsEnabled = false;
  57706. return state;
  57707. }
  57708. /**
  57709. * It will remove resize/scroll events and won't recalculate popper position
  57710. * when they are triggered. It also won't trigger `onUpdate` callback anymore,
  57711. * unless you call `update` method manually.
  57712. * @method
  57713. * @memberof Popper
  57714. */
  57715. function disableEventListeners() {
  57716. if (this.state.eventsEnabled) {
  57717. cancelAnimationFrame(this.scheduleUpdate);
  57718. this.state = removeEventListeners(this.reference, this.state);
  57719. }
  57720. }
  57721. /**
  57722. * Tells if a given input is a number
  57723. * @method
  57724. * @memberof Popper.Utils
  57725. * @param {*} input to check
  57726. * @return {Boolean}
  57727. */
  57728. function isNumeric(n) {
  57729. return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
  57730. }
  57731. /**
  57732. * Set the style to the given popper
  57733. * @method
  57734. * @memberof Popper.Utils
  57735. * @argument {Element} element - Element to apply the style to
  57736. * @argument {Object} styles
  57737. * Object with a list of properties and values which will be applied to the element
  57738. */
  57739. function setStyles(element, styles) {
  57740. Object.keys(styles).forEach(function (prop) {
  57741. var unit = '';
  57742. // add unit if the value is numeric and is one of the following
  57743. if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
  57744. unit = 'px';
  57745. }
  57746. element.style[prop] = styles[prop] + unit;
  57747. });
  57748. }
  57749. /**
  57750. * Set the attributes to the given popper
  57751. * @method
  57752. * @memberof Popper.Utils
  57753. * @argument {Element} element - Element to apply the attributes to
  57754. * @argument {Object} styles
  57755. * Object with a list of properties and values which will be applied to the element
  57756. */
  57757. function setAttributes(element, attributes) {
  57758. Object.keys(attributes).forEach(function (prop) {
  57759. var value = attributes[prop];
  57760. if (value !== false) {
  57761. element.setAttribute(prop, attributes[prop]);
  57762. } else {
  57763. element.removeAttribute(prop);
  57764. }
  57765. });
  57766. }
  57767. /**
  57768. * @function
  57769. * @memberof Modifiers
  57770. * @argument {Object} data - The data object generated by `update` method
  57771. * @argument {Object} data.styles - List of style properties - values to apply to popper element
  57772. * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element
  57773. * @argument {Object} options - Modifiers configuration and options
  57774. * @returns {Object} The same data object
  57775. */
  57776. function applyStyle(data) {
  57777. // any property present in `data.styles` will be applied to the popper,
  57778. // in this way we can make the 3rd party modifiers add custom styles to it
  57779. // Be aware, modifiers could override the properties defined in the previous
  57780. // lines of this modifier!
  57781. setStyles(data.instance.popper, data.styles);
  57782. // any property present in `data.attributes` will be applied to the popper,
  57783. // they will be set as HTML attributes of the element
  57784. setAttributes(data.instance.popper, data.attributes);
  57785. // if arrowElement is defined and arrowStyles has some properties
  57786. if (data.arrowElement && Object.keys(data.arrowStyles).length) {
  57787. setStyles(data.arrowElement, data.arrowStyles);
  57788. }
  57789. return data;
  57790. }
  57791. /**
  57792. * Set the x-placement attribute before everything else because it could be used
  57793. * to add margins to the popper margins needs to be calculated to get the
  57794. * correct popper offsets.
  57795. * @method
  57796. * @memberof Popper.modifiers
  57797. * @param {HTMLElement} reference - The reference element used to position the popper
  57798. * @param {HTMLElement} popper - The HTML element used as popper
  57799. * @param {Object} options - Popper.js options
  57800. */
  57801. function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
  57802. // compute reference element offsets
  57803. var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);
  57804. // compute auto placement, store placement inside the data object,
  57805. // modifiers will be able to edit `placement` if needed
  57806. // and refer to originalPlacement to know the original value
  57807. var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);
  57808. popper.setAttribute('x-placement', placement);
  57809. // Apply `position` to popper before anything else because
  57810. // without the position applied we can't guarantee correct computations
  57811. setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });
  57812. return options;
  57813. }
  57814. /**
  57815. * @function
  57816. * @memberof Popper.Utils
  57817. * @argument {Object} data - The data object generated by `update` method
  57818. * @argument {Boolean} shouldRound - If the offsets should be rounded at all
  57819. * @returns {Object} The popper's position offsets rounded
  57820. *
  57821. * The tale of pixel-perfect positioning. It's still not 100% perfect, but as
  57822. * good as it can be within reason.
  57823. * Discussion here: https://github.com/FezVrasta/popper.js/pull/715
  57824. *
  57825. * Low DPI screens cause a popper to be blurry if not using full pixels (Safari
  57826. * as well on High DPI screens).
  57827. *
  57828. * Firefox prefers no rounding for positioning and does not have blurriness on
  57829. * high DPI screens.
  57830. *
  57831. * Only horizontal placement and left/right values need to be considered.
  57832. */
  57833. function getRoundedOffsets(data, shouldRound) {
  57834. var _data$offsets = data.offsets,
  57835. popper = _data$offsets.popper,
  57836. reference = _data$offsets.reference;
  57837. var round = Math.round,
  57838. floor = Math.floor;
  57839. var noRound = function noRound(v) {
  57840. return v;
  57841. };
  57842. var referenceWidth = round(reference.width);
  57843. var popperWidth = round(popper.width);
  57844. var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;
  57845. var isVariation = data.placement.indexOf('-') !== -1;
  57846. var sameWidthParity = referenceWidth % 2 === popperWidth % 2;
  57847. var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;
  57848. var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor;
  57849. var verticalToInteger = !shouldRound ? noRound : round;
  57850. return {
  57851. left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),
  57852. top: verticalToInteger(popper.top),
  57853. bottom: verticalToInteger(popper.bottom),
  57854. right: horizontalToInteger(popper.right)
  57855. };
  57856. }
  57857. var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);
  57858. /**
  57859. * @function
  57860. * @memberof Modifiers
  57861. * @argument {Object} data - The data object generated by `update` method
  57862. * @argument {Object} options - Modifiers configuration and options
  57863. * @returns {Object} The data object, properly modified
  57864. */
  57865. function computeStyle(data, options) {
  57866. var x = options.x,
  57867. y = options.y;
  57868. var popper = data.offsets.popper;
  57869. // Remove this legacy support in Popper.js v2
  57870. var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {
  57871. return modifier.name === 'applyStyle';
  57872. }).gpuAcceleration;
  57873. if (legacyGpuAccelerationOption !== undefined) {
  57874. console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
  57875. }
  57876. var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;
  57877. var offsetParent = getOffsetParent(data.instance.popper);
  57878. var offsetParentRect = getBoundingClientRect(offsetParent);
  57879. // Styles
  57880. var styles = {
  57881. position: popper.position
  57882. };
  57883. var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox);
  57884. var sideA = x === 'bottom' ? 'top' : 'bottom';
  57885. var sideB = y === 'right' ? 'left' : 'right';
  57886. // if gpuAcceleration is set to `true` and transform is supported,
  57887. // we use `translate3d` to apply the position to the popper we
  57888. // automatically use the supported prefixed version if needed
  57889. var prefixedProperty = getSupportedPropertyName('transform');
  57890. // now, let's make a step back and look at this code closely (wtf?)
  57891. // If the content of the popper grows once it's been positioned, it
  57892. // may happen that the popper gets misplaced because of the new content
  57893. // overflowing its reference element
  57894. // To avoid this problem, we provide two options (x and y), which allow
  57895. // the consumer to define the offset origin.
  57896. // If we position a popper on top of a reference element, we can set
  57897. // `x` to `top` to make the popper grow towards its top instead of
  57898. // its bottom.
  57899. var left = void 0,
  57900. top = void 0;
  57901. if (sideA === 'bottom') {
  57902. // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar)
  57903. // and not the bottom of the html element
  57904. if (offsetParent.nodeName === 'HTML') {
  57905. top = -offsetParent.clientHeight + offsets.bottom;
  57906. } else {
  57907. top = -offsetParentRect.height + offsets.bottom;
  57908. }
  57909. } else {
  57910. top = offsets.top;
  57911. }
  57912. if (sideB === 'right') {
  57913. if (offsetParent.nodeName === 'HTML') {
  57914. left = -offsetParent.clientWidth + offsets.right;
  57915. } else {
  57916. left = -offsetParentRect.width + offsets.right;
  57917. }
  57918. } else {
  57919. left = offsets.left;
  57920. }
  57921. if (gpuAcceleration && prefixedProperty) {
  57922. styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
  57923. styles[sideA] = 0;
  57924. styles[sideB] = 0;
  57925. styles.willChange = 'transform';
  57926. } else {
  57927. // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties
  57928. var invertTop = sideA === 'bottom' ? -1 : 1;
  57929. var invertLeft = sideB === 'right' ? -1 : 1;
  57930. styles[sideA] = top * invertTop;
  57931. styles[sideB] = left * invertLeft;
  57932. styles.willChange = sideA + ', ' + sideB;
  57933. }
  57934. // Attributes
  57935. var attributes = {
  57936. 'x-placement': data.placement
  57937. };
  57938. // Update `data` attributes, styles and arrowStyles
  57939. data.attributes = _extends({}, attributes, data.attributes);
  57940. data.styles = _extends({}, styles, data.styles);
  57941. data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);
  57942. return data;
  57943. }
  57944. /**
  57945. * Helper used to know if the given modifier depends from another one.<br />
  57946. * It checks if the needed modifier is listed and enabled.
  57947. * @method
  57948. * @memberof Popper.Utils
  57949. * @param {Array} modifiers - list of modifiers
  57950. * @param {String} requestingName - name of requesting modifier
  57951. * @param {String} requestedName - name of requested modifier
  57952. * @returns {Boolean}
  57953. */
  57954. function isModifierRequired(modifiers, requestingName, requestedName) {
  57955. var requesting = find(modifiers, function (_ref) {
  57956. var name = _ref.name;
  57957. return name === requestingName;
  57958. });
  57959. var isRequired = !!requesting && modifiers.some(function (modifier) {
  57960. return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
  57961. });
  57962. if (!isRequired) {
  57963. var _requesting = '`' + requestingName + '`';
  57964. var requested = '`' + requestedName + '`';
  57965. console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');
  57966. }
  57967. return isRequired;
  57968. }
  57969. /**
  57970. * @function
  57971. * @memberof Modifiers
  57972. * @argument {Object} data - The data object generated by update method
  57973. * @argument {Object} options - Modifiers configuration and options
  57974. * @returns {Object} The data object, properly modified
  57975. */
  57976. function arrow(data, options) {
  57977. var _data$offsets$arrow;
  57978. // arrow depends on keepTogether in order to work
  57979. if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
  57980. return data;
  57981. }
  57982. var arrowElement = options.element;
  57983. // if arrowElement is a string, suppose it's a CSS selector
  57984. if (typeof arrowElement === 'string') {
  57985. arrowElement = data.instance.popper.querySelector(arrowElement);
  57986. // if arrowElement is not found, don't run the modifier
  57987. if (!arrowElement) {
  57988. return data;
  57989. }
  57990. } else {
  57991. // if the arrowElement isn't a query selector we must check that the
  57992. // provided DOM node is child of its popper node
  57993. if (!data.instance.popper.contains(arrowElement)) {
  57994. console.warn('WARNING: `arrow.element` must be child of its popper element!');
  57995. return data;
  57996. }
  57997. }
  57998. var placement = data.placement.split('-')[0];
  57999. var _data$offsets = data.offsets,
  58000. popper = _data$offsets.popper,
  58001. reference = _data$offsets.reference;
  58002. var isVertical = ['left', 'right'].indexOf(placement) !== -1;
  58003. var len = isVertical ? 'height' : 'width';
  58004. var sideCapitalized = isVertical ? 'Top' : 'Left';
  58005. var side = sideCapitalized.toLowerCase();
  58006. var altSide = isVertical ? 'left' : 'top';
  58007. var opSide = isVertical ? 'bottom' : 'right';
  58008. var arrowElementSize = getOuterSizes(arrowElement)[len];
  58009. //
  58010. // extends keepTogether behavior making sure the popper and its
  58011. // reference have enough pixels in conjunction
  58012. //
  58013. // top/left side
  58014. if (reference[opSide] - arrowElementSize < popper[side]) {
  58015. data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);
  58016. }
  58017. // bottom/right side
  58018. if (reference[side] + arrowElementSize > popper[opSide]) {
  58019. data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];
  58020. }
  58021. data.offsets.popper = getClientRect(data.offsets.popper);
  58022. // compute center of the popper
  58023. var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;
  58024. // Compute the sideValue using the updated popper offsets
  58025. // take popper margin in account because we don't have this info available
  58026. var css = getStyleComputedProperty(data.instance.popper);
  58027. var popperMarginSide = parseFloat(css['margin' + sideCapitalized]);
  58028. var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width']);
  58029. var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;
  58030. // prevent arrowElement from being placed not contiguously to its popper
  58031. sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);
  58032. data.arrowElement = arrowElement;
  58033. data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);
  58034. return data;
  58035. }
  58036. /**
  58037. * Get the opposite placement variation of the given one
  58038. * @method
  58039. * @memberof Popper.Utils
  58040. * @argument {String} placement variation
  58041. * @returns {String} flipped placement variation
  58042. */
  58043. function getOppositeVariation(variation) {
  58044. if (variation === 'end') {
  58045. return 'start';
  58046. } else if (variation === 'start') {
  58047. return 'end';
  58048. }
  58049. return variation;
  58050. }
  58051. /**
  58052. * List of accepted placements to use as values of the `placement` option.<br />
  58053. * Valid placements are:
  58054. * - `auto`
  58055. * - `top`
  58056. * - `right`
  58057. * - `bottom`
  58058. * - `left`
  58059. *
  58060. * Each placement can have a variation from this list:
  58061. * - `-start`
  58062. * - `-end`
  58063. *
  58064. * Variations are interpreted easily if you think of them as the left to right
  58065. * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`
  58066. * is right.<br />
  58067. * Vertically (`left` and `right`), `start` is top and `end` is bottom.
  58068. *
  58069. * Some valid examples are:
  58070. * - `top-end` (on top of reference, right aligned)
  58071. * - `right-start` (on right of reference, top aligned)
  58072. * - `bottom` (on bottom, centered)
  58073. * - `auto-end` (on the side with more space available, alignment depends by placement)
  58074. *
  58075. * @static
  58076. * @type {Array}
  58077. * @enum {String}
  58078. * @readonly
  58079. * @method placements
  58080. * @memberof Popper
  58081. */
  58082. var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];
  58083. // Get rid of `auto` `auto-start` and `auto-end`
  58084. var validPlacements = placements.slice(3);
  58085. /**
  58086. * Given an initial placement, returns all the subsequent placements
  58087. * clockwise (or counter-clockwise).
  58088. *
  58089. * @method
  58090. * @memberof Popper.Utils
  58091. * @argument {String} placement - A valid placement (it accepts variations)
  58092. * @argument {Boolean} counter - Set to true to walk the placements counterclockwise
  58093. * @returns {Array} placements including their variations
  58094. */
  58095. function clockwise(placement) {
  58096. var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  58097. var index = validPlacements.indexOf(placement);
  58098. var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
  58099. return counter ? arr.reverse() : arr;
  58100. }
  58101. var BEHAVIORS = {
  58102. FLIP: 'flip',
  58103. CLOCKWISE: 'clockwise',
  58104. COUNTERCLOCKWISE: 'counterclockwise'
  58105. };
  58106. /**
  58107. * @function
  58108. * @memberof Modifiers
  58109. * @argument {Object} data - The data object generated by update method
  58110. * @argument {Object} options - Modifiers configuration and options
  58111. * @returns {Object} The data object, properly modified
  58112. */
  58113. function flip(data, options) {
  58114. // if `inner` modifier is enabled, we can't use the `flip` modifier
  58115. if (isModifierEnabled(data.instance.modifiers, 'inner')) {
  58116. return data;
  58117. }
  58118. if (data.flipped && data.placement === data.originalPlacement) {
  58119. // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
  58120. return data;
  58121. }
  58122. var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);
  58123. var placement = data.placement.split('-')[0];
  58124. var placementOpposite = getOppositePlacement(placement);
  58125. var variation = data.placement.split('-')[1] || '';
  58126. var flipOrder = [];
  58127. switch (options.behavior) {
  58128. case BEHAVIORS.FLIP:
  58129. flipOrder = [placement, placementOpposite];
  58130. break;
  58131. case BEHAVIORS.CLOCKWISE:
  58132. flipOrder = clockwise(placement);
  58133. break;
  58134. case BEHAVIORS.COUNTERCLOCKWISE:
  58135. flipOrder = clockwise(placement, true);
  58136. break;
  58137. default:
  58138. flipOrder = options.behavior;
  58139. }
  58140. flipOrder.forEach(function (step, index) {
  58141. if (placement !== step || flipOrder.length === index + 1) {
  58142. return data;
  58143. }
  58144. placement = data.placement.split('-')[0];
  58145. placementOpposite = getOppositePlacement(placement);
  58146. var popperOffsets = data.offsets.popper;
  58147. var refOffsets = data.offsets.reference;
  58148. // using floor because the reference offsets may contain decimals we are not going to consider here
  58149. var floor = Math.floor;
  58150. var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);
  58151. var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);
  58152. var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);
  58153. var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);
  58154. var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);
  58155. var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;
  58156. // flip the variation if required
  58157. var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
  58158. // flips variation if reference element overflows boundaries
  58159. var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);
  58160. // flips variation if popper content overflows boundaries
  58161. var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop);
  58162. var flippedVariation = flippedVariationByRef || flippedVariationByContent;
  58163. if (overlapsRef || overflowsBoundaries || flippedVariation) {
  58164. // this boolean to detect any flip loop
  58165. data.flipped = true;
  58166. if (overlapsRef || overflowsBoundaries) {
  58167. placement = flipOrder[index + 1];
  58168. }
  58169. if (flippedVariation) {
  58170. variation = getOppositeVariation(variation);
  58171. }
  58172. data.placement = placement + (variation ? '-' + variation : '');
  58173. // this object contains `position`, we want to preserve it along with
  58174. // any additional property we may add in the future
  58175. data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
  58176. data = runModifiers(data.instance.modifiers, data, 'flip');
  58177. }
  58178. });
  58179. return data;
  58180. }
  58181. /**
  58182. * @function
  58183. * @memberof Modifiers
  58184. * @argument {Object} data - The data object generated by update method
  58185. * @argument {Object} options - Modifiers configuration and options
  58186. * @returns {Object} The data object, properly modified
  58187. */
  58188. function keepTogether(data) {
  58189. var _data$offsets = data.offsets,
  58190. popper = _data$offsets.popper,
  58191. reference = _data$offsets.reference;
  58192. var placement = data.placement.split('-')[0];
  58193. var floor = Math.floor;
  58194. var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
  58195. var side = isVertical ? 'right' : 'bottom';
  58196. var opSide = isVertical ? 'left' : 'top';
  58197. var measurement = isVertical ? 'width' : 'height';
  58198. if (popper[side] < floor(reference[opSide])) {
  58199. data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];
  58200. }
  58201. if (popper[opSide] > floor(reference[side])) {
  58202. data.offsets.popper[opSide] = floor(reference[side]);
  58203. }
  58204. return data;
  58205. }
  58206. /**
  58207. * Converts a string containing value + unit into a px value number
  58208. * @function
  58209. * @memberof {modifiers~offset}
  58210. * @private
  58211. * @argument {String} str - Value + unit string
  58212. * @argument {String} measurement - `height` or `width`
  58213. * @argument {Object} popperOffsets
  58214. * @argument {Object} referenceOffsets
  58215. * @returns {Number|String}
  58216. * Value in pixels, or original string if no values were extracted
  58217. */
  58218. function toValue(str, measurement, popperOffsets, referenceOffsets) {
  58219. // separate value from unit
  58220. var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
  58221. var value = +split[1];
  58222. var unit = split[2];
  58223. // If it's not a number it's an operator, I guess
  58224. if (!value) {
  58225. return str;
  58226. }
  58227. if (unit.indexOf('%') === 0) {
  58228. var element = void 0;
  58229. switch (unit) {
  58230. case '%p':
  58231. element = popperOffsets;
  58232. break;
  58233. case '%':
  58234. case '%r':
  58235. default:
  58236. element = referenceOffsets;
  58237. }
  58238. var rect = getClientRect(element);
  58239. return rect[measurement] / 100 * value;
  58240. } else if (unit === 'vh' || unit === 'vw') {
  58241. // if is a vh or vw, we calculate the size based on the viewport
  58242. var size = void 0;
  58243. if (unit === 'vh') {
  58244. size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
  58245. } else {
  58246. size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
  58247. }
  58248. return size / 100 * value;
  58249. } else {
  58250. // if is an explicit pixel unit, we get rid of the unit and keep the value
  58251. // if is an implicit unit, it's px, and we return just the value
  58252. return value;
  58253. }
  58254. }
  58255. /**
  58256. * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.
  58257. * @function
  58258. * @memberof {modifiers~offset}
  58259. * @private
  58260. * @argument {String} offset
  58261. * @argument {Object} popperOffsets
  58262. * @argument {Object} referenceOffsets
  58263. * @argument {String} basePlacement
  58264. * @returns {Array} a two cells array with x and y offsets in numbers
  58265. */
  58266. function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
  58267. var offsets = [0, 0];
  58268. // Use height if placement is left or right and index is 0 otherwise use width
  58269. // in this way the first offset will use an axis and the second one
  58270. // will use the other one
  58271. var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;
  58272. // Split the offset string to obtain a list of values and operands
  58273. // The regex addresses values with the plus or minus sign in front (+10, -20, etc)
  58274. var fragments = offset.split(/(\+|\-)/).map(function (frag) {
  58275. return frag.trim();
  58276. });
  58277. // Detect if the offset string contains a pair of values or a single one
  58278. // they could be separated by comma or space
  58279. var divider = fragments.indexOf(find(fragments, function (frag) {
  58280. return frag.search(/,|\s/) !== -1;
  58281. }));
  58282. if (fragments[divider] && fragments[divider].indexOf(',') === -1) {
  58283. console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
  58284. }
  58285. // If divider is found, we divide the list of values and operands to divide
  58286. // them by ofset X and Y.
  58287. var splitRegex = /\s*,\s*|\s+/;
  58288. var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];
  58289. // Convert the values with units to absolute pixels to allow our computations
  58290. ops = ops.map(function (op, index) {
  58291. // Most of the units rely on the orientation of the popper
  58292. var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';
  58293. var mergeWithPrevious = false;
  58294. return op
  58295. // This aggregates any `+` or `-` sign that aren't considered operators
  58296. // e.g.: 10 + +5 => [10, +, +5]
  58297. .reduce(function (a, b) {
  58298. if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {
  58299. a[a.length - 1] = b;
  58300. mergeWithPrevious = true;
  58301. return a;
  58302. } else if (mergeWithPrevious) {
  58303. a[a.length - 1] += b;
  58304. mergeWithPrevious = false;
  58305. return a;
  58306. } else {
  58307. return a.concat(b);
  58308. }
  58309. }, [])
  58310. // Here we convert the string values into number values (in px)
  58311. .map(function (str) {
  58312. return toValue(str, measurement, popperOffsets, referenceOffsets);
  58313. });
  58314. });
  58315. // Loop trough the offsets arrays and execute the operations
  58316. ops.forEach(function (op, index) {
  58317. op.forEach(function (frag, index2) {
  58318. if (isNumeric(frag)) {
  58319. offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);
  58320. }
  58321. });
  58322. });
  58323. return offsets;
  58324. }
  58325. /**
  58326. * @function
  58327. * @memberof Modifiers
  58328. * @argument {Object} data - The data object generated by update method
  58329. * @argument {Object} options - Modifiers configuration and options
  58330. * @argument {Number|String} options.offset=0
  58331. * The offset value as described in the modifier description
  58332. * @returns {Object} The data object, properly modified
  58333. */
  58334. function offset(data, _ref) {
  58335. var offset = _ref.offset;
  58336. var placement = data.placement,
  58337. _data$offsets = data.offsets,
  58338. popper = _data$offsets.popper,
  58339. reference = _data$offsets.reference;
  58340. var basePlacement = placement.split('-')[0];
  58341. var offsets = void 0;
  58342. if (isNumeric(+offset)) {
  58343. offsets = [+offset, 0];
  58344. } else {
  58345. offsets = parseOffset(offset, popper, reference, basePlacement);
  58346. }
  58347. if (basePlacement === 'left') {
  58348. popper.top += offsets[0];
  58349. popper.left -= offsets[1];
  58350. } else if (basePlacement === 'right') {
  58351. popper.top += offsets[0];
  58352. popper.left += offsets[1];
  58353. } else if (basePlacement === 'top') {
  58354. popper.left += offsets[0];
  58355. popper.top -= offsets[1];
  58356. } else if (basePlacement === 'bottom') {
  58357. popper.left += offsets[0];
  58358. popper.top += offsets[1];
  58359. }
  58360. data.popper = popper;
  58361. return data;
  58362. }
  58363. /**
  58364. * @function
  58365. * @memberof Modifiers
  58366. * @argument {Object} data - The data object generated by `update` method
  58367. * @argument {Object} options - Modifiers configuration and options
  58368. * @returns {Object} The data object, properly modified
  58369. */
  58370. function preventOverflow(data, options) {
  58371. var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);
  58372. // If offsetParent is the reference element, we really want to
  58373. // go one step up and use the next offsetParent as reference to
  58374. // avoid to make this modifier completely useless and look like broken
  58375. if (data.instance.reference === boundariesElement) {
  58376. boundariesElement = getOffsetParent(boundariesElement);
  58377. }
  58378. // NOTE: DOM access here
  58379. // resets the popper's position so that the document size can be calculated excluding
  58380. // the size of the popper element itself
  58381. var transformProp = getSupportedPropertyName('transform');
  58382. var popperStyles = data.instance.popper.style; // assignment to help minification
  58383. var top = popperStyles.top,
  58384. left = popperStyles.left,
  58385. transform = popperStyles[transformProp];
  58386. popperStyles.top = '';
  58387. popperStyles.left = '';
  58388. popperStyles[transformProp] = '';
  58389. var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);
  58390. // NOTE: DOM access here
  58391. // restores the original style properties after the offsets have been computed
  58392. popperStyles.top = top;
  58393. popperStyles.left = left;
  58394. popperStyles[transformProp] = transform;
  58395. options.boundaries = boundaries;
  58396. var order = options.priority;
  58397. var popper = data.offsets.popper;
  58398. var check = {
  58399. primary: function primary(placement) {
  58400. var value = popper[placement];
  58401. if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
  58402. value = Math.max(popper[placement], boundaries[placement]);
  58403. }
  58404. return defineProperty({}, placement, value);
  58405. },
  58406. secondary: function secondary(placement) {
  58407. var mainSide = placement === 'right' ? 'left' : 'top';
  58408. var value = popper[mainSide];
  58409. if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
  58410. value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));
  58411. }
  58412. return defineProperty({}, mainSide, value);
  58413. }
  58414. };
  58415. order.forEach(function (placement) {
  58416. var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
  58417. popper = _extends({}, popper, check[side](placement));
  58418. });
  58419. data.offsets.popper = popper;
  58420. return data;
  58421. }
  58422. /**
  58423. * @function
  58424. * @memberof Modifiers
  58425. * @argument {Object} data - The data object generated by `update` method
  58426. * @argument {Object} options - Modifiers configuration and options
  58427. * @returns {Object} The data object, properly modified
  58428. */
  58429. function shift(data) {
  58430. var placement = data.placement;
  58431. var basePlacement = placement.split('-')[0];
  58432. var shiftvariation = placement.split('-')[1];
  58433. // if shift shiftvariation is specified, run the modifier
  58434. if (shiftvariation) {
  58435. var _data$offsets = data.offsets,
  58436. reference = _data$offsets.reference,
  58437. popper = _data$offsets.popper;
  58438. var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
  58439. var side = isVertical ? 'left' : 'top';
  58440. var measurement = isVertical ? 'width' : 'height';
  58441. var shiftOffsets = {
  58442. start: defineProperty({}, side, reference[side]),
  58443. end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
  58444. };
  58445. data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);
  58446. }
  58447. return data;
  58448. }
  58449. /**
  58450. * @function
  58451. * @memberof Modifiers
  58452. * @argument {Object} data - The data object generated by update method
  58453. * @argument {Object} options - Modifiers configuration and options
  58454. * @returns {Object} The data object, properly modified
  58455. */
  58456. function hide(data) {
  58457. if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
  58458. return data;
  58459. }
  58460. var refRect = data.offsets.reference;
  58461. var bound = find(data.instance.modifiers, function (modifier) {
  58462. return modifier.name === 'preventOverflow';
  58463. }).boundaries;
  58464. if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
  58465. // Avoid unnecessary DOM access if visibility hasn't changed
  58466. if (data.hide === true) {
  58467. return data;
  58468. }
  58469. data.hide = true;
  58470. data.attributes['x-out-of-boundaries'] = '';
  58471. } else {
  58472. // Avoid unnecessary DOM access if visibility hasn't changed
  58473. if (data.hide === false) {
  58474. return data;
  58475. }
  58476. data.hide = false;
  58477. data.attributes['x-out-of-boundaries'] = false;
  58478. }
  58479. return data;
  58480. }
  58481. /**
  58482. * @function
  58483. * @memberof Modifiers
  58484. * @argument {Object} data - The data object generated by `update` method
  58485. * @argument {Object} options - Modifiers configuration and options
  58486. * @returns {Object} The data object, properly modified
  58487. */
  58488. function inner(data) {
  58489. var placement = data.placement;
  58490. var basePlacement = placement.split('-')[0];
  58491. var _data$offsets = data.offsets,
  58492. popper = _data$offsets.popper,
  58493. reference = _data$offsets.reference;
  58494. var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;
  58495. var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;
  58496. popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);
  58497. data.placement = getOppositePlacement(placement);
  58498. data.offsets.popper = getClientRect(popper);
  58499. return data;
  58500. }
  58501. /**
  58502. * Modifier function, each modifier can have a function of this type assigned
  58503. * to its `fn` property.<br />
  58504. * These functions will be called on each update, this means that you must
  58505. * make sure they are performant enough to avoid performance bottlenecks.
  58506. *
  58507. * @function ModifierFn
  58508. * @argument {dataObject} data - The data object generated by `update` method
  58509. * @argument {Object} options - Modifiers configuration and options
  58510. * @returns {dataObject} The data object, properly modified
  58511. */
  58512. /**
  58513. * Modifiers are plugins used to alter the behavior of your poppers.<br />
  58514. * Popper.js uses a set of 9 modifiers to provide all the basic functionalities
  58515. * needed by the library.
  58516. *
  58517. * Usually you don't want to override the `order`, `fn` and `onLoad` props.
  58518. * All the other properties are configurations that could be tweaked.
  58519. * @namespace modifiers
  58520. */
  58521. var modifiers = {
  58522. /**
  58523. * Modifier used to shift the popper on the start or end of its reference
  58524. * element.<br />
  58525. * It will read the variation of the `placement` property.<br />
  58526. * It can be one either `-end` or `-start`.
  58527. * @memberof modifiers
  58528. * @inner
  58529. */
  58530. shift: {
  58531. /** @prop {number} order=100 - Index used to define the order of execution */
  58532. order: 100,
  58533. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  58534. enabled: true,
  58535. /** @prop {ModifierFn} */
  58536. fn: shift
  58537. },
  58538. /**
  58539. * The `offset` modifier can shift your popper on both its axis.
  58540. *
  58541. * It accepts the following units:
  58542. * - `px` or unit-less, interpreted as pixels
  58543. * - `%` or `%r`, percentage relative to the length of the reference element
  58544. * - `%p`, percentage relative to the length of the popper element
  58545. * - `vw`, CSS viewport width unit
  58546. * - `vh`, CSS viewport height unit
  58547. *
  58548. * For length is intended the main axis relative to the placement of the popper.<br />
  58549. * This means that if the placement is `top` or `bottom`, the length will be the
  58550. * `width`. In case of `left` or `right`, it will be the `height`.
  58551. *
  58552. * You can provide a single value (as `Number` or `String`), or a pair of values
  58553. * as `String` divided by a comma or one (or more) white spaces.<br />
  58554. * The latter is a deprecated method because it leads to confusion and will be
  58555. * removed in v2.<br />
  58556. * Additionally, it accepts additions and subtractions between different units.
  58557. * Note that multiplications and divisions aren't supported.
  58558. *
  58559. * Valid examples are:
  58560. * ```
  58561. * 10
  58562. * '10%'
  58563. * '10, 10'
  58564. * '10%, 10'
  58565. * '10 + 10%'
  58566. * '10 - 5vh + 3%'
  58567. * '-10px + 5vh, 5px - 6%'
  58568. * ```
  58569. * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap
  58570. * > with their reference element, unfortunately, you will have to disable the `flip` modifier.
  58571. * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).
  58572. *
  58573. * @memberof modifiers
  58574. * @inner
  58575. */
  58576. offset: {
  58577. /** @prop {number} order=200 - Index used to define the order of execution */
  58578. order: 200,
  58579. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  58580. enabled: true,
  58581. /** @prop {ModifierFn} */
  58582. fn: offset,
  58583. /** @prop {Number|String} offset=0
  58584. * The offset value as described in the modifier description
  58585. */
  58586. offset: 0
  58587. },
  58588. /**
  58589. * Modifier used to prevent the popper from being positioned outside the boundary.
  58590. *
  58591. * A scenario exists where the reference itself is not within the boundaries.<br />
  58592. * We can say it has "escaped the boundaries" — or just "escaped".<br />
  58593. * In this case we need to decide whether the popper should either:
  58594. *
  58595. * - detach from the reference and remain "trapped" in the boundaries, or
  58596. * - if it should ignore the boundary and "escape with its reference"
  58597. *
  58598. * When `escapeWithReference` is set to`true` and reference is completely
  58599. * outside its boundaries, the popper will overflow (or completely leave)
  58600. * the boundaries in order to remain attached to the edge of the reference.
  58601. *
  58602. * @memberof modifiers
  58603. * @inner
  58604. */
  58605. preventOverflow: {
  58606. /** @prop {number} order=300 - Index used to define the order of execution */
  58607. order: 300,
  58608. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  58609. enabled: true,
  58610. /** @prop {ModifierFn} */
  58611. fn: preventOverflow,
  58612. /**
  58613. * @prop {Array} [priority=['left','right','top','bottom']]
  58614. * Popper will try to prevent overflow following these priorities by default,
  58615. * then, it could overflow on the left and on top of the `boundariesElement`
  58616. */
  58617. priority: ['left', 'right', 'top', 'bottom'],
  58618. /**
  58619. * @prop {number} padding=5
  58620. * Amount of pixel used to define a minimum distance between the boundaries
  58621. * and the popper. This makes sure the popper always has a little padding
  58622. * between the edges of its container
  58623. */
  58624. padding: 5,
  58625. /**
  58626. * @prop {String|HTMLElement} boundariesElement='scrollParent'
  58627. * Boundaries used by the modifier. Can be `scrollParent`, `window`,
  58628. * `viewport` or any DOM element.
  58629. */
  58630. boundariesElement: 'scrollParent'
  58631. },
  58632. /**
  58633. * Modifier used to make sure the reference and its popper stay near each other
  58634. * without leaving any gap between the two. Especially useful when the arrow is
  58635. * enabled and you want to ensure that it points to its reference element.
  58636. * It cares only about the first axis. You can still have poppers with margin
  58637. * between the popper and its reference element.
  58638. * @memberof modifiers
  58639. * @inner
  58640. */
  58641. keepTogether: {
  58642. /** @prop {number} order=400 - Index used to define the order of execution */
  58643. order: 400,
  58644. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  58645. enabled: true,
  58646. /** @prop {ModifierFn} */
  58647. fn: keepTogether
  58648. },
  58649. /**
  58650. * This modifier is used to move the `arrowElement` of the popper to make
  58651. * sure it is positioned between the reference element and its popper element.
  58652. * It will read the outer size of the `arrowElement` node to detect how many
  58653. * pixels of conjunction are needed.
  58654. *
  58655. * It has no effect if no `arrowElement` is provided.
  58656. * @memberof modifiers
  58657. * @inner
  58658. */
  58659. arrow: {
  58660. /** @prop {number} order=500 - Index used to define the order of execution */
  58661. order: 500,
  58662. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  58663. enabled: true,
  58664. /** @prop {ModifierFn} */
  58665. fn: arrow,
  58666. /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */
  58667. element: '[x-arrow]'
  58668. },
  58669. /**
  58670. * Modifier used to flip the popper's placement when it starts to overlap its
  58671. * reference element.
  58672. *
  58673. * Requires the `preventOverflow` modifier before it in order to work.
  58674. *
  58675. * **NOTE:** this modifier will interrupt the current update cycle and will
  58676. * restart it if it detects the need to flip the placement.
  58677. * @memberof modifiers
  58678. * @inner
  58679. */
  58680. flip: {
  58681. /** @prop {number} order=600 - Index used to define the order of execution */
  58682. order: 600,
  58683. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  58684. enabled: true,
  58685. /** @prop {ModifierFn} */
  58686. fn: flip,
  58687. /**
  58688. * @prop {String|Array} behavior='flip'
  58689. * The behavior used to change the popper's placement. It can be one of
  58690. * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid
  58691. * placements (with optional variations)
  58692. */
  58693. behavior: 'flip',
  58694. /**
  58695. * @prop {number} padding=5
  58696. * The popper will flip if it hits the edges of the `boundariesElement`
  58697. */
  58698. padding: 5,
  58699. /**
  58700. * @prop {String|HTMLElement} boundariesElement='viewport'
  58701. * The element which will define the boundaries of the popper position.
  58702. * The popper will never be placed outside of the defined boundaries
  58703. * (except if `keepTogether` is enabled)
  58704. */
  58705. boundariesElement: 'viewport',
  58706. /**
  58707. * @prop {Boolean} flipVariations=false
  58708. * The popper will switch placement variation between `-start` and `-end` when
  58709. * the reference element overlaps its boundaries.
  58710. *
  58711. * The original placement should have a set variation.
  58712. */
  58713. flipVariations: false,
  58714. /**
  58715. * @prop {Boolean} flipVariationsByContent=false
  58716. * The popper will switch placement variation between `-start` and `-end` when
  58717. * the popper element overlaps its reference boundaries.
  58718. *
  58719. * The original placement should have a set variation.
  58720. */
  58721. flipVariationsByContent: false
  58722. },
  58723. /**
  58724. * Modifier used to make the popper flow toward the inner of the reference element.
  58725. * By default, when this modifier is disabled, the popper will be placed outside
  58726. * the reference element.
  58727. * @memberof modifiers
  58728. * @inner
  58729. */
  58730. inner: {
  58731. /** @prop {number} order=700 - Index used to define the order of execution */
  58732. order: 700,
  58733. /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */
  58734. enabled: false,
  58735. /** @prop {ModifierFn} */
  58736. fn: inner
  58737. },
  58738. /**
  58739. * Modifier used to hide the popper when its reference element is outside of the
  58740. * popper boundaries. It will set a `x-out-of-boundaries` attribute which can
  58741. * be used to hide with a CSS selector the popper when its reference is
  58742. * out of boundaries.
  58743. *
  58744. * Requires the `preventOverflow` modifier before it in order to work.
  58745. * @memberof modifiers
  58746. * @inner
  58747. */
  58748. hide: {
  58749. /** @prop {number} order=800 - Index used to define the order of execution */
  58750. order: 800,
  58751. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  58752. enabled: true,
  58753. /** @prop {ModifierFn} */
  58754. fn: hide
  58755. },
  58756. /**
  58757. * Computes the style that will be applied to the popper element to gets
  58758. * properly positioned.
  58759. *
  58760. * Note that this modifier will not touch the DOM, it just prepares the styles
  58761. * so that `applyStyle` modifier can apply it. This separation is useful
  58762. * in case you need to replace `applyStyle` with a custom implementation.
  58763. *
  58764. * This modifier has `850` as `order` value to maintain backward compatibility
  58765. * with previous versions of Popper.js. Expect the modifiers ordering method
  58766. * to change in future major versions of the library.
  58767. *
  58768. * @memberof modifiers
  58769. * @inner
  58770. */
  58771. computeStyle: {
  58772. /** @prop {number} order=850 - Index used to define the order of execution */
  58773. order: 850,
  58774. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  58775. enabled: true,
  58776. /** @prop {ModifierFn} */
  58777. fn: computeStyle,
  58778. /**
  58779. * @prop {Boolean} gpuAcceleration=true
  58780. * If true, it uses the CSS 3D transformation to position the popper.
  58781. * Otherwise, it will use the `top` and `left` properties
  58782. */
  58783. gpuAcceleration: true,
  58784. /**
  58785. * @prop {string} [x='bottom']
  58786. * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.
  58787. * Change this if your popper should grow in a direction different from `bottom`
  58788. */
  58789. x: 'bottom',
  58790. /**
  58791. * @prop {string} [x='left']
  58792. * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.
  58793. * Change this if your popper should grow in a direction different from `right`
  58794. */
  58795. y: 'right'
  58796. },
  58797. /**
  58798. * Applies the computed styles to the popper element.
  58799. *
  58800. * All the DOM manipulations are limited to this modifier. This is useful in case
  58801. * you want to integrate Popper.js inside a framework or view library and you
  58802. * want to delegate all the DOM manipulations to it.
  58803. *
  58804. * Note that if you disable this modifier, you must make sure the popper element
  58805. * has its position set to `absolute` before Popper.js can do its work!
  58806. *
  58807. * Just disable this modifier and define your own to achieve the desired effect.
  58808. *
  58809. * @memberof modifiers
  58810. * @inner
  58811. */
  58812. applyStyle: {
  58813. /** @prop {number} order=900 - Index used to define the order of execution */
  58814. order: 900,
  58815. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  58816. enabled: true,
  58817. /** @prop {ModifierFn} */
  58818. fn: applyStyle,
  58819. /** @prop {Function} */
  58820. onLoad: applyStyleOnLoad,
  58821. /**
  58822. * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier
  58823. * @prop {Boolean} gpuAcceleration=true
  58824. * If true, it uses the CSS 3D transformation to position the popper.
  58825. * Otherwise, it will use the `top` and `left` properties
  58826. */
  58827. gpuAcceleration: undefined
  58828. }
  58829. };
  58830. /**
  58831. * The `dataObject` is an object containing all the information used by Popper.js.
  58832. * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.
  58833. * @name dataObject
  58834. * @property {Object} data.instance The Popper.js instance
  58835. * @property {String} data.placement Placement applied to popper
  58836. * @property {String} data.originalPlacement Placement originally defined on init
  58837. * @property {Boolean} data.flipped True if popper has been flipped by flip modifier
  58838. * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper
  58839. * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier
  58840. * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)
  58841. * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)
  58842. * @property {Object} data.boundaries Offsets of the popper boundaries
  58843. * @property {Object} data.offsets The measurements of popper, reference and arrow elements
  58844. * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values
  58845. * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values
  58846. * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0
  58847. */
  58848. /**
  58849. * Default options provided to Popper.js constructor.<br />
  58850. * These can be overridden using the `options` argument of Popper.js.<br />
  58851. * To override an option, simply pass an object with the same
  58852. * structure of the `options` object, as the 3rd argument. For example:
  58853. * ```
  58854. * new Popper(ref, pop, {
  58855. * modifiers: {
  58856. * preventOverflow: { enabled: false }
  58857. * }
  58858. * })
  58859. * ```
  58860. * @type {Object}
  58861. * @static
  58862. * @memberof Popper
  58863. */
  58864. var Defaults = {
  58865. /**
  58866. * Popper's placement.
  58867. * @prop {Popper.placements} placement='bottom'
  58868. */
  58869. placement: 'bottom',
  58870. /**
  58871. * Set this to true if you want popper to position it self in 'fixed' mode
  58872. * @prop {Boolean} positionFixed=false
  58873. */
  58874. positionFixed: false,
  58875. /**
  58876. * Whether events (resize, scroll) are initially enabled.
  58877. * @prop {Boolean} eventsEnabled=true
  58878. */
  58879. eventsEnabled: true,
  58880. /**
  58881. * Set to true if you want to automatically remove the popper when
  58882. * you call the `destroy` method.
  58883. * @prop {Boolean} removeOnDestroy=false
  58884. */
  58885. removeOnDestroy: false,
  58886. /**
  58887. * Callback called when the popper is created.<br />
  58888. * By default, it is set to no-op.<br />
  58889. * Access Popper.js instance with `data.instance`.
  58890. * @prop {onCreate}
  58891. */
  58892. onCreate: function onCreate() {},
  58893. /**
  58894. * Callback called when the popper is updated. This callback is not called
  58895. * on the initialization/creation of the popper, but only on subsequent
  58896. * updates.<br />
  58897. * By default, it is set to no-op.<br />
  58898. * Access Popper.js instance with `data.instance`.
  58899. * @prop {onUpdate}
  58900. */
  58901. onUpdate: function onUpdate() {},
  58902. /**
  58903. * List of modifiers used to modify the offsets before they are applied to the popper.
  58904. * They provide most of the functionalities of Popper.js.
  58905. * @prop {modifiers}
  58906. */
  58907. modifiers: modifiers
  58908. };
  58909. /**
  58910. * @callback onCreate
  58911. * @param {dataObject} data
  58912. */
  58913. /**
  58914. * @callback onUpdate
  58915. * @param {dataObject} data
  58916. */
  58917. // Utils
  58918. // Methods
  58919. var Popper = function () {
  58920. /**
  58921. * Creates a new Popper.js instance.
  58922. * @class Popper
  58923. * @param {Element|referenceObject} reference - The reference element used to position the popper
  58924. * @param {Element} popper - The HTML / XML element used as the popper
  58925. * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)
  58926. * @return {Object} instance - The generated Popper.js instance
  58927. */
  58928. function Popper(reference, popper) {
  58929. var _this = this;
  58930. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  58931. classCallCheck(this, Popper);
  58932. this.scheduleUpdate = function () {
  58933. return requestAnimationFrame(_this.update);
  58934. };
  58935. // make update() debounced, so that it only runs at most once-per-tick
  58936. this.update = debounce(this.update.bind(this));
  58937. // with {} we create a new object with the options inside it
  58938. this.options = _extends({}, Popper.Defaults, options);
  58939. // init state
  58940. this.state = {
  58941. isDestroyed: false,
  58942. isCreated: false,
  58943. scrollParents: []
  58944. };
  58945. // get reference and popper elements (allow jQuery wrappers)
  58946. this.reference = reference && reference.jquery ? reference[0] : reference;
  58947. this.popper = popper && popper.jquery ? popper[0] : popper;
  58948. // Deep merge modifiers options
  58949. this.options.modifiers = {};
  58950. Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
  58951. _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
  58952. });
  58953. // Refactoring modifiers' list (Object => Array)
  58954. this.modifiers = Object.keys(this.options.modifiers).map(function (name) {
  58955. return _extends({
  58956. name: name
  58957. }, _this.options.modifiers[name]);
  58958. })
  58959. // sort the modifiers by order
  58960. .sort(function (a, b) {
  58961. return a.order - b.order;
  58962. });
  58963. // modifiers have the ability to execute arbitrary code when Popper.js get inited
  58964. // such code is executed in the same order of its modifier
  58965. // they could add new properties to their options configuration
  58966. // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!
  58967. this.modifiers.forEach(function (modifierOptions) {
  58968. if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {
  58969. modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
  58970. }
  58971. });
  58972. // fire the first update to position the popper in the right place
  58973. this.update();
  58974. var eventsEnabled = this.options.eventsEnabled;
  58975. if (eventsEnabled) {
  58976. // setup event listeners, they will take care of update the position in specific situations
  58977. this.enableEventListeners();
  58978. }
  58979. this.state.eventsEnabled = eventsEnabled;
  58980. }
  58981. // We can't use class properties because they don't get listed in the
  58982. // class prototype and break stuff like Sinon stubs
  58983. createClass(Popper, [{
  58984. key: 'update',
  58985. value: function update$$1() {
  58986. return update.call(this);
  58987. }
  58988. }, {
  58989. key: 'destroy',
  58990. value: function destroy$$1() {
  58991. return destroy.call(this);
  58992. }
  58993. }, {
  58994. key: 'enableEventListeners',
  58995. value: function enableEventListeners$$1() {
  58996. return enableEventListeners.call(this);
  58997. }
  58998. }, {
  58999. key: 'disableEventListeners',
  59000. value: function disableEventListeners$$1() {
  59001. return disableEventListeners.call(this);
  59002. }
  59003. /**
  59004. * Schedules an update. It will run on the next UI update available.
  59005. * @method scheduleUpdate
  59006. * @memberof Popper
  59007. */
  59008. /**
  59009. * Collection of utilities useful when writing custom modifiers.
  59010. * Starting from version 1.7, this method is available only if you
  59011. * include `popper-utils.js` before `popper.js`.
  59012. *
  59013. * **DEPRECATION**: This way to access PopperUtils is deprecated
  59014. * and will be removed in v2! Use the PopperUtils module directly instead.
  59015. * Due to the high instability of the methods contained in Utils, we can't
  59016. * guarantee them to follow semver. Use them at your own risk!
  59017. * @static
  59018. * @private
  59019. * @type {Object}
  59020. * @deprecated since version 1.8
  59021. * @member Utils
  59022. * @memberof Popper
  59023. */
  59024. }]);
  59025. return Popper;
  59026. }();
  59027. /**
  59028. * The `referenceObject` is an object that provides an interface compatible with Popper.js
  59029. * and lets you use it as replacement of a real DOM node.<br />
  59030. * You can use this method to position a popper relatively to a set of coordinates
  59031. * in case you don't have a DOM node to use as reference.
  59032. *
  59033. * ```
  59034. * new Popper(referenceObject, popperNode);
  59035. * ```
  59036. *
  59037. * NB: This feature isn't supported in Internet Explorer 10.
  59038. * @name referenceObject
  59039. * @property {Function} data.getBoundingClientRect
  59040. * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.
  59041. * @property {number} data.clientWidth
  59042. * An ES6 getter that will return the width of the virtual reference element.
  59043. * @property {number} data.clientHeight
  59044. * An ES6 getter that will return the height of the virtual reference element.
  59045. */
  59046. Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;
  59047. Popper.placements = placements;
  59048. Popper.Defaults = Defaults;
  59049. /* harmony default export */ __webpack_exports__["default"] = (Popper);
  59050. //# sourceMappingURL=popper.js.map
  59051. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  59052. /***/ }),
  59053. /***/ "./node_modules/process/browser.js":
  59054. /*!*****************************************!*\
  59055. !*** ./node_modules/process/browser.js ***!
  59056. \*****************************************/
  59057. /*! no static exports found */
  59058. /***/ (function(module, exports) {
  59059. // shim for using process in browser
  59060. var process = module.exports = {};
  59061. // cached from whatever global is present so that test runners that stub it
  59062. // don't break things. But we need to wrap it in a try catch in case it is
  59063. // wrapped in strict mode code which doesn't define any globals. It's inside a
  59064. // function because try/catches deoptimize in certain engines.
  59065. var cachedSetTimeout;
  59066. var cachedClearTimeout;
  59067. function defaultSetTimout() {
  59068. throw new Error('setTimeout has not been defined');
  59069. }
  59070. function defaultClearTimeout () {
  59071. throw new Error('clearTimeout has not been defined');
  59072. }
  59073. (function () {
  59074. try {
  59075. if (typeof setTimeout === 'function') {
  59076. cachedSetTimeout = setTimeout;
  59077. } else {
  59078. cachedSetTimeout = defaultSetTimout;
  59079. }
  59080. } catch (e) {
  59081. cachedSetTimeout = defaultSetTimout;
  59082. }
  59083. try {
  59084. if (typeof clearTimeout === 'function') {
  59085. cachedClearTimeout = clearTimeout;
  59086. } else {
  59087. cachedClearTimeout = defaultClearTimeout;
  59088. }
  59089. } catch (e) {
  59090. cachedClearTimeout = defaultClearTimeout;
  59091. }
  59092. } ())
  59093. function runTimeout(fun) {
  59094. if (cachedSetTimeout === setTimeout) {
  59095. //normal enviroments in sane situations
  59096. return setTimeout(fun, 0);
  59097. }
  59098. // if setTimeout wasn't available but was latter defined
  59099. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  59100. cachedSetTimeout = setTimeout;
  59101. return setTimeout(fun, 0);
  59102. }
  59103. try {
  59104. // when when somebody has screwed with setTimeout but no I.E. maddness
  59105. return cachedSetTimeout(fun, 0);
  59106. } catch(e){
  59107. try {
  59108. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  59109. return cachedSetTimeout.call(null, fun, 0);
  59110. } catch(e){
  59111. // 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
  59112. return cachedSetTimeout.call(this, fun, 0);
  59113. }
  59114. }
  59115. }
  59116. function runClearTimeout(marker) {
  59117. if (cachedClearTimeout === clearTimeout) {
  59118. //normal enviroments in sane situations
  59119. return clearTimeout(marker);
  59120. }
  59121. // if clearTimeout wasn't available but was latter defined
  59122. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  59123. cachedClearTimeout = clearTimeout;
  59124. return clearTimeout(marker);
  59125. }
  59126. try {
  59127. // when when somebody has screwed with setTimeout but no I.E. maddness
  59128. return cachedClearTimeout(marker);
  59129. } catch (e){
  59130. try {
  59131. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  59132. return cachedClearTimeout.call(null, marker);
  59133. } catch (e){
  59134. // 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.
  59135. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  59136. return cachedClearTimeout.call(this, marker);
  59137. }
  59138. }
  59139. }
  59140. var queue = [];
  59141. var draining = false;
  59142. var currentQueue;
  59143. var queueIndex = -1;
  59144. function cleanUpNextTick() {
  59145. if (!draining || !currentQueue) {
  59146. return;
  59147. }
  59148. draining = false;
  59149. if (currentQueue.length) {
  59150. queue = currentQueue.concat(queue);
  59151. } else {
  59152. queueIndex = -1;
  59153. }
  59154. if (queue.length) {
  59155. drainQueue();
  59156. }
  59157. }
  59158. function drainQueue() {
  59159. if (draining) {
  59160. return;
  59161. }
  59162. var timeout = runTimeout(cleanUpNextTick);
  59163. draining = true;
  59164. var len = queue.length;
  59165. while(len) {
  59166. currentQueue = queue;
  59167. queue = [];
  59168. while (++queueIndex < len) {
  59169. if (currentQueue) {
  59170. currentQueue[queueIndex].run();
  59171. }
  59172. }
  59173. queueIndex = -1;
  59174. len = queue.length;
  59175. }
  59176. currentQueue = null;
  59177. draining = false;
  59178. runClearTimeout(timeout);
  59179. }
  59180. process.nextTick = function (fun) {
  59181. var args = new Array(arguments.length - 1);
  59182. if (arguments.length > 1) {
  59183. for (var i = 1; i < arguments.length; i++) {
  59184. args[i - 1] = arguments[i];
  59185. }
  59186. }
  59187. queue.push(new Item(fun, args));
  59188. if (queue.length === 1 && !draining) {
  59189. runTimeout(drainQueue);
  59190. }
  59191. };
  59192. // v8 likes predictible objects
  59193. function Item(fun, array) {
  59194. this.fun = fun;
  59195. this.array = array;
  59196. }
  59197. Item.prototype.run = function () {
  59198. this.fun.apply(null, this.array);
  59199. };
  59200. process.title = 'browser';
  59201. process.browser = true;
  59202. process.env = {};
  59203. process.argv = [];
  59204. process.version = ''; // empty string to avoid regexp issues
  59205. process.versions = {};
  59206. function noop() {}
  59207. process.on = noop;
  59208. process.addListener = noop;
  59209. process.once = noop;
  59210. process.off = noop;
  59211. process.removeListener = noop;
  59212. process.removeAllListeners = noop;
  59213. process.emit = noop;
  59214. process.prependListener = noop;
  59215. process.prependOnceListener = noop;
  59216. process.listeners = function (name) { return [] }
  59217. process.binding = function (name) {
  59218. throw new Error('process.binding is not supported');
  59219. };
  59220. process.cwd = function () { return '/' };
  59221. process.chdir = function (dir) {
  59222. throw new Error('process.chdir is not supported');
  59223. };
  59224. process.umask = function() { return 0; };
  59225. /***/ }),
  59226. /***/ "./node_modules/setimmediate/setImmediate.js":
  59227. /*!***************************************************!*\
  59228. !*** ./node_modules/setimmediate/setImmediate.js ***!
  59229. \***************************************************/
  59230. /*! no static exports found */
  59231. /***/ (function(module, exports, __webpack_require__) {
  59232. /* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) {
  59233. "use strict";
  59234. if (global.setImmediate) {
  59235. return;
  59236. }
  59237. var nextHandle = 1; // Spec says greater than zero
  59238. var tasksByHandle = {};
  59239. var currentlyRunningATask = false;
  59240. var doc = global.document;
  59241. var registerImmediate;
  59242. function setImmediate(callback) {
  59243. // Callback can either be a function or a string
  59244. if (typeof callback !== "function") {
  59245. callback = new Function("" + callback);
  59246. }
  59247. // Copy function arguments
  59248. var args = new Array(arguments.length - 1);
  59249. for (var i = 0; i < args.length; i++) {
  59250. args[i] = arguments[i + 1];
  59251. }
  59252. // Store and register the task
  59253. var task = { callback: callback, args: args };
  59254. tasksByHandle[nextHandle] = task;
  59255. registerImmediate(nextHandle);
  59256. return nextHandle++;
  59257. }
  59258. function clearImmediate(handle) {
  59259. delete tasksByHandle[handle];
  59260. }
  59261. function run(task) {
  59262. var callback = task.callback;
  59263. var args = task.args;
  59264. switch (args.length) {
  59265. case 0:
  59266. callback();
  59267. break;
  59268. case 1:
  59269. callback(args[0]);
  59270. break;
  59271. case 2:
  59272. callback(args[0], args[1]);
  59273. break;
  59274. case 3:
  59275. callback(args[0], args[1], args[2]);
  59276. break;
  59277. default:
  59278. callback.apply(undefined, args);
  59279. break;
  59280. }
  59281. }
  59282. function runIfPresent(handle) {
  59283. // From the spec: "Wait until any invocations of this algorithm started before this one have completed."
  59284. // So if we're currently running a task, we'll need to delay this invocation.
  59285. if (currentlyRunningATask) {
  59286. // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a
  59287. // "too much recursion" error.
  59288. setTimeout(runIfPresent, 0, handle);
  59289. } else {
  59290. var task = tasksByHandle[handle];
  59291. if (task) {
  59292. currentlyRunningATask = true;
  59293. try {
  59294. run(task);
  59295. } finally {
  59296. clearImmediate(handle);
  59297. currentlyRunningATask = false;
  59298. }
  59299. }
  59300. }
  59301. }
  59302. function installNextTickImplementation() {
  59303. registerImmediate = function(handle) {
  59304. process.nextTick(function () { runIfPresent(handle); });
  59305. };
  59306. }
  59307. function canUsePostMessage() {
  59308. // The test against `importScripts` prevents this implementation from being installed inside a web worker,
  59309. // where `global.postMessage` means something completely different and can't be used for this purpose.
  59310. if (global.postMessage && !global.importScripts) {
  59311. var postMessageIsAsynchronous = true;
  59312. var oldOnMessage = global.onmessage;
  59313. global.onmessage = function() {
  59314. postMessageIsAsynchronous = false;
  59315. };
  59316. global.postMessage("", "*");
  59317. global.onmessage = oldOnMessage;
  59318. return postMessageIsAsynchronous;
  59319. }
  59320. }
  59321. function installPostMessageImplementation() {
  59322. // Installs an event handler on `global` for the `message` event: see
  59323. // * https://developer.mozilla.org/en/DOM/window.postMessage
  59324. // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages
  59325. var messagePrefix = "setImmediate$" + Math.random() + "$";
  59326. var onGlobalMessage = function(event) {
  59327. if (event.source === global &&
  59328. typeof event.data === "string" &&
  59329. event.data.indexOf(messagePrefix) === 0) {
  59330. runIfPresent(+event.data.slice(messagePrefix.length));
  59331. }
  59332. };
  59333. if (global.addEventListener) {
  59334. global.addEventListener("message", onGlobalMessage, false);
  59335. } else {
  59336. global.attachEvent("onmessage", onGlobalMessage);
  59337. }
  59338. registerImmediate = function(handle) {
  59339. global.postMessage(messagePrefix + handle, "*");
  59340. };
  59341. }
  59342. function installMessageChannelImplementation() {
  59343. var channel = new MessageChannel();
  59344. channel.port1.onmessage = function(event) {
  59345. var handle = event.data;
  59346. runIfPresent(handle);
  59347. };
  59348. registerImmediate = function(handle) {
  59349. channel.port2.postMessage(handle);
  59350. };
  59351. }
  59352. function installReadyStateChangeImplementation() {
  59353. var html = doc.documentElement;
  59354. registerImmediate = function(handle) {
  59355. // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
  59356. // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
  59357. var script = doc.createElement("script");
  59358. script.onreadystatechange = function () {
  59359. runIfPresent(handle);
  59360. script.onreadystatechange = null;
  59361. html.removeChild(script);
  59362. script = null;
  59363. };
  59364. html.appendChild(script);
  59365. };
  59366. }
  59367. function installSetTimeoutImplementation() {
  59368. registerImmediate = function(handle) {
  59369. setTimeout(runIfPresent, 0, handle);
  59370. };
  59371. }
  59372. // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.
  59373. var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);
  59374. attachTo = attachTo && attachTo.setTimeout ? attachTo : global;
  59375. // Don't get fooled by e.g. browserify environments.
  59376. if ({}.toString.call(global.process) === "[object process]") {
  59377. // For Node.js before 0.9
  59378. installNextTickImplementation();
  59379. } else if (canUsePostMessage()) {
  59380. // For non-IE10 modern browsers
  59381. installPostMessageImplementation();
  59382. } else if (global.MessageChannel) {
  59383. // For web workers, where supported
  59384. installMessageChannelImplementation();
  59385. } else if (doc && "onreadystatechange" in doc.createElement("script")) {
  59386. // For IE 6–8
  59387. installReadyStateChangeImplementation();
  59388. } else {
  59389. // For older browsers
  59390. installSetTimeoutImplementation();
  59391. }
  59392. attachTo.setImmediate = setImmediate;
  59393. attachTo.clearImmediate = clearImmediate;
  59394. }(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self));
  59395. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../process/browser.js */ "./node_modules/process/browser.js")))
  59396. /***/ }),
  59397. /***/ "./node_modules/socket.io-client/lib/index.js":
  59398. /*!****************************************************!*\
  59399. !*** ./node_modules/socket.io-client/lib/index.js ***!
  59400. \****************************************************/
  59401. /*! no static exports found */
  59402. /***/ (function(module, exports, __webpack_require__) {
  59403. /**
  59404. * Module dependencies.
  59405. */
  59406. var url = __webpack_require__(/*! ./url */ "./node_modules/socket.io-client/lib/url.js");
  59407. var parser = __webpack_require__(/*! socket.io-parser */ "./node_modules/socket.io-parser/index.js");
  59408. var Manager = __webpack_require__(/*! ./manager */ "./node_modules/socket.io-client/lib/manager.js");
  59409. var debug = __webpack_require__(/*! debug */ "./node_modules/socket.io-client/node_modules/debug/src/browser.js")('socket.io-client');
  59410. /**
  59411. * Module exports.
  59412. */
  59413. module.exports = exports = lookup;
  59414. /**
  59415. * Managers cache.
  59416. */
  59417. var cache = exports.managers = {};
  59418. /**
  59419. * Looks up an existing `Manager` for multiplexing.
  59420. * If the user summons:
  59421. *
  59422. * `io('http://localhost/a');`
  59423. * `io('http://localhost/b');`
  59424. *
  59425. * We reuse the existing instance based on same scheme/port/host,
  59426. * and we initialize sockets for each namespace.
  59427. *
  59428. * @api public
  59429. */
  59430. function lookup (uri, opts) {
  59431. if (typeof uri === 'object') {
  59432. opts = uri;
  59433. uri = undefined;
  59434. }
  59435. opts = opts || {};
  59436. var parsed = url(uri);
  59437. var source = parsed.source;
  59438. var id = parsed.id;
  59439. var path = parsed.path;
  59440. var sameNamespace = cache[id] && path in cache[id].nsps;
  59441. var newConnection = opts.forceNew || opts['force new connection'] ||
  59442. false === opts.multiplex || sameNamespace;
  59443. var io;
  59444. if (newConnection) {
  59445. debug('ignoring socket cache for %s', source);
  59446. io = Manager(source, opts);
  59447. } else {
  59448. if (!cache[id]) {
  59449. debug('new io instance for %s', source);
  59450. cache[id] = Manager(source, opts);
  59451. }
  59452. io = cache[id];
  59453. }
  59454. if (parsed.query && !opts.query) {
  59455. opts.query = parsed.query;
  59456. }
  59457. return io.socket(parsed.path, opts);
  59458. }
  59459. /**
  59460. * Protocol version.
  59461. *
  59462. * @api public
  59463. */
  59464. exports.protocol = parser.protocol;
  59465. /**
  59466. * `connect`.
  59467. *
  59468. * @param {String} uri
  59469. * @api public
  59470. */
  59471. exports.connect = lookup;
  59472. /**
  59473. * Expose constructors for standalone build.
  59474. *
  59475. * @api public
  59476. */
  59477. exports.Manager = __webpack_require__(/*! ./manager */ "./node_modules/socket.io-client/lib/manager.js");
  59478. exports.Socket = __webpack_require__(/*! ./socket */ "./node_modules/socket.io-client/lib/socket.js");
  59479. /***/ }),
  59480. /***/ "./node_modules/socket.io-client/lib/manager.js":
  59481. /*!******************************************************!*\
  59482. !*** ./node_modules/socket.io-client/lib/manager.js ***!
  59483. \******************************************************/
  59484. /*! no static exports found */
  59485. /***/ (function(module, exports, __webpack_require__) {
  59486. /**
  59487. * Module dependencies.
  59488. */
  59489. var eio = __webpack_require__(/*! engine.io-client */ "./node_modules/engine.io-client/lib/index.js");
  59490. var Socket = __webpack_require__(/*! ./socket */ "./node_modules/socket.io-client/lib/socket.js");
  59491. var Emitter = __webpack_require__(/*! component-emitter */ "./node_modules/socket.io-client/node_modules/component-emitter/index.js");
  59492. var parser = __webpack_require__(/*! socket.io-parser */ "./node_modules/socket.io-parser/index.js");
  59493. var on = __webpack_require__(/*! ./on */ "./node_modules/socket.io-client/lib/on.js");
  59494. var bind = __webpack_require__(/*! component-bind */ "./node_modules/component-bind/index.js");
  59495. var debug = __webpack_require__(/*! debug */ "./node_modules/socket.io-client/node_modules/debug/src/browser.js")('socket.io-client:manager');
  59496. var indexOf = __webpack_require__(/*! indexof */ "./node_modules/indexof/index.js");
  59497. var Backoff = __webpack_require__(/*! backo2 */ "./node_modules/backo2/index.js");
  59498. /**
  59499. * IE6+ hasOwnProperty
  59500. */
  59501. var has = Object.prototype.hasOwnProperty;
  59502. /**
  59503. * Module exports
  59504. */
  59505. module.exports = Manager;
  59506. /**
  59507. * `Manager` constructor.
  59508. *
  59509. * @param {String} engine instance or engine uri/opts
  59510. * @param {Object} options
  59511. * @api public
  59512. */
  59513. function Manager (uri, opts) {
  59514. if (!(this instanceof Manager)) return new Manager(uri, opts);
  59515. if (uri && ('object' === typeof uri)) {
  59516. opts = uri;
  59517. uri = undefined;
  59518. }
  59519. opts = opts || {};
  59520. opts.path = opts.path || '/socket.io';
  59521. this.nsps = {};
  59522. this.subs = [];
  59523. this.opts = opts;
  59524. this.reconnection(opts.reconnection !== false);
  59525. this.reconnectionAttempts(opts.reconnectionAttempts || Infinity);
  59526. this.reconnectionDelay(opts.reconnectionDelay || 1000);
  59527. this.reconnectionDelayMax(opts.reconnectionDelayMax || 5000);
  59528. this.randomizationFactor(opts.randomizationFactor || 0.5);
  59529. this.backoff = new Backoff({
  59530. min: this.reconnectionDelay(),
  59531. max: this.reconnectionDelayMax(),
  59532. jitter: this.randomizationFactor()
  59533. });
  59534. this.timeout(null == opts.timeout ? 20000 : opts.timeout);
  59535. this.readyState = 'closed';
  59536. this.uri = uri;
  59537. this.connecting = [];
  59538. this.lastPing = null;
  59539. this.encoding = false;
  59540. this.packetBuffer = [];
  59541. var _parser = opts.parser || parser;
  59542. this.encoder = new _parser.Encoder();
  59543. this.decoder = new _parser.Decoder();
  59544. this.autoConnect = opts.autoConnect !== false;
  59545. if (this.autoConnect) this.open();
  59546. }
  59547. /**
  59548. * Propagate given event to sockets and emit on `this`
  59549. *
  59550. * @api private
  59551. */
  59552. Manager.prototype.emitAll = function () {
  59553. this.emit.apply(this, arguments);
  59554. for (var nsp in this.nsps) {
  59555. if (has.call(this.nsps, nsp)) {
  59556. this.nsps[nsp].emit.apply(this.nsps[nsp], arguments);
  59557. }
  59558. }
  59559. };
  59560. /**
  59561. * Update `socket.id` of all sockets
  59562. *
  59563. * @api private
  59564. */
  59565. Manager.prototype.updateSocketIds = function () {
  59566. for (var nsp in this.nsps) {
  59567. if (has.call(this.nsps, nsp)) {
  59568. this.nsps[nsp].id = this.generateId(nsp);
  59569. }
  59570. }
  59571. };
  59572. /**
  59573. * generate `socket.id` for the given `nsp`
  59574. *
  59575. * @param {String} nsp
  59576. * @return {String}
  59577. * @api private
  59578. */
  59579. Manager.prototype.generateId = function (nsp) {
  59580. return (nsp === '/' ? '' : (nsp + '#')) + this.engine.id;
  59581. };
  59582. /**
  59583. * Mix in `Emitter`.
  59584. */
  59585. Emitter(Manager.prototype);
  59586. /**
  59587. * Sets the `reconnection` config.
  59588. *
  59589. * @param {Boolean} true/false if it should automatically reconnect
  59590. * @return {Manager} self or value
  59591. * @api public
  59592. */
  59593. Manager.prototype.reconnection = function (v) {
  59594. if (!arguments.length) return this._reconnection;
  59595. this._reconnection = !!v;
  59596. return this;
  59597. };
  59598. /**
  59599. * Sets the reconnection attempts config.
  59600. *
  59601. * @param {Number} max reconnection attempts before giving up
  59602. * @return {Manager} self or value
  59603. * @api public
  59604. */
  59605. Manager.prototype.reconnectionAttempts = function (v) {
  59606. if (!arguments.length) return this._reconnectionAttempts;
  59607. this._reconnectionAttempts = v;
  59608. return this;
  59609. };
  59610. /**
  59611. * Sets the delay between reconnections.
  59612. *
  59613. * @param {Number} delay
  59614. * @return {Manager} self or value
  59615. * @api public
  59616. */
  59617. Manager.prototype.reconnectionDelay = function (v) {
  59618. if (!arguments.length) return this._reconnectionDelay;
  59619. this._reconnectionDelay = v;
  59620. this.backoff && this.backoff.setMin(v);
  59621. return this;
  59622. };
  59623. Manager.prototype.randomizationFactor = function (v) {
  59624. if (!arguments.length) return this._randomizationFactor;
  59625. this._randomizationFactor = v;
  59626. this.backoff && this.backoff.setJitter(v);
  59627. return this;
  59628. };
  59629. /**
  59630. * Sets the maximum delay between reconnections.
  59631. *
  59632. * @param {Number} delay
  59633. * @return {Manager} self or value
  59634. * @api public
  59635. */
  59636. Manager.prototype.reconnectionDelayMax = function (v) {
  59637. if (!arguments.length) return this._reconnectionDelayMax;
  59638. this._reconnectionDelayMax = v;
  59639. this.backoff && this.backoff.setMax(v);
  59640. return this;
  59641. };
  59642. /**
  59643. * Sets the connection timeout. `false` to disable
  59644. *
  59645. * @return {Manager} self or value
  59646. * @api public
  59647. */
  59648. Manager.prototype.timeout = function (v) {
  59649. if (!arguments.length) return this._timeout;
  59650. this._timeout = v;
  59651. return this;
  59652. };
  59653. /**
  59654. * Starts trying to reconnect if reconnection is enabled and we have not
  59655. * started reconnecting yet
  59656. *
  59657. * @api private
  59658. */
  59659. Manager.prototype.maybeReconnectOnOpen = function () {
  59660. // Only try to reconnect if it's the first time we're connecting
  59661. if (!this.reconnecting && this._reconnection && this.backoff.attempts === 0) {
  59662. // keeps reconnection from firing twice for the same reconnection loop
  59663. this.reconnect();
  59664. }
  59665. };
  59666. /**
  59667. * Sets the current transport `socket`.
  59668. *
  59669. * @param {Function} optional, callback
  59670. * @return {Manager} self
  59671. * @api public
  59672. */
  59673. Manager.prototype.open =
  59674. Manager.prototype.connect = function (fn, opts) {
  59675. debug('readyState %s', this.readyState);
  59676. if (~this.readyState.indexOf('open')) return this;
  59677. debug('opening %s', this.uri);
  59678. this.engine = eio(this.uri, this.opts);
  59679. var socket = this.engine;
  59680. var self = this;
  59681. this.readyState = 'opening';
  59682. this.skipReconnect = false;
  59683. // emit `open`
  59684. var openSub = on(socket, 'open', function () {
  59685. self.onopen();
  59686. fn && fn();
  59687. });
  59688. // emit `connect_error`
  59689. var errorSub = on(socket, 'error', function (data) {
  59690. debug('connect_error');
  59691. self.cleanup();
  59692. self.readyState = 'closed';
  59693. self.emitAll('connect_error', data);
  59694. if (fn) {
  59695. var err = new Error('Connection error');
  59696. err.data = data;
  59697. fn(err);
  59698. } else {
  59699. // Only do this if there is no fn to handle the error
  59700. self.maybeReconnectOnOpen();
  59701. }
  59702. });
  59703. // emit `connect_timeout`
  59704. if (false !== this._timeout) {
  59705. var timeout = this._timeout;
  59706. debug('connect attempt will timeout after %d', timeout);
  59707. // set timer
  59708. var timer = setTimeout(function () {
  59709. debug('connect attempt timed out after %d', timeout);
  59710. openSub.destroy();
  59711. socket.close();
  59712. socket.emit('error', 'timeout');
  59713. self.emitAll('connect_timeout', timeout);
  59714. }, timeout);
  59715. this.subs.push({
  59716. destroy: function () {
  59717. clearTimeout(timer);
  59718. }
  59719. });
  59720. }
  59721. this.subs.push(openSub);
  59722. this.subs.push(errorSub);
  59723. return this;
  59724. };
  59725. /**
  59726. * Called upon transport open.
  59727. *
  59728. * @api private
  59729. */
  59730. Manager.prototype.onopen = function () {
  59731. debug('open');
  59732. // clear old subs
  59733. this.cleanup();
  59734. // mark as open
  59735. this.readyState = 'open';
  59736. this.emit('open');
  59737. // add new subs
  59738. var socket = this.engine;
  59739. this.subs.push(on(socket, 'data', bind(this, 'ondata')));
  59740. this.subs.push(on(socket, 'ping', bind(this, 'onping')));
  59741. this.subs.push(on(socket, 'pong', bind(this, 'onpong')));
  59742. this.subs.push(on(socket, 'error', bind(this, 'onerror')));
  59743. this.subs.push(on(socket, 'close', bind(this, 'onclose')));
  59744. this.subs.push(on(this.decoder, 'decoded', bind(this, 'ondecoded')));
  59745. };
  59746. /**
  59747. * Called upon a ping.
  59748. *
  59749. * @api private
  59750. */
  59751. Manager.prototype.onping = function () {
  59752. this.lastPing = new Date();
  59753. this.emitAll('ping');
  59754. };
  59755. /**
  59756. * Called upon a packet.
  59757. *
  59758. * @api private
  59759. */
  59760. Manager.prototype.onpong = function () {
  59761. this.emitAll('pong', new Date() - this.lastPing);
  59762. };
  59763. /**
  59764. * Called with data.
  59765. *
  59766. * @api private
  59767. */
  59768. Manager.prototype.ondata = function (data) {
  59769. this.decoder.add(data);
  59770. };
  59771. /**
  59772. * Called when parser fully decodes a packet.
  59773. *
  59774. * @api private
  59775. */
  59776. Manager.prototype.ondecoded = function (packet) {
  59777. this.emit('packet', packet);
  59778. };
  59779. /**
  59780. * Called upon socket error.
  59781. *
  59782. * @api private
  59783. */
  59784. Manager.prototype.onerror = function (err) {
  59785. debug('error', err);
  59786. this.emitAll('error', err);
  59787. };
  59788. /**
  59789. * Creates a new socket for the given `nsp`.
  59790. *
  59791. * @return {Socket}
  59792. * @api public
  59793. */
  59794. Manager.prototype.socket = function (nsp, opts) {
  59795. var socket = this.nsps[nsp];
  59796. if (!socket) {
  59797. socket = new Socket(this, nsp, opts);
  59798. this.nsps[nsp] = socket;
  59799. var self = this;
  59800. socket.on('connecting', onConnecting);
  59801. socket.on('connect', function () {
  59802. socket.id = self.generateId(nsp);
  59803. });
  59804. if (this.autoConnect) {
  59805. // manually call here since connecting event is fired before listening
  59806. onConnecting();
  59807. }
  59808. }
  59809. function onConnecting () {
  59810. if (!~indexOf(self.connecting, socket)) {
  59811. self.connecting.push(socket);
  59812. }
  59813. }
  59814. return socket;
  59815. };
  59816. /**
  59817. * Called upon a socket close.
  59818. *
  59819. * @param {Socket} socket
  59820. */
  59821. Manager.prototype.destroy = function (socket) {
  59822. var index = indexOf(this.connecting, socket);
  59823. if (~index) this.connecting.splice(index, 1);
  59824. if (this.connecting.length) return;
  59825. this.close();
  59826. };
  59827. /**
  59828. * Writes a packet.
  59829. *
  59830. * @param {Object} packet
  59831. * @api private
  59832. */
  59833. Manager.prototype.packet = function (packet) {
  59834. debug('writing packet %j', packet);
  59835. var self = this;
  59836. if (packet.query && packet.type === 0) packet.nsp += '?' + packet.query;
  59837. if (!self.encoding) {
  59838. // encode, then write to engine with result
  59839. self.encoding = true;
  59840. this.encoder.encode(packet, function (encodedPackets) {
  59841. for (var i = 0; i < encodedPackets.length; i++) {
  59842. self.engine.write(encodedPackets[i], packet.options);
  59843. }
  59844. self.encoding = false;
  59845. self.processPacketQueue();
  59846. });
  59847. } else { // add packet to the queue
  59848. self.packetBuffer.push(packet);
  59849. }
  59850. };
  59851. /**
  59852. * If packet buffer is non-empty, begins encoding the
  59853. * next packet in line.
  59854. *
  59855. * @api private
  59856. */
  59857. Manager.prototype.processPacketQueue = function () {
  59858. if (this.packetBuffer.length > 0 && !this.encoding) {
  59859. var pack = this.packetBuffer.shift();
  59860. this.packet(pack);
  59861. }
  59862. };
  59863. /**
  59864. * Clean up transport subscriptions and packet buffer.
  59865. *
  59866. * @api private
  59867. */
  59868. Manager.prototype.cleanup = function () {
  59869. debug('cleanup');
  59870. var subsLength = this.subs.length;
  59871. for (var i = 0; i < subsLength; i++) {
  59872. var sub = this.subs.shift();
  59873. sub.destroy();
  59874. }
  59875. this.packetBuffer = [];
  59876. this.encoding = false;
  59877. this.lastPing = null;
  59878. this.decoder.destroy();
  59879. };
  59880. /**
  59881. * Close the current socket.
  59882. *
  59883. * @api private
  59884. */
  59885. Manager.prototype.close =
  59886. Manager.prototype.disconnect = function () {
  59887. debug('disconnect');
  59888. this.skipReconnect = true;
  59889. this.reconnecting = false;
  59890. if ('opening' === this.readyState) {
  59891. // `onclose` will not fire because
  59892. // an open event never happened
  59893. this.cleanup();
  59894. }
  59895. this.backoff.reset();
  59896. this.readyState = 'closed';
  59897. if (this.engine) this.engine.close();
  59898. };
  59899. /**
  59900. * Called upon engine close.
  59901. *
  59902. * @api private
  59903. */
  59904. Manager.prototype.onclose = function (reason) {
  59905. debug('onclose');
  59906. this.cleanup();
  59907. this.backoff.reset();
  59908. this.readyState = 'closed';
  59909. this.emit('close', reason);
  59910. if (this._reconnection && !this.skipReconnect) {
  59911. this.reconnect();
  59912. }
  59913. };
  59914. /**
  59915. * Attempt a reconnection.
  59916. *
  59917. * @api private
  59918. */
  59919. Manager.prototype.reconnect = function () {
  59920. if (this.reconnecting || this.skipReconnect) return this;
  59921. var self = this;
  59922. if (this.backoff.attempts >= this._reconnectionAttempts) {
  59923. debug('reconnect failed');
  59924. this.backoff.reset();
  59925. this.emitAll('reconnect_failed');
  59926. this.reconnecting = false;
  59927. } else {
  59928. var delay = this.backoff.duration();
  59929. debug('will wait %dms before reconnect attempt', delay);
  59930. this.reconnecting = true;
  59931. var timer = setTimeout(function () {
  59932. if (self.skipReconnect) return;
  59933. debug('attempting reconnect');
  59934. self.emitAll('reconnect_attempt', self.backoff.attempts);
  59935. self.emitAll('reconnecting', self.backoff.attempts);
  59936. // check again for the case socket closed in above events
  59937. if (self.skipReconnect) return;
  59938. self.open(function (err) {
  59939. if (err) {
  59940. debug('reconnect attempt error');
  59941. self.reconnecting = false;
  59942. self.reconnect();
  59943. self.emitAll('reconnect_error', err.data);
  59944. } else {
  59945. debug('reconnect success');
  59946. self.onreconnect();
  59947. }
  59948. });
  59949. }, delay);
  59950. this.subs.push({
  59951. destroy: function () {
  59952. clearTimeout(timer);
  59953. }
  59954. });
  59955. }
  59956. };
  59957. /**
  59958. * Called upon successful reconnect.
  59959. *
  59960. * @api private
  59961. */
  59962. Manager.prototype.onreconnect = function () {
  59963. var attempt = this.backoff.attempts;
  59964. this.reconnecting = false;
  59965. this.backoff.reset();
  59966. this.updateSocketIds();
  59967. this.emitAll('reconnect', attempt);
  59968. };
  59969. /***/ }),
  59970. /***/ "./node_modules/socket.io-client/lib/on.js":
  59971. /*!*************************************************!*\
  59972. !*** ./node_modules/socket.io-client/lib/on.js ***!
  59973. \*************************************************/
  59974. /*! no static exports found */
  59975. /***/ (function(module, exports) {
  59976. /**
  59977. * Module exports.
  59978. */
  59979. module.exports = on;
  59980. /**
  59981. * Helper for subscriptions.
  59982. *
  59983. * @param {Object|EventEmitter} obj with `Emitter` mixin or `EventEmitter`
  59984. * @param {String} event name
  59985. * @param {Function} callback
  59986. * @api public
  59987. */
  59988. function on (obj, ev, fn) {
  59989. obj.on(ev, fn);
  59990. return {
  59991. destroy: function () {
  59992. obj.removeListener(ev, fn);
  59993. }
  59994. };
  59995. }
  59996. /***/ }),
  59997. /***/ "./node_modules/socket.io-client/lib/socket.js":
  59998. /*!*****************************************************!*\
  59999. !*** ./node_modules/socket.io-client/lib/socket.js ***!
  60000. \*****************************************************/
  60001. /*! no static exports found */
  60002. /***/ (function(module, exports, __webpack_require__) {
  60003. /**
  60004. * Module dependencies.
  60005. */
  60006. var parser = __webpack_require__(/*! socket.io-parser */ "./node_modules/socket.io-parser/index.js");
  60007. var Emitter = __webpack_require__(/*! component-emitter */ "./node_modules/socket.io-client/node_modules/component-emitter/index.js");
  60008. var toArray = __webpack_require__(/*! to-array */ "./node_modules/to-array/index.js");
  60009. var on = __webpack_require__(/*! ./on */ "./node_modules/socket.io-client/lib/on.js");
  60010. var bind = __webpack_require__(/*! component-bind */ "./node_modules/component-bind/index.js");
  60011. var debug = __webpack_require__(/*! debug */ "./node_modules/socket.io-client/node_modules/debug/src/browser.js")('socket.io-client:socket');
  60012. var parseqs = __webpack_require__(/*! parseqs */ "./node_modules/parseqs/index.js");
  60013. var hasBin = __webpack_require__(/*! has-binary2 */ "./node_modules/has-binary2/index.js");
  60014. /**
  60015. * Module exports.
  60016. */
  60017. module.exports = exports = Socket;
  60018. /**
  60019. * Internal events (blacklisted).
  60020. * These events can't be emitted by the user.
  60021. *
  60022. * @api private
  60023. */
  60024. var events = {
  60025. connect: 1,
  60026. connect_error: 1,
  60027. connect_timeout: 1,
  60028. connecting: 1,
  60029. disconnect: 1,
  60030. error: 1,
  60031. reconnect: 1,
  60032. reconnect_attempt: 1,
  60033. reconnect_failed: 1,
  60034. reconnect_error: 1,
  60035. reconnecting: 1,
  60036. ping: 1,
  60037. pong: 1
  60038. };
  60039. /**
  60040. * Shortcut to `Emitter#emit`.
  60041. */
  60042. var emit = Emitter.prototype.emit;
  60043. /**
  60044. * `Socket` constructor.
  60045. *
  60046. * @api public
  60047. */
  60048. function Socket (io, nsp, opts) {
  60049. this.io = io;
  60050. this.nsp = nsp;
  60051. this.json = this; // compat
  60052. this.ids = 0;
  60053. this.acks = {};
  60054. this.receiveBuffer = [];
  60055. this.sendBuffer = [];
  60056. this.connected = false;
  60057. this.disconnected = true;
  60058. this.flags = {};
  60059. if (opts && opts.query) {
  60060. this.query = opts.query;
  60061. }
  60062. if (this.io.autoConnect) this.open();
  60063. }
  60064. /**
  60065. * Mix in `Emitter`.
  60066. */
  60067. Emitter(Socket.prototype);
  60068. /**
  60069. * Subscribe to open, close and packet events
  60070. *
  60071. * @api private
  60072. */
  60073. Socket.prototype.subEvents = function () {
  60074. if (this.subs) return;
  60075. var io = this.io;
  60076. this.subs = [
  60077. on(io, 'open', bind(this, 'onopen')),
  60078. on(io, 'packet', bind(this, 'onpacket')),
  60079. on(io, 'close', bind(this, 'onclose'))
  60080. ];
  60081. };
  60082. /**
  60083. * "Opens" the socket.
  60084. *
  60085. * @api public
  60086. */
  60087. Socket.prototype.open =
  60088. Socket.prototype.connect = function () {
  60089. if (this.connected) return this;
  60090. this.subEvents();
  60091. this.io.open(); // ensure open
  60092. if ('open' === this.io.readyState) this.onopen();
  60093. this.emit('connecting');
  60094. return this;
  60095. };
  60096. /**
  60097. * Sends a `message` event.
  60098. *
  60099. * @return {Socket} self
  60100. * @api public
  60101. */
  60102. Socket.prototype.send = function () {
  60103. var args = toArray(arguments);
  60104. args.unshift('message');
  60105. this.emit.apply(this, args);
  60106. return this;
  60107. };
  60108. /**
  60109. * Override `emit`.
  60110. * If the event is in `events`, it's emitted normally.
  60111. *
  60112. * @param {String} event name
  60113. * @return {Socket} self
  60114. * @api public
  60115. */
  60116. Socket.prototype.emit = function (ev) {
  60117. if (events.hasOwnProperty(ev)) {
  60118. emit.apply(this, arguments);
  60119. return this;
  60120. }
  60121. var args = toArray(arguments);
  60122. var packet = {
  60123. type: (this.flags.binary !== undefined ? this.flags.binary : hasBin(args)) ? parser.BINARY_EVENT : parser.EVENT,
  60124. data: args
  60125. };
  60126. packet.options = {};
  60127. packet.options.compress = !this.flags || false !== this.flags.compress;
  60128. // event ack callback
  60129. if ('function' === typeof args[args.length - 1]) {
  60130. debug('emitting packet with ack id %d', this.ids);
  60131. this.acks[this.ids] = args.pop();
  60132. packet.id = this.ids++;
  60133. }
  60134. if (this.connected) {
  60135. this.packet(packet);
  60136. } else {
  60137. this.sendBuffer.push(packet);
  60138. }
  60139. this.flags = {};
  60140. return this;
  60141. };
  60142. /**
  60143. * Sends a packet.
  60144. *
  60145. * @param {Object} packet
  60146. * @api private
  60147. */
  60148. Socket.prototype.packet = function (packet) {
  60149. packet.nsp = this.nsp;
  60150. this.io.packet(packet);
  60151. };
  60152. /**
  60153. * Called upon engine `open`.
  60154. *
  60155. * @api private
  60156. */
  60157. Socket.prototype.onopen = function () {
  60158. debug('transport is open - connecting');
  60159. // write connect packet if necessary
  60160. if ('/' !== this.nsp) {
  60161. if (this.query) {
  60162. var query = typeof this.query === 'object' ? parseqs.encode(this.query) : this.query;
  60163. debug('sending connect packet with query %s', query);
  60164. this.packet({type: parser.CONNECT, query: query});
  60165. } else {
  60166. this.packet({type: parser.CONNECT});
  60167. }
  60168. }
  60169. };
  60170. /**
  60171. * Called upon engine `close`.
  60172. *
  60173. * @param {String} reason
  60174. * @api private
  60175. */
  60176. Socket.prototype.onclose = function (reason) {
  60177. debug('close (%s)', reason);
  60178. this.connected = false;
  60179. this.disconnected = true;
  60180. delete this.id;
  60181. this.emit('disconnect', reason);
  60182. };
  60183. /**
  60184. * Called with socket packet.
  60185. *
  60186. * @param {Object} packet
  60187. * @api private
  60188. */
  60189. Socket.prototype.onpacket = function (packet) {
  60190. var sameNamespace = packet.nsp === this.nsp;
  60191. var rootNamespaceError = packet.type === parser.ERROR && packet.nsp === '/';
  60192. if (!sameNamespace && !rootNamespaceError) return;
  60193. switch (packet.type) {
  60194. case parser.CONNECT:
  60195. this.onconnect();
  60196. break;
  60197. case parser.EVENT:
  60198. this.onevent(packet);
  60199. break;
  60200. case parser.BINARY_EVENT:
  60201. this.onevent(packet);
  60202. break;
  60203. case parser.ACK:
  60204. this.onack(packet);
  60205. break;
  60206. case parser.BINARY_ACK:
  60207. this.onack(packet);
  60208. break;
  60209. case parser.DISCONNECT:
  60210. this.ondisconnect();
  60211. break;
  60212. case parser.ERROR:
  60213. this.emit('error', packet.data);
  60214. break;
  60215. }
  60216. };
  60217. /**
  60218. * Called upon a server event.
  60219. *
  60220. * @param {Object} packet
  60221. * @api private
  60222. */
  60223. Socket.prototype.onevent = function (packet) {
  60224. var args = packet.data || [];
  60225. debug('emitting event %j', args);
  60226. if (null != packet.id) {
  60227. debug('attaching ack callback to event');
  60228. args.push(this.ack(packet.id));
  60229. }
  60230. if (this.connected) {
  60231. emit.apply(this, args);
  60232. } else {
  60233. this.receiveBuffer.push(args);
  60234. }
  60235. };
  60236. /**
  60237. * Produces an ack callback to emit with an event.
  60238. *
  60239. * @api private
  60240. */
  60241. Socket.prototype.ack = function (id) {
  60242. var self = this;
  60243. var sent = false;
  60244. return function () {
  60245. // prevent double callbacks
  60246. if (sent) return;
  60247. sent = true;
  60248. var args = toArray(arguments);
  60249. debug('sending ack %j', args);
  60250. self.packet({
  60251. type: hasBin(args) ? parser.BINARY_ACK : parser.ACK,
  60252. id: id,
  60253. data: args
  60254. });
  60255. };
  60256. };
  60257. /**
  60258. * Called upon a server acknowlegement.
  60259. *
  60260. * @param {Object} packet
  60261. * @api private
  60262. */
  60263. Socket.prototype.onack = function (packet) {
  60264. var ack = this.acks[packet.id];
  60265. if ('function' === typeof ack) {
  60266. debug('calling ack %s with %j', packet.id, packet.data);
  60267. ack.apply(this, packet.data);
  60268. delete this.acks[packet.id];
  60269. } else {
  60270. debug('bad ack %s', packet.id);
  60271. }
  60272. };
  60273. /**
  60274. * Called upon server connect.
  60275. *
  60276. * @api private
  60277. */
  60278. Socket.prototype.onconnect = function () {
  60279. this.connected = true;
  60280. this.disconnected = false;
  60281. this.emit('connect');
  60282. this.emitBuffered();
  60283. };
  60284. /**
  60285. * Emit buffered events (received and emitted).
  60286. *
  60287. * @api private
  60288. */
  60289. Socket.prototype.emitBuffered = function () {
  60290. var i;
  60291. for (i = 0; i < this.receiveBuffer.length; i++) {
  60292. emit.apply(this, this.receiveBuffer[i]);
  60293. }
  60294. this.receiveBuffer = [];
  60295. for (i = 0; i < this.sendBuffer.length; i++) {
  60296. this.packet(this.sendBuffer[i]);
  60297. }
  60298. this.sendBuffer = [];
  60299. };
  60300. /**
  60301. * Called upon server disconnect.
  60302. *
  60303. * @api private
  60304. */
  60305. Socket.prototype.ondisconnect = function () {
  60306. debug('server disconnect (%s)', this.nsp);
  60307. this.destroy();
  60308. this.onclose('io server disconnect');
  60309. };
  60310. /**
  60311. * Called upon forced client/server side disconnections,
  60312. * this method ensures the manager stops tracking us and
  60313. * that reconnections don't get triggered for this.
  60314. *
  60315. * @api private.
  60316. */
  60317. Socket.prototype.destroy = function () {
  60318. if (this.subs) {
  60319. // clean subscriptions to avoid reconnections
  60320. for (var i = 0; i < this.subs.length; i++) {
  60321. this.subs[i].destroy();
  60322. }
  60323. this.subs = null;
  60324. }
  60325. this.io.destroy(this);
  60326. };
  60327. /**
  60328. * Disconnects the socket manually.
  60329. *
  60330. * @return {Socket} self
  60331. * @api public
  60332. */
  60333. Socket.prototype.close =
  60334. Socket.prototype.disconnect = function () {
  60335. if (this.connected) {
  60336. debug('performing disconnect (%s)', this.nsp);
  60337. this.packet({ type: parser.DISCONNECT });
  60338. }
  60339. // remove socket from pool
  60340. this.destroy();
  60341. if (this.connected) {
  60342. // fire events
  60343. this.onclose('io client disconnect');
  60344. }
  60345. return this;
  60346. };
  60347. /**
  60348. * Sets the compress flag.
  60349. *
  60350. * @param {Boolean} if `true`, compresses the sending data
  60351. * @return {Socket} self
  60352. * @api public
  60353. */
  60354. Socket.prototype.compress = function (compress) {
  60355. this.flags.compress = compress;
  60356. return this;
  60357. };
  60358. /**
  60359. * Sets the binary flag
  60360. *
  60361. * @param {Boolean} whether the emitted data contains binary
  60362. * @return {Socket} self
  60363. * @api public
  60364. */
  60365. Socket.prototype.binary = function (binary) {
  60366. this.flags.binary = binary;
  60367. return this;
  60368. };
  60369. /***/ }),
  60370. /***/ "./node_modules/socket.io-client/lib/url.js":
  60371. /*!**************************************************!*\
  60372. !*** ./node_modules/socket.io-client/lib/url.js ***!
  60373. \**************************************************/
  60374. /*! no static exports found */
  60375. /***/ (function(module, exports, __webpack_require__) {
  60376. /**
  60377. * Module dependencies.
  60378. */
  60379. var parseuri = __webpack_require__(/*! parseuri */ "./node_modules/parseuri/index.js");
  60380. var debug = __webpack_require__(/*! debug */ "./node_modules/socket.io-client/node_modules/debug/src/browser.js")('socket.io-client:url');
  60381. /**
  60382. * Module exports.
  60383. */
  60384. module.exports = url;
  60385. /**
  60386. * URL parser.
  60387. *
  60388. * @param {String} url
  60389. * @param {Object} An object meant to mimic window.location.
  60390. * Defaults to window.location.
  60391. * @api public
  60392. */
  60393. function url (uri, loc) {
  60394. var obj = uri;
  60395. // default to window.location
  60396. loc = loc || (typeof location !== 'undefined' && location);
  60397. if (null == uri) uri = loc.protocol + '//' + loc.host;
  60398. // relative path support
  60399. if ('string' === typeof uri) {
  60400. if ('/' === uri.charAt(0)) {
  60401. if ('/' === uri.charAt(1)) {
  60402. uri = loc.protocol + uri;
  60403. } else {
  60404. uri = loc.host + uri;
  60405. }
  60406. }
  60407. if (!/^(https?|wss?):\/\//.test(uri)) {
  60408. debug('protocol-less url %s', uri);
  60409. if ('undefined' !== typeof loc) {
  60410. uri = loc.protocol + '//' + uri;
  60411. } else {
  60412. uri = 'https://' + uri;
  60413. }
  60414. }
  60415. // parse
  60416. debug('parse %s', uri);
  60417. obj = parseuri(uri);
  60418. }
  60419. // make sure we treat `localhost:80` and `localhost` equally
  60420. if (!obj.port) {
  60421. if (/^(http|ws)$/.test(obj.protocol)) {
  60422. obj.port = '80';
  60423. } else if (/^(http|ws)s$/.test(obj.protocol)) {
  60424. obj.port = '443';
  60425. }
  60426. }
  60427. obj.path = obj.path || '/';
  60428. var ipv6 = obj.host.indexOf(':') !== -1;
  60429. var host = ipv6 ? '[' + obj.host + ']' : obj.host;
  60430. // define unique id
  60431. obj.id = obj.protocol + '://' + host + ':' + obj.port;
  60432. // define href
  60433. obj.href = obj.protocol + '://' + host + (loc && loc.port === obj.port ? '' : (':' + obj.port));
  60434. return obj;
  60435. }
  60436. /***/ }),
  60437. /***/ "./node_modules/socket.io-client/node_modules/component-emitter/index.js":
  60438. /*!*******************************************************************************!*\
  60439. !*** ./node_modules/socket.io-client/node_modules/component-emitter/index.js ***!
  60440. \*******************************************************************************/
  60441. /*! no static exports found */
  60442. /***/ (function(module, exports, __webpack_require__) {
  60443. /**
  60444. * Expose `Emitter`.
  60445. */
  60446. if (true) {
  60447. module.exports = Emitter;
  60448. }
  60449. /**
  60450. * Initialize a new `Emitter`.
  60451. *
  60452. * @api public
  60453. */
  60454. function Emitter(obj) {
  60455. if (obj) return mixin(obj);
  60456. };
  60457. /**
  60458. * Mixin the emitter properties.
  60459. *
  60460. * @param {Object} obj
  60461. * @return {Object}
  60462. * @api private
  60463. */
  60464. function mixin(obj) {
  60465. for (var key in Emitter.prototype) {
  60466. obj[key] = Emitter.prototype[key];
  60467. }
  60468. return obj;
  60469. }
  60470. /**
  60471. * Listen on the given `event` with `fn`.
  60472. *
  60473. * @param {String} event
  60474. * @param {Function} fn
  60475. * @return {Emitter}
  60476. * @api public
  60477. */
  60478. Emitter.prototype.on =
  60479. Emitter.prototype.addEventListener = function(event, fn){
  60480. this._callbacks = this._callbacks || {};
  60481. (this._callbacks['$' + event] = this._callbacks['$' + event] || [])
  60482. .push(fn);
  60483. return this;
  60484. };
  60485. /**
  60486. * Adds an `event` listener that will be invoked a single
  60487. * time then automatically removed.
  60488. *
  60489. * @param {String} event
  60490. * @param {Function} fn
  60491. * @return {Emitter}
  60492. * @api public
  60493. */
  60494. Emitter.prototype.once = function(event, fn){
  60495. function on() {
  60496. this.off(event, on);
  60497. fn.apply(this, arguments);
  60498. }
  60499. on.fn = fn;
  60500. this.on(event, on);
  60501. return this;
  60502. };
  60503. /**
  60504. * Remove the given callback for `event` or all
  60505. * registered callbacks.
  60506. *
  60507. * @param {String} event
  60508. * @param {Function} fn
  60509. * @return {Emitter}
  60510. * @api public
  60511. */
  60512. Emitter.prototype.off =
  60513. Emitter.prototype.removeListener =
  60514. Emitter.prototype.removeAllListeners =
  60515. Emitter.prototype.removeEventListener = function(event, fn){
  60516. this._callbacks = this._callbacks || {};
  60517. // all
  60518. if (0 == arguments.length) {
  60519. this._callbacks = {};
  60520. return this;
  60521. }
  60522. // specific event
  60523. var callbacks = this._callbacks['$' + event];
  60524. if (!callbacks) return this;
  60525. // remove all handlers
  60526. if (1 == arguments.length) {
  60527. delete this._callbacks['$' + event];
  60528. return this;
  60529. }
  60530. // remove specific handler
  60531. var cb;
  60532. for (var i = 0; i < callbacks.length; i++) {
  60533. cb = callbacks[i];
  60534. if (cb === fn || cb.fn === fn) {
  60535. callbacks.splice(i, 1);
  60536. break;
  60537. }
  60538. }
  60539. return this;
  60540. };
  60541. /**
  60542. * Emit `event` with the given args.
  60543. *
  60544. * @param {String} event
  60545. * @param {Mixed} ...
  60546. * @return {Emitter}
  60547. */
  60548. Emitter.prototype.emit = function(event){
  60549. this._callbacks = this._callbacks || {};
  60550. var args = [].slice.call(arguments, 1)
  60551. , callbacks = this._callbacks['$' + event];
  60552. if (callbacks) {
  60553. callbacks = callbacks.slice(0);
  60554. for (var i = 0, len = callbacks.length; i < len; ++i) {
  60555. callbacks[i].apply(this, args);
  60556. }
  60557. }
  60558. return this;
  60559. };
  60560. /**
  60561. * Return array of callbacks for `event`.
  60562. *
  60563. * @param {String} event
  60564. * @return {Array}
  60565. * @api public
  60566. */
  60567. Emitter.prototype.listeners = function(event){
  60568. this._callbacks = this._callbacks || {};
  60569. return this._callbacks['$' + event] || [];
  60570. };
  60571. /**
  60572. * Check if this emitter has `event` handlers.
  60573. *
  60574. * @param {String} event
  60575. * @return {Boolean}
  60576. * @api public
  60577. */
  60578. Emitter.prototype.hasListeners = function(event){
  60579. return !! this.listeners(event).length;
  60580. };
  60581. /***/ }),
  60582. /***/ "./node_modules/socket.io-client/node_modules/debug/src/browser.js":
  60583. /*!*************************************************************************!*\
  60584. !*** ./node_modules/socket.io-client/node_modules/debug/src/browser.js ***!
  60585. \*************************************************************************/
  60586. /*! no static exports found */
  60587. /***/ (function(module, exports, __webpack_require__) {
  60588. /* WEBPACK VAR INJECTION */(function(process) {/* eslint-env browser */
  60589. /**
  60590. * This is the web browser implementation of `debug()`.
  60591. */
  60592. exports.log = log;
  60593. exports.formatArgs = formatArgs;
  60594. exports.save = save;
  60595. exports.load = load;
  60596. exports.useColors = useColors;
  60597. exports.storage = localstorage();
  60598. /**
  60599. * Colors.
  60600. */
  60601. exports.colors = [
  60602. '#0000CC',
  60603. '#0000FF',
  60604. '#0033CC',
  60605. '#0033FF',
  60606. '#0066CC',
  60607. '#0066FF',
  60608. '#0099CC',
  60609. '#0099FF',
  60610. '#00CC00',
  60611. '#00CC33',
  60612. '#00CC66',
  60613. '#00CC99',
  60614. '#00CCCC',
  60615. '#00CCFF',
  60616. '#3300CC',
  60617. '#3300FF',
  60618. '#3333CC',
  60619. '#3333FF',
  60620. '#3366CC',
  60621. '#3366FF',
  60622. '#3399CC',
  60623. '#3399FF',
  60624. '#33CC00',
  60625. '#33CC33',
  60626. '#33CC66',
  60627. '#33CC99',
  60628. '#33CCCC',
  60629. '#33CCFF',
  60630. '#6600CC',
  60631. '#6600FF',
  60632. '#6633CC',
  60633. '#6633FF',
  60634. '#66CC00',
  60635. '#66CC33',
  60636. '#9900CC',
  60637. '#9900FF',
  60638. '#9933CC',
  60639. '#9933FF',
  60640. '#99CC00',
  60641. '#99CC33',
  60642. '#CC0000',
  60643. '#CC0033',
  60644. '#CC0066',
  60645. '#CC0099',
  60646. '#CC00CC',
  60647. '#CC00FF',
  60648. '#CC3300',
  60649. '#CC3333',
  60650. '#CC3366',
  60651. '#CC3399',
  60652. '#CC33CC',
  60653. '#CC33FF',
  60654. '#CC6600',
  60655. '#CC6633',
  60656. '#CC9900',
  60657. '#CC9933',
  60658. '#CCCC00',
  60659. '#CCCC33',
  60660. '#FF0000',
  60661. '#FF0033',
  60662. '#FF0066',
  60663. '#FF0099',
  60664. '#FF00CC',
  60665. '#FF00FF',
  60666. '#FF3300',
  60667. '#FF3333',
  60668. '#FF3366',
  60669. '#FF3399',
  60670. '#FF33CC',
  60671. '#FF33FF',
  60672. '#FF6600',
  60673. '#FF6633',
  60674. '#FF9900',
  60675. '#FF9933',
  60676. '#FFCC00',
  60677. '#FFCC33'
  60678. ];
  60679. /**
  60680. * Currently only WebKit-based Web Inspectors, Firefox >= v31,
  60681. * and the Firebug extension (any Firefox version) are known
  60682. * to support "%c" CSS customizations.
  60683. *
  60684. * TODO: add a `localStorage` variable to explicitly enable/disable colors
  60685. */
  60686. // eslint-disable-next-line complexity
  60687. function useColors() {
  60688. // NB: In an Electron preload script, document will be defined but not fully
  60689. // initialized. Since we know we're in Chrome, we'll just detect this case
  60690. // explicitly
  60691. if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
  60692. return true;
  60693. }
  60694. // Internet Explorer and Edge do not support colors.
  60695. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
  60696. return false;
  60697. }
  60698. // Is webkit? http://stackoverflow.com/a/16459606/376773
  60699. // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
  60700. return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
  60701. // Is firebug? http://stackoverflow.com/a/398120/376773
  60702. (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
  60703. // Is firefox >= v31?
  60704. // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
  60705. (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
  60706. // Double check webkit in userAgent just in case we are in a worker
  60707. (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
  60708. }
  60709. /**
  60710. * Colorize log arguments if enabled.
  60711. *
  60712. * @api public
  60713. */
  60714. function formatArgs(args) {
  60715. args[0] = (this.useColors ? '%c' : '') +
  60716. this.namespace +
  60717. (this.useColors ? ' %c' : ' ') +
  60718. args[0] +
  60719. (this.useColors ? '%c ' : ' ') +
  60720. '+' + module.exports.humanize(this.diff);
  60721. if (!this.useColors) {
  60722. return;
  60723. }
  60724. const c = 'color: ' + this.color;
  60725. args.splice(1, 0, c, 'color: inherit');
  60726. // The final "%c" is somewhat tricky, because there could be other
  60727. // arguments passed either before or after the %c, so we need to
  60728. // figure out the correct index to insert the CSS into
  60729. let index = 0;
  60730. let lastC = 0;
  60731. args[0].replace(/%[a-zA-Z%]/g, match => {
  60732. if (match === '%%') {
  60733. return;
  60734. }
  60735. index++;
  60736. if (match === '%c') {
  60737. // We only are interested in the *last* %c
  60738. // (the user may have provided their own)
  60739. lastC = index;
  60740. }
  60741. });
  60742. args.splice(lastC, 0, c);
  60743. }
  60744. /**
  60745. * Invokes `console.log()` when available.
  60746. * No-op when `console.log` is not a "function".
  60747. *
  60748. * @api public
  60749. */
  60750. function log(...args) {
  60751. // This hackery is required for IE8/9, where
  60752. // the `console.log` function doesn't have 'apply'
  60753. return typeof console === 'object' &&
  60754. console.log &&
  60755. console.log(...args);
  60756. }
  60757. /**
  60758. * Save `namespaces`.
  60759. *
  60760. * @param {String} namespaces
  60761. * @api private
  60762. */
  60763. function save(namespaces) {
  60764. try {
  60765. if (namespaces) {
  60766. exports.storage.setItem('debug', namespaces);
  60767. } else {
  60768. exports.storage.removeItem('debug');
  60769. }
  60770. } catch (error) {
  60771. // Swallow
  60772. // XXX (@Qix-) should we be logging these?
  60773. }
  60774. }
  60775. /**
  60776. * Load `namespaces`.
  60777. *
  60778. * @return {String} returns the previously persisted debug modes
  60779. * @api private
  60780. */
  60781. function load() {
  60782. let r;
  60783. try {
  60784. r = exports.storage.getItem('debug');
  60785. } catch (error) {
  60786. // Swallow
  60787. // XXX (@Qix-) should we be logging these?
  60788. }
  60789. // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
  60790. if (!r && typeof process !== 'undefined' && 'env' in process) {
  60791. r = process.env.DEBUG;
  60792. }
  60793. return r;
  60794. }
  60795. /**
  60796. * Localstorage attempts to return the localstorage.
  60797. *
  60798. * This is necessary because safari throws
  60799. * when a user disables cookies/localstorage
  60800. * and you attempt to access it.
  60801. *
  60802. * @return {LocalStorage}
  60803. * @api private
  60804. */
  60805. function localstorage() {
  60806. try {
  60807. // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
  60808. // The Browser also has localStorage in the global context.
  60809. return localStorage;
  60810. } catch (error) {
  60811. // Swallow
  60812. // XXX (@Qix-) should we be logging these?
  60813. }
  60814. }
  60815. module.exports = __webpack_require__(/*! ./common */ "./node_modules/socket.io-client/node_modules/debug/src/common.js")(exports);
  60816. const {formatters} = module.exports;
  60817. /**
  60818. * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
  60819. */
  60820. formatters.j = function (v) {
  60821. try {
  60822. return JSON.stringify(v);
  60823. } catch (error) {
  60824. return '[UnexpectedJSONParseError]: ' + error.message;
  60825. }
  60826. };
  60827. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ "./node_modules/process/browser.js")))
  60828. /***/ }),
  60829. /***/ "./node_modules/socket.io-client/node_modules/debug/src/common.js":
  60830. /*!************************************************************************!*\
  60831. !*** ./node_modules/socket.io-client/node_modules/debug/src/common.js ***!
  60832. \************************************************************************/
  60833. /*! no static exports found */
  60834. /***/ (function(module, exports, __webpack_require__) {
  60835. /**
  60836. * This is the common logic for both the Node.js and web browser
  60837. * implementations of `debug()`.
  60838. */
  60839. function setup(env) {
  60840. createDebug.debug = createDebug;
  60841. createDebug.default = createDebug;
  60842. createDebug.coerce = coerce;
  60843. createDebug.disable = disable;
  60844. createDebug.enable = enable;
  60845. createDebug.enabled = enabled;
  60846. createDebug.humanize = __webpack_require__(/*! ms */ "./node_modules/socket.io-client/node_modules/ms/index.js");
  60847. Object.keys(env).forEach(key => {
  60848. createDebug[key] = env[key];
  60849. });
  60850. /**
  60851. * Active `debug` instances.
  60852. */
  60853. createDebug.instances = [];
  60854. /**
  60855. * The currently active debug mode names, and names to skip.
  60856. */
  60857. createDebug.names = [];
  60858. createDebug.skips = [];
  60859. /**
  60860. * Map of special "%n" handling functions, for the debug "format" argument.
  60861. *
  60862. * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
  60863. */
  60864. createDebug.formatters = {};
  60865. /**
  60866. * Selects a color for a debug namespace
  60867. * @param {String} namespace The namespace string for the for the debug instance to be colored
  60868. * @return {Number|String} An ANSI color code for the given namespace
  60869. * @api private
  60870. */
  60871. function selectColor(namespace) {
  60872. let hash = 0;
  60873. for (let i = 0; i < namespace.length; i++) {
  60874. hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
  60875. hash |= 0; // Convert to 32bit integer
  60876. }
  60877. return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
  60878. }
  60879. createDebug.selectColor = selectColor;
  60880. /**
  60881. * Create a debugger with the given `namespace`.
  60882. *
  60883. * @param {String} namespace
  60884. * @return {Function}
  60885. * @api public
  60886. */
  60887. function createDebug(namespace) {
  60888. let prevTime;
  60889. function debug(...args) {
  60890. // Disabled?
  60891. if (!debug.enabled) {
  60892. return;
  60893. }
  60894. const self = debug;
  60895. // Set `diff` timestamp
  60896. const curr = Number(new Date());
  60897. const ms = curr - (prevTime || curr);
  60898. self.diff = ms;
  60899. self.prev = prevTime;
  60900. self.curr = curr;
  60901. prevTime = curr;
  60902. args[0] = createDebug.coerce(args[0]);
  60903. if (typeof args[0] !== 'string') {
  60904. // Anything else let's inspect with %O
  60905. args.unshift('%O');
  60906. }
  60907. // Apply any `formatters` transformations
  60908. let index = 0;
  60909. args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
  60910. // If we encounter an escaped % then don't increase the array index
  60911. if (match === '%%') {
  60912. return match;
  60913. }
  60914. index++;
  60915. const formatter = createDebug.formatters[format];
  60916. if (typeof formatter === 'function') {
  60917. const val = args[index];
  60918. match = formatter.call(self, val);
  60919. // Now we need to remove `args[index]` since it's inlined in the `format`
  60920. args.splice(index, 1);
  60921. index--;
  60922. }
  60923. return match;
  60924. });
  60925. // Apply env-specific formatting (colors, etc.)
  60926. createDebug.formatArgs.call(self, args);
  60927. const logFn = self.log || createDebug.log;
  60928. logFn.apply(self, args);
  60929. }
  60930. debug.namespace = namespace;
  60931. debug.enabled = createDebug.enabled(namespace);
  60932. debug.useColors = createDebug.useColors();
  60933. debug.color = selectColor(namespace);
  60934. debug.destroy = destroy;
  60935. debug.extend = extend;
  60936. // Debug.formatArgs = formatArgs;
  60937. // debug.rawLog = rawLog;
  60938. // env-specific initialization logic for debug instances
  60939. if (typeof createDebug.init === 'function') {
  60940. createDebug.init(debug);
  60941. }
  60942. createDebug.instances.push(debug);
  60943. return debug;
  60944. }
  60945. function destroy() {
  60946. const index = createDebug.instances.indexOf(this);
  60947. if (index !== -1) {
  60948. createDebug.instances.splice(index, 1);
  60949. return true;
  60950. }
  60951. return false;
  60952. }
  60953. function extend(namespace, delimiter) {
  60954. const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
  60955. newDebug.log = this.log;
  60956. return newDebug;
  60957. }
  60958. /**
  60959. * Enables a debug mode by namespaces. This can include modes
  60960. * separated by a colon and wildcards.
  60961. *
  60962. * @param {String} namespaces
  60963. * @api public
  60964. */
  60965. function enable(namespaces) {
  60966. createDebug.save(namespaces);
  60967. createDebug.names = [];
  60968. createDebug.skips = [];
  60969. let i;
  60970. const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
  60971. const len = split.length;
  60972. for (i = 0; i < len; i++) {
  60973. if (!split[i]) {
  60974. // ignore empty strings
  60975. continue;
  60976. }
  60977. namespaces = split[i].replace(/\*/g, '.*?');
  60978. if (namespaces[0] === '-') {
  60979. createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
  60980. } else {
  60981. createDebug.names.push(new RegExp('^' + namespaces + '$'));
  60982. }
  60983. }
  60984. for (i = 0; i < createDebug.instances.length; i++) {
  60985. const instance = createDebug.instances[i];
  60986. instance.enabled = createDebug.enabled(instance.namespace);
  60987. }
  60988. }
  60989. /**
  60990. * Disable debug output.
  60991. *
  60992. * @return {String} namespaces
  60993. * @api public
  60994. */
  60995. function disable() {
  60996. const namespaces = [
  60997. ...createDebug.names.map(toNamespace),
  60998. ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
  60999. ].join(',');
  61000. createDebug.enable('');
  61001. return namespaces;
  61002. }
  61003. /**
  61004. * Returns true if the given mode name is enabled, false otherwise.
  61005. *
  61006. * @param {String} name
  61007. * @return {Boolean}
  61008. * @api public
  61009. */
  61010. function enabled(name) {
  61011. if (name[name.length - 1] === '*') {
  61012. return true;
  61013. }
  61014. let i;
  61015. let len;
  61016. for (i = 0, len = createDebug.skips.length; i < len; i++) {
  61017. if (createDebug.skips[i].test(name)) {
  61018. return false;
  61019. }
  61020. }
  61021. for (i = 0, len = createDebug.names.length; i < len; i++) {
  61022. if (createDebug.names[i].test(name)) {
  61023. return true;
  61024. }
  61025. }
  61026. return false;
  61027. }
  61028. /**
  61029. * Convert regexp to namespace
  61030. *
  61031. * @param {RegExp} regxep
  61032. * @return {String} namespace
  61033. * @api private
  61034. */
  61035. function toNamespace(regexp) {
  61036. return regexp.toString()
  61037. .substring(2, regexp.toString().length - 2)
  61038. .replace(/\.\*\?$/, '*');
  61039. }
  61040. /**
  61041. * Coerce `val`.
  61042. *
  61043. * @param {Mixed} val
  61044. * @return {Mixed}
  61045. * @api private
  61046. */
  61047. function coerce(val) {
  61048. if (val instanceof Error) {
  61049. return val.stack || val.message;
  61050. }
  61051. return val;
  61052. }
  61053. createDebug.enable(createDebug.load());
  61054. return createDebug;
  61055. }
  61056. module.exports = setup;
  61057. /***/ }),
  61058. /***/ "./node_modules/socket.io-client/node_modules/ms/index.js":
  61059. /*!****************************************************************!*\
  61060. !*** ./node_modules/socket.io-client/node_modules/ms/index.js ***!
  61061. \****************************************************************/
  61062. /*! no static exports found */
  61063. /***/ (function(module, exports) {
  61064. /**
  61065. * Helpers.
  61066. */
  61067. var s = 1000;
  61068. var m = s * 60;
  61069. var h = m * 60;
  61070. var d = h * 24;
  61071. var w = d * 7;
  61072. var y = d * 365.25;
  61073. /**
  61074. * Parse or format the given `val`.
  61075. *
  61076. * Options:
  61077. *
  61078. * - `long` verbose formatting [false]
  61079. *
  61080. * @param {String|Number} val
  61081. * @param {Object} [options]
  61082. * @throws {Error} throw an error if val is not a non-empty string or a number
  61083. * @return {String|Number}
  61084. * @api public
  61085. */
  61086. module.exports = function(val, options) {
  61087. options = options || {};
  61088. var type = typeof val;
  61089. if (type === 'string' && val.length > 0) {
  61090. return parse(val);
  61091. } else if (type === 'number' && isFinite(val)) {
  61092. return options.long ? fmtLong(val) : fmtShort(val);
  61093. }
  61094. throw new Error(
  61095. 'val is not a non-empty string or a valid number. val=' +
  61096. JSON.stringify(val)
  61097. );
  61098. };
  61099. /**
  61100. * Parse the given `str` and return milliseconds.
  61101. *
  61102. * @param {String} str
  61103. * @return {Number}
  61104. * @api private
  61105. */
  61106. function parse(str) {
  61107. str = String(str);
  61108. if (str.length > 100) {
  61109. return;
  61110. }
  61111. var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
  61112. str
  61113. );
  61114. if (!match) {
  61115. return;
  61116. }
  61117. var n = parseFloat(match[1]);
  61118. var type = (match[2] || 'ms').toLowerCase();
  61119. switch (type) {
  61120. case 'years':
  61121. case 'year':
  61122. case 'yrs':
  61123. case 'yr':
  61124. case 'y':
  61125. return n * y;
  61126. case 'weeks':
  61127. case 'week':
  61128. case 'w':
  61129. return n * w;
  61130. case 'days':
  61131. case 'day':
  61132. case 'd':
  61133. return n * d;
  61134. case 'hours':
  61135. case 'hour':
  61136. case 'hrs':
  61137. case 'hr':
  61138. case 'h':
  61139. return n * h;
  61140. case 'minutes':
  61141. case 'minute':
  61142. case 'mins':
  61143. case 'min':
  61144. case 'm':
  61145. return n * m;
  61146. case 'seconds':
  61147. case 'second':
  61148. case 'secs':
  61149. case 'sec':
  61150. case 's':
  61151. return n * s;
  61152. case 'milliseconds':
  61153. case 'millisecond':
  61154. case 'msecs':
  61155. case 'msec':
  61156. case 'ms':
  61157. return n;
  61158. default:
  61159. return undefined;
  61160. }
  61161. }
  61162. /**
  61163. * Short format for `ms`.
  61164. *
  61165. * @param {Number} ms
  61166. * @return {String}
  61167. * @api private
  61168. */
  61169. function fmtShort(ms) {
  61170. var msAbs = Math.abs(ms);
  61171. if (msAbs >= d) {
  61172. return Math.round(ms / d) + 'd';
  61173. }
  61174. if (msAbs >= h) {
  61175. return Math.round(ms / h) + 'h';
  61176. }
  61177. if (msAbs >= m) {
  61178. return Math.round(ms / m) + 'm';
  61179. }
  61180. if (msAbs >= s) {
  61181. return Math.round(ms / s) + 's';
  61182. }
  61183. return ms + 'ms';
  61184. }
  61185. /**
  61186. * Long format for `ms`.
  61187. *
  61188. * @param {Number} ms
  61189. * @return {String}
  61190. * @api private
  61191. */
  61192. function fmtLong(ms) {
  61193. var msAbs = Math.abs(ms);
  61194. if (msAbs >= d) {
  61195. return plural(ms, msAbs, d, 'day');
  61196. }
  61197. if (msAbs >= h) {
  61198. return plural(ms, msAbs, h, 'hour');
  61199. }
  61200. if (msAbs >= m) {
  61201. return plural(ms, msAbs, m, 'minute');
  61202. }
  61203. if (msAbs >= s) {
  61204. return plural(ms, msAbs, s, 'second');
  61205. }
  61206. return ms + ' ms';
  61207. }
  61208. /**
  61209. * Pluralization helper.
  61210. */
  61211. function plural(ms, msAbs, n, name) {
  61212. var isPlural = msAbs >= n * 1.5;
  61213. return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
  61214. }
  61215. /***/ }),
  61216. /***/ "./node_modules/socket.io-parser/binary.js":
  61217. /*!*************************************************!*\
  61218. !*** ./node_modules/socket.io-parser/binary.js ***!
  61219. \*************************************************/
  61220. /*! no static exports found */
  61221. /***/ (function(module, exports, __webpack_require__) {
  61222. /*global Blob,File*/
  61223. /**
  61224. * Module requirements
  61225. */
  61226. var isArray = __webpack_require__(/*! isarray */ "./node_modules/socket.io-parser/node_modules/isarray/index.js");
  61227. var isBuf = __webpack_require__(/*! ./is-buffer */ "./node_modules/socket.io-parser/is-buffer.js");
  61228. var toString = Object.prototype.toString;
  61229. var withNativeBlob = typeof Blob === 'function' || (typeof Blob !== 'undefined' && toString.call(Blob) === '[object BlobConstructor]');
  61230. var withNativeFile = typeof File === 'function' || (typeof File !== 'undefined' && toString.call(File) === '[object FileConstructor]');
  61231. /**
  61232. * Replaces every Buffer | ArrayBuffer in packet with a numbered placeholder.
  61233. * Anything with blobs or files should be fed through removeBlobs before coming
  61234. * here.
  61235. *
  61236. * @param {Object} packet - socket.io event packet
  61237. * @return {Object} with deconstructed packet and list of buffers
  61238. * @api public
  61239. */
  61240. exports.deconstructPacket = function(packet) {
  61241. var buffers = [];
  61242. var packetData = packet.data;
  61243. var pack = packet;
  61244. pack.data = _deconstructPacket(packetData, buffers);
  61245. pack.attachments = buffers.length; // number of binary 'attachments'
  61246. return {packet: pack, buffers: buffers};
  61247. };
  61248. function _deconstructPacket(data, buffers) {
  61249. if (!data) return data;
  61250. if (isBuf(data)) {
  61251. var placeholder = { _placeholder: true, num: buffers.length };
  61252. buffers.push(data);
  61253. return placeholder;
  61254. } else if (isArray(data)) {
  61255. var newData = new Array(data.length);
  61256. for (var i = 0; i < data.length; i++) {
  61257. newData[i] = _deconstructPacket(data[i], buffers);
  61258. }
  61259. return newData;
  61260. } else if (typeof data === 'object' && !(data instanceof Date)) {
  61261. var newData = {};
  61262. for (var key in data) {
  61263. newData[key] = _deconstructPacket(data[key], buffers);
  61264. }
  61265. return newData;
  61266. }
  61267. return data;
  61268. }
  61269. /**
  61270. * Reconstructs a binary packet from its placeholder packet and buffers
  61271. *
  61272. * @param {Object} packet - event packet with placeholders
  61273. * @param {Array} buffers - binary buffers to put in placeholder positions
  61274. * @return {Object} reconstructed packet
  61275. * @api public
  61276. */
  61277. exports.reconstructPacket = function(packet, buffers) {
  61278. packet.data = _reconstructPacket(packet.data, buffers);
  61279. packet.attachments = undefined; // no longer useful
  61280. return packet;
  61281. };
  61282. function _reconstructPacket(data, buffers) {
  61283. if (!data) return data;
  61284. if (data && data._placeholder) {
  61285. return buffers[data.num]; // appropriate buffer (should be natural order anyway)
  61286. } else if (isArray(data)) {
  61287. for (var i = 0; i < data.length; i++) {
  61288. data[i] = _reconstructPacket(data[i], buffers);
  61289. }
  61290. } else if (typeof data === 'object') {
  61291. for (var key in data) {
  61292. data[key] = _reconstructPacket(data[key], buffers);
  61293. }
  61294. }
  61295. return data;
  61296. }
  61297. /**
  61298. * Asynchronously removes Blobs or Files from data via
  61299. * FileReader's readAsArrayBuffer method. Used before encoding
  61300. * data as msgpack. Calls callback with the blobless data.
  61301. *
  61302. * @param {Object} data
  61303. * @param {Function} callback
  61304. * @api private
  61305. */
  61306. exports.removeBlobs = function(data, callback) {
  61307. function _removeBlobs(obj, curKey, containingObject) {
  61308. if (!obj) return obj;
  61309. // convert any blob
  61310. if ((withNativeBlob && obj instanceof Blob) ||
  61311. (withNativeFile && obj instanceof File)) {
  61312. pendingBlobs++;
  61313. // async filereader
  61314. var fileReader = new FileReader();
  61315. fileReader.onload = function() { // this.result == arraybuffer
  61316. if (containingObject) {
  61317. containingObject[curKey] = this.result;
  61318. }
  61319. else {
  61320. bloblessData = this.result;
  61321. }
  61322. // if nothing pending its callback time
  61323. if(! --pendingBlobs) {
  61324. callback(bloblessData);
  61325. }
  61326. };
  61327. fileReader.readAsArrayBuffer(obj); // blob -> arraybuffer
  61328. } else if (isArray(obj)) { // handle array
  61329. for (var i = 0; i < obj.length; i++) {
  61330. _removeBlobs(obj[i], i, obj);
  61331. }
  61332. } else if (typeof obj === 'object' && !isBuf(obj)) { // and object
  61333. for (var key in obj) {
  61334. _removeBlobs(obj[key], key, obj);
  61335. }
  61336. }
  61337. }
  61338. var pendingBlobs = 0;
  61339. var bloblessData = data;
  61340. _removeBlobs(bloblessData);
  61341. if (!pendingBlobs) {
  61342. callback(bloblessData);
  61343. }
  61344. };
  61345. /***/ }),
  61346. /***/ "./node_modules/socket.io-parser/index.js":
  61347. /*!************************************************!*\
  61348. !*** ./node_modules/socket.io-parser/index.js ***!
  61349. \************************************************/
  61350. /*! no static exports found */
  61351. /***/ (function(module, exports, __webpack_require__) {
  61352. /**
  61353. * Module dependencies.
  61354. */
  61355. var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js")('socket.io-parser');
  61356. var Emitter = __webpack_require__(/*! component-emitter */ "./node_modules/socket.io-parser/node_modules/component-emitter/index.js");
  61357. var binary = __webpack_require__(/*! ./binary */ "./node_modules/socket.io-parser/binary.js");
  61358. var isArray = __webpack_require__(/*! isarray */ "./node_modules/socket.io-parser/node_modules/isarray/index.js");
  61359. var isBuf = __webpack_require__(/*! ./is-buffer */ "./node_modules/socket.io-parser/is-buffer.js");
  61360. /**
  61361. * Protocol version.
  61362. *
  61363. * @api public
  61364. */
  61365. exports.protocol = 4;
  61366. /**
  61367. * Packet types.
  61368. *
  61369. * @api public
  61370. */
  61371. exports.types = [
  61372. 'CONNECT',
  61373. 'DISCONNECT',
  61374. 'EVENT',
  61375. 'ACK',
  61376. 'ERROR',
  61377. 'BINARY_EVENT',
  61378. 'BINARY_ACK'
  61379. ];
  61380. /**
  61381. * Packet type `connect`.
  61382. *
  61383. * @api public
  61384. */
  61385. exports.CONNECT = 0;
  61386. /**
  61387. * Packet type `disconnect`.
  61388. *
  61389. * @api public
  61390. */
  61391. exports.DISCONNECT = 1;
  61392. /**
  61393. * Packet type `event`.
  61394. *
  61395. * @api public
  61396. */
  61397. exports.EVENT = 2;
  61398. /**
  61399. * Packet type `ack`.
  61400. *
  61401. * @api public
  61402. */
  61403. exports.ACK = 3;
  61404. /**
  61405. * Packet type `error`.
  61406. *
  61407. * @api public
  61408. */
  61409. exports.ERROR = 4;
  61410. /**
  61411. * Packet type 'binary event'
  61412. *
  61413. * @api public
  61414. */
  61415. exports.BINARY_EVENT = 5;
  61416. /**
  61417. * Packet type `binary ack`. For acks with binary arguments.
  61418. *
  61419. * @api public
  61420. */
  61421. exports.BINARY_ACK = 6;
  61422. /**
  61423. * Encoder constructor.
  61424. *
  61425. * @api public
  61426. */
  61427. exports.Encoder = Encoder;
  61428. /**
  61429. * Decoder constructor.
  61430. *
  61431. * @api public
  61432. */
  61433. exports.Decoder = Decoder;
  61434. /**
  61435. * A socket.io Encoder instance
  61436. *
  61437. * @api public
  61438. */
  61439. function Encoder() {}
  61440. var ERROR_PACKET = exports.ERROR + '"encode error"';
  61441. /**
  61442. * Encode a packet as a single string if non-binary, or as a
  61443. * buffer sequence, depending on packet type.
  61444. *
  61445. * @param {Object} obj - packet object
  61446. * @param {Function} callback - function to handle encodings (likely engine.write)
  61447. * @return Calls callback with Array of encodings
  61448. * @api public
  61449. */
  61450. Encoder.prototype.encode = function(obj, callback){
  61451. debug('encoding packet %j', obj);
  61452. if (exports.BINARY_EVENT === obj.type || exports.BINARY_ACK === obj.type) {
  61453. encodeAsBinary(obj, callback);
  61454. } else {
  61455. var encoding = encodeAsString(obj);
  61456. callback([encoding]);
  61457. }
  61458. };
  61459. /**
  61460. * Encode packet as string.
  61461. *
  61462. * @param {Object} packet
  61463. * @return {String} encoded
  61464. * @api private
  61465. */
  61466. function encodeAsString(obj) {
  61467. // first is type
  61468. var str = '' + obj.type;
  61469. // attachments if we have them
  61470. if (exports.BINARY_EVENT === obj.type || exports.BINARY_ACK === obj.type) {
  61471. str += obj.attachments + '-';
  61472. }
  61473. // if we have a namespace other than `/`
  61474. // we append it followed by a comma `,`
  61475. if (obj.nsp && '/' !== obj.nsp) {
  61476. str += obj.nsp + ',';
  61477. }
  61478. // immediately followed by the id
  61479. if (null != obj.id) {
  61480. str += obj.id;
  61481. }
  61482. // json data
  61483. if (null != obj.data) {
  61484. var payload = tryStringify(obj.data);
  61485. if (payload !== false) {
  61486. str += payload;
  61487. } else {
  61488. return ERROR_PACKET;
  61489. }
  61490. }
  61491. debug('encoded %j as %s', obj, str);
  61492. return str;
  61493. }
  61494. function tryStringify(str) {
  61495. try {
  61496. return JSON.stringify(str);
  61497. } catch(e){
  61498. return false;
  61499. }
  61500. }
  61501. /**
  61502. * Encode packet as 'buffer sequence' by removing blobs, and
  61503. * deconstructing packet into object with placeholders and
  61504. * a list of buffers.
  61505. *
  61506. * @param {Object} packet
  61507. * @return {Buffer} encoded
  61508. * @api private
  61509. */
  61510. function encodeAsBinary(obj, callback) {
  61511. function writeEncoding(bloblessData) {
  61512. var deconstruction = binary.deconstructPacket(bloblessData);
  61513. var pack = encodeAsString(deconstruction.packet);
  61514. var buffers = deconstruction.buffers;
  61515. buffers.unshift(pack); // add packet info to beginning of data list
  61516. callback(buffers); // write all the buffers
  61517. }
  61518. binary.removeBlobs(obj, writeEncoding);
  61519. }
  61520. /**
  61521. * A socket.io Decoder instance
  61522. *
  61523. * @return {Object} decoder
  61524. * @api public
  61525. */
  61526. function Decoder() {
  61527. this.reconstructor = null;
  61528. }
  61529. /**
  61530. * Mix in `Emitter` with Decoder.
  61531. */
  61532. Emitter(Decoder.prototype);
  61533. /**
  61534. * Decodes an encoded packet string into packet JSON.
  61535. *
  61536. * @param {String} obj - encoded packet
  61537. * @return {Object} packet
  61538. * @api public
  61539. */
  61540. Decoder.prototype.add = function(obj) {
  61541. var packet;
  61542. if (typeof obj === 'string') {
  61543. packet = decodeString(obj);
  61544. if (exports.BINARY_EVENT === packet.type || exports.BINARY_ACK === packet.type) { // binary packet's json
  61545. this.reconstructor = new BinaryReconstructor(packet);
  61546. // no attachments, labeled binary but no binary data to follow
  61547. if (this.reconstructor.reconPack.attachments === 0) {
  61548. this.emit('decoded', packet);
  61549. }
  61550. } else { // non-binary full packet
  61551. this.emit('decoded', packet);
  61552. }
  61553. } else if (isBuf(obj) || obj.base64) { // raw binary data
  61554. if (!this.reconstructor) {
  61555. throw new Error('got binary data when not reconstructing a packet');
  61556. } else {
  61557. packet = this.reconstructor.takeBinaryData(obj);
  61558. if (packet) { // received final buffer
  61559. this.reconstructor = null;
  61560. this.emit('decoded', packet);
  61561. }
  61562. }
  61563. } else {
  61564. throw new Error('Unknown type: ' + obj);
  61565. }
  61566. };
  61567. /**
  61568. * Decode a packet String (JSON data)
  61569. *
  61570. * @param {String} str
  61571. * @return {Object} packet
  61572. * @api private
  61573. */
  61574. function decodeString(str) {
  61575. var i = 0;
  61576. // look up type
  61577. var p = {
  61578. type: Number(str.charAt(0))
  61579. };
  61580. if (null == exports.types[p.type]) {
  61581. return error('unknown packet type ' + p.type);
  61582. }
  61583. // look up attachments if type binary
  61584. if (exports.BINARY_EVENT === p.type || exports.BINARY_ACK === p.type) {
  61585. var buf = '';
  61586. while (str.charAt(++i) !== '-') {
  61587. buf += str.charAt(i);
  61588. if (i == str.length) break;
  61589. }
  61590. if (buf != Number(buf) || str.charAt(i) !== '-') {
  61591. throw new Error('Illegal attachments');
  61592. }
  61593. p.attachments = Number(buf);
  61594. }
  61595. // look up namespace (if any)
  61596. if ('/' === str.charAt(i + 1)) {
  61597. p.nsp = '';
  61598. while (++i) {
  61599. var c = str.charAt(i);
  61600. if (',' === c) break;
  61601. p.nsp += c;
  61602. if (i === str.length) break;
  61603. }
  61604. } else {
  61605. p.nsp = '/';
  61606. }
  61607. // look up id
  61608. var next = str.charAt(i + 1);
  61609. if ('' !== next && Number(next) == next) {
  61610. p.id = '';
  61611. while (++i) {
  61612. var c = str.charAt(i);
  61613. if (null == c || Number(c) != c) {
  61614. --i;
  61615. break;
  61616. }
  61617. p.id += str.charAt(i);
  61618. if (i === str.length) break;
  61619. }
  61620. p.id = Number(p.id);
  61621. }
  61622. // look up json data
  61623. if (str.charAt(++i)) {
  61624. var payload = tryParse(str.substr(i));
  61625. var isPayloadValid = payload !== false && (p.type === exports.ERROR || isArray(payload));
  61626. if (isPayloadValid) {
  61627. p.data = payload;
  61628. } else {
  61629. return error('invalid payload');
  61630. }
  61631. }
  61632. debug('decoded %s as %j', str, p);
  61633. return p;
  61634. }
  61635. function tryParse(str) {
  61636. try {
  61637. return JSON.parse(str);
  61638. } catch(e){
  61639. return false;
  61640. }
  61641. }
  61642. /**
  61643. * Deallocates a parser's resources
  61644. *
  61645. * @api public
  61646. */
  61647. Decoder.prototype.destroy = function() {
  61648. if (this.reconstructor) {
  61649. this.reconstructor.finishedReconstruction();
  61650. }
  61651. };
  61652. /**
  61653. * A manager of a binary event's 'buffer sequence'. Should
  61654. * be constructed whenever a packet of type BINARY_EVENT is
  61655. * decoded.
  61656. *
  61657. * @param {Object} packet
  61658. * @return {BinaryReconstructor} initialized reconstructor
  61659. * @api private
  61660. */
  61661. function BinaryReconstructor(packet) {
  61662. this.reconPack = packet;
  61663. this.buffers = [];
  61664. }
  61665. /**
  61666. * Method to be called when binary data received from connection
  61667. * after a BINARY_EVENT packet.
  61668. *
  61669. * @param {Buffer | ArrayBuffer} binData - the raw binary data received
  61670. * @return {null | Object} returns null if more binary data is expected or
  61671. * a reconstructed packet object if all buffers have been received.
  61672. * @api private
  61673. */
  61674. BinaryReconstructor.prototype.takeBinaryData = function(binData) {
  61675. this.buffers.push(binData);
  61676. if (this.buffers.length === this.reconPack.attachments) { // done with buffer list
  61677. var packet = binary.reconstructPacket(this.reconPack, this.buffers);
  61678. this.finishedReconstruction();
  61679. return packet;
  61680. }
  61681. return null;
  61682. };
  61683. /**
  61684. * Cleans up binary packet reconstruction variables.
  61685. *
  61686. * @api private
  61687. */
  61688. BinaryReconstructor.prototype.finishedReconstruction = function() {
  61689. this.reconPack = null;
  61690. this.buffers = [];
  61691. };
  61692. function error(msg) {
  61693. return {
  61694. type: exports.ERROR,
  61695. data: 'parser error: ' + msg
  61696. };
  61697. }
  61698. /***/ }),
  61699. /***/ "./node_modules/socket.io-parser/is-buffer.js":
  61700. /*!****************************************************!*\
  61701. !*** ./node_modules/socket.io-parser/is-buffer.js ***!
  61702. \****************************************************/
  61703. /*! no static exports found */
  61704. /***/ (function(module, exports, __webpack_require__) {
  61705. /* WEBPACK VAR INJECTION */(function(Buffer) {
  61706. module.exports = isBuf;
  61707. var withNativeBuffer = typeof Buffer === 'function' && typeof Buffer.isBuffer === 'function';
  61708. var withNativeArrayBuffer = typeof ArrayBuffer === 'function';
  61709. var isView = function (obj) {
  61710. return typeof ArrayBuffer.isView === 'function' ? ArrayBuffer.isView(obj) : (obj.buffer instanceof ArrayBuffer);
  61711. };
  61712. /**
  61713. * Returns true if obj is a buffer or an arraybuffer.
  61714. *
  61715. * @api private
  61716. */
  61717. function isBuf(obj) {
  61718. return (withNativeBuffer && Buffer.isBuffer(obj)) ||
  61719. (withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)));
  61720. }
  61721. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ "./node_modules/buffer/index.js").Buffer))
  61722. /***/ }),
  61723. /***/ "./node_modules/socket.io-parser/node_modules/component-emitter/index.js":
  61724. /*!*******************************************************************************!*\
  61725. !*** ./node_modules/socket.io-parser/node_modules/component-emitter/index.js ***!
  61726. \*******************************************************************************/
  61727. /*! no static exports found */
  61728. /***/ (function(module, exports, __webpack_require__) {
  61729. /**
  61730. * Expose `Emitter`.
  61731. */
  61732. if (true) {
  61733. module.exports = Emitter;
  61734. }
  61735. /**
  61736. * Initialize a new `Emitter`.
  61737. *
  61738. * @api public
  61739. */
  61740. function Emitter(obj) {
  61741. if (obj) return mixin(obj);
  61742. };
  61743. /**
  61744. * Mixin the emitter properties.
  61745. *
  61746. * @param {Object} obj
  61747. * @return {Object}
  61748. * @api private
  61749. */
  61750. function mixin(obj) {
  61751. for (var key in Emitter.prototype) {
  61752. obj[key] = Emitter.prototype[key];
  61753. }
  61754. return obj;
  61755. }
  61756. /**
  61757. * Listen on the given `event` with `fn`.
  61758. *
  61759. * @param {String} event
  61760. * @param {Function} fn
  61761. * @return {Emitter}
  61762. * @api public
  61763. */
  61764. Emitter.prototype.on =
  61765. Emitter.prototype.addEventListener = function(event, fn){
  61766. this._callbacks = this._callbacks || {};
  61767. (this._callbacks['$' + event] = this._callbacks['$' + event] || [])
  61768. .push(fn);
  61769. return this;
  61770. };
  61771. /**
  61772. * Adds an `event` listener that will be invoked a single
  61773. * time then automatically removed.
  61774. *
  61775. * @param {String} event
  61776. * @param {Function} fn
  61777. * @return {Emitter}
  61778. * @api public
  61779. */
  61780. Emitter.prototype.once = function(event, fn){
  61781. function on() {
  61782. this.off(event, on);
  61783. fn.apply(this, arguments);
  61784. }
  61785. on.fn = fn;
  61786. this.on(event, on);
  61787. return this;
  61788. };
  61789. /**
  61790. * Remove the given callback for `event` or all
  61791. * registered callbacks.
  61792. *
  61793. * @param {String} event
  61794. * @param {Function} fn
  61795. * @return {Emitter}
  61796. * @api public
  61797. */
  61798. Emitter.prototype.off =
  61799. Emitter.prototype.removeListener =
  61800. Emitter.prototype.removeAllListeners =
  61801. Emitter.prototype.removeEventListener = function(event, fn){
  61802. this._callbacks = this._callbacks || {};
  61803. // all
  61804. if (0 == arguments.length) {
  61805. this._callbacks = {};
  61806. return this;
  61807. }
  61808. // specific event
  61809. var callbacks = this._callbacks['$' + event];
  61810. if (!callbacks) return this;
  61811. // remove all handlers
  61812. if (1 == arguments.length) {
  61813. delete this._callbacks['$' + event];
  61814. return this;
  61815. }
  61816. // remove specific handler
  61817. var cb;
  61818. for (var i = 0; i < callbacks.length; i++) {
  61819. cb = callbacks[i];
  61820. if (cb === fn || cb.fn === fn) {
  61821. callbacks.splice(i, 1);
  61822. break;
  61823. }
  61824. }
  61825. return this;
  61826. };
  61827. /**
  61828. * Emit `event` with the given args.
  61829. *
  61830. * @param {String} event
  61831. * @param {Mixed} ...
  61832. * @return {Emitter}
  61833. */
  61834. Emitter.prototype.emit = function(event){
  61835. this._callbacks = this._callbacks || {};
  61836. var args = [].slice.call(arguments, 1)
  61837. , callbacks = this._callbacks['$' + event];
  61838. if (callbacks) {
  61839. callbacks = callbacks.slice(0);
  61840. for (var i = 0, len = callbacks.length; i < len; ++i) {
  61841. callbacks[i].apply(this, args);
  61842. }
  61843. }
  61844. return this;
  61845. };
  61846. /**
  61847. * Return array of callbacks for `event`.
  61848. *
  61849. * @param {String} event
  61850. * @return {Array}
  61851. * @api public
  61852. */
  61853. Emitter.prototype.listeners = function(event){
  61854. this._callbacks = this._callbacks || {};
  61855. return this._callbacks['$' + event] || [];
  61856. };
  61857. /**
  61858. * Check if this emitter has `event` handlers.
  61859. *
  61860. * @param {String} event
  61861. * @return {Boolean}
  61862. * @api public
  61863. */
  61864. Emitter.prototype.hasListeners = function(event){
  61865. return !! this.listeners(event).length;
  61866. };
  61867. /***/ }),
  61868. /***/ "./node_modules/socket.io-parser/node_modules/isarray/index.js":
  61869. /*!*********************************************************************!*\
  61870. !*** ./node_modules/socket.io-parser/node_modules/isarray/index.js ***!
  61871. \*********************************************************************/
  61872. /*! no static exports found */
  61873. /***/ (function(module, exports) {
  61874. var toString = {}.toString;
  61875. module.exports = Array.isArray || function (arr) {
  61876. return toString.call(arr) == '[object Array]';
  61877. };
  61878. /***/ }),
  61879. /***/ "./node_modules/timers-browserify/main.js":
  61880. /*!************************************************!*\
  61881. !*** ./node_modules/timers-browserify/main.js ***!
  61882. \************************************************/
  61883. /*! no static exports found */
  61884. /***/ (function(module, exports, __webpack_require__) {
  61885. /* WEBPACK VAR INJECTION */(function(global) {var scope = (typeof global !== "undefined" && global) ||
  61886. (typeof self !== "undefined" && self) ||
  61887. window;
  61888. var apply = Function.prototype.apply;
  61889. // DOM APIs, for completeness
  61890. exports.setTimeout = function() {
  61891. return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);
  61892. };
  61893. exports.setInterval = function() {
  61894. return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);
  61895. };
  61896. exports.clearTimeout =
  61897. exports.clearInterval = function(timeout) {
  61898. if (timeout) {
  61899. timeout.close();
  61900. }
  61901. };
  61902. function Timeout(id, clearFn) {
  61903. this._id = id;
  61904. this._clearFn = clearFn;
  61905. }
  61906. Timeout.prototype.unref = Timeout.prototype.ref = function() {};
  61907. Timeout.prototype.close = function() {
  61908. this._clearFn.call(scope, this._id);
  61909. };
  61910. // Does not start the time, just sets up the members needed.
  61911. exports.enroll = function(item, msecs) {
  61912. clearTimeout(item._idleTimeoutId);
  61913. item._idleTimeout = msecs;
  61914. };
  61915. exports.unenroll = function(item) {
  61916. clearTimeout(item._idleTimeoutId);
  61917. item._idleTimeout = -1;
  61918. };
  61919. exports._unrefActive = exports.active = function(item) {
  61920. clearTimeout(item._idleTimeoutId);
  61921. var msecs = item._idleTimeout;
  61922. if (msecs >= 0) {
  61923. item._idleTimeoutId = setTimeout(function onTimeout() {
  61924. if (item._onTimeout)
  61925. item._onTimeout();
  61926. }, msecs);
  61927. }
  61928. };
  61929. // setimmediate attaches itself to the global object
  61930. __webpack_require__(/*! setimmediate */ "./node_modules/setimmediate/setImmediate.js");
  61931. // On some exotic environments, it's not clear which object `setimmediate` was
  61932. // able to install onto. Search each possibility in the same order as the
  61933. // `setimmediate` library.
  61934. exports.setImmediate = (typeof self !== "undefined" && self.setImmediate) ||
  61935. (typeof global !== "undefined" && global.setImmediate) ||
  61936. (this && this.setImmediate);
  61937. exports.clearImmediate = (typeof self !== "undefined" && self.clearImmediate) ||
  61938. (typeof global !== "undefined" && global.clearImmediate) ||
  61939. (this && this.clearImmediate);
  61940. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  61941. /***/ }),
  61942. /***/ "./node_modules/to-array/index.js":
  61943. /*!****************************************!*\
  61944. !*** ./node_modules/to-array/index.js ***!
  61945. \****************************************/
  61946. /*! no static exports found */
  61947. /***/ (function(module, exports) {
  61948. module.exports = toArray
  61949. function toArray(list, index) {
  61950. var array = []
  61951. index = index || 0
  61952. for (var i = index || 0; i < list.length; i++) {
  61953. array[i - index] = list[i]
  61954. }
  61955. return array
  61956. }
  61957. /***/ }),
  61958. /***/ "./node_modules/vue/dist/vue.common.dev.js":
  61959. /*!*************************************************!*\
  61960. !*** ./node_modules/vue/dist/vue.common.dev.js ***!
  61961. \*************************************************/
  61962. /*! no static exports found */
  61963. /***/ (function(module, exports, __webpack_require__) {
  61964. "use strict";
  61965. /* WEBPACK VAR INJECTION */(function(global, setImmediate) {/*!
  61966. * Vue.js v2.6.11
  61967. * (c) 2014-2019 Evan You
  61968. * Released under the MIT License.
  61969. */
  61970. /* */
  61971. var emptyObject = Object.freeze({});
  61972. // These helpers produce better VM code in JS engines due to their
  61973. // explicitness and function inlining.
  61974. function isUndef (v) {
  61975. return v === undefined || v === null
  61976. }
  61977. function isDef (v) {
  61978. return v !== undefined && v !== null
  61979. }
  61980. function isTrue (v) {
  61981. return v === true
  61982. }
  61983. function isFalse (v) {
  61984. return v === false
  61985. }
  61986. /**
  61987. * Check if value is primitive.
  61988. */
  61989. function isPrimitive (value) {
  61990. return (
  61991. typeof value === 'string' ||
  61992. typeof value === 'number' ||
  61993. // $flow-disable-line
  61994. typeof value === 'symbol' ||
  61995. typeof value === 'boolean'
  61996. )
  61997. }
  61998. /**
  61999. * Quick object check - this is primarily used to tell
  62000. * Objects from primitive values when we know the value
  62001. * is a JSON-compliant type.
  62002. */
  62003. function isObject (obj) {
  62004. return obj !== null && typeof obj === 'object'
  62005. }
  62006. /**
  62007. * Get the raw type string of a value, e.g., [object Object].
  62008. */
  62009. var _toString = Object.prototype.toString;
  62010. function toRawType (value) {
  62011. return _toString.call(value).slice(8, -1)
  62012. }
  62013. /**
  62014. * Strict object type check. Only returns true
  62015. * for plain JavaScript objects.
  62016. */
  62017. function isPlainObject (obj) {
  62018. return _toString.call(obj) === '[object Object]'
  62019. }
  62020. function isRegExp (v) {
  62021. return _toString.call(v) === '[object RegExp]'
  62022. }
  62023. /**
  62024. * Check if val is a valid array index.
  62025. */
  62026. function isValidArrayIndex (val) {
  62027. var n = parseFloat(String(val));
  62028. return n >= 0 && Math.floor(n) === n && isFinite(val)
  62029. }
  62030. function isPromise (val) {
  62031. return (
  62032. isDef(val) &&
  62033. typeof val.then === 'function' &&
  62034. typeof val.catch === 'function'
  62035. )
  62036. }
  62037. /**
  62038. * Convert a value to a string that is actually rendered.
  62039. */
  62040. function toString (val) {
  62041. return val == null
  62042. ? ''
  62043. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  62044. ? JSON.stringify(val, null, 2)
  62045. : String(val)
  62046. }
  62047. /**
  62048. * Convert an input value to a number for persistence.
  62049. * If the conversion fails, return original string.
  62050. */
  62051. function toNumber (val) {
  62052. var n = parseFloat(val);
  62053. return isNaN(n) ? val : n
  62054. }
  62055. /**
  62056. * Make a map and return a function for checking if a key
  62057. * is in that map.
  62058. */
  62059. function makeMap (
  62060. str,
  62061. expectsLowerCase
  62062. ) {
  62063. var map = Object.create(null);
  62064. var list = str.split(',');
  62065. for (var i = 0; i < list.length; i++) {
  62066. map[list[i]] = true;
  62067. }
  62068. return expectsLowerCase
  62069. ? function (val) { return map[val.toLowerCase()]; }
  62070. : function (val) { return map[val]; }
  62071. }
  62072. /**
  62073. * Check if a tag is a built-in tag.
  62074. */
  62075. var isBuiltInTag = makeMap('slot,component', true);
  62076. /**
  62077. * Check if an attribute is a reserved attribute.
  62078. */
  62079. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  62080. /**
  62081. * Remove an item from an array.
  62082. */
  62083. function remove (arr, item) {
  62084. if (arr.length) {
  62085. var index = arr.indexOf(item);
  62086. if (index > -1) {
  62087. return arr.splice(index, 1)
  62088. }
  62089. }
  62090. }
  62091. /**
  62092. * Check whether an object has the property.
  62093. */
  62094. var hasOwnProperty = Object.prototype.hasOwnProperty;
  62095. function hasOwn (obj, key) {
  62096. return hasOwnProperty.call(obj, key)
  62097. }
  62098. /**
  62099. * Create a cached version of a pure function.
  62100. */
  62101. function cached (fn) {
  62102. var cache = Object.create(null);
  62103. return (function cachedFn (str) {
  62104. var hit = cache[str];
  62105. return hit || (cache[str] = fn(str))
  62106. })
  62107. }
  62108. /**
  62109. * Camelize a hyphen-delimited string.
  62110. */
  62111. var camelizeRE = /-(\w)/g;
  62112. var camelize = cached(function (str) {
  62113. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  62114. });
  62115. /**
  62116. * Capitalize a string.
  62117. */
  62118. var capitalize = cached(function (str) {
  62119. return str.charAt(0).toUpperCase() + str.slice(1)
  62120. });
  62121. /**
  62122. * Hyphenate a camelCase string.
  62123. */
  62124. var hyphenateRE = /\B([A-Z])/g;
  62125. var hyphenate = cached(function (str) {
  62126. return str.replace(hyphenateRE, '-$1').toLowerCase()
  62127. });
  62128. /**
  62129. * Simple bind polyfill for environments that do not support it,
  62130. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  62131. * since native bind is now performant enough in most browsers.
  62132. * But removing it would mean breaking code that was able to run in
  62133. * PhantomJS 1.x, so this must be kept for backward compatibility.
  62134. */
  62135. /* istanbul ignore next */
  62136. function polyfillBind (fn, ctx) {
  62137. function boundFn (a) {
  62138. var l = arguments.length;
  62139. return l
  62140. ? l > 1
  62141. ? fn.apply(ctx, arguments)
  62142. : fn.call(ctx, a)
  62143. : fn.call(ctx)
  62144. }
  62145. boundFn._length = fn.length;
  62146. return boundFn
  62147. }
  62148. function nativeBind (fn, ctx) {
  62149. return fn.bind(ctx)
  62150. }
  62151. var bind = Function.prototype.bind
  62152. ? nativeBind
  62153. : polyfillBind;
  62154. /**
  62155. * Convert an Array-like object to a real Array.
  62156. */
  62157. function toArray (list, start) {
  62158. start = start || 0;
  62159. var i = list.length - start;
  62160. var ret = new Array(i);
  62161. while (i--) {
  62162. ret[i] = list[i + start];
  62163. }
  62164. return ret
  62165. }
  62166. /**
  62167. * Mix properties into target object.
  62168. */
  62169. function extend (to, _from) {
  62170. for (var key in _from) {
  62171. to[key] = _from[key];
  62172. }
  62173. return to
  62174. }
  62175. /**
  62176. * Merge an Array of Objects into a single Object.
  62177. */
  62178. function toObject (arr) {
  62179. var res = {};
  62180. for (var i = 0; i < arr.length; i++) {
  62181. if (arr[i]) {
  62182. extend(res, arr[i]);
  62183. }
  62184. }
  62185. return res
  62186. }
  62187. /* eslint-disable no-unused-vars */
  62188. /**
  62189. * Perform no operation.
  62190. * Stubbing args to make Flow happy without leaving useless transpiled code
  62191. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  62192. */
  62193. function noop (a, b, c) {}
  62194. /**
  62195. * Always return false.
  62196. */
  62197. var no = function (a, b, c) { return false; };
  62198. /* eslint-enable no-unused-vars */
  62199. /**
  62200. * Return the same value.
  62201. */
  62202. var identity = function (_) { return _; };
  62203. /**
  62204. * Generate a string containing static keys from compiler modules.
  62205. */
  62206. function genStaticKeys (modules) {
  62207. return modules.reduce(function (keys, m) {
  62208. return keys.concat(m.staticKeys || [])
  62209. }, []).join(',')
  62210. }
  62211. /**
  62212. * Check if two values are loosely equal - that is,
  62213. * if they are plain objects, do they have the same shape?
  62214. */
  62215. function looseEqual (a, b) {
  62216. if (a === b) { return true }
  62217. var isObjectA = isObject(a);
  62218. var isObjectB = isObject(b);
  62219. if (isObjectA && isObjectB) {
  62220. try {
  62221. var isArrayA = Array.isArray(a);
  62222. var isArrayB = Array.isArray(b);
  62223. if (isArrayA && isArrayB) {
  62224. return a.length === b.length && a.every(function (e, i) {
  62225. return looseEqual(e, b[i])
  62226. })
  62227. } else if (a instanceof Date && b instanceof Date) {
  62228. return a.getTime() === b.getTime()
  62229. } else if (!isArrayA && !isArrayB) {
  62230. var keysA = Object.keys(a);
  62231. var keysB = Object.keys(b);
  62232. return keysA.length === keysB.length && keysA.every(function (key) {
  62233. return looseEqual(a[key], b[key])
  62234. })
  62235. } else {
  62236. /* istanbul ignore next */
  62237. return false
  62238. }
  62239. } catch (e) {
  62240. /* istanbul ignore next */
  62241. return false
  62242. }
  62243. } else if (!isObjectA && !isObjectB) {
  62244. return String(a) === String(b)
  62245. } else {
  62246. return false
  62247. }
  62248. }
  62249. /**
  62250. * Return the first index at which a loosely equal value can be
  62251. * found in the array (if value is a plain object, the array must
  62252. * contain an object of the same shape), or -1 if it is not present.
  62253. */
  62254. function looseIndexOf (arr, val) {
  62255. for (var i = 0; i < arr.length; i++) {
  62256. if (looseEqual(arr[i], val)) { return i }
  62257. }
  62258. return -1
  62259. }
  62260. /**
  62261. * Ensure a function is called only once.
  62262. */
  62263. function once (fn) {
  62264. var called = false;
  62265. return function () {
  62266. if (!called) {
  62267. called = true;
  62268. fn.apply(this, arguments);
  62269. }
  62270. }
  62271. }
  62272. var SSR_ATTR = 'data-server-rendered';
  62273. var ASSET_TYPES = [
  62274. 'component',
  62275. 'directive',
  62276. 'filter'
  62277. ];
  62278. var LIFECYCLE_HOOKS = [
  62279. 'beforeCreate',
  62280. 'created',
  62281. 'beforeMount',
  62282. 'mounted',
  62283. 'beforeUpdate',
  62284. 'updated',
  62285. 'beforeDestroy',
  62286. 'destroyed',
  62287. 'activated',
  62288. 'deactivated',
  62289. 'errorCaptured',
  62290. 'serverPrefetch'
  62291. ];
  62292. /* */
  62293. var config = ({
  62294. /**
  62295. * Option merge strategies (used in core/util/options)
  62296. */
  62297. // $flow-disable-line
  62298. optionMergeStrategies: Object.create(null),
  62299. /**
  62300. * Whether to suppress warnings.
  62301. */
  62302. silent: false,
  62303. /**
  62304. * Show production mode tip message on boot?
  62305. */
  62306. productionTip: "development" !== 'production',
  62307. /**
  62308. * Whether to enable devtools
  62309. */
  62310. devtools: "development" !== 'production',
  62311. /**
  62312. * Whether to record perf
  62313. */
  62314. performance: false,
  62315. /**
  62316. * Error handler for watcher errors
  62317. */
  62318. errorHandler: null,
  62319. /**
  62320. * Warn handler for watcher warns
  62321. */
  62322. warnHandler: null,
  62323. /**
  62324. * Ignore certain custom elements
  62325. */
  62326. ignoredElements: [],
  62327. /**
  62328. * Custom user key aliases for v-on
  62329. */
  62330. // $flow-disable-line
  62331. keyCodes: Object.create(null),
  62332. /**
  62333. * Check if a tag is reserved so that it cannot be registered as a
  62334. * component. This is platform-dependent and may be overwritten.
  62335. */
  62336. isReservedTag: no,
  62337. /**
  62338. * Check if an attribute is reserved so that it cannot be used as a component
  62339. * prop. This is platform-dependent and may be overwritten.
  62340. */
  62341. isReservedAttr: no,
  62342. /**
  62343. * Check if a tag is an unknown element.
  62344. * Platform-dependent.
  62345. */
  62346. isUnknownElement: no,
  62347. /**
  62348. * Get the namespace of an element
  62349. */
  62350. getTagNamespace: noop,
  62351. /**
  62352. * Parse the real tag name for the specific platform.
  62353. */
  62354. parsePlatformTagName: identity,
  62355. /**
  62356. * Check if an attribute must be bound using property, e.g. value
  62357. * Platform-dependent.
  62358. */
  62359. mustUseProp: no,
  62360. /**
  62361. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  62362. * This will significantly reduce performance if set to false.
  62363. */
  62364. async: true,
  62365. /**
  62366. * Exposed for legacy reasons
  62367. */
  62368. _lifecycleHooks: LIFECYCLE_HOOKS
  62369. });
  62370. /* */
  62371. /**
  62372. * unicode letters used for parsing html tags, component names and property paths.
  62373. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  62374. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  62375. */
  62376. var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;
  62377. /**
  62378. * Check if a string starts with $ or _
  62379. */
  62380. function isReserved (str) {
  62381. var c = (str + '').charCodeAt(0);
  62382. return c === 0x24 || c === 0x5F
  62383. }
  62384. /**
  62385. * Define a property.
  62386. */
  62387. function def (obj, key, val, enumerable) {
  62388. Object.defineProperty(obj, key, {
  62389. value: val,
  62390. enumerable: !!enumerable,
  62391. writable: true,
  62392. configurable: true
  62393. });
  62394. }
  62395. /**
  62396. * Parse simple path.
  62397. */
  62398. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  62399. function parsePath (path) {
  62400. if (bailRE.test(path)) {
  62401. return
  62402. }
  62403. var segments = path.split('.');
  62404. return function (obj) {
  62405. for (var i = 0; i < segments.length; i++) {
  62406. if (!obj) { return }
  62407. obj = obj[segments[i]];
  62408. }
  62409. return obj
  62410. }
  62411. }
  62412. /* */
  62413. // can we use __proto__?
  62414. var hasProto = '__proto__' in {};
  62415. // Browser environment sniffing
  62416. var inBrowser = typeof window !== 'undefined';
  62417. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  62418. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  62419. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  62420. var isIE = UA && /msie|trident/.test(UA);
  62421. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  62422. var isEdge = UA && UA.indexOf('edge/') > 0;
  62423. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  62424. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  62425. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  62426. var isPhantomJS = UA && /phantomjs/.test(UA);
  62427. var isFF = UA && UA.match(/firefox\/(\d+)/);
  62428. // Firefox has a "watch" function on Object.prototype...
  62429. var nativeWatch = ({}).watch;
  62430. var supportsPassive = false;
  62431. if (inBrowser) {
  62432. try {
  62433. var opts = {};
  62434. Object.defineProperty(opts, 'passive', ({
  62435. get: function get () {
  62436. /* istanbul ignore next */
  62437. supportsPassive = true;
  62438. }
  62439. })); // https://github.com/facebook/flow/issues/285
  62440. window.addEventListener('test-passive', null, opts);
  62441. } catch (e) {}
  62442. }
  62443. // this needs to be lazy-evaled because vue may be required before
  62444. // vue-server-renderer can set VUE_ENV
  62445. var _isServer;
  62446. var isServerRendering = function () {
  62447. if (_isServer === undefined) {
  62448. /* istanbul ignore if */
  62449. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  62450. // detect presence of vue-server-renderer and avoid
  62451. // Webpack shimming the process
  62452. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  62453. } else {
  62454. _isServer = false;
  62455. }
  62456. }
  62457. return _isServer
  62458. };
  62459. // detect devtools
  62460. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  62461. /* istanbul ignore next */
  62462. function isNative (Ctor) {
  62463. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  62464. }
  62465. var hasSymbol =
  62466. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  62467. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  62468. var _Set;
  62469. /* istanbul ignore if */ // $flow-disable-line
  62470. if (typeof Set !== 'undefined' && isNative(Set)) {
  62471. // use native Set when available.
  62472. _Set = Set;
  62473. } else {
  62474. // a non-standard Set polyfill that only works with primitive keys.
  62475. _Set = /*@__PURE__*/(function () {
  62476. function Set () {
  62477. this.set = Object.create(null);
  62478. }
  62479. Set.prototype.has = function has (key) {
  62480. return this.set[key] === true
  62481. };
  62482. Set.prototype.add = function add (key) {
  62483. this.set[key] = true;
  62484. };
  62485. Set.prototype.clear = function clear () {
  62486. this.set = Object.create(null);
  62487. };
  62488. return Set;
  62489. }());
  62490. }
  62491. /* */
  62492. var warn = noop;
  62493. var tip = noop;
  62494. var generateComponentTrace = (noop); // work around flow check
  62495. var formatComponentName = (noop);
  62496. {
  62497. var hasConsole = typeof console !== 'undefined';
  62498. var classifyRE = /(?:^|[-_])(\w)/g;
  62499. var classify = function (str) { return str
  62500. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  62501. .replace(/[-_]/g, ''); };
  62502. warn = function (msg, vm) {
  62503. var trace = vm ? generateComponentTrace(vm) : '';
  62504. if (config.warnHandler) {
  62505. config.warnHandler.call(null, msg, vm, trace);
  62506. } else if (hasConsole && (!config.silent)) {
  62507. console.error(("[Vue warn]: " + msg + trace));
  62508. }
  62509. };
  62510. tip = function (msg, vm) {
  62511. if (hasConsole && (!config.silent)) {
  62512. console.warn("[Vue tip]: " + msg + (
  62513. vm ? generateComponentTrace(vm) : ''
  62514. ));
  62515. }
  62516. };
  62517. formatComponentName = function (vm, includeFile) {
  62518. if (vm.$root === vm) {
  62519. return '<Root>'
  62520. }
  62521. var options = typeof vm === 'function' && vm.cid != null
  62522. ? vm.options
  62523. : vm._isVue
  62524. ? vm.$options || vm.constructor.options
  62525. : vm;
  62526. var name = options.name || options._componentTag;
  62527. var file = options.__file;
  62528. if (!name && file) {
  62529. var match = file.match(/([^/\\]+)\.vue$/);
  62530. name = match && match[1];
  62531. }
  62532. return (
  62533. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  62534. (file && includeFile !== false ? (" at " + file) : '')
  62535. )
  62536. };
  62537. var repeat = function (str, n) {
  62538. var res = '';
  62539. while (n) {
  62540. if (n % 2 === 1) { res += str; }
  62541. if (n > 1) { str += str; }
  62542. n >>= 1;
  62543. }
  62544. return res
  62545. };
  62546. generateComponentTrace = function (vm) {
  62547. if (vm._isVue && vm.$parent) {
  62548. var tree = [];
  62549. var currentRecursiveSequence = 0;
  62550. while (vm) {
  62551. if (tree.length > 0) {
  62552. var last = tree[tree.length - 1];
  62553. if (last.constructor === vm.constructor) {
  62554. currentRecursiveSequence++;
  62555. vm = vm.$parent;
  62556. continue
  62557. } else if (currentRecursiveSequence > 0) {
  62558. tree[tree.length - 1] = [last, currentRecursiveSequence];
  62559. currentRecursiveSequence = 0;
  62560. }
  62561. }
  62562. tree.push(vm);
  62563. vm = vm.$parent;
  62564. }
  62565. return '\n\nfound in\n\n' + tree
  62566. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  62567. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  62568. : formatComponentName(vm))); })
  62569. .join('\n')
  62570. } else {
  62571. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  62572. }
  62573. };
  62574. }
  62575. /* */
  62576. var uid = 0;
  62577. /**
  62578. * A dep is an observable that can have multiple
  62579. * directives subscribing to it.
  62580. */
  62581. var Dep = function Dep () {
  62582. this.id = uid++;
  62583. this.subs = [];
  62584. };
  62585. Dep.prototype.addSub = function addSub (sub) {
  62586. this.subs.push(sub);
  62587. };
  62588. Dep.prototype.removeSub = function removeSub (sub) {
  62589. remove(this.subs, sub);
  62590. };
  62591. Dep.prototype.depend = function depend () {
  62592. if (Dep.target) {
  62593. Dep.target.addDep(this);
  62594. }
  62595. };
  62596. Dep.prototype.notify = function notify () {
  62597. // stabilize the subscriber list first
  62598. var subs = this.subs.slice();
  62599. if (!config.async) {
  62600. // subs aren't sorted in scheduler if not running async
  62601. // we need to sort them now to make sure they fire in correct
  62602. // order
  62603. subs.sort(function (a, b) { return a.id - b.id; });
  62604. }
  62605. for (var i = 0, l = subs.length; i < l; i++) {
  62606. subs[i].update();
  62607. }
  62608. };
  62609. // The current target watcher being evaluated.
  62610. // This is globally unique because only one watcher
  62611. // can be evaluated at a time.
  62612. Dep.target = null;
  62613. var targetStack = [];
  62614. function pushTarget (target) {
  62615. targetStack.push(target);
  62616. Dep.target = target;
  62617. }
  62618. function popTarget () {
  62619. targetStack.pop();
  62620. Dep.target = targetStack[targetStack.length - 1];
  62621. }
  62622. /* */
  62623. var VNode = function VNode (
  62624. tag,
  62625. data,
  62626. children,
  62627. text,
  62628. elm,
  62629. context,
  62630. componentOptions,
  62631. asyncFactory
  62632. ) {
  62633. this.tag = tag;
  62634. this.data = data;
  62635. this.children = children;
  62636. this.text = text;
  62637. this.elm = elm;
  62638. this.ns = undefined;
  62639. this.context = context;
  62640. this.fnContext = undefined;
  62641. this.fnOptions = undefined;
  62642. this.fnScopeId = undefined;
  62643. this.key = data && data.key;
  62644. this.componentOptions = componentOptions;
  62645. this.componentInstance = undefined;
  62646. this.parent = undefined;
  62647. this.raw = false;
  62648. this.isStatic = false;
  62649. this.isRootInsert = true;
  62650. this.isComment = false;
  62651. this.isCloned = false;
  62652. this.isOnce = false;
  62653. this.asyncFactory = asyncFactory;
  62654. this.asyncMeta = undefined;
  62655. this.isAsyncPlaceholder = false;
  62656. };
  62657. var prototypeAccessors = { child: { configurable: true } };
  62658. // DEPRECATED: alias for componentInstance for backwards compat.
  62659. /* istanbul ignore next */
  62660. prototypeAccessors.child.get = function () {
  62661. return this.componentInstance
  62662. };
  62663. Object.defineProperties( VNode.prototype, prototypeAccessors );
  62664. var createEmptyVNode = function (text) {
  62665. if ( text === void 0 ) text = '';
  62666. var node = new VNode();
  62667. node.text = text;
  62668. node.isComment = true;
  62669. return node
  62670. };
  62671. function createTextVNode (val) {
  62672. return new VNode(undefined, undefined, undefined, String(val))
  62673. }
  62674. // optimized shallow clone
  62675. // used for static nodes and slot nodes because they may be reused across
  62676. // multiple renders, cloning them avoids errors when DOM manipulations rely
  62677. // on their elm reference.
  62678. function cloneVNode (vnode) {
  62679. var cloned = new VNode(
  62680. vnode.tag,
  62681. vnode.data,
  62682. // #7975
  62683. // clone children array to avoid mutating original in case of cloning
  62684. // a child.
  62685. vnode.children && vnode.children.slice(),
  62686. vnode.text,
  62687. vnode.elm,
  62688. vnode.context,
  62689. vnode.componentOptions,
  62690. vnode.asyncFactory
  62691. );
  62692. cloned.ns = vnode.ns;
  62693. cloned.isStatic = vnode.isStatic;
  62694. cloned.key = vnode.key;
  62695. cloned.isComment = vnode.isComment;
  62696. cloned.fnContext = vnode.fnContext;
  62697. cloned.fnOptions = vnode.fnOptions;
  62698. cloned.fnScopeId = vnode.fnScopeId;
  62699. cloned.asyncMeta = vnode.asyncMeta;
  62700. cloned.isCloned = true;
  62701. return cloned
  62702. }
  62703. /*
  62704. * not type checking this file because flow doesn't play well with
  62705. * dynamically accessing methods on Array prototype
  62706. */
  62707. var arrayProto = Array.prototype;
  62708. var arrayMethods = Object.create(arrayProto);
  62709. var methodsToPatch = [
  62710. 'push',
  62711. 'pop',
  62712. 'shift',
  62713. 'unshift',
  62714. 'splice',
  62715. 'sort',
  62716. 'reverse'
  62717. ];
  62718. /**
  62719. * Intercept mutating methods and emit events
  62720. */
  62721. methodsToPatch.forEach(function (method) {
  62722. // cache original method
  62723. var original = arrayProto[method];
  62724. def(arrayMethods, method, function mutator () {
  62725. var args = [], len = arguments.length;
  62726. while ( len-- ) args[ len ] = arguments[ len ];
  62727. var result = original.apply(this, args);
  62728. var ob = this.__ob__;
  62729. var inserted;
  62730. switch (method) {
  62731. case 'push':
  62732. case 'unshift':
  62733. inserted = args;
  62734. break
  62735. case 'splice':
  62736. inserted = args.slice(2);
  62737. break
  62738. }
  62739. if (inserted) { ob.observeArray(inserted); }
  62740. // notify change
  62741. ob.dep.notify();
  62742. return result
  62743. });
  62744. });
  62745. /* */
  62746. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  62747. /**
  62748. * In some cases we may want to disable observation inside a component's
  62749. * update computation.
  62750. */
  62751. var shouldObserve = true;
  62752. function toggleObserving (value) {
  62753. shouldObserve = value;
  62754. }
  62755. /**
  62756. * Observer class that is attached to each observed
  62757. * object. Once attached, the observer converts the target
  62758. * object's property keys into getter/setters that
  62759. * collect dependencies and dispatch updates.
  62760. */
  62761. var Observer = function Observer (value) {
  62762. this.value = value;
  62763. this.dep = new Dep();
  62764. this.vmCount = 0;
  62765. def(value, '__ob__', this);
  62766. if (Array.isArray(value)) {
  62767. if (hasProto) {
  62768. protoAugment(value, arrayMethods);
  62769. } else {
  62770. copyAugment(value, arrayMethods, arrayKeys);
  62771. }
  62772. this.observeArray(value);
  62773. } else {
  62774. this.walk(value);
  62775. }
  62776. };
  62777. /**
  62778. * Walk through all properties and convert them into
  62779. * getter/setters. This method should only be called when
  62780. * value type is Object.
  62781. */
  62782. Observer.prototype.walk = function walk (obj) {
  62783. var keys = Object.keys(obj);
  62784. for (var i = 0; i < keys.length; i++) {
  62785. defineReactive$$1(obj, keys[i]);
  62786. }
  62787. };
  62788. /**
  62789. * Observe a list of Array items.
  62790. */
  62791. Observer.prototype.observeArray = function observeArray (items) {
  62792. for (var i = 0, l = items.length; i < l; i++) {
  62793. observe(items[i]);
  62794. }
  62795. };
  62796. // helpers
  62797. /**
  62798. * Augment a target Object or Array by intercepting
  62799. * the prototype chain using __proto__
  62800. */
  62801. function protoAugment (target, src) {
  62802. /* eslint-disable no-proto */
  62803. target.__proto__ = src;
  62804. /* eslint-enable no-proto */
  62805. }
  62806. /**
  62807. * Augment a target Object or Array by defining
  62808. * hidden properties.
  62809. */
  62810. /* istanbul ignore next */
  62811. function copyAugment (target, src, keys) {
  62812. for (var i = 0, l = keys.length; i < l; i++) {
  62813. var key = keys[i];
  62814. def(target, key, src[key]);
  62815. }
  62816. }
  62817. /**
  62818. * Attempt to create an observer instance for a value,
  62819. * returns the new observer if successfully observed,
  62820. * or the existing observer if the value already has one.
  62821. */
  62822. function observe (value, asRootData) {
  62823. if (!isObject(value) || value instanceof VNode) {
  62824. return
  62825. }
  62826. var ob;
  62827. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  62828. ob = value.__ob__;
  62829. } else if (
  62830. shouldObserve &&
  62831. !isServerRendering() &&
  62832. (Array.isArray(value) || isPlainObject(value)) &&
  62833. Object.isExtensible(value) &&
  62834. !value._isVue
  62835. ) {
  62836. ob = new Observer(value);
  62837. }
  62838. if (asRootData && ob) {
  62839. ob.vmCount++;
  62840. }
  62841. return ob
  62842. }
  62843. /**
  62844. * Define a reactive property on an Object.
  62845. */
  62846. function defineReactive$$1 (
  62847. obj,
  62848. key,
  62849. val,
  62850. customSetter,
  62851. shallow
  62852. ) {
  62853. var dep = new Dep();
  62854. var property = Object.getOwnPropertyDescriptor(obj, key);
  62855. if (property && property.configurable === false) {
  62856. return
  62857. }
  62858. // cater for pre-defined getter/setters
  62859. var getter = property && property.get;
  62860. var setter = property && property.set;
  62861. if ((!getter || setter) && arguments.length === 2) {
  62862. val = obj[key];
  62863. }
  62864. var childOb = !shallow && observe(val);
  62865. Object.defineProperty(obj, key, {
  62866. enumerable: true,
  62867. configurable: true,
  62868. get: function reactiveGetter () {
  62869. var value = getter ? getter.call(obj) : val;
  62870. if (Dep.target) {
  62871. dep.depend();
  62872. if (childOb) {
  62873. childOb.dep.depend();
  62874. if (Array.isArray(value)) {
  62875. dependArray(value);
  62876. }
  62877. }
  62878. }
  62879. return value
  62880. },
  62881. set: function reactiveSetter (newVal) {
  62882. var value = getter ? getter.call(obj) : val;
  62883. /* eslint-disable no-self-compare */
  62884. if (newVal === value || (newVal !== newVal && value !== value)) {
  62885. return
  62886. }
  62887. /* eslint-enable no-self-compare */
  62888. if (customSetter) {
  62889. customSetter();
  62890. }
  62891. // #7981: for accessor properties without setter
  62892. if (getter && !setter) { return }
  62893. if (setter) {
  62894. setter.call(obj, newVal);
  62895. } else {
  62896. val = newVal;
  62897. }
  62898. childOb = !shallow && observe(newVal);
  62899. dep.notify();
  62900. }
  62901. });
  62902. }
  62903. /**
  62904. * Set a property on an object. Adds the new property and
  62905. * triggers change notification if the property doesn't
  62906. * already exist.
  62907. */
  62908. function set (target, key, val) {
  62909. if (isUndef(target) || isPrimitive(target)
  62910. ) {
  62911. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  62912. }
  62913. if (Array.isArray(target) && isValidArrayIndex(key)) {
  62914. target.length = Math.max(target.length, key);
  62915. target.splice(key, 1, val);
  62916. return val
  62917. }
  62918. if (key in target && !(key in Object.prototype)) {
  62919. target[key] = val;
  62920. return val
  62921. }
  62922. var ob = (target).__ob__;
  62923. if (target._isVue || (ob && ob.vmCount)) {
  62924. warn(
  62925. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  62926. 'at runtime - declare it upfront in the data option.'
  62927. );
  62928. return val
  62929. }
  62930. if (!ob) {
  62931. target[key] = val;
  62932. return val
  62933. }
  62934. defineReactive$$1(ob.value, key, val);
  62935. ob.dep.notify();
  62936. return val
  62937. }
  62938. /**
  62939. * Delete a property and trigger change if necessary.
  62940. */
  62941. function del (target, key) {
  62942. if (isUndef(target) || isPrimitive(target)
  62943. ) {
  62944. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  62945. }
  62946. if (Array.isArray(target) && isValidArrayIndex(key)) {
  62947. target.splice(key, 1);
  62948. return
  62949. }
  62950. var ob = (target).__ob__;
  62951. if (target._isVue || (ob && ob.vmCount)) {
  62952. warn(
  62953. 'Avoid deleting properties on a Vue instance or its root $data ' +
  62954. '- just set it to null.'
  62955. );
  62956. return
  62957. }
  62958. if (!hasOwn(target, key)) {
  62959. return
  62960. }
  62961. delete target[key];
  62962. if (!ob) {
  62963. return
  62964. }
  62965. ob.dep.notify();
  62966. }
  62967. /**
  62968. * Collect dependencies on array elements when the array is touched, since
  62969. * we cannot intercept array element access like property getters.
  62970. */
  62971. function dependArray (value) {
  62972. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  62973. e = value[i];
  62974. e && e.__ob__ && e.__ob__.dep.depend();
  62975. if (Array.isArray(e)) {
  62976. dependArray(e);
  62977. }
  62978. }
  62979. }
  62980. /* */
  62981. /**
  62982. * Option overwriting strategies are functions that handle
  62983. * how to merge a parent option value and a child option
  62984. * value into the final value.
  62985. */
  62986. var strats = config.optionMergeStrategies;
  62987. /**
  62988. * Options with restrictions
  62989. */
  62990. {
  62991. strats.el = strats.propsData = function (parent, child, vm, key) {
  62992. if (!vm) {
  62993. warn(
  62994. "option \"" + key + "\" can only be used during instance " +
  62995. 'creation with the `new` keyword.'
  62996. );
  62997. }
  62998. return defaultStrat(parent, child)
  62999. };
  63000. }
  63001. /**
  63002. * Helper that recursively merges two data objects together.
  63003. */
  63004. function mergeData (to, from) {
  63005. if (!from) { return to }
  63006. var key, toVal, fromVal;
  63007. var keys = hasSymbol
  63008. ? Reflect.ownKeys(from)
  63009. : Object.keys(from);
  63010. for (var i = 0; i < keys.length; i++) {
  63011. key = keys[i];
  63012. // in case the object is already observed...
  63013. if (key === '__ob__') { continue }
  63014. toVal = to[key];
  63015. fromVal = from[key];
  63016. if (!hasOwn(to, key)) {
  63017. set(to, key, fromVal);
  63018. } else if (
  63019. toVal !== fromVal &&
  63020. isPlainObject(toVal) &&
  63021. isPlainObject(fromVal)
  63022. ) {
  63023. mergeData(toVal, fromVal);
  63024. }
  63025. }
  63026. return to
  63027. }
  63028. /**
  63029. * Data
  63030. */
  63031. function mergeDataOrFn (
  63032. parentVal,
  63033. childVal,
  63034. vm
  63035. ) {
  63036. if (!vm) {
  63037. // in a Vue.extend merge, both should be functions
  63038. if (!childVal) {
  63039. return parentVal
  63040. }
  63041. if (!parentVal) {
  63042. return childVal
  63043. }
  63044. // when parentVal & childVal are both present,
  63045. // we need to return a function that returns the
  63046. // merged result of both functions... no need to
  63047. // check if parentVal is a function here because
  63048. // it has to be a function to pass previous merges.
  63049. return function mergedDataFn () {
  63050. return mergeData(
  63051. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  63052. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  63053. )
  63054. }
  63055. } else {
  63056. return function mergedInstanceDataFn () {
  63057. // instance merge
  63058. var instanceData = typeof childVal === 'function'
  63059. ? childVal.call(vm, vm)
  63060. : childVal;
  63061. var defaultData = typeof parentVal === 'function'
  63062. ? parentVal.call(vm, vm)
  63063. : parentVal;
  63064. if (instanceData) {
  63065. return mergeData(instanceData, defaultData)
  63066. } else {
  63067. return defaultData
  63068. }
  63069. }
  63070. }
  63071. }
  63072. strats.data = function (
  63073. parentVal,
  63074. childVal,
  63075. vm
  63076. ) {
  63077. if (!vm) {
  63078. if (childVal && typeof childVal !== 'function') {
  63079. warn(
  63080. 'The "data" option should be a function ' +
  63081. 'that returns a per-instance value in component ' +
  63082. 'definitions.',
  63083. vm
  63084. );
  63085. return parentVal
  63086. }
  63087. return mergeDataOrFn(parentVal, childVal)
  63088. }
  63089. return mergeDataOrFn(parentVal, childVal, vm)
  63090. };
  63091. /**
  63092. * Hooks and props are merged as arrays.
  63093. */
  63094. function mergeHook (
  63095. parentVal,
  63096. childVal
  63097. ) {
  63098. var res = childVal
  63099. ? parentVal
  63100. ? parentVal.concat(childVal)
  63101. : Array.isArray(childVal)
  63102. ? childVal
  63103. : [childVal]
  63104. : parentVal;
  63105. return res
  63106. ? dedupeHooks(res)
  63107. : res
  63108. }
  63109. function dedupeHooks (hooks) {
  63110. var res = [];
  63111. for (var i = 0; i < hooks.length; i++) {
  63112. if (res.indexOf(hooks[i]) === -1) {
  63113. res.push(hooks[i]);
  63114. }
  63115. }
  63116. return res
  63117. }
  63118. LIFECYCLE_HOOKS.forEach(function (hook) {
  63119. strats[hook] = mergeHook;
  63120. });
  63121. /**
  63122. * Assets
  63123. *
  63124. * When a vm is present (instance creation), we need to do
  63125. * a three-way merge between constructor options, instance
  63126. * options and parent options.
  63127. */
  63128. function mergeAssets (
  63129. parentVal,
  63130. childVal,
  63131. vm,
  63132. key
  63133. ) {
  63134. var res = Object.create(parentVal || null);
  63135. if (childVal) {
  63136. assertObjectType(key, childVal, vm);
  63137. return extend(res, childVal)
  63138. } else {
  63139. return res
  63140. }
  63141. }
  63142. ASSET_TYPES.forEach(function (type) {
  63143. strats[type + 's'] = mergeAssets;
  63144. });
  63145. /**
  63146. * Watchers.
  63147. *
  63148. * Watchers hashes should not overwrite one
  63149. * another, so we merge them as arrays.
  63150. */
  63151. strats.watch = function (
  63152. parentVal,
  63153. childVal,
  63154. vm,
  63155. key
  63156. ) {
  63157. // work around Firefox's Object.prototype.watch...
  63158. if (parentVal === nativeWatch) { parentVal = undefined; }
  63159. if (childVal === nativeWatch) { childVal = undefined; }
  63160. /* istanbul ignore if */
  63161. if (!childVal) { return Object.create(parentVal || null) }
  63162. {
  63163. assertObjectType(key, childVal, vm);
  63164. }
  63165. if (!parentVal) { return childVal }
  63166. var ret = {};
  63167. extend(ret, parentVal);
  63168. for (var key$1 in childVal) {
  63169. var parent = ret[key$1];
  63170. var child = childVal[key$1];
  63171. if (parent && !Array.isArray(parent)) {
  63172. parent = [parent];
  63173. }
  63174. ret[key$1] = parent
  63175. ? parent.concat(child)
  63176. : Array.isArray(child) ? child : [child];
  63177. }
  63178. return ret
  63179. };
  63180. /**
  63181. * Other object hashes.
  63182. */
  63183. strats.props =
  63184. strats.methods =
  63185. strats.inject =
  63186. strats.computed = function (
  63187. parentVal,
  63188. childVal,
  63189. vm,
  63190. key
  63191. ) {
  63192. if (childVal && "development" !== 'production') {
  63193. assertObjectType(key, childVal, vm);
  63194. }
  63195. if (!parentVal) { return childVal }
  63196. var ret = Object.create(null);
  63197. extend(ret, parentVal);
  63198. if (childVal) { extend(ret, childVal); }
  63199. return ret
  63200. };
  63201. strats.provide = mergeDataOrFn;
  63202. /**
  63203. * Default strategy.
  63204. */
  63205. var defaultStrat = function (parentVal, childVal) {
  63206. return childVal === undefined
  63207. ? parentVal
  63208. : childVal
  63209. };
  63210. /**
  63211. * Validate component names
  63212. */
  63213. function checkComponents (options) {
  63214. for (var key in options.components) {
  63215. validateComponentName(key);
  63216. }
  63217. }
  63218. function validateComponentName (name) {
  63219. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  63220. warn(
  63221. 'Invalid component name: "' + name + '". Component names ' +
  63222. 'should conform to valid custom element name in html5 specification.'
  63223. );
  63224. }
  63225. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  63226. warn(
  63227. 'Do not use built-in or reserved HTML elements as component ' +
  63228. 'id: ' + name
  63229. );
  63230. }
  63231. }
  63232. /**
  63233. * Ensure all props option syntax are normalized into the
  63234. * Object-based format.
  63235. */
  63236. function normalizeProps (options, vm) {
  63237. var props = options.props;
  63238. if (!props) { return }
  63239. var res = {};
  63240. var i, val, name;
  63241. if (Array.isArray(props)) {
  63242. i = props.length;
  63243. while (i--) {
  63244. val = props[i];
  63245. if (typeof val === 'string') {
  63246. name = camelize(val);
  63247. res[name] = { type: null };
  63248. } else {
  63249. warn('props must be strings when using array syntax.');
  63250. }
  63251. }
  63252. } else if (isPlainObject(props)) {
  63253. for (var key in props) {
  63254. val = props[key];
  63255. name = camelize(key);
  63256. res[name] = isPlainObject(val)
  63257. ? val
  63258. : { type: val };
  63259. }
  63260. } else {
  63261. warn(
  63262. "Invalid value for option \"props\": expected an Array or an Object, " +
  63263. "but got " + (toRawType(props)) + ".",
  63264. vm
  63265. );
  63266. }
  63267. options.props = res;
  63268. }
  63269. /**
  63270. * Normalize all injections into Object-based format
  63271. */
  63272. function normalizeInject (options, vm) {
  63273. var inject = options.inject;
  63274. if (!inject) { return }
  63275. var normalized = options.inject = {};
  63276. if (Array.isArray(inject)) {
  63277. for (var i = 0; i < inject.length; i++) {
  63278. normalized[inject[i]] = { from: inject[i] };
  63279. }
  63280. } else if (isPlainObject(inject)) {
  63281. for (var key in inject) {
  63282. var val = inject[key];
  63283. normalized[key] = isPlainObject(val)
  63284. ? extend({ from: key }, val)
  63285. : { from: val };
  63286. }
  63287. } else {
  63288. warn(
  63289. "Invalid value for option \"inject\": expected an Array or an Object, " +
  63290. "but got " + (toRawType(inject)) + ".",
  63291. vm
  63292. );
  63293. }
  63294. }
  63295. /**
  63296. * Normalize raw function directives into object format.
  63297. */
  63298. function normalizeDirectives (options) {
  63299. var dirs = options.directives;
  63300. if (dirs) {
  63301. for (var key in dirs) {
  63302. var def$$1 = dirs[key];
  63303. if (typeof def$$1 === 'function') {
  63304. dirs[key] = { bind: def$$1, update: def$$1 };
  63305. }
  63306. }
  63307. }
  63308. }
  63309. function assertObjectType (name, value, vm) {
  63310. if (!isPlainObject(value)) {
  63311. warn(
  63312. "Invalid value for option \"" + name + "\": expected an Object, " +
  63313. "but got " + (toRawType(value)) + ".",
  63314. vm
  63315. );
  63316. }
  63317. }
  63318. /**
  63319. * Merge two option objects into a new one.
  63320. * Core utility used in both instantiation and inheritance.
  63321. */
  63322. function mergeOptions (
  63323. parent,
  63324. child,
  63325. vm
  63326. ) {
  63327. {
  63328. checkComponents(child);
  63329. }
  63330. if (typeof child === 'function') {
  63331. child = child.options;
  63332. }
  63333. normalizeProps(child, vm);
  63334. normalizeInject(child, vm);
  63335. normalizeDirectives(child);
  63336. // Apply extends and mixins on the child options,
  63337. // but only if it is a raw options object that isn't
  63338. // the result of another mergeOptions call.
  63339. // Only merged options has the _base property.
  63340. if (!child._base) {
  63341. if (child.extends) {
  63342. parent = mergeOptions(parent, child.extends, vm);
  63343. }
  63344. if (child.mixins) {
  63345. for (var i = 0, l = child.mixins.length; i < l; i++) {
  63346. parent = mergeOptions(parent, child.mixins[i], vm);
  63347. }
  63348. }
  63349. }
  63350. var options = {};
  63351. var key;
  63352. for (key in parent) {
  63353. mergeField(key);
  63354. }
  63355. for (key in child) {
  63356. if (!hasOwn(parent, key)) {
  63357. mergeField(key);
  63358. }
  63359. }
  63360. function mergeField (key) {
  63361. var strat = strats[key] || defaultStrat;
  63362. options[key] = strat(parent[key], child[key], vm, key);
  63363. }
  63364. return options
  63365. }
  63366. /**
  63367. * Resolve an asset.
  63368. * This function is used because child instances need access
  63369. * to assets defined in its ancestor chain.
  63370. */
  63371. function resolveAsset (
  63372. options,
  63373. type,
  63374. id,
  63375. warnMissing
  63376. ) {
  63377. /* istanbul ignore if */
  63378. if (typeof id !== 'string') {
  63379. return
  63380. }
  63381. var assets = options[type];
  63382. // check local registration variations first
  63383. if (hasOwn(assets, id)) { return assets[id] }
  63384. var camelizedId = camelize(id);
  63385. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  63386. var PascalCaseId = capitalize(camelizedId);
  63387. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  63388. // fallback to prototype chain
  63389. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  63390. if (warnMissing && !res) {
  63391. warn(
  63392. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  63393. options
  63394. );
  63395. }
  63396. return res
  63397. }
  63398. /* */
  63399. function validateProp (
  63400. key,
  63401. propOptions,
  63402. propsData,
  63403. vm
  63404. ) {
  63405. var prop = propOptions[key];
  63406. var absent = !hasOwn(propsData, key);
  63407. var value = propsData[key];
  63408. // boolean casting
  63409. var booleanIndex = getTypeIndex(Boolean, prop.type);
  63410. if (booleanIndex > -1) {
  63411. if (absent && !hasOwn(prop, 'default')) {
  63412. value = false;
  63413. } else if (value === '' || value === hyphenate(key)) {
  63414. // only cast empty string / same name to boolean if
  63415. // boolean has higher priority
  63416. var stringIndex = getTypeIndex(String, prop.type);
  63417. if (stringIndex < 0 || booleanIndex < stringIndex) {
  63418. value = true;
  63419. }
  63420. }
  63421. }
  63422. // check default value
  63423. if (value === undefined) {
  63424. value = getPropDefaultValue(vm, prop, key);
  63425. // since the default value is a fresh copy,
  63426. // make sure to observe it.
  63427. var prevShouldObserve = shouldObserve;
  63428. toggleObserving(true);
  63429. observe(value);
  63430. toggleObserving(prevShouldObserve);
  63431. }
  63432. {
  63433. assertProp(prop, key, value, vm, absent);
  63434. }
  63435. return value
  63436. }
  63437. /**
  63438. * Get the default value of a prop.
  63439. */
  63440. function getPropDefaultValue (vm, prop, key) {
  63441. // no default, return undefined
  63442. if (!hasOwn(prop, 'default')) {
  63443. return undefined
  63444. }
  63445. var def = prop.default;
  63446. // warn against non-factory defaults for Object & Array
  63447. if (isObject(def)) {
  63448. warn(
  63449. 'Invalid default value for prop "' + key + '": ' +
  63450. 'Props with type Object/Array must use a factory function ' +
  63451. 'to return the default value.',
  63452. vm
  63453. );
  63454. }
  63455. // the raw prop value was also undefined from previous render,
  63456. // return previous default value to avoid unnecessary watcher trigger
  63457. if (vm && vm.$options.propsData &&
  63458. vm.$options.propsData[key] === undefined &&
  63459. vm._props[key] !== undefined
  63460. ) {
  63461. return vm._props[key]
  63462. }
  63463. // call factory function for non-Function types
  63464. // a value is Function if its prototype is function even across different execution context
  63465. return typeof def === 'function' && getType(prop.type) !== 'Function'
  63466. ? def.call(vm)
  63467. : def
  63468. }
  63469. /**
  63470. * Assert whether a prop is valid.
  63471. */
  63472. function assertProp (
  63473. prop,
  63474. name,
  63475. value,
  63476. vm,
  63477. absent
  63478. ) {
  63479. if (prop.required && absent) {
  63480. warn(
  63481. 'Missing required prop: "' + name + '"',
  63482. vm
  63483. );
  63484. return
  63485. }
  63486. if (value == null && !prop.required) {
  63487. return
  63488. }
  63489. var type = prop.type;
  63490. var valid = !type || type === true;
  63491. var expectedTypes = [];
  63492. if (type) {
  63493. if (!Array.isArray(type)) {
  63494. type = [type];
  63495. }
  63496. for (var i = 0; i < type.length && !valid; i++) {
  63497. var assertedType = assertType(value, type[i]);
  63498. expectedTypes.push(assertedType.expectedType || '');
  63499. valid = assertedType.valid;
  63500. }
  63501. }
  63502. if (!valid) {
  63503. warn(
  63504. getInvalidTypeMessage(name, value, expectedTypes),
  63505. vm
  63506. );
  63507. return
  63508. }
  63509. var validator = prop.validator;
  63510. if (validator) {
  63511. if (!validator(value)) {
  63512. warn(
  63513. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  63514. vm
  63515. );
  63516. }
  63517. }
  63518. }
  63519. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  63520. function assertType (value, type) {
  63521. var valid;
  63522. var expectedType = getType(type);
  63523. if (simpleCheckRE.test(expectedType)) {
  63524. var t = typeof value;
  63525. valid = t === expectedType.toLowerCase();
  63526. // for primitive wrapper objects
  63527. if (!valid && t === 'object') {
  63528. valid = value instanceof type;
  63529. }
  63530. } else if (expectedType === 'Object') {
  63531. valid = isPlainObject(value);
  63532. } else if (expectedType === 'Array') {
  63533. valid = Array.isArray(value);
  63534. } else {
  63535. valid = value instanceof type;
  63536. }
  63537. return {
  63538. valid: valid,
  63539. expectedType: expectedType
  63540. }
  63541. }
  63542. /**
  63543. * Use function string name to check built-in types,
  63544. * because a simple equality check will fail when running
  63545. * across different vms / iframes.
  63546. */
  63547. function getType (fn) {
  63548. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  63549. return match ? match[1] : ''
  63550. }
  63551. function isSameType (a, b) {
  63552. return getType(a) === getType(b)
  63553. }
  63554. function getTypeIndex (type, expectedTypes) {
  63555. if (!Array.isArray(expectedTypes)) {
  63556. return isSameType(expectedTypes, type) ? 0 : -1
  63557. }
  63558. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  63559. if (isSameType(expectedTypes[i], type)) {
  63560. return i
  63561. }
  63562. }
  63563. return -1
  63564. }
  63565. function getInvalidTypeMessage (name, value, expectedTypes) {
  63566. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  63567. " Expected " + (expectedTypes.map(capitalize).join(', '));
  63568. var expectedType = expectedTypes[0];
  63569. var receivedType = toRawType(value);
  63570. var expectedValue = styleValue(value, expectedType);
  63571. var receivedValue = styleValue(value, receivedType);
  63572. // check if we need to specify expected value
  63573. if (expectedTypes.length === 1 &&
  63574. isExplicable(expectedType) &&
  63575. !isBoolean(expectedType, receivedType)) {
  63576. message += " with value " + expectedValue;
  63577. }
  63578. message += ", got " + receivedType + " ";
  63579. // check if we need to specify received value
  63580. if (isExplicable(receivedType)) {
  63581. message += "with value " + receivedValue + ".";
  63582. }
  63583. return message
  63584. }
  63585. function styleValue (value, type) {
  63586. if (type === 'String') {
  63587. return ("\"" + value + "\"")
  63588. } else if (type === 'Number') {
  63589. return ("" + (Number(value)))
  63590. } else {
  63591. return ("" + value)
  63592. }
  63593. }
  63594. function isExplicable (value) {
  63595. var explicitTypes = ['string', 'number', 'boolean'];
  63596. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  63597. }
  63598. function isBoolean () {
  63599. var args = [], len = arguments.length;
  63600. while ( len-- ) args[ len ] = arguments[ len ];
  63601. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  63602. }
  63603. /* */
  63604. function handleError (err, vm, info) {
  63605. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  63606. // See: https://github.com/vuejs/vuex/issues/1505
  63607. pushTarget();
  63608. try {
  63609. if (vm) {
  63610. var cur = vm;
  63611. while ((cur = cur.$parent)) {
  63612. var hooks = cur.$options.errorCaptured;
  63613. if (hooks) {
  63614. for (var i = 0; i < hooks.length; i++) {
  63615. try {
  63616. var capture = hooks[i].call(cur, err, vm, info) === false;
  63617. if (capture) { return }
  63618. } catch (e) {
  63619. globalHandleError(e, cur, 'errorCaptured hook');
  63620. }
  63621. }
  63622. }
  63623. }
  63624. }
  63625. globalHandleError(err, vm, info);
  63626. } finally {
  63627. popTarget();
  63628. }
  63629. }
  63630. function invokeWithErrorHandling (
  63631. handler,
  63632. context,
  63633. args,
  63634. vm,
  63635. info
  63636. ) {
  63637. var res;
  63638. try {
  63639. res = args ? handler.apply(context, args) : handler.call(context);
  63640. if (res && !res._isVue && isPromise(res) && !res._handled) {
  63641. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  63642. // issue #9511
  63643. // avoid catch triggering multiple times when nested calls
  63644. res._handled = true;
  63645. }
  63646. } catch (e) {
  63647. handleError(e, vm, info);
  63648. }
  63649. return res
  63650. }
  63651. function globalHandleError (err, vm, info) {
  63652. if (config.errorHandler) {
  63653. try {
  63654. return config.errorHandler.call(null, err, vm, info)
  63655. } catch (e) {
  63656. // if the user intentionally throws the original error in the handler,
  63657. // do not log it twice
  63658. if (e !== err) {
  63659. logError(e, null, 'config.errorHandler');
  63660. }
  63661. }
  63662. }
  63663. logError(err, vm, info);
  63664. }
  63665. function logError (err, vm, info) {
  63666. {
  63667. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  63668. }
  63669. /* istanbul ignore else */
  63670. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  63671. console.error(err);
  63672. } else {
  63673. throw err
  63674. }
  63675. }
  63676. /* */
  63677. var isUsingMicroTask = false;
  63678. var callbacks = [];
  63679. var pending = false;
  63680. function flushCallbacks () {
  63681. pending = false;
  63682. var copies = callbacks.slice(0);
  63683. callbacks.length = 0;
  63684. for (var i = 0; i < copies.length; i++) {
  63685. copies[i]();
  63686. }
  63687. }
  63688. // Here we have async deferring wrappers using microtasks.
  63689. // In 2.5 we used (macro) tasks (in combination with microtasks).
  63690. // However, it has subtle problems when state is changed right before repaint
  63691. // (e.g. #6813, out-in transitions).
  63692. // Also, using (macro) tasks in event handler would cause some weird behaviors
  63693. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  63694. // So we now use microtasks everywhere, again.
  63695. // A major drawback of this tradeoff is that there are some scenarios
  63696. // where microtasks have too high a priority and fire in between supposedly
  63697. // sequential events (e.g. #4521, #6690, which have workarounds)
  63698. // or even between bubbling of the same event (#6566).
  63699. var timerFunc;
  63700. // The nextTick behavior leverages the microtask queue, which can be accessed
  63701. // via either native Promise.then or MutationObserver.
  63702. // MutationObserver has wider support, however it is seriously bugged in
  63703. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  63704. // completely stops working after triggering a few times... so, if native
  63705. // Promise is available, we will use it:
  63706. /* istanbul ignore next, $flow-disable-line */
  63707. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  63708. var p = Promise.resolve();
  63709. timerFunc = function () {
  63710. p.then(flushCallbacks);
  63711. // In problematic UIWebViews, Promise.then doesn't completely break, but
  63712. // it can get stuck in a weird state where callbacks are pushed into the
  63713. // microtask queue but the queue isn't being flushed, until the browser
  63714. // needs to do some other work, e.g. handle a timer. Therefore we can
  63715. // "force" the microtask queue to be flushed by adding an empty timer.
  63716. if (isIOS) { setTimeout(noop); }
  63717. };
  63718. isUsingMicroTask = true;
  63719. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  63720. isNative(MutationObserver) ||
  63721. // PhantomJS and iOS 7.x
  63722. MutationObserver.toString() === '[object MutationObserverConstructor]'
  63723. )) {
  63724. // Use MutationObserver where native Promise is not available,
  63725. // e.g. PhantomJS, iOS7, Android 4.4
  63726. // (#6466 MutationObserver is unreliable in IE11)
  63727. var counter = 1;
  63728. var observer = new MutationObserver(flushCallbacks);
  63729. var textNode = document.createTextNode(String(counter));
  63730. observer.observe(textNode, {
  63731. characterData: true
  63732. });
  63733. timerFunc = function () {
  63734. counter = (counter + 1) % 2;
  63735. textNode.data = String(counter);
  63736. };
  63737. isUsingMicroTask = true;
  63738. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  63739. // Fallback to setImmediate.
  63740. // Technically it leverages the (macro) task queue,
  63741. // but it is still a better choice than setTimeout.
  63742. timerFunc = function () {
  63743. setImmediate(flushCallbacks);
  63744. };
  63745. } else {
  63746. // Fallback to setTimeout.
  63747. timerFunc = function () {
  63748. setTimeout(flushCallbacks, 0);
  63749. };
  63750. }
  63751. function nextTick (cb, ctx) {
  63752. var _resolve;
  63753. callbacks.push(function () {
  63754. if (cb) {
  63755. try {
  63756. cb.call(ctx);
  63757. } catch (e) {
  63758. handleError(e, ctx, 'nextTick');
  63759. }
  63760. } else if (_resolve) {
  63761. _resolve(ctx);
  63762. }
  63763. });
  63764. if (!pending) {
  63765. pending = true;
  63766. timerFunc();
  63767. }
  63768. // $flow-disable-line
  63769. if (!cb && typeof Promise !== 'undefined') {
  63770. return new Promise(function (resolve) {
  63771. _resolve = resolve;
  63772. })
  63773. }
  63774. }
  63775. /* */
  63776. var mark;
  63777. var measure;
  63778. {
  63779. var perf = inBrowser && window.performance;
  63780. /* istanbul ignore if */
  63781. if (
  63782. perf &&
  63783. perf.mark &&
  63784. perf.measure &&
  63785. perf.clearMarks &&
  63786. perf.clearMeasures
  63787. ) {
  63788. mark = function (tag) { return perf.mark(tag); };
  63789. measure = function (name, startTag, endTag) {
  63790. perf.measure(name, startTag, endTag);
  63791. perf.clearMarks(startTag);
  63792. perf.clearMarks(endTag);
  63793. // perf.clearMeasures(name)
  63794. };
  63795. }
  63796. }
  63797. /* not type checking this file because flow doesn't play well with Proxy */
  63798. var initProxy;
  63799. {
  63800. var allowedGlobals = makeMap(
  63801. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  63802. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  63803. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  63804. 'require' // for Webpack/Browserify
  63805. );
  63806. var warnNonPresent = function (target, key) {
  63807. warn(
  63808. "Property or method \"" + key + "\" is not defined on the instance but " +
  63809. 'referenced during render. Make sure that this property is reactive, ' +
  63810. 'either in the data option, or for class-based components, by ' +
  63811. 'initializing the property. ' +
  63812. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  63813. target
  63814. );
  63815. };
  63816. var warnReservedPrefix = function (target, key) {
  63817. warn(
  63818. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  63819. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  63820. 'prevent conflicts with Vue internals. ' +
  63821. 'See: https://vuejs.org/v2/api/#data',
  63822. target
  63823. );
  63824. };
  63825. var hasProxy =
  63826. typeof Proxy !== 'undefined' && isNative(Proxy);
  63827. if (hasProxy) {
  63828. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  63829. config.keyCodes = new Proxy(config.keyCodes, {
  63830. set: function set (target, key, value) {
  63831. if (isBuiltInModifier(key)) {
  63832. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  63833. return false
  63834. } else {
  63835. target[key] = value;
  63836. return true
  63837. }
  63838. }
  63839. });
  63840. }
  63841. var hasHandler = {
  63842. has: function has (target, key) {
  63843. var has = key in target;
  63844. var isAllowed = allowedGlobals(key) ||
  63845. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  63846. if (!has && !isAllowed) {
  63847. if (key in target.$data) { warnReservedPrefix(target, key); }
  63848. else { warnNonPresent(target, key); }
  63849. }
  63850. return has || !isAllowed
  63851. }
  63852. };
  63853. var getHandler = {
  63854. get: function get (target, key) {
  63855. if (typeof key === 'string' && !(key in target)) {
  63856. if (key in target.$data) { warnReservedPrefix(target, key); }
  63857. else { warnNonPresent(target, key); }
  63858. }
  63859. return target[key]
  63860. }
  63861. };
  63862. initProxy = function initProxy (vm) {
  63863. if (hasProxy) {
  63864. // determine which proxy handler to use
  63865. var options = vm.$options;
  63866. var handlers = options.render && options.render._withStripped
  63867. ? getHandler
  63868. : hasHandler;
  63869. vm._renderProxy = new Proxy(vm, handlers);
  63870. } else {
  63871. vm._renderProxy = vm;
  63872. }
  63873. };
  63874. }
  63875. /* */
  63876. var seenObjects = new _Set();
  63877. /**
  63878. * Recursively traverse an object to evoke all converted
  63879. * getters, so that every nested property inside the object
  63880. * is collected as a "deep" dependency.
  63881. */
  63882. function traverse (val) {
  63883. _traverse(val, seenObjects);
  63884. seenObjects.clear();
  63885. }
  63886. function _traverse (val, seen) {
  63887. var i, keys;
  63888. var isA = Array.isArray(val);
  63889. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  63890. return
  63891. }
  63892. if (val.__ob__) {
  63893. var depId = val.__ob__.dep.id;
  63894. if (seen.has(depId)) {
  63895. return
  63896. }
  63897. seen.add(depId);
  63898. }
  63899. if (isA) {
  63900. i = val.length;
  63901. while (i--) { _traverse(val[i], seen); }
  63902. } else {
  63903. keys = Object.keys(val);
  63904. i = keys.length;
  63905. while (i--) { _traverse(val[keys[i]], seen); }
  63906. }
  63907. }
  63908. /* */
  63909. var normalizeEvent = cached(function (name) {
  63910. var passive = name.charAt(0) === '&';
  63911. name = passive ? name.slice(1) : name;
  63912. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  63913. name = once$$1 ? name.slice(1) : name;
  63914. var capture = name.charAt(0) === '!';
  63915. name = capture ? name.slice(1) : name;
  63916. return {
  63917. name: name,
  63918. once: once$$1,
  63919. capture: capture,
  63920. passive: passive
  63921. }
  63922. });
  63923. function createFnInvoker (fns, vm) {
  63924. function invoker () {
  63925. var arguments$1 = arguments;
  63926. var fns = invoker.fns;
  63927. if (Array.isArray(fns)) {
  63928. var cloned = fns.slice();
  63929. for (var i = 0; i < cloned.length; i++) {
  63930. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  63931. }
  63932. } else {
  63933. // return handler return value for single handlers
  63934. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  63935. }
  63936. }
  63937. invoker.fns = fns;
  63938. return invoker
  63939. }
  63940. function updateListeners (
  63941. on,
  63942. oldOn,
  63943. add,
  63944. remove$$1,
  63945. createOnceHandler,
  63946. vm
  63947. ) {
  63948. var name, def$$1, cur, old, event;
  63949. for (name in on) {
  63950. def$$1 = cur = on[name];
  63951. old = oldOn[name];
  63952. event = normalizeEvent(name);
  63953. if (isUndef(cur)) {
  63954. warn(
  63955. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  63956. vm
  63957. );
  63958. } else if (isUndef(old)) {
  63959. if (isUndef(cur.fns)) {
  63960. cur = on[name] = createFnInvoker(cur, vm);
  63961. }
  63962. if (isTrue(event.once)) {
  63963. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  63964. }
  63965. add(event.name, cur, event.capture, event.passive, event.params);
  63966. } else if (cur !== old) {
  63967. old.fns = cur;
  63968. on[name] = old;
  63969. }
  63970. }
  63971. for (name in oldOn) {
  63972. if (isUndef(on[name])) {
  63973. event = normalizeEvent(name);
  63974. remove$$1(event.name, oldOn[name], event.capture);
  63975. }
  63976. }
  63977. }
  63978. /* */
  63979. function mergeVNodeHook (def, hookKey, hook) {
  63980. if (def instanceof VNode) {
  63981. def = def.data.hook || (def.data.hook = {});
  63982. }
  63983. var invoker;
  63984. var oldHook = def[hookKey];
  63985. function wrappedHook () {
  63986. hook.apply(this, arguments);
  63987. // important: remove merged hook to ensure it's called only once
  63988. // and prevent memory leak
  63989. remove(invoker.fns, wrappedHook);
  63990. }
  63991. if (isUndef(oldHook)) {
  63992. // no existing hook
  63993. invoker = createFnInvoker([wrappedHook]);
  63994. } else {
  63995. /* istanbul ignore if */
  63996. if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {
  63997. // already a merged invoker
  63998. invoker = oldHook;
  63999. invoker.fns.push(wrappedHook);
  64000. } else {
  64001. // existing plain hook
  64002. invoker = createFnInvoker([oldHook, wrappedHook]);
  64003. }
  64004. }
  64005. invoker.merged = true;
  64006. def[hookKey] = invoker;
  64007. }
  64008. /* */
  64009. function extractPropsFromVNodeData (
  64010. data,
  64011. Ctor,
  64012. tag
  64013. ) {
  64014. // we are only extracting raw values here.
  64015. // validation and default values are handled in the child
  64016. // component itself.
  64017. var propOptions = Ctor.options.props;
  64018. if (isUndef(propOptions)) {
  64019. return
  64020. }
  64021. var res = {};
  64022. var attrs = data.attrs;
  64023. var props = data.props;
  64024. if (isDef(attrs) || isDef(props)) {
  64025. for (var key in propOptions) {
  64026. var altKey = hyphenate(key);
  64027. {
  64028. var keyInLowerCase = key.toLowerCase();
  64029. if (
  64030. key !== keyInLowerCase &&
  64031. attrs && hasOwn(attrs, keyInLowerCase)
  64032. ) {
  64033. tip(
  64034. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  64035. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  64036. " \"" + key + "\". " +
  64037. "Note that HTML attributes are case-insensitive and camelCased " +
  64038. "props need to use their kebab-case equivalents when using in-DOM " +
  64039. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  64040. );
  64041. }
  64042. }
  64043. checkProp(res, props, key, altKey, true) ||
  64044. checkProp(res, attrs, key, altKey, false);
  64045. }
  64046. }
  64047. return res
  64048. }
  64049. function checkProp (
  64050. res,
  64051. hash,
  64052. key,
  64053. altKey,
  64054. preserve
  64055. ) {
  64056. if (isDef(hash)) {
  64057. if (hasOwn(hash, key)) {
  64058. res[key] = hash[key];
  64059. if (!preserve) {
  64060. delete hash[key];
  64061. }
  64062. return true
  64063. } else if (hasOwn(hash, altKey)) {
  64064. res[key] = hash[altKey];
  64065. if (!preserve) {
  64066. delete hash[altKey];
  64067. }
  64068. return true
  64069. }
  64070. }
  64071. return false
  64072. }
  64073. /* */
  64074. // The template compiler attempts to minimize the need for normalization by
  64075. // statically analyzing the template at compile time.
  64076. //
  64077. // For plain HTML markup, normalization can be completely skipped because the
  64078. // generated render function is guaranteed to return Array<VNode>. There are
  64079. // two cases where extra normalization is needed:
  64080. // 1. When the children contains components - because a functional component
  64081. // may return an Array instead of a single root. In this case, just a simple
  64082. // normalization is needed - if any child is an Array, we flatten the whole
  64083. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  64084. // because functional components already normalize their own children.
  64085. function simpleNormalizeChildren (children) {
  64086. for (var i = 0; i < children.length; i++) {
  64087. if (Array.isArray(children[i])) {
  64088. return Array.prototype.concat.apply([], children)
  64089. }
  64090. }
  64091. return children
  64092. }
  64093. // 2. When the children contains constructs that always generated nested Arrays,
  64094. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  64095. // with hand-written render functions / JSX. In such cases a full normalization
  64096. // is needed to cater to all possible types of children values.
  64097. function normalizeChildren (children) {
  64098. return isPrimitive(children)
  64099. ? [createTextVNode(children)]
  64100. : Array.isArray(children)
  64101. ? normalizeArrayChildren(children)
  64102. : undefined
  64103. }
  64104. function isTextNode (node) {
  64105. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  64106. }
  64107. function normalizeArrayChildren (children, nestedIndex) {
  64108. var res = [];
  64109. var i, c, lastIndex, last;
  64110. for (i = 0; i < children.length; i++) {
  64111. c = children[i];
  64112. if (isUndef(c) || typeof c === 'boolean') { continue }
  64113. lastIndex = res.length - 1;
  64114. last = res[lastIndex];
  64115. // nested
  64116. if (Array.isArray(c)) {
  64117. if (c.length > 0) {
  64118. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  64119. // merge adjacent text nodes
  64120. if (isTextNode(c[0]) && isTextNode(last)) {
  64121. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  64122. c.shift();
  64123. }
  64124. res.push.apply(res, c);
  64125. }
  64126. } else if (isPrimitive(c)) {
  64127. if (isTextNode(last)) {
  64128. // merge adjacent text nodes
  64129. // this is necessary for SSR hydration because text nodes are
  64130. // essentially merged when rendered to HTML strings
  64131. res[lastIndex] = createTextVNode(last.text + c);
  64132. } else if (c !== '') {
  64133. // convert primitive to vnode
  64134. res.push(createTextVNode(c));
  64135. }
  64136. } else {
  64137. if (isTextNode(c) && isTextNode(last)) {
  64138. // merge adjacent text nodes
  64139. res[lastIndex] = createTextVNode(last.text + c.text);
  64140. } else {
  64141. // default key for nested array children (likely generated by v-for)
  64142. if (isTrue(children._isVList) &&
  64143. isDef(c.tag) &&
  64144. isUndef(c.key) &&
  64145. isDef(nestedIndex)) {
  64146. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  64147. }
  64148. res.push(c);
  64149. }
  64150. }
  64151. }
  64152. return res
  64153. }
  64154. /* */
  64155. function initProvide (vm) {
  64156. var provide = vm.$options.provide;
  64157. if (provide) {
  64158. vm._provided = typeof provide === 'function'
  64159. ? provide.call(vm)
  64160. : provide;
  64161. }
  64162. }
  64163. function initInjections (vm) {
  64164. var result = resolveInject(vm.$options.inject, vm);
  64165. if (result) {
  64166. toggleObserving(false);
  64167. Object.keys(result).forEach(function (key) {
  64168. /* istanbul ignore else */
  64169. {
  64170. defineReactive$$1(vm, key, result[key], function () {
  64171. warn(
  64172. "Avoid mutating an injected value directly since the changes will be " +
  64173. "overwritten whenever the provided component re-renders. " +
  64174. "injection being mutated: \"" + key + "\"",
  64175. vm
  64176. );
  64177. });
  64178. }
  64179. });
  64180. toggleObserving(true);
  64181. }
  64182. }
  64183. function resolveInject (inject, vm) {
  64184. if (inject) {
  64185. // inject is :any because flow is not smart enough to figure out cached
  64186. var result = Object.create(null);
  64187. var keys = hasSymbol
  64188. ? Reflect.ownKeys(inject)
  64189. : Object.keys(inject);
  64190. for (var i = 0; i < keys.length; i++) {
  64191. var key = keys[i];
  64192. // #6574 in case the inject object is observed...
  64193. if (key === '__ob__') { continue }
  64194. var provideKey = inject[key].from;
  64195. var source = vm;
  64196. while (source) {
  64197. if (source._provided && hasOwn(source._provided, provideKey)) {
  64198. result[key] = source._provided[provideKey];
  64199. break
  64200. }
  64201. source = source.$parent;
  64202. }
  64203. if (!source) {
  64204. if ('default' in inject[key]) {
  64205. var provideDefault = inject[key].default;
  64206. result[key] = typeof provideDefault === 'function'
  64207. ? provideDefault.call(vm)
  64208. : provideDefault;
  64209. } else {
  64210. warn(("Injection \"" + key + "\" not found"), vm);
  64211. }
  64212. }
  64213. }
  64214. return result
  64215. }
  64216. }
  64217. /* */
  64218. /**
  64219. * Runtime helper for resolving raw children VNodes into a slot object.
  64220. */
  64221. function resolveSlots (
  64222. children,
  64223. context
  64224. ) {
  64225. if (!children || !children.length) {
  64226. return {}
  64227. }
  64228. var slots = {};
  64229. for (var i = 0, l = children.length; i < l; i++) {
  64230. var child = children[i];
  64231. var data = child.data;
  64232. // remove slot attribute if the node is resolved as a Vue slot node
  64233. if (data && data.attrs && data.attrs.slot) {
  64234. delete data.attrs.slot;
  64235. }
  64236. // named slots should only be respected if the vnode was rendered in the
  64237. // same context.
  64238. if ((child.context === context || child.fnContext === context) &&
  64239. data && data.slot != null
  64240. ) {
  64241. var name = data.slot;
  64242. var slot = (slots[name] || (slots[name] = []));
  64243. if (child.tag === 'template') {
  64244. slot.push.apply(slot, child.children || []);
  64245. } else {
  64246. slot.push(child);
  64247. }
  64248. } else {
  64249. (slots.default || (slots.default = [])).push(child);
  64250. }
  64251. }
  64252. // ignore slots that contains only whitespace
  64253. for (var name$1 in slots) {
  64254. if (slots[name$1].every(isWhitespace)) {
  64255. delete slots[name$1];
  64256. }
  64257. }
  64258. return slots
  64259. }
  64260. function isWhitespace (node) {
  64261. return (node.isComment && !node.asyncFactory) || node.text === ' '
  64262. }
  64263. /* */
  64264. function normalizeScopedSlots (
  64265. slots,
  64266. normalSlots,
  64267. prevSlots
  64268. ) {
  64269. var res;
  64270. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  64271. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  64272. var key = slots && slots.$key;
  64273. if (!slots) {
  64274. res = {};
  64275. } else if (slots._normalized) {
  64276. // fast path 1: child component re-render only, parent did not change
  64277. return slots._normalized
  64278. } else if (
  64279. isStable &&
  64280. prevSlots &&
  64281. prevSlots !== emptyObject &&
  64282. key === prevSlots.$key &&
  64283. !hasNormalSlots &&
  64284. !prevSlots.$hasNormal
  64285. ) {
  64286. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  64287. // only need to normalize once
  64288. return prevSlots
  64289. } else {
  64290. res = {};
  64291. for (var key$1 in slots) {
  64292. if (slots[key$1] && key$1[0] !== '$') {
  64293. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  64294. }
  64295. }
  64296. }
  64297. // expose normal slots on scopedSlots
  64298. for (var key$2 in normalSlots) {
  64299. if (!(key$2 in res)) {
  64300. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  64301. }
  64302. }
  64303. // avoriaz seems to mock a non-extensible $scopedSlots object
  64304. // and when that is passed down this would cause an error
  64305. if (slots && Object.isExtensible(slots)) {
  64306. (slots)._normalized = res;
  64307. }
  64308. def(res, '$stable', isStable);
  64309. def(res, '$key', key);
  64310. def(res, '$hasNormal', hasNormalSlots);
  64311. return res
  64312. }
  64313. function normalizeScopedSlot(normalSlots, key, fn) {
  64314. var normalized = function () {
  64315. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  64316. res = res && typeof res === 'object' && !Array.isArray(res)
  64317. ? [res] // single vnode
  64318. : normalizeChildren(res);
  64319. return res && (
  64320. res.length === 0 ||
  64321. (res.length === 1 && res[0].isComment) // #9658
  64322. ) ? undefined
  64323. : res
  64324. };
  64325. // this is a slot using the new v-slot syntax without scope. although it is
  64326. // compiled as a scoped slot, render fn users would expect it to be present
  64327. // on this.$slots because the usage is semantically a normal slot.
  64328. if (fn.proxy) {
  64329. Object.defineProperty(normalSlots, key, {
  64330. get: normalized,
  64331. enumerable: true,
  64332. configurable: true
  64333. });
  64334. }
  64335. return normalized
  64336. }
  64337. function proxyNormalSlot(slots, key) {
  64338. return function () { return slots[key]; }
  64339. }
  64340. /* */
  64341. /**
  64342. * Runtime helper for rendering v-for lists.
  64343. */
  64344. function renderList (
  64345. val,
  64346. render
  64347. ) {
  64348. var ret, i, l, keys, key;
  64349. if (Array.isArray(val) || typeof val === 'string') {
  64350. ret = new Array(val.length);
  64351. for (i = 0, l = val.length; i < l; i++) {
  64352. ret[i] = render(val[i], i);
  64353. }
  64354. } else if (typeof val === 'number') {
  64355. ret = new Array(val);
  64356. for (i = 0; i < val; i++) {
  64357. ret[i] = render(i + 1, i);
  64358. }
  64359. } else if (isObject(val)) {
  64360. if (hasSymbol && val[Symbol.iterator]) {
  64361. ret = [];
  64362. var iterator = val[Symbol.iterator]();
  64363. var result = iterator.next();
  64364. while (!result.done) {
  64365. ret.push(render(result.value, ret.length));
  64366. result = iterator.next();
  64367. }
  64368. } else {
  64369. keys = Object.keys(val);
  64370. ret = new Array(keys.length);
  64371. for (i = 0, l = keys.length; i < l; i++) {
  64372. key = keys[i];
  64373. ret[i] = render(val[key], key, i);
  64374. }
  64375. }
  64376. }
  64377. if (!isDef(ret)) {
  64378. ret = [];
  64379. }
  64380. (ret)._isVList = true;
  64381. return ret
  64382. }
  64383. /* */
  64384. /**
  64385. * Runtime helper for rendering <slot>
  64386. */
  64387. function renderSlot (
  64388. name,
  64389. fallback,
  64390. props,
  64391. bindObject
  64392. ) {
  64393. var scopedSlotFn = this.$scopedSlots[name];
  64394. var nodes;
  64395. if (scopedSlotFn) { // scoped slot
  64396. props = props || {};
  64397. if (bindObject) {
  64398. if (!isObject(bindObject)) {
  64399. warn(
  64400. 'slot v-bind without argument expects an Object',
  64401. this
  64402. );
  64403. }
  64404. props = extend(extend({}, bindObject), props);
  64405. }
  64406. nodes = scopedSlotFn(props) || fallback;
  64407. } else {
  64408. nodes = this.$slots[name] || fallback;
  64409. }
  64410. var target = props && props.slot;
  64411. if (target) {
  64412. return this.$createElement('template', { slot: target }, nodes)
  64413. } else {
  64414. return nodes
  64415. }
  64416. }
  64417. /* */
  64418. /**
  64419. * Runtime helper for resolving filters
  64420. */
  64421. function resolveFilter (id) {
  64422. return resolveAsset(this.$options, 'filters', id, true) || identity
  64423. }
  64424. /* */
  64425. function isKeyNotMatch (expect, actual) {
  64426. if (Array.isArray(expect)) {
  64427. return expect.indexOf(actual) === -1
  64428. } else {
  64429. return expect !== actual
  64430. }
  64431. }
  64432. /**
  64433. * Runtime helper for checking keyCodes from config.
  64434. * exposed as Vue.prototype._k
  64435. * passing in eventKeyName as last argument separately for backwards compat
  64436. */
  64437. function checkKeyCodes (
  64438. eventKeyCode,
  64439. key,
  64440. builtInKeyCode,
  64441. eventKeyName,
  64442. builtInKeyName
  64443. ) {
  64444. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  64445. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  64446. return isKeyNotMatch(builtInKeyName, eventKeyName)
  64447. } else if (mappedKeyCode) {
  64448. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  64449. } else if (eventKeyName) {
  64450. return hyphenate(eventKeyName) !== key
  64451. }
  64452. }
  64453. /* */
  64454. /**
  64455. * Runtime helper for merging v-bind="object" into a VNode's data.
  64456. */
  64457. function bindObjectProps (
  64458. data,
  64459. tag,
  64460. value,
  64461. asProp,
  64462. isSync
  64463. ) {
  64464. if (value) {
  64465. if (!isObject(value)) {
  64466. warn(
  64467. 'v-bind without argument expects an Object or Array value',
  64468. this
  64469. );
  64470. } else {
  64471. if (Array.isArray(value)) {
  64472. value = toObject(value);
  64473. }
  64474. var hash;
  64475. var loop = function ( key ) {
  64476. if (
  64477. key === 'class' ||
  64478. key === 'style' ||
  64479. isReservedAttribute(key)
  64480. ) {
  64481. hash = data;
  64482. } else {
  64483. var type = data.attrs && data.attrs.type;
  64484. hash = asProp || config.mustUseProp(tag, type, key)
  64485. ? data.domProps || (data.domProps = {})
  64486. : data.attrs || (data.attrs = {});
  64487. }
  64488. var camelizedKey = camelize(key);
  64489. var hyphenatedKey = hyphenate(key);
  64490. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  64491. hash[key] = value[key];
  64492. if (isSync) {
  64493. var on = data.on || (data.on = {});
  64494. on[("update:" + key)] = function ($event) {
  64495. value[key] = $event;
  64496. };
  64497. }
  64498. }
  64499. };
  64500. for (var key in value) loop( key );
  64501. }
  64502. }
  64503. return data
  64504. }
  64505. /* */
  64506. /**
  64507. * Runtime helper for rendering static trees.
  64508. */
  64509. function renderStatic (
  64510. index,
  64511. isInFor
  64512. ) {
  64513. var cached = this._staticTrees || (this._staticTrees = []);
  64514. var tree = cached[index];
  64515. // if has already-rendered static tree and not inside v-for,
  64516. // we can reuse the same tree.
  64517. if (tree && !isInFor) {
  64518. return tree
  64519. }
  64520. // otherwise, render a fresh tree.
  64521. tree = cached[index] = this.$options.staticRenderFns[index].call(
  64522. this._renderProxy,
  64523. null,
  64524. this // for render fns generated for functional component templates
  64525. );
  64526. markStatic(tree, ("__static__" + index), false);
  64527. return tree
  64528. }
  64529. /**
  64530. * Runtime helper for v-once.
  64531. * Effectively it means marking the node as static with a unique key.
  64532. */
  64533. function markOnce (
  64534. tree,
  64535. index,
  64536. key
  64537. ) {
  64538. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  64539. return tree
  64540. }
  64541. function markStatic (
  64542. tree,
  64543. key,
  64544. isOnce
  64545. ) {
  64546. if (Array.isArray(tree)) {
  64547. for (var i = 0; i < tree.length; i++) {
  64548. if (tree[i] && typeof tree[i] !== 'string') {
  64549. markStaticNode(tree[i], (key + "_" + i), isOnce);
  64550. }
  64551. }
  64552. } else {
  64553. markStaticNode(tree, key, isOnce);
  64554. }
  64555. }
  64556. function markStaticNode (node, key, isOnce) {
  64557. node.isStatic = true;
  64558. node.key = key;
  64559. node.isOnce = isOnce;
  64560. }
  64561. /* */
  64562. function bindObjectListeners (data, value) {
  64563. if (value) {
  64564. if (!isPlainObject(value)) {
  64565. warn(
  64566. 'v-on without argument expects an Object value',
  64567. this
  64568. );
  64569. } else {
  64570. var on = data.on = data.on ? extend({}, data.on) : {};
  64571. for (var key in value) {
  64572. var existing = on[key];
  64573. var ours = value[key];
  64574. on[key] = existing ? [].concat(existing, ours) : ours;
  64575. }
  64576. }
  64577. }
  64578. return data
  64579. }
  64580. /* */
  64581. function resolveScopedSlots (
  64582. fns, // see flow/vnode
  64583. res,
  64584. // the following are added in 2.6
  64585. hasDynamicKeys,
  64586. contentHashKey
  64587. ) {
  64588. res = res || { $stable: !hasDynamicKeys };
  64589. for (var i = 0; i < fns.length; i++) {
  64590. var slot = fns[i];
  64591. if (Array.isArray(slot)) {
  64592. resolveScopedSlots(slot, res, hasDynamicKeys);
  64593. } else if (slot) {
  64594. // marker for reverse proxying v-slot without scope on this.$slots
  64595. if (slot.proxy) {
  64596. slot.fn.proxy = true;
  64597. }
  64598. res[slot.key] = slot.fn;
  64599. }
  64600. }
  64601. if (contentHashKey) {
  64602. (res).$key = contentHashKey;
  64603. }
  64604. return res
  64605. }
  64606. /* */
  64607. function bindDynamicKeys (baseObj, values) {
  64608. for (var i = 0; i < values.length; i += 2) {
  64609. var key = values[i];
  64610. if (typeof key === 'string' && key) {
  64611. baseObj[values[i]] = values[i + 1];
  64612. } else if (key !== '' && key !== null) {
  64613. // null is a special value for explicitly removing a binding
  64614. warn(
  64615. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  64616. this
  64617. );
  64618. }
  64619. }
  64620. return baseObj
  64621. }
  64622. // helper to dynamically append modifier runtime markers to event names.
  64623. // ensure only append when value is already string, otherwise it will be cast
  64624. // to string and cause the type check to miss.
  64625. function prependModifier (value, symbol) {
  64626. return typeof value === 'string' ? symbol + value : value
  64627. }
  64628. /* */
  64629. function installRenderHelpers (target) {
  64630. target._o = markOnce;
  64631. target._n = toNumber;
  64632. target._s = toString;
  64633. target._l = renderList;
  64634. target._t = renderSlot;
  64635. target._q = looseEqual;
  64636. target._i = looseIndexOf;
  64637. target._m = renderStatic;
  64638. target._f = resolveFilter;
  64639. target._k = checkKeyCodes;
  64640. target._b = bindObjectProps;
  64641. target._v = createTextVNode;
  64642. target._e = createEmptyVNode;
  64643. target._u = resolveScopedSlots;
  64644. target._g = bindObjectListeners;
  64645. target._d = bindDynamicKeys;
  64646. target._p = prependModifier;
  64647. }
  64648. /* */
  64649. function FunctionalRenderContext (
  64650. data,
  64651. props,
  64652. children,
  64653. parent,
  64654. Ctor
  64655. ) {
  64656. var this$1 = this;
  64657. var options = Ctor.options;
  64658. // ensure the createElement function in functional components
  64659. // gets a unique context - this is necessary for correct named slot check
  64660. var contextVm;
  64661. if (hasOwn(parent, '_uid')) {
  64662. contextVm = Object.create(parent);
  64663. // $flow-disable-line
  64664. contextVm._original = parent;
  64665. } else {
  64666. // the context vm passed in is a functional context as well.
  64667. // in this case we want to make sure we are able to get a hold to the
  64668. // real context instance.
  64669. contextVm = parent;
  64670. // $flow-disable-line
  64671. parent = parent._original;
  64672. }
  64673. var isCompiled = isTrue(options._compiled);
  64674. var needNormalization = !isCompiled;
  64675. this.data = data;
  64676. this.props = props;
  64677. this.children = children;
  64678. this.parent = parent;
  64679. this.listeners = data.on || emptyObject;
  64680. this.injections = resolveInject(options.inject, parent);
  64681. this.slots = function () {
  64682. if (!this$1.$slots) {
  64683. normalizeScopedSlots(
  64684. data.scopedSlots,
  64685. this$1.$slots = resolveSlots(children, parent)
  64686. );
  64687. }
  64688. return this$1.$slots
  64689. };
  64690. Object.defineProperty(this, 'scopedSlots', ({
  64691. enumerable: true,
  64692. get: function get () {
  64693. return normalizeScopedSlots(data.scopedSlots, this.slots())
  64694. }
  64695. }));
  64696. // support for compiled functional template
  64697. if (isCompiled) {
  64698. // exposing $options for renderStatic()
  64699. this.$options = options;
  64700. // pre-resolve slots for renderSlot()
  64701. this.$slots = this.slots();
  64702. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  64703. }
  64704. if (options._scopeId) {
  64705. this._c = function (a, b, c, d) {
  64706. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  64707. if (vnode && !Array.isArray(vnode)) {
  64708. vnode.fnScopeId = options._scopeId;
  64709. vnode.fnContext = parent;
  64710. }
  64711. return vnode
  64712. };
  64713. } else {
  64714. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  64715. }
  64716. }
  64717. installRenderHelpers(FunctionalRenderContext.prototype);
  64718. function createFunctionalComponent (
  64719. Ctor,
  64720. propsData,
  64721. data,
  64722. contextVm,
  64723. children
  64724. ) {
  64725. var options = Ctor.options;
  64726. var props = {};
  64727. var propOptions = options.props;
  64728. if (isDef(propOptions)) {
  64729. for (var key in propOptions) {
  64730. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  64731. }
  64732. } else {
  64733. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  64734. if (isDef(data.props)) { mergeProps(props, data.props); }
  64735. }
  64736. var renderContext = new FunctionalRenderContext(
  64737. data,
  64738. props,
  64739. children,
  64740. contextVm,
  64741. Ctor
  64742. );
  64743. var vnode = options.render.call(null, renderContext._c, renderContext);
  64744. if (vnode instanceof VNode) {
  64745. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  64746. } else if (Array.isArray(vnode)) {
  64747. var vnodes = normalizeChildren(vnode) || [];
  64748. var res = new Array(vnodes.length);
  64749. for (var i = 0; i < vnodes.length; i++) {
  64750. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  64751. }
  64752. return res
  64753. }
  64754. }
  64755. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  64756. // #7817 clone node before setting fnContext, otherwise if the node is reused
  64757. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  64758. // that should not be matched to match.
  64759. var clone = cloneVNode(vnode);
  64760. clone.fnContext = contextVm;
  64761. clone.fnOptions = options;
  64762. {
  64763. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  64764. }
  64765. if (data.slot) {
  64766. (clone.data || (clone.data = {})).slot = data.slot;
  64767. }
  64768. return clone
  64769. }
  64770. function mergeProps (to, from) {
  64771. for (var key in from) {
  64772. to[camelize(key)] = from[key];
  64773. }
  64774. }
  64775. /* */
  64776. /* */
  64777. /* */
  64778. /* */
  64779. // inline hooks to be invoked on component VNodes during patch
  64780. var componentVNodeHooks = {
  64781. init: function init (vnode, hydrating) {
  64782. if (
  64783. vnode.componentInstance &&
  64784. !vnode.componentInstance._isDestroyed &&
  64785. vnode.data.keepAlive
  64786. ) {
  64787. // kept-alive components, treat as a patch
  64788. var mountedNode = vnode; // work around flow
  64789. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  64790. } else {
  64791. var child = vnode.componentInstance = createComponentInstanceForVnode(
  64792. vnode,
  64793. activeInstance
  64794. );
  64795. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  64796. }
  64797. },
  64798. prepatch: function prepatch (oldVnode, vnode) {
  64799. var options = vnode.componentOptions;
  64800. var child = vnode.componentInstance = oldVnode.componentInstance;
  64801. updateChildComponent(
  64802. child,
  64803. options.propsData, // updated props
  64804. options.listeners, // updated listeners
  64805. vnode, // new parent vnode
  64806. options.children // new children
  64807. );
  64808. },
  64809. insert: function insert (vnode) {
  64810. var context = vnode.context;
  64811. var componentInstance = vnode.componentInstance;
  64812. if (!componentInstance._isMounted) {
  64813. componentInstance._isMounted = true;
  64814. callHook(componentInstance, 'mounted');
  64815. }
  64816. if (vnode.data.keepAlive) {
  64817. if (context._isMounted) {
  64818. // vue-router#1212
  64819. // During updates, a kept-alive component's child components may
  64820. // change, so directly walking the tree here may call activated hooks
  64821. // on incorrect children. Instead we push them into a queue which will
  64822. // be processed after the whole patch process ended.
  64823. queueActivatedComponent(componentInstance);
  64824. } else {
  64825. activateChildComponent(componentInstance, true /* direct */);
  64826. }
  64827. }
  64828. },
  64829. destroy: function destroy (vnode) {
  64830. var componentInstance = vnode.componentInstance;
  64831. if (!componentInstance._isDestroyed) {
  64832. if (!vnode.data.keepAlive) {
  64833. componentInstance.$destroy();
  64834. } else {
  64835. deactivateChildComponent(componentInstance, true /* direct */);
  64836. }
  64837. }
  64838. }
  64839. };
  64840. var hooksToMerge = Object.keys(componentVNodeHooks);
  64841. function createComponent (
  64842. Ctor,
  64843. data,
  64844. context,
  64845. children,
  64846. tag
  64847. ) {
  64848. if (isUndef(Ctor)) {
  64849. return
  64850. }
  64851. var baseCtor = context.$options._base;
  64852. // plain options object: turn it into a constructor
  64853. if (isObject(Ctor)) {
  64854. Ctor = baseCtor.extend(Ctor);
  64855. }
  64856. // if at this stage it's not a constructor or an async component factory,
  64857. // reject.
  64858. if (typeof Ctor !== 'function') {
  64859. {
  64860. warn(("Invalid Component definition: " + (String(Ctor))), context);
  64861. }
  64862. return
  64863. }
  64864. // async component
  64865. var asyncFactory;
  64866. if (isUndef(Ctor.cid)) {
  64867. asyncFactory = Ctor;
  64868. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  64869. if (Ctor === undefined) {
  64870. // return a placeholder node for async component, which is rendered
  64871. // as a comment node but preserves all the raw information for the node.
  64872. // the information will be used for async server-rendering and hydration.
  64873. return createAsyncPlaceholder(
  64874. asyncFactory,
  64875. data,
  64876. context,
  64877. children,
  64878. tag
  64879. )
  64880. }
  64881. }
  64882. data = data || {};
  64883. // resolve constructor options in case global mixins are applied after
  64884. // component constructor creation
  64885. resolveConstructorOptions(Ctor);
  64886. // transform component v-model data into props & events
  64887. if (isDef(data.model)) {
  64888. transformModel(Ctor.options, data);
  64889. }
  64890. // extract props
  64891. var propsData = extractPropsFromVNodeData(data, Ctor, tag);
  64892. // functional component
  64893. if (isTrue(Ctor.options.functional)) {
  64894. return createFunctionalComponent(Ctor, propsData, data, context, children)
  64895. }
  64896. // extract listeners, since these needs to be treated as
  64897. // child component listeners instead of DOM listeners
  64898. var listeners = data.on;
  64899. // replace with listeners with .native modifier
  64900. // so it gets processed during parent component patch.
  64901. data.on = data.nativeOn;
  64902. if (isTrue(Ctor.options.abstract)) {
  64903. // abstract components do not keep anything
  64904. // other than props & listeners & slot
  64905. // work around flow
  64906. var slot = data.slot;
  64907. data = {};
  64908. if (slot) {
  64909. data.slot = slot;
  64910. }
  64911. }
  64912. // install component management hooks onto the placeholder node
  64913. installComponentHooks(data);
  64914. // return a placeholder vnode
  64915. var name = Ctor.options.name || tag;
  64916. var vnode = new VNode(
  64917. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  64918. data, undefined, undefined, undefined, context,
  64919. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  64920. asyncFactory
  64921. );
  64922. return vnode
  64923. }
  64924. function createComponentInstanceForVnode (
  64925. vnode, // we know it's MountedComponentVNode but flow doesn't
  64926. parent // activeInstance in lifecycle state
  64927. ) {
  64928. var options = {
  64929. _isComponent: true,
  64930. _parentVnode: vnode,
  64931. parent: parent
  64932. };
  64933. // check inline-template render functions
  64934. var inlineTemplate = vnode.data.inlineTemplate;
  64935. if (isDef(inlineTemplate)) {
  64936. options.render = inlineTemplate.render;
  64937. options.staticRenderFns = inlineTemplate.staticRenderFns;
  64938. }
  64939. return new vnode.componentOptions.Ctor(options)
  64940. }
  64941. function installComponentHooks (data) {
  64942. var hooks = data.hook || (data.hook = {});
  64943. for (var i = 0; i < hooksToMerge.length; i++) {
  64944. var key = hooksToMerge[i];
  64945. var existing = hooks[key];
  64946. var toMerge = componentVNodeHooks[key];
  64947. if (existing !== toMerge && !(existing && existing._merged)) {
  64948. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  64949. }
  64950. }
  64951. }
  64952. function mergeHook$1 (f1, f2) {
  64953. var merged = function (a, b) {
  64954. // flow complains about extra args which is why we use any
  64955. f1(a, b);
  64956. f2(a, b);
  64957. };
  64958. merged._merged = true;
  64959. return merged
  64960. }
  64961. // transform component v-model info (value and callback) into
  64962. // prop and event handler respectively.
  64963. function transformModel (options, data) {
  64964. var prop = (options.model && options.model.prop) || 'value';
  64965. var event = (options.model && options.model.event) || 'input'
  64966. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  64967. var on = data.on || (data.on = {});
  64968. var existing = on[event];
  64969. var callback = data.model.callback;
  64970. if (isDef(existing)) {
  64971. if (
  64972. Array.isArray(existing)
  64973. ? existing.indexOf(callback) === -1
  64974. : existing !== callback
  64975. ) {
  64976. on[event] = [callback].concat(existing);
  64977. }
  64978. } else {
  64979. on[event] = callback;
  64980. }
  64981. }
  64982. /* */
  64983. var SIMPLE_NORMALIZE = 1;
  64984. var ALWAYS_NORMALIZE = 2;
  64985. // wrapper function for providing a more flexible interface
  64986. // without getting yelled at by flow
  64987. function createElement (
  64988. context,
  64989. tag,
  64990. data,
  64991. children,
  64992. normalizationType,
  64993. alwaysNormalize
  64994. ) {
  64995. if (Array.isArray(data) || isPrimitive(data)) {
  64996. normalizationType = children;
  64997. children = data;
  64998. data = undefined;
  64999. }
  65000. if (isTrue(alwaysNormalize)) {
  65001. normalizationType = ALWAYS_NORMALIZE;
  65002. }
  65003. return _createElement(context, tag, data, children, normalizationType)
  65004. }
  65005. function _createElement (
  65006. context,
  65007. tag,
  65008. data,
  65009. children,
  65010. normalizationType
  65011. ) {
  65012. if (isDef(data) && isDef((data).__ob__)) {
  65013. warn(
  65014. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  65015. 'Always create fresh vnode data objects in each render!',
  65016. context
  65017. );
  65018. return createEmptyVNode()
  65019. }
  65020. // object syntax in v-bind
  65021. if (isDef(data) && isDef(data.is)) {
  65022. tag = data.is;
  65023. }
  65024. if (!tag) {
  65025. // in case of component :is set to falsy value
  65026. return createEmptyVNode()
  65027. }
  65028. // warn against non-primitive key
  65029. if (isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  65030. ) {
  65031. {
  65032. warn(
  65033. 'Avoid using non-primitive value as key, ' +
  65034. 'use string/number value instead.',
  65035. context
  65036. );
  65037. }
  65038. }
  65039. // support single function children as default scoped slot
  65040. if (Array.isArray(children) &&
  65041. typeof children[0] === 'function'
  65042. ) {
  65043. data = data || {};
  65044. data.scopedSlots = { default: children[0] };
  65045. children.length = 0;
  65046. }
  65047. if (normalizationType === ALWAYS_NORMALIZE) {
  65048. children = normalizeChildren(children);
  65049. } else if (normalizationType === SIMPLE_NORMALIZE) {
  65050. children = simpleNormalizeChildren(children);
  65051. }
  65052. var vnode, ns;
  65053. if (typeof tag === 'string') {
  65054. var Ctor;
  65055. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  65056. if (config.isReservedTag(tag)) {
  65057. // platform built-in elements
  65058. if (isDef(data) && isDef(data.nativeOn)) {
  65059. warn(
  65060. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  65061. context
  65062. );
  65063. }
  65064. vnode = new VNode(
  65065. config.parsePlatformTagName(tag), data, children,
  65066. undefined, undefined, context
  65067. );
  65068. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  65069. // component
  65070. vnode = createComponent(Ctor, data, context, children, tag);
  65071. } else {
  65072. // unknown or unlisted namespaced elements
  65073. // check at runtime because it may get assigned a namespace when its
  65074. // parent normalizes children
  65075. vnode = new VNode(
  65076. tag, data, children,
  65077. undefined, undefined, context
  65078. );
  65079. }
  65080. } else {
  65081. // direct component options / constructor
  65082. vnode = createComponent(tag, data, context, children);
  65083. }
  65084. if (Array.isArray(vnode)) {
  65085. return vnode
  65086. } else if (isDef(vnode)) {
  65087. if (isDef(ns)) { applyNS(vnode, ns); }
  65088. if (isDef(data)) { registerDeepBindings(data); }
  65089. return vnode
  65090. } else {
  65091. return createEmptyVNode()
  65092. }
  65093. }
  65094. function applyNS (vnode, ns, force) {
  65095. vnode.ns = ns;
  65096. if (vnode.tag === 'foreignObject') {
  65097. // use default namespace inside foreignObject
  65098. ns = undefined;
  65099. force = true;
  65100. }
  65101. if (isDef(vnode.children)) {
  65102. for (var i = 0, l = vnode.children.length; i < l; i++) {
  65103. var child = vnode.children[i];
  65104. if (isDef(child.tag) && (
  65105. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  65106. applyNS(child, ns, force);
  65107. }
  65108. }
  65109. }
  65110. }
  65111. // ref #5318
  65112. // necessary to ensure parent re-render when deep bindings like :style and
  65113. // :class are used on slot nodes
  65114. function registerDeepBindings (data) {
  65115. if (isObject(data.style)) {
  65116. traverse(data.style);
  65117. }
  65118. if (isObject(data.class)) {
  65119. traverse(data.class);
  65120. }
  65121. }
  65122. /* */
  65123. function initRender (vm) {
  65124. vm._vnode = null; // the root of the child tree
  65125. vm._staticTrees = null; // v-once cached trees
  65126. var options = vm.$options;
  65127. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  65128. var renderContext = parentVnode && parentVnode.context;
  65129. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  65130. vm.$scopedSlots = emptyObject;
  65131. // bind the createElement fn to this instance
  65132. // so that we get proper render context inside it.
  65133. // args order: tag, data, children, normalizationType, alwaysNormalize
  65134. // internal version is used by render functions compiled from templates
  65135. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  65136. // normalization is always applied for the public version, used in
  65137. // user-written render functions.
  65138. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  65139. // $attrs & $listeners are exposed for easier HOC creation.
  65140. // they need to be reactive so that HOCs using them are always updated
  65141. var parentData = parentVnode && parentVnode.data;
  65142. /* istanbul ignore else */
  65143. {
  65144. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  65145. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  65146. }, true);
  65147. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  65148. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  65149. }, true);
  65150. }
  65151. }
  65152. var currentRenderingInstance = null;
  65153. function renderMixin (Vue) {
  65154. // install runtime convenience helpers
  65155. installRenderHelpers(Vue.prototype);
  65156. Vue.prototype.$nextTick = function (fn) {
  65157. return nextTick(fn, this)
  65158. };
  65159. Vue.prototype._render = function () {
  65160. var vm = this;
  65161. var ref = vm.$options;
  65162. var render = ref.render;
  65163. var _parentVnode = ref._parentVnode;
  65164. if (_parentVnode) {
  65165. vm.$scopedSlots = normalizeScopedSlots(
  65166. _parentVnode.data.scopedSlots,
  65167. vm.$slots,
  65168. vm.$scopedSlots
  65169. );
  65170. }
  65171. // set parent vnode. this allows render functions to have access
  65172. // to the data on the placeholder node.
  65173. vm.$vnode = _parentVnode;
  65174. // render self
  65175. var vnode;
  65176. try {
  65177. // There's no need to maintain a stack because all render fns are called
  65178. // separately from one another. Nested component's render fns are called
  65179. // when parent component is patched.
  65180. currentRenderingInstance = vm;
  65181. vnode = render.call(vm._renderProxy, vm.$createElement);
  65182. } catch (e) {
  65183. handleError(e, vm, "render");
  65184. // return error render result,
  65185. // or previous vnode to prevent render error causing blank component
  65186. /* istanbul ignore else */
  65187. if (vm.$options.renderError) {
  65188. try {
  65189. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  65190. } catch (e) {
  65191. handleError(e, vm, "renderError");
  65192. vnode = vm._vnode;
  65193. }
  65194. } else {
  65195. vnode = vm._vnode;
  65196. }
  65197. } finally {
  65198. currentRenderingInstance = null;
  65199. }
  65200. // if the returned array contains only a single node, allow it
  65201. if (Array.isArray(vnode) && vnode.length === 1) {
  65202. vnode = vnode[0];
  65203. }
  65204. // return empty vnode in case the render function errored out
  65205. if (!(vnode instanceof VNode)) {
  65206. if (Array.isArray(vnode)) {
  65207. warn(
  65208. 'Multiple root nodes returned from render function. Render function ' +
  65209. 'should return a single root node.',
  65210. vm
  65211. );
  65212. }
  65213. vnode = createEmptyVNode();
  65214. }
  65215. // set parent
  65216. vnode.parent = _parentVnode;
  65217. return vnode
  65218. };
  65219. }
  65220. /* */
  65221. function ensureCtor (comp, base) {
  65222. if (
  65223. comp.__esModule ||
  65224. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  65225. ) {
  65226. comp = comp.default;
  65227. }
  65228. return isObject(comp)
  65229. ? base.extend(comp)
  65230. : comp
  65231. }
  65232. function createAsyncPlaceholder (
  65233. factory,
  65234. data,
  65235. context,
  65236. children,
  65237. tag
  65238. ) {
  65239. var node = createEmptyVNode();
  65240. node.asyncFactory = factory;
  65241. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  65242. return node
  65243. }
  65244. function resolveAsyncComponent (
  65245. factory,
  65246. baseCtor
  65247. ) {
  65248. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  65249. return factory.errorComp
  65250. }
  65251. if (isDef(factory.resolved)) {
  65252. return factory.resolved
  65253. }
  65254. var owner = currentRenderingInstance;
  65255. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  65256. // already pending
  65257. factory.owners.push(owner);
  65258. }
  65259. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  65260. return factory.loadingComp
  65261. }
  65262. if (owner && !isDef(factory.owners)) {
  65263. var owners = factory.owners = [owner];
  65264. var sync = true;
  65265. var timerLoading = null;
  65266. var timerTimeout = null
  65267. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  65268. var forceRender = function (renderCompleted) {
  65269. for (var i = 0, l = owners.length; i < l; i++) {
  65270. (owners[i]).$forceUpdate();
  65271. }
  65272. if (renderCompleted) {
  65273. owners.length = 0;
  65274. if (timerLoading !== null) {
  65275. clearTimeout(timerLoading);
  65276. timerLoading = null;
  65277. }
  65278. if (timerTimeout !== null) {
  65279. clearTimeout(timerTimeout);
  65280. timerTimeout = null;
  65281. }
  65282. }
  65283. };
  65284. var resolve = once(function (res) {
  65285. // cache resolved
  65286. factory.resolved = ensureCtor(res, baseCtor);
  65287. // invoke callbacks only if this is not a synchronous resolve
  65288. // (async resolves are shimmed as synchronous during SSR)
  65289. if (!sync) {
  65290. forceRender(true);
  65291. } else {
  65292. owners.length = 0;
  65293. }
  65294. });
  65295. var reject = once(function (reason) {
  65296. warn(
  65297. "Failed to resolve async component: " + (String(factory)) +
  65298. (reason ? ("\nReason: " + reason) : '')
  65299. );
  65300. if (isDef(factory.errorComp)) {
  65301. factory.error = true;
  65302. forceRender(true);
  65303. }
  65304. });
  65305. var res = factory(resolve, reject);
  65306. if (isObject(res)) {
  65307. if (isPromise(res)) {
  65308. // () => Promise
  65309. if (isUndef(factory.resolved)) {
  65310. res.then(resolve, reject);
  65311. }
  65312. } else if (isPromise(res.component)) {
  65313. res.component.then(resolve, reject);
  65314. if (isDef(res.error)) {
  65315. factory.errorComp = ensureCtor(res.error, baseCtor);
  65316. }
  65317. if (isDef(res.loading)) {
  65318. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  65319. if (res.delay === 0) {
  65320. factory.loading = true;
  65321. } else {
  65322. timerLoading = setTimeout(function () {
  65323. timerLoading = null;
  65324. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  65325. factory.loading = true;
  65326. forceRender(false);
  65327. }
  65328. }, res.delay || 200);
  65329. }
  65330. }
  65331. if (isDef(res.timeout)) {
  65332. timerTimeout = setTimeout(function () {
  65333. timerTimeout = null;
  65334. if (isUndef(factory.resolved)) {
  65335. reject(
  65336. "timeout (" + (res.timeout) + "ms)"
  65337. );
  65338. }
  65339. }, res.timeout);
  65340. }
  65341. }
  65342. }
  65343. sync = false;
  65344. // return in case resolved synchronously
  65345. return factory.loading
  65346. ? factory.loadingComp
  65347. : factory.resolved
  65348. }
  65349. }
  65350. /* */
  65351. function isAsyncPlaceholder (node) {
  65352. return node.isComment && node.asyncFactory
  65353. }
  65354. /* */
  65355. function getFirstComponentChild (children) {
  65356. if (Array.isArray(children)) {
  65357. for (var i = 0; i < children.length; i++) {
  65358. var c = children[i];
  65359. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  65360. return c
  65361. }
  65362. }
  65363. }
  65364. }
  65365. /* */
  65366. /* */
  65367. function initEvents (vm) {
  65368. vm._events = Object.create(null);
  65369. vm._hasHookEvent = false;
  65370. // init parent attached events
  65371. var listeners = vm.$options._parentListeners;
  65372. if (listeners) {
  65373. updateComponentListeners(vm, listeners);
  65374. }
  65375. }
  65376. var target;
  65377. function add (event, fn) {
  65378. target.$on(event, fn);
  65379. }
  65380. function remove$1 (event, fn) {
  65381. target.$off(event, fn);
  65382. }
  65383. function createOnceHandler (event, fn) {
  65384. var _target = target;
  65385. return function onceHandler () {
  65386. var res = fn.apply(null, arguments);
  65387. if (res !== null) {
  65388. _target.$off(event, onceHandler);
  65389. }
  65390. }
  65391. }
  65392. function updateComponentListeners (
  65393. vm,
  65394. listeners,
  65395. oldListeners
  65396. ) {
  65397. target = vm;
  65398. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  65399. target = undefined;
  65400. }
  65401. function eventsMixin (Vue) {
  65402. var hookRE = /^hook:/;
  65403. Vue.prototype.$on = function (event, fn) {
  65404. var vm = this;
  65405. if (Array.isArray(event)) {
  65406. for (var i = 0, l = event.length; i < l; i++) {
  65407. vm.$on(event[i], fn);
  65408. }
  65409. } else {
  65410. (vm._events[event] || (vm._events[event] = [])).push(fn);
  65411. // optimize hook:event cost by using a boolean flag marked at registration
  65412. // instead of a hash lookup
  65413. if (hookRE.test(event)) {
  65414. vm._hasHookEvent = true;
  65415. }
  65416. }
  65417. return vm
  65418. };
  65419. Vue.prototype.$once = function (event, fn) {
  65420. var vm = this;
  65421. function on () {
  65422. vm.$off(event, on);
  65423. fn.apply(vm, arguments);
  65424. }
  65425. on.fn = fn;
  65426. vm.$on(event, on);
  65427. return vm
  65428. };
  65429. Vue.prototype.$off = function (event, fn) {
  65430. var vm = this;
  65431. // all
  65432. if (!arguments.length) {
  65433. vm._events = Object.create(null);
  65434. return vm
  65435. }
  65436. // array of events
  65437. if (Array.isArray(event)) {
  65438. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  65439. vm.$off(event[i$1], fn);
  65440. }
  65441. return vm
  65442. }
  65443. // specific event
  65444. var cbs = vm._events[event];
  65445. if (!cbs) {
  65446. return vm
  65447. }
  65448. if (!fn) {
  65449. vm._events[event] = null;
  65450. return vm
  65451. }
  65452. // specific handler
  65453. var cb;
  65454. var i = cbs.length;
  65455. while (i--) {
  65456. cb = cbs[i];
  65457. if (cb === fn || cb.fn === fn) {
  65458. cbs.splice(i, 1);
  65459. break
  65460. }
  65461. }
  65462. return vm
  65463. };
  65464. Vue.prototype.$emit = function (event) {
  65465. var vm = this;
  65466. {
  65467. var lowerCaseEvent = event.toLowerCase();
  65468. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  65469. tip(
  65470. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  65471. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  65472. "Note that HTML attributes are case-insensitive and you cannot use " +
  65473. "v-on to listen to camelCase events when using in-DOM templates. " +
  65474. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  65475. );
  65476. }
  65477. }
  65478. var cbs = vm._events[event];
  65479. if (cbs) {
  65480. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  65481. var args = toArray(arguments, 1);
  65482. var info = "event handler for \"" + event + "\"";
  65483. for (var i = 0, l = cbs.length; i < l; i++) {
  65484. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  65485. }
  65486. }
  65487. return vm
  65488. };
  65489. }
  65490. /* */
  65491. var activeInstance = null;
  65492. var isUpdatingChildComponent = false;
  65493. function setActiveInstance(vm) {
  65494. var prevActiveInstance = activeInstance;
  65495. activeInstance = vm;
  65496. return function () {
  65497. activeInstance = prevActiveInstance;
  65498. }
  65499. }
  65500. function initLifecycle (vm) {
  65501. var options = vm.$options;
  65502. // locate first non-abstract parent
  65503. var parent = options.parent;
  65504. if (parent && !options.abstract) {
  65505. while (parent.$options.abstract && parent.$parent) {
  65506. parent = parent.$parent;
  65507. }
  65508. parent.$children.push(vm);
  65509. }
  65510. vm.$parent = parent;
  65511. vm.$root = parent ? parent.$root : vm;
  65512. vm.$children = [];
  65513. vm.$refs = {};
  65514. vm._watcher = null;
  65515. vm._inactive = null;
  65516. vm._directInactive = false;
  65517. vm._isMounted = false;
  65518. vm._isDestroyed = false;
  65519. vm._isBeingDestroyed = false;
  65520. }
  65521. function lifecycleMixin (Vue) {
  65522. Vue.prototype._update = function (vnode, hydrating) {
  65523. var vm = this;
  65524. var prevEl = vm.$el;
  65525. var prevVnode = vm._vnode;
  65526. var restoreActiveInstance = setActiveInstance(vm);
  65527. vm._vnode = vnode;
  65528. // Vue.prototype.__patch__ is injected in entry points
  65529. // based on the rendering backend used.
  65530. if (!prevVnode) {
  65531. // initial render
  65532. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  65533. } else {
  65534. // updates
  65535. vm.$el = vm.__patch__(prevVnode, vnode);
  65536. }
  65537. restoreActiveInstance();
  65538. // update __vue__ reference
  65539. if (prevEl) {
  65540. prevEl.__vue__ = null;
  65541. }
  65542. if (vm.$el) {
  65543. vm.$el.__vue__ = vm;
  65544. }
  65545. // if parent is an HOC, update its $el as well
  65546. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  65547. vm.$parent.$el = vm.$el;
  65548. }
  65549. // updated hook is called by the scheduler to ensure that children are
  65550. // updated in a parent's updated hook.
  65551. };
  65552. Vue.prototype.$forceUpdate = function () {
  65553. var vm = this;
  65554. if (vm._watcher) {
  65555. vm._watcher.update();
  65556. }
  65557. };
  65558. Vue.prototype.$destroy = function () {
  65559. var vm = this;
  65560. if (vm._isBeingDestroyed) {
  65561. return
  65562. }
  65563. callHook(vm, 'beforeDestroy');
  65564. vm._isBeingDestroyed = true;
  65565. // remove self from parent
  65566. var parent = vm.$parent;
  65567. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  65568. remove(parent.$children, vm);
  65569. }
  65570. // teardown watchers
  65571. if (vm._watcher) {
  65572. vm._watcher.teardown();
  65573. }
  65574. var i = vm._watchers.length;
  65575. while (i--) {
  65576. vm._watchers[i].teardown();
  65577. }
  65578. // remove reference from data ob
  65579. // frozen object may not have observer.
  65580. if (vm._data.__ob__) {
  65581. vm._data.__ob__.vmCount--;
  65582. }
  65583. // call the last hook...
  65584. vm._isDestroyed = true;
  65585. // invoke destroy hooks on current rendered tree
  65586. vm.__patch__(vm._vnode, null);
  65587. // fire destroyed hook
  65588. callHook(vm, 'destroyed');
  65589. // turn off all instance listeners.
  65590. vm.$off();
  65591. // remove __vue__ reference
  65592. if (vm.$el) {
  65593. vm.$el.__vue__ = null;
  65594. }
  65595. // release circular reference (#6759)
  65596. if (vm.$vnode) {
  65597. vm.$vnode.parent = null;
  65598. }
  65599. };
  65600. }
  65601. function mountComponent (
  65602. vm,
  65603. el,
  65604. hydrating
  65605. ) {
  65606. vm.$el = el;
  65607. if (!vm.$options.render) {
  65608. vm.$options.render = createEmptyVNode;
  65609. {
  65610. /* istanbul ignore if */
  65611. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  65612. vm.$options.el || el) {
  65613. warn(
  65614. 'You are using the runtime-only build of Vue where the template ' +
  65615. 'compiler is not available. Either pre-compile the templates into ' +
  65616. 'render functions, or use the compiler-included build.',
  65617. vm
  65618. );
  65619. } else {
  65620. warn(
  65621. 'Failed to mount component: template or render function not defined.',
  65622. vm
  65623. );
  65624. }
  65625. }
  65626. }
  65627. callHook(vm, 'beforeMount');
  65628. var updateComponent;
  65629. /* istanbul ignore if */
  65630. if (config.performance && mark) {
  65631. updateComponent = function () {
  65632. var name = vm._name;
  65633. var id = vm._uid;
  65634. var startTag = "vue-perf-start:" + id;
  65635. var endTag = "vue-perf-end:" + id;
  65636. mark(startTag);
  65637. var vnode = vm._render();
  65638. mark(endTag);
  65639. measure(("vue " + name + " render"), startTag, endTag);
  65640. mark(startTag);
  65641. vm._update(vnode, hydrating);
  65642. mark(endTag);
  65643. measure(("vue " + name + " patch"), startTag, endTag);
  65644. };
  65645. } else {
  65646. updateComponent = function () {
  65647. vm._update(vm._render(), hydrating);
  65648. };
  65649. }
  65650. // we set this to vm._watcher inside the watcher's constructor
  65651. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  65652. // component's mounted hook), which relies on vm._watcher being already defined
  65653. new Watcher(vm, updateComponent, noop, {
  65654. before: function before () {
  65655. if (vm._isMounted && !vm._isDestroyed) {
  65656. callHook(vm, 'beforeUpdate');
  65657. }
  65658. }
  65659. }, true /* isRenderWatcher */);
  65660. hydrating = false;
  65661. // manually mounted instance, call mounted on self
  65662. // mounted is called for render-created child components in its inserted hook
  65663. if (vm.$vnode == null) {
  65664. vm._isMounted = true;
  65665. callHook(vm, 'mounted');
  65666. }
  65667. return vm
  65668. }
  65669. function updateChildComponent (
  65670. vm,
  65671. propsData,
  65672. listeners,
  65673. parentVnode,
  65674. renderChildren
  65675. ) {
  65676. {
  65677. isUpdatingChildComponent = true;
  65678. }
  65679. // determine whether component has slot children
  65680. // we need to do this before overwriting $options._renderChildren.
  65681. // check if there are dynamic scopedSlots (hand-written or compiled but with
  65682. // dynamic slot names). Static scoped slots compiled from template has the
  65683. // "$stable" marker.
  65684. var newScopedSlots = parentVnode.data.scopedSlots;
  65685. var oldScopedSlots = vm.$scopedSlots;
  65686. var hasDynamicScopedSlot = !!(
  65687. (newScopedSlots && !newScopedSlots.$stable) ||
  65688. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  65689. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  65690. );
  65691. // Any static slot children from the parent may have changed during parent's
  65692. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  65693. // update is necessary to ensure correctness.
  65694. var needsForceUpdate = !!(
  65695. renderChildren || // has new static slots
  65696. vm.$options._renderChildren || // has old static slots
  65697. hasDynamicScopedSlot
  65698. );
  65699. vm.$options._parentVnode = parentVnode;
  65700. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  65701. if (vm._vnode) { // update child tree's parent
  65702. vm._vnode.parent = parentVnode;
  65703. }
  65704. vm.$options._renderChildren = renderChildren;
  65705. // update $attrs and $listeners hash
  65706. // these are also reactive so they may trigger child update if the child
  65707. // used them during render
  65708. vm.$attrs = parentVnode.data.attrs || emptyObject;
  65709. vm.$listeners = listeners || emptyObject;
  65710. // update props
  65711. if (propsData && vm.$options.props) {
  65712. toggleObserving(false);
  65713. var props = vm._props;
  65714. var propKeys = vm.$options._propKeys || [];
  65715. for (var i = 0; i < propKeys.length; i++) {
  65716. var key = propKeys[i];
  65717. var propOptions = vm.$options.props; // wtf flow?
  65718. props[key] = validateProp(key, propOptions, propsData, vm);
  65719. }
  65720. toggleObserving(true);
  65721. // keep a copy of raw propsData
  65722. vm.$options.propsData = propsData;
  65723. }
  65724. // update listeners
  65725. listeners = listeners || emptyObject;
  65726. var oldListeners = vm.$options._parentListeners;
  65727. vm.$options._parentListeners = listeners;
  65728. updateComponentListeners(vm, listeners, oldListeners);
  65729. // resolve slots + force update if has children
  65730. if (needsForceUpdate) {
  65731. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  65732. vm.$forceUpdate();
  65733. }
  65734. {
  65735. isUpdatingChildComponent = false;
  65736. }
  65737. }
  65738. function isInInactiveTree (vm) {
  65739. while (vm && (vm = vm.$parent)) {
  65740. if (vm._inactive) { return true }
  65741. }
  65742. return false
  65743. }
  65744. function activateChildComponent (vm, direct) {
  65745. if (direct) {
  65746. vm._directInactive = false;
  65747. if (isInInactiveTree(vm)) {
  65748. return
  65749. }
  65750. } else if (vm._directInactive) {
  65751. return
  65752. }
  65753. if (vm._inactive || vm._inactive === null) {
  65754. vm._inactive = false;
  65755. for (var i = 0; i < vm.$children.length; i++) {
  65756. activateChildComponent(vm.$children[i]);
  65757. }
  65758. callHook(vm, 'activated');
  65759. }
  65760. }
  65761. function deactivateChildComponent (vm, direct) {
  65762. if (direct) {
  65763. vm._directInactive = true;
  65764. if (isInInactiveTree(vm)) {
  65765. return
  65766. }
  65767. }
  65768. if (!vm._inactive) {
  65769. vm._inactive = true;
  65770. for (var i = 0; i < vm.$children.length; i++) {
  65771. deactivateChildComponent(vm.$children[i]);
  65772. }
  65773. callHook(vm, 'deactivated');
  65774. }
  65775. }
  65776. function callHook (vm, hook) {
  65777. // #7573 disable dep collection when invoking lifecycle hooks
  65778. pushTarget();
  65779. var handlers = vm.$options[hook];
  65780. var info = hook + " hook";
  65781. if (handlers) {
  65782. for (var i = 0, j = handlers.length; i < j; i++) {
  65783. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  65784. }
  65785. }
  65786. if (vm._hasHookEvent) {
  65787. vm.$emit('hook:' + hook);
  65788. }
  65789. popTarget();
  65790. }
  65791. /* */
  65792. var MAX_UPDATE_COUNT = 100;
  65793. var queue = [];
  65794. var activatedChildren = [];
  65795. var has = {};
  65796. var circular = {};
  65797. var waiting = false;
  65798. var flushing = false;
  65799. var index = 0;
  65800. /**
  65801. * Reset the scheduler's state.
  65802. */
  65803. function resetSchedulerState () {
  65804. index = queue.length = activatedChildren.length = 0;
  65805. has = {};
  65806. {
  65807. circular = {};
  65808. }
  65809. waiting = flushing = false;
  65810. }
  65811. // Async edge case #6566 requires saving the timestamp when event listeners are
  65812. // attached. However, calling performance.now() has a perf overhead especially
  65813. // if the page has thousands of event listeners. Instead, we take a timestamp
  65814. // every time the scheduler flushes and use that for all event listeners
  65815. // attached during that flush.
  65816. var currentFlushTimestamp = 0;
  65817. // Async edge case fix requires storing an event listener's attach timestamp.
  65818. var getNow = Date.now;
  65819. // Determine what event timestamp the browser is using. Annoyingly, the
  65820. // timestamp can either be hi-res (relative to page load) or low-res
  65821. // (relative to UNIX epoch), so in order to compare time we have to use the
  65822. // same timestamp type when saving the flush timestamp.
  65823. // All IE versions use low-res event timestamps, and have problematic clock
  65824. // implementations (#9632)
  65825. if (inBrowser && !isIE) {
  65826. var performance = window.performance;
  65827. if (
  65828. performance &&
  65829. typeof performance.now === 'function' &&
  65830. getNow() > document.createEvent('Event').timeStamp
  65831. ) {
  65832. // if the event timestamp, although evaluated AFTER the Date.now(), is
  65833. // smaller than it, it means the event is using a hi-res timestamp,
  65834. // and we need to use the hi-res version for event listener timestamps as
  65835. // well.
  65836. getNow = function () { return performance.now(); };
  65837. }
  65838. }
  65839. /**
  65840. * Flush both queues and run the watchers.
  65841. */
  65842. function flushSchedulerQueue () {
  65843. currentFlushTimestamp = getNow();
  65844. flushing = true;
  65845. var watcher, id;
  65846. // Sort queue before flush.
  65847. // This ensures that:
  65848. // 1. Components are updated from parent to child. (because parent is always
  65849. // created before the child)
  65850. // 2. A component's user watchers are run before its render watcher (because
  65851. // user watchers are created before the render watcher)
  65852. // 3. If a component is destroyed during a parent component's watcher run,
  65853. // its watchers can be skipped.
  65854. queue.sort(function (a, b) { return a.id - b.id; });
  65855. // do not cache length because more watchers might be pushed
  65856. // as we run existing watchers
  65857. for (index = 0; index < queue.length; index++) {
  65858. watcher = queue[index];
  65859. if (watcher.before) {
  65860. watcher.before();
  65861. }
  65862. id = watcher.id;
  65863. has[id] = null;
  65864. watcher.run();
  65865. // in dev build, check and stop circular updates.
  65866. if (has[id] != null) {
  65867. circular[id] = (circular[id] || 0) + 1;
  65868. if (circular[id] > MAX_UPDATE_COUNT) {
  65869. warn(
  65870. 'You may have an infinite update loop ' + (
  65871. watcher.user
  65872. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  65873. : "in a component render function."
  65874. ),
  65875. watcher.vm
  65876. );
  65877. break
  65878. }
  65879. }
  65880. }
  65881. // keep copies of post queues before resetting state
  65882. var activatedQueue = activatedChildren.slice();
  65883. var updatedQueue = queue.slice();
  65884. resetSchedulerState();
  65885. // call component updated and activated hooks
  65886. callActivatedHooks(activatedQueue);
  65887. callUpdatedHooks(updatedQueue);
  65888. // devtool hook
  65889. /* istanbul ignore if */
  65890. if (devtools && config.devtools) {
  65891. devtools.emit('flush');
  65892. }
  65893. }
  65894. function callUpdatedHooks (queue) {
  65895. var i = queue.length;
  65896. while (i--) {
  65897. var watcher = queue[i];
  65898. var vm = watcher.vm;
  65899. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  65900. callHook(vm, 'updated');
  65901. }
  65902. }
  65903. }
  65904. /**
  65905. * Queue a kept-alive component that was activated during patch.
  65906. * The queue will be processed after the entire tree has been patched.
  65907. */
  65908. function queueActivatedComponent (vm) {
  65909. // setting _inactive to false here so that a render function can
  65910. // rely on checking whether it's in an inactive tree (e.g. router-view)
  65911. vm._inactive = false;
  65912. activatedChildren.push(vm);
  65913. }
  65914. function callActivatedHooks (queue) {
  65915. for (var i = 0; i < queue.length; i++) {
  65916. queue[i]._inactive = true;
  65917. activateChildComponent(queue[i], true /* true */);
  65918. }
  65919. }
  65920. /**
  65921. * Push a watcher into the watcher queue.
  65922. * Jobs with duplicate IDs will be skipped unless it's
  65923. * pushed when the queue is being flushed.
  65924. */
  65925. function queueWatcher (watcher) {
  65926. var id = watcher.id;
  65927. if (has[id] == null) {
  65928. has[id] = true;
  65929. if (!flushing) {
  65930. queue.push(watcher);
  65931. } else {
  65932. // if already flushing, splice the watcher based on its id
  65933. // if already past its id, it will be run next immediately.
  65934. var i = queue.length - 1;
  65935. while (i > index && queue[i].id > watcher.id) {
  65936. i--;
  65937. }
  65938. queue.splice(i + 1, 0, watcher);
  65939. }
  65940. // queue the flush
  65941. if (!waiting) {
  65942. waiting = true;
  65943. if (!config.async) {
  65944. flushSchedulerQueue();
  65945. return
  65946. }
  65947. nextTick(flushSchedulerQueue);
  65948. }
  65949. }
  65950. }
  65951. /* */
  65952. var uid$2 = 0;
  65953. /**
  65954. * A watcher parses an expression, collects dependencies,
  65955. * and fires callback when the expression value changes.
  65956. * This is used for both the $watch() api and directives.
  65957. */
  65958. var Watcher = function Watcher (
  65959. vm,
  65960. expOrFn,
  65961. cb,
  65962. options,
  65963. isRenderWatcher
  65964. ) {
  65965. this.vm = vm;
  65966. if (isRenderWatcher) {
  65967. vm._watcher = this;
  65968. }
  65969. vm._watchers.push(this);
  65970. // options
  65971. if (options) {
  65972. this.deep = !!options.deep;
  65973. this.user = !!options.user;
  65974. this.lazy = !!options.lazy;
  65975. this.sync = !!options.sync;
  65976. this.before = options.before;
  65977. } else {
  65978. this.deep = this.user = this.lazy = this.sync = false;
  65979. }
  65980. this.cb = cb;
  65981. this.id = ++uid$2; // uid for batching
  65982. this.active = true;
  65983. this.dirty = this.lazy; // for lazy watchers
  65984. this.deps = [];
  65985. this.newDeps = [];
  65986. this.depIds = new _Set();
  65987. this.newDepIds = new _Set();
  65988. this.expression = expOrFn.toString();
  65989. // parse expression for getter
  65990. if (typeof expOrFn === 'function') {
  65991. this.getter = expOrFn;
  65992. } else {
  65993. this.getter = parsePath(expOrFn);
  65994. if (!this.getter) {
  65995. this.getter = noop;
  65996. warn(
  65997. "Failed watching path: \"" + expOrFn + "\" " +
  65998. 'Watcher only accepts simple dot-delimited paths. ' +
  65999. 'For full control, use a function instead.',
  66000. vm
  66001. );
  66002. }
  66003. }
  66004. this.value = this.lazy
  66005. ? undefined
  66006. : this.get();
  66007. };
  66008. /**
  66009. * Evaluate the getter, and re-collect dependencies.
  66010. */
  66011. Watcher.prototype.get = function get () {
  66012. pushTarget(this);
  66013. var value;
  66014. var vm = this.vm;
  66015. try {
  66016. value = this.getter.call(vm, vm);
  66017. } catch (e) {
  66018. if (this.user) {
  66019. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  66020. } else {
  66021. throw e
  66022. }
  66023. } finally {
  66024. // "touch" every property so they are all tracked as
  66025. // dependencies for deep watching
  66026. if (this.deep) {
  66027. traverse(value);
  66028. }
  66029. popTarget();
  66030. this.cleanupDeps();
  66031. }
  66032. return value
  66033. };
  66034. /**
  66035. * Add a dependency to this directive.
  66036. */
  66037. Watcher.prototype.addDep = function addDep (dep) {
  66038. var id = dep.id;
  66039. if (!this.newDepIds.has(id)) {
  66040. this.newDepIds.add(id);
  66041. this.newDeps.push(dep);
  66042. if (!this.depIds.has(id)) {
  66043. dep.addSub(this);
  66044. }
  66045. }
  66046. };
  66047. /**
  66048. * Clean up for dependency collection.
  66049. */
  66050. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  66051. var i = this.deps.length;
  66052. while (i--) {
  66053. var dep = this.deps[i];
  66054. if (!this.newDepIds.has(dep.id)) {
  66055. dep.removeSub(this);
  66056. }
  66057. }
  66058. var tmp = this.depIds;
  66059. this.depIds = this.newDepIds;
  66060. this.newDepIds = tmp;
  66061. this.newDepIds.clear();
  66062. tmp = this.deps;
  66063. this.deps = this.newDeps;
  66064. this.newDeps = tmp;
  66065. this.newDeps.length = 0;
  66066. };
  66067. /**
  66068. * Subscriber interface.
  66069. * Will be called when a dependency changes.
  66070. */
  66071. Watcher.prototype.update = function update () {
  66072. /* istanbul ignore else */
  66073. if (this.lazy) {
  66074. this.dirty = true;
  66075. } else if (this.sync) {
  66076. this.run();
  66077. } else {
  66078. queueWatcher(this);
  66079. }
  66080. };
  66081. /**
  66082. * Scheduler job interface.
  66083. * Will be called by the scheduler.
  66084. */
  66085. Watcher.prototype.run = function run () {
  66086. if (this.active) {
  66087. var value = this.get();
  66088. if (
  66089. value !== this.value ||
  66090. // Deep watchers and watchers on Object/Arrays should fire even
  66091. // when the value is the same, because the value may
  66092. // have mutated.
  66093. isObject(value) ||
  66094. this.deep
  66095. ) {
  66096. // set new value
  66097. var oldValue = this.value;
  66098. this.value = value;
  66099. if (this.user) {
  66100. try {
  66101. this.cb.call(this.vm, value, oldValue);
  66102. } catch (e) {
  66103. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  66104. }
  66105. } else {
  66106. this.cb.call(this.vm, value, oldValue);
  66107. }
  66108. }
  66109. }
  66110. };
  66111. /**
  66112. * Evaluate the value of the watcher.
  66113. * This only gets called for lazy watchers.
  66114. */
  66115. Watcher.prototype.evaluate = function evaluate () {
  66116. this.value = this.get();
  66117. this.dirty = false;
  66118. };
  66119. /**
  66120. * Depend on all deps collected by this watcher.
  66121. */
  66122. Watcher.prototype.depend = function depend () {
  66123. var i = this.deps.length;
  66124. while (i--) {
  66125. this.deps[i].depend();
  66126. }
  66127. };
  66128. /**
  66129. * Remove self from all dependencies' subscriber list.
  66130. */
  66131. Watcher.prototype.teardown = function teardown () {
  66132. if (this.active) {
  66133. // remove self from vm's watcher list
  66134. // this is a somewhat expensive operation so we skip it
  66135. // if the vm is being destroyed.
  66136. if (!this.vm._isBeingDestroyed) {
  66137. remove(this.vm._watchers, this);
  66138. }
  66139. var i = this.deps.length;
  66140. while (i--) {
  66141. this.deps[i].removeSub(this);
  66142. }
  66143. this.active = false;
  66144. }
  66145. };
  66146. /* */
  66147. var sharedPropertyDefinition = {
  66148. enumerable: true,
  66149. configurable: true,
  66150. get: noop,
  66151. set: noop
  66152. };
  66153. function proxy (target, sourceKey, key) {
  66154. sharedPropertyDefinition.get = function proxyGetter () {
  66155. return this[sourceKey][key]
  66156. };
  66157. sharedPropertyDefinition.set = function proxySetter (val) {
  66158. this[sourceKey][key] = val;
  66159. };
  66160. Object.defineProperty(target, key, sharedPropertyDefinition);
  66161. }
  66162. function initState (vm) {
  66163. vm._watchers = [];
  66164. var opts = vm.$options;
  66165. if (opts.props) { initProps(vm, opts.props); }
  66166. if (opts.methods) { initMethods(vm, opts.methods); }
  66167. if (opts.data) {
  66168. initData(vm);
  66169. } else {
  66170. observe(vm._data = {}, true /* asRootData */);
  66171. }
  66172. if (opts.computed) { initComputed(vm, opts.computed); }
  66173. if (opts.watch && opts.watch !== nativeWatch) {
  66174. initWatch(vm, opts.watch);
  66175. }
  66176. }
  66177. function initProps (vm, propsOptions) {
  66178. var propsData = vm.$options.propsData || {};
  66179. var props = vm._props = {};
  66180. // cache prop keys so that future props updates can iterate using Array
  66181. // instead of dynamic object key enumeration.
  66182. var keys = vm.$options._propKeys = [];
  66183. var isRoot = !vm.$parent;
  66184. // root instance props should be converted
  66185. if (!isRoot) {
  66186. toggleObserving(false);
  66187. }
  66188. var loop = function ( key ) {
  66189. keys.push(key);
  66190. var value = validateProp(key, propsOptions, propsData, vm);
  66191. /* istanbul ignore else */
  66192. {
  66193. var hyphenatedKey = hyphenate(key);
  66194. if (isReservedAttribute(hyphenatedKey) ||
  66195. config.isReservedAttr(hyphenatedKey)) {
  66196. warn(
  66197. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  66198. vm
  66199. );
  66200. }
  66201. defineReactive$$1(props, key, value, function () {
  66202. if (!isRoot && !isUpdatingChildComponent) {
  66203. warn(
  66204. "Avoid mutating a prop directly since the value will be " +
  66205. "overwritten whenever the parent component re-renders. " +
  66206. "Instead, use a data or computed property based on the prop's " +
  66207. "value. Prop being mutated: \"" + key + "\"",
  66208. vm
  66209. );
  66210. }
  66211. });
  66212. }
  66213. // static props are already proxied on the component's prototype
  66214. // during Vue.extend(). We only need to proxy props defined at
  66215. // instantiation here.
  66216. if (!(key in vm)) {
  66217. proxy(vm, "_props", key);
  66218. }
  66219. };
  66220. for (var key in propsOptions) loop( key );
  66221. toggleObserving(true);
  66222. }
  66223. function initData (vm) {
  66224. var data = vm.$options.data;
  66225. data = vm._data = typeof data === 'function'
  66226. ? getData(data, vm)
  66227. : data || {};
  66228. if (!isPlainObject(data)) {
  66229. data = {};
  66230. warn(
  66231. 'data functions should return an object:\n' +
  66232. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  66233. vm
  66234. );
  66235. }
  66236. // proxy data on instance
  66237. var keys = Object.keys(data);
  66238. var props = vm.$options.props;
  66239. var methods = vm.$options.methods;
  66240. var i = keys.length;
  66241. while (i--) {
  66242. var key = keys[i];
  66243. {
  66244. if (methods && hasOwn(methods, key)) {
  66245. warn(
  66246. ("Method \"" + key + "\" has already been defined as a data property."),
  66247. vm
  66248. );
  66249. }
  66250. }
  66251. if (props && hasOwn(props, key)) {
  66252. warn(
  66253. "The data property \"" + key + "\" is already declared as a prop. " +
  66254. "Use prop default value instead.",
  66255. vm
  66256. );
  66257. } else if (!isReserved(key)) {
  66258. proxy(vm, "_data", key);
  66259. }
  66260. }
  66261. // observe data
  66262. observe(data, true /* asRootData */);
  66263. }
  66264. function getData (data, vm) {
  66265. // #7573 disable dep collection when invoking data getters
  66266. pushTarget();
  66267. try {
  66268. return data.call(vm, vm)
  66269. } catch (e) {
  66270. handleError(e, vm, "data()");
  66271. return {}
  66272. } finally {
  66273. popTarget();
  66274. }
  66275. }
  66276. var computedWatcherOptions = { lazy: true };
  66277. function initComputed (vm, computed) {
  66278. // $flow-disable-line
  66279. var watchers = vm._computedWatchers = Object.create(null);
  66280. // computed properties are just getters during SSR
  66281. var isSSR = isServerRendering();
  66282. for (var key in computed) {
  66283. var userDef = computed[key];
  66284. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  66285. if (getter == null) {
  66286. warn(
  66287. ("Getter is missing for computed property \"" + key + "\"."),
  66288. vm
  66289. );
  66290. }
  66291. if (!isSSR) {
  66292. // create internal watcher for the computed property.
  66293. watchers[key] = new Watcher(
  66294. vm,
  66295. getter || noop,
  66296. noop,
  66297. computedWatcherOptions
  66298. );
  66299. }
  66300. // component-defined computed properties are already defined on the
  66301. // component prototype. We only need to define computed properties defined
  66302. // at instantiation here.
  66303. if (!(key in vm)) {
  66304. defineComputed(vm, key, userDef);
  66305. } else {
  66306. if (key in vm.$data) {
  66307. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  66308. } else if (vm.$options.props && key in vm.$options.props) {
  66309. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  66310. }
  66311. }
  66312. }
  66313. }
  66314. function defineComputed (
  66315. target,
  66316. key,
  66317. userDef
  66318. ) {
  66319. var shouldCache = !isServerRendering();
  66320. if (typeof userDef === 'function') {
  66321. sharedPropertyDefinition.get = shouldCache
  66322. ? createComputedGetter(key)
  66323. : createGetterInvoker(userDef);
  66324. sharedPropertyDefinition.set = noop;
  66325. } else {
  66326. sharedPropertyDefinition.get = userDef.get
  66327. ? shouldCache && userDef.cache !== false
  66328. ? createComputedGetter(key)
  66329. : createGetterInvoker(userDef.get)
  66330. : noop;
  66331. sharedPropertyDefinition.set = userDef.set || noop;
  66332. }
  66333. if (sharedPropertyDefinition.set === noop) {
  66334. sharedPropertyDefinition.set = function () {
  66335. warn(
  66336. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  66337. this
  66338. );
  66339. };
  66340. }
  66341. Object.defineProperty(target, key, sharedPropertyDefinition);
  66342. }
  66343. function createComputedGetter (key) {
  66344. return function computedGetter () {
  66345. var watcher = this._computedWatchers && this._computedWatchers[key];
  66346. if (watcher) {
  66347. if (watcher.dirty) {
  66348. watcher.evaluate();
  66349. }
  66350. if (Dep.target) {
  66351. watcher.depend();
  66352. }
  66353. return watcher.value
  66354. }
  66355. }
  66356. }
  66357. function createGetterInvoker(fn) {
  66358. return function computedGetter () {
  66359. return fn.call(this, this)
  66360. }
  66361. }
  66362. function initMethods (vm, methods) {
  66363. var props = vm.$options.props;
  66364. for (var key in methods) {
  66365. {
  66366. if (typeof methods[key] !== 'function') {
  66367. warn(
  66368. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  66369. "Did you reference the function correctly?",
  66370. vm
  66371. );
  66372. }
  66373. if (props && hasOwn(props, key)) {
  66374. warn(
  66375. ("Method \"" + key + "\" has already been defined as a prop."),
  66376. vm
  66377. );
  66378. }
  66379. if ((key in vm) && isReserved(key)) {
  66380. warn(
  66381. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  66382. "Avoid defining component methods that start with _ or $."
  66383. );
  66384. }
  66385. }
  66386. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  66387. }
  66388. }
  66389. function initWatch (vm, watch) {
  66390. for (var key in watch) {
  66391. var handler = watch[key];
  66392. if (Array.isArray(handler)) {
  66393. for (var i = 0; i < handler.length; i++) {
  66394. createWatcher(vm, key, handler[i]);
  66395. }
  66396. } else {
  66397. createWatcher(vm, key, handler);
  66398. }
  66399. }
  66400. }
  66401. function createWatcher (
  66402. vm,
  66403. expOrFn,
  66404. handler,
  66405. options
  66406. ) {
  66407. if (isPlainObject(handler)) {
  66408. options = handler;
  66409. handler = handler.handler;
  66410. }
  66411. if (typeof handler === 'string') {
  66412. handler = vm[handler];
  66413. }
  66414. return vm.$watch(expOrFn, handler, options)
  66415. }
  66416. function stateMixin (Vue) {
  66417. // flow somehow has problems with directly declared definition object
  66418. // when using Object.defineProperty, so we have to procedurally build up
  66419. // the object here.
  66420. var dataDef = {};
  66421. dataDef.get = function () { return this._data };
  66422. var propsDef = {};
  66423. propsDef.get = function () { return this._props };
  66424. {
  66425. dataDef.set = function () {
  66426. warn(
  66427. 'Avoid replacing instance root $data. ' +
  66428. 'Use nested data properties instead.',
  66429. this
  66430. );
  66431. };
  66432. propsDef.set = function () {
  66433. warn("$props is readonly.", this);
  66434. };
  66435. }
  66436. Object.defineProperty(Vue.prototype, '$data', dataDef);
  66437. Object.defineProperty(Vue.prototype, '$props', propsDef);
  66438. Vue.prototype.$set = set;
  66439. Vue.prototype.$delete = del;
  66440. Vue.prototype.$watch = function (
  66441. expOrFn,
  66442. cb,
  66443. options
  66444. ) {
  66445. var vm = this;
  66446. if (isPlainObject(cb)) {
  66447. return createWatcher(vm, expOrFn, cb, options)
  66448. }
  66449. options = options || {};
  66450. options.user = true;
  66451. var watcher = new Watcher(vm, expOrFn, cb, options);
  66452. if (options.immediate) {
  66453. try {
  66454. cb.call(vm, watcher.value);
  66455. } catch (error) {
  66456. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  66457. }
  66458. }
  66459. return function unwatchFn () {
  66460. watcher.teardown();
  66461. }
  66462. };
  66463. }
  66464. /* */
  66465. var uid$3 = 0;
  66466. function initMixin (Vue) {
  66467. Vue.prototype._init = function (options) {
  66468. var vm = this;
  66469. // a uid
  66470. vm._uid = uid$3++;
  66471. var startTag, endTag;
  66472. /* istanbul ignore if */
  66473. if (config.performance && mark) {
  66474. startTag = "vue-perf-start:" + (vm._uid);
  66475. endTag = "vue-perf-end:" + (vm._uid);
  66476. mark(startTag);
  66477. }
  66478. // a flag to avoid this being observed
  66479. vm._isVue = true;
  66480. // merge options
  66481. if (options && options._isComponent) {
  66482. // optimize internal component instantiation
  66483. // since dynamic options merging is pretty slow, and none of the
  66484. // internal component options needs special treatment.
  66485. initInternalComponent(vm, options);
  66486. } else {
  66487. vm.$options = mergeOptions(
  66488. resolveConstructorOptions(vm.constructor),
  66489. options || {},
  66490. vm
  66491. );
  66492. }
  66493. /* istanbul ignore else */
  66494. {
  66495. initProxy(vm);
  66496. }
  66497. // expose real self
  66498. vm._self = vm;
  66499. initLifecycle(vm);
  66500. initEvents(vm);
  66501. initRender(vm);
  66502. callHook(vm, 'beforeCreate');
  66503. initInjections(vm); // resolve injections before data/props
  66504. initState(vm);
  66505. initProvide(vm); // resolve provide after data/props
  66506. callHook(vm, 'created');
  66507. /* istanbul ignore if */
  66508. if (config.performance && mark) {
  66509. vm._name = formatComponentName(vm, false);
  66510. mark(endTag);
  66511. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  66512. }
  66513. if (vm.$options.el) {
  66514. vm.$mount(vm.$options.el);
  66515. }
  66516. };
  66517. }
  66518. function initInternalComponent (vm, options) {
  66519. var opts = vm.$options = Object.create(vm.constructor.options);
  66520. // doing this because it's faster than dynamic enumeration.
  66521. var parentVnode = options._parentVnode;
  66522. opts.parent = options.parent;
  66523. opts._parentVnode = parentVnode;
  66524. var vnodeComponentOptions = parentVnode.componentOptions;
  66525. opts.propsData = vnodeComponentOptions.propsData;
  66526. opts._parentListeners = vnodeComponentOptions.listeners;
  66527. opts._renderChildren = vnodeComponentOptions.children;
  66528. opts._componentTag = vnodeComponentOptions.tag;
  66529. if (options.render) {
  66530. opts.render = options.render;
  66531. opts.staticRenderFns = options.staticRenderFns;
  66532. }
  66533. }
  66534. function resolveConstructorOptions (Ctor) {
  66535. var options = Ctor.options;
  66536. if (Ctor.super) {
  66537. var superOptions = resolveConstructorOptions(Ctor.super);
  66538. var cachedSuperOptions = Ctor.superOptions;
  66539. if (superOptions !== cachedSuperOptions) {
  66540. // super option changed,
  66541. // need to resolve new options.
  66542. Ctor.superOptions = superOptions;
  66543. // check if there are any late-modified/attached options (#4976)
  66544. var modifiedOptions = resolveModifiedOptions(Ctor);
  66545. // update base extend options
  66546. if (modifiedOptions) {
  66547. extend(Ctor.extendOptions, modifiedOptions);
  66548. }
  66549. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  66550. if (options.name) {
  66551. options.components[options.name] = Ctor;
  66552. }
  66553. }
  66554. }
  66555. return options
  66556. }
  66557. function resolveModifiedOptions (Ctor) {
  66558. var modified;
  66559. var latest = Ctor.options;
  66560. var sealed = Ctor.sealedOptions;
  66561. for (var key in latest) {
  66562. if (latest[key] !== sealed[key]) {
  66563. if (!modified) { modified = {}; }
  66564. modified[key] = latest[key];
  66565. }
  66566. }
  66567. return modified
  66568. }
  66569. function Vue (options) {
  66570. if (!(this instanceof Vue)
  66571. ) {
  66572. warn('Vue is a constructor and should be called with the `new` keyword');
  66573. }
  66574. this._init(options);
  66575. }
  66576. initMixin(Vue);
  66577. stateMixin(Vue);
  66578. eventsMixin(Vue);
  66579. lifecycleMixin(Vue);
  66580. renderMixin(Vue);
  66581. /* */
  66582. function initUse (Vue) {
  66583. Vue.use = function (plugin) {
  66584. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  66585. if (installedPlugins.indexOf(plugin) > -1) {
  66586. return this
  66587. }
  66588. // additional parameters
  66589. var args = toArray(arguments, 1);
  66590. args.unshift(this);
  66591. if (typeof plugin.install === 'function') {
  66592. plugin.install.apply(plugin, args);
  66593. } else if (typeof plugin === 'function') {
  66594. plugin.apply(null, args);
  66595. }
  66596. installedPlugins.push(plugin);
  66597. return this
  66598. };
  66599. }
  66600. /* */
  66601. function initMixin$1 (Vue) {
  66602. Vue.mixin = function (mixin) {
  66603. this.options = mergeOptions(this.options, mixin);
  66604. return this
  66605. };
  66606. }
  66607. /* */
  66608. function initExtend (Vue) {
  66609. /**
  66610. * Each instance constructor, including Vue, has a unique
  66611. * cid. This enables us to create wrapped "child
  66612. * constructors" for prototypal inheritance and cache them.
  66613. */
  66614. Vue.cid = 0;
  66615. var cid = 1;
  66616. /**
  66617. * Class inheritance
  66618. */
  66619. Vue.extend = function (extendOptions) {
  66620. extendOptions = extendOptions || {};
  66621. var Super = this;
  66622. var SuperId = Super.cid;
  66623. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  66624. if (cachedCtors[SuperId]) {
  66625. return cachedCtors[SuperId]
  66626. }
  66627. var name = extendOptions.name || Super.options.name;
  66628. if (name) {
  66629. validateComponentName(name);
  66630. }
  66631. var Sub = function VueComponent (options) {
  66632. this._init(options);
  66633. };
  66634. Sub.prototype = Object.create(Super.prototype);
  66635. Sub.prototype.constructor = Sub;
  66636. Sub.cid = cid++;
  66637. Sub.options = mergeOptions(
  66638. Super.options,
  66639. extendOptions
  66640. );
  66641. Sub['super'] = Super;
  66642. // For props and computed properties, we define the proxy getters on
  66643. // the Vue instances at extension time, on the extended prototype. This
  66644. // avoids Object.defineProperty calls for each instance created.
  66645. if (Sub.options.props) {
  66646. initProps$1(Sub);
  66647. }
  66648. if (Sub.options.computed) {
  66649. initComputed$1(Sub);
  66650. }
  66651. // allow further extension/mixin/plugin usage
  66652. Sub.extend = Super.extend;
  66653. Sub.mixin = Super.mixin;
  66654. Sub.use = Super.use;
  66655. // create asset registers, so extended classes
  66656. // can have their private assets too.
  66657. ASSET_TYPES.forEach(function (type) {
  66658. Sub[type] = Super[type];
  66659. });
  66660. // enable recursive self-lookup
  66661. if (name) {
  66662. Sub.options.components[name] = Sub;
  66663. }
  66664. // keep a reference to the super options at extension time.
  66665. // later at instantiation we can check if Super's options have
  66666. // been updated.
  66667. Sub.superOptions = Super.options;
  66668. Sub.extendOptions = extendOptions;
  66669. Sub.sealedOptions = extend({}, Sub.options);
  66670. // cache constructor
  66671. cachedCtors[SuperId] = Sub;
  66672. return Sub
  66673. };
  66674. }
  66675. function initProps$1 (Comp) {
  66676. var props = Comp.options.props;
  66677. for (var key in props) {
  66678. proxy(Comp.prototype, "_props", key);
  66679. }
  66680. }
  66681. function initComputed$1 (Comp) {
  66682. var computed = Comp.options.computed;
  66683. for (var key in computed) {
  66684. defineComputed(Comp.prototype, key, computed[key]);
  66685. }
  66686. }
  66687. /* */
  66688. function initAssetRegisters (Vue) {
  66689. /**
  66690. * Create asset registration methods.
  66691. */
  66692. ASSET_TYPES.forEach(function (type) {
  66693. Vue[type] = function (
  66694. id,
  66695. definition
  66696. ) {
  66697. if (!definition) {
  66698. return this.options[type + 's'][id]
  66699. } else {
  66700. /* istanbul ignore if */
  66701. if (type === 'component') {
  66702. validateComponentName(id);
  66703. }
  66704. if (type === 'component' && isPlainObject(definition)) {
  66705. definition.name = definition.name || id;
  66706. definition = this.options._base.extend(definition);
  66707. }
  66708. if (type === 'directive' && typeof definition === 'function') {
  66709. definition = { bind: definition, update: definition };
  66710. }
  66711. this.options[type + 's'][id] = definition;
  66712. return definition
  66713. }
  66714. };
  66715. });
  66716. }
  66717. /* */
  66718. function getComponentName (opts) {
  66719. return opts && (opts.Ctor.options.name || opts.tag)
  66720. }
  66721. function matches (pattern, name) {
  66722. if (Array.isArray(pattern)) {
  66723. return pattern.indexOf(name) > -1
  66724. } else if (typeof pattern === 'string') {
  66725. return pattern.split(',').indexOf(name) > -1
  66726. } else if (isRegExp(pattern)) {
  66727. return pattern.test(name)
  66728. }
  66729. /* istanbul ignore next */
  66730. return false
  66731. }
  66732. function pruneCache (keepAliveInstance, filter) {
  66733. var cache = keepAliveInstance.cache;
  66734. var keys = keepAliveInstance.keys;
  66735. var _vnode = keepAliveInstance._vnode;
  66736. for (var key in cache) {
  66737. var cachedNode = cache[key];
  66738. if (cachedNode) {
  66739. var name = getComponentName(cachedNode.componentOptions);
  66740. if (name && !filter(name)) {
  66741. pruneCacheEntry(cache, key, keys, _vnode);
  66742. }
  66743. }
  66744. }
  66745. }
  66746. function pruneCacheEntry (
  66747. cache,
  66748. key,
  66749. keys,
  66750. current
  66751. ) {
  66752. var cached$$1 = cache[key];
  66753. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  66754. cached$$1.componentInstance.$destroy();
  66755. }
  66756. cache[key] = null;
  66757. remove(keys, key);
  66758. }
  66759. var patternTypes = [String, RegExp, Array];
  66760. var KeepAlive = {
  66761. name: 'keep-alive',
  66762. abstract: true,
  66763. props: {
  66764. include: patternTypes,
  66765. exclude: patternTypes,
  66766. max: [String, Number]
  66767. },
  66768. created: function created () {
  66769. this.cache = Object.create(null);
  66770. this.keys = [];
  66771. },
  66772. destroyed: function destroyed () {
  66773. for (var key in this.cache) {
  66774. pruneCacheEntry(this.cache, key, this.keys);
  66775. }
  66776. },
  66777. mounted: function mounted () {
  66778. var this$1 = this;
  66779. this.$watch('include', function (val) {
  66780. pruneCache(this$1, function (name) { return matches(val, name); });
  66781. });
  66782. this.$watch('exclude', function (val) {
  66783. pruneCache(this$1, function (name) { return !matches(val, name); });
  66784. });
  66785. },
  66786. render: function render () {
  66787. var slot = this.$slots.default;
  66788. var vnode = getFirstComponentChild(slot);
  66789. var componentOptions = vnode && vnode.componentOptions;
  66790. if (componentOptions) {
  66791. // check pattern
  66792. var name = getComponentName(componentOptions);
  66793. var ref = this;
  66794. var include = ref.include;
  66795. var exclude = ref.exclude;
  66796. if (
  66797. // not included
  66798. (include && (!name || !matches(include, name))) ||
  66799. // excluded
  66800. (exclude && name && matches(exclude, name))
  66801. ) {
  66802. return vnode
  66803. }
  66804. var ref$1 = this;
  66805. var cache = ref$1.cache;
  66806. var keys = ref$1.keys;
  66807. var key = vnode.key == null
  66808. // same constructor may get registered as different local components
  66809. // so cid alone is not enough (#3269)
  66810. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  66811. : vnode.key;
  66812. if (cache[key]) {
  66813. vnode.componentInstance = cache[key].componentInstance;
  66814. // make current key freshest
  66815. remove(keys, key);
  66816. keys.push(key);
  66817. } else {
  66818. cache[key] = vnode;
  66819. keys.push(key);
  66820. // prune oldest entry
  66821. if (this.max && keys.length > parseInt(this.max)) {
  66822. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  66823. }
  66824. }
  66825. vnode.data.keepAlive = true;
  66826. }
  66827. return vnode || (slot && slot[0])
  66828. }
  66829. };
  66830. var builtInComponents = {
  66831. KeepAlive: KeepAlive
  66832. };
  66833. /* */
  66834. function initGlobalAPI (Vue) {
  66835. // config
  66836. var configDef = {};
  66837. configDef.get = function () { return config; };
  66838. {
  66839. configDef.set = function () {
  66840. warn(
  66841. 'Do not replace the Vue.config object, set individual fields instead.'
  66842. );
  66843. };
  66844. }
  66845. Object.defineProperty(Vue, 'config', configDef);
  66846. // exposed util methods.
  66847. // NOTE: these are not considered part of the public API - avoid relying on
  66848. // them unless you are aware of the risk.
  66849. Vue.util = {
  66850. warn: warn,
  66851. extend: extend,
  66852. mergeOptions: mergeOptions,
  66853. defineReactive: defineReactive$$1
  66854. };
  66855. Vue.set = set;
  66856. Vue.delete = del;
  66857. Vue.nextTick = nextTick;
  66858. // 2.6 explicit observable API
  66859. Vue.observable = function (obj) {
  66860. observe(obj);
  66861. return obj
  66862. };
  66863. Vue.options = Object.create(null);
  66864. ASSET_TYPES.forEach(function (type) {
  66865. Vue.options[type + 's'] = Object.create(null);
  66866. });
  66867. // this is used to identify the "base" constructor to extend all plain-object
  66868. // components with in Weex's multi-instance scenarios.
  66869. Vue.options._base = Vue;
  66870. extend(Vue.options.components, builtInComponents);
  66871. initUse(Vue);
  66872. initMixin$1(Vue);
  66873. initExtend(Vue);
  66874. initAssetRegisters(Vue);
  66875. }
  66876. initGlobalAPI(Vue);
  66877. Object.defineProperty(Vue.prototype, '$isServer', {
  66878. get: isServerRendering
  66879. });
  66880. Object.defineProperty(Vue.prototype, '$ssrContext', {
  66881. get: function get () {
  66882. /* istanbul ignore next */
  66883. return this.$vnode && this.$vnode.ssrContext
  66884. }
  66885. });
  66886. // expose FunctionalRenderContext for ssr runtime helper installation
  66887. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  66888. value: FunctionalRenderContext
  66889. });
  66890. Vue.version = '2.6.11';
  66891. /* */
  66892. // these are reserved for web because they are directly compiled away
  66893. // during template compilation
  66894. var isReservedAttr = makeMap('style,class');
  66895. // attributes that should be using props for binding
  66896. var acceptValue = makeMap('input,textarea,option,select,progress');
  66897. var mustUseProp = function (tag, type, attr) {
  66898. return (
  66899. (attr === 'value' && acceptValue(tag)) && type !== 'button' ||
  66900. (attr === 'selected' && tag === 'option') ||
  66901. (attr === 'checked' && tag === 'input') ||
  66902. (attr === 'muted' && tag === 'video')
  66903. )
  66904. };
  66905. var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
  66906. var isValidContentEditableValue = makeMap('events,caret,typing,plaintext-only');
  66907. var convertEnumeratedValue = function (key, value) {
  66908. return isFalsyAttrValue(value) || value === 'false'
  66909. ? 'false'
  66910. // allow arbitrary string value for contenteditable
  66911. : key === 'contenteditable' && isValidContentEditableValue(value)
  66912. ? value
  66913. : 'true'
  66914. };
  66915. var isBooleanAttr = makeMap(
  66916. 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
  66917. 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
  66918. 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
  66919. 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
  66920. 'required,reversed,scoped,seamless,selected,sortable,translate,' +
  66921. 'truespeed,typemustmatch,visible'
  66922. );
  66923. var xlinkNS = 'http://www.w3.org/1999/xlink';
  66924. var isXlink = function (name) {
  66925. return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'
  66926. };
  66927. var getXlinkProp = function (name) {
  66928. return isXlink(name) ? name.slice(6, name.length) : ''
  66929. };
  66930. var isFalsyAttrValue = function (val) {
  66931. return val == null || val === false
  66932. };
  66933. /* */
  66934. function genClassForVnode (vnode) {
  66935. var data = vnode.data;
  66936. var parentNode = vnode;
  66937. var childNode = vnode;
  66938. while (isDef(childNode.componentInstance)) {
  66939. childNode = childNode.componentInstance._vnode;
  66940. if (childNode && childNode.data) {
  66941. data = mergeClassData(childNode.data, data);
  66942. }
  66943. }
  66944. while (isDef(parentNode = parentNode.parent)) {
  66945. if (parentNode && parentNode.data) {
  66946. data = mergeClassData(data, parentNode.data);
  66947. }
  66948. }
  66949. return renderClass(data.staticClass, data.class)
  66950. }
  66951. function mergeClassData (child, parent) {
  66952. return {
  66953. staticClass: concat(child.staticClass, parent.staticClass),
  66954. class: isDef(child.class)
  66955. ? [child.class, parent.class]
  66956. : parent.class
  66957. }
  66958. }
  66959. function renderClass (
  66960. staticClass,
  66961. dynamicClass
  66962. ) {
  66963. if (isDef(staticClass) || isDef(dynamicClass)) {
  66964. return concat(staticClass, stringifyClass(dynamicClass))
  66965. }
  66966. /* istanbul ignore next */
  66967. return ''
  66968. }
  66969. function concat (a, b) {
  66970. return a ? b ? (a + ' ' + b) : a : (b || '')
  66971. }
  66972. function stringifyClass (value) {
  66973. if (Array.isArray(value)) {
  66974. return stringifyArray(value)
  66975. }
  66976. if (isObject(value)) {
  66977. return stringifyObject(value)
  66978. }
  66979. if (typeof value === 'string') {
  66980. return value
  66981. }
  66982. /* istanbul ignore next */
  66983. return ''
  66984. }
  66985. function stringifyArray (value) {
  66986. var res = '';
  66987. var stringified;
  66988. for (var i = 0, l = value.length; i < l; i++) {
  66989. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  66990. if (res) { res += ' '; }
  66991. res += stringified;
  66992. }
  66993. }
  66994. return res
  66995. }
  66996. function stringifyObject (value) {
  66997. var res = '';
  66998. for (var key in value) {
  66999. if (value[key]) {
  67000. if (res) { res += ' '; }
  67001. res += key;
  67002. }
  67003. }
  67004. return res
  67005. }
  67006. /* */
  67007. var namespaceMap = {
  67008. svg: 'http://www.w3.org/2000/svg',
  67009. math: 'http://www.w3.org/1998/Math/MathML'
  67010. };
  67011. var isHTMLTag = makeMap(
  67012. 'html,body,base,head,link,meta,style,title,' +
  67013. 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
  67014. 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' +
  67015. 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
  67016. 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
  67017. 'embed,object,param,source,canvas,script,noscript,del,ins,' +
  67018. 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
  67019. 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
  67020. 'output,progress,select,textarea,' +
  67021. 'details,dialog,menu,menuitem,summary,' +
  67022. 'content,element,shadow,template,blockquote,iframe,tfoot'
  67023. );
  67024. // this map is intentionally selective, only covering SVG elements that may
  67025. // contain child elements.
  67026. var isSVG = makeMap(
  67027. 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +
  67028. 'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
  67029. 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',
  67030. true
  67031. );
  67032. var isPreTag = function (tag) { return tag === 'pre'; };
  67033. var isReservedTag = function (tag) {
  67034. return isHTMLTag(tag) || isSVG(tag)
  67035. };
  67036. function getTagNamespace (tag) {
  67037. if (isSVG(tag)) {
  67038. return 'svg'
  67039. }
  67040. // basic support for MathML
  67041. // note it doesn't support other MathML elements being component roots
  67042. if (tag === 'math') {
  67043. return 'math'
  67044. }
  67045. }
  67046. var unknownElementCache = Object.create(null);
  67047. function isUnknownElement (tag) {
  67048. /* istanbul ignore if */
  67049. if (!inBrowser) {
  67050. return true
  67051. }
  67052. if (isReservedTag(tag)) {
  67053. return false
  67054. }
  67055. tag = tag.toLowerCase();
  67056. /* istanbul ignore if */
  67057. if (unknownElementCache[tag] != null) {
  67058. return unknownElementCache[tag]
  67059. }
  67060. var el = document.createElement(tag);
  67061. if (tag.indexOf('-') > -1) {
  67062. // http://stackoverflow.com/a/28210364/1070244
  67063. return (unknownElementCache[tag] = (
  67064. el.constructor === window.HTMLUnknownElement ||
  67065. el.constructor === window.HTMLElement
  67066. ))
  67067. } else {
  67068. return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))
  67069. }
  67070. }
  67071. var isTextInputType = makeMap('text,number,password,search,email,tel,url');
  67072. /* */
  67073. /**
  67074. * Query an element selector if it's not an element already.
  67075. */
  67076. function query (el) {
  67077. if (typeof el === 'string') {
  67078. var selected = document.querySelector(el);
  67079. if (!selected) {
  67080. warn(
  67081. 'Cannot find element: ' + el
  67082. );
  67083. return document.createElement('div')
  67084. }
  67085. return selected
  67086. } else {
  67087. return el
  67088. }
  67089. }
  67090. /* */
  67091. function createElement$1 (tagName, vnode) {
  67092. var elm = document.createElement(tagName);
  67093. if (tagName !== 'select') {
  67094. return elm
  67095. }
  67096. // false or null will remove the attribute but undefined will not
  67097. if (vnode.data && vnode.data.attrs && vnode.data.attrs.multiple !== undefined) {
  67098. elm.setAttribute('multiple', 'multiple');
  67099. }
  67100. return elm
  67101. }
  67102. function createElementNS (namespace, tagName) {
  67103. return document.createElementNS(namespaceMap[namespace], tagName)
  67104. }
  67105. function createTextNode (text) {
  67106. return document.createTextNode(text)
  67107. }
  67108. function createComment (text) {
  67109. return document.createComment(text)
  67110. }
  67111. function insertBefore (parentNode, newNode, referenceNode) {
  67112. parentNode.insertBefore(newNode, referenceNode);
  67113. }
  67114. function removeChild (node, child) {
  67115. node.removeChild(child);
  67116. }
  67117. function appendChild (node, child) {
  67118. node.appendChild(child);
  67119. }
  67120. function parentNode (node) {
  67121. return node.parentNode
  67122. }
  67123. function nextSibling (node) {
  67124. return node.nextSibling
  67125. }
  67126. function tagName (node) {
  67127. return node.tagName
  67128. }
  67129. function setTextContent (node, text) {
  67130. node.textContent = text;
  67131. }
  67132. function setStyleScope (node, scopeId) {
  67133. node.setAttribute(scopeId, '');
  67134. }
  67135. var nodeOps = /*#__PURE__*/Object.freeze({
  67136. createElement: createElement$1,
  67137. createElementNS: createElementNS,
  67138. createTextNode: createTextNode,
  67139. createComment: createComment,
  67140. insertBefore: insertBefore,
  67141. removeChild: removeChild,
  67142. appendChild: appendChild,
  67143. parentNode: parentNode,
  67144. nextSibling: nextSibling,
  67145. tagName: tagName,
  67146. setTextContent: setTextContent,
  67147. setStyleScope: setStyleScope
  67148. });
  67149. /* */
  67150. var ref = {
  67151. create: function create (_, vnode) {
  67152. registerRef(vnode);
  67153. },
  67154. update: function update (oldVnode, vnode) {
  67155. if (oldVnode.data.ref !== vnode.data.ref) {
  67156. registerRef(oldVnode, true);
  67157. registerRef(vnode);
  67158. }
  67159. },
  67160. destroy: function destroy (vnode) {
  67161. registerRef(vnode, true);
  67162. }
  67163. };
  67164. function registerRef (vnode, isRemoval) {
  67165. var key = vnode.data.ref;
  67166. if (!isDef(key)) { return }
  67167. var vm = vnode.context;
  67168. var ref = vnode.componentInstance || vnode.elm;
  67169. var refs = vm.$refs;
  67170. if (isRemoval) {
  67171. if (Array.isArray(refs[key])) {
  67172. remove(refs[key], ref);
  67173. } else if (refs[key] === ref) {
  67174. refs[key] = undefined;
  67175. }
  67176. } else {
  67177. if (vnode.data.refInFor) {
  67178. if (!Array.isArray(refs[key])) {
  67179. refs[key] = [ref];
  67180. } else if (refs[key].indexOf(ref) < 0) {
  67181. // $flow-disable-line
  67182. refs[key].push(ref);
  67183. }
  67184. } else {
  67185. refs[key] = ref;
  67186. }
  67187. }
  67188. }
  67189. /**
  67190. * Virtual DOM patching algorithm based on Snabbdom by
  67191. * Simon Friis Vindum (@paldepind)
  67192. * Licensed under the MIT License
  67193. * https://github.com/paldepind/snabbdom/blob/master/LICENSE
  67194. *
  67195. * modified by Evan You (@yyx990803)
  67196. *
  67197. * Not type-checking this because this file is perf-critical and the cost
  67198. * of making flow understand it is not worth it.
  67199. */
  67200. var emptyNode = new VNode('', {}, []);
  67201. var hooks = ['create', 'activate', 'update', 'remove', 'destroy'];
  67202. function sameVnode (a, b) {
  67203. return (
  67204. a.key === b.key && (
  67205. (
  67206. a.tag === b.tag &&
  67207. a.isComment === b.isComment &&
  67208. isDef(a.data) === isDef(b.data) &&
  67209. sameInputType(a, b)
  67210. ) || (
  67211. isTrue(a.isAsyncPlaceholder) &&
  67212. a.asyncFactory === b.asyncFactory &&
  67213. isUndef(b.asyncFactory.error)
  67214. )
  67215. )
  67216. )
  67217. }
  67218. function sameInputType (a, b) {
  67219. if (a.tag !== 'input') { return true }
  67220. var i;
  67221. var typeA = isDef(i = a.data) && isDef(i = i.attrs) && i.type;
  67222. var typeB = isDef(i = b.data) && isDef(i = i.attrs) && i.type;
  67223. return typeA === typeB || isTextInputType(typeA) && isTextInputType(typeB)
  67224. }
  67225. function createKeyToOldIdx (children, beginIdx, endIdx) {
  67226. var i, key;
  67227. var map = {};
  67228. for (i = beginIdx; i <= endIdx; ++i) {
  67229. key = children[i].key;
  67230. if (isDef(key)) { map[key] = i; }
  67231. }
  67232. return map
  67233. }
  67234. function createPatchFunction (backend) {
  67235. var i, j;
  67236. var cbs = {};
  67237. var modules = backend.modules;
  67238. var nodeOps = backend.nodeOps;
  67239. for (i = 0; i < hooks.length; ++i) {
  67240. cbs[hooks[i]] = [];
  67241. for (j = 0; j < modules.length; ++j) {
  67242. if (isDef(modules[j][hooks[i]])) {
  67243. cbs[hooks[i]].push(modules[j][hooks[i]]);
  67244. }
  67245. }
  67246. }
  67247. function emptyNodeAt (elm) {
  67248. return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)
  67249. }
  67250. function createRmCb (childElm, listeners) {
  67251. function remove$$1 () {
  67252. if (--remove$$1.listeners === 0) {
  67253. removeNode(childElm);
  67254. }
  67255. }
  67256. remove$$1.listeners = listeners;
  67257. return remove$$1
  67258. }
  67259. function removeNode (el) {
  67260. var parent = nodeOps.parentNode(el);
  67261. // element may have already been removed due to v-html / v-text
  67262. if (isDef(parent)) {
  67263. nodeOps.removeChild(parent, el);
  67264. }
  67265. }
  67266. function isUnknownElement$$1 (vnode, inVPre) {
  67267. return (
  67268. !inVPre &&
  67269. !vnode.ns &&
  67270. !(
  67271. config.ignoredElements.length &&
  67272. config.ignoredElements.some(function (ignore) {
  67273. return isRegExp(ignore)
  67274. ? ignore.test(vnode.tag)
  67275. : ignore === vnode.tag
  67276. })
  67277. ) &&
  67278. config.isUnknownElement(vnode.tag)
  67279. )
  67280. }
  67281. var creatingElmInVPre = 0;
  67282. function createElm (
  67283. vnode,
  67284. insertedVnodeQueue,
  67285. parentElm,
  67286. refElm,
  67287. nested,
  67288. ownerArray,
  67289. index
  67290. ) {
  67291. if (isDef(vnode.elm) && isDef(ownerArray)) {
  67292. // This vnode was used in a previous render!
  67293. // now it's used as a new node, overwriting its elm would cause
  67294. // potential patch errors down the road when it's used as an insertion
  67295. // reference node. Instead, we clone the node on-demand before creating
  67296. // associated DOM element for it.
  67297. vnode = ownerArray[index] = cloneVNode(vnode);
  67298. }
  67299. vnode.isRootInsert = !nested; // for transition enter check
  67300. if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
  67301. return
  67302. }
  67303. var data = vnode.data;
  67304. var children = vnode.children;
  67305. var tag = vnode.tag;
  67306. if (isDef(tag)) {
  67307. {
  67308. if (data && data.pre) {
  67309. creatingElmInVPre++;
  67310. }
  67311. if (isUnknownElement$$1(vnode, creatingElmInVPre)) {
  67312. warn(
  67313. 'Unknown custom element: <' + tag + '> - did you ' +
  67314. 'register the component correctly? For recursive components, ' +
  67315. 'make sure to provide the "name" option.',
  67316. vnode.context
  67317. );
  67318. }
  67319. }
  67320. vnode.elm = vnode.ns
  67321. ? nodeOps.createElementNS(vnode.ns, tag)
  67322. : nodeOps.createElement(tag, vnode);
  67323. setScope(vnode);
  67324. /* istanbul ignore if */
  67325. {
  67326. createChildren(vnode, children, insertedVnodeQueue);
  67327. if (isDef(data)) {
  67328. invokeCreateHooks(vnode, insertedVnodeQueue);
  67329. }
  67330. insert(parentElm, vnode.elm, refElm);
  67331. }
  67332. if (data && data.pre) {
  67333. creatingElmInVPre--;
  67334. }
  67335. } else if (isTrue(vnode.isComment)) {
  67336. vnode.elm = nodeOps.createComment(vnode.text);
  67337. insert(parentElm, vnode.elm, refElm);
  67338. } else {
  67339. vnode.elm = nodeOps.createTextNode(vnode.text);
  67340. insert(parentElm, vnode.elm, refElm);
  67341. }
  67342. }
  67343. function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
  67344. var i = vnode.data;
  67345. if (isDef(i)) {
  67346. var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;
  67347. if (isDef(i = i.hook) && isDef(i = i.init)) {
  67348. i(vnode, false /* hydrating */);
  67349. }
  67350. // after calling the init hook, if the vnode is a child component
  67351. // it should've created a child instance and mounted it. the child
  67352. // component also has set the placeholder vnode's elm.
  67353. // in that case we can just return the element and be done.
  67354. if (isDef(vnode.componentInstance)) {
  67355. initComponent(vnode, insertedVnodeQueue);
  67356. insert(parentElm, vnode.elm, refElm);
  67357. if (isTrue(isReactivated)) {
  67358. reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);
  67359. }
  67360. return true
  67361. }
  67362. }
  67363. }
  67364. function initComponent (vnode, insertedVnodeQueue) {
  67365. if (isDef(vnode.data.pendingInsert)) {
  67366. insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
  67367. vnode.data.pendingInsert = null;
  67368. }
  67369. vnode.elm = vnode.componentInstance.$el;
  67370. if (isPatchable(vnode)) {
  67371. invokeCreateHooks(vnode, insertedVnodeQueue);
  67372. setScope(vnode);
  67373. } else {
  67374. // empty component root.
  67375. // skip all element-related modules except for ref (#3455)
  67376. registerRef(vnode);
  67377. // make sure to invoke the insert hook
  67378. insertedVnodeQueue.push(vnode);
  67379. }
  67380. }
  67381. function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
  67382. var i;
  67383. // hack for #4339: a reactivated component with inner transition
  67384. // does not trigger because the inner node's created hooks are not called
  67385. // again. It's not ideal to involve module-specific logic in here but
  67386. // there doesn't seem to be a better way to do it.
  67387. var innerNode = vnode;
  67388. while (innerNode.componentInstance) {
  67389. innerNode = innerNode.componentInstance._vnode;
  67390. if (isDef(i = innerNode.data) && isDef(i = i.transition)) {
  67391. for (i = 0; i < cbs.activate.length; ++i) {
  67392. cbs.activate[i](emptyNode, innerNode);
  67393. }
  67394. insertedVnodeQueue.push(innerNode);
  67395. break
  67396. }
  67397. }
  67398. // unlike a newly created component,
  67399. // a reactivated keep-alive component doesn't insert itself
  67400. insert(parentElm, vnode.elm, refElm);
  67401. }
  67402. function insert (parent, elm, ref$$1) {
  67403. if (isDef(parent)) {
  67404. if (isDef(ref$$1)) {
  67405. if (nodeOps.parentNode(ref$$1) === parent) {
  67406. nodeOps.insertBefore(parent, elm, ref$$1);
  67407. }
  67408. } else {
  67409. nodeOps.appendChild(parent, elm);
  67410. }
  67411. }
  67412. }
  67413. function createChildren (vnode, children, insertedVnodeQueue) {
  67414. if (Array.isArray(children)) {
  67415. {
  67416. checkDuplicateKeys(children);
  67417. }
  67418. for (var i = 0; i < children.length; ++i) {
  67419. createElm(children[i], insertedVnodeQueue, vnode.elm, null, true, children, i);
  67420. }
  67421. } else if (isPrimitive(vnode.text)) {
  67422. nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text)));
  67423. }
  67424. }
  67425. function isPatchable (vnode) {
  67426. while (vnode.componentInstance) {
  67427. vnode = vnode.componentInstance._vnode;
  67428. }
  67429. return isDef(vnode.tag)
  67430. }
  67431. function invokeCreateHooks (vnode, insertedVnodeQueue) {
  67432. for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
  67433. cbs.create[i$1](emptyNode, vnode);
  67434. }
  67435. i = vnode.data.hook; // Reuse variable
  67436. if (isDef(i)) {
  67437. if (isDef(i.create)) { i.create(emptyNode, vnode); }
  67438. if (isDef(i.insert)) { insertedVnodeQueue.push(vnode); }
  67439. }
  67440. }
  67441. // set scope id attribute for scoped CSS.
  67442. // this is implemented as a special case to avoid the overhead
  67443. // of going through the normal attribute patching process.
  67444. function setScope (vnode) {
  67445. var i;
  67446. if (isDef(i = vnode.fnScopeId)) {
  67447. nodeOps.setStyleScope(vnode.elm, i);
  67448. } else {
  67449. var ancestor = vnode;
  67450. while (ancestor) {
  67451. if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {
  67452. nodeOps.setStyleScope(vnode.elm, i);
  67453. }
  67454. ancestor = ancestor.parent;
  67455. }
  67456. }
  67457. // for slot content they should also get the scopeId from the host instance.
  67458. if (isDef(i = activeInstance) &&
  67459. i !== vnode.context &&
  67460. i !== vnode.fnContext &&
  67461. isDef(i = i.$options._scopeId)
  67462. ) {
  67463. nodeOps.setStyleScope(vnode.elm, i);
  67464. }
  67465. }
  67466. function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
  67467. for (; startIdx <= endIdx; ++startIdx) {
  67468. createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx);
  67469. }
  67470. }
  67471. function invokeDestroyHook (vnode) {
  67472. var i, j;
  67473. var data = vnode.data;
  67474. if (isDef(data)) {
  67475. if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }
  67476. for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }
  67477. }
  67478. if (isDef(i = vnode.children)) {
  67479. for (j = 0; j < vnode.children.length; ++j) {
  67480. invokeDestroyHook(vnode.children[j]);
  67481. }
  67482. }
  67483. }
  67484. function removeVnodes (vnodes, startIdx, endIdx) {
  67485. for (; startIdx <= endIdx; ++startIdx) {
  67486. var ch = vnodes[startIdx];
  67487. if (isDef(ch)) {
  67488. if (isDef(ch.tag)) {
  67489. removeAndInvokeRemoveHook(ch);
  67490. invokeDestroyHook(ch);
  67491. } else { // Text node
  67492. removeNode(ch.elm);
  67493. }
  67494. }
  67495. }
  67496. }
  67497. function removeAndInvokeRemoveHook (vnode, rm) {
  67498. if (isDef(rm) || isDef(vnode.data)) {
  67499. var i;
  67500. var listeners = cbs.remove.length + 1;
  67501. if (isDef(rm)) {
  67502. // we have a recursively passed down rm callback
  67503. // increase the listeners count
  67504. rm.listeners += listeners;
  67505. } else {
  67506. // directly removing
  67507. rm = createRmCb(vnode.elm, listeners);
  67508. }
  67509. // recursively invoke hooks on child component root node
  67510. if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {
  67511. removeAndInvokeRemoveHook(i, rm);
  67512. }
  67513. for (i = 0; i < cbs.remove.length; ++i) {
  67514. cbs.remove[i](vnode, rm);
  67515. }
  67516. if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {
  67517. i(vnode, rm);
  67518. } else {
  67519. rm();
  67520. }
  67521. } else {
  67522. removeNode(vnode.elm);
  67523. }
  67524. }
  67525. function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
  67526. var oldStartIdx = 0;
  67527. var newStartIdx = 0;
  67528. var oldEndIdx = oldCh.length - 1;
  67529. var oldStartVnode = oldCh[0];
  67530. var oldEndVnode = oldCh[oldEndIdx];
  67531. var newEndIdx = newCh.length - 1;
  67532. var newStartVnode = newCh[0];
  67533. var newEndVnode = newCh[newEndIdx];
  67534. var oldKeyToIdx, idxInOld, vnodeToMove, refElm;
  67535. // removeOnly is a special flag used only by <transition-group>
  67536. // to ensure removed elements stay in correct relative positions
  67537. // during leaving transitions
  67538. var canMove = !removeOnly;
  67539. {
  67540. checkDuplicateKeys(newCh);
  67541. }
  67542. while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
  67543. if (isUndef(oldStartVnode)) {
  67544. oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
  67545. } else if (isUndef(oldEndVnode)) {
  67546. oldEndVnode = oldCh[--oldEndIdx];
  67547. } else if (sameVnode(oldStartVnode, newStartVnode)) {
  67548. patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  67549. oldStartVnode = oldCh[++oldStartIdx];
  67550. newStartVnode = newCh[++newStartIdx];
  67551. } else if (sameVnode(oldEndVnode, newEndVnode)) {
  67552. patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
  67553. oldEndVnode = oldCh[--oldEndIdx];
  67554. newEndVnode = newCh[--newEndIdx];
  67555. } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right
  67556. patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
  67557. canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
  67558. oldStartVnode = oldCh[++oldStartIdx];
  67559. newEndVnode = newCh[--newEndIdx];
  67560. } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left
  67561. patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  67562. canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
  67563. oldEndVnode = oldCh[--oldEndIdx];
  67564. newStartVnode = newCh[++newStartIdx];
  67565. } else {
  67566. if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }
  67567. idxInOld = isDef(newStartVnode.key)
  67568. ? oldKeyToIdx[newStartVnode.key]
  67569. : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx);
  67570. if (isUndef(idxInOld)) { // New element
  67571. createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
  67572. } else {
  67573. vnodeToMove = oldCh[idxInOld];
  67574. if (sameVnode(vnodeToMove, newStartVnode)) {
  67575. patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  67576. oldCh[idxInOld] = undefined;
  67577. canMove && nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm);
  67578. } else {
  67579. // same key but different element. treat as new element
  67580. createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
  67581. }
  67582. }
  67583. newStartVnode = newCh[++newStartIdx];
  67584. }
  67585. }
  67586. if (oldStartIdx > oldEndIdx) {
  67587. refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
  67588. addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
  67589. } else if (newStartIdx > newEndIdx) {
  67590. removeVnodes(oldCh, oldStartIdx, oldEndIdx);
  67591. }
  67592. }
  67593. function checkDuplicateKeys (children) {
  67594. var seenKeys = {};
  67595. for (var i = 0; i < children.length; i++) {
  67596. var vnode = children[i];
  67597. var key = vnode.key;
  67598. if (isDef(key)) {
  67599. if (seenKeys[key]) {
  67600. warn(
  67601. ("Duplicate keys detected: '" + key + "'. This may cause an update error."),
  67602. vnode.context
  67603. );
  67604. } else {
  67605. seenKeys[key] = true;
  67606. }
  67607. }
  67608. }
  67609. }
  67610. function findIdxInOld (node, oldCh, start, end) {
  67611. for (var i = start; i < end; i++) {
  67612. var c = oldCh[i];
  67613. if (isDef(c) && sameVnode(node, c)) { return i }
  67614. }
  67615. }
  67616. function patchVnode (
  67617. oldVnode,
  67618. vnode,
  67619. insertedVnodeQueue,
  67620. ownerArray,
  67621. index,
  67622. removeOnly
  67623. ) {
  67624. if (oldVnode === vnode) {
  67625. return
  67626. }
  67627. if (isDef(vnode.elm) && isDef(ownerArray)) {
  67628. // clone reused vnode
  67629. vnode = ownerArray[index] = cloneVNode(vnode);
  67630. }
  67631. var elm = vnode.elm = oldVnode.elm;
  67632. if (isTrue(oldVnode.isAsyncPlaceholder)) {
  67633. if (isDef(vnode.asyncFactory.resolved)) {
  67634. hydrate(oldVnode.elm, vnode, insertedVnodeQueue);
  67635. } else {
  67636. vnode.isAsyncPlaceholder = true;
  67637. }
  67638. return
  67639. }
  67640. // reuse element for static trees.
  67641. // note we only do this if the vnode is cloned -
  67642. // if the new node is not cloned it means the render functions have been
  67643. // reset by the hot-reload-api and we need to do a proper re-render.
  67644. if (isTrue(vnode.isStatic) &&
  67645. isTrue(oldVnode.isStatic) &&
  67646. vnode.key === oldVnode.key &&
  67647. (isTrue(vnode.isCloned) || isTrue(vnode.isOnce))
  67648. ) {
  67649. vnode.componentInstance = oldVnode.componentInstance;
  67650. return
  67651. }
  67652. var i;
  67653. var data = vnode.data;
  67654. if (isDef(data) && isDef(i = data.hook) && isDef(i = i.prepatch)) {
  67655. i(oldVnode, vnode);
  67656. }
  67657. var oldCh = oldVnode.children;
  67658. var ch = vnode.children;
  67659. if (isDef(data) && isPatchable(vnode)) {
  67660. for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); }
  67661. if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); }
  67662. }
  67663. if (isUndef(vnode.text)) {
  67664. if (isDef(oldCh) && isDef(ch)) {
  67665. if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); }
  67666. } else if (isDef(ch)) {
  67667. {
  67668. checkDuplicateKeys(ch);
  67669. }
  67670. if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
  67671. addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
  67672. } else if (isDef(oldCh)) {
  67673. removeVnodes(oldCh, 0, oldCh.length - 1);
  67674. } else if (isDef(oldVnode.text)) {
  67675. nodeOps.setTextContent(elm, '');
  67676. }
  67677. } else if (oldVnode.text !== vnode.text) {
  67678. nodeOps.setTextContent(elm, vnode.text);
  67679. }
  67680. if (isDef(data)) {
  67681. if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); }
  67682. }
  67683. }
  67684. function invokeInsertHook (vnode, queue, initial) {
  67685. // delay insert hooks for component root nodes, invoke them after the
  67686. // element is really inserted
  67687. if (isTrue(initial) && isDef(vnode.parent)) {
  67688. vnode.parent.data.pendingInsert = queue;
  67689. } else {
  67690. for (var i = 0; i < queue.length; ++i) {
  67691. queue[i].data.hook.insert(queue[i]);
  67692. }
  67693. }
  67694. }
  67695. var hydrationBailed = false;
  67696. // list of modules that can skip create hook during hydration because they
  67697. // are already rendered on the client or has no need for initialization
  67698. // Note: style is excluded because it relies on initial clone for future
  67699. // deep updates (#7063).
  67700. var isRenderedModule = makeMap('attrs,class,staticClass,staticStyle,key');
  67701. // Note: this is a browser-only function so we can assume elms are DOM nodes.
  67702. function hydrate (elm, vnode, insertedVnodeQueue, inVPre) {
  67703. var i;
  67704. var tag = vnode.tag;
  67705. var data = vnode.data;
  67706. var children = vnode.children;
  67707. inVPre = inVPre || (data && data.pre);
  67708. vnode.elm = elm;
  67709. if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) {
  67710. vnode.isAsyncPlaceholder = true;
  67711. return true
  67712. }
  67713. // assert node match
  67714. {
  67715. if (!assertNodeMatch(elm, vnode, inVPre)) {
  67716. return false
  67717. }
  67718. }
  67719. if (isDef(data)) {
  67720. if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); }
  67721. if (isDef(i = vnode.componentInstance)) {
  67722. // child component. it should have hydrated its own tree.
  67723. initComponent(vnode, insertedVnodeQueue);
  67724. return true
  67725. }
  67726. }
  67727. if (isDef(tag)) {
  67728. if (isDef(children)) {
  67729. // empty element, allow client to pick up and populate children
  67730. if (!elm.hasChildNodes()) {
  67731. createChildren(vnode, children, insertedVnodeQueue);
  67732. } else {
  67733. // v-html and domProps: innerHTML
  67734. if (isDef(i = data) && isDef(i = i.domProps) && isDef(i = i.innerHTML)) {
  67735. if (i !== elm.innerHTML) {
  67736. /* istanbul ignore if */
  67737. if (typeof console !== 'undefined' &&
  67738. !hydrationBailed
  67739. ) {
  67740. hydrationBailed = true;
  67741. console.warn('Parent: ', elm);
  67742. console.warn('server innerHTML: ', i);
  67743. console.warn('client innerHTML: ', elm.innerHTML);
  67744. }
  67745. return false
  67746. }
  67747. } else {
  67748. // iterate and compare children lists
  67749. var childrenMatch = true;
  67750. var childNode = elm.firstChild;
  67751. for (var i$1 = 0; i$1 < children.length; i$1++) {
  67752. if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue, inVPre)) {
  67753. childrenMatch = false;
  67754. break
  67755. }
  67756. childNode = childNode.nextSibling;
  67757. }
  67758. // if childNode is not null, it means the actual childNodes list is
  67759. // longer than the virtual children list.
  67760. if (!childrenMatch || childNode) {
  67761. /* istanbul ignore if */
  67762. if (typeof console !== 'undefined' &&
  67763. !hydrationBailed
  67764. ) {
  67765. hydrationBailed = true;
  67766. console.warn('Parent: ', elm);
  67767. console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);
  67768. }
  67769. return false
  67770. }
  67771. }
  67772. }
  67773. }
  67774. if (isDef(data)) {
  67775. var fullInvoke = false;
  67776. for (var key in data) {
  67777. if (!isRenderedModule(key)) {
  67778. fullInvoke = true;
  67779. invokeCreateHooks(vnode, insertedVnodeQueue);
  67780. break
  67781. }
  67782. }
  67783. if (!fullInvoke && data['class']) {
  67784. // ensure collecting deps for deep class bindings for future updates
  67785. traverse(data['class']);
  67786. }
  67787. }
  67788. } else if (elm.data !== vnode.text) {
  67789. elm.data = vnode.text;
  67790. }
  67791. return true
  67792. }
  67793. function assertNodeMatch (node, vnode, inVPre) {
  67794. if (isDef(vnode.tag)) {
  67795. return vnode.tag.indexOf('vue-component') === 0 || (
  67796. !isUnknownElement$$1(vnode, inVPre) &&
  67797. vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase())
  67798. )
  67799. } else {
  67800. return node.nodeType === (vnode.isComment ? 8 : 3)
  67801. }
  67802. }
  67803. return function patch (oldVnode, vnode, hydrating, removeOnly) {
  67804. if (isUndef(vnode)) {
  67805. if (isDef(oldVnode)) { invokeDestroyHook(oldVnode); }
  67806. return
  67807. }
  67808. var isInitialPatch = false;
  67809. var insertedVnodeQueue = [];
  67810. if (isUndef(oldVnode)) {
  67811. // empty mount (likely as component), create new root element
  67812. isInitialPatch = true;
  67813. createElm(vnode, insertedVnodeQueue);
  67814. } else {
  67815. var isRealElement = isDef(oldVnode.nodeType);
  67816. if (!isRealElement && sameVnode(oldVnode, vnode)) {
  67817. // patch existing root node
  67818. patchVnode(oldVnode, vnode, insertedVnodeQueue, null, null, removeOnly);
  67819. } else {
  67820. if (isRealElement) {
  67821. // mounting to a real element
  67822. // check if this is server-rendered content and if we can perform
  67823. // a successful hydration.
  67824. if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {
  67825. oldVnode.removeAttribute(SSR_ATTR);
  67826. hydrating = true;
  67827. }
  67828. if (isTrue(hydrating)) {
  67829. if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
  67830. invokeInsertHook(vnode, insertedVnodeQueue, true);
  67831. return oldVnode
  67832. } else {
  67833. warn(
  67834. 'The client-side rendered virtual DOM tree is not matching ' +
  67835. 'server-rendered content. This is likely caused by incorrect ' +
  67836. 'HTML markup, for example nesting block-level elements inside ' +
  67837. '<p>, or missing <tbody>. Bailing hydration and performing ' +
  67838. 'full client-side render.'
  67839. );
  67840. }
  67841. }
  67842. // either not server-rendered, or hydration failed.
  67843. // create an empty node and replace it
  67844. oldVnode = emptyNodeAt(oldVnode);
  67845. }
  67846. // replacing existing element
  67847. var oldElm = oldVnode.elm;
  67848. var parentElm = nodeOps.parentNode(oldElm);
  67849. // create new node
  67850. createElm(
  67851. vnode,
  67852. insertedVnodeQueue,
  67853. // extremely rare edge case: do not insert if old element is in a
  67854. // leaving transition. Only happens when combining transition +
  67855. // keep-alive + HOCs. (#4590)
  67856. oldElm._leaveCb ? null : parentElm,
  67857. nodeOps.nextSibling(oldElm)
  67858. );
  67859. // update parent placeholder node element, recursively
  67860. if (isDef(vnode.parent)) {
  67861. var ancestor = vnode.parent;
  67862. var patchable = isPatchable(vnode);
  67863. while (ancestor) {
  67864. for (var i = 0; i < cbs.destroy.length; ++i) {
  67865. cbs.destroy[i](ancestor);
  67866. }
  67867. ancestor.elm = vnode.elm;
  67868. if (patchable) {
  67869. for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
  67870. cbs.create[i$1](emptyNode, ancestor);
  67871. }
  67872. // #6513
  67873. // invoke insert hooks that may have been merged by create hooks.
  67874. // e.g. for directives that uses the "inserted" hook.
  67875. var insert = ancestor.data.hook.insert;
  67876. if (insert.merged) {
  67877. // start at index 1 to avoid re-invoking component mounted hook
  67878. for (var i$2 = 1; i$2 < insert.fns.length; i$2++) {
  67879. insert.fns[i$2]();
  67880. }
  67881. }
  67882. } else {
  67883. registerRef(ancestor);
  67884. }
  67885. ancestor = ancestor.parent;
  67886. }
  67887. }
  67888. // destroy old node
  67889. if (isDef(parentElm)) {
  67890. removeVnodes([oldVnode], 0, 0);
  67891. } else if (isDef(oldVnode.tag)) {
  67892. invokeDestroyHook(oldVnode);
  67893. }
  67894. }
  67895. }
  67896. invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
  67897. return vnode.elm
  67898. }
  67899. }
  67900. /* */
  67901. var directives = {
  67902. create: updateDirectives,
  67903. update: updateDirectives,
  67904. destroy: function unbindDirectives (vnode) {
  67905. updateDirectives(vnode, emptyNode);
  67906. }
  67907. };
  67908. function updateDirectives (oldVnode, vnode) {
  67909. if (oldVnode.data.directives || vnode.data.directives) {
  67910. _update(oldVnode, vnode);
  67911. }
  67912. }
  67913. function _update (oldVnode, vnode) {
  67914. var isCreate = oldVnode === emptyNode;
  67915. var isDestroy = vnode === emptyNode;
  67916. var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);
  67917. var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);
  67918. var dirsWithInsert = [];
  67919. var dirsWithPostpatch = [];
  67920. var key, oldDir, dir;
  67921. for (key in newDirs) {
  67922. oldDir = oldDirs[key];
  67923. dir = newDirs[key];
  67924. if (!oldDir) {
  67925. // new directive, bind
  67926. callHook$1(dir, 'bind', vnode, oldVnode);
  67927. if (dir.def && dir.def.inserted) {
  67928. dirsWithInsert.push(dir);
  67929. }
  67930. } else {
  67931. // existing directive, update
  67932. dir.oldValue = oldDir.value;
  67933. dir.oldArg = oldDir.arg;
  67934. callHook$1(dir, 'update', vnode, oldVnode);
  67935. if (dir.def && dir.def.componentUpdated) {
  67936. dirsWithPostpatch.push(dir);
  67937. }
  67938. }
  67939. }
  67940. if (dirsWithInsert.length) {
  67941. var callInsert = function () {
  67942. for (var i = 0; i < dirsWithInsert.length; i++) {
  67943. callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode);
  67944. }
  67945. };
  67946. if (isCreate) {
  67947. mergeVNodeHook(vnode, 'insert', callInsert);
  67948. } else {
  67949. callInsert();
  67950. }
  67951. }
  67952. if (dirsWithPostpatch.length) {
  67953. mergeVNodeHook(vnode, 'postpatch', function () {
  67954. for (var i = 0; i < dirsWithPostpatch.length; i++) {
  67955. callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);
  67956. }
  67957. });
  67958. }
  67959. if (!isCreate) {
  67960. for (key in oldDirs) {
  67961. if (!newDirs[key]) {
  67962. // no longer present, unbind
  67963. callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);
  67964. }
  67965. }
  67966. }
  67967. }
  67968. var emptyModifiers = Object.create(null);
  67969. function normalizeDirectives$1 (
  67970. dirs,
  67971. vm
  67972. ) {
  67973. var res = Object.create(null);
  67974. if (!dirs) {
  67975. // $flow-disable-line
  67976. return res
  67977. }
  67978. var i, dir;
  67979. for (i = 0; i < dirs.length; i++) {
  67980. dir = dirs[i];
  67981. if (!dir.modifiers) {
  67982. // $flow-disable-line
  67983. dir.modifiers = emptyModifiers;
  67984. }
  67985. res[getRawDirName(dir)] = dir;
  67986. dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);
  67987. }
  67988. // $flow-disable-line
  67989. return res
  67990. }
  67991. function getRawDirName (dir) {
  67992. return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.')))
  67993. }
  67994. function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) {
  67995. var fn = dir.def && dir.def[hook];
  67996. if (fn) {
  67997. try {
  67998. fn(vnode.elm, dir, vnode, oldVnode, isDestroy);
  67999. } catch (e) {
  68000. handleError(e, vnode.context, ("directive " + (dir.name) + " " + hook + " hook"));
  68001. }
  68002. }
  68003. }
  68004. var baseModules = [
  68005. ref,
  68006. directives
  68007. ];
  68008. /* */
  68009. function updateAttrs (oldVnode, vnode) {
  68010. var opts = vnode.componentOptions;
  68011. if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) {
  68012. return
  68013. }
  68014. if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) {
  68015. return
  68016. }
  68017. var key, cur, old;
  68018. var elm = vnode.elm;
  68019. var oldAttrs = oldVnode.data.attrs || {};
  68020. var attrs = vnode.data.attrs || {};
  68021. // clone observed objects, as the user probably wants to mutate it
  68022. if (isDef(attrs.__ob__)) {
  68023. attrs = vnode.data.attrs = extend({}, attrs);
  68024. }
  68025. for (key in attrs) {
  68026. cur = attrs[key];
  68027. old = oldAttrs[key];
  68028. if (old !== cur) {
  68029. setAttr(elm, key, cur);
  68030. }
  68031. }
  68032. // #4391: in IE9, setting type can reset value for input[type=radio]
  68033. // #6666: IE/Edge forces progress value down to 1 before setting a max
  68034. /* istanbul ignore if */
  68035. if ((isIE || isEdge) && attrs.value !== oldAttrs.value) {
  68036. setAttr(elm, 'value', attrs.value);
  68037. }
  68038. for (key in oldAttrs) {
  68039. if (isUndef(attrs[key])) {
  68040. if (isXlink(key)) {
  68041. elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
  68042. } else if (!isEnumeratedAttr(key)) {
  68043. elm.removeAttribute(key);
  68044. }
  68045. }
  68046. }
  68047. }
  68048. function setAttr (el, key, value) {
  68049. if (el.tagName.indexOf('-') > -1) {
  68050. baseSetAttr(el, key, value);
  68051. } else if (isBooleanAttr(key)) {
  68052. // set attribute for blank value
  68053. // e.g. <option disabled>Select one</option>
  68054. if (isFalsyAttrValue(value)) {
  68055. el.removeAttribute(key);
  68056. } else {
  68057. // technically allowfullscreen is a boolean attribute for <iframe>,
  68058. // but Flash expects a value of "true" when used on <embed> tag
  68059. value = key === 'allowfullscreen' && el.tagName === 'EMBED'
  68060. ? 'true'
  68061. : key;
  68062. el.setAttribute(key, value);
  68063. }
  68064. } else if (isEnumeratedAttr(key)) {
  68065. el.setAttribute(key, convertEnumeratedValue(key, value));
  68066. } else if (isXlink(key)) {
  68067. if (isFalsyAttrValue(value)) {
  68068. el.removeAttributeNS(xlinkNS, getXlinkProp(key));
  68069. } else {
  68070. el.setAttributeNS(xlinkNS, key, value);
  68071. }
  68072. } else {
  68073. baseSetAttr(el, key, value);
  68074. }
  68075. }
  68076. function baseSetAttr (el, key, value) {
  68077. if (isFalsyAttrValue(value)) {
  68078. el.removeAttribute(key);
  68079. } else {
  68080. // #7138: IE10 & 11 fires input event when setting placeholder on
  68081. // <textarea>... block the first input event and remove the blocker
  68082. // immediately.
  68083. /* istanbul ignore if */
  68084. if (
  68085. isIE && !isIE9 &&
  68086. el.tagName === 'TEXTAREA' &&
  68087. key === 'placeholder' && value !== '' && !el.__ieph
  68088. ) {
  68089. var blocker = function (e) {
  68090. e.stopImmediatePropagation();
  68091. el.removeEventListener('input', blocker);
  68092. };
  68093. el.addEventListener('input', blocker);
  68094. // $flow-disable-line
  68095. el.__ieph = true; /* IE placeholder patched */
  68096. }
  68097. el.setAttribute(key, value);
  68098. }
  68099. }
  68100. var attrs = {
  68101. create: updateAttrs,
  68102. update: updateAttrs
  68103. };
  68104. /* */
  68105. function updateClass (oldVnode, vnode) {
  68106. var el = vnode.elm;
  68107. var data = vnode.data;
  68108. var oldData = oldVnode.data;
  68109. if (
  68110. isUndef(data.staticClass) &&
  68111. isUndef(data.class) && (
  68112. isUndef(oldData) || (
  68113. isUndef(oldData.staticClass) &&
  68114. isUndef(oldData.class)
  68115. )
  68116. )
  68117. ) {
  68118. return
  68119. }
  68120. var cls = genClassForVnode(vnode);
  68121. // handle transition classes
  68122. var transitionClass = el._transitionClasses;
  68123. if (isDef(transitionClass)) {
  68124. cls = concat(cls, stringifyClass(transitionClass));
  68125. }
  68126. // set the class
  68127. if (cls !== el._prevClass) {
  68128. el.setAttribute('class', cls);
  68129. el._prevClass = cls;
  68130. }
  68131. }
  68132. var klass = {
  68133. create: updateClass,
  68134. update: updateClass
  68135. };
  68136. /* */
  68137. var validDivisionCharRE = /[\w).+\-_$\]]/;
  68138. function parseFilters (exp) {
  68139. var inSingle = false;
  68140. var inDouble = false;
  68141. var inTemplateString = false;
  68142. var inRegex = false;
  68143. var curly = 0;
  68144. var square = 0;
  68145. var paren = 0;
  68146. var lastFilterIndex = 0;
  68147. var c, prev, i, expression, filters;
  68148. for (i = 0; i < exp.length; i++) {
  68149. prev = c;
  68150. c = exp.charCodeAt(i);
  68151. if (inSingle) {
  68152. if (c === 0x27 && prev !== 0x5C) { inSingle = false; }
  68153. } else if (inDouble) {
  68154. if (c === 0x22 && prev !== 0x5C) { inDouble = false; }
  68155. } else if (inTemplateString) {
  68156. if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; }
  68157. } else if (inRegex) {
  68158. if (c === 0x2f && prev !== 0x5C) { inRegex = false; }
  68159. } else if (
  68160. c === 0x7C && // pipe
  68161. exp.charCodeAt(i + 1) !== 0x7C &&
  68162. exp.charCodeAt(i - 1) !== 0x7C &&
  68163. !curly && !square && !paren
  68164. ) {
  68165. if (expression === undefined) {
  68166. // first filter, end of expression
  68167. lastFilterIndex = i + 1;
  68168. expression = exp.slice(0, i).trim();
  68169. } else {
  68170. pushFilter();
  68171. }
  68172. } else {
  68173. switch (c) {
  68174. case 0x22: inDouble = true; break // "
  68175. case 0x27: inSingle = true; break // '
  68176. case 0x60: inTemplateString = true; break // `
  68177. case 0x28: paren++; break // (
  68178. case 0x29: paren--; break // )
  68179. case 0x5B: square++; break // [
  68180. case 0x5D: square--; break // ]
  68181. case 0x7B: curly++; break // {
  68182. case 0x7D: curly--; break // }
  68183. }
  68184. if (c === 0x2f) { // /
  68185. var j = i - 1;
  68186. var p = (void 0);
  68187. // find first non-whitespace prev char
  68188. for (; j >= 0; j--) {
  68189. p = exp.charAt(j);
  68190. if (p !== ' ') { break }
  68191. }
  68192. if (!p || !validDivisionCharRE.test(p)) {
  68193. inRegex = true;
  68194. }
  68195. }
  68196. }
  68197. }
  68198. if (expression === undefined) {
  68199. expression = exp.slice(0, i).trim();
  68200. } else if (lastFilterIndex !== 0) {
  68201. pushFilter();
  68202. }
  68203. function pushFilter () {
  68204. (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim());
  68205. lastFilterIndex = i + 1;
  68206. }
  68207. if (filters) {
  68208. for (i = 0; i < filters.length; i++) {
  68209. expression = wrapFilter(expression, filters[i]);
  68210. }
  68211. }
  68212. return expression
  68213. }
  68214. function wrapFilter (exp, filter) {
  68215. var i = filter.indexOf('(');
  68216. if (i < 0) {
  68217. // _f: resolveFilter
  68218. return ("_f(\"" + filter + "\")(" + exp + ")")
  68219. } else {
  68220. var name = filter.slice(0, i);
  68221. var args = filter.slice(i + 1);
  68222. return ("_f(\"" + name + "\")(" + exp + (args !== ')' ? ',' + args : args))
  68223. }
  68224. }
  68225. /* */
  68226. /* eslint-disable no-unused-vars */
  68227. function baseWarn (msg, range) {
  68228. console.error(("[Vue compiler]: " + msg));
  68229. }
  68230. /* eslint-enable no-unused-vars */
  68231. function pluckModuleFunction (
  68232. modules,
  68233. key
  68234. ) {
  68235. return modules
  68236. ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; })
  68237. : []
  68238. }
  68239. function addProp (el, name, value, range, dynamic) {
  68240. (el.props || (el.props = [])).push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range));
  68241. el.plain = false;
  68242. }
  68243. function addAttr (el, name, value, range, dynamic) {
  68244. var attrs = dynamic
  68245. ? (el.dynamicAttrs || (el.dynamicAttrs = []))
  68246. : (el.attrs || (el.attrs = []));
  68247. attrs.push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range));
  68248. el.plain = false;
  68249. }
  68250. // add a raw attr (use this in preTransforms)
  68251. function addRawAttr (el, name, value, range) {
  68252. el.attrsMap[name] = value;
  68253. el.attrsList.push(rangeSetItem({ name: name, value: value }, range));
  68254. }
  68255. function addDirective (
  68256. el,
  68257. name,
  68258. rawName,
  68259. value,
  68260. arg,
  68261. isDynamicArg,
  68262. modifiers,
  68263. range
  68264. ) {
  68265. (el.directives || (el.directives = [])).push(rangeSetItem({
  68266. name: name,
  68267. rawName: rawName,
  68268. value: value,
  68269. arg: arg,
  68270. isDynamicArg: isDynamicArg,
  68271. modifiers: modifiers
  68272. }, range));
  68273. el.plain = false;
  68274. }
  68275. function prependModifierMarker (symbol, name, dynamic) {
  68276. return dynamic
  68277. ? ("_p(" + name + ",\"" + symbol + "\")")
  68278. : symbol + name // mark the event as captured
  68279. }
  68280. function addHandler (
  68281. el,
  68282. name,
  68283. value,
  68284. modifiers,
  68285. important,
  68286. warn,
  68287. range,
  68288. dynamic
  68289. ) {
  68290. modifiers = modifiers || emptyObject;
  68291. // warn prevent and passive modifier
  68292. /* istanbul ignore if */
  68293. if (
  68294. warn &&
  68295. modifiers.prevent && modifiers.passive
  68296. ) {
  68297. warn(
  68298. 'passive and prevent can\'t be used together. ' +
  68299. 'Passive handler can\'t prevent default event.',
  68300. range
  68301. );
  68302. }
  68303. // normalize click.right and click.middle since they don't actually fire
  68304. // this is technically browser-specific, but at least for now browsers are
  68305. // the only target envs that have right/middle clicks.
  68306. if (modifiers.right) {
  68307. if (dynamic) {
  68308. name = "(" + name + ")==='click'?'contextmenu':(" + name + ")";
  68309. } else if (name === 'click') {
  68310. name = 'contextmenu';
  68311. delete modifiers.right;
  68312. }
  68313. } else if (modifiers.middle) {
  68314. if (dynamic) {
  68315. name = "(" + name + ")==='click'?'mouseup':(" + name + ")";
  68316. } else if (name === 'click') {
  68317. name = 'mouseup';
  68318. }
  68319. }
  68320. // check capture modifier
  68321. if (modifiers.capture) {
  68322. delete modifiers.capture;
  68323. name = prependModifierMarker('!', name, dynamic);
  68324. }
  68325. if (modifiers.once) {
  68326. delete modifiers.once;
  68327. name = prependModifierMarker('~', name, dynamic);
  68328. }
  68329. /* istanbul ignore if */
  68330. if (modifiers.passive) {
  68331. delete modifiers.passive;
  68332. name = prependModifierMarker('&', name, dynamic);
  68333. }
  68334. var events;
  68335. if (modifiers.native) {
  68336. delete modifiers.native;
  68337. events = el.nativeEvents || (el.nativeEvents = {});
  68338. } else {
  68339. events = el.events || (el.events = {});
  68340. }
  68341. var newHandler = rangeSetItem({ value: value.trim(), dynamic: dynamic }, range);
  68342. if (modifiers !== emptyObject) {
  68343. newHandler.modifiers = modifiers;
  68344. }
  68345. var handlers = events[name];
  68346. /* istanbul ignore if */
  68347. if (Array.isArray(handlers)) {
  68348. important ? handlers.unshift(newHandler) : handlers.push(newHandler);
  68349. } else if (handlers) {
  68350. events[name] = important ? [newHandler, handlers] : [handlers, newHandler];
  68351. } else {
  68352. events[name] = newHandler;
  68353. }
  68354. el.plain = false;
  68355. }
  68356. function getRawBindingAttr (
  68357. el,
  68358. name
  68359. ) {
  68360. return el.rawAttrsMap[':' + name] ||
  68361. el.rawAttrsMap['v-bind:' + name] ||
  68362. el.rawAttrsMap[name]
  68363. }
  68364. function getBindingAttr (
  68365. el,
  68366. name,
  68367. getStatic
  68368. ) {
  68369. var dynamicValue =
  68370. getAndRemoveAttr(el, ':' + name) ||
  68371. getAndRemoveAttr(el, 'v-bind:' + name);
  68372. if (dynamicValue != null) {
  68373. return parseFilters(dynamicValue)
  68374. } else if (getStatic !== false) {
  68375. var staticValue = getAndRemoveAttr(el, name);
  68376. if (staticValue != null) {
  68377. return JSON.stringify(staticValue)
  68378. }
  68379. }
  68380. }
  68381. // note: this only removes the attr from the Array (attrsList) so that it
  68382. // doesn't get processed by processAttrs.
  68383. // By default it does NOT remove it from the map (attrsMap) because the map is
  68384. // needed during codegen.
  68385. function getAndRemoveAttr (
  68386. el,
  68387. name,
  68388. removeFromMap
  68389. ) {
  68390. var val;
  68391. if ((val = el.attrsMap[name]) != null) {
  68392. var list = el.attrsList;
  68393. for (var i = 0, l = list.length; i < l; i++) {
  68394. if (list[i].name === name) {
  68395. list.splice(i, 1);
  68396. break
  68397. }
  68398. }
  68399. }
  68400. if (removeFromMap) {
  68401. delete el.attrsMap[name];
  68402. }
  68403. return val
  68404. }
  68405. function getAndRemoveAttrByRegex (
  68406. el,
  68407. name
  68408. ) {
  68409. var list = el.attrsList;
  68410. for (var i = 0, l = list.length; i < l; i++) {
  68411. var attr = list[i];
  68412. if (name.test(attr.name)) {
  68413. list.splice(i, 1);
  68414. return attr
  68415. }
  68416. }
  68417. }
  68418. function rangeSetItem (
  68419. item,
  68420. range
  68421. ) {
  68422. if (range) {
  68423. if (range.start != null) {
  68424. item.start = range.start;
  68425. }
  68426. if (range.end != null) {
  68427. item.end = range.end;
  68428. }
  68429. }
  68430. return item
  68431. }
  68432. /* */
  68433. /**
  68434. * Cross-platform code generation for component v-model
  68435. */
  68436. function genComponentModel (
  68437. el,
  68438. value,
  68439. modifiers
  68440. ) {
  68441. var ref = modifiers || {};
  68442. var number = ref.number;
  68443. var trim = ref.trim;
  68444. var baseValueExpression = '$$v';
  68445. var valueExpression = baseValueExpression;
  68446. if (trim) {
  68447. valueExpression =
  68448. "(typeof " + baseValueExpression + " === 'string'" +
  68449. "? " + baseValueExpression + ".trim()" +
  68450. ": " + baseValueExpression + ")";
  68451. }
  68452. if (number) {
  68453. valueExpression = "_n(" + valueExpression + ")";
  68454. }
  68455. var assignment = genAssignmentCode(value, valueExpression);
  68456. el.model = {
  68457. value: ("(" + value + ")"),
  68458. expression: JSON.stringify(value),
  68459. callback: ("function (" + baseValueExpression + ") {" + assignment + "}")
  68460. };
  68461. }
  68462. /**
  68463. * Cross-platform codegen helper for generating v-model value assignment code.
  68464. */
  68465. function genAssignmentCode (
  68466. value,
  68467. assignment
  68468. ) {
  68469. var res = parseModel(value);
  68470. if (res.key === null) {
  68471. return (value + "=" + assignment)
  68472. } else {
  68473. return ("$set(" + (res.exp) + ", " + (res.key) + ", " + assignment + ")")
  68474. }
  68475. }
  68476. /**
  68477. * Parse a v-model expression into a base path and a final key segment.
  68478. * Handles both dot-path and possible square brackets.
  68479. *
  68480. * Possible cases:
  68481. *
  68482. * - test
  68483. * - test[key]
  68484. * - test[test1[key]]
  68485. * - test["a"][key]
  68486. * - xxx.test[a[a].test1[key]]
  68487. * - test.xxx.a["asa"][test1[key]]
  68488. *
  68489. */
  68490. var len, str, chr, index$1, expressionPos, expressionEndPos;
  68491. function parseModel (val) {
  68492. // Fix https://github.com/vuejs/vue/pull/7730
  68493. // allow v-model="obj.val " (trailing whitespace)
  68494. val = val.trim();
  68495. len = val.length;
  68496. if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {
  68497. index$1 = val.lastIndexOf('.');
  68498. if (index$1 > -1) {
  68499. return {
  68500. exp: val.slice(0, index$1),
  68501. key: '"' + val.slice(index$1 + 1) + '"'
  68502. }
  68503. } else {
  68504. return {
  68505. exp: val,
  68506. key: null
  68507. }
  68508. }
  68509. }
  68510. str = val;
  68511. index$1 = expressionPos = expressionEndPos = 0;
  68512. while (!eof()) {
  68513. chr = next();
  68514. /* istanbul ignore if */
  68515. if (isStringStart(chr)) {
  68516. parseString(chr);
  68517. } else if (chr === 0x5B) {
  68518. parseBracket(chr);
  68519. }
  68520. }
  68521. return {
  68522. exp: val.slice(0, expressionPos),
  68523. key: val.slice(expressionPos + 1, expressionEndPos)
  68524. }
  68525. }
  68526. function next () {
  68527. return str.charCodeAt(++index$1)
  68528. }
  68529. function eof () {
  68530. return index$1 >= len
  68531. }
  68532. function isStringStart (chr) {
  68533. return chr === 0x22 || chr === 0x27
  68534. }
  68535. function parseBracket (chr) {
  68536. var inBracket = 1;
  68537. expressionPos = index$1;
  68538. while (!eof()) {
  68539. chr = next();
  68540. if (isStringStart(chr)) {
  68541. parseString(chr);
  68542. continue
  68543. }
  68544. if (chr === 0x5B) { inBracket++; }
  68545. if (chr === 0x5D) { inBracket--; }
  68546. if (inBracket === 0) {
  68547. expressionEndPos = index$1;
  68548. break
  68549. }
  68550. }
  68551. }
  68552. function parseString (chr) {
  68553. var stringQuote = chr;
  68554. while (!eof()) {
  68555. chr = next();
  68556. if (chr === stringQuote) {
  68557. break
  68558. }
  68559. }
  68560. }
  68561. /* */
  68562. var warn$1;
  68563. // in some cases, the event used has to be determined at runtime
  68564. // so we used some reserved tokens during compile.
  68565. var RANGE_TOKEN = '__r';
  68566. var CHECKBOX_RADIO_TOKEN = '__c';
  68567. function model (
  68568. el,
  68569. dir,
  68570. _warn
  68571. ) {
  68572. warn$1 = _warn;
  68573. var value = dir.value;
  68574. var modifiers = dir.modifiers;
  68575. var tag = el.tag;
  68576. var type = el.attrsMap.type;
  68577. {
  68578. // inputs with type="file" are read only and setting the input's
  68579. // value will throw an error.
  68580. if (tag === 'input' && type === 'file') {
  68581. warn$1(
  68582. "<" + (el.tag) + " v-model=\"" + value + "\" type=\"file\">:\n" +
  68583. "File inputs are read only. Use a v-on:change listener instead.",
  68584. el.rawAttrsMap['v-model']
  68585. );
  68586. }
  68587. }
  68588. if (el.component) {
  68589. genComponentModel(el, value, modifiers);
  68590. // component v-model doesn't need extra runtime
  68591. return false
  68592. } else if (tag === 'select') {
  68593. genSelect(el, value, modifiers);
  68594. } else if (tag === 'input' && type === 'checkbox') {
  68595. genCheckboxModel(el, value, modifiers);
  68596. } else if (tag === 'input' && type === 'radio') {
  68597. genRadioModel(el, value, modifiers);
  68598. } else if (tag === 'input' || tag === 'textarea') {
  68599. genDefaultModel(el, value, modifiers);
  68600. } else if (!config.isReservedTag(tag)) {
  68601. genComponentModel(el, value, modifiers);
  68602. // component v-model doesn't need extra runtime
  68603. return false
  68604. } else {
  68605. warn$1(
  68606. "<" + (el.tag) + " v-model=\"" + value + "\">: " +
  68607. "v-model is not supported on this element type. " +
  68608. 'If you are working with contenteditable, it\'s recommended to ' +
  68609. 'wrap a library dedicated for that purpose inside a custom component.',
  68610. el.rawAttrsMap['v-model']
  68611. );
  68612. }
  68613. // ensure runtime directive metadata
  68614. return true
  68615. }
  68616. function genCheckboxModel (
  68617. el,
  68618. value,
  68619. modifiers
  68620. ) {
  68621. var number = modifiers && modifiers.number;
  68622. var valueBinding = getBindingAttr(el, 'value') || 'null';
  68623. var trueValueBinding = getBindingAttr(el, 'true-value') || 'true';
  68624. var falseValueBinding = getBindingAttr(el, 'false-value') || 'false';
  68625. addProp(el, 'checked',
  68626. "Array.isArray(" + value + ")" +
  68627. "?_i(" + value + "," + valueBinding + ")>-1" + (
  68628. trueValueBinding === 'true'
  68629. ? (":(" + value + ")")
  68630. : (":_q(" + value + "," + trueValueBinding + ")")
  68631. )
  68632. );
  68633. addHandler(el, 'change',
  68634. "var $$a=" + value + "," +
  68635. '$$el=$event.target,' +
  68636. "$$c=$$el.checked?(" + trueValueBinding + "):(" + falseValueBinding + ");" +
  68637. 'if(Array.isArray($$a)){' +
  68638. "var $$v=" + (number ? '_n(' + valueBinding + ')' : valueBinding) + "," +
  68639. '$$i=_i($$a,$$v);' +
  68640. "if($$el.checked){$$i<0&&(" + (genAssignmentCode(value, '$$a.concat([$$v])')) + ")}" +
  68641. "else{$$i>-1&&(" + (genAssignmentCode(value, '$$a.slice(0,$$i).concat($$a.slice($$i+1))')) + ")}" +
  68642. "}else{" + (genAssignmentCode(value, '$$c')) + "}",
  68643. null, true
  68644. );
  68645. }
  68646. function genRadioModel (
  68647. el,
  68648. value,
  68649. modifiers
  68650. ) {
  68651. var number = modifiers && modifiers.number;
  68652. var valueBinding = getBindingAttr(el, 'value') || 'null';
  68653. valueBinding = number ? ("_n(" + valueBinding + ")") : valueBinding;
  68654. addProp(el, 'checked', ("_q(" + value + "," + valueBinding + ")"));
  68655. addHandler(el, 'change', genAssignmentCode(value, valueBinding), null, true);
  68656. }
  68657. function genSelect (
  68658. el,
  68659. value,
  68660. modifiers
  68661. ) {
  68662. var number = modifiers && modifiers.number;
  68663. var selectedVal = "Array.prototype.filter" +
  68664. ".call($event.target.options,function(o){return o.selected})" +
  68665. ".map(function(o){var val = \"_value\" in o ? o._value : o.value;" +
  68666. "return " + (number ? '_n(val)' : 'val') + "})";
  68667. var assignment = '$event.target.multiple ? $$selectedVal : $$selectedVal[0]';
  68668. var code = "var $$selectedVal = " + selectedVal + ";";
  68669. code = code + " " + (genAssignmentCode(value, assignment));
  68670. addHandler(el, 'change', code, null, true);
  68671. }
  68672. function genDefaultModel (
  68673. el,
  68674. value,
  68675. modifiers
  68676. ) {
  68677. var type = el.attrsMap.type;
  68678. // warn if v-bind:value conflicts with v-model
  68679. // except for inputs with v-bind:type
  68680. {
  68681. var value$1 = el.attrsMap['v-bind:value'] || el.attrsMap[':value'];
  68682. var typeBinding = el.attrsMap['v-bind:type'] || el.attrsMap[':type'];
  68683. if (value$1 && !typeBinding) {
  68684. var binding = el.attrsMap['v-bind:value'] ? 'v-bind:value' : ':value';
  68685. warn$1(
  68686. binding + "=\"" + value$1 + "\" conflicts with v-model on the same element " +
  68687. 'because the latter already expands to a value binding internally',
  68688. el.rawAttrsMap[binding]
  68689. );
  68690. }
  68691. }
  68692. var ref = modifiers || {};
  68693. var lazy = ref.lazy;
  68694. var number = ref.number;
  68695. var trim = ref.trim;
  68696. var needCompositionGuard = !lazy && type !== 'range';
  68697. var event = lazy
  68698. ? 'change'
  68699. : type === 'range'
  68700. ? RANGE_TOKEN
  68701. : 'input';
  68702. var valueExpression = '$event.target.value';
  68703. if (trim) {
  68704. valueExpression = "$event.target.value.trim()";
  68705. }
  68706. if (number) {
  68707. valueExpression = "_n(" + valueExpression + ")";
  68708. }
  68709. var code = genAssignmentCode(value, valueExpression);
  68710. if (needCompositionGuard) {
  68711. code = "if($event.target.composing)return;" + code;
  68712. }
  68713. addProp(el, 'value', ("(" + value + ")"));
  68714. addHandler(el, event, code, null, true);
  68715. if (trim || number) {
  68716. addHandler(el, 'blur', '$forceUpdate()');
  68717. }
  68718. }
  68719. /* */
  68720. // normalize v-model event tokens that can only be determined at runtime.
  68721. // it's important to place the event as the first in the array because
  68722. // the whole point is ensuring the v-model callback gets called before
  68723. // user-attached handlers.
  68724. function normalizeEvents (on) {
  68725. /* istanbul ignore if */
  68726. if (isDef(on[RANGE_TOKEN])) {
  68727. // IE input[type=range] only supports `change` event
  68728. var event = isIE ? 'change' : 'input';
  68729. on[event] = [].concat(on[RANGE_TOKEN], on[event] || []);
  68730. delete on[RANGE_TOKEN];
  68731. }
  68732. // This was originally intended to fix #4521 but no longer necessary
  68733. // after 2.5. Keeping it for backwards compat with generated code from < 2.4
  68734. /* istanbul ignore if */
  68735. if (isDef(on[CHECKBOX_RADIO_TOKEN])) {
  68736. on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || []);
  68737. delete on[CHECKBOX_RADIO_TOKEN];
  68738. }
  68739. }
  68740. var target$1;
  68741. function createOnceHandler$1 (event, handler, capture) {
  68742. var _target = target$1; // save current target element in closure
  68743. return function onceHandler () {
  68744. var res = handler.apply(null, arguments);
  68745. if (res !== null) {
  68746. remove$2(event, onceHandler, capture, _target);
  68747. }
  68748. }
  68749. }
  68750. // #9446: Firefox <= 53 (in particular, ESR 52) has incorrect Event.timeStamp
  68751. // implementation and does not fire microtasks in between event propagation, so
  68752. // safe to exclude.
  68753. var useMicrotaskFix = isUsingMicroTask && !(isFF && Number(isFF[1]) <= 53);
  68754. function add$1 (
  68755. name,
  68756. handler,
  68757. capture,
  68758. passive
  68759. ) {
  68760. // async edge case #6566: inner click event triggers patch, event handler
  68761. // attached to outer element during patch, and triggered again. This
  68762. // happens because browsers fire microtask ticks between event propagation.
  68763. // the solution is simple: we save the timestamp when a handler is attached,
  68764. // and the handler would only fire if the event passed to it was fired
  68765. // AFTER it was attached.
  68766. if (useMicrotaskFix) {
  68767. var attachedTimestamp = currentFlushTimestamp;
  68768. var original = handler;
  68769. handler = original._wrapper = function (e) {
  68770. if (
  68771. // no bubbling, should always fire.
  68772. // this is just a safety net in case event.timeStamp is unreliable in
  68773. // certain weird environments...
  68774. e.target === e.currentTarget ||
  68775. // event is fired after handler attachment
  68776. e.timeStamp >= attachedTimestamp ||
  68777. // bail for environments that have buggy event.timeStamp implementations
  68778. // #9462 iOS 9 bug: event.timeStamp is 0 after history.pushState
  68779. // #9681 QtWebEngine event.timeStamp is negative value
  68780. e.timeStamp <= 0 ||
  68781. // #9448 bail if event is fired in another document in a multi-page
  68782. // electron/nw.js app, since event.timeStamp will be using a different
  68783. // starting reference
  68784. e.target.ownerDocument !== document
  68785. ) {
  68786. return original.apply(this, arguments)
  68787. }
  68788. };
  68789. }
  68790. target$1.addEventListener(
  68791. name,
  68792. handler,
  68793. supportsPassive
  68794. ? { capture: capture, passive: passive }
  68795. : capture
  68796. );
  68797. }
  68798. function remove$2 (
  68799. name,
  68800. handler,
  68801. capture,
  68802. _target
  68803. ) {
  68804. (_target || target$1).removeEventListener(
  68805. name,
  68806. handler._wrapper || handler,
  68807. capture
  68808. );
  68809. }
  68810. function updateDOMListeners (oldVnode, vnode) {
  68811. if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) {
  68812. return
  68813. }
  68814. var on = vnode.data.on || {};
  68815. var oldOn = oldVnode.data.on || {};
  68816. target$1 = vnode.elm;
  68817. normalizeEvents(on);
  68818. updateListeners(on, oldOn, add$1, remove$2, createOnceHandler$1, vnode.context);
  68819. target$1 = undefined;
  68820. }
  68821. var events = {
  68822. create: updateDOMListeners,
  68823. update: updateDOMListeners
  68824. };
  68825. /* */
  68826. var svgContainer;
  68827. function updateDOMProps (oldVnode, vnode) {
  68828. if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) {
  68829. return
  68830. }
  68831. var key, cur;
  68832. var elm = vnode.elm;
  68833. var oldProps = oldVnode.data.domProps || {};
  68834. var props = vnode.data.domProps || {};
  68835. // clone observed objects, as the user probably wants to mutate it
  68836. if (isDef(props.__ob__)) {
  68837. props = vnode.data.domProps = extend({}, props);
  68838. }
  68839. for (key in oldProps) {
  68840. if (!(key in props)) {
  68841. elm[key] = '';
  68842. }
  68843. }
  68844. for (key in props) {
  68845. cur = props[key];
  68846. // ignore children if the node has textContent or innerHTML,
  68847. // as these will throw away existing DOM nodes and cause removal errors
  68848. // on subsequent patches (#3360)
  68849. if (key === 'textContent' || key === 'innerHTML') {
  68850. if (vnode.children) { vnode.children.length = 0; }
  68851. if (cur === oldProps[key]) { continue }
  68852. // #6601 work around Chrome version <= 55 bug where single textNode
  68853. // replaced by innerHTML/textContent retains its parentNode property
  68854. if (elm.childNodes.length === 1) {
  68855. elm.removeChild(elm.childNodes[0]);
  68856. }
  68857. }
  68858. if (key === 'value' && elm.tagName !== 'PROGRESS') {
  68859. // store value as _value as well since
  68860. // non-string values will be stringified
  68861. elm._value = cur;
  68862. // avoid resetting cursor position when value is the same
  68863. var strCur = isUndef(cur) ? '' : String(cur);
  68864. if (shouldUpdateValue(elm, strCur)) {
  68865. elm.value = strCur;
  68866. }
  68867. } else if (key === 'innerHTML' && isSVG(elm.tagName) && isUndef(elm.innerHTML)) {
  68868. // IE doesn't support innerHTML for SVG elements
  68869. svgContainer = svgContainer || document.createElement('div');
  68870. svgContainer.innerHTML = "<svg>" + cur + "</svg>";
  68871. var svg = svgContainer.firstChild;
  68872. while (elm.firstChild) {
  68873. elm.removeChild(elm.firstChild);
  68874. }
  68875. while (svg.firstChild) {
  68876. elm.appendChild(svg.firstChild);
  68877. }
  68878. } else if (
  68879. // skip the update if old and new VDOM state is the same.
  68880. // `value` is handled separately because the DOM value may be temporarily
  68881. // out of sync with VDOM state due to focus, composition and modifiers.
  68882. // This #4521 by skipping the unnecesarry `checked` update.
  68883. cur !== oldProps[key]
  68884. ) {
  68885. // some property updates can throw
  68886. // e.g. `value` on <progress> w/ non-finite value
  68887. try {
  68888. elm[key] = cur;
  68889. } catch (e) {}
  68890. }
  68891. }
  68892. }
  68893. // check platforms/web/util/attrs.js acceptValue
  68894. function shouldUpdateValue (elm, checkVal) {
  68895. return (!elm.composing && (
  68896. elm.tagName === 'OPTION' ||
  68897. isNotInFocusAndDirty(elm, checkVal) ||
  68898. isDirtyWithModifiers(elm, checkVal)
  68899. ))
  68900. }
  68901. function isNotInFocusAndDirty (elm, checkVal) {
  68902. // return true when textbox (.number and .trim) loses focus and its value is
  68903. // not equal to the updated value
  68904. var notInFocus = true;
  68905. // #6157
  68906. // work around IE bug when accessing document.activeElement in an iframe
  68907. try { notInFocus = document.activeElement !== elm; } catch (e) {}
  68908. return notInFocus && elm.value !== checkVal
  68909. }
  68910. function isDirtyWithModifiers (elm, newVal) {
  68911. var value = elm.value;
  68912. var modifiers = elm._vModifiers; // injected by v-model runtime
  68913. if (isDef(modifiers)) {
  68914. if (modifiers.number) {
  68915. return toNumber(value) !== toNumber(newVal)
  68916. }
  68917. if (modifiers.trim) {
  68918. return value.trim() !== newVal.trim()
  68919. }
  68920. }
  68921. return value !== newVal
  68922. }
  68923. var domProps = {
  68924. create: updateDOMProps,
  68925. update: updateDOMProps
  68926. };
  68927. /* */
  68928. var parseStyleText = cached(function (cssText) {
  68929. var res = {};
  68930. var listDelimiter = /;(?![^(]*\))/g;
  68931. var propertyDelimiter = /:(.+)/;
  68932. cssText.split(listDelimiter).forEach(function (item) {
  68933. if (item) {
  68934. var tmp = item.split(propertyDelimiter);
  68935. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  68936. }
  68937. });
  68938. return res
  68939. });
  68940. // merge static and dynamic style data on the same vnode
  68941. function normalizeStyleData (data) {
  68942. var style = normalizeStyleBinding(data.style);
  68943. // static style is pre-processed into an object during compilation
  68944. // and is always a fresh object, so it's safe to merge into it
  68945. return data.staticStyle
  68946. ? extend(data.staticStyle, style)
  68947. : style
  68948. }
  68949. // normalize possible array / string values into Object
  68950. function normalizeStyleBinding (bindingStyle) {
  68951. if (Array.isArray(bindingStyle)) {
  68952. return toObject(bindingStyle)
  68953. }
  68954. if (typeof bindingStyle === 'string') {
  68955. return parseStyleText(bindingStyle)
  68956. }
  68957. return bindingStyle
  68958. }
  68959. /**
  68960. * parent component style should be after child's
  68961. * so that parent component's style could override it
  68962. */
  68963. function getStyle (vnode, checkChild) {
  68964. var res = {};
  68965. var styleData;
  68966. if (checkChild) {
  68967. var childNode = vnode;
  68968. while (childNode.componentInstance) {
  68969. childNode = childNode.componentInstance._vnode;
  68970. if (
  68971. childNode && childNode.data &&
  68972. (styleData = normalizeStyleData(childNode.data))
  68973. ) {
  68974. extend(res, styleData);
  68975. }
  68976. }
  68977. }
  68978. if ((styleData = normalizeStyleData(vnode.data))) {
  68979. extend(res, styleData);
  68980. }
  68981. var parentNode = vnode;
  68982. while ((parentNode = parentNode.parent)) {
  68983. if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
  68984. extend(res, styleData);
  68985. }
  68986. }
  68987. return res
  68988. }
  68989. /* */
  68990. var cssVarRE = /^--/;
  68991. var importantRE = /\s*!important$/;
  68992. var setProp = function (el, name, val) {
  68993. /* istanbul ignore if */
  68994. if (cssVarRE.test(name)) {
  68995. el.style.setProperty(name, val);
  68996. } else if (importantRE.test(val)) {
  68997. el.style.setProperty(hyphenate(name), val.replace(importantRE, ''), 'important');
  68998. } else {
  68999. var normalizedName = normalize(name);
  69000. if (Array.isArray(val)) {
  69001. // Support values array created by autoprefixer, e.g.
  69002. // {display: ["-webkit-box", "-ms-flexbox", "flex"]}
  69003. // Set them one by one, and the browser will only set those it can recognize
  69004. for (var i = 0, len = val.length; i < len; i++) {
  69005. el.style[normalizedName] = val[i];
  69006. }
  69007. } else {
  69008. el.style[normalizedName] = val;
  69009. }
  69010. }
  69011. };
  69012. var vendorNames = ['Webkit', 'Moz', 'ms'];
  69013. var emptyStyle;
  69014. var normalize = cached(function (prop) {
  69015. emptyStyle = emptyStyle || document.createElement('div').style;
  69016. prop = camelize(prop);
  69017. if (prop !== 'filter' && (prop in emptyStyle)) {
  69018. return prop
  69019. }
  69020. var capName = prop.charAt(0).toUpperCase() + prop.slice(1);
  69021. for (var i = 0; i < vendorNames.length; i++) {
  69022. var name = vendorNames[i] + capName;
  69023. if (name in emptyStyle) {
  69024. return name
  69025. }
  69026. }
  69027. });
  69028. function updateStyle (oldVnode, vnode) {
  69029. var data = vnode.data;
  69030. var oldData = oldVnode.data;
  69031. if (isUndef(data.staticStyle) && isUndef(data.style) &&
  69032. isUndef(oldData.staticStyle) && isUndef(oldData.style)
  69033. ) {
  69034. return
  69035. }
  69036. var cur, name;
  69037. var el = vnode.elm;
  69038. var oldStaticStyle = oldData.staticStyle;
  69039. var oldStyleBinding = oldData.normalizedStyle || oldData.style || {};
  69040. // if static style exists, stylebinding already merged into it when doing normalizeStyleData
  69041. var oldStyle = oldStaticStyle || oldStyleBinding;
  69042. var style = normalizeStyleBinding(vnode.data.style) || {};
  69043. // store normalized style under a different key for next diff
  69044. // make sure to clone it if it's reactive, since the user likely wants
  69045. // to mutate it.
  69046. vnode.data.normalizedStyle = isDef(style.__ob__)
  69047. ? extend({}, style)
  69048. : style;
  69049. var newStyle = getStyle(vnode, true);
  69050. for (name in oldStyle) {
  69051. if (isUndef(newStyle[name])) {
  69052. setProp(el, name, '');
  69053. }
  69054. }
  69055. for (name in newStyle) {
  69056. cur = newStyle[name];
  69057. if (cur !== oldStyle[name]) {
  69058. // ie9 setting to null has no effect, must use empty string
  69059. setProp(el, name, cur == null ? '' : cur);
  69060. }
  69061. }
  69062. }
  69063. var style = {
  69064. create: updateStyle,
  69065. update: updateStyle
  69066. };
  69067. /* */
  69068. var whitespaceRE = /\s+/;
  69069. /**
  69070. * Add class with compatibility for SVG since classList is not supported on
  69071. * SVG elements in IE
  69072. */
  69073. function addClass (el, cls) {
  69074. /* istanbul ignore if */
  69075. if (!cls || !(cls = cls.trim())) {
  69076. return
  69077. }
  69078. /* istanbul ignore else */
  69079. if (el.classList) {
  69080. if (cls.indexOf(' ') > -1) {
  69081. cls.split(whitespaceRE).forEach(function (c) { return el.classList.add(c); });
  69082. } else {
  69083. el.classList.add(cls);
  69084. }
  69085. } else {
  69086. var cur = " " + (el.getAttribute('class') || '') + " ";
  69087. if (cur.indexOf(' ' + cls + ' ') < 0) {
  69088. el.setAttribute('class', (cur + cls).trim());
  69089. }
  69090. }
  69091. }
  69092. /**
  69093. * Remove class with compatibility for SVG since classList is not supported on
  69094. * SVG elements in IE
  69095. */
  69096. function removeClass (el, cls) {
  69097. /* istanbul ignore if */
  69098. if (!cls || !(cls = cls.trim())) {
  69099. return
  69100. }
  69101. /* istanbul ignore else */
  69102. if (el.classList) {
  69103. if (cls.indexOf(' ') > -1) {
  69104. cls.split(whitespaceRE).forEach(function (c) { return el.classList.remove(c); });
  69105. } else {
  69106. el.classList.remove(cls);
  69107. }
  69108. if (!el.classList.length) {
  69109. el.removeAttribute('class');
  69110. }
  69111. } else {
  69112. var cur = " " + (el.getAttribute('class') || '') + " ";
  69113. var tar = ' ' + cls + ' ';
  69114. while (cur.indexOf(tar) >= 0) {
  69115. cur = cur.replace(tar, ' ');
  69116. }
  69117. cur = cur.trim();
  69118. if (cur) {
  69119. el.setAttribute('class', cur);
  69120. } else {
  69121. el.removeAttribute('class');
  69122. }
  69123. }
  69124. }
  69125. /* */
  69126. function resolveTransition (def$$1) {
  69127. if (!def$$1) {
  69128. return
  69129. }
  69130. /* istanbul ignore else */
  69131. if (typeof def$$1 === 'object') {
  69132. var res = {};
  69133. if (def$$1.css !== false) {
  69134. extend(res, autoCssTransition(def$$1.name || 'v'));
  69135. }
  69136. extend(res, def$$1);
  69137. return res
  69138. } else if (typeof def$$1 === 'string') {
  69139. return autoCssTransition(def$$1)
  69140. }
  69141. }
  69142. var autoCssTransition = cached(function (name) {
  69143. return {
  69144. enterClass: (name + "-enter"),
  69145. enterToClass: (name + "-enter-to"),
  69146. enterActiveClass: (name + "-enter-active"),
  69147. leaveClass: (name + "-leave"),
  69148. leaveToClass: (name + "-leave-to"),
  69149. leaveActiveClass: (name + "-leave-active")
  69150. }
  69151. });
  69152. var hasTransition = inBrowser && !isIE9;
  69153. var TRANSITION = 'transition';
  69154. var ANIMATION = 'animation';
  69155. // Transition property/event sniffing
  69156. var transitionProp = 'transition';
  69157. var transitionEndEvent = 'transitionend';
  69158. var animationProp = 'animation';
  69159. var animationEndEvent = 'animationend';
  69160. if (hasTransition) {
  69161. /* istanbul ignore if */
  69162. if (window.ontransitionend === undefined &&
  69163. window.onwebkittransitionend !== undefined
  69164. ) {
  69165. transitionProp = 'WebkitTransition';
  69166. transitionEndEvent = 'webkitTransitionEnd';
  69167. }
  69168. if (window.onanimationend === undefined &&
  69169. window.onwebkitanimationend !== undefined
  69170. ) {
  69171. animationProp = 'WebkitAnimation';
  69172. animationEndEvent = 'webkitAnimationEnd';
  69173. }
  69174. }
  69175. // binding to window is necessary to make hot reload work in IE in strict mode
  69176. var raf = inBrowser
  69177. ? window.requestAnimationFrame
  69178. ? window.requestAnimationFrame.bind(window)
  69179. : setTimeout
  69180. : /* istanbul ignore next */ function (fn) { return fn(); };
  69181. function nextFrame (fn) {
  69182. raf(function () {
  69183. raf(fn);
  69184. });
  69185. }
  69186. function addTransitionClass (el, cls) {
  69187. var transitionClasses = el._transitionClasses || (el._transitionClasses = []);
  69188. if (transitionClasses.indexOf(cls) < 0) {
  69189. transitionClasses.push(cls);
  69190. addClass(el, cls);
  69191. }
  69192. }
  69193. function removeTransitionClass (el, cls) {
  69194. if (el._transitionClasses) {
  69195. remove(el._transitionClasses, cls);
  69196. }
  69197. removeClass(el, cls);
  69198. }
  69199. function whenTransitionEnds (
  69200. el,
  69201. expectedType,
  69202. cb
  69203. ) {
  69204. var ref = getTransitionInfo(el, expectedType);
  69205. var type = ref.type;
  69206. var timeout = ref.timeout;
  69207. var propCount = ref.propCount;
  69208. if (!type) { return cb() }
  69209. var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
  69210. var ended = 0;
  69211. var end = function () {
  69212. el.removeEventListener(event, onEnd);
  69213. cb();
  69214. };
  69215. var onEnd = function (e) {
  69216. if (e.target === el) {
  69217. if (++ended >= propCount) {
  69218. end();
  69219. }
  69220. }
  69221. };
  69222. setTimeout(function () {
  69223. if (ended < propCount) {
  69224. end();
  69225. }
  69226. }, timeout + 1);
  69227. el.addEventListener(event, onEnd);
  69228. }
  69229. var transformRE = /\b(transform|all)(,|$)/;
  69230. function getTransitionInfo (el, expectedType) {
  69231. var styles = window.getComputedStyle(el);
  69232. // JSDOM may return undefined for transition properties
  69233. var transitionDelays = (styles[transitionProp + 'Delay'] || '').split(', ');
  69234. var transitionDurations = (styles[transitionProp + 'Duration'] || '').split(', ');
  69235. var transitionTimeout = getTimeout(transitionDelays, transitionDurations);
  69236. var animationDelays = (styles[animationProp + 'Delay'] || '').split(', ');
  69237. var animationDurations = (styles[animationProp + 'Duration'] || '').split(', ');
  69238. var animationTimeout = getTimeout(animationDelays, animationDurations);
  69239. var type;
  69240. var timeout = 0;
  69241. var propCount = 0;
  69242. /* istanbul ignore if */
  69243. if (expectedType === TRANSITION) {
  69244. if (transitionTimeout > 0) {
  69245. type = TRANSITION;
  69246. timeout = transitionTimeout;
  69247. propCount = transitionDurations.length;
  69248. }
  69249. } else if (expectedType === ANIMATION) {
  69250. if (animationTimeout > 0) {
  69251. type = ANIMATION;
  69252. timeout = animationTimeout;
  69253. propCount = animationDurations.length;
  69254. }
  69255. } else {
  69256. timeout = Math.max(transitionTimeout, animationTimeout);
  69257. type = timeout > 0
  69258. ? transitionTimeout > animationTimeout
  69259. ? TRANSITION
  69260. : ANIMATION
  69261. : null;
  69262. propCount = type
  69263. ? type === TRANSITION
  69264. ? transitionDurations.length
  69265. : animationDurations.length
  69266. : 0;
  69267. }
  69268. var hasTransform =
  69269. type === TRANSITION &&
  69270. transformRE.test(styles[transitionProp + 'Property']);
  69271. return {
  69272. type: type,
  69273. timeout: timeout,
  69274. propCount: propCount,
  69275. hasTransform: hasTransform
  69276. }
  69277. }
  69278. function getTimeout (delays, durations) {
  69279. /* istanbul ignore next */
  69280. while (delays.length < durations.length) {
  69281. delays = delays.concat(delays);
  69282. }
  69283. return Math.max.apply(null, durations.map(function (d, i) {
  69284. return toMs(d) + toMs(delays[i])
  69285. }))
  69286. }
  69287. // Old versions of Chromium (below 61.0.3163.100) formats floating pointer numbers
  69288. // in a locale-dependent way, using a comma instead of a dot.
  69289. // If comma is not replaced with a dot, the input will be rounded down (i.e. acting
  69290. // as a floor function) causing unexpected behaviors
  69291. function toMs (s) {
  69292. return Number(s.slice(0, -1).replace(',', '.')) * 1000
  69293. }
  69294. /* */
  69295. function enter (vnode, toggleDisplay) {
  69296. var el = vnode.elm;
  69297. // call leave callback now
  69298. if (isDef(el._leaveCb)) {
  69299. el._leaveCb.cancelled = true;
  69300. el._leaveCb();
  69301. }
  69302. var data = resolveTransition(vnode.data.transition);
  69303. if (isUndef(data)) {
  69304. return
  69305. }
  69306. /* istanbul ignore if */
  69307. if (isDef(el._enterCb) || el.nodeType !== 1) {
  69308. return
  69309. }
  69310. var css = data.css;
  69311. var type = data.type;
  69312. var enterClass = data.enterClass;
  69313. var enterToClass = data.enterToClass;
  69314. var enterActiveClass = data.enterActiveClass;
  69315. var appearClass = data.appearClass;
  69316. var appearToClass = data.appearToClass;
  69317. var appearActiveClass = data.appearActiveClass;
  69318. var beforeEnter = data.beforeEnter;
  69319. var enter = data.enter;
  69320. var afterEnter = data.afterEnter;
  69321. var enterCancelled = data.enterCancelled;
  69322. var beforeAppear = data.beforeAppear;
  69323. var appear = data.appear;
  69324. var afterAppear = data.afterAppear;
  69325. var appearCancelled = data.appearCancelled;
  69326. var duration = data.duration;
  69327. // activeInstance will always be the <transition> component managing this
  69328. // transition. One edge case to check is when the <transition> is placed
  69329. // as the root node of a child component. In that case we need to check
  69330. // <transition>'s parent for appear check.
  69331. var context = activeInstance;
  69332. var transitionNode = activeInstance.$vnode;
  69333. while (transitionNode && transitionNode.parent) {
  69334. context = transitionNode.context;
  69335. transitionNode = transitionNode.parent;
  69336. }
  69337. var isAppear = !context._isMounted || !vnode.isRootInsert;
  69338. if (isAppear && !appear && appear !== '') {
  69339. return
  69340. }
  69341. var startClass = isAppear && appearClass
  69342. ? appearClass
  69343. : enterClass;
  69344. var activeClass = isAppear && appearActiveClass
  69345. ? appearActiveClass
  69346. : enterActiveClass;
  69347. var toClass = isAppear && appearToClass
  69348. ? appearToClass
  69349. : enterToClass;
  69350. var beforeEnterHook = isAppear
  69351. ? (beforeAppear || beforeEnter)
  69352. : beforeEnter;
  69353. var enterHook = isAppear
  69354. ? (typeof appear === 'function' ? appear : enter)
  69355. : enter;
  69356. var afterEnterHook = isAppear
  69357. ? (afterAppear || afterEnter)
  69358. : afterEnter;
  69359. var enterCancelledHook = isAppear
  69360. ? (appearCancelled || enterCancelled)
  69361. : enterCancelled;
  69362. var explicitEnterDuration = toNumber(
  69363. isObject(duration)
  69364. ? duration.enter
  69365. : duration
  69366. );
  69367. if (explicitEnterDuration != null) {
  69368. checkDuration(explicitEnterDuration, 'enter', vnode);
  69369. }
  69370. var expectsCSS = css !== false && !isIE9;
  69371. var userWantsControl = getHookArgumentsLength(enterHook);
  69372. var cb = el._enterCb = once(function () {
  69373. if (expectsCSS) {
  69374. removeTransitionClass(el, toClass);
  69375. removeTransitionClass(el, activeClass);
  69376. }
  69377. if (cb.cancelled) {
  69378. if (expectsCSS) {
  69379. removeTransitionClass(el, startClass);
  69380. }
  69381. enterCancelledHook && enterCancelledHook(el);
  69382. } else {
  69383. afterEnterHook && afterEnterHook(el);
  69384. }
  69385. el._enterCb = null;
  69386. });
  69387. if (!vnode.data.show) {
  69388. // remove pending leave element on enter by injecting an insert hook
  69389. mergeVNodeHook(vnode, 'insert', function () {
  69390. var parent = el.parentNode;
  69391. var pendingNode = parent && parent._pending && parent._pending[vnode.key];
  69392. if (pendingNode &&
  69393. pendingNode.tag === vnode.tag &&
  69394. pendingNode.elm._leaveCb
  69395. ) {
  69396. pendingNode.elm._leaveCb();
  69397. }
  69398. enterHook && enterHook(el, cb);
  69399. });
  69400. }
  69401. // start enter transition
  69402. beforeEnterHook && beforeEnterHook(el);
  69403. if (expectsCSS) {
  69404. addTransitionClass(el, startClass);
  69405. addTransitionClass(el, activeClass);
  69406. nextFrame(function () {
  69407. removeTransitionClass(el, startClass);
  69408. if (!cb.cancelled) {
  69409. addTransitionClass(el, toClass);
  69410. if (!userWantsControl) {
  69411. if (isValidDuration(explicitEnterDuration)) {
  69412. setTimeout(cb, explicitEnterDuration);
  69413. } else {
  69414. whenTransitionEnds(el, type, cb);
  69415. }
  69416. }
  69417. }
  69418. });
  69419. }
  69420. if (vnode.data.show) {
  69421. toggleDisplay && toggleDisplay();
  69422. enterHook && enterHook(el, cb);
  69423. }
  69424. if (!expectsCSS && !userWantsControl) {
  69425. cb();
  69426. }
  69427. }
  69428. function leave (vnode, rm) {
  69429. var el = vnode.elm;
  69430. // call enter callback now
  69431. if (isDef(el._enterCb)) {
  69432. el._enterCb.cancelled = true;
  69433. el._enterCb();
  69434. }
  69435. var data = resolveTransition(vnode.data.transition);
  69436. if (isUndef(data) || el.nodeType !== 1) {
  69437. return rm()
  69438. }
  69439. /* istanbul ignore if */
  69440. if (isDef(el._leaveCb)) {
  69441. return
  69442. }
  69443. var css = data.css;
  69444. var type = data.type;
  69445. var leaveClass = data.leaveClass;
  69446. var leaveToClass = data.leaveToClass;
  69447. var leaveActiveClass = data.leaveActiveClass;
  69448. var beforeLeave = data.beforeLeave;
  69449. var leave = data.leave;
  69450. var afterLeave = data.afterLeave;
  69451. var leaveCancelled = data.leaveCancelled;
  69452. var delayLeave = data.delayLeave;
  69453. var duration = data.duration;
  69454. var expectsCSS = css !== false && !isIE9;
  69455. var userWantsControl = getHookArgumentsLength(leave);
  69456. var explicitLeaveDuration = toNumber(
  69457. isObject(duration)
  69458. ? duration.leave
  69459. : duration
  69460. );
  69461. if (isDef(explicitLeaveDuration)) {
  69462. checkDuration(explicitLeaveDuration, 'leave', vnode);
  69463. }
  69464. var cb = el._leaveCb = once(function () {
  69465. if (el.parentNode && el.parentNode._pending) {
  69466. el.parentNode._pending[vnode.key] = null;
  69467. }
  69468. if (expectsCSS) {
  69469. removeTransitionClass(el, leaveToClass);
  69470. removeTransitionClass(el, leaveActiveClass);
  69471. }
  69472. if (cb.cancelled) {
  69473. if (expectsCSS) {
  69474. removeTransitionClass(el, leaveClass);
  69475. }
  69476. leaveCancelled && leaveCancelled(el);
  69477. } else {
  69478. rm();
  69479. afterLeave && afterLeave(el);
  69480. }
  69481. el._leaveCb = null;
  69482. });
  69483. if (delayLeave) {
  69484. delayLeave(performLeave);
  69485. } else {
  69486. performLeave();
  69487. }
  69488. function performLeave () {
  69489. // the delayed leave may have already been cancelled
  69490. if (cb.cancelled) {
  69491. return
  69492. }
  69493. // record leaving element
  69494. if (!vnode.data.show && el.parentNode) {
  69495. (el.parentNode._pending || (el.parentNode._pending = {}))[(vnode.key)] = vnode;
  69496. }
  69497. beforeLeave && beforeLeave(el);
  69498. if (expectsCSS) {
  69499. addTransitionClass(el, leaveClass);
  69500. addTransitionClass(el, leaveActiveClass);
  69501. nextFrame(function () {
  69502. removeTransitionClass(el, leaveClass);
  69503. if (!cb.cancelled) {
  69504. addTransitionClass(el, leaveToClass);
  69505. if (!userWantsControl) {
  69506. if (isValidDuration(explicitLeaveDuration)) {
  69507. setTimeout(cb, explicitLeaveDuration);
  69508. } else {
  69509. whenTransitionEnds(el, type, cb);
  69510. }
  69511. }
  69512. }
  69513. });
  69514. }
  69515. leave && leave(el, cb);
  69516. if (!expectsCSS && !userWantsControl) {
  69517. cb();
  69518. }
  69519. }
  69520. }
  69521. // only used in dev mode
  69522. function checkDuration (val, name, vnode) {
  69523. if (typeof val !== 'number') {
  69524. warn(
  69525. "<transition> explicit " + name + " duration is not a valid number - " +
  69526. "got " + (JSON.stringify(val)) + ".",
  69527. vnode.context
  69528. );
  69529. } else if (isNaN(val)) {
  69530. warn(
  69531. "<transition> explicit " + name + " duration is NaN - " +
  69532. 'the duration expression might be incorrect.',
  69533. vnode.context
  69534. );
  69535. }
  69536. }
  69537. function isValidDuration (val) {
  69538. return typeof val === 'number' && !isNaN(val)
  69539. }
  69540. /**
  69541. * Normalize a transition hook's argument length. The hook may be:
  69542. * - a merged hook (invoker) with the original in .fns
  69543. * - a wrapped component method (check ._length)
  69544. * - a plain function (.length)
  69545. */
  69546. function getHookArgumentsLength (fn) {
  69547. if (isUndef(fn)) {
  69548. return false
  69549. }
  69550. var invokerFns = fn.fns;
  69551. if (isDef(invokerFns)) {
  69552. // invoker
  69553. return getHookArgumentsLength(
  69554. Array.isArray(invokerFns)
  69555. ? invokerFns[0]
  69556. : invokerFns
  69557. )
  69558. } else {
  69559. return (fn._length || fn.length) > 1
  69560. }
  69561. }
  69562. function _enter (_, vnode) {
  69563. if (vnode.data.show !== true) {
  69564. enter(vnode);
  69565. }
  69566. }
  69567. var transition = inBrowser ? {
  69568. create: _enter,
  69569. activate: _enter,
  69570. remove: function remove$$1 (vnode, rm) {
  69571. /* istanbul ignore else */
  69572. if (vnode.data.show !== true) {
  69573. leave(vnode, rm);
  69574. } else {
  69575. rm();
  69576. }
  69577. }
  69578. } : {};
  69579. var platformModules = [
  69580. attrs,
  69581. klass,
  69582. events,
  69583. domProps,
  69584. style,
  69585. transition
  69586. ];
  69587. /* */
  69588. // the directive module should be applied last, after all
  69589. // built-in modules have been applied.
  69590. var modules = platformModules.concat(baseModules);
  69591. var patch = createPatchFunction({ nodeOps: nodeOps, modules: modules });
  69592. /**
  69593. * Not type checking this file because flow doesn't like attaching
  69594. * properties to Elements.
  69595. */
  69596. /* istanbul ignore if */
  69597. if (isIE9) {
  69598. // http://www.matts411.com/post/internet-explorer-9-oninput/
  69599. document.addEventListener('selectionchange', function () {
  69600. var el = document.activeElement;
  69601. if (el && el.vmodel) {
  69602. trigger(el, 'input');
  69603. }
  69604. });
  69605. }
  69606. var directive = {
  69607. inserted: function inserted (el, binding, vnode, oldVnode) {
  69608. if (vnode.tag === 'select') {
  69609. // #6903
  69610. if (oldVnode.elm && !oldVnode.elm._vOptions) {
  69611. mergeVNodeHook(vnode, 'postpatch', function () {
  69612. directive.componentUpdated(el, binding, vnode);
  69613. });
  69614. } else {
  69615. setSelected(el, binding, vnode.context);
  69616. }
  69617. el._vOptions = [].map.call(el.options, getValue);
  69618. } else if (vnode.tag === 'textarea' || isTextInputType(el.type)) {
  69619. el._vModifiers = binding.modifiers;
  69620. if (!binding.modifiers.lazy) {
  69621. el.addEventListener('compositionstart', onCompositionStart);
  69622. el.addEventListener('compositionend', onCompositionEnd);
  69623. // Safari < 10.2 & UIWebView doesn't fire compositionend when
  69624. // switching focus before confirming composition choice
  69625. // this also fixes the issue where some browsers e.g. iOS Chrome
  69626. // fires "change" instead of "input" on autocomplete.
  69627. el.addEventListener('change', onCompositionEnd);
  69628. /* istanbul ignore if */
  69629. if (isIE9) {
  69630. el.vmodel = true;
  69631. }
  69632. }
  69633. }
  69634. },
  69635. componentUpdated: function componentUpdated (el, binding, vnode) {
  69636. if (vnode.tag === 'select') {
  69637. setSelected(el, binding, vnode.context);
  69638. // in case the options rendered by v-for have changed,
  69639. // it's possible that the value is out-of-sync with the rendered options.
  69640. // detect such cases and filter out values that no longer has a matching
  69641. // option in the DOM.
  69642. var prevOptions = el._vOptions;
  69643. var curOptions = el._vOptions = [].map.call(el.options, getValue);
  69644. if (curOptions.some(function (o, i) { return !looseEqual(o, prevOptions[i]); })) {
  69645. // trigger change event if
  69646. // no matching option found for at least one value
  69647. var needReset = el.multiple
  69648. ? binding.value.some(function (v) { return hasNoMatchingOption(v, curOptions); })
  69649. : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, curOptions);
  69650. if (needReset) {
  69651. trigger(el, 'change');
  69652. }
  69653. }
  69654. }
  69655. }
  69656. };
  69657. function setSelected (el, binding, vm) {
  69658. actuallySetSelected(el, binding, vm);
  69659. /* istanbul ignore if */
  69660. if (isIE || isEdge) {
  69661. setTimeout(function () {
  69662. actuallySetSelected(el, binding, vm);
  69663. }, 0);
  69664. }
  69665. }
  69666. function actuallySetSelected (el, binding, vm) {
  69667. var value = binding.value;
  69668. var isMultiple = el.multiple;
  69669. if (isMultiple && !Array.isArray(value)) {
  69670. warn(
  69671. "<select multiple v-model=\"" + (binding.expression) + "\"> " +
  69672. "expects an Array value for its binding, but got " + (Object.prototype.toString.call(value).slice(8, -1)),
  69673. vm
  69674. );
  69675. return
  69676. }
  69677. var selected, option;
  69678. for (var i = 0, l = el.options.length; i < l; i++) {
  69679. option = el.options[i];
  69680. if (isMultiple) {
  69681. selected = looseIndexOf(value, getValue(option)) > -1;
  69682. if (option.selected !== selected) {
  69683. option.selected = selected;
  69684. }
  69685. } else {
  69686. if (looseEqual(getValue(option), value)) {
  69687. if (el.selectedIndex !== i) {
  69688. el.selectedIndex = i;
  69689. }
  69690. return
  69691. }
  69692. }
  69693. }
  69694. if (!isMultiple) {
  69695. el.selectedIndex = -1;
  69696. }
  69697. }
  69698. function hasNoMatchingOption (value, options) {
  69699. return options.every(function (o) { return !looseEqual(o, value); })
  69700. }
  69701. function getValue (option) {
  69702. return '_value' in option
  69703. ? option._value
  69704. : option.value
  69705. }
  69706. function onCompositionStart (e) {
  69707. e.target.composing = true;
  69708. }
  69709. function onCompositionEnd (e) {
  69710. // prevent triggering an input event for no reason
  69711. if (!e.target.composing) { return }
  69712. e.target.composing = false;
  69713. trigger(e.target, 'input');
  69714. }
  69715. function trigger (el, type) {
  69716. var e = document.createEvent('HTMLEvents');
  69717. e.initEvent(type, true, true);
  69718. el.dispatchEvent(e);
  69719. }
  69720. /* */
  69721. // recursively search for possible transition defined inside the component root
  69722. function locateNode (vnode) {
  69723. return vnode.componentInstance && (!vnode.data || !vnode.data.transition)
  69724. ? locateNode(vnode.componentInstance._vnode)
  69725. : vnode
  69726. }
  69727. var show = {
  69728. bind: function bind (el, ref, vnode) {
  69729. var value = ref.value;
  69730. vnode = locateNode(vnode);
  69731. var transition$$1 = vnode.data && vnode.data.transition;
  69732. var originalDisplay = el.__vOriginalDisplay =
  69733. el.style.display === 'none' ? '' : el.style.display;
  69734. if (value && transition$$1) {
  69735. vnode.data.show = true;
  69736. enter(vnode, function () {
  69737. el.style.display = originalDisplay;
  69738. });
  69739. } else {
  69740. el.style.display = value ? originalDisplay : 'none';
  69741. }
  69742. },
  69743. update: function update (el, ref, vnode) {
  69744. var value = ref.value;
  69745. var oldValue = ref.oldValue;
  69746. /* istanbul ignore if */
  69747. if (!value === !oldValue) { return }
  69748. vnode = locateNode(vnode);
  69749. var transition$$1 = vnode.data && vnode.data.transition;
  69750. if (transition$$1) {
  69751. vnode.data.show = true;
  69752. if (value) {
  69753. enter(vnode, function () {
  69754. el.style.display = el.__vOriginalDisplay;
  69755. });
  69756. } else {
  69757. leave(vnode, function () {
  69758. el.style.display = 'none';
  69759. });
  69760. }
  69761. } else {
  69762. el.style.display = value ? el.__vOriginalDisplay : 'none';
  69763. }
  69764. },
  69765. unbind: function unbind (
  69766. el,
  69767. binding,
  69768. vnode,
  69769. oldVnode,
  69770. isDestroy
  69771. ) {
  69772. if (!isDestroy) {
  69773. el.style.display = el.__vOriginalDisplay;
  69774. }
  69775. }
  69776. };
  69777. var platformDirectives = {
  69778. model: directive,
  69779. show: show
  69780. };
  69781. /* */
  69782. var transitionProps = {
  69783. name: String,
  69784. appear: Boolean,
  69785. css: Boolean,
  69786. mode: String,
  69787. type: String,
  69788. enterClass: String,
  69789. leaveClass: String,
  69790. enterToClass: String,
  69791. leaveToClass: String,
  69792. enterActiveClass: String,
  69793. leaveActiveClass: String,
  69794. appearClass: String,
  69795. appearActiveClass: String,
  69796. appearToClass: String,
  69797. duration: [Number, String, Object]
  69798. };
  69799. // in case the child is also an abstract component, e.g. <keep-alive>
  69800. // we want to recursively retrieve the real component to be rendered
  69801. function getRealChild (vnode) {
  69802. var compOptions = vnode && vnode.componentOptions;
  69803. if (compOptions && compOptions.Ctor.options.abstract) {
  69804. return getRealChild(getFirstComponentChild(compOptions.children))
  69805. } else {
  69806. return vnode
  69807. }
  69808. }
  69809. function extractTransitionData (comp) {
  69810. var data = {};
  69811. var options = comp.$options;
  69812. // props
  69813. for (var key in options.propsData) {
  69814. data[key] = comp[key];
  69815. }
  69816. // events.
  69817. // extract listeners and pass them directly to the transition methods
  69818. var listeners = options._parentListeners;
  69819. for (var key$1 in listeners) {
  69820. data[camelize(key$1)] = listeners[key$1];
  69821. }
  69822. return data
  69823. }
  69824. function placeholder (h, rawChild) {
  69825. if (/\d-keep-alive$/.test(rawChild.tag)) {
  69826. return h('keep-alive', {
  69827. props: rawChild.componentOptions.propsData
  69828. })
  69829. }
  69830. }
  69831. function hasParentTransition (vnode) {
  69832. while ((vnode = vnode.parent)) {
  69833. if (vnode.data.transition) {
  69834. return true
  69835. }
  69836. }
  69837. }
  69838. function isSameChild (child, oldChild) {
  69839. return oldChild.key === child.key && oldChild.tag === child.tag
  69840. }
  69841. var isNotTextNode = function (c) { return c.tag || isAsyncPlaceholder(c); };
  69842. var isVShowDirective = function (d) { return d.name === 'show'; };
  69843. var Transition = {
  69844. name: 'transition',
  69845. props: transitionProps,
  69846. abstract: true,
  69847. render: function render (h) {
  69848. var this$1 = this;
  69849. var children = this.$slots.default;
  69850. if (!children) {
  69851. return
  69852. }
  69853. // filter out text nodes (possible whitespaces)
  69854. children = children.filter(isNotTextNode);
  69855. /* istanbul ignore if */
  69856. if (!children.length) {
  69857. return
  69858. }
  69859. // warn multiple elements
  69860. if (children.length > 1) {
  69861. warn(
  69862. '<transition> can only be used on a single element. Use ' +
  69863. '<transition-group> for lists.',
  69864. this.$parent
  69865. );
  69866. }
  69867. var mode = this.mode;
  69868. // warn invalid mode
  69869. if (mode && mode !== 'in-out' && mode !== 'out-in'
  69870. ) {
  69871. warn(
  69872. 'invalid <transition> mode: ' + mode,
  69873. this.$parent
  69874. );
  69875. }
  69876. var rawChild = children[0];
  69877. // if this is a component root node and the component's
  69878. // parent container node also has transition, skip.
  69879. if (hasParentTransition(this.$vnode)) {
  69880. return rawChild
  69881. }
  69882. // apply transition data to child
  69883. // use getRealChild() to ignore abstract components e.g. keep-alive
  69884. var child = getRealChild(rawChild);
  69885. /* istanbul ignore if */
  69886. if (!child) {
  69887. return rawChild
  69888. }
  69889. if (this._leaving) {
  69890. return placeholder(h, rawChild)
  69891. }
  69892. // ensure a key that is unique to the vnode type and to this transition
  69893. // component instance. This key will be used to remove pending leaving nodes
  69894. // during entering.
  69895. var id = "__transition-" + (this._uid) + "-";
  69896. child.key = child.key == null
  69897. ? child.isComment
  69898. ? id + 'comment'
  69899. : id + child.tag
  69900. : isPrimitive(child.key)
  69901. ? (String(child.key).indexOf(id) === 0 ? child.key : id + child.key)
  69902. : child.key;
  69903. var data = (child.data || (child.data = {})).transition = extractTransitionData(this);
  69904. var oldRawChild = this._vnode;
  69905. var oldChild = getRealChild(oldRawChild);
  69906. // mark v-show
  69907. // so that the transition module can hand over the control to the directive
  69908. if (child.data.directives && child.data.directives.some(isVShowDirective)) {
  69909. child.data.show = true;
  69910. }
  69911. if (
  69912. oldChild &&
  69913. oldChild.data &&
  69914. !isSameChild(child, oldChild) &&
  69915. !isAsyncPlaceholder(oldChild) &&
  69916. // #6687 component root is a comment node
  69917. !(oldChild.componentInstance && oldChild.componentInstance._vnode.isComment)
  69918. ) {
  69919. // replace old child transition data with fresh one
  69920. // important for dynamic transitions!
  69921. var oldData = oldChild.data.transition = extend({}, data);
  69922. // handle transition mode
  69923. if (mode === 'out-in') {
  69924. // return placeholder node and queue update when leave finishes
  69925. this._leaving = true;
  69926. mergeVNodeHook(oldData, 'afterLeave', function () {
  69927. this$1._leaving = false;
  69928. this$1.$forceUpdate();
  69929. });
  69930. return placeholder(h, rawChild)
  69931. } else if (mode === 'in-out') {
  69932. if (isAsyncPlaceholder(child)) {
  69933. return oldRawChild
  69934. }
  69935. var delayedLeave;
  69936. var performLeave = function () { delayedLeave(); };
  69937. mergeVNodeHook(data, 'afterEnter', performLeave);
  69938. mergeVNodeHook(data, 'enterCancelled', performLeave);
  69939. mergeVNodeHook(oldData, 'delayLeave', function (leave) { delayedLeave = leave; });
  69940. }
  69941. }
  69942. return rawChild
  69943. }
  69944. };
  69945. /* */
  69946. var props = extend({
  69947. tag: String,
  69948. moveClass: String
  69949. }, transitionProps);
  69950. delete props.mode;
  69951. var TransitionGroup = {
  69952. props: props,
  69953. beforeMount: function beforeMount () {
  69954. var this$1 = this;
  69955. var update = this._update;
  69956. this._update = function (vnode, hydrating) {
  69957. var restoreActiveInstance = setActiveInstance(this$1);
  69958. // force removing pass
  69959. this$1.__patch__(
  69960. this$1._vnode,
  69961. this$1.kept,
  69962. false, // hydrating
  69963. true // removeOnly (!important, avoids unnecessary moves)
  69964. );
  69965. this$1._vnode = this$1.kept;
  69966. restoreActiveInstance();
  69967. update.call(this$1, vnode, hydrating);
  69968. };
  69969. },
  69970. render: function render (h) {
  69971. var tag = this.tag || this.$vnode.data.tag || 'span';
  69972. var map = Object.create(null);
  69973. var prevChildren = this.prevChildren = this.children;
  69974. var rawChildren = this.$slots.default || [];
  69975. var children = this.children = [];
  69976. var transitionData = extractTransitionData(this);
  69977. for (var i = 0; i < rawChildren.length; i++) {
  69978. var c = rawChildren[i];
  69979. if (c.tag) {
  69980. if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
  69981. children.push(c);
  69982. map[c.key] = c
  69983. ;(c.data || (c.data = {})).transition = transitionData;
  69984. } else {
  69985. var opts = c.componentOptions;
  69986. var name = opts ? (opts.Ctor.options.name || opts.tag || '') : c.tag;
  69987. warn(("<transition-group> children must be keyed: <" + name + ">"));
  69988. }
  69989. }
  69990. }
  69991. if (prevChildren) {
  69992. var kept = [];
  69993. var removed = [];
  69994. for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {
  69995. var c$1 = prevChildren[i$1];
  69996. c$1.data.transition = transitionData;
  69997. c$1.data.pos = c$1.elm.getBoundingClientRect();
  69998. if (map[c$1.key]) {
  69999. kept.push(c$1);
  70000. } else {
  70001. removed.push(c$1);
  70002. }
  70003. }
  70004. this.kept = h(tag, null, kept);
  70005. this.removed = removed;
  70006. }
  70007. return h(tag, null, children)
  70008. },
  70009. updated: function updated () {
  70010. var children = this.prevChildren;
  70011. var moveClass = this.moveClass || ((this.name || 'v') + '-move');
  70012. if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
  70013. return
  70014. }
  70015. // we divide the work into three loops to avoid mixing DOM reads and writes
  70016. // in each iteration - which helps prevent layout thrashing.
  70017. children.forEach(callPendingCbs);
  70018. children.forEach(recordPosition);
  70019. children.forEach(applyTranslation);
  70020. // force reflow to put everything in position
  70021. // assign to this to avoid being removed in tree-shaking
  70022. // $flow-disable-line
  70023. this._reflow = document.body.offsetHeight;
  70024. children.forEach(function (c) {
  70025. if (c.data.moved) {
  70026. var el = c.elm;
  70027. var s = el.style;
  70028. addTransitionClass(el, moveClass);
  70029. s.transform = s.WebkitTransform = s.transitionDuration = '';
  70030. el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) {
  70031. if (e && e.target !== el) {
  70032. return
  70033. }
  70034. if (!e || /transform$/.test(e.propertyName)) {
  70035. el.removeEventListener(transitionEndEvent, cb);
  70036. el._moveCb = null;
  70037. removeTransitionClass(el, moveClass);
  70038. }
  70039. });
  70040. }
  70041. });
  70042. },
  70043. methods: {
  70044. hasMove: function hasMove (el, moveClass) {
  70045. /* istanbul ignore if */
  70046. if (!hasTransition) {
  70047. return false
  70048. }
  70049. /* istanbul ignore if */
  70050. if (this._hasMove) {
  70051. return this._hasMove
  70052. }
  70053. // Detect whether an element with the move class applied has
  70054. // CSS transitions. Since the element may be inside an entering
  70055. // transition at this very moment, we make a clone of it and remove
  70056. // all other transition classes applied to ensure only the move class
  70057. // is applied.
  70058. var clone = el.cloneNode();
  70059. if (el._transitionClasses) {
  70060. el._transitionClasses.forEach(function (cls) { removeClass(clone, cls); });
  70061. }
  70062. addClass(clone, moveClass);
  70063. clone.style.display = 'none';
  70064. this.$el.appendChild(clone);
  70065. var info = getTransitionInfo(clone);
  70066. this.$el.removeChild(clone);
  70067. return (this._hasMove = info.hasTransform)
  70068. }
  70069. }
  70070. };
  70071. function callPendingCbs (c) {
  70072. /* istanbul ignore if */
  70073. if (c.elm._moveCb) {
  70074. c.elm._moveCb();
  70075. }
  70076. /* istanbul ignore if */
  70077. if (c.elm._enterCb) {
  70078. c.elm._enterCb();
  70079. }
  70080. }
  70081. function recordPosition (c) {
  70082. c.data.newPos = c.elm.getBoundingClientRect();
  70083. }
  70084. function applyTranslation (c) {
  70085. var oldPos = c.data.pos;
  70086. var newPos = c.data.newPos;
  70087. var dx = oldPos.left - newPos.left;
  70088. var dy = oldPos.top - newPos.top;
  70089. if (dx || dy) {
  70090. c.data.moved = true;
  70091. var s = c.elm.style;
  70092. s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)";
  70093. s.transitionDuration = '0s';
  70094. }
  70095. }
  70096. var platformComponents = {
  70097. Transition: Transition,
  70098. TransitionGroup: TransitionGroup
  70099. };
  70100. /* */
  70101. // install platform specific utils
  70102. Vue.config.mustUseProp = mustUseProp;
  70103. Vue.config.isReservedTag = isReservedTag;
  70104. Vue.config.isReservedAttr = isReservedAttr;
  70105. Vue.config.getTagNamespace = getTagNamespace;
  70106. Vue.config.isUnknownElement = isUnknownElement;
  70107. // install platform runtime directives & components
  70108. extend(Vue.options.directives, platformDirectives);
  70109. extend(Vue.options.components, platformComponents);
  70110. // install platform patch function
  70111. Vue.prototype.__patch__ = inBrowser ? patch : noop;
  70112. // public mount method
  70113. Vue.prototype.$mount = function (
  70114. el,
  70115. hydrating
  70116. ) {
  70117. el = el && inBrowser ? query(el) : undefined;
  70118. return mountComponent(this, el, hydrating)
  70119. };
  70120. // devtools global hook
  70121. /* istanbul ignore next */
  70122. if (inBrowser) {
  70123. setTimeout(function () {
  70124. if (config.devtools) {
  70125. if (devtools) {
  70126. devtools.emit('init', Vue);
  70127. } else {
  70128. console[console.info ? 'info' : 'log'](
  70129. 'Download the Vue Devtools extension for a better development experience:\n' +
  70130. 'https://github.com/vuejs/vue-devtools'
  70131. );
  70132. }
  70133. }
  70134. if (config.productionTip !== false &&
  70135. typeof console !== 'undefined'
  70136. ) {
  70137. console[console.info ? 'info' : 'log'](
  70138. "You are running Vue in development mode.\n" +
  70139. "Make sure to turn on production mode when deploying for production.\n" +
  70140. "See more tips at https://vuejs.org/guide/deployment.html"
  70141. );
  70142. }
  70143. }, 0);
  70144. }
  70145. /* */
  70146. var defaultTagRE = /\{\{((?:.|\r?\n)+?)\}\}/g;
  70147. var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g;
  70148. var buildRegex = cached(function (delimiters) {
  70149. var open = delimiters[0].replace(regexEscapeRE, '\\$&');
  70150. var close = delimiters[1].replace(regexEscapeRE, '\\$&');
  70151. return new RegExp(open + '((?:.|\\n)+?)' + close, 'g')
  70152. });
  70153. function parseText (
  70154. text,
  70155. delimiters
  70156. ) {
  70157. var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;
  70158. if (!tagRE.test(text)) {
  70159. return
  70160. }
  70161. var tokens = [];
  70162. var rawTokens = [];
  70163. var lastIndex = tagRE.lastIndex = 0;
  70164. var match, index, tokenValue;
  70165. while ((match = tagRE.exec(text))) {
  70166. index = match.index;
  70167. // push text token
  70168. if (index > lastIndex) {
  70169. rawTokens.push(tokenValue = text.slice(lastIndex, index));
  70170. tokens.push(JSON.stringify(tokenValue));
  70171. }
  70172. // tag token
  70173. var exp = parseFilters(match[1].trim());
  70174. tokens.push(("_s(" + exp + ")"));
  70175. rawTokens.push({ '@binding': exp });
  70176. lastIndex = index + match[0].length;
  70177. }
  70178. if (lastIndex < text.length) {
  70179. rawTokens.push(tokenValue = text.slice(lastIndex));
  70180. tokens.push(JSON.stringify(tokenValue));
  70181. }
  70182. return {
  70183. expression: tokens.join('+'),
  70184. tokens: rawTokens
  70185. }
  70186. }
  70187. /* */
  70188. function transformNode (el, options) {
  70189. var warn = options.warn || baseWarn;
  70190. var staticClass = getAndRemoveAttr(el, 'class');
  70191. if (staticClass) {
  70192. var res = parseText(staticClass, options.delimiters);
  70193. if (res) {
  70194. warn(
  70195. "class=\"" + staticClass + "\": " +
  70196. 'Interpolation inside attributes has been removed. ' +
  70197. 'Use v-bind or the colon shorthand instead. For example, ' +
  70198. 'instead of <div class="{{ val }}">, use <div :class="val">.',
  70199. el.rawAttrsMap['class']
  70200. );
  70201. }
  70202. }
  70203. if (staticClass) {
  70204. el.staticClass = JSON.stringify(staticClass);
  70205. }
  70206. var classBinding = getBindingAttr(el, 'class', false /* getStatic */);
  70207. if (classBinding) {
  70208. el.classBinding = classBinding;
  70209. }
  70210. }
  70211. function genData (el) {
  70212. var data = '';
  70213. if (el.staticClass) {
  70214. data += "staticClass:" + (el.staticClass) + ",";
  70215. }
  70216. if (el.classBinding) {
  70217. data += "class:" + (el.classBinding) + ",";
  70218. }
  70219. return data
  70220. }
  70221. var klass$1 = {
  70222. staticKeys: ['staticClass'],
  70223. transformNode: transformNode,
  70224. genData: genData
  70225. };
  70226. /* */
  70227. function transformNode$1 (el, options) {
  70228. var warn = options.warn || baseWarn;
  70229. var staticStyle = getAndRemoveAttr(el, 'style');
  70230. if (staticStyle) {
  70231. /* istanbul ignore if */
  70232. {
  70233. var res = parseText(staticStyle, options.delimiters);
  70234. if (res) {
  70235. warn(
  70236. "style=\"" + staticStyle + "\": " +
  70237. 'Interpolation inside attributes has been removed. ' +
  70238. 'Use v-bind or the colon shorthand instead. For example, ' +
  70239. 'instead of <div style="{{ val }}">, use <div :style="val">.',
  70240. el.rawAttrsMap['style']
  70241. );
  70242. }
  70243. }
  70244. el.staticStyle = JSON.stringify(parseStyleText(staticStyle));
  70245. }
  70246. var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);
  70247. if (styleBinding) {
  70248. el.styleBinding = styleBinding;
  70249. }
  70250. }
  70251. function genData$1 (el) {
  70252. var data = '';
  70253. if (el.staticStyle) {
  70254. data += "staticStyle:" + (el.staticStyle) + ",";
  70255. }
  70256. if (el.styleBinding) {
  70257. data += "style:(" + (el.styleBinding) + "),";
  70258. }
  70259. return data
  70260. }
  70261. var style$1 = {
  70262. staticKeys: ['staticStyle'],
  70263. transformNode: transformNode$1,
  70264. genData: genData$1
  70265. };
  70266. /* */
  70267. var decoder;
  70268. var he = {
  70269. decode: function decode (html) {
  70270. decoder = decoder || document.createElement('div');
  70271. decoder.innerHTML = html;
  70272. return decoder.textContent
  70273. }
  70274. };
  70275. /* */
  70276. var isUnaryTag = makeMap(
  70277. 'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +
  70278. 'link,meta,param,source,track,wbr'
  70279. );
  70280. // Elements that you can, intentionally, leave open
  70281. // (and which close themselves)
  70282. var canBeLeftOpenTag = makeMap(
  70283. 'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source'
  70284. );
  70285. // HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3
  70286. // Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content
  70287. var isNonPhrasingTag = makeMap(
  70288. 'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +
  70289. 'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +
  70290. 'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +
  70291. 'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +
  70292. 'title,tr,track'
  70293. );
  70294. /**
  70295. * Not type-checking this file because it's mostly vendor code.
  70296. */
  70297. // Regular Expressions for parsing tags and attributes
  70298. var attribute = /^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
  70299. var dynamicArgAttribute = /^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
  70300. var ncname = "[a-zA-Z_][\\-\\.0-9_a-zA-Z" + (unicodeRegExp.source) + "]*";
  70301. var qnameCapture = "((?:" + ncname + "\\:)?" + ncname + ")";
  70302. var startTagOpen = new RegExp(("^<" + qnameCapture));
  70303. var startTagClose = /^\s*(\/?)>/;
  70304. var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>"));
  70305. var doctype = /^<!DOCTYPE [^>]+>/i;
  70306. // #7298: escape - to avoid being passed as HTML comment when inlined in page
  70307. var comment = /^<!\--/;
  70308. var conditionalComment = /^<!\[/;
  70309. // Special Elements (can contain anything)
  70310. var isPlainTextElement = makeMap('script,style,textarea', true);
  70311. var reCache = {};
  70312. var decodingMap = {
  70313. '&lt;': '<',
  70314. '&gt;': '>',
  70315. '&quot;': '"',
  70316. '&amp;': '&',
  70317. '&#10;': '\n',
  70318. '&#9;': '\t',
  70319. '&#39;': "'"
  70320. };
  70321. var encodedAttr = /&(?:lt|gt|quot|amp|#39);/g;
  70322. var encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#39|#10|#9);/g;
  70323. // #5992
  70324. var isIgnoreNewlineTag = makeMap('pre,textarea', true);
  70325. var shouldIgnoreFirstNewline = function (tag, html) { return tag && isIgnoreNewlineTag(tag) && html[0] === '\n'; };
  70326. function decodeAttr (value, shouldDecodeNewlines) {
  70327. var re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr;
  70328. return value.replace(re, function (match) { return decodingMap[match]; })
  70329. }
  70330. function parseHTML (html, options) {
  70331. var stack = [];
  70332. var expectHTML = options.expectHTML;
  70333. var isUnaryTag$$1 = options.isUnaryTag || no;
  70334. var canBeLeftOpenTag$$1 = options.canBeLeftOpenTag || no;
  70335. var index = 0;
  70336. var last, lastTag;
  70337. while (html) {
  70338. last = html;
  70339. // Make sure we're not in a plaintext content element like script/style
  70340. if (!lastTag || !isPlainTextElement(lastTag)) {
  70341. var textEnd = html.indexOf('<');
  70342. if (textEnd === 0) {
  70343. // Comment:
  70344. if (comment.test(html)) {
  70345. var commentEnd = html.indexOf('-->');
  70346. if (commentEnd >= 0) {
  70347. if (options.shouldKeepComment) {
  70348. options.comment(html.substring(4, commentEnd), index, index + commentEnd + 3);
  70349. }
  70350. advance(commentEnd + 3);
  70351. continue
  70352. }
  70353. }
  70354. // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
  70355. if (conditionalComment.test(html)) {
  70356. var conditionalEnd = html.indexOf(']>');
  70357. if (conditionalEnd >= 0) {
  70358. advance(conditionalEnd + 2);
  70359. continue
  70360. }
  70361. }
  70362. // Doctype:
  70363. var doctypeMatch = html.match(doctype);
  70364. if (doctypeMatch) {
  70365. advance(doctypeMatch[0].length);
  70366. continue
  70367. }
  70368. // End tag:
  70369. var endTagMatch = html.match(endTag);
  70370. if (endTagMatch) {
  70371. var curIndex = index;
  70372. advance(endTagMatch[0].length);
  70373. parseEndTag(endTagMatch[1], curIndex, index);
  70374. continue
  70375. }
  70376. // Start tag:
  70377. var startTagMatch = parseStartTag();
  70378. if (startTagMatch) {
  70379. handleStartTag(startTagMatch);
  70380. if (shouldIgnoreFirstNewline(startTagMatch.tagName, html)) {
  70381. advance(1);
  70382. }
  70383. continue
  70384. }
  70385. }
  70386. var text = (void 0), rest = (void 0), next = (void 0);
  70387. if (textEnd >= 0) {
  70388. rest = html.slice(textEnd);
  70389. while (
  70390. !endTag.test(rest) &&
  70391. !startTagOpen.test(rest) &&
  70392. !comment.test(rest) &&
  70393. !conditionalComment.test(rest)
  70394. ) {
  70395. // < in plain text, be forgiving and treat it as text
  70396. next = rest.indexOf('<', 1);
  70397. if (next < 0) { break }
  70398. textEnd += next;
  70399. rest = html.slice(textEnd);
  70400. }
  70401. text = html.substring(0, textEnd);
  70402. }
  70403. if (textEnd < 0) {
  70404. text = html;
  70405. }
  70406. if (text) {
  70407. advance(text.length);
  70408. }
  70409. if (options.chars && text) {
  70410. options.chars(text, index - text.length, index);
  70411. }
  70412. } else {
  70413. var endTagLength = 0;
  70414. var stackedTag = lastTag.toLowerCase();
  70415. var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\s\\S]*?)(</' + stackedTag + '[^>]*>)', 'i'));
  70416. var rest$1 = html.replace(reStackedTag, function (all, text, endTag) {
  70417. endTagLength = endTag.length;
  70418. if (!isPlainTextElement(stackedTag) && stackedTag !== 'noscript') {
  70419. text = text
  70420. .replace(/<!\--([\s\S]*?)-->/g, '$1') // #7298
  70421. .replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1');
  70422. }
  70423. if (shouldIgnoreFirstNewline(stackedTag, text)) {
  70424. text = text.slice(1);
  70425. }
  70426. if (options.chars) {
  70427. options.chars(text);
  70428. }
  70429. return ''
  70430. });
  70431. index += html.length - rest$1.length;
  70432. html = rest$1;
  70433. parseEndTag(stackedTag, index - endTagLength, index);
  70434. }
  70435. if (html === last) {
  70436. options.chars && options.chars(html);
  70437. if (!stack.length && options.warn) {
  70438. options.warn(("Mal-formatted tag at end of template: \"" + html + "\""), { start: index + html.length });
  70439. }
  70440. break
  70441. }
  70442. }
  70443. // Clean up any remaining tags
  70444. parseEndTag();
  70445. function advance (n) {
  70446. index += n;
  70447. html = html.substring(n);
  70448. }
  70449. function parseStartTag () {
  70450. var start = html.match(startTagOpen);
  70451. if (start) {
  70452. var match = {
  70453. tagName: start[1],
  70454. attrs: [],
  70455. start: index
  70456. };
  70457. advance(start[0].length);
  70458. var end, attr;
  70459. while (!(end = html.match(startTagClose)) && (attr = html.match(dynamicArgAttribute) || html.match(attribute))) {
  70460. attr.start = index;
  70461. advance(attr[0].length);
  70462. attr.end = index;
  70463. match.attrs.push(attr);
  70464. }
  70465. if (end) {
  70466. match.unarySlash = end[1];
  70467. advance(end[0].length);
  70468. match.end = index;
  70469. return match
  70470. }
  70471. }
  70472. }
  70473. function handleStartTag (match) {
  70474. var tagName = match.tagName;
  70475. var unarySlash = match.unarySlash;
  70476. if (expectHTML) {
  70477. if (lastTag === 'p' && isNonPhrasingTag(tagName)) {
  70478. parseEndTag(lastTag);
  70479. }
  70480. if (canBeLeftOpenTag$$1(tagName) && lastTag === tagName) {
  70481. parseEndTag(tagName);
  70482. }
  70483. }
  70484. var unary = isUnaryTag$$1(tagName) || !!unarySlash;
  70485. var l = match.attrs.length;
  70486. var attrs = new Array(l);
  70487. for (var i = 0; i < l; i++) {
  70488. var args = match.attrs[i];
  70489. var value = args[3] || args[4] || args[5] || '';
  70490. var shouldDecodeNewlines = tagName === 'a' && args[1] === 'href'
  70491. ? options.shouldDecodeNewlinesForHref
  70492. : options.shouldDecodeNewlines;
  70493. attrs[i] = {
  70494. name: args[1],
  70495. value: decodeAttr(value, shouldDecodeNewlines)
  70496. };
  70497. if (options.outputSourceRange) {
  70498. attrs[i].start = args.start + args[0].match(/^\s*/).length;
  70499. attrs[i].end = args.end;
  70500. }
  70501. }
  70502. if (!unary) {
  70503. stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs, start: match.start, end: match.end });
  70504. lastTag = tagName;
  70505. }
  70506. if (options.start) {
  70507. options.start(tagName, attrs, unary, match.start, match.end);
  70508. }
  70509. }
  70510. function parseEndTag (tagName, start, end) {
  70511. var pos, lowerCasedTagName;
  70512. if (start == null) { start = index; }
  70513. if (end == null) { end = index; }
  70514. // Find the closest opened tag of the same type
  70515. if (tagName) {
  70516. lowerCasedTagName = tagName.toLowerCase();
  70517. for (pos = stack.length - 1; pos >= 0; pos--) {
  70518. if (stack[pos].lowerCasedTag === lowerCasedTagName) {
  70519. break
  70520. }
  70521. }
  70522. } else {
  70523. // If no tag name is provided, clean shop
  70524. pos = 0;
  70525. }
  70526. if (pos >= 0) {
  70527. // Close all the open elements, up the stack
  70528. for (var i = stack.length - 1; i >= pos; i--) {
  70529. if (i > pos || !tagName &&
  70530. options.warn
  70531. ) {
  70532. options.warn(
  70533. ("tag <" + (stack[i].tag) + "> has no matching end tag."),
  70534. { start: stack[i].start, end: stack[i].end }
  70535. );
  70536. }
  70537. if (options.end) {
  70538. options.end(stack[i].tag, start, end);
  70539. }
  70540. }
  70541. // Remove the open elements from the stack
  70542. stack.length = pos;
  70543. lastTag = pos && stack[pos - 1].tag;
  70544. } else if (lowerCasedTagName === 'br') {
  70545. if (options.start) {
  70546. options.start(tagName, [], true, start, end);
  70547. }
  70548. } else if (lowerCasedTagName === 'p') {
  70549. if (options.start) {
  70550. options.start(tagName, [], false, start, end);
  70551. }
  70552. if (options.end) {
  70553. options.end(tagName, start, end);
  70554. }
  70555. }
  70556. }
  70557. }
  70558. /* */
  70559. var onRE = /^@|^v-on:/;
  70560. var dirRE = /^v-|^@|^:|^#/;
  70561. var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
  70562. var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
  70563. var stripParensRE = /^\(|\)$/g;
  70564. var dynamicArgRE = /^\[.*\]$/;
  70565. var argRE = /:(.*)$/;
  70566. var bindRE = /^:|^\.|^v-bind:/;
  70567. var modifierRE = /\.[^.\]]+(?=[^\]]*$)/g;
  70568. var slotRE = /^v-slot(:|$)|^#/;
  70569. var lineBreakRE = /[\r\n]/;
  70570. var whitespaceRE$1 = /\s+/g;
  70571. var invalidAttributeRE = /[\s"'<>\/=]/;
  70572. var decodeHTMLCached = cached(he.decode);
  70573. var emptySlotScopeToken = "_empty_";
  70574. // configurable state
  70575. var warn$2;
  70576. var delimiters;
  70577. var transforms;
  70578. var preTransforms;
  70579. var postTransforms;
  70580. var platformIsPreTag;
  70581. var platformMustUseProp;
  70582. var platformGetTagNamespace;
  70583. var maybeComponent;
  70584. function createASTElement (
  70585. tag,
  70586. attrs,
  70587. parent
  70588. ) {
  70589. return {
  70590. type: 1,
  70591. tag: tag,
  70592. attrsList: attrs,
  70593. attrsMap: makeAttrsMap(attrs),
  70594. rawAttrsMap: {},
  70595. parent: parent,
  70596. children: []
  70597. }
  70598. }
  70599. /**
  70600. * Convert HTML string to AST.
  70601. */
  70602. function parse (
  70603. template,
  70604. options
  70605. ) {
  70606. warn$2 = options.warn || baseWarn;
  70607. platformIsPreTag = options.isPreTag || no;
  70608. platformMustUseProp = options.mustUseProp || no;
  70609. platformGetTagNamespace = options.getTagNamespace || no;
  70610. var isReservedTag = options.isReservedTag || no;
  70611. maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); };
  70612. transforms = pluckModuleFunction(options.modules, 'transformNode');
  70613. preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');
  70614. postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');
  70615. delimiters = options.delimiters;
  70616. var stack = [];
  70617. var preserveWhitespace = options.preserveWhitespace !== false;
  70618. var whitespaceOption = options.whitespace;
  70619. var root;
  70620. var currentParent;
  70621. var inVPre = false;
  70622. var inPre = false;
  70623. var warned = false;
  70624. function warnOnce (msg, range) {
  70625. if (!warned) {
  70626. warned = true;
  70627. warn$2(msg, range);
  70628. }
  70629. }
  70630. function closeElement (element) {
  70631. trimEndingWhitespace(element);
  70632. if (!inVPre && !element.processed) {
  70633. element = processElement(element, options);
  70634. }
  70635. // tree management
  70636. if (!stack.length && element !== root) {
  70637. // allow root elements with v-if, v-else-if and v-else
  70638. if (root.if && (element.elseif || element.else)) {
  70639. {
  70640. checkRootConstraints(element);
  70641. }
  70642. addIfCondition(root, {
  70643. exp: element.elseif,
  70644. block: element
  70645. });
  70646. } else {
  70647. warnOnce(
  70648. "Component template should contain exactly one root element. " +
  70649. "If you are using v-if on multiple elements, " +
  70650. "use v-else-if to chain them instead.",
  70651. { start: element.start }
  70652. );
  70653. }
  70654. }
  70655. if (currentParent && !element.forbidden) {
  70656. if (element.elseif || element.else) {
  70657. processIfConditions(element, currentParent);
  70658. } else {
  70659. if (element.slotScope) {
  70660. // scoped slot
  70661. // keep it in the children list so that v-else(-if) conditions can
  70662. // find it as the prev node.
  70663. var name = element.slotTarget || '"default"'
  70664. ;(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;
  70665. }
  70666. currentParent.children.push(element);
  70667. element.parent = currentParent;
  70668. }
  70669. }
  70670. // final children cleanup
  70671. // filter out scoped slots
  70672. element.children = element.children.filter(function (c) { return !(c).slotScope; });
  70673. // remove trailing whitespace node again
  70674. trimEndingWhitespace(element);
  70675. // check pre state
  70676. if (element.pre) {
  70677. inVPre = false;
  70678. }
  70679. if (platformIsPreTag(element.tag)) {
  70680. inPre = false;
  70681. }
  70682. // apply post-transforms
  70683. for (var i = 0; i < postTransforms.length; i++) {
  70684. postTransforms[i](element, options);
  70685. }
  70686. }
  70687. function trimEndingWhitespace (el) {
  70688. // remove trailing whitespace node
  70689. if (!inPre) {
  70690. var lastNode;
  70691. while (
  70692. (lastNode = el.children[el.children.length - 1]) &&
  70693. lastNode.type === 3 &&
  70694. lastNode.text === ' '
  70695. ) {
  70696. el.children.pop();
  70697. }
  70698. }
  70699. }
  70700. function checkRootConstraints (el) {
  70701. if (el.tag === 'slot' || el.tag === 'template') {
  70702. warnOnce(
  70703. "Cannot use <" + (el.tag) + "> as component root element because it may " +
  70704. 'contain multiple nodes.',
  70705. { start: el.start }
  70706. );
  70707. }
  70708. if (el.attrsMap.hasOwnProperty('v-for')) {
  70709. warnOnce(
  70710. 'Cannot use v-for on stateful component root element because ' +
  70711. 'it renders multiple elements.',
  70712. el.rawAttrsMap['v-for']
  70713. );
  70714. }
  70715. }
  70716. parseHTML(template, {
  70717. warn: warn$2,
  70718. expectHTML: options.expectHTML,
  70719. isUnaryTag: options.isUnaryTag,
  70720. canBeLeftOpenTag: options.canBeLeftOpenTag,
  70721. shouldDecodeNewlines: options.shouldDecodeNewlines,
  70722. shouldDecodeNewlinesForHref: options.shouldDecodeNewlinesForHref,
  70723. shouldKeepComment: options.comments,
  70724. outputSourceRange: options.outputSourceRange,
  70725. start: function start (tag, attrs, unary, start$1, end) {
  70726. // check namespace.
  70727. // inherit parent ns if there is one
  70728. var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);
  70729. // handle IE svg bug
  70730. /* istanbul ignore if */
  70731. if (isIE && ns === 'svg') {
  70732. attrs = guardIESVGBug(attrs);
  70733. }
  70734. var element = createASTElement(tag, attrs, currentParent);
  70735. if (ns) {
  70736. element.ns = ns;
  70737. }
  70738. {
  70739. if (options.outputSourceRange) {
  70740. element.start = start$1;
  70741. element.end = end;
  70742. element.rawAttrsMap = element.attrsList.reduce(function (cumulated, attr) {
  70743. cumulated[attr.name] = attr;
  70744. return cumulated
  70745. }, {});
  70746. }
  70747. attrs.forEach(function (attr) {
  70748. if (invalidAttributeRE.test(attr.name)) {
  70749. warn$2(
  70750. "Invalid dynamic argument expression: attribute names cannot contain " +
  70751. "spaces, quotes, <, >, / or =.",
  70752. {
  70753. start: attr.start + attr.name.indexOf("["),
  70754. end: attr.start + attr.name.length
  70755. }
  70756. );
  70757. }
  70758. });
  70759. }
  70760. if (isForbiddenTag(element) && !isServerRendering()) {
  70761. element.forbidden = true;
  70762. warn$2(
  70763. 'Templates should only be responsible for mapping the state to the ' +
  70764. 'UI. Avoid placing tags with side-effects in your templates, such as ' +
  70765. "<" + tag + ">" + ', as they will not be parsed.',
  70766. { start: element.start }
  70767. );
  70768. }
  70769. // apply pre-transforms
  70770. for (var i = 0; i < preTransforms.length; i++) {
  70771. element = preTransforms[i](element, options) || element;
  70772. }
  70773. if (!inVPre) {
  70774. processPre(element);
  70775. if (element.pre) {
  70776. inVPre = true;
  70777. }
  70778. }
  70779. if (platformIsPreTag(element.tag)) {
  70780. inPre = true;
  70781. }
  70782. if (inVPre) {
  70783. processRawAttrs(element);
  70784. } else if (!element.processed) {
  70785. // structural directives
  70786. processFor(element);
  70787. processIf(element);
  70788. processOnce(element);
  70789. }
  70790. if (!root) {
  70791. root = element;
  70792. {
  70793. checkRootConstraints(root);
  70794. }
  70795. }
  70796. if (!unary) {
  70797. currentParent = element;
  70798. stack.push(element);
  70799. } else {
  70800. closeElement(element);
  70801. }
  70802. },
  70803. end: function end (tag, start, end$1) {
  70804. var element = stack[stack.length - 1];
  70805. // pop stack
  70806. stack.length -= 1;
  70807. currentParent = stack[stack.length - 1];
  70808. if (options.outputSourceRange) {
  70809. element.end = end$1;
  70810. }
  70811. closeElement(element);
  70812. },
  70813. chars: function chars (text, start, end) {
  70814. if (!currentParent) {
  70815. {
  70816. if (text === template) {
  70817. warnOnce(
  70818. 'Component template requires a root element, rather than just text.',
  70819. { start: start }
  70820. );
  70821. } else if ((text = text.trim())) {
  70822. warnOnce(
  70823. ("text \"" + text + "\" outside root element will be ignored."),
  70824. { start: start }
  70825. );
  70826. }
  70827. }
  70828. return
  70829. }
  70830. // IE textarea placeholder bug
  70831. /* istanbul ignore if */
  70832. if (isIE &&
  70833. currentParent.tag === 'textarea' &&
  70834. currentParent.attrsMap.placeholder === text
  70835. ) {
  70836. return
  70837. }
  70838. var children = currentParent.children;
  70839. if (inPre || text.trim()) {
  70840. text = isTextTag(currentParent) ? text : decodeHTMLCached(text);
  70841. } else if (!children.length) {
  70842. // remove the whitespace-only node right after an opening tag
  70843. text = '';
  70844. } else if (whitespaceOption) {
  70845. if (whitespaceOption === 'condense') {
  70846. // in condense mode, remove the whitespace node if it contains
  70847. // line break, otherwise condense to a single space
  70848. text = lineBreakRE.test(text) ? '' : ' ';
  70849. } else {
  70850. text = ' ';
  70851. }
  70852. } else {
  70853. text = preserveWhitespace ? ' ' : '';
  70854. }
  70855. if (text) {
  70856. if (!inPre && whitespaceOption === 'condense') {
  70857. // condense consecutive whitespaces into single space
  70858. text = text.replace(whitespaceRE$1, ' ');
  70859. }
  70860. var res;
  70861. var child;
  70862. if (!inVPre && text !== ' ' && (res = parseText(text, delimiters))) {
  70863. child = {
  70864. type: 2,
  70865. expression: res.expression,
  70866. tokens: res.tokens,
  70867. text: text
  70868. };
  70869. } else if (text !== ' ' || !children.length || children[children.length - 1].text !== ' ') {
  70870. child = {
  70871. type: 3,
  70872. text: text
  70873. };
  70874. }
  70875. if (child) {
  70876. if (options.outputSourceRange) {
  70877. child.start = start;
  70878. child.end = end;
  70879. }
  70880. children.push(child);
  70881. }
  70882. }
  70883. },
  70884. comment: function comment (text, start, end) {
  70885. // adding anyting as a sibling to the root node is forbidden
  70886. // comments should still be allowed, but ignored
  70887. if (currentParent) {
  70888. var child = {
  70889. type: 3,
  70890. text: text,
  70891. isComment: true
  70892. };
  70893. if (options.outputSourceRange) {
  70894. child.start = start;
  70895. child.end = end;
  70896. }
  70897. currentParent.children.push(child);
  70898. }
  70899. }
  70900. });
  70901. return root
  70902. }
  70903. function processPre (el) {
  70904. if (getAndRemoveAttr(el, 'v-pre') != null) {
  70905. el.pre = true;
  70906. }
  70907. }
  70908. function processRawAttrs (el) {
  70909. var list = el.attrsList;
  70910. var len = list.length;
  70911. if (len) {
  70912. var attrs = el.attrs = new Array(len);
  70913. for (var i = 0; i < len; i++) {
  70914. attrs[i] = {
  70915. name: list[i].name,
  70916. value: JSON.stringify(list[i].value)
  70917. };
  70918. if (list[i].start != null) {
  70919. attrs[i].start = list[i].start;
  70920. attrs[i].end = list[i].end;
  70921. }
  70922. }
  70923. } else if (!el.pre) {
  70924. // non root node in pre blocks with no attributes
  70925. el.plain = true;
  70926. }
  70927. }
  70928. function processElement (
  70929. element,
  70930. options
  70931. ) {
  70932. processKey(element);
  70933. // determine whether this is a plain element after
  70934. // removing structural attributes
  70935. element.plain = (
  70936. !element.key &&
  70937. !element.scopedSlots &&
  70938. !element.attrsList.length
  70939. );
  70940. processRef(element);
  70941. processSlotContent(element);
  70942. processSlotOutlet(element);
  70943. processComponent(element);
  70944. for (var i = 0; i < transforms.length; i++) {
  70945. element = transforms[i](element, options) || element;
  70946. }
  70947. processAttrs(element);
  70948. return element
  70949. }
  70950. function processKey (el) {
  70951. var exp = getBindingAttr(el, 'key');
  70952. if (exp) {
  70953. {
  70954. if (el.tag === 'template') {
  70955. warn$2(
  70956. "<template> cannot be keyed. Place the key on real elements instead.",
  70957. getRawBindingAttr(el, 'key')
  70958. );
  70959. }
  70960. if (el.for) {
  70961. var iterator = el.iterator2 || el.iterator1;
  70962. var parent = el.parent;
  70963. if (iterator && iterator === exp && parent && parent.tag === 'transition-group') {
  70964. warn$2(
  70965. "Do not use v-for index as key on <transition-group> children, " +
  70966. "this is the same as not using keys.",
  70967. getRawBindingAttr(el, 'key'),
  70968. true /* tip */
  70969. );
  70970. }
  70971. }
  70972. }
  70973. el.key = exp;
  70974. }
  70975. }
  70976. function processRef (el) {
  70977. var ref = getBindingAttr(el, 'ref');
  70978. if (ref) {
  70979. el.ref = ref;
  70980. el.refInFor = checkInFor(el);
  70981. }
  70982. }
  70983. function processFor (el) {
  70984. var exp;
  70985. if ((exp = getAndRemoveAttr(el, 'v-for'))) {
  70986. var res = parseFor(exp);
  70987. if (res) {
  70988. extend(el, res);
  70989. } else {
  70990. warn$2(
  70991. ("Invalid v-for expression: " + exp),
  70992. el.rawAttrsMap['v-for']
  70993. );
  70994. }
  70995. }
  70996. }
  70997. function parseFor (exp) {
  70998. var inMatch = exp.match(forAliasRE);
  70999. if (!inMatch) { return }
  71000. var res = {};
  71001. res.for = inMatch[2].trim();
  71002. var alias = inMatch[1].trim().replace(stripParensRE, '');
  71003. var iteratorMatch = alias.match(forIteratorRE);
  71004. if (iteratorMatch) {
  71005. res.alias = alias.replace(forIteratorRE, '').trim();
  71006. res.iterator1 = iteratorMatch[1].trim();
  71007. if (iteratorMatch[2]) {
  71008. res.iterator2 = iteratorMatch[2].trim();
  71009. }
  71010. } else {
  71011. res.alias = alias;
  71012. }
  71013. return res
  71014. }
  71015. function processIf (el) {
  71016. var exp = getAndRemoveAttr(el, 'v-if');
  71017. if (exp) {
  71018. el.if = exp;
  71019. addIfCondition(el, {
  71020. exp: exp,
  71021. block: el
  71022. });
  71023. } else {
  71024. if (getAndRemoveAttr(el, 'v-else') != null) {
  71025. el.else = true;
  71026. }
  71027. var elseif = getAndRemoveAttr(el, 'v-else-if');
  71028. if (elseif) {
  71029. el.elseif = elseif;
  71030. }
  71031. }
  71032. }
  71033. function processIfConditions (el, parent) {
  71034. var prev = findPrevElement(parent.children);
  71035. if (prev && prev.if) {
  71036. addIfCondition(prev, {
  71037. exp: el.elseif,
  71038. block: el
  71039. });
  71040. } else {
  71041. warn$2(
  71042. "v-" + (el.elseif ? ('else-if="' + el.elseif + '"') : 'else') + " " +
  71043. "used on element <" + (el.tag) + "> without corresponding v-if.",
  71044. el.rawAttrsMap[el.elseif ? 'v-else-if' : 'v-else']
  71045. );
  71046. }
  71047. }
  71048. function findPrevElement (children) {
  71049. var i = children.length;
  71050. while (i--) {
  71051. if (children[i].type === 1) {
  71052. return children[i]
  71053. } else {
  71054. if (children[i].text !== ' ') {
  71055. warn$2(
  71056. "text \"" + (children[i].text.trim()) + "\" between v-if and v-else(-if) " +
  71057. "will be ignored.",
  71058. children[i]
  71059. );
  71060. }
  71061. children.pop();
  71062. }
  71063. }
  71064. }
  71065. function addIfCondition (el, condition) {
  71066. if (!el.ifConditions) {
  71067. el.ifConditions = [];
  71068. }
  71069. el.ifConditions.push(condition);
  71070. }
  71071. function processOnce (el) {
  71072. var once$$1 = getAndRemoveAttr(el, 'v-once');
  71073. if (once$$1 != null) {
  71074. el.once = true;
  71075. }
  71076. }
  71077. // handle content being passed to a component as slot,
  71078. // e.g. <template slot="xxx">, <div slot-scope="xxx">
  71079. function processSlotContent (el) {
  71080. var slotScope;
  71081. if (el.tag === 'template') {
  71082. slotScope = getAndRemoveAttr(el, 'scope');
  71083. /* istanbul ignore if */
  71084. if (slotScope) {
  71085. warn$2(
  71086. "the \"scope\" attribute for scoped slots have been deprecated and " +
  71087. "replaced by \"slot-scope\" since 2.5. The new \"slot-scope\" attribute " +
  71088. "can also be used on plain elements in addition to <template> to " +
  71089. "denote scoped slots.",
  71090. el.rawAttrsMap['scope'],
  71091. true
  71092. );
  71093. }
  71094. el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope');
  71095. } else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) {
  71096. /* istanbul ignore if */
  71097. if (el.attrsMap['v-for']) {
  71098. warn$2(
  71099. "Ambiguous combined usage of slot-scope and v-for on <" + (el.tag) + "> " +
  71100. "(v-for takes higher priority). Use a wrapper <template> for the " +
  71101. "scoped slot to make it clearer.",
  71102. el.rawAttrsMap['slot-scope'],
  71103. true
  71104. );
  71105. }
  71106. el.slotScope = slotScope;
  71107. }
  71108. // slot="xxx"
  71109. var slotTarget = getBindingAttr(el, 'slot');
  71110. if (slotTarget) {
  71111. el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget;
  71112. el.slotTargetDynamic = !!(el.attrsMap[':slot'] || el.attrsMap['v-bind:slot']);
  71113. // preserve slot as an attribute for native shadow DOM compat
  71114. // only for non-scoped slots.
  71115. if (el.tag !== 'template' && !el.slotScope) {
  71116. addAttr(el, 'slot', slotTarget, getRawBindingAttr(el, 'slot'));
  71117. }
  71118. }
  71119. // 2.6 v-slot syntax
  71120. {
  71121. if (el.tag === 'template') {
  71122. // v-slot on <template>
  71123. var slotBinding = getAndRemoveAttrByRegex(el, slotRE);
  71124. if (slotBinding) {
  71125. {
  71126. if (el.slotTarget || el.slotScope) {
  71127. warn$2(
  71128. "Unexpected mixed usage of different slot syntaxes.",
  71129. el
  71130. );
  71131. }
  71132. if (el.parent && !maybeComponent(el.parent)) {
  71133. warn$2(
  71134. "<template v-slot> can only appear at the root level inside " +
  71135. "the receiving component",
  71136. el
  71137. );
  71138. }
  71139. }
  71140. var ref = getSlotName(slotBinding);
  71141. var name = ref.name;
  71142. var dynamic = ref.dynamic;
  71143. el.slotTarget = name;
  71144. el.slotTargetDynamic = dynamic;
  71145. el.slotScope = slotBinding.value || emptySlotScopeToken; // force it into a scoped slot for perf
  71146. }
  71147. } else {
  71148. // v-slot on component, denotes default slot
  71149. var slotBinding$1 = getAndRemoveAttrByRegex(el, slotRE);
  71150. if (slotBinding$1) {
  71151. {
  71152. if (!maybeComponent(el)) {
  71153. warn$2(
  71154. "v-slot can only be used on components or <template>.",
  71155. slotBinding$1
  71156. );
  71157. }
  71158. if (el.slotScope || el.slotTarget) {
  71159. warn$2(
  71160. "Unexpected mixed usage of different slot syntaxes.",
  71161. el
  71162. );
  71163. }
  71164. if (el.scopedSlots) {
  71165. warn$2(
  71166. "To avoid scope ambiguity, the default slot should also use " +
  71167. "<template> syntax when there are other named slots.",
  71168. slotBinding$1
  71169. );
  71170. }
  71171. }
  71172. // add the component's children to its default slot
  71173. var slots = el.scopedSlots || (el.scopedSlots = {});
  71174. var ref$1 = getSlotName(slotBinding$1);
  71175. var name$1 = ref$1.name;
  71176. var dynamic$1 = ref$1.dynamic;
  71177. var slotContainer = slots[name$1] = createASTElement('template', [], el);
  71178. slotContainer.slotTarget = name$1;
  71179. slotContainer.slotTargetDynamic = dynamic$1;
  71180. slotContainer.children = el.children.filter(function (c) {
  71181. if (!c.slotScope) {
  71182. c.parent = slotContainer;
  71183. return true
  71184. }
  71185. });
  71186. slotContainer.slotScope = slotBinding$1.value || emptySlotScopeToken;
  71187. // remove children as they are returned from scopedSlots now
  71188. el.children = [];
  71189. // mark el non-plain so data gets generated
  71190. el.plain = false;
  71191. }
  71192. }
  71193. }
  71194. }
  71195. function getSlotName (binding) {
  71196. var name = binding.name.replace(slotRE, '');
  71197. if (!name) {
  71198. if (binding.name[0] !== '#') {
  71199. name = 'default';
  71200. } else {
  71201. warn$2(
  71202. "v-slot shorthand syntax requires a slot name.",
  71203. binding
  71204. );
  71205. }
  71206. }
  71207. return dynamicArgRE.test(name)
  71208. // dynamic [name]
  71209. ? { name: name.slice(1, -1), dynamic: true }
  71210. // static name
  71211. : { name: ("\"" + name + "\""), dynamic: false }
  71212. }
  71213. // handle <slot/> outlets
  71214. function processSlotOutlet (el) {
  71215. if (el.tag === 'slot') {
  71216. el.slotName = getBindingAttr(el, 'name');
  71217. if (el.key) {
  71218. warn$2(
  71219. "`key` does not work on <slot> because slots are abstract outlets " +
  71220. "and can possibly expand into multiple elements. " +
  71221. "Use the key on a wrapping element instead.",
  71222. getRawBindingAttr(el, 'key')
  71223. );
  71224. }
  71225. }
  71226. }
  71227. function processComponent (el) {
  71228. var binding;
  71229. if ((binding = getBindingAttr(el, 'is'))) {
  71230. el.component = binding;
  71231. }
  71232. if (getAndRemoveAttr(el, 'inline-template') != null) {
  71233. el.inlineTemplate = true;
  71234. }
  71235. }
  71236. function processAttrs (el) {
  71237. var list = el.attrsList;
  71238. var i, l, name, rawName, value, modifiers, syncGen, isDynamic;
  71239. for (i = 0, l = list.length; i < l; i++) {
  71240. name = rawName = list[i].name;
  71241. value = list[i].value;
  71242. if (dirRE.test(name)) {
  71243. // mark element as dynamic
  71244. el.hasBindings = true;
  71245. // modifiers
  71246. modifiers = parseModifiers(name.replace(dirRE, ''));
  71247. // support .foo shorthand syntax for the .prop modifier
  71248. if (modifiers) {
  71249. name = name.replace(modifierRE, '');
  71250. }
  71251. if (bindRE.test(name)) { // v-bind
  71252. name = name.replace(bindRE, '');
  71253. value = parseFilters(value);
  71254. isDynamic = dynamicArgRE.test(name);
  71255. if (isDynamic) {
  71256. name = name.slice(1, -1);
  71257. }
  71258. if (
  71259. value.trim().length === 0
  71260. ) {
  71261. warn$2(
  71262. ("The value for a v-bind expression cannot be empty. Found in \"v-bind:" + name + "\"")
  71263. );
  71264. }
  71265. if (modifiers) {
  71266. if (modifiers.prop && !isDynamic) {
  71267. name = camelize(name);
  71268. if (name === 'innerHtml') { name = 'innerHTML'; }
  71269. }
  71270. if (modifiers.camel && !isDynamic) {
  71271. name = camelize(name);
  71272. }
  71273. if (modifiers.sync) {
  71274. syncGen = genAssignmentCode(value, "$event");
  71275. if (!isDynamic) {
  71276. addHandler(
  71277. el,
  71278. ("update:" + (camelize(name))),
  71279. syncGen,
  71280. null,
  71281. false,
  71282. warn$2,
  71283. list[i]
  71284. );
  71285. if (hyphenate(name) !== camelize(name)) {
  71286. addHandler(
  71287. el,
  71288. ("update:" + (hyphenate(name))),
  71289. syncGen,
  71290. null,
  71291. false,
  71292. warn$2,
  71293. list[i]
  71294. );
  71295. }
  71296. } else {
  71297. // handler w/ dynamic event name
  71298. addHandler(
  71299. el,
  71300. ("\"update:\"+(" + name + ")"),
  71301. syncGen,
  71302. null,
  71303. false,
  71304. warn$2,
  71305. list[i],
  71306. true // dynamic
  71307. );
  71308. }
  71309. }
  71310. }
  71311. if ((modifiers && modifiers.prop) || (
  71312. !el.component && platformMustUseProp(el.tag, el.attrsMap.type, name)
  71313. )) {
  71314. addProp(el, name, value, list[i], isDynamic);
  71315. } else {
  71316. addAttr(el, name, value, list[i], isDynamic);
  71317. }
  71318. } else if (onRE.test(name)) { // v-on
  71319. name = name.replace(onRE, '');
  71320. isDynamic = dynamicArgRE.test(name);
  71321. if (isDynamic) {
  71322. name = name.slice(1, -1);
  71323. }
  71324. addHandler(el, name, value, modifiers, false, warn$2, list[i], isDynamic);
  71325. } else { // normal directives
  71326. name = name.replace(dirRE, '');
  71327. // parse arg
  71328. var argMatch = name.match(argRE);
  71329. var arg = argMatch && argMatch[1];
  71330. isDynamic = false;
  71331. if (arg) {
  71332. name = name.slice(0, -(arg.length + 1));
  71333. if (dynamicArgRE.test(arg)) {
  71334. arg = arg.slice(1, -1);
  71335. isDynamic = true;
  71336. }
  71337. }
  71338. addDirective(el, name, rawName, value, arg, isDynamic, modifiers, list[i]);
  71339. if (name === 'model') {
  71340. checkForAliasModel(el, value);
  71341. }
  71342. }
  71343. } else {
  71344. // literal attribute
  71345. {
  71346. var res = parseText(value, delimiters);
  71347. if (res) {
  71348. warn$2(
  71349. name + "=\"" + value + "\": " +
  71350. 'Interpolation inside attributes has been removed. ' +
  71351. 'Use v-bind or the colon shorthand instead. For example, ' +
  71352. 'instead of <div id="{{ val }}">, use <div :id="val">.',
  71353. list[i]
  71354. );
  71355. }
  71356. }
  71357. addAttr(el, name, JSON.stringify(value), list[i]);
  71358. // #6887 firefox doesn't update muted state if set via attribute
  71359. // even immediately after element creation
  71360. if (!el.component &&
  71361. name === 'muted' &&
  71362. platformMustUseProp(el.tag, el.attrsMap.type, name)) {
  71363. addProp(el, name, 'true', list[i]);
  71364. }
  71365. }
  71366. }
  71367. }
  71368. function checkInFor (el) {
  71369. var parent = el;
  71370. while (parent) {
  71371. if (parent.for !== undefined) {
  71372. return true
  71373. }
  71374. parent = parent.parent;
  71375. }
  71376. return false
  71377. }
  71378. function parseModifiers (name) {
  71379. var match = name.match(modifierRE);
  71380. if (match) {
  71381. var ret = {};
  71382. match.forEach(function (m) { ret[m.slice(1)] = true; });
  71383. return ret
  71384. }
  71385. }
  71386. function makeAttrsMap (attrs) {
  71387. var map = {};
  71388. for (var i = 0, l = attrs.length; i < l; i++) {
  71389. if (
  71390. map[attrs[i].name] && !isIE && !isEdge
  71391. ) {
  71392. warn$2('duplicate attribute: ' + attrs[i].name, attrs[i]);
  71393. }
  71394. map[attrs[i].name] = attrs[i].value;
  71395. }
  71396. return map
  71397. }
  71398. // for script (e.g. type="x/template") or style, do not decode content
  71399. function isTextTag (el) {
  71400. return el.tag === 'script' || el.tag === 'style'
  71401. }
  71402. function isForbiddenTag (el) {
  71403. return (
  71404. el.tag === 'style' ||
  71405. (el.tag === 'script' && (
  71406. !el.attrsMap.type ||
  71407. el.attrsMap.type === 'text/javascript'
  71408. ))
  71409. )
  71410. }
  71411. var ieNSBug = /^xmlns:NS\d+/;
  71412. var ieNSPrefix = /^NS\d+:/;
  71413. /* istanbul ignore next */
  71414. function guardIESVGBug (attrs) {
  71415. var res = [];
  71416. for (var i = 0; i < attrs.length; i++) {
  71417. var attr = attrs[i];
  71418. if (!ieNSBug.test(attr.name)) {
  71419. attr.name = attr.name.replace(ieNSPrefix, '');
  71420. res.push(attr);
  71421. }
  71422. }
  71423. return res
  71424. }
  71425. function checkForAliasModel (el, value) {
  71426. var _el = el;
  71427. while (_el) {
  71428. if (_el.for && _el.alias === value) {
  71429. warn$2(
  71430. "<" + (el.tag) + " v-model=\"" + value + "\">: " +
  71431. "You are binding v-model directly to a v-for iteration alias. " +
  71432. "This will not be able to modify the v-for source array because " +
  71433. "writing to the alias is like modifying a function local variable. " +
  71434. "Consider using an array of objects and use v-model on an object property instead.",
  71435. el.rawAttrsMap['v-model']
  71436. );
  71437. }
  71438. _el = _el.parent;
  71439. }
  71440. }
  71441. /* */
  71442. function preTransformNode (el, options) {
  71443. if (el.tag === 'input') {
  71444. var map = el.attrsMap;
  71445. if (!map['v-model']) {
  71446. return
  71447. }
  71448. var typeBinding;
  71449. if (map[':type'] || map['v-bind:type']) {
  71450. typeBinding = getBindingAttr(el, 'type');
  71451. }
  71452. if (!map.type && !typeBinding && map['v-bind']) {
  71453. typeBinding = "(" + (map['v-bind']) + ").type";
  71454. }
  71455. if (typeBinding) {
  71456. var ifCondition = getAndRemoveAttr(el, 'v-if', true);
  71457. var ifConditionExtra = ifCondition ? ("&&(" + ifCondition + ")") : "";
  71458. var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;
  71459. var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);
  71460. // 1. checkbox
  71461. var branch0 = cloneASTElement(el);
  71462. // process for on the main node
  71463. processFor(branch0);
  71464. addRawAttr(branch0, 'type', 'checkbox');
  71465. processElement(branch0, options);
  71466. branch0.processed = true; // prevent it from double-processed
  71467. branch0.if = "(" + typeBinding + ")==='checkbox'" + ifConditionExtra;
  71468. addIfCondition(branch0, {
  71469. exp: branch0.if,
  71470. block: branch0
  71471. });
  71472. // 2. add radio else-if condition
  71473. var branch1 = cloneASTElement(el);
  71474. getAndRemoveAttr(branch1, 'v-for', true);
  71475. addRawAttr(branch1, 'type', 'radio');
  71476. processElement(branch1, options);
  71477. addIfCondition(branch0, {
  71478. exp: "(" + typeBinding + ")==='radio'" + ifConditionExtra,
  71479. block: branch1
  71480. });
  71481. // 3. other
  71482. var branch2 = cloneASTElement(el);
  71483. getAndRemoveAttr(branch2, 'v-for', true);
  71484. addRawAttr(branch2, ':type', typeBinding);
  71485. processElement(branch2, options);
  71486. addIfCondition(branch0, {
  71487. exp: ifCondition,
  71488. block: branch2
  71489. });
  71490. if (hasElse) {
  71491. branch0.else = true;
  71492. } else if (elseIfCondition) {
  71493. branch0.elseif = elseIfCondition;
  71494. }
  71495. return branch0
  71496. }
  71497. }
  71498. }
  71499. function cloneASTElement (el) {
  71500. return createASTElement(el.tag, el.attrsList.slice(), el.parent)
  71501. }
  71502. var model$1 = {
  71503. preTransformNode: preTransformNode
  71504. };
  71505. var modules$1 = [
  71506. klass$1,
  71507. style$1,
  71508. model$1
  71509. ];
  71510. /* */
  71511. function text (el, dir) {
  71512. if (dir.value) {
  71513. addProp(el, 'textContent', ("_s(" + (dir.value) + ")"), dir);
  71514. }
  71515. }
  71516. /* */
  71517. function html (el, dir) {
  71518. if (dir.value) {
  71519. addProp(el, 'innerHTML', ("_s(" + (dir.value) + ")"), dir);
  71520. }
  71521. }
  71522. var directives$1 = {
  71523. model: model,
  71524. text: text,
  71525. html: html
  71526. };
  71527. /* */
  71528. var baseOptions = {
  71529. expectHTML: true,
  71530. modules: modules$1,
  71531. directives: directives$1,
  71532. isPreTag: isPreTag,
  71533. isUnaryTag: isUnaryTag,
  71534. mustUseProp: mustUseProp,
  71535. canBeLeftOpenTag: canBeLeftOpenTag,
  71536. isReservedTag: isReservedTag,
  71537. getTagNamespace: getTagNamespace,
  71538. staticKeys: genStaticKeys(modules$1)
  71539. };
  71540. /* */
  71541. var isStaticKey;
  71542. var isPlatformReservedTag;
  71543. var genStaticKeysCached = cached(genStaticKeys$1);
  71544. /**
  71545. * Goal of the optimizer: walk the generated template AST tree
  71546. * and detect sub-trees that are purely static, i.e. parts of
  71547. * the DOM that never needs to change.
  71548. *
  71549. * Once we detect these sub-trees, we can:
  71550. *
  71551. * 1. Hoist them into constants, so that we no longer need to
  71552. * create fresh nodes for them on each re-render;
  71553. * 2. Completely skip them in the patching process.
  71554. */
  71555. function optimize (root, options) {
  71556. if (!root) { return }
  71557. isStaticKey = genStaticKeysCached(options.staticKeys || '');
  71558. isPlatformReservedTag = options.isReservedTag || no;
  71559. // first pass: mark all non-static nodes.
  71560. markStatic$1(root);
  71561. // second pass: mark static roots.
  71562. markStaticRoots(root, false);
  71563. }
  71564. function genStaticKeys$1 (keys) {
  71565. return makeMap(
  71566. 'type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap' +
  71567. (keys ? ',' + keys : '')
  71568. )
  71569. }
  71570. function markStatic$1 (node) {
  71571. node.static = isStatic(node);
  71572. if (node.type === 1) {
  71573. // do not make component slot content static. this avoids
  71574. // 1. components not able to mutate slot nodes
  71575. // 2. static slot content fails for hot-reloading
  71576. if (
  71577. !isPlatformReservedTag(node.tag) &&
  71578. node.tag !== 'slot' &&
  71579. node.attrsMap['inline-template'] == null
  71580. ) {
  71581. return
  71582. }
  71583. for (var i = 0, l = node.children.length; i < l; i++) {
  71584. var child = node.children[i];
  71585. markStatic$1(child);
  71586. if (!child.static) {
  71587. node.static = false;
  71588. }
  71589. }
  71590. if (node.ifConditions) {
  71591. for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {
  71592. var block = node.ifConditions[i$1].block;
  71593. markStatic$1(block);
  71594. if (!block.static) {
  71595. node.static = false;
  71596. }
  71597. }
  71598. }
  71599. }
  71600. }
  71601. function markStaticRoots (node, isInFor) {
  71602. if (node.type === 1) {
  71603. if (node.static || node.once) {
  71604. node.staticInFor = isInFor;
  71605. }
  71606. // For a node to qualify as a static root, it should have children that
  71607. // are not just static text. Otherwise the cost of hoisting out will
  71608. // outweigh the benefits and it's better off to just always render it fresh.
  71609. if (node.static && node.children.length && !(
  71610. node.children.length === 1 &&
  71611. node.children[0].type === 3
  71612. )) {
  71613. node.staticRoot = true;
  71614. return
  71615. } else {
  71616. node.staticRoot = false;
  71617. }
  71618. if (node.children) {
  71619. for (var i = 0, l = node.children.length; i < l; i++) {
  71620. markStaticRoots(node.children[i], isInFor || !!node.for);
  71621. }
  71622. }
  71623. if (node.ifConditions) {
  71624. for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {
  71625. markStaticRoots(node.ifConditions[i$1].block, isInFor);
  71626. }
  71627. }
  71628. }
  71629. }
  71630. function isStatic (node) {
  71631. if (node.type === 2) { // expression
  71632. return false
  71633. }
  71634. if (node.type === 3) { // text
  71635. return true
  71636. }
  71637. return !!(node.pre || (
  71638. !node.hasBindings && // no dynamic bindings
  71639. !node.if && !node.for && // not v-if or v-for or v-else
  71640. !isBuiltInTag(node.tag) && // not a built-in
  71641. isPlatformReservedTag(node.tag) && // not a component
  71642. !isDirectChildOfTemplateFor(node) &&
  71643. Object.keys(node).every(isStaticKey)
  71644. ))
  71645. }
  71646. function isDirectChildOfTemplateFor (node) {
  71647. while (node.parent) {
  71648. node = node.parent;
  71649. if (node.tag !== 'template') {
  71650. return false
  71651. }
  71652. if (node.for) {
  71653. return true
  71654. }
  71655. }
  71656. return false
  71657. }
  71658. /* */
  71659. var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/;
  71660. var fnInvokeRE = /\([^)]*?\);*$/;
  71661. var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;
  71662. // KeyboardEvent.keyCode aliases
  71663. var keyCodes = {
  71664. esc: 27,
  71665. tab: 9,
  71666. enter: 13,
  71667. space: 32,
  71668. up: 38,
  71669. left: 37,
  71670. right: 39,
  71671. down: 40,
  71672. 'delete': [8, 46]
  71673. };
  71674. // KeyboardEvent.key aliases
  71675. var keyNames = {
  71676. // #7880: IE11 and Edge use `Esc` for Escape key name.
  71677. esc: ['Esc', 'Escape'],
  71678. tab: 'Tab',
  71679. enter: 'Enter',
  71680. // #9112: IE11 uses `Spacebar` for Space key name.
  71681. space: [' ', 'Spacebar'],
  71682. // #7806: IE11 uses key names without `Arrow` prefix for arrow keys.
  71683. up: ['Up', 'ArrowUp'],
  71684. left: ['Left', 'ArrowLeft'],
  71685. right: ['Right', 'ArrowRight'],
  71686. down: ['Down', 'ArrowDown'],
  71687. // #9112: IE11 uses `Del` for Delete key name.
  71688. 'delete': ['Backspace', 'Delete', 'Del']
  71689. };
  71690. // #4868: modifiers that prevent the execution of the listener
  71691. // need to explicitly return null so that we can determine whether to remove
  71692. // the listener for .once
  71693. var genGuard = function (condition) { return ("if(" + condition + ")return null;"); };
  71694. var modifierCode = {
  71695. stop: '$event.stopPropagation();',
  71696. prevent: '$event.preventDefault();',
  71697. self: genGuard("$event.target !== $event.currentTarget"),
  71698. ctrl: genGuard("!$event.ctrlKey"),
  71699. shift: genGuard("!$event.shiftKey"),
  71700. alt: genGuard("!$event.altKey"),
  71701. meta: genGuard("!$event.metaKey"),
  71702. left: genGuard("'button' in $event && $event.button !== 0"),
  71703. middle: genGuard("'button' in $event && $event.button !== 1"),
  71704. right: genGuard("'button' in $event && $event.button !== 2")
  71705. };
  71706. function genHandlers (
  71707. events,
  71708. isNative
  71709. ) {
  71710. var prefix = isNative ? 'nativeOn:' : 'on:';
  71711. var staticHandlers = "";
  71712. var dynamicHandlers = "";
  71713. for (var name in events) {
  71714. var handlerCode = genHandler(events[name]);
  71715. if (events[name] && events[name].dynamic) {
  71716. dynamicHandlers += name + "," + handlerCode + ",";
  71717. } else {
  71718. staticHandlers += "\"" + name + "\":" + handlerCode + ",";
  71719. }
  71720. }
  71721. staticHandlers = "{" + (staticHandlers.slice(0, -1)) + "}";
  71722. if (dynamicHandlers) {
  71723. return prefix + "_d(" + staticHandlers + ",[" + (dynamicHandlers.slice(0, -1)) + "])"
  71724. } else {
  71725. return prefix + staticHandlers
  71726. }
  71727. }
  71728. function genHandler (handler) {
  71729. if (!handler) {
  71730. return 'function(){}'
  71731. }
  71732. if (Array.isArray(handler)) {
  71733. return ("[" + (handler.map(function (handler) { return genHandler(handler); }).join(',')) + "]")
  71734. }
  71735. var isMethodPath = simplePathRE.test(handler.value);
  71736. var isFunctionExpression = fnExpRE.test(handler.value);
  71737. var isFunctionInvocation = simplePathRE.test(handler.value.replace(fnInvokeRE, ''));
  71738. if (!handler.modifiers) {
  71739. if (isMethodPath || isFunctionExpression) {
  71740. return handler.value
  71741. }
  71742. return ("function($event){" + (isFunctionInvocation ? ("return " + (handler.value)) : handler.value) + "}") // inline statement
  71743. } else {
  71744. var code = '';
  71745. var genModifierCode = '';
  71746. var keys = [];
  71747. for (var key in handler.modifiers) {
  71748. if (modifierCode[key]) {
  71749. genModifierCode += modifierCode[key];
  71750. // left/right
  71751. if (keyCodes[key]) {
  71752. keys.push(key);
  71753. }
  71754. } else if (key === 'exact') {
  71755. var modifiers = (handler.modifiers);
  71756. genModifierCode += genGuard(
  71757. ['ctrl', 'shift', 'alt', 'meta']
  71758. .filter(function (keyModifier) { return !modifiers[keyModifier]; })
  71759. .map(function (keyModifier) { return ("$event." + keyModifier + "Key"); })
  71760. .join('||')
  71761. );
  71762. } else {
  71763. keys.push(key);
  71764. }
  71765. }
  71766. if (keys.length) {
  71767. code += genKeyFilter(keys);
  71768. }
  71769. // Make sure modifiers like prevent and stop get executed after key filtering
  71770. if (genModifierCode) {
  71771. code += genModifierCode;
  71772. }
  71773. var handlerCode = isMethodPath
  71774. ? ("return " + (handler.value) + "($event)")
  71775. : isFunctionExpression
  71776. ? ("return (" + (handler.value) + ")($event)")
  71777. : isFunctionInvocation
  71778. ? ("return " + (handler.value))
  71779. : handler.value;
  71780. return ("function($event){" + code + handlerCode + "}")
  71781. }
  71782. }
  71783. function genKeyFilter (keys) {
  71784. return (
  71785. // make sure the key filters only apply to KeyboardEvents
  71786. // #9441: can't use 'keyCode' in $event because Chrome autofill fires fake
  71787. // key events that do not have keyCode property...
  71788. "if(!$event.type.indexOf('key')&&" +
  71789. (keys.map(genFilterCode).join('&&')) + ")return null;"
  71790. )
  71791. }
  71792. function genFilterCode (key) {
  71793. var keyVal = parseInt(key, 10);
  71794. if (keyVal) {
  71795. return ("$event.keyCode!==" + keyVal)
  71796. }
  71797. var keyCode = keyCodes[key];
  71798. var keyName = keyNames[key];
  71799. return (
  71800. "_k($event.keyCode," +
  71801. (JSON.stringify(key)) + "," +
  71802. (JSON.stringify(keyCode)) + "," +
  71803. "$event.key," +
  71804. "" + (JSON.stringify(keyName)) +
  71805. ")"
  71806. )
  71807. }
  71808. /* */
  71809. function on (el, dir) {
  71810. if (dir.modifiers) {
  71811. warn("v-on without argument does not support modifiers.");
  71812. }
  71813. el.wrapListeners = function (code) { return ("_g(" + code + "," + (dir.value) + ")"); };
  71814. }
  71815. /* */
  71816. function bind$1 (el, dir) {
  71817. el.wrapData = function (code) {
  71818. return ("_b(" + code + ",'" + (el.tag) + "'," + (dir.value) + "," + (dir.modifiers && dir.modifiers.prop ? 'true' : 'false') + (dir.modifiers && dir.modifiers.sync ? ',true' : '') + ")")
  71819. };
  71820. }
  71821. /* */
  71822. var baseDirectives = {
  71823. on: on,
  71824. bind: bind$1,
  71825. cloak: noop
  71826. };
  71827. /* */
  71828. var CodegenState = function CodegenState (options) {
  71829. this.options = options;
  71830. this.warn = options.warn || baseWarn;
  71831. this.transforms = pluckModuleFunction(options.modules, 'transformCode');
  71832. this.dataGenFns = pluckModuleFunction(options.modules, 'genData');
  71833. this.directives = extend(extend({}, baseDirectives), options.directives);
  71834. var isReservedTag = options.isReservedTag || no;
  71835. this.maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); };
  71836. this.onceId = 0;
  71837. this.staticRenderFns = [];
  71838. this.pre = false;
  71839. };
  71840. function generate (
  71841. ast,
  71842. options
  71843. ) {
  71844. var state = new CodegenState(options);
  71845. var code = ast ? genElement(ast, state) : '_c("div")';
  71846. return {
  71847. render: ("with(this){return " + code + "}"),
  71848. staticRenderFns: state.staticRenderFns
  71849. }
  71850. }
  71851. function genElement (el, state) {
  71852. if (el.parent) {
  71853. el.pre = el.pre || el.parent.pre;
  71854. }
  71855. if (el.staticRoot && !el.staticProcessed) {
  71856. return genStatic(el, state)
  71857. } else if (el.once && !el.onceProcessed) {
  71858. return genOnce(el, state)
  71859. } else if (el.for && !el.forProcessed) {
  71860. return genFor(el, state)
  71861. } else if (el.if && !el.ifProcessed) {
  71862. return genIf(el, state)
  71863. } else if (el.tag === 'template' && !el.slotTarget && !state.pre) {
  71864. return genChildren(el, state) || 'void 0'
  71865. } else if (el.tag === 'slot') {
  71866. return genSlot(el, state)
  71867. } else {
  71868. // component or element
  71869. var code;
  71870. if (el.component) {
  71871. code = genComponent(el.component, el, state);
  71872. } else {
  71873. var data;
  71874. if (!el.plain || (el.pre && state.maybeComponent(el))) {
  71875. data = genData$2(el, state);
  71876. }
  71877. var children = el.inlineTemplate ? null : genChildren(el, state, true);
  71878. code = "_c('" + (el.tag) + "'" + (data ? ("," + data) : '') + (children ? ("," + children) : '') + ")";
  71879. }
  71880. // module transforms
  71881. for (var i = 0; i < state.transforms.length; i++) {
  71882. code = state.transforms[i](el, code);
  71883. }
  71884. return code
  71885. }
  71886. }
  71887. // hoist static sub-trees out
  71888. function genStatic (el, state) {
  71889. el.staticProcessed = true;
  71890. // Some elements (templates) need to behave differently inside of a v-pre
  71891. // node. All pre nodes are static roots, so we can use this as a location to
  71892. // wrap a state change and reset it upon exiting the pre node.
  71893. var originalPreState = state.pre;
  71894. if (el.pre) {
  71895. state.pre = el.pre;
  71896. }
  71897. state.staticRenderFns.push(("with(this){return " + (genElement(el, state)) + "}"));
  71898. state.pre = originalPreState;
  71899. return ("_m(" + (state.staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + ")")
  71900. }
  71901. // v-once
  71902. function genOnce (el, state) {
  71903. el.onceProcessed = true;
  71904. if (el.if && !el.ifProcessed) {
  71905. return genIf(el, state)
  71906. } else if (el.staticInFor) {
  71907. var key = '';
  71908. var parent = el.parent;
  71909. while (parent) {
  71910. if (parent.for) {
  71911. key = parent.key;
  71912. break
  71913. }
  71914. parent = parent.parent;
  71915. }
  71916. if (!key) {
  71917. state.warn(
  71918. "v-once can only be used inside v-for that is keyed. ",
  71919. el.rawAttrsMap['v-once']
  71920. );
  71921. return genElement(el, state)
  71922. }
  71923. return ("_o(" + (genElement(el, state)) + "," + (state.onceId++) + "," + key + ")")
  71924. } else {
  71925. return genStatic(el, state)
  71926. }
  71927. }
  71928. function genIf (
  71929. el,
  71930. state,
  71931. altGen,
  71932. altEmpty
  71933. ) {
  71934. el.ifProcessed = true; // avoid recursion
  71935. return genIfConditions(el.ifConditions.slice(), state, altGen, altEmpty)
  71936. }
  71937. function genIfConditions (
  71938. conditions,
  71939. state,
  71940. altGen,
  71941. altEmpty
  71942. ) {
  71943. if (!conditions.length) {
  71944. return altEmpty || '_e()'
  71945. }
  71946. var condition = conditions.shift();
  71947. if (condition.exp) {
  71948. return ("(" + (condition.exp) + ")?" + (genTernaryExp(condition.block)) + ":" + (genIfConditions(conditions, state, altGen, altEmpty)))
  71949. } else {
  71950. return ("" + (genTernaryExp(condition.block)))
  71951. }
  71952. // v-if with v-once should generate code like (a)?_m(0):_m(1)
  71953. function genTernaryExp (el) {
  71954. return altGen
  71955. ? altGen(el, state)
  71956. : el.once
  71957. ? genOnce(el, state)
  71958. : genElement(el, state)
  71959. }
  71960. }
  71961. function genFor (
  71962. el,
  71963. state,
  71964. altGen,
  71965. altHelper
  71966. ) {
  71967. var exp = el.for;
  71968. var alias = el.alias;
  71969. var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : '';
  71970. var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : '';
  71971. if (state.maybeComponent(el) &&
  71972. el.tag !== 'slot' &&
  71973. el.tag !== 'template' &&
  71974. !el.key
  71975. ) {
  71976. state.warn(
  71977. "<" + (el.tag) + " v-for=\"" + alias + " in " + exp + "\">: component lists rendered with " +
  71978. "v-for should have explicit keys. " +
  71979. "See https://vuejs.org/guide/list.html#key for more info.",
  71980. el.rawAttrsMap['v-for'],
  71981. true /* tip */
  71982. );
  71983. }
  71984. el.forProcessed = true; // avoid recursion
  71985. return (altHelper || '_l') + "((" + exp + ")," +
  71986. "function(" + alias + iterator1 + iterator2 + "){" +
  71987. "return " + ((altGen || genElement)(el, state)) +
  71988. '})'
  71989. }
  71990. function genData$2 (el, state) {
  71991. var data = '{';
  71992. // directives first.
  71993. // directives may mutate the el's other properties before they are generated.
  71994. var dirs = genDirectives(el, state);
  71995. if (dirs) { data += dirs + ','; }
  71996. // key
  71997. if (el.key) {
  71998. data += "key:" + (el.key) + ",";
  71999. }
  72000. // ref
  72001. if (el.ref) {
  72002. data += "ref:" + (el.ref) + ",";
  72003. }
  72004. if (el.refInFor) {
  72005. data += "refInFor:true,";
  72006. }
  72007. // pre
  72008. if (el.pre) {
  72009. data += "pre:true,";
  72010. }
  72011. // record original tag name for components using "is" attribute
  72012. if (el.component) {
  72013. data += "tag:\"" + (el.tag) + "\",";
  72014. }
  72015. // module data generation functions
  72016. for (var i = 0; i < state.dataGenFns.length; i++) {
  72017. data += state.dataGenFns[i](el);
  72018. }
  72019. // attributes
  72020. if (el.attrs) {
  72021. data += "attrs:" + (genProps(el.attrs)) + ",";
  72022. }
  72023. // DOM props
  72024. if (el.props) {
  72025. data += "domProps:" + (genProps(el.props)) + ",";
  72026. }
  72027. // event handlers
  72028. if (el.events) {
  72029. data += (genHandlers(el.events, false)) + ",";
  72030. }
  72031. if (el.nativeEvents) {
  72032. data += (genHandlers(el.nativeEvents, true)) + ",";
  72033. }
  72034. // slot target
  72035. // only for non-scoped slots
  72036. if (el.slotTarget && !el.slotScope) {
  72037. data += "slot:" + (el.slotTarget) + ",";
  72038. }
  72039. // scoped slots
  72040. if (el.scopedSlots) {
  72041. data += (genScopedSlots(el, el.scopedSlots, state)) + ",";
  72042. }
  72043. // component v-model
  72044. if (el.model) {
  72045. data += "model:{value:" + (el.model.value) + ",callback:" + (el.model.callback) + ",expression:" + (el.model.expression) + "},";
  72046. }
  72047. // inline-template
  72048. if (el.inlineTemplate) {
  72049. var inlineTemplate = genInlineTemplate(el, state);
  72050. if (inlineTemplate) {
  72051. data += inlineTemplate + ",";
  72052. }
  72053. }
  72054. data = data.replace(/,$/, '') + '}';
  72055. // v-bind dynamic argument wrap
  72056. // v-bind with dynamic arguments must be applied using the same v-bind object
  72057. // merge helper so that class/style/mustUseProp attrs are handled correctly.
  72058. if (el.dynamicAttrs) {
  72059. data = "_b(" + data + ",\"" + (el.tag) + "\"," + (genProps(el.dynamicAttrs)) + ")";
  72060. }
  72061. // v-bind data wrap
  72062. if (el.wrapData) {
  72063. data = el.wrapData(data);
  72064. }
  72065. // v-on data wrap
  72066. if (el.wrapListeners) {
  72067. data = el.wrapListeners(data);
  72068. }
  72069. return data
  72070. }
  72071. function genDirectives (el, state) {
  72072. var dirs = el.directives;
  72073. if (!dirs) { return }
  72074. var res = 'directives:[';
  72075. var hasRuntime = false;
  72076. var i, l, dir, needRuntime;
  72077. for (i = 0, l = dirs.length; i < l; i++) {
  72078. dir = dirs[i];
  72079. needRuntime = true;
  72080. var gen = state.directives[dir.name];
  72081. if (gen) {
  72082. // compile-time directive that manipulates AST.
  72083. // returns true if it also needs a runtime counterpart.
  72084. needRuntime = !!gen(el, dir, state.warn);
  72085. }
  72086. if (needRuntime) {
  72087. hasRuntime = true;
  72088. res += "{name:\"" + (dir.name) + "\",rawName:\"" + (dir.rawName) + "\"" + (dir.value ? (",value:(" + (dir.value) + "),expression:" + (JSON.stringify(dir.value))) : '') + (dir.arg ? (",arg:" + (dir.isDynamicArg ? dir.arg : ("\"" + (dir.arg) + "\""))) : '') + (dir.modifiers ? (",modifiers:" + (JSON.stringify(dir.modifiers))) : '') + "},";
  72089. }
  72090. }
  72091. if (hasRuntime) {
  72092. return res.slice(0, -1) + ']'
  72093. }
  72094. }
  72095. function genInlineTemplate (el, state) {
  72096. var ast = el.children[0];
  72097. if (el.children.length !== 1 || ast.type !== 1) {
  72098. state.warn(
  72099. 'Inline-template components must have exactly one child element.',
  72100. { start: el.start }
  72101. );
  72102. }
  72103. if (ast && ast.type === 1) {
  72104. var inlineRenderFns = generate(ast, state.options);
  72105. return ("inlineTemplate:{render:function(){" + (inlineRenderFns.render) + "},staticRenderFns:[" + (inlineRenderFns.staticRenderFns.map(function (code) { return ("function(){" + code + "}"); }).join(',')) + "]}")
  72106. }
  72107. }
  72108. function genScopedSlots (
  72109. el,
  72110. slots,
  72111. state
  72112. ) {
  72113. // by default scoped slots are considered "stable", this allows child
  72114. // components with only scoped slots to skip forced updates from parent.
  72115. // but in some cases we have to bail-out of this optimization
  72116. // for example if the slot contains dynamic names, has v-if or v-for on them...
  72117. var needsForceUpdate = el.for || Object.keys(slots).some(function (key) {
  72118. var slot = slots[key];
  72119. return (
  72120. slot.slotTargetDynamic ||
  72121. slot.if ||
  72122. slot.for ||
  72123. containsSlotChild(slot) // is passing down slot from parent which may be dynamic
  72124. )
  72125. });
  72126. // #9534: if a component with scoped slots is inside a conditional branch,
  72127. // it's possible for the same component to be reused but with different
  72128. // compiled slot content. To avoid that, we generate a unique key based on
  72129. // the generated code of all the slot contents.
  72130. var needsKey = !!el.if;
  72131. // OR when it is inside another scoped slot or v-for (the reactivity may be
  72132. // disconnected due to the intermediate scope variable)
  72133. // #9438, #9506
  72134. // TODO: this can be further optimized by properly analyzing in-scope bindings
  72135. // and skip force updating ones that do not actually use scope variables.
  72136. if (!needsForceUpdate) {
  72137. var parent = el.parent;
  72138. while (parent) {
  72139. if (
  72140. (parent.slotScope && parent.slotScope !== emptySlotScopeToken) ||
  72141. parent.for
  72142. ) {
  72143. needsForceUpdate = true;
  72144. break
  72145. }
  72146. if (parent.if) {
  72147. needsKey = true;
  72148. }
  72149. parent = parent.parent;
  72150. }
  72151. }
  72152. var generatedSlots = Object.keys(slots)
  72153. .map(function (key) { return genScopedSlot(slots[key], state); })
  72154. .join(',');
  72155. return ("scopedSlots:_u([" + generatedSlots + "]" + (needsForceUpdate ? ",null,true" : "") + (!needsForceUpdate && needsKey ? (",null,false," + (hash(generatedSlots))) : "") + ")")
  72156. }
  72157. function hash(str) {
  72158. var hash = 5381;
  72159. var i = str.length;
  72160. while(i) {
  72161. hash = (hash * 33) ^ str.charCodeAt(--i);
  72162. }
  72163. return hash >>> 0
  72164. }
  72165. function containsSlotChild (el) {
  72166. if (el.type === 1) {
  72167. if (el.tag === 'slot') {
  72168. return true
  72169. }
  72170. return el.children.some(containsSlotChild)
  72171. }
  72172. return false
  72173. }
  72174. function genScopedSlot (
  72175. el,
  72176. state
  72177. ) {
  72178. var isLegacySyntax = el.attrsMap['slot-scope'];
  72179. if (el.if && !el.ifProcessed && !isLegacySyntax) {
  72180. return genIf(el, state, genScopedSlot, "null")
  72181. }
  72182. if (el.for && !el.forProcessed) {
  72183. return genFor(el, state, genScopedSlot)
  72184. }
  72185. var slotScope = el.slotScope === emptySlotScopeToken
  72186. ? ""
  72187. : String(el.slotScope);
  72188. var fn = "function(" + slotScope + "){" +
  72189. "return " + (el.tag === 'template'
  72190. ? el.if && isLegacySyntax
  72191. ? ("(" + (el.if) + ")?" + (genChildren(el, state) || 'undefined') + ":undefined")
  72192. : genChildren(el, state) || 'undefined'
  72193. : genElement(el, state)) + "}";
  72194. // reverse proxy v-slot without scope on this.$slots
  72195. var reverseProxy = slotScope ? "" : ",proxy:true";
  72196. return ("{key:" + (el.slotTarget || "\"default\"") + ",fn:" + fn + reverseProxy + "}")
  72197. }
  72198. function genChildren (
  72199. el,
  72200. state,
  72201. checkSkip,
  72202. altGenElement,
  72203. altGenNode
  72204. ) {
  72205. var children = el.children;
  72206. if (children.length) {
  72207. var el$1 = children[0];
  72208. // optimize single v-for
  72209. if (children.length === 1 &&
  72210. el$1.for &&
  72211. el$1.tag !== 'template' &&
  72212. el$1.tag !== 'slot'
  72213. ) {
  72214. var normalizationType = checkSkip
  72215. ? state.maybeComponent(el$1) ? ",1" : ",0"
  72216. : "";
  72217. return ("" + ((altGenElement || genElement)(el$1, state)) + normalizationType)
  72218. }
  72219. var normalizationType$1 = checkSkip
  72220. ? getNormalizationType(children, state.maybeComponent)
  72221. : 0;
  72222. var gen = altGenNode || genNode;
  72223. return ("[" + (children.map(function (c) { return gen(c, state); }).join(',')) + "]" + (normalizationType$1 ? ("," + normalizationType$1) : ''))
  72224. }
  72225. }
  72226. // determine the normalization needed for the children array.
  72227. // 0: no normalization needed
  72228. // 1: simple normalization needed (possible 1-level deep nested array)
  72229. // 2: full normalization needed
  72230. function getNormalizationType (
  72231. children,
  72232. maybeComponent
  72233. ) {
  72234. var res = 0;
  72235. for (var i = 0; i < children.length; i++) {
  72236. var el = children[i];
  72237. if (el.type !== 1) {
  72238. continue
  72239. }
  72240. if (needsNormalization(el) ||
  72241. (el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) {
  72242. res = 2;
  72243. break
  72244. }
  72245. if (maybeComponent(el) ||
  72246. (el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) {
  72247. res = 1;
  72248. }
  72249. }
  72250. return res
  72251. }
  72252. function needsNormalization (el) {
  72253. return el.for !== undefined || el.tag === 'template' || el.tag === 'slot'
  72254. }
  72255. function genNode (node, state) {
  72256. if (node.type === 1) {
  72257. return genElement(node, state)
  72258. } else if (node.type === 3 && node.isComment) {
  72259. return genComment(node)
  72260. } else {
  72261. return genText(node)
  72262. }
  72263. }
  72264. function genText (text) {
  72265. return ("_v(" + (text.type === 2
  72266. ? text.expression // no need for () because already wrapped in _s()
  72267. : transformSpecialNewlines(JSON.stringify(text.text))) + ")")
  72268. }
  72269. function genComment (comment) {
  72270. return ("_e(" + (JSON.stringify(comment.text)) + ")")
  72271. }
  72272. function genSlot (el, state) {
  72273. var slotName = el.slotName || '"default"';
  72274. var children = genChildren(el, state);
  72275. var res = "_t(" + slotName + (children ? ("," + children) : '');
  72276. var attrs = el.attrs || el.dynamicAttrs
  72277. ? genProps((el.attrs || []).concat(el.dynamicAttrs || []).map(function (attr) { return ({
  72278. // slot props are camelized
  72279. name: camelize(attr.name),
  72280. value: attr.value,
  72281. dynamic: attr.dynamic
  72282. }); }))
  72283. : null;
  72284. var bind$$1 = el.attrsMap['v-bind'];
  72285. if ((attrs || bind$$1) && !children) {
  72286. res += ",null";
  72287. }
  72288. if (attrs) {
  72289. res += "," + attrs;
  72290. }
  72291. if (bind$$1) {
  72292. res += (attrs ? '' : ',null') + "," + bind$$1;
  72293. }
  72294. return res + ')'
  72295. }
  72296. // componentName is el.component, take it as argument to shun flow's pessimistic refinement
  72297. function genComponent (
  72298. componentName,
  72299. el,
  72300. state
  72301. ) {
  72302. var children = el.inlineTemplate ? null : genChildren(el, state, true);
  72303. return ("_c(" + componentName + "," + (genData$2(el, state)) + (children ? ("," + children) : '') + ")")
  72304. }
  72305. function genProps (props) {
  72306. var staticProps = "";
  72307. var dynamicProps = "";
  72308. for (var i = 0; i < props.length; i++) {
  72309. var prop = props[i];
  72310. var value = transformSpecialNewlines(prop.value);
  72311. if (prop.dynamic) {
  72312. dynamicProps += (prop.name) + "," + value + ",";
  72313. } else {
  72314. staticProps += "\"" + (prop.name) + "\":" + value + ",";
  72315. }
  72316. }
  72317. staticProps = "{" + (staticProps.slice(0, -1)) + "}";
  72318. if (dynamicProps) {
  72319. return ("_d(" + staticProps + ",[" + (dynamicProps.slice(0, -1)) + "])")
  72320. } else {
  72321. return staticProps
  72322. }
  72323. }
  72324. // #3895, #4268
  72325. function transformSpecialNewlines (text) {
  72326. return text
  72327. .replace(/\u2028/g, '\\u2028')
  72328. .replace(/\u2029/g, '\\u2029')
  72329. }
  72330. /* */
  72331. // these keywords should not appear inside expressions, but operators like
  72332. // typeof, instanceof and in are allowed
  72333. var prohibitedKeywordRE = new RegExp('\\b' + (
  72334. 'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +
  72335. 'super,throw,while,yield,delete,export,import,return,switch,default,' +
  72336. 'extends,finally,continue,debugger,function,arguments'
  72337. ).split(',').join('\\b|\\b') + '\\b');
  72338. // these unary operators should not be used as property/method names
  72339. var unaryOperatorsRE = new RegExp('\\b' + (
  72340. 'delete,typeof,void'
  72341. ).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)');
  72342. // strip strings in expressions
  72343. var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
  72344. // detect problematic expressions in a template
  72345. function detectErrors (ast, warn) {
  72346. if (ast) {
  72347. checkNode(ast, warn);
  72348. }
  72349. }
  72350. function checkNode (node, warn) {
  72351. if (node.type === 1) {
  72352. for (var name in node.attrsMap) {
  72353. if (dirRE.test(name)) {
  72354. var value = node.attrsMap[name];
  72355. if (value) {
  72356. var range = node.rawAttrsMap[name];
  72357. if (name === 'v-for') {
  72358. checkFor(node, ("v-for=\"" + value + "\""), warn, range);
  72359. } else if (name === 'v-slot' || name[0] === '#') {
  72360. checkFunctionParameterExpression(value, (name + "=\"" + value + "\""), warn, range);
  72361. } else if (onRE.test(name)) {
  72362. checkEvent(value, (name + "=\"" + value + "\""), warn, range);
  72363. } else {
  72364. checkExpression(value, (name + "=\"" + value + "\""), warn, range);
  72365. }
  72366. }
  72367. }
  72368. }
  72369. if (node.children) {
  72370. for (var i = 0; i < node.children.length; i++) {
  72371. checkNode(node.children[i], warn);
  72372. }
  72373. }
  72374. } else if (node.type === 2) {
  72375. checkExpression(node.expression, node.text, warn, node);
  72376. }
  72377. }
  72378. function checkEvent (exp, text, warn, range) {
  72379. var stripped = exp.replace(stripStringRE, '');
  72380. var keywordMatch = stripped.match(unaryOperatorsRE);
  72381. if (keywordMatch && stripped.charAt(keywordMatch.index - 1) !== '$') {
  72382. warn(
  72383. "avoid using JavaScript unary operator as property name: " +
  72384. "\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()),
  72385. range
  72386. );
  72387. }
  72388. checkExpression(exp, text, warn, range);
  72389. }
  72390. function checkFor (node, text, warn, range) {
  72391. checkExpression(node.for || '', text, warn, range);
  72392. checkIdentifier(node.alias, 'v-for alias', text, warn, range);
  72393. checkIdentifier(node.iterator1, 'v-for iterator', text, warn, range);
  72394. checkIdentifier(node.iterator2, 'v-for iterator', text, warn, range);
  72395. }
  72396. function checkIdentifier (
  72397. ident,
  72398. type,
  72399. text,
  72400. warn,
  72401. range
  72402. ) {
  72403. if (typeof ident === 'string') {
  72404. try {
  72405. new Function(("var " + ident + "=_"));
  72406. } catch (e) {
  72407. warn(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim())), range);
  72408. }
  72409. }
  72410. }
  72411. function checkExpression (exp, text, warn, range) {
  72412. try {
  72413. new Function(("return " + exp));
  72414. } catch (e) {
  72415. var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE);
  72416. if (keywordMatch) {
  72417. warn(
  72418. "avoid using JavaScript keyword as property name: " +
  72419. "\"" + (keywordMatch[0]) + "\"\n Raw expression: " + (text.trim()),
  72420. range
  72421. );
  72422. } else {
  72423. warn(
  72424. "invalid expression: " + (e.message) + " in\n\n" +
  72425. " " + exp + "\n\n" +
  72426. " Raw expression: " + (text.trim()) + "\n",
  72427. range
  72428. );
  72429. }
  72430. }
  72431. }
  72432. function checkFunctionParameterExpression (exp, text, warn, range) {
  72433. try {
  72434. new Function(exp, '');
  72435. } catch (e) {
  72436. warn(
  72437. "invalid function parameter expression: " + (e.message) + " in\n\n" +
  72438. " " + exp + "\n\n" +
  72439. " Raw expression: " + (text.trim()) + "\n",
  72440. range
  72441. );
  72442. }
  72443. }
  72444. /* */
  72445. var range = 2;
  72446. function generateCodeFrame (
  72447. source,
  72448. start,
  72449. end
  72450. ) {
  72451. if ( start === void 0 ) start = 0;
  72452. if ( end === void 0 ) end = source.length;
  72453. var lines = source.split(/\r?\n/);
  72454. var count = 0;
  72455. var res = [];
  72456. for (var i = 0; i < lines.length; i++) {
  72457. count += lines[i].length + 1;
  72458. if (count >= start) {
  72459. for (var j = i - range; j <= i + range || end > count; j++) {
  72460. if (j < 0 || j >= lines.length) { continue }
  72461. res.push(("" + (j + 1) + (repeat$1(" ", 3 - String(j + 1).length)) + "| " + (lines[j])));
  72462. var lineLength = lines[j].length;
  72463. if (j === i) {
  72464. // push underline
  72465. var pad = start - (count - lineLength) + 1;
  72466. var length = end > count ? lineLength - pad : end - start;
  72467. res.push(" | " + repeat$1(" ", pad) + repeat$1("^", length));
  72468. } else if (j > i) {
  72469. if (end > count) {
  72470. var length$1 = Math.min(end - count, lineLength);
  72471. res.push(" | " + repeat$1("^", length$1));
  72472. }
  72473. count += lineLength + 1;
  72474. }
  72475. }
  72476. break
  72477. }
  72478. }
  72479. return res.join('\n')
  72480. }
  72481. function repeat$1 (str, n) {
  72482. var result = '';
  72483. if (n > 0) {
  72484. while (true) { // eslint-disable-line
  72485. if (n & 1) { result += str; }
  72486. n >>>= 1;
  72487. if (n <= 0) { break }
  72488. str += str;
  72489. }
  72490. }
  72491. return result
  72492. }
  72493. /* */
  72494. function createFunction (code, errors) {
  72495. try {
  72496. return new Function(code)
  72497. } catch (err) {
  72498. errors.push({ err: err, code: code });
  72499. return noop
  72500. }
  72501. }
  72502. function createCompileToFunctionFn (compile) {
  72503. var cache = Object.create(null);
  72504. return function compileToFunctions (
  72505. template,
  72506. options,
  72507. vm
  72508. ) {
  72509. options = extend({}, options);
  72510. var warn$$1 = options.warn || warn;
  72511. delete options.warn;
  72512. /* istanbul ignore if */
  72513. {
  72514. // detect possible CSP restriction
  72515. try {
  72516. new Function('return 1');
  72517. } catch (e) {
  72518. if (e.toString().match(/unsafe-eval|CSP/)) {
  72519. warn$$1(
  72520. 'It seems you are using the standalone build of Vue.js in an ' +
  72521. 'environment with Content Security Policy that prohibits unsafe-eval. ' +
  72522. 'The template compiler cannot work in this environment. Consider ' +
  72523. 'relaxing the policy to allow unsafe-eval or pre-compiling your ' +
  72524. 'templates into render functions.'
  72525. );
  72526. }
  72527. }
  72528. }
  72529. // check cache
  72530. var key = options.delimiters
  72531. ? String(options.delimiters) + template
  72532. : template;
  72533. if (cache[key]) {
  72534. return cache[key]
  72535. }
  72536. // compile
  72537. var compiled = compile(template, options);
  72538. // check compilation errors/tips
  72539. {
  72540. if (compiled.errors && compiled.errors.length) {
  72541. if (options.outputSourceRange) {
  72542. compiled.errors.forEach(function (e) {
  72543. warn$$1(
  72544. "Error compiling template:\n\n" + (e.msg) + "\n\n" +
  72545. generateCodeFrame(template, e.start, e.end),
  72546. vm
  72547. );
  72548. });
  72549. } else {
  72550. warn$$1(
  72551. "Error compiling template:\n\n" + template + "\n\n" +
  72552. compiled.errors.map(function (e) { return ("- " + e); }).join('\n') + '\n',
  72553. vm
  72554. );
  72555. }
  72556. }
  72557. if (compiled.tips && compiled.tips.length) {
  72558. if (options.outputSourceRange) {
  72559. compiled.tips.forEach(function (e) { return tip(e.msg, vm); });
  72560. } else {
  72561. compiled.tips.forEach(function (msg) { return tip(msg, vm); });
  72562. }
  72563. }
  72564. }
  72565. // turn code into functions
  72566. var res = {};
  72567. var fnGenErrors = [];
  72568. res.render = createFunction(compiled.render, fnGenErrors);
  72569. res.staticRenderFns = compiled.staticRenderFns.map(function (code) {
  72570. return createFunction(code, fnGenErrors)
  72571. });
  72572. // check function generation errors.
  72573. // this should only happen if there is a bug in the compiler itself.
  72574. // mostly for codegen development use
  72575. /* istanbul ignore if */
  72576. {
  72577. if ((!compiled.errors || !compiled.errors.length) && fnGenErrors.length) {
  72578. warn$$1(
  72579. "Failed to generate render function:\n\n" +
  72580. fnGenErrors.map(function (ref) {
  72581. var err = ref.err;
  72582. var code = ref.code;
  72583. return ((err.toString()) + " in\n\n" + code + "\n");
  72584. }).join('\n'),
  72585. vm
  72586. );
  72587. }
  72588. }
  72589. return (cache[key] = res)
  72590. }
  72591. }
  72592. /* */
  72593. function createCompilerCreator (baseCompile) {
  72594. return function createCompiler (baseOptions) {
  72595. function compile (
  72596. template,
  72597. options
  72598. ) {
  72599. var finalOptions = Object.create(baseOptions);
  72600. var errors = [];
  72601. var tips = [];
  72602. var warn = function (msg, range, tip) {
  72603. (tip ? tips : errors).push(msg);
  72604. };
  72605. if (options) {
  72606. if (options.outputSourceRange) {
  72607. // $flow-disable-line
  72608. var leadingSpaceLength = template.match(/^\s*/)[0].length;
  72609. warn = function (msg, range, tip) {
  72610. var data = { msg: msg };
  72611. if (range) {
  72612. if (range.start != null) {
  72613. data.start = range.start + leadingSpaceLength;
  72614. }
  72615. if (range.end != null) {
  72616. data.end = range.end + leadingSpaceLength;
  72617. }
  72618. }
  72619. (tip ? tips : errors).push(data);
  72620. };
  72621. }
  72622. // merge custom modules
  72623. if (options.modules) {
  72624. finalOptions.modules =
  72625. (baseOptions.modules || []).concat(options.modules);
  72626. }
  72627. // merge custom directives
  72628. if (options.directives) {
  72629. finalOptions.directives = extend(
  72630. Object.create(baseOptions.directives || null),
  72631. options.directives
  72632. );
  72633. }
  72634. // copy other options
  72635. for (var key in options) {
  72636. if (key !== 'modules' && key !== 'directives') {
  72637. finalOptions[key] = options[key];
  72638. }
  72639. }
  72640. }
  72641. finalOptions.warn = warn;
  72642. var compiled = baseCompile(template.trim(), finalOptions);
  72643. {
  72644. detectErrors(compiled.ast, warn);
  72645. }
  72646. compiled.errors = errors;
  72647. compiled.tips = tips;
  72648. return compiled
  72649. }
  72650. return {
  72651. compile: compile,
  72652. compileToFunctions: createCompileToFunctionFn(compile)
  72653. }
  72654. }
  72655. }
  72656. /* */
  72657. // `createCompilerCreator` allows creating compilers that use alternative
  72658. // parser/optimizer/codegen, e.g the SSR optimizing compiler.
  72659. // Here we just export a default compiler using the default parts.
  72660. var createCompiler = createCompilerCreator(function baseCompile (
  72661. template,
  72662. options
  72663. ) {
  72664. var ast = parse(template.trim(), options);
  72665. if (options.optimize !== false) {
  72666. optimize(ast, options);
  72667. }
  72668. var code = generate(ast, options);
  72669. return {
  72670. ast: ast,
  72671. render: code.render,
  72672. staticRenderFns: code.staticRenderFns
  72673. }
  72674. });
  72675. /* */
  72676. var ref$1 = createCompiler(baseOptions);
  72677. var compile = ref$1.compile;
  72678. var compileToFunctions = ref$1.compileToFunctions;
  72679. /* */
  72680. // check whether current browser encodes a char inside attribute values
  72681. var div;
  72682. function getShouldDecode (href) {
  72683. div = div || document.createElement('div');
  72684. div.innerHTML = href ? "<a href=\"\n\"/>" : "<div a=\"\n\"/>";
  72685. return div.innerHTML.indexOf('&#10;') > 0
  72686. }
  72687. // #3663: IE encodes newlines inside attribute values while other browsers don't
  72688. var shouldDecodeNewlines = inBrowser ? getShouldDecode(false) : false;
  72689. // #6828: chrome encodes content in a[href]
  72690. var shouldDecodeNewlinesForHref = inBrowser ? getShouldDecode(true) : false;
  72691. /* */
  72692. var idToTemplate = cached(function (id) {
  72693. var el = query(id);
  72694. return el && el.innerHTML
  72695. });
  72696. var mount = Vue.prototype.$mount;
  72697. Vue.prototype.$mount = function (
  72698. el,
  72699. hydrating
  72700. ) {
  72701. el = el && query(el);
  72702. /* istanbul ignore if */
  72703. if (el === document.body || el === document.documentElement) {
  72704. warn(
  72705. "Do not mount Vue to <html> or <body> - mount to normal elements instead."
  72706. );
  72707. return this
  72708. }
  72709. var options = this.$options;
  72710. // resolve template/el and convert to render function
  72711. if (!options.render) {
  72712. var template = options.template;
  72713. if (template) {
  72714. if (typeof template === 'string') {
  72715. if (template.charAt(0) === '#') {
  72716. template = idToTemplate(template);
  72717. /* istanbul ignore if */
  72718. if (!template) {
  72719. warn(
  72720. ("Template element not found or is empty: " + (options.template)),
  72721. this
  72722. );
  72723. }
  72724. }
  72725. } else if (template.nodeType) {
  72726. template = template.innerHTML;
  72727. } else {
  72728. {
  72729. warn('invalid template option:' + template, this);
  72730. }
  72731. return this
  72732. }
  72733. } else if (el) {
  72734. template = getOuterHTML(el);
  72735. }
  72736. if (template) {
  72737. /* istanbul ignore if */
  72738. if (config.performance && mark) {
  72739. mark('compile');
  72740. }
  72741. var ref = compileToFunctions(template, {
  72742. outputSourceRange: "development" !== 'production',
  72743. shouldDecodeNewlines: shouldDecodeNewlines,
  72744. shouldDecodeNewlinesForHref: shouldDecodeNewlinesForHref,
  72745. delimiters: options.delimiters,
  72746. comments: options.comments
  72747. }, this);
  72748. var render = ref.render;
  72749. var staticRenderFns = ref.staticRenderFns;
  72750. options.render = render;
  72751. options.staticRenderFns = staticRenderFns;
  72752. /* istanbul ignore if */
  72753. if (config.performance && mark) {
  72754. mark('compile end');
  72755. measure(("vue " + (this._name) + " compile"), 'compile', 'compile end');
  72756. }
  72757. }
  72758. }
  72759. return mount.call(this, el, hydrating)
  72760. };
  72761. /**
  72762. * Get outerHTML of elements, taking care
  72763. * of SVG elements in IE as well.
  72764. */
  72765. function getOuterHTML (el) {
  72766. if (el.outerHTML) {
  72767. return el.outerHTML
  72768. } else {
  72769. var container = document.createElement('div');
  72770. container.appendChild(el.cloneNode(true));
  72771. return container.innerHTML
  72772. }
  72773. }
  72774. Vue.compile = compileToFunctions;
  72775. module.exports = Vue;
  72776. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../../timers-browserify/main.js */ "./node_modules/timers-browserify/main.js").setImmediate))
  72777. /***/ }),
  72778. /***/ "./node_modules/vue/dist/vue.common.js":
  72779. /*!*********************************************!*\
  72780. !*** ./node_modules/vue/dist/vue.common.js ***!
  72781. \*********************************************/
  72782. /*! no static exports found */
  72783. /***/ (function(module, exports, __webpack_require__) {
  72784. if (false) {} else {
  72785. module.exports = __webpack_require__(/*! ./vue.common.dev.js */ "./node_modules/vue/dist/vue.common.dev.js")
  72786. }
  72787. /***/ }),
  72788. /***/ "./node_modules/webpack/buildin/global.js":
  72789. /*!***********************************!*\
  72790. !*** (webpack)/buildin/global.js ***!
  72791. \***********************************/
  72792. /*! no static exports found */
  72793. /***/ (function(module, exports) {
  72794. var g;
  72795. // This works in non-strict mode
  72796. g = (function() {
  72797. return this;
  72798. })();
  72799. try {
  72800. // This works if eval is allowed (see CSP)
  72801. g = g || new Function("return this")();
  72802. } catch (e) {
  72803. // This works if the window reference is available
  72804. if (typeof window === "object") g = window;
  72805. }
  72806. // g can still be undefined, but nothing to do about it...
  72807. // We return undefined, instead of nothing here, so it's
  72808. // easier to handle this case. if(!global) { ...}
  72809. module.exports = g;
  72810. /***/ }),
  72811. /***/ "./node_modules/webpack/buildin/module.js":
  72812. /*!***********************************!*\
  72813. !*** (webpack)/buildin/module.js ***!
  72814. \***********************************/
  72815. /*! no static exports found */
  72816. /***/ (function(module, exports) {
  72817. module.exports = function(module) {
  72818. if (!module.webpackPolyfill) {
  72819. module.deprecate = function() {};
  72820. module.paths = [];
  72821. // module.parent = undefined by default
  72822. if (!module.children) module.children = [];
  72823. Object.defineProperty(module, "loaded", {
  72824. enumerable: true,
  72825. get: function() {
  72826. return module.l;
  72827. }
  72828. });
  72829. Object.defineProperty(module, "id", {
  72830. enumerable: true,
  72831. get: function() {
  72832. return module.i;
  72833. }
  72834. });
  72835. module.webpackPolyfill = 1;
  72836. }
  72837. return module;
  72838. };
  72839. /***/ }),
  72840. /***/ "./node_modules/yeast/index.js":
  72841. /*!*************************************!*\
  72842. !*** ./node_modules/yeast/index.js ***!
  72843. \*************************************/
  72844. /*! no static exports found */
  72845. /***/ (function(module, exports, __webpack_require__) {
  72846. "use strict";
  72847. var alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'.split('')
  72848. , length = 64
  72849. , map = {}
  72850. , seed = 0
  72851. , i = 0
  72852. , prev;
  72853. /**
  72854. * Return a string representing the specified number.
  72855. *
  72856. * @param {Number} num The number to convert.
  72857. * @returns {String} The string representation of the number.
  72858. * @api public
  72859. */
  72860. function encode(num) {
  72861. var encoded = '';
  72862. do {
  72863. encoded = alphabet[num % length] + encoded;
  72864. num = Math.floor(num / length);
  72865. } while (num > 0);
  72866. return encoded;
  72867. }
  72868. /**
  72869. * Return the integer value specified by the given string.
  72870. *
  72871. * @param {String} str The string to convert.
  72872. * @returns {Number} The integer value represented by the string.
  72873. * @api public
  72874. */
  72875. function decode(str) {
  72876. var decoded = 0;
  72877. for (i = 0; i < str.length; i++) {
  72878. decoded = decoded * length + map[str.charAt(i)];
  72879. }
  72880. return decoded;
  72881. }
  72882. /**
  72883. * Yeast: A tiny growing id generator.
  72884. *
  72885. * @returns {String} A unique id.
  72886. * @api public
  72887. */
  72888. function yeast() {
  72889. var now = encode(+new Date());
  72890. if (now !== prev) return seed = 0, prev = now;
  72891. return now +'.'+ encode(seed++);
  72892. }
  72893. //
  72894. // Map each character to its index.
  72895. //
  72896. for (; i < length; i++) map[alphabet[i]] = i;
  72897. //
  72898. // Expose the `yeast`, `encode` and `decode` functions.
  72899. //
  72900. yeast.encode = encode;
  72901. yeast.decode = decode;
  72902. module.exports = yeast;
  72903. /***/ }),
  72904. /***/ "./resources/js/app.js":
  72905. /*!*****************************!*\
  72906. !*** ./resources/js/app.js ***!
  72907. \*****************************/
  72908. /*! no static exports found */
  72909. /***/ (function(module, exports, __webpack_require__) {
  72910. __webpack_require__(/*! ./bootstrap */ "./resources/js/bootstrap.js");
  72911. __webpack_require__(/*! ./mounted */ "./resources/js/mounted.js");
  72912. window.Vue = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.common.js");
  72913. window.tempTip = __webpack_require__(/*! ./utilities/tempTip */ "./resources/js/utilities/tempTip.js");
  72914. window.getGetVal = __webpack_require__(/*! ./utilities/getGetVal */ "./resources/js/utilities/getGetVal.js");
  72915. window.scanner = __webpack_require__(/*! ./utilities/scanner */ "./resources/js/utilities/scanner.js");
  72916. window.datetimeRelating = __webpack_require__(/*! ./utilities/datetimeRelating */ "./resources/js/utilities/datetimeRelating.js");
  72917. /***/ }),
  72918. /***/ "./resources/js/bootstrap.js":
  72919. /*!***********************************!*\
  72920. !*** ./resources/js/bootstrap.js ***!
  72921. \***********************************/
  72922. /*! no exports provided */
  72923. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  72924. "use strict";
  72925. __webpack_require__.r(__webpack_exports__);
  72926. /* harmony import */ var laravel_echo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! laravel-echo */ "./node_modules/laravel-echo/dist/echo.js");
  72927. window._ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  72928. /**
  72929. * We'll load jQuery and the Bootstrap jQuery plugin which provides support
  72930. * for JavaScript based Bootstrap features such as modals and tabs. This
  72931. * code may be modified to fit the specific needs of your application.
  72932. */
  72933. try {
  72934. window.Popper = __webpack_require__(/*! popper.js */ "./node_modules/popper.js/dist/esm/popper.js")["default"];
  72935. window.$ = window.jQuery = __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js");
  72936. window.$.cookie = __webpack_require__(/*! js-cookie */ "./node_modules/js-cookie/src/js.cookie.js");
  72937. __webpack_require__(/*! bootstrap */ "./node_modules/bootstrap/dist/js/bootstrap.js");
  72938. } catch (e) {}
  72939. window.moment = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
  72940. /**
  72941. * We'll load the axios HTTP library which allows us to easily issue requests
  72942. * to our Laravel back-end. This library automatically handles sending the
  72943. * CSRF token as a header based on the value of the "XSRF" token cookie.
  72944. */
  72945. window.axios = __webpack_require__(/*! axios */ "./node_modules/axios/index.js");
  72946. window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
  72947. /**
  72948. * Next we will register the CSRF Token as a common header with Axios so that
  72949. * all outgoing HTTP requests automatically have it attached. This is just
  72950. * a simple convenience so we don't have to attach every token manually.
  72951. */
  72952. var token = document.head.querySelector('meta[name="csrf-token"]');
  72953. if (token) {
  72954. window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
  72955. } else {
  72956. console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
  72957. }
  72958. /**
  72959. * Echo exposes an expressive API for subscribing to channels and listening
  72960. * for events that are broadcast by Laravel. Echo and event broadcasting
  72961. * allows your team to easily build robust real-time web applications.
  72962. */
  72963. //
  72964. // const client = require('pusher-js');
  72965. window.io = __webpack_require__(/*! socket.io-client */ "./node_modules/socket.io-client/lib/index.js");
  72966. window.initEcho = function () {
  72967. window.Echo = new laravel_echo__WEBPACK_IMPORTED_MODULE_0__["default"]({
  72968. broadcaster: 'socket.io',
  72969. host: window.location.hostname + ':6001' //broadcaster: 'pusher',
  72970. // key: process.env.MIX_PUSHER_APP_KEY,
  72971. // key: 'bo20alg-1',
  72972. // authEndpoint: '/custom/endpoint/auth',
  72973. // cluster: process.env.MIX_PUSHER_APP_CLUSTER,
  72974. // encrypted: true,
  72975. // client:client
  72976. });
  72977. };
  72978. /***/ }),
  72979. /***/ "./resources/js/mounted.js":
  72980. /*!*********************************!*\
  72981. !*** ./resources/js/mounted.js ***!
  72982. \*********************************/
  72983. /*! no static exports found */
  72984. /***/ (function(module, exports) {
  72985. //解决input number类型上下滚动 禁用滚轮事件
  72986. setTimeout(function () {
  72987. for (var i = 0; i < $("input[type='number']").length; i++) {
  72988. $("input[type='number']")[i].setAttribute('onmousewheel', 'return false'); //禁止谷歌浏览器、Opera浏览器以及360浏览器等采用谷歌内核的浏览器
  72989. $("input[type='number']")[i].addEventListener('DOMMouseScroll', MouseWheel, false); //禁止Firefox浏览器
  72990. }
  72991. }, 100);
  72992. function MouseWheel(event) {
  72993. event = event || window.event;
  72994. event.preventDefault();
  72995. }
  72996. /***/ }),
  72997. /***/ "./resources/js/utilities/datetimeRelating.js":
  72998. /*!****************************************************!*\
  72999. !*** ./resources/js/utilities/datetimeRelating.js ***!
  73000. \****************************************************/
  73001. /*! no static exports found */
  73002. /***/ (function(module, exports) {
  73003. var datetime = {
  73004. verifyTime: function verifyTime(time) {
  73005. setTimeout(function () {
  73006. time.target.value = time.target.value.replace(':', ':');
  73007. time.target.value = time.target.value.replace(/[a-zA-Z]/, '');
  73008. time.target.value = time.target.value.replace(/^([\d]{1})([\s]{1})/, "$1:");
  73009. time.target.value = time.target.value.replace(/^([\d]{1})([\d]{1})([\s]{1})/, "$1$2:");
  73010. time.target.value = time.target.value.replace(/^([\d]{1})([\d]{1})([\d]{1})/, "$1$2:$3");
  73011. time.target.value = time.target.value.replace(/^([\d]{1})([\d]{1})([\d]{1})([\d]{1})(.*?)/, "$1$2$3$4");
  73012. time.target.value = time.target.value.replace(/^([\d]{1})([\d]{1})([\d]{1})([\d]{1})/, "$1$2:$3$4");
  73013. time.target.value = time.target.value.replace(/^([\d]{1})([\d]{1}):([\d]{1})([\d]{1})([\s\S]{1})/, "$1$2:$3$4");
  73014. time.target.value = time.target.value.replace(/^([\d]{1})([\d]{1}):([\D]{1,99})/, "$1$2:");
  73015. time.target.value = time.target.value.replace(/^([\d]{1})([\d]{1})([\d]{1})\./, "$1:$2$3");
  73016. time.target.value = time.target.value.replace(/^([\d]{1})\.([\d]{1})([\d]{1})/, "$1:$2$3");
  73017. time.target.value = time.target.value.replace(/^([\d]{1})([\d]{2})([\S\s]{1,99})/, "$1$2:$3");
  73018. time.target.value = time.target.value.replace(/^([\d]{1}):([\d]{2})([\S\s]{1,99})/, "$1:$2");
  73019. time.target.value = time.target.value.replace(/^([\d])/, "$1");
  73020. time.target.value = time.target.value.replace(/^([1])([\d]{1})/, "$1$2");
  73021. time.target.value = time.target.value.replace(/^([3-9])([\d]{1})/, "2$2");
  73022. time.target.value = time.target.value.replace(/^([2-9]{1})([4-9]{1})/, "$13");
  73023. time.target.value = time.target.value.replace(/^([\d]{1})([\d]{1}):([6-9]{1})/, "$1$2:5");
  73024. time.target.value = time.target.value.replace(/^([\d]{1})([\d]{1})$/, "$1$2:");
  73025. }, 10);
  73026. }
  73027. };
  73028. module.exports = datetime;
  73029. /***/ }),
  73030. /***/ "./resources/js/utilities/getGetVal.js":
  73031. /*!*********************************************!*\
  73032. !*** ./resources/js/utilities/getGetVal.js ***!
  73033. \*********************************************/
  73034. /*! no static exports found */
  73035. /***/ (function(module, exports) {
  73036. var get = function get(name) {
  73037. var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
  73038. var r = window.location.search.substr(1).match(reg);
  73039. if (r != null) {
  73040. return unescape(r[2]);
  73041. }
  73042. return null;
  73043. };
  73044. module.exports = get;
  73045. /***/ }),
  73046. /***/ "./resources/js/utilities/scanner.js":
  73047. /*!*******************************************!*\
  73048. !*** ./resources/js/utilities/scanner.js ***!
  73049. \*******************************************/
  73050. /*! no static exports found */
  73051. /***/ (function(module, exports) {
  73052. var scanner = {
  73053. /**
  73054. * 监听document的扫描枪活动,扫描后调用doFunc执行,doFunc(str)
  73055. * str是扫到的内容,在doFunc内执行
  73056. * @param doFunc
  73057. */
  73058. monitorScan: function monitorScan(doFunc) {
  73059. var tightInputInterval = 50;
  73060. var leastCodeLength = 3;
  73061. var lastPressedAt = 0;
  73062. var scannedStr = "";
  73063. $(document).on('keyup', function (e) {
  73064. var nowAtMilli = new Date().getTime();
  73065. var inputInterval = nowAtMilli - lastPressedAt;
  73066. if (inputInterval < tightInputInterval) {
  73067. if (e.key !== 'Enter') {
  73068. scannedStr += e.key;
  73069. } else {
  73070. if (scannedStr.length >= leastCodeLength) {
  73071. doFunc(scannedStr);
  73072. }
  73073. scannedStr = '';
  73074. }
  73075. } else {
  73076. if (e.key !== 'Enter') {
  73077. scannedStr = e.key;
  73078. } else {
  73079. scannedStr = '';
  73080. }
  73081. }
  73082. lastPressedAt = nowAtMilli;
  73083. });
  73084. },
  73085. monitorFocusingTarget: function monitorFocusingTarget(doFunc) {
  73086. $('input').on('focus', function (e) {
  73087. doFunc(e.target);
  73088. });
  73089. }
  73090. };
  73091. module.exports = scanner;
  73092. /***/ }),
  73093. /***/ "./resources/js/utilities/tempTip.js":
  73094. /*!*******************************************!*\
  73095. !*** ./resources/js/utilities/tempTip.js ***!
  73096. \*******************************************/
  73097. /*! no static exports found */
  73098. /***/ (function(module, exports) {
  73099. var tempTip = {
  73100. fadingDuration: 4500,
  73101. inputType: 'input',
  73102. index: 99,
  73103. setIndex: function setIndex(index) {
  73104. this.index = parseInt(index);
  73105. },
  73106. setDuration: function setDuration(milliSec) {
  73107. this.fadingDuration = parseInt(milliSec);
  73108. },
  73109. setInputType: function setInputType(type) {
  73110. this.inputType = type;
  73111. },
  73112. showSuccess: function showSuccess(text) {
  73113. var tiper = $("<div class='row' style='color:white;opacity:0.9;position: fixed;top:40%;transform:translateY(-50%);z-index:" + this.index + ";width:100%;'>" + "<div class='col-8 offset-2'><div class='card'><div class='card-body h4 bg-success text-center'>" + text + "</div></div></div></div>");
  73114. tiper.animate({
  73115. opacity: '0'
  73116. }, this.fadingDuration, 'swing', function () {
  73117. tiper.remove();
  73118. });
  73119. $('body').append(tiper);
  73120. },
  73121. show: function show(text) {
  73122. var tiper = $("<div class='row' style='color:white;opacity:0.9;top:40%;position: fixed;transform:translateY(-50%);width:100%;z-index:" + this.index + ";'>" + "<div class='col-8 offset-2'><div class='card'><div class='card-body h2 bg-danger text-center'>" + text + "</div></div></div></div>");
  73123. tiper.animate({
  73124. opacity: '0'
  73125. }, this.fadingDuration, 'swing', function () {
  73126. tiper.remove();
  73127. });
  73128. $('body').append(tiper);
  73129. },
  73130. okWindow: function okWindow(text, okText) {
  73131. var bg = $("<div style='opacity:0.4;position:fixed;top:0;width:100%;height:100%;z-index:" + this.index + ";background-color:#000;'></div>");
  73132. if (typeof okText == 'undefined') okText = '确定';
  73133. var tiper = $("<div class='row' style='opacity:0.9;position:fixed;top:40%;transform:translateY(-50%);width:100%;z-index:" + (this.index + 1) + "'>" + "<div class='col-8 offset-2'><div class='card'><div class='card-body h2 text-center'>" + text + "<p><button class='btn btn-success btn-lg okWindow'>" + okText + "</button></p><div>" + "</div></div></div>");
  73134. tiper.find('.okWindow').on('click', function () {
  73135. tiper.off('click');
  73136. tiper.remove();
  73137. bg.remove();
  73138. });
  73139. $('html').css('height', '100%').append(bg);
  73140. $('body').append(tiper);
  73141. },
  73142. waitingTip: function waitingTip(text) {
  73143. var bg = $("<div style='opacity:0.4;position:fixed;top:0;width:100%;height:100%;z-index:" + this.index + ";background-color:#fff;' class='tipperBg'></div>");
  73144. var tipper = $("<div class='row tipper' style='color:white;opacity:0.9;position:fixed;top:40%;transform:translateY(-50%);width:100%;z-index:" + (this.index + 1) + ";'>" + "<div class='col-8 offset-2'><div class='card-body h5 bg-dark text-center' style='border-radius: 50px'>" + text + "</div></div></div>");
  73145. tipper.animate({
  73146. opacity: '0'
  73147. }, this.fadingDuration, 'swing', function () {
  73148. tipper.remove();
  73149. bg.remove();
  73150. });
  73151. $('html').css('height', '100%').append(bg);
  73152. $('body').append(tipper);
  73153. },
  73154. cancelWaitingTip: function cancelWaitingTip() {
  73155. var bg = $(".tipperBg");
  73156. var tipper = $(".tipper");
  73157. tipper.remove();
  73158. bg.remove();
  73159. },
  73160. confirm: function confirm(text, yesFunc, noFunc, yesText, noText) {
  73161. if (typeof yesText === 'undefined') yesText = '确定';
  73162. if (typeof noText === 'undefined') noText = '取消';
  73163. var bg = $("<div style='opacity:0.4;position:fixed;top:0;width:100%;height:100%;z-index:" + this.index + ";background-color:#000;'></div>");
  73164. var tiper = $("<div class='row' style='color:#000;opacity:0.9;position:fixed;top:40%;transform:translateY(-50%);width:100%;z-index:" + (this.index + 1) + "'>" + "<div class='col-8 offset-2'><div class='card'><div class='card-body'><div class='card-title h4'>" + text + "</div><div class='card-text'><button class='btn btn-dark btn-lg ok'>" + yesText + "</button>" + "<button class='btn btn-success btn-lg cancel ml-4'>" + noText + "</button></div>" + "</div></div></div></div>");
  73165. var $ok = tiper.find('.ok');
  73166. var $cancel = tiper.find('.cancel');
  73167. $ok.on('click', function () {
  73168. $ok.off('click');
  73169. $cancel.off('click');
  73170. tiper.remove();
  73171. bg.remove();
  73172. yesFunc();
  73173. });
  73174. $cancel.on('click', function () {
  73175. $ok.off('click');
  73176. $cancel.off('click');
  73177. tiper.remove();
  73178. bg.remove();
  73179. if (typeof noFunc != 'undefined') noFunc();
  73180. });
  73181. $('html').css('height', '100%').append(bg);
  73182. $('body').append(tiper);
  73183. },
  73184. inputVal: function inputVal(tipText, resultFunc) {
  73185. var bg = $("<div style='opacity:0.4;position:fixed;top:0;width:100%;height:100%;z-index:" + (this.index - 1) + ";background-color:#000;'></div>");
  73186. var tiper = $("<div class='row' style='color:#000;opacity:0.9;position:fixed;top:40%;transform:translateY(-50%);width:100%;z-index:" + this.index + "'>" + "<div class='col-8 offset-2'><div class='card'><div class='card-body'><div class='card-title h5'>" + tipText + "</div><div><input type='" + this.inputType + "' class='input form-control mb-3'/></div>" + "<div class='card-text'><button class='btn btn-outline-success ok'>确定</button></div>" + "</div></div></div></div>");
  73187. var $ok = tiper.find('.ok');
  73188. var $input = tiper.find('.input');
  73189. $ok.on('click', function () {
  73190. $ok.off('click');
  73191. tiper.remove();
  73192. bg.remove();
  73193. resultFunc($input.val());
  73194. });
  73195. $('html').css('height', '100%').append(bg);
  73196. $('body').append(tiper);
  73197. $input.focus();
  73198. }
  73199. };
  73200. module.exports = tempTip;
  73201. /***/ }),
  73202. /***/ "./resources/sass/app.scss":
  73203. /*!*********************************!*\
  73204. !*** ./resources/sass/app.scss ***!
  73205. \*********************************/
  73206. /*! no static exports found */
  73207. /***/ (function(module, exports) {
  73208. // removed by extract-text-webpack-plugin
  73209. /***/ }),
  73210. /***/ 0:
  73211. /*!*************************************************************!*\
  73212. !*** multi ./resources/js/app.js ./resources/sass/app.scss ***!
  73213. \*************************************************************/
  73214. /*! no static exports found */
  73215. /***/ (function(module, exports, __webpack_require__) {
  73216. __webpack_require__(/*! D:\Demo\bswas\resources\js\app.js */"./resources/js/app.js");
  73217. module.exports = __webpack_require__(/*! D:\Demo\bswas\resources\sass\app.scss */"./resources/sass/app.scss");
  73218. /***/ }),
  73219. /***/ 1:
  73220. /*!********************!*\
  73221. !*** ws (ignored) ***!
  73222. \********************/
  73223. /*! no static exports found */
  73224. /***/ (function(module, exports) {
  73225. /* (ignored) */
  73226. /***/ })
  73227. /******/ });