mqtt.js 283 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778
  1. ! function (e) {
  2. if ("object" == typeof exports && "undefined" != typeof module) module.exports = e();
  3. else if ("function" == typeof define && define.amd) define([], e);
  4. else {
  5. ("undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this).mqtt = e()
  6. }
  7. }(function () {
  8. return function () {
  9. return function e(t, r, n) {
  10. function i(s, a) {
  11. if (!r[s]) {
  12. if (!t[s]) {
  13. var c = "function" == typeof require && require;
  14. if (!a && c) return c(s, !0);
  15. if (o) return o(s, !0);
  16. var u = new Error("Cannot find module '" + s + "'");
  17. throw u.code = "MODULE_NOT_FOUND", u
  18. }
  19. var l = r[s] = {
  20. exports: {}
  21. };
  22. t[s][0].call(l.exports, function (e) {
  23. return i(t[s][1][e] || e)
  24. }, l, l.exports, e, t, r, n)
  25. }
  26. return r[s].exports
  27. }
  28. for (var o = "function" == typeof require && require, s = 0; s < n.length; s++) i(n[s]);
  29. return i
  30. }
  31. }()({
  32. 1: [function (e, t, r) {
  33. (function (r, n) {
  34. "use strict";
  35. var i = e("events").EventEmitter,
  36. o = e("./store"),
  37. s = e("mqtt-packet"),
  38. a = e("readable-stream").Writable,
  39. c = e("inherits"),
  40. u = e("reinterval"),
  41. l = e("./validations"),
  42. f = e("xtend"),
  43. p = e("debug")("mqttjs:client"),
  44. h = r ? r.nextTick : function (e) {
  45. setTimeout(e, 0)
  46. },
  47. d = n.setImmediate || function (e) {
  48. h(e)
  49. },
  50. g = {
  51. keepalive: 60,
  52. reschedulePings: !0,
  53. protocolId: "MQTT",
  54. protocolVersion: 4,
  55. reconnectPeriod: 1e3,
  56. connectTimeout: 3e4,
  57. clean: !0,
  58. resubscribe: !0
  59. },
  60. b = ["ECONNREFUSED", "EADDRINUSE", "ECONNRESET", "ENOTFOUND"],
  61. m = {
  62. 0: "",
  63. 1: "Unacceptable protocol version",
  64. 2: "Identifier rejected",
  65. 3: "Server unavailable",
  66. 4: "Bad username or password",
  67. 5: "Not authorized",
  68. 16: "No matching subscribers",
  69. 17: "No subscription existed",
  70. 128: "Unspecified error",
  71. 129: "Malformed Packet",
  72. 130: "Protocol Error",
  73. 131: "Implementation specific error",
  74. 132: "Unsupported Protocol Version",
  75. 133: "Client Identifier not valid",
  76. 134: "Bad User Name or Password",
  77. 135: "Not authorized",
  78. 136: "Server unavailable",
  79. 137: "Server busy",
  80. 138: "Banned",
  81. 139: "Server shutting down",
  82. 140: "Bad authentication method",
  83. 141: "Keep Alive timeout",
  84. 142: "Session taken over",
  85. 143: "Topic Filter invalid",
  86. 144: "Topic Name invalid",
  87. 145: "Packet identifier in use",
  88. 146: "Packet Identifier not found",
  89. 147: "Receive Maximum exceeded",
  90. 148: "Topic Alias invalid",
  91. 149: "Packet too large",
  92. 150: "Message rate too high",
  93. 151: "Quota exceeded",
  94. 152: "Administrative action",
  95. 153: "Payload format invalid",
  96. 154: "Retain not supported",
  97. 155: "QoS not supported",
  98. 156: "Use another server",
  99. 157: "Server moved",
  100. 158: "Shared Subscriptions not supported",
  101. 159: "Connection rate exceeded",
  102. 160: "Maximum connect time",
  103. 161: "Subscription Identifiers not supported",
  104. 162: "Wildcard Subscriptions not supported"
  105. };
  106. function y(e, t, r) {
  107. p("sendPacket :: packet: %O", t), p("sendPacket :: emitting `packetsend`"), e.emit("packetsend", t), p("sendPacket :: writing to stream");
  108. var n = s.writeToStream(t, e.stream, e.options);
  109. p("sendPacket :: writeToStream result %s", n), !n && r ? (p("sendPacket :: handle events on `drain` once through callback."), e.stream.once("drain", r)) : r && (p("sendPacket :: invoking cb"), r())
  110. }
  111. function _(e, t, r, n) {
  112. p("storeAndSend :: store packet with cmd %s to outgoingStore", t.cmd), e.outgoingStore.put(t, function (i) {
  113. if (i) return r && r(i);
  114. n(), y(e, t, r)
  115. })
  116. }
  117. function v(e) {
  118. p("nop ::", e)
  119. }
  120. function w(e, t) {
  121. var r, n = this;
  122. if (!(this instanceof w)) return new w(e, t);
  123. for (r in this.options = t || {}, g) void 0 === this.options[r] ? this.options[r] = g[r] : this.options[r] = t[r];
  124. p("MqttClient :: options.protocol", t.protocol), p("MqttClient :: options.protocolVersion", t.protocolVersion), p("MqttClient :: options.username", t.username), p("MqttClient :: options.keepalive", t.keepalive), p("MqttClient :: options.reconnectPeriod", t.reconnectPeriod), p("MqttClient :: options.rejectUnauthorized", t.rejectUnauthorized), this.options.clientId = "string" == typeof t.clientId ? t.clientId : "mqttjs_" + Math.random().toString(16).substr(2, 8), p("MqttClient :: clientId", this.options.clientId), this.options.customHandleAcks = 5 === t.protocolVersion && t.customHandleAcks ? t.customHandleAcks : function () {
  125. arguments[3](0)
  126. }, this.streamBuilder = e, this.outgoingStore = t.outgoingStore || new o, this.incomingStore = t.incomingStore || new o, this.queueQoSZero = void 0 === t.queueQoSZero || t.queueQoSZero, this._resubscribeTopics = {}, this.messageIdToTopic = {}, this.pingTimer = null, this.connected = !1, this.disconnecting = !1, this.queue = [], this.connackTimer = null, this.reconnectTimer = null, this._storeProcessing = !1, this._packetIdsDuringStoreProcessing = {}, this.nextId = Math.max(1, Math.floor(65535 * Math.random())), this.outgoing = {}, this._firstConnection = !0, this.on("connect", function () {
  127. var e = this.queue;
  128. p("connect :: sending queued packets"),
  129. function t() {
  130. var r = e.shift();
  131. p("deliver :: entry %o", r);
  132. var i;
  133. r && (i = r.packet, p("deliver :: call _sendPacket for %o", i), n._sendPacket(i, function (e) {
  134. r.cb && r.cb(e), t()
  135. }))
  136. }()
  137. }), this.on("close", function () {
  138. p("close :: connected set to `false`"), this.connected = !1, p("close :: clearing connackTimer"), clearTimeout(this.connackTimer), p("close :: clearing ping timer"), null !== n.pingTimer && (n.pingTimer.clear(), n.pingTimer = null), p("close :: calling _setupReconnect"), this._setupReconnect()
  139. }), i.call(this), p("MqttClient :: setting up stream"), this._setupStream()
  140. }
  141. c(w, i), w.prototype._setupStream = function () {
  142. var e, t = this,
  143. r = new a,
  144. n = s.parser(this.options),
  145. i = null,
  146. o = [];
  147. function c() {
  148. if (o.length) h(u);
  149. else {
  150. var e = i;
  151. i = null, e()
  152. }
  153. }
  154. function u() {
  155. p("work :: getting next packet in queue");
  156. var e = o.shift();
  157. if (e) p("work :: packet pulled from queue"), t._handlePacket(e, c);
  158. else {
  159. p("work :: no packets in queue");
  160. var r = i;
  161. i = null, p("work :: done flag is %s", !!r), r && r()
  162. }
  163. }
  164. if (p("_setupStream :: calling method to clear reconnect"), this._clearReconnect(), p("_setupStream :: using streamBuilder provided to client to create stream"), this.stream = this.streamBuilder(this), n.on("packet", function (e) {
  165. p("parser :: on packet push to packets array."), o.push(e)
  166. }), r._write = function (e, t, r) {
  167. i = r, p("writable stream :: parsing buffer"), n.parse(e), u()
  168. }, p("_setupStream :: pipe stream to writable stream"), this.stream.pipe(r), this.stream.on("error", function (e) {
  169. p("streamErrorHandler :: error", e.message), b.includes(e.code) ? (p("streamErrorHandler :: emitting error"), t.emit("error", e)) : v(e)
  170. }), this.stream.on("close", function () {
  171. var e;
  172. p("(%s)stream :: on close", t.options.clientId), (e = t.outgoing) && (p("flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"), Object.keys(e).forEach(function (t) {
  173. e[t].volatile && "function" == typeof e[t].cb && (e[t].cb(new Error("Connection closed")), delete e[t])
  174. })), p("stream: emit close to MqttClient"), t.emit("close")
  175. }), p("_setupStream: sending packet `connect`"), (e = Object.create(this.options)).cmd = "connect", y(this, e), n.on("error", this.emit.bind(this, "error")), this.options.properties) {
  176. if (!this.options.properties.authenticationMethod && this.options.properties.authenticationData) return t.end(() => this.emit("error", new Error("Packet has no Authentication Method"))), this;
  177. if (this.options.properties.authenticationMethod && this.options.authPacket && "object" == typeof this.options.authPacket) y(this, f({
  178. cmd: "auth",
  179. reasonCode: 0
  180. }, this.options.authPacket))
  181. }
  182. this.stream.setMaxListeners(1e3), clearTimeout(this.connackTimer), this.connackTimer = setTimeout(function () {
  183. p("!!connectTimeout hit!! Calling _cleanUp with force `true`"), t._cleanUp(!0)
  184. }, this.options.connectTimeout)
  185. }, w.prototype._handlePacket = function (e, t) {
  186. var r = this.options;
  187. if (5 === r.protocolVersion && r.properties && r.properties.maximumPacketSize && r.properties.maximumPacketSize < e.length) return this.emit("error", new Error("exceeding packets size " + e.cmd)), this.end({
  188. reasonCode: 149,
  189. properties: {
  190. reasonString: "Maximum packet size was exceeded"
  191. }
  192. }), this;
  193. switch (p("_handlePacket :: emitting packetreceive"), this.emit("packetreceive", e), e.cmd) {
  194. case "publish":
  195. this._handlePublish(e, t);
  196. break;
  197. case "puback":
  198. case "pubrec":
  199. case "pubcomp":
  200. case "suback":
  201. case "unsuback":
  202. this._handleAck(e), t();
  203. break;
  204. case "pubrel":
  205. this._handlePubrel(e, t);
  206. break;
  207. case "connack":
  208. this._handleConnack(e), t();
  209. break;
  210. case "pingresp":
  211. this._handlePingresp(e), t();
  212. break;
  213. case "disconnect":
  214. this._handleDisconnect(e), t()
  215. }
  216. }, w.prototype._checkDisconnecting = function (e) {
  217. return this.disconnecting && (e ? e(new Error("client disconnecting")) : this.emit("error", new Error("client disconnecting"))), this.disconnecting
  218. }, w.prototype.publish = function (e, t, r, n) {
  219. var i;
  220. p("publish :: message `%s` to topic `%s`", t, e);
  221. var o = this.options;
  222. "function" == typeof r && (n = r, r = null);
  223. if (r = f({
  224. qos: 0,
  225. retain: !1,
  226. dup: !1
  227. }, r), this._checkDisconnecting(n)) return this;
  228. switch (i = {
  229. cmd: "publish",
  230. topic: e,
  231. payload: t,
  232. qos: r.qos,
  233. retain: r.retain,
  234. messageId: this._nextId(),
  235. dup: r.dup
  236. }, 5 === o.protocolVersion && (i.properties = r.properties, (!o.properties && i.properties && i.properties.topicAlias || r.properties && o.properties && (r.properties.topicAlias && o.properties.topicAliasMaximum && r.properties.topicAlias > o.properties.topicAliasMaximum || !o.properties.topicAliasMaximum && r.properties.topicAlias)) && delete i.properties.topicAlias), p("publish :: qos", r.qos), r.qos) {
  237. case 1:
  238. case 2:
  239. this.outgoing[i.messageId] = {
  240. volatile: !1,
  241. cb: n || v
  242. }, this._storeProcessing ? (p("_storeProcessing enabled"), this._packetIdsDuringStoreProcessing[i.messageId] = !1, this._storePacket(i, void 0, r.cbStorePut)) : (p("MqttClient:publish: packet cmd: %s", i.cmd), this._sendPacket(i, void 0, r.cbStorePut));
  243. break;
  244. default:
  245. this._storeProcessing ? (p("_storeProcessing enabled"), this._storePacket(i, n, r.cbStorePut)) : (p("MqttClient:publish: packet cmd: %s", i.cmd), this._sendPacket(i, n, r.cbStorePut))
  246. }
  247. return this
  248. }, w.prototype.subscribe = function () {
  249. for (var e, t = new Array(arguments.length), r = 0; r < arguments.length; r++) t[r] = arguments[r];
  250. var n, i = [],
  251. o = t.shift(),
  252. s = o.resubscribe,
  253. a = t.pop() || v,
  254. c = t.pop(),
  255. u = this,
  256. h = this.options.protocolVersion;
  257. if (delete o.resubscribe, "string" == typeof o && (o = [o]), "function" != typeof a && (c = a, a = v), null !== (n = l.validateTopics(o))) return d(a, new Error("Invalid topic " + n)), this;
  258. if (this._checkDisconnecting(a)) return p("subscribe: discconecting true"), this;
  259. var g = {
  260. qos: 0
  261. };
  262. if (5 === h && (g.nl = !1, g.rap = !1, g.rh = 0), c = f(g, c), Array.isArray(o) ? o.forEach(function (e) {
  263. if (p("subscribe: array topic %s", e), !u._resubscribeTopics.hasOwnProperty(e) || u._resubscribeTopics[e].qos < c.qos || s) {
  264. var t = {
  265. topic: e,
  266. qos: c.qos
  267. };
  268. 5 === h && (t.nl = c.nl, t.rap = c.rap, t.rh = c.rh, t.properties = c.properties), p("subscribe: pushing topic `%s` and qos `%s` to subs list", t.topic, t.qos), i.push(t)
  269. }
  270. }) : Object.keys(o).forEach(function (e) {
  271. if (p("subscribe: object topic %s", e), !u._resubscribeTopics.hasOwnProperty(e) || u._resubscribeTopics[e].qos < o[e].qos || s) {
  272. var t = {
  273. topic: e,
  274. qos: o[e].qos
  275. };
  276. 5 === h && (t.nl = o[e].nl, t.rap = o[e].rap, t.rh = o[e].rh, t.properties = c.properties), p("subscribe: pushing `%s` to subs list", t), i.push(t)
  277. }
  278. }), e = {
  279. cmd: "subscribe",
  280. subscriptions: i,
  281. qos: 1,
  282. retain: !1,
  283. dup: !1,
  284. messageId: this._nextId()
  285. }, c.properties && (e.properties = c.properties), i.length) {
  286. if (this.options.resubscribe) {
  287. p("subscribe :: resubscribe true");
  288. var b = [];
  289. i.forEach(function (e) {
  290. if (u.options.reconnectPeriod > 0) {
  291. var t = {
  292. qos: e.qos
  293. };
  294. 5 === h && (t.nl = e.nl || !1, t.rap = e.rap || !1, t.rh = e.rh || 0, t.properties = e.properties), u._resubscribeTopics[e.topic] = t, b.push(e.topic)
  295. }
  296. }), u.messageIdToTopic[e.messageId] = b
  297. }
  298. return this.outgoing[e.messageId] = {
  299. volatile: !0,
  300. cb: function (e, t) {
  301. if (!e)
  302. for (var r = t.granted, n = 0; n < r.length; n += 1) i[n].qos = r[n];
  303. a(e, i)
  304. }
  305. }, p("subscribe :: call _sendPacket"), this._sendPacket(e), this
  306. }
  307. a(null, [])
  308. }, w.prototype.unsubscribe = function () {
  309. for (var e = {
  310. cmd: "unsubscribe",
  311. qos: 1,
  312. messageId: this._nextId()
  313. }, t = this, r = new Array(arguments.length), n = 0; n < arguments.length; n++) r[n] = arguments[n];
  314. var i = r.shift(),
  315. o = r.pop() || v,
  316. s = r.pop();
  317. return "string" == typeof i && (i = [i]), "function" != typeof o && (s = o, o = v), this._checkDisconnecting(o) ? this : ("string" == typeof i ? e.unsubscriptions = [i] : Array.isArray(i) && (e.unsubscriptions = i), this.options.resubscribe && e.unsubscriptions.forEach(function (e) {
  318. delete t._resubscribeTopics[e]
  319. }), "object" == typeof s && s.properties && (e.properties = s.properties), this.outgoing[e.messageId] = {
  320. volatile: !0,
  321. cb: o
  322. }, p("unsubscribe: call _sendPacket"), this._sendPacket(e), this)
  323. }, w.prototype.end = function (e, t, r) {
  324. var n = this;
  325. function i() {
  326. p("end :: (%s) :: finish :: calling _cleanUp with force %s", n.options.clientId, e), n._cleanUp(e, () => {
  327. p("end :: finish :: calling process.nextTick on closeStores"), h(function () {
  328. p("end :: closeStores: closing incoming and outgoing stores"), n.disconnected = !0, n.incomingStore.close(function (e) {
  329. n.outgoingStore.close(function (t) {
  330. if (p("end :: closeStores: emitting end"), n.emit("end"), r) {
  331. let n = e || t;
  332. p("end :: closeStores: invoking callback with args"), r(n)
  333. }
  334. })
  335. }), n._deferredReconnect && n._deferredReconnect()
  336. }.bind(n))
  337. }, t)
  338. }
  339. return p("end :: (%s)", this.options.clientId), null != e && "boolean" == typeof e || (r = t || v, t = e, e = !1, "object" != typeof t && (r = t, t = null, "function" != typeof r && (r = v))), "object" != typeof t && (r = t, t = null), p("end :: cb? %s", !!r), r = r || v, this.disconnecting ? (r(), this) : (this._clearReconnect(), this.disconnecting = !0, !e && Object.keys(this.outgoing).length > 0 ? (p("end :: (%s) :: calling finish in 10ms once outgoing is empty", n.options.clientId), this.once("outgoingEmpty", setTimeout.bind(null, i, 10))) : (p("end :: (%s) :: immediately calling finish", n.options.clientId), i()), this)
  340. }, w.prototype.removeOutgoingMessage = function (e) {
  341. var t = this.outgoing[e] ? this.outgoing[e].cb : null;
  342. return delete this.outgoing[e], this.outgoingStore.del({
  343. messageId: e
  344. }, function () {
  345. t(new Error("Message removed"))
  346. }), this
  347. }, w.prototype.reconnect = function (e) {
  348. p("client reconnect");
  349. var t = this,
  350. r = function () {
  351. e ? (t.options.incomingStore = e.incomingStore, t.options.outgoingStore = e.outgoingStore) : (t.options.incomingStore = null, t.options.outgoingStore = null), t.incomingStore = t.options.incomingStore || new o, t.outgoingStore = t.options.outgoingStore || new o, t.disconnecting = !1, t.disconnected = !1, t._deferredReconnect = null, t._reconnect()
  352. };
  353. return this.disconnecting && !this.disconnected ? this._deferredReconnect = r : r(), this
  354. }, w.prototype._reconnect = function () {
  355. p("_reconnect: emitting reconnect to client"), this.emit("reconnect"), p("_reconnect: calling _setupStream"), this._setupStream()
  356. }, w.prototype._setupReconnect = function () {
  357. var e = this;
  358. !e.disconnecting && !e.reconnectTimer && e.options.reconnectPeriod > 0 ? (this.reconnecting || (p("_setupReconnect :: emit `offline` state"), this.emit("offline"), p("_setupReconnect :: set `reconnecting` to `true`"), this.reconnecting = !0), p("_setupReconnect :: setting reconnectTimer for %d ms", e.options.reconnectPeriod), e.reconnectTimer = setInterval(function () {
  359. p("reconnectTimer :: reconnect triggered!"), e._reconnect()
  360. }, e.options.reconnectPeriod)) : p("_setupReconnect :: doing nothing...")
  361. }, w.prototype._clearReconnect = function () {
  362. p("_clearReconnect : clearing reconnect timer"), this.reconnectTimer && (clearInterval(this.reconnectTimer), this.reconnectTimer = null)
  363. }, w.prototype._cleanUp = function (e, t) {
  364. var r, n = arguments[2];
  365. if (t && (p("_cleanUp :: done callback provided for on stream close"), this.stream.on("close", t)), p("_cleanUp :: forced? %s", e), e) 0 === this.options.reconnectPeriod && this.options.clean && (r = this.outgoing) && (p("flush: queue exists? %b", !!r), Object.keys(r).forEach(function (e) {
  366. "function" == typeof r[e].cb && (r[e].cb(new Error("Connection closed")), delete r[e])
  367. })), p("_cleanUp :: (%s) :: destroying stream", this.options.clientId), this.stream.destroy();
  368. else {
  369. var i = f({
  370. cmd: "disconnect"
  371. }, n);
  372. p("_cleanUp :: (%s) :: call _sendPacket with disconnect packet", this.options.clientId), this._sendPacket(i, d.bind(null, this.stream.end.bind(this.stream)))
  373. }
  374. this.disconnecting || (p("_cleanUp :: client not disconnecting. Clearing and resetting reconnect."), this._clearReconnect(), this._setupReconnect()), null !== this.pingTimer && (p("_cleanUp :: clearing pingTimer"), this.pingTimer.clear(), this.pingTimer = null), t && !this.connected && (p("_cleanUp :: (%s) :: removing stream `done` callback `close` listener", this.options.clientId), this.stream.removeListener("close", t), t())
  375. }, w.prototype._sendPacket = function (e, t, r) {
  376. if (p("_sendPacket :: (%s) :: start", this.options.clientId), r = r || v, !this.connected) return p("_sendPacket :: client not connected. Storing packet offline."), void this._storePacket(e, t, r);
  377. switch (this._shiftPingInterval(), e.cmd) {
  378. case "publish":
  379. break;
  380. case "pubrel":
  381. return void _(this, e, t, r);
  382. default:
  383. return void y(this, e, t)
  384. }
  385. switch (e.qos) {
  386. case 2:
  387. case 1:
  388. _(this, e, t, r);
  389. break;
  390. case 0:
  391. default:
  392. y(this, e, t)
  393. }
  394. p("_sendPacket :: (%s) :: end", this.options.clientId)
  395. }, w.prototype._storePacket = function (e, t, r) {
  396. p("_storePacket :: packet: %o", e), p("_storePacket :: cb? %s", !!t), r = r || v, 0 === (e.qos || 0) && this.queueQoSZero || "publish" !== e.cmd ? this.queue.push({
  397. packet: e,
  398. cb: t
  399. }) : e.qos > 0 ? (t = this.outgoing[e.messageId] ? this.outgoing[e.messageId].cb : null, this.outgoingStore.put(e, function (e) {
  400. if (e) return t && t(e);
  401. r()
  402. })) : t && t(new Error("No connection to broker"))
  403. }, w.prototype._setupPingTimer = function () {
  404. p("_setupPingTimer :: keepalive %d (seconds)", this.options.keepalive);
  405. var e = this;
  406. !this.pingTimer && this.options.keepalive && (this.pingResp = !0, this.pingTimer = u(function () {
  407. e._checkPing()
  408. }, 1e3 * this.options.keepalive))
  409. }, w.prototype._shiftPingInterval = function () {
  410. this.pingTimer && this.options.keepalive && this.options.reschedulePings && this.pingTimer.reschedule(1e3 * this.options.keepalive)
  411. }, w.prototype._checkPing = function () {
  412. p("_checkPing :: checking ping..."), this.pingResp ? (p("_checkPing :: ping response received. Clearing flag and sending `pingreq`"), this.pingResp = !1, this._sendPacket({
  413. cmd: "pingreq"
  414. })) : (p("_checkPing :: calling _cleanUp with force true"), this._cleanUp(!0))
  415. }, w.prototype._handlePingresp = function () {
  416. this.pingResp = !0
  417. }, w.prototype._handleConnack = function (e) {
  418. p("_handleConnack");
  419. var t = this.options,
  420. r = 5 === t.protocolVersion ? e.reasonCode : e.returnCode;
  421. if (clearTimeout(this.connackTimer), e.properties && (e.properties.topicAliasMaximum && (t.properties || (t.properties = {}), t.properties.topicAliasMaximum = e.properties.topicAliasMaximum), e.properties.serverKeepAlive && t.keepalive && (t.keepalive = e.properties.serverKeepAlive, this._shiftPingInterval()), e.properties.maximumPacketSize && (t.properties || (t.properties = {}), t.properties.maximumPacketSize = e.properties.maximumPacketSize)), 0 === r) this.reconnecting = !1, this._onConnect(e);
  422. else if (r > 0) {
  423. var n = new Error("Connection refused: " + m[r]);
  424. n.code = r, this.emit("error", n)
  425. }
  426. }, w.prototype._handlePublish = function (e, t) {
  427. p("_handlePublish: packet %o", e), t = void 0 !== t ? t : v;
  428. var r = e.topic.toString(),
  429. n = e.payload,
  430. i = e.qos,
  431. o = e.messageId,
  432. s = this,
  433. a = this.options,
  434. c = [0, 16, 128, 131, 135, 144, 145, 151, 153];
  435. switch (p("_handlePublish: qos %d", i), i) {
  436. case 2:
  437. a.customHandleAcks(r, n, e, function (r, n) {
  438. return r instanceof Error || (n = r, r = null), r ? s.emit("error", r) : -1 === c.indexOf(n) ? s.emit("error", new Error("Wrong reason code for pubrec")) : void(n ? s._sendPacket({
  439. cmd: "pubrec",
  440. messageId: o,
  441. reasonCode: n
  442. }, t) : s.incomingStore.put(e, function () {
  443. s._sendPacket({
  444. cmd: "pubrec",
  445. messageId: o
  446. }, t)
  447. }))
  448. });
  449. break;
  450. case 1:
  451. a.customHandleAcks(r, n, e, function (i, a) {
  452. return i instanceof Error || (a = i, i = null), i ? s.emit("error", i) : -1 === c.indexOf(a) ? s.emit("error", new Error("Wrong reason code for puback")) : (a || s.emit("message", r, n, e), void s.handleMessage(e, function (e) {
  453. if (e) return t && t(e);
  454. s._sendPacket({
  455. cmd: "puback",
  456. messageId: o,
  457. reasonCode: a
  458. }, t)
  459. }))
  460. });
  461. break;
  462. case 0:
  463. this.emit("message", r, n, e), this.handleMessage(e, t);
  464. break;
  465. default:
  466. p("_handlePublish: unknown QoS. Doing nothing.")
  467. }
  468. }, w.prototype.handleMessage = function (e, t) {
  469. t()
  470. }, w.prototype._handleAck = function (e) {
  471. var t, r = e.messageId,
  472. n = e.cmd,
  473. i = null,
  474. o = this.outgoing[r] ? this.outgoing[r].cb : null,
  475. s = this;
  476. if (o) {
  477. switch (p("_handleAck :: packet type", n), n) {
  478. case "pubcomp":
  479. case "puback":
  480. var a = e.reasonCode;
  481. a && a > 0 && 16 !== a && ((t = new Error("Publish error: " + m[a])).code = a, o(t, e)), delete this.outgoing[r], this.outgoingStore.del(e, o);
  482. break;
  483. case "pubrec":
  484. i = {
  485. cmd: "pubrel",
  486. qos: 2,
  487. messageId: r
  488. };
  489. var c = e.reasonCode;
  490. c && c > 0 && 16 !== c ? ((t = new Error("Publish error: " + m[c])).code = c, o(t, e)) : this._sendPacket(i);
  491. break;
  492. case "suback":
  493. delete this.outgoing[r];
  494. for (var u = 0; u < e.granted.length; u++)
  495. if (0 != (128 & e.granted[u])) {
  496. var l = this.messageIdToTopic[r];
  497. l && l.forEach(function (e) {
  498. delete s._resubscribeTopics[e]
  499. })
  500. } o(null, e);
  501. break;
  502. case "unsuback":
  503. delete this.outgoing[r], o(null);
  504. break;
  505. default:
  506. s.emit("error", new Error("unrecognized packet type"))
  507. }
  508. this.disconnecting && 0 === Object.keys(this.outgoing).length && this.emit("outgoingEmpty")
  509. } else p("_handleAck :: Server sent an ack in error. Ignoring.")
  510. }, w.prototype._handlePubrel = function (e, t) {
  511. p("handling pubrel packet"), t = void 0 !== t ? t : v;
  512. var r = this,
  513. n = {
  514. cmd: "pubcomp",
  515. messageId: e.messageId
  516. };
  517. r.incomingStore.get(e, function (e, i) {
  518. e ? r._sendPacket(n, t) : (r.emit("message", i.topic, i.payload, i), r.handleMessage(i, function (e) {
  519. if (e) return t(e);
  520. r.incomingStore.del(i, v), r._sendPacket(n, t)
  521. }))
  522. })
  523. }, w.prototype._handleDisconnect = function (e) {
  524. this.emit("disconnect", e)
  525. }, w.prototype._nextId = function () {
  526. var e = this.nextId++;
  527. return 65536 === this.nextId && (this.nextId = 1), e
  528. }, w.prototype.getLastMessageId = function () {
  529. return 1 === this.nextId ? 65535 : this.nextId - 1
  530. }, w.prototype._resubscribe = function (e) {
  531. p("_resubscribe");
  532. var t = Object.keys(this._resubscribeTopics);
  533. if (!this._firstConnection && (this.options.clean || 5 === this.options.protocolVersion && !e.sessionPresent) && t.length > 0)
  534. if (this.options.resubscribe)
  535. if (5 === this.options.protocolVersion) {
  536. p("_resubscribe: protocolVersion 5");
  537. for (var r = 0; r < t.length; r++) {
  538. var n = {};
  539. n[t[r]] = this._resubscribeTopics[t[r]], n.resubscribe = !0, this.subscribe(n, {
  540. properties: n[t[r]].properties
  541. })
  542. }
  543. } else this._resubscribeTopics.resubscribe = !0, this.subscribe(this._resubscribeTopics);
  544. else this._resubscribeTopics = {};
  545. this._firstConnection = !1
  546. }, w.prototype._onConnect = function (e) {
  547. if (this.disconnected) this.emit("connect", e);
  548. else {
  549. var t = this;
  550. this._setupPingTimer(), this._resubscribe(e), this.connected = !0,
  551. function r() {
  552. var n = t.outgoingStore.createStream();
  553. function i() {
  554. t._storeProcessing = !1, t._packetIdsDuringStoreProcessing = {}
  555. }
  556. function o() {
  557. n.destroy(), n = null, i()
  558. }
  559. t.once("close", o), n.on("error", function (e) {
  560. i(), t.removeListener("close", o), t.emit("error", e)
  561. }), n.on("end", function () {
  562. var n = !0;
  563. for (var s in t._packetIdsDuringStoreProcessing)
  564. if (!t._packetIdsDuringStoreProcessing[s]) {
  565. n = !1;
  566. break
  567. } n ? (i(), t.removeListener("close", o), t.emit("connect", e)) : r()
  568. }),
  569. function e() {
  570. if (n) {
  571. t._storeProcessing = !0;
  572. var r, i = n.read(1);
  573. i ? t._packetIdsDuringStoreProcessing[i.messageId] ? e() : t.disconnecting || t.reconnectTimer ? n.destroy && n.destroy() : (r = t.outgoing[i.messageId] ? t.outgoing[i.messageId].cb : null, t.outgoing[i.messageId] = {
  574. volatile: !1,
  575. cb: function (t, n) {
  576. r && r(t, n), e()
  577. }
  578. }, t._packetIdsDuringStoreProcessing[i.messageId] = !0, t._sendPacket(i)) : n.once("readable", e)
  579. }
  580. }()
  581. }()
  582. }
  583. }, t.exports = w
  584. }).call(this, e("_process"), "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  585. }, {
  586. "./store": 7,
  587. "./validations": 8,
  588. _process: 101,
  589. debug: 17,
  590. events: 83,
  591. inherits: 88,
  592. "mqtt-packet": 93,
  593. "readable-stream": 115,
  594. reinterval: 116,
  595. xtend: 140
  596. }],
  597. 2: [function (e, t, r) {
  598. (function (r) {
  599. "use strict";
  600. var n, i, o, s = e("readable-stream").Transform,
  601. a = e("duplexify"),
  602. c = e("base64-js"),
  603. u = !1;
  604. t.exports = function (e, t) {
  605. if (t.hostname = t.hostname || t.host, !t.hostname) throw new Error("Could not determine host. Specify host manually.");
  606. var l = "MQIsdp" === t.protocolId && 3 === t.protocolVersion ? "mqttv3.1" : "mqtt";
  607. ! function (e) {
  608. e.hostname || (e.hostname = "localhost"), e.path || (e.path = "/"), e.wsOptions || (e.wsOptions = {})
  609. }(t);
  610. var f = function (e, t) {
  611. var r = "alis" === e.protocol ? "wss" : "ws",
  612. n = r + "://" + e.hostname + e.path;
  613. return e.port && 80 !== e.port && 443 !== e.port && (n = r + "://" + e.hostname + ":" + e.port + e.path), "function" == typeof e.transformWsUrl && (n = e.transformWsUrl(n, e, t)), n
  614. }(t, e);
  615. return (n = t.my).connectSocket({
  616. url: f,
  617. protocols: l
  618. }), i = function () {
  619. var e = new s;
  620. return e._write = function (e, t, r) {
  621. n.sendSocketMessage({
  622. data: e.buffer,
  623. success: function () {
  624. r()
  625. },
  626. fail: function () {
  627. r(new Error)
  628. }
  629. })
  630. }, e._flush = function (e) {
  631. n.closeSocket({
  632. success: function () {
  633. e()
  634. }
  635. })
  636. }, e
  637. }(), o = a.obj(), u || (u = !0, n.onSocketOpen(function () {
  638. o.setReadable(i), o.setWritable(i), o.emit("connect")
  639. }), n.onSocketMessage(function (e) {
  640. if ("string" == typeof e.data) {
  641. var t = c.toByteArray(e.data),
  642. n = r.from(t);
  643. i.push(n)
  644. } else {
  645. var o = new FileReader;
  646. o.addEventListener("load", function () {
  647. var e = o.result;
  648. e = e instanceof ArrayBuffer ? r.from(e) : r.from(e, "utf8"), i.push(e)
  649. }), o.readAsArrayBuffer(e.data)
  650. }
  651. }), n.onSocketClose(function () {
  652. o.end(), o.destroy()
  653. }), n.onSocketError(function (e) {
  654. o.destroy(e)
  655. })), o
  656. }
  657. }).call(this, e("buffer").Buffer)
  658. }, {
  659. "base64-js": 10,
  660. buffer: 13,
  661. duplexify: 19,
  662. "readable-stream": 115
  663. }],
  664. 3: [function (e, t, r) {
  665. "use strict";
  666. var n = e("net"),
  667. i = e("debug")("mqttjs:tcp");
  668. t.exports = function (e, t) {
  669. var r, o;
  670. return t.port = t.port || 1883, t.hostname = t.hostname || t.host || "localhost", r = t.port, o = t.hostname, i("port %d and host %s", r, o), n.createConnection(r, o)
  671. }
  672. }, {
  673. debug: 17,
  674. net: 12
  675. }],
  676. 4: [function (e, t, r) {
  677. "use strict";
  678. var n = e("tls"),
  679. i = e("debug")("mqttjs:tls");
  680. t.exports = function (e, t) {
  681. var r;
  682. function o(n) {
  683. t.rejectUnauthorized && e.emit("error", n), r.end()
  684. }
  685. return t.port = t.port || 8883, t.host = t.hostname || t.host || "localhost", t.servername = t.host, t.rejectUnauthorized = !1 !== t.rejectUnauthorized, delete t.path, i("port %d host %s rejectUnauthorized %b", t.port, t.host, t.rejectUnauthorized), (r = n.connect(t)).on("secureConnect", function () {
  686. t.rejectUnauthorized && !r.authorized ? r.emit("error", new Error("TLS not authorized")) : r.removeListener("error", o)
  687. }), r.on("error", o), r
  688. }
  689. }, {
  690. debug: 17,
  691. tls: 12
  692. }],
  693. 5: [function (e, t, r) {
  694. (function (r) {
  695. "use strict";
  696. const n = e("ws"),
  697. i = e("debug")("mqttjs:ws"),
  698. o = e("duplexify"),
  699. s = e("safe-buffer").Buffer,
  700. a = e("url"),
  701. c = e("readable-stream").Transform;
  702. let u = ["rejectUnauthorized", "ca", "cert", "key", "pfx", "passphrase"];
  703. const l = void 0 !== r && "browser" === r.title || "function" == typeof __webpack_require__;
  704. function f(e, t) {
  705. let r = e.protocol + "://" + e.hostname + ":" + e.port + e.path;
  706. return "function" == typeof e.transformWsUrl && (r = e.transformWsUrl(r, e, t)), r
  707. }
  708. function p(e) {
  709. let t = e;
  710. return e.hostname || (t.hostname = "localhost"), e.port || ("wss" === e.protocol ? t.port = 443 : t.port = 80), e.path || (t.path = "/"), e.wsOptions || (t.wsOptions = {}), l || "wss" !== e.protocol || u.forEach(function (r) {
  711. e.hasOwnProperty(r) && !e.wsOptions.hasOwnProperty(r) && (t.wsOptions[r] = e[r])
  712. }), t
  713. }
  714. t.exports = l ? function (e, t) {
  715. let r;
  716. i("browserStreamBuilder");
  717. const n = function (e) {
  718. let t = p(e);
  719. if (t.hostname || (t.hostname = t.host), !t.hostname) {
  720. if ("undefined" == typeof document) throw new Error("Could not determine host. Specify host manually.");
  721. const e = a.parse(document.URL);
  722. t.hostname = e.hostname, t.port || (t.port = e.port)
  723. }
  724. return void 0 === t.objectMode && (t.objectMode = !(!0 === t.binary || void 0 === t.binary)), t
  725. }(t).browserBufferSize || 524288,
  726. u = t.browserBufferTimeout || 1e3,
  727. l = !t.objectMode;
  728. let h = function (e, t) {
  729. const r = "MQIsdp" === t.protocolId && 3 === t.protocolVersion ? "mqttv3.1" : "mqtt";
  730. let n = f(t, e),
  731. i = new WebSocket(n, [r]);
  732. return i.binaryType = "arraybuffer", i
  733. }(e, t),
  734. d = function (e, t, r) {
  735. let n = new c({
  736. objectModeMode: e.objectMode
  737. });
  738. return n._write = t, n._flush = r, n
  739. }(t, function e(t, r, i) {
  740. h.bufferedAmount > n && setTimeout(e, u, t, r, i), l && "string" == typeof t && (t = s.from(t, "utf8"));
  741. try {
  742. h.send(t)
  743. } catch (e) {
  744. return i(e)
  745. }
  746. i()
  747. }, function (e) {
  748. h.close(), e()
  749. });
  750. t.objectMode || (d._writev = v), d.on("close", () => {
  751. h.close()
  752. });
  753. const g = void 0 === h.addEventListener;
  754. function b() {
  755. r.setReadable(d), r.setWritable(d), r.emit("connect")
  756. }
  757. function m() {
  758. r.end(), r.destroy()
  759. }
  760. function y(e) {
  761. r.destroy(e)
  762. }
  763. function _(e) {
  764. let t = e.data;
  765. t = t instanceof ArrayBuffer ? s.from(t) : s.from(t, "utf8"), d.push(t)
  766. }
  767. function v(e, t) {
  768. const r = new Array(e.length);
  769. for (let t = 0; t < e.length; t++) "string" == typeof e[t].chunk ? r[t] = s.from(e[t], "utf8") : r[t] = e[t].chunk;
  770. this._write(s.concat(r), "binary", t)
  771. }
  772. return h.readyState === h.OPEN ? r = d : (r = r = o(void 0, void 0, t), t.objectMode || (r._writev = v), g ? h.addEventListener("open", b) : h.onopen = b), r.socket = h, g ? (h.addEventListener("close", m), h.addEventListener("error", y), h.addEventListener("message", _)) : (h.onclose = m, h.onerror = y, h.onmessage = _), r
  773. } : function (e, t) {
  774. i("streamBuilder");
  775. let r = p(t);
  776. const o = f(r, e);
  777. let s = function (e, t, r) {
  778. i("createWebSocket"), i("protocol: " + r.protocolId + " " + r.protocolVersion);
  779. const o = "MQIsdp" === r.protocolId && 3 === r.protocolVersion ? "mqttv3.1" : "mqtt";
  780. return i("creating new Websocket for url: " + t + " and protocol: " + o), new n(t, [o], r.wsOptions)
  781. }(0, o, r),
  782. a = n.createWebSocketStream(s, r.wsOptions);
  783. return a.url = o, a
  784. }
  785. }).call(this, e("_process"))
  786. }, {
  787. _process: 101,
  788. debug: 17,
  789. duplexify: 19,
  790. "readable-stream": 115,
  791. "safe-buffer": 117,
  792. url: 132,
  793. ws: 139
  794. }],
  795. 6: [function (e, t, r) {
  796. (function (r) {
  797. "use strict";
  798. var n, i, o, s = e("readable-stream").Transform,
  799. a = e("duplexify");
  800. t.exports = function (e, t) {
  801. if (t.hostname = t.hostname || t.host, !t.hostname) throw new Error("Could not determine host. Specify host manually.");
  802. var c = "MQIsdp" === t.protocolId && 3 === t.protocolVersion ? "mqttv3.1" : "mqtt";
  803. ! function (e) {
  804. e.hostname || (e.hostname = "localhost"), e.path || (e.path = "/"), e.wsOptions || (e.wsOptions = {})
  805. }(t);
  806. var u = function (e, t) {
  807. var r = "wxs" === e.protocol ? "wss" : "ws",
  808. n = r + "://" + e.hostname + e.path;
  809. return e.port && 80 !== e.port && 443 !== e.port && (n = r + "://" + e.hostname + ":" + e.port + e.path), "function" == typeof e.transformWsUrl && (n = e.transformWsUrl(n, e, t)), n
  810. }(t, e);
  811. n = wx.connectSocket({
  812. url: u,
  813. protocols: [c]
  814. }), i = function () {
  815. var e = new s;
  816. return e._write = function (e, t, r) {
  817. n.send({
  818. data: e.buffer,
  819. success: function () {
  820. r()
  821. },
  822. fail: function (e) {
  823. r(new Error(e))
  824. }
  825. })
  826. }, e._flush = function (e) {
  827. n.close({
  828. success: function () {
  829. e()
  830. }
  831. })
  832. }, e
  833. }(), (o = a.obj())._destroy = function (e, t) {
  834. n.close({
  835. success: function () {
  836. t && t(e)
  837. }
  838. })
  839. };
  840. var l = o.destroy;
  841. return o.destroy = function () {
  842. o.destroy = l;
  843. var e = this;
  844. setTimeout(function () {
  845. n.close({
  846. fail: function () {
  847. e._destroy(new Error)
  848. }
  849. })
  850. }, 0)
  851. }.bind(o), n.onOpen(function () {
  852. o.setReadable(i), o.setWritable(i), o.emit("connect")
  853. }), n.onMessage(function (e) {
  854. var t = e.data;
  855. t = t instanceof ArrayBuffer ? r.from(t) : r.from(t, "utf8"), i.push(t)
  856. }), n.onClose(function () {
  857. o.end(), o.destroy()
  858. }), n.onError(function (e) {
  859. o.destroy(new Error(e.errMsg))
  860. }), o
  861. }
  862. }).call(this, e("buffer").Buffer)
  863. }, {
  864. buffer: 13,
  865. duplexify: 19,
  866. "readable-stream": 115
  867. }],
  868. 7: [function (e, t, r) {
  869. "use strict";
  870. var n = e("xtend"),
  871. i = e("readable-stream").Readable,
  872. o = {
  873. objectMode: !0
  874. },
  875. s = {
  876. clean: !0
  877. },
  878. a = e("es6-map");
  879. function c(e) {
  880. if (!(this instanceof c)) return new c(e);
  881. this.options = e || {}, this.options = n(s, e), this._inflights = new a
  882. }
  883. c.prototype.put = function (e, t) {
  884. return this._inflights.set(e.messageId, e), t && t(), this
  885. }, c.prototype.createStream = function () {
  886. var e = new i(o),
  887. t = !1,
  888. r = [],
  889. n = 0;
  890. return this._inflights.forEach(function (e, t) {
  891. r.push(e)
  892. }), e._read = function () {
  893. !t && n < r.length ? this.push(r[n++]) : this.push(null)
  894. }, e.destroy = function () {
  895. if (!t) {
  896. var e = this;
  897. t = !0, setTimeout(function () {
  898. e.emit("close")
  899. }, 0)
  900. }
  901. }, e
  902. }, c.prototype.del = function (e, t) {
  903. return (e = this._inflights.get(e.messageId)) ? (this._inflights.delete(e.messageId), t(null, e)) : t && t(new Error("missing packet")), this
  904. }, c.prototype.get = function (e, t) {
  905. return (e = this._inflights.get(e.messageId)) ? t(null, e) : t && t(new Error("missing packet")), this
  906. }, c.prototype.close = function (e) {
  907. this.options.clean && (this._inflights = null), e && e()
  908. }, t.exports = c
  909. }, {
  910. "es6-map": 68,
  911. "readable-stream": 115,
  912. xtend: 140
  913. }],
  914. 8: [function (e, t, r) {
  915. "use strict";
  916. function n(e) {
  917. for (var t = e.split("/"), r = 0; r < t.length; r++)
  918. if ("+" !== t[r]) {
  919. if ("#" === t[r]) return r === t.length - 1;
  920. if (-1 !== t[r].indexOf("+") || -1 !== t[r].indexOf("#")) return !1
  921. } return !0
  922. }
  923. t.exports = {
  924. validateTopics: function (e) {
  925. if (0 === e.length) return "empty_topic_list";
  926. for (var t = 0; t < e.length; t++)
  927. if (!n(e[t])) return e[t];
  928. return null
  929. }
  930. }
  931. }, {}],
  932. 9: [function (e, t, r) {
  933. (function (r) {
  934. "use strict";
  935. var n = e("../client"),
  936. i = e("../store"),
  937. o = e("url"),
  938. s = e("xtend"),
  939. a = e("debug")("mqttjs"),
  940. c = {};
  941. function u(e, t) {
  942. if (a("connecting to an MQTT broker..."), "object" != typeof e || t || (t = e, e = null), t = t || {}, e) {
  943. var r = o.parse(e, !0);
  944. if (null != r.port && (r.port = Number(r.port)), null === (t = s(r, t)).protocol) throw new Error("Missing protocol");
  945. t.protocol = t.protocol.replace(/:$/, "")
  946. }
  947. if (function (e) {
  948. var t;
  949. e.auth && ((t = e.auth.match(/^(.+):(.+)$/)) ? (e.username = t[1], e.password = t[2]) : e.username = e.auth)
  950. }(t), t.query && "string" == typeof t.query.clientId && (t.clientId = t.query.clientId), t.cert && t.key) {
  951. if (!t.protocol) throw new Error("Missing secure protocol key");
  952. if (-1 === ["mqtts", "wss", "wxs", "alis"].indexOf(t.protocol)) switch (t.protocol) {
  953. case "mqtt":
  954. t.protocol = "mqtts";
  955. break;
  956. case "ws":
  957. t.protocol = "wss";
  958. break;
  959. case "wx":
  960. t.protocol = "wxs";
  961. break;
  962. case "ali":
  963. t.protocol = "alis";
  964. break;
  965. default:
  966. throw new Error('Unknown protocol for secure connection: "' + t.protocol + '"!')
  967. }
  968. }
  969. if (!c[t.protocol]) {
  970. var i = -1 !== ["mqtts", "wss"].indexOf(t.protocol);
  971. t.protocol = ["mqtt", "mqtts", "ws", "wss", "wx", "wxs", "ali", "alis"].filter(function (e, t) {
  972. return (!i || t % 2 != 0) && "function" == typeof c[e]
  973. })[0]
  974. }
  975. if (!1 === t.clean && !t.clientId) throw new Error("Missing clientId for unclean clients");
  976. t.protocol && (t.defaultProtocol = t.protocol);
  977. var u = new n(function (e) {
  978. return t.servers && (e._reconnectCount && e._reconnectCount !== t.servers.length || (e._reconnectCount = 0), t.host = t.servers[e._reconnectCount].host, t.port = t.servers[e._reconnectCount].port, t.protocol = t.servers[e._reconnectCount].protocol ? t.servers[e._reconnectCount].protocol : t.defaultProtocol, t.hostname = t.host, e._reconnectCount++), a("calling streambuilder for", t.protocol), c[t.protocol](e, t)
  979. }, t);
  980. return u.on("error", function () {}), u
  981. }
  982. void 0 !== r && "browser" !== r.title || "function" == typeof __webpack_require__ ? (c.mqtt = e("./tcp"), c.tcp = e("./tcp"), c.ssl = e("./tls"), c.tls = e("./tls"), c.mqtts = e("./tls")) : (c.wx = e("./wx"), c.wxs = e("./wx"), c.ali = e("./ali"), c.alis = e("./ali")), c.ws = e("./ws"), c.wss = e("./ws"), t.exports = u, t.exports.connect = u, t.exports.MqttClient = n, t.exports.Store = i
  983. }).call(this, e("_process"))
  984. }, {
  985. "../client": 1,
  986. "../store": 7,
  987. "./ali": 2,
  988. "./tcp": 3,
  989. "./tls": 4,
  990. "./ws": 5,
  991. "./wx": 6,
  992. _process: 101,
  993. debug: 17,
  994. url: 132,
  995. xtend: 140
  996. }],
  997. 10: [function (e, t, r) {
  998. "use strict";
  999. r.byteLength = function (e) {
  1000. var t = u(e),
  1001. r = t[0],
  1002. n = t[1];
  1003. return 3 * (r + n) / 4 - n
  1004. }, r.toByteArray = function (e) {
  1005. var t, r, n = u(e),
  1006. s = n[0],
  1007. a = n[1],
  1008. c = new o(function (e, t, r) {
  1009. return 3 * (t + r) / 4 - r
  1010. }(0, s, a)),
  1011. l = 0,
  1012. f = a > 0 ? s - 4 : s;
  1013. for (r = 0; r < f; r += 4) t = i[e.charCodeAt(r)] << 18 | i[e.charCodeAt(r + 1)] << 12 | i[e.charCodeAt(r + 2)] << 6 | i[e.charCodeAt(r + 3)], c[l++] = t >> 16 & 255, c[l++] = t >> 8 & 255, c[l++] = 255 & t;
  1014. 2 === a && (t = i[e.charCodeAt(r)] << 2 | i[e.charCodeAt(r + 1)] >> 4, c[l++] = 255 & t);
  1015. 1 === a && (t = i[e.charCodeAt(r)] << 10 | i[e.charCodeAt(r + 1)] << 4 | i[e.charCodeAt(r + 2)] >> 2, c[l++] = t >> 8 & 255, c[l++] = 255 & t);
  1016. return c
  1017. }, r.fromByteArray = function (e) {
  1018. for (var t, r = e.length, i = r % 3, o = [], s = 0, a = r - i; s < a; s += 16383) o.push(l(e, s, s + 16383 > a ? a : s + 16383));
  1019. 1 === i ? (t = e[r - 1], o.push(n[t >> 2] + n[t << 4 & 63] + "==")) : 2 === i && (t = (e[r - 2] << 8) + e[r - 1], o.push(n[t >> 10] + n[t >> 4 & 63] + n[t << 2 & 63] + "="));
  1020. return o.join("")
  1021. };
  1022. for (var n = [], i = [], o = "undefined" != typeof Uint8Array ? Uint8Array : Array, s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", a = 0, c = s.length; a < c; ++a) n[a] = s[a], i[s.charCodeAt(a)] = a;
  1023. function u(e) {
  1024. var t = e.length;
  1025. if (t % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4");
  1026. var r = e.indexOf("=");
  1027. return -1 === r && (r = t), [r, r === t ? 0 : 4 - r % 4]
  1028. }
  1029. function l(e, t, r) {
  1030. for (var i, o, s = [], a = t; a < r; a += 3) i = (e[a] << 16 & 16711680) + (e[a + 1] << 8 & 65280) + (255 & e[a + 2]), s.push(n[(o = i) >> 18 & 63] + n[o >> 12 & 63] + n[o >> 6 & 63] + n[63 & o]);
  1031. return s.join("")
  1032. }
  1033. i["-".charCodeAt(0)] = 62, i["_".charCodeAt(0)] = 63
  1034. }, {}],
  1035. 11: [function (e, t, r) {
  1036. var n = e("readable-stream/duplex"),
  1037. i = e("util"),
  1038. o = e("safe-buffer").Buffer;
  1039. function s(e) {
  1040. if (!(this instanceof s)) return new s(e);
  1041. if (this._bufs = [], this.length = 0, "function" == typeof e) {
  1042. this._callback = e;
  1043. var t = function (e) {
  1044. this._callback && (this._callback(e), this._callback = null)
  1045. }.bind(this);
  1046. this.on("pipe", function (e) {
  1047. e.on("error", t)
  1048. }), this.on("unpipe", function (e) {
  1049. e.removeListener("error", t)
  1050. })
  1051. } else this.append(e);
  1052. n.call(this)
  1053. }
  1054. i.inherits(s, n), s.prototype._offset = function (e) {
  1055. var t, r = 0,
  1056. n = 0;
  1057. if (0 === e) return [0, 0];
  1058. for (; n < this._bufs.length; n++) {
  1059. if (e < (t = r + this._bufs[n].length) || n == this._bufs.length - 1) return [n, e - r];
  1060. r = t
  1061. }
  1062. }, s.prototype.append = function (e) {
  1063. var t = 0;
  1064. if (o.isBuffer(e)) this._appendBuffer(e);
  1065. else if (Array.isArray(e))
  1066. for (; t < e.length; t++) this.append(e[t]);
  1067. else if (e instanceof s)
  1068. for (; t < e._bufs.length; t++) this.append(e._bufs[t]);
  1069. else null != e && ("number" == typeof e && (e = e.toString()), this._appendBuffer(o.from(e)));
  1070. return this
  1071. }, s.prototype._appendBuffer = function (e) {
  1072. this._bufs.push(e), this.length += e.length
  1073. }, s.prototype._write = function (e, t, r) {
  1074. this._appendBuffer(e), "function" == typeof r && r()
  1075. }, s.prototype._read = function (e) {
  1076. if (!this.length) return this.push(null);
  1077. e = Math.min(e, this.length), this.push(this.slice(0, e)), this.consume(e)
  1078. }, s.prototype.end = function (e) {
  1079. n.prototype.end.call(this, e), this._callback && (this._callback(null, this.slice()), this._callback = null)
  1080. }, s.prototype.get = function (e) {
  1081. return this.slice(e, e + 1)[0]
  1082. }, s.prototype.slice = function (e, t) {
  1083. return "number" == typeof e && e < 0 && (e += this.length), "number" == typeof t && t < 0 && (t += this.length), this.copy(null, 0, e, t)
  1084. }, s.prototype.copy = function (e, t, r, n) {
  1085. if (("number" != typeof r || r < 0) && (r = 0), ("number" != typeof n || n > this.length) && (n = this.length), r >= this.length) return e || o.alloc(0);
  1086. if (n <= 0) return e || o.alloc(0);
  1087. var i, s, a = !!e,
  1088. c = this._offset(r),
  1089. u = n - r,
  1090. l = u,
  1091. f = a && t || 0,
  1092. p = c[1];
  1093. if (0 === r && n == this.length) {
  1094. if (!a) return 1 === this._bufs.length ? this._bufs[0] : o.concat(this._bufs, this.length);
  1095. for (s = 0; s < this._bufs.length; s++) this._bufs[s].copy(e, f), f += this._bufs[s].length;
  1096. return e
  1097. }
  1098. if (l <= this._bufs[c[0]].length - p) return a ? this._bufs[c[0]].copy(e, t, p, p + l) : this._bufs[c[0]].slice(p, p + l);
  1099. for (a || (e = o.allocUnsafe(u)), s = c[0]; s < this._bufs.length; s++) {
  1100. if (!(l > (i = this._bufs[s].length - p))) {
  1101. this._bufs[s].copy(e, f, p, p + l);
  1102. break
  1103. }
  1104. this._bufs[s].copy(e, f, p), f += i, l -= i, p && (p = 0)
  1105. }
  1106. return e
  1107. }, s.prototype.shallowSlice = function (e, t) {
  1108. e = e || 0, t = t || this.length, e < 0 && (e += this.length), t < 0 && (t += this.length);
  1109. var r = this._offset(e),
  1110. n = this._offset(t),
  1111. i = this._bufs.slice(r[0], n[0] + 1);
  1112. return 0 == n[1] ? i.pop() : i[i.length - 1] = i[i.length - 1].slice(0, n[1]), 0 != r[1] && (i[0] = i[0].slice(r[1])), new s(i)
  1113. }, s.prototype.toString = function (e, t, r) {
  1114. return this.slice(t, r).toString(e)
  1115. }, s.prototype.consume = function (e) {
  1116. for (; this._bufs.length;) {
  1117. if (!(e >= this._bufs[0].length)) {
  1118. this._bufs[0] = this._bufs[0].slice(e), this.length -= e;
  1119. break
  1120. }
  1121. e -= this._bufs[0].length, this.length -= this._bufs[0].length, this._bufs.shift()
  1122. }
  1123. return this
  1124. }, s.prototype.duplicate = function () {
  1125. for (var e = 0, t = new s; e < this._bufs.length; e++) t.append(this._bufs[e]);
  1126. return t
  1127. }, s.prototype.destroy = function () {
  1128. this._bufs.length = 0, this.length = 0, this.push(null)
  1129. },
  1130. function () {
  1131. var e = {
  1132. readDoubleBE: 8,
  1133. readDoubleLE: 8,
  1134. readFloatBE: 4,
  1135. readFloatLE: 4,
  1136. readInt32BE: 4,
  1137. readInt32LE: 4,
  1138. readUInt32BE: 4,
  1139. readUInt32LE: 4,
  1140. readInt16BE: 2,
  1141. readInt16LE: 2,
  1142. readUInt16BE: 2,
  1143. readUInt16LE: 2,
  1144. readInt8: 1,
  1145. readUInt8: 1
  1146. };
  1147. for (var t in e) ! function (t) {
  1148. s.prototype[t] = function (r) {
  1149. return this.slice(r, r + e[t])[t](0)
  1150. }
  1151. }(t)
  1152. }(), t.exports = s
  1153. }, {
  1154. "readable-stream/duplex": 106,
  1155. "safe-buffer": 117,
  1156. util: 137
  1157. }],
  1158. 12: [function (e, t, r) {}, {}],
  1159. 13: [function (e, t, r) {
  1160. (function (t) {
  1161. "use strict";
  1162. var n = e("base64-js"),
  1163. i = e("ieee754");
  1164. r.Buffer = t, r.SlowBuffer = function (e) {
  1165. +e != e && (e = 0);
  1166. return t.alloc(+e)
  1167. }, r.INSPECT_MAX_BYTES = 50;
  1168. var o = 2147483647;
  1169. function s(e) {
  1170. if (e > o) throw new RangeError('The value "' + e + '" is invalid for option "size"');
  1171. var r = new Uint8Array(e);
  1172. return r.__proto__ = t.prototype, r
  1173. }
  1174. function t(e, t, r) {
  1175. if ("number" == typeof e) {
  1176. if ("string" == typeof t) throw new TypeError('The "string" argument must be of type string. Received type number');
  1177. return u(e)
  1178. }
  1179. return a(e, t, r)
  1180. }
  1181. function a(e, r, n) {
  1182. if ("string" == typeof e) return function (e, r) {
  1183. "string" == typeof r && "" !== r || (r = "utf8");
  1184. if (!t.isEncoding(r)) throw new TypeError("Unknown encoding: " + r);
  1185. var n = 0 | p(e, r),
  1186. i = s(n),
  1187. o = i.write(e, r);
  1188. o !== n && (i = i.slice(0, o));
  1189. return i
  1190. }(e, r);
  1191. if (ArrayBuffer.isView(e)) return l(e);
  1192. if (null == e) throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof e);
  1193. if (q(e, ArrayBuffer) || e && q(e.buffer, ArrayBuffer)) return function (e, r, n) {
  1194. if (r < 0 || e.byteLength < r) throw new RangeError('"offset" is outside of buffer bounds');
  1195. if (e.byteLength < r + (n || 0)) throw new RangeError('"length" is outside of buffer bounds');
  1196. var i;
  1197. i = void 0 === r && void 0 === n ? new Uint8Array(e) : void 0 === n ? new Uint8Array(e, r) : new Uint8Array(e, r, n);
  1198. return i.__proto__ = t.prototype, i
  1199. }(e, r, n);
  1200. if ("number" == typeof e) throw new TypeError('The "value" argument must not be of type number. Received type number');
  1201. var i = e.valueOf && e.valueOf();
  1202. if (null != i && i !== e) return t.from(i, r, n);
  1203. var o = function (e) {
  1204. if (t.isBuffer(e)) {
  1205. var r = 0 | f(e.length),
  1206. n = s(r);
  1207. return 0 === n.length ? n : (e.copy(n, 0, 0, r), n)
  1208. }
  1209. if (void 0 !== e.length) return "number" != typeof e.length || F(e.length) ? s(0) : l(e);
  1210. if ("Buffer" === e.type && Array.isArray(e.data)) return l(e.data)
  1211. }(e);
  1212. if (o) return o;
  1213. if ("undefined" != typeof Symbol && null != Symbol.toPrimitive && "function" == typeof e[Symbol.toPrimitive]) return t.from(e[Symbol.toPrimitive]("string"), r, n);
  1214. throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof e)
  1215. }
  1216. function c(e) {
  1217. if ("number" != typeof e) throw new TypeError('"size" argument must be of type number');
  1218. if (e < 0) throw new RangeError('The value "' + e + '" is invalid for option "size"')
  1219. }
  1220. function u(e) {
  1221. return c(e), s(e < 0 ? 0 : 0 | f(e))
  1222. }
  1223. function l(e) {
  1224. for (var t = e.length < 0 ? 0 : 0 | f(e.length), r = s(t), n = 0; n < t; n += 1) r[n] = 255 & e[n];
  1225. return r
  1226. }
  1227. function f(e) {
  1228. if (e >= o) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + o.toString(16) + " bytes");
  1229. return 0 | e
  1230. }
  1231. function p(e, r) {
  1232. if (t.isBuffer(e)) return e.length;
  1233. if (ArrayBuffer.isView(e) || q(e, ArrayBuffer)) return e.byteLength;
  1234. if ("string" != typeof e) throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof e);
  1235. var n = e.length,
  1236. i = arguments.length > 2 && !0 === arguments[2];
  1237. if (!i && 0 === n) return 0;
  1238. for (var o = !1;;) switch (r) {
  1239. case "ascii":
  1240. case "latin1":
  1241. case "binary":
  1242. return n;
  1243. case "utf8":
  1244. case "utf-8":
  1245. return N(e).length;
  1246. case "ucs2":
  1247. case "ucs-2":
  1248. case "utf16le":
  1249. case "utf-16le":
  1250. return 2 * n;
  1251. case "hex":
  1252. return n >>> 1;
  1253. case "base64":
  1254. return U(e).length;
  1255. default:
  1256. if (o) return i ? -1 : N(e).length;
  1257. r = ("" + r).toLowerCase(), o = !0
  1258. }
  1259. }
  1260. function h(e, t, r) {
  1261. var n = e[t];
  1262. e[t] = e[r], e[r] = n
  1263. }
  1264. function d(e, r, n, i, o) {
  1265. if (0 === e.length) return -1;
  1266. if ("string" == typeof n ? (i = n, n = 0) : n > 2147483647 ? n = 2147483647 : n < -2147483648 && (n = -2147483648), F(n = +n) && (n = o ? 0 : e.length - 1), n < 0 && (n = e.length + n), n >= e.length) {
  1267. if (o) return -1;
  1268. n = e.length - 1
  1269. } else if (n < 0) {
  1270. if (!o) return -1;
  1271. n = 0
  1272. }
  1273. if ("string" == typeof r && (r = t.from(r, i)), t.isBuffer(r)) return 0 === r.length ? -1 : g(e, r, n, i, o);
  1274. if ("number" == typeof r) return r &= 255, "function" == typeof Uint8Array.prototype.indexOf ? o ? Uint8Array.prototype.indexOf.call(e, r, n) : Uint8Array.prototype.lastIndexOf.call(e, r, n) : g(e, [r], n, i, o);
  1275. throw new TypeError("val must be string, number or Buffer")
  1276. }
  1277. function g(e, t, r, n, i) {
  1278. var o, s = 1,
  1279. a = e.length,
  1280. c = t.length;
  1281. if (void 0 !== n && ("ucs2" === (n = String(n).toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  1282. if (e.length < 2 || t.length < 2) return -1;
  1283. s = 2, a /= 2, c /= 2, r /= 2
  1284. }
  1285. function u(e, t) {
  1286. return 1 === s ? e[t] : e.readUInt16BE(t * s)
  1287. }
  1288. if (i) {
  1289. var l = -1;
  1290. for (o = r; o < a; o++)
  1291. if (u(e, o) === u(t, -1 === l ? 0 : o - l)) {
  1292. if (-1 === l && (l = o), o - l + 1 === c) return l * s
  1293. } else -1 !== l && (o -= o - l), l = -1
  1294. } else
  1295. for (r + c > a && (r = a - c), o = r; o >= 0; o--) {
  1296. for (var f = !0, p = 0; p < c; p++)
  1297. if (u(e, o + p) !== u(t, p)) {
  1298. f = !1;
  1299. break
  1300. } if (f) return o
  1301. }
  1302. return -1
  1303. }
  1304. function b(e, t, r, n) {
  1305. r = Number(r) || 0;
  1306. var i = e.length - r;
  1307. n ? (n = Number(n)) > i && (n = i) : n = i;
  1308. var o = t.length;
  1309. n > o / 2 && (n = o / 2);
  1310. for (var s = 0; s < n; ++s) {
  1311. var a = parseInt(t.substr(2 * s, 2), 16);
  1312. if (F(a)) return s;
  1313. e[r + s] = a
  1314. }
  1315. return s
  1316. }
  1317. function m(e, t, r, n) {
  1318. return L(N(t, e.length - r), e, r, n)
  1319. }
  1320. function y(e, t, r, n) {
  1321. return L(function (e) {
  1322. for (var t = [], r = 0; r < e.length; ++r) t.push(255 & e.charCodeAt(r));
  1323. return t
  1324. }(t), e, r, n)
  1325. }
  1326. function _(e, t, r, n) {
  1327. return y(e, t, r, n)
  1328. }
  1329. function v(e, t, r, n) {
  1330. return L(U(t), e, r, n)
  1331. }
  1332. function w(e, t, r, n) {
  1333. return L(function (e, t) {
  1334. for (var r, n, i, o = [], s = 0; s < e.length && !((t -= 2) < 0); ++s) r = e.charCodeAt(s), n = r >> 8, i = r % 256, o.push(i), o.push(n);
  1335. return o
  1336. }(t, e.length - r), e, r, n)
  1337. }
  1338. function S(e, t, r) {
  1339. return 0 === t && r === e.length ? n.fromByteArray(e) : n.fromByteArray(e.slice(t, r))
  1340. }
  1341. function k(e, t, r) {
  1342. r = Math.min(e.length, r);
  1343. for (var n = [], i = t; i < r;) {
  1344. var o, s, a, c, u = e[i],
  1345. l = null,
  1346. f = u > 239 ? 4 : u > 223 ? 3 : u > 191 ? 2 : 1;
  1347. if (i + f <= r) switch (f) {
  1348. case 1:
  1349. u < 128 && (l = u);
  1350. break;
  1351. case 2:
  1352. 128 == (192 & (o = e[i + 1])) && (c = (31 & u) << 6 | 63 & o) > 127 && (l = c);
  1353. break;
  1354. case 3:
  1355. o = e[i + 1], s = e[i + 2], 128 == (192 & o) && 128 == (192 & s) && (c = (15 & u) << 12 | (63 & o) << 6 | 63 & s) > 2047 && (c < 55296 || c > 57343) && (l = c);
  1356. break;
  1357. case 4:
  1358. o = e[i + 1], s = e[i + 2], a = e[i + 3], 128 == (192 & o) && 128 == (192 & s) && 128 == (192 & a) && (c = (15 & u) << 18 | (63 & o) << 12 | (63 & s) << 6 | 63 & a) > 65535 && c < 1114112 && (l = c)
  1359. }
  1360. null === l ? (l = 65533, f = 1) : l > 65535 && (l -= 65536, n.push(l >>> 10 & 1023 | 55296), l = 56320 | 1023 & l), n.push(l), i += f
  1361. }
  1362. return function (e) {
  1363. var t = e.length;
  1364. if (t <= x) return String.fromCharCode.apply(String, e);
  1365. var r = "",
  1366. n = 0;
  1367. for (; n < t;) r += String.fromCharCode.apply(String, e.slice(n, n += x));
  1368. return r
  1369. }(n)
  1370. }
  1371. r.kMaxLength = o, t.TYPED_ARRAY_SUPPORT = function () {
  1372. try {
  1373. var e = new Uint8Array(1);
  1374. return e.__proto__ = {
  1375. __proto__: Uint8Array.prototype,
  1376. foo: function () {
  1377. return 42
  1378. }
  1379. }, 42 === e.foo()
  1380. } catch (e) {
  1381. return !1
  1382. }
  1383. }(), t.TYPED_ARRAY_SUPPORT || "undefined" == typeof console || "function" != typeof console.error || console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."), Object.defineProperty(t.prototype, "parent", {
  1384. enumerable: !0,
  1385. get: function () {
  1386. if (t.isBuffer(this)) return this.buffer
  1387. }
  1388. }), Object.defineProperty(t.prototype, "offset", {
  1389. enumerable: !0,
  1390. get: function () {
  1391. if (t.isBuffer(this)) return this.byteOffset
  1392. }
  1393. }), "undefined" != typeof Symbol && null != Symbol.species && t[Symbol.species] === t && Object.defineProperty(t, Symbol.species, {
  1394. value: null,
  1395. configurable: !0,
  1396. enumerable: !1,
  1397. writable: !1
  1398. }), t.poolSize = 8192, t.from = function (e, t, r) {
  1399. return a(e, t, r)
  1400. }, t.prototype.__proto__ = Uint8Array.prototype, t.__proto__ = Uint8Array, t.alloc = function (e, t, r) {
  1401. return function (e, t, r) {
  1402. return c(e), e <= 0 ? s(e) : void 0 !== t ? "string" == typeof r ? s(e).fill(t, r) : s(e).fill(t) : s(e)
  1403. }(e, t, r)
  1404. }, t.allocUnsafe = function (e) {
  1405. return u(e)
  1406. }, t.allocUnsafeSlow = function (e) {
  1407. return u(e)
  1408. }, t.isBuffer = function (e) {
  1409. return null != e && !0 === e._isBuffer && e !== t.prototype
  1410. }, t.compare = function (e, r) {
  1411. if (q(e, Uint8Array) && (e = t.from(e, e.offset, e.byteLength)), q(r, Uint8Array) && (r = t.from(r, r.offset, r.byteLength)), !t.isBuffer(e) || !t.isBuffer(r)) throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');
  1412. if (e === r) return 0;
  1413. for (var n = e.length, i = r.length, o = 0, s = Math.min(n, i); o < s; ++o)
  1414. if (e[o] !== r[o]) {
  1415. n = e[o], i = r[o];
  1416. break
  1417. } return n < i ? -1 : i < n ? 1 : 0
  1418. }, t.isEncoding = function (e) {
  1419. switch (String(e).toLowerCase()) {
  1420. case "hex":
  1421. case "utf8":
  1422. case "utf-8":
  1423. case "ascii":
  1424. case "latin1":
  1425. case "binary":
  1426. case "base64":
  1427. case "ucs2":
  1428. case "ucs-2":
  1429. case "utf16le":
  1430. case "utf-16le":
  1431. return !0;
  1432. default:
  1433. return !1
  1434. }
  1435. }, t.concat = function (e, r) {
  1436. if (!Array.isArray(e)) throw new TypeError('"list" argument must be an Array of Buffers');
  1437. if (0 === e.length) return t.alloc(0);
  1438. var n;
  1439. if (void 0 === r)
  1440. for (r = 0, n = 0; n < e.length; ++n) r += e[n].length;
  1441. var i = t.allocUnsafe(r),
  1442. o = 0;
  1443. for (n = 0; n < e.length; ++n) {
  1444. var s = e[n];
  1445. if (q(s, Uint8Array) && (s = t.from(s)), !t.isBuffer(s)) throw new TypeError('"list" argument must be an Array of Buffers');
  1446. s.copy(i, o), o += s.length
  1447. }
  1448. return i
  1449. }, t.byteLength = p, t.prototype._isBuffer = !0, t.prototype.swap16 = function () {
  1450. var e = this.length;
  1451. if (e % 2 != 0) throw new RangeError("Buffer size must be a multiple of 16-bits");
  1452. for (var t = 0; t < e; t += 2) h(this, t, t + 1);
  1453. return this
  1454. }, t.prototype.swap32 = function () {
  1455. var e = this.length;
  1456. if (e % 4 != 0) throw new RangeError("Buffer size must be a multiple of 32-bits");
  1457. for (var t = 0; t < e; t += 4) h(this, t, t + 3), h(this, t + 1, t + 2);
  1458. return this
  1459. }, t.prototype.swap64 = function () {
  1460. var e = this.length;
  1461. if (e % 8 != 0) throw new RangeError("Buffer size must be a multiple of 64-bits");
  1462. for (var t = 0; t < e; t += 8) h(this, t, t + 7), h(this, t + 1, t + 6), h(this, t + 2, t + 5), h(this, t + 3, t + 4);
  1463. return this
  1464. }, t.prototype.toString = function () {
  1465. var e = this.length;
  1466. return 0 === e ? "" : 0 === arguments.length ? k(this, 0, e) : function (e, t, r) {
  1467. var n = !1;
  1468. if ((void 0 === t || t < 0) && (t = 0), t > this.length) return "";
  1469. if ((void 0 === r || r > this.length) && (r = this.length), r <= 0) return "";
  1470. if ((r >>>= 0) <= (t >>>= 0)) return "";
  1471. for (e || (e = "utf8");;) switch (e) {
  1472. case "hex":
  1473. return C(this, t, r);
  1474. case "utf8":
  1475. case "utf-8":
  1476. return k(this, t, r);
  1477. case "ascii":
  1478. return E(this, t, r);
  1479. case "latin1":
  1480. case "binary":
  1481. return I(this, t, r);
  1482. case "base64":
  1483. return S(this, t, r);
  1484. case "ucs2":
  1485. case "ucs-2":
  1486. case "utf16le":
  1487. case "utf-16le":
  1488. return O(this, t, r);
  1489. default:
  1490. if (n) throw new TypeError("Unknown encoding: " + e);
  1491. e = (e + "").toLowerCase(), n = !0
  1492. }
  1493. }.apply(this, arguments)
  1494. }, t.prototype.toLocaleString = t.prototype.toString, t.prototype.equals = function (e) {
  1495. if (!t.isBuffer(e)) throw new TypeError("Argument must be a Buffer");
  1496. return this === e || 0 === t.compare(this, e)
  1497. }, t.prototype.inspect = function () {
  1498. var e = "",
  1499. t = r.INSPECT_MAX_BYTES;
  1500. return e = this.toString("hex", 0, t).replace(/(.{2})/g, "$1 ").trim(), this.length > t && (e += " ... "), "<Buffer " + e + ">"
  1501. }, t.prototype.compare = function (e, r, n, i, o) {
  1502. if (q(e, Uint8Array) && (e = t.from(e, e.offset, e.byteLength)), !t.isBuffer(e)) throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof e);
  1503. if (void 0 === r && (r = 0), void 0 === n && (n = e ? e.length : 0), void 0 === i && (i = 0), void 0 === o && (o = this.length), r < 0 || n > e.length || i < 0 || o > this.length) throw new RangeError("out of range index");
  1504. if (i >= o && r >= n) return 0;
  1505. if (i >= o) return -1;
  1506. if (r >= n) return 1;
  1507. if (r >>>= 0, n >>>= 0, i >>>= 0, o >>>= 0, this === e) return 0;
  1508. for (var s = o - i, a = n - r, c = Math.min(s, a), u = this.slice(i, o), l = e.slice(r, n), f = 0; f < c; ++f)
  1509. if (u[f] !== l[f]) {
  1510. s = u[f], a = l[f];
  1511. break
  1512. } return s < a ? -1 : a < s ? 1 : 0
  1513. }, t.prototype.includes = function (e, t, r) {
  1514. return -1 !== this.indexOf(e, t, r)
  1515. }, t.prototype.indexOf = function (e, t, r) {
  1516. return d(this, e, t, r, !0)
  1517. }, t.prototype.lastIndexOf = function (e, t, r) {
  1518. return d(this, e, t, r, !1)
  1519. }, t.prototype.write = function (e, t, r, n) {
  1520. if (void 0 === t) n = "utf8", r = this.length, t = 0;
  1521. else if (void 0 === r && "string" == typeof t) n = t, r = this.length, t = 0;
  1522. else {
  1523. if (!isFinite(t)) throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  1524. t >>>= 0, isFinite(r) ? (r >>>= 0, void 0 === n && (n = "utf8")) : (n = r, r = void 0)
  1525. }
  1526. var i = this.length - t;
  1527. if ((void 0 === r || r > i) && (r = i), e.length > 0 && (r < 0 || t < 0) || t > this.length) throw new RangeError("Attempt to write outside buffer bounds");
  1528. n || (n = "utf8");
  1529. for (var o = !1;;) switch (n) {
  1530. case "hex":
  1531. return b(this, e, t, r);
  1532. case "utf8":
  1533. case "utf-8":
  1534. return m(this, e, t, r);
  1535. case "ascii":
  1536. return y(this, e, t, r);
  1537. case "latin1":
  1538. case "binary":
  1539. return _(this, e, t, r);
  1540. case "base64":
  1541. return v(this, e, t, r);
  1542. case "ucs2":
  1543. case "ucs-2":
  1544. case "utf16le":
  1545. case "utf-16le":
  1546. return w(this, e, t, r);
  1547. default:
  1548. if (o) throw new TypeError("Unknown encoding: " + n);
  1549. n = ("" + n).toLowerCase(), o = !0
  1550. }
  1551. }, t.prototype.toJSON = function () {
  1552. return {
  1553. type: "Buffer",
  1554. data: Array.prototype.slice.call(this._arr || this, 0)
  1555. }
  1556. };
  1557. var x = 4096;
  1558. function E(e, t, r) {
  1559. var n = "";
  1560. r = Math.min(e.length, r);
  1561. for (var i = t; i < r; ++i) n += String.fromCharCode(127 & e[i]);
  1562. return n
  1563. }
  1564. function I(e, t, r) {
  1565. var n = "";
  1566. r = Math.min(e.length, r);
  1567. for (var i = t; i < r; ++i) n += String.fromCharCode(e[i]);
  1568. return n
  1569. }
  1570. function C(e, t, r) {
  1571. var n = e.length;
  1572. (!t || t < 0) && (t = 0), (!r || r < 0 || r > n) && (r = n);
  1573. for (var i = "", o = t; o < r; ++o) i += R(e[o]);
  1574. return i
  1575. }
  1576. function O(e, t, r) {
  1577. for (var n = e.slice(t, r), i = "", o = 0; o < n.length; o += 2) i += String.fromCharCode(n[o] + 256 * n[o + 1]);
  1578. return i
  1579. }
  1580. function j(e, t, r) {
  1581. if (e % 1 != 0 || e < 0) throw new RangeError("offset is not uint");
  1582. if (e + t > r) throw new RangeError("Trying to access beyond buffer length")
  1583. }
  1584. function A(e, r, n, i, o, s) {
  1585. if (!t.isBuffer(e)) throw new TypeError('"buffer" argument must be a Buffer instance');
  1586. if (r > o || r < s) throw new RangeError('"value" argument is out of bounds');
  1587. if (n + i > e.length) throw new RangeError("Index out of range")
  1588. }
  1589. function T(e, t, r, n, i, o) {
  1590. if (r + n > e.length) throw new RangeError("Index out of range");
  1591. if (r < 0) throw new RangeError("Index out of range")
  1592. }
  1593. function P(e, t, r, n, o) {
  1594. return t = +t, r >>>= 0, o || T(e, 0, r, 4), i.write(e, t, r, n, 23, 4), r + 4
  1595. }
  1596. function M(e, t, r, n, o) {
  1597. return t = +t, r >>>= 0, o || T(e, 0, r, 8), i.write(e, t, r, n, 52, 8), r + 8
  1598. }
  1599. t.prototype.slice = function (e, r) {
  1600. var n = this.length;
  1601. e = ~~e, r = void 0 === r ? n : ~~r, e < 0 ? (e += n) < 0 && (e = 0) : e > n && (e = n), r < 0 ? (r += n) < 0 && (r = 0) : r > n && (r = n), r < e && (r = e);
  1602. var i = this.subarray(e, r);
  1603. return i.__proto__ = t.prototype, i
  1604. }, t.prototype.readUIntLE = function (e, t, r) {
  1605. e >>>= 0, t >>>= 0, r || j(e, t, this.length);
  1606. for (var n = this[e], i = 1, o = 0; ++o < t && (i *= 256);) n += this[e + o] * i;
  1607. return n
  1608. }, t.prototype.readUIntBE = function (e, t, r) {
  1609. e >>>= 0, t >>>= 0, r || j(e, t, this.length);
  1610. for (var n = this[e + --t], i = 1; t > 0 && (i *= 256);) n += this[e + --t] * i;
  1611. return n
  1612. }, t.prototype.readUInt8 = function (e, t) {
  1613. return e >>>= 0, t || j(e, 1, this.length), this[e]
  1614. }, t.prototype.readUInt16LE = function (e, t) {
  1615. return e >>>= 0, t || j(e, 2, this.length), this[e] | this[e + 1] << 8
  1616. }, t.prototype.readUInt16BE = function (e, t) {
  1617. return e >>>= 0, t || j(e, 2, this.length), this[e] << 8 | this[e + 1]
  1618. }, t.prototype.readUInt32LE = function (e, t) {
  1619. return e >>>= 0, t || j(e, 4, this.length), (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  1620. }, t.prototype.readUInt32BE = function (e, t) {
  1621. return e >>>= 0, t || j(e, 4, this.length), 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  1622. }, t.prototype.readIntLE = function (e, t, r) {
  1623. e >>>= 0, t >>>= 0, r || j(e, t, this.length);
  1624. for (var n = this[e], i = 1, o = 0; ++o < t && (i *= 256);) n += this[e + o] * i;
  1625. return n >= (i *= 128) && (n -= Math.pow(2, 8 * t)), n
  1626. }, t.prototype.readIntBE = function (e, t, r) {
  1627. e >>>= 0, t >>>= 0, r || j(e, t, this.length);
  1628. for (var n = t, i = 1, o = this[e + --n]; n > 0 && (i *= 256);) o += this[e + --n] * i;
  1629. return o >= (i *= 128) && (o -= Math.pow(2, 8 * t)), o
  1630. }, t.prototype.readInt8 = function (e, t) {
  1631. return e >>>= 0, t || j(e, 1, this.length), 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
  1632. }, t.prototype.readInt16LE = function (e, t) {
  1633. e >>>= 0, t || j(e, 2, this.length);
  1634. var r = this[e] | this[e + 1] << 8;
  1635. return 32768 & r ? 4294901760 | r : r
  1636. }, t.prototype.readInt16BE = function (e, t) {
  1637. e >>>= 0, t || j(e, 2, this.length);
  1638. var r = this[e + 1] | this[e] << 8;
  1639. return 32768 & r ? 4294901760 | r : r
  1640. }, t.prototype.readInt32LE = function (e, t) {
  1641. return e >>>= 0, t || j(e, 4, this.length), this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  1642. }, t.prototype.readInt32BE = function (e, t) {
  1643. return e >>>= 0, t || j(e, 4, this.length), this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  1644. }, t.prototype.readFloatLE = function (e, t) {
  1645. return e >>>= 0, t || j(e, 4, this.length), i.read(this, e, !0, 23, 4)
  1646. }, t.prototype.readFloatBE = function (e, t) {
  1647. return e >>>= 0, t || j(e, 4, this.length), i.read(this, e, !1, 23, 4)
  1648. }, t.prototype.readDoubleLE = function (e, t) {
  1649. return e >>>= 0, t || j(e, 8, this.length), i.read(this, e, !0, 52, 8)
  1650. }, t.prototype.readDoubleBE = function (e, t) {
  1651. return e >>>= 0, t || j(e, 8, this.length), i.read(this, e, !1, 52, 8)
  1652. }, t.prototype.writeUIntLE = function (e, t, r, n) {
  1653. (e = +e, t >>>= 0, r >>>= 0, n) || A(this, e, t, r, Math.pow(2, 8 * r) - 1, 0);
  1654. var i = 1,
  1655. o = 0;
  1656. for (this[t] = 255 & e; ++o < r && (i *= 256);) this[t + o] = e / i & 255;
  1657. return t + r
  1658. }, t.prototype.writeUIntBE = function (e, t, r, n) {
  1659. (e = +e, t >>>= 0, r >>>= 0, n) || A(this, e, t, r, Math.pow(2, 8 * r) - 1, 0);
  1660. var i = r - 1,
  1661. o = 1;
  1662. for (this[t + i] = 255 & e; --i >= 0 && (o *= 256);) this[t + i] = e / o & 255;
  1663. return t + r
  1664. }, t.prototype.writeUInt8 = function (e, t, r) {
  1665. return e = +e, t >>>= 0, r || A(this, e, t, 1, 255, 0), this[t] = 255 & e, t + 1
  1666. }, t.prototype.writeUInt16LE = function (e, t, r) {
  1667. return e = +e, t >>>= 0, r || A(this, e, t, 2, 65535, 0), this[t] = 255 & e, this[t + 1] = e >>> 8, t + 2
  1668. }, t.prototype.writeUInt16BE = function (e, t, r) {
  1669. return e = +e, t >>>= 0, r || A(this, e, t, 2, 65535, 0), this[t] = e >>> 8, this[t + 1] = 255 & e, t + 2
  1670. }, t.prototype.writeUInt32LE = function (e, t, r) {
  1671. return e = +e, t >>>= 0, r || A(this, e, t, 4, 4294967295, 0), this[t + 3] = e >>> 24, this[t + 2] = e >>> 16, this[t + 1] = e >>> 8, this[t] = 255 & e, t + 4
  1672. }, t.prototype.writeUInt32BE = function (e, t, r) {
  1673. return e = +e, t >>>= 0, r || A(this, e, t, 4, 4294967295, 0), this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = 255 & e, t + 4
  1674. }, t.prototype.writeIntLE = function (e, t, r, n) {
  1675. if (e = +e, t >>>= 0, !n) {
  1676. var i = Math.pow(2, 8 * r - 1);
  1677. A(this, e, t, r, i - 1, -i)
  1678. }
  1679. var o = 0,
  1680. s = 1,
  1681. a = 0;
  1682. for (this[t] = 255 & e; ++o < r && (s *= 256);) e < 0 && 0 === a && 0 !== this[t + o - 1] && (a = 1), this[t + o] = (e / s >> 0) - a & 255;
  1683. return t + r
  1684. }, t.prototype.writeIntBE = function (e, t, r, n) {
  1685. if (e = +e, t >>>= 0, !n) {
  1686. var i = Math.pow(2, 8 * r - 1);
  1687. A(this, e, t, r, i - 1, -i)
  1688. }
  1689. var o = r - 1,
  1690. s = 1,
  1691. a = 0;
  1692. for (this[t + o] = 255 & e; --o >= 0 && (s *= 256);) e < 0 && 0 === a && 0 !== this[t + o + 1] && (a = 1), this[t + o] = (e / s >> 0) - a & 255;
  1693. return t + r
  1694. }, t.prototype.writeInt8 = function (e, t, r) {
  1695. return e = +e, t >>>= 0, r || A(this, e, t, 1, 127, -128), e < 0 && (e = 255 + e + 1), this[t] = 255 & e, t + 1
  1696. }, t.prototype.writeInt16LE = function (e, t, r) {
  1697. return e = +e, t >>>= 0, r || A(this, e, t, 2, 32767, -32768), this[t] = 255 & e, this[t + 1] = e >>> 8, t + 2
  1698. }, t.prototype.writeInt16BE = function (e, t, r) {
  1699. return e = +e, t >>>= 0, r || A(this, e, t, 2, 32767, -32768), this[t] = e >>> 8, this[t + 1] = 255 & e, t + 2
  1700. }, t.prototype.writeInt32LE = function (e, t, r) {
  1701. return e = +e, t >>>= 0, r || A(this, e, t, 4, 2147483647, -2147483648), this[t] = 255 & e, this[t + 1] = e >>> 8, this[t + 2] = e >>> 16, this[t + 3] = e >>> 24, t + 4
  1702. }, t.prototype.writeInt32BE = function (e, t, r) {
  1703. return e = +e, t >>>= 0, r || A(this, e, t, 4, 2147483647, -2147483648), e < 0 && (e = 4294967295 + e + 1), this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = 255 & e, t + 4
  1704. }, t.prototype.writeFloatLE = function (e, t, r) {
  1705. return P(this, e, t, !0, r)
  1706. }, t.prototype.writeFloatBE = function (e, t, r) {
  1707. return P(this, e, t, !1, r)
  1708. }, t.prototype.writeDoubleLE = function (e, t, r) {
  1709. return M(this, e, t, !0, r)
  1710. }, t.prototype.writeDoubleBE = function (e, t, r) {
  1711. return M(this, e, t, !1, r)
  1712. }, t.prototype.copy = function (e, r, n, i) {
  1713. if (!t.isBuffer(e)) throw new TypeError("argument should be a Buffer");
  1714. if (n || (n = 0), i || 0 === i || (i = this.length), r >= e.length && (r = e.length), r || (r = 0), i > 0 && i < n && (i = n), i === n) return 0;
  1715. if (0 === e.length || 0 === this.length) return 0;
  1716. if (r < 0) throw new RangeError("targetStart out of bounds");
  1717. if (n < 0 || n >= this.length) throw new RangeError("Index out of range");
  1718. if (i < 0) throw new RangeError("sourceEnd out of bounds");
  1719. i > this.length && (i = this.length), e.length - r < i - n && (i = e.length - r + n);
  1720. var o = i - n;
  1721. if (this === e && "function" == typeof Uint8Array.prototype.copyWithin) this.copyWithin(r, n, i);
  1722. else if (this === e && n < r && r < i)
  1723. for (var s = o - 1; s >= 0; --s) e[s + r] = this[s + n];
  1724. else Uint8Array.prototype.set.call(e, this.subarray(n, i), r);
  1725. return o
  1726. }, t.prototype.fill = function (e, r, n, i) {
  1727. if ("string" == typeof e) {
  1728. if ("string" == typeof r ? (i = r, r = 0, n = this.length) : "string" == typeof n && (i = n, n = this.length), void 0 !== i && "string" != typeof i) throw new TypeError("encoding must be a string");
  1729. if ("string" == typeof i && !t.isEncoding(i)) throw new TypeError("Unknown encoding: " + i);
  1730. if (1 === e.length) {
  1731. var o = e.charCodeAt(0);
  1732. ("utf8" === i && o < 128 || "latin1" === i) && (e = o)
  1733. }
  1734. } else "number" == typeof e && (e &= 255);
  1735. if (r < 0 || this.length < r || this.length < n) throw new RangeError("Out of range index");
  1736. if (n <= r) return this;
  1737. var s;
  1738. if (r >>>= 0, n = void 0 === n ? this.length : n >>> 0, e || (e = 0), "number" == typeof e)
  1739. for (s = r; s < n; ++s) this[s] = e;
  1740. else {
  1741. var a = t.isBuffer(e) ? e : t.from(e, i),
  1742. c = a.length;
  1743. if (0 === c) throw new TypeError('The value "' + e + '" is invalid for argument "value"');
  1744. for (s = 0; s < n - r; ++s) this[s + r] = a[s % c]
  1745. }
  1746. return this
  1747. };
  1748. var B = /[^+/0-9A-Za-z-_]/g;
  1749. function R(e) {
  1750. return e < 16 ? "0" + e.toString(16) : e.toString(16)
  1751. }
  1752. function N(e, t) {
  1753. var r;
  1754. t = t || 1 / 0;
  1755. for (var n = e.length, i = null, o = [], s = 0; s < n; ++s) {
  1756. if ((r = e.charCodeAt(s)) > 55295 && r < 57344) {
  1757. if (!i) {
  1758. if (r > 56319) {
  1759. (t -= 3) > -1 && o.push(239, 191, 189);
  1760. continue
  1761. }
  1762. if (s + 1 === n) {
  1763. (t -= 3) > -1 && o.push(239, 191, 189);
  1764. continue
  1765. }
  1766. i = r;
  1767. continue
  1768. }
  1769. if (r < 56320) {
  1770. (t -= 3) > -1 && o.push(239, 191, 189), i = r;
  1771. continue
  1772. }
  1773. r = 65536 + (i - 55296 << 10 | r - 56320)
  1774. } else i && (t -= 3) > -1 && o.push(239, 191, 189);
  1775. if (i = null, r < 128) {
  1776. if ((t -= 1) < 0) break;
  1777. o.push(r)
  1778. } else if (r < 2048) {
  1779. if ((t -= 2) < 0) break;
  1780. o.push(r >> 6 | 192, 63 & r | 128)
  1781. } else if (r < 65536) {
  1782. if ((t -= 3) < 0) break;
  1783. o.push(r >> 12 | 224, r >> 6 & 63 | 128, 63 & r | 128)
  1784. } else {
  1785. if (!(r < 1114112)) throw new Error("Invalid code point");
  1786. if ((t -= 4) < 0) break;
  1787. o.push(r >> 18 | 240, r >> 12 & 63 | 128, r >> 6 & 63 | 128, 63 & r | 128)
  1788. }
  1789. }
  1790. return o
  1791. }
  1792. function U(e) {
  1793. return n.toByteArray(function (e) {
  1794. if ((e = (e = e.split("=")[0]).trim().replace(B, "")).length < 2) return "";
  1795. for (; e.length % 4 != 0;) e += "=";
  1796. return e
  1797. }(e))
  1798. }
  1799. function L(e, t, r, n) {
  1800. for (var i = 0; i < n && !(i + r >= t.length || i >= e.length); ++i) t[i + r] = e[i];
  1801. return i
  1802. }
  1803. function q(e, t) {
  1804. return e instanceof t || null != e && null != e.constructor && null != e.constructor.name && e.constructor.name === t.name
  1805. }
  1806. function F(e) {
  1807. return e != e
  1808. }
  1809. }).call(this, e("buffer").Buffer)
  1810. }, {
  1811. "base64-js": 10,
  1812. buffer: 13,
  1813. ieee754: 87
  1814. }],
  1815. 14: [function (e, t, r) {
  1816. (function (e) {
  1817. function t(e) {
  1818. return Object.prototype.toString.call(e)
  1819. }
  1820. r.isArray = function (e) {
  1821. return Array.isArray ? Array.isArray(e) : "[object Array]" === t(e)
  1822. }, r.isBoolean = function (e) {
  1823. return "boolean" == typeof e
  1824. }, r.isNull = function (e) {
  1825. return null === e
  1826. }, r.isNullOrUndefined = function (e) {
  1827. return null == e
  1828. }, r.isNumber = function (e) {
  1829. return "number" == typeof e
  1830. }, r.isString = function (e) {
  1831. return "string" == typeof e
  1832. }, r.isSymbol = function (e) {
  1833. return "symbol" == typeof e
  1834. }, r.isUndefined = function (e) {
  1835. return void 0 === e
  1836. }, r.isRegExp = function (e) {
  1837. return "[object RegExp]" === t(e)
  1838. }, r.isObject = function (e) {
  1839. return "object" == typeof e && null !== e
  1840. }, r.isDate = function (e) {
  1841. return "[object Date]" === t(e)
  1842. }, r.isError = function (e) {
  1843. return "[object Error]" === t(e) || e instanceof Error
  1844. }, r.isFunction = function (e) {
  1845. return "function" == typeof e
  1846. }, r.isPrimitive = function (e) {
  1847. return null === e || "boolean" == typeof e || "number" == typeof e || "string" == typeof e || "symbol" == typeof e || void 0 === e
  1848. }, r.isBuffer = e.isBuffer
  1849. }).call(this, {
  1850. isBuffer: e("../../is-buffer/index.js")
  1851. })
  1852. }, {
  1853. "../../is-buffer/index.js": 89
  1854. }],
  1855. 15: [function (e, t, r) {
  1856. "use strict";
  1857. var n, i = e("type/value/is"),
  1858. o = e("type/value/ensure"),
  1859. s = e("type/plain-function/ensure"),
  1860. a = e("es5-ext/object/copy"),
  1861. c = e("es5-ext/object/normalize-options"),
  1862. u = e("es5-ext/object/map"),
  1863. l = Function.prototype.bind,
  1864. f = Object.defineProperty,
  1865. p = Object.prototype.hasOwnProperty;
  1866. n = function (e, t, r) {
  1867. var n, i = o(t) && s(t.value);
  1868. return delete(n = a(t)).writable, delete n.value, n.get = function () {
  1869. return !r.overwriteDefinition && p.call(this, e) ? i : (t.value = l.call(i, r.resolveContext ? r.resolveContext(this) : this), f(this, e, t), this[e])
  1870. }, n
  1871. }, t.exports = function (e) {
  1872. var t = c(arguments[1]);
  1873. return i(t.resolveContext) && s(t.resolveContext), u(e, function (e, r) {
  1874. return n(r, e, t)
  1875. })
  1876. }
  1877. }, {
  1878. "es5-ext/object/copy": 41,
  1879. "es5-ext/object/map": 49,
  1880. "es5-ext/object/normalize-options": 50,
  1881. "type/plain-function/ensure": 126,
  1882. "type/value/ensure": 130,
  1883. "type/value/is": 131
  1884. }],
  1885. 16: [function (e, t, r) {
  1886. "use strict";
  1887. var n = e("type/value/is"),
  1888. i = e("type/plain-function/is"),
  1889. o = e("es5-ext/object/assign"),
  1890. s = e("es5-ext/object/normalize-options"),
  1891. a = e("es5-ext/string/#/contains");
  1892. (t.exports = function (e, t) {
  1893. var r, i, c, u, l;
  1894. return arguments.length < 2 || "string" != typeof e ? (u = t, t = e, e = null) : u = arguments[2], n(e) ? (r = a.call(e, "c"), i = a.call(e, "e"), c = a.call(e, "w")) : (r = c = !0, i = !1), l = {
  1895. value: t,
  1896. configurable: r,
  1897. enumerable: i,
  1898. writable: c
  1899. }, u ? o(s(u), l) : l
  1900. }).gs = function (e, t, r) {
  1901. var c, u, l, f;
  1902. return "string" != typeof e ? (l = r, r = t, t = e, e = null) : l = arguments[3], n(t) ? i(t) ? n(r) ? i(r) || (l = r, r = void 0) : r = void 0 : (l = t, t = r = void 0) : t = void 0, n(e) ? (c = a.call(e, "c"), u = a.call(e, "e")) : (c = !0, u = !1), f = {
  1903. get: t,
  1904. set: r,
  1905. configurable: c,
  1906. enumerable: u
  1907. }, l ? o(s(l), f) : f
  1908. }
  1909. }, {
  1910. "es5-ext/object/assign": 38,
  1911. "es5-ext/object/normalize-options": 50,
  1912. "es5-ext/string/#/contains": 57,
  1913. "type/plain-function/is": 127,
  1914. "type/value/is": 131
  1915. }],
  1916. 17: [function (e, t, r) {
  1917. (function (n) {
  1918. r.log = function (...e) {
  1919. return "object" == typeof console && console.log && console.log(...e)
  1920. }, r.formatArgs = function (e) {
  1921. if (e[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + e[0] + (this.useColors ? "%c " : " ") + "+" + t.exports.humanize(this.diff), !this.useColors) return;
  1922. const r = "color: " + this.color;
  1923. e.splice(1, 0, r, "color: inherit");
  1924. let n = 0,
  1925. i = 0;
  1926. e[0].replace(/%[a-zA-Z%]/g, e => {
  1927. "%%" !== e && "%c" === e && (i = ++n)
  1928. }), e.splice(i, 0, r)
  1929. }, r.save = function (e) {
  1930. try {
  1931. e ? r.storage.setItem("debug", e) : r.storage.removeItem("debug")
  1932. } catch (e) {}
  1933. }, r.load = function () {
  1934. let e;
  1935. try {
  1936. e = r.storage.getItem("debug")
  1937. } catch (e) {}!e && void 0 !== n && "env" in n && (e = n.env.DEBUG);
  1938. return e
  1939. }, r.useColors = function () {
  1940. if ("undefined" != typeof window && window.process && ("renderer" === window.process.type || window.process.__nwjs)) return !0;
  1941. if ("undefined" != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) return !1;
  1942. return "undefined" != typeof document && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || "undefined" != typeof window && window.console && (window.console.firebug || window.console.exception && window.console.table) || "undefined" != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || "undefined" != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)
  1943. }, r.storage = function () {
  1944. try {
  1945. return localStorage
  1946. } catch (e) {}
  1947. }(), r.colors = ["#0000CC", "#0000FF", "#0033CC", "#0033FF", "#0066CC", "#0066FF", "#0099CC", "#0099FF", "#00CC00", "#00CC33", "#00CC66", "#00CC99", "#00CCCC", "#00CCFF", "#3300CC", "#3300FF", "#3333CC", "#3333FF", "#3366CC", "#3366FF", "#3399CC", "#3399FF", "#33CC00", "#33CC33", "#33CC66", "#33CC99", "#33CCCC", "#33CCFF", "#6600CC", "#6600FF", "#6633CC", "#6633FF", "#66CC00", "#66CC33", "#9900CC", "#9900FF", "#9933CC", "#9933FF", "#99CC00", "#99CC33", "#CC0000", "#CC0033", "#CC0066", "#CC0099", "#CC00CC", "#CC00FF", "#CC3300", "#CC3333", "#CC3366", "#CC3399", "#CC33CC", "#CC33FF", "#CC6600", "#CC6633", "#CC9900", "#CC9933", "#CCCC00", "#CCCC33", "#FF0000", "#FF0033", "#FF0066", "#FF0099", "#FF00CC", "#FF00FF", "#FF3300", "#FF3333", "#FF3366", "#FF3399", "#FF33CC", "#FF33FF", "#FF6600", "#FF6633", "#FF9900", "#FF9933", "#FFCC00", "#FFCC33"], t.exports = e("./common")(r);
  1948. const {
  1949. formatters: i
  1950. } = t.exports;
  1951. i.j = function (e) {
  1952. try {
  1953. return JSON.stringify(e)
  1954. } catch (e) {
  1955. return "[UnexpectedJSONParseError]: " + e.message
  1956. }
  1957. }
  1958. }).call(this, e("_process"))
  1959. }, {
  1960. "./common": 18,
  1961. _process: 101
  1962. }],
  1963. 18: [function (e, t, r) {
  1964. t.exports = function (t) {
  1965. function r(e) {
  1966. let t = 0;
  1967. for (let r = 0; r < e.length; r++) t = (t << 5) - t + e.charCodeAt(r), t |= 0;
  1968. return n.colors[Math.abs(t) % n.colors.length]
  1969. }
  1970. function n(e) {
  1971. let t;
  1972. function s(...e) {
  1973. if (!s.enabled) return;
  1974. const r = s,
  1975. i = Number(new Date),
  1976. o = i - (t || i);
  1977. r.diff = o, r.prev = t, r.curr = i, t = i, e[0] = n.coerce(e[0]), "string" != typeof e[0] && e.unshift("%O");
  1978. let a = 0;
  1979. e[0] = e[0].replace(/%([a-zA-Z%])/g, (t, i) => {
  1980. if ("%%" === t) return t;
  1981. a++;
  1982. const o = n.formatters[i];
  1983. if ("function" == typeof o) {
  1984. const n = e[a];
  1985. t = o.call(r, n), e.splice(a, 1), a--
  1986. }
  1987. return t
  1988. }), n.formatArgs.call(r, e), (r.log || n.log).apply(r, e)
  1989. }
  1990. return s.namespace = e, s.enabled = n.enabled(e), s.useColors = n.useColors(), s.color = r(e), s.destroy = i, s.extend = o, "function" == typeof n.init && n.init(s), n.instances.push(s), s
  1991. }
  1992. function i() {
  1993. const e = n.instances.indexOf(this);
  1994. return -1 !== e && (n.instances.splice(e, 1), !0)
  1995. }
  1996. function o(e, t) {
  1997. const r = n(this.namespace + (void 0 === t ? ":" : t) + e);
  1998. return r.log = this.log, r
  1999. }
  2000. function s(e) {
  2001. return e.toString().substring(2, e.toString().length - 2).replace(/\.\*\?$/, "*")
  2002. }
  2003. return n.debug = n, n.default = n, n.coerce = function (e) {
  2004. return e instanceof Error ? e.stack || e.message : e
  2005. }, n.disable = function () {
  2006. const e = [...n.names.map(s), ...n.skips.map(s).map(e => "-" + e)].join(",");
  2007. return n.enable(""), e
  2008. }, n.enable = function (e) {
  2009. let t;
  2010. n.save(e), n.names = [], n.skips = [];
  2011. const r = ("string" == typeof e ? e : "").split(/[\s,]+/),
  2012. i = r.length;
  2013. for (t = 0; t < i; t++) r[t] && ("-" === (e = r[t].replace(/\*/g, ".*?"))[0] ? n.skips.push(new RegExp("^" + e.substr(1) + "$")) : n.names.push(new RegExp("^" + e + "$")));
  2014. for (t = 0; t < n.instances.length; t++) {
  2015. const e = n.instances[t];
  2016. e.enabled = n.enabled(e.namespace)
  2017. }
  2018. }, n.enabled = function (e) {
  2019. if ("*" === e[e.length - 1]) return !0;
  2020. let t, r;
  2021. for (t = 0, r = n.skips.length; t < r; t++)
  2022. if (n.skips[t].test(e)) return !1;
  2023. for (t = 0, r = n.names.length; t < r; t++)
  2024. if (n.names[t].test(e)) return !0;
  2025. return !1
  2026. }, n.humanize = e("ms"), Object.keys(t).forEach(e => {
  2027. n[e] = t[e]
  2028. }), n.instances = [], n.names = [], n.skips = [], n.formatters = {}, n.selectColor = r, n.enable(n.load()), n
  2029. }
  2030. }, {
  2031. ms: 98
  2032. }],
  2033. 19: [function (e, t, r) {
  2034. (function (r, n) {
  2035. var i = e("readable-stream"),
  2036. o = e("end-of-stream"),
  2037. s = e("inherits"),
  2038. a = e("stream-shift"),
  2039. c = n.from && n.from !== Uint8Array.from ? n.from([0]) : new n([0]),
  2040. u = function (e, t) {
  2041. e._corked ? e.once("uncork", t) : t()
  2042. },
  2043. l = function (e, t) {
  2044. return function (r) {
  2045. r ? function (e, t) {
  2046. e._autoDestroy && e.destroy(t)
  2047. }(e, "premature close" === r.message ? null : r) : t && !e._ended && e.end()
  2048. }
  2049. },
  2050. f = function (e, t, r) {
  2051. if (!(this instanceof f)) return new f(e, t, r);
  2052. i.Duplex.call(this, r), this._writable = null, this._readable = null, this._readable2 = null, this._autoDestroy = !r || !1 !== r.autoDestroy, this._forwardDestroy = !r || !1 !== r.destroy, this._forwardEnd = !r || !1 !== r.end, this._corked = 1, this._ondrain = null, this._drained = !1, this._forwarding = !1, this._unwrite = null, this._unread = null, this._ended = !1, this.destroyed = !1, e && this.setWritable(e), t && this.setReadable(t)
  2053. };
  2054. s(f, i.Duplex), f.obj = function (e, t, r) {
  2055. return r || (r = {}), r.objectMode = !0, r.highWaterMark = 16, new f(e, t, r)
  2056. }, f.prototype.cork = function () {
  2057. 1 == ++this._corked && this.emit("cork")
  2058. }, f.prototype.uncork = function () {
  2059. this._corked && 0 == --this._corked && this.emit("uncork")
  2060. }, f.prototype.setWritable = function (e) {
  2061. if (this._unwrite && this._unwrite(), this.destroyed) e && e.destroy && e.destroy();
  2062. else if (null !== e && !1 !== e) {
  2063. var t = this,
  2064. n = o(e, {
  2065. writable: !0,
  2066. readable: !1
  2067. }, l(this, this._forwardEnd)),
  2068. i = function () {
  2069. var e = t._ondrain;
  2070. t._ondrain = null, e && e()
  2071. };
  2072. this._unwrite && r.nextTick(i), this._writable = e, this._writable.on("drain", i), this._unwrite = function () {
  2073. t._writable.removeListener("drain", i), n()
  2074. }, this.uncork()
  2075. } else this.end()
  2076. }, f.prototype.setReadable = function (e) {
  2077. if (this._unread && this._unread(), this.destroyed) e && e.destroy && e.destroy();
  2078. else {
  2079. if (null === e || !1 === e) return this.push(null), void this.resume();
  2080. var t, r = this,
  2081. n = o(e, {
  2082. writable: !1,
  2083. readable: !0
  2084. }, l(this)),
  2085. s = function () {
  2086. r._forward()
  2087. },
  2088. a = function () {
  2089. r.push(null)
  2090. };
  2091. this._drained = !0, this._readable = e, this._readable2 = e._readableState ? e : (t = e, new i.Readable({
  2092. objectMode: !0,
  2093. highWaterMark: 16
  2094. }).wrap(t)), this._readable2.on("readable", s), this._readable2.on("end", a), this._unread = function () {
  2095. r._readable2.removeListener("readable", s), r._readable2.removeListener("end", a), n()
  2096. }, this._forward()
  2097. }
  2098. }, f.prototype._read = function () {
  2099. this._drained = !0, this._forward()
  2100. }, f.prototype._forward = function () {
  2101. if (!this._forwarding && this._readable2 && this._drained) {
  2102. var e;
  2103. for (this._forwarding = !0; this._drained && null !== (e = a(this._readable2));) this.destroyed || (this._drained = this.push(e));
  2104. this._forwarding = !1
  2105. }
  2106. }, f.prototype.destroy = function (e) {
  2107. if (!this.destroyed) {
  2108. this.destroyed = !0;
  2109. var t = this;
  2110. r.nextTick(function () {
  2111. t._destroy(e)
  2112. })
  2113. }
  2114. }, f.prototype._destroy = function (e) {
  2115. if (e) {
  2116. var t = this._ondrain;
  2117. this._ondrain = null, t ? t(e) : this.emit("error", e)
  2118. }
  2119. this._forwardDestroy && (this._readable && this._readable.destroy && this._readable.destroy(), this._writable && this._writable.destroy && this._writable.destroy()), this.emit("close")
  2120. }, f.prototype._write = function (e, t, r) {
  2121. return this.destroyed ? r() : this._corked ? u(this, this._write.bind(this, e, t, r)) : e === c ? this._finish(r) : this._writable ? void(!1 === this._writable.write(e) ? this._ondrain = r : r()) : r()
  2122. }, f.prototype._finish = function (e) {
  2123. var t = this;
  2124. this.emit("preend"), u(this, function () {
  2125. var r, n;
  2126. r = t._forwardEnd && t._writable, n = function () {
  2127. !1 === t._writableState.prefinished && (t._writableState.prefinished = !0), t.emit("prefinish"), u(t, e)
  2128. }, r ? r._writableState && r._writableState.finished ? n() : r._writableState ? r.end(n) : (r.end(), n()) : n()
  2129. })
  2130. }, f.prototype.end = function (e, t, r) {
  2131. return "function" == typeof e ? this.end(null, null, e) : "function" == typeof t ? this.end(e, null, t) : (this._ended = !0, e && this.write(e), this._writableState.ending || this.write(c), i.Writable.prototype.end.call(this, r))
  2132. }, t.exports = f
  2133. }).call(this, e("_process"), e("buffer").Buffer)
  2134. }, {
  2135. _process: 101,
  2136. buffer: 13,
  2137. "end-of-stream": 20,
  2138. inherits: 88,
  2139. "readable-stream": 115,
  2140. "stream-shift": 118
  2141. }],
  2142. 20: [function (e, t, r) {
  2143. (function (r) {
  2144. var n = e("once"),
  2145. i = function () {},
  2146. o = function (e, t, s) {
  2147. if ("function" == typeof t) return o(e, null, t);
  2148. t || (t = {}), s = n(s || i);
  2149. var a = e._writableState,
  2150. c = e._readableState,
  2151. u = t.readable || !1 !== t.readable && e.readable,
  2152. l = t.writable || !1 !== t.writable && e.writable,
  2153. f = !1,
  2154. p = function () {
  2155. e.writable || h()
  2156. },
  2157. h = function () {
  2158. l = !1, u || s.call(e)
  2159. },
  2160. d = function () {
  2161. u = !1, l || s.call(e)
  2162. },
  2163. g = function (t) {
  2164. s.call(e, t ? new Error("exited with error code: " + t) : null)
  2165. },
  2166. b = function (t) {
  2167. s.call(e, t)
  2168. },
  2169. m = function () {
  2170. r.nextTick(y)
  2171. },
  2172. y = function () {
  2173. if (!f) return (!u || c && c.ended && !c.destroyed) && (!l || a && a.ended && !a.destroyed) ? void 0 : s.call(e, new Error("premature close"))
  2174. },
  2175. _ = function () {
  2176. e.req.on("finish", h)
  2177. };
  2178. return ! function (e) {
  2179. return e.setHeader && "function" == typeof e.abort
  2180. }(e) ? l && !a && (e.on("end", p), e.on("close", p)) : (e.on("complete", h), e.on("abort", m), e.req ? _() : e.on("request", _)),
  2181. function (e) {
  2182. return e.stdio && Array.isArray(e.stdio) && 3 === e.stdio.length
  2183. }(e) && e.on("exit", g), e.on("end", d), e.on("finish", h), !1 !== t.error && e.on("error", b), e.on("close", m),
  2184. function () {
  2185. f = !0, e.removeListener("complete", h), e.removeListener("abort", m), e.removeListener("request", _), e.req && e.req.removeListener("finish", h), e.removeListener("end", p), e.removeListener("close", p), e.removeListener("finish", h), e.removeListener("exit", g), e.removeListener("end", d), e.removeListener("error", b), e.removeListener("close", m)
  2186. }
  2187. };
  2188. t.exports = o
  2189. }).call(this, e("_process"))
  2190. }, {
  2191. _process: 101,
  2192. once: 99
  2193. }],
  2194. 21: [function (e, t, r) {
  2195. "use strict";
  2196. var n = e("../../object/valid-value");
  2197. t.exports = function () {
  2198. return n(this).length = 0, this
  2199. }
  2200. }, {
  2201. "../../object/valid-value": 56
  2202. }],
  2203. 22: [function (e, t, r) {
  2204. "use strict";
  2205. var n = e("../../number/is-nan"),
  2206. i = e("../../number/to-pos-integer"),
  2207. o = e("../../object/valid-value"),
  2208. s = Array.prototype.indexOf,
  2209. a = Object.prototype.hasOwnProperty,
  2210. c = Math.abs,
  2211. u = Math.floor;
  2212. t.exports = function (e) {
  2213. var t, r, l, f;
  2214. if (!n(e)) return s.apply(this, arguments);
  2215. for (r = i(o(this).length), l = arguments[1], t = l = isNaN(l) ? 0 : l >= 0 ? u(l) : i(this.length) - u(c(l)); t < r; ++t)
  2216. if (a.call(this, t) && (f = this[t], n(f))) return t;
  2217. return -1
  2218. }
  2219. }, {
  2220. "../../number/is-nan": 32,
  2221. "../../number/to-pos-integer": 36,
  2222. "../../object/valid-value": 56
  2223. }],
  2224. 23: [function (e, t, r) {
  2225. "use strict";
  2226. t.exports = e("./is-implemented")() ? Array.from : e("./shim")
  2227. }, {
  2228. "./is-implemented": 24,
  2229. "./shim": 25
  2230. }],
  2231. 24: [function (e, t, r) {
  2232. "use strict";
  2233. t.exports = function () {
  2234. var e, t, r = Array.from;
  2235. return "function" == typeof r && (t = r(e = ["raz", "dwa"]), Boolean(t && t !== e && "dwa" === t[1]))
  2236. }
  2237. }, {}],
  2238. 25: [function (e, t, r) {
  2239. "use strict";
  2240. var n = e("es6-symbol").iterator,
  2241. i = e("../../function/is-arguments"),
  2242. o = e("../../function/is-function"),
  2243. s = e("../../number/to-pos-integer"),
  2244. a = e("../../object/valid-callable"),
  2245. c = e("../../object/valid-value"),
  2246. u = e("../../object/is-value"),
  2247. l = e("../../string/is-string"),
  2248. f = Array.isArray,
  2249. p = Function.prototype.call,
  2250. h = {
  2251. configurable: !0,
  2252. enumerable: !0,
  2253. writable: !0,
  2254. value: null
  2255. },
  2256. d = Object.defineProperty;
  2257. t.exports = function (e) {
  2258. var t, r, g, b, m, y, _, v, w, S, k = arguments[1],
  2259. x = arguments[2];
  2260. if (e = Object(c(e)), u(k) && a(k), this && this !== Array && o(this)) t = this;
  2261. else {
  2262. if (!k) {
  2263. if (i(e)) return 1 !== (m = e.length) ? Array.apply(null, e) : ((b = new Array(1))[0] = e[0], b);
  2264. if (f(e)) {
  2265. for (b = new Array(m = e.length), r = 0; r < m; ++r) b[r] = e[r];
  2266. return b
  2267. }
  2268. }
  2269. b = []
  2270. }
  2271. if (!f(e))
  2272. if (void 0 !== (w = e[n])) {
  2273. for (_ = a(w).call(e), t && (b = new t), v = _.next(), r = 0; !v.done;) S = k ? p.call(k, x, v.value, r) : v.value, t ? (h.value = S, d(b, r, h)) : b[r] = S, v = _.next(), ++r;
  2274. m = r
  2275. } else if (l(e)) {
  2276. for (m = e.length, t && (b = new t), r = 0, g = 0; r < m; ++r) S = e[r], r + 1 < m && (y = S.charCodeAt(0)) >= 55296 && y <= 56319 && (S += e[++r]), S = k ? p.call(k, x, S, g) : S, t ? (h.value = S, d(b, g, h)) : b[g] = S, ++g;
  2277. m = g
  2278. }
  2279. if (void 0 === m)
  2280. for (m = s(e.length), t && (b = new t(m)), r = 0; r < m; ++r) S = k ? p.call(k, x, e[r], r) : e[r], t ? (h.value = S, d(b, r, h)) : b[r] = S;
  2281. return t && (h.value = null, b.length = m), b
  2282. }
  2283. }, {
  2284. "../../function/is-arguments": 26,
  2285. "../../function/is-function": 27,
  2286. "../../number/to-pos-integer": 36,
  2287. "../../object/is-value": 45,
  2288. "../../object/valid-callable": 55,
  2289. "../../object/valid-value": 56,
  2290. "../../string/is-string": 60,
  2291. "es6-symbol": 74
  2292. }],
  2293. 26: [function (e, t, r) {
  2294. "use strict";
  2295. var n = Object.prototype.toString,
  2296. i = n.call(function () {
  2297. return arguments
  2298. }());
  2299. t.exports = function (e) {
  2300. return n.call(e) === i
  2301. }
  2302. }, {}],
  2303. 27: [function (e, t, r) {
  2304. "use strict";
  2305. var n = Object.prototype.toString,
  2306. i = RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);
  2307. t.exports = function (e) {
  2308. return "function" == typeof e && i(n.call(e))
  2309. }
  2310. }, {}],
  2311. 28: [function (e, t, r) {
  2312. "use strict";
  2313. t.exports = function () {}
  2314. }, {}],
  2315. 29: [function (e, t, r) {
  2316. "use strict";
  2317. t.exports = e("./is-implemented")() ? Math.sign : e("./shim")
  2318. }, {
  2319. "./is-implemented": 30,
  2320. "./shim": 31
  2321. }],
  2322. 30: [function (e, t, r) {
  2323. "use strict";
  2324. t.exports = function () {
  2325. var e = Math.sign;
  2326. return "function" == typeof e && (1 === e(10) && -1 === e(-20))
  2327. }
  2328. }, {}],
  2329. 31: [function (e, t, r) {
  2330. "use strict";
  2331. t.exports = function (e) {
  2332. return e = Number(e), isNaN(e) || 0 === e ? e : e > 0 ? 1 : -1
  2333. }
  2334. }, {}],
  2335. 32: [function (e, t, r) {
  2336. "use strict";
  2337. t.exports = e("./is-implemented")() ? Number.isNaN : e("./shim")
  2338. }, {
  2339. "./is-implemented": 33,
  2340. "./shim": 34
  2341. }],
  2342. 33: [function (e, t, r) {
  2343. "use strict";
  2344. t.exports = function () {
  2345. var e = Number.isNaN;
  2346. return "function" == typeof e && (!e({}) && e(NaN) && !e(34))
  2347. }
  2348. }, {}],
  2349. 34: [function (e, t, r) {
  2350. "use strict";
  2351. t.exports = function (e) {
  2352. return e != e
  2353. }
  2354. }, {}],
  2355. 35: [function (e, t, r) {
  2356. "use strict";
  2357. var n = e("../math/sign"),
  2358. i = Math.abs,
  2359. o = Math.floor;
  2360. t.exports = function (e) {
  2361. return isNaN(e) ? 0 : 0 !== (e = Number(e)) && isFinite(e) ? n(e) * o(i(e)) : e
  2362. }
  2363. }, {
  2364. "../math/sign": 29
  2365. }],
  2366. 36: [function (e, t, r) {
  2367. "use strict";
  2368. var n = e("./to-integer"),
  2369. i = Math.max;
  2370. t.exports = function (e) {
  2371. return i(0, n(e))
  2372. }
  2373. }, {
  2374. "./to-integer": 35
  2375. }],
  2376. 37: [function (e, t, r) {
  2377. "use strict";
  2378. var n = e("./valid-callable"),
  2379. i = e("./valid-value"),
  2380. o = Function.prototype.bind,
  2381. s = Function.prototype.call,
  2382. a = Object.keys,
  2383. c = Object.prototype.propertyIsEnumerable;
  2384. t.exports = function (e, t) {
  2385. return function (r, u) {
  2386. var l, f = arguments[2],
  2387. p = arguments[3];
  2388. return r = Object(i(r)), n(u), l = a(r), p && l.sort("function" == typeof p ? o.call(p, r) : void 0), "function" != typeof e && (e = l[e]), s.call(e, l, function (e, n) {
  2389. return c.call(r, e) ? s.call(u, f, r[e], e, r, n) : t
  2390. })
  2391. }
  2392. }
  2393. }, {
  2394. "./valid-callable": 55,
  2395. "./valid-value": 56
  2396. }],
  2397. 38: [function (e, t, r) {
  2398. "use strict";
  2399. t.exports = e("./is-implemented")() ? Object.assign : e("./shim")
  2400. }, {
  2401. "./is-implemented": 39,
  2402. "./shim": 40
  2403. }],
  2404. 39: [function (e, t, r) {
  2405. "use strict";
  2406. t.exports = function () {
  2407. var e, t = Object.assign;
  2408. return "function" == typeof t && (t(e = {
  2409. foo: "raz"
  2410. }, {
  2411. bar: "dwa"
  2412. }, {
  2413. trzy: "trzy"
  2414. }), e.foo + e.bar + e.trzy === "razdwatrzy")
  2415. }
  2416. }, {}],
  2417. 40: [function (e, t, r) {
  2418. "use strict";
  2419. var n = e("../keys"),
  2420. i = e("../valid-value"),
  2421. o = Math.max;
  2422. t.exports = function (e, t) {
  2423. var r, s, a, c = o(arguments.length, 2);
  2424. for (e = Object(i(e)), a = function (n) {
  2425. try {
  2426. e[n] = t[n]
  2427. } catch (e) {
  2428. r || (r = e)
  2429. }
  2430. }, s = 1; s < c; ++s) t = arguments[s], n(t).forEach(a);
  2431. if (void 0 !== r) throw r;
  2432. return e
  2433. }
  2434. }, {
  2435. "../keys": 46,
  2436. "../valid-value": 56
  2437. }],
  2438. 41: [function (e, t, r) {
  2439. "use strict";
  2440. var n = e("../array/from"),
  2441. i = e("./assign"),
  2442. o = e("./valid-value");
  2443. t.exports = function (e) {
  2444. var t = Object(o(e)),
  2445. r = arguments[1],
  2446. s = Object(arguments[2]);
  2447. if (t !== e && !r) return t;
  2448. var a = {};
  2449. return r ? n(r, function (t) {
  2450. (s.ensure || t in e) && (a[t] = e[t])
  2451. }) : i(a, e), a
  2452. }
  2453. }, {
  2454. "../array/from": 23,
  2455. "./assign": 38,
  2456. "./valid-value": 56
  2457. }],
  2458. 42: [function (e, t, r) {
  2459. "use strict";
  2460. var n, i, o, s, a = Object.create;
  2461. e("./set-prototype-of/is-implemented")() || (n = e("./set-prototype-of/shim")), t.exports = n ? 1 !== n.level ? a : (i = {}, o = {}, s = {
  2462. configurable: !1,
  2463. enumerable: !1,
  2464. writable: !0,
  2465. value: void 0
  2466. }, Object.getOwnPropertyNames(Object.prototype).forEach(function (e) {
  2467. o[e] = "__proto__" !== e ? s : {
  2468. configurable: !0,
  2469. enumerable: !1,
  2470. writable: !0,
  2471. value: void 0
  2472. }
  2473. }), Object.defineProperties(i, o), Object.defineProperty(n, "nullPolyfill", {
  2474. configurable: !1,
  2475. enumerable: !1,
  2476. writable: !1,
  2477. value: i
  2478. }), function (e, t) {
  2479. return a(null === e ? i : e, t)
  2480. }) : a
  2481. }, {
  2482. "./set-prototype-of/is-implemented": 53,
  2483. "./set-prototype-of/shim": 54
  2484. }],
  2485. 43: [function (e, t, r) {
  2486. "use strict";
  2487. t.exports = e("./_iterate")("forEach")
  2488. }, {
  2489. "./_iterate": 37
  2490. }],
  2491. 44: [function (e, t, r) {
  2492. "use strict";
  2493. var n = e("./is-value"),
  2494. i = {
  2495. function: !0,
  2496. object: !0
  2497. };
  2498. t.exports = function (e) {
  2499. return n(e) && i[typeof e] || !1
  2500. }
  2501. }, {
  2502. "./is-value": 45
  2503. }],
  2504. 45: [function (e, t, r) {
  2505. "use strict";
  2506. var n = e("../function/noop")();
  2507. t.exports = function (e) {
  2508. return e !== n && null !== e
  2509. }
  2510. }, {
  2511. "../function/noop": 28
  2512. }],
  2513. 46: [function (e, t, r) {
  2514. "use strict";
  2515. t.exports = e("./is-implemented")() ? Object.keys : e("./shim")
  2516. }, {
  2517. "./is-implemented": 47,
  2518. "./shim": 48
  2519. }],
  2520. 47: [function (e, t, r) {
  2521. "use strict";
  2522. t.exports = function () {
  2523. try {
  2524. return Object.keys("primitive"), !0
  2525. } catch (e) {
  2526. return !1
  2527. }
  2528. }
  2529. }, {}],
  2530. 48: [function (e, t, r) {
  2531. "use strict";
  2532. var n = e("../is-value"),
  2533. i = Object.keys;
  2534. t.exports = function (e) {
  2535. return i(n(e) ? Object(e) : e)
  2536. }
  2537. }, {
  2538. "../is-value": 45
  2539. }],
  2540. 49: [function (e, t, r) {
  2541. "use strict";
  2542. var n = e("./valid-callable"),
  2543. i = e("./for-each"),
  2544. o = Function.prototype.call;
  2545. t.exports = function (e, t) {
  2546. var r = {},
  2547. s = arguments[2];
  2548. return n(t), i(e, function (e, n, i, a) {
  2549. r[n] = o.call(t, s, e, n, i, a)
  2550. }), r
  2551. }
  2552. }, {
  2553. "./for-each": 43,
  2554. "./valid-callable": 55
  2555. }],
  2556. 50: [function (e, t, r) {
  2557. "use strict";
  2558. var n = e("./is-value"),
  2559. i = Array.prototype.forEach,
  2560. o = Object.create;
  2561. t.exports = function (e) {
  2562. var t = o(null);
  2563. return i.call(arguments, function (e) {
  2564. n(e) && function (e, t) {
  2565. var r;
  2566. for (r in e) t[r] = e[r]
  2567. }(Object(e), t)
  2568. }), t
  2569. }
  2570. }, {
  2571. "./is-value": 45
  2572. }],
  2573. 51: [function (e, t, r) {
  2574. "use strict";
  2575. var n = Array.prototype.forEach,
  2576. i = Object.create;
  2577. t.exports = function (e) {
  2578. var t = i(null);
  2579. return n.call(arguments, function (e) {
  2580. t[e] = !0
  2581. }), t
  2582. }
  2583. }, {}],
  2584. 52: [function (e, t, r) {
  2585. "use strict";
  2586. t.exports = e("./is-implemented")() ? Object.setPrototypeOf : e("./shim")
  2587. }, {
  2588. "./is-implemented": 53,
  2589. "./shim": 54
  2590. }],
  2591. 53: [function (e, t, r) {
  2592. "use strict";
  2593. var n = Object.create,
  2594. i = Object.getPrototypeOf,
  2595. o = {};
  2596. t.exports = function () {
  2597. var e = Object.setPrototypeOf,
  2598. t = arguments[0] || n;
  2599. return "function" == typeof e && i(e(t(null), o)) === o
  2600. }
  2601. }, {}],
  2602. 54: [function (e, t, r) {
  2603. "use strict";
  2604. var n, i, o, s, a = e("../is-object"),
  2605. c = e("../valid-value"),
  2606. u = Object.prototype.isPrototypeOf,
  2607. l = Object.defineProperty,
  2608. f = {
  2609. configurable: !0,
  2610. enumerable: !1,
  2611. writable: !0,
  2612. value: void 0
  2613. };
  2614. n = function (e, t) {
  2615. if (c(e), null === t || a(t)) return e;
  2616. throw new TypeError("Prototype must be null or an object")
  2617. }, t.exports = (i = function () {
  2618. var e, t = Object.create(null),
  2619. r = {},
  2620. n = Object.getOwnPropertyDescriptor(Object.prototype, "__proto__");
  2621. if (n) {
  2622. try {
  2623. (e = n.set).call(t, r)
  2624. } catch (e) {}
  2625. if (Object.getPrototypeOf(t) === r) return {
  2626. set: e,
  2627. level: 2
  2628. }
  2629. }
  2630. return t.__proto__ = r, Object.getPrototypeOf(t) === r ? {
  2631. level: 2
  2632. } : ((t = {}).__proto__ = r, Object.getPrototypeOf(t) === r && {
  2633. level: 1
  2634. })
  2635. }()) ? (2 === i.level ? i.set ? (s = i.set, o = function (e, t) {
  2636. return s.call(n(e, t), t), e
  2637. }) : o = function (e, t) {
  2638. return n(e, t).__proto__ = t, e
  2639. } : o = function e(t, r) {
  2640. var i;
  2641. return n(t, r), (i = u.call(e.nullPolyfill, t)) && delete e.nullPolyfill.__proto__, null === r && (r = e.nullPolyfill), t.__proto__ = r, i && l(e.nullPolyfill, "__proto__", f), t
  2642. }, Object.defineProperty(o, "level", {
  2643. configurable: !1,
  2644. enumerable: !1,
  2645. writable: !1,
  2646. value: i.level
  2647. })) : null, e("../create")
  2648. }, {
  2649. "../create": 42,
  2650. "../is-object": 44,
  2651. "../valid-value": 56
  2652. }],
  2653. 55: [function (e, t, r) {
  2654. "use strict";
  2655. t.exports = function (e) {
  2656. if ("function" != typeof e) throw new TypeError(e + " is not a function");
  2657. return e
  2658. }
  2659. }, {}],
  2660. 56: [function (e, t, r) {
  2661. "use strict";
  2662. var n = e("./is-value");
  2663. t.exports = function (e) {
  2664. if (!n(e)) throw new TypeError("Cannot use null or undefined");
  2665. return e
  2666. }
  2667. }, {
  2668. "./is-value": 45
  2669. }],
  2670. 57: [function (e, t, r) {
  2671. "use strict";
  2672. t.exports = e("./is-implemented")() ? String.prototype.contains : e("./shim")
  2673. }, {
  2674. "./is-implemented": 58,
  2675. "./shim": 59
  2676. }],
  2677. 58: [function (e, t, r) {
  2678. "use strict";
  2679. var n = "razdwatrzy";
  2680. t.exports = function () {
  2681. return "function" == typeof n.contains && (!0 === n.contains("dwa") && !1 === n.contains("foo"))
  2682. }
  2683. }, {}],
  2684. 59: [function (e, t, r) {
  2685. "use strict";
  2686. var n = String.prototype.indexOf;
  2687. t.exports = function (e) {
  2688. return n.call(this, e, arguments[1]) > -1
  2689. }
  2690. }, {}],
  2691. 60: [function (e, t, r) {
  2692. "use strict";
  2693. var n = Object.prototype.toString,
  2694. i = n.call("");
  2695. t.exports = function (e) {
  2696. return "string" == typeof e || e && "object" == typeof e && (e instanceof String || n.call(e) === i) || !1
  2697. }
  2698. }, {}],
  2699. 61: [function (e, t, r) {
  2700. "use strict";
  2701. var n, i = e("es5-ext/object/set-prototype-of"),
  2702. o = e("es5-ext/string/#/contains"),
  2703. s = e("d"),
  2704. a = e("es6-symbol"),
  2705. c = e("./"),
  2706. u = Object.defineProperty;
  2707. n = t.exports = function (e, t) {
  2708. if (!(this instanceof n)) throw new TypeError("Constructor requires 'new'");
  2709. c.call(this, e), t = t ? o.call(t, "key+value") ? "key+value" : o.call(t, "key") ? "key" : "value" : "value", u(this, "__kind__", s("", t))
  2710. }, i && i(n, c), delete n.prototype.constructor, n.prototype = Object.create(c.prototype, {
  2711. _resolve: s(function (e) {
  2712. return "value" === this.__kind__ ? this.__list__[e] : "key+value" === this.__kind__ ? [e, this.__list__[e]] : e
  2713. })
  2714. }), u(n.prototype, a.toStringTag, s("c", "Array Iterator"))
  2715. }, {
  2716. "./": 64,
  2717. d: 16,
  2718. "es5-ext/object/set-prototype-of": 52,
  2719. "es5-ext/string/#/contains": 57,
  2720. "es6-symbol": 74
  2721. }],
  2722. 62: [function (e, t, r) {
  2723. "use strict";
  2724. var n = e("es5-ext/function/is-arguments"),
  2725. i = e("es5-ext/object/valid-callable"),
  2726. o = e("es5-ext/string/is-string"),
  2727. s = e("./get"),
  2728. a = Array.isArray,
  2729. c = Function.prototype.call,
  2730. u = Array.prototype.some;
  2731. t.exports = function (e, t) {
  2732. var r, l, f, p, h, d, g, b, m = arguments[2];
  2733. if (a(e) || n(e) ? r = "array" : o(e) ? r = "string" : e = s(e), i(t), f = function () {
  2734. p = !0
  2735. }, "array" !== r)
  2736. if ("string" !== r)
  2737. for (l = e.next(); !l.done;) {
  2738. if (c.call(t, m, l.value, f), p) return;
  2739. l = e.next()
  2740. } else
  2741. for (d = e.length, h = 0; h < d && (g = e[h], h + 1 < d && (b = g.charCodeAt(0)) >= 55296 && b <= 56319 && (g += e[++h]), c.call(t, m, g, f), !p); ++h);
  2742. else u.call(e, function (e) {
  2743. return c.call(t, m, e, f), p
  2744. })
  2745. }
  2746. }, {
  2747. "./get": 63,
  2748. "es5-ext/function/is-arguments": 26,
  2749. "es5-ext/object/valid-callable": 55,
  2750. "es5-ext/string/is-string": 60
  2751. }],
  2752. 63: [function (e, t, r) {
  2753. "use strict";
  2754. var n = e("es5-ext/function/is-arguments"),
  2755. i = e("es5-ext/string/is-string"),
  2756. o = e("./array"),
  2757. s = e("./string"),
  2758. a = e("./valid-iterable"),
  2759. c = e("es6-symbol").iterator;
  2760. t.exports = function (e) {
  2761. return "function" == typeof a(e)[c] ? e[c]() : n(e) ? new o(e) : i(e) ? new s(e) : new o(e)
  2762. }
  2763. }, {
  2764. "./array": 61,
  2765. "./string": 66,
  2766. "./valid-iterable": 67,
  2767. "es5-ext/function/is-arguments": 26,
  2768. "es5-ext/string/is-string": 60,
  2769. "es6-symbol": 74
  2770. }],
  2771. 64: [function (e, t, r) {
  2772. "use strict";
  2773. var n, i = e("es5-ext/array/#/clear"),
  2774. o = e("es5-ext/object/assign"),
  2775. s = e("es5-ext/object/valid-callable"),
  2776. a = e("es5-ext/object/valid-value"),
  2777. c = e("d"),
  2778. u = e("d/auto-bind"),
  2779. l = e("es6-symbol"),
  2780. f = Object.defineProperty,
  2781. p = Object.defineProperties;
  2782. t.exports = n = function (e, t) {
  2783. if (!(this instanceof n)) throw new TypeError("Constructor requires 'new'");
  2784. p(this, {
  2785. __list__: c("w", a(e)),
  2786. __context__: c("w", t),
  2787. __nextIndex__: c("w", 0)
  2788. }), t && (s(t.on), t.on("_add", this._onAdd), t.on("_delete", this._onDelete), t.on("_clear", this._onClear))
  2789. }, delete n.prototype.constructor, p(n.prototype, o({
  2790. _next: c(function () {
  2791. var e;
  2792. if (this.__list__) return this.__redo__ && void 0 !== (e = this.__redo__.shift()) ? e : this.__nextIndex__ < this.__list__.length ? this.__nextIndex__++ : void this._unBind()
  2793. }),
  2794. next: c(function () {
  2795. return this._createResult(this._next())
  2796. }),
  2797. _createResult: c(function (e) {
  2798. return void 0 === e ? {
  2799. done: !0,
  2800. value: void 0
  2801. } : {
  2802. done: !1,
  2803. value: this._resolve(e)
  2804. }
  2805. }),
  2806. _resolve: c(function (e) {
  2807. return this.__list__[e]
  2808. }),
  2809. _unBind: c(function () {
  2810. this.__list__ = null, delete this.__redo__, this.__context__ && (this.__context__.off("_add", this._onAdd), this.__context__.off("_delete", this._onDelete), this.__context__.off("_clear", this._onClear), this.__context__ = null)
  2811. }),
  2812. toString: c(function () {
  2813. return "[object " + (this[l.toStringTag] || "Object") + "]"
  2814. })
  2815. }, u({
  2816. _onAdd: c(function (e) {
  2817. e >= this.__nextIndex__ || (++this.__nextIndex__, this.__redo__ ? (this.__redo__.forEach(function (t, r) {
  2818. t >= e && (this.__redo__[r] = ++t)
  2819. }, this), this.__redo__.push(e)) : f(this, "__redo__", c("c", [e])))
  2820. }),
  2821. _onDelete: c(function (e) {
  2822. var t;
  2823. e >= this.__nextIndex__ || (--this.__nextIndex__, this.__redo__ && (-1 !== (t = this.__redo__.indexOf(e)) && this.__redo__.splice(t, 1), this.__redo__.forEach(function (t, r) {
  2824. t > e && (this.__redo__[r] = --t)
  2825. }, this)))
  2826. }),
  2827. _onClear: c(function () {
  2828. this.__redo__ && i.call(this.__redo__), this.__nextIndex__ = 0
  2829. })
  2830. }))), f(n.prototype, l.iterator, c(function () {
  2831. return this
  2832. }))
  2833. }, {
  2834. d: 16,
  2835. "d/auto-bind": 15,
  2836. "es5-ext/array/#/clear": 21,
  2837. "es5-ext/object/assign": 38,
  2838. "es5-ext/object/valid-callable": 55,
  2839. "es5-ext/object/valid-value": 56,
  2840. "es6-symbol": 74
  2841. }],
  2842. 65: [function (e, t, r) {
  2843. "use strict";
  2844. var n = e("es5-ext/function/is-arguments"),
  2845. i = e("es5-ext/object/is-value"),
  2846. o = e("es5-ext/string/is-string"),
  2847. s = e("es6-symbol").iterator,
  2848. a = Array.isArray;
  2849. t.exports = function (e) {
  2850. return !!i(e) && (!!a(e) || (!!o(e) || (!!n(e) || "function" == typeof e[s])))
  2851. }
  2852. }, {
  2853. "es5-ext/function/is-arguments": 26,
  2854. "es5-ext/object/is-value": 45,
  2855. "es5-ext/string/is-string": 60,
  2856. "es6-symbol": 74
  2857. }],
  2858. 66: [function (e, t, r) {
  2859. "use strict";
  2860. var n, i = e("es5-ext/object/set-prototype-of"),
  2861. o = e("d"),
  2862. s = e("es6-symbol"),
  2863. a = e("./"),
  2864. c = Object.defineProperty;
  2865. n = t.exports = function (e) {
  2866. if (!(this instanceof n)) throw new TypeError("Constructor requires 'new'");
  2867. e = String(e), a.call(this, e), c(this, "__length__", o("", e.length))
  2868. }, i && i(n, a), delete n.prototype.constructor, n.prototype = Object.create(a.prototype, {
  2869. _next: o(function () {
  2870. if (this.__list__) return this.__nextIndex__ < this.__length__ ? this.__nextIndex__++ : void this._unBind()
  2871. }),
  2872. _resolve: o(function (e) {
  2873. var t, r = this.__list__[e];
  2874. return this.__nextIndex__ === this.__length__ ? r : (t = r.charCodeAt(0)) >= 55296 && t <= 56319 ? r + this.__list__[this.__nextIndex__++] : r
  2875. })
  2876. }), c(n.prototype, s.toStringTag, o("c", "String Iterator"))
  2877. }, {
  2878. "./": 64,
  2879. d: 16,
  2880. "es5-ext/object/set-prototype-of": 52,
  2881. "es6-symbol": 74
  2882. }],
  2883. 67: [function (e, t, r) {
  2884. "use strict";
  2885. var n = e("./is-iterable");
  2886. t.exports = function (e) {
  2887. if (!n(e)) throw new TypeError(e + " is not iterable");
  2888. return e
  2889. }
  2890. }, {
  2891. "./is-iterable": 65
  2892. }],
  2893. 68: [function (e, t, r) {
  2894. "use strict";
  2895. t.exports = e("./is-implemented")() ? Map : e("./polyfill")
  2896. }, {
  2897. "./is-implemented": 69,
  2898. "./polyfill": 73
  2899. }],
  2900. 69: [function (e, t, r) {
  2901. "use strict";
  2902. t.exports = function () {
  2903. var e, t;
  2904. if ("function" != typeof Map) return !1;
  2905. try {
  2906. e = new Map([
  2907. ["raz", "one"],
  2908. ["dwa", "two"],
  2909. ["trzy", "three"]
  2910. ])
  2911. } catch (e) {
  2912. return !1
  2913. }
  2914. return "[object Map]" === String(e) && (3 === e.size && ("function" == typeof e.clear && ("function" == typeof e.delete && ("function" == typeof e.entries && ("function" == typeof e.forEach && ("function" == typeof e.get && ("function" == typeof e.has && ("function" == typeof e.keys && ("function" == typeof e.set && ("function" == typeof e.values && (!1 === (t = e.entries().next()).done && (!!t.value && ("raz" === t.value[0] && "one" === t.value[1])))))))))))))
  2915. }
  2916. }, {}],
  2917. 70: [function (e, t, r) {
  2918. "use strict";
  2919. t.exports = "undefined" != typeof Map && "[object Map]" === Object.prototype.toString.call(new Map)
  2920. }, {}],
  2921. 71: [function (e, t, r) {
  2922. "use strict";
  2923. t.exports = e("es5-ext/object/primitive-set")("key", "value", "key+value")
  2924. }, {
  2925. "es5-ext/object/primitive-set": 51
  2926. }],
  2927. 72: [function (e, t, r) {
  2928. "use strict";
  2929. var n, i = e("es5-ext/object/set-prototype-of"),
  2930. o = e("d"),
  2931. s = e("es6-iterator"),
  2932. a = e("es6-symbol").toStringTag,
  2933. c = e("./iterator-kinds"),
  2934. u = Object.defineProperties,
  2935. l = s.prototype._unBind;
  2936. n = t.exports = function (e, t) {
  2937. if (!(this instanceof n)) return new n(e, t);
  2938. s.call(this, e.__mapKeysData__, e), t && c[t] || (t = "key+value"), u(this, {
  2939. __kind__: o("", t),
  2940. __values__: o("w", e.__mapValuesData__)
  2941. })
  2942. }, i && i(n, s), n.prototype = Object.create(s.prototype, {
  2943. constructor: o(n),
  2944. _resolve: o(function (e) {
  2945. return "value" === this.__kind__ ? this.__values__[e] : "key" === this.__kind__ ? this.__list__[e] : [this.__list__[e], this.__values__[e]]
  2946. }),
  2947. _unBind: o(function () {
  2948. this.__values__ = null, l.call(this)
  2949. }),
  2950. toString: o(function () {
  2951. return "[object Map Iterator]"
  2952. })
  2953. }), Object.defineProperty(n.prototype, a, o("c", "Map Iterator"))
  2954. }, {
  2955. "./iterator-kinds": 71,
  2956. d: 16,
  2957. "es5-ext/object/set-prototype-of": 52,
  2958. "es6-iterator": 64,
  2959. "es6-symbol": 74
  2960. }],
  2961. 73: [function (e, t, r) {
  2962. "use strict";
  2963. var n, i = e("es5-ext/array/#/clear"),
  2964. o = e("es5-ext/array/#/e-index-of"),
  2965. s = e("es5-ext/object/set-prototype-of"),
  2966. a = e("es5-ext/object/valid-callable"),
  2967. c = e("es5-ext/object/valid-value"),
  2968. u = e("d"),
  2969. l = e("event-emitter"),
  2970. f = e("es6-symbol"),
  2971. p = e("es6-iterator/valid-iterable"),
  2972. h = e("es6-iterator/for-of"),
  2973. d = e("./lib/iterator"),
  2974. g = e("./is-native-implemented"),
  2975. b = Function.prototype.call,
  2976. m = Object.defineProperties,
  2977. y = Object.getPrototypeOf;
  2978. t.exports = n = function () {
  2979. var e, t, r, i = arguments[0];
  2980. if (!(this instanceof n)) throw new TypeError("Constructor requires 'new'");
  2981. return r = g && s && Map !== n ? s(new Map, y(this)) : this, null != i && p(i), m(r, {
  2982. __mapKeysData__: u("c", e = []),
  2983. __mapValuesData__: u("c", t = [])
  2984. }), i ? (h(i, function (r) {
  2985. var n = c(r)[0];
  2986. r = r[1], -1 === o.call(e, n) && (e.push(n), t.push(r))
  2987. }, r), r) : r
  2988. }, g && (s && s(n, Map), n.prototype = Object.create(Map.prototype, {
  2989. constructor: u(n)
  2990. })), l(m(n.prototype, {
  2991. clear: u(function () {
  2992. this.__mapKeysData__.length && (i.call(this.__mapKeysData__), i.call(this.__mapValuesData__), this.emit("_clear"))
  2993. }),
  2994. delete: u(function (e) {
  2995. var t = o.call(this.__mapKeysData__, e);
  2996. return -1 !== t && (this.__mapKeysData__.splice(t, 1), this.__mapValuesData__.splice(t, 1), this.emit("_delete", t, e), !0)
  2997. }),
  2998. entries: u(function () {
  2999. return new d(this, "key+value")
  3000. }),
  3001. forEach: u(function (e) {
  3002. var t, r, n = arguments[1];
  3003. for (a(e), r = (t = this.entries())._next(); void 0 !== r;) b.call(e, n, this.__mapValuesData__[r], this.__mapKeysData__[r], this), r = t._next()
  3004. }),
  3005. get: u(function (e) {
  3006. var t = o.call(this.__mapKeysData__, e);
  3007. if (-1 !== t) return this.__mapValuesData__[t]
  3008. }),
  3009. has: u(function (e) {
  3010. return -1 !== o.call(this.__mapKeysData__, e)
  3011. }),
  3012. keys: u(function () {
  3013. return new d(this, "key")
  3014. }),
  3015. set: u(function (e, t) {
  3016. var r, n = o.call(this.__mapKeysData__, e);
  3017. return -1 === n && (n = this.__mapKeysData__.push(e) - 1, r = !0), this.__mapValuesData__[n] = t, r && this.emit("_add", n, e), this
  3018. }),
  3019. size: u.gs(function () {
  3020. return this.__mapKeysData__.length
  3021. }),
  3022. values: u(function () {
  3023. return new d(this, "value")
  3024. }),
  3025. toString: u(function () {
  3026. return "[object Map]"
  3027. })
  3028. })), Object.defineProperty(n.prototype, f.iterator, u(function () {
  3029. return this.entries()
  3030. })), Object.defineProperty(n.prototype, f.toStringTag, u("c", "Map"))
  3031. }, {
  3032. "./is-native-implemented": 70,
  3033. "./lib/iterator": 72,
  3034. d: 16,
  3035. "es5-ext/array/#/clear": 21,
  3036. "es5-ext/array/#/e-index-of": 22,
  3037. "es5-ext/object/set-prototype-of": 52,
  3038. "es5-ext/object/valid-callable": 55,
  3039. "es5-ext/object/valid-value": 56,
  3040. "es6-iterator/for-of": 62,
  3041. "es6-iterator/valid-iterable": 67,
  3042. "es6-symbol": 74,
  3043. "event-emitter": 82
  3044. }],
  3045. 74: [function (e, t, r) {
  3046. "use strict";
  3047. t.exports = e("./is-implemented")() ? e("ext/global-this").Symbol : e("./polyfill")
  3048. }, {
  3049. "./is-implemented": 75,
  3050. "./polyfill": 80,
  3051. "ext/global-this": 85
  3052. }],
  3053. 75: [function (e, t, r) {
  3054. "use strict";
  3055. var n = e("ext/global-this"),
  3056. i = {
  3057. object: !0,
  3058. symbol: !0
  3059. };
  3060. t.exports = function () {
  3061. var e, t = n.Symbol;
  3062. if ("function" != typeof t) return !1;
  3063. e = t("test symbol");
  3064. try {
  3065. String(e)
  3066. } catch (e) {
  3067. return !1
  3068. }
  3069. return !!i[typeof t.iterator] && (!!i[typeof t.toPrimitive] && !!i[typeof t.toStringTag])
  3070. }
  3071. }, {
  3072. "ext/global-this": 85
  3073. }],
  3074. 76: [function (e, t, r) {
  3075. "use strict";
  3076. t.exports = function (e) {
  3077. return !!e && ("symbol" == typeof e || !!e.constructor && ("Symbol" === e.constructor.name && "Symbol" === e[e.constructor.toStringTag]))
  3078. }
  3079. }, {}],
  3080. 77: [function (e, t, r) {
  3081. "use strict";
  3082. var n = e("d"),
  3083. i = Object.create,
  3084. o = Object.defineProperty,
  3085. s = Object.prototype,
  3086. a = i(null);
  3087. t.exports = function (e) {
  3088. for (var t, r, i = 0; a[e + (i || "")];) ++i;
  3089. return a[e += i || ""] = !0, o(s, t = "@@" + e, n.gs(null, function (e) {
  3090. r || (r = !0, o(this, t, n(e)), r = !1)
  3091. })), t
  3092. }
  3093. }, {
  3094. d: 16
  3095. }],
  3096. 78: [function (e, t, r) {
  3097. "use strict";
  3098. var n = e("d"),
  3099. i = e("ext/global-this").Symbol;
  3100. t.exports = function (e) {
  3101. return Object.defineProperties(e, {
  3102. hasInstance: n("", i && i.hasInstance || e("hasInstance")),
  3103. isConcatSpreadable: n("", i && i.isConcatSpreadable || e("isConcatSpreadable")),
  3104. iterator: n("", i && i.iterator || e("iterator")),
  3105. match: n("", i && i.match || e("match")),
  3106. replace: n("", i && i.replace || e("replace")),
  3107. search: n("", i && i.search || e("search")),
  3108. species: n("", i && i.species || e("species")),
  3109. split: n("", i && i.split || e("split")),
  3110. toPrimitive: n("", i && i.toPrimitive || e("toPrimitive")),
  3111. toStringTag: n("", i && i.toStringTag || e("toStringTag")),
  3112. unscopables: n("", i && i.unscopables || e("unscopables"))
  3113. })
  3114. }
  3115. }, {
  3116. d: 16,
  3117. "ext/global-this": 85
  3118. }],
  3119. 79: [function (e, t, r) {
  3120. "use strict";
  3121. var n = e("d"),
  3122. i = e("../../../validate-symbol"),
  3123. o = Object.create(null);
  3124. t.exports = function (e) {
  3125. return Object.defineProperties(e, {
  3126. for: n(function (t) {
  3127. return o[t] ? o[t] : o[t] = e(String(t))
  3128. }),
  3129. keyFor: n(function (e) {
  3130. var t;
  3131. for (t in i(e), o)
  3132. if (o[t] === e) return t
  3133. })
  3134. })
  3135. }
  3136. }, {
  3137. "../../../validate-symbol": 81,
  3138. d: 16
  3139. }],
  3140. 80: [function (e, t, r) {
  3141. "use strict";
  3142. var n, i, o, s = e("d"),
  3143. a = e("./validate-symbol"),
  3144. c = e("ext/global-this").Symbol,
  3145. u = e("./lib/private/generate-name"),
  3146. l = e("./lib/private/setup/standard-symbols"),
  3147. f = e("./lib/private/setup/symbol-registry"),
  3148. p = Object.create,
  3149. h = Object.defineProperties,
  3150. d = Object.defineProperty;
  3151. if ("function" == typeof c) try {
  3152. String(c()), o = !0
  3153. } catch (e) {} else c = null;
  3154. i = function (e) {
  3155. if (this instanceof i) throw new TypeError("Symbol is not a constructor");
  3156. return n(e)
  3157. }, t.exports = n = function e(t) {
  3158. var r;
  3159. if (this instanceof e) throw new TypeError("Symbol is not a constructor");
  3160. return o ? c(t) : (r = p(i.prototype), t = void 0 === t ? "" : String(t), h(r, {
  3161. __description__: s("", t),
  3162. __name__: s("", u(t))
  3163. }))
  3164. }, l(n), f(n), h(i.prototype, {
  3165. constructor: s(n),
  3166. toString: s("", function () {
  3167. return this.__name__
  3168. })
  3169. }), h(n.prototype, {
  3170. toString: s(function () {
  3171. return "Symbol (" + a(this).__description__ + ")"
  3172. }),
  3173. valueOf: s(function () {
  3174. return a(this)
  3175. })
  3176. }), d(n.prototype, n.toPrimitive, s("", function () {
  3177. var e = a(this);
  3178. return "symbol" == typeof e ? e : e.toString()
  3179. })), d(n.prototype, n.toStringTag, s("c", "Symbol")), d(i.prototype, n.toStringTag, s("c", n.prototype[n.toStringTag])), d(i.prototype, n.toPrimitive, s("c", n.prototype[n.toPrimitive]))
  3180. }, {
  3181. "./lib/private/generate-name": 77,
  3182. "./lib/private/setup/standard-symbols": 78,
  3183. "./lib/private/setup/symbol-registry": 79,
  3184. "./validate-symbol": 81,
  3185. d: 16,
  3186. "ext/global-this": 85
  3187. }],
  3188. 81: [function (e, t, r) {
  3189. "use strict";
  3190. var n = e("./is-symbol");
  3191. t.exports = function (e) {
  3192. if (!n(e)) throw new TypeError(e + " is not a symbol");
  3193. return e
  3194. }
  3195. }, {
  3196. "./is-symbol": 76
  3197. }],
  3198. 82: [function (e, t, r) {
  3199. "use strict";
  3200. var n, i, o, s, a, c, u, l = e("d"),
  3201. f = e("es5-ext/object/valid-callable"),
  3202. p = Function.prototype.apply,
  3203. h = Function.prototype.call,
  3204. d = Object.create,
  3205. g = Object.defineProperty,
  3206. b = Object.defineProperties,
  3207. m = Object.prototype.hasOwnProperty,
  3208. y = {
  3209. configurable: !0,
  3210. enumerable: !1,
  3211. writable: !0
  3212. };
  3213. a = {
  3214. on: n = function (e, t) {
  3215. var r;
  3216. return f(t), m.call(this, "__ee__") ? r = this.__ee__ : (r = y.value = d(null), g(this, "__ee__", y), y.value = null), r[e] ? "object" == typeof r[e] ? r[e].push(t) : r[e] = [r[e], t] : r[e] = t, this
  3217. },
  3218. once: i = function (e, t) {
  3219. var r, i;
  3220. return f(t), i = this, n.call(this, e, r = function () {
  3221. o.call(i, e, r), p.call(t, this, arguments)
  3222. }), r.__eeOnceListener__ = t, this
  3223. },
  3224. off: o = function (e, t) {
  3225. var r, n, i, o;
  3226. if (f(t), !m.call(this, "__ee__")) return this;
  3227. if (!(r = this.__ee__)[e]) return this;
  3228. if ("object" == typeof (n = r[e]))
  3229. for (o = 0; i = n[o]; ++o) i !== t && i.__eeOnceListener__ !== t || (2 === n.length ? r[e] = n[o ? 0 : 1] : n.splice(o, 1));
  3230. else n !== t && n.__eeOnceListener__ !== t || delete r[e];
  3231. return this
  3232. },
  3233. emit: s = function (e) {
  3234. var t, r, n, i, o;
  3235. if (m.call(this, "__ee__") && (i = this.__ee__[e]))
  3236. if ("object" == typeof i) {
  3237. for (r = arguments.length, o = new Array(r - 1), t = 1; t < r; ++t) o[t - 1] = arguments[t];
  3238. for (i = i.slice(), t = 0; n = i[t]; ++t) p.call(n, this, o)
  3239. } else switch (arguments.length) {
  3240. case 1:
  3241. h.call(i, this);
  3242. break;
  3243. case 2:
  3244. h.call(i, this, arguments[1]);
  3245. break;
  3246. case 3:
  3247. h.call(i, this, arguments[1], arguments[2]);
  3248. break;
  3249. default:
  3250. for (r = arguments.length, o = new Array(r - 1), t = 1; t < r; ++t) o[t - 1] = arguments[t];
  3251. p.call(i, this, o)
  3252. }
  3253. }
  3254. }, c = {
  3255. on: l(n),
  3256. once: l(i),
  3257. off: l(o),
  3258. emit: l(s)
  3259. }, u = b({}, c), t.exports = r = function (e) {
  3260. return null == e ? d(u) : b(Object(e), c)
  3261. }, r.methods = a
  3262. }, {
  3263. d: 16,
  3264. "es5-ext/object/valid-callable": 55
  3265. }],
  3266. 83: [function (e, t, r) {
  3267. var n = Object.create || function (e) {
  3268. var t = function () {};
  3269. return t.prototype = e, new t
  3270. },
  3271. i = Object.keys || function (e) {
  3272. var t = [];
  3273. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.push(r);
  3274. return r
  3275. },
  3276. o = Function.prototype.bind || function (e) {
  3277. var t = this;
  3278. return function () {
  3279. return t.apply(e, arguments)
  3280. }
  3281. };
  3282. function s() {
  3283. this._events && Object.prototype.hasOwnProperty.call(this, "_events") || (this._events = n(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0
  3284. }
  3285. t.exports = s, s.EventEmitter = s, s.prototype._events = void 0, s.prototype._maxListeners = void 0;
  3286. var a, c = 10;
  3287. try {
  3288. var u = {};
  3289. Object.defineProperty && Object.defineProperty(u, "x", {
  3290. value: 0
  3291. }), a = 0 === u.x
  3292. } catch (e) {
  3293. a = !1
  3294. }
  3295. function l(e) {
  3296. return void 0 === e._maxListeners ? s.defaultMaxListeners : e._maxListeners
  3297. }
  3298. function f(e, t, r, i) {
  3299. var o, s, a;
  3300. if ("function" != typeof r) throw new TypeError('"listener" argument must be a function');
  3301. if ((s = e._events) ? (s.newListener && (e.emit("newListener", t, r.listener ? r.listener : r), s = e._events), a = s[t]) : (s = e._events = n(null), e._eventsCount = 0), a) {
  3302. if ("function" == typeof a ? a = s[t] = i ? [r, a] : [a, r] : i ? a.unshift(r) : a.push(r), !a.warned && (o = l(e)) && o > 0 && a.length > o) {
  3303. a.warned = !0;
  3304. var c = new Error("Possible EventEmitter memory leak detected. " + a.length + ' "' + String(t) + '" listeners added. Use emitter.setMaxListeners() to increase limit.');
  3305. c.name = "MaxListenersExceededWarning", c.emitter = e, c.type = t, c.count = a.length, "object" == typeof console && console.warn && console.warn("%s: %s", c.name, c.message)
  3306. }
  3307. } else a = s[t] = r, ++e._eventsCount;
  3308. return e
  3309. }
  3310. function p() {
  3311. if (!this.fired) switch (this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length) {
  3312. case 0:
  3313. return this.listener.call(this.target);
  3314. case 1:
  3315. return this.listener.call(this.target, arguments[0]);
  3316. case 2:
  3317. return this.listener.call(this.target, arguments[0], arguments[1]);
  3318. case 3:
  3319. return this.listener.call(this.target, arguments[0], arguments[1], arguments[2]);
  3320. default:
  3321. for (var e = new Array(arguments.length), t = 0; t < e.length; ++t) e[t] = arguments[t];
  3322. this.listener.apply(this.target, e)
  3323. }
  3324. }
  3325. function h(e, t, r) {
  3326. var n = {
  3327. fired: !1,
  3328. wrapFn: void 0,
  3329. target: e,
  3330. type: t,
  3331. listener: r
  3332. },
  3333. i = o.call(p, n);
  3334. return i.listener = r, n.wrapFn = i, i
  3335. }
  3336. function d(e, t, r) {
  3337. var n = e._events;
  3338. if (!n) return [];
  3339. var i = n[t];
  3340. return i ? "function" == typeof i ? r ? [i.listener || i] : [i] : r ? function (e) {
  3341. for (var t = new Array(e.length), r = 0; r < t.length; ++r) t[r] = e[r].listener || e[r];
  3342. return t
  3343. }(i) : b(i, i.length) : []
  3344. }
  3345. function g(e) {
  3346. var t = this._events;
  3347. if (t) {
  3348. var r = t[e];
  3349. if ("function" == typeof r) return 1;
  3350. if (r) return r.length
  3351. }
  3352. return 0
  3353. }
  3354. function b(e, t) {
  3355. for (var r = new Array(t), n = 0; n < t; ++n) r[n] = e[n];
  3356. return r
  3357. }
  3358. a ? Object.defineProperty(s, "defaultMaxListeners", {
  3359. enumerable: !0,
  3360. get: function () {
  3361. return c
  3362. },
  3363. set: function (e) {
  3364. if ("number" != typeof e || e < 0 || e != e) throw new TypeError('"defaultMaxListeners" must be a positive number');
  3365. c = e
  3366. }
  3367. }) : s.defaultMaxListeners = c, s.prototype.setMaxListeners = function (e) {
  3368. if ("number" != typeof e || e < 0 || isNaN(e)) throw new TypeError('"n" argument must be a positive number');
  3369. return this._maxListeners = e, this
  3370. }, s.prototype.getMaxListeners = function () {
  3371. return l(this)
  3372. }, s.prototype.emit = function (e) {
  3373. var t, r, n, i, o, s, a = "error" === e;
  3374. if (s = this._events) a = a && null == s.error;
  3375. else if (!a) return !1;
  3376. if (a) {
  3377. if (arguments.length > 1 && (t = arguments[1]), t instanceof Error) throw t;
  3378. var c = new Error('Unhandled "error" event. (' + t + ")");
  3379. throw c.context = t, c
  3380. }
  3381. if (!(r = s[e])) return !1;
  3382. var u = "function" == typeof r;
  3383. switch (n = arguments.length) {
  3384. case 1:
  3385. ! function (e, t, r) {
  3386. if (t) e.call(r);
  3387. else
  3388. for (var n = e.length, i = b(e, n), o = 0; o < n; ++o) i[o].call(r)
  3389. }(r, u, this);
  3390. break;
  3391. case 2:
  3392. ! function (e, t, r, n) {
  3393. if (t) e.call(r, n);
  3394. else
  3395. for (var i = e.length, o = b(e, i), s = 0; s < i; ++s) o[s].call(r, n)
  3396. }(r, u, this, arguments[1]);
  3397. break;
  3398. case 3:
  3399. ! function (e, t, r, n, i) {
  3400. if (t) e.call(r, n, i);
  3401. else
  3402. for (var o = e.length, s = b(e, o), a = 0; a < o; ++a) s[a].call(r, n, i)
  3403. }(r, u, this, arguments[1], arguments[2]);
  3404. break;
  3405. case 4:
  3406. ! function (e, t, r, n, i, o) {
  3407. if (t) e.call(r, n, i, o);
  3408. else
  3409. for (var s = e.length, a = b(e, s), c = 0; c < s; ++c) a[c].call(r, n, i, o)
  3410. }(r, u, this, arguments[1], arguments[2], arguments[3]);
  3411. break;
  3412. default:
  3413. for (i = new Array(n - 1), o = 1; o < n; o++) i[o - 1] = arguments[o];
  3414. ! function (e, t, r, n) {
  3415. if (t) e.apply(r, n);
  3416. else
  3417. for (var i = e.length, o = b(e, i), s = 0; s < i; ++s) o[s].apply(r, n)
  3418. }(r, u, this, i)
  3419. }
  3420. return !0
  3421. }, s.prototype.addListener = function (e, t) {
  3422. return f(this, e, t, !1)
  3423. }, s.prototype.on = s.prototype.addListener, s.prototype.prependListener = function (e, t) {
  3424. return f(this, e, t, !0)
  3425. }, s.prototype.once = function (e, t) {
  3426. if ("function" != typeof t) throw new TypeError('"listener" argument must be a function');
  3427. return this.on(e, h(this, e, t)), this
  3428. }, s.prototype.prependOnceListener = function (e, t) {
  3429. if ("function" != typeof t) throw new TypeError('"listener" argument must be a function');
  3430. return this.prependListener(e, h(this, e, t)), this
  3431. }, s.prototype.removeListener = function (e, t) {
  3432. var r, i, o, s, a;
  3433. if ("function" != typeof t) throw new TypeError('"listener" argument must be a function');
  3434. if (!(i = this._events)) return this;
  3435. if (!(r = i[e])) return this;
  3436. if (r === t || r.listener === t) 0 == --this._eventsCount ? this._events = n(null) : (delete i[e], i.removeListener && this.emit("removeListener", e, r.listener || t));
  3437. else if ("function" != typeof r) {
  3438. for (o = -1, s = r.length - 1; s >= 0; s--)
  3439. if (r[s] === t || r[s].listener === t) {
  3440. a = r[s].listener, o = s;
  3441. break
  3442. } if (o < 0) return this;
  3443. 0 === o ? r.shift() : function (e, t) {
  3444. for (var r = t, n = r + 1, i = e.length; n < i; r += 1, n += 1) e[r] = e[n];
  3445. e.pop()
  3446. }(r, o), 1 === r.length && (i[e] = r[0]), i.removeListener && this.emit("removeListener", e, a || t)
  3447. }
  3448. return this
  3449. }, s.prototype.removeAllListeners = function (e) {
  3450. var t, r, o;
  3451. if (!(r = this._events)) return this;
  3452. if (!r.removeListener) return 0 === arguments.length ? (this._events = n(null), this._eventsCount = 0) : r[e] && (0 == --this._eventsCount ? this._events = n(null) : delete r[e]), this;
  3453. if (0 === arguments.length) {
  3454. var s, a = i(r);
  3455. for (o = 0; o < a.length; ++o) "removeListener" !== (s = a[o]) && this.removeAllListeners(s);
  3456. return this.removeAllListeners("removeListener"), this._events = n(null), this._eventsCount = 0, this
  3457. }
  3458. if ("function" == typeof (t = r[e])) this.removeListener(e, t);
  3459. else if (t)
  3460. for (o = t.length - 1; o >= 0; o--) this.removeListener(e, t[o]);
  3461. return this
  3462. }, s.prototype.listeners = function (e) {
  3463. return d(this, e, !0)
  3464. }, s.prototype.rawListeners = function (e) {
  3465. return d(this, e, !1)
  3466. }, s.listenerCount = function (e, t) {
  3467. return "function" == typeof e.listenerCount ? e.listenerCount(t) : g.call(e, t)
  3468. }, s.prototype.listenerCount = g, s.prototype.eventNames = function () {
  3469. return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : []
  3470. }
  3471. }, {}],
  3472. 84: [function (e, t, r) {
  3473. var n = function () {
  3474. if ("object" == typeof self && self) return self;
  3475. if ("object" == typeof window && window) return window;
  3476. throw new Error("Unable to resolve global `this`")
  3477. };
  3478. t.exports = function () {
  3479. if (this) return this;
  3480. try {
  3481. Object.defineProperty(Object.prototype, "__global__", {
  3482. get: function () {
  3483. return this
  3484. },
  3485. configurable: !0
  3486. })
  3487. } catch (e) {
  3488. return n()
  3489. }
  3490. try {
  3491. return __global__ || n()
  3492. } finally {
  3493. delete Object.prototype.__global__
  3494. }
  3495. }()
  3496. }, {}],
  3497. 85: [function (e, t, r) {
  3498. "use strict";
  3499. t.exports = e("./is-implemented")() ? globalThis : e("./implementation")
  3500. }, {
  3501. "./implementation": 84,
  3502. "./is-implemented": 86
  3503. }],
  3504. 86: [function (e, t, r) {
  3505. "use strict";
  3506. t.exports = function () {
  3507. return "object" == typeof globalThis && (!!globalThis && globalThis.Array === Array)
  3508. }
  3509. }, {}],
  3510. 87: [function (e, t, r) {
  3511. r.read = function (e, t, r, n, i) {
  3512. var o, s, a = 8 * i - n - 1,
  3513. c = (1 << a) - 1,
  3514. u = c >> 1,
  3515. l = -7,
  3516. f = r ? i - 1 : 0,
  3517. p = r ? -1 : 1,
  3518. h = e[t + f];
  3519. for (f += p, o = h & (1 << -l) - 1, h >>= -l, l += a; l > 0; o = 256 * o + e[t + f], f += p, l -= 8);
  3520. for (s = o & (1 << -l) - 1, o >>= -l, l += n; l > 0; s = 256 * s + e[t + f], f += p, l -= 8);
  3521. if (0 === o) o = 1 - u;
  3522. else {
  3523. if (o === c) return s ? NaN : 1 / 0 * (h ? -1 : 1);
  3524. s += Math.pow(2, n), o -= u
  3525. }
  3526. return (h ? -1 : 1) * s * Math.pow(2, o - n)
  3527. }, r.write = function (e, t, r, n, i, o) {
  3528. var s, a, c, u = 8 * o - i - 1,
  3529. l = (1 << u) - 1,
  3530. f = l >> 1,
  3531. p = 23 === i ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
  3532. h = n ? 0 : o - 1,
  3533. d = n ? 1 : -1,
  3534. g = t < 0 || 0 === t && 1 / t < 0 ? 1 : 0;
  3535. for (t = Math.abs(t), isNaN(t) || t === 1 / 0 ? (a = isNaN(t) ? 1 : 0, s = l) : (s = Math.floor(Math.log(t) / Math.LN2), t * (c = Math.pow(2, -s)) < 1 && (s--, c *= 2), (t += s + f >= 1 ? p / c : p * Math.pow(2, 1 - f)) * c >= 2 && (s++, c /= 2), s + f >= l ? (a = 0, s = l) : s + f >= 1 ? (a = (t * c - 1) * Math.pow(2, i), s += f) : (a = t * Math.pow(2, f - 1) * Math.pow(2, i), s = 0)); i >= 8; e[r + h] = 255 & a, h += d, a /= 256, i -= 8);
  3536. for (s = s << i | a, u += i; u > 0; e[r + h] = 255 & s, h += d, s /= 256, u -= 8);
  3537. e[r + h - d] |= 128 * g
  3538. }
  3539. }, {}],
  3540. 88: [function (e, t, r) {
  3541. "function" == typeof Object.create ? t.exports = function (e, t) {
  3542. t && (e.super_ = t, e.prototype = Object.create(t.prototype, {
  3543. constructor: {
  3544. value: e,
  3545. enumerable: !1,
  3546. writable: !0,
  3547. configurable: !0
  3548. }
  3549. }))
  3550. } : t.exports = function (e, t) {
  3551. if (t) {
  3552. e.super_ = t;
  3553. var r = function () {};
  3554. r.prototype = t.prototype, e.prototype = new r, e.prototype.constructor = e
  3555. }
  3556. }
  3557. }, {}],
  3558. 89: [function (e, t, r) {
  3559. function n(e) {
  3560. return !!e.constructor && "function" == typeof e.constructor.isBuffer && e.constructor.isBuffer(e)
  3561. }
  3562. t.exports = function (e) {
  3563. return null != e && (n(e) || function (e) {
  3564. return "function" == typeof e.readFloatLE && "function" == typeof e.slice && n(e.slice(0, 0))
  3565. }(e) || !!e._isBuffer)
  3566. }
  3567. }, {}],
  3568. 90: [function (e, t, r) {
  3569. var n = {}.toString;
  3570. t.exports = Array.isArray || function (e) {
  3571. return "[object Array]" == n.call(e)
  3572. }
  3573. }, {}],
  3574. 91: [function (e, t, r) {
  3575. "use strict";
  3576. var n = e("safe-buffer").Buffer,
  3577. i = t.exports;
  3578. for (var o in i.types = {
  3579. 0: "reserved",
  3580. 1: "connect",
  3581. 2: "connack",
  3582. 3: "publish",
  3583. 4: "puback",
  3584. 5: "pubrec",
  3585. 6: "pubrel",
  3586. 7: "pubcomp",
  3587. 8: "subscribe",
  3588. 9: "suback",
  3589. 10: "unsubscribe",
  3590. 11: "unsuback",
  3591. 12: "pingreq",
  3592. 13: "pingresp",
  3593. 14: "disconnect",
  3594. 15: "auth"
  3595. }, i.codes = {}, i.types) {
  3596. var s = i.types[o];
  3597. i.codes[s] = o
  3598. }
  3599. for (var a in i.CMD_SHIFT = 4, i.CMD_MASK = 240, i.DUP_MASK = 8, i.QOS_MASK = 3, i.QOS_SHIFT = 1, i.RETAIN_MASK = 1, i.LENGTH_MASK = 127, i.LENGTH_FIN_MASK = 128, i.SESSIONPRESENT_MASK = 1, i.SESSIONPRESENT_HEADER = n.from([i.SESSIONPRESENT_MASK]), i.CONNACK_HEADER = n.from([i.codes.connack << i.CMD_SHIFT]), i.USERNAME_MASK = 128, i.PASSWORD_MASK = 64, i.WILL_RETAIN_MASK = 32, i.WILL_QOS_MASK = 24, i.WILL_QOS_SHIFT = 3, i.WILL_FLAG_MASK = 4, i.CLEAN_SESSION_MASK = 2, i.CONNECT_HEADER = n.from([i.codes.connect << i.CMD_SHIFT]), i.properties = {
  3600. sessionExpiryInterval: 17,
  3601. willDelayInterval: 24,
  3602. receiveMaximum: 33,
  3603. maximumPacketSize: 39,
  3604. topicAliasMaximum: 34,
  3605. requestResponseInformation: 25,
  3606. requestProblemInformation: 23,
  3607. userProperties: 38,
  3608. authenticationMethod: 21,
  3609. authenticationData: 22,
  3610. payloadFormatIndicator: 1,
  3611. messageExpiryInterval: 2,
  3612. contentType: 3,
  3613. responseTopic: 8,
  3614. correlationData: 9,
  3615. maximumQoS: 36,
  3616. retainAvailable: 37,
  3617. assignedClientIdentifier: 18,
  3618. reasonString: 31,
  3619. wildcardSubscriptionAvailable: 40,
  3620. subscriptionIdentifiersAvailable: 41,
  3621. sharedSubscriptionAvailable: 42,
  3622. serverKeepAlive: 19,
  3623. responseInformation: 26,
  3624. serverReference: 28,
  3625. topicAlias: 35,
  3626. subscriptionIdentifier: 11
  3627. }, i.propertiesCodes = {}, i.properties) {
  3628. var c = i.properties[a];
  3629. i.propertiesCodes[c] = a
  3630. }
  3631. function u(e) {
  3632. return [0, 1, 2].map(function (t) {
  3633. return [0, 1].map(function (r) {
  3634. return [0, 1].map(function (o) {
  3635. var s = n.alloc(1);
  3636. return s.writeUInt8(i.codes[e] << i.CMD_SHIFT | (r ? i.DUP_MASK : 0) | t << i.QOS_SHIFT | o, 0, !0), s
  3637. })
  3638. })
  3639. })
  3640. }
  3641. i.propertiesTypes = {
  3642. sessionExpiryInterval: "int32",
  3643. willDelayInterval: "int32",
  3644. receiveMaximum: "int16",
  3645. maximumPacketSize: "int32",
  3646. topicAliasMaximum: "int16",
  3647. requestResponseInformation: "byte",
  3648. requestProblemInformation: "byte",
  3649. userProperties: "pair",
  3650. authenticationMethod: "string",
  3651. authenticationData: "binary",
  3652. payloadFormatIndicator: "byte",
  3653. messageExpiryInterval: "int32",
  3654. contentType: "string",
  3655. responseTopic: "string",
  3656. correlationData: "binary",
  3657. maximumQoS: "int8",
  3658. retainAvailable: "byte",
  3659. assignedClientIdentifier: "string",
  3660. reasonString: "string",
  3661. wildcardSubscriptionAvailable: "byte",
  3662. subscriptionIdentifiersAvailable: "byte",
  3663. sharedSubscriptionAvailable: "byte",
  3664. serverKeepAlive: "int16",
  3665. responseInformation: "string",
  3666. serverReference: "string",
  3667. topicAlias: "int16",
  3668. subscriptionIdentifier: "var"
  3669. }, i.PUBLISH_HEADER = u("publish"), i.SUBSCRIBE_HEADER = u("subscribe"), i.SUBSCRIBE_OPTIONS_QOS_MASK = 3, i.SUBSCRIBE_OPTIONS_NL_MASK = 1, i.SUBSCRIBE_OPTIONS_NL_SHIFT = 2, i.SUBSCRIBE_OPTIONS_RAP_MASK = 1, i.SUBSCRIBE_OPTIONS_RAP_SHIFT = 3, i.SUBSCRIBE_OPTIONS_RH_MASK = 3, i.SUBSCRIBE_OPTIONS_RH_SHIFT = 4, i.SUBSCRIBE_OPTIONS_RH = [0, 16, 32], i.SUBSCRIBE_OPTIONS_NL = 4, i.SUBSCRIBE_OPTIONS_RAP = 8, i.SUBSCRIBE_OPTIONS_QOS = [0, 1, 2], i.UNSUBSCRIBE_HEADER = u("unsubscribe"), i.ACKS = {
  3670. unsuback: u("unsuback"),
  3671. puback: u("puback"),
  3672. pubcomp: u("pubcomp"),
  3673. pubrel: u("pubrel"),
  3674. pubrec: u("pubrec")
  3675. }, i.SUBACK_HEADER = n.from([i.codes.suback << i.CMD_SHIFT]), i.VERSION3 = n.from([3]), i.VERSION4 = n.from([4]), i.VERSION5 = n.from([5]), i.QOS = [0, 1, 2].map(function (e) {
  3676. return n.from([e])
  3677. }), i.EMPTY = {
  3678. pingreq: n.from([i.codes.pingreq << 4, 0]),
  3679. pingresp: n.from([i.codes.pingresp << 4, 0]),
  3680. disconnect: n.from([i.codes.disconnect << 4, 0])
  3681. }
  3682. }, {
  3683. "safe-buffer": 117
  3684. }],
  3685. 92: [function (e, t, r) {
  3686. "use strict";
  3687. var n = e("safe-buffer").Buffer,
  3688. i = e("./writeToStream"),
  3689. o = e("events").EventEmitter;
  3690. function s() {
  3691. this._array = new Array(20), this._i = 0
  3692. }
  3693. e("inherits")(s, o), s.prototype.write = function (e) {
  3694. return this._array[this._i++] = e, !0
  3695. }, s.prototype.concat = function () {
  3696. var e, t, r = 0,
  3697. i = new Array(this._array.length),
  3698. o = this._array,
  3699. s = 0;
  3700. for (e = 0; e < o.length && void 0 !== o[e]; e++) "string" != typeof o[e] ? i[e] = o[e].length : i[e] = n.byteLength(o[e]), r += i[e];
  3701. for (t = n.allocUnsafe(r), e = 0; e < o.length && void 0 !== o[e]; e++) "string" != typeof o[e] ? (o[e].copy(t, s), s += i[e]) : (t.write(o[e], s), s += i[e]);
  3702. return t
  3703. }, t.exports = function (e, t) {
  3704. var r = new s;
  3705. return i(e, r, t), r.concat()
  3706. }
  3707. }, {
  3708. "./writeToStream": 97,
  3709. events: 83,
  3710. inherits: 88,
  3711. "safe-buffer": 117
  3712. }],
  3713. 93: [function (e, t, r) {
  3714. "use strict";
  3715. r.parser = e("./parser"), r.generate = e("./generate"), r.writeToStream = e("./writeToStream")
  3716. }, {
  3717. "./generate": 92,
  3718. "./parser": 96,
  3719. "./writeToStream": 97
  3720. }],
  3721. 94: [function (e, t, r) {
  3722. "use strict";
  3723. var n = e("safe-buffer").Buffer,
  3724. i = 65536,
  3725. o = {};
  3726. function s(e) {
  3727. var t = n.allocUnsafe(2);
  3728. return t.writeUInt8(e >> 8, 0), t.writeUInt8(255 & e, 1), t
  3729. }
  3730. t.exports = {
  3731. cache: o,
  3732. generateCache: function () {
  3733. for (var e = 0; e < i; e++) o[e] = s(e)
  3734. },
  3735. generateNumber: s,
  3736. genBufVariableByteInt: function (e) {
  3737. var t = 0,
  3738. r = 0,
  3739. i = function (e) {
  3740. return e >= 0 && e < 128 ? 1 : e >= 128 && e < 16384 ? 2 : e >= 16384 && e < 2097152 ? 3 : e >= 2097152 && e < 268435456 ? 4 : 0
  3741. }(e),
  3742. o = n.allocUnsafe(i);
  3743. do {
  3744. t = e % 128 | 0, (e = e / 128 | 0) > 0 && (t |= 128), o.writeUInt8(t, r++)
  3745. } while (e > 0);
  3746. return {
  3747. data: o,
  3748. length: i
  3749. }
  3750. },
  3751. generate4ByteBuffer: function (e) {
  3752. var t = n.allocUnsafe(4);
  3753. return t.writeUInt32BE(e, 0), t
  3754. }
  3755. }
  3756. }, {
  3757. "safe-buffer": 117
  3758. }],
  3759. 95: [function (e, t, r) {
  3760. t.exports = function () {
  3761. this.cmd = null, this.retain = !1, this.qos = 0, this.dup = !1, this.length = -1, this.topic = null, this.payload = null
  3762. }
  3763. }, {}],
  3764. 96: [function (e, t, r) {
  3765. "use strict";
  3766. var n = e("bl"),
  3767. i = e("inherits"),
  3768. o = e("events").EventEmitter,
  3769. s = e("./packet"),
  3770. a = e("./constants"),
  3771. c = e("debug")("mqtt-packet:parser");
  3772. function u(e) {
  3773. if (!(this instanceof u)) return new u(e);
  3774. this.settings = e || {}, this._states = ["_parseHeader", "_parseLength", "_parsePayload", "_newPacket"], this._resetState()
  3775. }
  3776. i(u, o), u.prototype._resetState = function () {
  3777. c("_resetState: resetting packet, error, _list, and _stateCounter"), this.packet = new s, this.error = null, this._list = n(), this._stateCounter = 0
  3778. }, u.prototype.parse = function (e) {
  3779. for (this.error && this._resetState(), this._list.append(e), c("parse: current state: %s", this._states[this._stateCounter]);
  3780. (-1 !== this.packet.length || this._list.length > 0) && this[this._states[this._stateCounter]]() && !this.error;) this._stateCounter++, c("parse: state complete. _stateCounter is now: %d", this._stateCounter), c("parse: packet.length: %d, buffer list length: %d", this.packet.length, this._list.length), this._stateCounter >= this._states.length && (this._stateCounter = 0);
  3781. return c("parse: exited while loop. packet: %d, buffer list length: %d", this.packet.length, this._list.length), this._list.length
  3782. }, u.prototype._parseHeader = function () {
  3783. var e = this._list.readUInt8(0);
  3784. return this.packet.cmd = a.types[e >> a.CMD_SHIFT], this.packet.retain = 0 != (e & a.RETAIN_MASK), this.packet.qos = e >> a.QOS_SHIFT & a.QOS_MASK, this.packet.dup = 0 != (e & a.DUP_MASK), c("_parseHeader: packet: %o", this.packet), this._list.consume(1), !0
  3785. }, u.prototype._parseLength = function () {
  3786. var e = this._parseVarByteNum(!0);
  3787. return e && (this.packet.length = e.value, this._list.consume(e.bytes)), c("_parseLength %d", e.value), !!e
  3788. }, u.prototype._parsePayload = function () {
  3789. c("_parsePayload: payload %O", this._list);
  3790. var e = !1;
  3791. if (0 === this.packet.length || this._list.length >= this.packet.length) {
  3792. switch (this._pos = 0, this.packet.cmd) {
  3793. case "connect":
  3794. this._parseConnect();
  3795. break;
  3796. case "connack":
  3797. this._parseConnack();
  3798. break;
  3799. case "publish":
  3800. this._parsePublish();
  3801. break;
  3802. case "puback":
  3803. case "pubrec":
  3804. case "pubrel":
  3805. case "pubcomp":
  3806. this._parseConfirmation();
  3807. break;
  3808. case "subscribe":
  3809. this._parseSubscribe();
  3810. break;
  3811. case "suback":
  3812. this._parseSuback();
  3813. break;
  3814. case "unsubscribe":
  3815. this._parseUnsubscribe();
  3816. break;
  3817. case "unsuback":
  3818. this._parseUnsuback();
  3819. break;
  3820. case "pingreq":
  3821. case "pingresp":
  3822. break;
  3823. case "disconnect":
  3824. this._parseDisconnect();
  3825. break;
  3826. case "auth":
  3827. this._parseAuth();
  3828. break;
  3829. default:
  3830. this._emitError(new Error("Not supported"))
  3831. }
  3832. e = !0
  3833. }
  3834. return c("_parsePayload complete result: %s", e), e
  3835. }, u.prototype._parseConnect = function () {
  3836. var e, t, r, n, i, o;
  3837. c("_parseConnect");
  3838. var s = {},
  3839. u = this.packet;
  3840. if (null === (e = this._parseString())) return this._emitError(new Error("Cannot parse protocolId"));
  3841. if ("MQTT" !== e && "MQIsdp" !== e) return this._emitError(new Error("Invalid protocolId"));
  3842. if (u.protocolId = e, this._pos >= this._list.length) return this._emitError(new Error("Packet too short"));
  3843. if (u.protocolVersion = this._list.readUInt8(this._pos), 3 !== u.protocolVersion && 4 !== u.protocolVersion && 5 !== u.protocolVersion) return this._emitError(new Error("Invalid protocol version"));
  3844. if (this._pos++, this._pos >= this._list.length) return this._emitError(new Error("Packet too short"));
  3845. if (s.username = this._list.readUInt8(this._pos) & a.USERNAME_MASK, s.password = this._list.readUInt8(this._pos) & a.PASSWORD_MASK, s.will = this._list.readUInt8(this._pos) & a.WILL_FLAG_MASK, s.will && (u.will = {}, u.will.retain = 0 != (this._list.readUInt8(this._pos) & a.WILL_RETAIN_MASK), u.will.qos = (this._list.readUInt8(this._pos) & a.WILL_QOS_MASK) >> a.WILL_QOS_SHIFT), u.clean = 0 != (this._list.readUInt8(this._pos) & a.CLEAN_SESSION_MASK), this._pos++, u.keepalive = this._parseNum(), -1 === u.keepalive) return this._emitError(new Error("Packet too short"));
  3846. if (5 === u.protocolVersion) {
  3847. var l = this._parseProperties();
  3848. Object.getOwnPropertyNames(l).length && (u.properties = l)
  3849. }
  3850. if (null === (t = this._parseString())) return this._emitError(new Error("Packet too short"));
  3851. if (u.clientId = t, c("_parseConnect: packet.clientId: %s", u.clientId), s.will) {
  3852. if (5 === u.protocolVersion) {
  3853. var f = this._parseProperties();
  3854. Object.getOwnPropertyNames(f).length && (u.will.properties = f)
  3855. }
  3856. if (null === (r = this._parseString())) return this._emitError(new Error("Cannot parse will topic"));
  3857. if (u.will.topic = r, c("_parseConnect: packet.will.topic: %s", u.will.topic), null === (n = this._parseBuffer())) return this._emitError(new Error("Cannot parse will payload"));
  3858. u.will.payload = n, c("_parseConnect: packet.will.paylaod: %s", u.will.payload)
  3859. }
  3860. if (s.username) {
  3861. if (null === (o = this._parseString())) return this._emitError(new Error("Cannot parse username"));
  3862. u.username = o, c("_parseConnect: packet.username: %s", u.username)
  3863. }
  3864. if (s.password) {
  3865. if (null === (i = this._parseBuffer())) return this._emitError(new Error("Cannot parse password"));
  3866. u.password = i
  3867. }
  3868. return this.settings = u, c("_parseConnect: complete"), u
  3869. }, u.prototype._parseConnack = function () {
  3870. c("_parseConnack");
  3871. var e = this.packet;
  3872. if (this._list.length < 2) return null;
  3873. if (e.sessionPresent = !!(this._list.readUInt8(this._pos++) & a.SESSIONPRESENT_MASK), 5 === this.settings.protocolVersion ? e.reasonCode = this._list.readUInt8(this._pos++) : e.returnCode = this._list.readUInt8(this._pos++), -1 === e.returnCode || -1 === e.reasonCode) return this._emitError(new Error("Cannot parse return code"));
  3874. if (5 === this.settings.protocolVersion) {
  3875. var t = this._parseProperties();
  3876. Object.getOwnPropertyNames(t).length && (e.properties = t)
  3877. }
  3878. c("_parseConnack: complete")
  3879. }, u.prototype._parsePublish = function () {
  3880. c("_parsePublish");
  3881. var e = this.packet;
  3882. if (e.topic = this._parseString(), null === e.topic) return this._emitError(new Error("Cannot parse topic"));
  3883. if (!(e.qos > 0) || this._parseMessageId()) {
  3884. if (5 === this.settings.protocolVersion) {
  3885. var t = this._parseProperties();
  3886. Object.getOwnPropertyNames(t).length && (e.properties = t)
  3887. }
  3888. e.payload = this._list.slice(this._pos, e.length), c("_parsePublish: payload from buffer list: %o", e.payload)
  3889. }
  3890. }, u.prototype._parseSubscribe = function () {
  3891. c("_parseSubscribe");
  3892. var e, t, r, n, i, o, s, u = this.packet;
  3893. if (1 !== u.qos) return this._emitError(new Error("Wrong subscribe header"));
  3894. if (u.subscriptions = [], this._parseMessageId()) {
  3895. if (5 === this.settings.protocolVersion) {
  3896. var l = this._parseProperties();
  3897. Object.getOwnPropertyNames(l).length && (u.properties = l)
  3898. }
  3899. for (; this._pos < u.length;) {
  3900. if (null === (e = this._parseString())) return this._emitError(new Error("Cannot parse topic"));
  3901. if (this._pos >= u.length) return this._emitError(new Error("Malformed Subscribe Payload"));
  3902. r = (t = this._parseByte()) & a.SUBSCRIBE_OPTIONS_QOS_MASK, o = 0 != (t >> a.SUBSCRIBE_OPTIONS_NL_SHIFT & a.SUBSCRIBE_OPTIONS_NL_MASK), i = 0 != (t >> a.SUBSCRIBE_OPTIONS_RAP_SHIFT & a.SUBSCRIBE_OPTIONS_RAP_MASK), n = t >> a.SUBSCRIBE_OPTIONS_RH_SHIFT & a.SUBSCRIBE_OPTIONS_RH_MASK, s = {
  3903. topic: e,
  3904. qos: r
  3905. }, 5 === this.settings.protocolVersion && (s.nl = o, s.rap = i, s.rh = n), c("_parseSubscribe: push subscription `%s` to subscription", s), u.subscriptions.push(s)
  3906. }
  3907. }
  3908. }, u.prototype._parseSuback = function () {
  3909. c("_parseSuback");
  3910. var e = this.packet;
  3911. if (this.packet.granted = [], this._parseMessageId()) {
  3912. if (5 === this.settings.protocolVersion) {
  3913. var t = this._parseProperties();
  3914. Object.getOwnPropertyNames(t).length && (e.properties = t)
  3915. }
  3916. for (; this._pos < this.packet.length;) this.packet.granted.push(this._list.readUInt8(this._pos++))
  3917. }
  3918. }, u.prototype._parseUnsubscribe = function () {
  3919. c("_parseUnsubscribe");
  3920. var e = this.packet;
  3921. if (e.unsubscriptions = [], this._parseMessageId()) {
  3922. if (5 === this.settings.protocolVersion) {
  3923. var t = this._parseProperties();
  3924. Object.getOwnPropertyNames(t).length && (e.properties = t)
  3925. }
  3926. for (; this._pos < e.length;) {
  3927. var r;
  3928. if (null === (r = this._parseString())) return this._emitError(new Error("Cannot parse topic"));
  3929. c("_parseUnsubscribe: push topic `%s` to unsubscriptions", r), e.unsubscriptions.push(r)
  3930. }
  3931. }
  3932. }, u.prototype._parseUnsuback = function () {
  3933. c("_parseUnsuback");
  3934. var e = this.packet;
  3935. if (!this._parseMessageId()) return this._emitError(new Error("Cannot parse messageId"));
  3936. if (5 === this.settings.protocolVersion) {
  3937. var t = this._parseProperties();
  3938. for (Object.getOwnPropertyNames(t).length && (e.properties = t), e.granted = []; this._pos < this.packet.length;) this.packet.granted.push(this._list.readUInt8(this._pos++))
  3939. }
  3940. }, u.prototype._parseConfirmation = function () {
  3941. c("_parseConfirmation: packet.cmd: `%s`", this.packet.cmd);
  3942. var e = this.packet;
  3943. if (this._parseMessageId(), 5 === this.settings.protocolVersion && (e.length > 2 && (e.reasonCode = this._parseByte(), c("_parseConfirmation: packet.reasonCode `%d`", e.reasonCode)), e.length > 3)) {
  3944. var t = this._parseProperties();
  3945. Object.getOwnPropertyNames(t).length && (e.properties = t)
  3946. }
  3947. return !0
  3948. }, u.prototype._parseDisconnect = function () {
  3949. var e = this.packet;
  3950. if (c("_parseDisconnect"), 5 === this.settings.protocolVersion) {
  3951. e.reasonCode = this._parseByte();
  3952. var t = this._parseProperties();
  3953. Object.getOwnPropertyNames(t).length && (e.properties = t)
  3954. }
  3955. return c("_parseDisconnect result: true"), !0
  3956. }, u.prototype._parseAuth = function () {
  3957. c("_parseAuth");
  3958. var e = this.packet;
  3959. if (5 !== this.settings.protocolVersion) return this._emitError(new Error("Not supported auth packet for this version MQTT"));
  3960. e.reasonCode = this._parseByte();
  3961. var t = this._parseProperties();
  3962. return Object.getOwnPropertyNames(t).length && (e.properties = t), c("_parseAuth: result: true"), !0
  3963. }, u.prototype._parseMessageId = function () {
  3964. var e = this.packet;
  3965. return e.messageId = this._parseNum(), null === e.messageId ? (this._emitError(new Error("Cannot parse messageId")), !1) : (c("_parseMessageId: packet.messageId %d", e.messageId), !0)
  3966. }, u.prototype._parseString = function (e) {
  3967. var t, r = this._parseNum(),
  3968. n = r + this._pos;
  3969. return -1 === r || n > this._list.length || n > this.packet.length ? null : (t = this._list.toString("utf8", this._pos, n), this._pos += r, c("_parseString: result: %s", t), t)
  3970. }, u.prototype._parseStringPair = function () {
  3971. return c("_parseStringPair"), {
  3972. name: this._parseString(),
  3973. value: this._parseString()
  3974. }
  3975. }, u.prototype._parseBuffer = function () {
  3976. var e, t = this._parseNum(),
  3977. r = t + this._pos;
  3978. return -1 === t || r > this._list.length || r > this.packet.length ? null : (e = this._list.slice(this._pos, r), this._pos += t, c("_parseBuffer: result: %o", e), e)
  3979. }, u.prototype._parseNum = function () {
  3980. if (this._list.length - this._pos < 2) return -1;
  3981. var e = this._list.readUInt16BE(this._pos);
  3982. return this._pos += 2, c("_parseNum: result: %s", e), e
  3983. }, u.prototype._parse4ByteNum = function () {
  3984. if (this._list.length - this._pos < 4) return -1;
  3985. var e = this._list.readUInt32BE(this._pos);
  3986. return this._pos += 4, c("_parse4ByteNum: result: %s", e), e
  3987. }, u.prototype._parseVarByteNum = function (e) {
  3988. c("_parseVarByteNum");
  3989. for (var t, r = 0, n = 1, i = 0, o = !0, s = this._pos ? this._pos : 0; r < 5 && (i += n * ((t = this._list.readUInt8(s + r++)) & a.LENGTH_MASK), n *= 128, 0 != (t & a.LENGTH_FIN_MASK));)
  3990. if (this._list.length <= r) {
  3991. o = !1;
  3992. break
  3993. } return s && (this._pos += r), c("_parseVarByteNum: result: %o", o = !!o && (e ? {
  3994. bytes: r,
  3995. value: i
  3996. } : i)), o
  3997. }, u.prototype._parseByte = function () {
  3998. var e = this._list.readUInt8(this._pos);
  3999. return this._pos++, c("_parseByte: result: %o", e), e
  4000. }, u.prototype._parseByType = function (e) {
  4001. switch (c("_parseByType: type: %s", e), e) {
  4002. case "byte":
  4003. return 0 !== this._parseByte();
  4004. case "int8":
  4005. return this._parseByte();
  4006. case "int16":
  4007. return this._parseNum();
  4008. case "int32":
  4009. return this._parse4ByteNum();
  4010. case "var":
  4011. return this._parseVarByteNum();
  4012. case "string":
  4013. return this._parseString();
  4014. case "pair":
  4015. return this._parseStringPair();
  4016. case "binary":
  4017. return this._parseBuffer()
  4018. }
  4019. }, u.prototype._parseProperties = function () {
  4020. c("_parseProperties");
  4021. for (var e = this._parseVarByteNum(), t = this._pos + e, r = {}; this._pos < t;) {
  4022. var n = this._parseByte(),
  4023. i = a.propertiesCodes[n];
  4024. if (!i) return this._emitError(new Error("Unknown property")), !1;
  4025. if ("userProperties" !== i) r[i] ? Array.isArray(r[i]) ? r[i].push(this._parseByType(a.propertiesTypes[i])) : (r[i] = [r[i]], r[i].push(this._parseByType(a.propertiesTypes[i]))) : r[i] = this._parseByType(a.propertiesTypes[i]);
  4026. else {
  4027. r[i] || (r[i] = {});
  4028. var o = this._parseByType(a.propertiesTypes[i]);
  4029. if (r[i][o.name])
  4030. if (Array.isArray(r[i][o.name])) r[i][o.name].push(o.value);
  4031. else {
  4032. var s = r[i][o.name];
  4033. r[i][o.name] = [s], r[i][o.name].push(o.value)
  4034. }
  4035. else r[i][o.name] = o.value
  4036. }
  4037. }
  4038. return r
  4039. }, u.prototype._newPacket = function () {
  4040. return c("_newPacket"), this.packet && (this._list.consume(this.packet.length), c("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d", this.packet.cmd, this.packet.payload, this.packet.length), this.emit("packet", this.packet)), c("_newPacket: new packet"), this.packet = new s, this._pos = 0, !0
  4041. }, u.prototype._emitError = function (e) {
  4042. c("_emitError"), this.error = e, this.emit("error", e)
  4043. }, t.exports = u
  4044. }, {
  4045. "./constants": 91,
  4046. "./packet": 95,
  4047. bl: 11,
  4048. debug: 17,
  4049. events: 83,
  4050. inherits: 88
  4051. }],
  4052. 97: [function (e, t, r) {
  4053. "use strict";
  4054. var n = e("./constants"),
  4055. i = e("safe-buffer").Buffer,
  4056. o = i.allocUnsafe(0),
  4057. s = i.from([0]),
  4058. a = e("./numbers"),
  4059. c = e("process-nextick-args").nextTick,
  4060. u = e("debug")("mqtt-packet:writeToStream"),
  4061. l = a.cache,
  4062. f = a.generateNumber,
  4063. p = a.generateCache,
  4064. h = a.genBufVariableByteInt,
  4065. d = a.generate4ByteBuffer,
  4066. g = k,
  4067. b = !0;
  4068. function m(e, t, r) {
  4069. switch (u("generate called"), t.cork && (t.cork(), c(y, t)), b && (b = !1, p()), u("generate: packet.cmd: %s", e.cmd), e.cmd) {
  4070. case "connect":
  4071. return function (e, t, r) {
  4072. var o = e || {},
  4073. s = o.protocolId || "MQTT",
  4074. a = o.protocolVersion || 4,
  4075. c = o.will,
  4076. u = o.clean,
  4077. l = o.keepalive || 0,
  4078. f = o.clientId || "",
  4079. p = o.username,
  4080. h = o.password,
  4081. d = o.properties;
  4082. void 0 === u && (u = !0);
  4083. var b = 0;
  4084. if (!s || "string" != typeof s && !i.isBuffer(s)) return t.emit("error", new Error("Invalid protocolId")), !1;
  4085. b += s.length + 2;
  4086. if (3 !== a && 4 !== a && 5 !== a) return t.emit("error", new Error("Invalid protocol version")), !1;
  4087. b += 1;
  4088. if ("string" != typeof f && !i.isBuffer(f) || !f && 4 !== a || !f && !u) {
  4089. if (a < 4) return t.emit("error", new Error("clientId must be supplied before 3.1.1")), !1;
  4090. if (1 * u == 0) return t.emit("error", new Error("clientId must be given if cleanSession set to 0")), !1
  4091. } else b += f.length + 2;
  4092. if ("number" != typeof l || l < 0 || l > 65535 || l % 1 != 0) return t.emit("error", new Error("Invalid keepalive")), !1;
  4093. b += 2;
  4094. if (b += 1, 5 === a) {
  4095. var m = I(t, d);
  4096. if (!m) return !1;
  4097. b += m.length
  4098. }
  4099. if (c) {
  4100. if ("object" != typeof c) return t.emit("error", new Error("Invalid will")), !1;
  4101. if (!c.topic || "string" != typeof c.topic) return t.emit("error", new Error("Invalid will topic")), !1;
  4102. if (b += i.byteLength(c.topic) + 2, b += 2, c.payload) {
  4103. if (!(c.payload.length >= 0)) return t.emit("error", new Error("Invalid will payload")), !1;
  4104. "string" == typeof c.payload ? b += i.byteLength(c.payload) : b += c.payload.length
  4105. }
  4106. var y = {};
  4107. if (5 === a) {
  4108. if (!(y = I(t, c.properties))) return !1;
  4109. b += y.length
  4110. }
  4111. }
  4112. var _ = !1;
  4113. if (null != p) {
  4114. if (!T(p)) return t.emit("error", new Error("Invalid username")), !1;
  4115. _ = !0, b += i.byteLength(p) + 2
  4116. }
  4117. if (null != h) {
  4118. if (!_) return t.emit("error", new Error("Username is required to use password")), !1;
  4119. if (!T(h)) return t.emit("error", new Error("Invalid password")), !1;
  4120. b += A(h) + 2
  4121. }
  4122. t.write(n.CONNECT_HEADER), v(t, b), E(t, s), t.write(4 === a ? n.VERSION4 : 5 === a ? n.VERSION5 : n.VERSION3);
  4123. var S = 0;
  4124. S |= null != p ? n.USERNAME_MASK : 0, S |= null != h ? n.PASSWORD_MASK : 0, S |= c && c.retain ? n.WILL_RETAIN_MASK : 0, S |= c && c.qos ? c.qos << n.WILL_QOS_SHIFT : 0, S |= c ? n.WILL_FLAG_MASK : 0, S |= u ? n.CLEAN_SESSION_MASK : 0, t.write(i.from([S])), g(t, l), 5 === a && m.write();
  4125. E(t, f), c && (5 === a && y.write(), w(t, c.topic), E(t, c.payload));
  4126. null != p && E(t, p);
  4127. null != h && E(t, h);
  4128. return !0
  4129. }(e, t);
  4130. case "connack":
  4131. return function (e, t, r) {
  4132. var o = r ? r.protocolVersion : 4,
  4133. a = e || {},
  4134. c = 5 === o ? a.reasonCode : a.returnCode,
  4135. u = a.properties,
  4136. l = 2;
  4137. if ("number" != typeof c) return t.emit("error", new Error("Invalid return code")), !1;
  4138. var f = null;
  4139. if (5 === o) {
  4140. if (!(f = I(t, u))) return !1;
  4141. l += f.length
  4142. }
  4143. t.write(n.CONNACK_HEADER), v(t, l), t.write(a.sessionPresent ? n.SESSIONPRESENT_HEADER : s), t.write(i.from([c])), null != f && f.write();
  4144. return !0
  4145. }(e, t, r);
  4146. case "publish":
  4147. return function (e, t, r) {
  4148. u("publish: packet: %o", e);
  4149. var s = r ? r.protocolVersion : 4,
  4150. a = e || {},
  4151. c = a.qos || 0,
  4152. l = a.retain ? n.RETAIN_MASK : 0,
  4153. f = a.topic,
  4154. p = a.payload || o,
  4155. h = a.messageId,
  4156. d = a.properties,
  4157. b = 0;
  4158. if ("string" == typeof f) b += i.byteLength(f) + 2;
  4159. else {
  4160. if (!i.isBuffer(f)) return t.emit("error", new Error("Invalid topic")), !1;
  4161. b += f.length + 2
  4162. }
  4163. i.isBuffer(p) ? b += p.length : b += i.byteLength(p);
  4164. if (c && "number" != typeof h) return t.emit("error", new Error("Invalid messageId")), !1;
  4165. c && (b += 2);
  4166. var m = null;
  4167. if (5 === s) {
  4168. if (!(m = I(t, d))) return !1;
  4169. b += m.length
  4170. }
  4171. t.write(n.PUBLISH_HEADER[c][a.dup ? 1 : 0][l ? 1 : 0]), v(t, b), g(t, A(f)), t.write(f), c > 0 && g(t, h);
  4172. null != m && m.write();
  4173. return u("publish: payload: %o", p), t.write(p)
  4174. }(e, t, r);
  4175. case "puback":
  4176. case "pubrec":
  4177. case "pubrel":
  4178. case "pubcomp":
  4179. return function (e, t, r) {
  4180. var o = r ? r.protocolVersion : 4,
  4181. s = e || {},
  4182. a = s.cmd || "puback",
  4183. c = s.messageId,
  4184. u = s.dup && "pubrel" === a ? n.DUP_MASK : 0,
  4185. l = 0,
  4186. f = s.reasonCode,
  4187. p = s.properties,
  4188. h = 5 === o ? 3 : 2;
  4189. "pubrel" === a && (l = 1);
  4190. if ("number" != typeof c) return t.emit("error", new Error("Invalid messageId")), !1;
  4191. var d = null;
  4192. if (5 === o && "object" == typeof p) {
  4193. if (!(d = C(t, p, r, h))) return !1;
  4194. h += d.length
  4195. }
  4196. t.write(n.ACKS[a][l][u][0]), v(t, h), g(t, c), 5 === o && t.write(i.from([f]));
  4197. null !== d && d.write();
  4198. return !0
  4199. }(e, t, r);
  4200. case "subscribe":
  4201. return function (e, t, r) {
  4202. u("subscribe: packet: ");
  4203. var o = r ? r.protocolVersion : 4,
  4204. s = e || {},
  4205. a = s.dup ? n.DUP_MASK : 0,
  4206. c = s.messageId,
  4207. l = s.subscriptions,
  4208. f = s.properties,
  4209. p = 0;
  4210. if ("number" != typeof c) return t.emit("error", new Error("Invalid messageId")), !1;
  4211. p += 2;
  4212. var h = null;
  4213. if (5 === o) {
  4214. if (!(h = I(t, f))) return !1;
  4215. p += h.length
  4216. }
  4217. if ("object" != typeof l || !l.length) return t.emit("error", new Error("Invalid subscriptions")), !1;
  4218. for (var d = 0; d < l.length; d += 1) {
  4219. var b = l[d].topic,
  4220. m = l[d].qos;
  4221. if ("string" != typeof b) return t.emit("error", new Error("Invalid subscriptions - invalid topic")), !1;
  4222. if ("number" != typeof m) return t.emit("error", new Error("Invalid subscriptions - invalid qos")), !1;
  4223. if (5 === o) {
  4224. var y = l[d].nl || !1;
  4225. if ("boolean" != typeof y) return t.emit("error", new Error("Invalid subscriptions - invalid No Local")), !1;
  4226. var _ = l[d].rap || !1;
  4227. if ("boolean" != typeof _) return t.emit("error", new Error("Invalid subscriptions - invalid Retain as Published")), !1;
  4228. var S = l[d].rh || 0;
  4229. if ("number" != typeof S || S > 2) return t.emit("error", new Error("Invalid subscriptions - invalid Retain Handling")), !1
  4230. }
  4231. p += i.byteLength(b) + 2 + 1
  4232. }
  4233. u("subscribe: writing to stream: %o", n.SUBSCRIBE_HEADER), t.write(n.SUBSCRIBE_HEADER[1][a ? 1 : 0][0]), v(t, p), g(t, c), null !== h && h.write();
  4234. for (var k = !0, x = 0; x < l.length; x++) {
  4235. var E, C = l[x],
  4236. O = C.topic,
  4237. j = C.qos,
  4238. A = +C.nl,
  4239. T = +C.rap,
  4240. P = C.rh;
  4241. w(t, O), E = n.SUBSCRIBE_OPTIONS_QOS[j], 5 === o && (E |= A ? n.SUBSCRIBE_OPTIONS_NL : 0, E |= T ? n.SUBSCRIBE_OPTIONS_RAP : 0, E |= P ? n.SUBSCRIBE_OPTIONS_RH[P] : 0), k = t.write(i.from([E]))
  4242. }
  4243. return k
  4244. }(e, t, r);
  4245. case "suback":
  4246. return function (e, t, r) {
  4247. var o = r ? r.protocolVersion : 4,
  4248. s = e || {},
  4249. a = s.messageId,
  4250. c = s.granted,
  4251. u = s.properties,
  4252. l = 0;
  4253. if ("number" != typeof a) return t.emit("error", new Error("Invalid messageId")), !1;
  4254. l += 2;
  4255. if ("object" != typeof c || !c.length) return t.emit("error", new Error("Invalid qos vector")), !1;
  4256. for (var f = 0; f < c.length; f += 1) {
  4257. if ("number" != typeof c[f]) return t.emit("error", new Error("Invalid qos vector")), !1;
  4258. l += 1
  4259. }
  4260. var p = null;
  4261. if (5 === o) {
  4262. if (!(p = C(t, u, r, l))) return !1;
  4263. l += p.length
  4264. }
  4265. t.write(n.SUBACK_HEADER), v(t, l), g(t, a), null !== p && p.write();
  4266. return t.write(i.from(c))
  4267. }(e, t, r);
  4268. case "unsubscribe":
  4269. return function (e, t, r) {
  4270. var o = r ? r.protocolVersion : 4,
  4271. s = e || {},
  4272. a = s.messageId,
  4273. c = s.dup ? n.DUP_MASK : 0,
  4274. u = s.unsubscriptions,
  4275. l = s.properties,
  4276. f = 0;
  4277. if ("number" != typeof a) return t.emit("error", new Error("Invalid messageId")), !1;
  4278. f += 2;
  4279. if ("object" != typeof u || !u.length) return t.emit("error", new Error("Invalid unsubscriptions")), !1;
  4280. for (var p = 0; p < u.length; p += 1) {
  4281. if ("string" != typeof u[p]) return t.emit("error", new Error("Invalid unsubscriptions")), !1;
  4282. f += i.byteLength(u[p]) + 2
  4283. }
  4284. var h = null;
  4285. if (5 === o) {
  4286. if (!(h = I(t, l))) return !1;
  4287. f += h.length
  4288. }
  4289. t.write(n.UNSUBSCRIBE_HEADER[1][c ? 1 : 0][0]), v(t, f), g(t, a), null !== h && h.write();
  4290. for (var d = !0, b = 0; b < u.length; b++) d = w(t, u[b]);
  4291. return d
  4292. }(e, t, r);
  4293. case "unsuback":
  4294. return function (e, t, r) {
  4295. var o = r ? r.protocolVersion : 4,
  4296. s = e || {},
  4297. a = s.messageId,
  4298. c = s.dup ? n.DUP_MASK : 0,
  4299. u = s.granted,
  4300. l = s.properties,
  4301. f = s.cmd,
  4302. p = 2;
  4303. if ("number" != typeof a) return t.emit("error", new Error("Invalid messageId")), !1;
  4304. if (5 === o) {
  4305. if ("object" != typeof u || !u.length) return t.emit("error", new Error("Invalid qos vector")), !1;
  4306. for (var h = 0; h < u.length; h += 1) {
  4307. if ("number" != typeof u[h]) return t.emit("error", new Error("Invalid qos vector")), !1;
  4308. p += 1
  4309. }
  4310. }
  4311. var d = null;
  4312. if (5 === o) {
  4313. if (!(d = C(t, l, r, p))) return !1;
  4314. p += d.length
  4315. }
  4316. t.write(n.ACKS[f][0][c][0]), v(t, p), g(t, a), null !== d && d.write();
  4317. 5 === o && t.write(i.from(u));
  4318. return !0
  4319. }(e, t, r);
  4320. case "pingreq":
  4321. case "pingresp":
  4322. return function (e, t, r) {
  4323. return t.write(n.EMPTY[e.cmd])
  4324. }(e, t);
  4325. case "disconnect":
  4326. return function (e, t, r) {
  4327. var o = r ? r.protocolVersion : 4,
  4328. s = e || {},
  4329. a = s.reasonCode,
  4330. c = s.properties,
  4331. u = 5 === o ? 1 : 0,
  4332. l = null;
  4333. if (5 === o) {
  4334. if (!(l = C(t, c, r, u))) return !1;
  4335. u += l.length
  4336. }
  4337. t.write(i.from([n.codes.disconnect << 4])), v(t, u), 5 === o && t.write(i.from([a]));
  4338. null !== l && l.write();
  4339. return !0
  4340. }(e, t, r);
  4341. case "auth":
  4342. return function (e, t, r) {
  4343. var o = r ? r.protocolVersion : 4,
  4344. s = e || {},
  4345. a = s.reasonCode,
  4346. c = s.properties,
  4347. u = 5 === o ? 1 : 0;
  4348. 5 !== o && t.emit("error", new Error("Invalid mqtt version for auth packet"));
  4349. var l = C(t, c, r, u);
  4350. if (!l) return !1;
  4351. u += l.length, t.write(i.from([n.codes.auth << 4])), v(t, u), t.write(i.from([a])), null !== l && l.write();
  4352. return !0
  4353. }(e, t, r);
  4354. default:
  4355. return t.emit("error", new Error("Unknown command")), !1
  4356. }
  4357. }
  4358. function y(e) {
  4359. e.uncork()
  4360. }
  4361. Object.defineProperty(m, "cacheNumbers", {
  4362. get: function () {
  4363. return g === k
  4364. },
  4365. set: function (e) {
  4366. e ? (l && 0 !== Object.keys(l).length || (b = !0), g = k) : (b = !1, g = x)
  4367. }
  4368. });
  4369. var _ = {};
  4370. function v(e, t) {
  4371. var r = _[t];
  4372. r || (r = h(t).data, t < 16384 && (_[t] = r)), u("writeVarByteInt: writing to stream: %o", r), e.write(r)
  4373. }
  4374. function w(e, t) {
  4375. var r = i.byteLength(t);
  4376. return g(e, r), u("writeString: %s", t), e.write(t, "utf8")
  4377. }
  4378. function S(e, t, r) {
  4379. w(e, t), w(e, r)
  4380. }
  4381. function k(e, t) {
  4382. return u("writeNumberCached: number: %d", t), u("writeNumberCached: %o", l[t]), e.write(l[t])
  4383. }
  4384. function x(e, t) {
  4385. var r = f(t);
  4386. return u("writeNumberGenerated: %o", r), e.write(r)
  4387. }
  4388. function E(e, t) {
  4389. "string" == typeof t ? w(e, t) : t ? (g(e, t.length), e.write(t)) : g(e, 0)
  4390. }
  4391. function I(e, t) {
  4392. if ("object" != typeof t || null != t.length) return {
  4393. length: 1,
  4394. write: function () {
  4395. j(e, {}, 0)
  4396. }
  4397. };
  4398. var r = 0;
  4399. function o(t, r) {
  4400. var o = 0;
  4401. switch (n.propertiesTypes[t]) {
  4402. case "byte":
  4403. if ("boolean" != typeof r) return e.emit("error", new Error("Invalid " + t + ": " + r)), !1;
  4404. o += 2;
  4405. break;
  4406. case "int8":
  4407. if ("number" != typeof r || r < 0 || r > 255) return e.emit("error", new Error("Invalid " + t + ": " + r)), !1;
  4408. o += 2;
  4409. break;
  4410. case "binary":
  4411. if (r && null === r) return e.emit("error", new Error("Invalid " + t + ": " + r)), !1;
  4412. o += 1 + i.byteLength(r) + 2;
  4413. break;
  4414. case "int16":
  4415. if ("number" != typeof r || r < 0 || r > 65535) return e.emit("error", new Error("Invalid " + t + ": " + r)), !1;
  4416. o += 3;
  4417. break;
  4418. case "int32":
  4419. if ("number" != typeof r || r < 0 || r > 4294967295) return e.emit("error", new Error("Invalid " + t + ": " + r)), !1;
  4420. o += 5;
  4421. break;
  4422. case "var":
  4423. if ("number" != typeof r || r < 0 || r > 4294967295) return e.emit("error", new Error("Invalid " + t + ": " + r)), !1;
  4424. o += 1 + h(r).length;
  4425. break;
  4426. case "string":
  4427. if ("string" != typeof r) return e.emit("error", new Error("Invalid " + t + ": " + r)), !1;
  4428. o += 3 + i.byteLength(r.toString());
  4429. break;
  4430. case "pair":
  4431. if ("object" != typeof r) return e.emit("error", new Error("Invalid " + t + ": " + r)), !1;
  4432. o += Object.getOwnPropertyNames(r).reduce(function (e, t) {
  4433. var n = r[t];
  4434. return Array.isArray(n) ? e += n.reduce(function (e, r) {
  4435. return e += 3 + i.byteLength(t.toString()) + 2 + i.byteLength(r.toString())
  4436. }, 0) : e += 3 + i.byteLength(t.toString()) + 2 + i.byteLength(r[t].toString()), e
  4437. }, 0);
  4438. break;
  4439. default:
  4440. return e.emit("error", new Error("Invalid property " + t + ": " + r)), !1
  4441. }
  4442. return o
  4443. }
  4444. if (t)
  4445. for (var s in t) {
  4446. var a = 0,
  4447. c = 0,
  4448. u = t[s];
  4449. if (Array.isArray(u))
  4450. for (var l = 0; l < u.length; l++) {
  4451. if (!(c = o(s, u[l]))) return !1;
  4452. a += c
  4453. } else {
  4454. if (!(c = o(s, u))) return !1;
  4455. a = c
  4456. }
  4457. if (!a) return !1;
  4458. r += a
  4459. }
  4460. return {
  4461. length: h(r).length + r,
  4462. write: function () {
  4463. j(e, t, r)
  4464. }
  4465. }
  4466. }
  4467. function C(e, t, r, n) {
  4468. var i = ["reasonString", "userProperties"],
  4469. o = r && r.properties && r.properties.maximumPacketSize ? r.properties.maximumPacketSize : 0,
  4470. s = I(e, t);
  4471. if (o)
  4472. for (; n + s.length > o;) {
  4473. var a = i.shift();
  4474. if (!a || !t[a]) return !1;
  4475. delete t[a], s = I(e, t)
  4476. }
  4477. return s
  4478. }
  4479. function O(e, t, r) {
  4480. switch (n.propertiesTypes[t]) {
  4481. case "byte":
  4482. e.write(i.from([n.properties[t]])), e.write(i.from([+r]));
  4483. break;
  4484. case "int8":
  4485. e.write(i.from([n.properties[t]])), e.write(i.from([r]));
  4486. break;
  4487. case "binary":
  4488. e.write(i.from([n.properties[t]])), E(e, r);
  4489. break;
  4490. case "int16":
  4491. e.write(i.from([n.properties[t]])), g(e, r);
  4492. break;
  4493. case "int32":
  4494. e.write(i.from([n.properties[t]])),
  4495. function (e, t) {
  4496. var r = d(t);
  4497. u("write4ByteNumber: %o", r), e.write(r)
  4498. }(e, r);
  4499. break;
  4500. case "var":
  4501. e.write(i.from([n.properties[t]])), v(e, r);
  4502. break;
  4503. case "string":
  4504. e.write(i.from([n.properties[t]])), w(e, r);
  4505. break;
  4506. case "pair":
  4507. Object.getOwnPropertyNames(r).forEach(function (o) {
  4508. var s = r[o];
  4509. Array.isArray(s) ? s.forEach(function (r) {
  4510. e.write(i.from([n.properties[t]])), S(e, o.toString(), r.toString())
  4511. }) : (e.write(i.from([n.properties[t]])), S(e, o.toString(), s.toString()))
  4512. });
  4513. break;
  4514. default:
  4515. return e.emit("error", new Error("Invalid property " + t + " value: " + r)), !1
  4516. }
  4517. }
  4518. function j(e, t, r) {
  4519. for (var n in v(e, r), t)
  4520. if (t.hasOwnProperty(n) && null !== t[n]) {
  4521. var i = t[n];
  4522. if (Array.isArray(i))
  4523. for (var o = 0; o < i.length; o++) O(e, n, i[o]);
  4524. else O(e, n, i)
  4525. }
  4526. }
  4527. function A(e) {
  4528. return e ? e instanceof i ? e.length : i.byteLength(e) : 0
  4529. }
  4530. function T(e) {
  4531. return "string" == typeof e || e instanceof i
  4532. }
  4533. t.exports = m
  4534. }, {
  4535. "./constants": 91,
  4536. "./numbers": 94,
  4537. debug: 17,
  4538. "process-nextick-args": 100,
  4539. "safe-buffer": 117
  4540. }],
  4541. 98: [function (e, t, r) {
  4542. var n = 1e3,
  4543. i = 60 * n,
  4544. o = 60 * i,
  4545. s = 24 * o,
  4546. a = 7 * s,
  4547. c = 365.25 * s;
  4548. function u(e, t, r, n) {
  4549. var i = t >= 1.5 * r;
  4550. return Math.round(e / r) + " " + n + (i ? "s" : "")
  4551. }
  4552. t.exports = function (e, t) {
  4553. t = t || {};
  4554. var r = typeof e;
  4555. if ("string" === r && e.length > 0) return function (e) {
  4556. if ((e = String(e)).length > 100) return;
  4557. var t = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);
  4558. if (!t) return;
  4559. var r = parseFloat(t[1]);
  4560. switch ((t[2] || "ms").toLowerCase()) {
  4561. case "years":
  4562. case "year":
  4563. case "yrs":
  4564. case "yr":
  4565. case "y":
  4566. return r * c;
  4567. case "weeks":
  4568. case "week":
  4569. case "w":
  4570. return r * a;
  4571. case "days":
  4572. case "day":
  4573. case "d":
  4574. return r * s;
  4575. case "hours":
  4576. case "hour":
  4577. case "hrs":
  4578. case "hr":
  4579. case "h":
  4580. return r * o;
  4581. case "minutes":
  4582. case "minute":
  4583. case "mins":
  4584. case "min":
  4585. case "m":
  4586. return r * i;
  4587. case "seconds":
  4588. case "second":
  4589. case "secs":
  4590. case "sec":
  4591. case "s":
  4592. return r * n;
  4593. case "milliseconds":
  4594. case "millisecond":
  4595. case "msecs":
  4596. case "msec":
  4597. case "ms":
  4598. return r;
  4599. default:
  4600. return
  4601. }
  4602. }(e);
  4603. if ("number" === r && isFinite(e)) return t.long ? function (e) {
  4604. var t = Math.abs(e);
  4605. if (t >= s) return u(e, t, s, "day");
  4606. if (t >= o) return u(e, t, o, "hour");
  4607. if (t >= i) return u(e, t, i, "minute");
  4608. if (t >= n) return u(e, t, n, "second");
  4609. return e + " ms"
  4610. }(e) : function (e) {
  4611. var t = Math.abs(e);
  4612. if (t >= s) return Math.round(e / s) + "d";
  4613. if (t >= o) return Math.round(e / o) + "h";
  4614. if (t >= i) return Math.round(e / i) + "m";
  4615. if (t >= n) return Math.round(e / n) + "s";
  4616. return e + "ms"
  4617. }(e);
  4618. throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(e))
  4619. }
  4620. }, {}],
  4621. 99: [function (e, t, r) {
  4622. var n = e("wrappy");
  4623. function i(e) {
  4624. var t = function () {
  4625. return t.called ? t.value : (t.called = !0, t.value = e.apply(this, arguments))
  4626. };
  4627. return t.called = !1, t
  4628. }
  4629. function o(e) {
  4630. var t = function () {
  4631. if (t.called) throw new Error(t.onceError);
  4632. return t.called = !0, t.value = e.apply(this, arguments)
  4633. },
  4634. r = e.name || "Function wrapped with `once`";
  4635. return t.onceError = r + " shouldn't be called more than once", t.called = !1, t
  4636. }
  4637. t.exports = n(i), t.exports.strict = n(o), i.proto = i(function () {
  4638. Object.defineProperty(Function.prototype, "once", {
  4639. value: function () {
  4640. return i(this)
  4641. },
  4642. configurable: !0
  4643. }), Object.defineProperty(Function.prototype, "onceStrict", {
  4644. value: function () {
  4645. return o(this)
  4646. },
  4647. configurable: !0
  4648. })
  4649. })
  4650. }, {
  4651. wrappy: 138
  4652. }],
  4653. 100: [function (e, t, r) {
  4654. (function (e) {
  4655. "use strict";
  4656. void 0 === e || !e.version || 0 === e.version.indexOf("v0.") || 0 === e.version.indexOf("v1.") && 0 !== e.version.indexOf("v1.8.") ? t.exports = {
  4657. nextTick: function (t, r, n, i) {
  4658. if ("function" != typeof t) throw new TypeError('"callback" argument must be a function');
  4659. var o, s, a = arguments.length;
  4660. switch (a) {
  4661. case 0:
  4662. case 1:
  4663. return e.nextTick(t);
  4664. case 2:
  4665. return e.nextTick(function () {
  4666. t.call(null, r)
  4667. });
  4668. case 3:
  4669. return e.nextTick(function () {
  4670. t.call(null, r, n)
  4671. });
  4672. case 4:
  4673. return e.nextTick(function () {
  4674. t.call(null, r, n, i)
  4675. });
  4676. default:
  4677. for (o = new Array(a - 1), s = 0; s < o.length;) o[s++] = arguments[s];
  4678. return e.nextTick(function () {
  4679. t.apply(null, o)
  4680. })
  4681. }
  4682. }
  4683. } : t.exports = e
  4684. }).call(this, e("_process"))
  4685. }, {
  4686. _process: 101
  4687. }],
  4688. 101: [function (e, t, r) {
  4689. var n, i, o = t.exports = {};
  4690. function s() {
  4691. throw new Error("setTimeout has not been defined")
  4692. }
  4693. function a() {
  4694. throw new Error("clearTimeout has not been defined")
  4695. }
  4696. function c(e) {
  4697. if (n === setTimeout) return setTimeout(e, 0);
  4698. if ((n === s || !n) && setTimeout) return n = setTimeout, setTimeout(e, 0);
  4699. try {
  4700. return n(e, 0)
  4701. } catch (t) {
  4702. try {
  4703. return n.call(null, e, 0)
  4704. } catch (t) {
  4705. return n.call(this, e, 0)
  4706. }
  4707. }
  4708. }! function () {
  4709. try {
  4710. n = "function" == typeof setTimeout ? setTimeout : s
  4711. } catch (e) {
  4712. n = s
  4713. }
  4714. try {
  4715. i = "function" == typeof clearTimeout ? clearTimeout : a
  4716. } catch (e) {
  4717. i = a
  4718. }
  4719. }();
  4720. var u, l = [],
  4721. f = !1,
  4722. p = -1;
  4723. function h() {
  4724. f && u && (f = !1, u.length ? l = u.concat(l) : p = -1, l.length && d())
  4725. }
  4726. function d() {
  4727. if (!f) {
  4728. var e = c(h);
  4729. f = !0;
  4730. for (var t = l.length; t;) {
  4731. for (u = l, l = []; ++p < t;) u && u[p].run();
  4732. p = -1, t = l.length
  4733. }
  4734. u = null, f = !1,
  4735. function (e) {
  4736. if (i === clearTimeout) return clearTimeout(e);
  4737. if ((i === a || !i) && clearTimeout) return i = clearTimeout, clearTimeout(e);
  4738. try {
  4739. i(e)
  4740. } catch (t) {
  4741. try {
  4742. return i.call(null, e)
  4743. } catch (t) {
  4744. return i.call(this, e)
  4745. }
  4746. }
  4747. }(e)
  4748. }
  4749. }
  4750. function g(e, t) {
  4751. this.fun = e, this.array = t
  4752. }
  4753. function b() {}
  4754. o.nextTick = function (e) {
  4755. var t = new Array(arguments.length - 1);
  4756. if (arguments.length > 1)
  4757. for (var r = 1; r < arguments.length; r++) t[r - 1] = arguments[r];
  4758. l.push(new g(e, t)), 1 !== l.length || f || c(d)
  4759. }, g.prototype.run = function () {
  4760. this.fun.apply(null, this.array)
  4761. }, o.title = "browser", o.browser = !0, o.env = {}, o.argv = [], o.version = "", o.versions = {}, o.on = b, o.addListener = b, o.once = b, o.off = b, o.removeListener = b, o.removeAllListeners = b, o.emit = b, o.prependListener = b, o.prependOnceListener = b, o.listeners = function (e) {
  4762. return []
  4763. }, o.binding = function (e) {
  4764. throw new Error("process.binding is not supported")
  4765. }, o.cwd = function () {
  4766. return "/"
  4767. }, o.chdir = function (e) {
  4768. throw new Error("process.chdir is not supported")
  4769. }, o.umask = function () {
  4770. return 0
  4771. }
  4772. }, {}],
  4773. 102: [function (e, t, r) {
  4774. (function (e) {
  4775. ! function (n) {
  4776. var i = "object" == typeof r && r && !r.nodeType && r,
  4777. o = "object" == typeof t && t && !t.nodeType && t,
  4778. s = "object" == typeof e && e;
  4779. s.global !== s && s.window !== s && s.self !== s || (n = s);
  4780. var a, c, u = 2147483647,
  4781. l = 36,
  4782. f = 1,
  4783. p = 26,
  4784. h = 38,
  4785. d = 700,
  4786. g = 72,
  4787. b = 128,
  4788. m = "-",
  4789. y = /^xn--/,
  4790. _ = /[^\x20-\x7E]/,
  4791. v = /[\x2E\u3002\uFF0E\uFF61]/g,
  4792. w = {
  4793. overflow: "Overflow: input needs wider integers to process",
  4794. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  4795. "invalid-input": "Invalid input"
  4796. },
  4797. S = l - f,
  4798. k = Math.floor,
  4799. x = String.fromCharCode;
  4800. function E(e) {
  4801. throw new RangeError(w[e])
  4802. }
  4803. function I(e, t) {
  4804. for (var r = e.length, n = []; r--;) n[r] = t(e[r]);
  4805. return n
  4806. }
  4807. function C(e, t) {
  4808. var r = e.split("@"),
  4809. n = "";
  4810. return r.length > 1 && (n = r[0] + "@", e = r[1]), n + I((e = e.replace(v, ".")).split("."), t).join(".")
  4811. }
  4812. function O(e) {
  4813. for (var t, r, n = [], i = 0, o = e.length; i < o;)(t = e.charCodeAt(i++)) >= 55296 && t <= 56319 && i < o ? 56320 == (64512 & (r = e.charCodeAt(i++))) ? n.push(((1023 & t) << 10) + (1023 & r) + 65536) : (n.push(t), i--) : n.push(t);
  4814. return n
  4815. }
  4816. function j(e) {
  4817. return I(e, function (e) {
  4818. var t = "";
  4819. return e > 65535 && (t += x((e -= 65536) >>> 10 & 1023 | 55296), e = 56320 | 1023 & e), t += x(e)
  4820. }).join("")
  4821. }
  4822. function A(e, t) {
  4823. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  4824. }
  4825. function T(e, t, r) {
  4826. var n = 0;
  4827. for (e = r ? k(e / d) : e >> 1, e += k(e / t); e > S * p >> 1; n += l) e = k(e / S);
  4828. return k(n + (S + 1) * e / (e + h))
  4829. }
  4830. function P(e) {
  4831. var t, r, n, i, o, s, a, c, h, d, y, _ = [],
  4832. v = e.length,
  4833. w = 0,
  4834. S = b,
  4835. x = g;
  4836. for ((r = e.lastIndexOf(m)) < 0 && (r = 0), n = 0; n < r; ++n) e.charCodeAt(n) >= 128 && E("not-basic"), _.push(e.charCodeAt(n));
  4837. for (i = r > 0 ? r + 1 : 0; i < v;) {
  4838. for (o = w, s = 1, a = l; i >= v && E("invalid-input"), ((c = (y = e.charCodeAt(i++)) - 48 < 10 ? y - 22 : y - 65 < 26 ? y - 65 : y - 97 < 26 ? y - 97 : l) >= l || c > k((u - w) / s)) && E("overflow"), w += c * s, !(c < (h = a <= x ? f : a >= x + p ? p : a - x)); a += l) s > k(u / (d = l - h)) && E("overflow"), s *= d;
  4839. x = T(w - o, t = _.length + 1, 0 == o), k(w / t) > u - S && E("overflow"), S += k(w / t), w %= t, _.splice(w++, 0, S)
  4840. }
  4841. return j(_)
  4842. }
  4843. function M(e) {
  4844. var t, r, n, i, o, s, a, c, h, d, y, _, v, w, S, I = [];
  4845. for (_ = (e = O(e)).length, t = b, r = 0, o = g, s = 0; s < _; ++s)(y = e[s]) < 128 && I.push(x(y));
  4846. for (n = i = I.length, i && I.push(m); n < _;) {
  4847. for (a = u, s = 0; s < _; ++s)(y = e[s]) >= t && y < a && (a = y);
  4848. for (a - t > k((u - r) / (v = n + 1)) && E("overflow"), r += (a - t) * v, t = a, s = 0; s < _; ++s)
  4849. if ((y = e[s]) < t && ++r > u && E("overflow"), y == t) {
  4850. for (c = r, h = l; !(c < (d = h <= o ? f : h >= o + p ? p : h - o)); h += l) S = c - d, w = l - d, I.push(x(A(d + S % w, 0))), c = k(S / w);
  4851. I.push(x(A(c, 0))), o = T(r, v, n == i), r = 0, ++n
  4852. }++ r, ++t
  4853. }
  4854. return I.join("")
  4855. }
  4856. if (a = {
  4857. version: "1.4.1",
  4858. ucs2: {
  4859. decode: O,
  4860. encode: j
  4861. },
  4862. decode: P,
  4863. encode: M,
  4864. toASCII: function (e) {
  4865. return C(e, function (e) {
  4866. return _.test(e) ? "xn--" + M(e) : e
  4867. })
  4868. },
  4869. toUnicode: function (e) {
  4870. return C(e, function (e) {
  4871. return y.test(e) ? P(e.slice(4).toLowerCase()) : e
  4872. })
  4873. }
  4874. }, i && o)
  4875. if (t.exports == i) o.exports = a;
  4876. else
  4877. for (c in a) a.hasOwnProperty(c) && (i[c] = a[c]);
  4878. else n.punycode = a
  4879. }(this)
  4880. }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  4881. }, {}],
  4882. 103: [function (e, t, r) {
  4883. "use strict";
  4884. function n(e, t) {
  4885. return Object.prototype.hasOwnProperty.call(e, t)
  4886. }
  4887. t.exports = function (e, t, r, o) {
  4888. t = t || "&", r = r || "=";
  4889. var s = {};
  4890. if ("string" != typeof e || 0 === e.length) return s;
  4891. var a = /\+/g;
  4892. e = e.split(t);
  4893. var c = 1e3;
  4894. o && "number" == typeof o.maxKeys && (c = o.maxKeys);
  4895. var u = e.length;
  4896. c > 0 && u > c && (u = c);
  4897. for (var l = 0; l < u; ++l) {
  4898. var f, p, h, d, g = e[l].replace(a, "%20"),
  4899. b = g.indexOf(r);
  4900. b >= 0 ? (f = g.substr(0, b), p = g.substr(b + 1)) : (f = g, p = ""), h = decodeURIComponent(f), d = decodeURIComponent(p), n(s, h) ? i(s[h]) ? s[h].push(d) : s[h] = [s[h], d] : s[h] = d
  4901. }
  4902. return s
  4903. };
  4904. var i = Array.isArray || function (e) {
  4905. return "[object Array]" === Object.prototype.toString.call(e)
  4906. }
  4907. }, {}],
  4908. 104: [function (e, t, r) {
  4909. "use strict";
  4910. var n = function (e) {
  4911. switch (typeof e) {
  4912. case "string":
  4913. return e;
  4914. case "boolean":
  4915. return e ? "true" : "false";
  4916. case "number":
  4917. return isFinite(e) ? e : "";
  4918. default:
  4919. return ""
  4920. }
  4921. };
  4922. t.exports = function (e, t, r, a) {
  4923. return t = t || "&", r = r || "=", null === e && (e = void 0), "object" == typeof e ? o(s(e), function (s) {
  4924. var a = encodeURIComponent(n(s)) + r;
  4925. return i(e[s]) ? o(e[s], function (e) {
  4926. return a + encodeURIComponent(n(e))
  4927. }).join(t) : a + encodeURIComponent(n(e[s]))
  4928. }).join(t) : a ? encodeURIComponent(n(a)) + r + encodeURIComponent(n(e)) : ""
  4929. };
  4930. var i = Array.isArray || function (e) {
  4931. return "[object Array]" === Object.prototype.toString.call(e)
  4932. };
  4933. function o(e, t) {
  4934. if (e.map) return e.map(t);
  4935. for (var r = [], n = 0; n < e.length; n++) r.push(t(e[n], n));
  4936. return r
  4937. }
  4938. var s = Object.keys || function (e) {
  4939. var t = [];
  4940. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.push(r);
  4941. return t
  4942. }
  4943. }, {}],
  4944. 105: [function (e, t, r) {
  4945. "use strict";
  4946. r.decode = r.parse = e("./decode"), r.encode = r.stringify = e("./encode")
  4947. }, {
  4948. "./decode": 103,
  4949. "./encode": 104
  4950. }],
  4951. 106: [function (e, t, r) {
  4952. t.exports = e("./lib/_stream_duplex.js")
  4953. }, {
  4954. "./lib/_stream_duplex.js": 107
  4955. }],
  4956. 107: [function (e, t, r) {
  4957. "use strict";
  4958. var n = e("process-nextick-args"),
  4959. i = Object.keys || function (e) {
  4960. var t = [];
  4961. for (var r in e) t.push(r);
  4962. return t
  4963. };
  4964. t.exports = f;
  4965. var o = Object.create(e("core-util-is"));
  4966. o.inherits = e("inherits");
  4967. var s = e("./_stream_readable"),
  4968. a = e("./_stream_writable");
  4969. o.inherits(f, s);
  4970. for (var c = i(a.prototype), u = 0; u < c.length; u++) {
  4971. var l = c[u];
  4972. f.prototype[l] || (f.prototype[l] = a.prototype[l])
  4973. }
  4974. function f(e) {
  4975. if (!(this instanceof f)) return new f(e);
  4976. s.call(this, e), a.call(this, e), e && !1 === e.readable && (this.readable = !1), e && !1 === e.writable && (this.writable = !1), this.allowHalfOpen = !0, e && !1 === e.allowHalfOpen && (this.allowHalfOpen = !1), this.once("end", p)
  4977. }
  4978. function p() {
  4979. this.allowHalfOpen || this._writableState.ended || n.nextTick(h, this)
  4980. }
  4981. function h(e) {
  4982. e.end()
  4983. }
  4984. Object.defineProperty(f.prototype, "writableHighWaterMark", {
  4985. enumerable: !1,
  4986. get: function () {
  4987. return this._writableState.highWaterMark
  4988. }
  4989. }), Object.defineProperty(f.prototype, "destroyed", {
  4990. get: function () {
  4991. return void 0 !== this._readableState && void 0 !== this._writableState && (this._readableState.destroyed && this._writableState.destroyed)
  4992. },
  4993. set: function (e) {
  4994. void 0 !== this._readableState && void 0 !== this._writableState && (this._readableState.destroyed = e, this._writableState.destroyed = e)
  4995. }
  4996. }), f.prototype._destroy = function (e, t) {
  4997. this.push(null), this.end(), n.nextTick(t, e)
  4998. }
  4999. }, {
  5000. "./_stream_readable": 109,
  5001. "./_stream_writable": 111,
  5002. "core-util-is": 14,
  5003. inherits: 88,
  5004. "process-nextick-args": 100
  5005. }],
  5006. 108: [function (e, t, r) {
  5007. "use strict";
  5008. t.exports = o;
  5009. var n = e("./_stream_transform"),
  5010. i = Object.create(e("core-util-is"));
  5011. function o(e) {
  5012. if (!(this instanceof o)) return new o(e);
  5013. n.call(this, e)
  5014. }
  5015. i.inherits = e("inherits"), i.inherits(o, n), o.prototype._transform = function (e, t, r) {
  5016. r(null, e)
  5017. }
  5018. }, {
  5019. "./_stream_transform": 110,
  5020. "core-util-is": 14,
  5021. inherits: 88
  5022. }],
  5023. 109: [function (e, t, r) {
  5024. (function (r, n) {
  5025. "use strict";
  5026. var i = e("process-nextick-args");
  5027. t.exports = _;
  5028. var o, s = e("isarray");
  5029. _.ReadableState = y;
  5030. e("events").EventEmitter;
  5031. var a = function (e, t) {
  5032. return e.listeners(t).length
  5033. },
  5034. c = e("./internal/streams/stream"),
  5035. u = e("safe-buffer").Buffer,
  5036. l = n.Uint8Array || function () {};
  5037. var f = Object.create(e("core-util-is"));
  5038. f.inherits = e("inherits");
  5039. var p = e("util"),
  5040. h = void 0;
  5041. h = p && p.debuglog ? p.debuglog("stream") : function () {};
  5042. var d, g = e("./internal/streams/BufferList"),
  5043. b = e("./internal/streams/destroy");
  5044. f.inherits(_, c);
  5045. var m = ["error", "close", "destroy", "pause", "resume"];
  5046. function y(t, r) {
  5047. o = o || e("./_stream_duplex"), t = t || {};
  5048. var n = r instanceof o;
  5049. this.objectMode = !!t.objectMode, n && (this.objectMode = this.objectMode || !!t.readableObjectMode);
  5050. var i = t.highWaterMark,
  5051. s = t.readableHighWaterMark,
  5052. a = this.objectMode ? 16 : 16384;
  5053. this.highWaterMark = i || 0 === i ? i : n && (s || 0 === s) ? s : a, this.highWaterMark = Math.floor(this.highWaterMark), this.buffer = new g, this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.ended = !1, this.endEmitted = !1, this.reading = !1, this.sync = !0, this.needReadable = !1, this.emittedReadable = !1, this.readableListening = !1, this.resumeScheduled = !1, this.destroyed = !1, this.defaultEncoding = t.defaultEncoding || "utf8", this.awaitDrain = 0, this.readingMore = !1, this.decoder = null, this.encoding = null, t.encoding && (d || (d = e("string_decoder/").StringDecoder), this.decoder = new d(t.encoding), this.encoding = t.encoding)
  5054. }
  5055. function _(t) {
  5056. if (o = o || e("./_stream_duplex"), !(this instanceof _)) return new _(t);
  5057. this._readableState = new y(t, this), this.readable = !0, t && ("function" == typeof t.read && (this._read = t.read), "function" == typeof t.destroy && (this._destroy = t.destroy)), c.call(this)
  5058. }
  5059. function v(e, t, r, n, i) {
  5060. var o, s = e._readableState;
  5061. null === t ? (s.reading = !1, function (e, t) {
  5062. if (t.ended) return;
  5063. if (t.decoder) {
  5064. var r = t.decoder.end();
  5065. r && r.length && (t.buffer.push(r), t.length += t.objectMode ? 1 : r.length)
  5066. }
  5067. t.ended = !0, x(e)
  5068. }(e, s)) : (i || (o = function (e, t) {
  5069. var r;
  5070. n = t, u.isBuffer(n) || n instanceof l || "string" == typeof t || void 0 === t || e.objectMode || (r = new TypeError("Invalid non-string/buffer chunk"));
  5071. var n;
  5072. return r
  5073. }(s, t)), o ? e.emit("error", o) : s.objectMode || t && t.length > 0 ? ("string" == typeof t || s.objectMode || Object.getPrototypeOf(t) === u.prototype || (t = function (e) {
  5074. return u.from(e)
  5075. }(t)), n ? s.endEmitted ? e.emit("error", new Error("stream.unshift() after end event")) : w(e, s, t, !0) : s.ended ? e.emit("error", new Error("stream.push() after EOF")) : (s.reading = !1, s.decoder && !r ? (t = s.decoder.write(t), s.objectMode || 0 !== t.length ? w(e, s, t, !1) : I(e, s)) : w(e, s, t, !1))) : n || (s.reading = !1));
  5076. return function (e) {
  5077. return !e.ended && (e.needReadable || e.length < e.highWaterMark || 0 === e.length)
  5078. }(s)
  5079. }
  5080. function w(e, t, r, n) {
  5081. t.flowing && 0 === t.length && !t.sync ? (e.emit("data", r), e.read(0)) : (t.length += t.objectMode ? 1 : r.length, n ? t.buffer.unshift(r) : t.buffer.push(r), t.needReadable && x(e)), I(e, t)
  5082. }
  5083. Object.defineProperty(_.prototype, "destroyed", {
  5084. get: function () {
  5085. return void 0 !== this._readableState && this._readableState.destroyed
  5086. },
  5087. set: function (e) {
  5088. this._readableState && (this._readableState.destroyed = e)
  5089. }
  5090. }), _.prototype.destroy = b.destroy, _.prototype._undestroy = b.undestroy, _.prototype._destroy = function (e, t) {
  5091. this.push(null), t(e)
  5092. }, _.prototype.push = function (e, t) {
  5093. var r, n = this._readableState;
  5094. return n.objectMode ? r = !0 : "string" == typeof e && ((t = t || n.defaultEncoding) !== n.encoding && (e = u.from(e, t), t = ""), r = !0), v(this, e, t, !1, r)
  5095. }, _.prototype.unshift = function (e) {
  5096. return v(this, e, null, !0, !1)
  5097. }, _.prototype.isPaused = function () {
  5098. return !1 === this._readableState.flowing
  5099. }, _.prototype.setEncoding = function (t) {
  5100. return d || (d = e("string_decoder/").StringDecoder), this._readableState.decoder = new d(t), this._readableState.encoding = t, this
  5101. };
  5102. var S = 8388608;
  5103. function k(e, t) {
  5104. return e <= 0 || 0 === t.length && t.ended ? 0 : t.objectMode ? 1 : e != e ? t.flowing && t.length ? t.buffer.head.data.length : t.length : (e > t.highWaterMark && (t.highWaterMark = function (e) {
  5105. return e >= S ? e = S : (e--, e |= e >>> 1, e |= e >>> 2, e |= e >>> 4, e |= e >>> 8, e |= e >>> 16, e++), e
  5106. }(e)), e <= t.length ? e : t.ended ? t.length : (t.needReadable = !0, 0))
  5107. }
  5108. function x(e) {
  5109. var t = e._readableState;
  5110. t.needReadable = !1, t.emittedReadable || (h("emitReadable", t.flowing), t.emittedReadable = !0, t.sync ? i.nextTick(E, e) : E(e))
  5111. }
  5112. function E(e) {
  5113. h("emit readable"), e.emit("readable"), A(e)
  5114. }
  5115. function I(e, t) {
  5116. t.readingMore || (t.readingMore = !0, i.nextTick(C, e, t))
  5117. }
  5118. function C(e, t) {
  5119. for (var r = t.length; !t.reading && !t.flowing && !t.ended && t.length < t.highWaterMark && (h("maybeReadMore read 0"), e.read(0), r !== t.length);) r = t.length;
  5120. t.readingMore = !1
  5121. }
  5122. function O(e) {
  5123. h("readable nexttick read 0"), e.read(0)
  5124. }
  5125. function j(e, t) {
  5126. t.reading || (h("resume read 0"), e.read(0)), t.resumeScheduled = !1, t.awaitDrain = 0, e.emit("resume"), A(e), t.flowing && !t.reading && e.read(0)
  5127. }
  5128. function A(e) {
  5129. var t = e._readableState;
  5130. for (h("flow", t.flowing); t.flowing && null !== e.read(););
  5131. }
  5132. function T(e, t) {
  5133. return 0 === t.length ? null : (t.objectMode ? r = t.buffer.shift() : !e || e >= t.length ? (r = t.decoder ? t.buffer.join("") : 1 === t.buffer.length ? t.buffer.head.data : t.buffer.concat(t.length), t.buffer.clear()) : r = function (e, t, r) {
  5134. var n;
  5135. e < t.head.data.length ? (n = t.head.data.slice(0, e), t.head.data = t.head.data.slice(e)) : n = e === t.head.data.length ? t.shift() : r ? function (e, t) {
  5136. var r = t.head,
  5137. n = 1,
  5138. i = r.data;
  5139. e -= i.length;
  5140. for (; r = r.next;) {
  5141. var o = r.data,
  5142. s = e > o.length ? o.length : e;
  5143. if (s === o.length ? i += o : i += o.slice(0, e), 0 === (e -= s)) {
  5144. s === o.length ? (++n, r.next ? t.head = r.next : t.head = t.tail = null) : (t.head = r, r.data = o.slice(s));
  5145. break
  5146. }++n
  5147. }
  5148. return t.length -= n, i
  5149. }(e, t) : function (e, t) {
  5150. var r = u.allocUnsafe(e),
  5151. n = t.head,
  5152. i = 1;
  5153. n.data.copy(r), e -= n.data.length;
  5154. for (; n = n.next;) {
  5155. var o = n.data,
  5156. s = e > o.length ? o.length : e;
  5157. if (o.copy(r, r.length - e, 0, s), 0 === (e -= s)) {
  5158. s === o.length ? (++i, n.next ? t.head = n.next : t.head = t.tail = null) : (t.head = n, n.data = o.slice(s));
  5159. break
  5160. }++i
  5161. }
  5162. return t.length -= i, r
  5163. }(e, t);
  5164. return n
  5165. }(e, t.buffer, t.decoder), r);
  5166. var r
  5167. }
  5168. function P(e) {
  5169. var t = e._readableState;
  5170. if (t.length > 0) throw new Error('"endReadable()" called on non-empty stream');
  5171. t.endEmitted || (t.ended = !0, i.nextTick(M, t, e))
  5172. }
  5173. function M(e, t) {
  5174. e.endEmitted || 0 !== e.length || (e.endEmitted = !0, t.readable = !1, t.emit("end"))
  5175. }
  5176. function B(e, t) {
  5177. for (var r = 0, n = e.length; r < n; r++)
  5178. if (e[r] === t) return r;
  5179. return -1
  5180. }
  5181. _.prototype.read = function (e) {
  5182. h("read", e), e = parseInt(e, 10);
  5183. var t = this._readableState,
  5184. r = e;
  5185. if (0 !== e && (t.emittedReadable = !1), 0 === e && t.needReadable && (t.length >= t.highWaterMark || t.ended)) return h("read: emitReadable", t.length, t.ended), 0 === t.length && t.ended ? P(this) : x(this), null;
  5186. if (0 === (e = k(e, t)) && t.ended) return 0 === t.length && P(this), null;
  5187. var n, i = t.needReadable;
  5188. return h("need readable", i), (0 === t.length || t.length - e < t.highWaterMark) && h("length less than watermark", i = !0), t.ended || t.reading ? h("reading or ended", i = !1) : i && (h("do read"), t.reading = !0, t.sync = !0, 0 === t.length && (t.needReadable = !0), this._read(t.highWaterMark), t.sync = !1, t.reading || (e = k(r, t))), null === (n = e > 0 ? T(e, t) : null) ? (t.needReadable = !0, e = 0) : t.length -= e, 0 === t.length && (t.ended || (t.needReadable = !0), r !== e && t.ended && P(this)), null !== n && this.emit("data", n), n
  5189. }, _.prototype._read = function (e) {
  5190. this.emit("error", new Error("_read() is not implemented"))
  5191. }, _.prototype.pipe = function (e, t) {
  5192. var n = this,
  5193. o = this._readableState;
  5194. switch (o.pipesCount) {
  5195. case 0:
  5196. o.pipes = e;
  5197. break;
  5198. case 1:
  5199. o.pipes = [o.pipes, e];
  5200. break;
  5201. default:
  5202. o.pipes.push(e)
  5203. }
  5204. o.pipesCount += 1, h("pipe count=%d opts=%j", o.pipesCount, t);
  5205. var c = (!t || !1 !== t.end) && e !== r.stdout && e !== r.stderr ? l : _;
  5206. function u(t, r) {
  5207. h("onunpipe"), t === n && r && !1 === r.hasUnpiped && (r.hasUnpiped = !0, h("cleanup"), e.removeListener("close", m), e.removeListener("finish", y), e.removeListener("drain", f), e.removeListener("error", b), e.removeListener("unpipe", u), n.removeListener("end", l), n.removeListener("end", _), n.removeListener("data", g), p = !0, !o.awaitDrain || e._writableState && !e._writableState.needDrain || f())
  5208. }
  5209. function l() {
  5210. h("onend"), e.end()
  5211. }
  5212. o.endEmitted ? i.nextTick(c) : n.once("end", c), e.on("unpipe", u);
  5213. var f = function (e) {
  5214. return function () {
  5215. var t = e._readableState;
  5216. h("pipeOnDrain", t.awaitDrain), t.awaitDrain && t.awaitDrain--, 0 === t.awaitDrain && a(e, "data") && (t.flowing = !0, A(e))
  5217. }
  5218. }(n);
  5219. e.on("drain", f);
  5220. var p = !1;
  5221. var d = !1;
  5222. function g(t) {
  5223. h("ondata"), d = !1, !1 !== e.write(t) || d || ((1 === o.pipesCount && o.pipes === e || o.pipesCount > 1 && -1 !== B(o.pipes, e)) && !p && (h("false write response, pause", n._readableState.awaitDrain), n._readableState.awaitDrain++, d = !0), n.pause())
  5224. }
  5225. function b(t) {
  5226. h("onerror", t), _(), e.removeListener("error", b), 0 === a(e, "error") && e.emit("error", t)
  5227. }
  5228. function m() {
  5229. e.removeListener("finish", y), _()
  5230. }
  5231. function y() {
  5232. h("onfinish"), e.removeListener("close", m), _()
  5233. }
  5234. function _() {
  5235. h("unpipe"), n.unpipe(e)
  5236. }
  5237. return n.on("data", g),
  5238. function (e, t, r) {
  5239. if ("function" == typeof e.prependListener) return e.prependListener(t, r);
  5240. e._events && e._events[t] ? s(e._events[t]) ? e._events[t].unshift(r) : e._events[t] = [r, e._events[t]] : e.on(t, r)
  5241. }(e, "error", b), e.once("close", m), e.once("finish", y), e.emit("pipe", n), o.flowing || (h("pipe resume"), n.resume()), e
  5242. }, _.prototype.unpipe = function (e) {
  5243. var t = this._readableState,
  5244. r = {
  5245. hasUnpiped: !1
  5246. };
  5247. if (0 === t.pipesCount) return this;
  5248. if (1 === t.pipesCount) return e && e !== t.pipes ? this : (e || (e = t.pipes), t.pipes = null, t.pipesCount = 0, t.flowing = !1, e && e.emit("unpipe", this, r), this);
  5249. if (!e) {
  5250. var n = t.pipes,
  5251. i = t.pipesCount;
  5252. t.pipes = null, t.pipesCount = 0, t.flowing = !1;
  5253. for (var o = 0; o < i; o++) n[o].emit("unpipe", this, r);
  5254. return this
  5255. }
  5256. var s = B(t.pipes, e);
  5257. return -1 === s ? this : (t.pipes.splice(s, 1), t.pipesCount -= 1, 1 === t.pipesCount && (t.pipes = t.pipes[0]), e.emit("unpipe", this, r), this)
  5258. }, _.prototype.on = function (e, t) {
  5259. var r = c.prototype.on.call(this, e, t);
  5260. if ("data" === e) !1 !== this._readableState.flowing && this.resume();
  5261. else if ("readable" === e) {
  5262. var n = this._readableState;
  5263. n.endEmitted || n.readableListening || (n.readableListening = n.needReadable = !0, n.emittedReadable = !1, n.reading ? n.length && x(this) : i.nextTick(O, this))
  5264. }
  5265. return r
  5266. }, _.prototype.addListener = _.prototype.on, _.prototype.resume = function () {
  5267. var e = this._readableState;
  5268. return e.flowing || (h("resume"), e.flowing = !0, function (e, t) {
  5269. t.resumeScheduled || (t.resumeScheduled = !0, i.nextTick(j, e, t))
  5270. }(this, e)), this
  5271. }, _.prototype.pause = function () {
  5272. return h("call pause flowing=%j", this._readableState.flowing), !1 !== this._readableState.flowing && (h("pause"), this._readableState.flowing = !1, this.emit("pause")), this
  5273. }, _.prototype.wrap = function (e) {
  5274. var t = this,
  5275. r = this._readableState,
  5276. n = !1;
  5277. for (var i in e.on("end", function () {
  5278. if (h("wrapped end"), r.decoder && !r.ended) {
  5279. var e = r.decoder.end();
  5280. e && e.length && t.push(e)
  5281. }
  5282. t.push(null)
  5283. }), e.on("data", function (i) {
  5284. (h("wrapped data"), r.decoder && (i = r.decoder.write(i)), !r.objectMode || null !== i && void 0 !== i) && ((r.objectMode || i && i.length) && (t.push(i) || (n = !0, e.pause())))
  5285. }), e) void 0 === this[i] && "function" == typeof e[i] && (this[i] = function (t) {
  5286. return function () {
  5287. return e[t].apply(e, arguments)
  5288. }
  5289. }(i));
  5290. for (var o = 0; o < m.length; o++) e.on(m[o], this.emit.bind(this, m[o]));
  5291. return this._read = function (t) {
  5292. h("wrapped _read", t), n && (n = !1, e.resume())
  5293. }, this
  5294. }, Object.defineProperty(_.prototype, "readableHighWaterMark", {
  5295. enumerable: !1,
  5296. get: function () {
  5297. return this._readableState.highWaterMark
  5298. }
  5299. }), _._fromList = T
  5300. }).call(this, e("_process"), "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  5301. }, {
  5302. "./_stream_duplex": 107,
  5303. "./internal/streams/BufferList": 112,
  5304. "./internal/streams/destroy": 113,
  5305. "./internal/streams/stream": 114,
  5306. _process: 101,
  5307. "core-util-is": 14,
  5308. events: 83,
  5309. inherits: 88,
  5310. isarray: 90,
  5311. "process-nextick-args": 100,
  5312. "safe-buffer": 117,
  5313. "string_decoder/": 119,
  5314. util: 12
  5315. }],
  5316. 110: [function (e, t, r) {
  5317. "use strict";
  5318. t.exports = o;
  5319. var n = e("./_stream_duplex"),
  5320. i = Object.create(e("core-util-is"));
  5321. function o(e) {
  5322. if (!(this instanceof o)) return new o(e);
  5323. n.call(this, e), this._transformState = {
  5324. afterTransform: function (e, t) {
  5325. var r = this._transformState;
  5326. r.transforming = !1;
  5327. var n = r.writecb;
  5328. if (!n) return this.emit("error", new Error("write callback called multiple times"));
  5329. r.writechunk = null, r.writecb = null, null != t && this.push(t), n(e);
  5330. var i = this._readableState;
  5331. i.reading = !1, (i.needReadable || i.length < i.highWaterMark) && this._read(i.highWaterMark)
  5332. }.bind(this),
  5333. needTransform: !1,
  5334. transforming: !1,
  5335. writecb: null,
  5336. writechunk: null,
  5337. writeencoding: null
  5338. }, this._readableState.needReadable = !0, this._readableState.sync = !1, e && ("function" == typeof e.transform && (this._transform = e.transform), "function" == typeof e.flush && (this._flush = e.flush)), this.on("prefinish", s)
  5339. }
  5340. function s() {
  5341. var e = this;
  5342. "function" == typeof this._flush ? this._flush(function (t, r) {
  5343. a(e, t, r)
  5344. }) : a(this, null, null)
  5345. }
  5346. function a(e, t, r) {
  5347. if (t) return e.emit("error", t);
  5348. if (null != r && e.push(r), e._writableState.length) throw new Error("Calling transform done when ws.length != 0");
  5349. if (e._transformState.transforming) throw new Error("Calling transform done when still transforming");
  5350. return e.push(null)
  5351. }
  5352. i.inherits = e("inherits"), i.inherits(o, n), o.prototype.push = function (e, t) {
  5353. return this._transformState.needTransform = !1, n.prototype.push.call(this, e, t)
  5354. }, o.prototype._transform = function (e, t, r) {
  5355. throw new Error("_transform() is not implemented")
  5356. }, o.prototype._write = function (e, t, r) {
  5357. var n = this._transformState;
  5358. if (n.writecb = r, n.writechunk = e, n.writeencoding = t, !n.transforming) {
  5359. var i = this._readableState;
  5360. (n.needTransform || i.needReadable || i.length < i.highWaterMark) && this._read(i.highWaterMark)
  5361. }
  5362. }, o.prototype._read = function (e) {
  5363. var t = this._transformState;
  5364. null !== t.writechunk && t.writecb && !t.transforming ? (t.transforming = !0, this._transform(t.writechunk, t.writeencoding, t.afterTransform)) : t.needTransform = !0
  5365. }, o.prototype._destroy = function (e, t) {
  5366. var r = this;
  5367. n.prototype._destroy.call(this, e, function (e) {
  5368. t(e), r.emit("close")
  5369. })
  5370. }
  5371. }, {
  5372. "./_stream_duplex": 107,
  5373. "core-util-is": 14,
  5374. inherits: 88
  5375. }],
  5376. 111: [function (e, t, r) {
  5377. (function (r, n, i) {
  5378. "use strict";
  5379. var o = e("process-nextick-args");
  5380. function s(e) {
  5381. var t = this;
  5382. this.next = null, this.entry = null, this.finish = function () {
  5383. ! function (e, t, r) {
  5384. var n = e.entry;
  5385. e.entry = null;
  5386. for (; n;) {
  5387. var i = n.callback;
  5388. t.pendingcb--, i(r), n = n.next
  5389. }
  5390. t.corkedRequestsFree ? t.corkedRequestsFree.next = e : t.corkedRequestsFree = e
  5391. }(t, e)
  5392. }
  5393. }
  5394. t.exports = y;
  5395. var a, c = !r.browser && ["v0.10", "v0.9."].indexOf(r.version.slice(0, 5)) > -1 ? i : o.nextTick;
  5396. y.WritableState = m;
  5397. var u = Object.create(e("core-util-is"));
  5398. u.inherits = e("inherits");
  5399. var l = {
  5400. deprecate: e("util-deprecate")
  5401. },
  5402. f = e("./internal/streams/stream"),
  5403. p = e("safe-buffer").Buffer,
  5404. h = n.Uint8Array || function () {};
  5405. var d, g = e("./internal/streams/destroy");
  5406. function b() {}
  5407. function m(t, r) {
  5408. a = a || e("./_stream_duplex"), t = t || {};
  5409. var n = r instanceof a;
  5410. this.objectMode = !!t.objectMode, n && (this.objectMode = this.objectMode || !!t.writableObjectMode);
  5411. var i = t.highWaterMark,
  5412. u = t.writableHighWaterMark,
  5413. l = this.objectMode ? 16 : 16384;
  5414. this.highWaterMark = i || 0 === i ? i : n && (u || 0 === u) ? u : l, this.highWaterMark = Math.floor(this.highWaterMark), this.finalCalled = !1, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1, this.destroyed = !1;
  5415. var f = !1 === t.decodeStrings;
  5416. this.decodeStrings = !f, this.defaultEncoding = t.defaultEncoding || "utf8", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = function (e) {
  5417. ! function (e, t) {
  5418. var r = e._writableState,
  5419. n = r.sync,
  5420. i = r.writecb;
  5421. if (function (e) {
  5422. e.writing = !1, e.writecb = null, e.length -= e.writelen, e.writelen = 0
  5423. }(r), t) ! function (e, t, r, n, i) {
  5424. --t.pendingcb, r ? (o.nextTick(i, n), o.nextTick(x, e, t), e._writableState.errorEmitted = !0, e.emit("error", n)) : (i(n), e._writableState.errorEmitted = !0, e.emit("error", n), x(e, t))
  5425. }(e, r, n, t, i);
  5426. else {
  5427. var s = S(r);
  5428. s || r.corked || r.bufferProcessing || !r.bufferedRequest || w(e, r), n ? c(v, e, r, s, i) : v(e, r, s, i)
  5429. }
  5430. }(r, e)
  5431. }, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = !1, this.errorEmitted = !1, this.bufferedRequestCount = 0, this.corkedRequestsFree = new s(this)
  5432. }
  5433. function y(t) {
  5434. if (a = a || e("./_stream_duplex"), !(d.call(y, this) || this instanceof a)) return new y(t);
  5435. this._writableState = new m(t, this), this.writable = !0, t && ("function" == typeof t.write && (this._write = t.write), "function" == typeof t.writev && (this._writev = t.writev), "function" == typeof t.destroy && (this._destroy = t.destroy), "function" == typeof t.final && (this._final = t.final)), f.call(this)
  5436. }
  5437. function _(e, t, r, n, i, o, s) {
  5438. t.writelen = n, t.writecb = s, t.writing = !0, t.sync = !0, r ? e._writev(i, t.onwrite) : e._write(i, o, t.onwrite), t.sync = !1
  5439. }
  5440. function v(e, t, r, n) {
  5441. r || function (e, t) {
  5442. 0 === t.length && t.needDrain && (t.needDrain = !1, e.emit("drain"))
  5443. }(e, t), t.pendingcb--, n(), x(e, t)
  5444. }
  5445. function w(e, t) {
  5446. t.bufferProcessing = !0;
  5447. var r = t.bufferedRequest;
  5448. if (e._writev && r && r.next) {
  5449. var n = t.bufferedRequestCount,
  5450. i = new Array(n),
  5451. o = t.corkedRequestsFree;
  5452. o.entry = r;
  5453. for (var a = 0, c = !0; r;) i[a] = r, r.isBuf || (c = !1), r = r.next, a += 1;
  5454. i.allBuffers = c, _(e, t, !0, t.length, i, "", o.finish), t.pendingcb++, t.lastBufferedRequest = null, o.next ? (t.corkedRequestsFree = o.next, o.next = null) : t.corkedRequestsFree = new s(t), t.bufferedRequestCount = 0
  5455. } else {
  5456. for (; r;) {
  5457. var u = r.chunk,
  5458. l = r.encoding,
  5459. f = r.callback;
  5460. if (_(e, t, !1, t.objectMode ? 1 : u.length, u, l, f), r = r.next, t.bufferedRequestCount--, t.writing) break
  5461. }
  5462. null === r && (t.lastBufferedRequest = null)
  5463. }
  5464. t.bufferedRequest = r, t.bufferProcessing = !1
  5465. }
  5466. function S(e) {
  5467. return e.ending && 0 === e.length && null === e.bufferedRequest && !e.finished && !e.writing
  5468. }
  5469. function k(e, t) {
  5470. e._final(function (r) {
  5471. t.pendingcb--, r && e.emit("error", r), t.prefinished = !0, e.emit("prefinish"), x(e, t)
  5472. })
  5473. }
  5474. function x(e, t) {
  5475. var r = S(t);
  5476. return r && (! function (e, t) {
  5477. t.prefinished || t.finalCalled || ("function" == typeof e._final ? (t.pendingcb++, t.finalCalled = !0, o.nextTick(k, e, t)) : (t.prefinished = !0, e.emit("prefinish")))
  5478. }(e, t), 0 === t.pendingcb && (t.finished = !0, e.emit("finish"))), r
  5479. }
  5480. u.inherits(y, f), m.prototype.getBuffer = function () {
  5481. for (var e = this.bufferedRequest, t = []; e;) t.push(e), e = e.next;
  5482. return t
  5483. },
  5484. function () {
  5485. try {
  5486. Object.defineProperty(m.prototype, "buffer", {
  5487. get: l.deprecate(function () {
  5488. return this.getBuffer()
  5489. }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003")
  5490. })
  5491. } catch (e) {}
  5492. }(), "function" == typeof Symbol && Symbol.hasInstance && "function" == typeof Function.prototype[Symbol.hasInstance] ? (d = Function.prototype[Symbol.hasInstance], Object.defineProperty(y, Symbol.hasInstance, {
  5493. value: function (e) {
  5494. return !!d.call(this, e) || this === y && (e && e._writableState instanceof m)
  5495. }
  5496. })) : d = function (e) {
  5497. return e instanceof this
  5498. }, y.prototype.pipe = function () {
  5499. this.emit("error", new Error("Cannot pipe, not readable"))
  5500. }, y.prototype.write = function (e, t, r) {
  5501. var n, i = this._writableState,
  5502. s = !1,
  5503. a = !i.objectMode && (n = e, p.isBuffer(n) || n instanceof h);
  5504. return a && !p.isBuffer(e) && (e = function (e) {
  5505. return p.from(e)
  5506. }(e)), "function" == typeof t && (r = t, t = null), a ? t = "buffer" : t || (t = i.defaultEncoding), "function" != typeof r && (r = b), i.ended ? function (e, t) {
  5507. var r = new Error("write after end");
  5508. e.emit("error", r), o.nextTick(t, r)
  5509. }(this, r) : (a || function (e, t, r, n) {
  5510. var i = !0,
  5511. s = !1;
  5512. return null === r ? s = new TypeError("May not write null values to stream") : "string" == typeof r || void 0 === r || t.objectMode || (s = new TypeError("Invalid non-string/buffer chunk")), s && (e.emit("error", s), o.nextTick(n, s), i = !1), i
  5513. }(this, i, e, r)) && (i.pendingcb++, s = function (e, t, r, n, i, o) {
  5514. if (!r) {
  5515. var s = function (e, t, r) {
  5516. e.objectMode || !1 === e.decodeStrings || "string" != typeof t || (t = p.from(t, r));
  5517. return t
  5518. }(t, n, i);
  5519. n !== s && (r = !0, i = "buffer", n = s)
  5520. }
  5521. var a = t.objectMode ? 1 : n.length;
  5522. t.length += a;
  5523. var c = t.length < t.highWaterMark;
  5524. c || (t.needDrain = !0);
  5525. if (t.writing || t.corked) {
  5526. var u = t.lastBufferedRequest;
  5527. t.lastBufferedRequest = {
  5528. chunk: n,
  5529. encoding: i,
  5530. isBuf: r,
  5531. callback: o,
  5532. next: null
  5533. }, u ? u.next = t.lastBufferedRequest : t.bufferedRequest = t.lastBufferedRequest, t.bufferedRequestCount += 1
  5534. } else _(e, t, !1, a, n, i, o);
  5535. return c
  5536. }(this, i, a, e, t, r)), s
  5537. }, y.prototype.cork = function () {
  5538. this._writableState.corked++
  5539. }, y.prototype.uncork = function () {
  5540. var e = this._writableState;
  5541. e.corked && (e.corked--, e.writing || e.corked || e.finished || e.bufferProcessing || !e.bufferedRequest || w(this, e))
  5542. }, y.prototype.setDefaultEncoding = function (e) {
  5543. if ("string" == typeof e && (e = e.toLowerCase()), !(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((e + "").toLowerCase()) > -1)) throw new TypeError("Unknown encoding: " + e);
  5544. return this._writableState.defaultEncoding = e, this
  5545. }, Object.defineProperty(y.prototype, "writableHighWaterMark", {
  5546. enumerable: !1,
  5547. get: function () {
  5548. return this._writableState.highWaterMark
  5549. }
  5550. }), y.prototype._write = function (e, t, r) {
  5551. r(new Error("_write() is not implemented"))
  5552. }, y.prototype._writev = null, y.prototype.end = function (e, t, r) {
  5553. var n = this._writableState;
  5554. "function" == typeof e ? (r = e, e = null, t = null) : "function" == typeof t && (r = t, t = null), null !== e && void 0 !== e && this.write(e, t), n.corked && (n.corked = 1, this.uncork()), n.ending || n.finished || function (e, t, r) {
  5555. t.ending = !0, x(e, t), r && (t.finished ? o.nextTick(r) : e.once("finish", r));
  5556. t.ended = !0, e.writable = !1
  5557. }(this, n, r)
  5558. }, Object.defineProperty(y.prototype, "destroyed", {
  5559. get: function () {
  5560. return void 0 !== this._writableState && this._writableState.destroyed
  5561. },
  5562. set: function (e) {
  5563. this._writableState && (this._writableState.destroyed = e)
  5564. }
  5565. }), y.prototype.destroy = g.destroy, y.prototype._undestroy = g.undestroy, y.prototype._destroy = function (e, t) {
  5566. this.end(), t(e)
  5567. }
  5568. }).call(this, e("_process"), "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, e("timers").setImmediate)
  5569. }, {
  5570. "./_stream_duplex": 107,
  5571. "./internal/streams/destroy": 113,
  5572. "./internal/streams/stream": 114,
  5573. _process: 101,
  5574. "core-util-is": 14,
  5575. inherits: 88,
  5576. "process-nextick-args": 100,
  5577. "safe-buffer": 117,
  5578. timers: 120,
  5579. "util-deprecate": 134
  5580. }],
  5581. 112: [function (e, t, r) {
  5582. "use strict";
  5583. var n = e("safe-buffer").Buffer,
  5584. i = e("util");
  5585. t.exports = function () {
  5586. function e() {
  5587. ! function (e, t) {
  5588. if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
  5589. }(this, e), this.head = null, this.tail = null, this.length = 0
  5590. }
  5591. return e.prototype.push = function (e) {
  5592. var t = {
  5593. data: e,
  5594. next: null
  5595. };
  5596. this.length > 0 ? this.tail.next = t : this.head = t, this.tail = t, ++this.length
  5597. }, e.prototype.unshift = function (e) {
  5598. var t = {
  5599. data: e,
  5600. next: this.head
  5601. };
  5602. 0 === this.length && (this.tail = t), this.head = t, ++this.length
  5603. }, e.prototype.shift = function () {
  5604. if (0 !== this.length) {
  5605. var e = this.head.data;
  5606. return 1 === this.length ? this.head = this.tail = null : this.head = this.head.next, --this.length, e
  5607. }
  5608. }, e.prototype.clear = function () {
  5609. this.head = this.tail = null, this.length = 0
  5610. }, e.prototype.join = function (e) {
  5611. if (0 === this.length) return "";
  5612. for (var t = this.head, r = "" + t.data; t = t.next;) r += e + t.data;
  5613. return r
  5614. }, e.prototype.concat = function (e) {
  5615. if (0 === this.length) return n.alloc(0);
  5616. if (1 === this.length) return this.head.data;
  5617. for (var t, r, i, o = n.allocUnsafe(e >>> 0), s = this.head, a = 0; s;) t = s.data, r = o, i = a, t.copy(r, i), a += s.data.length, s = s.next;
  5618. return o
  5619. }, e
  5620. }(), i && i.inspect && i.inspect.custom && (t.exports.prototype[i.inspect.custom] = function () {
  5621. var e = i.inspect({
  5622. length: this.length
  5623. });
  5624. return this.constructor.name + " " + e
  5625. })
  5626. }, {
  5627. "safe-buffer": 117,
  5628. util: 12
  5629. }],
  5630. 113: [function (e, t, r) {
  5631. "use strict";
  5632. var n = e("process-nextick-args");
  5633. function i(e, t) {
  5634. e.emit("error", t)
  5635. }
  5636. t.exports = {
  5637. destroy: function (e, t) {
  5638. var r = this,
  5639. o = this._readableState && this._readableState.destroyed,
  5640. s = this._writableState && this._writableState.destroyed;
  5641. return o || s ? (t ? t(e) : !e || this._writableState && this._writableState.errorEmitted || n.nextTick(i, this, e), this) : (this._readableState && (this._readableState.destroyed = !0), this._writableState && (this._writableState.destroyed = !0), this._destroy(e || null, function (e) {
  5642. !t && e ? (n.nextTick(i, r, e), r._writableState && (r._writableState.errorEmitted = !0)) : t && t(e)
  5643. }), this)
  5644. },
  5645. undestroy: function () {
  5646. this._readableState && (this._readableState.destroyed = !1, this._readableState.reading = !1, this._readableState.ended = !1, this._readableState.endEmitted = !1), this._writableState && (this._writableState.destroyed = !1, this._writableState.ended = !1, this._writableState.ending = !1, this._writableState.finished = !1, this._writableState.errorEmitted = !1)
  5647. }
  5648. }
  5649. }, {
  5650. "process-nextick-args": 100
  5651. }],
  5652. 114: [function (e, t, r) {
  5653. t.exports = e("events").EventEmitter
  5654. }, {
  5655. events: 83
  5656. }],
  5657. 115: [function (e, t, r) {
  5658. (r = t.exports = e("./lib/_stream_readable.js")).Stream = r, r.Readable = r, r.Writable = e("./lib/_stream_writable.js"), r.Duplex = e("./lib/_stream_duplex.js"), r.Transform = e("./lib/_stream_transform.js"), r.PassThrough = e("./lib/_stream_passthrough.js")
  5659. }, {
  5660. "./lib/_stream_duplex.js": 107,
  5661. "./lib/_stream_passthrough.js": 108,
  5662. "./lib/_stream_readable.js": 109,
  5663. "./lib/_stream_transform.js": 110,
  5664. "./lib/_stream_writable.js": 111
  5665. }],
  5666. 116: [function (e, t, r) {
  5667. "use strict";
  5668. t.exports = function () {
  5669. if ("function" != typeof arguments[0]) throw new Error("callback needed");
  5670. if ("number" != typeof arguments[1]) throw new Error("interval needed");
  5671. var e;
  5672. if (arguments.length > 0) {
  5673. e = new Array(arguments.length - 2);
  5674. for (var t = 0; t < e.length; t++) e[t] = arguments[t + 2]
  5675. }
  5676. return new function (e, t, r) {
  5677. var n = this;
  5678. this._callback = e, this._args = r, this._interval = setInterval(e, t, this._args), this.reschedule = function (e) {
  5679. e || (e = n._interval), n._interval && clearInterval(n._interval), n._interval = setInterval(n._callback, e, n._args)
  5680. }, this.clear = function () {
  5681. n._interval && (clearInterval(n._interval), n._interval = void 0)
  5682. }, this.destroy = function () {
  5683. n._interval && clearInterval(n._interval), n._callback = void 0, n._interval = void 0, n._args = void 0
  5684. }
  5685. }(arguments[0], arguments[1], e)
  5686. }
  5687. }, {}],
  5688. 117: [function (e, t, r) {
  5689. var n = e("buffer"),
  5690. i = n.Buffer;
  5691. function o(e, t) {
  5692. for (var r in e) t[r] = e[r]
  5693. }
  5694. function s(e, t, r) {
  5695. return i(e, t, r)
  5696. }
  5697. i.from && i.alloc && i.allocUnsafe && i.allocUnsafeSlow ? t.exports = n : (o(n, r), r.Buffer = s), o(i, s), s.from = function (e, t, r) {
  5698. if ("number" == typeof e) throw new TypeError("Argument must not be a number");
  5699. return i(e, t, r)
  5700. }, s.alloc = function (e, t, r) {
  5701. if ("number" != typeof e) throw new TypeError("Argument must be a number");
  5702. var n = i(e);
  5703. return void 0 !== t ? "string" == typeof r ? n.fill(t, r) : n.fill(t) : n.fill(0), n
  5704. }, s.allocUnsafe = function (e) {
  5705. if ("number" != typeof e) throw new TypeError("Argument must be a number");
  5706. return i(e)
  5707. }, s.allocUnsafeSlow = function (e) {
  5708. if ("number" != typeof e) throw new TypeError("Argument must be a number");
  5709. return n.SlowBuffer(e)
  5710. }
  5711. }, {
  5712. buffer: 13
  5713. }],
  5714. 118: [function (e, t, r) {
  5715. t.exports = function (e) {
  5716. var t = e._readableState;
  5717. return t ? t.objectMode || "number" == typeof e._duplexState ? e.read() : e.read((r = t, r.buffer.length ? r.buffer.head ? r.buffer.head.data.length : r.buffer[0].length : r.length)) : null;
  5718. var r
  5719. }
  5720. }, {}],
  5721. 119: [function (e, t, r) {
  5722. "use strict";
  5723. var n = e("safe-buffer").Buffer,
  5724. i = n.isEncoding || function (e) {
  5725. switch ((e = "" + e) && e.toLowerCase()) {
  5726. case "hex":
  5727. case "utf8":
  5728. case "utf-8":
  5729. case "ascii":
  5730. case "binary":
  5731. case "base64":
  5732. case "ucs2":
  5733. case "ucs-2":
  5734. case "utf16le":
  5735. case "utf-16le":
  5736. case "raw":
  5737. return !0;
  5738. default:
  5739. return !1
  5740. }
  5741. };
  5742. function o(e) {
  5743. var t;
  5744. switch (this.encoding = function (e) {
  5745. var t = function (e) {
  5746. if (!e) return "utf8";
  5747. for (var t;;) switch (e) {
  5748. case "utf8":
  5749. case "utf-8":
  5750. return "utf8";
  5751. case "ucs2":
  5752. case "ucs-2":
  5753. case "utf16le":
  5754. case "utf-16le":
  5755. return "utf16le";
  5756. case "latin1":
  5757. case "binary":
  5758. return "latin1";
  5759. case "base64":
  5760. case "ascii":
  5761. case "hex":
  5762. return e;
  5763. default:
  5764. if (t) return;
  5765. e = ("" + e).toLowerCase(), t = !0
  5766. }
  5767. }(e);
  5768. if ("string" != typeof t && (n.isEncoding === i || !i(e))) throw new Error("Unknown encoding: " + e);
  5769. return t || e
  5770. }(e), this.encoding) {
  5771. case "utf16le":
  5772. this.text = c, this.end = u, t = 4;
  5773. break;
  5774. case "utf8":
  5775. this.fillLast = a, t = 4;
  5776. break;
  5777. case "base64":
  5778. this.text = l, this.end = f, t = 3;
  5779. break;
  5780. default:
  5781. return this.write = p, void(this.end = h)
  5782. }
  5783. this.lastNeed = 0, this.lastTotal = 0, this.lastChar = n.allocUnsafe(t)
  5784. }
  5785. function s(e) {
  5786. return e <= 127 ? 0 : e >> 5 == 6 ? 2 : e >> 4 == 14 ? 3 : e >> 3 == 30 ? 4 : e >> 6 == 2 ? -1 : -2
  5787. }
  5788. function a(e) {
  5789. var t = this.lastTotal - this.lastNeed,
  5790. r = function (e, t, r) {
  5791. if (128 != (192 & t[0])) return e.lastNeed = 0, "�";
  5792. if (e.lastNeed > 1 && t.length > 1) {
  5793. if (128 != (192 & t[1])) return e.lastNeed = 1, "�";
  5794. if (e.lastNeed > 2 && t.length > 2 && 128 != (192 & t[2])) return e.lastNeed = 2, "�"
  5795. }
  5796. }(this, e);
  5797. return void 0 !== r ? r : this.lastNeed <= e.length ? (e.copy(this.lastChar, t, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal)) : (e.copy(this.lastChar, t, 0, e.length), void(this.lastNeed -= e.length))
  5798. }
  5799. function c(e, t) {
  5800. if ((e.length - t) % 2 == 0) {
  5801. var r = e.toString("utf16le", t);
  5802. if (r) {
  5803. var n = r.charCodeAt(r.length - 1);
  5804. if (n >= 55296 && n <= 56319) return this.lastNeed = 2, this.lastTotal = 4, this.lastChar[0] = e[e.length - 2], this.lastChar[1] = e[e.length - 1], r.slice(0, -1)
  5805. }
  5806. return r
  5807. }
  5808. return this.lastNeed = 1, this.lastTotal = 2, this.lastChar[0] = e[e.length - 1], e.toString("utf16le", t, e.length - 1)
  5809. }
  5810. function u(e) {
  5811. var t = e && e.length ? this.write(e) : "";
  5812. if (this.lastNeed) {
  5813. var r = this.lastTotal - this.lastNeed;
  5814. return t + this.lastChar.toString("utf16le", 0, r)
  5815. }
  5816. return t
  5817. }
  5818. function l(e, t) {
  5819. var r = (e.length - t) % 3;
  5820. return 0 === r ? e.toString("base64", t) : (this.lastNeed = 3 - r, this.lastTotal = 3, 1 === r ? this.lastChar[0] = e[e.length - 1] : (this.lastChar[0] = e[e.length - 2], this.lastChar[1] = e[e.length - 1]), e.toString("base64", t, e.length - r))
  5821. }
  5822. function f(e) {
  5823. var t = e && e.length ? this.write(e) : "";
  5824. return this.lastNeed ? t + this.lastChar.toString("base64", 0, 3 - this.lastNeed) : t
  5825. }
  5826. function p(e) {
  5827. return e.toString(this.encoding)
  5828. }
  5829. function h(e) {
  5830. return e && e.length ? this.write(e) : ""
  5831. }
  5832. r.StringDecoder = o, o.prototype.write = function (e) {
  5833. if (0 === e.length) return "";
  5834. var t, r;
  5835. if (this.lastNeed) {
  5836. if (void 0 === (t = this.fillLast(e))) return "";
  5837. r = this.lastNeed, this.lastNeed = 0
  5838. } else r = 0;
  5839. return r < e.length ? t ? t + this.text(e, r) : this.text(e, r) : t || ""
  5840. }, o.prototype.end = function (e) {
  5841. var t = e && e.length ? this.write(e) : "";
  5842. return this.lastNeed ? t + "�" : t
  5843. }, o.prototype.text = function (e, t) {
  5844. var r = function (e, t, r) {
  5845. var n = t.length - 1;
  5846. if (n < r) return 0;
  5847. var i = s(t[n]);
  5848. if (i >= 0) return i > 0 && (e.lastNeed = i - 1), i;
  5849. if (--n < r || -2 === i) return 0;
  5850. if ((i = s(t[n])) >= 0) return i > 0 && (e.lastNeed = i - 2), i;
  5851. if (--n < r || -2 === i) return 0;
  5852. if ((i = s(t[n])) >= 0) return i > 0 && (2 === i ? i = 0 : e.lastNeed = i - 3), i;
  5853. return 0
  5854. }(this, e, t);
  5855. if (!this.lastNeed) return e.toString("utf8", t);
  5856. this.lastTotal = r;
  5857. var n = e.length - (r - this.lastNeed);
  5858. return e.copy(this.lastChar, 0, n), e.toString("utf8", t, n)
  5859. }, o.prototype.fillLast = function (e) {
  5860. if (this.lastNeed <= e.length) return e.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal);
  5861. e.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, e.length), this.lastNeed -= e.length
  5862. }
  5863. }, {
  5864. "safe-buffer": 117
  5865. }],
  5866. 120: [function (e, t, r) {
  5867. (function (t, n) {
  5868. var i = e("process/browser.js").nextTick,
  5869. o = Function.prototype.apply,
  5870. s = Array.prototype.slice,
  5871. a = {},
  5872. c = 0;
  5873. function u(e, t) {
  5874. this._id = e, this._clearFn = t
  5875. }
  5876. r.setTimeout = function () {
  5877. return new u(o.call(setTimeout, window, arguments), clearTimeout)
  5878. }, r.setInterval = function () {
  5879. return new u(o.call(setInterval, window, arguments), clearInterval)
  5880. }, r.clearTimeout = r.clearInterval = function (e) {
  5881. e.close()
  5882. }, u.prototype.unref = u.prototype.ref = function () {}, u.prototype.close = function () {
  5883. this._clearFn.call(window, this._id)
  5884. }, r.enroll = function (e, t) {
  5885. clearTimeout(e._idleTimeoutId), e._idleTimeout = t
  5886. }, r.unenroll = function (e) {
  5887. clearTimeout(e._idleTimeoutId), e._idleTimeout = -1
  5888. }, r._unrefActive = r.active = function (e) {
  5889. clearTimeout(e._idleTimeoutId);
  5890. var t = e._idleTimeout;
  5891. t >= 0 && (e._idleTimeoutId = setTimeout(function () {
  5892. e._onTimeout && e._onTimeout()
  5893. }, t))
  5894. }, r.setImmediate = "function" == typeof t ? t : function (e) {
  5895. var t = c++,
  5896. n = !(arguments.length < 2) && s.call(arguments, 1);
  5897. return a[t] = !0, i(function () {
  5898. a[t] && (n ? e.apply(null, n) : e.call(null), r.clearImmediate(t))
  5899. }), t
  5900. }, r.clearImmediate = "function" == typeof n ? n : function (e) {
  5901. delete a[e]
  5902. }
  5903. }).call(this, e("timers").setImmediate, e("timers").clearImmediate)
  5904. }, {
  5905. "process/browser.js": 101,
  5906. timers: 120
  5907. }],
  5908. 121: [function (e, t, r) {
  5909. "use strict";
  5910. var n = e("../prototype/is");
  5911. t.exports = function (e) {
  5912. if ("function" != typeof e) return !1;
  5913. if (!hasOwnProperty.call(e, "length")) return !1;
  5914. try {
  5915. if ("number" != typeof e.length) return !1;
  5916. if ("function" != typeof e.call) return !1;
  5917. if ("function" != typeof e.apply) return !1
  5918. } catch (e) {
  5919. return !1
  5920. }
  5921. return !n(e)
  5922. }
  5923. }, {
  5924. "../prototype/is": 128
  5925. }],
  5926. 122: [function (e, t, r) {
  5927. "use strict";
  5928. var n = e("../value/is"),
  5929. i = e("../object/is"),
  5930. o = e("../string/coerce"),
  5931. s = e("./to-short-string"),
  5932. a = function (e, t) {
  5933. return e.replace("%v", s(t))
  5934. };
  5935. t.exports = function (e, t, r) {
  5936. if (!i(r)) throw new TypeError(a(t, e));
  5937. if (!n(e)) {
  5938. if ("default" in r) return r.default;
  5939. if (r.isOptional) return null
  5940. }
  5941. var s = o(r.errorMessage);
  5942. throw n(s) || (s = t), new TypeError(a(s, e))
  5943. }
  5944. }, {
  5945. "../object/is": 125,
  5946. "../string/coerce": 129,
  5947. "../value/is": 131,
  5948. "./to-short-string": 124
  5949. }],
  5950. 123: [function (e, t, r) {
  5951. "use strict";
  5952. t.exports = function (e) {
  5953. try {
  5954. return e.toString()
  5955. } catch (t) {
  5956. try {
  5957. return String(e)
  5958. } catch (e) {
  5959. return null
  5960. }
  5961. }
  5962. }
  5963. }, {}],
  5964. 124: [function (e, t, r) {
  5965. "use strict";
  5966. var n = e("./safe-to-string"),
  5967. i = /[\n\r\u2028\u2029]/g;
  5968. t.exports = function (e) {
  5969. var t = n(e);
  5970. return null === t ? "<Non-coercible to string value>" : (t.length > 100 && (t = t.slice(0, 99) + "…"), t = t.replace(i, function (e) {
  5971. switch (e) {
  5972. case "\n":
  5973. return "\\n";
  5974. case "\r":
  5975. return "\\r";
  5976. case "\u2028":
  5977. return "\\u2028";
  5978. case "\u2029":
  5979. return "\\u2029";
  5980. default:
  5981. throw new Error("Unexpected character")
  5982. }
  5983. }))
  5984. }
  5985. }, {
  5986. "./safe-to-string": 123
  5987. }],
  5988. 125: [function (e, t, r) {
  5989. "use strict";
  5990. var n = e("../value/is"),
  5991. i = {
  5992. object: !0,
  5993. function: !0,
  5994. undefined: !0
  5995. };
  5996. t.exports = function (e) {
  5997. return !!n(e) && hasOwnProperty.call(i, typeof e)
  5998. }
  5999. }, {
  6000. "../value/is": 131
  6001. }],
  6002. 126: [function (e, t, r) {
  6003. "use strict";
  6004. var n = e("../lib/resolve-exception"),
  6005. i = e("./is");
  6006. t.exports = function (e) {
  6007. return i(e) ? e : n(e, "%v is not a plain function", arguments[1])
  6008. }
  6009. }, {
  6010. "../lib/resolve-exception": 122,
  6011. "./is": 127
  6012. }],
  6013. 127: [function (e, t, r) {
  6014. "use strict";
  6015. var n = e("../function/is"),
  6016. i = /^\s*class[\s{/}]/,
  6017. o = Function.prototype.toString;
  6018. t.exports = function (e) {
  6019. return !!n(e) && !i.test(o.call(e))
  6020. }
  6021. }, {
  6022. "../function/is": 121
  6023. }],
  6024. 128: [function (e, t, r) {
  6025. "use strict";
  6026. var n = e("../object/is");
  6027. t.exports = function (e) {
  6028. if (!n(e)) return !1;
  6029. try {
  6030. return !!e.constructor && e.constructor.prototype === e
  6031. } catch (e) {
  6032. return !1
  6033. }
  6034. }
  6035. }, {
  6036. "../object/is": 125
  6037. }],
  6038. 129: [function (e, t, r) {
  6039. "use strict";
  6040. var n = e("../value/is"),
  6041. i = e("../object/is"),
  6042. o = Object.prototype.toString;
  6043. t.exports = function (e) {
  6044. if (!n(e)) return null;
  6045. if (i(e)) {
  6046. var t = e.toString;
  6047. if ("function" != typeof t) return null;
  6048. if (t === o) return null
  6049. }
  6050. try {
  6051. return "" + e
  6052. } catch (e) {
  6053. return null
  6054. }
  6055. }
  6056. }, {
  6057. "../object/is": 125,
  6058. "../value/is": 131
  6059. }],
  6060. 130: [function (e, t, r) {
  6061. "use strict";
  6062. var n = e("../lib/resolve-exception"),
  6063. i = e("./is");
  6064. t.exports = function (e) {
  6065. return i(e) ? e : n(e, "Cannot use %v", arguments[1])
  6066. }
  6067. }, {
  6068. "../lib/resolve-exception": 122,
  6069. "./is": 131
  6070. }],
  6071. 131: [function (e, t, r) {
  6072. "use strict";
  6073. t.exports = function (e) {
  6074. return void 0 !== e && null !== e
  6075. }
  6076. }, {}],
  6077. 132: [function (e, t, r) {
  6078. "use strict";
  6079. var n = e("punycode"),
  6080. i = e("./util");
  6081. function o() {
  6082. this.protocol = null, this.slashes = null, this.auth = null, this.host = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.query = null, this.pathname = null, this.path = null, this.href = null
  6083. }
  6084. r.parse = _, r.resolve = function (e, t) {
  6085. return _(e, !1, !0).resolve(t)
  6086. }, r.resolveObject = function (e, t) {
  6087. return e ? _(e, !1, !0).resolveObject(t) : t
  6088. }, r.format = function (e) {
  6089. i.isString(e) && (e = _(e));
  6090. return e instanceof o ? e.format() : o.prototype.format.call(e)
  6091. }, r.Url = o;
  6092. var s = /^([a-z0-9.+-]+:)/i,
  6093. a = /:[0-9]*$/,
  6094. c = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
  6095. u = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"]),
  6096. l = ["'"].concat(u),
  6097. f = ["%", "/", "?", ";", "#"].concat(l),
  6098. p = ["/", "?", "#"],
  6099. h = /^[+a-z0-9A-Z_-]{0,63}$/,
  6100. d = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
  6101. g = {
  6102. javascript: !0,
  6103. "javascript:": !0
  6104. },
  6105. b = {
  6106. javascript: !0,
  6107. "javascript:": !0
  6108. },
  6109. m = {
  6110. http: !0,
  6111. https: !0,
  6112. ftp: !0,
  6113. gopher: !0,
  6114. file: !0,
  6115. "http:": !0,
  6116. "https:": !0,
  6117. "ftp:": !0,
  6118. "gopher:": !0,
  6119. "file:": !0
  6120. },
  6121. y = e("querystring");
  6122. function _(e, t, r) {
  6123. if (e && i.isObject(e) && e instanceof o) return e;
  6124. var n = new o;
  6125. return n.parse(e, t, r), n
  6126. }
  6127. o.prototype.parse = function (e, t, r) {
  6128. if (!i.isString(e)) throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  6129. var o = e.indexOf("?"),
  6130. a = -1 !== o && o < e.indexOf("#") ? "?" : "#",
  6131. u = e.split(a);
  6132. u[0] = u[0].replace(/\\/g, "/");
  6133. var _ = e = u.join(a);
  6134. if (_ = _.trim(), !r && 1 === e.split("#").length) {
  6135. var v = c.exec(_);
  6136. if (v) return this.path = _, this.href = _, this.pathname = v[1], v[2] ? (this.search = v[2], this.query = t ? y.parse(this.search.substr(1)) : this.search.substr(1)) : t && (this.search = "", this.query = {}), this
  6137. }
  6138. var w = s.exec(_);
  6139. if (w) {
  6140. var S = (w = w[0]).toLowerCase();
  6141. this.protocol = S, _ = _.substr(w.length)
  6142. }
  6143. if (r || w || _.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  6144. var k = "//" === _.substr(0, 2);
  6145. !k || w && b[w] || (_ = _.substr(2), this.slashes = !0)
  6146. }
  6147. if (!b[w] && (k || w && !m[w])) {
  6148. for (var x, E, I = -1, C = 0; C < p.length; C++) {
  6149. -1 !== (O = _.indexOf(p[C])) && (-1 === I || O < I) && (I = O)
  6150. } - 1 !== (E = -1 === I ? _.lastIndexOf("@") : _.lastIndexOf("@", I)) && (x = _.slice(0, E), _ = _.slice(E + 1), this.auth = decodeURIComponent(x)), I = -1;
  6151. for (C = 0; C < f.length; C++) {
  6152. var O; - 1 !== (O = _.indexOf(f[C])) && (-1 === I || O < I) && (I = O)
  6153. } - 1 === I && (I = _.length), this.host = _.slice(0, I), _ = _.slice(I), this.parseHost(), this.hostname = this.hostname || "";
  6154. var j = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  6155. if (!j)
  6156. for (var A = this.hostname.split(/\./), T = (C = 0, A.length); C < T; C++) {
  6157. var P = A[C];
  6158. if (P && !P.match(h)) {
  6159. for (var M = "", B = 0, R = P.length; B < R; B++) P.charCodeAt(B) > 127 ? M += "x" : M += P[B];
  6160. if (!M.match(h)) {
  6161. var N = A.slice(0, C),
  6162. U = A.slice(C + 1),
  6163. L = P.match(d);
  6164. L && (N.push(L[1]), U.unshift(L[2])), U.length && (_ = "/" + U.join(".") + _), this.hostname = N.join(".");
  6165. break
  6166. }
  6167. }
  6168. }
  6169. this.hostname.length > 255 ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(), j || (this.hostname = n.toASCII(this.hostname));
  6170. var q = this.port ? ":" + this.port : "",
  6171. F = this.hostname || "";
  6172. this.host = F + q, this.href += this.host, j && (this.hostname = this.hostname.substr(1, this.hostname.length - 2), "/" !== _[0] && (_ = "/" + _))
  6173. }
  6174. if (!g[S])
  6175. for (C = 0, T = l.length; C < T; C++) {
  6176. var D = l[C];
  6177. if (-1 !== _.indexOf(D)) {
  6178. var z = encodeURIComponent(D);
  6179. z === D && (z = escape(D)), _ = _.split(D).join(z)
  6180. }
  6181. }
  6182. var H = _.indexOf("#"); - 1 !== H && (this.hash = _.substr(H), _ = _.slice(0, H));
  6183. var K = _.indexOf("?");
  6184. if (-1 !== K ? (this.search = _.substr(K), this.query = _.substr(K + 1), t && (this.query = y.parse(this.query)), _ = _.slice(0, K)) : t && (this.search = "", this.query = {}), _ && (this.pathname = _), m[S] && this.hostname && !this.pathname && (this.pathname = "/"), this.pathname || this.search) {
  6185. q = this.pathname || "";
  6186. var W = this.search || "";
  6187. this.path = q + W
  6188. }
  6189. return this.href = this.format(), this
  6190. }, o.prototype.format = function () {
  6191. var e = this.auth || "";
  6192. e && (e = (e = encodeURIComponent(e)).replace(/%3A/i, ":"), e += "@");
  6193. var t = this.protocol || "",
  6194. r = this.pathname || "",
  6195. n = this.hash || "",
  6196. o = !1,
  6197. s = "";
  6198. this.host ? o = e + this.host : this.hostname && (o = e + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"), this.port && (o += ":" + this.port)), this.query && i.isObject(this.query) && Object.keys(this.query).length && (s = y.stringify(this.query));
  6199. var a = this.search || s && "?" + s || "";
  6200. return t && ":" !== t.substr(-1) && (t += ":"), this.slashes || (!t || m[t]) && !1 !== o ? (o = "//" + (o || ""), r && "/" !== r.charAt(0) && (r = "/" + r)) : o || (o = ""), n && "#" !== n.charAt(0) && (n = "#" + n), a && "?" !== a.charAt(0) && (a = "?" + a), t + o + (r = r.replace(/[?#]/g, function (e) {
  6201. return encodeURIComponent(e)
  6202. })) + (a = a.replace("#", "%23")) + n
  6203. }, o.prototype.resolve = function (e) {
  6204. return this.resolveObject(_(e, !1, !0)).format()
  6205. }, o.prototype.resolveObject = function (e) {
  6206. if (i.isString(e)) {
  6207. var t = new o;
  6208. t.parse(e, !1, !0), e = t
  6209. }
  6210. for (var r = new o, n = Object.keys(this), s = 0; s < n.length; s++) {
  6211. var a = n[s];
  6212. r[a] = this[a]
  6213. }
  6214. if (r.hash = e.hash, "" === e.href) return r.href = r.format(), r;
  6215. if (e.slashes && !e.protocol) {
  6216. for (var c = Object.keys(e), u = 0; u < c.length; u++) {
  6217. var l = c[u];
  6218. "protocol" !== l && (r[l] = e[l])
  6219. }
  6220. return m[r.protocol] && r.hostname && !r.pathname && (r.path = r.pathname = "/"), r.href = r.format(), r
  6221. }
  6222. if (e.protocol && e.protocol !== r.protocol) {
  6223. if (!m[e.protocol]) {
  6224. for (var f = Object.keys(e), p = 0; p < f.length; p++) {
  6225. var h = f[p];
  6226. r[h] = e[h]
  6227. }
  6228. return r.href = r.format(), r
  6229. }
  6230. if (r.protocol = e.protocol, e.host || b[e.protocol]) r.pathname = e.pathname;
  6231. else {
  6232. for (var d = (e.pathname || "").split("/"); d.length && !(e.host = d.shift()););
  6233. e.host || (e.host = ""), e.hostname || (e.hostname = ""), "" !== d[0] && d.unshift(""), d.length < 2 && d.unshift(""), r.pathname = d.join("/")
  6234. }
  6235. if (r.search = e.search, r.query = e.query, r.host = e.host || "", r.auth = e.auth, r.hostname = e.hostname || e.host, r.port = e.port, r.pathname || r.search) {
  6236. var g = r.pathname || "",
  6237. y = r.search || "";
  6238. r.path = g + y
  6239. }
  6240. return r.slashes = r.slashes || e.slashes, r.href = r.format(), r
  6241. }
  6242. var _ = r.pathname && "/" === r.pathname.charAt(0),
  6243. v = e.host || e.pathname && "/" === e.pathname.charAt(0),
  6244. w = v || _ || r.host && e.pathname,
  6245. S = w,
  6246. k = r.pathname && r.pathname.split("/") || [],
  6247. x = (d = e.pathname && e.pathname.split("/") || [], r.protocol && !m[r.protocol]);
  6248. if (x && (r.hostname = "", r.port = null, r.host && ("" === k[0] ? k[0] = r.host : k.unshift(r.host)), r.host = "", e.protocol && (e.hostname = null, e.port = null, e.host && ("" === d[0] ? d[0] = e.host : d.unshift(e.host)), e.host = null), w = w && ("" === d[0] || "" === k[0])), v) r.host = e.host || "" === e.host ? e.host : r.host, r.hostname = e.hostname || "" === e.hostname ? e.hostname : r.hostname, r.search = e.search, r.query = e.query, k = d;
  6249. else if (d.length) k || (k = []), k.pop(), k = k.concat(d), r.search = e.search, r.query = e.query;
  6250. else if (!i.isNullOrUndefined(e.search)) {
  6251. if (x) r.hostname = r.host = k.shift(), (j = !!(r.host && r.host.indexOf("@") > 0) && r.host.split("@")) && (r.auth = j.shift(), r.host = r.hostname = j.shift());
  6252. return r.search = e.search, r.query = e.query, i.isNull(r.pathname) && i.isNull(r.search) || (r.path = (r.pathname ? r.pathname : "") + (r.search ? r.search : "")), r.href = r.format(), r
  6253. }
  6254. if (!k.length) return r.pathname = null, r.search ? r.path = "/" + r.search : r.path = null, r.href = r.format(), r;
  6255. for (var E = k.slice(-1)[0], I = (r.host || e.host || k.length > 1) && ("." === E || ".." === E) || "" === E, C = 0, O = k.length; O >= 0; O--) "." === (E = k[O]) ? k.splice(O, 1) : ".." === E ? (k.splice(O, 1), C++) : C && (k.splice(O, 1), C--);
  6256. if (!w && !S)
  6257. for (; C--; C) k.unshift("..");
  6258. !w || "" === k[0] || k[0] && "/" === k[0].charAt(0) || k.unshift(""), I && "/" !== k.join("/").substr(-1) && k.push("");
  6259. var j, A = "" === k[0] || k[0] && "/" === k[0].charAt(0);
  6260. x && (r.hostname = r.host = A ? "" : k.length ? k.shift() : "", (j = !!(r.host && r.host.indexOf("@") > 0) && r.host.split("@")) && (r.auth = j.shift(), r.host = r.hostname = j.shift()));
  6261. return (w = w || r.host && k.length) && !A && k.unshift(""), k.length ? r.pathname = k.join("/") : (r.pathname = null, r.path = null), i.isNull(r.pathname) && i.isNull(r.search) || (r.path = (r.pathname ? r.pathname : "") + (r.search ? r.search : "")), r.auth = e.auth || r.auth, r.slashes = r.slashes || e.slashes, r.href = r.format(), r
  6262. }, o.prototype.parseHost = function () {
  6263. var e = this.host,
  6264. t = a.exec(e);
  6265. t && (":" !== (t = t[0]) && (this.port = t.substr(1)), e = e.substr(0, e.length - t.length)), e && (this.hostname = e)
  6266. }
  6267. }, {
  6268. "./util": 133,
  6269. punycode: 102,
  6270. querystring: 105
  6271. }],
  6272. 133: [function (e, t, r) {
  6273. "use strict";
  6274. t.exports = {
  6275. isString: function (e) {
  6276. return "string" == typeof e
  6277. },
  6278. isObject: function (e) {
  6279. return "object" == typeof e && null !== e
  6280. },
  6281. isNull: function (e) {
  6282. return null === e
  6283. },
  6284. isNullOrUndefined: function (e) {
  6285. return null == e
  6286. }
  6287. }
  6288. }, {}],
  6289. 134: [function (e, t, r) {
  6290. (function (e) {
  6291. function r(t) {
  6292. try {
  6293. if (!e.localStorage) return !1
  6294. } catch (e) {
  6295. return !1
  6296. }
  6297. var r = e.localStorage[t];
  6298. return null != r && "true" === String(r).toLowerCase()
  6299. }
  6300. t.exports = function (e, t) {
  6301. if (r("noDeprecation")) return e;
  6302. var n = !1;
  6303. return function () {
  6304. if (!n) {
  6305. if (r("throwDeprecation")) throw new Error(t);
  6306. r("traceDeprecation") ? console.trace(t) : console.warn(t), n = !0
  6307. }
  6308. return e.apply(this, arguments)
  6309. }
  6310. }
  6311. }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  6312. }, {}],
  6313. 135: [function (e, t, r) {
  6314. "function" == typeof Object.create ? t.exports = function (e, t) {
  6315. e.super_ = t, e.prototype = Object.create(t.prototype, {
  6316. constructor: {
  6317. value: e,
  6318. enumerable: !1,
  6319. writable: !0,
  6320. configurable: !0
  6321. }
  6322. })
  6323. } : t.exports = function (e, t) {
  6324. e.super_ = t;
  6325. var r = function () {};
  6326. r.prototype = t.prototype, e.prototype = new r, e.prototype.constructor = e
  6327. }
  6328. }, {}],
  6329. 136: [function (e, t, r) {
  6330. t.exports = function (e) {
  6331. return e && "object" == typeof e && "function" == typeof e.copy && "function" == typeof e.fill && "function" == typeof e.readUInt8
  6332. }
  6333. }, {}],
  6334. 137: [function (e, t, r) {
  6335. (function (t, n) {
  6336. var i = /%[sdj%]/g;
  6337. r.format = function (e) {
  6338. if (!m(e)) {
  6339. for (var t = [], r = 0; r < arguments.length; r++) t.push(a(arguments[r]));
  6340. return t.join(" ")
  6341. }
  6342. r = 1;
  6343. for (var n = arguments, o = n.length, s = String(e).replace(i, function (e) {
  6344. if ("%%" === e) return "%";
  6345. if (r >= o) return e;
  6346. switch (e) {
  6347. case "%s":
  6348. return String(n[r++]);
  6349. case "%d":
  6350. return Number(n[r++]);
  6351. case "%j":
  6352. try {
  6353. return JSON.stringify(n[r++])
  6354. } catch (e) {
  6355. return "[Circular]"
  6356. }
  6357. default:
  6358. return e
  6359. }
  6360. }), c = n[r]; r < o; c = n[++r]) g(c) || !v(c) ? s += " " + c : s += " " + a(c);
  6361. return s
  6362. }, r.deprecate = function (e, i) {
  6363. if (y(n.process)) return function () {
  6364. return r.deprecate(e, i).apply(this, arguments)
  6365. };
  6366. if (!0 === t.noDeprecation) return e;
  6367. var o = !1;
  6368. return function () {
  6369. if (!o) {
  6370. if (t.throwDeprecation) throw new Error(i);
  6371. t.traceDeprecation ? console.trace(i) : console.error(i), o = !0
  6372. }
  6373. return e.apply(this, arguments)
  6374. }
  6375. };
  6376. var o, s = {};
  6377. function a(e, t) {
  6378. var n = {
  6379. seen: [],
  6380. stylize: u
  6381. };
  6382. return arguments.length >= 3 && (n.depth = arguments[2]), arguments.length >= 4 && (n.colors = arguments[3]), d(t) ? n.showHidden = t : t && r._extend(n, t), y(n.showHidden) && (n.showHidden = !1), y(n.depth) && (n.depth = 2), y(n.colors) && (n.colors = !1), y(n.customInspect) && (n.customInspect = !0), n.colors && (n.stylize = c), l(n, e, n.depth)
  6383. }
  6384. function c(e, t) {
  6385. var r = a.styles[t];
  6386. return r ? "[" + a.colors[r][0] + "m" + e + "[" + a.colors[r][1] + "m" : e
  6387. }
  6388. function u(e, t) {
  6389. return e
  6390. }
  6391. function l(e, t, n) {
  6392. if (e.customInspect && t && k(t.inspect) && t.inspect !== r.inspect && (!t.constructor || t.constructor.prototype !== t)) {
  6393. var i = t.inspect(n, e);
  6394. return m(i) || (i = l(e, i, n)), i
  6395. }
  6396. var o = function (e, t) {
  6397. if (y(t)) return e.stylize("undefined", "undefined");
  6398. if (m(t)) {
  6399. var r = "'" + JSON.stringify(t).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
  6400. return e.stylize(r, "string")
  6401. }
  6402. if (b(t)) return e.stylize("" + t, "number");
  6403. if (d(t)) return e.stylize("" + t, "boolean");
  6404. if (g(t)) return e.stylize("null", "null")
  6405. }(e, t);
  6406. if (o) return o;
  6407. var s = Object.keys(t),
  6408. a = function (e) {
  6409. var t = {};
  6410. return e.forEach(function (e, r) {
  6411. t[e] = !0
  6412. }), t
  6413. }(s);
  6414. if (e.showHidden && (s = Object.getOwnPropertyNames(t)), S(t) && (s.indexOf("message") >= 0 || s.indexOf("description") >= 0)) return f(t);
  6415. if (0 === s.length) {
  6416. if (k(t)) {
  6417. var c = t.name ? ": " + t.name : "";
  6418. return e.stylize("[Function" + c + "]", "special")
  6419. }
  6420. if (_(t)) return e.stylize(RegExp.prototype.toString.call(t), "regexp");
  6421. if (w(t)) return e.stylize(Date.prototype.toString.call(t), "date");
  6422. if (S(t)) return f(t)
  6423. }
  6424. var u, v = "",
  6425. x = !1,
  6426. E = ["{", "}"];
  6427. (h(t) && (x = !0, E = ["[", "]"]), k(t)) && (v = " [Function" + (t.name ? ": " + t.name : "") + "]");
  6428. return _(t) && (v = " " + RegExp.prototype.toString.call(t)), w(t) && (v = " " + Date.prototype.toUTCString.call(t)), S(t) && (v = " " + f(t)), 0 !== s.length || x && 0 != t.length ? n < 0 ? _(t) ? e.stylize(RegExp.prototype.toString.call(t), "regexp") : e.stylize("[Object]", "special") : (e.seen.push(t), u = x ? function (e, t, r, n, i) {
  6429. for (var o = [], s = 0, a = t.length; s < a; ++s) C(t, String(s)) ? o.push(p(e, t, r, n, String(s), !0)) : o.push("");
  6430. return i.forEach(function (i) {
  6431. i.match(/^\d+$/) || o.push(p(e, t, r, n, i, !0))
  6432. }), o
  6433. }(e, t, n, a, s) : s.map(function (r) {
  6434. return p(e, t, n, a, r, x)
  6435. }), e.seen.pop(), function (e, t, r) {
  6436. if (e.reduce(function (e, t) {
  6437. return 0, t.indexOf("\n") >= 0 && 0, e + t.replace(/\u001b\[\d\d?m/g, "").length + 1
  6438. }, 0) > 60) return r[0] + ("" === t ? "" : t + "\n ") + " " + e.join(",\n ") + " " + r[1];
  6439. return r[0] + t + " " + e.join(", ") + " " + r[1]
  6440. }(u, v, E)) : E[0] + v + E[1]
  6441. }
  6442. function f(e) {
  6443. return "[" + Error.prototype.toString.call(e) + "]"
  6444. }
  6445. function p(e, t, r, n, i, o) {
  6446. var s, a, c;
  6447. if ((c = Object.getOwnPropertyDescriptor(t, i) || {
  6448. value: t[i]
  6449. }).get ? a = c.set ? e.stylize("[Getter/Setter]", "special") : e.stylize("[Getter]", "special") : c.set && (a = e.stylize("[Setter]", "special")), C(n, i) || (s = "[" + i + "]"), a || (e.seen.indexOf(c.value) < 0 ? (a = g(r) ? l(e, c.value, null) : l(e, c.value, r - 1)).indexOf("\n") > -1 && (a = o ? a.split("\n").map(function (e) {
  6450. return " " + e
  6451. }).join("\n").substr(2) : "\n" + a.split("\n").map(function (e) {
  6452. return " " + e
  6453. }).join("\n")) : a = e.stylize("[Circular]", "special")), y(s)) {
  6454. if (o && i.match(/^\d+$/)) return a;
  6455. (s = JSON.stringify("" + i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (s = s.substr(1, s.length - 2), s = e.stylize(s, "name")) : (s = s.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), s = e.stylize(s, "string"))
  6456. }
  6457. return s + ": " + a
  6458. }
  6459. function h(e) {
  6460. return Array.isArray(e)
  6461. }
  6462. function d(e) {
  6463. return "boolean" == typeof e
  6464. }
  6465. function g(e) {
  6466. return null === e
  6467. }
  6468. function b(e) {
  6469. return "number" == typeof e
  6470. }
  6471. function m(e) {
  6472. return "string" == typeof e
  6473. }
  6474. function y(e) {
  6475. return void 0 === e
  6476. }
  6477. function _(e) {
  6478. return v(e) && "[object RegExp]" === x(e)
  6479. }
  6480. function v(e) {
  6481. return "object" == typeof e && null !== e
  6482. }
  6483. function w(e) {
  6484. return v(e) && "[object Date]" === x(e)
  6485. }
  6486. function S(e) {
  6487. return v(e) && ("[object Error]" === x(e) || e instanceof Error)
  6488. }
  6489. function k(e) {
  6490. return "function" == typeof e
  6491. }
  6492. function x(e) {
  6493. return Object.prototype.toString.call(e)
  6494. }
  6495. function E(e) {
  6496. return e < 10 ? "0" + e.toString(10) : e.toString(10)
  6497. }
  6498. r.debuglog = function (e) {
  6499. if (y(o) && (o = t.env.NODE_DEBUG || ""), e = e.toUpperCase(), !s[e])
  6500. if (new RegExp("\\b" + e + "\\b", "i").test(o)) {
  6501. var n = t.pid;
  6502. s[e] = function () {
  6503. var t = r.format.apply(r, arguments);
  6504. console.error("%s %d: %s", e, n, t)
  6505. }
  6506. } else s[e] = function () {};
  6507. return s[e]
  6508. }, r.inspect = a, a.colors = {
  6509. bold: [1, 22],
  6510. italic: [3, 23],
  6511. underline: [4, 24],
  6512. inverse: [7, 27],
  6513. white: [37, 39],
  6514. grey: [90, 39],
  6515. black: [30, 39],
  6516. blue: [34, 39],
  6517. cyan: [36, 39],
  6518. green: [32, 39],
  6519. magenta: [35, 39],
  6520. red: [31, 39],
  6521. yellow: [33, 39]
  6522. }, a.styles = {
  6523. special: "cyan",
  6524. number: "yellow",
  6525. boolean: "yellow",
  6526. undefined: "grey",
  6527. null: "bold",
  6528. string: "green",
  6529. date: "magenta",
  6530. regexp: "red"
  6531. }, r.isArray = h, r.isBoolean = d, r.isNull = g, r.isNullOrUndefined = function (e) {
  6532. return null == e
  6533. }, r.isNumber = b, r.isString = m, r.isSymbol = function (e) {
  6534. return "symbol" == typeof e
  6535. }, r.isUndefined = y, r.isRegExp = _, r.isObject = v, r.isDate = w, r.isError = S, r.isFunction = k, r.isPrimitive = function (e) {
  6536. return null === e || "boolean" == typeof e || "number" == typeof e || "string" == typeof e || "symbol" == typeof e || void 0 === e
  6537. }, r.isBuffer = e("./support/isBuffer");
  6538. var I = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
  6539. function C(e, t) {
  6540. return Object.prototype.hasOwnProperty.call(e, t)
  6541. }
  6542. r.log = function () {
  6543. var e, t;
  6544. console.log("%s - %s", (e = new Date, t = [E(e.getHours()), E(e.getMinutes()), E(e.getSeconds())].join(":"), [e.getDate(), I[e.getMonth()], t].join(" ")), r.format.apply(r, arguments))
  6545. }, r.inherits = e("inherits"), r._extend = function (e, t) {
  6546. if (!t || !v(t)) return e;
  6547. for (var r = Object.keys(t), n = r.length; n--;) e[r[n]] = t[r[n]];
  6548. return e
  6549. }
  6550. }).call(this, e("_process"), "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  6551. }, {
  6552. "./support/isBuffer": 136,
  6553. _process: 101,
  6554. inherits: 135
  6555. }],
  6556. 138: [function (e, t, r) {
  6557. t.exports = function e(t, r) {
  6558. if (t && r) return e(t)(r);
  6559. if ("function" != typeof t) throw new TypeError("need wrapper function");
  6560. Object.keys(t).forEach(function (e) {
  6561. n[e] = t[e]
  6562. });
  6563. return n;
  6564. function n() {
  6565. for (var e = new Array(arguments.length), r = 0; r < e.length; r++) e[r] = arguments[r];
  6566. var n = t.apply(this, e),
  6567. i = e[e.length - 1];
  6568. return "function" == typeof n && n !== i && Object.keys(i).forEach(function (e) {
  6569. n[e] = i[e]
  6570. }), n
  6571. }
  6572. }
  6573. }, {}],
  6574. 139: [function (e, t, r) {
  6575. "use strict";
  6576. t.exports = function () {
  6577. throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")
  6578. }
  6579. }, {}],
  6580. 140: [function (e, t, r) {
  6581. t.exports = function () {
  6582. for (var e = {}, t = 0; t < arguments.length; t++) {
  6583. var r = arguments[t];
  6584. for (var i in r) n.call(r, i) && (e[i] = r[i])
  6585. }
  6586. return e
  6587. };
  6588. var n = Object.prototype.hasOwnProperty
  6589. }, {}]
  6590. }, {}, [9])(9)
  6591. });