bson.js 543 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218
  1. (function webpackUniversalModuleDefinition(root, factory) {
  2. if(typeof exports === 'object' && typeof module === 'object')
  3. module.exports = factory();
  4. else if(typeof define === 'function' && define.amd)
  5. define([], factory);
  6. else {
  7. var a = factory();
  8. for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
  9. }
  10. })(this, function() {
  11. return /******/ (function(modules) { // webpackBootstrap
  12. /******/ // The module cache
  13. /******/ var installedModules = {};
  14. /******/ // The require function
  15. /******/ function __webpack_require__(moduleId) {
  16. /******/ // Check if module is in cache
  17. /******/ if(installedModules[moduleId])
  18. /******/ return installedModules[moduleId].exports;
  19. /******/ // Create a new module (and put it into the cache)
  20. /******/ var module = installedModules[moduleId] = {
  21. /******/ exports: {},
  22. /******/ id: moduleId,
  23. /******/ loaded: false
  24. /******/ };
  25. /******/ // Execute the module function
  26. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  27. /******/ // Flag the module as loaded
  28. /******/ module.loaded = true;
  29. /******/ // Return the exports of the module
  30. /******/ return module.exports;
  31. /******/ }
  32. /******/ // expose the modules object (__webpack_modules__)
  33. /******/ __webpack_require__.m = modules;
  34. /******/ // expose the module cache
  35. /******/ __webpack_require__.c = installedModules;
  36. /******/ // __webpack_public_path__
  37. /******/ __webpack_require__.p = "/";
  38. /******/ // Load entry module and return exports
  39. /******/ return __webpack_require__(0);
  40. /******/ })
  41. /************************************************************************/
  42. /******/ ([
  43. /* 0 */
  44. /***/ (function(module, exports, __webpack_require__) {
  45. __webpack_require__(1);
  46. module.exports = __webpack_require__(332);
  47. /***/ }),
  48. /* 1 */
  49. /***/ (function(module, exports, __webpack_require__) {
  50. /* WEBPACK VAR INJECTION */(function(global) {"use strict";
  51. __webpack_require__(2);
  52. __webpack_require__(328);
  53. __webpack_require__(329);
  54. if (global._babelPolyfill) {
  55. throw new Error("only one instance of babel-polyfill is allowed");
  56. }
  57. global._babelPolyfill = true;
  58. var DEFINE_PROPERTY = "defineProperty";
  59. function define(O, key, value) {
  60. O[key] || Object[DEFINE_PROPERTY](O, key, {
  61. writable: true,
  62. configurable: true,
  63. value: value
  64. });
  65. }
  66. define(String.prototype, "padLeft", "".padStart);
  67. define(String.prototype, "padRight", "".padEnd);
  68. "pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach(function (key) {
  69. [][key] && define(Array, key, Function.call.bind([][key]));
  70. });
  71. /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
  72. /***/ }),
  73. /* 2 */
  74. /***/ (function(module, exports, __webpack_require__) {
  75. __webpack_require__(3);
  76. __webpack_require__(53);
  77. __webpack_require__(54);
  78. __webpack_require__(55);
  79. __webpack_require__(56);
  80. __webpack_require__(58);
  81. __webpack_require__(60);
  82. __webpack_require__(61);
  83. __webpack_require__(62);
  84. __webpack_require__(63);
  85. __webpack_require__(64);
  86. __webpack_require__(65);
  87. __webpack_require__(66);
  88. __webpack_require__(67);
  89. __webpack_require__(68);
  90. __webpack_require__(70);
  91. __webpack_require__(72);
  92. __webpack_require__(74);
  93. __webpack_require__(76);
  94. __webpack_require__(79);
  95. __webpack_require__(80);
  96. __webpack_require__(81);
  97. __webpack_require__(85);
  98. __webpack_require__(87);
  99. __webpack_require__(89);
  100. __webpack_require__(92);
  101. __webpack_require__(93);
  102. __webpack_require__(94);
  103. __webpack_require__(95);
  104. __webpack_require__(97);
  105. __webpack_require__(98);
  106. __webpack_require__(99);
  107. __webpack_require__(100);
  108. __webpack_require__(101);
  109. __webpack_require__(102);
  110. __webpack_require__(103);
  111. __webpack_require__(105);
  112. __webpack_require__(106);
  113. __webpack_require__(107);
  114. __webpack_require__(109);
  115. __webpack_require__(110);
  116. __webpack_require__(111);
  117. __webpack_require__(113);
  118. __webpack_require__(115);
  119. __webpack_require__(116);
  120. __webpack_require__(117);
  121. __webpack_require__(118);
  122. __webpack_require__(119);
  123. __webpack_require__(120);
  124. __webpack_require__(121);
  125. __webpack_require__(122);
  126. __webpack_require__(123);
  127. __webpack_require__(124);
  128. __webpack_require__(125);
  129. __webpack_require__(126);
  130. __webpack_require__(127);
  131. __webpack_require__(132);
  132. __webpack_require__(133);
  133. __webpack_require__(137);
  134. __webpack_require__(138);
  135. __webpack_require__(139);
  136. __webpack_require__(140);
  137. __webpack_require__(142);
  138. __webpack_require__(143);
  139. __webpack_require__(144);
  140. __webpack_require__(145);
  141. __webpack_require__(146);
  142. __webpack_require__(147);
  143. __webpack_require__(148);
  144. __webpack_require__(149);
  145. __webpack_require__(150);
  146. __webpack_require__(151);
  147. __webpack_require__(152);
  148. __webpack_require__(153);
  149. __webpack_require__(154);
  150. __webpack_require__(155);
  151. __webpack_require__(156);
  152. __webpack_require__(158);
  153. __webpack_require__(159);
  154. __webpack_require__(161);
  155. __webpack_require__(162);
  156. __webpack_require__(168);
  157. __webpack_require__(169);
  158. __webpack_require__(171);
  159. __webpack_require__(172);
  160. __webpack_require__(173);
  161. __webpack_require__(177);
  162. __webpack_require__(178);
  163. __webpack_require__(179);
  164. __webpack_require__(180);
  165. __webpack_require__(181);
  166. __webpack_require__(183);
  167. __webpack_require__(184);
  168. __webpack_require__(185);
  169. __webpack_require__(186);
  170. __webpack_require__(189);
  171. __webpack_require__(191);
  172. __webpack_require__(192);
  173. __webpack_require__(193);
  174. __webpack_require__(195);
  175. __webpack_require__(197);
  176. __webpack_require__(199);
  177. __webpack_require__(201);
  178. __webpack_require__(202);
  179. __webpack_require__(203);
  180. __webpack_require__(207);
  181. __webpack_require__(208);
  182. __webpack_require__(209);
  183. __webpack_require__(211);
  184. __webpack_require__(221);
  185. __webpack_require__(225);
  186. __webpack_require__(226);
  187. __webpack_require__(228);
  188. __webpack_require__(229);
  189. __webpack_require__(233);
  190. __webpack_require__(234);
  191. __webpack_require__(236);
  192. __webpack_require__(237);
  193. __webpack_require__(238);
  194. __webpack_require__(239);
  195. __webpack_require__(240);
  196. __webpack_require__(241);
  197. __webpack_require__(242);
  198. __webpack_require__(243);
  199. __webpack_require__(244);
  200. __webpack_require__(245);
  201. __webpack_require__(246);
  202. __webpack_require__(247);
  203. __webpack_require__(248);
  204. __webpack_require__(249);
  205. __webpack_require__(250);
  206. __webpack_require__(251);
  207. __webpack_require__(252);
  208. __webpack_require__(253);
  209. __webpack_require__(254);
  210. __webpack_require__(256);
  211. __webpack_require__(257);
  212. __webpack_require__(258);
  213. __webpack_require__(259);
  214. __webpack_require__(260);
  215. __webpack_require__(262);
  216. __webpack_require__(263);
  217. __webpack_require__(264);
  218. __webpack_require__(266);
  219. __webpack_require__(267);
  220. __webpack_require__(268);
  221. __webpack_require__(269);
  222. __webpack_require__(270);
  223. __webpack_require__(271);
  224. __webpack_require__(272);
  225. __webpack_require__(273);
  226. __webpack_require__(275);
  227. __webpack_require__(276);
  228. __webpack_require__(278);
  229. __webpack_require__(279);
  230. __webpack_require__(280);
  231. __webpack_require__(281);
  232. __webpack_require__(284);
  233. __webpack_require__(285);
  234. __webpack_require__(287);
  235. __webpack_require__(288);
  236. __webpack_require__(289);
  237. __webpack_require__(290);
  238. __webpack_require__(292);
  239. __webpack_require__(293);
  240. __webpack_require__(294);
  241. __webpack_require__(295);
  242. __webpack_require__(296);
  243. __webpack_require__(297);
  244. __webpack_require__(298);
  245. __webpack_require__(299);
  246. __webpack_require__(300);
  247. __webpack_require__(301);
  248. __webpack_require__(303);
  249. __webpack_require__(304);
  250. __webpack_require__(305);
  251. __webpack_require__(306);
  252. __webpack_require__(307);
  253. __webpack_require__(308);
  254. __webpack_require__(309);
  255. __webpack_require__(310);
  256. __webpack_require__(311);
  257. __webpack_require__(312);
  258. __webpack_require__(313);
  259. __webpack_require__(315);
  260. __webpack_require__(316);
  261. __webpack_require__(317);
  262. __webpack_require__(318);
  263. __webpack_require__(319);
  264. __webpack_require__(320);
  265. __webpack_require__(321);
  266. __webpack_require__(322);
  267. __webpack_require__(323);
  268. __webpack_require__(324);
  269. __webpack_require__(325);
  270. __webpack_require__(326);
  271. __webpack_require__(327);
  272. module.exports = __webpack_require__(9);
  273. /***/ }),
  274. /* 3 */
  275. /***/ (function(module, exports, __webpack_require__) {
  276. 'use strict';
  277. // ECMAScript 6 symbols shim
  278. var global = __webpack_require__(4);
  279. var has = __webpack_require__(5);
  280. var DESCRIPTORS = __webpack_require__(6);
  281. var $export = __webpack_require__(8);
  282. var redefine = __webpack_require__(18);
  283. var META = __webpack_require__(25).KEY;
  284. var $fails = __webpack_require__(7);
  285. var shared = __webpack_require__(21);
  286. var setToStringTag = __webpack_require__(26);
  287. var uid = __webpack_require__(19);
  288. var wks = __webpack_require__(27);
  289. var wksExt = __webpack_require__(28);
  290. var wksDefine = __webpack_require__(29);
  291. var enumKeys = __webpack_require__(30);
  292. var isArray = __webpack_require__(45);
  293. var anObject = __webpack_require__(12);
  294. var isObject = __webpack_require__(13);
  295. var toObject = __webpack_require__(46);
  296. var toIObject = __webpack_require__(33);
  297. var toPrimitive = __webpack_require__(16);
  298. var createDesc = __webpack_require__(17);
  299. var _create = __webpack_require__(47);
  300. var gOPNExt = __webpack_require__(50);
  301. var $GOPD = __webpack_require__(52);
  302. var $GOPS = __webpack_require__(43);
  303. var $DP = __webpack_require__(11);
  304. var $keys = __webpack_require__(31);
  305. var gOPD = $GOPD.f;
  306. var dP = $DP.f;
  307. var gOPN = gOPNExt.f;
  308. var $Symbol = global.Symbol;
  309. var $JSON = global.JSON;
  310. var _stringify = $JSON && $JSON.stringify;
  311. var PROTOTYPE = 'prototype';
  312. var HIDDEN = wks('_hidden');
  313. var TO_PRIMITIVE = wks('toPrimitive');
  314. var isEnum = {}.propertyIsEnumerable;
  315. var SymbolRegistry = shared('symbol-registry');
  316. var AllSymbols = shared('symbols');
  317. var OPSymbols = shared('op-symbols');
  318. var ObjectProto = Object[PROTOTYPE];
  319. var USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f;
  320. var QObject = global.QObject;
  321. // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
  322. var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
  323. // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
  324. var setSymbolDesc = DESCRIPTORS && $fails(function () {
  325. return _create(dP({}, 'a', {
  326. get: function () { return dP(this, 'a', { value: 7 }).a; }
  327. })).a != 7;
  328. }) ? function (it, key, D) {
  329. var protoDesc = gOPD(ObjectProto, key);
  330. if (protoDesc) delete ObjectProto[key];
  331. dP(it, key, D);
  332. if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);
  333. } : dP;
  334. var wrap = function (tag) {
  335. var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
  336. sym._k = tag;
  337. return sym;
  338. };
  339. var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
  340. return typeof it == 'symbol';
  341. } : function (it) {
  342. return it instanceof $Symbol;
  343. };
  344. var $defineProperty = function defineProperty(it, key, D) {
  345. if (it === ObjectProto) $defineProperty(OPSymbols, key, D);
  346. anObject(it);
  347. key = toPrimitive(key, true);
  348. anObject(D);
  349. if (has(AllSymbols, key)) {
  350. if (!D.enumerable) {
  351. if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));
  352. it[HIDDEN][key] = true;
  353. } else {
  354. if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
  355. D = _create(D, { enumerable: createDesc(0, false) });
  356. } return setSymbolDesc(it, key, D);
  357. } return dP(it, key, D);
  358. };
  359. var $defineProperties = function defineProperties(it, P) {
  360. anObject(it);
  361. var keys = enumKeys(P = toIObject(P));
  362. var i = 0;
  363. var l = keys.length;
  364. var key;
  365. while (l > i) $defineProperty(it, key = keys[i++], P[key]);
  366. return it;
  367. };
  368. var $create = function create(it, P) {
  369. return P === undefined ? _create(it) : $defineProperties(_create(it), P);
  370. };
  371. var $propertyIsEnumerable = function propertyIsEnumerable(key) {
  372. var E = isEnum.call(this, key = toPrimitive(key, true));
  373. if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;
  374. return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
  375. };
  376. var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
  377. it = toIObject(it);
  378. key = toPrimitive(key, true);
  379. if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;
  380. var D = gOPD(it, key);
  381. if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
  382. return D;
  383. };
  384. var $getOwnPropertyNames = function getOwnPropertyNames(it) {
  385. var names = gOPN(toIObject(it));
  386. var result = [];
  387. var i = 0;
  388. var key;
  389. while (names.length > i) {
  390. if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
  391. } return result;
  392. };
  393. var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
  394. var IS_OP = it === ObjectProto;
  395. var names = gOPN(IS_OP ? OPSymbols : toIObject(it));
  396. var result = [];
  397. var i = 0;
  398. var key;
  399. while (names.length > i) {
  400. if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);
  401. } return result;
  402. };
  403. // 19.4.1.1 Symbol([description])
  404. if (!USE_NATIVE) {
  405. $Symbol = function Symbol() {
  406. if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
  407. var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
  408. var $set = function (value) {
  409. if (this === ObjectProto) $set.call(OPSymbols, value);
  410. if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
  411. setSymbolDesc(this, tag, createDesc(1, value));
  412. };
  413. if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });
  414. return wrap(tag);
  415. };
  416. redefine($Symbol[PROTOTYPE], 'toString', function toString() {
  417. return this._k;
  418. });
  419. $GOPD.f = $getOwnPropertyDescriptor;
  420. $DP.f = $defineProperty;
  421. __webpack_require__(51).f = gOPNExt.f = $getOwnPropertyNames;
  422. __webpack_require__(44).f = $propertyIsEnumerable;
  423. $GOPS.f = $getOwnPropertySymbols;
  424. if (DESCRIPTORS && !__webpack_require__(22)) {
  425. redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
  426. }
  427. wksExt.f = function (name) {
  428. return wrap(wks(name));
  429. };
  430. }
  431. $export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });
  432. for (var es6Symbols = (
  433. // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
  434. 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
  435. ).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);
  436. for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);
  437. $export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
  438. // 19.4.2.1 Symbol.for(key)
  439. 'for': function (key) {
  440. return has(SymbolRegistry, key += '')
  441. ? SymbolRegistry[key]
  442. : SymbolRegistry[key] = $Symbol(key);
  443. },
  444. // 19.4.2.5 Symbol.keyFor(sym)
  445. keyFor: function keyFor(sym) {
  446. if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');
  447. for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
  448. },
  449. useSetter: function () { setter = true; },
  450. useSimple: function () { setter = false; }
  451. });
  452. $export($export.S + $export.F * !USE_NATIVE, 'Object', {
  453. // 19.1.2.2 Object.create(O [, Properties])
  454. create: $create,
  455. // 19.1.2.4 Object.defineProperty(O, P, Attributes)
  456. defineProperty: $defineProperty,
  457. // 19.1.2.3 Object.defineProperties(O, Properties)
  458. defineProperties: $defineProperties,
  459. // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
  460. getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
  461. // 19.1.2.7 Object.getOwnPropertyNames(O)
  462. getOwnPropertyNames: $getOwnPropertyNames,
  463. // 19.1.2.8 Object.getOwnPropertySymbols(O)
  464. getOwnPropertySymbols: $getOwnPropertySymbols
  465. });
  466. // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
  467. // https://bugs.chromium.org/p/v8/issues/detail?id=3443
  468. var FAILS_ON_PRIMITIVES = $fails(function () { $GOPS.f(1); });
  469. $export($export.S + $export.F * FAILS_ON_PRIMITIVES, 'Object', {
  470. getOwnPropertySymbols: function getOwnPropertySymbols(it) {
  471. return $GOPS.f(toObject(it));
  472. }
  473. });
  474. // 24.3.2 JSON.stringify(value [, replacer [, space]])
  475. $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
  476. var S = $Symbol();
  477. // MS Edge converts symbol values to JSON as {}
  478. // WebKit converts symbol values to JSON as null
  479. // V8 throws on boxed symbols
  480. return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
  481. })), 'JSON', {
  482. stringify: function stringify(it) {
  483. var args = [it];
  484. var i = 1;
  485. var replacer, $replacer;
  486. while (arguments.length > i) args.push(arguments[i++]);
  487. $replacer = replacer = args[1];
  488. if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
  489. if (!isArray(replacer)) replacer = function (key, value) {
  490. if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
  491. if (!isSymbol(value)) return value;
  492. };
  493. args[1] = replacer;
  494. return _stringify.apply($JSON, args);
  495. }
  496. });
  497. // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
  498. $Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(10)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
  499. // 19.4.3.5 Symbol.prototype[@@toStringTag]
  500. setToStringTag($Symbol, 'Symbol');
  501. // 20.2.1.9 Math[@@toStringTag]
  502. setToStringTag(Math, 'Math', true);
  503. // 24.3.3 JSON[@@toStringTag]
  504. setToStringTag(global.JSON, 'JSON', true);
  505. /***/ }),
  506. /* 4 */
  507. /***/ (function(module, exports) {
  508. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  509. var global = module.exports = typeof window != 'undefined' && window.Math == Math
  510. ? window : typeof self != 'undefined' && self.Math == Math ? self
  511. // eslint-disable-next-line no-new-func
  512. : Function('return this')();
  513. if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
  514. /***/ }),
  515. /* 5 */
  516. /***/ (function(module, exports) {
  517. var hasOwnProperty = {}.hasOwnProperty;
  518. module.exports = function (it, key) {
  519. return hasOwnProperty.call(it, key);
  520. };
  521. /***/ }),
  522. /* 6 */
  523. /***/ (function(module, exports, __webpack_require__) {
  524. // Thank's IE8 for his funny defineProperty
  525. module.exports = !__webpack_require__(7)(function () {
  526. return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
  527. });
  528. /***/ }),
  529. /* 7 */
  530. /***/ (function(module, exports) {
  531. module.exports = function (exec) {
  532. try {
  533. return !!exec();
  534. } catch (e) {
  535. return true;
  536. }
  537. };
  538. /***/ }),
  539. /* 8 */
  540. /***/ (function(module, exports, __webpack_require__) {
  541. var global = __webpack_require__(4);
  542. var core = __webpack_require__(9);
  543. var hide = __webpack_require__(10);
  544. var redefine = __webpack_require__(18);
  545. var ctx = __webpack_require__(23);
  546. var PROTOTYPE = 'prototype';
  547. var $export = function (type, name, source) {
  548. var IS_FORCED = type & $export.F;
  549. var IS_GLOBAL = type & $export.G;
  550. var IS_STATIC = type & $export.S;
  551. var IS_PROTO = type & $export.P;
  552. var IS_BIND = type & $export.B;
  553. var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];
  554. var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
  555. var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});
  556. var key, own, out, exp;
  557. if (IS_GLOBAL) source = name;
  558. for (key in source) {
  559. // contains in native
  560. own = !IS_FORCED && target && target[key] !== undefined;
  561. // export native or passed
  562. out = (own ? target : source)[key];
  563. // bind timers to global for call from export context
  564. exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
  565. // extend global
  566. if (target) redefine(target, key, out, type & $export.U);
  567. // export
  568. if (exports[key] != out) hide(exports, key, exp);
  569. if (IS_PROTO && expProto[key] != out) expProto[key] = out;
  570. }
  571. };
  572. global.core = core;
  573. // type bitmap
  574. $export.F = 1; // forced
  575. $export.G = 2; // global
  576. $export.S = 4; // static
  577. $export.P = 8; // proto
  578. $export.B = 16; // bind
  579. $export.W = 32; // wrap
  580. $export.U = 64; // safe
  581. $export.R = 128; // real proto method for `library`
  582. module.exports = $export;
  583. /***/ }),
  584. /* 9 */
  585. /***/ (function(module, exports) {
  586. var core = module.exports = { version: '2.6.10' };
  587. if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
  588. /***/ }),
  589. /* 10 */
  590. /***/ (function(module, exports, __webpack_require__) {
  591. var dP = __webpack_require__(11);
  592. var createDesc = __webpack_require__(17);
  593. module.exports = __webpack_require__(6) ? function (object, key, value) {
  594. return dP.f(object, key, createDesc(1, value));
  595. } : function (object, key, value) {
  596. object[key] = value;
  597. return object;
  598. };
  599. /***/ }),
  600. /* 11 */
  601. /***/ (function(module, exports, __webpack_require__) {
  602. var anObject = __webpack_require__(12);
  603. var IE8_DOM_DEFINE = __webpack_require__(14);
  604. var toPrimitive = __webpack_require__(16);
  605. var dP = Object.defineProperty;
  606. exports.f = __webpack_require__(6) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
  607. anObject(O);
  608. P = toPrimitive(P, true);
  609. anObject(Attributes);
  610. if (IE8_DOM_DEFINE) try {
  611. return dP(O, P, Attributes);
  612. } catch (e) { /* empty */ }
  613. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
  614. if ('value' in Attributes) O[P] = Attributes.value;
  615. return O;
  616. };
  617. /***/ }),
  618. /* 12 */
  619. /***/ (function(module, exports, __webpack_require__) {
  620. var isObject = __webpack_require__(13);
  621. module.exports = function (it) {
  622. if (!isObject(it)) throw TypeError(it + ' is not an object!');
  623. return it;
  624. };
  625. /***/ }),
  626. /* 13 */
  627. /***/ (function(module, exports) {
  628. module.exports = function (it) {
  629. return typeof it === 'object' ? it !== null : typeof it === 'function';
  630. };
  631. /***/ }),
  632. /* 14 */
  633. /***/ (function(module, exports, __webpack_require__) {
  634. module.exports = !__webpack_require__(6) && !__webpack_require__(7)(function () {
  635. return Object.defineProperty(__webpack_require__(15)('div'), 'a', { get: function () { return 7; } }).a != 7;
  636. });
  637. /***/ }),
  638. /* 15 */
  639. /***/ (function(module, exports, __webpack_require__) {
  640. var isObject = __webpack_require__(13);
  641. var document = __webpack_require__(4).document;
  642. // typeof document.createElement is 'object' in old IE
  643. var is = isObject(document) && isObject(document.createElement);
  644. module.exports = function (it) {
  645. return is ? document.createElement(it) : {};
  646. };
  647. /***/ }),
  648. /* 16 */
  649. /***/ (function(module, exports, __webpack_require__) {
  650. // 7.1.1 ToPrimitive(input [, PreferredType])
  651. var isObject = __webpack_require__(13);
  652. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  653. // and the second argument - flag - preferred type is a string
  654. module.exports = function (it, S) {
  655. if (!isObject(it)) return it;
  656. var fn, val;
  657. if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  658. if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
  659. if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  660. throw TypeError("Can't convert object to primitive value");
  661. };
  662. /***/ }),
  663. /* 17 */
  664. /***/ (function(module, exports) {
  665. module.exports = function (bitmap, value) {
  666. return {
  667. enumerable: !(bitmap & 1),
  668. configurable: !(bitmap & 2),
  669. writable: !(bitmap & 4),
  670. value: value
  671. };
  672. };
  673. /***/ }),
  674. /* 18 */
  675. /***/ (function(module, exports, __webpack_require__) {
  676. var global = __webpack_require__(4);
  677. var hide = __webpack_require__(10);
  678. var has = __webpack_require__(5);
  679. var SRC = __webpack_require__(19)('src');
  680. var $toString = __webpack_require__(20);
  681. var TO_STRING = 'toString';
  682. var TPL = ('' + $toString).split(TO_STRING);
  683. __webpack_require__(9).inspectSource = function (it) {
  684. return $toString.call(it);
  685. };
  686. (module.exports = function (O, key, val, safe) {
  687. var isFunction = typeof val == 'function';
  688. if (isFunction) has(val, 'name') || hide(val, 'name', key);
  689. if (O[key] === val) return;
  690. if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
  691. if (O === global) {
  692. O[key] = val;
  693. } else if (!safe) {
  694. delete O[key];
  695. hide(O, key, val);
  696. } else if (O[key]) {
  697. O[key] = val;
  698. } else {
  699. hide(O, key, val);
  700. }
  701. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  702. })(Function.prototype, TO_STRING, function toString() {
  703. return typeof this == 'function' && this[SRC] || $toString.call(this);
  704. });
  705. /***/ }),
  706. /* 19 */
  707. /***/ (function(module, exports) {
  708. var id = 0;
  709. var px = Math.random();
  710. module.exports = function (key) {
  711. return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
  712. };
  713. /***/ }),
  714. /* 20 */
  715. /***/ (function(module, exports, __webpack_require__) {
  716. module.exports = __webpack_require__(21)('native-function-to-string', Function.toString);
  717. /***/ }),
  718. /* 21 */
  719. /***/ (function(module, exports, __webpack_require__) {
  720. var core = __webpack_require__(9);
  721. var global = __webpack_require__(4);
  722. var SHARED = '__core-js_shared__';
  723. var store = global[SHARED] || (global[SHARED] = {});
  724. (module.exports = function (key, value) {
  725. return store[key] || (store[key] = value !== undefined ? value : {});
  726. })('versions', []).push({
  727. version: core.version,
  728. mode: __webpack_require__(22) ? 'pure' : 'global',
  729. copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
  730. });
  731. /***/ }),
  732. /* 22 */
  733. /***/ (function(module, exports) {
  734. module.exports = false;
  735. /***/ }),
  736. /* 23 */
  737. /***/ (function(module, exports, __webpack_require__) {
  738. // optional / simple context binding
  739. var aFunction = __webpack_require__(24);
  740. module.exports = function (fn, that, length) {
  741. aFunction(fn);
  742. if (that === undefined) return fn;
  743. switch (length) {
  744. case 1: return function (a) {
  745. return fn.call(that, a);
  746. };
  747. case 2: return function (a, b) {
  748. return fn.call(that, a, b);
  749. };
  750. case 3: return function (a, b, c) {
  751. return fn.call(that, a, b, c);
  752. };
  753. }
  754. return function (/* ...args */) {
  755. return fn.apply(that, arguments);
  756. };
  757. };
  758. /***/ }),
  759. /* 24 */
  760. /***/ (function(module, exports) {
  761. module.exports = function (it) {
  762. if (typeof it != 'function') throw TypeError(it + ' is not a function!');
  763. return it;
  764. };
  765. /***/ }),
  766. /* 25 */
  767. /***/ (function(module, exports, __webpack_require__) {
  768. var META = __webpack_require__(19)('meta');
  769. var isObject = __webpack_require__(13);
  770. var has = __webpack_require__(5);
  771. var setDesc = __webpack_require__(11).f;
  772. var id = 0;
  773. var isExtensible = Object.isExtensible || function () {
  774. return true;
  775. };
  776. var FREEZE = !__webpack_require__(7)(function () {
  777. return isExtensible(Object.preventExtensions({}));
  778. });
  779. var setMeta = function (it) {
  780. setDesc(it, META, { value: {
  781. i: 'O' + ++id, // object ID
  782. w: {} // weak collections IDs
  783. } });
  784. };
  785. var fastKey = function (it, create) {
  786. // return primitive with prefix
  787. if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
  788. if (!has(it, META)) {
  789. // can't set metadata to uncaught frozen object
  790. if (!isExtensible(it)) return 'F';
  791. // not necessary to add metadata
  792. if (!create) return 'E';
  793. // add missing metadata
  794. setMeta(it);
  795. // return object ID
  796. } return it[META].i;
  797. };
  798. var getWeak = function (it, create) {
  799. if (!has(it, META)) {
  800. // can't set metadata to uncaught frozen object
  801. if (!isExtensible(it)) return true;
  802. // not necessary to add metadata
  803. if (!create) return false;
  804. // add missing metadata
  805. setMeta(it);
  806. // return hash weak collections IDs
  807. } return it[META].w;
  808. };
  809. // add metadata on freeze-family methods calling
  810. var onFreeze = function (it) {
  811. if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
  812. return it;
  813. };
  814. var meta = module.exports = {
  815. KEY: META,
  816. NEED: false,
  817. fastKey: fastKey,
  818. getWeak: getWeak,
  819. onFreeze: onFreeze
  820. };
  821. /***/ }),
  822. /* 26 */
  823. /***/ (function(module, exports, __webpack_require__) {
  824. var def = __webpack_require__(11).f;
  825. var has = __webpack_require__(5);
  826. var TAG = __webpack_require__(27)('toStringTag');
  827. module.exports = function (it, tag, stat) {
  828. if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
  829. };
  830. /***/ }),
  831. /* 27 */
  832. /***/ (function(module, exports, __webpack_require__) {
  833. var store = __webpack_require__(21)('wks');
  834. var uid = __webpack_require__(19);
  835. var Symbol = __webpack_require__(4).Symbol;
  836. var USE_SYMBOL = typeof Symbol == 'function';
  837. var $exports = module.exports = function (name) {
  838. return store[name] || (store[name] =
  839. USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
  840. };
  841. $exports.store = store;
  842. /***/ }),
  843. /* 28 */
  844. /***/ (function(module, exports, __webpack_require__) {
  845. exports.f = __webpack_require__(27);
  846. /***/ }),
  847. /* 29 */
  848. /***/ (function(module, exports, __webpack_require__) {
  849. var global = __webpack_require__(4);
  850. var core = __webpack_require__(9);
  851. var LIBRARY = __webpack_require__(22);
  852. var wksExt = __webpack_require__(28);
  853. var defineProperty = __webpack_require__(11).f;
  854. module.exports = function (name) {
  855. var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
  856. if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });
  857. };
  858. /***/ }),
  859. /* 30 */
  860. /***/ (function(module, exports, __webpack_require__) {
  861. // all enumerable object keys, includes symbols
  862. var getKeys = __webpack_require__(31);
  863. var gOPS = __webpack_require__(43);
  864. var pIE = __webpack_require__(44);
  865. module.exports = function (it) {
  866. var result = getKeys(it);
  867. var getSymbols = gOPS.f;
  868. if (getSymbols) {
  869. var symbols = getSymbols(it);
  870. var isEnum = pIE.f;
  871. var i = 0;
  872. var key;
  873. while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
  874. } return result;
  875. };
  876. /***/ }),
  877. /* 31 */
  878. /***/ (function(module, exports, __webpack_require__) {
  879. // 19.1.2.14 / 15.2.3.14 Object.keys(O)
  880. var $keys = __webpack_require__(32);
  881. var enumBugKeys = __webpack_require__(42);
  882. module.exports = Object.keys || function keys(O) {
  883. return $keys(O, enumBugKeys);
  884. };
  885. /***/ }),
  886. /* 32 */
  887. /***/ (function(module, exports, __webpack_require__) {
  888. var has = __webpack_require__(5);
  889. var toIObject = __webpack_require__(33);
  890. var arrayIndexOf = __webpack_require__(37)(false);
  891. var IE_PROTO = __webpack_require__(41)('IE_PROTO');
  892. module.exports = function (object, names) {
  893. var O = toIObject(object);
  894. var i = 0;
  895. var result = [];
  896. var key;
  897. for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
  898. // Don't enum bug & hidden keys
  899. while (names.length > i) if (has(O, key = names[i++])) {
  900. ~arrayIndexOf(result, key) || result.push(key);
  901. }
  902. return result;
  903. };
  904. /***/ }),
  905. /* 33 */
  906. /***/ (function(module, exports, __webpack_require__) {
  907. // to indexed object, toObject with fallback for non-array-like ES3 strings
  908. var IObject = __webpack_require__(34);
  909. var defined = __webpack_require__(36);
  910. module.exports = function (it) {
  911. return IObject(defined(it));
  912. };
  913. /***/ }),
  914. /* 34 */
  915. /***/ (function(module, exports, __webpack_require__) {
  916. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  917. var cof = __webpack_require__(35);
  918. // eslint-disable-next-line no-prototype-builtins
  919. module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
  920. return cof(it) == 'String' ? it.split('') : Object(it);
  921. };
  922. /***/ }),
  923. /* 35 */
  924. /***/ (function(module, exports) {
  925. var toString = {}.toString;
  926. module.exports = function (it) {
  927. return toString.call(it).slice(8, -1);
  928. };
  929. /***/ }),
  930. /* 36 */
  931. /***/ (function(module, exports) {
  932. // 7.2.1 RequireObjectCoercible(argument)
  933. module.exports = function (it) {
  934. if (it == undefined) throw TypeError("Can't call method on " + it);
  935. return it;
  936. };
  937. /***/ }),
  938. /* 37 */
  939. /***/ (function(module, exports, __webpack_require__) {
  940. // false -> Array#indexOf
  941. // true -> Array#includes
  942. var toIObject = __webpack_require__(33);
  943. var toLength = __webpack_require__(38);
  944. var toAbsoluteIndex = __webpack_require__(40);
  945. module.exports = function (IS_INCLUDES) {
  946. return function ($this, el, fromIndex) {
  947. var O = toIObject($this);
  948. var length = toLength(O.length);
  949. var index = toAbsoluteIndex(fromIndex, length);
  950. var value;
  951. // Array#includes uses SameValueZero equality algorithm
  952. // eslint-disable-next-line no-self-compare
  953. if (IS_INCLUDES && el != el) while (length > index) {
  954. value = O[index++];
  955. // eslint-disable-next-line no-self-compare
  956. if (value != value) return true;
  957. // Array#indexOf ignores holes, Array#includes - not
  958. } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
  959. if (O[index] === el) return IS_INCLUDES || index || 0;
  960. } return !IS_INCLUDES && -1;
  961. };
  962. };
  963. /***/ }),
  964. /* 38 */
  965. /***/ (function(module, exports, __webpack_require__) {
  966. // 7.1.15 ToLength
  967. var toInteger = __webpack_require__(39);
  968. var min = Math.min;
  969. module.exports = function (it) {
  970. return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
  971. };
  972. /***/ }),
  973. /* 39 */
  974. /***/ (function(module, exports) {
  975. // 7.1.4 ToInteger
  976. var ceil = Math.ceil;
  977. var floor = Math.floor;
  978. module.exports = function (it) {
  979. return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
  980. };
  981. /***/ }),
  982. /* 40 */
  983. /***/ (function(module, exports, __webpack_require__) {
  984. var toInteger = __webpack_require__(39);
  985. var max = Math.max;
  986. var min = Math.min;
  987. module.exports = function (index, length) {
  988. index = toInteger(index);
  989. return index < 0 ? max(index + length, 0) : min(index, length);
  990. };
  991. /***/ }),
  992. /* 41 */
  993. /***/ (function(module, exports, __webpack_require__) {
  994. var shared = __webpack_require__(21)('keys');
  995. var uid = __webpack_require__(19);
  996. module.exports = function (key) {
  997. return shared[key] || (shared[key] = uid(key));
  998. };
  999. /***/ }),
  1000. /* 42 */
  1001. /***/ (function(module, exports) {
  1002. // IE 8- don't enum bug keys
  1003. module.exports = (
  1004. 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
  1005. ).split(',');
  1006. /***/ }),
  1007. /* 43 */
  1008. /***/ (function(module, exports) {
  1009. exports.f = Object.getOwnPropertySymbols;
  1010. /***/ }),
  1011. /* 44 */
  1012. /***/ (function(module, exports) {
  1013. exports.f = {}.propertyIsEnumerable;
  1014. /***/ }),
  1015. /* 45 */
  1016. /***/ (function(module, exports, __webpack_require__) {
  1017. // 7.2.2 IsArray(argument)
  1018. var cof = __webpack_require__(35);
  1019. module.exports = Array.isArray || function isArray(arg) {
  1020. return cof(arg) == 'Array';
  1021. };
  1022. /***/ }),
  1023. /* 46 */
  1024. /***/ (function(module, exports, __webpack_require__) {
  1025. // 7.1.13 ToObject(argument)
  1026. var defined = __webpack_require__(36);
  1027. module.exports = function (it) {
  1028. return Object(defined(it));
  1029. };
  1030. /***/ }),
  1031. /* 47 */
  1032. /***/ (function(module, exports, __webpack_require__) {
  1033. // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
  1034. var anObject = __webpack_require__(12);
  1035. var dPs = __webpack_require__(48);
  1036. var enumBugKeys = __webpack_require__(42);
  1037. var IE_PROTO = __webpack_require__(41)('IE_PROTO');
  1038. var Empty = function () { /* empty */ };
  1039. var PROTOTYPE = 'prototype';
  1040. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  1041. var createDict = function () {
  1042. // Thrash, waste and sodomy: IE GC bug
  1043. var iframe = __webpack_require__(15)('iframe');
  1044. var i = enumBugKeys.length;
  1045. var lt = '<';
  1046. var gt = '>';
  1047. var iframeDocument;
  1048. iframe.style.display = 'none';
  1049. __webpack_require__(49).appendChild(iframe);
  1050. iframe.src = 'javascript:'; // eslint-disable-line no-script-url
  1051. // createDict = iframe.contentWindow.Object;
  1052. // html.removeChild(iframe);
  1053. iframeDocument = iframe.contentWindow.document;
  1054. iframeDocument.open();
  1055. iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
  1056. iframeDocument.close();
  1057. createDict = iframeDocument.F;
  1058. while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
  1059. return createDict();
  1060. };
  1061. module.exports = Object.create || function create(O, Properties) {
  1062. var result;
  1063. if (O !== null) {
  1064. Empty[PROTOTYPE] = anObject(O);
  1065. result = new Empty();
  1066. Empty[PROTOTYPE] = null;
  1067. // add "__proto__" for Object.getPrototypeOf polyfill
  1068. result[IE_PROTO] = O;
  1069. } else result = createDict();
  1070. return Properties === undefined ? result : dPs(result, Properties);
  1071. };
  1072. /***/ }),
  1073. /* 48 */
  1074. /***/ (function(module, exports, __webpack_require__) {
  1075. var dP = __webpack_require__(11);
  1076. var anObject = __webpack_require__(12);
  1077. var getKeys = __webpack_require__(31);
  1078. module.exports = __webpack_require__(6) ? Object.defineProperties : function defineProperties(O, Properties) {
  1079. anObject(O);
  1080. var keys = getKeys(Properties);
  1081. var length = keys.length;
  1082. var i = 0;
  1083. var P;
  1084. while (length > i) dP.f(O, P = keys[i++], Properties[P]);
  1085. return O;
  1086. };
  1087. /***/ }),
  1088. /* 49 */
  1089. /***/ (function(module, exports, __webpack_require__) {
  1090. var document = __webpack_require__(4).document;
  1091. module.exports = document && document.documentElement;
  1092. /***/ }),
  1093. /* 50 */
  1094. /***/ (function(module, exports, __webpack_require__) {
  1095. // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
  1096. var toIObject = __webpack_require__(33);
  1097. var gOPN = __webpack_require__(51).f;
  1098. var toString = {}.toString;
  1099. var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
  1100. ? Object.getOwnPropertyNames(window) : [];
  1101. var getWindowNames = function (it) {
  1102. try {
  1103. return gOPN(it);
  1104. } catch (e) {
  1105. return windowNames.slice();
  1106. }
  1107. };
  1108. module.exports.f = function getOwnPropertyNames(it) {
  1109. return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
  1110. };
  1111. /***/ }),
  1112. /* 51 */
  1113. /***/ (function(module, exports, __webpack_require__) {
  1114. // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
  1115. var $keys = __webpack_require__(32);
  1116. var hiddenKeys = __webpack_require__(42).concat('length', 'prototype');
  1117. exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  1118. return $keys(O, hiddenKeys);
  1119. };
  1120. /***/ }),
  1121. /* 52 */
  1122. /***/ (function(module, exports, __webpack_require__) {
  1123. var pIE = __webpack_require__(44);
  1124. var createDesc = __webpack_require__(17);
  1125. var toIObject = __webpack_require__(33);
  1126. var toPrimitive = __webpack_require__(16);
  1127. var has = __webpack_require__(5);
  1128. var IE8_DOM_DEFINE = __webpack_require__(14);
  1129. var gOPD = Object.getOwnPropertyDescriptor;
  1130. exports.f = __webpack_require__(6) ? gOPD : function getOwnPropertyDescriptor(O, P) {
  1131. O = toIObject(O);
  1132. P = toPrimitive(P, true);
  1133. if (IE8_DOM_DEFINE) try {
  1134. return gOPD(O, P);
  1135. } catch (e) { /* empty */ }
  1136. if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
  1137. };
  1138. /***/ }),
  1139. /* 53 */
  1140. /***/ (function(module, exports, __webpack_require__) {
  1141. var $export = __webpack_require__(8);
  1142. // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
  1143. $export($export.S, 'Object', { create: __webpack_require__(47) });
  1144. /***/ }),
  1145. /* 54 */
  1146. /***/ (function(module, exports, __webpack_require__) {
  1147. var $export = __webpack_require__(8);
  1148. // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
  1149. $export($export.S + $export.F * !__webpack_require__(6), 'Object', { defineProperty: __webpack_require__(11).f });
  1150. /***/ }),
  1151. /* 55 */
  1152. /***/ (function(module, exports, __webpack_require__) {
  1153. var $export = __webpack_require__(8);
  1154. // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties)
  1155. $export($export.S + $export.F * !__webpack_require__(6), 'Object', { defineProperties: __webpack_require__(48) });
  1156. /***/ }),
  1157. /* 56 */
  1158. /***/ (function(module, exports, __webpack_require__) {
  1159. // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
  1160. var toIObject = __webpack_require__(33);
  1161. var $getOwnPropertyDescriptor = __webpack_require__(52).f;
  1162. __webpack_require__(57)('getOwnPropertyDescriptor', function () {
  1163. return function getOwnPropertyDescriptor(it, key) {
  1164. return $getOwnPropertyDescriptor(toIObject(it), key);
  1165. };
  1166. });
  1167. /***/ }),
  1168. /* 57 */
  1169. /***/ (function(module, exports, __webpack_require__) {
  1170. // most Object methods by ES6 should accept primitives
  1171. var $export = __webpack_require__(8);
  1172. var core = __webpack_require__(9);
  1173. var fails = __webpack_require__(7);
  1174. module.exports = function (KEY, exec) {
  1175. var fn = (core.Object || {})[KEY] || Object[KEY];
  1176. var exp = {};
  1177. exp[KEY] = exec(fn);
  1178. $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);
  1179. };
  1180. /***/ }),
  1181. /* 58 */
  1182. /***/ (function(module, exports, __webpack_require__) {
  1183. // 19.1.2.9 Object.getPrototypeOf(O)
  1184. var toObject = __webpack_require__(46);
  1185. var $getPrototypeOf = __webpack_require__(59);
  1186. __webpack_require__(57)('getPrototypeOf', function () {
  1187. return function getPrototypeOf(it) {
  1188. return $getPrototypeOf(toObject(it));
  1189. };
  1190. });
  1191. /***/ }),
  1192. /* 59 */
  1193. /***/ (function(module, exports, __webpack_require__) {
  1194. // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
  1195. var has = __webpack_require__(5);
  1196. var toObject = __webpack_require__(46);
  1197. var IE_PROTO = __webpack_require__(41)('IE_PROTO');
  1198. var ObjectProto = Object.prototype;
  1199. module.exports = Object.getPrototypeOf || function (O) {
  1200. O = toObject(O);
  1201. if (has(O, IE_PROTO)) return O[IE_PROTO];
  1202. if (typeof O.constructor == 'function' && O instanceof O.constructor) {
  1203. return O.constructor.prototype;
  1204. } return O instanceof Object ? ObjectProto : null;
  1205. };
  1206. /***/ }),
  1207. /* 60 */
  1208. /***/ (function(module, exports, __webpack_require__) {
  1209. // 19.1.2.14 Object.keys(O)
  1210. var toObject = __webpack_require__(46);
  1211. var $keys = __webpack_require__(31);
  1212. __webpack_require__(57)('keys', function () {
  1213. return function keys(it) {
  1214. return $keys(toObject(it));
  1215. };
  1216. });
  1217. /***/ }),
  1218. /* 61 */
  1219. /***/ (function(module, exports, __webpack_require__) {
  1220. // 19.1.2.7 Object.getOwnPropertyNames(O)
  1221. __webpack_require__(57)('getOwnPropertyNames', function () {
  1222. return __webpack_require__(50).f;
  1223. });
  1224. /***/ }),
  1225. /* 62 */
  1226. /***/ (function(module, exports, __webpack_require__) {
  1227. // 19.1.2.5 Object.freeze(O)
  1228. var isObject = __webpack_require__(13);
  1229. var meta = __webpack_require__(25).onFreeze;
  1230. __webpack_require__(57)('freeze', function ($freeze) {
  1231. return function freeze(it) {
  1232. return $freeze && isObject(it) ? $freeze(meta(it)) : it;
  1233. };
  1234. });
  1235. /***/ }),
  1236. /* 63 */
  1237. /***/ (function(module, exports, __webpack_require__) {
  1238. // 19.1.2.17 Object.seal(O)
  1239. var isObject = __webpack_require__(13);
  1240. var meta = __webpack_require__(25).onFreeze;
  1241. __webpack_require__(57)('seal', function ($seal) {
  1242. return function seal(it) {
  1243. return $seal && isObject(it) ? $seal(meta(it)) : it;
  1244. };
  1245. });
  1246. /***/ }),
  1247. /* 64 */
  1248. /***/ (function(module, exports, __webpack_require__) {
  1249. // 19.1.2.15 Object.preventExtensions(O)
  1250. var isObject = __webpack_require__(13);
  1251. var meta = __webpack_require__(25).onFreeze;
  1252. __webpack_require__(57)('preventExtensions', function ($preventExtensions) {
  1253. return function preventExtensions(it) {
  1254. return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it;
  1255. };
  1256. });
  1257. /***/ }),
  1258. /* 65 */
  1259. /***/ (function(module, exports, __webpack_require__) {
  1260. // 19.1.2.12 Object.isFrozen(O)
  1261. var isObject = __webpack_require__(13);
  1262. __webpack_require__(57)('isFrozen', function ($isFrozen) {
  1263. return function isFrozen(it) {
  1264. return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true;
  1265. };
  1266. });
  1267. /***/ }),
  1268. /* 66 */
  1269. /***/ (function(module, exports, __webpack_require__) {
  1270. // 19.1.2.13 Object.isSealed(O)
  1271. var isObject = __webpack_require__(13);
  1272. __webpack_require__(57)('isSealed', function ($isSealed) {
  1273. return function isSealed(it) {
  1274. return isObject(it) ? $isSealed ? $isSealed(it) : false : true;
  1275. };
  1276. });
  1277. /***/ }),
  1278. /* 67 */
  1279. /***/ (function(module, exports, __webpack_require__) {
  1280. // 19.1.2.11 Object.isExtensible(O)
  1281. var isObject = __webpack_require__(13);
  1282. __webpack_require__(57)('isExtensible', function ($isExtensible) {
  1283. return function isExtensible(it) {
  1284. return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false;
  1285. };
  1286. });
  1287. /***/ }),
  1288. /* 68 */
  1289. /***/ (function(module, exports, __webpack_require__) {
  1290. // 19.1.3.1 Object.assign(target, source)
  1291. var $export = __webpack_require__(8);
  1292. $export($export.S + $export.F, 'Object', { assign: __webpack_require__(69) });
  1293. /***/ }),
  1294. /* 69 */
  1295. /***/ (function(module, exports, __webpack_require__) {
  1296. 'use strict';
  1297. // 19.1.2.1 Object.assign(target, source, ...)
  1298. var DESCRIPTORS = __webpack_require__(6);
  1299. var getKeys = __webpack_require__(31);
  1300. var gOPS = __webpack_require__(43);
  1301. var pIE = __webpack_require__(44);
  1302. var toObject = __webpack_require__(46);
  1303. var IObject = __webpack_require__(34);
  1304. var $assign = Object.assign;
  1305. // should work with symbols and should have deterministic property order (V8 bug)
  1306. module.exports = !$assign || __webpack_require__(7)(function () {
  1307. var A = {};
  1308. var B = {};
  1309. // eslint-disable-next-line no-undef
  1310. var S = Symbol();
  1311. var K = 'abcdefghijklmnopqrst';
  1312. A[S] = 7;
  1313. K.split('').forEach(function (k) { B[k] = k; });
  1314. return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
  1315. }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
  1316. var T = toObject(target);
  1317. var aLen = arguments.length;
  1318. var index = 1;
  1319. var getSymbols = gOPS.f;
  1320. var isEnum = pIE.f;
  1321. while (aLen > index) {
  1322. var S = IObject(arguments[index++]);
  1323. var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
  1324. var length = keys.length;
  1325. var j = 0;
  1326. var key;
  1327. while (length > j) {
  1328. key = keys[j++];
  1329. if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key];
  1330. }
  1331. } return T;
  1332. } : $assign;
  1333. /***/ }),
  1334. /* 70 */
  1335. /***/ (function(module, exports, __webpack_require__) {
  1336. // 19.1.3.10 Object.is(value1, value2)
  1337. var $export = __webpack_require__(8);
  1338. $export($export.S, 'Object', { is: __webpack_require__(71) });
  1339. /***/ }),
  1340. /* 71 */
  1341. /***/ (function(module, exports) {
  1342. // 7.2.9 SameValue(x, y)
  1343. module.exports = Object.is || function is(x, y) {
  1344. // eslint-disable-next-line no-self-compare
  1345. return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
  1346. };
  1347. /***/ }),
  1348. /* 72 */
  1349. /***/ (function(module, exports, __webpack_require__) {
  1350. // 19.1.3.19 Object.setPrototypeOf(O, proto)
  1351. var $export = __webpack_require__(8);
  1352. $export($export.S, 'Object', { setPrototypeOf: __webpack_require__(73).set });
  1353. /***/ }),
  1354. /* 73 */
  1355. /***/ (function(module, exports, __webpack_require__) {
  1356. // Works with __proto__ only. Old v8 can't work with null proto objects.
  1357. /* eslint-disable no-proto */
  1358. var isObject = __webpack_require__(13);
  1359. var anObject = __webpack_require__(12);
  1360. var check = function (O, proto) {
  1361. anObject(O);
  1362. if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
  1363. };
  1364. module.exports = {
  1365. set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
  1366. function (test, buggy, set) {
  1367. try {
  1368. set = __webpack_require__(23)(Function.call, __webpack_require__(52).f(Object.prototype, '__proto__').set, 2);
  1369. set(test, []);
  1370. buggy = !(test instanceof Array);
  1371. } catch (e) { buggy = true; }
  1372. return function setPrototypeOf(O, proto) {
  1373. check(O, proto);
  1374. if (buggy) O.__proto__ = proto;
  1375. else set(O, proto);
  1376. return O;
  1377. };
  1378. }({}, false) : undefined),
  1379. check: check
  1380. };
  1381. /***/ }),
  1382. /* 74 */
  1383. /***/ (function(module, exports, __webpack_require__) {
  1384. 'use strict';
  1385. // 19.1.3.6 Object.prototype.toString()
  1386. var classof = __webpack_require__(75);
  1387. var test = {};
  1388. test[__webpack_require__(27)('toStringTag')] = 'z';
  1389. if (test + '' != '[object z]') {
  1390. __webpack_require__(18)(Object.prototype, 'toString', function toString() {
  1391. return '[object ' + classof(this) + ']';
  1392. }, true);
  1393. }
  1394. /***/ }),
  1395. /* 75 */
  1396. /***/ (function(module, exports, __webpack_require__) {
  1397. // getting tag from 19.1.3.6 Object.prototype.toString()
  1398. var cof = __webpack_require__(35);
  1399. var TAG = __webpack_require__(27)('toStringTag');
  1400. // ES3 wrong here
  1401. var ARG = cof(function () { return arguments; }()) == 'Arguments';
  1402. // fallback for IE11 Script Access Denied error
  1403. var tryGet = function (it, key) {
  1404. try {
  1405. return it[key];
  1406. } catch (e) { /* empty */ }
  1407. };
  1408. module.exports = function (it) {
  1409. var O, T, B;
  1410. return it === undefined ? 'Undefined' : it === null ? 'Null'
  1411. // @@toStringTag case
  1412. : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
  1413. // builtinTag case
  1414. : ARG ? cof(O)
  1415. // ES3 arguments fallback
  1416. : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
  1417. };
  1418. /***/ }),
  1419. /* 76 */
  1420. /***/ (function(module, exports, __webpack_require__) {
  1421. // 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...)
  1422. var $export = __webpack_require__(8);
  1423. $export($export.P, 'Function', { bind: __webpack_require__(77) });
  1424. /***/ }),
  1425. /* 77 */
  1426. /***/ (function(module, exports, __webpack_require__) {
  1427. 'use strict';
  1428. var aFunction = __webpack_require__(24);
  1429. var isObject = __webpack_require__(13);
  1430. var invoke = __webpack_require__(78);
  1431. var arraySlice = [].slice;
  1432. var factories = {};
  1433. var construct = function (F, len, args) {
  1434. if (!(len in factories)) {
  1435. for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']';
  1436. // eslint-disable-next-line no-new-func
  1437. factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')');
  1438. } return factories[len](F, args);
  1439. };
  1440. module.exports = Function.bind || function bind(that /* , ...args */) {
  1441. var fn = aFunction(this);
  1442. var partArgs = arraySlice.call(arguments, 1);
  1443. var bound = function (/* args... */) {
  1444. var args = partArgs.concat(arraySlice.call(arguments));
  1445. return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that);
  1446. };
  1447. if (isObject(fn.prototype)) bound.prototype = fn.prototype;
  1448. return bound;
  1449. };
  1450. /***/ }),
  1451. /* 78 */
  1452. /***/ (function(module, exports) {
  1453. // fast apply, http://jsperf.lnkit.com/fast-apply/5
  1454. module.exports = function (fn, args, that) {
  1455. var un = that === undefined;
  1456. switch (args.length) {
  1457. case 0: return un ? fn()
  1458. : fn.call(that);
  1459. case 1: return un ? fn(args[0])
  1460. : fn.call(that, args[0]);
  1461. case 2: return un ? fn(args[0], args[1])
  1462. : fn.call(that, args[0], args[1]);
  1463. case 3: return un ? fn(args[0], args[1], args[2])
  1464. : fn.call(that, args[0], args[1], args[2]);
  1465. case 4: return un ? fn(args[0], args[1], args[2], args[3])
  1466. : fn.call(that, args[0], args[1], args[2], args[3]);
  1467. } return fn.apply(that, args);
  1468. };
  1469. /***/ }),
  1470. /* 79 */
  1471. /***/ (function(module, exports, __webpack_require__) {
  1472. var dP = __webpack_require__(11).f;
  1473. var FProto = Function.prototype;
  1474. var nameRE = /^\s*function ([^ (]*)/;
  1475. var NAME = 'name';
  1476. // 19.2.4.2 name
  1477. NAME in FProto || __webpack_require__(6) && dP(FProto, NAME, {
  1478. configurable: true,
  1479. get: function () {
  1480. try {
  1481. return ('' + this).match(nameRE)[1];
  1482. } catch (e) {
  1483. return '';
  1484. }
  1485. }
  1486. });
  1487. /***/ }),
  1488. /* 80 */
  1489. /***/ (function(module, exports, __webpack_require__) {
  1490. 'use strict';
  1491. var isObject = __webpack_require__(13);
  1492. var getPrototypeOf = __webpack_require__(59);
  1493. var HAS_INSTANCE = __webpack_require__(27)('hasInstance');
  1494. var FunctionProto = Function.prototype;
  1495. // 19.2.3.6 Function.prototype[@@hasInstance](V)
  1496. if (!(HAS_INSTANCE in FunctionProto)) __webpack_require__(11).f(FunctionProto, HAS_INSTANCE, { value: function (O) {
  1497. if (typeof this != 'function' || !isObject(O)) return false;
  1498. if (!isObject(this.prototype)) return O instanceof this;
  1499. // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this:
  1500. while (O = getPrototypeOf(O)) if (this.prototype === O) return true;
  1501. return false;
  1502. } });
  1503. /***/ }),
  1504. /* 81 */
  1505. /***/ (function(module, exports, __webpack_require__) {
  1506. var $export = __webpack_require__(8);
  1507. var $parseInt = __webpack_require__(82);
  1508. // 18.2.5 parseInt(string, radix)
  1509. $export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt });
  1510. /***/ }),
  1511. /* 82 */
  1512. /***/ (function(module, exports, __webpack_require__) {
  1513. var $parseInt = __webpack_require__(4).parseInt;
  1514. var $trim = __webpack_require__(83).trim;
  1515. var ws = __webpack_require__(84);
  1516. var hex = /^[-+]?0[xX]/;
  1517. module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) {
  1518. var string = $trim(String(str), 3);
  1519. return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10));
  1520. } : $parseInt;
  1521. /***/ }),
  1522. /* 83 */
  1523. /***/ (function(module, exports, __webpack_require__) {
  1524. var $export = __webpack_require__(8);
  1525. var defined = __webpack_require__(36);
  1526. var fails = __webpack_require__(7);
  1527. var spaces = __webpack_require__(84);
  1528. var space = '[' + spaces + ']';
  1529. var non = '\u200b\u0085';
  1530. var ltrim = RegExp('^' + space + space + '*');
  1531. var rtrim = RegExp(space + space + '*$');
  1532. var exporter = function (KEY, exec, ALIAS) {
  1533. var exp = {};
  1534. var FORCE = fails(function () {
  1535. return !!spaces[KEY]() || non[KEY]() != non;
  1536. });
  1537. var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY];
  1538. if (ALIAS) exp[ALIAS] = fn;
  1539. $export($export.P + $export.F * FORCE, 'String', exp);
  1540. };
  1541. // 1 -> String#trimLeft
  1542. // 2 -> String#trimRight
  1543. // 3 -> String#trim
  1544. var trim = exporter.trim = function (string, TYPE) {
  1545. string = String(defined(string));
  1546. if (TYPE & 1) string = string.replace(ltrim, '');
  1547. if (TYPE & 2) string = string.replace(rtrim, '');
  1548. return string;
  1549. };
  1550. module.exports = exporter;
  1551. /***/ }),
  1552. /* 84 */
  1553. /***/ (function(module, exports) {
  1554. module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' +
  1555. '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  1556. /***/ }),
  1557. /* 85 */
  1558. /***/ (function(module, exports, __webpack_require__) {
  1559. var $export = __webpack_require__(8);
  1560. var $parseFloat = __webpack_require__(86);
  1561. // 18.2.4 parseFloat(string)
  1562. $export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat });
  1563. /***/ }),
  1564. /* 86 */
  1565. /***/ (function(module, exports, __webpack_require__) {
  1566. var $parseFloat = __webpack_require__(4).parseFloat;
  1567. var $trim = __webpack_require__(83).trim;
  1568. module.exports = 1 / $parseFloat(__webpack_require__(84) + '-0') !== -Infinity ? function parseFloat(str) {
  1569. var string = $trim(String(str), 3);
  1570. var result = $parseFloat(string);
  1571. return result === 0 && string.charAt(0) == '-' ? -0 : result;
  1572. } : $parseFloat;
  1573. /***/ }),
  1574. /* 87 */
  1575. /***/ (function(module, exports, __webpack_require__) {
  1576. 'use strict';
  1577. var global = __webpack_require__(4);
  1578. var has = __webpack_require__(5);
  1579. var cof = __webpack_require__(35);
  1580. var inheritIfRequired = __webpack_require__(88);
  1581. var toPrimitive = __webpack_require__(16);
  1582. var fails = __webpack_require__(7);
  1583. var gOPN = __webpack_require__(51).f;
  1584. var gOPD = __webpack_require__(52).f;
  1585. var dP = __webpack_require__(11).f;
  1586. var $trim = __webpack_require__(83).trim;
  1587. var NUMBER = 'Number';
  1588. var $Number = global[NUMBER];
  1589. var Base = $Number;
  1590. var proto = $Number.prototype;
  1591. // Opera ~12 has broken Object#toString
  1592. var BROKEN_COF = cof(__webpack_require__(47)(proto)) == NUMBER;
  1593. var TRIM = 'trim' in String.prototype;
  1594. // 7.1.3 ToNumber(argument)
  1595. var toNumber = function (argument) {
  1596. var it = toPrimitive(argument, false);
  1597. if (typeof it == 'string' && it.length > 2) {
  1598. it = TRIM ? it.trim() : $trim(it, 3);
  1599. var first = it.charCodeAt(0);
  1600. var third, radix, maxCode;
  1601. if (first === 43 || first === 45) {
  1602. third = it.charCodeAt(2);
  1603. if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
  1604. } else if (first === 48) {
  1605. switch (it.charCodeAt(1)) {
  1606. case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i
  1607. case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i
  1608. default: return +it;
  1609. }
  1610. for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) {
  1611. code = digits.charCodeAt(i);
  1612. // parseInt parses a string to a first unavailable symbol
  1613. // but ToNumber should return NaN if a string contains unavailable symbols
  1614. if (code < 48 || code > maxCode) return NaN;
  1615. } return parseInt(digits, radix);
  1616. }
  1617. } return +it;
  1618. };
  1619. if (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) {
  1620. $Number = function Number(value) {
  1621. var it = arguments.length < 1 ? 0 : value;
  1622. var that = this;
  1623. return that instanceof $Number
  1624. // check on 1..constructor(foo) case
  1625. && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER)
  1626. ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it);
  1627. };
  1628. for (var keys = __webpack_require__(6) ? gOPN(Base) : (
  1629. // ES3:
  1630. 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
  1631. // ES6 (in case, if modules with ES6 Number statics required before):
  1632. 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +
  1633. 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'
  1634. ).split(','), j = 0, key; keys.length > j; j++) {
  1635. if (has(Base, key = keys[j]) && !has($Number, key)) {
  1636. dP($Number, key, gOPD(Base, key));
  1637. }
  1638. }
  1639. $Number.prototype = proto;
  1640. proto.constructor = $Number;
  1641. __webpack_require__(18)(global, NUMBER, $Number);
  1642. }
  1643. /***/ }),
  1644. /* 88 */
  1645. /***/ (function(module, exports, __webpack_require__) {
  1646. var isObject = __webpack_require__(13);
  1647. var setPrototypeOf = __webpack_require__(73).set;
  1648. module.exports = function (that, target, C) {
  1649. var S = target.constructor;
  1650. var P;
  1651. if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) {
  1652. setPrototypeOf(that, P);
  1653. } return that;
  1654. };
  1655. /***/ }),
  1656. /* 89 */
  1657. /***/ (function(module, exports, __webpack_require__) {
  1658. 'use strict';
  1659. var $export = __webpack_require__(8);
  1660. var toInteger = __webpack_require__(39);
  1661. var aNumberValue = __webpack_require__(90);
  1662. var repeat = __webpack_require__(91);
  1663. var $toFixed = 1.0.toFixed;
  1664. var floor = Math.floor;
  1665. var data = [0, 0, 0, 0, 0, 0];
  1666. var ERROR = 'Number.toFixed: incorrect invocation!';
  1667. var ZERO = '0';
  1668. var multiply = function (n, c) {
  1669. var i = -1;
  1670. var c2 = c;
  1671. while (++i < 6) {
  1672. c2 += n * data[i];
  1673. data[i] = c2 % 1e7;
  1674. c2 = floor(c2 / 1e7);
  1675. }
  1676. };
  1677. var divide = function (n) {
  1678. var i = 6;
  1679. var c = 0;
  1680. while (--i >= 0) {
  1681. c += data[i];
  1682. data[i] = floor(c / n);
  1683. c = (c % n) * 1e7;
  1684. }
  1685. };
  1686. var numToString = function () {
  1687. var i = 6;
  1688. var s = '';
  1689. while (--i >= 0) {
  1690. if (s !== '' || i === 0 || data[i] !== 0) {
  1691. var t = String(data[i]);
  1692. s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t;
  1693. }
  1694. } return s;
  1695. };
  1696. var pow = function (x, n, acc) {
  1697. return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);
  1698. };
  1699. var log = function (x) {
  1700. var n = 0;
  1701. var x2 = x;
  1702. while (x2 >= 4096) {
  1703. n += 12;
  1704. x2 /= 4096;
  1705. }
  1706. while (x2 >= 2) {
  1707. n += 1;
  1708. x2 /= 2;
  1709. } return n;
  1710. };
  1711. $export($export.P + $export.F * (!!$toFixed && (
  1712. 0.00008.toFixed(3) !== '0.000' ||
  1713. 0.9.toFixed(0) !== '1' ||
  1714. 1.255.toFixed(2) !== '1.25' ||
  1715. 1000000000000000128.0.toFixed(0) !== '1000000000000000128'
  1716. ) || !__webpack_require__(7)(function () {
  1717. // V8 ~ Android 4.3-
  1718. $toFixed.call({});
  1719. })), 'Number', {
  1720. toFixed: function toFixed(fractionDigits) {
  1721. var x = aNumberValue(this, ERROR);
  1722. var f = toInteger(fractionDigits);
  1723. var s = '';
  1724. var m = ZERO;
  1725. var e, z, j, k;
  1726. if (f < 0 || f > 20) throw RangeError(ERROR);
  1727. // eslint-disable-next-line no-self-compare
  1728. if (x != x) return 'NaN';
  1729. if (x <= -1e21 || x >= 1e21) return String(x);
  1730. if (x < 0) {
  1731. s = '-';
  1732. x = -x;
  1733. }
  1734. if (x > 1e-21) {
  1735. e = log(x * pow(2, 69, 1)) - 69;
  1736. z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1);
  1737. z *= 0x10000000000000;
  1738. e = 52 - e;
  1739. if (e > 0) {
  1740. multiply(0, z);
  1741. j = f;
  1742. while (j >= 7) {
  1743. multiply(1e7, 0);
  1744. j -= 7;
  1745. }
  1746. multiply(pow(10, j, 1), 0);
  1747. j = e - 1;
  1748. while (j >= 23) {
  1749. divide(1 << 23);
  1750. j -= 23;
  1751. }
  1752. divide(1 << j);
  1753. multiply(1, 1);
  1754. divide(2);
  1755. m = numToString();
  1756. } else {
  1757. multiply(0, z);
  1758. multiply(1 << -e, 0);
  1759. m = numToString() + repeat.call(ZERO, f);
  1760. }
  1761. }
  1762. if (f > 0) {
  1763. k = m.length;
  1764. m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f));
  1765. } else {
  1766. m = s + m;
  1767. } return m;
  1768. }
  1769. });
  1770. /***/ }),
  1771. /* 90 */
  1772. /***/ (function(module, exports, __webpack_require__) {
  1773. var cof = __webpack_require__(35);
  1774. module.exports = function (it, msg) {
  1775. if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg);
  1776. return +it;
  1777. };
  1778. /***/ }),
  1779. /* 91 */
  1780. /***/ (function(module, exports, __webpack_require__) {
  1781. 'use strict';
  1782. var toInteger = __webpack_require__(39);
  1783. var defined = __webpack_require__(36);
  1784. module.exports = function repeat(count) {
  1785. var str = String(defined(this));
  1786. var res = '';
  1787. var n = toInteger(count);
  1788. if (n < 0 || n == Infinity) throw RangeError("Count can't be negative");
  1789. for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str;
  1790. return res;
  1791. };
  1792. /***/ }),
  1793. /* 92 */
  1794. /***/ (function(module, exports, __webpack_require__) {
  1795. 'use strict';
  1796. var $export = __webpack_require__(8);
  1797. var $fails = __webpack_require__(7);
  1798. var aNumberValue = __webpack_require__(90);
  1799. var $toPrecision = 1.0.toPrecision;
  1800. $export($export.P + $export.F * ($fails(function () {
  1801. // IE7-
  1802. return $toPrecision.call(1, undefined) !== '1';
  1803. }) || !$fails(function () {
  1804. // V8 ~ Android 4.3-
  1805. $toPrecision.call({});
  1806. })), 'Number', {
  1807. toPrecision: function toPrecision(precision) {
  1808. var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!');
  1809. return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision);
  1810. }
  1811. });
  1812. /***/ }),
  1813. /* 93 */
  1814. /***/ (function(module, exports, __webpack_require__) {
  1815. // 20.1.2.1 Number.EPSILON
  1816. var $export = __webpack_require__(8);
  1817. $export($export.S, 'Number', { EPSILON: Math.pow(2, -52) });
  1818. /***/ }),
  1819. /* 94 */
  1820. /***/ (function(module, exports, __webpack_require__) {
  1821. // 20.1.2.2 Number.isFinite(number)
  1822. var $export = __webpack_require__(8);
  1823. var _isFinite = __webpack_require__(4).isFinite;
  1824. $export($export.S, 'Number', {
  1825. isFinite: function isFinite(it) {
  1826. return typeof it == 'number' && _isFinite(it);
  1827. }
  1828. });
  1829. /***/ }),
  1830. /* 95 */
  1831. /***/ (function(module, exports, __webpack_require__) {
  1832. // 20.1.2.3 Number.isInteger(number)
  1833. var $export = __webpack_require__(8);
  1834. $export($export.S, 'Number', { isInteger: __webpack_require__(96) });
  1835. /***/ }),
  1836. /* 96 */
  1837. /***/ (function(module, exports, __webpack_require__) {
  1838. // 20.1.2.3 Number.isInteger(number)
  1839. var isObject = __webpack_require__(13);
  1840. var floor = Math.floor;
  1841. module.exports = function isInteger(it) {
  1842. return !isObject(it) && isFinite(it) && floor(it) === it;
  1843. };
  1844. /***/ }),
  1845. /* 97 */
  1846. /***/ (function(module, exports, __webpack_require__) {
  1847. // 20.1.2.4 Number.isNaN(number)
  1848. var $export = __webpack_require__(8);
  1849. $export($export.S, 'Number', {
  1850. isNaN: function isNaN(number) {
  1851. // eslint-disable-next-line no-self-compare
  1852. return number != number;
  1853. }
  1854. });
  1855. /***/ }),
  1856. /* 98 */
  1857. /***/ (function(module, exports, __webpack_require__) {
  1858. // 20.1.2.5 Number.isSafeInteger(number)
  1859. var $export = __webpack_require__(8);
  1860. var isInteger = __webpack_require__(96);
  1861. var abs = Math.abs;
  1862. $export($export.S, 'Number', {
  1863. isSafeInteger: function isSafeInteger(number) {
  1864. return isInteger(number) && abs(number) <= 0x1fffffffffffff;
  1865. }
  1866. });
  1867. /***/ }),
  1868. /* 99 */
  1869. /***/ (function(module, exports, __webpack_require__) {
  1870. // 20.1.2.6 Number.MAX_SAFE_INTEGER
  1871. var $export = __webpack_require__(8);
  1872. $export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff });
  1873. /***/ }),
  1874. /* 100 */
  1875. /***/ (function(module, exports, __webpack_require__) {
  1876. // 20.1.2.10 Number.MIN_SAFE_INTEGER
  1877. var $export = __webpack_require__(8);
  1878. $export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff });
  1879. /***/ }),
  1880. /* 101 */
  1881. /***/ (function(module, exports, __webpack_require__) {
  1882. var $export = __webpack_require__(8);
  1883. var $parseFloat = __webpack_require__(86);
  1884. // 20.1.2.12 Number.parseFloat(string)
  1885. $export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat });
  1886. /***/ }),
  1887. /* 102 */
  1888. /***/ (function(module, exports, __webpack_require__) {
  1889. var $export = __webpack_require__(8);
  1890. var $parseInt = __webpack_require__(82);
  1891. // 20.1.2.13 Number.parseInt(string, radix)
  1892. $export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt });
  1893. /***/ }),
  1894. /* 103 */
  1895. /***/ (function(module, exports, __webpack_require__) {
  1896. // 20.2.2.3 Math.acosh(x)
  1897. var $export = __webpack_require__(8);
  1898. var log1p = __webpack_require__(104);
  1899. var sqrt = Math.sqrt;
  1900. var $acosh = Math.acosh;
  1901. $export($export.S + $export.F * !($acosh
  1902. // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509
  1903. && Math.floor($acosh(Number.MAX_VALUE)) == 710
  1904. // Tor Browser bug: Math.acosh(Infinity) -> NaN
  1905. && $acosh(Infinity) == Infinity
  1906. ), 'Math', {
  1907. acosh: function acosh(x) {
  1908. return (x = +x) < 1 ? NaN : x > 94906265.62425156
  1909. ? Math.log(x) + Math.LN2
  1910. : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1));
  1911. }
  1912. });
  1913. /***/ }),
  1914. /* 104 */
  1915. /***/ (function(module, exports) {
  1916. // 20.2.2.20 Math.log1p(x)
  1917. module.exports = Math.log1p || function log1p(x) {
  1918. return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x);
  1919. };
  1920. /***/ }),
  1921. /* 105 */
  1922. /***/ (function(module, exports, __webpack_require__) {
  1923. // 20.2.2.5 Math.asinh(x)
  1924. var $export = __webpack_require__(8);
  1925. var $asinh = Math.asinh;
  1926. function asinh(x) {
  1927. return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1));
  1928. }
  1929. // Tor Browser bug: Math.asinh(0) -> -0
  1930. $export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh });
  1931. /***/ }),
  1932. /* 106 */
  1933. /***/ (function(module, exports, __webpack_require__) {
  1934. // 20.2.2.7 Math.atanh(x)
  1935. var $export = __webpack_require__(8);
  1936. var $atanh = Math.atanh;
  1937. // Tor Browser bug: Math.atanh(-0) -> 0
  1938. $export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', {
  1939. atanh: function atanh(x) {
  1940. return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2;
  1941. }
  1942. });
  1943. /***/ }),
  1944. /* 107 */
  1945. /***/ (function(module, exports, __webpack_require__) {
  1946. // 20.2.2.9 Math.cbrt(x)
  1947. var $export = __webpack_require__(8);
  1948. var sign = __webpack_require__(108);
  1949. $export($export.S, 'Math', {
  1950. cbrt: function cbrt(x) {
  1951. return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3);
  1952. }
  1953. });
  1954. /***/ }),
  1955. /* 108 */
  1956. /***/ (function(module, exports) {
  1957. // 20.2.2.28 Math.sign(x)
  1958. module.exports = Math.sign || function sign(x) {
  1959. // eslint-disable-next-line no-self-compare
  1960. return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;
  1961. };
  1962. /***/ }),
  1963. /* 109 */
  1964. /***/ (function(module, exports, __webpack_require__) {
  1965. // 20.2.2.11 Math.clz32(x)
  1966. var $export = __webpack_require__(8);
  1967. $export($export.S, 'Math', {
  1968. clz32: function clz32(x) {
  1969. return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32;
  1970. }
  1971. });
  1972. /***/ }),
  1973. /* 110 */
  1974. /***/ (function(module, exports, __webpack_require__) {
  1975. // 20.2.2.12 Math.cosh(x)
  1976. var $export = __webpack_require__(8);
  1977. var exp = Math.exp;
  1978. $export($export.S, 'Math', {
  1979. cosh: function cosh(x) {
  1980. return (exp(x = +x) + exp(-x)) / 2;
  1981. }
  1982. });
  1983. /***/ }),
  1984. /* 111 */
  1985. /***/ (function(module, exports, __webpack_require__) {
  1986. // 20.2.2.14 Math.expm1(x)
  1987. var $export = __webpack_require__(8);
  1988. var $expm1 = __webpack_require__(112);
  1989. $export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 });
  1990. /***/ }),
  1991. /* 112 */
  1992. /***/ (function(module, exports) {
  1993. // 20.2.2.14 Math.expm1(x)
  1994. var $expm1 = Math.expm1;
  1995. module.exports = (!$expm1
  1996. // Old FF bug
  1997. || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168
  1998. // Tor Browser bug
  1999. || $expm1(-2e-17) != -2e-17
  2000. ) ? function expm1(x) {
  2001. return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1;
  2002. } : $expm1;
  2003. /***/ }),
  2004. /* 113 */
  2005. /***/ (function(module, exports, __webpack_require__) {
  2006. // 20.2.2.16 Math.fround(x)
  2007. var $export = __webpack_require__(8);
  2008. $export($export.S, 'Math', { fround: __webpack_require__(114) });
  2009. /***/ }),
  2010. /* 114 */
  2011. /***/ (function(module, exports, __webpack_require__) {
  2012. // 20.2.2.16 Math.fround(x)
  2013. var sign = __webpack_require__(108);
  2014. var pow = Math.pow;
  2015. var EPSILON = pow(2, -52);
  2016. var EPSILON32 = pow(2, -23);
  2017. var MAX32 = pow(2, 127) * (2 - EPSILON32);
  2018. var MIN32 = pow(2, -126);
  2019. var roundTiesToEven = function (n) {
  2020. return n + 1 / EPSILON - 1 / EPSILON;
  2021. };
  2022. module.exports = Math.fround || function fround(x) {
  2023. var $abs = Math.abs(x);
  2024. var $sign = sign(x);
  2025. var a, result;
  2026. if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;
  2027. a = (1 + EPSILON32 / EPSILON) * $abs;
  2028. result = a - (a - $abs);
  2029. // eslint-disable-next-line no-self-compare
  2030. if (result > MAX32 || result != result) return $sign * Infinity;
  2031. return $sign * result;
  2032. };
  2033. /***/ }),
  2034. /* 115 */
  2035. /***/ (function(module, exports, __webpack_require__) {
  2036. // 20.2.2.17 Math.hypot([value1[, value2[, … ]]])
  2037. var $export = __webpack_require__(8);
  2038. var abs = Math.abs;
  2039. $export($export.S, 'Math', {
  2040. hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars
  2041. var sum = 0;
  2042. var i = 0;
  2043. var aLen = arguments.length;
  2044. var larg = 0;
  2045. var arg, div;
  2046. while (i < aLen) {
  2047. arg = abs(arguments[i++]);
  2048. if (larg < arg) {
  2049. div = larg / arg;
  2050. sum = sum * div * div + 1;
  2051. larg = arg;
  2052. } else if (arg > 0) {
  2053. div = arg / larg;
  2054. sum += div * div;
  2055. } else sum += arg;
  2056. }
  2057. return larg === Infinity ? Infinity : larg * Math.sqrt(sum);
  2058. }
  2059. });
  2060. /***/ }),
  2061. /* 116 */
  2062. /***/ (function(module, exports, __webpack_require__) {
  2063. // 20.2.2.18 Math.imul(x, y)
  2064. var $export = __webpack_require__(8);
  2065. var $imul = Math.imul;
  2066. // some WebKit versions fails with big numbers, some has wrong arity
  2067. $export($export.S + $export.F * __webpack_require__(7)(function () {
  2068. return $imul(0xffffffff, 5) != -5 || $imul.length != 2;
  2069. }), 'Math', {
  2070. imul: function imul(x, y) {
  2071. var UINT16 = 0xffff;
  2072. var xn = +x;
  2073. var yn = +y;
  2074. var xl = UINT16 & xn;
  2075. var yl = UINT16 & yn;
  2076. return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0);
  2077. }
  2078. });
  2079. /***/ }),
  2080. /* 117 */
  2081. /***/ (function(module, exports, __webpack_require__) {
  2082. // 20.2.2.21 Math.log10(x)
  2083. var $export = __webpack_require__(8);
  2084. $export($export.S, 'Math', {
  2085. log10: function log10(x) {
  2086. return Math.log(x) * Math.LOG10E;
  2087. }
  2088. });
  2089. /***/ }),
  2090. /* 118 */
  2091. /***/ (function(module, exports, __webpack_require__) {
  2092. // 20.2.2.20 Math.log1p(x)
  2093. var $export = __webpack_require__(8);
  2094. $export($export.S, 'Math', { log1p: __webpack_require__(104) });
  2095. /***/ }),
  2096. /* 119 */
  2097. /***/ (function(module, exports, __webpack_require__) {
  2098. // 20.2.2.22 Math.log2(x)
  2099. var $export = __webpack_require__(8);
  2100. $export($export.S, 'Math', {
  2101. log2: function log2(x) {
  2102. return Math.log(x) / Math.LN2;
  2103. }
  2104. });
  2105. /***/ }),
  2106. /* 120 */
  2107. /***/ (function(module, exports, __webpack_require__) {
  2108. // 20.2.2.28 Math.sign(x)
  2109. var $export = __webpack_require__(8);
  2110. $export($export.S, 'Math', { sign: __webpack_require__(108) });
  2111. /***/ }),
  2112. /* 121 */
  2113. /***/ (function(module, exports, __webpack_require__) {
  2114. // 20.2.2.30 Math.sinh(x)
  2115. var $export = __webpack_require__(8);
  2116. var expm1 = __webpack_require__(112);
  2117. var exp = Math.exp;
  2118. // V8 near Chromium 38 has a problem with very small numbers
  2119. $export($export.S + $export.F * __webpack_require__(7)(function () {
  2120. return !Math.sinh(-2e-17) != -2e-17;
  2121. }), 'Math', {
  2122. sinh: function sinh(x) {
  2123. return Math.abs(x = +x) < 1
  2124. ? (expm1(x) - expm1(-x)) / 2
  2125. : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2);
  2126. }
  2127. });
  2128. /***/ }),
  2129. /* 122 */
  2130. /***/ (function(module, exports, __webpack_require__) {
  2131. // 20.2.2.33 Math.tanh(x)
  2132. var $export = __webpack_require__(8);
  2133. var expm1 = __webpack_require__(112);
  2134. var exp = Math.exp;
  2135. $export($export.S, 'Math', {
  2136. tanh: function tanh(x) {
  2137. var a = expm1(x = +x);
  2138. var b = expm1(-x);
  2139. return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x));
  2140. }
  2141. });
  2142. /***/ }),
  2143. /* 123 */
  2144. /***/ (function(module, exports, __webpack_require__) {
  2145. // 20.2.2.34 Math.trunc(x)
  2146. var $export = __webpack_require__(8);
  2147. $export($export.S, 'Math', {
  2148. trunc: function trunc(it) {
  2149. return (it > 0 ? Math.floor : Math.ceil)(it);
  2150. }
  2151. });
  2152. /***/ }),
  2153. /* 124 */
  2154. /***/ (function(module, exports, __webpack_require__) {
  2155. var $export = __webpack_require__(8);
  2156. var toAbsoluteIndex = __webpack_require__(40);
  2157. var fromCharCode = String.fromCharCode;
  2158. var $fromCodePoint = String.fromCodePoint;
  2159. // length should be 1, old FF problem
  2160. $export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {
  2161. // 21.1.2.2 String.fromCodePoint(...codePoints)
  2162. fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars
  2163. var res = [];
  2164. var aLen = arguments.length;
  2165. var i = 0;
  2166. var code;
  2167. while (aLen > i) {
  2168. code = +arguments[i++];
  2169. if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point');
  2170. res.push(code < 0x10000
  2171. ? fromCharCode(code)
  2172. : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)
  2173. );
  2174. } return res.join('');
  2175. }
  2176. });
  2177. /***/ }),
  2178. /* 125 */
  2179. /***/ (function(module, exports, __webpack_require__) {
  2180. var $export = __webpack_require__(8);
  2181. var toIObject = __webpack_require__(33);
  2182. var toLength = __webpack_require__(38);
  2183. $export($export.S, 'String', {
  2184. // 21.1.2.4 String.raw(callSite, ...substitutions)
  2185. raw: function raw(callSite) {
  2186. var tpl = toIObject(callSite.raw);
  2187. var len = toLength(tpl.length);
  2188. var aLen = arguments.length;
  2189. var res = [];
  2190. var i = 0;
  2191. while (len > i) {
  2192. res.push(String(tpl[i++]));
  2193. if (i < aLen) res.push(String(arguments[i]));
  2194. } return res.join('');
  2195. }
  2196. });
  2197. /***/ }),
  2198. /* 126 */
  2199. /***/ (function(module, exports, __webpack_require__) {
  2200. 'use strict';
  2201. // 21.1.3.25 String.prototype.trim()
  2202. __webpack_require__(83)('trim', function ($trim) {
  2203. return function trim() {
  2204. return $trim(this, 3);
  2205. };
  2206. });
  2207. /***/ }),
  2208. /* 127 */
  2209. /***/ (function(module, exports, __webpack_require__) {
  2210. 'use strict';
  2211. var $at = __webpack_require__(128)(true);
  2212. // 21.1.3.27 String.prototype[@@iterator]()
  2213. __webpack_require__(129)(String, 'String', function (iterated) {
  2214. this._t = String(iterated); // target
  2215. this._i = 0; // next index
  2216. // 21.1.5.2.1 %StringIteratorPrototype%.next()
  2217. }, function () {
  2218. var O = this._t;
  2219. var index = this._i;
  2220. var point;
  2221. if (index >= O.length) return { value: undefined, done: true };
  2222. point = $at(O, index);
  2223. this._i += point.length;
  2224. return { value: point, done: false };
  2225. });
  2226. /***/ }),
  2227. /* 128 */
  2228. /***/ (function(module, exports, __webpack_require__) {
  2229. var toInteger = __webpack_require__(39);
  2230. var defined = __webpack_require__(36);
  2231. // true -> String#at
  2232. // false -> String#codePointAt
  2233. module.exports = function (TO_STRING) {
  2234. return function (that, pos) {
  2235. var s = String(defined(that));
  2236. var i = toInteger(pos);
  2237. var l = s.length;
  2238. var a, b;
  2239. if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
  2240. a = s.charCodeAt(i);
  2241. return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
  2242. ? TO_STRING ? s.charAt(i) : a
  2243. : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
  2244. };
  2245. };
  2246. /***/ }),
  2247. /* 129 */
  2248. /***/ (function(module, exports, __webpack_require__) {
  2249. 'use strict';
  2250. var LIBRARY = __webpack_require__(22);
  2251. var $export = __webpack_require__(8);
  2252. var redefine = __webpack_require__(18);
  2253. var hide = __webpack_require__(10);
  2254. var Iterators = __webpack_require__(130);
  2255. var $iterCreate = __webpack_require__(131);
  2256. var setToStringTag = __webpack_require__(26);
  2257. var getPrototypeOf = __webpack_require__(59);
  2258. var ITERATOR = __webpack_require__(27)('iterator');
  2259. var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
  2260. var FF_ITERATOR = '@@iterator';
  2261. var KEYS = 'keys';
  2262. var VALUES = 'values';
  2263. var returnThis = function () { return this; };
  2264. module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
  2265. $iterCreate(Constructor, NAME, next);
  2266. var getMethod = function (kind) {
  2267. if (!BUGGY && kind in proto) return proto[kind];
  2268. switch (kind) {
  2269. case KEYS: return function keys() { return new Constructor(this, kind); };
  2270. case VALUES: return function values() { return new Constructor(this, kind); };
  2271. } return function entries() { return new Constructor(this, kind); };
  2272. };
  2273. var TAG = NAME + ' Iterator';
  2274. var DEF_VALUES = DEFAULT == VALUES;
  2275. var VALUES_BUG = false;
  2276. var proto = Base.prototype;
  2277. var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
  2278. var $default = $native || getMethod(DEFAULT);
  2279. var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
  2280. var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
  2281. var methods, key, IteratorPrototype;
  2282. // Fix native
  2283. if ($anyNative) {
  2284. IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
  2285. if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
  2286. // Set @@toStringTag to native iterators
  2287. setToStringTag(IteratorPrototype, TAG, true);
  2288. // fix for some old engines
  2289. if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
  2290. }
  2291. }
  2292. // fix Array#{values, @@iterator}.name in V8 / FF
  2293. if (DEF_VALUES && $native && $native.name !== VALUES) {
  2294. VALUES_BUG = true;
  2295. $default = function values() { return $native.call(this); };
  2296. }
  2297. // Define iterator
  2298. if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
  2299. hide(proto, ITERATOR, $default);
  2300. }
  2301. // Plug for library
  2302. Iterators[NAME] = $default;
  2303. Iterators[TAG] = returnThis;
  2304. if (DEFAULT) {
  2305. methods = {
  2306. values: DEF_VALUES ? $default : getMethod(VALUES),
  2307. keys: IS_SET ? $default : getMethod(KEYS),
  2308. entries: $entries
  2309. };
  2310. if (FORCED) for (key in methods) {
  2311. if (!(key in proto)) redefine(proto, key, methods[key]);
  2312. } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
  2313. }
  2314. return methods;
  2315. };
  2316. /***/ }),
  2317. /* 130 */
  2318. /***/ (function(module, exports) {
  2319. module.exports = {};
  2320. /***/ }),
  2321. /* 131 */
  2322. /***/ (function(module, exports, __webpack_require__) {
  2323. 'use strict';
  2324. var create = __webpack_require__(47);
  2325. var descriptor = __webpack_require__(17);
  2326. var setToStringTag = __webpack_require__(26);
  2327. var IteratorPrototype = {};
  2328. // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
  2329. __webpack_require__(10)(IteratorPrototype, __webpack_require__(27)('iterator'), function () { return this; });
  2330. module.exports = function (Constructor, NAME, next) {
  2331. Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
  2332. setToStringTag(Constructor, NAME + ' Iterator');
  2333. };
  2334. /***/ }),
  2335. /* 132 */
  2336. /***/ (function(module, exports, __webpack_require__) {
  2337. 'use strict';
  2338. var $export = __webpack_require__(8);
  2339. var $at = __webpack_require__(128)(false);
  2340. $export($export.P, 'String', {
  2341. // 21.1.3.3 String.prototype.codePointAt(pos)
  2342. codePointAt: function codePointAt(pos) {
  2343. return $at(this, pos);
  2344. }
  2345. });
  2346. /***/ }),
  2347. /* 133 */
  2348. /***/ (function(module, exports, __webpack_require__) {
  2349. // 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])
  2350. 'use strict';
  2351. var $export = __webpack_require__(8);
  2352. var toLength = __webpack_require__(38);
  2353. var context = __webpack_require__(134);
  2354. var ENDS_WITH = 'endsWith';
  2355. var $endsWith = ''[ENDS_WITH];
  2356. $export($export.P + $export.F * __webpack_require__(136)(ENDS_WITH), 'String', {
  2357. endsWith: function endsWith(searchString /* , endPosition = @length */) {
  2358. var that = context(this, searchString, ENDS_WITH);
  2359. var endPosition = arguments.length > 1 ? arguments[1] : undefined;
  2360. var len = toLength(that.length);
  2361. var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len);
  2362. var search = String(searchString);
  2363. return $endsWith
  2364. ? $endsWith.call(that, search, end)
  2365. : that.slice(end - search.length, end) === search;
  2366. }
  2367. });
  2368. /***/ }),
  2369. /* 134 */
  2370. /***/ (function(module, exports, __webpack_require__) {
  2371. // helper for String#{startsWith, endsWith, includes}
  2372. var isRegExp = __webpack_require__(135);
  2373. var defined = __webpack_require__(36);
  2374. module.exports = function (that, searchString, NAME) {
  2375. if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!");
  2376. return String(defined(that));
  2377. };
  2378. /***/ }),
  2379. /* 135 */
  2380. /***/ (function(module, exports, __webpack_require__) {
  2381. // 7.2.8 IsRegExp(argument)
  2382. var isObject = __webpack_require__(13);
  2383. var cof = __webpack_require__(35);
  2384. var MATCH = __webpack_require__(27)('match');
  2385. module.exports = function (it) {
  2386. var isRegExp;
  2387. return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');
  2388. };
  2389. /***/ }),
  2390. /* 136 */
  2391. /***/ (function(module, exports, __webpack_require__) {
  2392. var MATCH = __webpack_require__(27)('match');
  2393. module.exports = function (KEY) {
  2394. var re = /./;
  2395. try {
  2396. '/./'[KEY](re);
  2397. } catch (e) {
  2398. try {
  2399. re[MATCH] = false;
  2400. return !'/./'[KEY](re);
  2401. } catch (f) { /* empty */ }
  2402. } return true;
  2403. };
  2404. /***/ }),
  2405. /* 137 */
  2406. /***/ (function(module, exports, __webpack_require__) {
  2407. // 21.1.3.7 String.prototype.includes(searchString, position = 0)
  2408. 'use strict';
  2409. var $export = __webpack_require__(8);
  2410. var context = __webpack_require__(134);
  2411. var INCLUDES = 'includes';
  2412. $export($export.P + $export.F * __webpack_require__(136)(INCLUDES), 'String', {
  2413. includes: function includes(searchString /* , position = 0 */) {
  2414. return !!~context(this, searchString, INCLUDES)
  2415. .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);
  2416. }
  2417. });
  2418. /***/ }),
  2419. /* 138 */
  2420. /***/ (function(module, exports, __webpack_require__) {
  2421. var $export = __webpack_require__(8);
  2422. $export($export.P, 'String', {
  2423. // 21.1.3.13 String.prototype.repeat(count)
  2424. repeat: __webpack_require__(91)
  2425. });
  2426. /***/ }),
  2427. /* 139 */
  2428. /***/ (function(module, exports, __webpack_require__) {
  2429. // 21.1.3.18 String.prototype.startsWith(searchString [, position ])
  2430. 'use strict';
  2431. var $export = __webpack_require__(8);
  2432. var toLength = __webpack_require__(38);
  2433. var context = __webpack_require__(134);
  2434. var STARTS_WITH = 'startsWith';
  2435. var $startsWith = ''[STARTS_WITH];
  2436. $export($export.P + $export.F * __webpack_require__(136)(STARTS_WITH), 'String', {
  2437. startsWith: function startsWith(searchString /* , position = 0 */) {
  2438. var that = context(this, searchString, STARTS_WITH);
  2439. var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length));
  2440. var search = String(searchString);
  2441. return $startsWith
  2442. ? $startsWith.call(that, search, index)
  2443. : that.slice(index, index + search.length) === search;
  2444. }
  2445. });
  2446. /***/ }),
  2447. /* 140 */
  2448. /***/ (function(module, exports, __webpack_require__) {
  2449. 'use strict';
  2450. // B.2.3.2 String.prototype.anchor(name)
  2451. __webpack_require__(141)('anchor', function (createHTML) {
  2452. return function anchor(name) {
  2453. return createHTML(this, 'a', 'name', name);
  2454. };
  2455. });
  2456. /***/ }),
  2457. /* 141 */
  2458. /***/ (function(module, exports, __webpack_require__) {
  2459. var $export = __webpack_require__(8);
  2460. var fails = __webpack_require__(7);
  2461. var defined = __webpack_require__(36);
  2462. var quot = /"/g;
  2463. // B.2.3.2.1 CreateHTML(string, tag, attribute, value)
  2464. var createHTML = function (string, tag, attribute, value) {
  2465. var S = String(defined(string));
  2466. var p1 = '<' + tag;
  2467. if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '&quot;') + '"';
  2468. return p1 + '>' + S + '</' + tag + '>';
  2469. };
  2470. module.exports = function (NAME, exec) {
  2471. var O = {};
  2472. O[NAME] = exec(createHTML);
  2473. $export($export.P + $export.F * fails(function () {
  2474. var test = ''[NAME]('"');
  2475. return test !== test.toLowerCase() || test.split('"').length > 3;
  2476. }), 'String', O);
  2477. };
  2478. /***/ }),
  2479. /* 142 */
  2480. /***/ (function(module, exports, __webpack_require__) {
  2481. 'use strict';
  2482. // B.2.3.3 String.prototype.big()
  2483. __webpack_require__(141)('big', function (createHTML) {
  2484. return function big() {
  2485. return createHTML(this, 'big', '', '');
  2486. };
  2487. });
  2488. /***/ }),
  2489. /* 143 */
  2490. /***/ (function(module, exports, __webpack_require__) {
  2491. 'use strict';
  2492. // B.2.3.4 String.prototype.blink()
  2493. __webpack_require__(141)('blink', function (createHTML) {
  2494. return function blink() {
  2495. return createHTML(this, 'blink', '', '');
  2496. };
  2497. });
  2498. /***/ }),
  2499. /* 144 */
  2500. /***/ (function(module, exports, __webpack_require__) {
  2501. 'use strict';
  2502. // B.2.3.5 String.prototype.bold()
  2503. __webpack_require__(141)('bold', function (createHTML) {
  2504. return function bold() {
  2505. return createHTML(this, 'b', '', '');
  2506. };
  2507. });
  2508. /***/ }),
  2509. /* 145 */
  2510. /***/ (function(module, exports, __webpack_require__) {
  2511. 'use strict';
  2512. // B.2.3.6 String.prototype.fixed()
  2513. __webpack_require__(141)('fixed', function (createHTML) {
  2514. return function fixed() {
  2515. return createHTML(this, 'tt', '', '');
  2516. };
  2517. });
  2518. /***/ }),
  2519. /* 146 */
  2520. /***/ (function(module, exports, __webpack_require__) {
  2521. 'use strict';
  2522. // B.2.3.7 String.prototype.fontcolor(color)
  2523. __webpack_require__(141)('fontcolor', function (createHTML) {
  2524. return function fontcolor(color) {
  2525. return createHTML(this, 'font', 'color', color);
  2526. };
  2527. });
  2528. /***/ }),
  2529. /* 147 */
  2530. /***/ (function(module, exports, __webpack_require__) {
  2531. 'use strict';
  2532. // B.2.3.8 String.prototype.fontsize(size)
  2533. __webpack_require__(141)('fontsize', function (createHTML) {
  2534. return function fontsize(size) {
  2535. return createHTML(this, 'font', 'size', size);
  2536. };
  2537. });
  2538. /***/ }),
  2539. /* 148 */
  2540. /***/ (function(module, exports, __webpack_require__) {
  2541. 'use strict';
  2542. // B.2.3.9 String.prototype.italics()
  2543. __webpack_require__(141)('italics', function (createHTML) {
  2544. return function italics() {
  2545. return createHTML(this, 'i', '', '');
  2546. };
  2547. });
  2548. /***/ }),
  2549. /* 149 */
  2550. /***/ (function(module, exports, __webpack_require__) {
  2551. 'use strict';
  2552. // B.2.3.10 String.prototype.link(url)
  2553. __webpack_require__(141)('link', function (createHTML) {
  2554. return function link(url) {
  2555. return createHTML(this, 'a', 'href', url);
  2556. };
  2557. });
  2558. /***/ }),
  2559. /* 150 */
  2560. /***/ (function(module, exports, __webpack_require__) {
  2561. 'use strict';
  2562. // B.2.3.11 String.prototype.small()
  2563. __webpack_require__(141)('small', function (createHTML) {
  2564. return function small() {
  2565. return createHTML(this, 'small', '', '');
  2566. };
  2567. });
  2568. /***/ }),
  2569. /* 151 */
  2570. /***/ (function(module, exports, __webpack_require__) {
  2571. 'use strict';
  2572. // B.2.3.12 String.prototype.strike()
  2573. __webpack_require__(141)('strike', function (createHTML) {
  2574. return function strike() {
  2575. return createHTML(this, 'strike', '', '');
  2576. };
  2577. });
  2578. /***/ }),
  2579. /* 152 */
  2580. /***/ (function(module, exports, __webpack_require__) {
  2581. 'use strict';
  2582. // B.2.3.13 String.prototype.sub()
  2583. __webpack_require__(141)('sub', function (createHTML) {
  2584. return function sub() {
  2585. return createHTML(this, 'sub', '', '');
  2586. };
  2587. });
  2588. /***/ }),
  2589. /* 153 */
  2590. /***/ (function(module, exports, __webpack_require__) {
  2591. 'use strict';
  2592. // B.2.3.14 String.prototype.sup()
  2593. __webpack_require__(141)('sup', function (createHTML) {
  2594. return function sup() {
  2595. return createHTML(this, 'sup', '', '');
  2596. };
  2597. });
  2598. /***/ }),
  2599. /* 154 */
  2600. /***/ (function(module, exports, __webpack_require__) {
  2601. // 20.3.3.1 / 15.9.4.4 Date.now()
  2602. var $export = __webpack_require__(8);
  2603. $export($export.S, 'Date', { now: function () { return new Date().getTime(); } });
  2604. /***/ }),
  2605. /* 155 */
  2606. /***/ (function(module, exports, __webpack_require__) {
  2607. 'use strict';
  2608. var $export = __webpack_require__(8);
  2609. var toObject = __webpack_require__(46);
  2610. var toPrimitive = __webpack_require__(16);
  2611. $export($export.P + $export.F * __webpack_require__(7)(function () {
  2612. return new Date(NaN).toJSON() !== null
  2613. || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1;
  2614. }), 'Date', {
  2615. // eslint-disable-next-line no-unused-vars
  2616. toJSON: function toJSON(key) {
  2617. var O = toObject(this);
  2618. var pv = toPrimitive(O);
  2619. return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();
  2620. }
  2621. });
  2622. /***/ }),
  2623. /* 156 */
  2624. /***/ (function(module, exports, __webpack_require__) {
  2625. // 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()
  2626. var $export = __webpack_require__(8);
  2627. var toISOString = __webpack_require__(157);
  2628. // PhantomJS / old WebKit has a broken implementations
  2629. $export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', {
  2630. toISOString: toISOString
  2631. });
  2632. /***/ }),
  2633. /* 157 */
  2634. /***/ (function(module, exports, __webpack_require__) {
  2635. 'use strict';
  2636. // 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()
  2637. var fails = __webpack_require__(7);
  2638. var getTime = Date.prototype.getTime;
  2639. var $toISOString = Date.prototype.toISOString;
  2640. var lz = function (num) {
  2641. return num > 9 ? num : '0' + num;
  2642. };
  2643. // PhantomJS / old WebKit has a broken implementations
  2644. module.exports = (fails(function () {
  2645. return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z';
  2646. }) || !fails(function () {
  2647. $toISOString.call(new Date(NaN));
  2648. })) ? function toISOString() {
  2649. if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value');
  2650. var d = this;
  2651. var y = d.getUTCFullYear();
  2652. var m = d.getUTCMilliseconds();
  2653. var s = y < 0 ? '-' : y > 9999 ? '+' : '';
  2654. return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) +
  2655. '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) +
  2656. 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) +
  2657. ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z';
  2658. } : $toISOString;
  2659. /***/ }),
  2660. /* 158 */
  2661. /***/ (function(module, exports, __webpack_require__) {
  2662. var DateProto = Date.prototype;
  2663. var INVALID_DATE = 'Invalid Date';
  2664. var TO_STRING = 'toString';
  2665. var $toString = DateProto[TO_STRING];
  2666. var getTime = DateProto.getTime;
  2667. if (new Date(NaN) + '' != INVALID_DATE) {
  2668. __webpack_require__(18)(DateProto, TO_STRING, function toString() {
  2669. var value = getTime.call(this);
  2670. // eslint-disable-next-line no-self-compare
  2671. return value === value ? $toString.call(this) : INVALID_DATE;
  2672. });
  2673. }
  2674. /***/ }),
  2675. /* 159 */
  2676. /***/ (function(module, exports, __webpack_require__) {
  2677. var TO_PRIMITIVE = __webpack_require__(27)('toPrimitive');
  2678. var proto = Date.prototype;
  2679. if (!(TO_PRIMITIVE in proto)) __webpack_require__(10)(proto, TO_PRIMITIVE, __webpack_require__(160));
  2680. /***/ }),
  2681. /* 160 */
  2682. /***/ (function(module, exports, __webpack_require__) {
  2683. 'use strict';
  2684. var anObject = __webpack_require__(12);
  2685. var toPrimitive = __webpack_require__(16);
  2686. var NUMBER = 'number';
  2687. module.exports = function (hint) {
  2688. if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint');
  2689. return toPrimitive(anObject(this), hint != NUMBER);
  2690. };
  2691. /***/ }),
  2692. /* 161 */
  2693. /***/ (function(module, exports, __webpack_require__) {
  2694. // 22.1.2.2 / 15.4.3.2 Array.isArray(arg)
  2695. var $export = __webpack_require__(8);
  2696. $export($export.S, 'Array', { isArray: __webpack_require__(45) });
  2697. /***/ }),
  2698. /* 162 */
  2699. /***/ (function(module, exports, __webpack_require__) {
  2700. 'use strict';
  2701. var ctx = __webpack_require__(23);
  2702. var $export = __webpack_require__(8);
  2703. var toObject = __webpack_require__(46);
  2704. var call = __webpack_require__(163);
  2705. var isArrayIter = __webpack_require__(164);
  2706. var toLength = __webpack_require__(38);
  2707. var createProperty = __webpack_require__(165);
  2708. var getIterFn = __webpack_require__(166);
  2709. $export($export.S + $export.F * !__webpack_require__(167)(function (iter) { Array.from(iter); }), 'Array', {
  2710. // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
  2711. from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
  2712. var O = toObject(arrayLike);
  2713. var C = typeof this == 'function' ? this : Array;
  2714. var aLen = arguments.length;
  2715. var mapfn = aLen > 1 ? arguments[1] : undefined;
  2716. var mapping = mapfn !== undefined;
  2717. var index = 0;
  2718. var iterFn = getIterFn(O);
  2719. var length, result, step, iterator;
  2720. if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);
  2721. // if object isn't iterable or it's array with default iterator - use simple case
  2722. if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {
  2723. for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {
  2724. createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);
  2725. }
  2726. } else {
  2727. length = toLength(O.length);
  2728. for (result = new C(length); length > index; index++) {
  2729. createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
  2730. }
  2731. }
  2732. result.length = index;
  2733. return result;
  2734. }
  2735. });
  2736. /***/ }),
  2737. /* 163 */
  2738. /***/ (function(module, exports, __webpack_require__) {
  2739. // call something on iterator step with safe closing on error
  2740. var anObject = __webpack_require__(12);
  2741. module.exports = function (iterator, fn, value, entries) {
  2742. try {
  2743. return entries ? fn(anObject(value)[0], value[1]) : fn(value);
  2744. // 7.4.6 IteratorClose(iterator, completion)
  2745. } catch (e) {
  2746. var ret = iterator['return'];
  2747. if (ret !== undefined) anObject(ret.call(iterator));
  2748. throw e;
  2749. }
  2750. };
  2751. /***/ }),
  2752. /* 164 */
  2753. /***/ (function(module, exports, __webpack_require__) {
  2754. // check on default Array iterator
  2755. var Iterators = __webpack_require__(130);
  2756. var ITERATOR = __webpack_require__(27)('iterator');
  2757. var ArrayProto = Array.prototype;
  2758. module.exports = function (it) {
  2759. return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
  2760. };
  2761. /***/ }),
  2762. /* 165 */
  2763. /***/ (function(module, exports, __webpack_require__) {
  2764. 'use strict';
  2765. var $defineProperty = __webpack_require__(11);
  2766. var createDesc = __webpack_require__(17);
  2767. module.exports = function (object, index, value) {
  2768. if (index in object) $defineProperty.f(object, index, createDesc(0, value));
  2769. else object[index] = value;
  2770. };
  2771. /***/ }),
  2772. /* 166 */
  2773. /***/ (function(module, exports, __webpack_require__) {
  2774. var classof = __webpack_require__(75);
  2775. var ITERATOR = __webpack_require__(27)('iterator');
  2776. var Iterators = __webpack_require__(130);
  2777. module.exports = __webpack_require__(9).getIteratorMethod = function (it) {
  2778. if (it != undefined) return it[ITERATOR]
  2779. || it['@@iterator']
  2780. || Iterators[classof(it)];
  2781. };
  2782. /***/ }),
  2783. /* 167 */
  2784. /***/ (function(module, exports, __webpack_require__) {
  2785. var ITERATOR = __webpack_require__(27)('iterator');
  2786. var SAFE_CLOSING = false;
  2787. try {
  2788. var riter = [7][ITERATOR]();
  2789. riter['return'] = function () { SAFE_CLOSING = true; };
  2790. // eslint-disable-next-line no-throw-literal
  2791. Array.from(riter, function () { throw 2; });
  2792. } catch (e) { /* empty */ }
  2793. module.exports = function (exec, skipClosing) {
  2794. if (!skipClosing && !SAFE_CLOSING) return false;
  2795. var safe = false;
  2796. try {
  2797. var arr = [7];
  2798. var iter = arr[ITERATOR]();
  2799. iter.next = function () { return { done: safe = true }; };
  2800. arr[ITERATOR] = function () { return iter; };
  2801. exec(arr);
  2802. } catch (e) { /* empty */ }
  2803. return safe;
  2804. };
  2805. /***/ }),
  2806. /* 168 */
  2807. /***/ (function(module, exports, __webpack_require__) {
  2808. 'use strict';
  2809. var $export = __webpack_require__(8);
  2810. var createProperty = __webpack_require__(165);
  2811. // WebKit Array.of isn't generic
  2812. $export($export.S + $export.F * __webpack_require__(7)(function () {
  2813. function F() { /* empty */ }
  2814. return !(Array.of.call(F) instanceof F);
  2815. }), 'Array', {
  2816. // 22.1.2.3 Array.of( ...items)
  2817. of: function of(/* ...args */) {
  2818. var index = 0;
  2819. var aLen = arguments.length;
  2820. var result = new (typeof this == 'function' ? this : Array)(aLen);
  2821. while (aLen > index) createProperty(result, index, arguments[index++]);
  2822. result.length = aLen;
  2823. return result;
  2824. }
  2825. });
  2826. /***/ }),
  2827. /* 169 */
  2828. /***/ (function(module, exports, __webpack_require__) {
  2829. 'use strict';
  2830. // 22.1.3.13 Array.prototype.join(separator)
  2831. var $export = __webpack_require__(8);
  2832. var toIObject = __webpack_require__(33);
  2833. var arrayJoin = [].join;
  2834. // fallback for not array-like strings
  2835. $export($export.P + $export.F * (__webpack_require__(34) != Object || !__webpack_require__(170)(arrayJoin)), 'Array', {
  2836. join: function join(separator) {
  2837. return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator);
  2838. }
  2839. });
  2840. /***/ }),
  2841. /* 170 */
  2842. /***/ (function(module, exports, __webpack_require__) {
  2843. 'use strict';
  2844. var fails = __webpack_require__(7);
  2845. module.exports = function (method, arg) {
  2846. return !!method && fails(function () {
  2847. // eslint-disable-next-line no-useless-call
  2848. arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);
  2849. });
  2850. };
  2851. /***/ }),
  2852. /* 171 */
  2853. /***/ (function(module, exports, __webpack_require__) {
  2854. 'use strict';
  2855. var $export = __webpack_require__(8);
  2856. var html = __webpack_require__(49);
  2857. var cof = __webpack_require__(35);
  2858. var toAbsoluteIndex = __webpack_require__(40);
  2859. var toLength = __webpack_require__(38);
  2860. var arraySlice = [].slice;
  2861. // fallback for not array-like ES3 strings and DOM objects
  2862. $export($export.P + $export.F * __webpack_require__(7)(function () {
  2863. if (html) arraySlice.call(html);
  2864. }), 'Array', {
  2865. slice: function slice(begin, end) {
  2866. var len = toLength(this.length);
  2867. var klass = cof(this);
  2868. end = end === undefined ? len : end;
  2869. if (klass == 'Array') return arraySlice.call(this, begin, end);
  2870. var start = toAbsoluteIndex(begin, len);
  2871. var upTo = toAbsoluteIndex(end, len);
  2872. var size = toLength(upTo - start);
  2873. var cloned = new Array(size);
  2874. var i = 0;
  2875. for (; i < size; i++) cloned[i] = klass == 'String'
  2876. ? this.charAt(start + i)
  2877. : this[start + i];
  2878. return cloned;
  2879. }
  2880. });
  2881. /***/ }),
  2882. /* 172 */
  2883. /***/ (function(module, exports, __webpack_require__) {
  2884. 'use strict';
  2885. var $export = __webpack_require__(8);
  2886. var aFunction = __webpack_require__(24);
  2887. var toObject = __webpack_require__(46);
  2888. var fails = __webpack_require__(7);
  2889. var $sort = [].sort;
  2890. var test = [1, 2, 3];
  2891. $export($export.P + $export.F * (fails(function () {
  2892. // IE8-
  2893. test.sort(undefined);
  2894. }) || !fails(function () {
  2895. // V8 bug
  2896. test.sort(null);
  2897. // Old WebKit
  2898. }) || !__webpack_require__(170)($sort)), 'Array', {
  2899. // 22.1.3.25 Array.prototype.sort(comparefn)
  2900. sort: function sort(comparefn) {
  2901. return comparefn === undefined
  2902. ? $sort.call(toObject(this))
  2903. : $sort.call(toObject(this), aFunction(comparefn));
  2904. }
  2905. });
  2906. /***/ }),
  2907. /* 173 */
  2908. /***/ (function(module, exports, __webpack_require__) {
  2909. 'use strict';
  2910. var $export = __webpack_require__(8);
  2911. var $forEach = __webpack_require__(174)(0);
  2912. var STRICT = __webpack_require__(170)([].forEach, true);
  2913. $export($export.P + $export.F * !STRICT, 'Array', {
  2914. // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg])
  2915. forEach: function forEach(callbackfn /* , thisArg */) {
  2916. return $forEach(this, callbackfn, arguments[1]);
  2917. }
  2918. });
  2919. /***/ }),
  2920. /* 174 */
  2921. /***/ (function(module, exports, __webpack_require__) {
  2922. // 0 -> Array#forEach
  2923. // 1 -> Array#map
  2924. // 2 -> Array#filter
  2925. // 3 -> Array#some
  2926. // 4 -> Array#every
  2927. // 5 -> Array#find
  2928. // 6 -> Array#findIndex
  2929. var ctx = __webpack_require__(23);
  2930. var IObject = __webpack_require__(34);
  2931. var toObject = __webpack_require__(46);
  2932. var toLength = __webpack_require__(38);
  2933. var asc = __webpack_require__(175);
  2934. module.exports = function (TYPE, $create) {
  2935. var IS_MAP = TYPE == 1;
  2936. var IS_FILTER = TYPE == 2;
  2937. var IS_SOME = TYPE == 3;
  2938. var IS_EVERY = TYPE == 4;
  2939. var IS_FIND_INDEX = TYPE == 6;
  2940. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  2941. var create = $create || asc;
  2942. return function ($this, callbackfn, that) {
  2943. var O = toObject($this);
  2944. var self = IObject(O);
  2945. var f = ctx(callbackfn, that, 3);
  2946. var length = toLength(self.length);
  2947. var index = 0;
  2948. var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
  2949. var val, res;
  2950. for (;length > index; index++) if (NO_HOLES || index in self) {
  2951. val = self[index];
  2952. res = f(val, index, O);
  2953. if (TYPE) {
  2954. if (IS_MAP) result[index] = res; // map
  2955. else if (res) switch (TYPE) {
  2956. case 3: return true; // some
  2957. case 5: return val; // find
  2958. case 6: return index; // findIndex
  2959. case 2: result.push(val); // filter
  2960. } else if (IS_EVERY) return false; // every
  2961. }
  2962. }
  2963. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
  2964. };
  2965. };
  2966. /***/ }),
  2967. /* 175 */
  2968. /***/ (function(module, exports, __webpack_require__) {
  2969. // 9.4.2.3 ArraySpeciesCreate(originalArray, length)
  2970. var speciesConstructor = __webpack_require__(176);
  2971. module.exports = function (original, length) {
  2972. return new (speciesConstructor(original))(length);
  2973. };
  2974. /***/ }),
  2975. /* 176 */
  2976. /***/ (function(module, exports, __webpack_require__) {
  2977. var isObject = __webpack_require__(13);
  2978. var isArray = __webpack_require__(45);
  2979. var SPECIES = __webpack_require__(27)('species');
  2980. module.exports = function (original) {
  2981. var C;
  2982. if (isArray(original)) {
  2983. C = original.constructor;
  2984. // cross-realm fallback
  2985. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  2986. if (isObject(C)) {
  2987. C = C[SPECIES];
  2988. if (C === null) C = undefined;
  2989. }
  2990. } return C === undefined ? Array : C;
  2991. };
  2992. /***/ }),
  2993. /* 177 */
  2994. /***/ (function(module, exports, __webpack_require__) {
  2995. 'use strict';
  2996. var $export = __webpack_require__(8);
  2997. var $map = __webpack_require__(174)(1);
  2998. $export($export.P + $export.F * !__webpack_require__(170)([].map, true), 'Array', {
  2999. // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg])
  3000. map: function map(callbackfn /* , thisArg */) {
  3001. return $map(this, callbackfn, arguments[1]);
  3002. }
  3003. });
  3004. /***/ }),
  3005. /* 178 */
  3006. /***/ (function(module, exports, __webpack_require__) {
  3007. 'use strict';
  3008. var $export = __webpack_require__(8);
  3009. var $filter = __webpack_require__(174)(2);
  3010. $export($export.P + $export.F * !__webpack_require__(170)([].filter, true), 'Array', {
  3011. // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg])
  3012. filter: function filter(callbackfn /* , thisArg */) {
  3013. return $filter(this, callbackfn, arguments[1]);
  3014. }
  3015. });
  3016. /***/ }),
  3017. /* 179 */
  3018. /***/ (function(module, exports, __webpack_require__) {
  3019. 'use strict';
  3020. var $export = __webpack_require__(8);
  3021. var $some = __webpack_require__(174)(3);
  3022. $export($export.P + $export.F * !__webpack_require__(170)([].some, true), 'Array', {
  3023. // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg])
  3024. some: function some(callbackfn /* , thisArg */) {
  3025. return $some(this, callbackfn, arguments[1]);
  3026. }
  3027. });
  3028. /***/ }),
  3029. /* 180 */
  3030. /***/ (function(module, exports, __webpack_require__) {
  3031. 'use strict';
  3032. var $export = __webpack_require__(8);
  3033. var $every = __webpack_require__(174)(4);
  3034. $export($export.P + $export.F * !__webpack_require__(170)([].every, true), 'Array', {
  3035. // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg])
  3036. every: function every(callbackfn /* , thisArg */) {
  3037. return $every(this, callbackfn, arguments[1]);
  3038. }
  3039. });
  3040. /***/ }),
  3041. /* 181 */
  3042. /***/ (function(module, exports, __webpack_require__) {
  3043. 'use strict';
  3044. var $export = __webpack_require__(8);
  3045. var $reduce = __webpack_require__(182);
  3046. $export($export.P + $export.F * !__webpack_require__(170)([].reduce, true), 'Array', {
  3047. // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue])
  3048. reduce: function reduce(callbackfn /* , initialValue */) {
  3049. return $reduce(this, callbackfn, arguments.length, arguments[1], false);
  3050. }
  3051. });
  3052. /***/ }),
  3053. /* 182 */
  3054. /***/ (function(module, exports, __webpack_require__) {
  3055. var aFunction = __webpack_require__(24);
  3056. var toObject = __webpack_require__(46);
  3057. var IObject = __webpack_require__(34);
  3058. var toLength = __webpack_require__(38);
  3059. module.exports = function (that, callbackfn, aLen, memo, isRight) {
  3060. aFunction(callbackfn);
  3061. var O = toObject(that);
  3062. var self = IObject(O);
  3063. var length = toLength(O.length);
  3064. var index = isRight ? length - 1 : 0;
  3065. var i = isRight ? -1 : 1;
  3066. if (aLen < 2) for (;;) {
  3067. if (index in self) {
  3068. memo = self[index];
  3069. index += i;
  3070. break;
  3071. }
  3072. index += i;
  3073. if (isRight ? index < 0 : length <= index) {
  3074. throw TypeError('Reduce of empty array with no initial value');
  3075. }
  3076. }
  3077. for (;isRight ? index >= 0 : length > index; index += i) if (index in self) {
  3078. memo = callbackfn(memo, self[index], index, O);
  3079. }
  3080. return memo;
  3081. };
  3082. /***/ }),
  3083. /* 183 */
  3084. /***/ (function(module, exports, __webpack_require__) {
  3085. 'use strict';
  3086. var $export = __webpack_require__(8);
  3087. var $reduce = __webpack_require__(182);
  3088. $export($export.P + $export.F * !__webpack_require__(170)([].reduceRight, true), 'Array', {
  3089. // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue])
  3090. reduceRight: function reduceRight(callbackfn /* , initialValue */) {
  3091. return $reduce(this, callbackfn, arguments.length, arguments[1], true);
  3092. }
  3093. });
  3094. /***/ }),
  3095. /* 184 */
  3096. /***/ (function(module, exports, __webpack_require__) {
  3097. 'use strict';
  3098. var $export = __webpack_require__(8);
  3099. var $indexOf = __webpack_require__(37)(false);
  3100. var $native = [].indexOf;
  3101. var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0;
  3102. $export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(170)($native)), 'Array', {
  3103. // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex])
  3104. indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
  3105. return NEGATIVE_ZERO
  3106. // convert -0 to +0
  3107. ? $native.apply(this, arguments) || 0
  3108. : $indexOf(this, searchElement, arguments[1]);
  3109. }
  3110. });
  3111. /***/ }),
  3112. /* 185 */
  3113. /***/ (function(module, exports, __webpack_require__) {
  3114. 'use strict';
  3115. var $export = __webpack_require__(8);
  3116. var toIObject = __webpack_require__(33);
  3117. var toInteger = __webpack_require__(39);
  3118. var toLength = __webpack_require__(38);
  3119. var $native = [].lastIndexOf;
  3120. var NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0;
  3121. $export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(170)($native)), 'Array', {
  3122. // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex])
  3123. lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {
  3124. // convert -0 to +0
  3125. if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0;
  3126. var O = toIObject(this);
  3127. var length = toLength(O.length);
  3128. var index = length - 1;
  3129. if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1]));
  3130. if (index < 0) index = length + index;
  3131. for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0;
  3132. return -1;
  3133. }
  3134. });
  3135. /***/ }),
  3136. /* 186 */
  3137. /***/ (function(module, exports, __webpack_require__) {
  3138. // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
  3139. var $export = __webpack_require__(8);
  3140. $export($export.P, 'Array', { copyWithin: __webpack_require__(187) });
  3141. __webpack_require__(188)('copyWithin');
  3142. /***/ }),
  3143. /* 187 */
  3144. /***/ (function(module, exports, __webpack_require__) {
  3145. // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
  3146. 'use strict';
  3147. var toObject = __webpack_require__(46);
  3148. var toAbsoluteIndex = __webpack_require__(40);
  3149. var toLength = __webpack_require__(38);
  3150. module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {
  3151. var O = toObject(this);
  3152. var len = toLength(O.length);
  3153. var to = toAbsoluteIndex(target, len);
  3154. var from = toAbsoluteIndex(start, len);
  3155. var end = arguments.length > 2 ? arguments[2] : undefined;
  3156. var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);
  3157. var inc = 1;
  3158. if (from < to && to < from + count) {
  3159. inc = -1;
  3160. from += count - 1;
  3161. to += count - 1;
  3162. }
  3163. while (count-- > 0) {
  3164. if (from in O) O[to] = O[from];
  3165. else delete O[to];
  3166. to += inc;
  3167. from += inc;
  3168. } return O;
  3169. };
  3170. /***/ }),
  3171. /* 188 */
  3172. /***/ (function(module, exports, __webpack_require__) {
  3173. // 22.1.3.31 Array.prototype[@@unscopables]
  3174. var UNSCOPABLES = __webpack_require__(27)('unscopables');
  3175. var ArrayProto = Array.prototype;
  3176. if (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__(10)(ArrayProto, UNSCOPABLES, {});
  3177. module.exports = function (key) {
  3178. ArrayProto[UNSCOPABLES][key] = true;
  3179. };
  3180. /***/ }),
  3181. /* 189 */
  3182. /***/ (function(module, exports, __webpack_require__) {
  3183. // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
  3184. var $export = __webpack_require__(8);
  3185. $export($export.P, 'Array', { fill: __webpack_require__(190) });
  3186. __webpack_require__(188)('fill');
  3187. /***/ }),
  3188. /* 190 */
  3189. /***/ (function(module, exports, __webpack_require__) {
  3190. // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
  3191. 'use strict';
  3192. var toObject = __webpack_require__(46);
  3193. var toAbsoluteIndex = __webpack_require__(40);
  3194. var toLength = __webpack_require__(38);
  3195. module.exports = function fill(value /* , start = 0, end = @length */) {
  3196. var O = toObject(this);
  3197. var length = toLength(O.length);
  3198. var aLen = arguments.length;
  3199. var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length);
  3200. var end = aLen > 2 ? arguments[2] : undefined;
  3201. var endPos = end === undefined ? length : toAbsoluteIndex(end, length);
  3202. while (endPos > index) O[index++] = value;
  3203. return O;
  3204. };
  3205. /***/ }),
  3206. /* 191 */
  3207. /***/ (function(module, exports, __webpack_require__) {
  3208. 'use strict';
  3209. // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)
  3210. var $export = __webpack_require__(8);
  3211. var $find = __webpack_require__(174)(5);
  3212. var KEY = 'find';
  3213. var forced = true;
  3214. // Shouldn't skip holes
  3215. if (KEY in []) Array(1)[KEY](function () { forced = false; });
  3216. $export($export.P + $export.F * forced, 'Array', {
  3217. find: function find(callbackfn /* , that = undefined */) {
  3218. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  3219. }
  3220. });
  3221. __webpack_require__(188)(KEY);
  3222. /***/ }),
  3223. /* 192 */
  3224. /***/ (function(module, exports, __webpack_require__) {
  3225. 'use strict';
  3226. // 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)
  3227. var $export = __webpack_require__(8);
  3228. var $find = __webpack_require__(174)(6);
  3229. var KEY = 'findIndex';
  3230. var forced = true;
  3231. // Shouldn't skip holes
  3232. if (KEY in []) Array(1)[KEY](function () { forced = false; });
  3233. $export($export.P + $export.F * forced, 'Array', {
  3234. findIndex: function findIndex(callbackfn /* , that = undefined */) {
  3235. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  3236. }
  3237. });
  3238. __webpack_require__(188)(KEY);
  3239. /***/ }),
  3240. /* 193 */
  3241. /***/ (function(module, exports, __webpack_require__) {
  3242. __webpack_require__(194)('Array');
  3243. /***/ }),
  3244. /* 194 */
  3245. /***/ (function(module, exports, __webpack_require__) {
  3246. 'use strict';
  3247. var global = __webpack_require__(4);
  3248. var dP = __webpack_require__(11);
  3249. var DESCRIPTORS = __webpack_require__(6);
  3250. var SPECIES = __webpack_require__(27)('species');
  3251. module.exports = function (KEY) {
  3252. var C = global[KEY];
  3253. if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {
  3254. configurable: true,
  3255. get: function () { return this; }
  3256. });
  3257. };
  3258. /***/ }),
  3259. /* 195 */
  3260. /***/ (function(module, exports, __webpack_require__) {
  3261. 'use strict';
  3262. var addToUnscopables = __webpack_require__(188);
  3263. var step = __webpack_require__(196);
  3264. var Iterators = __webpack_require__(130);
  3265. var toIObject = __webpack_require__(33);
  3266. // 22.1.3.4 Array.prototype.entries()
  3267. // 22.1.3.13 Array.prototype.keys()
  3268. // 22.1.3.29 Array.prototype.values()
  3269. // 22.1.3.30 Array.prototype[@@iterator]()
  3270. module.exports = __webpack_require__(129)(Array, 'Array', function (iterated, kind) {
  3271. this._t = toIObject(iterated); // target
  3272. this._i = 0; // next index
  3273. this._k = kind; // kind
  3274. // 22.1.5.2.1 %ArrayIteratorPrototype%.next()
  3275. }, function () {
  3276. var O = this._t;
  3277. var kind = this._k;
  3278. var index = this._i++;
  3279. if (!O || index >= O.length) {
  3280. this._t = undefined;
  3281. return step(1);
  3282. }
  3283. if (kind == 'keys') return step(0, index);
  3284. if (kind == 'values') return step(0, O[index]);
  3285. return step(0, [index, O[index]]);
  3286. }, 'values');
  3287. // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
  3288. Iterators.Arguments = Iterators.Array;
  3289. addToUnscopables('keys');
  3290. addToUnscopables('values');
  3291. addToUnscopables('entries');
  3292. /***/ }),
  3293. /* 196 */
  3294. /***/ (function(module, exports) {
  3295. module.exports = function (done, value) {
  3296. return { value: value, done: !!done };
  3297. };
  3298. /***/ }),
  3299. /* 197 */
  3300. /***/ (function(module, exports, __webpack_require__) {
  3301. var global = __webpack_require__(4);
  3302. var inheritIfRequired = __webpack_require__(88);
  3303. var dP = __webpack_require__(11).f;
  3304. var gOPN = __webpack_require__(51).f;
  3305. var isRegExp = __webpack_require__(135);
  3306. var $flags = __webpack_require__(198);
  3307. var $RegExp = global.RegExp;
  3308. var Base = $RegExp;
  3309. var proto = $RegExp.prototype;
  3310. var re1 = /a/g;
  3311. var re2 = /a/g;
  3312. // "new" creates a new object, old webkit buggy here
  3313. var CORRECT_NEW = new $RegExp(re1) !== re1;
  3314. if (__webpack_require__(6) && (!CORRECT_NEW || __webpack_require__(7)(function () {
  3315. re2[__webpack_require__(27)('match')] = false;
  3316. // RegExp constructor can alter flags and IsRegExp works correct with @@match
  3317. return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i';
  3318. }))) {
  3319. $RegExp = function RegExp(p, f) {
  3320. var tiRE = this instanceof $RegExp;
  3321. var piRE = isRegExp(p);
  3322. var fiU = f === undefined;
  3323. return !tiRE && piRE && p.constructor === $RegExp && fiU ? p
  3324. : inheritIfRequired(CORRECT_NEW
  3325. ? new Base(piRE && !fiU ? p.source : p, f)
  3326. : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f)
  3327. , tiRE ? this : proto, $RegExp);
  3328. };
  3329. var proxy = function (key) {
  3330. key in $RegExp || dP($RegExp, key, {
  3331. configurable: true,
  3332. get: function () { return Base[key]; },
  3333. set: function (it) { Base[key] = it; }
  3334. });
  3335. };
  3336. for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]);
  3337. proto.constructor = $RegExp;
  3338. $RegExp.prototype = proto;
  3339. __webpack_require__(18)(global, 'RegExp', $RegExp);
  3340. }
  3341. __webpack_require__(194)('RegExp');
  3342. /***/ }),
  3343. /* 198 */
  3344. /***/ (function(module, exports, __webpack_require__) {
  3345. 'use strict';
  3346. // 21.2.5.3 get RegExp.prototype.flags
  3347. var anObject = __webpack_require__(12);
  3348. module.exports = function () {
  3349. var that = anObject(this);
  3350. var result = '';
  3351. if (that.global) result += 'g';
  3352. if (that.ignoreCase) result += 'i';
  3353. if (that.multiline) result += 'm';
  3354. if (that.unicode) result += 'u';
  3355. if (that.sticky) result += 'y';
  3356. return result;
  3357. };
  3358. /***/ }),
  3359. /* 199 */
  3360. /***/ (function(module, exports, __webpack_require__) {
  3361. 'use strict';
  3362. var regexpExec = __webpack_require__(200);
  3363. __webpack_require__(8)({
  3364. target: 'RegExp',
  3365. proto: true,
  3366. forced: regexpExec !== /./.exec
  3367. }, {
  3368. exec: regexpExec
  3369. });
  3370. /***/ }),
  3371. /* 200 */
  3372. /***/ (function(module, exports, __webpack_require__) {
  3373. 'use strict';
  3374. var regexpFlags = __webpack_require__(198);
  3375. var nativeExec = RegExp.prototype.exec;
  3376. // This always refers to the native implementation, because the
  3377. // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
  3378. // which loads this file before patching the method.
  3379. var nativeReplace = String.prototype.replace;
  3380. var patchedExec = nativeExec;
  3381. var LAST_INDEX = 'lastIndex';
  3382. var UPDATES_LAST_INDEX_WRONG = (function () {
  3383. var re1 = /a/,
  3384. re2 = /b*/g;
  3385. nativeExec.call(re1, 'a');
  3386. nativeExec.call(re2, 'a');
  3387. return re1[LAST_INDEX] !== 0 || re2[LAST_INDEX] !== 0;
  3388. })();
  3389. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  3390. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  3391. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;
  3392. if (PATCH) {
  3393. patchedExec = function exec(str) {
  3394. var re = this;
  3395. var lastIndex, reCopy, match, i;
  3396. if (NPCG_INCLUDED) {
  3397. reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re));
  3398. }
  3399. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re[LAST_INDEX];
  3400. match = nativeExec.call(re, str);
  3401. if (UPDATES_LAST_INDEX_WRONG && match) {
  3402. re[LAST_INDEX] = re.global ? match.index + match[0].length : lastIndex;
  3403. }
  3404. if (NPCG_INCLUDED && match && match.length > 1) {
  3405. // Fix browsers whose `exec` methods don't consistently return `undefined`
  3406. // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
  3407. // eslint-disable-next-line no-loop-func
  3408. nativeReplace.call(match[0], reCopy, function () {
  3409. for (i = 1; i < arguments.length - 2; i++) {
  3410. if (arguments[i] === undefined) match[i] = undefined;
  3411. }
  3412. });
  3413. }
  3414. return match;
  3415. };
  3416. }
  3417. module.exports = patchedExec;
  3418. /***/ }),
  3419. /* 201 */
  3420. /***/ (function(module, exports, __webpack_require__) {
  3421. 'use strict';
  3422. __webpack_require__(202);
  3423. var anObject = __webpack_require__(12);
  3424. var $flags = __webpack_require__(198);
  3425. var DESCRIPTORS = __webpack_require__(6);
  3426. var TO_STRING = 'toString';
  3427. var $toString = /./[TO_STRING];
  3428. var define = function (fn) {
  3429. __webpack_require__(18)(RegExp.prototype, TO_STRING, fn, true);
  3430. };
  3431. // 21.2.5.14 RegExp.prototype.toString()
  3432. if (__webpack_require__(7)(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) {
  3433. define(function toString() {
  3434. var R = anObject(this);
  3435. return '/'.concat(R.source, '/',
  3436. 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined);
  3437. });
  3438. // FF44- RegExp#toString has a wrong name
  3439. } else if ($toString.name != TO_STRING) {
  3440. define(function toString() {
  3441. return $toString.call(this);
  3442. });
  3443. }
  3444. /***/ }),
  3445. /* 202 */
  3446. /***/ (function(module, exports, __webpack_require__) {
  3447. // 21.2.5.3 get RegExp.prototype.flags()
  3448. if (__webpack_require__(6) && /./g.flags != 'g') __webpack_require__(11).f(RegExp.prototype, 'flags', {
  3449. configurable: true,
  3450. get: __webpack_require__(198)
  3451. });
  3452. /***/ }),
  3453. /* 203 */
  3454. /***/ (function(module, exports, __webpack_require__) {
  3455. 'use strict';
  3456. var anObject = __webpack_require__(12);
  3457. var toLength = __webpack_require__(38);
  3458. var advanceStringIndex = __webpack_require__(204);
  3459. var regExpExec = __webpack_require__(205);
  3460. // @@match logic
  3461. __webpack_require__(206)('match', 1, function (defined, MATCH, $match, maybeCallNative) {
  3462. return [
  3463. // `String.prototype.match` method
  3464. // https://tc39.github.io/ecma262/#sec-string.prototype.match
  3465. function match(regexp) {
  3466. var O = defined(this);
  3467. var fn = regexp == undefined ? undefined : regexp[MATCH];
  3468. return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
  3469. },
  3470. // `RegExp.prototype[@@match]` method
  3471. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match
  3472. function (regexp) {
  3473. var res = maybeCallNative($match, regexp, this);
  3474. if (res.done) return res.value;
  3475. var rx = anObject(regexp);
  3476. var S = String(this);
  3477. if (!rx.global) return regExpExec(rx, S);
  3478. var fullUnicode = rx.unicode;
  3479. rx.lastIndex = 0;
  3480. var A = [];
  3481. var n = 0;
  3482. var result;
  3483. while ((result = regExpExec(rx, S)) !== null) {
  3484. var matchStr = String(result[0]);
  3485. A[n] = matchStr;
  3486. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  3487. n++;
  3488. }
  3489. return n === 0 ? null : A;
  3490. }
  3491. ];
  3492. });
  3493. /***/ }),
  3494. /* 204 */
  3495. /***/ (function(module, exports, __webpack_require__) {
  3496. 'use strict';
  3497. var at = __webpack_require__(128)(true);
  3498. // `AdvanceStringIndex` abstract operation
  3499. // https://tc39.github.io/ecma262/#sec-advancestringindex
  3500. module.exports = function (S, index, unicode) {
  3501. return index + (unicode ? at(S, index).length : 1);
  3502. };
  3503. /***/ }),
  3504. /* 205 */
  3505. /***/ (function(module, exports, __webpack_require__) {
  3506. 'use strict';
  3507. var classof = __webpack_require__(75);
  3508. var builtinExec = RegExp.prototype.exec;
  3509. // `RegExpExec` abstract operation
  3510. // https://tc39.github.io/ecma262/#sec-regexpexec
  3511. module.exports = function (R, S) {
  3512. var exec = R.exec;
  3513. if (typeof exec === 'function') {
  3514. var result = exec.call(R, S);
  3515. if (typeof result !== 'object') {
  3516. throw new TypeError('RegExp exec method returned something other than an Object or null');
  3517. }
  3518. return result;
  3519. }
  3520. if (classof(R) !== 'RegExp') {
  3521. throw new TypeError('RegExp#exec called on incompatible receiver');
  3522. }
  3523. return builtinExec.call(R, S);
  3524. };
  3525. /***/ }),
  3526. /* 206 */
  3527. /***/ (function(module, exports, __webpack_require__) {
  3528. 'use strict';
  3529. __webpack_require__(199);
  3530. var redefine = __webpack_require__(18);
  3531. var hide = __webpack_require__(10);
  3532. var fails = __webpack_require__(7);
  3533. var defined = __webpack_require__(36);
  3534. var wks = __webpack_require__(27);
  3535. var regexpExec = __webpack_require__(200);
  3536. var SPECIES = wks('species');
  3537. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  3538. // #replace needs built-in support for named groups.
  3539. // #match works fine because it just return the exec results, even if it has
  3540. // a "grops" property.
  3541. var re = /./;
  3542. re.exec = function () {
  3543. var result = [];
  3544. result.groups = { a: '7' };
  3545. return result;
  3546. };
  3547. return ''.replace(re, '$<a>') !== '7';
  3548. });
  3549. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = (function () {
  3550. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  3551. var re = /(?:)/;
  3552. var originalExec = re.exec;
  3553. re.exec = function () { return originalExec.apply(this, arguments); };
  3554. var result = 'ab'.split(re);
  3555. return result.length === 2 && result[0] === 'a' && result[1] === 'b';
  3556. })();
  3557. module.exports = function (KEY, length, exec) {
  3558. var SYMBOL = wks(KEY);
  3559. var DELEGATES_TO_SYMBOL = !fails(function () {
  3560. // String methods call symbol-named RegEp methods
  3561. var O = {};
  3562. O[SYMBOL] = function () { return 7; };
  3563. return ''[KEY](O) != 7;
  3564. });
  3565. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL ? !fails(function () {
  3566. // Symbol-named RegExp methods call .exec
  3567. var execCalled = false;
  3568. var re = /a/;
  3569. re.exec = function () { execCalled = true; return null; };
  3570. if (KEY === 'split') {
  3571. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  3572. // a new one. We need to return the patched regex when creating the new one.
  3573. re.constructor = {};
  3574. re.constructor[SPECIES] = function () { return re; };
  3575. }
  3576. re[SYMBOL]('');
  3577. return !execCalled;
  3578. }) : undefined;
  3579. if (
  3580. !DELEGATES_TO_SYMBOL ||
  3581. !DELEGATES_TO_EXEC ||
  3582. (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||
  3583. (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
  3584. ) {
  3585. var nativeRegExpMethod = /./[SYMBOL];
  3586. var fns = exec(
  3587. defined,
  3588. SYMBOL,
  3589. ''[KEY],
  3590. function maybeCallNative(nativeMethod, regexp, str, arg2, forceStringMethod) {
  3591. if (regexp.exec === regexpExec) {
  3592. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  3593. // The native String method already delegates to @@method (this
  3594. // polyfilled function), leasing to infinite recursion.
  3595. // We avoid it by directly calling the native @@method method.
  3596. return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
  3597. }
  3598. return { done: true, value: nativeMethod.call(str, regexp, arg2) };
  3599. }
  3600. return { done: false };
  3601. }
  3602. );
  3603. var strfn = fns[0];
  3604. var rxfn = fns[1];
  3605. redefine(String.prototype, KEY, strfn);
  3606. hide(RegExp.prototype, SYMBOL, length == 2
  3607. // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
  3608. // 21.2.5.11 RegExp.prototype[@@split](string, limit)
  3609. ? function (string, arg) { return rxfn.call(string, this, arg); }
  3610. // 21.2.5.6 RegExp.prototype[@@match](string)
  3611. // 21.2.5.9 RegExp.prototype[@@search](string)
  3612. : function (string) { return rxfn.call(string, this); }
  3613. );
  3614. }
  3615. };
  3616. /***/ }),
  3617. /* 207 */
  3618. /***/ (function(module, exports, __webpack_require__) {
  3619. 'use strict';
  3620. var anObject = __webpack_require__(12);
  3621. var toObject = __webpack_require__(46);
  3622. var toLength = __webpack_require__(38);
  3623. var toInteger = __webpack_require__(39);
  3624. var advanceStringIndex = __webpack_require__(204);
  3625. var regExpExec = __webpack_require__(205);
  3626. var max = Math.max;
  3627. var min = Math.min;
  3628. var floor = Math.floor;
  3629. var SUBSTITUTION_SYMBOLS = /\$([$&`']|\d\d?|<[^>]*>)/g;
  3630. var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&`']|\d\d?)/g;
  3631. var maybeToString = function (it) {
  3632. return it === undefined ? it : String(it);
  3633. };
  3634. // @@replace logic
  3635. __webpack_require__(206)('replace', 2, function (defined, REPLACE, $replace, maybeCallNative) {
  3636. return [
  3637. // `String.prototype.replace` method
  3638. // https://tc39.github.io/ecma262/#sec-string.prototype.replace
  3639. function replace(searchValue, replaceValue) {
  3640. var O = defined(this);
  3641. var fn = searchValue == undefined ? undefined : searchValue[REPLACE];
  3642. return fn !== undefined
  3643. ? fn.call(searchValue, O, replaceValue)
  3644. : $replace.call(String(O), searchValue, replaceValue);
  3645. },
  3646. // `RegExp.prototype[@@replace]` method
  3647. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
  3648. function (regexp, replaceValue) {
  3649. var res = maybeCallNative($replace, regexp, this, replaceValue);
  3650. if (res.done) return res.value;
  3651. var rx = anObject(regexp);
  3652. var S = String(this);
  3653. var functionalReplace = typeof replaceValue === 'function';
  3654. if (!functionalReplace) replaceValue = String(replaceValue);
  3655. var global = rx.global;
  3656. if (global) {
  3657. var fullUnicode = rx.unicode;
  3658. rx.lastIndex = 0;
  3659. }
  3660. var results = [];
  3661. while (true) {
  3662. var result = regExpExec(rx, S);
  3663. if (result === null) break;
  3664. results.push(result);
  3665. if (!global) break;
  3666. var matchStr = String(result[0]);
  3667. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  3668. }
  3669. var accumulatedResult = '';
  3670. var nextSourcePosition = 0;
  3671. for (var i = 0; i < results.length; i++) {
  3672. result = results[i];
  3673. var matched = String(result[0]);
  3674. var position = max(min(toInteger(result.index), S.length), 0);
  3675. var captures = [];
  3676. // NOTE: This is equivalent to
  3677. // captures = result.slice(1).map(maybeToString)
  3678. // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
  3679. // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
  3680. // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
  3681. for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
  3682. var namedCaptures = result.groups;
  3683. if (functionalReplace) {
  3684. var replacerArgs = [matched].concat(captures, position, S);
  3685. if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
  3686. var replacement = String(replaceValue.apply(undefined, replacerArgs));
  3687. } else {
  3688. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  3689. }
  3690. if (position >= nextSourcePosition) {
  3691. accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
  3692. nextSourcePosition = position + matched.length;
  3693. }
  3694. }
  3695. return accumulatedResult + S.slice(nextSourcePosition);
  3696. }
  3697. ];
  3698. // https://tc39.github.io/ecma262/#sec-getsubstitution
  3699. function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
  3700. var tailPos = position + matched.length;
  3701. var m = captures.length;
  3702. var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
  3703. if (namedCaptures !== undefined) {
  3704. namedCaptures = toObject(namedCaptures);
  3705. symbols = SUBSTITUTION_SYMBOLS;
  3706. }
  3707. return $replace.call(replacement, symbols, function (match, ch) {
  3708. var capture;
  3709. switch (ch.charAt(0)) {
  3710. case '$': return '$';
  3711. case '&': return matched;
  3712. case '`': return str.slice(0, position);
  3713. case "'": return str.slice(tailPos);
  3714. case '<':
  3715. capture = namedCaptures[ch.slice(1, -1)];
  3716. break;
  3717. default: // \d\d?
  3718. var n = +ch;
  3719. if (n === 0) return match;
  3720. if (n > m) {
  3721. var f = floor(n / 10);
  3722. if (f === 0) return match;
  3723. if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
  3724. return match;
  3725. }
  3726. capture = captures[n - 1];
  3727. }
  3728. return capture === undefined ? '' : capture;
  3729. });
  3730. }
  3731. });
  3732. /***/ }),
  3733. /* 208 */
  3734. /***/ (function(module, exports, __webpack_require__) {
  3735. 'use strict';
  3736. var anObject = __webpack_require__(12);
  3737. var sameValue = __webpack_require__(71);
  3738. var regExpExec = __webpack_require__(205);
  3739. // @@search logic
  3740. __webpack_require__(206)('search', 1, function (defined, SEARCH, $search, maybeCallNative) {
  3741. return [
  3742. // `String.prototype.search` method
  3743. // https://tc39.github.io/ecma262/#sec-string.prototype.search
  3744. function search(regexp) {
  3745. var O = defined(this);
  3746. var fn = regexp == undefined ? undefined : regexp[SEARCH];
  3747. return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
  3748. },
  3749. // `RegExp.prototype[@@search]` method
  3750. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search
  3751. function (regexp) {
  3752. var res = maybeCallNative($search, regexp, this);
  3753. if (res.done) return res.value;
  3754. var rx = anObject(regexp);
  3755. var S = String(this);
  3756. var previousLastIndex = rx.lastIndex;
  3757. if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
  3758. var result = regExpExec(rx, S);
  3759. if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
  3760. return result === null ? -1 : result.index;
  3761. }
  3762. ];
  3763. });
  3764. /***/ }),
  3765. /* 209 */
  3766. /***/ (function(module, exports, __webpack_require__) {
  3767. 'use strict';
  3768. var isRegExp = __webpack_require__(135);
  3769. var anObject = __webpack_require__(12);
  3770. var speciesConstructor = __webpack_require__(210);
  3771. var advanceStringIndex = __webpack_require__(204);
  3772. var toLength = __webpack_require__(38);
  3773. var callRegExpExec = __webpack_require__(205);
  3774. var regexpExec = __webpack_require__(200);
  3775. var fails = __webpack_require__(7);
  3776. var $min = Math.min;
  3777. var $push = [].push;
  3778. var $SPLIT = 'split';
  3779. var LENGTH = 'length';
  3780. var LAST_INDEX = 'lastIndex';
  3781. var MAX_UINT32 = 0xffffffff;
  3782. // babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError
  3783. var SUPPORTS_Y = !fails(function () { RegExp(MAX_UINT32, 'y'); });
  3784. // @@split logic
  3785. __webpack_require__(206)('split', 2, function (defined, SPLIT, $split, maybeCallNative) {
  3786. var internalSplit;
  3787. if (
  3788. 'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||
  3789. 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||
  3790. 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||
  3791. '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||
  3792. '.'[$SPLIT](/()()/)[LENGTH] > 1 ||
  3793. ''[$SPLIT](/.?/)[LENGTH]
  3794. ) {
  3795. // based on es5-shim implementation, need to rework it
  3796. internalSplit = function (separator, limit) {
  3797. var string = String(this);
  3798. if (separator === undefined && limit === 0) return [];
  3799. // If `separator` is not a regex, use native split
  3800. if (!isRegExp(separator)) return $split.call(string, separator, limit);
  3801. var output = [];
  3802. var flags = (separator.ignoreCase ? 'i' : '') +
  3803. (separator.multiline ? 'm' : '') +
  3804. (separator.unicode ? 'u' : '') +
  3805. (separator.sticky ? 'y' : '');
  3806. var lastLastIndex = 0;
  3807. var splitLimit = limit === undefined ? MAX_UINT32 : limit >>> 0;
  3808. // Make `global` and avoid `lastIndex` issues by working with a copy
  3809. var separatorCopy = new RegExp(separator.source, flags + 'g');
  3810. var match, lastIndex, lastLength;
  3811. while (match = regexpExec.call(separatorCopy, string)) {
  3812. lastIndex = separatorCopy[LAST_INDEX];
  3813. if (lastIndex > lastLastIndex) {
  3814. output.push(string.slice(lastLastIndex, match.index));
  3815. if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1));
  3816. lastLength = match[0][LENGTH];
  3817. lastLastIndex = lastIndex;
  3818. if (output[LENGTH] >= splitLimit) break;
  3819. }
  3820. if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop
  3821. }
  3822. if (lastLastIndex === string[LENGTH]) {
  3823. if (lastLength || !separatorCopy.test('')) output.push('');
  3824. } else output.push(string.slice(lastLastIndex));
  3825. return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;
  3826. };
  3827. // Chakra, V8
  3828. } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) {
  3829. internalSplit = function (separator, limit) {
  3830. return separator === undefined && limit === 0 ? [] : $split.call(this, separator, limit);
  3831. };
  3832. } else {
  3833. internalSplit = $split;
  3834. }
  3835. return [
  3836. // `String.prototype.split` method
  3837. // https://tc39.github.io/ecma262/#sec-string.prototype.split
  3838. function split(separator, limit) {
  3839. var O = defined(this);
  3840. var splitter = separator == undefined ? undefined : separator[SPLIT];
  3841. return splitter !== undefined
  3842. ? splitter.call(separator, O, limit)
  3843. : internalSplit.call(String(O), separator, limit);
  3844. },
  3845. // `RegExp.prototype[@@split]` method
  3846. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split
  3847. //
  3848. // NOTE: This cannot be properly polyfilled in engines that don't support
  3849. // the 'y' flag.
  3850. function (regexp, limit) {
  3851. var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== $split);
  3852. if (res.done) return res.value;
  3853. var rx = anObject(regexp);
  3854. var S = String(this);
  3855. var C = speciesConstructor(rx, RegExp);
  3856. var unicodeMatching = rx.unicode;
  3857. var flags = (rx.ignoreCase ? 'i' : '') +
  3858. (rx.multiline ? 'm' : '') +
  3859. (rx.unicode ? 'u' : '') +
  3860. (SUPPORTS_Y ? 'y' : 'g');
  3861. // ^(? + rx + ) is needed, in combination with some S slicing, to
  3862. // simulate the 'y' flag.
  3863. var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
  3864. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  3865. if (lim === 0) return [];
  3866. if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];
  3867. var p = 0;
  3868. var q = 0;
  3869. var A = [];
  3870. while (q < S.length) {
  3871. splitter.lastIndex = SUPPORTS_Y ? q : 0;
  3872. var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q));
  3873. var e;
  3874. if (
  3875. z === null ||
  3876. (e = $min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
  3877. ) {
  3878. q = advanceStringIndex(S, q, unicodeMatching);
  3879. } else {
  3880. A.push(S.slice(p, q));
  3881. if (A.length === lim) return A;
  3882. for (var i = 1; i <= z.length - 1; i++) {
  3883. A.push(z[i]);
  3884. if (A.length === lim) return A;
  3885. }
  3886. q = p = e;
  3887. }
  3888. }
  3889. A.push(S.slice(p));
  3890. return A;
  3891. }
  3892. ];
  3893. });
  3894. /***/ }),
  3895. /* 210 */
  3896. /***/ (function(module, exports, __webpack_require__) {
  3897. // 7.3.20 SpeciesConstructor(O, defaultConstructor)
  3898. var anObject = __webpack_require__(12);
  3899. var aFunction = __webpack_require__(24);
  3900. var SPECIES = __webpack_require__(27)('species');
  3901. module.exports = function (O, D) {
  3902. var C = anObject(O).constructor;
  3903. var S;
  3904. return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);
  3905. };
  3906. /***/ }),
  3907. /* 211 */
  3908. /***/ (function(module, exports, __webpack_require__) {
  3909. 'use strict';
  3910. var LIBRARY = __webpack_require__(22);
  3911. var global = __webpack_require__(4);
  3912. var ctx = __webpack_require__(23);
  3913. var classof = __webpack_require__(75);
  3914. var $export = __webpack_require__(8);
  3915. var isObject = __webpack_require__(13);
  3916. var aFunction = __webpack_require__(24);
  3917. var anInstance = __webpack_require__(212);
  3918. var forOf = __webpack_require__(213);
  3919. var speciesConstructor = __webpack_require__(210);
  3920. var task = __webpack_require__(214).set;
  3921. var microtask = __webpack_require__(215)();
  3922. var newPromiseCapabilityModule = __webpack_require__(216);
  3923. var perform = __webpack_require__(217);
  3924. var userAgent = __webpack_require__(218);
  3925. var promiseResolve = __webpack_require__(219);
  3926. var PROMISE = 'Promise';
  3927. var TypeError = global.TypeError;
  3928. var process = global.process;
  3929. var versions = process && process.versions;
  3930. var v8 = versions && versions.v8 || '';
  3931. var $Promise = global[PROMISE];
  3932. var isNode = classof(process) == 'process';
  3933. var empty = function () { /* empty */ };
  3934. var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;
  3935. var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;
  3936. var USE_NATIVE = !!function () {
  3937. try {
  3938. // correct subclassing with @@species support
  3939. var promise = $Promise.resolve(1);
  3940. var FakePromise = (promise.constructor = {})[__webpack_require__(27)('species')] = function (exec) {
  3941. exec(empty, empty);
  3942. };
  3943. // unhandled rejections tracking support, NodeJS Promise without it fails @@species test
  3944. return (isNode || typeof PromiseRejectionEvent == 'function')
  3945. && promise.then(empty) instanceof FakePromise
  3946. // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
  3947. // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
  3948. // we can't detect it synchronously, so just check versions
  3949. && v8.indexOf('6.6') !== 0
  3950. && userAgent.indexOf('Chrome/66') === -1;
  3951. } catch (e) { /* empty */ }
  3952. }();
  3953. // helpers
  3954. var isThenable = function (it) {
  3955. var then;
  3956. return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
  3957. };
  3958. var notify = function (promise, isReject) {
  3959. if (promise._n) return;
  3960. promise._n = true;
  3961. var chain = promise._c;
  3962. microtask(function () {
  3963. var value = promise._v;
  3964. var ok = promise._s == 1;
  3965. var i = 0;
  3966. var run = function (reaction) {
  3967. var handler = ok ? reaction.ok : reaction.fail;
  3968. var resolve = reaction.resolve;
  3969. var reject = reaction.reject;
  3970. var domain = reaction.domain;
  3971. var result, then, exited;
  3972. try {
  3973. if (handler) {
  3974. if (!ok) {
  3975. if (promise._h == 2) onHandleUnhandled(promise);
  3976. promise._h = 1;
  3977. }
  3978. if (handler === true) result = value;
  3979. else {
  3980. if (domain) domain.enter();
  3981. result = handler(value); // may throw
  3982. if (domain) {
  3983. domain.exit();
  3984. exited = true;
  3985. }
  3986. }
  3987. if (result === reaction.promise) {
  3988. reject(TypeError('Promise-chain cycle'));
  3989. } else if (then = isThenable(result)) {
  3990. then.call(result, resolve, reject);
  3991. } else resolve(result);
  3992. } else reject(value);
  3993. } catch (e) {
  3994. if (domain && !exited) domain.exit();
  3995. reject(e);
  3996. }
  3997. };
  3998. while (chain.length > i) run(chain[i++]); // variable length - can't use forEach
  3999. promise._c = [];
  4000. promise._n = false;
  4001. if (isReject && !promise._h) onUnhandled(promise);
  4002. });
  4003. };
  4004. var onUnhandled = function (promise) {
  4005. task.call(global, function () {
  4006. var value = promise._v;
  4007. var unhandled = isUnhandled(promise);
  4008. var result, handler, console;
  4009. if (unhandled) {
  4010. result = perform(function () {
  4011. if (isNode) {
  4012. process.emit('unhandledRejection', value, promise);
  4013. } else if (handler = global.onunhandledrejection) {
  4014. handler({ promise: promise, reason: value });
  4015. } else if ((console = global.console) && console.error) {
  4016. console.error('Unhandled promise rejection', value);
  4017. }
  4018. });
  4019. // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
  4020. promise._h = isNode || isUnhandled(promise) ? 2 : 1;
  4021. } promise._a = undefined;
  4022. if (unhandled && result.e) throw result.v;
  4023. });
  4024. };
  4025. var isUnhandled = function (promise) {
  4026. return promise._h !== 1 && (promise._a || promise._c).length === 0;
  4027. };
  4028. var onHandleUnhandled = function (promise) {
  4029. task.call(global, function () {
  4030. var handler;
  4031. if (isNode) {
  4032. process.emit('rejectionHandled', promise);
  4033. } else if (handler = global.onrejectionhandled) {
  4034. handler({ promise: promise, reason: promise._v });
  4035. }
  4036. });
  4037. };
  4038. var $reject = function (value) {
  4039. var promise = this;
  4040. if (promise._d) return;
  4041. promise._d = true;
  4042. promise = promise._w || promise; // unwrap
  4043. promise._v = value;
  4044. promise._s = 2;
  4045. if (!promise._a) promise._a = promise._c.slice();
  4046. notify(promise, true);
  4047. };
  4048. var $resolve = function (value) {
  4049. var promise = this;
  4050. var then;
  4051. if (promise._d) return;
  4052. promise._d = true;
  4053. promise = promise._w || promise; // unwrap
  4054. try {
  4055. if (promise === value) throw TypeError("Promise can't be resolved itself");
  4056. if (then = isThenable(value)) {
  4057. microtask(function () {
  4058. var wrapper = { _w: promise, _d: false }; // wrap
  4059. try {
  4060. then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));
  4061. } catch (e) {
  4062. $reject.call(wrapper, e);
  4063. }
  4064. });
  4065. } else {
  4066. promise._v = value;
  4067. promise._s = 1;
  4068. notify(promise, false);
  4069. }
  4070. } catch (e) {
  4071. $reject.call({ _w: promise, _d: false }, e); // wrap
  4072. }
  4073. };
  4074. // constructor polyfill
  4075. if (!USE_NATIVE) {
  4076. // 25.4.3.1 Promise(executor)
  4077. $Promise = function Promise(executor) {
  4078. anInstance(this, $Promise, PROMISE, '_h');
  4079. aFunction(executor);
  4080. Internal.call(this);
  4081. try {
  4082. executor(ctx($resolve, this, 1), ctx($reject, this, 1));
  4083. } catch (err) {
  4084. $reject.call(this, err);
  4085. }
  4086. };
  4087. // eslint-disable-next-line no-unused-vars
  4088. Internal = function Promise(executor) {
  4089. this._c = []; // <- awaiting reactions
  4090. this._a = undefined; // <- checked in isUnhandled reactions
  4091. this._s = 0; // <- state
  4092. this._d = false; // <- done
  4093. this._v = undefined; // <- value
  4094. this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled
  4095. this._n = false; // <- notify
  4096. };
  4097. Internal.prototype = __webpack_require__(220)($Promise.prototype, {
  4098. // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
  4099. then: function then(onFulfilled, onRejected) {
  4100. var reaction = newPromiseCapability(speciesConstructor(this, $Promise));
  4101. reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
  4102. reaction.fail = typeof onRejected == 'function' && onRejected;
  4103. reaction.domain = isNode ? process.domain : undefined;
  4104. this._c.push(reaction);
  4105. if (this._a) this._a.push(reaction);
  4106. if (this._s) notify(this, false);
  4107. return reaction.promise;
  4108. },
  4109. // 25.4.5.1 Promise.prototype.catch(onRejected)
  4110. 'catch': function (onRejected) {
  4111. return this.then(undefined, onRejected);
  4112. }
  4113. });
  4114. OwnPromiseCapability = function () {
  4115. var promise = new Internal();
  4116. this.promise = promise;
  4117. this.resolve = ctx($resolve, promise, 1);
  4118. this.reject = ctx($reject, promise, 1);
  4119. };
  4120. newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
  4121. return C === $Promise || C === Wrapper
  4122. ? new OwnPromiseCapability(C)
  4123. : newGenericPromiseCapability(C);
  4124. };
  4125. }
  4126. $export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });
  4127. __webpack_require__(26)($Promise, PROMISE);
  4128. __webpack_require__(194)(PROMISE);
  4129. Wrapper = __webpack_require__(9)[PROMISE];
  4130. // statics
  4131. $export($export.S + $export.F * !USE_NATIVE, PROMISE, {
  4132. // 25.4.4.5 Promise.reject(r)
  4133. reject: function reject(r) {
  4134. var capability = newPromiseCapability(this);
  4135. var $$reject = capability.reject;
  4136. $$reject(r);
  4137. return capability.promise;
  4138. }
  4139. });
  4140. $export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {
  4141. // 25.4.4.6 Promise.resolve(x)
  4142. resolve: function resolve(x) {
  4143. return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);
  4144. }
  4145. });
  4146. $export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(167)(function (iter) {
  4147. $Promise.all(iter)['catch'](empty);
  4148. })), PROMISE, {
  4149. // 25.4.4.1 Promise.all(iterable)
  4150. all: function all(iterable) {
  4151. var C = this;
  4152. var capability = newPromiseCapability(C);
  4153. var resolve = capability.resolve;
  4154. var reject = capability.reject;
  4155. var result = perform(function () {
  4156. var values = [];
  4157. var index = 0;
  4158. var remaining = 1;
  4159. forOf(iterable, false, function (promise) {
  4160. var $index = index++;
  4161. var alreadyCalled = false;
  4162. values.push(undefined);
  4163. remaining++;
  4164. C.resolve(promise).then(function (value) {
  4165. if (alreadyCalled) return;
  4166. alreadyCalled = true;
  4167. values[$index] = value;
  4168. --remaining || resolve(values);
  4169. }, reject);
  4170. });
  4171. --remaining || resolve(values);
  4172. });
  4173. if (result.e) reject(result.v);
  4174. return capability.promise;
  4175. },
  4176. // 25.4.4.4 Promise.race(iterable)
  4177. race: function race(iterable) {
  4178. var C = this;
  4179. var capability = newPromiseCapability(C);
  4180. var reject = capability.reject;
  4181. var result = perform(function () {
  4182. forOf(iterable, false, function (promise) {
  4183. C.resolve(promise).then(capability.resolve, reject);
  4184. });
  4185. });
  4186. if (result.e) reject(result.v);
  4187. return capability.promise;
  4188. }
  4189. });
  4190. /***/ }),
  4191. /* 212 */
  4192. /***/ (function(module, exports) {
  4193. module.exports = function (it, Constructor, name, forbiddenField) {
  4194. if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
  4195. throw TypeError(name + ': incorrect invocation!');
  4196. } return it;
  4197. };
  4198. /***/ }),
  4199. /* 213 */
  4200. /***/ (function(module, exports, __webpack_require__) {
  4201. var ctx = __webpack_require__(23);
  4202. var call = __webpack_require__(163);
  4203. var isArrayIter = __webpack_require__(164);
  4204. var anObject = __webpack_require__(12);
  4205. var toLength = __webpack_require__(38);
  4206. var getIterFn = __webpack_require__(166);
  4207. var BREAK = {};
  4208. var RETURN = {};
  4209. var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
  4210. var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);
  4211. var f = ctx(fn, that, entries ? 2 : 1);
  4212. var index = 0;
  4213. var length, step, iterator, result;
  4214. if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
  4215. // fast case for arrays with default iterator
  4216. if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {
  4217. result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
  4218. if (result === BREAK || result === RETURN) return result;
  4219. } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
  4220. result = call(iterator, f, step.value, entries);
  4221. if (result === BREAK || result === RETURN) return result;
  4222. }
  4223. };
  4224. exports.BREAK = BREAK;
  4225. exports.RETURN = RETURN;
  4226. /***/ }),
  4227. /* 214 */
  4228. /***/ (function(module, exports, __webpack_require__) {
  4229. var ctx = __webpack_require__(23);
  4230. var invoke = __webpack_require__(78);
  4231. var html = __webpack_require__(49);
  4232. var cel = __webpack_require__(15);
  4233. var global = __webpack_require__(4);
  4234. var process = global.process;
  4235. var setTask = global.setImmediate;
  4236. var clearTask = global.clearImmediate;
  4237. var MessageChannel = global.MessageChannel;
  4238. var Dispatch = global.Dispatch;
  4239. var counter = 0;
  4240. var queue = {};
  4241. var ONREADYSTATECHANGE = 'onreadystatechange';
  4242. var defer, channel, port;
  4243. var run = function () {
  4244. var id = +this;
  4245. // eslint-disable-next-line no-prototype-builtins
  4246. if (queue.hasOwnProperty(id)) {
  4247. var fn = queue[id];
  4248. delete queue[id];
  4249. fn();
  4250. }
  4251. };
  4252. var listener = function (event) {
  4253. run.call(event.data);
  4254. };
  4255. // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
  4256. if (!setTask || !clearTask) {
  4257. setTask = function setImmediate(fn) {
  4258. var args = [];
  4259. var i = 1;
  4260. while (arguments.length > i) args.push(arguments[i++]);
  4261. queue[++counter] = function () {
  4262. // eslint-disable-next-line no-new-func
  4263. invoke(typeof fn == 'function' ? fn : Function(fn), args);
  4264. };
  4265. defer(counter);
  4266. return counter;
  4267. };
  4268. clearTask = function clearImmediate(id) {
  4269. delete queue[id];
  4270. };
  4271. // Node.js 0.8-
  4272. if (__webpack_require__(35)(process) == 'process') {
  4273. defer = function (id) {
  4274. process.nextTick(ctx(run, id, 1));
  4275. };
  4276. // Sphere (JS game engine) Dispatch API
  4277. } else if (Dispatch && Dispatch.now) {
  4278. defer = function (id) {
  4279. Dispatch.now(ctx(run, id, 1));
  4280. };
  4281. // Browsers with MessageChannel, includes WebWorkers
  4282. } else if (MessageChannel) {
  4283. channel = new MessageChannel();
  4284. port = channel.port2;
  4285. channel.port1.onmessage = listener;
  4286. defer = ctx(port.postMessage, port, 1);
  4287. // Browsers with postMessage, skip WebWorkers
  4288. // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
  4289. } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {
  4290. defer = function (id) {
  4291. global.postMessage(id + '', '*');
  4292. };
  4293. global.addEventListener('message', listener, false);
  4294. // IE8-
  4295. } else if (ONREADYSTATECHANGE in cel('script')) {
  4296. defer = function (id) {
  4297. html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {
  4298. html.removeChild(this);
  4299. run.call(id);
  4300. };
  4301. };
  4302. // Rest old browsers
  4303. } else {
  4304. defer = function (id) {
  4305. setTimeout(ctx(run, id, 1), 0);
  4306. };
  4307. }
  4308. }
  4309. module.exports = {
  4310. set: setTask,
  4311. clear: clearTask
  4312. };
  4313. /***/ }),
  4314. /* 215 */
  4315. /***/ (function(module, exports, __webpack_require__) {
  4316. var global = __webpack_require__(4);
  4317. var macrotask = __webpack_require__(214).set;
  4318. var Observer = global.MutationObserver || global.WebKitMutationObserver;
  4319. var process = global.process;
  4320. var Promise = global.Promise;
  4321. var isNode = __webpack_require__(35)(process) == 'process';
  4322. module.exports = function () {
  4323. var head, last, notify;
  4324. var flush = function () {
  4325. var parent, fn;
  4326. if (isNode && (parent = process.domain)) parent.exit();
  4327. while (head) {
  4328. fn = head.fn;
  4329. head = head.next;
  4330. try {
  4331. fn();
  4332. } catch (e) {
  4333. if (head) notify();
  4334. else last = undefined;
  4335. throw e;
  4336. }
  4337. } last = undefined;
  4338. if (parent) parent.enter();
  4339. };
  4340. // Node.js
  4341. if (isNode) {
  4342. notify = function () {
  4343. process.nextTick(flush);
  4344. };
  4345. // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339
  4346. } else if (Observer && !(global.navigator && global.navigator.standalone)) {
  4347. var toggle = true;
  4348. var node = document.createTextNode('');
  4349. new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new
  4350. notify = function () {
  4351. node.data = toggle = !toggle;
  4352. };
  4353. // environments with maybe non-completely correct, but existent Promise
  4354. } else if (Promise && Promise.resolve) {
  4355. // Promise.resolve without an argument throws an error in LG WebOS 2
  4356. var promise = Promise.resolve(undefined);
  4357. notify = function () {
  4358. promise.then(flush);
  4359. };
  4360. // for other environments - macrotask based on:
  4361. // - setImmediate
  4362. // - MessageChannel
  4363. // - window.postMessag
  4364. // - onreadystatechange
  4365. // - setTimeout
  4366. } else {
  4367. notify = function () {
  4368. // strange IE + webpack dev server bug - use .call(global)
  4369. macrotask.call(global, flush);
  4370. };
  4371. }
  4372. return function (fn) {
  4373. var task = { fn: fn, next: undefined };
  4374. if (last) last.next = task;
  4375. if (!head) {
  4376. head = task;
  4377. notify();
  4378. } last = task;
  4379. };
  4380. };
  4381. /***/ }),
  4382. /* 216 */
  4383. /***/ (function(module, exports, __webpack_require__) {
  4384. 'use strict';
  4385. // 25.4.1.5 NewPromiseCapability(C)
  4386. var aFunction = __webpack_require__(24);
  4387. function PromiseCapability(C) {
  4388. var resolve, reject;
  4389. this.promise = new C(function ($$resolve, $$reject) {
  4390. if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
  4391. resolve = $$resolve;
  4392. reject = $$reject;
  4393. });
  4394. this.resolve = aFunction(resolve);
  4395. this.reject = aFunction(reject);
  4396. }
  4397. module.exports.f = function (C) {
  4398. return new PromiseCapability(C);
  4399. };
  4400. /***/ }),
  4401. /* 217 */
  4402. /***/ (function(module, exports) {
  4403. module.exports = function (exec) {
  4404. try {
  4405. return { e: false, v: exec() };
  4406. } catch (e) {
  4407. return { e: true, v: e };
  4408. }
  4409. };
  4410. /***/ }),
  4411. /* 218 */
  4412. /***/ (function(module, exports, __webpack_require__) {
  4413. var global = __webpack_require__(4);
  4414. var navigator = global.navigator;
  4415. module.exports = navigator && navigator.userAgent || '';
  4416. /***/ }),
  4417. /* 219 */
  4418. /***/ (function(module, exports, __webpack_require__) {
  4419. var anObject = __webpack_require__(12);
  4420. var isObject = __webpack_require__(13);
  4421. var newPromiseCapability = __webpack_require__(216);
  4422. module.exports = function (C, x) {
  4423. anObject(C);
  4424. if (isObject(x) && x.constructor === C) return x;
  4425. var promiseCapability = newPromiseCapability.f(C);
  4426. var resolve = promiseCapability.resolve;
  4427. resolve(x);
  4428. return promiseCapability.promise;
  4429. };
  4430. /***/ }),
  4431. /* 220 */
  4432. /***/ (function(module, exports, __webpack_require__) {
  4433. var redefine = __webpack_require__(18);
  4434. module.exports = function (target, src, safe) {
  4435. for (var key in src) redefine(target, key, src[key], safe);
  4436. return target;
  4437. };
  4438. /***/ }),
  4439. /* 221 */
  4440. /***/ (function(module, exports, __webpack_require__) {
  4441. 'use strict';
  4442. var strong = __webpack_require__(222);
  4443. var validate = __webpack_require__(223);
  4444. var MAP = 'Map';
  4445. // 23.1 Map Objects
  4446. module.exports = __webpack_require__(224)(MAP, function (get) {
  4447. return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
  4448. }, {
  4449. // 23.1.3.6 Map.prototype.get(key)
  4450. get: function get(key) {
  4451. var entry = strong.getEntry(validate(this, MAP), key);
  4452. return entry && entry.v;
  4453. },
  4454. // 23.1.3.9 Map.prototype.set(key, value)
  4455. set: function set(key, value) {
  4456. return strong.def(validate(this, MAP), key === 0 ? 0 : key, value);
  4457. }
  4458. }, strong, true);
  4459. /***/ }),
  4460. /* 222 */
  4461. /***/ (function(module, exports, __webpack_require__) {
  4462. 'use strict';
  4463. var dP = __webpack_require__(11).f;
  4464. var create = __webpack_require__(47);
  4465. var redefineAll = __webpack_require__(220);
  4466. var ctx = __webpack_require__(23);
  4467. var anInstance = __webpack_require__(212);
  4468. var forOf = __webpack_require__(213);
  4469. var $iterDefine = __webpack_require__(129);
  4470. var step = __webpack_require__(196);
  4471. var setSpecies = __webpack_require__(194);
  4472. var DESCRIPTORS = __webpack_require__(6);
  4473. var fastKey = __webpack_require__(25).fastKey;
  4474. var validate = __webpack_require__(223);
  4475. var SIZE = DESCRIPTORS ? '_s' : 'size';
  4476. var getEntry = function (that, key) {
  4477. // fast case
  4478. var index = fastKey(key);
  4479. var entry;
  4480. if (index !== 'F') return that._i[index];
  4481. // frozen object case
  4482. for (entry = that._f; entry; entry = entry.n) {
  4483. if (entry.k == key) return entry;
  4484. }
  4485. };
  4486. module.exports = {
  4487. getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {
  4488. var C = wrapper(function (that, iterable) {
  4489. anInstance(that, C, NAME, '_i');
  4490. that._t = NAME; // collection type
  4491. that._i = create(null); // index
  4492. that._f = undefined; // first entry
  4493. that._l = undefined; // last entry
  4494. that[SIZE] = 0; // size
  4495. if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
  4496. });
  4497. redefineAll(C.prototype, {
  4498. // 23.1.3.1 Map.prototype.clear()
  4499. // 23.2.3.2 Set.prototype.clear()
  4500. clear: function clear() {
  4501. for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {
  4502. entry.r = true;
  4503. if (entry.p) entry.p = entry.p.n = undefined;
  4504. delete data[entry.i];
  4505. }
  4506. that._f = that._l = undefined;
  4507. that[SIZE] = 0;
  4508. },
  4509. // 23.1.3.3 Map.prototype.delete(key)
  4510. // 23.2.3.4 Set.prototype.delete(value)
  4511. 'delete': function (key) {
  4512. var that = validate(this, NAME);
  4513. var entry = getEntry(that, key);
  4514. if (entry) {
  4515. var next = entry.n;
  4516. var prev = entry.p;
  4517. delete that._i[entry.i];
  4518. entry.r = true;
  4519. if (prev) prev.n = next;
  4520. if (next) next.p = prev;
  4521. if (that._f == entry) that._f = next;
  4522. if (that._l == entry) that._l = prev;
  4523. that[SIZE]--;
  4524. } return !!entry;
  4525. },
  4526. // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
  4527. // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
  4528. forEach: function forEach(callbackfn /* , that = undefined */) {
  4529. validate(this, NAME);
  4530. var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
  4531. var entry;
  4532. while (entry = entry ? entry.n : this._f) {
  4533. f(entry.v, entry.k, this);
  4534. // revert to the last existing entry
  4535. while (entry && entry.r) entry = entry.p;
  4536. }
  4537. },
  4538. // 23.1.3.7 Map.prototype.has(key)
  4539. // 23.2.3.7 Set.prototype.has(value)
  4540. has: function has(key) {
  4541. return !!getEntry(validate(this, NAME), key);
  4542. }
  4543. });
  4544. if (DESCRIPTORS) dP(C.prototype, 'size', {
  4545. get: function () {
  4546. return validate(this, NAME)[SIZE];
  4547. }
  4548. });
  4549. return C;
  4550. },
  4551. def: function (that, key, value) {
  4552. var entry = getEntry(that, key);
  4553. var prev, index;
  4554. // change existing entry
  4555. if (entry) {
  4556. entry.v = value;
  4557. // create new entry
  4558. } else {
  4559. that._l = entry = {
  4560. i: index = fastKey(key, true), // <- index
  4561. k: key, // <- key
  4562. v: value, // <- value
  4563. p: prev = that._l, // <- previous entry
  4564. n: undefined, // <- next entry
  4565. r: false // <- removed
  4566. };
  4567. if (!that._f) that._f = entry;
  4568. if (prev) prev.n = entry;
  4569. that[SIZE]++;
  4570. // add to index
  4571. if (index !== 'F') that._i[index] = entry;
  4572. } return that;
  4573. },
  4574. getEntry: getEntry,
  4575. setStrong: function (C, NAME, IS_MAP) {
  4576. // add .keys, .values, .entries, [@@iterator]
  4577. // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11
  4578. $iterDefine(C, NAME, function (iterated, kind) {
  4579. this._t = validate(iterated, NAME); // target
  4580. this._k = kind; // kind
  4581. this._l = undefined; // previous
  4582. }, function () {
  4583. var that = this;
  4584. var kind = that._k;
  4585. var entry = that._l;
  4586. // revert to the last existing entry
  4587. while (entry && entry.r) entry = entry.p;
  4588. // get next entry
  4589. if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {
  4590. // or finish the iteration
  4591. that._t = undefined;
  4592. return step(1);
  4593. }
  4594. // return step by kind
  4595. if (kind == 'keys') return step(0, entry.k);
  4596. if (kind == 'values') return step(0, entry.v);
  4597. return step(0, [entry.k, entry.v]);
  4598. }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
  4599. // add [@@species], 23.1.2.2, 23.2.2.2
  4600. setSpecies(NAME);
  4601. }
  4602. };
  4603. /***/ }),
  4604. /* 223 */
  4605. /***/ (function(module, exports, __webpack_require__) {
  4606. var isObject = __webpack_require__(13);
  4607. module.exports = function (it, TYPE) {
  4608. if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');
  4609. return it;
  4610. };
  4611. /***/ }),
  4612. /* 224 */
  4613. /***/ (function(module, exports, __webpack_require__) {
  4614. 'use strict';
  4615. var global = __webpack_require__(4);
  4616. var $export = __webpack_require__(8);
  4617. var redefine = __webpack_require__(18);
  4618. var redefineAll = __webpack_require__(220);
  4619. var meta = __webpack_require__(25);
  4620. var forOf = __webpack_require__(213);
  4621. var anInstance = __webpack_require__(212);
  4622. var isObject = __webpack_require__(13);
  4623. var fails = __webpack_require__(7);
  4624. var $iterDetect = __webpack_require__(167);
  4625. var setToStringTag = __webpack_require__(26);
  4626. var inheritIfRequired = __webpack_require__(88);
  4627. module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {
  4628. var Base = global[NAME];
  4629. var C = Base;
  4630. var ADDER = IS_MAP ? 'set' : 'add';
  4631. var proto = C && C.prototype;
  4632. var O = {};
  4633. var fixMethod = function (KEY) {
  4634. var fn = proto[KEY];
  4635. redefine(proto, KEY,
  4636. KEY == 'delete' ? function (a) {
  4637. return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
  4638. } : KEY == 'has' ? function has(a) {
  4639. return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
  4640. } : KEY == 'get' ? function get(a) {
  4641. return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);
  4642. } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; }
  4643. : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; }
  4644. );
  4645. };
  4646. if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {
  4647. new C().entries().next();
  4648. }))) {
  4649. // create collection constructor
  4650. C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);
  4651. redefineAll(C.prototype, methods);
  4652. meta.NEED = true;
  4653. } else {
  4654. var instance = new C();
  4655. // early implementations not supports chaining
  4656. var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
  4657. // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
  4658. var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
  4659. // most early implementations doesn't supports iterables, most modern - not close it correctly
  4660. var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new
  4661. // for early implementations -0 and +0 not the same
  4662. var BUGGY_ZERO = !IS_WEAK && fails(function () {
  4663. // V8 ~ Chromium 42- fails only with 5+ elements
  4664. var $instance = new C();
  4665. var index = 5;
  4666. while (index--) $instance[ADDER](index, index);
  4667. return !$instance.has(-0);
  4668. });
  4669. if (!ACCEPT_ITERABLES) {
  4670. C = wrapper(function (target, iterable) {
  4671. anInstance(target, C, NAME);
  4672. var that = inheritIfRequired(new Base(), target, C);
  4673. if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
  4674. return that;
  4675. });
  4676. C.prototype = proto;
  4677. proto.constructor = C;
  4678. }
  4679. if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
  4680. fixMethod('delete');
  4681. fixMethod('has');
  4682. IS_MAP && fixMethod('get');
  4683. }
  4684. if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);
  4685. // weak collections should not contains .clear method
  4686. if (IS_WEAK && proto.clear) delete proto.clear;
  4687. }
  4688. setToStringTag(C, NAME);
  4689. O[NAME] = C;
  4690. $export($export.G + $export.W + $export.F * (C != Base), O);
  4691. if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);
  4692. return C;
  4693. };
  4694. /***/ }),
  4695. /* 225 */
  4696. /***/ (function(module, exports, __webpack_require__) {
  4697. 'use strict';
  4698. var strong = __webpack_require__(222);
  4699. var validate = __webpack_require__(223);
  4700. var SET = 'Set';
  4701. // 23.2 Set Objects
  4702. module.exports = __webpack_require__(224)(SET, function (get) {
  4703. return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
  4704. }, {
  4705. // 23.2.3.1 Set.prototype.add(value)
  4706. add: function add(value) {
  4707. return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);
  4708. }
  4709. }, strong);
  4710. /***/ }),
  4711. /* 226 */
  4712. /***/ (function(module, exports, __webpack_require__) {
  4713. 'use strict';
  4714. var global = __webpack_require__(4);
  4715. var each = __webpack_require__(174)(0);
  4716. var redefine = __webpack_require__(18);
  4717. var meta = __webpack_require__(25);
  4718. var assign = __webpack_require__(69);
  4719. var weak = __webpack_require__(227);
  4720. var isObject = __webpack_require__(13);
  4721. var validate = __webpack_require__(223);
  4722. var NATIVE_WEAK_MAP = __webpack_require__(223);
  4723. var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global;
  4724. var WEAK_MAP = 'WeakMap';
  4725. var getWeak = meta.getWeak;
  4726. var isExtensible = Object.isExtensible;
  4727. var uncaughtFrozenStore = weak.ufstore;
  4728. var InternalMap;
  4729. var wrapper = function (get) {
  4730. return function WeakMap() {
  4731. return get(this, arguments.length > 0 ? arguments[0] : undefined);
  4732. };
  4733. };
  4734. var methods = {
  4735. // 23.3.3.3 WeakMap.prototype.get(key)
  4736. get: function get(key) {
  4737. if (isObject(key)) {
  4738. var data = getWeak(key);
  4739. if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key);
  4740. return data ? data[this._i] : undefined;
  4741. }
  4742. },
  4743. // 23.3.3.5 WeakMap.prototype.set(key, value)
  4744. set: function set(key, value) {
  4745. return weak.def(validate(this, WEAK_MAP), key, value);
  4746. }
  4747. };
  4748. // 23.3 WeakMap Objects
  4749. var $WeakMap = module.exports = __webpack_require__(224)(WEAK_MAP, wrapper, methods, weak, true, true);
  4750. // IE11 WeakMap frozen keys fix
  4751. if (NATIVE_WEAK_MAP && IS_IE11) {
  4752. InternalMap = weak.getConstructor(wrapper, WEAK_MAP);
  4753. assign(InternalMap.prototype, methods);
  4754. meta.NEED = true;
  4755. each(['delete', 'has', 'get', 'set'], function (key) {
  4756. var proto = $WeakMap.prototype;
  4757. var method = proto[key];
  4758. redefine(proto, key, function (a, b) {
  4759. // store frozen objects on internal weakmap shim
  4760. if (isObject(a) && !isExtensible(a)) {
  4761. if (!this._f) this._f = new InternalMap();
  4762. var result = this._f[key](a, b);
  4763. return key == 'set' ? this : result;
  4764. // store all the rest on native weakmap
  4765. } return method.call(this, a, b);
  4766. });
  4767. });
  4768. }
  4769. /***/ }),
  4770. /* 227 */
  4771. /***/ (function(module, exports, __webpack_require__) {
  4772. 'use strict';
  4773. var redefineAll = __webpack_require__(220);
  4774. var getWeak = __webpack_require__(25).getWeak;
  4775. var anObject = __webpack_require__(12);
  4776. var isObject = __webpack_require__(13);
  4777. var anInstance = __webpack_require__(212);
  4778. var forOf = __webpack_require__(213);
  4779. var createArrayMethod = __webpack_require__(174);
  4780. var $has = __webpack_require__(5);
  4781. var validate = __webpack_require__(223);
  4782. var arrayFind = createArrayMethod(5);
  4783. var arrayFindIndex = createArrayMethod(6);
  4784. var id = 0;
  4785. // fallback for uncaught frozen keys
  4786. var uncaughtFrozenStore = function (that) {
  4787. return that._l || (that._l = new UncaughtFrozenStore());
  4788. };
  4789. var UncaughtFrozenStore = function () {
  4790. this.a = [];
  4791. };
  4792. var findUncaughtFrozen = function (store, key) {
  4793. return arrayFind(store.a, function (it) {
  4794. return it[0] === key;
  4795. });
  4796. };
  4797. UncaughtFrozenStore.prototype = {
  4798. get: function (key) {
  4799. var entry = findUncaughtFrozen(this, key);
  4800. if (entry) return entry[1];
  4801. },
  4802. has: function (key) {
  4803. return !!findUncaughtFrozen(this, key);
  4804. },
  4805. set: function (key, value) {
  4806. var entry = findUncaughtFrozen(this, key);
  4807. if (entry) entry[1] = value;
  4808. else this.a.push([key, value]);
  4809. },
  4810. 'delete': function (key) {
  4811. var index = arrayFindIndex(this.a, function (it) {
  4812. return it[0] === key;
  4813. });
  4814. if (~index) this.a.splice(index, 1);
  4815. return !!~index;
  4816. }
  4817. };
  4818. module.exports = {
  4819. getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {
  4820. var C = wrapper(function (that, iterable) {
  4821. anInstance(that, C, NAME, '_i');
  4822. that._t = NAME; // collection type
  4823. that._i = id++; // collection id
  4824. that._l = undefined; // leak store for uncaught frozen objects
  4825. if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
  4826. });
  4827. redefineAll(C.prototype, {
  4828. // 23.3.3.2 WeakMap.prototype.delete(key)
  4829. // 23.4.3.3 WeakSet.prototype.delete(value)
  4830. 'delete': function (key) {
  4831. if (!isObject(key)) return false;
  4832. var data = getWeak(key);
  4833. if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key);
  4834. return data && $has(data, this._i) && delete data[this._i];
  4835. },
  4836. // 23.3.3.4 WeakMap.prototype.has(key)
  4837. // 23.4.3.4 WeakSet.prototype.has(value)
  4838. has: function has(key) {
  4839. if (!isObject(key)) return false;
  4840. var data = getWeak(key);
  4841. if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key);
  4842. return data && $has(data, this._i);
  4843. }
  4844. });
  4845. return C;
  4846. },
  4847. def: function (that, key, value) {
  4848. var data = getWeak(anObject(key), true);
  4849. if (data === true) uncaughtFrozenStore(that).set(key, value);
  4850. else data[that._i] = value;
  4851. return that;
  4852. },
  4853. ufstore: uncaughtFrozenStore
  4854. };
  4855. /***/ }),
  4856. /* 228 */
  4857. /***/ (function(module, exports, __webpack_require__) {
  4858. 'use strict';
  4859. var weak = __webpack_require__(227);
  4860. var validate = __webpack_require__(223);
  4861. var WEAK_SET = 'WeakSet';
  4862. // 23.4 WeakSet Objects
  4863. __webpack_require__(224)(WEAK_SET, function (get) {
  4864. return function WeakSet() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
  4865. }, {
  4866. // 23.4.3.1 WeakSet.prototype.add(value)
  4867. add: function add(value) {
  4868. return weak.def(validate(this, WEAK_SET), value, true);
  4869. }
  4870. }, weak, false, true);
  4871. /***/ }),
  4872. /* 229 */
  4873. /***/ (function(module, exports, __webpack_require__) {
  4874. 'use strict';
  4875. var $export = __webpack_require__(8);
  4876. var $typed = __webpack_require__(230);
  4877. var buffer = __webpack_require__(231);
  4878. var anObject = __webpack_require__(12);
  4879. var toAbsoluteIndex = __webpack_require__(40);
  4880. var toLength = __webpack_require__(38);
  4881. var isObject = __webpack_require__(13);
  4882. var ArrayBuffer = __webpack_require__(4).ArrayBuffer;
  4883. var speciesConstructor = __webpack_require__(210);
  4884. var $ArrayBuffer = buffer.ArrayBuffer;
  4885. var $DataView = buffer.DataView;
  4886. var $isView = $typed.ABV && ArrayBuffer.isView;
  4887. var $slice = $ArrayBuffer.prototype.slice;
  4888. var VIEW = $typed.VIEW;
  4889. var ARRAY_BUFFER = 'ArrayBuffer';
  4890. $export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer });
  4891. $export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, {
  4892. // 24.1.3.1 ArrayBuffer.isView(arg)
  4893. isView: function isView(it) {
  4894. return $isView && $isView(it) || isObject(it) && VIEW in it;
  4895. }
  4896. });
  4897. $export($export.P + $export.U + $export.F * __webpack_require__(7)(function () {
  4898. return !new $ArrayBuffer(2).slice(1, undefined).byteLength;
  4899. }), ARRAY_BUFFER, {
  4900. // 24.1.4.3 ArrayBuffer.prototype.slice(start, end)
  4901. slice: function slice(start, end) {
  4902. if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix
  4903. var len = anObject(this).byteLength;
  4904. var first = toAbsoluteIndex(start, len);
  4905. var fin = toAbsoluteIndex(end === undefined ? len : end, len);
  4906. var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first));
  4907. var viewS = new $DataView(this);
  4908. var viewT = new $DataView(result);
  4909. var index = 0;
  4910. while (first < fin) {
  4911. viewT.setUint8(index++, viewS.getUint8(first++));
  4912. } return result;
  4913. }
  4914. });
  4915. __webpack_require__(194)(ARRAY_BUFFER);
  4916. /***/ }),
  4917. /* 230 */
  4918. /***/ (function(module, exports, __webpack_require__) {
  4919. var global = __webpack_require__(4);
  4920. var hide = __webpack_require__(10);
  4921. var uid = __webpack_require__(19);
  4922. var TYPED = uid('typed_array');
  4923. var VIEW = uid('view');
  4924. var ABV = !!(global.ArrayBuffer && global.DataView);
  4925. var CONSTR = ABV;
  4926. var i = 0;
  4927. var l = 9;
  4928. var Typed;
  4929. var TypedArrayConstructors = (
  4930. 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array'
  4931. ).split(',');
  4932. while (i < l) {
  4933. if (Typed = global[TypedArrayConstructors[i++]]) {
  4934. hide(Typed.prototype, TYPED, true);
  4935. hide(Typed.prototype, VIEW, true);
  4936. } else CONSTR = false;
  4937. }
  4938. module.exports = {
  4939. ABV: ABV,
  4940. CONSTR: CONSTR,
  4941. TYPED: TYPED,
  4942. VIEW: VIEW
  4943. };
  4944. /***/ }),
  4945. /* 231 */
  4946. /***/ (function(module, exports, __webpack_require__) {
  4947. 'use strict';
  4948. var global = __webpack_require__(4);
  4949. var DESCRIPTORS = __webpack_require__(6);
  4950. var LIBRARY = __webpack_require__(22);
  4951. var $typed = __webpack_require__(230);
  4952. var hide = __webpack_require__(10);
  4953. var redefineAll = __webpack_require__(220);
  4954. var fails = __webpack_require__(7);
  4955. var anInstance = __webpack_require__(212);
  4956. var toInteger = __webpack_require__(39);
  4957. var toLength = __webpack_require__(38);
  4958. var toIndex = __webpack_require__(232);
  4959. var gOPN = __webpack_require__(51).f;
  4960. var dP = __webpack_require__(11).f;
  4961. var arrayFill = __webpack_require__(190);
  4962. var setToStringTag = __webpack_require__(26);
  4963. var ARRAY_BUFFER = 'ArrayBuffer';
  4964. var DATA_VIEW = 'DataView';
  4965. var PROTOTYPE = 'prototype';
  4966. var WRONG_LENGTH = 'Wrong length!';
  4967. var WRONG_INDEX = 'Wrong index!';
  4968. var $ArrayBuffer = global[ARRAY_BUFFER];
  4969. var $DataView = global[DATA_VIEW];
  4970. var Math = global.Math;
  4971. var RangeError = global.RangeError;
  4972. // eslint-disable-next-line no-shadow-restricted-names
  4973. var Infinity = global.Infinity;
  4974. var BaseBuffer = $ArrayBuffer;
  4975. var abs = Math.abs;
  4976. var pow = Math.pow;
  4977. var floor = Math.floor;
  4978. var log = Math.log;
  4979. var LN2 = Math.LN2;
  4980. var BUFFER = 'buffer';
  4981. var BYTE_LENGTH = 'byteLength';
  4982. var BYTE_OFFSET = 'byteOffset';
  4983. var $BUFFER = DESCRIPTORS ? '_b' : BUFFER;
  4984. var $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH;
  4985. var $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET;
  4986. // IEEE754 conversions based on https://github.com/feross/ieee754
  4987. function packIEEE754(value, mLen, nBytes) {
  4988. var buffer = new Array(nBytes);
  4989. var eLen = nBytes * 8 - mLen - 1;
  4990. var eMax = (1 << eLen) - 1;
  4991. var eBias = eMax >> 1;
  4992. var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;
  4993. var i = 0;
  4994. var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
  4995. var e, m, c;
  4996. value = abs(value);
  4997. // eslint-disable-next-line no-self-compare
  4998. if (value != value || value === Infinity) {
  4999. // eslint-disable-next-line no-self-compare
  5000. m = value != value ? 1 : 0;
  5001. e = eMax;
  5002. } else {
  5003. e = floor(log(value) / LN2);
  5004. if (value * (c = pow(2, -e)) < 1) {
  5005. e--;
  5006. c *= 2;
  5007. }
  5008. if (e + eBias >= 1) {
  5009. value += rt / c;
  5010. } else {
  5011. value += rt * pow(2, 1 - eBias);
  5012. }
  5013. if (value * c >= 2) {
  5014. e++;
  5015. c /= 2;
  5016. }
  5017. if (e + eBias >= eMax) {
  5018. m = 0;
  5019. e = eMax;
  5020. } else if (e + eBias >= 1) {
  5021. m = (value * c - 1) * pow(2, mLen);
  5022. e = e + eBias;
  5023. } else {
  5024. m = value * pow(2, eBias - 1) * pow(2, mLen);
  5025. e = 0;
  5026. }
  5027. }
  5028. for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);
  5029. e = e << mLen | m;
  5030. eLen += mLen;
  5031. for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);
  5032. buffer[--i] |= s * 128;
  5033. return buffer;
  5034. }
  5035. function unpackIEEE754(buffer, mLen, nBytes) {
  5036. var eLen = nBytes * 8 - mLen - 1;
  5037. var eMax = (1 << eLen) - 1;
  5038. var eBias = eMax >> 1;
  5039. var nBits = eLen - 7;
  5040. var i = nBytes - 1;
  5041. var s = buffer[i--];
  5042. var e = s & 127;
  5043. var m;
  5044. s >>= 7;
  5045. for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8);
  5046. m = e & (1 << -nBits) - 1;
  5047. e >>= -nBits;
  5048. nBits += mLen;
  5049. for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8);
  5050. if (e === 0) {
  5051. e = 1 - eBias;
  5052. } else if (e === eMax) {
  5053. return m ? NaN : s ? -Infinity : Infinity;
  5054. } else {
  5055. m = m + pow(2, mLen);
  5056. e = e - eBias;
  5057. } return (s ? -1 : 1) * m * pow(2, e - mLen);
  5058. }
  5059. function unpackI32(bytes) {
  5060. return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0];
  5061. }
  5062. function packI8(it) {
  5063. return [it & 0xff];
  5064. }
  5065. function packI16(it) {
  5066. return [it & 0xff, it >> 8 & 0xff];
  5067. }
  5068. function packI32(it) {
  5069. return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff];
  5070. }
  5071. function packF64(it) {
  5072. return packIEEE754(it, 52, 8);
  5073. }
  5074. function packF32(it) {
  5075. return packIEEE754(it, 23, 4);
  5076. }
  5077. function addGetter(C, key, internal) {
  5078. dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } });
  5079. }
  5080. function get(view, bytes, index, isLittleEndian) {
  5081. var numIndex = +index;
  5082. var intIndex = toIndex(numIndex);
  5083. if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);
  5084. var store = view[$BUFFER]._b;
  5085. var start = intIndex + view[$OFFSET];
  5086. var pack = store.slice(start, start + bytes);
  5087. return isLittleEndian ? pack : pack.reverse();
  5088. }
  5089. function set(view, bytes, index, conversion, value, isLittleEndian) {
  5090. var numIndex = +index;
  5091. var intIndex = toIndex(numIndex);
  5092. if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);
  5093. var store = view[$BUFFER]._b;
  5094. var start = intIndex + view[$OFFSET];
  5095. var pack = conversion(+value);
  5096. for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1];
  5097. }
  5098. if (!$typed.ABV) {
  5099. $ArrayBuffer = function ArrayBuffer(length) {
  5100. anInstance(this, $ArrayBuffer, ARRAY_BUFFER);
  5101. var byteLength = toIndex(length);
  5102. this._b = arrayFill.call(new Array(byteLength), 0);
  5103. this[$LENGTH] = byteLength;
  5104. };
  5105. $DataView = function DataView(buffer, byteOffset, byteLength) {
  5106. anInstance(this, $DataView, DATA_VIEW);
  5107. anInstance(buffer, $ArrayBuffer, DATA_VIEW);
  5108. var bufferLength = buffer[$LENGTH];
  5109. var offset = toInteger(byteOffset);
  5110. if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!');
  5111. byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);
  5112. if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);
  5113. this[$BUFFER] = buffer;
  5114. this[$OFFSET] = offset;
  5115. this[$LENGTH] = byteLength;
  5116. };
  5117. if (DESCRIPTORS) {
  5118. addGetter($ArrayBuffer, BYTE_LENGTH, '_l');
  5119. addGetter($DataView, BUFFER, '_b');
  5120. addGetter($DataView, BYTE_LENGTH, '_l');
  5121. addGetter($DataView, BYTE_OFFSET, '_o');
  5122. }
  5123. redefineAll($DataView[PROTOTYPE], {
  5124. getInt8: function getInt8(byteOffset) {
  5125. return get(this, 1, byteOffset)[0] << 24 >> 24;
  5126. },
  5127. getUint8: function getUint8(byteOffset) {
  5128. return get(this, 1, byteOffset)[0];
  5129. },
  5130. getInt16: function getInt16(byteOffset /* , littleEndian */) {
  5131. var bytes = get(this, 2, byteOffset, arguments[1]);
  5132. return (bytes[1] << 8 | bytes[0]) << 16 >> 16;
  5133. },
  5134. getUint16: function getUint16(byteOffset /* , littleEndian */) {
  5135. var bytes = get(this, 2, byteOffset, arguments[1]);
  5136. return bytes[1] << 8 | bytes[0];
  5137. },
  5138. getInt32: function getInt32(byteOffset /* , littleEndian */) {
  5139. return unpackI32(get(this, 4, byteOffset, arguments[1]));
  5140. },
  5141. getUint32: function getUint32(byteOffset /* , littleEndian */) {
  5142. return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0;
  5143. },
  5144. getFloat32: function getFloat32(byteOffset /* , littleEndian */) {
  5145. return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4);
  5146. },
  5147. getFloat64: function getFloat64(byteOffset /* , littleEndian */) {
  5148. return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8);
  5149. },
  5150. setInt8: function setInt8(byteOffset, value) {
  5151. set(this, 1, byteOffset, packI8, value);
  5152. },
  5153. setUint8: function setUint8(byteOffset, value) {
  5154. set(this, 1, byteOffset, packI8, value);
  5155. },
  5156. setInt16: function setInt16(byteOffset, value /* , littleEndian */) {
  5157. set(this, 2, byteOffset, packI16, value, arguments[2]);
  5158. },
  5159. setUint16: function setUint16(byteOffset, value /* , littleEndian */) {
  5160. set(this, 2, byteOffset, packI16, value, arguments[2]);
  5161. },
  5162. setInt32: function setInt32(byteOffset, value /* , littleEndian */) {
  5163. set(this, 4, byteOffset, packI32, value, arguments[2]);
  5164. },
  5165. setUint32: function setUint32(byteOffset, value /* , littleEndian */) {
  5166. set(this, 4, byteOffset, packI32, value, arguments[2]);
  5167. },
  5168. setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {
  5169. set(this, 4, byteOffset, packF32, value, arguments[2]);
  5170. },
  5171. setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {
  5172. set(this, 8, byteOffset, packF64, value, arguments[2]);
  5173. }
  5174. });
  5175. } else {
  5176. if (!fails(function () {
  5177. $ArrayBuffer(1);
  5178. }) || !fails(function () {
  5179. new $ArrayBuffer(-1); // eslint-disable-line no-new
  5180. }) || fails(function () {
  5181. new $ArrayBuffer(); // eslint-disable-line no-new
  5182. new $ArrayBuffer(1.5); // eslint-disable-line no-new
  5183. new $ArrayBuffer(NaN); // eslint-disable-line no-new
  5184. return $ArrayBuffer.name != ARRAY_BUFFER;
  5185. })) {
  5186. $ArrayBuffer = function ArrayBuffer(length) {
  5187. anInstance(this, $ArrayBuffer);
  5188. return new BaseBuffer(toIndex(length));
  5189. };
  5190. var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE];
  5191. for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) {
  5192. if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]);
  5193. }
  5194. if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer;
  5195. }
  5196. // iOS Safari 7.x bug
  5197. var view = new $DataView(new $ArrayBuffer(2));
  5198. var $setInt8 = $DataView[PROTOTYPE].setInt8;
  5199. view.setInt8(0, 2147483648);
  5200. view.setInt8(1, 2147483649);
  5201. if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], {
  5202. setInt8: function setInt8(byteOffset, value) {
  5203. $setInt8.call(this, byteOffset, value << 24 >> 24);
  5204. },
  5205. setUint8: function setUint8(byteOffset, value) {
  5206. $setInt8.call(this, byteOffset, value << 24 >> 24);
  5207. }
  5208. }, true);
  5209. }
  5210. setToStringTag($ArrayBuffer, ARRAY_BUFFER);
  5211. setToStringTag($DataView, DATA_VIEW);
  5212. hide($DataView[PROTOTYPE], $typed.VIEW, true);
  5213. exports[ARRAY_BUFFER] = $ArrayBuffer;
  5214. exports[DATA_VIEW] = $DataView;
  5215. /***/ }),
  5216. /* 232 */
  5217. /***/ (function(module, exports, __webpack_require__) {
  5218. // https://tc39.github.io/ecma262/#sec-toindex
  5219. var toInteger = __webpack_require__(39);
  5220. var toLength = __webpack_require__(38);
  5221. module.exports = function (it) {
  5222. if (it === undefined) return 0;
  5223. var number = toInteger(it);
  5224. var length = toLength(number);
  5225. if (number !== length) throw RangeError('Wrong length!');
  5226. return length;
  5227. };
  5228. /***/ }),
  5229. /* 233 */
  5230. /***/ (function(module, exports, __webpack_require__) {
  5231. var $export = __webpack_require__(8);
  5232. $export($export.G + $export.W + $export.F * !__webpack_require__(230).ABV, {
  5233. DataView: __webpack_require__(231).DataView
  5234. });
  5235. /***/ }),
  5236. /* 234 */
  5237. /***/ (function(module, exports, __webpack_require__) {
  5238. __webpack_require__(235)('Int8', 1, function (init) {
  5239. return function Int8Array(data, byteOffset, length) {
  5240. return init(this, data, byteOffset, length);
  5241. };
  5242. });
  5243. /***/ }),
  5244. /* 235 */
  5245. /***/ (function(module, exports, __webpack_require__) {
  5246. 'use strict';
  5247. if (__webpack_require__(6)) {
  5248. var LIBRARY = __webpack_require__(22);
  5249. var global = __webpack_require__(4);
  5250. var fails = __webpack_require__(7);
  5251. var $export = __webpack_require__(8);
  5252. var $typed = __webpack_require__(230);
  5253. var $buffer = __webpack_require__(231);
  5254. var ctx = __webpack_require__(23);
  5255. var anInstance = __webpack_require__(212);
  5256. var propertyDesc = __webpack_require__(17);
  5257. var hide = __webpack_require__(10);
  5258. var redefineAll = __webpack_require__(220);
  5259. var toInteger = __webpack_require__(39);
  5260. var toLength = __webpack_require__(38);
  5261. var toIndex = __webpack_require__(232);
  5262. var toAbsoluteIndex = __webpack_require__(40);
  5263. var toPrimitive = __webpack_require__(16);
  5264. var has = __webpack_require__(5);
  5265. var classof = __webpack_require__(75);
  5266. var isObject = __webpack_require__(13);
  5267. var toObject = __webpack_require__(46);
  5268. var isArrayIter = __webpack_require__(164);
  5269. var create = __webpack_require__(47);
  5270. var getPrototypeOf = __webpack_require__(59);
  5271. var gOPN = __webpack_require__(51).f;
  5272. var getIterFn = __webpack_require__(166);
  5273. var uid = __webpack_require__(19);
  5274. var wks = __webpack_require__(27);
  5275. var createArrayMethod = __webpack_require__(174);
  5276. var createArrayIncludes = __webpack_require__(37);
  5277. var speciesConstructor = __webpack_require__(210);
  5278. var ArrayIterators = __webpack_require__(195);
  5279. var Iterators = __webpack_require__(130);
  5280. var $iterDetect = __webpack_require__(167);
  5281. var setSpecies = __webpack_require__(194);
  5282. var arrayFill = __webpack_require__(190);
  5283. var arrayCopyWithin = __webpack_require__(187);
  5284. var $DP = __webpack_require__(11);
  5285. var $GOPD = __webpack_require__(52);
  5286. var dP = $DP.f;
  5287. var gOPD = $GOPD.f;
  5288. var RangeError = global.RangeError;
  5289. var TypeError = global.TypeError;
  5290. var Uint8Array = global.Uint8Array;
  5291. var ARRAY_BUFFER = 'ArrayBuffer';
  5292. var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER;
  5293. var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';
  5294. var PROTOTYPE = 'prototype';
  5295. var ArrayProto = Array[PROTOTYPE];
  5296. var $ArrayBuffer = $buffer.ArrayBuffer;
  5297. var $DataView = $buffer.DataView;
  5298. var arrayForEach = createArrayMethod(0);
  5299. var arrayFilter = createArrayMethod(2);
  5300. var arraySome = createArrayMethod(3);
  5301. var arrayEvery = createArrayMethod(4);
  5302. var arrayFind = createArrayMethod(5);
  5303. var arrayFindIndex = createArrayMethod(6);
  5304. var arrayIncludes = createArrayIncludes(true);
  5305. var arrayIndexOf = createArrayIncludes(false);
  5306. var arrayValues = ArrayIterators.values;
  5307. var arrayKeys = ArrayIterators.keys;
  5308. var arrayEntries = ArrayIterators.entries;
  5309. var arrayLastIndexOf = ArrayProto.lastIndexOf;
  5310. var arrayReduce = ArrayProto.reduce;
  5311. var arrayReduceRight = ArrayProto.reduceRight;
  5312. var arrayJoin = ArrayProto.join;
  5313. var arraySort = ArrayProto.sort;
  5314. var arraySlice = ArrayProto.slice;
  5315. var arrayToString = ArrayProto.toString;
  5316. var arrayToLocaleString = ArrayProto.toLocaleString;
  5317. var ITERATOR = wks('iterator');
  5318. var TAG = wks('toStringTag');
  5319. var TYPED_CONSTRUCTOR = uid('typed_constructor');
  5320. var DEF_CONSTRUCTOR = uid('def_constructor');
  5321. var ALL_CONSTRUCTORS = $typed.CONSTR;
  5322. var TYPED_ARRAY = $typed.TYPED;
  5323. var VIEW = $typed.VIEW;
  5324. var WRONG_LENGTH = 'Wrong length!';
  5325. var $map = createArrayMethod(1, function (O, length) {
  5326. return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length);
  5327. });
  5328. var LITTLE_ENDIAN = fails(function () {
  5329. // eslint-disable-next-line no-undef
  5330. return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;
  5331. });
  5332. var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () {
  5333. new Uint8Array(1).set({});
  5334. });
  5335. var toOffset = function (it, BYTES) {
  5336. var offset = toInteger(it);
  5337. if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!');
  5338. return offset;
  5339. };
  5340. var validate = function (it) {
  5341. if (isObject(it) && TYPED_ARRAY in it) return it;
  5342. throw TypeError(it + ' is not a typed array!');
  5343. };
  5344. var allocate = function (C, length) {
  5345. if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) {
  5346. throw TypeError('It is not a typed array constructor!');
  5347. } return new C(length);
  5348. };
  5349. var speciesFromList = function (O, list) {
  5350. return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list);
  5351. };
  5352. var fromList = function (C, list) {
  5353. var index = 0;
  5354. var length = list.length;
  5355. var result = allocate(C, length);
  5356. while (length > index) result[index] = list[index++];
  5357. return result;
  5358. };
  5359. var addGetter = function (it, key, internal) {
  5360. dP(it, key, { get: function () { return this._d[internal]; } });
  5361. };
  5362. var $from = function from(source /* , mapfn, thisArg */) {
  5363. var O = toObject(source);
  5364. var aLen = arguments.length;
  5365. var mapfn = aLen > 1 ? arguments[1] : undefined;
  5366. var mapping = mapfn !== undefined;
  5367. var iterFn = getIterFn(O);
  5368. var i, length, values, result, step, iterator;
  5369. if (iterFn != undefined && !isArrayIter(iterFn)) {
  5370. for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) {
  5371. values.push(step.value);
  5372. } O = values;
  5373. }
  5374. if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2);
  5375. for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) {
  5376. result[i] = mapping ? mapfn(O[i], i) : O[i];
  5377. }
  5378. return result;
  5379. };
  5380. var $of = function of(/* ...items */) {
  5381. var index = 0;
  5382. var length = arguments.length;
  5383. var result = allocate(this, length);
  5384. while (length > index) result[index] = arguments[index++];
  5385. return result;
  5386. };
  5387. // iOS Safari 6.x fails here
  5388. var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); });
  5389. var $toLocaleString = function toLocaleString() {
  5390. return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments);
  5391. };
  5392. var proto = {
  5393. copyWithin: function copyWithin(target, start /* , end */) {
  5394. return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined);
  5395. },
  5396. every: function every(callbackfn /* , thisArg */) {
  5397. return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  5398. },
  5399. fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars
  5400. return arrayFill.apply(validate(this), arguments);
  5401. },
  5402. filter: function filter(callbackfn /* , thisArg */) {
  5403. return speciesFromList(this, arrayFilter(validate(this), callbackfn,
  5404. arguments.length > 1 ? arguments[1] : undefined));
  5405. },
  5406. find: function find(predicate /* , thisArg */) {
  5407. return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
  5408. },
  5409. findIndex: function findIndex(predicate /* , thisArg */) {
  5410. return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
  5411. },
  5412. forEach: function forEach(callbackfn /* , thisArg */) {
  5413. arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  5414. },
  5415. indexOf: function indexOf(searchElement /* , fromIndex */) {
  5416. return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
  5417. },
  5418. includes: function includes(searchElement /* , fromIndex */) {
  5419. return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
  5420. },
  5421. join: function join(separator) { // eslint-disable-line no-unused-vars
  5422. return arrayJoin.apply(validate(this), arguments);
  5423. },
  5424. lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars
  5425. return arrayLastIndexOf.apply(validate(this), arguments);
  5426. },
  5427. map: function map(mapfn /* , thisArg */) {
  5428. return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined);
  5429. },
  5430. reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars
  5431. return arrayReduce.apply(validate(this), arguments);
  5432. },
  5433. reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars
  5434. return arrayReduceRight.apply(validate(this), arguments);
  5435. },
  5436. reverse: function reverse() {
  5437. var that = this;
  5438. var length = validate(that).length;
  5439. var middle = Math.floor(length / 2);
  5440. var index = 0;
  5441. var value;
  5442. while (index < middle) {
  5443. value = that[index];
  5444. that[index++] = that[--length];
  5445. that[length] = value;
  5446. } return that;
  5447. },
  5448. some: function some(callbackfn /* , thisArg */) {
  5449. return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  5450. },
  5451. sort: function sort(comparefn) {
  5452. return arraySort.call(validate(this), comparefn);
  5453. },
  5454. subarray: function subarray(begin, end) {
  5455. var O = validate(this);
  5456. var length = O.length;
  5457. var $begin = toAbsoluteIndex(begin, length);
  5458. return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))(
  5459. O.buffer,
  5460. O.byteOffset + $begin * O.BYTES_PER_ELEMENT,
  5461. toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin)
  5462. );
  5463. }
  5464. };
  5465. var $slice = function slice(start, end) {
  5466. return speciesFromList(this, arraySlice.call(validate(this), start, end));
  5467. };
  5468. var $set = function set(arrayLike /* , offset */) {
  5469. validate(this);
  5470. var offset = toOffset(arguments[1], 1);
  5471. var length = this.length;
  5472. var src = toObject(arrayLike);
  5473. var len = toLength(src.length);
  5474. var index = 0;
  5475. if (len + offset > length) throw RangeError(WRONG_LENGTH);
  5476. while (index < len) this[offset + index] = src[index++];
  5477. };
  5478. var $iterators = {
  5479. entries: function entries() {
  5480. return arrayEntries.call(validate(this));
  5481. },
  5482. keys: function keys() {
  5483. return arrayKeys.call(validate(this));
  5484. },
  5485. values: function values() {
  5486. return arrayValues.call(validate(this));
  5487. }
  5488. };
  5489. var isTAIndex = function (target, key) {
  5490. return isObject(target)
  5491. && target[TYPED_ARRAY]
  5492. && typeof key != 'symbol'
  5493. && key in target
  5494. && String(+key) == String(key);
  5495. };
  5496. var $getDesc = function getOwnPropertyDescriptor(target, key) {
  5497. return isTAIndex(target, key = toPrimitive(key, true))
  5498. ? propertyDesc(2, target[key])
  5499. : gOPD(target, key);
  5500. };
  5501. var $setDesc = function defineProperty(target, key, desc) {
  5502. if (isTAIndex(target, key = toPrimitive(key, true))
  5503. && isObject(desc)
  5504. && has(desc, 'value')
  5505. && !has(desc, 'get')
  5506. && !has(desc, 'set')
  5507. // TODO: add validation descriptor w/o calling accessors
  5508. && !desc.configurable
  5509. && (!has(desc, 'writable') || desc.writable)
  5510. && (!has(desc, 'enumerable') || desc.enumerable)
  5511. ) {
  5512. target[key] = desc.value;
  5513. return target;
  5514. } return dP(target, key, desc);
  5515. };
  5516. if (!ALL_CONSTRUCTORS) {
  5517. $GOPD.f = $getDesc;
  5518. $DP.f = $setDesc;
  5519. }
  5520. $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', {
  5521. getOwnPropertyDescriptor: $getDesc,
  5522. defineProperty: $setDesc
  5523. });
  5524. if (fails(function () { arrayToString.call({}); })) {
  5525. arrayToString = arrayToLocaleString = function toString() {
  5526. return arrayJoin.call(this);
  5527. };
  5528. }
  5529. var $TypedArrayPrototype$ = redefineAll({}, proto);
  5530. redefineAll($TypedArrayPrototype$, $iterators);
  5531. hide($TypedArrayPrototype$, ITERATOR, $iterators.values);
  5532. redefineAll($TypedArrayPrototype$, {
  5533. slice: $slice,
  5534. set: $set,
  5535. constructor: function () { /* noop */ },
  5536. toString: arrayToString,
  5537. toLocaleString: $toLocaleString
  5538. });
  5539. addGetter($TypedArrayPrototype$, 'buffer', 'b');
  5540. addGetter($TypedArrayPrototype$, 'byteOffset', 'o');
  5541. addGetter($TypedArrayPrototype$, 'byteLength', 'l');
  5542. addGetter($TypedArrayPrototype$, 'length', 'e');
  5543. dP($TypedArrayPrototype$, TAG, {
  5544. get: function () { return this[TYPED_ARRAY]; }
  5545. });
  5546. // eslint-disable-next-line max-statements
  5547. module.exports = function (KEY, BYTES, wrapper, CLAMPED) {
  5548. CLAMPED = !!CLAMPED;
  5549. var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array';
  5550. var GETTER = 'get' + KEY;
  5551. var SETTER = 'set' + KEY;
  5552. var TypedArray = global[NAME];
  5553. var Base = TypedArray || {};
  5554. var TAC = TypedArray && getPrototypeOf(TypedArray);
  5555. var FORCED = !TypedArray || !$typed.ABV;
  5556. var O = {};
  5557. var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE];
  5558. var getter = function (that, index) {
  5559. var data = that._d;
  5560. return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN);
  5561. };
  5562. var setter = function (that, index, value) {
  5563. var data = that._d;
  5564. if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff;
  5565. data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN);
  5566. };
  5567. var addElement = function (that, index) {
  5568. dP(that, index, {
  5569. get: function () {
  5570. return getter(this, index);
  5571. },
  5572. set: function (value) {
  5573. return setter(this, index, value);
  5574. },
  5575. enumerable: true
  5576. });
  5577. };
  5578. if (FORCED) {
  5579. TypedArray = wrapper(function (that, data, $offset, $length) {
  5580. anInstance(that, TypedArray, NAME, '_d');
  5581. var index = 0;
  5582. var offset = 0;
  5583. var buffer, byteLength, length, klass;
  5584. if (!isObject(data)) {
  5585. length = toIndex(data);
  5586. byteLength = length * BYTES;
  5587. buffer = new $ArrayBuffer(byteLength);
  5588. } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {
  5589. buffer = data;
  5590. offset = toOffset($offset, BYTES);
  5591. var $len = data.byteLength;
  5592. if ($length === undefined) {
  5593. if ($len % BYTES) throw RangeError(WRONG_LENGTH);
  5594. byteLength = $len - offset;
  5595. if (byteLength < 0) throw RangeError(WRONG_LENGTH);
  5596. } else {
  5597. byteLength = toLength($length) * BYTES;
  5598. if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH);
  5599. }
  5600. length = byteLength / BYTES;
  5601. } else if (TYPED_ARRAY in data) {
  5602. return fromList(TypedArray, data);
  5603. } else {
  5604. return $from.call(TypedArray, data);
  5605. }
  5606. hide(that, '_d', {
  5607. b: buffer,
  5608. o: offset,
  5609. l: byteLength,
  5610. e: length,
  5611. v: new $DataView(buffer)
  5612. });
  5613. while (index < length) addElement(that, index++);
  5614. });
  5615. TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$);
  5616. hide(TypedArrayPrototype, 'constructor', TypedArray);
  5617. } else if (!fails(function () {
  5618. TypedArray(1);
  5619. }) || !fails(function () {
  5620. new TypedArray(-1); // eslint-disable-line no-new
  5621. }) || !$iterDetect(function (iter) {
  5622. new TypedArray(); // eslint-disable-line no-new
  5623. new TypedArray(null); // eslint-disable-line no-new
  5624. new TypedArray(1.5); // eslint-disable-line no-new
  5625. new TypedArray(iter); // eslint-disable-line no-new
  5626. }, true)) {
  5627. TypedArray = wrapper(function (that, data, $offset, $length) {
  5628. anInstance(that, TypedArray, NAME);
  5629. var klass;
  5630. // `ws` module bug, temporarily remove validation length for Uint8Array
  5631. // https://github.com/websockets/ws/pull/645
  5632. if (!isObject(data)) return new Base(toIndex(data));
  5633. if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {
  5634. return $length !== undefined
  5635. ? new Base(data, toOffset($offset, BYTES), $length)
  5636. : $offset !== undefined
  5637. ? new Base(data, toOffset($offset, BYTES))
  5638. : new Base(data);
  5639. }
  5640. if (TYPED_ARRAY in data) return fromList(TypedArray, data);
  5641. return $from.call(TypedArray, data);
  5642. });
  5643. arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) {
  5644. if (!(key in TypedArray)) hide(TypedArray, key, Base[key]);
  5645. });
  5646. TypedArray[PROTOTYPE] = TypedArrayPrototype;
  5647. if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray;
  5648. }
  5649. var $nativeIterator = TypedArrayPrototype[ITERATOR];
  5650. var CORRECT_ITER_NAME = !!$nativeIterator
  5651. && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined);
  5652. var $iterator = $iterators.values;
  5653. hide(TypedArray, TYPED_CONSTRUCTOR, true);
  5654. hide(TypedArrayPrototype, TYPED_ARRAY, NAME);
  5655. hide(TypedArrayPrototype, VIEW, true);
  5656. hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray);
  5657. if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) {
  5658. dP(TypedArrayPrototype, TAG, {
  5659. get: function () { return NAME; }
  5660. });
  5661. }
  5662. O[NAME] = TypedArray;
  5663. $export($export.G + $export.W + $export.F * (TypedArray != Base), O);
  5664. $export($export.S, NAME, {
  5665. BYTES_PER_ELEMENT: BYTES
  5666. });
  5667. $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, {
  5668. from: $from,
  5669. of: $of
  5670. });
  5671. if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES);
  5672. $export($export.P, NAME, proto);
  5673. setSpecies(NAME);
  5674. $export($export.P + $export.F * FORCED_SET, NAME, { set: $set });
  5675. $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators);
  5676. if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString;
  5677. $export($export.P + $export.F * fails(function () {
  5678. new TypedArray(1).slice();
  5679. }), NAME, { slice: $slice });
  5680. $export($export.P + $export.F * (fails(function () {
  5681. return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString();
  5682. }) || !fails(function () {
  5683. TypedArrayPrototype.toLocaleString.call([1, 2]);
  5684. })), NAME, { toLocaleString: $toLocaleString });
  5685. Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator;
  5686. if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator);
  5687. };
  5688. } else module.exports = function () { /* empty */ };
  5689. /***/ }),
  5690. /* 236 */
  5691. /***/ (function(module, exports, __webpack_require__) {
  5692. __webpack_require__(235)('Uint8', 1, function (init) {
  5693. return function Uint8Array(data, byteOffset, length) {
  5694. return init(this, data, byteOffset, length);
  5695. };
  5696. });
  5697. /***/ }),
  5698. /* 237 */
  5699. /***/ (function(module, exports, __webpack_require__) {
  5700. __webpack_require__(235)('Uint8', 1, function (init) {
  5701. return function Uint8ClampedArray(data, byteOffset, length) {
  5702. return init(this, data, byteOffset, length);
  5703. };
  5704. }, true);
  5705. /***/ }),
  5706. /* 238 */
  5707. /***/ (function(module, exports, __webpack_require__) {
  5708. __webpack_require__(235)('Int16', 2, function (init) {
  5709. return function Int16Array(data, byteOffset, length) {
  5710. return init(this, data, byteOffset, length);
  5711. };
  5712. });
  5713. /***/ }),
  5714. /* 239 */
  5715. /***/ (function(module, exports, __webpack_require__) {
  5716. __webpack_require__(235)('Uint16', 2, function (init) {
  5717. return function Uint16Array(data, byteOffset, length) {
  5718. return init(this, data, byteOffset, length);
  5719. };
  5720. });
  5721. /***/ }),
  5722. /* 240 */
  5723. /***/ (function(module, exports, __webpack_require__) {
  5724. __webpack_require__(235)('Int32', 4, function (init) {
  5725. return function Int32Array(data, byteOffset, length) {
  5726. return init(this, data, byteOffset, length);
  5727. };
  5728. });
  5729. /***/ }),
  5730. /* 241 */
  5731. /***/ (function(module, exports, __webpack_require__) {
  5732. __webpack_require__(235)('Uint32', 4, function (init) {
  5733. return function Uint32Array(data, byteOffset, length) {
  5734. return init(this, data, byteOffset, length);
  5735. };
  5736. });
  5737. /***/ }),
  5738. /* 242 */
  5739. /***/ (function(module, exports, __webpack_require__) {
  5740. __webpack_require__(235)('Float32', 4, function (init) {
  5741. return function Float32Array(data, byteOffset, length) {
  5742. return init(this, data, byteOffset, length);
  5743. };
  5744. });
  5745. /***/ }),
  5746. /* 243 */
  5747. /***/ (function(module, exports, __webpack_require__) {
  5748. __webpack_require__(235)('Float64', 8, function (init) {
  5749. return function Float64Array(data, byteOffset, length) {
  5750. return init(this, data, byteOffset, length);
  5751. };
  5752. });
  5753. /***/ }),
  5754. /* 244 */
  5755. /***/ (function(module, exports, __webpack_require__) {
  5756. // 26.1.1 Reflect.apply(target, thisArgument, argumentsList)
  5757. var $export = __webpack_require__(8);
  5758. var aFunction = __webpack_require__(24);
  5759. var anObject = __webpack_require__(12);
  5760. var rApply = (__webpack_require__(4).Reflect || {}).apply;
  5761. var fApply = Function.apply;
  5762. // MS Edge argumentsList argument is optional
  5763. $export($export.S + $export.F * !__webpack_require__(7)(function () {
  5764. rApply(function () { /* empty */ });
  5765. }), 'Reflect', {
  5766. apply: function apply(target, thisArgument, argumentsList) {
  5767. var T = aFunction(target);
  5768. var L = anObject(argumentsList);
  5769. return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L);
  5770. }
  5771. });
  5772. /***/ }),
  5773. /* 245 */
  5774. /***/ (function(module, exports, __webpack_require__) {
  5775. // 26.1.2 Reflect.construct(target, argumentsList [, newTarget])
  5776. var $export = __webpack_require__(8);
  5777. var create = __webpack_require__(47);
  5778. var aFunction = __webpack_require__(24);
  5779. var anObject = __webpack_require__(12);
  5780. var isObject = __webpack_require__(13);
  5781. var fails = __webpack_require__(7);
  5782. var bind = __webpack_require__(77);
  5783. var rConstruct = (__webpack_require__(4).Reflect || {}).construct;
  5784. // MS Edge supports only 2 arguments and argumentsList argument is optional
  5785. // FF Nightly sets third argument as `new.target`, but does not create `this` from it
  5786. var NEW_TARGET_BUG = fails(function () {
  5787. function F() { /* empty */ }
  5788. return !(rConstruct(function () { /* empty */ }, [], F) instanceof F);
  5789. });
  5790. var ARGS_BUG = !fails(function () {
  5791. rConstruct(function () { /* empty */ });
  5792. });
  5793. $export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', {
  5794. construct: function construct(Target, args /* , newTarget */) {
  5795. aFunction(Target);
  5796. anObject(args);
  5797. var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]);
  5798. if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget);
  5799. if (Target == newTarget) {
  5800. // w/o altered newTarget, optimization for 0-4 arguments
  5801. switch (args.length) {
  5802. case 0: return new Target();
  5803. case 1: return new Target(args[0]);
  5804. case 2: return new Target(args[0], args[1]);
  5805. case 3: return new Target(args[0], args[1], args[2]);
  5806. case 4: return new Target(args[0], args[1], args[2], args[3]);
  5807. }
  5808. // w/o altered newTarget, lot of arguments case
  5809. var $args = [null];
  5810. $args.push.apply($args, args);
  5811. return new (bind.apply(Target, $args))();
  5812. }
  5813. // with altered newTarget, not support built-in constructors
  5814. var proto = newTarget.prototype;
  5815. var instance = create(isObject(proto) ? proto : Object.prototype);
  5816. var result = Function.apply.call(Target, instance, args);
  5817. return isObject(result) ? result : instance;
  5818. }
  5819. });
  5820. /***/ }),
  5821. /* 246 */
  5822. /***/ (function(module, exports, __webpack_require__) {
  5823. // 26.1.3 Reflect.defineProperty(target, propertyKey, attributes)
  5824. var dP = __webpack_require__(11);
  5825. var $export = __webpack_require__(8);
  5826. var anObject = __webpack_require__(12);
  5827. var toPrimitive = __webpack_require__(16);
  5828. // MS Edge has broken Reflect.defineProperty - throwing instead of returning false
  5829. $export($export.S + $export.F * __webpack_require__(7)(function () {
  5830. // eslint-disable-next-line no-undef
  5831. Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 });
  5832. }), 'Reflect', {
  5833. defineProperty: function defineProperty(target, propertyKey, attributes) {
  5834. anObject(target);
  5835. propertyKey = toPrimitive(propertyKey, true);
  5836. anObject(attributes);
  5837. try {
  5838. dP.f(target, propertyKey, attributes);
  5839. return true;
  5840. } catch (e) {
  5841. return false;
  5842. }
  5843. }
  5844. });
  5845. /***/ }),
  5846. /* 247 */
  5847. /***/ (function(module, exports, __webpack_require__) {
  5848. // 26.1.4 Reflect.deleteProperty(target, propertyKey)
  5849. var $export = __webpack_require__(8);
  5850. var gOPD = __webpack_require__(52).f;
  5851. var anObject = __webpack_require__(12);
  5852. $export($export.S, 'Reflect', {
  5853. deleteProperty: function deleteProperty(target, propertyKey) {
  5854. var desc = gOPD(anObject(target), propertyKey);
  5855. return desc && !desc.configurable ? false : delete target[propertyKey];
  5856. }
  5857. });
  5858. /***/ }),
  5859. /* 248 */
  5860. /***/ (function(module, exports, __webpack_require__) {
  5861. 'use strict';
  5862. // 26.1.5 Reflect.enumerate(target)
  5863. var $export = __webpack_require__(8);
  5864. var anObject = __webpack_require__(12);
  5865. var Enumerate = function (iterated) {
  5866. this._t = anObject(iterated); // target
  5867. this._i = 0; // next index
  5868. var keys = this._k = []; // keys
  5869. var key;
  5870. for (key in iterated) keys.push(key);
  5871. };
  5872. __webpack_require__(131)(Enumerate, 'Object', function () {
  5873. var that = this;
  5874. var keys = that._k;
  5875. var key;
  5876. do {
  5877. if (that._i >= keys.length) return { value: undefined, done: true };
  5878. } while (!((key = keys[that._i++]) in that._t));
  5879. return { value: key, done: false };
  5880. });
  5881. $export($export.S, 'Reflect', {
  5882. enumerate: function enumerate(target) {
  5883. return new Enumerate(target);
  5884. }
  5885. });
  5886. /***/ }),
  5887. /* 249 */
  5888. /***/ (function(module, exports, __webpack_require__) {
  5889. // 26.1.6 Reflect.get(target, propertyKey [, receiver])
  5890. var gOPD = __webpack_require__(52);
  5891. var getPrototypeOf = __webpack_require__(59);
  5892. var has = __webpack_require__(5);
  5893. var $export = __webpack_require__(8);
  5894. var isObject = __webpack_require__(13);
  5895. var anObject = __webpack_require__(12);
  5896. function get(target, propertyKey /* , receiver */) {
  5897. var receiver = arguments.length < 3 ? target : arguments[2];
  5898. var desc, proto;
  5899. if (anObject(target) === receiver) return target[propertyKey];
  5900. if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value')
  5901. ? desc.value
  5902. : desc.get !== undefined
  5903. ? desc.get.call(receiver)
  5904. : undefined;
  5905. if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver);
  5906. }
  5907. $export($export.S, 'Reflect', { get: get });
  5908. /***/ }),
  5909. /* 250 */
  5910. /***/ (function(module, exports, __webpack_require__) {
  5911. // 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey)
  5912. var gOPD = __webpack_require__(52);
  5913. var $export = __webpack_require__(8);
  5914. var anObject = __webpack_require__(12);
  5915. $export($export.S, 'Reflect', {
  5916. getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) {
  5917. return gOPD.f(anObject(target), propertyKey);
  5918. }
  5919. });
  5920. /***/ }),
  5921. /* 251 */
  5922. /***/ (function(module, exports, __webpack_require__) {
  5923. // 26.1.8 Reflect.getPrototypeOf(target)
  5924. var $export = __webpack_require__(8);
  5925. var getProto = __webpack_require__(59);
  5926. var anObject = __webpack_require__(12);
  5927. $export($export.S, 'Reflect', {
  5928. getPrototypeOf: function getPrototypeOf(target) {
  5929. return getProto(anObject(target));
  5930. }
  5931. });
  5932. /***/ }),
  5933. /* 252 */
  5934. /***/ (function(module, exports, __webpack_require__) {
  5935. // 26.1.9 Reflect.has(target, propertyKey)
  5936. var $export = __webpack_require__(8);
  5937. $export($export.S, 'Reflect', {
  5938. has: function has(target, propertyKey) {
  5939. return propertyKey in target;
  5940. }
  5941. });
  5942. /***/ }),
  5943. /* 253 */
  5944. /***/ (function(module, exports, __webpack_require__) {
  5945. // 26.1.10 Reflect.isExtensible(target)
  5946. var $export = __webpack_require__(8);
  5947. var anObject = __webpack_require__(12);
  5948. var $isExtensible = Object.isExtensible;
  5949. $export($export.S, 'Reflect', {
  5950. isExtensible: function isExtensible(target) {
  5951. anObject(target);
  5952. return $isExtensible ? $isExtensible(target) : true;
  5953. }
  5954. });
  5955. /***/ }),
  5956. /* 254 */
  5957. /***/ (function(module, exports, __webpack_require__) {
  5958. // 26.1.11 Reflect.ownKeys(target)
  5959. var $export = __webpack_require__(8);
  5960. $export($export.S, 'Reflect', { ownKeys: __webpack_require__(255) });
  5961. /***/ }),
  5962. /* 255 */
  5963. /***/ (function(module, exports, __webpack_require__) {
  5964. // all object keys, includes non-enumerable and symbols
  5965. var gOPN = __webpack_require__(51);
  5966. var gOPS = __webpack_require__(43);
  5967. var anObject = __webpack_require__(12);
  5968. var Reflect = __webpack_require__(4).Reflect;
  5969. module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) {
  5970. var keys = gOPN.f(anObject(it));
  5971. var getSymbols = gOPS.f;
  5972. return getSymbols ? keys.concat(getSymbols(it)) : keys;
  5973. };
  5974. /***/ }),
  5975. /* 256 */
  5976. /***/ (function(module, exports, __webpack_require__) {
  5977. // 26.1.12 Reflect.preventExtensions(target)
  5978. var $export = __webpack_require__(8);
  5979. var anObject = __webpack_require__(12);
  5980. var $preventExtensions = Object.preventExtensions;
  5981. $export($export.S, 'Reflect', {
  5982. preventExtensions: function preventExtensions(target) {
  5983. anObject(target);
  5984. try {
  5985. if ($preventExtensions) $preventExtensions(target);
  5986. return true;
  5987. } catch (e) {
  5988. return false;
  5989. }
  5990. }
  5991. });
  5992. /***/ }),
  5993. /* 257 */
  5994. /***/ (function(module, exports, __webpack_require__) {
  5995. // 26.1.13 Reflect.set(target, propertyKey, V [, receiver])
  5996. var dP = __webpack_require__(11);
  5997. var gOPD = __webpack_require__(52);
  5998. var getPrototypeOf = __webpack_require__(59);
  5999. var has = __webpack_require__(5);
  6000. var $export = __webpack_require__(8);
  6001. var createDesc = __webpack_require__(17);
  6002. var anObject = __webpack_require__(12);
  6003. var isObject = __webpack_require__(13);
  6004. function set(target, propertyKey, V /* , receiver */) {
  6005. var receiver = arguments.length < 4 ? target : arguments[3];
  6006. var ownDesc = gOPD.f(anObject(target), propertyKey);
  6007. var existingDescriptor, proto;
  6008. if (!ownDesc) {
  6009. if (isObject(proto = getPrototypeOf(target))) {
  6010. return set(proto, propertyKey, V, receiver);
  6011. }
  6012. ownDesc = createDesc(0);
  6013. }
  6014. if (has(ownDesc, 'value')) {
  6015. if (ownDesc.writable === false || !isObject(receiver)) return false;
  6016. if (existingDescriptor = gOPD.f(receiver, propertyKey)) {
  6017. if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false;
  6018. existingDescriptor.value = V;
  6019. dP.f(receiver, propertyKey, existingDescriptor);
  6020. } else dP.f(receiver, propertyKey, createDesc(0, V));
  6021. return true;
  6022. }
  6023. return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true);
  6024. }
  6025. $export($export.S, 'Reflect', { set: set });
  6026. /***/ }),
  6027. /* 258 */
  6028. /***/ (function(module, exports, __webpack_require__) {
  6029. // 26.1.14 Reflect.setPrototypeOf(target, proto)
  6030. var $export = __webpack_require__(8);
  6031. var setProto = __webpack_require__(73);
  6032. if (setProto) $export($export.S, 'Reflect', {
  6033. setPrototypeOf: function setPrototypeOf(target, proto) {
  6034. setProto.check(target, proto);
  6035. try {
  6036. setProto.set(target, proto);
  6037. return true;
  6038. } catch (e) {
  6039. return false;
  6040. }
  6041. }
  6042. });
  6043. /***/ }),
  6044. /* 259 */
  6045. /***/ (function(module, exports, __webpack_require__) {
  6046. 'use strict';
  6047. // https://github.com/tc39/Array.prototype.includes
  6048. var $export = __webpack_require__(8);
  6049. var $includes = __webpack_require__(37)(true);
  6050. $export($export.P, 'Array', {
  6051. includes: function includes(el /* , fromIndex = 0 */) {
  6052. return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
  6053. }
  6054. });
  6055. __webpack_require__(188)('includes');
  6056. /***/ }),
  6057. /* 260 */
  6058. /***/ (function(module, exports, __webpack_require__) {
  6059. 'use strict';
  6060. // https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap
  6061. var $export = __webpack_require__(8);
  6062. var flattenIntoArray = __webpack_require__(261);
  6063. var toObject = __webpack_require__(46);
  6064. var toLength = __webpack_require__(38);
  6065. var aFunction = __webpack_require__(24);
  6066. var arraySpeciesCreate = __webpack_require__(175);
  6067. $export($export.P, 'Array', {
  6068. flatMap: function flatMap(callbackfn /* , thisArg */) {
  6069. var O = toObject(this);
  6070. var sourceLen, A;
  6071. aFunction(callbackfn);
  6072. sourceLen = toLength(O.length);
  6073. A = arraySpeciesCreate(O, 0);
  6074. flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]);
  6075. return A;
  6076. }
  6077. });
  6078. __webpack_require__(188)('flatMap');
  6079. /***/ }),
  6080. /* 261 */
  6081. /***/ (function(module, exports, __webpack_require__) {
  6082. 'use strict';
  6083. // https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray
  6084. var isArray = __webpack_require__(45);
  6085. var isObject = __webpack_require__(13);
  6086. var toLength = __webpack_require__(38);
  6087. var ctx = __webpack_require__(23);
  6088. var IS_CONCAT_SPREADABLE = __webpack_require__(27)('isConcatSpreadable');
  6089. function flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) {
  6090. var targetIndex = start;
  6091. var sourceIndex = 0;
  6092. var mapFn = mapper ? ctx(mapper, thisArg, 3) : false;
  6093. var element, spreadable;
  6094. while (sourceIndex < sourceLen) {
  6095. if (sourceIndex in source) {
  6096. element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
  6097. spreadable = false;
  6098. if (isObject(element)) {
  6099. spreadable = element[IS_CONCAT_SPREADABLE];
  6100. spreadable = spreadable !== undefined ? !!spreadable : isArray(element);
  6101. }
  6102. if (spreadable && depth > 0) {
  6103. targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1;
  6104. } else {
  6105. if (targetIndex >= 0x1fffffffffffff) throw TypeError();
  6106. target[targetIndex] = element;
  6107. }
  6108. targetIndex++;
  6109. }
  6110. sourceIndex++;
  6111. }
  6112. return targetIndex;
  6113. }
  6114. module.exports = flattenIntoArray;
  6115. /***/ }),
  6116. /* 262 */
  6117. /***/ (function(module, exports, __webpack_require__) {
  6118. 'use strict';
  6119. // https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatten
  6120. var $export = __webpack_require__(8);
  6121. var flattenIntoArray = __webpack_require__(261);
  6122. var toObject = __webpack_require__(46);
  6123. var toLength = __webpack_require__(38);
  6124. var toInteger = __webpack_require__(39);
  6125. var arraySpeciesCreate = __webpack_require__(175);
  6126. $export($export.P, 'Array', {
  6127. flatten: function flatten(/* depthArg = 1 */) {
  6128. var depthArg = arguments[0];
  6129. var O = toObject(this);
  6130. var sourceLen = toLength(O.length);
  6131. var A = arraySpeciesCreate(O, 0);
  6132. flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg));
  6133. return A;
  6134. }
  6135. });
  6136. __webpack_require__(188)('flatten');
  6137. /***/ }),
  6138. /* 263 */
  6139. /***/ (function(module, exports, __webpack_require__) {
  6140. 'use strict';
  6141. // https://github.com/mathiasbynens/String.prototype.at
  6142. var $export = __webpack_require__(8);
  6143. var $at = __webpack_require__(128)(true);
  6144. $export($export.P, 'String', {
  6145. at: function at(pos) {
  6146. return $at(this, pos);
  6147. }
  6148. });
  6149. /***/ }),
  6150. /* 264 */
  6151. /***/ (function(module, exports, __webpack_require__) {
  6152. 'use strict';
  6153. // https://github.com/tc39/proposal-string-pad-start-end
  6154. var $export = __webpack_require__(8);
  6155. var $pad = __webpack_require__(265);
  6156. var userAgent = __webpack_require__(218);
  6157. // https://github.com/zloirock/core-js/issues/280
  6158. var WEBKIT_BUG = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent);
  6159. $export($export.P + $export.F * WEBKIT_BUG, 'String', {
  6160. padStart: function padStart(maxLength /* , fillString = ' ' */) {
  6161. return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);
  6162. }
  6163. });
  6164. /***/ }),
  6165. /* 265 */
  6166. /***/ (function(module, exports, __webpack_require__) {
  6167. // https://github.com/tc39/proposal-string-pad-start-end
  6168. var toLength = __webpack_require__(38);
  6169. var repeat = __webpack_require__(91);
  6170. var defined = __webpack_require__(36);
  6171. module.exports = function (that, maxLength, fillString, left) {
  6172. var S = String(defined(that));
  6173. var stringLength = S.length;
  6174. var fillStr = fillString === undefined ? ' ' : String(fillString);
  6175. var intMaxLength = toLength(maxLength);
  6176. if (intMaxLength <= stringLength || fillStr == '') return S;
  6177. var fillLen = intMaxLength - stringLength;
  6178. var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));
  6179. if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);
  6180. return left ? stringFiller + S : S + stringFiller;
  6181. };
  6182. /***/ }),
  6183. /* 266 */
  6184. /***/ (function(module, exports, __webpack_require__) {
  6185. 'use strict';
  6186. // https://github.com/tc39/proposal-string-pad-start-end
  6187. var $export = __webpack_require__(8);
  6188. var $pad = __webpack_require__(265);
  6189. var userAgent = __webpack_require__(218);
  6190. // https://github.com/zloirock/core-js/issues/280
  6191. var WEBKIT_BUG = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent);
  6192. $export($export.P + $export.F * WEBKIT_BUG, 'String', {
  6193. padEnd: function padEnd(maxLength /* , fillString = ' ' */) {
  6194. return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);
  6195. }
  6196. });
  6197. /***/ }),
  6198. /* 267 */
  6199. /***/ (function(module, exports, __webpack_require__) {
  6200. 'use strict';
  6201. // https://github.com/sebmarkbage/ecmascript-string-left-right-trim
  6202. __webpack_require__(83)('trimLeft', function ($trim) {
  6203. return function trimLeft() {
  6204. return $trim(this, 1);
  6205. };
  6206. }, 'trimStart');
  6207. /***/ }),
  6208. /* 268 */
  6209. /***/ (function(module, exports, __webpack_require__) {
  6210. 'use strict';
  6211. // https://github.com/sebmarkbage/ecmascript-string-left-right-trim
  6212. __webpack_require__(83)('trimRight', function ($trim) {
  6213. return function trimRight() {
  6214. return $trim(this, 2);
  6215. };
  6216. }, 'trimEnd');
  6217. /***/ }),
  6218. /* 269 */
  6219. /***/ (function(module, exports, __webpack_require__) {
  6220. 'use strict';
  6221. // https://tc39.github.io/String.prototype.matchAll/
  6222. var $export = __webpack_require__(8);
  6223. var defined = __webpack_require__(36);
  6224. var toLength = __webpack_require__(38);
  6225. var isRegExp = __webpack_require__(135);
  6226. var getFlags = __webpack_require__(198);
  6227. var RegExpProto = RegExp.prototype;
  6228. var $RegExpStringIterator = function (regexp, string) {
  6229. this._r = regexp;
  6230. this._s = string;
  6231. };
  6232. __webpack_require__(131)($RegExpStringIterator, 'RegExp String', function next() {
  6233. var match = this._r.exec(this._s);
  6234. return { value: match, done: match === null };
  6235. });
  6236. $export($export.P, 'String', {
  6237. matchAll: function matchAll(regexp) {
  6238. defined(this);
  6239. if (!isRegExp(regexp)) throw TypeError(regexp + ' is not a regexp!');
  6240. var S = String(this);
  6241. var flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp);
  6242. var rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags);
  6243. rx.lastIndex = toLength(regexp.lastIndex);
  6244. return new $RegExpStringIterator(rx, S);
  6245. }
  6246. });
  6247. /***/ }),
  6248. /* 270 */
  6249. /***/ (function(module, exports, __webpack_require__) {
  6250. __webpack_require__(29)('asyncIterator');
  6251. /***/ }),
  6252. /* 271 */
  6253. /***/ (function(module, exports, __webpack_require__) {
  6254. __webpack_require__(29)('observable');
  6255. /***/ }),
  6256. /* 272 */
  6257. /***/ (function(module, exports, __webpack_require__) {
  6258. // https://github.com/tc39/proposal-object-getownpropertydescriptors
  6259. var $export = __webpack_require__(8);
  6260. var ownKeys = __webpack_require__(255);
  6261. var toIObject = __webpack_require__(33);
  6262. var gOPD = __webpack_require__(52);
  6263. var createProperty = __webpack_require__(165);
  6264. $export($export.S, 'Object', {
  6265. getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
  6266. var O = toIObject(object);
  6267. var getDesc = gOPD.f;
  6268. var keys = ownKeys(O);
  6269. var result = {};
  6270. var i = 0;
  6271. var key, desc;
  6272. while (keys.length > i) {
  6273. desc = getDesc(O, key = keys[i++]);
  6274. if (desc !== undefined) createProperty(result, key, desc);
  6275. }
  6276. return result;
  6277. }
  6278. });
  6279. /***/ }),
  6280. /* 273 */
  6281. /***/ (function(module, exports, __webpack_require__) {
  6282. // https://github.com/tc39/proposal-object-values-entries
  6283. var $export = __webpack_require__(8);
  6284. var $values = __webpack_require__(274)(false);
  6285. $export($export.S, 'Object', {
  6286. values: function values(it) {
  6287. return $values(it);
  6288. }
  6289. });
  6290. /***/ }),
  6291. /* 274 */
  6292. /***/ (function(module, exports, __webpack_require__) {
  6293. var DESCRIPTORS = __webpack_require__(6);
  6294. var getKeys = __webpack_require__(31);
  6295. var toIObject = __webpack_require__(33);
  6296. var isEnum = __webpack_require__(44).f;
  6297. module.exports = function (isEntries) {
  6298. return function (it) {
  6299. var O = toIObject(it);
  6300. var keys = getKeys(O);
  6301. var length = keys.length;
  6302. var i = 0;
  6303. var result = [];
  6304. var key;
  6305. while (length > i) {
  6306. key = keys[i++];
  6307. if (!DESCRIPTORS || isEnum.call(O, key)) {
  6308. result.push(isEntries ? [key, O[key]] : O[key]);
  6309. }
  6310. }
  6311. return result;
  6312. };
  6313. };
  6314. /***/ }),
  6315. /* 275 */
  6316. /***/ (function(module, exports, __webpack_require__) {
  6317. // https://github.com/tc39/proposal-object-values-entries
  6318. var $export = __webpack_require__(8);
  6319. var $entries = __webpack_require__(274)(true);
  6320. $export($export.S, 'Object', {
  6321. entries: function entries(it) {
  6322. return $entries(it);
  6323. }
  6324. });
  6325. /***/ }),
  6326. /* 276 */
  6327. /***/ (function(module, exports, __webpack_require__) {
  6328. 'use strict';
  6329. var $export = __webpack_require__(8);
  6330. var toObject = __webpack_require__(46);
  6331. var aFunction = __webpack_require__(24);
  6332. var $defineProperty = __webpack_require__(11);
  6333. // B.2.2.2 Object.prototype.__defineGetter__(P, getter)
  6334. __webpack_require__(6) && $export($export.P + __webpack_require__(277), 'Object', {
  6335. __defineGetter__: function __defineGetter__(P, getter) {
  6336. $defineProperty.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true });
  6337. }
  6338. });
  6339. /***/ }),
  6340. /* 277 */
  6341. /***/ (function(module, exports, __webpack_require__) {
  6342. 'use strict';
  6343. // Forced replacement prototype accessors methods
  6344. module.exports = __webpack_require__(22) || !__webpack_require__(7)(function () {
  6345. var K = Math.random();
  6346. // In FF throws only define methods
  6347. // eslint-disable-next-line no-undef, no-useless-call
  6348. __defineSetter__.call(null, K, function () { /* empty */ });
  6349. delete __webpack_require__(4)[K];
  6350. });
  6351. /***/ }),
  6352. /* 278 */
  6353. /***/ (function(module, exports, __webpack_require__) {
  6354. 'use strict';
  6355. var $export = __webpack_require__(8);
  6356. var toObject = __webpack_require__(46);
  6357. var aFunction = __webpack_require__(24);
  6358. var $defineProperty = __webpack_require__(11);
  6359. // B.2.2.3 Object.prototype.__defineSetter__(P, setter)
  6360. __webpack_require__(6) && $export($export.P + __webpack_require__(277), 'Object', {
  6361. __defineSetter__: function __defineSetter__(P, setter) {
  6362. $defineProperty.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true });
  6363. }
  6364. });
  6365. /***/ }),
  6366. /* 279 */
  6367. /***/ (function(module, exports, __webpack_require__) {
  6368. 'use strict';
  6369. var $export = __webpack_require__(8);
  6370. var toObject = __webpack_require__(46);
  6371. var toPrimitive = __webpack_require__(16);
  6372. var getPrototypeOf = __webpack_require__(59);
  6373. var getOwnPropertyDescriptor = __webpack_require__(52).f;
  6374. // B.2.2.4 Object.prototype.__lookupGetter__(P)
  6375. __webpack_require__(6) && $export($export.P + __webpack_require__(277), 'Object', {
  6376. __lookupGetter__: function __lookupGetter__(P) {
  6377. var O = toObject(this);
  6378. var K = toPrimitive(P, true);
  6379. var D;
  6380. do {
  6381. if (D = getOwnPropertyDescriptor(O, K)) return D.get;
  6382. } while (O = getPrototypeOf(O));
  6383. }
  6384. });
  6385. /***/ }),
  6386. /* 280 */
  6387. /***/ (function(module, exports, __webpack_require__) {
  6388. 'use strict';
  6389. var $export = __webpack_require__(8);
  6390. var toObject = __webpack_require__(46);
  6391. var toPrimitive = __webpack_require__(16);
  6392. var getPrototypeOf = __webpack_require__(59);
  6393. var getOwnPropertyDescriptor = __webpack_require__(52).f;
  6394. // B.2.2.5 Object.prototype.__lookupSetter__(P)
  6395. __webpack_require__(6) && $export($export.P + __webpack_require__(277), 'Object', {
  6396. __lookupSetter__: function __lookupSetter__(P) {
  6397. var O = toObject(this);
  6398. var K = toPrimitive(P, true);
  6399. var D;
  6400. do {
  6401. if (D = getOwnPropertyDescriptor(O, K)) return D.set;
  6402. } while (O = getPrototypeOf(O));
  6403. }
  6404. });
  6405. /***/ }),
  6406. /* 281 */
  6407. /***/ (function(module, exports, __webpack_require__) {
  6408. // https://github.com/DavidBruant/Map-Set.prototype.toJSON
  6409. var $export = __webpack_require__(8);
  6410. $export($export.P + $export.R, 'Map', { toJSON: __webpack_require__(282)('Map') });
  6411. /***/ }),
  6412. /* 282 */
  6413. /***/ (function(module, exports, __webpack_require__) {
  6414. // https://github.com/DavidBruant/Map-Set.prototype.toJSON
  6415. var classof = __webpack_require__(75);
  6416. var from = __webpack_require__(283);
  6417. module.exports = function (NAME) {
  6418. return function toJSON() {
  6419. if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic");
  6420. return from(this);
  6421. };
  6422. };
  6423. /***/ }),
  6424. /* 283 */
  6425. /***/ (function(module, exports, __webpack_require__) {
  6426. var forOf = __webpack_require__(213);
  6427. module.exports = function (iter, ITERATOR) {
  6428. var result = [];
  6429. forOf(iter, false, result.push, result, ITERATOR);
  6430. return result;
  6431. };
  6432. /***/ }),
  6433. /* 284 */
  6434. /***/ (function(module, exports, __webpack_require__) {
  6435. // https://github.com/DavidBruant/Map-Set.prototype.toJSON
  6436. var $export = __webpack_require__(8);
  6437. $export($export.P + $export.R, 'Set', { toJSON: __webpack_require__(282)('Set') });
  6438. /***/ }),
  6439. /* 285 */
  6440. /***/ (function(module, exports, __webpack_require__) {
  6441. // https://tc39.github.io/proposal-setmap-offrom/#sec-map.of
  6442. __webpack_require__(286)('Map');
  6443. /***/ }),
  6444. /* 286 */
  6445. /***/ (function(module, exports, __webpack_require__) {
  6446. 'use strict';
  6447. // https://tc39.github.io/proposal-setmap-offrom/
  6448. var $export = __webpack_require__(8);
  6449. module.exports = function (COLLECTION) {
  6450. $export($export.S, COLLECTION, { of: function of() {
  6451. var length = arguments.length;
  6452. var A = new Array(length);
  6453. while (length--) A[length] = arguments[length];
  6454. return new this(A);
  6455. } });
  6456. };
  6457. /***/ }),
  6458. /* 287 */
  6459. /***/ (function(module, exports, __webpack_require__) {
  6460. // https://tc39.github.io/proposal-setmap-offrom/#sec-set.of
  6461. __webpack_require__(286)('Set');
  6462. /***/ }),
  6463. /* 288 */
  6464. /***/ (function(module, exports, __webpack_require__) {
  6465. // https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of
  6466. __webpack_require__(286)('WeakMap');
  6467. /***/ }),
  6468. /* 289 */
  6469. /***/ (function(module, exports, __webpack_require__) {
  6470. // https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of
  6471. __webpack_require__(286)('WeakSet');
  6472. /***/ }),
  6473. /* 290 */
  6474. /***/ (function(module, exports, __webpack_require__) {
  6475. // https://tc39.github.io/proposal-setmap-offrom/#sec-map.from
  6476. __webpack_require__(291)('Map');
  6477. /***/ }),
  6478. /* 291 */
  6479. /***/ (function(module, exports, __webpack_require__) {
  6480. 'use strict';
  6481. // https://tc39.github.io/proposal-setmap-offrom/
  6482. var $export = __webpack_require__(8);
  6483. var aFunction = __webpack_require__(24);
  6484. var ctx = __webpack_require__(23);
  6485. var forOf = __webpack_require__(213);
  6486. module.exports = function (COLLECTION) {
  6487. $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {
  6488. var mapFn = arguments[1];
  6489. var mapping, A, n, cb;
  6490. aFunction(this);
  6491. mapping = mapFn !== undefined;
  6492. if (mapping) aFunction(mapFn);
  6493. if (source == undefined) return new this();
  6494. A = [];
  6495. if (mapping) {
  6496. n = 0;
  6497. cb = ctx(mapFn, arguments[2], 2);
  6498. forOf(source, false, function (nextItem) {
  6499. A.push(cb(nextItem, n++));
  6500. });
  6501. } else {
  6502. forOf(source, false, A.push, A);
  6503. }
  6504. return new this(A);
  6505. } });
  6506. };
  6507. /***/ }),
  6508. /* 292 */
  6509. /***/ (function(module, exports, __webpack_require__) {
  6510. // https://tc39.github.io/proposal-setmap-offrom/#sec-set.from
  6511. __webpack_require__(291)('Set');
  6512. /***/ }),
  6513. /* 293 */
  6514. /***/ (function(module, exports, __webpack_require__) {
  6515. // https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from
  6516. __webpack_require__(291)('WeakMap');
  6517. /***/ }),
  6518. /* 294 */
  6519. /***/ (function(module, exports, __webpack_require__) {
  6520. // https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from
  6521. __webpack_require__(291)('WeakSet');
  6522. /***/ }),
  6523. /* 295 */
  6524. /***/ (function(module, exports, __webpack_require__) {
  6525. // https://github.com/tc39/proposal-global
  6526. var $export = __webpack_require__(8);
  6527. $export($export.G, { global: __webpack_require__(4) });
  6528. /***/ }),
  6529. /* 296 */
  6530. /***/ (function(module, exports, __webpack_require__) {
  6531. // https://github.com/tc39/proposal-global
  6532. var $export = __webpack_require__(8);
  6533. $export($export.S, 'System', { global: __webpack_require__(4) });
  6534. /***/ }),
  6535. /* 297 */
  6536. /***/ (function(module, exports, __webpack_require__) {
  6537. // https://github.com/ljharb/proposal-is-error
  6538. var $export = __webpack_require__(8);
  6539. var cof = __webpack_require__(35);
  6540. $export($export.S, 'Error', {
  6541. isError: function isError(it) {
  6542. return cof(it) === 'Error';
  6543. }
  6544. });
  6545. /***/ }),
  6546. /* 298 */
  6547. /***/ (function(module, exports, __webpack_require__) {
  6548. // https://rwaldron.github.io/proposal-math-extensions/
  6549. var $export = __webpack_require__(8);
  6550. $export($export.S, 'Math', {
  6551. clamp: function clamp(x, lower, upper) {
  6552. return Math.min(upper, Math.max(lower, x));
  6553. }
  6554. });
  6555. /***/ }),
  6556. /* 299 */
  6557. /***/ (function(module, exports, __webpack_require__) {
  6558. // https://rwaldron.github.io/proposal-math-extensions/
  6559. var $export = __webpack_require__(8);
  6560. $export($export.S, 'Math', { DEG_PER_RAD: Math.PI / 180 });
  6561. /***/ }),
  6562. /* 300 */
  6563. /***/ (function(module, exports, __webpack_require__) {
  6564. // https://rwaldron.github.io/proposal-math-extensions/
  6565. var $export = __webpack_require__(8);
  6566. var RAD_PER_DEG = 180 / Math.PI;
  6567. $export($export.S, 'Math', {
  6568. degrees: function degrees(radians) {
  6569. return radians * RAD_PER_DEG;
  6570. }
  6571. });
  6572. /***/ }),
  6573. /* 301 */
  6574. /***/ (function(module, exports, __webpack_require__) {
  6575. // https://rwaldron.github.io/proposal-math-extensions/
  6576. var $export = __webpack_require__(8);
  6577. var scale = __webpack_require__(302);
  6578. var fround = __webpack_require__(114);
  6579. $export($export.S, 'Math', {
  6580. fscale: function fscale(x, inLow, inHigh, outLow, outHigh) {
  6581. return fround(scale(x, inLow, inHigh, outLow, outHigh));
  6582. }
  6583. });
  6584. /***/ }),
  6585. /* 302 */
  6586. /***/ (function(module, exports) {
  6587. // https://rwaldron.github.io/proposal-math-extensions/
  6588. module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) {
  6589. if (
  6590. arguments.length === 0
  6591. // eslint-disable-next-line no-self-compare
  6592. || x != x
  6593. // eslint-disable-next-line no-self-compare
  6594. || inLow != inLow
  6595. // eslint-disable-next-line no-self-compare
  6596. || inHigh != inHigh
  6597. // eslint-disable-next-line no-self-compare
  6598. || outLow != outLow
  6599. // eslint-disable-next-line no-self-compare
  6600. || outHigh != outHigh
  6601. ) return NaN;
  6602. if (x === Infinity || x === -Infinity) return x;
  6603. return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow;
  6604. };
  6605. /***/ }),
  6606. /* 303 */
  6607. /***/ (function(module, exports, __webpack_require__) {
  6608. // https://gist.github.com/BrendanEich/4294d5c212a6d2254703
  6609. var $export = __webpack_require__(8);
  6610. $export($export.S, 'Math', {
  6611. iaddh: function iaddh(x0, x1, y0, y1) {
  6612. var $x0 = x0 >>> 0;
  6613. var $x1 = x1 >>> 0;
  6614. var $y0 = y0 >>> 0;
  6615. return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0;
  6616. }
  6617. });
  6618. /***/ }),
  6619. /* 304 */
  6620. /***/ (function(module, exports, __webpack_require__) {
  6621. // https://gist.github.com/BrendanEich/4294d5c212a6d2254703
  6622. var $export = __webpack_require__(8);
  6623. $export($export.S, 'Math', {
  6624. isubh: function isubh(x0, x1, y0, y1) {
  6625. var $x0 = x0 >>> 0;
  6626. var $x1 = x1 >>> 0;
  6627. var $y0 = y0 >>> 0;
  6628. return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0;
  6629. }
  6630. });
  6631. /***/ }),
  6632. /* 305 */
  6633. /***/ (function(module, exports, __webpack_require__) {
  6634. // https://gist.github.com/BrendanEich/4294d5c212a6d2254703
  6635. var $export = __webpack_require__(8);
  6636. $export($export.S, 'Math', {
  6637. imulh: function imulh(u, v) {
  6638. var UINT16 = 0xffff;
  6639. var $u = +u;
  6640. var $v = +v;
  6641. var u0 = $u & UINT16;
  6642. var v0 = $v & UINT16;
  6643. var u1 = $u >> 16;
  6644. var v1 = $v >> 16;
  6645. var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);
  6646. return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16);
  6647. }
  6648. });
  6649. /***/ }),
  6650. /* 306 */
  6651. /***/ (function(module, exports, __webpack_require__) {
  6652. // https://rwaldron.github.io/proposal-math-extensions/
  6653. var $export = __webpack_require__(8);
  6654. $export($export.S, 'Math', { RAD_PER_DEG: 180 / Math.PI });
  6655. /***/ }),
  6656. /* 307 */
  6657. /***/ (function(module, exports, __webpack_require__) {
  6658. // https://rwaldron.github.io/proposal-math-extensions/
  6659. var $export = __webpack_require__(8);
  6660. var DEG_PER_RAD = Math.PI / 180;
  6661. $export($export.S, 'Math', {
  6662. radians: function radians(degrees) {
  6663. return degrees * DEG_PER_RAD;
  6664. }
  6665. });
  6666. /***/ }),
  6667. /* 308 */
  6668. /***/ (function(module, exports, __webpack_require__) {
  6669. // https://rwaldron.github.io/proposal-math-extensions/
  6670. var $export = __webpack_require__(8);
  6671. $export($export.S, 'Math', { scale: __webpack_require__(302) });
  6672. /***/ }),
  6673. /* 309 */
  6674. /***/ (function(module, exports, __webpack_require__) {
  6675. // https://gist.github.com/BrendanEich/4294d5c212a6d2254703
  6676. var $export = __webpack_require__(8);
  6677. $export($export.S, 'Math', {
  6678. umulh: function umulh(u, v) {
  6679. var UINT16 = 0xffff;
  6680. var $u = +u;
  6681. var $v = +v;
  6682. var u0 = $u & UINT16;
  6683. var v0 = $v & UINT16;
  6684. var u1 = $u >>> 16;
  6685. var v1 = $v >>> 16;
  6686. var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);
  6687. return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16);
  6688. }
  6689. });
  6690. /***/ }),
  6691. /* 310 */
  6692. /***/ (function(module, exports, __webpack_require__) {
  6693. // http://jfbastien.github.io/papers/Math.signbit.html
  6694. var $export = __webpack_require__(8);
  6695. $export($export.S, 'Math', { signbit: function signbit(x) {
  6696. // eslint-disable-next-line no-self-compare
  6697. return (x = +x) != x ? x : x == 0 ? 1 / x == Infinity : x > 0;
  6698. } });
  6699. /***/ }),
  6700. /* 311 */
  6701. /***/ (function(module, exports, __webpack_require__) {
  6702. // https://github.com/tc39/proposal-promise-finally
  6703. 'use strict';
  6704. var $export = __webpack_require__(8);
  6705. var core = __webpack_require__(9);
  6706. var global = __webpack_require__(4);
  6707. var speciesConstructor = __webpack_require__(210);
  6708. var promiseResolve = __webpack_require__(219);
  6709. $export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {
  6710. var C = speciesConstructor(this, core.Promise || global.Promise);
  6711. var isFunction = typeof onFinally == 'function';
  6712. return this.then(
  6713. isFunction ? function (x) {
  6714. return promiseResolve(C, onFinally()).then(function () { return x; });
  6715. } : onFinally,
  6716. isFunction ? function (e) {
  6717. return promiseResolve(C, onFinally()).then(function () { throw e; });
  6718. } : onFinally
  6719. );
  6720. } });
  6721. /***/ }),
  6722. /* 312 */
  6723. /***/ (function(module, exports, __webpack_require__) {
  6724. 'use strict';
  6725. // https://github.com/tc39/proposal-promise-try
  6726. var $export = __webpack_require__(8);
  6727. var newPromiseCapability = __webpack_require__(216);
  6728. var perform = __webpack_require__(217);
  6729. $export($export.S, 'Promise', { 'try': function (callbackfn) {
  6730. var promiseCapability = newPromiseCapability.f(this);
  6731. var result = perform(callbackfn);
  6732. (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v);
  6733. return promiseCapability.promise;
  6734. } });
  6735. /***/ }),
  6736. /* 313 */
  6737. /***/ (function(module, exports, __webpack_require__) {
  6738. var metadata = __webpack_require__(314);
  6739. var anObject = __webpack_require__(12);
  6740. var toMetaKey = metadata.key;
  6741. var ordinaryDefineOwnMetadata = metadata.set;
  6742. metadata.exp({ defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey) {
  6743. ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey));
  6744. } });
  6745. /***/ }),
  6746. /* 314 */
  6747. /***/ (function(module, exports, __webpack_require__) {
  6748. var Map = __webpack_require__(221);
  6749. var $export = __webpack_require__(8);
  6750. var shared = __webpack_require__(21)('metadata');
  6751. var store = shared.store || (shared.store = new (__webpack_require__(226))());
  6752. var getOrCreateMetadataMap = function (target, targetKey, create) {
  6753. var targetMetadata = store.get(target);
  6754. if (!targetMetadata) {
  6755. if (!create) return undefined;
  6756. store.set(target, targetMetadata = new Map());
  6757. }
  6758. var keyMetadata = targetMetadata.get(targetKey);
  6759. if (!keyMetadata) {
  6760. if (!create) return undefined;
  6761. targetMetadata.set(targetKey, keyMetadata = new Map());
  6762. } return keyMetadata;
  6763. };
  6764. var ordinaryHasOwnMetadata = function (MetadataKey, O, P) {
  6765. var metadataMap = getOrCreateMetadataMap(O, P, false);
  6766. return metadataMap === undefined ? false : metadataMap.has(MetadataKey);
  6767. };
  6768. var ordinaryGetOwnMetadata = function (MetadataKey, O, P) {
  6769. var metadataMap = getOrCreateMetadataMap(O, P, false);
  6770. return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey);
  6771. };
  6772. var ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) {
  6773. getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue);
  6774. };
  6775. var ordinaryOwnMetadataKeys = function (target, targetKey) {
  6776. var metadataMap = getOrCreateMetadataMap(target, targetKey, false);
  6777. var keys = [];
  6778. if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key); });
  6779. return keys;
  6780. };
  6781. var toMetaKey = function (it) {
  6782. return it === undefined || typeof it == 'symbol' ? it : String(it);
  6783. };
  6784. var exp = function (O) {
  6785. $export($export.S, 'Reflect', O);
  6786. };
  6787. module.exports = {
  6788. store: store,
  6789. map: getOrCreateMetadataMap,
  6790. has: ordinaryHasOwnMetadata,
  6791. get: ordinaryGetOwnMetadata,
  6792. set: ordinaryDefineOwnMetadata,
  6793. keys: ordinaryOwnMetadataKeys,
  6794. key: toMetaKey,
  6795. exp: exp
  6796. };
  6797. /***/ }),
  6798. /* 315 */
  6799. /***/ (function(module, exports, __webpack_require__) {
  6800. var metadata = __webpack_require__(314);
  6801. var anObject = __webpack_require__(12);
  6802. var toMetaKey = metadata.key;
  6803. var getOrCreateMetadataMap = metadata.map;
  6804. var store = metadata.store;
  6805. metadata.exp({ deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) {
  6806. var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]);
  6807. var metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false);
  6808. if (metadataMap === undefined || !metadataMap['delete'](metadataKey)) return false;
  6809. if (metadataMap.size) return true;
  6810. var targetMetadata = store.get(target);
  6811. targetMetadata['delete'](targetKey);
  6812. return !!targetMetadata.size || store['delete'](target);
  6813. } });
  6814. /***/ }),
  6815. /* 316 */
  6816. /***/ (function(module, exports, __webpack_require__) {
  6817. var metadata = __webpack_require__(314);
  6818. var anObject = __webpack_require__(12);
  6819. var getPrototypeOf = __webpack_require__(59);
  6820. var ordinaryHasOwnMetadata = metadata.has;
  6821. var ordinaryGetOwnMetadata = metadata.get;
  6822. var toMetaKey = metadata.key;
  6823. var ordinaryGetMetadata = function (MetadataKey, O, P) {
  6824. var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);
  6825. if (hasOwn) return ordinaryGetOwnMetadata(MetadataKey, O, P);
  6826. var parent = getPrototypeOf(O);
  6827. return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined;
  6828. };
  6829. metadata.exp({ getMetadata: function getMetadata(metadataKey, target /* , targetKey */) {
  6830. return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
  6831. } });
  6832. /***/ }),
  6833. /* 317 */
  6834. /***/ (function(module, exports, __webpack_require__) {
  6835. var Set = __webpack_require__(225);
  6836. var from = __webpack_require__(283);
  6837. var metadata = __webpack_require__(314);
  6838. var anObject = __webpack_require__(12);
  6839. var getPrototypeOf = __webpack_require__(59);
  6840. var ordinaryOwnMetadataKeys = metadata.keys;
  6841. var toMetaKey = metadata.key;
  6842. var ordinaryMetadataKeys = function (O, P) {
  6843. var oKeys = ordinaryOwnMetadataKeys(O, P);
  6844. var parent = getPrototypeOf(O);
  6845. if (parent === null) return oKeys;
  6846. var pKeys = ordinaryMetadataKeys(parent, P);
  6847. return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys;
  6848. };
  6849. metadata.exp({ getMetadataKeys: function getMetadataKeys(target /* , targetKey */) {
  6850. return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));
  6851. } });
  6852. /***/ }),
  6853. /* 318 */
  6854. /***/ (function(module, exports, __webpack_require__) {
  6855. var metadata = __webpack_require__(314);
  6856. var anObject = __webpack_require__(12);
  6857. var ordinaryGetOwnMetadata = metadata.get;
  6858. var toMetaKey = metadata.key;
  6859. metadata.exp({ getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) {
  6860. return ordinaryGetOwnMetadata(metadataKey, anObject(target)
  6861. , arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
  6862. } });
  6863. /***/ }),
  6864. /* 319 */
  6865. /***/ (function(module, exports, __webpack_require__) {
  6866. var metadata = __webpack_require__(314);
  6867. var anObject = __webpack_require__(12);
  6868. var ordinaryOwnMetadataKeys = metadata.keys;
  6869. var toMetaKey = metadata.key;
  6870. metadata.exp({ getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) {
  6871. return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));
  6872. } });
  6873. /***/ }),
  6874. /* 320 */
  6875. /***/ (function(module, exports, __webpack_require__) {
  6876. var metadata = __webpack_require__(314);
  6877. var anObject = __webpack_require__(12);
  6878. var getPrototypeOf = __webpack_require__(59);
  6879. var ordinaryHasOwnMetadata = metadata.has;
  6880. var toMetaKey = metadata.key;
  6881. var ordinaryHasMetadata = function (MetadataKey, O, P) {
  6882. var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);
  6883. if (hasOwn) return true;
  6884. var parent = getPrototypeOf(O);
  6885. return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false;
  6886. };
  6887. metadata.exp({ hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) {
  6888. return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
  6889. } });
  6890. /***/ }),
  6891. /* 321 */
  6892. /***/ (function(module, exports, __webpack_require__) {
  6893. var metadata = __webpack_require__(314);
  6894. var anObject = __webpack_require__(12);
  6895. var ordinaryHasOwnMetadata = metadata.has;
  6896. var toMetaKey = metadata.key;
  6897. metadata.exp({ hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) {
  6898. return ordinaryHasOwnMetadata(metadataKey, anObject(target)
  6899. , arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
  6900. } });
  6901. /***/ }),
  6902. /* 322 */
  6903. /***/ (function(module, exports, __webpack_require__) {
  6904. var $metadata = __webpack_require__(314);
  6905. var anObject = __webpack_require__(12);
  6906. var aFunction = __webpack_require__(24);
  6907. var toMetaKey = $metadata.key;
  6908. var ordinaryDefineOwnMetadata = $metadata.set;
  6909. $metadata.exp({ metadata: function metadata(metadataKey, metadataValue) {
  6910. return function decorator(target, targetKey) {
  6911. ordinaryDefineOwnMetadata(
  6912. metadataKey, metadataValue,
  6913. (targetKey !== undefined ? anObject : aFunction)(target),
  6914. toMetaKey(targetKey)
  6915. );
  6916. };
  6917. } });
  6918. /***/ }),
  6919. /* 323 */
  6920. /***/ (function(module, exports, __webpack_require__) {
  6921. // https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask
  6922. var $export = __webpack_require__(8);
  6923. var microtask = __webpack_require__(215)();
  6924. var process = __webpack_require__(4).process;
  6925. var isNode = __webpack_require__(35)(process) == 'process';
  6926. $export($export.G, {
  6927. asap: function asap(fn) {
  6928. var domain = isNode && process.domain;
  6929. microtask(domain ? domain.bind(fn) : fn);
  6930. }
  6931. });
  6932. /***/ }),
  6933. /* 324 */
  6934. /***/ (function(module, exports, __webpack_require__) {
  6935. 'use strict';
  6936. // https://github.com/zenparsing/es-observable
  6937. var $export = __webpack_require__(8);
  6938. var global = __webpack_require__(4);
  6939. var core = __webpack_require__(9);
  6940. var microtask = __webpack_require__(215)();
  6941. var OBSERVABLE = __webpack_require__(27)('observable');
  6942. var aFunction = __webpack_require__(24);
  6943. var anObject = __webpack_require__(12);
  6944. var anInstance = __webpack_require__(212);
  6945. var redefineAll = __webpack_require__(220);
  6946. var hide = __webpack_require__(10);
  6947. var forOf = __webpack_require__(213);
  6948. var RETURN = forOf.RETURN;
  6949. var getMethod = function (fn) {
  6950. return fn == null ? undefined : aFunction(fn);
  6951. };
  6952. var cleanupSubscription = function (subscription) {
  6953. var cleanup = subscription._c;
  6954. if (cleanup) {
  6955. subscription._c = undefined;
  6956. cleanup();
  6957. }
  6958. };
  6959. var subscriptionClosed = function (subscription) {
  6960. return subscription._o === undefined;
  6961. };
  6962. var closeSubscription = function (subscription) {
  6963. if (!subscriptionClosed(subscription)) {
  6964. subscription._o = undefined;
  6965. cleanupSubscription(subscription);
  6966. }
  6967. };
  6968. var Subscription = function (observer, subscriber) {
  6969. anObject(observer);
  6970. this._c = undefined;
  6971. this._o = observer;
  6972. observer = new SubscriptionObserver(this);
  6973. try {
  6974. var cleanup = subscriber(observer);
  6975. var subscription = cleanup;
  6976. if (cleanup != null) {
  6977. if (typeof cleanup.unsubscribe === 'function') cleanup = function () { subscription.unsubscribe(); };
  6978. else aFunction(cleanup);
  6979. this._c = cleanup;
  6980. }
  6981. } catch (e) {
  6982. observer.error(e);
  6983. return;
  6984. } if (subscriptionClosed(this)) cleanupSubscription(this);
  6985. };
  6986. Subscription.prototype = redefineAll({}, {
  6987. unsubscribe: function unsubscribe() { closeSubscription(this); }
  6988. });
  6989. var SubscriptionObserver = function (subscription) {
  6990. this._s = subscription;
  6991. };
  6992. SubscriptionObserver.prototype = redefineAll({}, {
  6993. next: function next(value) {
  6994. var subscription = this._s;
  6995. if (!subscriptionClosed(subscription)) {
  6996. var observer = subscription._o;
  6997. try {
  6998. var m = getMethod(observer.next);
  6999. if (m) return m.call(observer, value);
  7000. } catch (e) {
  7001. try {
  7002. closeSubscription(subscription);
  7003. } finally {
  7004. throw e;
  7005. }
  7006. }
  7007. }
  7008. },
  7009. error: function error(value) {
  7010. var subscription = this._s;
  7011. if (subscriptionClosed(subscription)) throw value;
  7012. var observer = subscription._o;
  7013. subscription._o = undefined;
  7014. try {
  7015. var m = getMethod(observer.error);
  7016. if (!m) throw value;
  7017. value = m.call(observer, value);
  7018. } catch (e) {
  7019. try {
  7020. cleanupSubscription(subscription);
  7021. } finally {
  7022. throw e;
  7023. }
  7024. } cleanupSubscription(subscription);
  7025. return value;
  7026. },
  7027. complete: function complete(value) {
  7028. var subscription = this._s;
  7029. if (!subscriptionClosed(subscription)) {
  7030. var observer = subscription._o;
  7031. subscription._o = undefined;
  7032. try {
  7033. var m = getMethod(observer.complete);
  7034. value = m ? m.call(observer, value) : undefined;
  7035. } catch (e) {
  7036. try {
  7037. cleanupSubscription(subscription);
  7038. } finally {
  7039. throw e;
  7040. }
  7041. } cleanupSubscription(subscription);
  7042. return value;
  7043. }
  7044. }
  7045. });
  7046. var $Observable = function Observable(subscriber) {
  7047. anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber);
  7048. };
  7049. redefineAll($Observable.prototype, {
  7050. subscribe: function subscribe(observer) {
  7051. return new Subscription(observer, this._f);
  7052. },
  7053. forEach: function forEach(fn) {
  7054. var that = this;
  7055. return new (core.Promise || global.Promise)(function (resolve, reject) {
  7056. aFunction(fn);
  7057. var subscription = that.subscribe({
  7058. next: function (value) {
  7059. try {
  7060. return fn(value);
  7061. } catch (e) {
  7062. reject(e);
  7063. subscription.unsubscribe();
  7064. }
  7065. },
  7066. error: reject,
  7067. complete: resolve
  7068. });
  7069. });
  7070. }
  7071. });
  7072. redefineAll($Observable, {
  7073. from: function from(x) {
  7074. var C = typeof this === 'function' ? this : $Observable;
  7075. var method = getMethod(anObject(x)[OBSERVABLE]);
  7076. if (method) {
  7077. var observable = anObject(method.call(x));
  7078. return observable.constructor === C ? observable : new C(function (observer) {
  7079. return observable.subscribe(observer);
  7080. });
  7081. }
  7082. return new C(function (observer) {
  7083. var done = false;
  7084. microtask(function () {
  7085. if (!done) {
  7086. try {
  7087. if (forOf(x, false, function (it) {
  7088. observer.next(it);
  7089. if (done) return RETURN;
  7090. }) === RETURN) return;
  7091. } catch (e) {
  7092. if (done) throw e;
  7093. observer.error(e);
  7094. return;
  7095. } observer.complete();
  7096. }
  7097. });
  7098. return function () { done = true; };
  7099. });
  7100. },
  7101. of: function of() {
  7102. for (var i = 0, l = arguments.length, items = new Array(l); i < l;) items[i] = arguments[i++];
  7103. return new (typeof this === 'function' ? this : $Observable)(function (observer) {
  7104. var done = false;
  7105. microtask(function () {
  7106. if (!done) {
  7107. for (var j = 0; j < items.length; ++j) {
  7108. observer.next(items[j]);
  7109. if (done) return;
  7110. } observer.complete();
  7111. }
  7112. });
  7113. return function () { done = true; };
  7114. });
  7115. }
  7116. });
  7117. hide($Observable.prototype, OBSERVABLE, function () { return this; });
  7118. $export($export.G, { Observable: $Observable });
  7119. __webpack_require__(194)('Observable');
  7120. /***/ }),
  7121. /* 325 */
  7122. /***/ (function(module, exports, __webpack_require__) {
  7123. // ie9- setTimeout & setInterval additional parameters fix
  7124. var global = __webpack_require__(4);
  7125. var $export = __webpack_require__(8);
  7126. var userAgent = __webpack_require__(218);
  7127. var slice = [].slice;
  7128. var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check
  7129. var wrap = function (set) {
  7130. return function (fn, time /* , ...args */) {
  7131. var boundArgs = arguments.length > 2;
  7132. var args = boundArgs ? slice.call(arguments, 2) : false;
  7133. return set(boundArgs ? function () {
  7134. // eslint-disable-next-line no-new-func
  7135. (typeof fn == 'function' ? fn : Function(fn)).apply(this, args);
  7136. } : fn, time);
  7137. };
  7138. };
  7139. $export($export.G + $export.B + $export.F * MSIE, {
  7140. setTimeout: wrap(global.setTimeout),
  7141. setInterval: wrap(global.setInterval)
  7142. });
  7143. /***/ }),
  7144. /* 326 */
  7145. /***/ (function(module, exports, __webpack_require__) {
  7146. var $export = __webpack_require__(8);
  7147. var $task = __webpack_require__(214);
  7148. $export($export.G + $export.B, {
  7149. setImmediate: $task.set,
  7150. clearImmediate: $task.clear
  7151. });
  7152. /***/ }),
  7153. /* 327 */
  7154. /***/ (function(module, exports, __webpack_require__) {
  7155. var $iterators = __webpack_require__(195);
  7156. var getKeys = __webpack_require__(31);
  7157. var redefine = __webpack_require__(18);
  7158. var global = __webpack_require__(4);
  7159. var hide = __webpack_require__(10);
  7160. var Iterators = __webpack_require__(130);
  7161. var wks = __webpack_require__(27);
  7162. var ITERATOR = wks('iterator');
  7163. var TO_STRING_TAG = wks('toStringTag');
  7164. var ArrayValues = Iterators.Array;
  7165. var DOMIterables = {
  7166. CSSRuleList: true, // TODO: Not spec compliant, should be false.
  7167. CSSStyleDeclaration: false,
  7168. CSSValueList: false,
  7169. ClientRectList: false,
  7170. DOMRectList: false,
  7171. DOMStringList: false,
  7172. DOMTokenList: true,
  7173. DataTransferItemList: false,
  7174. FileList: false,
  7175. HTMLAllCollection: false,
  7176. HTMLCollection: false,
  7177. HTMLFormElement: false,
  7178. HTMLSelectElement: false,
  7179. MediaList: true, // TODO: Not spec compliant, should be false.
  7180. MimeTypeArray: false,
  7181. NamedNodeMap: false,
  7182. NodeList: true,
  7183. PaintRequestList: false,
  7184. Plugin: false,
  7185. PluginArray: false,
  7186. SVGLengthList: false,
  7187. SVGNumberList: false,
  7188. SVGPathSegList: false,
  7189. SVGPointList: false,
  7190. SVGStringList: false,
  7191. SVGTransformList: false,
  7192. SourceBufferList: false,
  7193. StyleSheetList: true, // TODO: Not spec compliant, should be false.
  7194. TextTrackCueList: false,
  7195. TextTrackList: false,
  7196. TouchList: false
  7197. };
  7198. for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {
  7199. var NAME = collections[i];
  7200. var explicit = DOMIterables[NAME];
  7201. var Collection = global[NAME];
  7202. var proto = Collection && Collection.prototype;
  7203. var key;
  7204. if (proto) {
  7205. if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);
  7206. if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
  7207. Iterators[NAME] = ArrayValues;
  7208. if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);
  7209. }
  7210. }
  7211. /***/ }),
  7212. /* 328 */
  7213. /***/ (function(module, exports) {
  7214. /* WEBPACK VAR INJECTION */(function(global) {/**
  7215. * Copyright (c) 2014, Facebook, Inc.
  7216. * All rights reserved.
  7217. *
  7218. * This source code is licensed under the BSD-style license found in the
  7219. * https://raw.github.com/facebook/regenerator/master/LICENSE file. An
  7220. * additional grant of patent rights can be found in the PATENTS file in
  7221. * the same directory.
  7222. */
  7223. !(function(global) {
  7224. "use strict";
  7225. var Op = Object.prototype;
  7226. var hasOwn = Op.hasOwnProperty;
  7227. var undefined; // More compressible than void 0.
  7228. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  7229. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  7230. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  7231. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  7232. var inModule = typeof module === "object";
  7233. var runtime = global.regeneratorRuntime;
  7234. if (runtime) {
  7235. if (inModule) {
  7236. // If regeneratorRuntime is defined globally and we're in a module,
  7237. // make the exports object identical to regeneratorRuntime.
  7238. module.exports = runtime;
  7239. }
  7240. // Don't bother evaluating the rest of this file if the runtime was
  7241. // already defined globally.
  7242. return;
  7243. }
  7244. // Define the runtime globally (as expected by generated code) as either
  7245. // module.exports (if we're in a module) or a new, empty object.
  7246. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  7247. function wrap(innerFn, outerFn, self, tryLocsList) {
  7248. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  7249. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  7250. var generator = Object.create(protoGenerator.prototype);
  7251. var context = new Context(tryLocsList || []);
  7252. // The ._invoke method unifies the implementations of the .next,
  7253. // .throw, and .return methods.
  7254. generator._invoke = makeInvokeMethod(innerFn, self, context);
  7255. return generator;
  7256. }
  7257. runtime.wrap = wrap;
  7258. // Try/catch helper to minimize deoptimizations. Returns a completion
  7259. // record like context.tryEntries[i].completion. This interface could
  7260. // have been (and was previously) designed to take a closure to be
  7261. // invoked without arguments, but in all the cases we care about we
  7262. // already have an existing method we want to call, so there's no need
  7263. // to create a new function object. We can even get away with assuming
  7264. // the method takes exactly one argument, since that happens to be true
  7265. // in every case, so we don't have to touch the arguments object. The
  7266. // only additional allocation required is the completion record, which
  7267. // has a stable shape and so hopefully should be cheap to allocate.
  7268. function tryCatch(fn, obj, arg) {
  7269. try {
  7270. return { type: "normal", arg: fn.call(obj, arg) };
  7271. } catch (err) {
  7272. return { type: "throw", arg: err };
  7273. }
  7274. }
  7275. var GenStateSuspendedStart = "suspendedStart";
  7276. var GenStateSuspendedYield = "suspendedYield";
  7277. var GenStateExecuting = "executing";
  7278. var GenStateCompleted = "completed";
  7279. // Returning this object from the innerFn has the same effect as
  7280. // breaking out of the dispatch switch statement.
  7281. var ContinueSentinel = {};
  7282. // Dummy constructor functions that we use as the .constructor and
  7283. // .constructor.prototype properties for functions that return Generator
  7284. // objects. For full spec compliance, you may wish to configure your
  7285. // minifier not to mangle the names of these two functions.
  7286. function Generator() {}
  7287. function GeneratorFunction() {}
  7288. function GeneratorFunctionPrototype() {}
  7289. // This is a polyfill for %IteratorPrototype% for environments that
  7290. // don't natively support it.
  7291. var IteratorPrototype = {};
  7292. IteratorPrototype[iteratorSymbol] = function () {
  7293. return this;
  7294. };
  7295. var getProto = Object.getPrototypeOf;
  7296. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  7297. if (NativeIteratorPrototype &&
  7298. NativeIteratorPrototype !== Op &&
  7299. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  7300. // This environment has a native %IteratorPrototype%; use it instead
  7301. // of the polyfill.
  7302. IteratorPrototype = NativeIteratorPrototype;
  7303. }
  7304. var Gp = GeneratorFunctionPrototype.prototype =
  7305. Generator.prototype = Object.create(IteratorPrototype);
  7306. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  7307. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  7308. GeneratorFunctionPrototype[toStringTagSymbol] =
  7309. GeneratorFunction.displayName = "GeneratorFunction";
  7310. // Helper for defining the .next, .throw, and .return methods of the
  7311. // Iterator interface in terms of a single ._invoke method.
  7312. function defineIteratorMethods(prototype) {
  7313. ["next", "throw", "return"].forEach(function(method) {
  7314. prototype[method] = function(arg) {
  7315. return this._invoke(method, arg);
  7316. };
  7317. });
  7318. }
  7319. runtime.isGeneratorFunction = function(genFun) {
  7320. var ctor = typeof genFun === "function" && genFun.constructor;
  7321. return ctor
  7322. ? ctor === GeneratorFunction ||
  7323. // For the native GeneratorFunction constructor, the best we can
  7324. // do is to check its .name property.
  7325. (ctor.displayName || ctor.name) === "GeneratorFunction"
  7326. : false;
  7327. };
  7328. runtime.mark = function(genFun) {
  7329. if (Object.setPrototypeOf) {
  7330. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  7331. } else {
  7332. genFun.__proto__ = GeneratorFunctionPrototype;
  7333. if (!(toStringTagSymbol in genFun)) {
  7334. genFun[toStringTagSymbol] = "GeneratorFunction";
  7335. }
  7336. }
  7337. genFun.prototype = Object.create(Gp);
  7338. return genFun;
  7339. };
  7340. // Within the body of any async function, `await x` is transformed to
  7341. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  7342. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  7343. // meant to be awaited.
  7344. runtime.awrap = function(arg) {
  7345. return { __await: arg };
  7346. };
  7347. function AsyncIterator(generator) {
  7348. function invoke(method, arg, resolve, reject) {
  7349. var record = tryCatch(generator[method], generator, arg);
  7350. if (record.type === "throw") {
  7351. reject(record.arg);
  7352. } else {
  7353. var result = record.arg;
  7354. var value = result.value;
  7355. if (value &&
  7356. typeof value === "object" &&
  7357. hasOwn.call(value, "__await")) {
  7358. return Promise.resolve(value.__await).then(function(value) {
  7359. invoke("next", value, resolve, reject);
  7360. }, function(err) {
  7361. invoke("throw", err, resolve, reject);
  7362. });
  7363. }
  7364. return Promise.resolve(value).then(function(unwrapped) {
  7365. // When a yielded Promise is resolved, its final value becomes
  7366. // the .value of the Promise<{value,done}> result for the
  7367. // current iteration. If the Promise is rejected, however, the
  7368. // result for this iteration will be rejected with the same
  7369. // reason. Note that rejections of yielded Promises are not
  7370. // thrown back into the generator function, as is the case
  7371. // when an awaited Promise is rejected. This difference in
  7372. // behavior between yield and await is important, because it
  7373. // allows the consumer to decide what to do with the yielded
  7374. // rejection (swallow it and continue, manually .throw it back
  7375. // into the generator, abandon iteration, whatever). With
  7376. // await, by contrast, there is no opportunity to examine the
  7377. // rejection reason outside the generator function, so the
  7378. // only option is to throw it from the await expression, and
  7379. // let the generator function handle the exception.
  7380. result.value = unwrapped;
  7381. resolve(result);
  7382. }, reject);
  7383. }
  7384. }
  7385. if (typeof global.process === "object" && global.process.domain) {
  7386. invoke = global.process.domain.bind(invoke);
  7387. }
  7388. var previousPromise;
  7389. function enqueue(method, arg) {
  7390. function callInvokeWithMethodAndArg() {
  7391. return new Promise(function(resolve, reject) {
  7392. invoke(method, arg, resolve, reject);
  7393. });
  7394. }
  7395. return previousPromise =
  7396. // If enqueue has been called before, then we want to wait until
  7397. // all previous Promises have been resolved before calling invoke,
  7398. // so that results are always delivered in the correct order. If
  7399. // enqueue has not been called before, then it is important to
  7400. // call invoke immediately, without waiting on a callback to fire,
  7401. // so that the async generator function has the opportunity to do
  7402. // any necessary setup in a predictable way. This predictability
  7403. // is why the Promise constructor synchronously invokes its
  7404. // executor callback, and why async functions synchronously
  7405. // execute code before the first await. Since we implement simple
  7406. // async functions in terms of async generators, it is especially
  7407. // important to get this right, even though it requires care.
  7408. previousPromise ? previousPromise.then(
  7409. callInvokeWithMethodAndArg,
  7410. // Avoid propagating failures to Promises returned by later
  7411. // invocations of the iterator.
  7412. callInvokeWithMethodAndArg
  7413. ) : callInvokeWithMethodAndArg();
  7414. }
  7415. // Define the unified helper method that is used to implement .next,
  7416. // .throw, and .return (see defineIteratorMethods).
  7417. this._invoke = enqueue;
  7418. }
  7419. defineIteratorMethods(AsyncIterator.prototype);
  7420. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  7421. return this;
  7422. };
  7423. runtime.AsyncIterator = AsyncIterator;
  7424. // Note that simple async functions are implemented on top of
  7425. // AsyncIterator objects; they just return a Promise for the value of
  7426. // the final result produced by the iterator.
  7427. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  7428. var iter = new AsyncIterator(
  7429. wrap(innerFn, outerFn, self, tryLocsList)
  7430. );
  7431. return runtime.isGeneratorFunction(outerFn)
  7432. ? iter // If outerFn is a generator, return the full iterator.
  7433. : iter.next().then(function(result) {
  7434. return result.done ? result.value : iter.next();
  7435. });
  7436. };
  7437. function makeInvokeMethod(innerFn, self, context) {
  7438. var state = GenStateSuspendedStart;
  7439. return function invoke(method, arg) {
  7440. if (state === GenStateExecuting) {
  7441. throw new Error("Generator is already running");
  7442. }
  7443. if (state === GenStateCompleted) {
  7444. if (method === "throw") {
  7445. throw arg;
  7446. }
  7447. // Be forgiving, per 25.3.3.3.3 of the spec:
  7448. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  7449. return doneResult();
  7450. }
  7451. context.method = method;
  7452. context.arg = arg;
  7453. while (true) {
  7454. var delegate = context.delegate;
  7455. if (delegate) {
  7456. var delegateResult = maybeInvokeDelegate(delegate, context);
  7457. if (delegateResult) {
  7458. if (delegateResult === ContinueSentinel) continue;
  7459. return delegateResult;
  7460. }
  7461. }
  7462. if (context.method === "next") {
  7463. // Setting context._sent for legacy support of Babel's
  7464. // function.sent implementation.
  7465. context.sent = context._sent = context.arg;
  7466. } else if (context.method === "throw") {
  7467. if (state === GenStateSuspendedStart) {
  7468. state = GenStateCompleted;
  7469. throw context.arg;
  7470. }
  7471. context.dispatchException(context.arg);
  7472. } else if (context.method === "return") {
  7473. context.abrupt("return", context.arg);
  7474. }
  7475. state = GenStateExecuting;
  7476. var record = tryCatch(innerFn, self, context);
  7477. if (record.type === "normal") {
  7478. // If an exception is thrown from innerFn, we leave state ===
  7479. // GenStateExecuting and loop back for another invocation.
  7480. state = context.done
  7481. ? GenStateCompleted
  7482. : GenStateSuspendedYield;
  7483. if (record.arg === ContinueSentinel) {
  7484. continue;
  7485. }
  7486. return {
  7487. value: record.arg,
  7488. done: context.done
  7489. };
  7490. } else if (record.type === "throw") {
  7491. state = GenStateCompleted;
  7492. // Dispatch the exception by looping back around to the
  7493. // context.dispatchException(context.arg) call above.
  7494. context.method = "throw";
  7495. context.arg = record.arg;
  7496. }
  7497. }
  7498. };
  7499. }
  7500. // Call delegate.iterator[context.method](context.arg) and handle the
  7501. // result, either by returning a { value, done } result from the
  7502. // delegate iterator, or by modifying context.method and context.arg,
  7503. // setting context.delegate to null, and returning the ContinueSentinel.
  7504. function maybeInvokeDelegate(delegate, context) {
  7505. var method = delegate.iterator[context.method];
  7506. if (method === undefined) {
  7507. // A .throw or .return when the delegate iterator has no .throw
  7508. // method always terminates the yield* loop.
  7509. context.delegate = null;
  7510. if (context.method === "throw") {
  7511. if (delegate.iterator.return) {
  7512. // If the delegate iterator has a return method, give it a
  7513. // chance to clean up.
  7514. context.method = "return";
  7515. context.arg = undefined;
  7516. maybeInvokeDelegate(delegate, context);
  7517. if (context.method === "throw") {
  7518. // If maybeInvokeDelegate(context) changed context.method from
  7519. // "return" to "throw", let that override the TypeError below.
  7520. return ContinueSentinel;
  7521. }
  7522. }
  7523. context.method = "throw";
  7524. context.arg = new TypeError(
  7525. "The iterator does not provide a 'throw' method");
  7526. }
  7527. return ContinueSentinel;
  7528. }
  7529. var record = tryCatch(method, delegate.iterator, context.arg);
  7530. if (record.type === "throw") {
  7531. context.method = "throw";
  7532. context.arg = record.arg;
  7533. context.delegate = null;
  7534. return ContinueSentinel;
  7535. }
  7536. var info = record.arg;
  7537. if (! info) {
  7538. context.method = "throw";
  7539. context.arg = new TypeError("iterator result is not an object");
  7540. context.delegate = null;
  7541. return ContinueSentinel;
  7542. }
  7543. if (info.done) {
  7544. // Assign the result of the finished delegate to the temporary
  7545. // variable specified by delegate.resultName (see delegateYield).
  7546. context[delegate.resultName] = info.value;
  7547. // Resume execution at the desired location (see delegateYield).
  7548. context.next = delegate.nextLoc;
  7549. // If context.method was "throw" but the delegate handled the
  7550. // exception, let the outer generator proceed normally. If
  7551. // context.method was "next", forget context.arg since it has been
  7552. // "consumed" by the delegate iterator. If context.method was
  7553. // "return", allow the original .return call to continue in the
  7554. // outer generator.
  7555. if (context.method !== "return") {
  7556. context.method = "next";
  7557. context.arg = undefined;
  7558. }
  7559. } else {
  7560. // Re-yield the result returned by the delegate method.
  7561. return info;
  7562. }
  7563. // The delegate iterator is finished, so forget it and continue with
  7564. // the outer generator.
  7565. context.delegate = null;
  7566. return ContinueSentinel;
  7567. }
  7568. // Define Generator.prototype.{next,throw,return} in terms of the
  7569. // unified ._invoke helper method.
  7570. defineIteratorMethods(Gp);
  7571. Gp[toStringTagSymbol] = "Generator";
  7572. // A Generator should always return itself as the iterator object when the
  7573. // @@iterator function is called on it. Some browsers' implementations of the
  7574. // iterator prototype chain incorrectly implement this, causing the Generator
  7575. // object to not be returned from this call. This ensures that doesn't happen.
  7576. // See https://github.com/facebook/regenerator/issues/274 for more details.
  7577. Gp[iteratorSymbol] = function() {
  7578. return this;
  7579. };
  7580. Gp.toString = function() {
  7581. return "[object Generator]";
  7582. };
  7583. function pushTryEntry(locs) {
  7584. var entry = { tryLoc: locs[0] };
  7585. if (1 in locs) {
  7586. entry.catchLoc = locs[1];
  7587. }
  7588. if (2 in locs) {
  7589. entry.finallyLoc = locs[2];
  7590. entry.afterLoc = locs[3];
  7591. }
  7592. this.tryEntries.push(entry);
  7593. }
  7594. function resetTryEntry(entry) {
  7595. var record = entry.completion || {};
  7596. record.type = "normal";
  7597. delete record.arg;
  7598. entry.completion = record;
  7599. }
  7600. function Context(tryLocsList) {
  7601. // The root entry object (effectively a try statement without a catch
  7602. // or a finally block) gives us a place to store values thrown from
  7603. // locations where there is no enclosing try statement.
  7604. this.tryEntries = [{ tryLoc: "root" }];
  7605. tryLocsList.forEach(pushTryEntry, this);
  7606. this.reset(true);
  7607. }
  7608. runtime.keys = function(object) {
  7609. var keys = [];
  7610. for (var key in object) {
  7611. keys.push(key);
  7612. }
  7613. keys.reverse();
  7614. // Rather than returning an object with a next method, we keep
  7615. // things simple and return the next function itself.
  7616. return function next() {
  7617. while (keys.length) {
  7618. var key = keys.pop();
  7619. if (key in object) {
  7620. next.value = key;
  7621. next.done = false;
  7622. return next;
  7623. }
  7624. }
  7625. // To avoid creating an additional object, we just hang the .value
  7626. // and .done properties off the next function object itself. This
  7627. // also ensures that the minifier will not anonymize the function.
  7628. next.done = true;
  7629. return next;
  7630. };
  7631. };
  7632. function values(iterable) {
  7633. if (iterable) {
  7634. var iteratorMethod = iterable[iteratorSymbol];
  7635. if (iteratorMethod) {
  7636. return iteratorMethod.call(iterable);
  7637. }
  7638. if (typeof iterable.next === "function") {
  7639. return iterable;
  7640. }
  7641. if (!isNaN(iterable.length)) {
  7642. var i = -1, next = function next() {
  7643. while (++i < iterable.length) {
  7644. if (hasOwn.call(iterable, i)) {
  7645. next.value = iterable[i];
  7646. next.done = false;
  7647. return next;
  7648. }
  7649. }
  7650. next.value = undefined;
  7651. next.done = true;
  7652. return next;
  7653. };
  7654. return next.next = next;
  7655. }
  7656. }
  7657. // Return an iterator with no values.
  7658. return { next: doneResult };
  7659. }
  7660. runtime.values = values;
  7661. function doneResult() {
  7662. return { value: undefined, done: true };
  7663. }
  7664. Context.prototype = {
  7665. constructor: Context,
  7666. reset: function(skipTempReset) {
  7667. this.prev = 0;
  7668. this.next = 0;
  7669. // Resetting context._sent for legacy support of Babel's
  7670. // function.sent implementation.
  7671. this.sent = this._sent = undefined;
  7672. this.done = false;
  7673. this.delegate = null;
  7674. this.method = "next";
  7675. this.arg = undefined;
  7676. this.tryEntries.forEach(resetTryEntry);
  7677. if (!skipTempReset) {
  7678. for (var name in this) {
  7679. // Not sure about the optimal order of these conditions:
  7680. if (name.charAt(0) === "t" &&
  7681. hasOwn.call(this, name) &&
  7682. !isNaN(+name.slice(1))) {
  7683. this[name] = undefined;
  7684. }
  7685. }
  7686. }
  7687. },
  7688. stop: function() {
  7689. this.done = true;
  7690. var rootEntry = this.tryEntries[0];
  7691. var rootRecord = rootEntry.completion;
  7692. if (rootRecord.type === "throw") {
  7693. throw rootRecord.arg;
  7694. }
  7695. return this.rval;
  7696. },
  7697. dispatchException: function(exception) {
  7698. if (this.done) {
  7699. throw exception;
  7700. }
  7701. var context = this;
  7702. function handle(loc, caught) {
  7703. record.type = "throw";
  7704. record.arg = exception;
  7705. context.next = loc;
  7706. if (caught) {
  7707. // If the dispatched exception was caught by a catch block,
  7708. // then let that catch block handle the exception normally.
  7709. context.method = "next";
  7710. context.arg = undefined;
  7711. }
  7712. return !! caught;
  7713. }
  7714. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  7715. var entry = this.tryEntries[i];
  7716. var record = entry.completion;
  7717. if (entry.tryLoc === "root") {
  7718. // Exception thrown outside of any try block that could handle
  7719. // it, so set the completion value of the entire function to
  7720. // throw the exception.
  7721. return handle("end");
  7722. }
  7723. if (entry.tryLoc <= this.prev) {
  7724. var hasCatch = hasOwn.call(entry, "catchLoc");
  7725. var hasFinally = hasOwn.call(entry, "finallyLoc");
  7726. if (hasCatch && hasFinally) {
  7727. if (this.prev < entry.catchLoc) {
  7728. return handle(entry.catchLoc, true);
  7729. } else if (this.prev < entry.finallyLoc) {
  7730. return handle(entry.finallyLoc);
  7731. }
  7732. } else if (hasCatch) {
  7733. if (this.prev < entry.catchLoc) {
  7734. return handle(entry.catchLoc, true);
  7735. }
  7736. } else if (hasFinally) {
  7737. if (this.prev < entry.finallyLoc) {
  7738. return handle(entry.finallyLoc);
  7739. }
  7740. } else {
  7741. throw new Error("try statement without catch or finally");
  7742. }
  7743. }
  7744. }
  7745. },
  7746. abrupt: function(type, arg) {
  7747. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  7748. var entry = this.tryEntries[i];
  7749. if (entry.tryLoc <= this.prev &&
  7750. hasOwn.call(entry, "finallyLoc") &&
  7751. this.prev < entry.finallyLoc) {
  7752. var finallyEntry = entry;
  7753. break;
  7754. }
  7755. }
  7756. if (finallyEntry &&
  7757. (type === "break" ||
  7758. type === "continue") &&
  7759. finallyEntry.tryLoc <= arg &&
  7760. arg <= finallyEntry.finallyLoc) {
  7761. // Ignore the finally entry if control is not jumping to a
  7762. // location outside the try/catch block.
  7763. finallyEntry = null;
  7764. }
  7765. var record = finallyEntry ? finallyEntry.completion : {};
  7766. record.type = type;
  7767. record.arg = arg;
  7768. if (finallyEntry) {
  7769. this.method = "next";
  7770. this.next = finallyEntry.finallyLoc;
  7771. return ContinueSentinel;
  7772. }
  7773. return this.complete(record);
  7774. },
  7775. complete: function(record, afterLoc) {
  7776. if (record.type === "throw") {
  7777. throw record.arg;
  7778. }
  7779. if (record.type === "break" ||
  7780. record.type === "continue") {
  7781. this.next = record.arg;
  7782. } else if (record.type === "return") {
  7783. this.rval = this.arg = record.arg;
  7784. this.method = "return";
  7785. this.next = "end";
  7786. } else if (record.type === "normal" && afterLoc) {
  7787. this.next = afterLoc;
  7788. }
  7789. return ContinueSentinel;
  7790. },
  7791. finish: function(finallyLoc) {
  7792. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  7793. var entry = this.tryEntries[i];
  7794. if (entry.finallyLoc === finallyLoc) {
  7795. this.complete(entry.completion, entry.afterLoc);
  7796. resetTryEntry(entry);
  7797. return ContinueSentinel;
  7798. }
  7799. }
  7800. },
  7801. "catch": function(tryLoc) {
  7802. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  7803. var entry = this.tryEntries[i];
  7804. if (entry.tryLoc === tryLoc) {
  7805. var record = entry.completion;
  7806. if (record.type === "throw") {
  7807. var thrown = record.arg;
  7808. resetTryEntry(entry);
  7809. }
  7810. return thrown;
  7811. }
  7812. }
  7813. // The context.catch method must only be called with a location
  7814. // argument that corresponds to a known catch block.
  7815. throw new Error("illegal catch attempt");
  7816. },
  7817. delegateYield: function(iterable, resultName, nextLoc) {
  7818. this.delegate = {
  7819. iterator: values(iterable),
  7820. resultName: resultName,
  7821. nextLoc: nextLoc
  7822. };
  7823. if (this.method === "next") {
  7824. // Deliberately forget the last sent value so that we don't
  7825. // accidentally pass it on to the delegate.
  7826. this.arg = undefined;
  7827. }
  7828. return ContinueSentinel;
  7829. }
  7830. };
  7831. })(
  7832. // Among the various tricks for obtaining a reference to the global
  7833. // object, this seems to be the most reliable technique that does not
  7834. // use indirect eval (which violates Content Security Policy).
  7835. typeof global === "object" ? global :
  7836. typeof window === "object" ? window :
  7837. typeof self === "object" ? self : this
  7838. );
  7839. /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
  7840. /***/ }),
  7841. /* 329 */
  7842. /***/ (function(module, exports, __webpack_require__) {
  7843. __webpack_require__(330);
  7844. module.exports = __webpack_require__(9).RegExp.escape;
  7845. /***/ }),
  7846. /* 330 */
  7847. /***/ (function(module, exports, __webpack_require__) {
  7848. // https://github.com/benjamingr/RexExp.escape
  7849. var $export = __webpack_require__(8);
  7850. var $re = __webpack_require__(331)(/[\\^$*+?.()|[\]{}]/g, '\\$&');
  7851. $export($export.S, 'RegExp', { escape: function escape(it) { return $re(it); } });
  7852. /***/ }),
  7853. /* 331 */
  7854. /***/ (function(module, exports) {
  7855. module.exports = function (regExp, replace) {
  7856. var replacer = replace === Object(replace) ? function (part) {
  7857. return replace[part];
  7858. } : replace;
  7859. return function (it) {
  7860. return String(it).replace(regExp, replacer);
  7861. };
  7862. };
  7863. /***/ }),
  7864. /* 332 */
  7865. /***/ (function(module, exports, __webpack_require__) {
  7866. var BSON = __webpack_require__(333),
  7867. Binary = __webpack_require__(356),
  7868. Code = __webpack_require__(351),
  7869. DBRef = __webpack_require__(355),
  7870. Decimal128 = __webpack_require__(352),
  7871. Double = __webpack_require__(336),
  7872. Int32 = __webpack_require__(350),
  7873. Long = __webpack_require__(335),
  7874. Map = __webpack_require__(334),
  7875. MaxKey = __webpack_require__(354),
  7876. MinKey = __webpack_require__(353),
  7877. ObjectId = __webpack_require__(338),
  7878. BSONRegExp = __webpack_require__(348),
  7879. Symbol = __webpack_require__(349),
  7880. Timestamp = __webpack_require__(337);
  7881. // BSON MAX VALUES
  7882. BSON.BSON_INT32_MAX = 0x7fffffff;
  7883. BSON.BSON_INT32_MIN = -0x80000000;
  7884. BSON.BSON_INT64_MAX = Math.pow(2, 63) - 1;
  7885. BSON.BSON_INT64_MIN = -Math.pow(2, 63);
  7886. // JS MAX PRECISE VALUES
  7887. BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
  7888. BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
  7889. // Add BSON types to function creation
  7890. BSON.Binary = Binary;
  7891. BSON.Code = Code;
  7892. BSON.DBRef = DBRef;
  7893. BSON.Decimal128 = Decimal128;
  7894. BSON.Double = Double;
  7895. BSON.Int32 = Int32;
  7896. BSON.Long = Long;
  7897. BSON.Map = Map;
  7898. BSON.MaxKey = MaxKey;
  7899. BSON.MinKey = MinKey;
  7900. BSON.ObjectId = ObjectId;
  7901. BSON.ObjectID = ObjectId;
  7902. BSON.BSONRegExp = BSONRegExp;
  7903. BSON.Symbol = Symbol;
  7904. BSON.Timestamp = Timestamp;
  7905. // Return the BSON
  7906. module.exports = BSON;
  7907. /***/ }),
  7908. /* 333 */
  7909. /***/ (function(module, exports, __webpack_require__) {
  7910. 'use strict';
  7911. var Map = __webpack_require__(334),
  7912. Long = __webpack_require__(335),
  7913. Double = __webpack_require__(336),
  7914. Timestamp = __webpack_require__(337),
  7915. ObjectID = __webpack_require__(338),
  7916. BSONRegExp = __webpack_require__(348),
  7917. Symbol = __webpack_require__(349),
  7918. Int32 = __webpack_require__(350),
  7919. Code = __webpack_require__(351),
  7920. Decimal128 = __webpack_require__(352),
  7921. MinKey = __webpack_require__(353),
  7922. MaxKey = __webpack_require__(354),
  7923. DBRef = __webpack_require__(355),
  7924. Binary = __webpack_require__(356);
  7925. // Parts of the parser
  7926. var deserialize = __webpack_require__(357),
  7927. serializer = __webpack_require__(358),
  7928. calculateObjectSize = __webpack_require__(360),
  7929. utils = __webpack_require__(344);
  7930. /**
  7931. * @ignore
  7932. * @api private
  7933. */
  7934. // Default Max Size
  7935. var MAXSIZE = 1024 * 1024 * 17;
  7936. // Current Internal Temporary Serialization Buffer
  7937. var buffer = utils.allocBuffer(MAXSIZE);
  7938. var BSON = function () {};
  7939. /**
  7940. * Serialize a Javascript object.
  7941. *
  7942. * @param {Object} object the Javascript object to serialize.
  7943. * @param {Boolean} [options.checkKeys] the serializer will check if keys are valid.
  7944. * @param {Boolean} [options.serializeFunctions=false] serialize the javascript functions **(default:false)**.
  7945. * @param {Boolean} [options.ignoreUndefined=true] ignore undefined fields **(default:true)**.
  7946. * @param {Number} [options.minInternalBufferSize=1024*1024*17] minimum size of the internal temporary serialization buffer **(default:1024*1024*17)**.
  7947. * @return {Buffer} returns the Buffer object containing the serialized object.
  7948. * @api public
  7949. */
  7950. BSON.prototype.serialize = function serialize(object, options) {
  7951. options = options || {};
  7952. // Unpack the options
  7953. var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false;
  7954. var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false;
  7955. var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true;
  7956. var minInternalBufferSize = typeof options.minInternalBufferSize === 'number' ? options.minInternalBufferSize : MAXSIZE;
  7957. // Resize the internal serialization buffer if needed
  7958. if (buffer.length < minInternalBufferSize) {
  7959. buffer = utils.allocBuffer(minInternalBufferSize);
  7960. }
  7961. // Attempt to serialize
  7962. var serializationIndex = serializer(buffer, object, checkKeys, 0, 0, serializeFunctions, ignoreUndefined, []);
  7963. // Create the final buffer
  7964. var finishedBuffer = utils.allocBuffer(serializationIndex);
  7965. // Copy into the finished buffer
  7966. buffer.copy(finishedBuffer, 0, 0, finishedBuffer.length);
  7967. // Return the buffer
  7968. return finishedBuffer;
  7969. };
  7970. /**
  7971. * Serialize a Javascript object using a predefined Buffer and index into the buffer, useful when pre-allocating the space for serialization.
  7972. *
  7973. * @param {Object} object the Javascript object to serialize.
  7974. * @param {Buffer} buffer the Buffer you pre-allocated to store the serialized BSON object.
  7975. * @param {Boolean} [options.checkKeys] the serializer will check if keys are valid.
  7976. * @param {Boolean} [options.serializeFunctions=false] serialize the javascript functions **(default:false)**.
  7977. * @param {Boolean} [options.ignoreUndefined=true] ignore undefined fields **(default:true)**.
  7978. * @param {Number} [options.index] the index in the buffer where we wish to start serializing into.
  7979. * @return {Number} returns the index pointing to the last written byte in the buffer.
  7980. * @api public
  7981. */
  7982. BSON.prototype.serializeWithBufferAndIndex = function (object, finalBuffer, options) {
  7983. options = options || {};
  7984. // Unpack the options
  7985. var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false;
  7986. var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false;
  7987. var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true;
  7988. var startIndex = typeof options.index === 'number' ? options.index : 0;
  7989. // Attempt to serialize
  7990. var serializationIndex = serializer(finalBuffer, object, checkKeys, startIndex || 0, 0, serializeFunctions, ignoreUndefined);
  7991. // Return the index
  7992. return serializationIndex - 1;
  7993. };
  7994. /**
  7995. * Deserialize data as BSON.
  7996. *
  7997. * @param {Buffer} buffer the buffer containing the serialized set of BSON documents.
  7998. * @param {Object} [options.evalFunctions=false] evaluate functions in the BSON document scoped to the object deserialized.
  7999. * @param {Object} [options.cacheFunctions=false] cache evaluated functions for reuse.
  8000. * @param {Object} [options.cacheFunctionsCrc32=false] use a crc32 code for caching, otherwise use the string of the function.
  8001. * @param {Object} [options.promoteLongs=true] when deserializing a Long will fit it into a Number if it's smaller than 53 bits
  8002. * @param {Object} [options.promoteBuffers=false] when deserializing a Binary will return it as a node.js Buffer instance.
  8003. * @param {Object} [options.promoteValues=false] when deserializing will promote BSON values to their Node.js closest equivalent types.
  8004. * @param {Object} [options.fieldsAsRaw=null] allow to specify if there what fields we wish to return as unserialized raw buffer.
  8005. * @param {Object} [options.bsonRegExp=false] return BSON regular expressions as BSONRegExp instances.
  8006. * @return {Object} returns the deserialized Javascript Object.
  8007. * @api public
  8008. */
  8009. BSON.prototype.deserialize = function (buffer, options) {
  8010. return deserialize(buffer, options);
  8011. };
  8012. /**
  8013. * Calculate the bson size for a passed in Javascript object.
  8014. *
  8015. * @param {Object} object the Javascript object to calculate the BSON byte size for.
  8016. * @param {Boolean} [options.serializeFunctions=false] serialize the javascript functions **(default:false)**.
  8017. * @param {Boolean} [options.ignoreUndefined=true] ignore undefined fields **(default:true)**.
  8018. * @return {Number} returns the number of bytes the BSON object will take up.
  8019. * @api public
  8020. */
  8021. BSON.prototype.calculateObjectSize = function (object, options) {
  8022. options = options || {};
  8023. var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false;
  8024. var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true;
  8025. return calculateObjectSize(object, serializeFunctions, ignoreUndefined);
  8026. };
  8027. /**
  8028. * Deserialize stream data as BSON documents.
  8029. *
  8030. * @param {Buffer} data the buffer containing the serialized set of BSON documents.
  8031. * @param {Number} startIndex the start index in the data Buffer where the deserialization is to start.
  8032. * @param {Number} numberOfDocuments number of documents to deserialize.
  8033. * @param {Array} documents an array where to store the deserialized documents.
  8034. * @param {Number} docStartIndex the index in the documents array from where to start inserting documents.
  8035. * @param {Object} [options] additional options used for the deserialization.
  8036. * @param {Object} [options.evalFunctions=false] evaluate functions in the BSON document scoped to the object deserialized.
  8037. * @param {Object} [options.cacheFunctions=false] cache evaluated functions for reuse.
  8038. * @param {Object} [options.cacheFunctionsCrc32=false] use a crc32 code for caching, otherwise use the string of the function.
  8039. * @param {Object} [options.promoteLongs=true] when deserializing a Long will fit it into a Number if it's smaller than 53 bits
  8040. * @param {Object} [options.promoteBuffers=false] when deserializing a Binary will return it as a node.js Buffer instance.
  8041. * @param {Object} [options.promoteValues=false] when deserializing will promote BSON values to their Node.js closest equivalent types.
  8042. * @param {Object} [options.fieldsAsRaw=null] allow to specify if there what fields we wish to return as unserialized raw buffer.
  8043. * @param {Object} [options.bsonRegExp=false] return BSON regular expressions as BSONRegExp instances.
  8044. * @return {Number} returns the next index in the buffer after deserialization **x** numbers of documents.
  8045. * @api public
  8046. */
  8047. BSON.prototype.deserializeStream = function (data, startIndex, numberOfDocuments, documents, docStartIndex, options) {
  8048. options = options != null ? options : {};
  8049. var index = startIndex;
  8050. // Loop over all documents
  8051. for (var i = 0; i < numberOfDocuments; i++) {
  8052. // Find size of the document
  8053. var size = data[index] | data[index + 1] << 8 | data[index + 2] << 16 | data[index + 3] << 24;
  8054. // Update options with index
  8055. options['index'] = index;
  8056. // Parse the document at this point
  8057. documents[docStartIndex + i] = this.deserialize(data, options);
  8058. // Adjust index by the document size
  8059. index = index + size;
  8060. }
  8061. // Return object containing end index of parsing and list of documents
  8062. return index;
  8063. };
  8064. /**
  8065. * @ignore
  8066. * @api private
  8067. */
  8068. // BSON MAX VALUES
  8069. BSON.BSON_INT32_MAX = 0x7fffffff;
  8070. BSON.BSON_INT32_MIN = -0x80000000;
  8071. BSON.BSON_INT64_MAX = Math.pow(2, 63) - 1;
  8072. BSON.BSON_INT64_MIN = -Math.pow(2, 63);
  8073. // JS MAX PRECISE VALUES
  8074. BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
  8075. BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
  8076. // Internal long versions
  8077. // var JS_INT_MAX_LONG = Long.fromNumber(0x20000000000000); // Any integer up to 2^53 can be precisely represented by a double.
  8078. // var JS_INT_MIN_LONG = Long.fromNumber(-0x20000000000000); // Any integer down to -2^53 can be precisely represented by a double.
  8079. /**
  8080. * Number BSON Type
  8081. *
  8082. * @classconstant BSON_DATA_NUMBER
  8083. **/
  8084. BSON.BSON_DATA_NUMBER = 1;
  8085. /**
  8086. * String BSON Type
  8087. *
  8088. * @classconstant BSON_DATA_STRING
  8089. **/
  8090. BSON.BSON_DATA_STRING = 2;
  8091. /**
  8092. * Object BSON Type
  8093. *
  8094. * @classconstant BSON_DATA_OBJECT
  8095. **/
  8096. BSON.BSON_DATA_OBJECT = 3;
  8097. /**
  8098. * Array BSON Type
  8099. *
  8100. * @classconstant BSON_DATA_ARRAY
  8101. **/
  8102. BSON.BSON_DATA_ARRAY = 4;
  8103. /**
  8104. * Binary BSON Type
  8105. *
  8106. * @classconstant BSON_DATA_BINARY
  8107. **/
  8108. BSON.BSON_DATA_BINARY = 5;
  8109. /**
  8110. * ObjectID BSON Type
  8111. *
  8112. * @classconstant BSON_DATA_OID
  8113. **/
  8114. BSON.BSON_DATA_OID = 7;
  8115. /**
  8116. * Boolean BSON Type
  8117. *
  8118. * @classconstant BSON_DATA_BOOLEAN
  8119. **/
  8120. BSON.BSON_DATA_BOOLEAN = 8;
  8121. /**
  8122. * Date BSON Type
  8123. *
  8124. * @classconstant BSON_DATA_DATE
  8125. **/
  8126. BSON.BSON_DATA_DATE = 9;
  8127. /**
  8128. * null BSON Type
  8129. *
  8130. * @classconstant BSON_DATA_NULL
  8131. **/
  8132. BSON.BSON_DATA_NULL = 10;
  8133. /**
  8134. * RegExp BSON Type
  8135. *
  8136. * @classconstant BSON_DATA_REGEXP
  8137. **/
  8138. BSON.BSON_DATA_REGEXP = 11;
  8139. /**
  8140. * Code BSON Type
  8141. *
  8142. * @classconstant BSON_DATA_CODE
  8143. **/
  8144. BSON.BSON_DATA_CODE = 13;
  8145. /**
  8146. * Symbol BSON Type
  8147. *
  8148. * @classconstant BSON_DATA_SYMBOL
  8149. **/
  8150. BSON.BSON_DATA_SYMBOL = 14;
  8151. /**
  8152. * Code with Scope BSON Type
  8153. *
  8154. * @classconstant BSON_DATA_CODE_W_SCOPE
  8155. **/
  8156. BSON.BSON_DATA_CODE_W_SCOPE = 15;
  8157. /**
  8158. * 32 bit Integer BSON Type
  8159. *
  8160. * @classconstant BSON_DATA_INT
  8161. **/
  8162. BSON.BSON_DATA_INT = 16;
  8163. /**
  8164. * Timestamp BSON Type
  8165. *
  8166. * @classconstant BSON_DATA_TIMESTAMP
  8167. **/
  8168. BSON.BSON_DATA_TIMESTAMP = 17;
  8169. /**
  8170. * Long BSON Type
  8171. *
  8172. * @classconstant BSON_DATA_LONG
  8173. **/
  8174. BSON.BSON_DATA_LONG = 18;
  8175. /**
  8176. * MinKey BSON Type
  8177. *
  8178. * @classconstant BSON_DATA_MIN_KEY
  8179. **/
  8180. BSON.BSON_DATA_MIN_KEY = 0xff;
  8181. /**
  8182. * MaxKey BSON Type
  8183. *
  8184. * @classconstant BSON_DATA_MAX_KEY
  8185. **/
  8186. BSON.BSON_DATA_MAX_KEY = 0x7f;
  8187. /**
  8188. * Binary Default Type
  8189. *
  8190. * @classconstant BSON_BINARY_SUBTYPE_DEFAULT
  8191. **/
  8192. BSON.BSON_BINARY_SUBTYPE_DEFAULT = 0;
  8193. /**
  8194. * Binary Function Type
  8195. *
  8196. * @classconstant BSON_BINARY_SUBTYPE_FUNCTION
  8197. **/
  8198. BSON.BSON_BINARY_SUBTYPE_FUNCTION = 1;
  8199. /**
  8200. * Binary Byte Array Type
  8201. *
  8202. * @classconstant BSON_BINARY_SUBTYPE_BYTE_ARRAY
  8203. **/
  8204. BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2;
  8205. /**
  8206. * Binary UUID Type
  8207. *
  8208. * @classconstant BSON_BINARY_SUBTYPE_UUID
  8209. **/
  8210. BSON.BSON_BINARY_SUBTYPE_UUID = 3;
  8211. /**
  8212. * Binary MD5 Type
  8213. *
  8214. * @classconstant BSON_BINARY_SUBTYPE_MD5
  8215. **/
  8216. BSON.BSON_BINARY_SUBTYPE_MD5 = 4;
  8217. /**
  8218. * Binary User Defined Type
  8219. *
  8220. * @classconstant BSON_BINARY_SUBTYPE_USER_DEFINED
  8221. **/
  8222. BSON.BSON_BINARY_SUBTYPE_USER_DEFINED = 128;
  8223. // Return BSON
  8224. module.exports = BSON;
  8225. module.exports.Code = Code;
  8226. module.exports.Map = Map;
  8227. module.exports.Symbol = Symbol;
  8228. module.exports.BSON = BSON;
  8229. module.exports.DBRef = DBRef;
  8230. module.exports.Binary = Binary;
  8231. module.exports.ObjectID = ObjectID;
  8232. module.exports.Long = Long;
  8233. module.exports.Timestamp = Timestamp;
  8234. module.exports.Double = Double;
  8235. module.exports.Int32 = Int32;
  8236. module.exports.MinKey = MinKey;
  8237. module.exports.MaxKey = MaxKey;
  8238. module.exports.BSONRegExp = BSONRegExp;
  8239. module.exports.Decimal128 = Decimal128;
  8240. /***/ }),
  8241. /* 334 */
  8242. /***/ (function(module, exports) {
  8243. /* WEBPACK VAR INJECTION */(function(global) {'use strict';
  8244. // We have an ES6 Map available, return the native instance
  8245. if (typeof global.Map !== 'undefined') {
  8246. module.exports = global.Map;
  8247. module.exports.Map = global.Map;
  8248. } else {
  8249. // We will return a polyfill
  8250. var Map = function (array) {
  8251. this._keys = [];
  8252. this._values = {};
  8253. for (var i = 0; i < array.length; i++) {
  8254. if (array[i] == null) continue; // skip null and undefined
  8255. var entry = array[i];
  8256. var key = entry[0];
  8257. var value = entry[1];
  8258. // Add the key to the list of keys in order
  8259. this._keys.push(key);
  8260. // Add the key and value to the values dictionary with a point
  8261. // to the location in the ordered keys list
  8262. this._values[key] = { v: value, i: this._keys.length - 1 };
  8263. }
  8264. };
  8265. Map.prototype.clear = function () {
  8266. this._keys = [];
  8267. this._values = {};
  8268. };
  8269. Map.prototype.delete = function (key) {
  8270. var value = this._values[key];
  8271. if (value == null) return false;
  8272. // Delete entry
  8273. delete this._values[key];
  8274. // Remove the key from the ordered keys list
  8275. this._keys.splice(value.i, 1);
  8276. return true;
  8277. };
  8278. Map.prototype.entries = function () {
  8279. var self = this;
  8280. var index = 0;
  8281. return {
  8282. next: function () {
  8283. var key = self._keys[index++];
  8284. return {
  8285. value: key !== undefined ? [key, self._values[key].v] : undefined,
  8286. done: key !== undefined ? false : true
  8287. };
  8288. }
  8289. };
  8290. };
  8291. Map.prototype.forEach = function (callback, self) {
  8292. self = self || this;
  8293. for (var i = 0; i < this._keys.length; i++) {
  8294. var key = this._keys[i];
  8295. // Call the forEach callback
  8296. callback.call(self, this._values[key].v, key, self);
  8297. }
  8298. };
  8299. Map.prototype.get = function (key) {
  8300. return this._values[key] ? this._values[key].v : undefined;
  8301. };
  8302. Map.prototype.has = function (key) {
  8303. return this._values[key] != null;
  8304. };
  8305. Map.prototype.keys = function () {
  8306. var self = this;
  8307. var index = 0;
  8308. return {
  8309. next: function () {
  8310. var key = self._keys[index++];
  8311. return {
  8312. value: key !== undefined ? key : undefined,
  8313. done: key !== undefined ? false : true
  8314. };
  8315. }
  8316. };
  8317. };
  8318. Map.prototype.set = function (key, value) {
  8319. if (this._values[key]) {
  8320. this._values[key].v = value;
  8321. return this;
  8322. }
  8323. // Add the key to the list of keys in order
  8324. this._keys.push(key);
  8325. // Add the key and value to the values dictionary with a point
  8326. // to the location in the ordered keys list
  8327. this._values[key] = { v: value, i: this._keys.length - 1 };
  8328. return this;
  8329. };
  8330. Map.prototype.values = function () {
  8331. var self = this;
  8332. var index = 0;
  8333. return {
  8334. next: function () {
  8335. var key = self._keys[index++];
  8336. return {
  8337. value: key !== undefined ? self._values[key].v : undefined,
  8338. done: key !== undefined ? false : true
  8339. };
  8340. }
  8341. };
  8342. };
  8343. // Last ismaster
  8344. Object.defineProperty(Map.prototype, 'size', {
  8345. enumerable: true,
  8346. get: function () {
  8347. return this._keys.length;
  8348. }
  8349. });
  8350. module.exports = Map;
  8351. module.exports.Map = Map;
  8352. }
  8353. /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
  8354. /***/ }),
  8355. /* 335 */
  8356. /***/ (function(module, exports) {
  8357. // Licensed under the Apache License, Version 2.0 (the "License");
  8358. // you may not use this file except in compliance with the License.
  8359. // You may obtain a copy of the License at
  8360. //
  8361. // http://www.apache.org/licenses/LICENSE-2.0
  8362. //
  8363. // Unless required by applicable law or agreed to in writing, software
  8364. // distributed under the License is distributed on an "AS IS" BASIS,
  8365. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8366. // See the License for the specific language governing permissions and
  8367. // limitations under the License.
  8368. //
  8369. // Copyright 2009 Google Inc. All Rights Reserved
  8370. /**
  8371. * Defines a Long class for representing a 64-bit two's-complement
  8372. * integer value, which faithfully simulates the behavior of a Java "Long". This
  8373. * implementation is derived from LongLib in GWT.
  8374. *
  8375. * Constructs a 64-bit two's-complement integer, given its low and high 32-bit
  8376. * values as *signed* integers. See the from* functions below for more
  8377. * convenient ways of constructing Longs.
  8378. *
  8379. * The internal representation of a Long is the two given signed, 32-bit values.
  8380. * We use 32-bit pieces because these are the size of integers on which
  8381. * Javascript performs bit-operations. For operations like addition and
  8382. * multiplication, we split each number into 16-bit pieces, which can easily be
  8383. * multiplied within Javascript's floating-point representation without overflow
  8384. * or change in sign.
  8385. *
  8386. * In the algorithms below, we frequently reduce the negative case to the
  8387. * positive case by negating the input(s) and then post-processing the result.
  8388. * Note that we must ALWAYS check specially whether those values are MIN_VALUE
  8389. * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as
  8390. * a positive number, it overflows back into a negative). Not handling this
  8391. * case would often result in infinite recursion.
  8392. *
  8393. * @class
  8394. * @param {number} low the low (signed) 32 bits of the Long.
  8395. * @param {number} high the high (signed) 32 bits of the Long.
  8396. * @return {Long}
  8397. */
  8398. function Long(low, high) {
  8399. if (!(this instanceof Long)) return new Long(low, high);
  8400. this._bsontype = 'Long';
  8401. /**
  8402. * @type {number}
  8403. * @ignore
  8404. */
  8405. this.low_ = low | 0; // force into 32 signed bits.
  8406. /**
  8407. * @type {number}
  8408. * @ignore
  8409. */
  8410. this.high_ = high | 0; // force into 32 signed bits.
  8411. }
  8412. /**
  8413. * Return the int value.
  8414. *
  8415. * @method
  8416. * @return {number} the value, assuming it is a 32-bit integer.
  8417. */
  8418. Long.prototype.toInt = function () {
  8419. return this.low_;
  8420. };
  8421. /**
  8422. * Return the Number value.
  8423. *
  8424. * @method
  8425. * @return {number} the closest floating-point representation to this value.
  8426. */
  8427. Long.prototype.toNumber = function () {
  8428. return this.high_ * Long.TWO_PWR_32_DBL_ + this.getLowBitsUnsigned();
  8429. };
  8430. /**
  8431. * Return the JSON value.
  8432. *
  8433. * @method
  8434. * @return {string} the JSON representation.
  8435. */
  8436. Long.prototype.toJSON = function () {
  8437. return this.toString();
  8438. };
  8439. /**
  8440. * Return the String value.
  8441. *
  8442. * @method
  8443. * @param {number} [opt_radix] the radix in which the text should be written.
  8444. * @return {string} the textual representation of this value.
  8445. */
  8446. Long.prototype.toString = function (opt_radix) {
  8447. var radix = opt_radix || 10;
  8448. if (radix < 2 || 36 < radix) {
  8449. throw Error('radix out of range: ' + radix);
  8450. }
  8451. if (this.isZero()) {
  8452. return '0';
  8453. }
  8454. if (this.isNegative()) {
  8455. if (this.equals(Long.MIN_VALUE)) {
  8456. // We need to change the Long value before it can be negated, so we remove
  8457. // the bottom-most digit in this base and then recurse to do the rest.
  8458. var radixLong = Long.fromNumber(radix);
  8459. var div = this.div(radixLong);
  8460. var rem = div.multiply(radixLong).subtract(this);
  8461. return div.toString(radix) + rem.toInt().toString(radix);
  8462. } else {
  8463. return '-' + this.negate().toString(radix);
  8464. }
  8465. }
  8466. // Do several (6) digits each time through the loop, so as to
  8467. // minimize the calls to the very expensive emulated div.
  8468. var radixToPower = Long.fromNumber(Math.pow(radix, 6));
  8469. rem = this;
  8470. var result = '';
  8471. while (!rem.isZero()) {
  8472. var remDiv = rem.div(radixToPower);
  8473. var intval = rem.subtract(remDiv.multiply(radixToPower)).toInt();
  8474. var digits = intval.toString(radix);
  8475. rem = remDiv;
  8476. if (rem.isZero()) {
  8477. return digits + result;
  8478. } else {
  8479. while (digits.length < 6) {
  8480. digits = '0' + digits;
  8481. }
  8482. result = '' + digits + result;
  8483. }
  8484. }
  8485. };
  8486. /**
  8487. * Return the high 32-bits value.
  8488. *
  8489. * @method
  8490. * @return {number} the high 32-bits as a signed value.
  8491. */
  8492. Long.prototype.getHighBits = function () {
  8493. return this.high_;
  8494. };
  8495. /**
  8496. * Return the low 32-bits value.
  8497. *
  8498. * @method
  8499. * @return {number} the low 32-bits as a signed value.
  8500. */
  8501. Long.prototype.getLowBits = function () {
  8502. return this.low_;
  8503. };
  8504. /**
  8505. * Return the low unsigned 32-bits value.
  8506. *
  8507. * @method
  8508. * @return {number} the low 32-bits as an unsigned value.
  8509. */
  8510. Long.prototype.getLowBitsUnsigned = function () {
  8511. return this.low_ >= 0 ? this.low_ : Long.TWO_PWR_32_DBL_ + this.low_;
  8512. };
  8513. /**
  8514. * Returns the number of bits needed to represent the absolute value of this Long.
  8515. *
  8516. * @method
  8517. * @return {number} Returns the number of bits needed to represent the absolute value of this Long.
  8518. */
  8519. Long.prototype.getNumBitsAbs = function () {
  8520. if (this.isNegative()) {
  8521. if (this.equals(Long.MIN_VALUE)) {
  8522. return 64;
  8523. } else {
  8524. return this.negate().getNumBitsAbs();
  8525. }
  8526. } else {
  8527. var val = this.high_ !== 0 ? this.high_ : this.low_;
  8528. for (var bit = 31; bit > 0; bit--) {
  8529. if ((val & 1 << bit) !== 0) {
  8530. break;
  8531. }
  8532. }
  8533. return this.high_ !== 0 ? bit + 33 : bit + 1;
  8534. }
  8535. };
  8536. /**
  8537. * Return whether this value is zero.
  8538. *
  8539. * @method
  8540. * @return {boolean} whether this value is zero.
  8541. */
  8542. Long.prototype.isZero = function () {
  8543. return this.high_ === 0 && this.low_ === 0;
  8544. };
  8545. /**
  8546. * Return whether this value is negative.
  8547. *
  8548. * @method
  8549. * @return {boolean} whether this value is negative.
  8550. */
  8551. Long.prototype.isNegative = function () {
  8552. return this.high_ < 0;
  8553. };
  8554. /**
  8555. * Return whether this value is odd.
  8556. *
  8557. * @method
  8558. * @return {boolean} whether this value is odd.
  8559. */
  8560. Long.prototype.isOdd = function () {
  8561. return (this.low_ & 1) === 1;
  8562. };
  8563. /**
  8564. * Return whether this Long equals the other
  8565. *
  8566. * @method
  8567. * @param {Long} other Long to compare against.
  8568. * @return {boolean} whether this Long equals the other
  8569. */
  8570. Long.prototype.equals = function (other) {
  8571. return this.high_ === other.high_ && this.low_ === other.low_;
  8572. };
  8573. /**
  8574. * Return whether this Long does not equal the other.
  8575. *
  8576. * @method
  8577. * @param {Long} other Long to compare against.
  8578. * @return {boolean} whether this Long does not equal the other.
  8579. */
  8580. Long.prototype.notEquals = function (other) {
  8581. return this.high_ !== other.high_ || this.low_ !== other.low_;
  8582. };
  8583. /**
  8584. * Return whether this Long is less than the other.
  8585. *
  8586. * @method
  8587. * @param {Long} other Long to compare against.
  8588. * @return {boolean} whether this Long is less than the other.
  8589. */
  8590. Long.prototype.lessThan = function (other) {
  8591. return this.compare(other) < 0;
  8592. };
  8593. /**
  8594. * Return whether this Long is less than or equal to the other.
  8595. *
  8596. * @method
  8597. * @param {Long} other Long to compare against.
  8598. * @return {boolean} whether this Long is less than or equal to the other.
  8599. */
  8600. Long.prototype.lessThanOrEqual = function (other) {
  8601. return this.compare(other) <= 0;
  8602. };
  8603. /**
  8604. * Return whether this Long is greater than the other.
  8605. *
  8606. * @method
  8607. * @param {Long} other Long to compare against.
  8608. * @return {boolean} whether this Long is greater than the other.
  8609. */
  8610. Long.prototype.greaterThan = function (other) {
  8611. return this.compare(other) > 0;
  8612. };
  8613. /**
  8614. * Return whether this Long is greater than or equal to the other.
  8615. *
  8616. * @method
  8617. * @param {Long} other Long to compare against.
  8618. * @return {boolean} whether this Long is greater than or equal to the other.
  8619. */
  8620. Long.prototype.greaterThanOrEqual = function (other) {
  8621. return this.compare(other) >= 0;
  8622. };
  8623. /**
  8624. * Compares this Long with the given one.
  8625. *
  8626. * @method
  8627. * @param {Long} other Long to compare against.
  8628. * @return {boolean} 0 if they are the same, 1 if the this is greater, and -1 if the given one is greater.
  8629. */
  8630. Long.prototype.compare = function (other) {
  8631. if (this.equals(other)) {
  8632. return 0;
  8633. }
  8634. var thisNeg = this.isNegative();
  8635. var otherNeg = other.isNegative();
  8636. if (thisNeg && !otherNeg) {
  8637. return -1;
  8638. }
  8639. if (!thisNeg && otherNeg) {
  8640. return 1;
  8641. }
  8642. // at this point, the signs are the same, so subtraction will not overflow
  8643. if (this.subtract(other).isNegative()) {
  8644. return -1;
  8645. } else {
  8646. return 1;
  8647. }
  8648. };
  8649. /**
  8650. * The negation of this value.
  8651. *
  8652. * @method
  8653. * @return {Long} the negation of this value.
  8654. */
  8655. Long.prototype.negate = function () {
  8656. if (this.equals(Long.MIN_VALUE)) {
  8657. return Long.MIN_VALUE;
  8658. } else {
  8659. return this.not().add(Long.ONE);
  8660. }
  8661. };
  8662. /**
  8663. * Returns the sum of this and the given Long.
  8664. *
  8665. * @method
  8666. * @param {Long} other Long to add to this one.
  8667. * @return {Long} the sum of this and the given Long.
  8668. */
  8669. Long.prototype.add = function (other) {
  8670. // Divide each number into 4 chunks of 16 bits, and then sum the chunks.
  8671. var a48 = this.high_ >>> 16;
  8672. var a32 = this.high_ & 0xffff;
  8673. var a16 = this.low_ >>> 16;
  8674. var a00 = this.low_ & 0xffff;
  8675. var b48 = other.high_ >>> 16;
  8676. var b32 = other.high_ & 0xffff;
  8677. var b16 = other.low_ >>> 16;
  8678. var b00 = other.low_ & 0xffff;
  8679. var c48 = 0,
  8680. c32 = 0,
  8681. c16 = 0,
  8682. c00 = 0;
  8683. c00 += a00 + b00;
  8684. c16 += c00 >>> 16;
  8685. c00 &= 0xffff;
  8686. c16 += a16 + b16;
  8687. c32 += c16 >>> 16;
  8688. c16 &= 0xffff;
  8689. c32 += a32 + b32;
  8690. c48 += c32 >>> 16;
  8691. c32 &= 0xffff;
  8692. c48 += a48 + b48;
  8693. c48 &= 0xffff;
  8694. return Long.fromBits(c16 << 16 | c00, c48 << 16 | c32);
  8695. };
  8696. /**
  8697. * Returns the difference of this and the given Long.
  8698. *
  8699. * @method
  8700. * @param {Long} other Long to subtract from this.
  8701. * @return {Long} the difference of this and the given Long.
  8702. */
  8703. Long.prototype.subtract = function (other) {
  8704. return this.add(other.negate());
  8705. };
  8706. /**
  8707. * Returns the product of this and the given Long.
  8708. *
  8709. * @method
  8710. * @param {Long} other Long to multiply with this.
  8711. * @return {Long} the product of this and the other.
  8712. */
  8713. Long.prototype.multiply = function (other) {
  8714. if (this.isZero()) {
  8715. return Long.ZERO;
  8716. } else if (other.isZero()) {
  8717. return Long.ZERO;
  8718. }
  8719. if (this.equals(Long.MIN_VALUE)) {
  8720. return other.isOdd() ? Long.MIN_VALUE : Long.ZERO;
  8721. } else if (other.equals(Long.MIN_VALUE)) {
  8722. return this.isOdd() ? Long.MIN_VALUE : Long.ZERO;
  8723. }
  8724. if (this.isNegative()) {
  8725. if (other.isNegative()) {
  8726. return this.negate().multiply(other.negate());
  8727. } else {
  8728. return this.negate().multiply(other).negate();
  8729. }
  8730. } else if (other.isNegative()) {
  8731. return this.multiply(other.negate()).negate();
  8732. }
  8733. // If both Longs are small, use float multiplication
  8734. if (this.lessThan(Long.TWO_PWR_24_) && other.lessThan(Long.TWO_PWR_24_)) {
  8735. return Long.fromNumber(this.toNumber() * other.toNumber());
  8736. }
  8737. // Divide each Long into 4 chunks of 16 bits, and then add up 4x4 products.
  8738. // We can skip products that would overflow.
  8739. var a48 = this.high_ >>> 16;
  8740. var a32 = this.high_ & 0xffff;
  8741. var a16 = this.low_ >>> 16;
  8742. var a00 = this.low_ & 0xffff;
  8743. var b48 = other.high_ >>> 16;
  8744. var b32 = other.high_ & 0xffff;
  8745. var b16 = other.low_ >>> 16;
  8746. var b00 = other.low_ & 0xffff;
  8747. var c48 = 0,
  8748. c32 = 0,
  8749. c16 = 0,
  8750. c00 = 0;
  8751. c00 += a00 * b00;
  8752. c16 += c00 >>> 16;
  8753. c00 &= 0xffff;
  8754. c16 += a16 * b00;
  8755. c32 += c16 >>> 16;
  8756. c16 &= 0xffff;
  8757. c16 += a00 * b16;
  8758. c32 += c16 >>> 16;
  8759. c16 &= 0xffff;
  8760. c32 += a32 * b00;
  8761. c48 += c32 >>> 16;
  8762. c32 &= 0xffff;
  8763. c32 += a16 * b16;
  8764. c48 += c32 >>> 16;
  8765. c32 &= 0xffff;
  8766. c32 += a00 * b32;
  8767. c48 += c32 >>> 16;
  8768. c32 &= 0xffff;
  8769. c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;
  8770. c48 &= 0xffff;
  8771. return Long.fromBits(c16 << 16 | c00, c48 << 16 | c32);
  8772. };
  8773. /**
  8774. * Returns this Long divided by the given one.
  8775. *
  8776. * @method
  8777. * @param {Long} other Long by which to divide.
  8778. * @return {Long} this Long divided by the given one.
  8779. */
  8780. Long.prototype.div = function (other) {
  8781. if (other.isZero()) {
  8782. throw Error('division by zero');
  8783. } else if (this.isZero()) {
  8784. return Long.ZERO;
  8785. }
  8786. if (this.equals(Long.MIN_VALUE)) {
  8787. if (other.equals(Long.ONE) || other.equals(Long.NEG_ONE)) {
  8788. return Long.MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE
  8789. } else if (other.equals(Long.MIN_VALUE)) {
  8790. return Long.ONE;
  8791. } else {
  8792. // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.
  8793. var halfThis = this.shiftRight(1);
  8794. var approx = halfThis.div(other).shiftLeft(1);
  8795. if (approx.equals(Long.ZERO)) {
  8796. return other.isNegative() ? Long.ONE : Long.NEG_ONE;
  8797. } else {
  8798. var rem = this.subtract(other.multiply(approx));
  8799. var result = approx.add(rem.div(other));
  8800. return result;
  8801. }
  8802. }
  8803. } else if (other.equals(Long.MIN_VALUE)) {
  8804. return Long.ZERO;
  8805. }
  8806. if (this.isNegative()) {
  8807. if (other.isNegative()) {
  8808. return this.negate().div(other.negate());
  8809. } else {
  8810. return this.negate().div(other).negate();
  8811. }
  8812. } else if (other.isNegative()) {
  8813. return this.div(other.negate()).negate();
  8814. }
  8815. // Repeat the following until the remainder is less than other: find a
  8816. // floating-point that approximates remainder / other *from below*, add this
  8817. // into the result, and subtract it from the remainder. It is critical that
  8818. // the approximate value is less than or equal to the real value so that the
  8819. // remainder never becomes negative.
  8820. var res = Long.ZERO;
  8821. rem = this;
  8822. while (rem.greaterThanOrEqual(other)) {
  8823. // Approximate the result of division. This may be a little greater or
  8824. // smaller than the actual value.
  8825. approx = Math.max(1, Math.floor(rem.toNumber() / other.toNumber()));
  8826. // We will tweak the approximate result by changing it in the 48-th digit or
  8827. // the smallest non-fractional digit, whichever is larger.
  8828. var log2 = Math.ceil(Math.log(approx) / Math.LN2);
  8829. var delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48);
  8830. // Decrease the approximation until it is smaller than the remainder. Note
  8831. // that if it is too large, the product overflows and is negative.
  8832. var approxRes = Long.fromNumber(approx);
  8833. var approxRem = approxRes.multiply(other);
  8834. while (approxRem.isNegative() || approxRem.greaterThan(rem)) {
  8835. approx -= delta;
  8836. approxRes = Long.fromNumber(approx);
  8837. approxRem = approxRes.multiply(other);
  8838. }
  8839. // We know the answer can't be zero... and actually, zero would cause
  8840. // infinite recursion since we would make no progress.
  8841. if (approxRes.isZero()) {
  8842. approxRes = Long.ONE;
  8843. }
  8844. res = res.add(approxRes);
  8845. rem = rem.subtract(approxRem);
  8846. }
  8847. return res;
  8848. };
  8849. /**
  8850. * Returns this Long modulo the given one.
  8851. *
  8852. * @method
  8853. * @param {Long} other Long by which to mod.
  8854. * @return {Long} this Long modulo the given one.
  8855. */
  8856. Long.prototype.modulo = function (other) {
  8857. return this.subtract(this.div(other).multiply(other));
  8858. };
  8859. /**
  8860. * The bitwise-NOT of this value.
  8861. *
  8862. * @method
  8863. * @return {Long} the bitwise-NOT of this value.
  8864. */
  8865. Long.prototype.not = function () {
  8866. return Long.fromBits(~this.low_, ~this.high_);
  8867. };
  8868. /**
  8869. * Returns the bitwise-AND of this Long and the given one.
  8870. *
  8871. * @method
  8872. * @param {Long} other the Long with which to AND.
  8873. * @return {Long} the bitwise-AND of this and the other.
  8874. */
  8875. Long.prototype.and = function (other) {
  8876. return Long.fromBits(this.low_ & other.low_, this.high_ & other.high_);
  8877. };
  8878. /**
  8879. * Returns the bitwise-OR of this Long and the given one.
  8880. *
  8881. * @method
  8882. * @param {Long} other the Long with which to OR.
  8883. * @return {Long} the bitwise-OR of this and the other.
  8884. */
  8885. Long.prototype.or = function (other) {
  8886. return Long.fromBits(this.low_ | other.low_, this.high_ | other.high_);
  8887. };
  8888. /**
  8889. * Returns the bitwise-XOR of this Long and the given one.
  8890. *
  8891. * @method
  8892. * @param {Long} other the Long with which to XOR.
  8893. * @return {Long} the bitwise-XOR of this and the other.
  8894. */
  8895. Long.prototype.xor = function (other) {
  8896. return Long.fromBits(this.low_ ^ other.low_, this.high_ ^ other.high_);
  8897. };
  8898. /**
  8899. * Returns this Long with bits shifted to the left by the given amount.
  8900. *
  8901. * @method
  8902. * @param {number} numBits the number of bits by which to shift.
  8903. * @return {Long} this shifted to the left by the given amount.
  8904. */
  8905. Long.prototype.shiftLeft = function (numBits) {
  8906. numBits &= 63;
  8907. if (numBits === 0) {
  8908. return this;
  8909. } else {
  8910. var low = this.low_;
  8911. if (numBits < 32) {
  8912. var high = this.high_;
  8913. return Long.fromBits(low << numBits, high << numBits | low >>> 32 - numBits);
  8914. } else {
  8915. return Long.fromBits(0, low << numBits - 32);
  8916. }
  8917. }
  8918. };
  8919. /**
  8920. * Returns this Long with bits shifted to the right by the given amount.
  8921. *
  8922. * @method
  8923. * @param {number} numBits the number of bits by which to shift.
  8924. * @return {Long} this shifted to the right by the given amount.
  8925. */
  8926. Long.prototype.shiftRight = function (numBits) {
  8927. numBits &= 63;
  8928. if (numBits === 0) {
  8929. return this;
  8930. } else {
  8931. var high = this.high_;
  8932. if (numBits < 32) {
  8933. var low = this.low_;
  8934. return Long.fromBits(low >>> numBits | high << 32 - numBits, high >> numBits);
  8935. } else {
  8936. return Long.fromBits(high >> numBits - 32, high >= 0 ? 0 : -1);
  8937. }
  8938. }
  8939. };
  8940. /**
  8941. * Returns this Long with bits shifted to the right by the given amount, with the new top bits matching the current sign bit.
  8942. *
  8943. * @method
  8944. * @param {number} numBits the number of bits by which to shift.
  8945. * @return {Long} this shifted to the right by the given amount, with zeros placed into the new leading bits.
  8946. */
  8947. Long.prototype.shiftRightUnsigned = function (numBits) {
  8948. numBits &= 63;
  8949. if (numBits === 0) {
  8950. return this;
  8951. } else {
  8952. var high = this.high_;
  8953. if (numBits < 32) {
  8954. var low = this.low_;
  8955. return Long.fromBits(low >>> numBits | high << 32 - numBits, high >>> numBits);
  8956. } else if (numBits === 32) {
  8957. return Long.fromBits(high, 0);
  8958. } else {
  8959. return Long.fromBits(high >>> numBits - 32, 0);
  8960. }
  8961. }
  8962. };
  8963. /**
  8964. * Returns a Long representing the given (32-bit) integer value.
  8965. *
  8966. * @method
  8967. * @param {number} value the 32-bit integer in question.
  8968. * @return {Long} the corresponding Long value.
  8969. */
  8970. Long.fromInt = function (value) {
  8971. if (-128 <= value && value < 128) {
  8972. var cachedObj = Long.INT_CACHE_[value];
  8973. if (cachedObj) {
  8974. return cachedObj;
  8975. }
  8976. }
  8977. var obj = new Long(value | 0, value < 0 ? -1 : 0);
  8978. if (-128 <= value && value < 128) {
  8979. Long.INT_CACHE_[value] = obj;
  8980. }
  8981. return obj;
  8982. };
  8983. /**
  8984. * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.
  8985. *
  8986. * @method
  8987. * @param {number} value the number in question.
  8988. * @return {Long} the corresponding Long value.
  8989. */
  8990. Long.fromNumber = function (value) {
  8991. if (isNaN(value) || !isFinite(value)) {
  8992. return Long.ZERO;
  8993. } else if (value <= -Long.TWO_PWR_63_DBL_) {
  8994. return Long.MIN_VALUE;
  8995. } else if (value + 1 >= Long.TWO_PWR_63_DBL_) {
  8996. return Long.MAX_VALUE;
  8997. } else if (value < 0) {
  8998. return Long.fromNumber(-value).negate();
  8999. } else {
  9000. return new Long(value % Long.TWO_PWR_32_DBL_ | 0, value / Long.TWO_PWR_32_DBL_ | 0);
  9001. }
  9002. };
  9003. /**
  9004. * Returns a Long representing the 64-bit integer that comes by concatenating the given high and low bits. Each is assumed to use 32 bits.
  9005. *
  9006. * @method
  9007. * @param {number} lowBits the low 32-bits.
  9008. * @param {number} highBits the high 32-bits.
  9009. * @return {Long} the corresponding Long value.
  9010. */
  9011. Long.fromBits = function (lowBits, highBits) {
  9012. return new Long(lowBits, highBits);
  9013. };
  9014. /**
  9015. * Returns a Long representation of the given string, written using the given radix.
  9016. *
  9017. * @method
  9018. * @param {string} str the textual representation of the Long.
  9019. * @param {number} opt_radix the radix in which the text is written.
  9020. * @return {Long} the corresponding Long value.
  9021. */
  9022. Long.fromString = function (str, opt_radix) {
  9023. if (str.length === 0) {
  9024. throw Error('number format error: empty string');
  9025. }
  9026. var radix = opt_radix || 10;
  9027. if (radix < 2 || 36 < radix) {
  9028. throw Error('radix out of range: ' + radix);
  9029. }
  9030. if (str.charAt(0) === '-') {
  9031. return Long.fromString(str.substring(1), radix).negate();
  9032. } else if (str.indexOf('-') >= 0) {
  9033. throw Error('number format error: interior "-" character: ' + str);
  9034. }
  9035. // Do several (8) digits each time through the loop, so as to
  9036. // minimize the calls to the very expensive emulated div.
  9037. var radixToPower = Long.fromNumber(Math.pow(radix, 8));
  9038. var result = Long.ZERO;
  9039. for (var i = 0; i < str.length; i += 8) {
  9040. var size = Math.min(8, str.length - i);
  9041. var value = parseInt(str.substring(i, i + size), radix);
  9042. if (size < 8) {
  9043. var power = Long.fromNumber(Math.pow(radix, size));
  9044. result = result.multiply(power).add(Long.fromNumber(value));
  9045. } else {
  9046. result = result.multiply(radixToPower);
  9047. result = result.add(Long.fromNumber(value));
  9048. }
  9049. }
  9050. return result;
  9051. };
  9052. // NOTE: Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the
  9053. // from* methods on which they depend.
  9054. /**
  9055. * A cache of the Long representations of small integer values.
  9056. * @type {Object}
  9057. * @ignore
  9058. */
  9059. Long.INT_CACHE_ = {};
  9060. // NOTE: the compiler should inline these constant values below and then remove
  9061. // these variables, so there should be no runtime penalty for these.
  9062. /**
  9063. * Number used repeated below in calculations. This must appear before the
  9064. * first call to any from* function below.
  9065. * @type {number}
  9066. * @ignore
  9067. */
  9068. Long.TWO_PWR_16_DBL_ = 1 << 16;
  9069. /**
  9070. * @type {number}
  9071. * @ignore
  9072. */
  9073. Long.TWO_PWR_24_DBL_ = 1 << 24;
  9074. /**
  9075. * @type {number}
  9076. * @ignore
  9077. */
  9078. Long.TWO_PWR_32_DBL_ = Long.TWO_PWR_16_DBL_ * Long.TWO_PWR_16_DBL_;
  9079. /**
  9080. * @type {number}
  9081. * @ignore
  9082. */
  9083. Long.TWO_PWR_31_DBL_ = Long.TWO_PWR_32_DBL_ / 2;
  9084. /**
  9085. * @type {number}
  9086. * @ignore
  9087. */
  9088. Long.TWO_PWR_48_DBL_ = Long.TWO_PWR_32_DBL_ * Long.TWO_PWR_16_DBL_;
  9089. /**
  9090. * @type {number}
  9091. * @ignore
  9092. */
  9093. Long.TWO_PWR_64_DBL_ = Long.TWO_PWR_32_DBL_ * Long.TWO_PWR_32_DBL_;
  9094. /**
  9095. * @type {number}
  9096. * @ignore
  9097. */
  9098. Long.TWO_PWR_63_DBL_ = Long.TWO_PWR_64_DBL_ / 2;
  9099. /** @type {Long} */
  9100. Long.ZERO = Long.fromInt(0);
  9101. /** @type {Long} */
  9102. Long.ONE = Long.fromInt(1);
  9103. /** @type {Long} */
  9104. Long.NEG_ONE = Long.fromInt(-1);
  9105. /** @type {Long} */
  9106. Long.MAX_VALUE = Long.fromBits(0xffffffff | 0, 0x7fffffff | 0);
  9107. /** @type {Long} */
  9108. Long.MIN_VALUE = Long.fromBits(0, 0x80000000 | 0);
  9109. /**
  9110. * @type {Long}
  9111. * @ignore
  9112. */
  9113. Long.TWO_PWR_24_ = Long.fromInt(1 << 24);
  9114. /**
  9115. * Expose.
  9116. */
  9117. module.exports = Long;
  9118. module.exports.Long = Long;
  9119. /***/ }),
  9120. /* 336 */
  9121. /***/ (function(module, exports) {
  9122. /**
  9123. * A class representation of the BSON Double type.
  9124. *
  9125. * @class
  9126. * @param {number} value the number we want to represent as a double.
  9127. * @return {Double}
  9128. */
  9129. function Double(value) {
  9130. if (!(this instanceof Double)) return new Double(value);
  9131. this._bsontype = 'Double';
  9132. this.value = value;
  9133. }
  9134. /**
  9135. * Access the number value.
  9136. *
  9137. * @method
  9138. * @return {number} returns the wrapped double number.
  9139. */
  9140. Double.prototype.valueOf = function () {
  9141. return this.value;
  9142. };
  9143. /**
  9144. * @ignore
  9145. */
  9146. Double.prototype.toJSON = function () {
  9147. return this.value;
  9148. };
  9149. module.exports = Double;
  9150. module.exports.Double = Double;
  9151. /***/ }),
  9152. /* 337 */
  9153. /***/ (function(module, exports) {
  9154. // Licensed under the Apache License, Version 2.0 (the "License");
  9155. // you may not use this file except in compliance with the License.
  9156. // You may obtain a copy of the License at
  9157. //
  9158. // http://www.apache.org/licenses/LICENSE-2.0
  9159. //
  9160. // Unless required by applicable law or agreed to in writing, software
  9161. // distributed under the License is distributed on an "AS IS" BASIS,
  9162. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9163. // See the License for the specific language governing permissions and
  9164. // limitations under the License.
  9165. //
  9166. // Copyright 2009 Google Inc. All Rights Reserved
  9167. /**
  9168. * This type is for INTERNAL use in MongoDB only and should not be used in applications.
  9169. * The appropriate corresponding type is the JavaScript Date type.
  9170. *
  9171. * Defines a Timestamp class for representing a 64-bit two's-complement
  9172. * integer value, which faithfully simulates the behavior of a Java "Timestamp". This
  9173. * implementation is derived from TimestampLib in GWT.
  9174. *
  9175. * Constructs a 64-bit two's-complement integer, given its low and high 32-bit
  9176. * values as *signed* integers. See the from* functions below for more
  9177. * convenient ways of constructing Timestamps.
  9178. *
  9179. * The internal representation of a Timestamp is the two given signed, 32-bit values.
  9180. * We use 32-bit pieces because these are the size of integers on which
  9181. * Javascript performs bit-operations. For operations like addition and
  9182. * multiplication, we split each number into 16-bit pieces, which can easily be
  9183. * multiplied within Javascript's floating-point representation without overflow
  9184. * or change in sign.
  9185. *
  9186. * In the algorithms below, we frequently reduce the negative case to the
  9187. * positive case by negating the input(s) and then post-processing the result.
  9188. * Note that we must ALWAYS check specially whether those values are MIN_VALUE
  9189. * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as
  9190. * a positive number, it overflows back into a negative). Not handling this
  9191. * case would often result in infinite recursion.
  9192. *
  9193. * @class
  9194. * @param {number} low the low (signed) 32 bits of the Timestamp.
  9195. * @param {number} high the high (signed) 32 bits of the Timestamp.
  9196. */
  9197. function Timestamp(low, high) {
  9198. if (!(this instanceof Timestamp)) return new Timestamp(low, high);
  9199. this._bsontype = 'Timestamp';
  9200. /**
  9201. * @type {number}
  9202. * @ignore
  9203. */
  9204. this.low_ = low | 0; // force into 32 signed bits.
  9205. /**
  9206. * @type {number}
  9207. * @ignore
  9208. */
  9209. this.high_ = high | 0; // force into 32 signed bits.
  9210. }
  9211. /**
  9212. * Return the int value.
  9213. *
  9214. * @return {number} the value, assuming it is a 32-bit integer.
  9215. */
  9216. Timestamp.prototype.toInt = function () {
  9217. return this.low_;
  9218. };
  9219. /**
  9220. * Return the Number value.
  9221. *
  9222. * @method
  9223. * @return {number} the closest floating-point representation to this value.
  9224. */
  9225. Timestamp.prototype.toNumber = function () {
  9226. return this.high_ * Timestamp.TWO_PWR_32_DBL_ + this.getLowBitsUnsigned();
  9227. };
  9228. /**
  9229. * Return the JSON value.
  9230. *
  9231. * @method
  9232. * @return {string} the JSON representation.
  9233. */
  9234. Timestamp.prototype.toJSON = function () {
  9235. return this.toString();
  9236. };
  9237. /**
  9238. * Return the String value.
  9239. *
  9240. * @method
  9241. * @param {number} [opt_radix] the radix in which the text should be written.
  9242. * @return {string} the textual representation of this value.
  9243. */
  9244. Timestamp.prototype.toString = function (opt_radix) {
  9245. var radix = opt_radix || 10;
  9246. if (radix < 2 || 36 < radix) {
  9247. throw Error('radix out of range: ' + radix);
  9248. }
  9249. if (this.isZero()) {
  9250. return '0';
  9251. }
  9252. if (this.isNegative()) {
  9253. if (this.equals(Timestamp.MIN_VALUE)) {
  9254. // We need to change the Timestamp value before it can be negated, so we remove
  9255. // the bottom-most digit in this base and then recurse to do the rest.
  9256. var radixTimestamp = Timestamp.fromNumber(radix);
  9257. var div = this.div(radixTimestamp);
  9258. var rem = div.multiply(radixTimestamp).subtract(this);
  9259. return div.toString(radix) + rem.toInt().toString(radix);
  9260. } else {
  9261. return '-' + this.negate().toString(radix);
  9262. }
  9263. }
  9264. // Do several (6) digits each time through the loop, so as to
  9265. // minimize the calls to the very expensive emulated div.
  9266. var radixToPower = Timestamp.fromNumber(Math.pow(radix, 6));
  9267. rem = this;
  9268. var result = '';
  9269. while (!rem.isZero()) {
  9270. var remDiv = rem.div(radixToPower);
  9271. var intval = rem.subtract(remDiv.multiply(radixToPower)).toInt();
  9272. var digits = intval.toString(radix);
  9273. rem = remDiv;
  9274. if (rem.isZero()) {
  9275. return digits + result;
  9276. } else {
  9277. while (digits.length < 6) {
  9278. digits = '0' + digits;
  9279. }
  9280. result = '' + digits + result;
  9281. }
  9282. }
  9283. };
  9284. /**
  9285. * Return the high 32-bits value.
  9286. *
  9287. * @method
  9288. * @return {number} the high 32-bits as a signed value.
  9289. */
  9290. Timestamp.prototype.getHighBits = function () {
  9291. return this.high_;
  9292. };
  9293. /**
  9294. * Return the low 32-bits value.
  9295. *
  9296. * @method
  9297. * @return {number} the low 32-bits as a signed value.
  9298. */
  9299. Timestamp.prototype.getLowBits = function () {
  9300. return this.low_;
  9301. };
  9302. /**
  9303. * Return the low unsigned 32-bits value.
  9304. *
  9305. * @method
  9306. * @return {number} the low 32-bits as an unsigned value.
  9307. */
  9308. Timestamp.prototype.getLowBitsUnsigned = function () {
  9309. return this.low_ >= 0 ? this.low_ : Timestamp.TWO_PWR_32_DBL_ + this.low_;
  9310. };
  9311. /**
  9312. * Returns the number of bits needed to represent the absolute value of this Timestamp.
  9313. *
  9314. * @method
  9315. * @return {number} Returns the number of bits needed to represent the absolute value of this Timestamp.
  9316. */
  9317. Timestamp.prototype.getNumBitsAbs = function () {
  9318. if (this.isNegative()) {
  9319. if (this.equals(Timestamp.MIN_VALUE)) {
  9320. return 64;
  9321. } else {
  9322. return this.negate().getNumBitsAbs();
  9323. }
  9324. } else {
  9325. var val = this.high_ !== 0 ? this.high_ : this.low_;
  9326. for (var bit = 31; bit > 0; bit--) {
  9327. if ((val & 1 << bit) !== 0) {
  9328. break;
  9329. }
  9330. }
  9331. return this.high_ !== 0 ? bit + 33 : bit + 1;
  9332. }
  9333. };
  9334. /**
  9335. * Return whether this value is zero.
  9336. *
  9337. * @method
  9338. * @return {boolean} whether this value is zero.
  9339. */
  9340. Timestamp.prototype.isZero = function () {
  9341. return this.high_ === 0 && this.low_ === 0;
  9342. };
  9343. /**
  9344. * Return whether this value is negative.
  9345. *
  9346. * @method
  9347. * @return {boolean} whether this value is negative.
  9348. */
  9349. Timestamp.prototype.isNegative = function () {
  9350. return this.high_ < 0;
  9351. };
  9352. /**
  9353. * Return whether this value is odd.
  9354. *
  9355. * @method
  9356. * @return {boolean} whether this value is odd.
  9357. */
  9358. Timestamp.prototype.isOdd = function () {
  9359. return (this.low_ & 1) === 1;
  9360. };
  9361. /**
  9362. * Return whether this Timestamp equals the other
  9363. *
  9364. * @method
  9365. * @param {Timestamp} other Timestamp to compare against.
  9366. * @return {boolean} whether this Timestamp equals the other
  9367. */
  9368. Timestamp.prototype.equals = function (other) {
  9369. return this.high_ === other.high_ && this.low_ === other.low_;
  9370. };
  9371. /**
  9372. * Return whether this Timestamp does not equal the other.
  9373. *
  9374. * @method
  9375. * @param {Timestamp} other Timestamp to compare against.
  9376. * @return {boolean} whether this Timestamp does not equal the other.
  9377. */
  9378. Timestamp.prototype.notEquals = function (other) {
  9379. return this.high_ !== other.high_ || this.low_ !== other.low_;
  9380. };
  9381. /**
  9382. * Return whether this Timestamp is less than the other.
  9383. *
  9384. * @method
  9385. * @param {Timestamp} other Timestamp to compare against.
  9386. * @return {boolean} whether this Timestamp is less than the other.
  9387. */
  9388. Timestamp.prototype.lessThan = function (other) {
  9389. return this.compare(other) < 0;
  9390. };
  9391. /**
  9392. * Return whether this Timestamp is less than or equal to the other.
  9393. *
  9394. * @method
  9395. * @param {Timestamp} other Timestamp to compare against.
  9396. * @return {boolean} whether this Timestamp is less than or equal to the other.
  9397. */
  9398. Timestamp.prototype.lessThanOrEqual = function (other) {
  9399. return this.compare(other) <= 0;
  9400. };
  9401. /**
  9402. * Return whether this Timestamp is greater than the other.
  9403. *
  9404. * @method
  9405. * @param {Timestamp} other Timestamp to compare against.
  9406. * @return {boolean} whether this Timestamp is greater than the other.
  9407. */
  9408. Timestamp.prototype.greaterThan = function (other) {
  9409. return this.compare(other) > 0;
  9410. };
  9411. /**
  9412. * Return whether this Timestamp is greater than or equal to the other.
  9413. *
  9414. * @method
  9415. * @param {Timestamp} other Timestamp to compare against.
  9416. * @return {boolean} whether this Timestamp is greater than or equal to the other.
  9417. */
  9418. Timestamp.prototype.greaterThanOrEqual = function (other) {
  9419. return this.compare(other) >= 0;
  9420. };
  9421. /**
  9422. * Compares this Timestamp with the given one.
  9423. *
  9424. * @method
  9425. * @param {Timestamp} other Timestamp to compare against.
  9426. * @return {boolean} 0 if they are the same, 1 if the this is greater, and -1 if the given one is greater.
  9427. */
  9428. Timestamp.prototype.compare = function (other) {
  9429. if (this.equals(other)) {
  9430. return 0;
  9431. }
  9432. var thisNeg = this.isNegative();
  9433. var otherNeg = other.isNegative();
  9434. if (thisNeg && !otherNeg) {
  9435. return -1;
  9436. }
  9437. if (!thisNeg && otherNeg) {
  9438. return 1;
  9439. }
  9440. // at this point, the signs are the same, so subtraction will not overflow
  9441. if (this.subtract(other).isNegative()) {
  9442. return -1;
  9443. } else {
  9444. return 1;
  9445. }
  9446. };
  9447. /**
  9448. * The negation of this value.
  9449. *
  9450. * @method
  9451. * @return {Timestamp} the negation of this value.
  9452. */
  9453. Timestamp.prototype.negate = function () {
  9454. if (this.equals(Timestamp.MIN_VALUE)) {
  9455. return Timestamp.MIN_VALUE;
  9456. } else {
  9457. return this.not().add(Timestamp.ONE);
  9458. }
  9459. };
  9460. /**
  9461. * Returns the sum of this and the given Timestamp.
  9462. *
  9463. * @method
  9464. * @param {Timestamp} other Timestamp to add to this one.
  9465. * @return {Timestamp} the sum of this and the given Timestamp.
  9466. */
  9467. Timestamp.prototype.add = function (other) {
  9468. // Divide each number into 4 chunks of 16 bits, and then sum the chunks.
  9469. var a48 = this.high_ >>> 16;
  9470. var a32 = this.high_ & 0xffff;
  9471. var a16 = this.low_ >>> 16;
  9472. var a00 = this.low_ & 0xffff;
  9473. var b48 = other.high_ >>> 16;
  9474. var b32 = other.high_ & 0xffff;
  9475. var b16 = other.low_ >>> 16;
  9476. var b00 = other.low_ & 0xffff;
  9477. var c48 = 0,
  9478. c32 = 0,
  9479. c16 = 0,
  9480. c00 = 0;
  9481. c00 += a00 + b00;
  9482. c16 += c00 >>> 16;
  9483. c00 &= 0xffff;
  9484. c16 += a16 + b16;
  9485. c32 += c16 >>> 16;
  9486. c16 &= 0xffff;
  9487. c32 += a32 + b32;
  9488. c48 += c32 >>> 16;
  9489. c32 &= 0xffff;
  9490. c48 += a48 + b48;
  9491. c48 &= 0xffff;
  9492. return Timestamp.fromBits(c16 << 16 | c00, c48 << 16 | c32);
  9493. };
  9494. /**
  9495. * Returns the difference of this and the given Timestamp.
  9496. *
  9497. * @method
  9498. * @param {Timestamp} other Timestamp to subtract from this.
  9499. * @return {Timestamp} the difference of this and the given Timestamp.
  9500. */
  9501. Timestamp.prototype.subtract = function (other) {
  9502. return this.add(other.negate());
  9503. };
  9504. /**
  9505. * Returns the product of this and the given Timestamp.
  9506. *
  9507. * @method
  9508. * @param {Timestamp} other Timestamp to multiply with this.
  9509. * @return {Timestamp} the product of this and the other.
  9510. */
  9511. Timestamp.prototype.multiply = function (other) {
  9512. if (this.isZero()) {
  9513. return Timestamp.ZERO;
  9514. } else if (other.isZero()) {
  9515. return Timestamp.ZERO;
  9516. }
  9517. if (this.equals(Timestamp.MIN_VALUE)) {
  9518. return other.isOdd() ? Timestamp.MIN_VALUE : Timestamp.ZERO;
  9519. } else if (other.equals(Timestamp.MIN_VALUE)) {
  9520. return this.isOdd() ? Timestamp.MIN_VALUE : Timestamp.ZERO;
  9521. }
  9522. if (this.isNegative()) {
  9523. if (other.isNegative()) {
  9524. return this.negate().multiply(other.negate());
  9525. } else {
  9526. return this.negate().multiply(other).negate();
  9527. }
  9528. } else if (other.isNegative()) {
  9529. return this.multiply(other.negate()).negate();
  9530. }
  9531. // If both Timestamps are small, use float multiplication
  9532. if (this.lessThan(Timestamp.TWO_PWR_24_) && other.lessThan(Timestamp.TWO_PWR_24_)) {
  9533. return Timestamp.fromNumber(this.toNumber() * other.toNumber());
  9534. }
  9535. // Divide each Timestamp into 4 chunks of 16 bits, and then add up 4x4 products.
  9536. // We can skip products that would overflow.
  9537. var a48 = this.high_ >>> 16;
  9538. var a32 = this.high_ & 0xffff;
  9539. var a16 = this.low_ >>> 16;
  9540. var a00 = this.low_ & 0xffff;
  9541. var b48 = other.high_ >>> 16;
  9542. var b32 = other.high_ & 0xffff;
  9543. var b16 = other.low_ >>> 16;
  9544. var b00 = other.low_ & 0xffff;
  9545. var c48 = 0,
  9546. c32 = 0,
  9547. c16 = 0,
  9548. c00 = 0;
  9549. c00 += a00 * b00;
  9550. c16 += c00 >>> 16;
  9551. c00 &= 0xffff;
  9552. c16 += a16 * b00;
  9553. c32 += c16 >>> 16;
  9554. c16 &= 0xffff;
  9555. c16 += a00 * b16;
  9556. c32 += c16 >>> 16;
  9557. c16 &= 0xffff;
  9558. c32 += a32 * b00;
  9559. c48 += c32 >>> 16;
  9560. c32 &= 0xffff;
  9561. c32 += a16 * b16;
  9562. c48 += c32 >>> 16;
  9563. c32 &= 0xffff;
  9564. c32 += a00 * b32;
  9565. c48 += c32 >>> 16;
  9566. c32 &= 0xffff;
  9567. c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;
  9568. c48 &= 0xffff;
  9569. return Timestamp.fromBits(c16 << 16 | c00, c48 << 16 | c32);
  9570. };
  9571. /**
  9572. * Returns this Timestamp divided by the given one.
  9573. *
  9574. * @method
  9575. * @param {Timestamp} other Timestamp by which to divide.
  9576. * @return {Timestamp} this Timestamp divided by the given one.
  9577. */
  9578. Timestamp.prototype.div = function (other) {
  9579. if (other.isZero()) {
  9580. throw Error('division by zero');
  9581. } else if (this.isZero()) {
  9582. return Timestamp.ZERO;
  9583. }
  9584. if (this.equals(Timestamp.MIN_VALUE)) {
  9585. if (other.equals(Timestamp.ONE) || other.equals(Timestamp.NEG_ONE)) {
  9586. return Timestamp.MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE
  9587. } else if (other.equals(Timestamp.MIN_VALUE)) {
  9588. return Timestamp.ONE;
  9589. } else {
  9590. // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.
  9591. var halfThis = this.shiftRight(1);
  9592. var approx = halfThis.div(other).shiftLeft(1);
  9593. if (approx.equals(Timestamp.ZERO)) {
  9594. return other.isNegative() ? Timestamp.ONE : Timestamp.NEG_ONE;
  9595. } else {
  9596. var rem = this.subtract(other.multiply(approx));
  9597. var result = approx.add(rem.div(other));
  9598. return result;
  9599. }
  9600. }
  9601. } else if (other.equals(Timestamp.MIN_VALUE)) {
  9602. return Timestamp.ZERO;
  9603. }
  9604. if (this.isNegative()) {
  9605. if (other.isNegative()) {
  9606. return this.negate().div(other.negate());
  9607. } else {
  9608. return this.negate().div(other).negate();
  9609. }
  9610. } else if (other.isNegative()) {
  9611. return this.div(other.negate()).negate();
  9612. }
  9613. // Repeat the following until the remainder is less than other: find a
  9614. // floating-point that approximates remainder / other *from below*, add this
  9615. // into the result, and subtract it from the remainder. It is critical that
  9616. // the approximate value is less than or equal to the real value so that the
  9617. // remainder never becomes negative.
  9618. var res = Timestamp.ZERO;
  9619. rem = this;
  9620. while (rem.greaterThanOrEqual(other)) {
  9621. // Approximate the result of division. This may be a little greater or
  9622. // smaller than the actual value.
  9623. approx = Math.max(1, Math.floor(rem.toNumber() / other.toNumber()));
  9624. // We will tweak the approximate result by changing it in the 48-th digit or
  9625. // the smallest non-fractional digit, whichever is larger.
  9626. var log2 = Math.ceil(Math.log(approx) / Math.LN2);
  9627. var delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48);
  9628. // Decrease the approximation until it is smaller than the remainder. Note
  9629. // that if it is too large, the product overflows and is negative.
  9630. var approxRes = Timestamp.fromNumber(approx);
  9631. var approxRem = approxRes.multiply(other);
  9632. while (approxRem.isNegative() || approxRem.greaterThan(rem)) {
  9633. approx -= delta;
  9634. approxRes = Timestamp.fromNumber(approx);
  9635. approxRem = approxRes.multiply(other);
  9636. }
  9637. // We know the answer can't be zero... and actually, zero would cause
  9638. // infinite recursion since we would make no progress.
  9639. if (approxRes.isZero()) {
  9640. approxRes = Timestamp.ONE;
  9641. }
  9642. res = res.add(approxRes);
  9643. rem = rem.subtract(approxRem);
  9644. }
  9645. return res;
  9646. };
  9647. /**
  9648. * Returns this Timestamp modulo the given one.
  9649. *
  9650. * @method
  9651. * @param {Timestamp} other Timestamp by which to mod.
  9652. * @return {Timestamp} this Timestamp modulo the given one.
  9653. */
  9654. Timestamp.prototype.modulo = function (other) {
  9655. return this.subtract(this.div(other).multiply(other));
  9656. };
  9657. /**
  9658. * The bitwise-NOT of this value.
  9659. *
  9660. * @method
  9661. * @return {Timestamp} the bitwise-NOT of this value.
  9662. */
  9663. Timestamp.prototype.not = function () {
  9664. return Timestamp.fromBits(~this.low_, ~this.high_);
  9665. };
  9666. /**
  9667. * Returns the bitwise-AND of this Timestamp and the given one.
  9668. *
  9669. * @method
  9670. * @param {Timestamp} other the Timestamp with which to AND.
  9671. * @return {Timestamp} the bitwise-AND of this and the other.
  9672. */
  9673. Timestamp.prototype.and = function (other) {
  9674. return Timestamp.fromBits(this.low_ & other.low_, this.high_ & other.high_);
  9675. };
  9676. /**
  9677. * Returns the bitwise-OR of this Timestamp and the given one.
  9678. *
  9679. * @method
  9680. * @param {Timestamp} other the Timestamp with which to OR.
  9681. * @return {Timestamp} the bitwise-OR of this and the other.
  9682. */
  9683. Timestamp.prototype.or = function (other) {
  9684. return Timestamp.fromBits(this.low_ | other.low_, this.high_ | other.high_);
  9685. };
  9686. /**
  9687. * Returns the bitwise-XOR of this Timestamp and the given one.
  9688. *
  9689. * @method
  9690. * @param {Timestamp} other the Timestamp with which to XOR.
  9691. * @return {Timestamp} the bitwise-XOR of this and the other.
  9692. */
  9693. Timestamp.prototype.xor = function (other) {
  9694. return Timestamp.fromBits(this.low_ ^ other.low_, this.high_ ^ other.high_);
  9695. };
  9696. /**
  9697. * Returns this Timestamp with bits shifted to the left by the given amount.
  9698. *
  9699. * @method
  9700. * @param {number} numBits the number of bits by which to shift.
  9701. * @return {Timestamp} this shifted to the left by the given amount.
  9702. */
  9703. Timestamp.prototype.shiftLeft = function (numBits) {
  9704. numBits &= 63;
  9705. if (numBits === 0) {
  9706. return this;
  9707. } else {
  9708. var low = this.low_;
  9709. if (numBits < 32) {
  9710. var high = this.high_;
  9711. return Timestamp.fromBits(low << numBits, high << numBits | low >>> 32 - numBits);
  9712. } else {
  9713. return Timestamp.fromBits(0, low << numBits - 32);
  9714. }
  9715. }
  9716. };
  9717. /**
  9718. * Returns this Timestamp with bits shifted to the right by the given amount.
  9719. *
  9720. * @method
  9721. * @param {number} numBits the number of bits by which to shift.
  9722. * @return {Timestamp} this shifted to the right by the given amount.
  9723. */
  9724. Timestamp.prototype.shiftRight = function (numBits) {
  9725. numBits &= 63;
  9726. if (numBits === 0) {
  9727. return this;
  9728. } else {
  9729. var high = this.high_;
  9730. if (numBits < 32) {
  9731. var low = this.low_;
  9732. return Timestamp.fromBits(low >>> numBits | high << 32 - numBits, high >> numBits);
  9733. } else {
  9734. return Timestamp.fromBits(high >> numBits - 32, high >= 0 ? 0 : -1);
  9735. }
  9736. }
  9737. };
  9738. /**
  9739. * Returns this Timestamp with bits shifted to the right by the given amount, with the new top bits matching the current sign bit.
  9740. *
  9741. * @method
  9742. * @param {number} numBits the number of bits by which to shift.
  9743. * @return {Timestamp} this shifted to the right by the given amount, with zeros placed into the new leading bits.
  9744. */
  9745. Timestamp.prototype.shiftRightUnsigned = function (numBits) {
  9746. numBits &= 63;
  9747. if (numBits === 0) {
  9748. return this;
  9749. } else {
  9750. var high = this.high_;
  9751. if (numBits < 32) {
  9752. var low = this.low_;
  9753. return Timestamp.fromBits(low >>> numBits | high << 32 - numBits, high >>> numBits);
  9754. } else if (numBits === 32) {
  9755. return Timestamp.fromBits(high, 0);
  9756. } else {
  9757. return Timestamp.fromBits(high >>> numBits - 32, 0);
  9758. }
  9759. }
  9760. };
  9761. /**
  9762. * Returns a Timestamp representing the given (32-bit) integer value.
  9763. *
  9764. * @method
  9765. * @param {number} value the 32-bit integer in question.
  9766. * @return {Timestamp} the corresponding Timestamp value.
  9767. */
  9768. Timestamp.fromInt = function (value) {
  9769. if (-128 <= value && value < 128) {
  9770. var cachedObj = Timestamp.INT_CACHE_[value];
  9771. if (cachedObj) {
  9772. return cachedObj;
  9773. }
  9774. }
  9775. var obj = new Timestamp(value | 0, value < 0 ? -1 : 0);
  9776. if (-128 <= value && value < 128) {
  9777. Timestamp.INT_CACHE_[value] = obj;
  9778. }
  9779. return obj;
  9780. };
  9781. /**
  9782. * Returns a Timestamp representing the given value, provided that it is a finite number. Otherwise, zero is returned.
  9783. *
  9784. * @method
  9785. * @param {number} value the number in question.
  9786. * @return {Timestamp} the corresponding Timestamp value.
  9787. */
  9788. Timestamp.fromNumber = function (value) {
  9789. if (isNaN(value) || !isFinite(value)) {
  9790. return Timestamp.ZERO;
  9791. } else if (value <= -Timestamp.TWO_PWR_63_DBL_) {
  9792. return Timestamp.MIN_VALUE;
  9793. } else if (value + 1 >= Timestamp.TWO_PWR_63_DBL_) {
  9794. return Timestamp.MAX_VALUE;
  9795. } else if (value < 0) {
  9796. return Timestamp.fromNumber(-value).negate();
  9797. } else {
  9798. return new Timestamp(value % Timestamp.TWO_PWR_32_DBL_ | 0, value / Timestamp.TWO_PWR_32_DBL_ | 0);
  9799. }
  9800. };
  9801. /**
  9802. * Returns a Timestamp representing the 64-bit integer that comes by concatenating the given high and low bits. Each is assumed to use 32 bits.
  9803. *
  9804. * @method
  9805. * @param {number} lowBits the low 32-bits.
  9806. * @param {number} highBits the high 32-bits.
  9807. * @return {Timestamp} the corresponding Timestamp value.
  9808. */
  9809. Timestamp.fromBits = function (lowBits, highBits) {
  9810. return new Timestamp(lowBits, highBits);
  9811. };
  9812. /**
  9813. * Returns a Timestamp representation of the given string, written using the given radix.
  9814. *
  9815. * @method
  9816. * @param {string} str the textual representation of the Timestamp.
  9817. * @param {number} opt_radix the radix in which the text is written.
  9818. * @return {Timestamp} the corresponding Timestamp value.
  9819. */
  9820. Timestamp.fromString = function (str, opt_radix) {
  9821. if (str.length === 0) {
  9822. throw Error('number format error: empty string');
  9823. }
  9824. var radix = opt_radix || 10;
  9825. if (radix < 2 || 36 < radix) {
  9826. throw Error('radix out of range: ' + radix);
  9827. }
  9828. if (str.charAt(0) === '-') {
  9829. return Timestamp.fromString(str.substring(1), radix).negate();
  9830. } else if (str.indexOf('-') >= 0) {
  9831. throw Error('number format error: interior "-" character: ' + str);
  9832. }
  9833. // Do several (8) digits each time through the loop, so as to
  9834. // minimize the calls to the very expensive emulated div.
  9835. var radixToPower = Timestamp.fromNumber(Math.pow(radix, 8));
  9836. var result = Timestamp.ZERO;
  9837. for (var i = 0; i < str.length; i += 8) {
  9838. var size = Math.min(8, str.length - i);
  9839. var value = parseInt(str.substring(i, i + size), radix);
  9840. if (size < 8) {
  9841. var power = Timestamp.fromNumber(Math.pow(radix, size));
  9842. result = result.multiply(power).add(Timestamp.fromNumber(value));
  9843. } else {
  9844. result = result.multiply(radixToPower);
  9845. result = result.add(Timestamp.fromNumber(value));
  9846. }
  9847. }
  9848. return result;
  9849. };
  9850. // NOTE: Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the
  9851. // from* methods on which they depend.
  9852. /**
  9853. * A cache of the Timestamp representations of small integer values.
  9854. * @type {Object}
  9855. * @ignore
  9856. */
  9857. Timestamp.INT_CACHE_ = {};
  9858. // NOTE: the compiler should inline these constant values below and then remove
  9859. // these variables, so there should be no runtime penalty for these.
  9860. /**
  9861. * Number used repeated below in calculations. This must appear before the
  9862. * first call to any from* function below.
  9863. * @type {number}
  9864. * @ignore
  9865. */
  9866. Timestamp.TWO_PWR_16_DBL_ = 1 << 16;
  9867. /**
  9868. * @type {number}
  9869. * @ignore
  9870. */
  9871. Timestamp.TWO_PWR_24_DBL_ = 1 << 24;
  9872. /**
  9873. * @type {number}
  9874. * @ignore
  9875. */
  9876. Timestamp.TWO_PWR_32_DBL_ = Timestamp.TWO_PWR_16_DBL_ * Timestamp.TWO_PWR_16_DBL_;
  9877. /**
  9878. * @type {number}
  9879. * @ignore
  9880. */
  9881. Timestamp.TWO_PWR_31_DBL_ = Timestamp.TWO_PWR_32_DBL_ / 2;
  9882. /**
  9883. * @type {number}
  9884. * @ignore
  9885. */
  9886. Timestamp.TWO_PWR_48_DBL_ = Timestamp.TWO_PWR_32_DBL_ * Timestamp.TWO_PWR_16_DBL_;
  9887. /**
  9888. * @type {number}
  9889. * @ignore
  9890. */
  9891. Timestamp.TWO_PWR_64_DBL_ = Timestamp.TWO_PWR_32_DBL_ * Timestamp.TWO_PWR_32_DBL_;
  9892. /**
  9893. * @type {number}
  9894. * @ignore
  9895. */
  9896. Timestamp.TWO_PWR_63_DBL_ = Timestamp.TWO_PWR_64_DBL_ / 2;
  9897. /** @type {Timestamp} */
  9898. Timestamp.ZERO = Timestamp.fromInt(0);
  9899. /** @type {Timestamp} */
  9900. Timestamp.ONE = Timestamp.fromInt(1);
  9901. /** @type {Timestamp} */
  9902. Timestamp.NEG_ONE = Timestamp.fromInt(-1);
  9903. /** @type {Timestamp} */
  9904. Timestamp.MAX_VALUE = Timestamp.fromBits(0xffffffff | 0, 0x7fffffff | 0);
  9905. /** @type {Timestamp} */
  9906. Timestamp.MIN_VALUE = Timestamp.fromBits(0, 0x80000000 | 0);
  9907. /**
  9908. * @type {Timestamp}
  9909. * @ignore
  9910. */
  9911. Timestamp.TWO_PWR_24_ = Timestamp.fromInt(1 << 24);
  9912. /**
  9913. * Expose.
  9914. */
  9915. module.exports = Timestamp;
  9916. module.exports.Timestamp = Timestamp;
  9917. /***/ }),
  9918. /* 338 */
  9919. /***/ (function(module, exports, __webpack_require__) {
  9920. /* WEBPACK VAR INJECTION */(function(Buffer, process) {// Custom inspect property name / symbol.
  9921. var inspect = 'inspect';
  9922. var utils = __webpack_require__(344);
  9923. /**
  9924. * Machine id.
  9925. *
  9926. * Create a random 3-byte value (i.e. unique for this
  9927. * process). Other drivers use a md5 of the machine id here, but
  9928. * that would mean an asyc call to gethostname, so we don't bother.
  9929. * @ignore
  9930. */
  9931. var MACHINE_ID = parseInt(Math.random() * 0xffffff, 10);
  9932. // Regular expression that checks for hex value
  9933. var checkForHexRegExp = new RegExp('^[0-9a-fA-F]{24}$');
  9934. // Check if buffer exists
  9935. try {
  9936. if (Buffer && Buffer.from) {
  9937. var hasBufferType = true;
  9938. inspect = __webpack_require__(345).inspect.custom || 'inspect';
  9939. }
  9940. } catch (err) {
  9941. hasBufferType = false;
  9942. }
  9943. /**
  9944. * Create a new ObjectID instance
  9945. *
  9946. * @class
  9947. * @param {(string|number)} id Can be a 24 byte hex string, 12 byte binary string or a Number.
  9948. * @property {number} generationTime The generation time of this ObjectId instance
  9949. * @return {ObjectID} instance of ObjectID.
  9950. */
  9951. var ObjectID = function ObjectID(id) {
  9952. // Duck-typing to support ObjectId from different npm packages
  9953. if (id instanceof ObjectID) return id;
  9954. if (!(this instanceof ObjectID)) return new ObjectID(id);
  9955. this._bsontype = 'ObjectID';
  9956. // The most common usecase (blank id, new objectId instance)
  9957. if (id == null || typeof id === 'number') {
  9958. // Generate a new id
  9959. this.id = this.generate(id);
  9960. // If we are caching the hex string
  9961. if (ObjectID.cacheHexString) this.__id = this.toString('hex');
  9962. // Return the object
  9963. return;
  9964. }
  9965. // Check if the passed in id is valid
  9966. var valid = ObjectID.isValid(id);
  9967. // Throw an error if it's not a valid setup
  9968. if (!valid && id != null) {
  9969. throw new Error('Argument passed in must be a single String of 12 bytes or a string of 24 hex characters');
  9970. } else if (valid && typeof id === 'string' && id.length === 24 && hasBufferType) {
  9971. return new ObjectID(utils.toBuffer(id, 'hex'));
  9972. } else if (valid && typeof id === 'string' && id.length === 24) {
  9973. return ObjectID.createFromHexString(id);
  9974. } else if (id != null && id.length === 12) {
  9975. // assume 12 byte string
  9976. this.id = id;
  9977. } else if (id != null && id.toHexString) {
  9978. // Duck-typing to support ObjectId from different npm packages
  9979. return id;
  9980. } else {
  9981. throw new Error('Argument passed in must be a single String of 12 bytes or a string of 24 hex characters');
  9982. }
  9983. if (ObjectID.cacheHexString) this.__id = this.toString('hex');
  9984. };
  9985. // Allow usage of ObjectId as well as ObjectID
  9986. // var ObjectId = ObjectID;
  9987. // Precomputed hex table enables speedy hex string conversion
  9988. var hexTable = [];
  9989. for (var i = 0; i < 256; i++) {
  9990. hexTable[i] = (i <= 15 ? '0' : '') + i.toString(16);
  9991. }
  9992. /**
  9993. * Return the ObjectID id as a 24 byte hex string representation
  9994. *
  9995. * @method
  9996. * @return {string} return the 24 byte hex string representation.
  9997. */
  9998. ObjectID.prototype.toHexString = function () {
  9999. if (ObjectID.cacheHexString && this.__id) return this.__id;
  10000. var hexString = '';
  10001. if (!this.id || !this.id.length) {
  10002. throw new Error('invalid ObjectId, ObjectId.id must be either a string or a Buffer, but is [' + JSON.stringify(this.id) + ']');
  10003. }
  10004. if (this.id instanceof _Buffer) {
  10005. hexString = convertToHex(this.id);
  10006. if (ObjectID.cacheHexString) this.__id = hexString;
  10007. return hexString;
  10008. }
  10009. for (var i = 0; i < this.id.length; i++) {
  10010. hexString += hexTable[this.id.charCodeAt(i)];
  10011. }
  10012. if (ObjectID.cacheHexString) this.__id = hexString;
  10013. return hexString;
  10014. };
  10015. /**
  10016. * Update the ObjectID index used in generating new ObjectID's on the driver
  10017. *
  10018. * @method
  10019. * @return {number} returns next index value.
  10020. * @ignore
  10021. */
  10022. ObjectID.prototype.get_inc = function () {
  10023. return ObjectID.index = (ObjectID.index + 1) % 0xffffff;
  10024. };
  10025. /**
  10026. * Update the ObjectID index used in generating new ObjectID's on the driver
  10027. *
  10028. * @method
  10029. * @return {number} returns next index value.
  10030. * @ignore
  10031. */
  10032. ObjectID.prototype.getInc = function () {
  10033. return this.get_inc();
  10034. };
  10035. /**
  10036. * Generate a 12 byte id buffer used in ObjectID's
  10037. *
  10038. * @method
  10039. * @param {number} [time] optional parameter allowing to pass in a second based timestamp.
  10040. * @return {Buffer} return the 12 byte id buffer string.
  10041. */
  10042. ObjectID.prototype.generate = function (time) {
  10043. if ('number' !== typeof time) {
  10044. time = ~~(Date.now() / 1000);
  10045. }
  10046. // Use pid
  10047. var pid = (typeof process === 'undefined' || process.pid === 1 ? Math.floor(Math.random() * 100000) : process.pid) % 0xffff;
  10048. var inc = this.get_inc();
  10049. // Buffer used
  10050. var buffer = utils.allocBuffer(12);
  10051. // Encode time
  10052. buffer[3] = time & 0xff;
  10053. buffer[2] = time >> 8 & 0xff;
  10054. buffer[1] = time >> 16 & 0xff;
  10055. buffer[0] = time >> 24 & 0xff;
  10056. // Encode machine
  10057. buffer[6] = MACHINE_ID & 0xff;
  10058. buffer[5] = MACHINE_ID >> 8 & 0xff;
  10059. buffer[4] = MACHINE_ID >> 16 & 0xff;
  10060. // Encode pid
  10061. buffer[8] = pid & 0xff;
  10062. buffer[7] = pid >> 8 & 0xff;
  10063. // Encode index
  10064. buffer[11] = inc & 0xff;
  10065. buffer[10] = inc >> 8 & 0xff;
  10066. buffer[9] = inc >> 16 & 0xff;
  10067. // Return the buffer
  10068. return buffer;
  10069. };
  10070. /**
  10071. * Converts the id into a 24 byte hex string for printing
  10072. *
  10073. * @param {String} format The Buffer toString format parameter.
  10074. * @return {String} return the 24 byte hex string representation.
  10075. * @ignore
  10076. */
  10077. ObjectID.prototype.toString = function (format) {
  10078. // Is the id a buffer then use the buffer toString method to return the format
  10079. if (this.id && this.id.copy) {
  10080. return this.id.toString(typeof format === 'string' ? format : 'hex');
  10081. }
  10082. // if(this.buffer )
  10083. return this.toHexString();
  10084. };
  10085. /**
  10086. * Converts to a string representation of this Id.
  10087. *
  10088. * @return {String} return the 24 byte hex string representation.
  10089. * @ignore
  10090. */
  10091. ObjectID.prototype[inspect] = ObjectID.prototype.toString;
  10092. /**
  10093. * Converts to its JSON representation.
  10094. *
  10095. * @return {String} return the 24 byte hex string representation.
  10096. * @ignore
  10097. */
  10098. ObjectID.prototype.toJSON = function () {
  10099. return this.toHexString();
  10100. };
  10101. /**
  10102. * Compares the equality of this ObjectID with `otherID`.
  10103. *
  10104. * @method
  10105. * @param {object} otherID ObjectID instance to compare against.
  10106. * @return {boolean} the result of comparing two ObjectID's
  10107. */
  10108. ObjectID.prototype.equals = function equals(otherId) {
  10109. // var id;
  10110. if (otherId instanceof ObjectID) {
  10111. return this.toString() === otherId.toString();
  10112. } else if (typeof otherId === 'string' && ObjectID.isValid(otherId) && otherId.length === 12 && this.id instanceof _Buffer) {
  10113. return otherId === this.id.toString('binary');
  10114. } else if (typeof otherId === 'string' && ObjectID.isValid(otherId) && otherId.length === 24) {
  10115. return otherId.toLowerCase() === this.toHexString();
  10116. } else if (typeof otherId === 'string' && ObjectID.isValid(otherId) && otherId.length === 12) {
  10117. return otherId === this.id;
  10118. } else if (otherId != null && (otherId instanceof ObjectID || otherId.toHexString)) {
  10119. return otherId.toHexString() === this.toHexString();
  10120. } else {
  10121. return false;
  10122. }
  10123. };
  10124. /**
  10125. * Returns the generation date (accurate up to the second) that this ID was generated.
  10126. *
  10127. * @method
  10128. * @return {date} the generation date
  10129. */
  10130. ObjectID.prototype.getTimestamp = function () {
  10131. var timestamp = new Date();
  10132. var time = this.id[3] | this.id[2] << 8 | this.id[1] << 16 | this.id[0] << 24;
  10133. timestamp.setTime(Math.floor(time) * 1000);
  10134. return timestamp;
  10135. };
  10136. /**
  10137. * @ignore
  10138. */
  10139. ObjectID.index = ~~(Math.random() * 0xffffff);
  10140. /**
  10141. * @ignore
  10142. */
  10143. ObjectID.createPk = function createPk() {
  10144. return new ObjectID();
  10145. };
  10146. /**
  10147. * Creates an ObjectID from a second based number, with the rest of the ObjectID zeroed out. Used for comparisons or sorting the ObjectID.
  10148. *
  10149. * @method
  10150. * @param {number} time an integer number representing a number of seconds.
  10151. * @return {ObjectID} return the created ObjectID
  10152. */
  10153. ObjectID.createFromTime = function createFromTime(time) {
  10154. var buffer = utils.toBuffer([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
  10155. // Encode time into first 4 bytes
  10156. buffer[3] = time & 0xff;
  10157. buffer[2] = time >> 8 & 0xff;
  10158. buffer[1] = time >> 16 & 0xff;
  10159. buffer[0] = time >> 24 & 0xff;
  10160. // Return the new objectId
  10161. return new ObjectID(buffer);
  10162. };
  10163. // Lookup tables
  10164. //var encodeLookup = '0123456789abcdef'.split('');
  10165. var decodeLookup = [];
  10166. i = 0;
  10167. while (i < 10) decodeLookup[0x30 + i] = i++;
  10168. while (i < 16) decodeLookup[0x41 - 10 + i] = decodeLookup[0x61 - 10 + i] = i++;
  10169. var _Buffer = Buffer;
  10170. var convertToHex = function (bytes) {
  10171. return bytes.toString('hex');
  10172. };
  10173. /**
  10174. * Creates an ObjectID from a hex string representation of an ObjectID.
  10175. *
  10176. * @method
  10177. * @param {string} hexString create a ObjectID from a passed in 24 byte hexstring.
  10178. * @return {ObjectID} return the created ObjectID
  10179. */
  10180. ObjectID.createFromHexString = function createFromHexString(string) {
  10181. // Throw an error if it's not a valid setup
  10182. if (typeof string === 'undefined' || string != null && string.length !== 24) {
  10183. throw new Error('Argument passed in must be a single String of 12 bytes or a string of 24 hex characters');
  10184. }
  10185. // Use Buffer.from method if available
  10186. if (hasBufferType) return new ObjectID(utils.toBuffer(string, 'hex'));
  10187. // Calculate lengths
  10188. var array = new _Buffer(12);
  10189. var n = 0;
  10190. var i = 0;
  10191. while (i < 24) {
  10192. array[n++] = decodeLookup[string.charCodeAt(i++)] << 4 | decodeLookup[string.charCodeAt(i++)];
  10193. }
  10194. return new ObjectID(array);
  10195. };
  10196. /**
  10197. * Checks if a value is a valid bson ObjectId
  10198. *
  10199. * @method
  10200. * @return {boolean} return true if the value is a valid bson ObjectId, return false otherwise.
  10201. */
  10202. ObjectID.isValid = function isValid(id) {
  10203. if (id == null) return false;
  10204. if (typeof id === 'number') {
  10205. return true;
  10206. }
  10207. if (typeof id === 'string') {
  10208. return id.length === 12 || id.length === 24 && checkForHexRegExp.test(id);
  10209. }
  10210. if (id instanceof ObjectID) {
  10211. return true;
  10212. }
  10213. if (id instanceof _Buffer) {
  10214. return true;
  10215. }
  10216. // Duck-Typing detection of ObjectId like objects
  10217. if (id.toHexString) {
  10218. return id.id.length === 12 || id.id.length === 24 && checkForHexRegExp.test(id.id);
  10219. }
  10220. return false;
  10221. };
  10222. /**
  10223. * @ignore
  10224. */
  10225. Object.defineProperty(ObjectID.prototype, 'generationTime', {
  10226. enumerable: true,
  10227. get: function () {
  10228. return this.id[3] | this.id[2] << 8 | this.id[1] << 16 | this.id[0] << 24;
  10229. },
  10230. set: function (value) {
  10231. // Encode time into first 4 bytes
  10232. this.id[3] = value & 0xff;
  10233. this.id[2] = value >> 8 & 0xff;
  10234. this.id[1] = value >> 16 & 0xff;
  10235. this.id[0] = value >> 24 & 0xff;
  10236. }
  10237. });
  10238. /**
  10239. * Expose.
  10240. */
  10241. module.exports = ObjectID;
  10242. module.exports.ObjectID = ObjectID;
  10243. module.exports.ObjectId = ObjectID;
  10244. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(339).Buffer, __webpack_require__(343)))
  10245. /***/ }),
  10246. /* 339 */
  10247. /***/ (function(module, exports, __webpack_require__) {
  10248. /* WEBPACK VAR INJECTION */(function(global) {/*!
  10249. * The buffer module from node.js, for the browser.
  10250. *
  10251. * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
  10252. * @license MIT
  10253. */
  10254. /* eslint-disable no-proto */
  10255. 'use strict'
  10256. var base64 = __webpack_require__(340)
  10257. var ieee754 = __webpack_require__(341)
  10258. var isArray = __webpack_require__(342)
  10259. exports.Buffer = Buffer
  10260. exports.SlowBuffer = SlowBuffer
  10261. exports.INSPECT_MAX_BYTES = 50
  10262. /**
  10263. * If `Buffer.TYPED_ARRAY_SUPPORT`:
  10264. * === true Use Uint8Array implementation (fastest)
  10265. * === false Use Object implementation (most compatible, even IE6)
  10266. *
  10267. * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
  10268. * Opera 11.6+, iOS 4.2+.
  10269. *
  10270. * Due to various browser bugs, sometimes the Object implementation will be used even
  10271. * when the browser supports typed arrays.
  10272. *
  10273. * Note:
  10274. *
  10275. * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
  10276. * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
  10277. *
  10278. * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
  10279. *
  10280. * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
  10281. * incorrect length in some situations.
  10282. * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
  10283. * get the Object implementation, which is slower but behaves correctly.
  10284. */
  10285. Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
  10286. ? global.TYPED_ARRAY_SUPPORT
  10287. : typedArraySupport()
  10288. /*
  10289. * Export kMaxLength after typed array support is determined.
  10290. */
  10291. exports.kMaxLength = kMaxLength()
  10292. function typedArraySupport () {
  10293. try {
  10294. var arr = new Uint8Array(1)
  10295. arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
  10296. return arr.foo() === 42 && // typed array instances can be augmented
  10297. typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
  10298. arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
  10299. } catch (e) {
  10300. return false
  10301. }
  10302. }
  10303. function kMaxLength () {
  10304. return Buffer.TYPED_ARRAY_SUPPORT
  10305. ? 0x7fffffff
  10306. : 0x3fffffff
  10307. }
  10308. function createBuffer (that, length) {
  10309. if (kMaxLength() < length) {
  10310. throw new RangeError('Invalid typed array length')
  10311. }
  10312. if (Buffer.TYPED_ARRAY_SUPPORT) {
  10313. // Return an augmented `Uint8Array` instance, for best performance
  10314. that = new Uint8Array(length)
  10315. that.__proto__ = Buffer.prototype
  10316. } else {
  10317. // Fallback: Return an object instance of the Buffer class
  10318. if (that === null) {
  10319. that = new Buffer(length)
  10320. }
  10321. that.length = length
  10322. }
  10323. return that
  10324. }
  10325. /**
  10326. * The Buffer constructor returns instances of `Uint8Array` that have their
  10327. * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
  10328. * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
  10329. * and the `Uint8Array` methods. Square bracket notation works as expected -- it
  10330. * returns a single octet.
  10331. *
  10332. * The `Uint8Array` prototype remains unmodified.
  10333. */
  10334. function Buffer (arg, encodingOrOffset, length) {
  10335. if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
  10336. return new Buffer(arg, encodingOrOffset, length)
  10337. }
  10338. // Common case.
  10339. if (typeof arg === 'number') {
  10340. if (typeof encodingOrOffset === 'string') {
  10341. throw new Error(
  10342. 'If encoding is specified then the first argument must be a string'
  10343. )
  10344. }
  10345. return allocUnsafe(this, arg)
  10346. }
  10347. return from(this, arg, encodingOrOffset, length)
  10348. }
  10349. Buffer.poolSize = 8192 // not used by this implementation
  10350. // TODO: Legacy, not needed anymore. Remove in next major version.
  10351. Buffer._augment = function (arr) {
  10352. arr.__proto__ = Buffer.prototype
  10353. return arr
  10354. }
  10355. function from (that, value, encodingOrOffset, length) {
  10356. if (typeof value === 'number') {
  10357. throw new TypeError('"value" argument must not be a number')
  10358. }
  10359. if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
  10360. return fromArrayBuffer(that, value, encodingOrOffset, length)
  10361. }
  10362. if (typeof value === 'string') {
  10363. return fromString(that, value, encodingOrOffset)
  10364. }
  10365. return fromObject(that, value)
  10366. }
  10367. /**
  10368. * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
  10369. * if value is a number.
  10370. * Buffer.from(str[, encoding])
  10371. * Buffer.from(array)
  10372. * Buffer.from(buffer)
  10373. * Buffer.from(arrayBuffer[, byteOffset[, length]])
  10374. **/
  10375. Buffer.from = function (value, encodingOrOffset, length) {
  10376. return from(null, value, encodingOrOffset, length)
  10377. }
  10378. if (Buffer.TYPED_ARRAY_SUPPORT) {
  10379. Buffer.prototype.__proto__ = Uint8Array.prototype
  10380. Buffer.__proto__ = Uint8Array
  10381. if (typeof Symbol !== 'undefined' && Symbol.species &&
  10382. Buffer[Symbol.species] === Buffer) {
  10383. // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
  10384. Object.defineProperty(Buffer, Symbol.species, {
  10385. value: null,
  10386. configurable: true
  10387. })
  10388. }
  10389. }
  10390. function assertSize (size) {
  10391. if (typeof size !== 'number') {
  10392. throw new TypeError('"size" argument must be a number')
  10393. } else if (size < 0) {
  10394. throw new RangeError('"size" argument must not be negative')
  10395. }
  10396. }
  10397. function alloc (that, size, fill, encoding) {
  10398. assertSize(size)
  10399. if (size <= 0) {
  10400. return createBuffer(that, size)
  10401. }
  10402. if (fill !== undefined) {
  10403. // Only pay attention to encoding if it's a string. This
  10404. // prevents accidentally sending in a number that would
  10405. // be interpretted as a start offset.
  10406. return typeof encoding === 'string'
  10407. ? createBuffer(that, size).fill(fill, encoding)
  10408. : createBuffer(that, size).fill(fill)
  10409. }
  10410. return createBuffer(that, size)
  10411. }
  10412. /**
  10413. * Creates a new filled Buffer instance.
  10414. * alloc(size[, fill[, encoding]])
  10415. **/
  10416. Buffer.alloc = function (size, fill, encoding) {
  10417. return alloc(null, size, fill, encoding)
  10418. }
  10419. function allocUnsafe (that, size) {
  10420. assertSize(size)
  10421. that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
  10422. if (!Buffer.TYPED_ARRAY_SUPPORT) {
  10423. for (var i = 0; i < size; ++i) {
  10424. that[i] = 0
  10425. }
  10426. }
  10427. return that
  10428. }
  10429. /**
  10430. * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
  10431. * */
  10432. Buffer.allocUnsafe = function (size) {
  10433. return allocUnsafe(null, size)
  10434. }
  10435. /**
  10436. * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
  10437. */
  10438. Buffer.allocUnsafeSlow = function (size) {
  10439. return allocUnsafe(null, size)
  10440. }
  10441. function fromString (that, string, encoding) {
  10442. if (typeof encoding !== 'string' || encoding === '') {
  10443. encoding = 'utf8'
  10444. }
  10445. if (!Buffer.isEncoding(encoding)) {
  10446. throw new TypeError('"encoding" must be a valid string encoding')
  10447. }
  10448. var length = byteLength(string, encoding) | 0
  10449. that = createBuffer(that, length)
  10450. var actual = that.write(string, encoding)
  10451. if (actual !== length) {
  10452. // Writing a hex string, for example, that contains invalid characters will
  10453. // cause everything after the first invalid character to be ignored. (e.g.
  10454. // 'abxxcd' will be treated as 'ab')
  10455. that = that.slice(0, actual)
  10456. }
  10457. return that
  10458. }
  10459. function fromArrayLike (that, array) {
  10460. var length = array.length < 0 ? 0 : checked(array.length) | 0
  10461. that = createBuffer(that, length)
  10462. for (var i = 0; i < length; i += 1) {
  10463. that[i] = array[i] & 255
  10464. }
  10465. return that
  10466. }
  10467. function fromArrayBuffer (that, array, byteOffset, length) {
  10468. array.byteLength // this throws if `array` is not a valid ArrayBuffer
  10469. if (byteOffset < 0 || array.byteLength < byteOffset) {
  10470. throw new RangeError('\'offset\' is out of bounds')
  10471. }
  10472. if (array.byteLength < byteOffset + (length || 0)) {
  10473. throw new RangeError('\'length\' is out of bounds')
  10474. }
  10475. if (byteOffset === undefined && length === undefined) {
  10476. array = new Uint8Array(array)
  10477. } else if (length === undefined) {
  10478. array = new Uint8Array(array, byteOffset)
  10479. } else {
  10480. array = new Uint8Array(array, byteOffset, length)
  10481. }
  10482. if (Buffer.TYPED_ARRAY_SUPPORT) {
  10483. // Return an augmented `Uint8Array` instance, for best performance
  10484. that = array
  10485. that.__proto__ = Buffer.prototype
  10486. } else {
  10487. // Fallback: Return an object instance of the Buffer class
  10488. that = fromArrayLike(that, array)
  10489. }
  10490. return that
  10491. }
  10492. function fromObject (that, obj) {
  10493. if (Buffer.isBuffer(obj)) {
  10494. var len = checked(obj.length) | 0
  10495. that = createBuffer(that, len)
  10496. if (that.length === 0) {
  10497. return that
  10498. }
  10499. obj.copy(that, 0, 0, len)
  10500. return that
  10501. }
  10502. if (obj) {
  10503. if ((typeof ArrayBuffer !== 'undefined' &&
  10504. obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
  10505. if (typeof obj.length !== 'number' || isnan(obj.length)) {
  10506. return createBuffer(that, 0)
  10507. }
  10508. return fromArrayLike(that, obj)
  10509. }
  10510. if (obj.type === 'Buffer' && isArray(obj.data)) {
  10511. return fromArrayLike(that, obj.data)
  10512. }
  10513. }
  10514. throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
  10515. }
  10516. function checked (length) {
  10517. // Note: cannot use `length < kMaxLength()` here because that fails when
  10518. // length is NaN (which is otherwise coerced to zero.)
  10519. if (length >= kMaxLength()) {
  10520. throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
  10521. 'size: 0x' + kMaxLength().toString(16) + ' bytes')
  10522. }
  10523. return length | 0
  10524. }
  10525. function SlowBuffer (length) {
  10526. if (+length != length) { // eslint-disable-line eqeqeq
  10527. length = 0
  10528. }
  10529. return Buffer.alloc(+length)
  10530. }
  10531. Buffer.isBuffer = function isBuffer (b) {
  10532. return !!(b != null && b._isBuffer)
  10533. }
  10534. Buffer.compare = function compare (a, b) {
  10535. if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
  10536. throw new TypeError('Arguments must be Buffers')
  10537. }
  10538. if (a === b) return 0
  10539. var x = a.length
  10540. var y = b.length
  10541. for (var i = 0, len = Math.min(x, y); i < len; ++i) {
  10542. if (a[i] !== b[i]) {
  10543. x = a[i]
  10544. y = b[i]
  10545. break
  10546. }
  10547. }
  10548. if (x < y) return -1
  10549. if (y < x) return 1
  10550. return 0
  10551. }
  10552. Buffer.isEncoding = function isEncoding (encoding) {
  10553. switch (String(encoding).toLowerCase()) {
  10554. case 'hex':
  10555. case 'utf8':
  10556. case 'utf-8':
  10557. case 'ascii':
  10558. case 'latin1':
  10559. case 'binary':
  10560. case 'base64':
  10561. case 'ucs2':
  10562. case 'ucs-2':
  10563. case 'utf16le':
  10564. case 'utf-16le':
  10565. return true
  10566. default:
  10567. return false
  10568. }
  10569. }
  10570. Buffer.concat = function concat (list, length) {
  10571. if (!isArray(list)) {
  10572. throw new TypeError('"list" argument must be an Array of Buffers')
  10573. }
  10574. if (list.length === 0) {
  10575. return Buffer.alloc(0)
  10576. }
  10577. var i
  10578. if (length === undefined) {
  10579. length = 0
  10580. for (i = 0; i < list.length; ++i) {
  10581. length += list[i].length
  10582. }
  10583. }
  10584. var buffer = Buffer.allocUnsafe(length)
  10585. var pos = 0
  10586. for (i = 0; i < list.length; ++i) {
  10587. var buf = list[i]
  10588. if (!Buffer.isBuffer(buf)) {
  10589. throw new TypeError('"list" argument must be an Array of Buffers')
  10590. }
  10591. buf.copy(buffer, pos)
  10592. pos += buf.length
  10593. }
  10594. return buffer
  10595. }
  10596. function byteLength (string, encoding) {
  10597. if (Buffer.isBuffer(string)) {
  10598. return string.length
  10599. }
  10600. if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
  10601. (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
  10602. return string.byteLength
  10603. }
  10604. if (typeof string !== 'string') {
  10605. string = '' + string
  10606. }
  10607. var len = string.length
  10608. if (len === 0) return 0
  10609. // Use a for loop to avoid recursion
  10610. var loweredCase = false
  10611. for (;;) {
  10612. switch (encoding) {
  10613. case 'ascii':
  10614. case 'latin1':
  10615. case 'binary':
  10616. return len
  10617. case 'utf8':
  10618. case 'utf-8':
  10619. case undefined:
  10620. return utf8ToBytes(string).length
  10621. case 'ucs2':
  10622. case 'ucs-2':
  10623. case 'utf16le':
  10624. case 'utf-16le':
  10625. return len * 2
  10626. case 'hex':
  10627. return len >>> 1
  10628. case 'base64':
  10629. return base64ToBytes(string).length
  10630. default:
  10631. if (loweredCase) return utf8ToBytes(string).length // assume utf8
  10632. encoding = ('' + encoding).toLowerCase()
  10633. loweredCase = true
  10634. }
  10635. }
  10636. }
  10637. Buffer.byteLength = byteLength
  10638. function slowToString (encoding, start, end) {
  10639. var loweredCase = false
  10640. // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
  10641. // property of a typed array.
  10642. // This behaves neither like String nor Uint8Array in that we set start/end
  10643. // to their upper/lower bounds if the value passed is out of range.
  10644. // undefined is handled specially as per ECMA-262 6th Edition,
  10645. // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
  10646. if (start === undefined || start < 0) {
  10647. start = 0
  10648. }
  10649. // Return early if start > this.length. Done here to prevent potential uint32
  10650. // coercion fail below.
  10651. if (start > this.length) {
  10652. return ''
  10653. }
  10654. if (end === undefined || end > this.length) {
  10655. end = this.length
  10656. }
  10657. if (end <= 0) {
  10658. return ''
  10659. }
  10660. // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
  10661. end >>>= 0
  10662. start >>>= 0
  10663. if (end <= start) {
  10664. return ''
  10665. }
  10666. if (!encoding) encoding = 'utf8'
  10667. while (true) {
  10668. switch (encoding) {
  10669. case 'hex':
  10670. return hexSlice(this, start, end)
  10671. case 'utf8':
  10672. case 'utf-8':
  10673. return utf8Slice(this, start, end)
  10674. case 'ascii':
  10675. return asciiSlice(this, start, end)
  10676. case 'latin1':
  10677. case 'binary':
  10678. return latin1Slice(this, start, end)
  10679. case 'base64':
  10680. return base64Slice(this, start, end)
  10681. case 'ucs2':
  10682. case 'ucs-2':
  10683. case 'utf16le':
  10684. case 'utf-16le':
  10685. return utf16leSlice(this, start, end)
  10686. default:
  10687. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  10688. encoding = (encoding + '').toLowerCase()
  10689. loweredCase = true
  10690. }
  10691. }
  10692. }
  10693. // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
  10694. // Buffer instances.
  10695. Buffer.prototype._isBuffer = true
  10696. function swap (b, n, m) {
  10697. var i = b[n]
  10698. b[n] = b[m]
  10699. b[m] = i
  10700. }
  10701. Buffer.prototype.swap16 = function swap16 () {
  10702. var len = this.length
  10703. if (len % 2 !== 0) {
  10704. throw new RangeError('Buffer size must be a multiple of 16-bits')
  10705. }
  10706. for (var i = 0; i < len; i += 2) {
  10707. swap(this, i, i + 1)
  10708. }
  10709. return this
  10710. }
  10711. Buffer.prototype.swap32 = function swap32 () {
  10712. var len = this.length
  10713. if (len % 4 !== 0) {
  10714. throw new RangeError('Buffer size must be a multiple of 32-bits')
  10715. }
  10716. for (var i = 0; i < len; i += 4) {
  10717. swap(this, i, i + 3)
  10718. swap(this, i + 1, i + 2)
  10719. }
  10720. return this
  10721. }
  10722. Buffer.prototype.swap64 = function swap64 () {
  10723. var len = this.length
  10724. if (len % 8 !== 0) {
  10725. throw new RangeError('Buffer size must be a multiple of 64-bits')
  10726. }
  10727. for (var i = 0; i < len; i += 8) {
  10728. swap(this, i, i + 7)
  10729. swap(this, i + 1, i + 6)
  10730. swap(this, i + 2, i + 5)
  10731. swap(this, i + 3, i + 4)
  10732. }
  10733. return this
  10734. }
  10735. Buffer.prototype.toString = function toString () {
  10736. var length = this.length | 0
  10737. if (length === 0) return ''
  10738. if (arguments.length === 0) return utf8Slice(this, 0, length)
  10739. return slowToString.apply(this, arguments)
  10740. }
  10741. Buffer.prototype.equals = function equals (b) {
  10742. if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
  10743. if (this === b) return true
  10744. return Buffer.compare(this, b) === 0
  10745. }
  10746. Buffer.prototype.inspect = function inspect () {
  10747. var str = ''
  10748. var max = exports.INSPECT_MAX_BYTES
  10749. if (this.length > 0) {
  10750. str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
  10751. if (this.length > max) str += ' ... '
  10752. }
  10753. return '<Buffer ' + str + '>'
  10754. }
  10755. Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
  10756. if (!Buffer.isBuffer(target)) {
  10757. throw new TypeError('Argument must be a Buffer')
  10758. }
  10759. if (start === undefined) {
  10760. start = 0
  10761. }
  10762. if (end === undefined) {
  10763. end = target ? target.length : 0
  10764. }
  10765. if (thisStart === undefined) {
  10766. thisStart = 0
  10767. }
  10768. if (thisEnd === undefined) {
  10769. thisEnd = this.length
  10770. }
  10771. if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
  10772. throw new RangeError('out of range index')
  10773. }
  10774. if (thisStart >= thisEnd && start >= end) {
  10775. return 0
  10776. }
  10777. if (thisStart >= thisEnd) {
  10778. return -1
  10779. }
  10780. if (start >= end) {
  10781. return 1
  10782. }
  10783. start >>>= 0
  10784. end >>>= 0
  10785. thisStart >>>= 0
  10786. thisEnd >>>= 0
  10787. if (this === target) return 0
  10788. var x = thisEnd - thisStart
  10789. var y = end - start
  10790. var len = Math.min(x, y)
  10791. var thisCopy = this.slice(thisStart, thisEnd)
  10792. var targetCopy = target.slice(start, end)
  10793. for (var i = 0; i < len; ++i) {
  10794. if (thisCopy[i] !== targetCopy[i]) {
  10795. x = thisCopy[i]
  10796. y = targetCopy[i]
  10797. break
  10798. }
  10799. }
  10800. if (x < y) return -1
  10801. if (y < x) return 1
  10802. return 0
  10803. }
  10804. // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
  10805. // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
  10806. //
  10807. // Arguments:
  10808. // - buffer - a Buffer to search
  10809. // - val - a string, Buffer, or number
  10810. // - byteOffset - an index into `buffer`; will be clamped to an int32
  10811. // - encoding - an optional encoding, relevant is val is a string
  10812. // - dir - true for indexOf, false for lastIndexOf
  10813. function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
  10814. // Empty buffer means no match
  10815. if (buffer.length === 0) return -1
  10816. // Normalize byteOffset
  10817. if (typeof byteOffset === 'string') {
  10818. encoding = byteOffset
  10819. byteOffset = 0
  10820. } else if (byteOffset > 0x7fffffff) {
  10821. byteOffset = 0x7fffffff
  10822. } else if (byteOffset < -0x80000000) {
  10823. byteOffset = -0x80000000
  10824. }
  10825. byteOffset = +byteOffset // Coerce to Number.
  10826. if (isNaN(byteOffset)) {
  10827. // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
  10828. byteOffset = dir ? 0 : (buffer.length - 1)
  10829. }
  10830. // Normalize byteOffset: negative offsets start from the end of the buffer
  10831. if (byteOffset < 0) byteOffset = buffer.length + byteOffset
  10832. if (byteOffset >= buffer.length) {
  10833. if (dir) return -1
  10834. else byteOffset = buffer.length - 1
  10835. } else if (byteOffset < 0) {
  10836. if (dir) byteOffset = 0
  10837. else return -1
  10838. }
  10839. // Normalize val
  10840. if (typeof val === 'string') {
  10841. val = Buffer.from(val, encoding)
  10842. }
  10843. // Finally, search either indexOf (if dir is true) or lastIndexOf
  10844. if (Buffer.isBuffer(val)) {
  10845. // Special case: looking for empty string/buffer always fails
  10846. if (val.length === 0) {
  10847. return -1
  10848. }
  10849. return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
  10850. } else if (typeof val === 'number') {
  10851. val = val & 0xFF // Search for a byte value [0-255]
  10852. if (Buffer.TYPED_ARRAY_SUPPORT &&
  10853. typeof Uint8Array.prototype.indexOf === 'function') {
  10854. if (dir) {
  10855. return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
  10856. } else {
  10857. return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
  10858. }
  10859. }
  10860. return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
  10861. }
  10862. throw new TypeError('val must be string, number or Buffer')
  10863. }
  10864. function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
  10865. var indexSize = 1
  10866. var arrLength = arr.length
  10867. var valLength = val.length
  10868. if (encoding !== undefined) {
  10869. encoding = String(encoding).toLowerCase()
  10870. if (encoding === 'ucs2' || encoding === 'ucs-2' ||
  10871. encoding === 'utf16le' || encoding === 'utf-16le') {
  10872. if (arr.length < 2 || val.length < 2) {
  10873. return -1
  10874. }
  10875. indexSize = 2
  10876. arrLength /= 2
  10877. valLength /= 2
  10878. byteOffset /= 2
  10879. }
  10880. }
  10881. function read (buf, i) {
  10882. if (indexSize === 1) {
  10883. return buf[i]
  10884. } else {
  10885. return buf.readUInt16BE(i * indexSize)
  10886. }
  10887. }
  10888. var i
  10889. if (dir) {
  10890. var foundIndex = -1
  10891. for (i = byteOffset; i < arrLength; i++) {
  10892. if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
  10893. if (foundIndex === -1) foundIndex = i
  10894. if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
  10895. } else {
  10896. if (foundIndex !== -1) i -= i - foundIndex
  10897. foundIndex = -1
  10898. }
  10899. }
  10900. } else {
  10901. if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
  10902. for (i = byteOffset; i >= 0; i--) {
  10903. var found = true
  10904. for (var j = 0; j < valLength; j++) {
  10905. if (read(arr, i + j) !== read(val, j)) {
  10906. found = false
  10907. break
  10908. }
  10909. }
  10910. if (found) return i
  10911. }
  10912. }
  10913. return -1
  10914. }
  10915. Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
  10916. return this.indexOf(val, byteOffset, encoding) !== -1
  10917. }
  10918. Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
  10919. return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
  10920. }
  10921. Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
  10922. return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
  10923. }
  10924. function hexWrite (buf, string, offset, length) {
  10925. offset = Number(offset) || 0
  10926. var remaining = buf.length - offset
  10927. if (!length) {
  10928. length = remaining
  10929. } else {
  10930. length = Number(length)
  10931. if (length > remaining) {
  10932. length = remaining
  10933. }
  10934. }
  10935. // must be an even number of digits
  10936. var strLen = string.length
  10937. if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
  10938. if (length > strLen / 2) {
  10939. length = strLen / 2
  10940. }
  10941. for (var i = 0; i < length; ++i) {
  10942. var parsed = parseInt(string.substr(i * 2, 2), 16)
  10943. if (isNaN(parsed)) return i
  10944. buf[offset + i] = parsed
  10945. }
  10946. return i
  10947. }
  10948. function utf8Write (buf, string, offset, length) {
  10949. return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
  10950. }
  10951. function asciiWrite (buf, string, offset, length) {
  10952. return blitBuffer(asciiToBytes(string), buf, offset, length)
  10953. }
  10954. function latin1Write (buf, string, offset, length) {
  10955. return asciiWrite(buf, string, offset, length)
  10956. }
  10957. function base64Write (buf, string, offset, length) {
  10958. return blitBuffer(base64ToBytes(string), buf, offset, length)
  10959. }
  10960. function ucs2Write (buf, string, offset, length) {
  10961. return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
  10962. }
  10963. Buffer.prototype.write = function write (string, offset, length, encoding) {
  10964. // Buffer#write(string)
  10965. if (offset === undefined) {
  10966. encoding = 'utf8'
  10967. length = this.length
  10968. offset = 0
  10969. // Buffer#write(string, encoding)
  10970. } else if (length === undefined && typeof offset === 'string') {
  10971. encoding = offset
  10972. length = this.length
  10973. offset = 0
  10974. // Buffer#write(string, offset[, length][, encoding])
  10975. } else if (isFinite(offset)) {
  10976. offset = offset | 0
  10977. if (isFinite(length)) {
  10978. length = length | 0
  10979. if (encoding === undefined) encoding = 'utf8'
  10980. } else {
  10981. encoding = length
  10982. length = undefined
  10983. }
  10984. // legacy write(string, encoding, offset, length) - remove in v0.13
  10985. } else {
  10986. throw new Error(
  10987. 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
  10988. )
  10989. }
  10990. var remaining = this.length - offset
  10991. if (length === undefined || length > remaining) length = remaining
  10992. if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
  10993. throw new RangeError('Attempt to write outside buffer bounds')
  10994. }
  10995. if (!encoding) encoding = 'utf8'
  10996. var loweredCase = false
  10997. for (;;) {
  10998. switch (encoding) {
  10999. case 'hex':
  11000. return hexWrite(this, string, offset, length)
  11001. case 'utf8':
  11002. case 'utf-8':
  11003. return utf8Write(this, string, offset, length)
  11004. case 'ascii':
  11005. return asciiWrite(this, string, offset, length)
  11006. case 'latin1':
  11007. case 'binary':
  11008. return latin1Write(this, string, offset, length)
  11009. case 'base64':
  11010. // Warning: maxLength not taken into account in base64Write
  11011. return base64Write(this, string, offset, length)
  11012. case 'ucs2':
  11013. case 'ucs-2':
  11014. case 'utf16le':
  11015. case 'utf-16le':
  11016. return ucs2Write(this, string, offset, length)
  11017. default:
  11018. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  11019. encoding = ('' + encoding).toLowerCase()
  11020. loweredCase = true
  11021. }
  11022. }
  11023. }
  11024. Buffer.prototype.toJSON = function toJSON () {
  11025. return {
  11026. type: 'Buffer',
  11027. data: Array.prototype.slice.call(this._arr || this, 0)
  11028. }
  11029. }
  11030. function base64Slice (buf, start, end) {
  11031. if (start === 0 && end === buf.length) {
  11032. return base64.fromByteArray(buf)
  11033. } else {
  11034. return base64.fromByteArray(buf.slice(start, end))
  11035. }
  11036. }
  11037. function utf8Slice (buf, start, end) {
  11038. end = Math.min(buf.length, end)
  11039. var res = []
  11040. var i = start
  11041. while (i < end) {
  11042. var firstByte = buf[i]
  11043. var codePoint = null
  11044. var bytesPerSequence = (firstByte > 0xEF) ? 4
  11045. : (firstByte > 0xDF) ? 3
  11046. : (firstByte > 0xBF) ? 2
  11047. : 1
  11048. if (i + bytesPerSequence <= end) {
  11049. var secondByte, thirdByte, fourthByte, tempCodePoint
  11050. switch (bytesPerSequence) {
  11051. case 1:
  11052. if (firstByte < 0x80) {
  11053. codePoint = firstByte
  11054. }
  11055. break
  11056. case 2:
  11057. secondByte = buf[i + 1]
  11058. if ((secondByte & 0xC0) === 0x80) {
  11059. tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
  11060. if (tempCodePoint > 0x7F) {
  11061. codePoint = tempCodePoint
  11062. }
  11063. }
  11064. break
  11065. case 3:
  11066. secondByte = buf[i + 1]
  11067. thirdByte = buf[i + 2]
  11068. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
  11069. tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
  11070. if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
  11071. codePoint = tempCodePoint
  11072. }
  11073. }
  11074. break
  11075. case 4:
  11076. secondByte = buf[i + 1]
  11077. thirdByte = buf[i + 2]
  11078. fourthByte = buf[i + 3]
  11079. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
  11080. tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
  11081. if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
  11082. codePoint = tempCodePoint
  11083. }
  11084. }
  11085. }
  11086. }
  11087. if (codePoint === null) {
  11088. // we did not generate a valid codePoint so insert a
  11089. // replacement char (U+FFFD) and advance only 1 byte
  11090. codePoint = 0xFFFD
  11091. bytesPerSequence = 1
  11092. } else if (codePoint > 0xFFFF) {
  11093. // encode to utf16 (surrogate pair dance)
  11094. codePoint -= 0x10000
  11095. res.push(codePoint >>> 10 & 0x3FF | 0xD800)
  11096. codePoint = 0xDC00 | codePoint & 0x3FF
  11097. }
  11098. res.push(codePoint)
  11099. i += bytesPerSequence
  11100. }
  11101. return decodeCodePointsArray(res)
  11102. }
  11103. // Based on http://stackoverflow.com/a/22747272/680742, the browser with
  11104. // the lowest limit is Chrome, with 0x10000 args.
  11105. // We go 1 magnitude less, for safety
  11106. var MAX_ARGUMENTS_LENGTH = 0x1000
  11107. function decodeCodePointsArray (codePoints) {
  11108. var len = codePoints.length
  11109. if (len <= MAX_ARGUMENTS_LENGTH) {
  11110. return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
  11111. }
  11112. // Decode in chunks to avoid "call stack size exceeded".
  11113. var res = ''
  11114. var i = 0
  11115. while (i < len) {
  11116. res += String.fromCharCode.apply(
  11117. String,
  11118. codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
  11119. )
  11120. }
  11121. return res
  11122. }
  11123. function asciiSlice (buf, start, end) {
  11124. var ret = ''
  11125. end = Math.min(buf.length, end)
  11126. for (var i = start; i < end; ++i) {
  11127. ret += String.fromCharCode(buf[i] & 0x7F)
  11128. }
  11129. return ret
  11130. }
  11131. function latin1Slice (buf, start, end) {
  11132. var ret = ''
  11133. end = Math.min(buf.length, end)
  11134. for (var i = start; i < end; ++i) {
  11135. ret += String.fromCharCode(buf[i])
  11136. }
  11137. return ret
  11138. }
  11139. function hexSlice (buf, start, end) {
  11140. var len = buf.length
  11141. if (!start || start < 0) start = 0
  11142. if (!end || end < 0 || end > len) end = len
  11143. var out = ''
  11144. for (var i = start; i < end; ++i) {
  11145. out += toHex(buf[i])
  11146. }
  11147. return out
  11148. }
  11149. function utf16leSlice (buf, start, end) {
  11150. var bytes = buf.slice(start, end)
  11151. var res = ''
  11152. for (var i = 0; i < bytes.length; i += 2) {
  11153. res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
  11154. }
  11155. return res
  11156. }
  11157. Buffer.prototype.slice = function slice (start, end) {
  11158. var len = this.length
  11159. start = ~~start
  11160. end = end === undefined ? len : ~~end
  11161. if (start < 0) {
  11162. start += len
  11163. if (start < 0) start = 0
  11164. } else if (start > len) {
  11165. start = len
  11166. }
  11167. if (end < 0) {
  11168. end += len
  11169. if (end < 0) end = 0
  11170. } else if (end > len) {
  11171. end = len
  11172. }
  11173. if (end < start) end = start
  11174. var newBuf
  11175. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11176. newBuf = this.subarray(start, end)
  11177. newBuf.__proto__ = Buffer.prototype
  11178. } else {
  11179. var sliceLen = end - start
  11180. newBuf = new Buffer(sliceLen, undefined)
  11181. for (var i = 0; i < sliceLen; ++i) {
  11182. newBuf[i] = this[i + start]
  11183. }
  11184. }
  11185. return newBuf
  11186. }
  11187. /*
  11188. * Need to make sure that buffer isn't trying to write out of bounds.
  11189. */
  11190. function checkOffset (offset, ext, length) {
  11191. if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
  11192. if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
  11193. }
  11194. Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
  11195. offset = offset | 0
  11196. byteLength = byteLength | 0
  11197. if (!noAssert) checkOffset(offset, byteLength, this.length)
  11198. var val = this[offset]
  11199. var mul = 1
  11200. var i = 0
  11201. while (++i < byteLength && (mul *= 0x100)) {
  11202. val += this[offset + i] * mul
  11203. }
  11204. return val
  11205. }
  11206. Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
  11207. offset = offset | 0
  11208. byteLength = byteLength | 0
  11209. if (!noAssert) {
  11210. checkOffset(offset, byteLength, this.length)
  11211. }
  11212. var val = this[offset + --byteLength]
  11213. var mul = 1
  11214. while (byteLength > 0 && (mul *= 0x100)) {
  11215. val += this[offset + --byteLength] * mul
  11216. }
  11217. return val
  11218. }
  11219. Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
  11220. if (!noAssert) checkOffset(offset, 1, this.length)
  11221. return this[offset]
  11222. }
  11223. Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
  11224. if (!noAssert) checkOffset(offset, 2, this.length)
  11225. return this[offset] | (this[offset + 1] << 8)
  11226. }
  11227. Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
  11228. if (!noAssert) checkOffset(offset, 2, this.length)
  11229. return (this[offset] << 8) | this[offset + 1]
  11230. }
  11231. Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
  11232. if (!noAssert) checkOffset(offset, 4, this.length)
  11233. return ((this[offset]) |
  11234. (this[offset + 1] << 8) |
  11235. (this[offset + 2] << 16)) +
  11236. (this[offset + 3] * 0x1000000)
  11237. }
  11238. Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
  11239. if (!noAssert) checkOffset(offset, 4, this.length)
  11240. return (this[offset] * 0x1000000) +
  11241. ((this[offset + 1] << 16) |
  11242. (this[offset + 2] << 8) |
  11243. this[offset + 3])
  11244. }
  11245. Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
  11246. offset = offset | 0
  11247. byteLength = byteLength | 0
  11248. if (!noAssert) checkOffset(offset, byteLength, this.length)
  11249. var val = this[offset]
  11250. var mul = 1
  11251. var i = 0
  11252. while (++i < byteLength && (mul *= 0x100)) {
  11253. val += this[offset + i] * mul
  11254. }
  11255. mul *= 0x80
  11256. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  11257. return val
  11258. }
  11259. Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
  11260. offset = offset | 0
  11261. byteLength = byteLength | 0
  11262. if (!noAssert) checkOffset(offset, byteLength, this.length)
  11263. var i = byteLength
  11264. var mul = 1
  11265. var val = this[offset + --i]
  11266. while (i > 0 && (mul *= 0x100)) {
  11267. val += this[offset + --i] * mul
  11268. }
  11269. mul *= 0x80
  11270. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  11271. return val
  11272. }
  11273. Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
  11274. if (!noAssert) checkOffset(offset, 1, this.length)
  11275. if (!(this[offset] & 0x80)) return (this[offset])
  11276. return ((0xff - this[offset] + 1) * -1)
  11277. }
  11278. Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
  11279. if (!noAssert) checkOffset(offset, 2, this.length)
  11280. var val = this[offset] | (this[offset + 1] << 8)
  11281. return (val & 0x8000) ? val | 0xFFFF0000 : val
  11282. }
  11283. Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
  11284. if (!noAssert) checkOffset(offset, 2, this.length)
  11285. var val = this[offset + 1] | (this[offset] << 8)
  11286. return (val & 0x8000) ? val | 0xFFFF0000 : val
  11287. }
  11288. Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
  11289. if (!noAssert) checkOffset(offset, 4, this.length)
  11290. return (this[offset]) |
  11291. (this[offset + 1] << 8) |
  11292. (this[offset + 2] << 16) |
  11293. (this[offset + 3] << 24)
  11294. }
  11295. Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
  11296. if (!noAssert) checkOffset(offset, 4, this.length)
  11297. return (this[offset] << 24) |
  11298. (this[offset + 1] << 16) |
  11299. (this[offset + 2] << 8) |
  11300. (this[offset + 3])
  11301. }
  11302. Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
  11303. if (!noAssert) checkOffset(offset, 4, this.length)
  11304. return ieee754.read(this, offset, true, 23, 4)
  11305. }
  11306. Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
  11307. if (!noAssert) checkOffset(offset, 4, this.length)
  11308. return ieee754.read(this, offset, false, 23, 4)
  11309. }
  11310. Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
  11311. if (!noAssert) checkOffset(offset, 8, this.length)
  11312. return ieee754.read(this, offset, true, 52, 8)
  11313. }
  11314. Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
  11315. if (!noAssert) checkOffset(offset, 8, this.length)
  11316. return ieee754.read(this, offset, false, 52, 8)
  11317. }
  11318. function checkInt (buf, value, offset, ext, max, min) {
  11319. if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
  11320. if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
  11321. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  11322. }
  11323. Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
  11324. value = +value
  11325. offset = offset | 0
  11326. byteLength = byteLength | 0
  11327. if (!noAssert) {
  11328. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  11329. checkInt(this, value, offset, byteLength, maxBytes, 0)
  11330. }
  11331. var mul = 1
  11332. var i = 0
  11333. this[offset] = value & 0xFF
  11334. while (++i < byteLength && (mul *= 0x100)) {
  11335. this[offset + i] = (value / mul) & 0xFF
  11336. }
  11337. return offset + byteLength
  11338. }
  11339. Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
  11340. value = +value
  11341. offset = offset | 0
  11342. byteLength = byteLength | 0
  11343. if (!noAssert) {
  11344. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  11345. checkInt(this, value, offset, byteLength, maxBytes, 0)
  11346. }
  11347. var i = byteLength - 1
  11348. var mul = 1
  11349. this[offset + i] = value & 0xFF
  11350. while (--i >= 0 && (mul *= 0x100)) {
  11351. this[offset + i] = (value / mul) & 0xFF
  11352. }
  11353. return offset + byteLength
  11354. }
  11355. Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
  11356. value = +value
  11357. offset = offset | 0
  11358. if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
  11359. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  11360. this[offset] = (value & 0xff)
  11361. return offset + 1
  11362. }
  11363. function objectWriteUInt16 (buf, value, offset, littleEndian) {
  11364. if (value < 0) value = 0xffff + value + 1
  11365. for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
  11366. buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
  11367. (littleEndian ? i : 1 - i) * 8
  11368. }
  11369. }
  11370. Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
  11371. value = +value
  11372. offset = offset | 0
  11373. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  11374. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11375. this[offset] = (value & 0xff)
  11376. this[offset + 1] = (value >>> 8)
  11377. } else {
  11378. objectWriteUInt16(this, value, offset, true)
  11379. }
  11380. return offset + 2
  11381. }
  11382. Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
  11383. value = +value
  11384. offset = offset | 0
  11385. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  11386. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11387. this[offset] = (value >>> 8)
  11388. this[offset + 1] = (value & 0xff)
  11389. } else {
  11390. objectWriteUInt16(this, value, offset, false)
  11391. }
  11392. return offset + 2
  11393. }
  11394. function objectWriteUInt32 (buf, value, offset, littleEndian) {
  11395. if (value < 0) value = 0xffffffff + value + 1
  11396. for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
  11397. buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
  11398. }
  11399. }
  11400. Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
  11401. value = +value
  11402. offset = offset | 0
  11403. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  11404. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11405. this[offset + 3] = (value >>> 24)
  11406. this[offset + 2] = (value >>> 16)
  11407. this[offset + 1] = (value >>> 8)
  11408. this[offset] = (value & 0xff)
  11409. } else {
  11410. objectWriteUInt32(this, value, offset, true)
  11411. }
  11412. return offset + 4
  11413. }
  11414. Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
  11415. value = +value
  11416. offset = offset | 0
  11417. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  11418. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11419. this[offset] = (value >>> 24)
  11420. this[offset + 1] = (value >>> 16)
  11421. this[offset + 2] = (value >>> 8)
  11422. this[offset + 3] = (value & 0xff)
  11423. } else {
  11424. objectWriteUInt32(this, value, offset, false)
  11425. }
  11426. return offset + 4
  11427. }
  11428. Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
  11429. value = +value
  11430. offset = offset | 0
  11431. if (!noAssert) {
  11432. var limit = Math.pow(2, 8 * byteLength - 1)
  11433. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  11434. }
  11435. var i = 0
  11436. var mul = 1
  11437. var sub = 0
  11438. this[offset] = value & 0xFF
  11439. while (++i < byteLength && (mul *= 0x100)) {
  11440. if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
  11441. sub = 1
  11442. }
  11443. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  11444. }
  11445. return offset + byteLength
  11446. }
  11447. Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
  11448. value = +value
  11449. offset = offset | 0
  11450. if (!noAssert) {
  11451. var limit = Math.pow(2, 8 * byteLength - 1)
  11452. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  11453. }
  11454. var i = byteLength - 1
  11455. var mul = 1
  11456. var sub = 0
  11457. this[offset + i] = value & 0xFF
  11458. while (--i >= 0 && (mul *= 0x100)) {
  11459. if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
  11460. sub = 1
  11461. }
  11462. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  11463. }
  11464. return offset + byteLength
  11465. }
  11466. Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
  11467. value = +value
  11468. offset = offset | 0
  11469. if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
  11470. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  11471. if (value < 0) value = 0xff + value + 1
  11472. this[offset] = (value & 0xff)
  11473. return offset + 1
  11474. }
  11475. Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
  11476. value = +value
  11477. offset = offset | 0
  11478. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  11479. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11480. this[offset] = (value & 0xff)
  11481. this[offset + 1] = (value >>> 8)
  11482. } else {
  11483. objectWriteUInt16(this, value, offset, true)
  11484. }
  11485. return offset + 2
  11486. }
  11487. Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
  11488. value = +value
  11489. offset = offset | 0
  11490. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  11491. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11492. this[offset] = (value >>> 8)
  11493. this[offset + 1] = (value & 0xff)
  11494. } else {
  11495. objectWriteUInt16(this, value, offset, false)
  11496. }
  11497. return offset + 2
  11498. }
  11499. Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
  11500. value = +value
  11501. offset = offset | 0
  11502. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  11503. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11504. this[offset] = (value & 0xff)
  11505. this[offset + 1] = (value >>> 8)
  11506. this[offset + 2] = (value >>> 16)
  11507. this[offset + 3] = (value >>> 24)
  11508. } else {
  11509. objectWriteUInt32(this, value, offset, true)
  11510. }
  11511. return offset + 4
  11512. }
  11513. Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
  11514. value = +value
  11515. offset = offset | 0
  11516. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  11517. if (value < 0) value = 0xffffffff + value + 1
  11518. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11519. this[offset] = (value >>> 24)
  11520. this[offset + 1] = (value >>> 16)
  11521. this[offset + 2] = (value >>> 8)
  11522. this[offset + 3] = (value & 0xff)
  11523. } else {
  11524. objectWriteUInt32(this, value, offset, false)
  11525. }
  11526. return offset + 4
  11527. }
  11528. function checkIEEE754 (buf, value, offset, ext, max, min) {
  11529. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  11530. if (offset < 0) throw new RangeError('Index out of range')
  11531. }
  11532. function writeFloat (buf, value, offset, littleEndian, noAssert) {
  11533. if (!noAssert) {
  11534. checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
  11535. }
  11536. ieee754.write(buf, value, offset, littleEndian, 23, 4)
  11537. return offset + 4
  11538. }
  11539. Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
  11540. return writeFloat(this, value, offset, true, noAssert)
  11541. }
  11542. Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
  11543. return writeFloat(this, value, offset, false, noAssert)
  11544. }
  11545. function writeDouble (buf, value, offset, littleEndian, noAssert) {
  11546. if (!noAssert) {
  11547. checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
  11548. }
  11549. ieee754.write(buf, value, offset, littleEndian, 52, 8)
  11550. return offset + 8
  11551. }
  11552. Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
  11553. return writeDouble(this, value, offset, true, noAssert)
  11554. }
  11555. Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
  11556. return writeDouble(this, value, offset, false, noAssert)
  11557. }
  11558. // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
  11559. Buffer.prototype.copy = function copy (target, targetStart, start, end) {
  11560. if (!start) start = 0
  11561. if (!end && end !== 0) end = this.length
  11562. if (targetStart >= target.length) targetStart = target.length
  11563. if (!targetStart) targetStart = 0
  11564. if (end > 0 && end < start) end = start
  11565. // Copy 0 bytes; we're done
  11566. if (end === start) return 0
  11567. if (target.length === 0 || this.length === 0) return 0
  11568. // Fatal error conditions
  11569. if (targetStart < 0) {
  11570. throw new RangeError('targetStart out of bounds')
  11571. }
  11572. if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
  11573. if (end < 0) throw new RangeError('sourceEnd out of bounds')
  11574. // Are we oob?
  11575. if (end > this.length) end = this.length
  11576. if (target.length - targetStart < end - start) {
  11577. end = target.length - targetStart + start
  11578. }
  11579. var len = end - start
  11580. var i
  11581. if (this === target && start < targetStart && targetStart < end) {
  11582. // descending copy from end
  11583. for (i = len - 1; i >= 0; --i) {
  11584. target[i + targetStart] = this[i + start]
  11585. }
  11586. } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
  11587. // ascending copy from start
  11588. for (i = 0; i < len; ++i) {
  11589. target[i + targetStart] = this[i + start]
  11590. }
  11591. } else {
  11592. Uint8Array.prototype.set.call(
  11593. target,
  11594. this.subarray(start, start + len),
  11595. targetStart
  11596. )
  11597. }
  11598. return len
  11599. }
  11600. // Usage:
  11601. // buffer.fill(number[, offset[, end]])
  11602. // buffer.fill(buffer[, offset[, end]])
  11603. // buffer.fill(string[, offset[, end]][, encoding])
  11604. Buffer.prototype.fill = function fill (val, start, end, encoding) {
  11605. // Handle string cases:
  11606. if (typeof val === 'string') {
  11607. if (typeof start === 'string') {
  11608. encoding = start
  11609. start = 0
  11610. end = this.length
  11611. } else if (typeof end === 'string') {
  11612. encoding = end
  11613. end = this.length
  11614. }
  11615. if (val.length === 1) {
  11616. var code = val.charCodeAt(0)
  11617. if (code < 256) {
  11618. val = code
  11619. }
  11620. }
  11621. if (encoding !== undefined && typeof encoding !== 'string') {
  11622. throw new TypeError('encoding must be a string')
  11623. }
  11624. if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
  11625. throw new TypeError('Unknown encoding: ' + encoding)
  11626. }
  11627. } else if (typeof val === 'number') {
  11628. val = val & 255
  11629. }
  11630. // Invalid ranges are not set to a default, so can range check early.
  11631. if (start < 0 || this.length < start || this.length < end) {
  11632. throw new RangeError('Out of range index')
  11633. }
  11634. if (end <= start) {
  11635. return this
  11636. }
  11637. start = start >>> 0
  11638. end = end === undefined ? this.length : end >>> 0
  11639. if (!val) val = 0
  11640. var i
  11641. if (typeof val === 'number') {
  11642. for (i = start; i < end; ++i) {
  11643. this[i] = val
  11644. }
  11645. } else {
  11646. var bytes = Buffer.isBuffer(val)
  11647. ? val
  11648. : utf8ToBytes(new Buffer(val, encoding).toString())
  11649. var len = bytes.length
  11650. for (i = 0; i < end - start; ++i) {
  11651. this[i + start] = bytes[i % len]
  11652. }
  11653. }
  11654. return this
  11655. }
  11656. // HELPER FUNCTIONS
  11657. // ================
  11658. var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
  11659. function base64clean (str) {
  11660. // Node strips out invalid characters like \n and \t from the string, base64-js does not
  11661. str = stringtrim(str).replace(INVALID_BASE64_RE, '')
  11662. // Node converts strings with length < 2 to ''
  11663. if (str.length < 2) return ''
  11664. // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
  11665. while (str.length % 4 !== 0) {
  11666. str = str + '='
  11667. }
  11668. return str
  11669. }
  11670. function stringtrim (str) {
  11671. if (str.trim) return str.trim()
  11672. return str.replace(/^\s+|\s+$/g, '')
  11673. }
  11674. function toHex (n) {
  11675. if (n < 16) return '0' + n.toString(16)
  11676. return n.toString(16)
  11677. }
  11678. function utf8ToBytes (string, units) {
  11679. units = units || Infinity
  11680. var codePoint
  11681. var length = string.length
  11682. var leadSurrogate = null
  11683. var bytes = []
  11684. for (var i = 0; i < length; ++i) {
  11685. codePoint = string.charCodeAt(i)
  11686. // is surrogate component
  11687. if (codePoint > 0xD7FF && codePoint < 0xE000) {
  11688. // last char was a lead
  11689. if (!leadSurrogate) {
  11690. // no lead yet
  11691. if (codePoint > 0xDBFF) {
  11692. // unexpected trail
  11693. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  11694. continue
  11695. } else if (i + 1 === length) {
  11696. // unpaired lead
  11697. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  11698. continue
  11699. }
  11700. // valid lead
  11701. leadSurrogate = codePoint
  11702. continue
  11703. }
  11704. // 2 leads in a row
  11705. if (codePoint < 0xDC00) {
  11706. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  11707. leadSurrogate = codePoint
  11708. continue
  11709. }
  11710. // valid surrogate pair
  11711. codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
  11712. } else if (leadSurrogate) {
  11713. // valid bmp char, but last char was a lead
  11714. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  11715. }
  11716. leadSurrogate = null
  11717. // encode utf8
  11718. if (codePoint < 0x80) {
  11719. if ((units -= 1) < 0) break
  11720. bytes.push(codePoint)
  11721. } else if (codePoint < 0x800) {
  11722. if ((units -= 2) < 0) break
  11723. bytes.push(
  11724. codePoint >> 0x6 | 0xC0,
  11725. codePoint & 0x3F | 0x80
  11726. )
  11727. } else if (codePoint < 0x10000) {
  11728. if ((units -= 3) < 0) break
  11729. bytes.push(
  11730. codePoint >> 0xC | 0xE0,
  11731. codePoint >> 0x6 & 0x3F | 0x80,
  11732. codePoint & 0x3F | 0x80
  11733. )
  11734. } else if (codePoint < 0x110000) {
  11735. if ((units -= 4) < 0) break
  11736. bytes.push(
  11737. codePoint >> 0x12 | 0xF0,
  11738. codePoint >> 0xC & 0x3F | 0x80,
  11739. codePoint >> 0x6 & 0x3F | 0x80,
  11740. codePoint & 0x3F | 0x80
  11741. )
  11742. } else {
  11743. throw new Error('Invalid code point')
  11744. }
  11745. }
  11746. return bytes
  11747. }
  11748. function asciiToBytes (str) {
  11749. var byteArray = []
  11750. for (var i = 0; i < str.length; ++i) {
  11751. // Node's code seems to be doing this and not & 0x7F..
  11752. byteArray.push(str.charCodeAt(i) & 0xFF)
  11753. }
  11754. return byteArray
  11755. }
  11756. function utf16leToBytes (str, units) {
  11757. var c, hi, lo
  11758. var byteArray = []
  11759. for (var i = 0; i < str.length; ++i) {
  11760. if ((units -= 2) < 0) break
  11761. c = str.charCodeAt(i)
  11762. hi = c >> 8
  11763. lo = c % 256
  11764. byteArray.push(lo)
  11765. byteArray.push(hi)
  11766. }
  11767. return byteArray
  11768. }
  11769. function base64ToBytes (str) {
  11770. return base64.toByteArray(base64clean(str))
  11771. }
  11772. function blitBuffer (src, dst, offset, length) {
  11773. for (var i = 0; i < length; ++i) {
  11774. if ((i + offset >= dst.length) || (i >= src.length)) break
  11775. dst[i + offset] = src[i]
  11776. }
  11777. return i
  11778. }
  11779. function isnan (val) {
  11780. return val !== val // eslint-disable-line no-self-compare
  11781. }
  11782. /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
  11783. /***/ }),
  11784. /* 340 */
  11785. /***/ (function(module, exports) {
  11786. 'use strict'
  11787. exports.byteLength = byteLength
  11788. exports.toByteArray = toByteArray
  11789. exports.fromByteArray = fromByteArray
  11790. var lookup = []
  11791. var revLookup = []
  11792. var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
  11793. var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
  11794. for (var i = 0, len = code.length; i < len; ++i) {
  11795. lookup[i] = code[i]
  11796. revLookup[code.charCodeAt(i)] = i
  11797. }
  11798. // Support decoding URL-safe base64 strings, as Node.js does.
  11799. // See: https://en.wikipedia.org/wiki/Base64#URL_applications
  11800. revLookup['-'.charCodeAt(0)] = 62
  11801. revLookup['_'.charCodeAt(0)] = 63
  11802. function getLens (b64) {
  11803. var len = b64.length
  11804. if (len % 4 > 0) {
  11805. throw new Error('Invalid string. Length must be a multiple of 4')
  11806. }
  11807. // Trim off extra bytes after placeholder bytes are found
  11808. // See: https://github.com/beatgammit/base64-js/issues/42
  11809. var validLen = b64.indexOf('=')
  11810. if (validLen === -1) validLen = len
  11811. var placeHoldersLen = validLen === len
  11812. ? 0
  11813. : 4 - (validLen % 4)
  11814. return [validLen, placeHoldersLen]
  11815. }
  11816. // base64 is 4/3 + up to two characters of the original data
  11817. function byteLength (b64) {
  11818. var lens = getLens(b64)
  11819. var validLen = lens[0]
  11820. var placeHoldersLen = lens[1]
  11821. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  11822. }
  11823. function _byteLength (b64, validLen, placeHoldersLen) {
  11824. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  11825. }
  11826. function toByteArray (b64) {
  11827. var tmp
  11828. var lens = getLens(b64)
  11829. var validLen = lens[0]
  11830. var placeHoldersLen = lens[1]
  11831. var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
  11832. var curByte = 0
  11833. // if there are placeholders, only get up to the last complete 4 chars
  11834. var len = placeHoldersLen > 0
  11835. ? validLen - 4
  11836. : validLen
  11837. var i
  11838. for (i = 0; i < len; i += 4) {
  11839. tmp =
  11840. (revLookup[b64.charCodeAt(i)] << 18) |
  11841. (revLookup[b64.charCodeAt(i + 1)] << 12) |
  11842. (revLookup[b64.charCodeAt(i + 2)] << 6) |
  11843. revLookup[b64.charCodeAt(i + 3)]
  11844. arr[curByte++] = (tmp >> 16) & 0xFF
  11845. arr[curByte++] = (tmp >> 8) & 0xFF
  11846. arr[curByte++] = tmp & 0xFF
  11847. }
  11848. if (placeHoldersLen === 2) {
  11849. tmp =
  11850. (revLookup[b64.charCodeAt(i)] << 2) |
  11851. (revLookup[b64.charCodeAt(i + 1)] >> 4)
  11852. arr[curByte++] = tmp & 0xFF
  11853. }
  11854. if (placeHoldersLen === 1) {
  11855. tmp =
  11856. (revLookup[b64.charCodeAt(i)] << 10) |
  11857. (revLookup[b64.charCodeAt(i + 1)] << 4) |
  11858. (revLookup[b64.charCodeAt(i + 2)] >> 2)
  11859. arr[curByte++] = (tmp >> 8) & 0xFF
  11860. arr[curByte++] = tmp & 0xFF
  11861. }
  11862. return arr
  11863. }
  11864. function tripletToBase64 (num) {
  11865. return lookup[num >> 18 & 0x3F] +
  11866. lookup[num >> 12 & 0x3F] +
  11867. lookup[num >> 6 & 0x3F] +
  11868. lookup[num & 0x3F]
  11869. }
  11870. function encodeChunk (uint8, start, end) {
  11871. var tmp
  11872. var output = []
  11873. for (var i = start; i < end; i += 3) {
  11874. tmp =
  11875. ((uint8[i] << 16) & 0xFF0000) +
  11876. ((uint8[i + 1] << 8) & 0xFF00) +
  11877. (uint8[i + 2] & 0xFF)
  11878. output.push(tripletToBase64(tmp))
  11879. }
  11880. return output.join('')
  11881. }
  11882. function fromByteArray (uint8) {
  11883. var tmp
  11884. var len = uint8.length
  11885. var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
  11886. var parts = []
  11887. var maxChunkLength = 16383 // must be multiple of 3
  11888. // go through the array every three bytes, we'll deal with trailing stuff later
  11889. for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
  11890. parts.push(encodeChunk(
  11891. uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)
  11892. ))
  11893. }
  11894. // pad the end with zeros, but make sure to not forget the extra bytes
  11895. if (extraBytes === 1) {
  11896. tmp = uint8[len - 1]
  11897. parts.push(
  11898. lookup[tmp >> 2] +
  11899. lookup[(tmp << 4) & 0x3F] +
  11900. '=='
  11901. )
  11902. } else if (extraBytes === 2) {
  11903. tmp = (uint8[len - 2] << 8) + uint8[len - 1]
  11904. parts.push(
  11905. lookup[tmp >> 10] +
  11906. lookup[(tmp >> 4) & 0x3F] +
  11907. lookup[(tmp << 2) & 0x3F] +
  11908. '='
  11909. )
  11910. }
  11911. return parts.join('')
  11912. }
  11913. /***/ }),
  11914. /* 341 */
  11915. /***/ (function(module, exports) {
  11916. exports.read = function (buffer, offset, isLE, mLen, nBytes) {
  11917. var e, m
  11918. var eLen = (nBytes * 8) - mLen - 1
  11919. var eMax = (1 << eLen) - 1
  11920. var eBias = eMax >> 1
  11921. var nBits = -7
  11922. var i = isLE ? (nBytes - 1) : 0
  11923. var d = isLE ? -1 : 1
  11924. var s = buffer[offset + i]
  11925. i += d
  11926. e = s & ((1 << (-nBits)) - 1)
  11927. s >>= (-nBits)
  11928. nBits += eLen
  11929. for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  11930. m = e & ((1 << (-nBits)) - 1)
  11931. e >>= (-nBits)
  11932. nBits += mLen
  11933. for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  11934. if (e === 0) {
  11935. e = 1 - eBias
  11936. } else if (e === eMax) {
  11937. return m ? NaN : ((s ? -1 : 1) * Infinity)
  11938. } else {
  11939. m = m + Math.pow(2, mLen)
  11940. e = e - eBias
  11941. }
  11942. return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
  11943. }
  11944. exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
  11945. var e, m, c
  11946. var eLen = (nBytes * 8) - mLen - 1
  11947. var eMax = (1 << eLen) - 1
  11948. var eBias = eMax >> 1
  11949. var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
  11950. var i = isLE ? 0 : (nBytes - 1)
  11951. var d = isLE ? 1 : -1
  11952. var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
  11953. value = Math.abs(value)
  11954. if (isNaN(value) || value === Infinity) {
  11955. m = isNaN(value) ? 1 : 0
  11956. e = eMax
  11957. } else {
  11958. e = Math.floor(Math.log(value) / Math.LN2)
  11959. if (value * (c = Math.pow(2, -e)) < 1) {
  11960. e--
  11961. c *= 2
  11962. }
  11963. if (e + eBias >= 1) {
  11964. value += rt / c
  11965. } else {
  11966. value += rt * Math.pow(2, 1 - eBias)
  11967. }
  11968. if (value * c >= 2) {
  11969. e++
  11970. c /= 2
  11971. }
  11972. if (e + eBias >= eMax) {
  11973. m = 0
  11974. e = eMax
  11975. } else if (e + eBias >= 1) {
  11976. m = ((value * c) - 1) * Math.pow(2, mLen)
  11977. e = e + eBias
  11978. } else {
  11979. m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
  11980. e = 0
  11981. }
  11982. }
  11983. for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
  11984. e = (e << mLen) | m
  11985. eLen += mLen
  11986. for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
  11987. buffer[offset + i - d] |= s * 128
  11988. }
  11989. /***/ }),
  11990. /* 342 */
  11991. /***/ (function(module, exports) {
  11992. var toString = {}.toString;
  11993. module.exports = Array.isArray || function (arr) {
  11994. return toString.call(arr) == '[object Array]';
  11995. };
  11996. /***/ }),
  11997. /* 343 */
  11998. /***/ (function(module, exports) {
  11999. // shim for using process in browser
  12000. var process = module.exports = {};
  12001. // cached from whatever global is present so that test runners that stub it
  12002. // don't break things. But we need to wrap it in a try catch in case it is
  12003. // wrapped in strict mode code which doesn't define any globals. It's inside a
  12004. // function because try/catches deoptimize in certain engines.
  12005. var cachedSetTimeout;
  12006. var cachedClearTimeout;
  12007. function defaultSetTimout() {
  12008. throw new Error('setTimeout has not been defined');
  12009. }
  12010. function defaultClearTimeout () {
  12011. throw new Error('clearTimeout has not been defined');
  12012. }
  12013. (function () {
  12014. try {
  12015. if (typeof setTimeout === 'function') {
  12016. cachedSetTimeout = setTimeout;
  12017. } else {
  12018. cachedSetTimeout = defaultSetTimout;
  12019. }
  12020. } catch (e) {
  12021. cachedSetTimeout = defaultSetTimout;
  12022. }
  12023. try {
  12024. if (typeof clearTimeout === 'function') {
  12025. cachedClearTimeout = clearTimeout;
  12026. } else {
  12027. cachedClearTimeout = defaultClearTimeout;
  12028. }
  12029. } catch (e) {
  12030. cachedClearTimeout = defaultClearTimeout;
  12031. }
  12032. } ())
  12033. function runTimeout(fun) {
  12034. if (cachedSetTimeout === setTimeout) {
  12035. //normal enviroments in sane situations
  12036. return setTimeout(fun, 0);
  12037. }
  12038. // if setTimeout wasn't available but was latter defined
  12039. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  12040. cachedSetTimeout = setTimeout;
  12041. return setTimeout(fun, 0);
  12042. }
  12043. try {
  12044. // when when somebody has screwed with setTimeout but no I.E. maddness
  12045. return cachedSetTimeout(fun, 0);
  12046. } catch(e){
  12047. try {
  12048. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  12049. return cachedSetTimeout.call(null, fun, 0);
  12050. } catch(e){
  12051. // 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
  12052. return cachedSetTimeout.call(this, fun, 0);
  12053. }
  12054. }
  12055. }
  12056. function runClearTimeout(marker) {
  12057. if (cachedClearTimeout === clearTimeout) {
  12058. //normal enviroments in sane situations
  12059. return clearTimeout(marker);
  12060. }
  12061. // if clearTimeout wasn't available but was latter defined
  12062. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  12063. cachedClearTimeout = clearTimeout;
  12064. return clearTimeout(marker);
  12065. }
  12066. try {
  12067. // when when somebody has screwed with setTimeout but no I.E. maddness
  12068. return cachedClearTimeout(marker);
  12069. } catch (e){
  12070. try {
  12071. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  12072. return cachedClearTimeout.call(null, marker);
  12073. } catch (e){
  12074. // 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.
  12075. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  12076. return cachedClearTimeout.call(this, marker);
  12077. }
  12078. }
  12079. }
  12080. var queue = [];
  12081. var draining = false;
  12082. var currentQueue;
  12083. var queueIndex = -1;
  12084. function cleanUpNextTick() {
  12085. if (!draining || !currentQueue) {
  12086. return;
  12087. }
  12088. draining = false;
  12089. if (currentQueue.length) {
  12090. queue = currentQueue.concat(queue);
  12091. } else {
  12092. queueIndex = -1;
  12093. }
  12094. if (queue.length) {
  12095. drainQueue();
  12096. }
  12097. }
  12098. function drainQueue() {
  12099. if (draining) {
  12100. return;
  12101. }
  12102. var timeout = runTimeout(cleanUpNextTick);
  12103. draining = true;
  12104. var len = queue.length;
  12105. while(len) {
  12106. currentQueue = queue;
  12107. queue = [];
  12108. while (++queueIndex < len) {
  12109. if (currentQueue) {
  12110. currentQueue[queueIndex].run();
  12111. }
  12112. }
  12113. queueIndex = -1;
  12114. len = queue.length;
  12115. }
  12116. currentQueue = null;
  12117. draining = false;
  12118. runClearTimeout(timeout);
  12119. }
  12120. process.nextTick = function (fun) {
  12121. var args = new Array(arguments.length - 1);
  12122. if (arguments.length > 1) {
  12123. for (var i = 1; i < arguments.length; i++) {
  12124. args[i - 1] = arguments[i];
  12125. }
  12126. }
  12127. queue.push(new Item(fun, args));
  12128. if (queue.length === 1 && !draining) {
  12129. runTimeout(drainQueue);
  12130. }
  12131. };
  12132. // v8 likes predictible objects
  12133. function Item(fun, array) {
  12134. this.fun = fun;
  12135. this.array = array;
  12136. }
  12137. Item.prototype.run = function () {
  12138. this.fun.apply(null, this.array);
  12139. };
  12140. process.title = 'browser';
  12141. process.browser = true;
  12142. process.env = {};
  12143. process.argv = [];
  12144. process.version = ''; // empty string to avoid regexp issues
  12145. process.versions = {};
  12146. function noop() {}
  12147. process.on = noop;
  12148. process.addListener = noop;
  12149. process.once = noop;
  12150. process.off = noop;
  12151. process.removeListener = noop;
  12152. process.removeAllListeners = noop;
  12153. process.emit = noop;
  12154. process.prependListener = noop;
  12155. process.prependOnceListener = noop;
  12156. process.listeners = function (name) { return [] }
  12157. process.binding = function (name) {
  12158. throw new Error('process.binding is not supported');
  12159. };
  12160. process.cwd = function () { return '/' };
  12161. process.chdir = function (dir) {
  12162. throw new Error('process.chdir is not supported');
  12163. };
  12164. process.umask = function() { return 0; };
  12165. /***/ }),
  12166. /* 344 */
  12167. /***/ (function(module, exports, __webpack_require__) {
  12168. /* WEBPACK VAR INJECTION */(function(Buffer) {'use strict';
  12169. /**
  12170. * Normalizes our expected stringified form of a function across versions of node
  12171. * @param {Function} fn The function to stringify
  12172. */
  12173. function normalizedFunctionString(fn) {
  12174. return fn.toString().replace(/function *\(/, 'function (');
  12175. }
  12176. function newBuffer(item, encoding) {
  12177. return new Buffer(item, encoding);
  12178. }
  12179. function allocBuffer() {
  12180. return Buffer.alloc.apply(Buffer, arguments);
  12181. }
  12182. function toBuffer() {
  12183. return Buffer.from.apply(Buffer, arguments);
  12184. }
  12185. module.exports = {
  12186. normalizedFunctionString: normalizedFunctionString,
  12187. allocBuffer: typeof Buffer.alloc === 'function' ? allocBuffer : newBuffer,
  12188. toBuffer: typeof Buffer.from === 'function' ? toBuffer : newBuffer
  12189. };
  12190. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(339).Buffer))
  12191. /***/ }),
  12192. /* 345 */
  12193. /***/ (function(module, exports, __webpack_require__) {
  12194. /* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.
  12195. //
  12196. // Permission is hereby granted, free of charge, to any person obtaining a
  12197. // copy of this software and associated documentation files (the
  12198. // "Software"), to deal in the Software without restriction, including
  12199. // without limitation the rights to use, copy, modify, merge, publish,
  12200. // distribute, sublicense, and/or sell copies of the Software, and to permit
  12201. // persons to whom the Software is furnished to do so, subject to the
  12202. // following conditions:
  12203. //
  12204. // The above copyright notice and this permission notice shall be included
  12205. // in all copies or substantial portions of the Software.
  12206. //
  12207. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  12208. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  12209. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  12210. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  12211. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  12212. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  12213. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  12214. var formatRegExp = /%[sdj%]/g;
  12215. exports.format = function(f) {
  12216. if (!isString(f)) {
  12217. var objects = [];
  12218. for (var i = 0; i < arguments.length; i++) {
  12219. objects.push(inspect(arguments[i]));
  12220. }
  12221. return objects.join(' ');
  12222. }
  12223. var i = 1;
  12224. var args = arguments;
  12225. var len = args.length;
  12226. var str = String(f).replace(formatRegExp, function(x) {
  12227. if (x === '%%') return '%';
  12228. if (i >= len) return x;
  12229. switch (x) {
  12230. case '%s': return String(args[i++]);
  12231. case '%d': return Number(args[i++]);
  12232. case '%j':
  12233. try {
  12234. return JSON.stringify(args[i++]);
  12235. } catch (_) {
  12236. return '[Circular]';
  12237. }
  12238. default:
  12239. return x;
  12240. }
  12241. });
  12242. for (var x = args[i]; i < len; x = args[++i]) {
  12243. if (isNull(x) || !isObject(x)) {
  12244. str += ' ' + x;
  12245. } else {
  12246. str += ' ' + inspect(x);
  12247. }
  12248. }
  12249. return str;
  12250. };
  12251. // Mark that a method should not be used.
  12252. // Returns a modified function which warns once by default.
  12253. // If --no-deprecation is set, then it is a no-op.
  12254. exports.deprecate = function(fn, msg) {
  12255. // Allow for deprecating things in the process of starting up.
  12256. if (isUndefined(global.process)) {
  12257. return function() {
  12258. return exports.deprecate(fn, msg).apply(this, arguments);
  12259. };
  12260. }
  12261. if (process.noDeprecation === true) {
  12262. return fn;
  12263. }
  12264. var warned = false;
  12265. function deprecated() {
  12266. if (!warned) {
  12267. if (process.throwDeprecation) {
  12268. throw new Error(msg);
  12269. } else if (process.traceDeprecation) {
  12270. console.trace(msg);
  12271. } else {
  12272. console.error(msg);
  12273. }
  12274. warned = true;
  12275. }
  12276. return fn.apply(this, arguments);
  12277. }
  12278. return deprecated;
  12279. };
  12280. var debugs = {};
  12281. var debugEnviron;
  12282. exports.debuglog = function(set) {
  12283. if (isUndefined(debugEnviron))
  12284. debugEnviron = process.env.NODE_DEBUG || '';
  12285. set = set.toUpperCase();
  12286. if (!debugs[set]) {
  12287. if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
  12288. var pid = process.pid;
  12289. debugs[set] = function() {
  12290. var msg = exports.format.apply(exports, arguments);
  12291. console.error('%s %d: %s', set, pid, msg);
  12292. };
  12293. } else {
  12294. debugs[set] = function() {};
  12295. }
  12296. }
  12297. return debugs[set];
  12298. };
  12299. /**
  12300. * Echos the value of a value. Trys to print the value out
  12301. * in the best way possible given the different types.
  12302. *
  12303. * @param {Object} obj The object to print out.
  12304. * @param {Object} opts Optional options object that alters the output.
  12305. */
  12306. /* legacy: obj, showHidden, depth, colors*/
  12307. function inspect(obj, opts) {
  12308. // default options
  12309. var ctx = {
  12310. seen: [],
  12311. stylize: stylizeNoColor
  12312. };
  12313. // legacy...
  12314. if (arguments.length >= 3) ctx.depth = arguments[2];
  12315. if (arguments.length >= 4) ctx.colors = arguments[3];
  12316. if (isBoolean(opts)) {
  12317. // legacy...
  12318. ctx.showHidden = opts;
  12319. } else if (opts) {
  12320. // got an "options" object
  12321. exports._extend(ctx, opts);
  12322. }
  12323. // set default options
  12324. if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
  12325. if (isUndefined(ctx.depth)) ctx.depth = 2;
  12326. if (isUndefined(ctx.colors)) ctx.colors = false;
  12327. if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
  12328. if (ctx.colors) ctx.stylize = stylizeWithColor;
  12329. return formatValue(ctx, obj, ctx.depth);
  12330. }
  12331. exports.inspect = inspect;
  12332. // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
  12333. inspect.colors = {
  12334. 'bold' : [1, 22],
  12335. 'italic' : [3, 23],
  12336. 'underline' : [4, 24],
  12337. 'inverse' : [7, 27],
  12338. 'white' : [37, 39],
  12339. 'grey' : [90, 39],
  12340. 'black' : [30, 39],
  12341. 'blue' : [34, 39],
  12342. 'cyan' : [36, 39],
  12343. 'green' : [32, 39],
  12344. 'magenta' : [35, 39],
  12345. 'red' : [31, 39],
  12346. 'yellow' : [33, 39]
  12347. };
  12348. // Don't use 'blue' not visible on cmd.exe
  12349. inspect.styles = {
  12350. 'special': 'cyan',
  12351. 'number': 'yellow',
  12352. 'boolean': 'yellow',
  12353. 'undefined': 'grey',
  12354. 'null': 'bold',
  12355. 'string': 'green',
  12356. 'date': 'magenta',
  12357. // "name": intentionally not styling
  12358. 'regexp': 'red'
  12359. };
  12360. function stylizeWithColor(str, styleType) {
  12361. var style = inspect.styles[styleType];
  12362. if (style) {
  12363. return '\u001b[' + inspect.colors[style][0] + 'm' + str +
  12364. '\u001b[' + inspect.colors[style][1] + 'm';
  12365. } else {
  12366. return str;
  12367. }
  12368. }
  12369. function stylizeNoColor(str, styleType) {
  12370. return str;
  12371. }
  12372. function arrayToHash(array) {
  12373. var hash = {};
  12374. array.forEach(function(val, idx) {
  12375. hash[val] = true;
  12376. });
  12377. return hash;
  12378. }
  12379. function formatValue(ctx, value, recurseTimes) {
  12380. // Provide a hook for user-specified inspect functions.
  12381. // Check that value is an object with an inspect function on it
  12382. if (ctx.customInspect &&
  12383. value &&
  12384. isFunction(value.inspect) &&
  12385. // Filter out the util module, it's inspect function is special
  12386. value.inspect !== exports.inspect &&
  12387. // Also filter out any prototype objects using the circular check.
  12388. !(value.constructor && value.constructor.prototype === value)) {
  12389. var ret = value.inspect(recurseTimes, ctx);
  12390. if (!isString(ret)) {
  12391. ret = formatValue(ctx, ret, recurseTimes);
  12392. }
  12393. return ret;
  12394. }
  12395. // Primitive types cannot have properties
  12396. var primitive = formatPrimitive(ctx, value);
  12397. if (primitive) {
  12398. return primitive;
  12399. }
  12400. // Look up the keys of the object.
  12401. var keys = Object.keys(value);
  12402. var visibleKeys = arrayToHash(keys);
  12403. if (ctx.showHidden) {
  12404. keys = Object.getOwnPropertyNames(value);
  12405. }
  12406. // IE doesn't make error fields non-enumerable
  12407. // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
  12408. if (isError(value)
  12409. && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
  12410. return formatError(value);
  12411. }
  12412. // Some type of object without properties can be shortcutted.
  12413. if (keys.length === 0) {
  12414. if (isFunction(value)) {
  12415. var name = value.name ? ': ' + value.name : '';
  12416. return ctx.stylize('[Function' + name + ']', 'special');
  12417. }
  12418. if (isRegExp(value)) {
  12419. return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
  12420. }
  12421. if (isDate(value)) {
  12422. return ctx.stylize(Date.prototype.toString.call(value), 'date');
  12423. }
  12424. if (isError(value)) {
  12425. return formatError(value);
  12426. }
  12427. }
  12428. var base = '', array = false, braces = ['{', '}'];
  12429. // Make Array say that they are Array
  12430. if (isArray(value)) {
  12431. array = true;
  12432. braces = ['[', ']'];
  12433. }
  12434. // Make functions say that they are functions
  12435. if (isFunction(value)) {
  12436. var n = value.name ? ': ' + value.name : '';
  12437. base = ' [Function' + n + ']';
  12438. }
  12439. // Make RegExps say that they are RegExps
  12440. if (isRegExp(value)) {
  12441. base = ' ' + RegExp.prototype.toString.call(value);
  12442. }
  12443. // Make dates with properties first say the date
  12444. if (isDate(value)) {
  12445. base = ' ' + Date.prototype.toUTCString.call(value);
  12446. }
  12447. // Make error with message first say the error
  12448. if (isError(value)) {
  12449. base = ' ' + formatError(value);
  12450. }
  12451. if (keys.length === 0 && (!array || value.length == 0)) {
  12452. return braces[0] + base + braces[1];
  12453. }
  12454. if (recurseTimes < 0) {
  12455. if (isRegExp(value)) {
  12456. return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
  12457. } else {
  12458. return ctx.stylize('[Object]', 'special');
  12459. }
  12460. }
  12461. ctx.seen.push(value);
  12462. var output;
  12463. if (array) {
  12464. output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
  12465. } else {
  12466. output = keys.map(function(key) {
  12467. return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
  12468. });
  12469. }
  12470. ctx.seen.pop();
  12471. return reduceToSingleString(output, base, braces);
  12472. }
  12473. function formatPrimitive(ctx, value) {
  12474. if (isUndefined(value))
  12475. return ctx.stylize('undefined', 'undefined');
  12476. if (isString(value)) {
  12477. var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
  12478. .replace(/'/g, "\\'")
  12479. .replace(/\\"/g, '"') + '\'';
  12480. return ctx.stylize(simple, 'string');
  12481. }
  12482. if (isNumber(value))
  12483. return ctx.stylize('' + value, 'number');
  12484. if (isBoolean(value))
  12485. return ctx.stylize('' + value, 'boolean');
  12486. // For some reason typeof null is "object", so special case here.
  12487. if (isNull(value))
  12488. return ctx.stylize('null', 'null');
  12489. }
  12490. function formatError(value) {
  12491. return '[' + Error.prototype.toString.call(value) + ']';
  12492. }
  12493. function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
  12494. var output = [];
  12495. for (var i = 0, l = value.length; i < l; ++i) {
  12496. if (hasOwnProperty(value, String(i))) {
  12497. output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
  12498. String(i), true));
  12499. } else {
  12500. output.push('');
  12501. }
  12502. }
  12503. keys.forEach(function(key) {
  12504. if (!key.match(/^\d+$/)) {
  12505. output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
  12506. key, true));
  12507. }
  12508. });
  12509. return output;
  12510. }
  12511. function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
  12512. var name, str, desc;
  12513. desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
  12514. if (desc.get) {
  12515. if (desc.set) {
  12516. str = ctx.stylize('[Getter/Setter]', 'special');
  12517. } else {
  12518. str = ctx.stylize('[Getter]', 'special');
  12519. }
  12520. } else {
  12521. if (desc.set) {
  12522. str = ctx.stylize('[Setter]', 'special');
  12523. }
  12524. }
  12525. if (!hasOwnProperty(visibleKeys, key)) {
  12526. name = '[' + key + ']';
  12527. }
  12528. if (!str) {
  12529. if (ctx.seen.indexOf(desc.value) < 0) {
  12530. if (isNull(recurseTimes)) {
  12531. str = formatValue(ctx, desc.value, null);
  12532. } else {
  12533. str = formatValue(ctx, desc.value, recurseTimes - 1);
  12534. }
  12535. if (str.indexOf('\n') > -1) {
  12536. if (array) {
  12537. str = str.split('\n').map(function(line) {
  12538. return ' ' + line;
  12539. }).join('\n').substr(2);
  12540. } else {
  12541. str = '\n' + str.split('\n').map(function(line) {
  12542. return ' ' + line;
  12543. }).join('\n');
  12544. }
  12545. }
  12546. } else {
  12547. str = ctx.stylize('[Circular]', 'special');
  12548. }
  12549. }
  12550. if (isUndefined(name)) {
  12551. if (array && key.match(/^\d+$/)) {
  12552. return str;
  12553. }
  12554. name = JSON.stringify('' + key);
  12555. if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
  12556. name = name.substr(1, name.length - 2);
  12557. name = ctx.stylize(name, 'name');
  12558. } else {
  12559. name = name.replace(/'/g, "\\'")
  12560. .replace(/\\"/g, '"')
  12561. .replace(/(^"|"$)/g, "'");
  12562. name = ctx.stylize(name, 'string');
  12563. }
  12564. }
  12565. return name + ': ' + str;
  12566. }
  12567. function reduceToSingleString(output, base, braces) {
  12568. var numLinesEst = 0;
  12569. var length = output.reduce(function(prev, cur) {
  12570. numLinesEst++;
  12571. if (cur.indexOf('\n') >= 0) numLinesEst++;
  12572. return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
  12573. }, 0);
  12574. if (length > 60) {
  12575. return braces[0] +
  12576. (base === '' ? '' : base + '\n ') +
  12577. ' ' +
  12578. output.join(',\n ') +
  12579. ' ' +
  12580. braces[1];
  12581. }
  12582. return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
  12583. }
  12584. // NOTE: These type checking functions intentionally don't use `instanceof`
  12585. // because it is fragile and can be easily faked with `Object.create()`.
  12586. function isArray(ar) {
  12587. return Array.isArray(ar);
  12588. }
  12589. exports.isArray = isArray;
  12590. function isBoolean(arg) {
  12591. return typeof arg === 'boolean';
  12592. }
  12593. exports.isBoolean = isBoolean;
  12594. function isNull(arg) {
  12595. return arg === null;
  12596. }
  12597. exports.isNull = isNull;
  12598. function isNullOrUndefined(arg) {
  12599. return arg == null;
  12600. }
  12601. exports.isNullOrUndefined = isNullOrUndefined;
  12602. function isNumber(arg) {
  12603. return typeof arg === 'number';
  12604. }
  12605. exports.isNumber = isNumber;
  12606. function isString(arg) {
  12607. return typeof arg === 'string';
  12608. }
  12609. exports.isString = isString;
  12610. function isSymbol(arg) {
  12611. return typeof arg === 'symbol';
  12612. }
  12613. exports.isSymbol = isSymbol;
  12614. function isUndefined(arg) {
  12615. return arg === void 0;
  12616. }
  12617. exports.isUndefined = isUndefined;
  12618. function isRegExp(re) {
  12619. return isObject(re) && objectToString(re) === '[object RegExp]';
  12620. }
  12621. exports.isRegExp = isRegExp;
  12622. function isObject(arg) {
  12623. return typeof arg === 'object' && arg !== null;
  12624. }
  12625. exports.isObject = isObject;
  12626. function isDate(d) {
  12627. return isObject(d) && objectToString(d) === '[object Date]';
  12628. }
  12629. exports.isDate = isDate;
  12630. function isError(e) {
  12631. return isObject(e) &&
  12632. (objectToString(e) === '[object Error]' || e instanceof Error);
  12633. }
  12634. exports.isError = isError;
  12635. function isFunction(arg) {
  12636. return typeof arg === 'function';
  12637. }
  12638. exports.isFunction = isFunction;
  12639. function isPrimitive(arg) {
  12640. return arg === null ||
  12641. typeof arg === 'boolean' ||
  12642. typeof arg === 'number' ||
  12643. typeof arg === 'string' ||
  12644. typeof arg === 'symbol' || // ES6 symbol
  12645. typeof arg === 'undefined';
  12646. }
  12647. exports.isPrimitive = isPrimitive;
  12648. exports.isBuffer = __webpack_require__(346);
  12649. function objectToString(o) {
  12650. return Object.prototype.toString.call(o);
  12651. }
  12652. function pad(n) {
  12653. return n < 10 ? '0' + n.toString(10) : n.toString(10);
  12654. }
  12655. var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
  12656. 'Oct', 'Nov', 'Dec'];
  12657. // 26 Feb 16:19:34
  12658. function timestamp() {
  12659. var d = new Date();
  12660. var time = [pad(d.getHours()),
  12661. pad(d.getMinutes()),
  12662. pad(d.getSeconds())].join(':');
  12663. return [d.getDate(), months[d.getMonth()], time].join(' ');
  12664. }
  12665. // log is just a thin wrapper to console.log that prepends a timestamp
  12666. exports.log = function() {
  12667. console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
  12668. };
  12669. /**
  12670. * Inherit the prototype methods from one constructor into another.
  12671. *
  12672. * The Function.prototype.inherits from lang.js rewritten as a standalone
  12673. * function (not on Function.prototype). NOTE: If this file is to be loaded
  12674. * during bootstrapping this function needs to be rewritten using some native
  12675. * functions as prototype setup using normal JavaScript does not work as
  12676. * expected during bootstrapping (see mirror.js in r114903).
  12677. *
  12678. * @param {function} ctor Constructor function which needs to inherit the
  12679. * prototype.
  12680. * @param {function} superCtor Constructor function to inherit prototype from.
  12681. */
  12682. exports.inherits = __webpack_require__(347);
  12683. exports._extend = function(origin, add) {
  12684. // Don't do anything if add isn't an object
  12685. if (!add || !isObject(add)) return origin;
  12686. var keys = Object.keys(add);
  12687. var i = keys.length;
  12688. while (i--) {
  12689. origin[keys[i]] = add[keys[i]];
  12690. }
  12691. return origin;
  12692. };
  12693. function hasOwnProperty(obj, prop) {
  12694. return Object.prototype.hasOwnProperty.call(obj, prop);
  12695. }
  12696. /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(343)))
  12697. /***/ }),
  12698. /* 346 */
  12699. /***/ (function(module, exports) {
  12700. module.exports = function isBuffer(arg) {
  12701. return arg && typeof arg === 'object'
  12702. && typeof arg.copy === 'function'
  12703. && typeof arg.fill === 'function'
  12704. && typeof arg.readUInt8 === 'function';
  12705. }
  12706. /***/ }),
  12707. /* 347 */
  12708. /***/ (function(module, exports) {
  12709. if (typeof Object.create === 'function') {
  12710. // implementation from standard node.js 'util' module
  12711. module.exports = function inherits(ctor, superCtor) {
  12712. ctor.super_ = superCtor
  12713. ctor.prototype = Object.create(superCtor.prototype, {
  12714. constructor: {
  12715. value: ctor,
  12716. enumerable: false,
  12717. writable: true,
  12718. configurable: true
  12719. }
  12720. });
  12721. };
  12722. } else {
  12723. // old school shim for old browsers
  12724. module.exports = function inherits(ctor, superCtor) {
  12725. ctor.super_ = superCtor
  12726. var TempCtor = function () {}
  12727. TempCtor.prototype = superCtor.prototype
  12728. ctor.prototype = new TempCtor()
  12729. ctor.prototype.constructor = ctor
  12730. }
  12731. }
  12732. /***/ }),
  12733. /* 348 */
  12734. /***/ (function(module, exports) {
  12735. /**
  12736. * A class representation of the BSON RegExp type.
  12737. *
  12738. * @class
  12739. * @return {BSONRegExp} A MinKey instance
  12740. */
  12741. function BSONRegExp(pattern, options) {
  12742. if (!(this instanceof BSONRegExp)) return new BSONRegExp();
  12743. // Execute
  12744. this._bsontype = 'BSONRegExp';
  12745. this.pattern = pattern || '';
  12746. this.options = options || '';
  12747. // Validate options
  12748. for (var i = 0; i < this.options.length; i++) {
  12749. if (!(this.options[i] === 'i' || this.options[i] === 'm' || this.options[i] === 'x' || this.options[i] === 'l' || this.options[i] === 's' || this.options[i] === 'u')) {
  12750. throw new Error('the regular expression options [' + this.options[i] + '] is not supported');
  12751. }
  12752. }
  12753. }
  12754. module.exports = BSONRegExp;
  12755. module.exports.BSONRegExp = BSONRegExp;
  12756. /***/ }),
  12757. /* 349 */
  12758. /***/ (function(module, exports, __webpack_require__) {
  12759. /* WEBPACK VAR INJECTION */(function(Buffer) {// Custom inspect property name / symbol.
  12760. var inspect = Buffer ? __webpack_require__(345).inspect.custom || 'inspect' : 'inspect';
  12761. /**
  12762. * A class representation of the BSON Symbol type.
  12763. *
  12764. * @class
  12765. * @deprecated
  12766. * @param {string} value the string representing the symbol.
  12767. * @return {Symbol}
  12768. */
  12769. function Symbol(value) {
  12770. if (!(this instanceof Symbol)) return new Symbol(value);
  12771. this._bsontype = 'Symbol';
  12772. this.value = value;
  12773. }
  12774. /**
  12775. * Access the wrapped string value.
  12776. *
  12777. * @method
  12778. * @return {String} returns the wrapped string.
  12779. */
  12780. Symbol.prototype.valueOf = function () {
  12781. return this.value;
  12782. };
  12783. /**
  12784. * @ignore
  12785. */
  12786. Symbol.prototype.toString = function () {
  12787. return this.value;
  12788. };
  12789. /**
  12790. * @ignore
  12791. */
  12792. Symbol.prototype[inspect] = function () {
  12793. return this.value;
  12794. };
  12795. /**
  12796. * @ignore
  12797. */
  12798. Symbol.prototype.toJSON = function () {
  12799. return this.value;
  12800. };
  12801. module.exports = Symbol;
  12802. module.exports.Symbol = Symbol;
  12803. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(339).Buffer))
  12804. /***/ }),
  12805. /* 350 */
  12806. /***/ (function(module, exports) {
  12807. /**
  12808. * A class representation of a BSON Int32 type.
  12809. *
  12810. * @class
  12811. * @param {number} value the number we want to represent as an int32.
  12812. * @return {Int32}
  12813. */
  12814. var Int32 = function (value) {
  12815. if (!(this instanceof Int32)) return new Int32(value);
  12816. this._bsontype = 'Int32';
  12817. this.value = value;
  12818. };
  12819. /**
  12820. * Access the number value.
  12821. *
  12822. * @method
  12823. * @return {number} returns the wrapped int32 number.
  12824. */
  12825. Int32.prototype.valueOf = function () {
  12826. return this.value;
  12827. };
  12828. /**
  12829. * @ignore
  12830. */
  12831. Int32.prototype.toJSON = function () {
  12832. return this.value;
  12833. };
  12834. module.exports = Int32;
  12835. module.exports.Int32 = Int32;
  12836. /***/ }),
  12837. /* 351 */
  12838. /***/ (function(module, exports) {
  12839. /**
  12840. * A class representation of the BSON Code type.
  12841. *
  12842. * @class
  12843. * @param {(string|function)} code a string or function.
  12844. * @param {Object} [scope] an optional scope for the function.
  12845. * @return {Code}
  12846. */
  12847. var Code = function Code(code, scope) {
  12848. if (!(this instanceof Code)) return new Code(code, scope);
  12849. this._bsontype = 'Code';
  12850. this.code = code;
  12851. this.scope = scope;
  12852. };
  12853. /**
  12854. * @ignore
  12855. */
  12856. Code.prototype.toJSON = function () {
  12857. return { scope: this.scope, code: this.code };
  12858. };
  12859. module.exports = Code;
  12860. module.exports.Code = Code;
  12861. /***/ }),
  12862. /* 352 */
  12863. /***/ (function(module, exports, __webpack_require__) {
  12864. 'use strict';
  12865. var Long = __webpack_require__(335);
  12866. var PARSE_STRING_REGEXP = /^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/;
  12867. var PARSE_INF_REGEXP = /^(\+|-)?(Infinity|inf)$/i;
  12868. var PARSE_NAN_REGEXP = /^(\+|-)?NaN$/i;
  12869. var EXPONENT_MAX = 6111;
  12870. var EXPONENT_MIN = -6176;
  12871. var EXPONENT_BIAS = 6176;
  12872. var MAX_DIGITS = 34;
  12873. // Nan value bits as 32 bit values (due to lack of longs)
  12874. var NAN_BUFFER = [0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00].reverse();
  12875. // Infinity value bits 32 bit values (due to lack of longs)
  12876. var INF_NEGATIVE_BUFFER = [0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00].reverse();
  12877. var INF_POSITIVE_BUFFER = [0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00].reverse();
  12878. var EXPONENT_REGEX = /^([-+])?(\d+)?$/;
  12879. var utils = __webpack_require__(344);
  12880. // Detect if the value is a digit
  12881. var isDigit = function (value) {
  12882. return !isNaN(parseInt(value, 10));
  12883. };
  12884. // Divide two uint128 values
  12885. var divideu128 = function (value) {
  12886. var DIVISOR = Long.fromNumber(1000 * 1000 * 1000);
  12887. var _rem = Long.fromNumber(0);
  12888. var i = 0;
  12889. if (!value.parts[0] && !value.parts[1] && !value.parts[2] && !value.parts[3]) {
  12890. return { quotient: value, rem: _rem };
  12891. }
  12892. for (i = 0; i <= 3; i++) {
  12893. // Adjust remainder to match value of next dividend
  12894. _rem = _rem.shiftLeft(32);
  12895. // Add the divided to _rem
  12896. _rem = _rem.add(new Long(value.parts[i], 0));
  12897. value.parts[i] = _rem.div(DIVISOR).low_;
  12898. _rem = _rem.modulo(DIVISOR);
  12899. }
  12900. return { quotient: value, rem: _rem };
  12901. };
  12902. // Multiply two Long values and return the 128 bit value
  12903. var multiply64x2 = function (left, right) {
  12904. if (!left && !right) {
  12905. return { high: Long.fromNumber(0), low: Long.fromNumber(0) };
  12906. }
  12907. var leftHigh = left.shiftRightUnsigned(32);
  12908. var leftLow = new Long(left.getLowBits(), 0);
  12909. var rightHigh = right.shiftRightUnsigned(32);
  12910. var rightLow = new Long(right.getLowBits(), 0);
  12911. var productHigh = leftHigh.multiply(rightHigh);
  12912. var productMid = leftHigh.multiply(rightLow);
  12913. var productMid2 = leftLow.multiply(rightHigh);
  12914. var productLow = leftLow.multiply(rightLow);
  12915. productHigh = productHigh.add(productMid.shiftRightUnsigned(32));
  12916. productMid = new Long(productMid.getLowBits(), 0).add(productMid2).add(productLow.shiftRightUnsigned(32));
  12917. productHigh = productHigh.add(productMid.shiftRightUnsigned(32));
  12918. productLow = productMid.shiftLeft(32).add(new Long(productLow.getLowBits(), 0));
  12919. // Return the 128 bit result
  12920. return { high: productHigh, low: productLow };
  12921. };
  12922. var lessThan = function (left, right) {
  12923. // Make values unsigned
  12924. var uhleft = left.high_ >>> 0;
  12925. var uhright = right.high_ >>> 0;
  12926. // Compare high bits first
  12927. if (uhleft < uhright) {
  12928. return true;
  12929. } else if (uhleft === uhright) {
  12930. var ulleft = left.low_ >>> 0;
  12931. var ulright = right.low_ >>> 0;
  12932. if (ulleft < ulright) return true;
  12933. }
  12934. return false;
  12935. };
  12936. // var longtoHex = function(value) {
  12937. // var buffer = utils.allocBuffer(8);
  12938. // var index = 0;
  12939. // // Encode the low 64 bits of the decimal
  12940. // // Encode low bits
  12941. // buffer[index++] = value.low_ & 0xff;
  12942. // buffer[index++] = (value.low_ >> 8) & 0xff;
  12943. // buffer[index++] = (value.low_ >> 16) & 0xff;
  12944. // buffer[index++] = (value.low_ >> 24) & 0xff;
  12945. // // Encode high bits
  12946. // buffer[index++] = value.high_ & 0xff;
  12947. // buffer[index++] = (value.high_ >> 8) & 0xff;
  12948. // buffer[index++] = (value.high_ >> 16) & 0xff;
  12949. // buffer[index++] = (value.high_ >> 24) & 0xff;
  12950. // return buffer.reverse().toString('hex');
  12951. // };
  12952. // var int32toHex = function(value) {
  12953. // var buffer = utils.allocBuffer(4);
  12954. // var index = 0;
  12955. // // Encode the low 64 bits of the decimal
  12956. // // Encode low bits
  12957. // buffer[index++] = value & 0xff;
  12958. // buffer[index++] = (value >> 8) & 0xff;
  12959. // buffer[index++] = (value >> 16) & 0xff;
  12960. // buffer[index++] = (value >> 24) & 0xff;
  12961. // return buffer.reverse().toString('hex');
  12962. // };
  12963. /**
  12964. * A class representation of the BSON Decimal128 type.
  12965. *
  12966. * @class
  12967. * @param {Buffer} bytes a buffer containing the raw Decimal128 bytes.
  12968. * @return {Double}
  12969. */
  12970. var Decimal128 = function (bytes) {
  12971. this._bsontype = 'Decimal128';
  12972. this.bytes = bytes;
  12973. };
  12974. /**
  12975. * Create a Decimal128 instance from a string representation
  12976. *
  12977. * @method
  12978. * @param {string} string a numeric string representation.
  12979. * @return {Decimal128} returns a Decimal128 instance.
  12980. */
  12981. Decimal128.fromString = function (string) {
  12982. // Parse state tracking
  12983. var isNegative = false;
  12984. var sawRadix = false;
  12985. var foundNonZero = false;
  12986. // Total number of significant digits (no leading or trailing zero)
  12987. var significantDigits = 0;
  12988. // Total number of significand digits read
  12989. var nDigitsRead = 0;
  12990. // Total number of digits (no leading zeros)
  12991. var nDigits = 0;
  12992. // The number of the digits after radix
  12993. var radixPosition = 0;
  12994. // The index of the first non-zero in *str*
  12995. var firstNonZero = 0;
  12996. // Digits Array
  12997. var digits = [0];
  12998. // The number of digits in digits
  12999. var nDigitsStored = 0;
  13000. // Insertion pointer for digits
  13001. var digitsInsert = 0;
  13002. // The index of the first non-zero digit
  13003. var firstDigit = 0;
  13004. // The index of the last digit
  13005. var lastDigit = 0;
  13006. // Exponent
  13007. var exponent = 0;
  13008. // loop index over array
  13009. var i = 0;
  13010. // The high 17 digits of the significand
  13011. var significandHigh = [0, 0];
  13012. // The low 17 digits of the significand
  13013. var significandLow = [0, 0];
  13014. // The biased exponent
  13015. var biasedExponent = 0;
  13016. // Read index
  13017. var index = 0;
  13018. // Trim the string
  13019. string = string.trim();
  13020. // Naively prevent against REDOS attacks.
  13021. // TODO: implementing a custom parsing for this, or refactoring the regex would yield
  13022. // further gains.
  13023. if (string.length >= 7000) {
  13024. throw new Error('' + string + ' not a valid Decimal128 string');
  13025. }
  13026. // Results
  13027. var stringMatch = string.match(PARSE_STRING_REGEXP);
  13028. var infMatch = string.match(PARSE_INF_REGEXP);
  13029. var nanMatch = string.match(PARSE_NAN_REGEXP);
  13030. // Validate the string
  13031. if (!stringMatch && !infMatch && !nanMatch || string.length === 0) {
  13032. throw new Error('' + string + ' not a valid Decimal128 string');
  13033. }
  13034. // Check if we have an illegal exponent format
  13035. if (stringMatch && stringMatch[4] && stringMatch[2] === undefined) {
  13036. throw new Error('' + string + ' not a valid Decimal128 string');
  13037. }
  13038. // Get the negative or positive sign
  13039. if (string[index] === '+' || string[index] === '-') {
  13040. isNegative = string[index++] === '-';
  13041. }
  13042. // Check if user passed Infinity or NaN
  13043. if (!isDigit(string[index]) && string[index] !== '.') {
  13044. if (string[index] === 'i' || string[index] === 'I') {
  13045. return new Decimal128(utils.toBuffer(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER));
  13046. } else if (string[index] === 'N') {
  13047. return new Decimal128(utils.toBuffer(NAN_BUFFER));
  13048. }
  13049. }
  13050. // Read all the digits
  13051. while (isDigit(string[index]) || string[index] === '.') {
  13052. if (string[index] === '.') {
  13053. if (sawRadix) {
  13054. return new Decimal128(utils.toBuffer(NAN_BUFFER));
  13055. }
  13056. sawRadix = true;
  13057. index = index + 1;
  13058. continue;
  13059. }
  13060. if (nDigitsStored < 34) {
  13061. if (string[index] !== '0' || foundNonZero) {
  13062. if (!foundNonZero) {
  13063. firstNonZero = nDigitsRead;
  13064. }
  13065. foundNonZero = true;
  13066. // Only store 34 digits
  13067. digits[digitsInsert++] = parseInt(string[index], 10);
  13068. nDigitsStored = nDigitsStored + 1;
  13069. }
  13070. }
  13071. if (foundNonZero) {
  13072. nDigits = nDigits + 1;
  13073. }
  13074. if (sawRadix) {
  13075. radixPosition = radixPosition + 1;
  13076. }
  13077. nDigitsRead = nDigitsRead + 1;
  13078. index = index + 1;
  13079. }
  13080. if (sawRadix && !nDigitsRead) {
  13081. throw new Error('' + string + ' not a valid Decimal128 string');
  13082. }
  13083. // Read exponent if exists
  13084. if (string[index] === 'e' || string[index] === 'E') {
  13085. // Read exponent digits
  13086. var match = string.substr(++index).match(EXPONENT_REGEX);
  13087. // No digits read
  13088. if (!match || !match[2]) {
  13089. return new Decimal128(utils.toBuffer(NAN_BUFFER));
  13090. }
  13091. // Get exponent
  13092. exponent = parseInt(match[0], 10);
  13093. // Adjust the index
  13094. index = index + match[0].length;
  13095. }
  13096. // Return not a number
  13097. if (string[index]) {
  13098. return new Decimal128(utils.toBuffer(NAN_BUFFER));
  13099. }
  13100. // Done reading input
  13101. // Find first non-zero digit in digits
  13102. firstDigit = 0;
  13103. if (!nDigitsStored) {
  13104. firstDigit = 0;
  13105. lastDigit = 0;
  13106. digits[0] = 0;
  13107. nDigits = 1;
  13108. nDigitsStored = 1;
  13109. significantDigits = 0;
  13110. } else {
  13111. lastDigit = nDigitsStored - 1;
  13112. significantDigits = nDigits;
  13113. if (exponent !== 0 && significantDigits !== 1) {
  13114. while (string[firstNonZero + significantDigits - 1] === '0') {
  13115. significantDigits = significantDigits - 1;
  13116. }
  13117. }
  13118. }
  13119. // Normalization of exponent
  13120. // Correct exponent based on radix position, and shift significand as needed
  13121. // to represent user input
  13122. // Overflow prevention
  13123. if (exponent <= radixPosition && radixPosition - exponent > 1 << 14) {
  13124. exponent = EXPONENT_MIN;
  13125. } else {
  13126. exponent = exponent - radixPosition;
  13127. }
  13128. // Attempt to normalize the exponent
  13129. while (exponent > EXPONENT_MAX) {
  13130. // Shift exponent to significand and decrease
  13131. lastDigit = lastDigit + 1;
  13132. if (lastDigit - firstDigit > MAX_DIGITS) {
  13133. // Check if we have a zero then just hard clamp, otherwise fail
  13134. var digitsString = digits.join('');
  13135. if (digitsString.match(/^0+$/)) {
  13136. exponent = EXPONENT_MAX;
  13137. break;
  13138. } else {
  13139. return new Decimal128(utils.toBuffer(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER));
  13140. }
  13141. }
  13142. exponent = exponent - 1;
  13143. }
  13144. while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) {
  13145. // Shift last digit
  13146. if (lastDigit === 0) {
  13147. exponent = EXPONENT_MIN;
  13148. significantDigits = 0;
  13149. break;
  13150. }
  13151. if (nDigitsStored < nDigits) {
  13152. // adjust to match digits not stored
  13153. nDigits = nDigits - 1;
  13154. } else {
  13155. // adjust to round
  13156. lastDigit = lastDigit - 1;
  13157. }
  13158. if (exponent < EXPONENT_MAX) {
  13159. exponent = exponent + 1;
  13160. } else {
  13161. // Check if we have a zero then just hard clamp, otherwise fail
  13162. digitsString = digits.join('');
  13163. if (digitsString.match(/^0+$/)) {
  13164. exponent = EXPONENT_MAX;
  13165. break;
  13166. } else {
  13167. return new Decimal128(utils.toBuffer(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER));
  13168. }
  13169. }
  13170. }
  13171. // Round
  13172. // We've normalized the exponent, but might still need to round.
  13173. if (lastDigit - firstDigit + 1 < significantDigits && string[significantDigits] !== '0') {
  13174. var endOfString = nDigitsRead;
  13175. // If we have seen a radix point, 'string' is 1 longer than we have
  13176. // documented with ndigits_read, so inc the position of the first nonzero
  13177. // digit and the position that digits are read to.
  13178. if (sawRadix && exponent === EXPONENT_MIN) {
  13179. firstNonZero = firstNonZero + 1;
  13180. endOfString = endOfString + 1;
  13181. }
  13182. var roundDigit = parseInt(string[firstNonZero + lastDigit + 1], 10);
  13183. var roundBit = 0;
  13184. if (roundDigit >= 5) {
  13185. roundBit = 1;
  13186. if (roundDigit === 5) {
  13187. roundBit = digits[lastDigit] % 2 === 1;
  13188. for (i = firstNonZero + lastDigit + 2; i < endOfString; i++) {
  13189. if (parseInt(string[i], 10)) {
  13190. roundBit = 1;
  13191. break;
  13192. }
  13193. }
  13194. }
  13195. }
  13196. if (roundBit) {
  13197. var dIdx = lastDigit;
  13198. for (; dIdx >= 0; dIdx--) {
  13199. if (++digits[dIdx] > 9) {
  13200. digits[dIdx] = 0;
  13201. // overflowed most significant digit
  13202. if (dIdx === 0) {
  13203. if (exponent < EXPONENT_MAX) {
  13204. exponent = exponent + 1;
  13205. digits[dIdx] = 1;
  13206. } else {
  13207. return new Decimal128(utils.toBuffer(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER));
  13208. }
  13209. }
  13210. } else {
  13211. break;
  13212. }
  13213. }
  13214. }
  13215. }
  13216. // Encode significand
  13217. // The high 17 digits of the significand
  13218. significandHigh = Long.fromNumber(0);
  13219. // The low 17 digits of the significand
  13220. significandLow = Long.fromNumber(0);
  13221. // read a zero
  13222. if (significantDigits === 0) {
  13223. significandHigh = Long.fromNumber(0);
  13224. significandLow = Long.fromNumber(0);
  13225. } else if (lastDigit - firstDigit < 17) {
  13226. dIdx = firstDigit;
  13227. significandLow = Long.fromNumber(digits[dIdx++]);
  13228. significandHigh = new Long(0, 0);
  13229. for (; dIdx <= lastDigit; dIdx++) {
  13230. significandLow = significandLow.multiply(Long.fromNumber(10));
  13231. significandLow = significandLow.add(Long.fromNumber(digits[dIdx]));
  13232. }
  13233. } else {
  13234. dIdx = firstDigit;
  13235. significandHigh = Long.fromNumber(digits[dIdx++]);
  13236. for (; dIdx <= lastDigit - 17; dIdx++) {
  13237. significandHigh = significandHigh.multiply(Long.fromNumber(10));
  13238. significandHigh = significandHigh.add(Long.fromNumber(digits[dIdx]));
  13239. }
  13240. significandLow = Long.fromNumber(digits[dIdx++]);
  13241. for (; dIdx <= lastDigit; dIdx++) {
  13242. significandLow = significandLow.multiply(Long.fromNumber(10));
  13243. significandLow = significandLow.add(Long.fromNumber(digits[dIdx]));
  13244. }
  13245. }
  13246. var significand = multiply64x2(significandHigh, Long.fromString('100000000000000000'));
  13247. significand.low = significand.low.add(significandLow);
  13248. if (lessThan(significand.low, significandLow)) {
  13249. significand.high = significand.high.add(Long.fromNumber(1));
  13250. }
  13251. // Biased exponent
  13252. biasedExponent = exponent + EXPONENT_BIAS;
  13253. var dec = { low: Long.fromNumber(0), high: Long.fromNumber(0) };
  13254. // Encode combination, exponent, and significand.
  13255. if (significand.high.shiftRightUnsigned(49).and(Long.fromNumber(1)).equals(Long.fromNumber)) {
  13256. // Encode '11' into bits 1 to 3
  13257. dec.high = dec.high.or(Long.fromNumber(0x3).shiftLeft(61));
  13258. dec.high = dec.high.or(Long.fromNumber(biasedExponent).and(Long.fromNumber(0x3fff).shiftLeft(47)));
  13259. dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x7fffffffffff)));
  13260. } else {
  13261. dec.high = dec.high.or(Long.fromNumber(biasedExponent & 0x3fff).shiftLeft(49));
  13262. dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x1ffffffffffff)));
  13263. }
  13264. dec.low = significand.low;
  13265. // Encode sign
  13266. if (isNegative) {
  13267. dec.high = dec.high.or(Long.fromString('9223372036854775808'));
  13268. }
  13269. // Encode into a buffer
  13270. var buffer = utils.allocBuffer(16);
  13271. index = 0;
  13272. // Encode the low 64 bits of the decimal
  13273. // Encode low bits
  13274. buffer[index++] = dec.low.low_ & 0xff;
  13275. buffer[index++] = dec.low.low_ >> 8 & 0xff;
  13276. buffer[index++] = dec.low.low_ >> 16 & 0xff;
  13277. buffer[index++] = dec.low.low_ >> 24 & 0xff;
  13278. // Encode high bits
  13279. buffer[index++] = dec.low.high_ & 0xff;
  13280. buffer[index++] = dec.low.high_ >> 8 & 0xff;
  13281. buffer[index++] = dec.low.high_ >> 16 & 0xff;
  13282. buffer[index++] = dec.low.high_ >> 24 & 0xff;
  13283. // Encode the high 64 bits of the decimal
  13284. // Encode low bits
  13285. buffer[index++] = dec.high.low_ & 0xff;
  13286. buffer[index++] = dec.high.low_ >> 8 & 0xff;
  13287. buffer[index++] = dec.high.low_ >> 16 & 0xff;
  13288. buffer[index++] = dec.high.low_ >> 24 & 0xff;
  13289. // Encode high bits
  13290. buffer[index++] = dec.high.high_ & 0xff;
  13291. buffer[index++] = dec.high.high_ >> 8 & 0xff;
  13292. buffer[index++] = dec.high.high_ >> 16 & 0xff;
  13293. buffer[index++] = dec.high.high_ >> 24 & 0xff;
  13294. // Return the new Decimal128
  13295. return new Decimal128(buffer);
  13296. };
  13297. // Extract least significant 5 bits
  13298. var COMBINATION_MASK = 0x1f;
  13299. // Extract least significant 14 bits
  13300. var EXPONENT_MASK = 0x3fff;
  13301. // Value of combination field for Inf
  13302. var COMBINATION_INFINITY = 30;
  13303. // Value of combination field for NaN
  13304. var COMBINATION_NAN = 31;
  13305. // Value of combination field for NaN
  13306. // var COMBINATION_SNAN = 32;
  13307. // decimal128 exponent bias
  13308. EXPONENT_BIAS = 6176;
  13309. /**
  13310. * Create a string representation of the raw Decimal128 value
  13311. *
  13312. * @method
  13313. * @return {string} returns a Decimal128 string representation.
  13314. */
  13315. Decimal128.prototype.toString = function () {
  13316. // Note: bits in this routine are referred to starting at 0,
  13317. // from the sign bit, towards the coefficient.
  13318. // bits 0 - 31
  13319. var high;
  13320. // bits 32 - 63
  13321. var midh;
  13322. // bits 64 - 95
  13323. var midl;
  13324. // bits 96 - 127
  13325. var low;
  13326. // bits 1 - 5
  13327. var combination;
  13328. // decoded biased exponent (14 bits)
  13329. var biased_exponent;
  13330. // the number of significand digits
  13331. var significand_digits = 0;
  13332. // the base-10 digits in the significand
  13333. var significand = new Array(36);
  13334. for (var i = 0; i < significand.length; i++) significand[i] = 0;
  13335. // read pointer into significand
  13336. var index = 0;
  13337. // unbiased exponent
  13338. var exponent;
  13339. // the exponent if scientific notation is used
  13340. var scientific_exponent;
  13341. // true if the number is zero
  13342. var is_zero = false;
  13343. // the most signifcant significand bits (50-46)
  13344. var significand_msb;
  13345. // temporary storage for significand decoding
  13346. var significand128 = { parts: new Array(4) };
  13347. // indexing variables
  13348. i;
  13349. var j, k;
  13350. // Output string
  13351. var string = [];
  13352. // Unpack index
  13353. index = 0;
  13354. // Buffer reference
  13355. var buffer = this.bytes;
  13356. // Unpack the low 64bits into a long
  13357. low = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13358. midl = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13359. // Unpack the high 64bits into a long
  13360. midh = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13361. high = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13362. // Unpack index
  13363. index = 0;
  13364. // Create the state of the decimal
  13365. var dec = {
  13366. low: new Long(low, midl),
  13367. high: new Long(midh, high)
  13368. };
  13369. if (dec.high.lessThan(Long.ZERO)) {
  13370. string.push('-');
  13371. }
  13372. // Decode combination field and exponent
  13373. combination = high >> 26 & COMBINATION_MASK;
  13374. if (combination >> 3 === 3) {
  13375. // Check for 'special' values
  13376. if (combination === COMBINATION_INFINITY) {
  13377. return string.join('') + 'Infinity';
  13378. } else if (combination === COMBINATION_NAN) {
  13379. return 'NaN';
  13380. } else {
  13381. biased_exponent = high >> 15 & EXPONENT_MASK;
  13382. significand_msb = 0x08 + (high >> 14 & 0x01);
  13383. }
  13384. } else {
  13385. significand_msb = high >> 14 & 0x07;
  13386. biased_exponent = high >> 17 & EXPONENT_MASK;
  13387. }
  13388. exponent = biased_exponent - EXPONENT_BIAS;
  13389. // Create string of significand digits
  13390. // Convert the 114-bit binary number represented by
  13391. // (significand_high, significand_low) to at most 34 decimal
  13392. // digits through modulo and division.
  13393. significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14);
  13394. significand128.parts[1] = midh;
  13395. significand128.parts[2] = midl;
  13396. significand128.parts[3] = low;
  13397. if (significand128.parts[0] === 0 && significand128.parts[1] === 0 && significand128.parts[2] === 0 && significand128.parts[3] === 0) {
  13398. is_zero = true;
  13399. } else {
  13400. for (k = 3; k >= 0; k--) {
  13401. var least_digits = 0;
  13402. // Peform the divide
  13403. var result = divideu128(significand128);
  13404. significand128 = result.quotient;
  13405. least_digits = result.rem.low_;
  13406. // We now have the 9 least significant digits (in base 2).
  13407. // Convert and output to string.
  13408. if (!least_digits) continue;
  13409. for (j = 8; j >= 0; j--) {
  13410. // significand[k * 9 + j] = Math.round(least_digits % 10);
  13411. significand[k * 9 + j] = least_digits % 10;
  13412. // least_digits = Math.round(least_digits / 10);
  13413. least_digits = Math.floor(least_digits / 10);
  13414. }
  13415. }
  13416. }
  13417. // Output format options:
  13418. // Scientific - [-]d.dddE(+/-)dd or [-]dE(+/-)dd
  13419. // Regular - ddd.ddd
  13420. if (is_zero) {
  13421. significand_digits = 1;
  13422. significand[index] = 0;
  13423. } else {
  13424. significand_digits = 36;
  13425. i = 0;
  13426. while (!significand[index]) {
  13427. i++;
  13428. significand_digits = significand_digits - 1;
  13429. index = index + 1;
  13430. }
  13431. }
  13432. scientific_exponent = significand_digits - 1 + exponent;
  13433. // The scientific exponent checks are dictated by the string conversion
  13434. // specification and are somewhat arbitrary cutoffs.
  13435. //
  13436. // We must check exponent > 0, because if this is the case, the number
  13437. // has trailing zeros. However, we *cannot* output these trailing zeros,
  13438. // because doing so would change the precision of the value, and would
  13439. // change stored data if the string converted number is round tripped.
  13440. if (scientific_exponent >= 34 || scientific_exponent <= -7 || exponent > 0) {
  13441. // Scientific format
  13442. string.push(significand[index++]);
  13443. significand_digits = significand_digits - 1;
  13444. if (significand_digits) {
  13445. string.push('.');
  13446. }
  13447. for (i = 0; i < significand_digits; i++) {
  13448. string.push(significand[index++]);
  13449. }
  13450. // Exponent
  13451. string.push('E');
  13452. if (scientific_exponent > 0) {
  13453. string.push('+' + scientific_exponent);
  13454. } else {
  13455. string.push(scientific_exponent);
  13456. }
  13457. } else {
  13458. // Regular format with no decimal place
  13459. if (exponent >= 0) {
  13460. for (i = 0; i < significand_digits; i++) {
  13461. string.push(significand[index++]);
  13462. }
  13463. } else {
  13464. var radix_position = significand_digits + exponent;
  13465. // non-zero digits before radix
  13466. if (radix_position > 0) {
  13467. for (i = 0; i < radix_position; i++) {
  13468. string.push(significand[index++]);
  13469. }
  13470. } else {
  13471. string.push('0');
  13472. }
  13473. string.push('.');
  13474. // add leading zeros after radix
  13475. while (radix_position++ < 0) {
  13476. string.push('0');
  13477. }
  13478. for (i = 0; i < significand_digits - Math.max(radix_position - 1, 0); i++) {
  13479. string.push(significand[index++]);
  13480. }
  13481. }
  13482. }
  13483. return string.join('');
  13484. };
  13485. Decimal128.prototype.toJSON = function () {
  13486. return { $numberDecimal: this.toString() };
  13487. };
  13488. module.exports = Decimal128;
  13489. module.exports.Decimal128 = Decimal128;
  13490. /***/ }),
  13491. /* 353 */
  13492. /***/ (function(module, exports) {
  13493. /**
  13494. * A class representation of the BSON MinKey type.
  13495. *
  13496. * @class
  13497. * @return {MinKey} A MinKey instance
  13498. */
  13499. function MinKey() {
  13500. if (!(this instanceof MinKey)) return new MinKey();
  13501. this._bsontype = 'MinKey';
  13502. }
  13503. module.exports = MinKey;
  13504. module.exports.MinKey = MinKey;
  13505. /***/ }),
  13506. /* 354 */
  13507. /***/ (function(module, exports) {
  13508. /**
  13509. * A class representation of the BSON MaxKey type.
  13510. *
  13511. * @class
  13512. * @return {MaxKey} A MaxKey instance
  13513. */
  13514. function MaxKey() {
  13515. if (!(this instanceof MaxKey)) return new MaxKey();
  13516. this._bsontype = 'MaxKey';
  13517. }
  13518. module.exports = MaxKey;
  13519. module.exports.MaxKey = MaxKey;
  13520. /***/ }),
  13521. /* 355 */
  13522. /***/ (function(module, exports) {
  13523. /**
  13524. * A class representation of the BSON DBRef type.
  13525. *
  13526. * @class
  13527. * @param {string} namespace the collection name.
  13528. * @param {ObjectID} oid the reference ObjectID.
  13529. * @param {string} [db] optional db name, if omitted the reference is local to the current db.
  13530. * @return {DBRef}
  13531. */
  13532. function DBRef(namespace, oid, db) {
  13533. if (!(this instanceof DBRef)) return new DBRef(namespace, oid, db);
  13534. this._bsontype = 'DBRef';
  13535. this.namespace = namespace;
  13536. this.oid = oid;
  13537. this.db = db;
  13538. }
  13539. /**
  13540. * @ignore
  13541. * @api private
  13542. */
  13543. DBRef.prototype.toJSON = function () {
  13544. return {
  13545. $ref: this.namespace,
  13546. $id: this.oid,
  13547. $db: this.db == null ? '' : this.db
  13548. };
  13549. };
  13550. module.exports = DBRef;
  13551. module.exports.DBRef = DBRef;
  13552. /***/ }),
  13553. /* 356 */
  13554. /***/ (function(module, exports, __webpack_require__) {
  13555. /* WEBPACK VAR INJECTION */(function(global) {/**
  13556. * Module dependencies.
  13557. * @ignore
  13558. */
  13559. // Test if we're in Node via presence of "global" not absence of "window"
  13560. // to support hybrid environments like Electron
  13561. if (typeof global !== 'undefined') {
  13562. var Buffer = __webpack_require__(339).Buffer; // TODO just use global Buffer
  13563. }
  13564. var utils = __webpack_require__(344);
  13565. /**
  13566. * A class representation of the BSON Binary type.
  13567. *
  13568. * Sub types
  13569. * - **BSON.BSON_BINARY_SUBTYPE_DEFAULT**, default BSON type.
  13570. * - **BSON.BSON_BINARY_SUBTYPE_FUNCTION**, BSON function type.
  13571. * - **BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY**, BSON byte array type.
  13572. * - **BSON.BSON_BINARY_SUBTYPE_UUID**, BSON uuid type.
  13573. * - **BSON.BSON_BINARY_SUBTYPE_MD5**, BSON md5 type.
  13574. * - **BSON.BSON_BINARY_SUBTYPE_USER_DEFINED**, BSON user defined type.
  13575. *
  13576. * @class
  13577. * @param {Buffer} buffer a buffer object containing the binary data.
  13578. * @param {Number} [subType] the option binary type.
  13579. * @return {Binary}
  13580. */
  13581. function Binary(buffer, subType) {
  13582. if (!(this instanceof Binary)) return new Binary(buffer, subType);
  13583. if (buffer != null && !(typeof buffer === 'string') && !Buffer.isBuffer(buffer) && !(buffer instanceof Uint8Array) && !Array.isArray(buffer)) {
  13584. throw new Error('only String, Buffer, Uint8Array or Array accepted');
  13585. }
  13586. this._bsontype = 'Binary';
  13587. if (buffer instanceof Number) {
  13588. this.sub_type = buffer;
  13589. this.position = 0;
  13590. } else {
  13591. this.sub_type = subType == null ? BSON_BINARY_SUBTYPE_DEFAULT : subType;
  13592. this.position = 0;
  13593. }
  13594. if (buffer != null && !(buffer instanceof Number)) {
  13595. // Only accept Buffer, Uint8Array or Arrays
  13596. if (typeof buffer === 'string') {
  13597. // Different ways of writing the length of the string for the different types
  13598. if (typeof Buffer !== 'undefined') {
  13599. this.buffer = utils.toBuffer(buffer);
  13600. } else if (typeof Uint8Array !== 'undefined' || Object.prototype.toString.call(buffer) === '[object Array]') {
  13601. this.buffer = writeStringToArray(buffer);
  13602. } else {
  13603. throw new Error('only String, Buffer, Uint8Array or Array accepted');
  13604. }
  13605. } else {
  13606. this.buffer = buffer;
  13607. }
  13608. this.position = buffer.length;
  13609. } else {
  13610. if (typeof Buffer !== 'undefined') {
  13611. this.buffer = utils.allocBuffer(Binary.BUFFER_SIZE);
  13612. } else if (typeof Uint8Array !== 'undefined') {
  13613. this.buffer = new Uint8Array(new ArrayBuffer(Binary.BUFFER_SIZE));
  13614. } else {
  13615. this.buffer = new Array(Binary.BUFFER_SIZE);
  13616. }
  13617. // Set position to start of buffer
  13618. this.position = 0;
  13619. }
  13620. }
  13621. /**
  13622. * Updates this binary with byte_value.
  13623. *
  13624. * @method
  13625. * @param {string} byte_value a single byte we wish to write.
  13626. */
  13627. Binary.prototype.put = function put(byte_value) {
  13628. // If it's a string and a has more than one character throw an error
  13629. if (byte_value['length'] != null && typeof byte_value !== 'number' && byte_value.length !== 1) throw new Error('only accepts single character String, Uint8Array or Array');
  13630. if (typeof byte_value !== 'number' && byte_value < 0 || byte_value > 255) throw new Error('only accepts number in a valid unsigned byte range 0-255');
  13631. // Decode the byte value once
  13632. var decoded_byte = null;
  13633. if (typeof byte_value === 'string') {
  13634. decoded_byte = byte_value.charCodeAt(0);
  13635. } else if (byte_value['length'] != null) {
  13636. decoded_byte = byte_value[0];
  13637. } else {
  13638. decoded_byte = byte_value;
  13639. }
  13640. if (this.buffer.length > this.position) {
  13641. this.buffer[this.position++] = decoded_byte;
  13642. } else {
  13643. if (typeof Buffer !== 'undefined' && Buffer.isBuffer(this.buffer)) {
  13644. // Create additional overflow buffer
  13645. var buffer = utils.allocBuffer(Binary.BUFFER_SIZE + this.buffer.length);
  13646. // Combine the two buffers together
  13647. this.buffer.copy(buffer, 0, 0, this.buffer.length);
  13648. this.buffer = buffer;
  13649. this.buffer[this.position++] = decoded_byte;
  13650. } else {
  13651. buffer = null;
  13652. // Create a new buffer (typed or normal array)
  13653. if (Object.prototype.toString.call(this.buffer) === '[object Uint8Array]') {
  13654. buffer = new Uint8Array(new ArrayBuffer(Binary.BUFFER_SIZE + this.buffer.length));
  13655. } else {
  13656. buffer = new Array(Binary.BUFFER_SIZE + this.buffer.length);
  13657. }
  13658. // We need to copy all the content to the new array
  13659. for (var i = 0; i < this.buffer.length; i++) {
  13660. buffer[i] = this.buffer[i];
  13661. }
  13662. // Reassign the buffer
  13663. this.buffer = buffer;
  13664. // Write the byte
  13665. this.buffer[this.position++] = decoded_byte;
  13666. }
  13667. }
  13668. };
  13669. /**
  13670. * Writes a buffer or string to the binary.
  13671. *
  13672. * @method
  13673. * @param {(Buffer|string)} string a string or buffer to be written to the Binary BSON object.
  13674. * @param {number} offset specify the binary of where to write the content.
  13675. * @return {null}
  13676. */
  13677. Binary.prototype.write = function write(string, offset) {
  13678. offset = typeof offset === 'number' ? offset : this.position;
  13679. // If the buffer is to small let's extend the buffer
  13680. if (this.buffer.length < offset + string.length) {
  13681. var buffer = null;
  13682. // If we are in node.js
  13683. if (typeof Buffer !== 'undefined' && Buffer.isBuffer(this.buffer)) {
  13684. buffer = utils.allocBuffer(this.buffer.length + string.length);
  13685. this.buffer.copy(buffer, 0, 0, this.buffer.length);
  13686. } else if (Object.prototype.toString.call(this.buffer) === '[object Uint8Array]') {
  13687. // Create a new buffer
  13688. buffer = new Uint8Array(new ArrayBuffer(this.buffer.length + string.length));
  13689. // Copy the content
  13690. for (var i = 0; i < this.position; i++) {
  13691. buffer[i] = this.buffer[i];
  13692. }
  13693. }
  13694. // Assign the new buffer
  13695. this.buffer = buffer;
  13696. }
  13697. if (typeof Buffer !== 'undefined' && Buffer.isBuffer(string) && Buffer.isBuffer(this.buffer)) {
  13698. string.copy(this.buffer, offset, 0, string.length);
  13699. this.position = offset + string.length > this.position ? offset + string.length : this.position;
  13700. // offset = string.length
  13701. } else if (typeof Buffer !== 'undefined' && typeof string === 'string' && Buffer.isBuffer(this.buffer)) {
  13702. this.buffer.write(string, offset, 'binary');
  13703. this.position = offset + string.length > this.position ? offset + string.length : this.position;
  13704. // offset = string.length;
  13705. } else if (Object.prototype.toString.call(string) === '[object Uint8Array]' || Object.prototype.toString.call(string) === '[object Array]' && typeof string !== 'string') {
  13706. for (i = 0; i < string.length; i++) {
  13707. this.buffer[offset++] = string[i];
  13708. }
  13709. this.position = offset > this.position ? offset : this.position;
  13710. } else if (typeof string === 'string') {
  13711. for (i = 0; i < string.length; i++) {
  13712. this.buffer[offset++] = string.charCodeAt(i);
  13713. }
  13714. this.position = offset > this.position ? offset : this.position;
  13715. }
  13716. };
  13717. /**
  13718. * Reads **length** bytes starting at **position**.
  13719. *
  13720. * @method
  13721. * @param {number} position read from the given position in the Binary.
  13722. * @param {number} length the number of bytes to read.
  13723. * @return {Buffer}
  13724. */
  13725. Binary.prototype.read = function read(position, length) {
  13726. length = length && length > 0 ? length : this.position;
  13727. // Let's return the data based on the type we have
  13728. if (this.buffer['slice']) {
  13729. return this.buffer.slice(position, position + length);
  13730. } else {
  13731. // Create a buffer to keep the result
  13732. var buffer = typeof Uint8Array !== 'undefined' ? new Uint8Array(new ArrayBuffer(length)) : new Array(length);
  13733. for (var i = 0; i < length; i++) {
  13734. buffer[i] = this.buffer[position++];
  13735. }
  13736. }
  13737. // Return the buffer
  13738. return buffer;
  13739. };
  13740. /**
  13741. * Returns the value of this binary as a string.
  13742. *
  13743. * @method
  13744. * @return {string}
  13745. */
  13746. Binary.prototype.value = function value(asRaw) {
  13747. asRaw = asRaw == null ? false : asRaw;
  13748. // Optimize to serialize for the situation where the data == size of buffer
  13749. if (asRaw && typeof Buffer !== 'undefined' && Buffer.isBuffer(this.buffer) && this.buffer.length === this.position) return this.buffer;
  13750. // If it's a node.js buffer object
  13751. if (typeof Buffer !== 'undefined' && Buffer.isBuffer(this.buffer)) {
  13752. return asRaw ? this.buffer.slice(0, this.position) : this.buffer.toString('binary', 0, this.position);
  13753. } else {
  13754. if (asRaw) {
  13755. // we support the slice command use it
  13756. if (this.buffer['slice'] != null) {
  13757. return this.buffer.slice(0, this.position);
  13758. } else {
  13759. // Create a new buffer to copy content to
  13760. var newBuffer = Object.prototype.toString.call(this.buffer) === '[object Uint8Array]' ? new Uint8Array(new ArrayBuffer(this.position)) : new Array(this.position);
  13761. // Copy content
  13762. for (var i = 0; i < this.position; i++) {
  13763. newBuffer[i] = this.buffer[i];
  13764. }
  13765. // Return the buffer
  13766. return newBuffer;
  13767. }
  13768. } else {
  13769. return convertArraytoUtf8BinaryString(this.buffer, 0, this.position);
  13770. }
  13771. }
  13772. };
  13773. /**
  13774. * Length.
  13775. *
  13776. * @method
  13777. * @return {number} the length of the binary.
  13778. */
  13779. Binary.prototype.length = function length() {
  13780. return this.position;
  13781. };
  13782. /**
  13783. * @ignore
  13784. */
  13785. Binary.prototype.toJSON = function () {
  13786. return this.buffer != null ? this.buffer.toString('base64') : '';
  13787. };
  13788. /**
  13789. * @ignore
  13790. */
  13791. Binary.prototype.toString = function (format) {
  13792. return this.buffer != null ? this.buffer.slice(0, this.position).toString(format) : '';
  13793. };
  13794. /**
  13795. * Binary default subtype
  13796. * @ignore
  13797. */
  13798. var BSON_BINARY_SUBTYPE_DEFAULT = 0;
  13799. /**
  13800. * @ignore
  13801. */
  13802. var writeStringToArray = function (data) {
  13803. // Create a buffer
  13804. var buffer = typeof Uint8Array !== 'undefined' ? new Uint8Array(new ArrayBuffer(data.length)) : new Array(data.length);
  13805. // Write the content to the buffer
  13806. for (var i = 0; i < data.length; i++) {
  13807. buffer[i] = data.charCodeAt(i);
  13808. }
  13809. // Write the string to the buffer
  13810. return buffer;
  13811. };
  13812. /**
  13813. * Convert Array ot Uint8Array to Binary String
  13814. *
  13815. * @ignore
  13816. */
  13817. var convertArraytoUtf8BinaryString = function (byteArray, startIndex, endIndex) {
  13818. var result = '';
  13819. for (var i = startIndex; i < endIndex; i++) {
  13820. result = result + String.fromCharCode(byteArray[i]);
  13821. }
  13822. return result;
  13823. };
  13824. Binary.BUFFER_SIZE = 256;
  13825. /**
  13826. * Default BSON type
  13827. *
  13828. * @classconstant SUBTYPE_DEFAULT
  13829. **/
  13830. Binary.SUBTYPE_DEFAULT = 0;
  13831. /**
  13832. * Function BSON type
  13833. *
  13834. * @classconstant SUBTYPE_DEFAULT
  13835. **/
  13836. Binary.SUBTYPE_FUNCTION = 1;
  13837. /**
  13838. * Byte Array BSON type
  13839. *
  13840. * @classconstant SUBTYPE_DEFAULT
  13841. **/
  13842. Binary.SUBTYPE_BYTE_ARRAY = 2;
  13843. /**
  13844. * OLD UUID BSON type
  13845. *
  13846. * @classconstant SUBTYPE_DEFAULT
  13847. **/
  13848. Binary.SUBTYPE_UUID_OLD = 3;
  13849. /**
  13850. * UUID BSON type
  13851. *
  13852. * @classconstant SUBTYPE_DEFAULT
  13853. **/
  13854. Binary.SUBTYPE_UUID = 4;
  13855. /**
  13856. * MD5 BSON type
  13857. *
  13858. * @classconstant SUBTYPE_DEFAULT
  13859. **/
  13860. Binary.SUBTYPE_MD5 = 5;
  13861. /**
  13862. * User BSON type
  13863. *
  13864. * @classconstant SUBTYPE_DEFAULT
  13865. **/
  13866. Binary.SUBTYPE_USER_DEFINED = 128;
  13867. /**
  13868. * Expose.
  13869. */
  13870. module.exports = Binary;
  13871. module.exports.Binary = Binary;
  13872. /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
  13873. /***/ }),
  13874. /* 357 */
  13875. /***/ (function(module, exports, __webpack_require__) {
  13876. 'use strict';
  13877. var Long = __webpack_require__(335).Long,
  13878. Double = __webpack_require__(336).Double,
  13879. Timestamp = __webpack_require__(337).Timestamp,
  13880. ObjectID = __webpack_require__(338).ObjectID,
  13881. Symbol = __webpack_require__(349).Symbol,
  13882. Code = __webpack_require__(351).Code,
  13883. MinKey = __webpack_require__(353).MinKey,
  13884. MaxKey = __webpack_require__(354).MaxKey,
  13885. Decimal128 = __webpack_require__(352),
  13886. Int32 = __webpack_require__(350),
  13887. DBRef = __webpack_require__(355).DBRef,
  13888. BSONRegExp = __webpack_require__(348).BSONRegExp,
  13889. Binary = __webpack_require__(356).Binary;
  13890. var utils = __webpack_require__(344);
  13891. var deserialize = function (buffer, options, isArray) {
  13892. options = options == null ? {} : options;
  13893. var index = options && options.index ? options.index : 0;
  13894. // Read the document size
  13895. var size = buffer[index] | buffer[index + 1] << 8 | buffer[index + 2] << 16 | buffer[index + 3] << 24;
  13896. // Ensure buffer is valid size
  13897. if (size < 5 || buffer.length < size || size + index > buffer.length) {
  13898. throw new Error('corrupt bson message');
  13899. }
  13900. // Illegal end value
  13901. if (buffer[index + size - 1] !== 0) {
  13902. throw new Error("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00");
  13903. }
  13904. // Start deserializtion
  13905. return deserializeObject(buffer, index, options, isArray);
  13906. };
  13907. var deserializeObject = function (buffer, index, options, isArray) {
  13908. var evalFunctions = options['evalFunctions'] == null ? false : options['evalFunctions'];
  13909. var cacheFunctions = options['cacheFunctions'] == null ? false : options['cacheFunctions'];
  13910. var cacheFunctionsCrc32 = options['cacheFunctionsCrc32'] == null ? false : options['cacheFunctionsCrc32'];
  13911. if (!cacheFunctionsCrc32) var crc32 = null;
  13912. var fieldsAsRaw = options['fieldsAsRaw'] == null ? null : options['fieldsAsRaw'];
  13913. // Return raw bson buffer instead of parsing it
  13914. var raw = options['raw'] == null ? false : options['raw'];
  13915. // Return BSONRegExp objects instead of native regular expressions
  13916. var bsonRegExp = typeof options['bsonRegExp'] === 'boolean' ? options['bsonRegExp'] : false;
  13917. // Controls the promotion of values vs wrapper classes
  13918. var promoteBuffers = options['promoteBuffers'] == null ? false : options['promoteBuffers'];
  13919. var promoteLongs = options['promoteLongs'] == null ? true : options['promoteLongs'];
  13920. var promoteValues = options['promoteValues'] == null ? true : options['promoteValues'];
  13921. // Set the start index
  13922. var startIndex = index;
  13923. // Validate that we have at least 4 bytes of buffer
  13924. if (buffer.length < 5) throw new Error('corrupt bson message < 5 bytes long');
  13925. // Read the document size
  13926. var size = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13927. // Ensure buffer is valid size
  13928. if (size < 5 || size > buffer.length) throw new Error('corrupt bson message');
  13929. // Create holding object
  13930. var object = isArray ? [] : {};
  13931. // Used for arrays to skip having to perform utf8 decoding
  13932. var arrayIndex = 0;
  13933. var done = false;
  13934. // While we have more left data left keep parsing
  13935. // while (buffer[index + 1] !== 0) {
  13936. while (!done) {
  13937. // Read the type
  13938. var elementType = buffer[index++];
  13939. // If we get a zero it's the last byte, exit
  13940. if (elementType === 0) break;
  13941. // Get the start search index
  13942. var i = index;
  13943. // Locate the end of the c string
  13944. while (buffer[i] !== 0x00 && i < buffer.length) {
  13945. i++;
  13946. }
  13947. // If are at the end of the buffer there is a problem with the document
  13948. if (i >= buffer.length) throw new Error('Bad BSON Document: illegal CString');
  13949. var name = isArray ? arrayIndex++ : buffer.toString('utf8', index, i);
  13950. index = i + 1;
  13951. if (elementType === BSON.BSON_DATA_STRING) {
  13952. var stringSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13953. if (stringSize <= 0 || stringSize > buffer.length - index || buffer[index + stringSize - 1] !== 0) throw new Error('bad string length in bson');
  13954. object[name] = buffer.toString('utf8', index, index + stringSize - 1);
  13955. index = index + stringSize;
  13956. } else if (elementType === BSON.BSON_DATA_OID) {
  13957. var oid = utils.allocBuffer(12);
  13958. buffer.copy(oid, 0, index, index + 12);
  13959. object[name] = new ObjectID(oid);
  13960. index = index + 12;
  13961. } else if (elementType === BSON.BSON_DATA_INT && promoteValues === false) {
  13962. object[name] = new Int32(buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24);
  13963. } else if (elementType === BSON.BSON_DATA_INT) {
  13964. object[name] = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13965. } else if (elementType === BSON.BSON_DATA_NUMBER && promoteValues === false) {
  13966. object[name] = new Double(buffer.readDoubleLE(index));
  13967. index = index + 8;
  13968. } else if (elementType === BSON.BSON_DATA_NUMBER) {
  13969. object[name] = buffer.readDoubleLE(index);
  13970. index = index + 8;
  13971. } else if (elementType === BSON.BSON_DATA_DATE) {
  13972. var lowBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13973. var highBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13974. object[name] = new Date(new Long(lowBits, highBits).toNumber());
  13975. } else if (elementType === BSON.BSON_DATA_BOOLEAN) {
  13976. if (buffer[index] !== 0 && buffer[index] !== 1) throw new Error('illegal boolean type value');
  13977. object[name] = buffer[index++] === 1;
  13978. } else if (elementType === BSON.BSON_DATA_OBJECT) {
  13979. var _index = index;
  13980. var objectSize = buffer[index] | buffer[index + 1] << 8 | buffer[index + 2] << 16 | buffer[index + 3] << 24;
  13981. if (objectSize <= 0 || objectSize > buffer.length - index) throw new Error('bad embedded document length in bson');
  13982. // We have a raw value
  13983. if (raw) {
  13984. object[name] = buffer.slice(index, index + objectSize);
  13985. } else {
  13986. object[name] = deserializeObject(buffer, _index, options, false);
  13987. }
  13988. index = index + objectSize;
  13989. } else if (elementType === BSON.BSON_DATA_ARRAY) {
  13990. _index = index;
  13991. objectSize = buffer[index] | buffer[index + 1] << 8 | buffer[index + 2] << 16 | buffer[index + 3] << 24;
  13992. var arrayOptions = options;
  13993. // Stop index
  13994. var stopIndex = index + objectSize;
  13995. // All elements of array to be returned as raw bson
  13996. if (fieldsAsRaw && fieldsAsRaw[name]) {
  13997. arrayOptions = {};
  13998. for (var n in options) arrayOptions[n] = options[n];
  13999. arrayOptions['raw'] = true;
  14000. }
  14001. object[name] = deserializeObject(buffer, _index, arrayOptions, true);
  14002. index = index + objectSize;
  14003. if (buffer[index - 1] !== 0) throw new Error('invalid array terminator byte');
  14004. if (index !== stopIndex) throw new Error('corrupted array bson');
  14005. } else if (elementType === BSON.BSON_DATA_UNDEFINED) {
  14006. object[name] = undefined;
  14007. } else if (elementType === BSON.BSON_DATA_NULL) {
  14008. object[name] = null;
  14009. } else if (elementType === BSON.BSON_DATA_LONG) {
  14010. // Unpack the low and high bits
  14011. lowBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  14012. highBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  14013. var long = new Long(lowBits, highBits);
  14014. // Promote the long if possible
  14015. if (promoteLongs && promoteValues === true) {
  14016. object[name] = long.lessThanOrEqual(JS_INT_MAX_LONG) && long.greaterThanOrEqual(JS_INT_MIN_LONG) ? long.toNumber() : long;
  14017. } else {
  14018. object[name] = long;
  14019. }
  14020. } else if (elementType === BSON.BSON_DATA_DECIMAL128) {
  14021. // Buffer to contain the decimal bytes
  14022. var bytes = utils.allocBuffer(16);
  14023. // Copy the next 16 bytes into the bytes buffer
  14024. buffer.copy(bytes, 0, index, index + 16);
  14025. // Update index
  14026. index = index + 16;
  14027. // Assign the new Decimal128 value
  14028. var decimal128 = new Decimal128(bytes);
  14029. // If we have an alternative mapper use that
  14030. object[name] = decimal128.toObject ? decimal128.toObject() : decimal128;
  14031. } else if (elementType === BSON.BSON_DATA_BINARY) {
  14032. var binarySize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  14033. var totalBinarySize = binarySize;
  14034. var subType = buffer[index++];
  14035. // Did we have a negative binary size, throw
  14036. if (binarySize < 0) throw new Error('Negative binary type element size found');
  14037. // Is the length longer than the document
  14038. if (binarySize > buffer.length) throw new Error('Binary type size larger than document size');
  14039. // Decode as raw Buffer object if options specifies it
  14040. if (buffer['slice'] != null) {
  14041. // If we have subtype 2 skip the 4 bytes for the size
  14042. if (subType === Binary.SUBTYPE_BYTE_ARRAY) {
  14043. binarySize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  14044. if (binarySize < 0) throw new Error('Negative binary type element size found for subtype 0x02');
  14045. if (binarySize > totalBinarySize - 4) throw new Error('Binary type with subtype 0x02 contains to long binary size');
  14046. if (binarySize < totalBinarySize - 4) throw new Error('Binary type with subtype 0x02 contains to short binary size');
  14047. }
  14048. if (promoteBuffers && promoteValues) {
  14049. object[name] = buffer.slice(index, index + binarySize);
  14050. } else {
  14051. object[name] = new Binary(buffer.slice(index, index + binarySize), subType);
  14052. }
  14053. } else {
  14054. var _buffer = typeof Uint8Array !== 'undefined' ? new Uint8Array(new ArrayBuffer(binarySize)) : new Array(binarySize);
  14055. // If we have subtype 2 skip the 4 bytes for the size
  14056. if (subType === Binary.SUBTYPE_BYTE_ARRAY) {
  14057. binarySize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  14058. if (binarySize < 0) throw new Error('Negative binary type element size found for subtype 0x02');
  14059. if (binarySize > totalBinarySize - 4) throw new Error('Binary type with subtype 0x02 contains to long binary size');
  14060. if (binarySize < totalBinarySize - 4) throw new Error('Binary type with subtype 0x02 contains to short binary size');
  14061. }
  14062. // Copy the data
  14063. for (i = 0; i < binarySize; i++) {
  14064. _buffer[i] = buffer[index + i];
  14065. }
  14066. if (promoteBuffers && promoteValues) {
  14067. object[name] = _buffer;
  14068. } else {
  14069. object[name] = new Binary(_buffer, subType);
  14070. }
  14071. }
  14072. // Update the index
  14073. index = index + binarySize;
  14074. } else if (elementType === BSON.BSON_DATA_REGEXP && bsonRegExp === false) {
  14075. // Get the start search index
  14076. i = index;
  14077. // Locate the end of the c string
  14078. while (buffer[i] !== 0x00 && i < buffer.length) {
  14079. i++;
  14080. }
  14081. // If are at the end of the buffer there is a problem with the document
  14082. if (i >= buffer.length) throw new Error('Bad BSON Document: illegal CString');
  14083. // Return the C string
  14084. var source = buffer.toString('utf8', index, i);
  14085. // Create the regexp
  14086. index = i + 1;
  14087. // Get the start search index
  14088. i = index;
  14089. // Locate the end of the c string
  14090. while (buffer[i] !== 0x00 && i < buffer.length) {
  14091. i++;
  14092. }
  14093. // If are at the end of the buffer there is a problem with the document
  14094. if (i >= buffer.length) throw new Error('Bad BSON Document: illegal CString');
  14095. // Return the C string
  14096. var regExpOptions = buffer.toString('utf8', index, i);
  14097. index = i + 1;
  14098. // For each option add the corresponding one for javascript
  14099. var optionsArray = new Array(regExpOptions.length);
  14100. // Parse options
  14101. for (i = 0; i < regExpOptions.length; i++) {
  14102. switch (regExpOptions[i]) {
  14103. case 'm':
  14104. optionsArray[i] = 'm';
  14105. break;
  14106. case 's':
  14107. optionsArray[i] = 'g';
  14108. break;
  14109. case 'i':
  14110. optionsArray[i] = 'i';
  14111. break;
  14112. }
  14113. }
  14114. object[name] = new RegExp(source, optionsArray.join(''));
  14115. } else if (elementType === BSON.BSON_DATA_REGEXP && bsonRegExp === true) {
  14116. // Get the start search index
  14117. i = index;
  14118. // Locate the end of the c string
  14119. while (buffer[i] !== 0x00 && i < buffer.length) {
  14120. i++;
  14121. }
  14122. // If are at the end of the buffer there is a problem with the document
  14123. if (i >= buffer.length) throw new Error('Bad BSON Document: illegal CString');
  14124. // Return the C string
  14125. source = buffer.toString('utf8', index, i);
  14126. index = i + 1;
  14127. // Get the start search index
  14128. i = index;
  14129. // Locate the end of the c string
  14130. while (buffer[i] !== 0x00 && i < buffer.length) {
  14131. i++;
  14132. }
  14133. // If are at the end of the buffer there is a problem with the document
  14134. if (i >= buffer.length) throw new Error('Bad BSON Document: illegal CString');
  14135. // Return the C string
  14136. regExpOptions = buffer.toString('utf8', index, i);
  14137. index = i + 1;
  14138. // Set the object
  14139. object[name] = new BSONRegExp(source, regExpOptions);
  14140. } else if (elementType === BSON.BSON_DATA_SYMBOL) {
  14141. stringSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  14142. if (stringSize <= 0 || stringSize > buffer.length - index || buffer[index + stringSize - 1] !== 0) throw new Error('bad string length in bson');
  14143. object[name] = new Symbol(buffer.toString('utf8', index, index + stringSize - 1));
  14144. index = index + stringSize;
  14145. } else if (elementType === BSON.BSON_DATA_TIMESTAMP) {
  14146. lowBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  14147. highBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  14148. object[name] = new Timestamp(lowBits, highBits);
  14149. } else if (elementType === BSON.BSON_DATA_MIN_KEY) {
  14150. object[name] = new MinKey();
  14151. } else if (elementType === BSON.BSON_DATA_MAX_KEY) {
  14152. object[name] = new MaxKey();
  14153. } else if (elementType === BSON.BSON_DATA_CODE) {
  14154. stringSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  14155. if (stringSize <= 0 || stringSize > buffer.length - index || buffer[index + stringSize - 1] !== 0) throw new Error('bad string length in bson');
  14156. var functionString = buffer.toString('utf8', index, index + stringSize - 1);
  14157. // If we are evaluating the functions
  14158. if (evalFunctions) {
  14159. // If we have cache enabled let's look for the md5 of the function in the cache
  14160. if (cacheFunctions) {
  14161. var hash = cacheFunctionsCrc32 ? crc32(functionString) : functionString;
  14162. // Got to do this to avoid V8 deoptimizing the call due to finding eval
  14163. object[name] = isolateEvalWithHash(functionCache, hash, functionString, object);
  14164. } else {
  14165. object[name] = isolateEval(functionString);
  14166. }
  14167. } else {
  14168. object[name] = new Code(functionString);
  14169. }
  14170. // Update parse index position
  14171. index = index + stringSize;
  14172. } else if (elementType === BSON.BSON_DATA_CODE_W_SCOPE) {
  14173. var totalSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  14174. // Element cannot be shorter than totalSize + stringSize + documentSize + terminator
  14175. if (totalSize < 4 + 4 + 4 + 1) {
  14176. throw new Error('code_w_scope total size shorter minimum expected length');
  14177. }
  14178. // Get the code string size
  14179. stringSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  14180. // Check if we have a valid string
  14181. if (stringSize <= 0 || stringSize > buffer.length - index || buffer[index + stringSize - 1] !== 0) throw new Error('bad string length in bson');
  14182. // Javascript function
  14183. functionString = buffer.toString('utf8', index, index + stringSize - 1);
  14184. // Update parse index position
  14185. index = index + stringSize;
  14186. // Parse the element
  14187. _index = index;
  14188. // Decode the size of the object document
  14189. objectSize = buffer[index] | buffer[index + 1] << 8 | buffer[index + 2] << 16 | buffer[index + 3] << 24;
  14190. // Decode the scope object
  14191. var scopeObject = deserializeObject(buffer, _index, options, false);
  14192. // Adjust the index
  14193. index = index + objectSize;
  14194. // Check if field length is to short
  14195. if (totalSize < 4 + 4 + objectSize + stringSize) {
  14196. throw new Error('code_w_scope total size is to short, truncating scope');
  14197. }
  14198. // Check if totalSize field is to long
  14199. if (totalSize > 4 + 4 + objectSize + stringSize) {
  14200. throw new Error('code_w_scope total size is to long, clips outer document');
  14201. }
  14202. // If we are evaluating the functions
  14203. if (evalFunctions) {
  14204. // If we have cache enabled let's look for the md5 of the function in the cache
  14205. if (cacheFunctions) {
  14206. hash = cacheFunctionsCrc32 ? crc32(functionString) : functionString;
  14207. // Got to do this to avoid V8 deoptimizing the call due to finding eval
  14208. object[name] = isolateEvalWithHash(functionCache, hash, functionString, object);
  14209. } else {
  14210. object[name] = isolateEval(functionString);
  14211. }
  14212. object[name].scope = scopeObject;
  14213. } else {
  14214. object[name] = new Code(functionString, scopeObject);
  14215. }
  14216. } else if (elementType === BSON.BSON_DATA_DBPOINTER) {
  14217. // Get the code string size
  14218. stringSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  14219. // Check if we have a valid string
  14220. if (stringSize <= 0 || stringSize > buffer.length - index || buffer[index + stringSize - 1] !== 0) throw new Error('bad string length in bson');
  14221. // Namespace
  14222. var namespace = buffer.toString('utf8', index, index + stringSize - 1);
  14223. // Update parse index position
  14224. index = index + stringSize;
  14225. // Read the oid
  14226. var oidBuffer = utils.allocBuffer(12);
  14227. buffer.copy(oidBuffer, 0, index, index + 12);
  14228. oid = new ObjectID(oidBuffer);
  14229. // Update the index
  14230. index = index + 12;
  14231. // Split the namespace
  14232. var parts = namespace.split('.');
  14233. var db = parts.shift();
  14234. var collection = parts.join('.');
  14235. // Upgrade to DBRef type
  14236. object[name] = new DBRef(collection, oid, db);
  14237. } else {
  14238. throw new Error('Detected unknown BSON type ' + elementType.toString(16) + ' for fieldname "' + name + '", are you using the latest BSON parser');
  14239. }
  14240. }
  14241. // Check if the deserialization was against a valid array/object
  14242. if (size !== index - startIndex) {
  14243. if (isArray) throw new Error('corrupt array bson');
  14244. throw new Error('corrupt object bson');
  14245. }
  14246. // Check if we have a db ref object
  14247. if (object['$id'] != null) object = new DBRef(object['$ref'], object['$id'], object['$db']);
  14248. return object;
  14249. };
  14250. /**
  14251. * Ensure eval is isolated.
  14252. *
  14253. * @ignore
  14254. * @api private
  14255. */
  14256. var isolateEvalWithHash = function (functionCache, hash, functionString, object) {
  14257. // Contains the value we are going to set
  14258. var value = null;
  14259. // Check for cache hit, eval if missing and return cached function
  14260. if (functionCache[hash] == null) {
  14261. eval('value = ' + functionString);
  14262. functionCache[hash] = value;
  14263. }
  14264. // Set the object
  14265. return functionCache[hash].bind(object);
  14266. };
  14267. /**
  14268. * Ensure eval is isolated.
  14269. *
  14270. * @ignore
  14271. * @api private
  14272. */
  14273. var isolateEval = function (functionString) {
  14274. // Contains the value we are going to set
  14275. var value = null;
  14276. // Eval the function
  14277. eval('value = ' + functionString);
  14278. return value;
  14279. };
  14280. var BSON = {};
  14281. /**
  14282. * Contains the function cache if we have that enable to allow for avoiding the eval step on each deserialization, comparison is by md5
  14283. *
  14284. * @ignore
  14285. * @api private
  14286. */
  14287. var functionCache = BSON.functionCache = {};
  14288. /**
  14289. * Number BSON Type
  14290. *
  14291. * @classconstant BSON_DATA_NUMBER
  14292. **/
  14293. BSON.BSON_DATA_NUMBER = 1;
  14294. /**
  14295. * String BSON Type
  14296. *
  14297. * @classconstant BSON_DATA_STRING
  14298. **/
  14299. BSON.BSON_DATA_STRING = 2;
  14300. /**
  14301. * Object BSON Type
  14302. *
  14303. * @classconstant BSON_DATA_OBJECT
  14304. **/
  14305. BSON.BSON_DATA_OBJECT = 3;
  14306. /**
  14307. * Array BSON Type
  14308. *
  14309. * @classconstant BSON_DATA_ARRAY
  14310. **/
  14311. BSON.BSON_DATA_ARRAY = 4;
  14312. /**
  14313. * Binary BSON Type
  14314. *
  14315. * @classconstant BSON_DATA_BINARY
  14316. **/
  14317. BSON.BSON_DATA_BINARY = 5;
  14318. /**
  14319. * Binary BSON Type
  14320. *
  14321. * @classconstant BSON_DATA_UNDEFINED
  14322. **/
  14323. BSON.BSON_DATA_UNDEFINED = 6;
  14324. /**
  14325. * ObjectID BSON Type
  14326. *
  14327. * @classconstant BSON_DATA_OID
  14328. **/
  14329. BSON.BSON_DATA_OID = 7;
  14330. /**
  14331. * Boolean BSON Type
  14332. *
  14333. * @classconstant BSON_DATA_BOOLEAN
  14334. **/
  14335. BSON.BSON_DATA_BOOLEAN = 8;
  14336. /**
  14337. * Date BSON Type
  14338. *
  14339. * @classconstant BSON_DATA_DATE
  14340. **/
  14341. BSON.BSON_DATA_DATE = 9;
  14342. /**
  14343. * null BSON Type
  14344. *
  14345. * @classconstant BSON_DATA_NULL
  14346. **/
  14347. BSON.BSON_DATA_NULL = 10;
  14348. /**
  14349. * RegExp BSON Type
  14350. *
  14351. * @classconstant BSON_DATA_REGEXP
  14352. **/
  14353. BSON.BSON_DATA_REGEXP = 11;
  14354. /**
  14355. * Code BSON Type
  14356. *
  14357. * @classconstant BSON_DATA_DBPOINTER
  14358. **/
  14359. BSON.BSON_DATA_DBPOINTER = 12;
  14360. /**
  14361. * Code BSON Type
  14362. *
  14363. * @classconstant BSON_DATA_CODE
  14364. **/
  14365. BSON.BSON_DATA_CODE = 13;
  14366. /**
  14367. * Symbol BSON Type
  14368. *
  14369. * @classconstant BSON_DATA_SYMBOL
  14370. **/
  14371. BSON.BSON_DATA_SYMBOL = 14;
  14372. /**
  14373. * Code with Scope BSON Type
  14374. *
  14375. * @classconstant BSON_DATA_CODE_W_SCOPE
  14376. **/
  14377. BSON.BSON_DATA_CODE_W_SCOPE = 15;
  14378. /**
  14379. * 32 bit Integer BSON Type
  14380. *
  14381. * @classconstant BSON_DATA_INT
  14382. **/
  14383. BSON.BSON_DATA_INT = 16;
  14384. /**
  14385. * Timestamp BSON Type
  14386. *
  14387. * @classconstant BSON_DATA_TIMESTAMP
  14388. **/
  14389. BSON.BSON_DATA_TIMESTAMP = 17;
  14390. /**
  14391. * Long BSON Type
  14392. *
  14393. * @classconstant BSON_DATA_LONG
  14394. **/
  14395. BSON.BSON_DATA_LONG = 18;
  14396. /**
  14397. * Long BSON Type
  14398. *
  14399. * @classconstant BSON_DATA_DECIMAL128
  14400. **/
  14401. BSON.BSON_DATA_DECIMAL128 = 19;
  14402. /**
  14403. * MinKey BSON Type
  14404. *
  14405. * @classconstant BSON_DATA_MIN_KEY
  14406. **/
  14407. BSON.BSON_DATA_MIN_KEY = 0xff;
  14408. /**
  14409. * MaxKey BSON Type
  14410. *
  14411. * @classconstant BSON_DATA_MAX_KEY
  14412. **/
  14413. BSON.BSON_DATA_MAX_KEY = 0x7f;
  14414. /**
  14415. * Binary Default Type
  14416. *
  14417. * @classconstant BSON_BINARY_SUBTYPE_DEFAULT
  14418. **/
  14419. BSON.BSON_BINARY_SUBTYPE_DEFAULT = 0;
  14420. /**
  14421. * Binary Function Type
  14422. *
  14423. * @classconstant BSON_BINARY_SUBTYPE_FUNCTION
  14424. **/
  14425. BSON.BSON_BINARY_SUBTYPE_FUNCTION = 1;
  14426. /**
  14427. * Binary Byte Array Type
  14428. *
  14429. * @classconstant BSON_BINARY_SUBTYPE_BYTE_ARRAY
  14430. **/
  14431. BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2;
  14432. /**
  14433. * Binary UUID Type
  14434. *
  14435. * @classconstant BSON_BINARY_SUBTYPE_UUID
  14436. **/
  14437. BSON.BSON_BINARY_SUBTYPE_UUID = 3;
  14438. /**
  14439. * Binary MD5 Type
  14440. *
  14441. * @classconstant BSON_BINARY_SUBTYPE_MD5
  14442. **/
  14443. BSON.BSON_BINARY_SUBTYPE_MD5 = 4;
  14444. /**
  14445. * Binary User Defined Type
  14446. *
  14447. * @classconstant BSON_BINARY_SUBTYPE_USER_DEFINED
  14448. **/
  14449. BSON.BSON_BINARY_SUBTYPE_USER_DEFINED = 128;
  14450. // BSON MAX VALUES
  14451. BSON.BSON_INT32_MAX = 0x7fffffff;
  14452. BSON.BSON_INT32_MIN = -0x80000000;
  14453. BSON.BSON_INT64_MAX = Math.pow(2, 63) - 1;
  14454. BSON.BSON_INT64_MIN = -Math.pow(2, 63);
  14455. // JS MAX PRECISE VALUES
  14456. BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
  14457. BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
  14458. // Internal long versions
  14459. var JS_INT_MAX_LONG = Long.fromNumber(0x20000000000000); // Any integer up to 2^53 can be precisely represented by a double.
  14460. var JS_INT_MIN_LONG = Long.fromNumber(-0x20000000000000); // Any integer down to -2^53 can be precisely represented by a double.
  14461. module.exports = deserialize;
  14462. /***/ }),
  14463. /* 358 */
  14464. /***/ (function(module, exports, __webpack_require__) {
  14465. /* WEBPACK VAR INJECTION */(function(Buffer) {'use strict';
  14466. var writeIEEE754 = __webpack_require__(359).writeIEEE754,
  14467. Long = __webpack_require__(335).Long,
  14468. Map = __webpack_require__(334),
  14469. Binary = __webpack_require__(356).Binary;
  14470. var normalizedFunctionString = __webpack_require__(344).normalizedFunctionString;
  14471. // try {
  14472. // var _Buffer = Uint8Array;
  14473. // } catch (e) {
  14474. // _Buffer = Buffer;
  14475. // }
  14476. var regexp = /\x00/; // eslint-disable-line no-control-regex
  14477. var ignoreKeys = ['$db', '$ref', '$id', '$clusterTime'];
  14478. // To ensure that 0.4 of node works correctly
  14479. var isDate = function isDate(d) {
  14480. return typeof d === 'object' && Object.prototype.toString.call(d) === '[object Date]';
  14481. };
  14482. var isRegExp = function isRegExp(d) {
  14483. return Object.prototype.toString.call(d) === '[object RegExp]';
  14484. };
  14485. var serializeString = function (buffer, key, value, index, isArray) {
  14486. // Encode String type
  14487. buffer[index++] = BSON.BSON_DATA_STRING;
  14488. // Number of written bytes
  14489. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14490. // Encode the name
  14491. index = index + numberOfWrittenBytes + 1;
  14492. buffer[index - 1] = 0;
  14493. // Write the string
  14494. var size = buffer.write(value, index + 4, 'utf8');
  14495. // Write the size of the string to buffer
  14496. buffer[index + 3] = size + 1 >> 24 & 0xff;
  14497. buffer[index + 2] = size + 1 >> 16 & 0xff;
  14498. buffer[index + 1] = size + 1 >> 8 & 0xff;
  14499. buffer[index] = size + 1 & 0xff;
  14500. // Update index
  14501. index = index + 4 + size;
  14502. // Write zero
  14503. buffer[index++] = 0;
  14504. return index;
  14505. };
  14506. var serializeNumber = function (buffer, key, value, index, isArray) {
  14507. // We have an integer value
  14508. if (Math.floor(value) === value && value >= BSON.JS_INT_MIN && value <= BSON.JS_INT_MAX) {
  14509. // If the value fits in 32 bits encode as int, if it fits in a double
  14510. // encode it as a double, otherwise long
  14511. if (value >= BSON.BSON_INT32_MIN && value <= BSON.BSON_INT32_MAX) {
  14512. // Set int type 32 bits or less
  14513. buffer[index++] = BSON.BSON_DATA_INT;
  14514. // Number of written bytes
  14515. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14516. // Encode the name
  14517. index = index + numberOfWrittenBytes;
  14518. buffer[index++] = 0;
  14519. // Write the int value
  14520. buffer[index++] = value & 0xff;
  14521. buffer[index++] = value >> 8 & 0xff;
  14522. buffer[index++] = value >> 16 & 0xff;
  14523. buffer[index++] = value >> 24 & 0xff;
  14524. } else if (value >= BSON.JS_INT_MIN && value <= BSON.JS_INT_MAX) {
  14525. // Encode as double
  14526. buffer[index++] = BSON.BSON_DATA_NUMBER;
  14527. // Number of written bytes
  14528. numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14529. // Encode the name
  14530. index = index + numberOfWrittenBytes;
  14531. buffer[index++] = 0;
  14532. // Write float
  14533. writeIEEE754(buffer, value, index, 'little', 52, 8);
  14534. // Ajust index
  14535. index = index + 8;
  14536. } else {
  14537. // Set long type
  14538. buffer[index++] = BSON.BSON_DATA_LONG;
  14539. // Number of written bytes
  14540. numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14541. // Encode the name
  14542. index = index + numberOfWrittenBytes;
  14543. buffer[index++] = 0;
  14544. var longVal = Long.fromNumber(value);
  14545. var lowBits = longVal.getLowBits();
  14546. var highBits = longVal.getHighBits();
  14547. // Encode low bits
  14548. buffer[index++] = lowBits & 0xff;
  14549. buffer[index++] = lowBits >> 8 & 0xff;
  14550. buffer[index++] = lowBits >> 16 & 0xff;
  14551. buffer[index++] = lowBits >> 24 & 0xff;
  14552. // Encode high bits
  14553. buffer[index++] = highBits & 0xff;
  14554. buffer[index++] = highBits >> 8 & 0xff;
  14555. buffer[index++] = highBits >> 16 & 0xff;
  14556. buffer[index++] = highBits >> 24 & 0xff;
  14557. }
  14558. } else {
  14559. // Encode as double
  14560. buffer[index++] = BSON.BSON_DATA_NUMBER;
  14561. // Number of written bytes
  14562. numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14563. // Encode the name
  14564. index = index + numberOfWrittenBytes;
  14565. buffer[index++] = 0;
  14566. // Write float
  14567. writeIEEE754(buffer, value, index, 'little', 52, 8);
  14568. // Ajust index
  14569. index = index + 8;
  14570. }
  14571. return index;
  14572. };
  14573. var serializeNull = function (buffer, key, value, index, isArray) {
  14574. // Set long type
  14575. buffer[index++] = BSON.BSON_DATA_NULL;
  14576. // Number of written bytes
  14577. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14578. // Encode the name
  14579. index = index + numberOfWrittenBytes;
  14580. buffer[index++] = 0;
  14581. return index;
  14582. };
  14583. var serializeBoolean = function (buffer, key, value, index, isArray) {
  14584. // Write the type
  14585. buffer[index++] = BSON.BSON_DATA_BOOLEAN;
  14586. // Number of written bytes
  14587. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14588. // Encode the name
  14589. index = index + numberOfWrittenBytes;
  14590. buffer[index++] = 0;
  14591. // Encode the boolean value
  14592. buffer[index++] = value ? 1 : 0;
  14593. return index;
  14594. };
  14595. var serializeDate = function (buffer, key, value, index, isArray) {
  14596. // Write the type
  14597. buffer[index++] = BSON.BSON_DATA_DATE;
  14598. // Number of written bytes
  14599. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14600. // Encode the name
  14601. index = index + numberOfWrittenBytes;
  14602. buffer[index++] = 0;
  14603. // Write the date
  14604. var dateInMilis = Long.fromNumber(value.getTime());
  14605. var lowBits = dateInMilis.getLowBits();
  14606. var highBits = dateInMilis.getHighBits();
  14607. // Encode low bits
  14608. buffer[index++] = lowBits & 0xff;
  14609. buffer[index++] = lowBits >> 8 & 0xff;
  14610. buffer[index++] = lowBits >> 16 & 0xff;
  14611. buffer[index++] = lowBits >> 24 & 0xff;
  14612. // Encode high bits
  14613. buffer[index++] = highBits & 0xff;
  14614. buffer[index++] = highBits >> 8 & 0xff;
  14615. buffer[index++] = highBits >> 16 & 0xff;
  14616. buffer[index++] = highBits >> 24 & 0xff;
  14617. return index;
  14618. };
  14619. var serializeRegExp = function (buffer, key, value, index, isArray) {
  14620. // Write the type
  14621. buffer[index++] = BSON.BSON_DATA_REGEXP;
  14622. // Number of written bytes
  14623. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14624. // Encode the name
  14625. index = index + numberOfWrittenBytes;
  14626. buffer[index++] = 0;
  14627. if (value.source && value.source.match(regexp) != null) {
  14628. throw Error('value ' + value.source + ' must not contain null bytes');
  14629. }
  14630. // Adjust the index
  14631. index = index + buffer.write(value.source, index, 'utf8');
  14632. // Write zero
  14633. buffer[index++] = 0x00;
  14634. // Write the parameters
  14635. if (value.global) buffer[index++] = 0x73; // s
  14636. if (value.ignoreCase) buffer[index++] = 0x69; // i
  14637. if (value.multiline) buffer[index++] = 0x6d; // m
  14638. // Add ending zero
  14639. buffer[index++] = 0x00;
  14640. return index;
  14641. };
  14642. var serializeBSONRegExp = function (buffer, key, value, index, isArray) {
  14643. // Write the type
  14644. buffer[index++] = BSON.BSON_DATA_REGEXP;
  14645. // Number of written bytes
  14646. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14647. // Encode the name
  14648. index = index + numberOfWrittenBytes;
  14649. buffer[index++] = 0;
  14650. // Check the pattern for 0 bytes
  14651. if (value.pattern.match(regexp) != null) {
  14652. // The BSON spec doesn't allow keys with null bytes because keys are
  14653. // null-terminated.
  14654. throw Error('pattern ' + value.pattern + ' must not contain null bytes');
  14655. }
  14656. // Adjust the index
  14657. index = index + buffer.write(value.pattern, index, 'utf8');
  14658. // Write zero
  14659. buffer[index++] = 0x00;
  14660. // Write the options
  14661. index = index + buffer.write(value.options.split('').sort().join(''), index, 'utf8');
  14662. // Add ending zero
  14663. buffer[index++] = 0x00;
  14664. return index;
  14665. };
  14666. var serializeMinMax = function (buffer, key, value, index, isArray) {
  14667. // Write the type of either min or max key
  14668. if (value === null) {
  14669. buffer[index++] = BSON.BSON_DATA_NULL;
  14670. } else if (value._bsontype === 'MinKey') {
  14671. buffer[index++] = BSON.BSON_DATA_MIN_KEY;
  14672. } else {
  14673. buffer[index++] = BSON.BSON_DATA_MAX_KEY;
  14674. }
  14675. // Number of written bytes
  14676. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14677. // Encode the name
  14678. index = index + numberOfWrittenBytes;
  14679. buffer[index++] = 0;
  14680. return index;
  14681. };
  14682. var serializeObjectId = function (buffer, key, value, index, isArray) {
  14683. // Write the type
  14684. buffer[index++] = BSON.BSON_DATA_OID;
  14685. // Number of written bytes
  14686. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14687. // Encode the name
  14688. index = index + numberOfWrittenBytes;
  14689. buffer[index++] = 0;
  14690. // Write the objectId into the shared buffer
  14691. if (typeof value.id === 'string') {
  14692. buffer.write(value.id, index, 'binary');
  14693. } else if (value.id && value.id.copy) {
  14694. value.id.copy(buffer, index, 0, 12);
  14695. } else {
  14696. throw new Error('object [' + JSON.stringify(value) + '] is not a valid ObjectId');
  14697. }
  14698. // Ajust index
  14699. return index + 12;
  14700. };
  14701. var serializeBuffer = function (buffer, key, value, index, isArray) {
  14702. // Write the type
  14703. buffer[index++] = BSON.BSON_DATA_BINARY;
  14704. // Number of written bytes
  14705. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14706. // Encode the name
  14707. index = index + numberOfWrittenBytes;
  14708. buffer[index++] = 0;
  14709. // Get size of the buffer (current write point)
  14710. var size = value.length;
  14711. // Write the size of the string to buffer
  14712. buffer[index++] = size & 0xff;
  14713. buffer[index++] = size >> 8 & 0xff;
  14714. buffer[index++] = size >> 16 & 0xff;
  14715. buffer[index++] = size >> 24 & 0xff;
  14716. // Write the default subtype
  14717. buffer[index++] = BSON.BSON_BINARY_SUBTYPE_DEFAULT;
  14718. // Copy the content form the binary field to the buffer
  14719. value.copy(buffer, index, 0, size);
  14720. // Adjust the index
  14721. index = index + size;
  14722. return index;
  14723. };
  14724. var serializeObject = function (buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, isArray, path) {
  14725. for (var i = 0; i < path.length; i++) {
  14726. if (path[i] === value) throw new Error('cyclic dependency detected');
  14727. }
  14728. // Push value to stack
  14729. path.push(value);
  14730. // Write the type
  14731. buffer[index++] = Array.isArray(value) ? BSON.BSON_DATA_ARRAY : BSON.BSON_DATA_OBJECT;
  14732. // Number of written bytes
  14733. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14734. // Encode the name
  14735. index = index + numberOfWrittenBytes;
  14736. buffer[index++] = 0;
  14737. var endIndex = serializeInto(buffer, value, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined, path);
  14738. // Pop stack
  14739. path.pop();
  14740. // Write size
  14741. return endIndex;
  14742. };
  14743. var serializeDecimal128 = function (buffer, key, value, index, isArray) {
  14744. buffer[index++] = BSON.BSON_DATA_DECIMAL128;
  14745. // Number of written bytes
  14746. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14747. // Encode the name
  14748. index = index + numberOfWrittenBytes;
  14749. buffer[index++] = 0;
  14750. // Write the data from the value
  14751. value.bytes.copy(buffer, index, 0, 16);
  14752. return index + 16;
  14753. };
  14754. var serializeLong = function (buffer, key, value, index, isArray) {
  14755. // Write the type
  14756. buffer[index++] = value._bsontype === 'Long' ? BSON.BSON_DATA_LONG : BSON.BSON_DATA_TIMESTAMP;
  14757. // Number of written bytes
  14758. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14759. // Encode the name
  14760. index = index + numberOfWrittenBytes;
  14761. buffer[index++] = 0;
  14762. // Write the date
  14763. var lowBits = value.getLowBits();
  14764. var highBits = value.getHighBits();
  14765. // Encode low bits
  14766. buffer[index++] = lowBits & 0xff;
  14767. buffer[index++] = lowBits >> 8 & 0xff;
  14768. buffer[index++] = lowBits >> 16 & 0xff;
  14769. buffer[index++] = lowBits >> 24 & 0xff;
  14770. // Encode high bits
  14771. buffer[index++] = highBits & 0xff;
  14772. buffer[index++] = highBits >> 8 & 0xff;
  14773. buffer[index++] = highBits >> 16 & 0xff;
  14774. buffer[index++] = highBits >> 24 & 0xff;
  14775. return index;
  14776. };
  14777. var serializeInt32 = function (buffer, key, value, index, isArray) {
  14778. // Set int type 32 bits or less
  14779. buffer[index++] = BSON.BSON_DATA_INT;
  14780. // Number of written bytes
  14781. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14782. // Encode the name
  14783. index = index + numberOfWrittenBytes;
  14784. buffer[index++] = 0;
  14785. // Write the int value
  14786. buffer[index++] = value & 0xff;
  14787. buffer[index++] = value >> 8 & 0xff;
  14788. buffer[index++] = value >> 16 & 0xff;
  14789. buffer[index++] = value >> 24 & 0xff;
  14790. return index;
  14791. };
  14792. var serializeDouble = function (buffer, key, value, index, isArray) {
  14793. // Encode as double
  14794. buffer[index++] = BSON.BSON_DATA_NUMBER;
  14795. // Number of written bytes
  14796. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14797. // Encode the name
  14798. index = index + numberOfWrittenBytes;
  14799. buffer[index++] = 0;
  14800. // Write float
  14801. writeIEEE754(buffer, value, index, 'little', 52, 8);
  14802. // Ajust index
  14803. index = index + 8;
  14804. return index;
  14805. };
  14806. var serializeFunction = function (buffer, key, value, index, checkKeys, depth, isArray) {
  14807. buffer[index++] = BSON.BSON_DATA_CODE;
  14808. // Number of written bytes
  14809. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14810. // Encode the name
  14811. index = index + numberOfWrittenBytes;
  14812. buffer[index++] = 0;
  14813. // Function string
  14814. var functionString = normalizedFunctionString(value);
  14815. // Write the string
  14816. var size = buffer.write(functionString, index + 4, 'utf8') + 1;
  14817. // Write the size of the string to buffer
  14818. buffer[index] = size & 0xff;
  14819. buffer[index + 1] = size >> 8 & 0xff;
  14820. buffer[index + 2] = size >> 16 & 0xff;
  14821. buffer[index + 3] = size >> 24 & 0xff;
  14822. // Update index
  14823. index = index + 4 + size - 1;
  14824. // Write zero
  14825. buffer[index++] = 0;
  14826. return index;
  14827. };
  14828. var serializeCode = function (buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, isArray) {
  14829. if (value.scope && typeof value.scope === 'object') {
  14830. // Write the type
  14831. buffer[index++] = BSON.BSON_DATA_CODE_W_SCOPE;
  14832. // Number of written bytes
  14833. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14834. // Encode the name
  14835. index = index + numberOfWrittenBytes;
  14836. buffer[index++] = 0;
  14837. // Starting index
  14838. var startIndex = index;
  14839. // Serialize the function
  14840. // Get the function string
  14841. var functionString = typeof value.code === 'string' ? value.code : value.code.toString();
  14842. // Index adjustment
  14843. index = index + 4;
  14844. // Write string into buffer
  14845. var codeSize = buffer.write(functionString, index + 4, 'utf8') + 1;
  14846. // Write the size of the string to buffer
  14847. buffer[index] = codeSize & 0xff;
  14848. buffer[index + 1] = codeSize >> 8 & 0xff;
  14849. buffer[index + 2] = codeSize >> 16 & 0xff;
  14850. buffer[index + 3] = codeSize >> 24 & 0xff;
  14851. // Write end 0
  14852. buffer[index + 4 + codeSize - 1] = 0;
  14853. // Write the
  14854. index = index + codeSize + 4;
  14855. //
  14856. // Serialize the scope value
  14857. var endIndex = serializeInto(buffer, value.scope, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined);
  14858. index = endIndex - 1;
  14859. // Writ the total
  14860. var totalSize = endIndex - startIndex;
  14861. // Write the total size of the object
  14862. buffer[startIndex++] = totalSize & 0xff;
  14863. buffer[startIndex++] = totalSize >> 8 & 0xff;
  14864. buffer[startIndex++] = totalSize >> 16 & 0xff;
  14865. buffer[startIndex++] = totalSize >> 24 & 0xff;
  14866. // Write trailing zero
  14867. buffer[index++] = 0;
  14868. } else {
  14869. buffer[index++] = BSON.BSON_DATA_CODE;
  14870. // Number of written bytes
  14871. numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14872. // Encode the name
  14873. index = index + numberOfWrittenBytes;
  14874. buffer[index++] = 0;
  14875. // Function string
  14876. functionString = value.code.toString();
  14877. // Write the string
  14878. var size = buffer.write(functionString, index + 4, 'utf8') + 1;
  14879. // Write the size of the string to buffer
  14880. buffer[index] = size & 0xff;
  14881. buffer[index + 1] = size >> 8 & 0xff;
  14882. buffer[index + 2] = size >> 16 & 0xff;
  14883. buffer[index + 3] = size >> 24 & 0xff;
  14884. // Update index
  14885. index = index + 4 + size - 1;
  14886. // Write zero
  14887. buffer[index++] = 0;
  14888. }
  14889. return index;
  14890. };
  14891. var serializeBinary = function (buffer, key, value, index, isArray) {
  14892. // Write the type
  14893. buffer[index++] = BSON.BSON_DATA_BINARY;
  14894. // Number of written bytes
  14895. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14896. // Encode the name
  14897. index = index + numberOfWrittenBytes;
  14898. buffer[index++] = 0;
  14899. // Extract the buffer
  14900. var data = value.value(true);
  14901. // Calculate size
  14902. var size = value.position;
  14903. // Add the deprecated 02 type 4 bytes of size to total
  14904. if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) size = size + 4;
  14905. // Write the size of the string to buffer
  14906. buffer[index++] = size & 0xff;
  14907. buffer[index++] = size >> 8 & 0xff;
  14908. buffer[index++] = size >> 16 & 0xff;
  14909. buffer[index++] = size >> 24 & 0xff;
  14910. // Write the subtype to the buffer
  14911. buffer[index++] = value.sub_type;
  14912. // If we have binary type 2 the 4 first bytes are the size
  14913. if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) {
  14914. size = size - 4;
  14915. buffer[index++] = size & 0xff;
  14916. buffer[index++] = size >> 8 & 0xff;
  14917. buffer[index++] = size >> 16 & 0xff;
  14918. buffer[index++] = size >> 24 & 0xff;
  14919. }
  14920. // Write the data to the object
  14921. data.copy(buffer, index, 0, value.position);
  14922. // Adjust the index
  14923. index = index + value.position;
  14924. return index;
  14925. };
  14926. var serializeSymbol = function (buffer, key, value, index, isArray) {
  14927. // Write the type
  14928. buffer[index++] = BSON.BSON_DATA_SYMBOL;
  14929. // Number of written bytes
  14930. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14931. // Encode the name
  14932. index = index + numberOfWrittenBytes;
  14933. buffer[index++] = 0;
  14934. // Write the string
  14935. var size = buffer.write(value.value, index + 4, 'utf8') + 1;
  14936. // Write the size of the string to buffer
  14937. buffer[index] = size & 0xff;
  14938. buffer[index + 1] = size >> 8 & 0xff;
  14939. buffer[index + 2] = size >> 16 & 0xff;
  14940. buffer[index + 3] = size >> 24 & 0xff;
  14941. // Update index
  14942. index = index + 4 + size - 1;
  14943. // Write zero
  14944. buffer[index++] = 0x00;
  14945. return index;
  14946. };
  14947. var serializeDBRef = function (buffer, key, value, index, depth, serializeFunctions, isArray) {
  14948. // Write the type
  14949. buffer[index++] = BSON.BSON_DATA_OBJECT;
  14950. // Number of written bytes
  14951. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14952. // Encode the name
  14953. index = index + numberOfWrittenBytes;
  14954. buffer[index++] = 0;
  14955. var startIndex = index;
  14956. var endIndex;
  14957. // Serialize object
  14958. if (null != value.db) {
  14959. endIndex = serializeInto(buffer, {
  14960. $ref: value.namespace,
  14961. $id: value.oid,
  14962. $db: value.db
  14963. }, false, index, depth + 1, serializeFunctions);
  14964. } else {
  14965. endIndex = serializeInto(buffer, {
  14966. $ref: value.namespace,
  14967. $id: value.oid
  14968. }, false, index, depth + 1, serializeFunctions);
  14969. }
  14970. // Calculate object size
  14971. var size = endIndex - startIndex;
  14972. // Write the size
  14973. buffer[startIndex++] = size & 0xff;
  14974. buffer[startIndex++] = size >> 8 & 0xff;
  14975. buffer[startIndex++] = size >> 16 & 0xff;
  14976. buffer[startIndex++] = size >> 24 & 0xff;
  14977. // Set index
  14978. return endIndex;
  14979. };
  14980. var serializeInto = function serializeInto(buffer, object, checkKeys, startingIndex, depth, serializeFunctions, ignoreUndefined, path) {
  14981. startingIndex = startingIndex || 0;
  14982. path = path || [];
  14983. // Push the object to the path
  14984. path.push(object);
  14985. // Start place to serialize into
  14986. var index = startingIndex + 4;
  14987. // var self = this;
  14988. // Special case isArray
  14989. if (Array.isArray(object)) {
  14990. // Get object keys
  14991. for (var i = 0; i < object.length; i++) {
  14992. var key = '' + i;
  14993. var value = object[i];
  14994. // Is there an override value
  14995. if (value && value.toBSON) {
  14996. if (typeof value.toBSON !== 'function') throw new Error('toBSON is not a function');
  14997. value = value.toBSON();
  14998. }
  14999. var type = typeof value;
  15000. if (type === 'string') {
  15001. index = serializeString(buffer, key, value, index, true);
  15002. } else if (type === 'number') {
  15003. index = serializeNumber(buffer, key, value, index, true);
  15004. } else if (type === 'boolean') {
  15005. index = serializeBoolean(buffer, key, value, index, true);
  15006. } else if (value instanceof Date || isDate(value)) {
  15007. index = serializeDate(buffer, key, value, index, true);
  15008. } else if (value === undefined) {
  15009. index = serializeNull(buffer, key, value, index, true);
  15010. } else if (value === null) {
  15011. index = serializeNull(buffer, key, value, index, true);
  15012. } else if (value['_bsontype'] === 'ObjectID' || value['_bsontype'] === 'ObjectId') {
  15013. index = serializeObjectId(buffer, key, value, index, true);
  15014. } else if (Buffer.isBuffer(value)) {
  15015. index = serializeBuffer(buffer, key, value, index, true);
  15016. } else if (value instanceof RegExp || isRegExp(value)) {
  15017. index = serializeRegExp(buffer, key, value, index, true);
  15018. } else if (type === 'object' && value['_bsontype'] == null) {
  15019. index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, true, path);
  15020. } else if (type === 'object' && value['_bsontype'] === 'Decimal128') {
  15021. index = serializeDecimal128(buffer, key, value, index, true);
  15022. } else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') {
  15023. index = serializeLong(buffer, key, value, index, true);
  15024. } else if (value['_bsontype'] === 'Double') {
  15025. index = serializeDouble(buffer, key, value, index, true);
  15026. } else if (typeof value === 'function' && serializeFunctions) {
  15027. index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions, true);
  15028. } else if (value['_bsontype'] === 'Code') {
  15029. index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, true);
  15030. } else if (value['_bsontype'] === 'Binary') {
  15031. index = serializeBinary(buffer, key, value, index, true);
  15032. } else if (value['_bsontype'] === 'Symbol') {
  15033. index = serializeSymbol(buffer, key, value, index, true);
  15034. } else if (value['_bsontype'] === 'DBRef') {
  15035. index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions, true);
  15036. } else if (value['_bsontype'] === 'BSONRegExp') {
  15037. index = serializeBSONRegExp(buffer, key, value, index, true);
  15038. } else if (value['_bsontype'] === 'Int32') {
  15039. index = serializeInt32(buffer, key, value, index, true);
  15040. } else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') {
  15041. index = serializeMinMax(buffer, key, value, index, true);
  15042. } else if (typeof value['_bsontype'] !== 'undefined') {
  15043. throw new TypeError('Unrecognized or invalid _bsontype: ' + value['_bsontype']);
  15044. }
  15045. }
  15046. } else if (object instanceof Map) {
  15047. var iterator = object.entries();
  15048. var done = false;
  15049. while (!done) {
  15050. // Unpack the next entry
  15051. var entry = iterator.next();
  15052. done = entry.done;
  15053. // Are we done, then skip and terminate
  15054. if (done) continue;
  15055. // Get the entry values
  15056. key = entry.value[0];
  15057. value = entry.value[1];
  15058. // Check the type of the value
  15059. type = typeof value;
  15060. // Check the key and throw error if it's illegal
  15061. if (typeof key === 'string' && ignoreKeys.indexOf(key) === -1) {
  15062. if (key.match(regexp) != null) {
  15063. // The BSON spec doesn't allow keys with null bytes because keys are
  15064. // null-terminated.
  15065. throw Error('key ' + key + ' must not contain null bytes');
  15066. }
  15067. if (checkKeys) {
  15068. if ('$' === key[0]) {
  15069. throw Error('key ' + key + " must not start with '$'");
  15070. } else if (~key.indexOf('.')) {
  15071. throw Error('key ' + key + " must not contain '.'");
  15072. }
  15073. }
  15074. }
  15075. if (type === 'string') {
  15076. index = serializeString(buffer, key, value, index);
  15077. } else if (type === 'number') {
  15078. index = serializeNumber(buffer, key, value, index);
  15079. } else if (type === 'boolean') {
  15080. index = serializeBoolean(buffer, key, value, index);
  15081. } else if (value instanceof Date || isDate(value)) {
  15082. index = serializeDate(buffer, key, value, index);
  15083. // } else if (value === undefined && ignoreUndefined === true) {
  15084. } else if (value === null || value === undefined && ignoreUndefined === false) {
  15085. index = serializeNull(buffer, key, value, index);
  15086. } else if (value['_bsontype'] === 'ObjectID' || value['_bsontype'] === 'ObjectId') {
  15087. index = serializeObjectId(buffer, key, value, index);
  15088. } else if (Buffer.isBuffer(value)) {
  15089. index = serializeBuffer(buffer, key, value, index);
  15090. } else if (value instanceof RegExp || isRegExp(value)) {
  15091. index = serializeRegExp(buffer, key, value, index);
  15092. } else if (type === 'object' && value['_bsontype'] == null) {
  15093. index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, false, path);
  15094. } else if (type === 'object' && value['_bsontype'] === 'Decimal128') {
  15095. index = serializeDecimal128(buffer, key, value, index);
  15096. } else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') {
  15097. index = serializeLong(buffer, key, value, index);
  15098. } else if (value['_bsontype'] === 'Double') {
  15099. index = serializeDouble(buffer, key, value, index);
  15100. } else if (value['_bsontype'] === 'Code') {
  15101. index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined);
  15102. } else if (typeof value === 'function' && serializeFunctions) {
  15103. index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions);
  15104. } else if (value['_bsontype'] === 'Binary') {
  15105. index = serializeBinary(buffer, key, value, index);
  15106. } else if (value['_bsontype'] === 'Symbol') {
  15107. index = serializeSymbol(buffer, key, value, index);
  15108. } else if (value['_bsontype'] === 'DBRef') {
  15109. index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions);
  15110. } else if (value['_bsontype'] === 'BSONRegExp') {
  15111. index = serializeBSONRegExp(buffer, key, value, index);
  15112. } else if (value['_bsontype'] === 'Int32') {
  15113. index = serializeInt32(buffer, key, value, index);
  15114. } else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') {
  15115. index = serializeMinMax(buffer, key, value, index);
  15116. } else if (typeof value['_bsontype'] !== 'undefined') {
  15117. throw new TypeError('Unrecognized or invalid _bsontype: ' + value['_bsontype']);
  15118. }
  15119. }
  15120. } else {
  15121. // Did we provide a custom serialization method
  15122. if (object.toBSON) {
  15123. if (typeof object.toBSON !== 'function') throw new Error('toBSON is not a function');
  15124. object = object.toBSON();
  15125. if (object != null && typeof object !== 'object') throw new Error('toBSON function did not return an object');
  15126. }
  15127. // Iterate over all the keys
  15128. for (key in object) {
  15129. value = object[key];
  15130. // Is there an override value
  15131. if (value && value.toBSON) {
  15132. if (typeof value.toBSON !== 'function') throw new Error('toBSON is not a function');
  15133. value = value.toBSON();
  15134. }
  15135. // Check the type of the value
  15136. type = typeof value;
  15137. // Check the key and throw error if it's illegal
  15138. if (typeof key === 'string' && ignoreKeys.indexOf(key) === -1) {
  15139. if (key.match(regexp) != null) {
  15140. // The BSON spec doesn't allow keys with null bytes because keys are
  15141. // null-terminated.
  15142. throw Error('key ' + key + ' must not contain null bytes');
  15143. }
  15144. if (checkKeys) {
  15145. if ('$' === key[0]) {
  15146. throw Error('key ' + key + " must not start with '$'");
  15147. } else if (~key.indexOf('.')) {
  15148. throw Error('key ' + key + " must not contain '.'");
  15149. }
  15150. }
  15151. }
  15152. if (type === 'string') {
  15153. index = serializeString(buffer, key, value, index);
  15154. } else if (type === 'number') {
  15155. index = serializeNumber(buffer, key, value, index);
  15156. } else if (type === 'boolean') {
  15157. index = serializeBoolean(buffer, key, value, index);
  15158. } else if (value instanceof Date || isDate(value)) {
  15159. index = serializeDate(buffer, key, value, index);
  15160. } else if (value === undefined) {
  15161. if (ignoreUndefined === false) index = serializeNull(buffer, key, value, index);
  15162. } else if (value === null) {
  15163. index = serializeNull(buffer, key, value, index);
  15164. } else if (value['_bsontype'] === 'ObjectID' || value['_bsontype'] === 'ObjectId') {
  15165. index = serializeObjectId(buffer, key, value, index);
  15166. } else if (Buffer.isBuffer(value)) {
  15167. index = serializeBuffer(buffer, key, value, index);
  15168. } else if (value instanceof RegExp || isRegExp(value)) {
  15169. index = serializeRegExp(buffer, key, value, index);
  15170. } else if (type === 'object' && value['_bsontype'] == null) {
  15171. index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, false, path);
  15172. } else if (type === 'object' && value['_bsontype'] === 'Decimal128') {
  15173. index = serializeDecimal128(buffer, key, value, index);
  15174. } else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') {
  15175. index = serializeLong(buffer, key, value, index);
  15176. } else if (value['_bsontype'] === 'Double') {
  15177. index = serializeDouble(buffer, key, value, index);
  15178. } else if (value['_bsontype'] === 'Code') {
  15179. index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined);
  15180. } else if (typeof value === 'function' && serializeFunctions) {
  15181. index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions);
  15182. } else if (value['_bsontype'] === 'Binary') {
  15183. index = serializeBinary(buffer, key, value, index);
  15184. } else if (value['_bsontype'] === 'Symbol') {
  15185. index = serializeSymbol(buffer, key, value, index);
  15186. } else if (value['_bsontype'] === 'DBRef') {
  15187. index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions);
  15188. } else if (value['_bsontype'] === 'BSONRegExp') {
  15189. index = serializeBSONRegExp(buffer, key, value, index);
  15190. } else if (value['_bsontype'] === 'Int32') {
  15191. index = serializeInt32(buffer, key, value, index);
  15192. } else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') {
  15193. index = serializeMinMax(buffer, key, value, index);
  15194. } else if (typeof value['_bsontype'] !== 'undefined') {
  15195. throw new TypeError('Unrecognized or invalid _bsontype: ' + value['_bsontype']);
  15196. }
  15197. }
  15198. }
  15199. // Remove the path
  15200. path.pop();
  15201. // Final padding byte for object
  15202. buffer[index++] = 0x00;
  15203. // Final size
  15204. var size = index - startingIndex;
  15205. // Write the size of the object
  15206. buffer[startingIndex++] = size & 0xff;
  15207. buffer[startingIndex++] = size >> 8 & 0xff;
  15208. buffer[startingIndex++] = size >> 16 & 0xff;
  15209. buffer[startingIndex++] = size >> 24 & 0xff;
  15210. return index;
  15211. };
  15212. var BSON = {};
  15213. /**
  15214. * Contains the function cache if we have that enable to allow for avoiding the eval step on each deserialization, comparison is by md5
  15215. *
  15216. * @ignore
  15217. * @api private
  15218. */
  15219. // var functionCache = (BSON.functionCache = {});
  15220. /**
  15221. * Number BSON Type
  15222. *
  15223. * @classconstant BSON_DATA_NUMBER
  15224. **/
  15225. BSON.BSON_DATA_NUMBER = 1;
  15226. /**
  15227. * String BSON Type
  15228. *
  15229. * @classconstant BSON_DATA_STRING
  15230. **/
  15231. BSON.BSON_DATA_STRING = 2;
  15232. /**
  15233. * Object BSON Type
  15234. *
  15235. * @classconstant BSON_DATA_OBJECT
  15236. **/
  15237. BSON.BSON_DATA_OBJECT = 3;
  15238. /**
  15239. * Array BSON Type
  15240. *
  15241. * @classconstant BSON_DATA_ARRAY
  15242. **/
  15243. BSON.BSON_DATA_ARRAY = 4;
  15244. /**
  15245. * Binary BSON Type
  15246. *
  15247. * @classconstant BSON_DATA_BINARY
  15248. **/
  15249. BSON.BSON_DATA_BINARY = 5;
  15250. /**
  15251. * ObjectID BSON Type, deprecated
  15252. *
  15253. * @classconstant BSON_DATA_UNDEFINED
  15254. **/
  15255. BSON.BSON_DATA_UNDEFINED = 6;
  15256. /**
  15257. * ObjectID BSON Type
  15258. *
  15259. * @classconstant BSON_DATA_OID
  15260. **/
  15261. BSON.BSON_DATA_OID = 7;
  15262. /**
  15263. * Boolean BSON Type
  15264. *
  15265. * @classconstant BSON_DATA_BOOLEAN
  15266. **/
  15267. BSON.BSON_DATA_BOOLEAN = 8;
  15268. /**
  15269. * Date BSON Type
  15270. *
  15271. * @classconstant BSON_DATA_DATE
  15272. **/
  15273. BSON.BSON_DATA_DATE = 9;
  15274. /**
  15275. * null BSON Type
  15276. *
  15277. * @classconstant BSON_DATA_NULL
  15278. **/
  15279. BSON.BSON_DATA_NULL = 10;
  15280. /**
  15281. * RegExp BSON Type
  15282. *
  15283. * @classconstant BSON_DATA_REGEXP
  15284. **/
  15285. BSON.BSON_DATA_REGEXP = 11;
  15286. /**
  15287. * Code BSON Type
  15288. *
  15289. * @classconstant BSON_DATA_CODE
  15290. **/
  15291. BSON.BSON_DATA_CODE = 13;
  15292. /**
  15293. * Symbol BSON Type
  15294. *
  15295. * @classconstant BSON_DATA_SYMBOL
  15296. **/
  15297. BSON.BSON_DATA_SYMBOL = 14;
  15298. /**
  15299. * Code with Scope BSON Type
  15300. *
  15301. * @classconstant BSON_DATA_CODE_W_SCOPE
  15302. **/
  15303. BSON.BSON_DATA_CODE_W_SCOPE = 15;
  15304. /**
  15305. * 32 bit Integer BSON Type
  15306. *
  15307. * @classconstant BSON_DATA_INT
  15308. **/
  15309. BSON.BSON_DATA_INT = 16;
  15310. /**
  15311. * Timestamp BSON Type
  15312. *
  15313. * @classconstant BSON_DATA_TIMESTAMP
  15314. **/
  15315. BSON.BSON_DATA_TIMESTAMP = 17;
  15316. /**
  15317. * Long BSON Type
  15318. *
  15319. * @classconstant BSON_DATA_LONG
  15320. **/
  15321. BSON.BSON_DATA_LONG = 18;
  15322. /**
  15323. * Long BSON Type
  15324. *
  15325. * @classconstant BSON_DATA_DECIMAL128
  15326. **/
  15327. BSON.BSON_DATA_DECIMAL128 = 19;
  15328. /**
  15329. * MinKey BSON Type
  15330. *
  15331. * @classconstant BSON_DATA_MIN_KEY
  15332. **/
  15333. BSON.BSON_DATA_MIN_KEY = 0xff;
  15334. /**
  15335. * MaxKey BSON Type
  15336. *
  15337. * @classconstant BSON_DATA_MAX_KEY
  15338. **/
  15339. BSON.BSON_DATA_MAX_KEY = 0x7f;
  15340. /**
  15341. * Binary Default Type
  15342. *
  15343. * @classconstant BSON_BINARY_SUBTYPE_DEFAULT
  15344. **/
  15345. BSON.BSON_BINARY_SUBTYPE_DEFAULT = 0;
  15346. /**
  15347. * Binary Function Type
  15348. *
  15349. * @classconstant BSON_BINARY_SUBTYPE_FUNCTION
  15350. **/
  15351. BSON.BSON_BINARY_SUBTYPE_FUNCTION = 1;
  15352. /**
  15353. * Binary Byte Array Type
  15354. *
  15355. * @classconstant BSON_BINARY_SUBTYPE_BYTE_ARRAY
  15356. **/
  15357. BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2;
  15358. /**
  15359. * Binary UUID Type
  15360. *
  15361. * @classconstant BSON_BINARY_SUBTYPE_UUID
  15362. **/
  15363. BSON.BSON_BINARY_SUBTYPE_UUID = 3;
  15364. /**
  15365. * Binary MD5 Type
  15366. *
  15367. * @classconstant BSON_BINARY_SUBTYPE_MD5
  15368. **/
  15369. BSON.BSON_BINARY_SUBTYPE_MD5 = 4;
  15370. /**
  15371. * Binary User Defined Type
  15372. *
  15373. * @classconstant BSON_BINARY_SUBTYPE_USER_DEFINED
  15374. **/
  15375. BSON.BSON_BINARY_SUBTYPE_USER_DEFINED = 128;
  15376. // BSON MAX VALUES
  15377. BSON.BSON_INT32_MAX = 0x7fffffff;
  15378. BSON.BSON_INT32_MIN = -0x80000000;
  15379. BSON.BSON_INT64_MAX = Math.pow(2, 63) - 1;
  15380. BSON.BSON_INT64_MIN = -Math.pow(2, 63);
  15381. // JS MAX PRECISE VALUES
  15382. BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
  15383. BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
  15384. // Internal long versions
  15385. // var JS_INT_MAX_LONG = Long.fromNumber(0x20000000000000); // Any integer up to 2^53 can be precisely represented by a double.
  15386. // var JS_INT_MIN_LONG = Long.fromNumber(-0x20000000000000); // Any integer down to -2^53 can be precisely represented by a double.
  15387. module.exports = serializeInto;
  15388. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(339).Buffer))
  15389. /***/ }),
  15390. /* 359 */
  15391. /***/ (function(module, exports) {
  15392. // Copyright (c) 2008, Fair Oaks Labs, Inc.
  15393. // All rights reserved.
  15394. //
  15395. // Redistribution and use in source and binary forms, with or without
  15396. // modification, are permitted provided that the following conditions are met:
  15397. //
  15398. // * Redistributions of source code must retain the above copyright notice,
  15399. // this list of conditions and the following disclaimer.
  15400. //
  15401. // * Redistributions in binary form must reproduce the above copyright notice,
  15402. // this list of conditions and the following disclaimer in the documentation
  15403. // and/or other materials provided with the distribution.
  15404. //
  15405. // * Neither the name of Fair Oaks Labs, Inc. nor the names of its contributors
  15406. // may be used to endorse or promote products derived from this software
  15407. // without specific prior written permission.
  15408. //
  15409. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  15410. // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  15411. // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  15412. // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  15413. // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  15414. // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  15415. // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  15416. // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  15417. // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  15418. // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  15419. // POSSIBILITY OF SUCH DAMAGE.
  15420. //
  15421. //
  15422. // Modifications to writeIEEE754 to support negative zeroes made by Brian White
  15423. var readIEEE754 = function (buffer, offset, endian, mLen, nBytes) {
  15424. var e,
  15425. m,
  15426. bBE = endian === 'big',
  15427. eLen = nBytes * 8 - mLen - 1,
  15428. eMax = (1 << eLen) - 1,
  15429. eBias = eMax >> 1,
  15430. nBits = -7,
  15431. i = bBE ? 0 : nBytes - 1,
  15432. d = bBE ? 1 : -1,
  15433. s = buffer[offset + i];
  15434. i += d;
  15435. e = s & (1 << -nBits) - 1;
  15436. s >>= -nBits;
  15437. nBits += eLen;
  15438. for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8);
  15439. m = e & (1 << -nBits) - 1;
  15440. e >>= -nBits;
  15441. nBits += mLen;
  15442. for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8);
  15443. if (e === 0) {
  15444. e = 1 - eBias;
  15445. } else if (e === eMax) {
  15446. return m ? NaN : (s ? -1 : 1) * Infinity;
  15447. } else {
  15448. m = m + Math.pow(2, mLen);
  15449. e = e - eBias;
  15450. }
  15451. return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
  15452. };
  15453. var writeIEEE754 = function (buffer, value, offset, endian, mLen, nBytes) {
  15454. var e,
  15455. m,
  15456. c,
  15457. bBE = endian === 'big',
  15458. eLen = nBytes * 8 - mLen - 1,
  15459. eMax = (1 << eLen) - 1,
  15460. eBias = eMax >> 1,
  15461. rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
  15462. i = bBE ? nBytes - 1 : 0,
  15463. d = bBE ? -1 : 1,
  15464. s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
  15465. value = Math.abs(value);
  15466. if (isNaN(value) || value === Infinity) {
  15467. m = isNaN(value) ? 1 : 0;
  15468. e = eMax;
  15469. } else {
  15470. e = Math.floor(Math.log(value) / Math.LN2);
  15471. if (value * (c = Math.pow(2, -e)) < 1) {
  15472. e--;
  15473. c *= 2;
  15474. }
  15475. if (e + eBias >= 1) {
  15476. value += rt / c;
  15477. } else {
  15478. value += rt * Math.pow(2, 1 - eBias);
  15479. }
  15480. if (value * c >= 2) {
  15481. e++;
  15482. c /= 2;
  15483. }
  15484. if (e + eBias >= eMax) {
  15485. m = 0;
  15486. e = eMax;
  15487. } else if (e + eBias >= 1) {
  15488. m = (value * c - 1) * Math.pow(2, mLen);
  15489. e = e + eBias;
  15490. } else {
  15491. m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
  15492. e = 0;
  15493. }
  15494. }
  15495. for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8);
  15496. e = e << mLen | m;
  15497. eLen += mLen;
  15498. for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8);
  15499. buffer[offset + i - d] |= s * 128;
  15500. };
  15501. exports.readIEEE754 = readIEEE754;
  15502. exports.writeIEEE754 = writeIEEE754;
  15503. /***/ }),
  15504. /* 360 */
  15505. /***/ (function(module, exports, __webpack_require__) {
  15506. /* WEBPACK VAR INJECTION */(function(Buffer) {'use strict';
  15507. var Long = __webpack_require__(335).Long,
  15508. Double = __webpack_require__(336).Double,
  15509. Timestamp = __webpack_require__(337).Timestamp,
  15510. ObjectID = __webpack_require__(338).ObjectID,
  15511. Symbol = __webpack_require__(349).Symbol,
  15512. BSONRegExp = __webpack_require__(348).BSONRegExp,
  15513. Code = __webpack_require__(351).Code,
  15514. Decimal128 = __webpack_require__(352),
  15515. MinKey = __webpack_require__(353).MinKey,
  15516. MaxKey = __webpack_require__(354).MaxKey,
  15517. DBRef = __webpack_require__(355).DBRef,
  15518. Binary = __webpack_require__(356).Binary;
  15519. var normalizedFunctionString = __webpack_require__(344).normalizedFunctionString;
  15520. // To ensure that 0.4 of node works correctly
  15521. var isDate = function isDate(d) {
  15522. return typeof d === 'object' && Object.prototype.toString.call(d) === '[object Date]';
  15523. };
  15524. var calculateObjectSize = function calculateObjectSize(object, serializeFunctions, ignoreUndefined) {
  15525. var totalLength = 4 + 1;
  15526. if (Array.isArray(object)) {
  15527. for (var i = 0; i < object.length; i++) {
  15528. totalLength += calculateElement(i.toString(), object[i], serializeFunctions, true, ignoreUndefined);
  15529. }
  15530. } else {
  15531. // If we have toBSON defined, override the current object
  15532. if (object.toBSON) {
  15533. object = object.toBSON();
  15534. }
  15535. // Calculate size
  15536. for (var key in object) {
  15537. totalLength += calculateElement(key, object[key], serializeFunctions, false, ignoreUndefined);
  15538. }
  15539. }
  15540. return totalLength;
  15541. };
  15542. /**
  15543. * @ignore
  15544. * @api private
  15545. */
  15546. function calculateElement(name, value, serializeFunctions, isArray, ignoreUndefined) {
  15547. // If we have toBSON defined, override the current object
  15548. if (value && value.toBSON) {
  15549. value = value.toBSON();
  15550. }
  15551. switch (typeof value) {
  15552. case 'string':
  15553. return 1 + Buffer.byteLength(name, 'utf8') + 1 + 4 + Buffer.byteLength(value, 'utf8') + 1;
  15554. case 'number':
  15555. if (Math.floor(value) === value && value >= BSON.JS_INT_MIN && value <= BSON.JS_INT_MAX) {
  15556. if (value >= BSON.BSON_INT32_MIN && value <= BSON.BSON_INT32_MAX) {
  15557. // 32 bit
  15558. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (4 + 1);
  15559. } else {
  15560. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1);
  15561. }
  15562. } else {
  15563. // 64 bit
  15564. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1);
  15565. }
  15566. case 'undefined':
  15567. if (isArray || !ignoreUndefined) return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1;
  15568. return 0;
  15569. case 'boolean':
  15570. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (1 + 1);
  15571. case 'object':
  15572. if (value == null || value instanceof MinKey || value instanceof MaxKey || value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') {
  15573. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1;
  15574. } else if (value instanceof ObjectID || value['_bsontype'] === 'ObjectID' || value['_bsontype'] === 'ObjectId') {
  15575. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (12 + 1);
  15576. } else if (value instanceof Date || isDate(value)) {
  15577. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1);
  15578. } else if (typeof Buffer !== 'undefined' && Buffer.isBuffer(value)) {
  15579. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (1 + 4 + 1) + value.length;
  15580. } else if (value instanceof Long || value instanceof Double || value instanceof Timestamp || value['_bsontype'] === 'Long' || value['_bsontype'] === 'Double' || value['_bsontype'] === 'Timestamp') {
  15581. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1);
  15582. } else if (value instanceof Decimal128 || value['_bsontype'] === 'Decimal128') {
  15583. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (16 + 1);
  15584. } else if (value instanceof Code || value['_bsontype'] === 'Code') {
  15585. // Calculate size depending on the availability of a scope
  15586. if (value.scope != null && Object.keys(value.scope).length > 0) {
  15587. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + 4 + 4 + Buffer.byteLength(value.code.toString(), 'utf8') + 1 + calculateObjectSize(value.scope, serializeFunctions, ignoreUndefined);
  15588. } else {
  15589. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + 4 + Buffer.byteLength(value.code.toString(), 'utf8') + 1;
  15590. }
  15591. } else if (value instanceof Binary || value['_bsontype'] === 'Binary') {
  15592. // Check what kind of subtype we have
  15593. if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) {
  15594. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (value.position + 1 + 4 + 1 + 4);
  15595. } else {
  15596. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (value.position + 1 + 4 + 1);
  15597. }
  15598. } else if (value instanceof Symbol || value['_bsontype'] === 'Symbol') {
  15599. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + Buffer.byteLength(value.value, 'utf8') + 4 + 1 + 1;
  15600. } else if (value instanceof DBRef || value['_bsontype'] === 'DBRef') {
  15601. // Set up correct object for serialization
  15602. var ordered_values = {
  15603. $ref: value.namespace,
  15604. $id: value.oid
  15605. };
  15606. // Add db reference if it exists
  15607. if (null != value.db) {
  15608. ordered_values['$db'] = value.db;
  15609. }
  15610. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + calculateObjectSize(ordered_values, serializeFunctions, ignoreUndefined);
  15611. } else if (value instanceof RegExp || Object.prototype.toString.call(value) === '[object RegExp]') {
  15612. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + Buffer.byteLength(value.source, 'utf8') + 1 + (value.global ? 1 : 0) + (value.ignoreCase ? 1 : 0) + (value.multiline ? 1 : 0) + 1;
  15613. } else if (value instanceof BSONRegExp || value['_bsontype'] === 'BSONRegExp') {
  15614. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + Buffer.byteLength(value.pattern, 'utf8') + 1 + Buffer.byteLength(value.options, 'utf8') + 1;
  15615. } else {
  15616. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + calculateObjectSize(value, serializeFunctions, ignoreUndefined) + 1;
  15617. }
  15618. case 'function':
  15619. // WTF for 0.4.X where typeof /someregexp/ === 'function'
  15620. if (value instanceof RegExp || Object.prototype.toString.call(value) === '[object RegExp]' || String.call(value) === '[object RegExp]') {
  15621. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + Buffer.byteLength(value.source, 'utf8') + 1 + (value.global ? 1 : 0) + (value.ignoreCase ? 1 : 0) + (value.multiline ? 1 : 0) + 1;
  15622. } else {
  15623. if (serializeFunctions && value.scope != null && Object.keys(value.scope).length > 0) {
  15624. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + 4 + 4 + Buffer.byteLength(normalizedFunctionString(value), 'utf8') + 1 + calculateObjectSize(value.scope, serializeFunctions, ignoreUndefined);
  15625. } else if (serializeFunctions) {
  15626. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + 4 + Buffer.byteLength(normalizedFunctionString(value), 'utf8') + 1;
  15627. }
  15628. }
  15629. }
  15630. return 0;
  15631. }
  15632. var BSON = {};
  15633. // BSON MAX VALUES
  15634. BSON.BSON_INT32_MAX = 0x7fffffff;
  15635. BSON.BSON_INT32_MIN = -0x80000000;
  15636. // JS MAX PRECISE VALUES
  15637. BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
  15638. BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
  15639. module.exports = calculateObjectSize;
  15640. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(339).Buffer))
  15641. /***/ })
  15642. /******/ ])
  15643. });
  15644. ;