vendor.js 1.2 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],[
  2. /* 0 */,
  3. /* 1 */
  4. /*!************************************************************!*\
  5. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  6. \************************************************************/
  7. /*! no static exports found */
  8. /***/ (function(module, exports, __webpack_require__) {
  9. "use strict";
  10. /* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });exports.createApp = createApp;exports.createComponent = createComponent;exports.createPage = createPage;exports.createPlugin = createPlugin;exports.createSubpackageApp = createSubpackageApp;exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 3));
  11. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 4);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}
  12. var realAtob;
  13. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  14. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  15. if (typeof atob !== 'function') {
  16. realAtob = function realAtob(str) {
  17. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  18. if (!b64re.test(str)) {throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");}
  19. // Adding the padding if missing, for semplicity
  20. str += '=='.slice(2 - (str.length & 3));
  21. var bitmap;var result = '';var r1;var r2;var i = 0;
  22. for (; i < str.length;) {
  23. bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 |
  24. (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
  25. result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) :
  26. r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) :
  27. String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  28. }
  29. return result;
  30. };
  31. } else {
  32. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  33. realAtob = atob;
  34. }
  35. function b64DecodeUnicode(str) {
  36. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  37. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  38. }).join(''));
  39. }
  40. function getCurrentUserInfo() {
  41. var token = wx.getStorageSync('uni_id_token') || '';
  42. var tokenArr = token.split('.');
  43. if (!token || tokenArr.length !== 3) {
  44. return {
  45. uid: null,
  46. role: [],
  47. permission: [],
  48. tokenExpired: 0 };
  49. }
  50. var userInfo;
  51. try {
  52. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  53. } catch (error) {
  54. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  55. }
  56. userInfo.tokenExpired = userInfo.exp * 1000;
  57. delete userInfo.exp;
  58. delete userInfo.iat;
  59. return userInfo;
  60. }
  61. function uniIdMixin(Vue) {
  62. Vue.prototype.uniIDHasRole = function (roleId) {var _getCurrentUserInfo =
  63. getCurrentUserInfo(),role = _getCurrentUserInfo.role;
  64. return role.indexOf(roleId) > -1;
  65. };
  66. Vue.prototype.uniIDHasPermission = function (permissionId) {var _getCurrentUserInfo2 =
  67. getCurrentUserInfo(),permission = _getCurrentUserInfo2.permission;
  68. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  69. };
  70. Vue.prototype.uniIDTokenValid = function () {var _getCurrentUserInfo3 =
  71. getCurrentUserInfo(),tokenExpired = _getCurrentUserInfo3.tokenExpired;
  72. return tokenExpired > Date.now();
  73. };
  74. }
  75. var _toString = Object.prototype.toString;
  76. var hasOwnProperty = Object.prototype.hasOwnProperty;
  77. function isFn(fn) {
  78. return typeof fn === 'function';
  79. }
  80. function isStr(str) {
  81. return typeof str === 'string';
  82. }
  83. function isPlainObject(obj) {
  84. return _toString.call(obj) === '[object Object]';
  85. }
  86. function hasOwn(obj, key) {
  87. return hasOwnProperty.call(obj, key);
  88. }
  89. function noop() {}
  90. /**
  91. * Create a cached version of a pure function.
  92. */
  93. function cached(fn) {
  94. var cache = Object.create(null);
  95. return function cachedFn(str) {
  96. var hit = cache[str];
  97. return hit || (cache[str] = fn(str));
  98. };
  99. }
  100. /**
  101. * Camelize a hyphen-delimited string.
  102. */
  103. var camelizeRE = /-(\w)/g;
  104. var camelize = cached(function (str) {
  105. return str.replace(camelizeRE, function (_, c) {return c ? c.toUpperCase() : '';});
  106. });
  107. var HOOKS = [
  108. 'invoke',
  109. 'success',
  110. 'fail',
  111. 'complete',
  112. 'returnValue'];
  113. var globalInterceptors = {};
  114. var scopedInterceptors = {};
  115. function mergeHook(parentVal, childVal) {
  116. var res = childVal ?
  117. parentVal ?
  118. parentVal.concat(childVal) :
  119. Array.isArray(childVal) ?
  120. childVal : [childVal] :
  121. parentVal;
  122. return res ?
  123. dedupeHooks(res) :
  124. res;
  125. }
  126. function dedupeHooks(hooks) {
  127. var res = [];
  128. for (var i = 0; i < hooks.length; i++) {
  129. if (res.indexOf(hooks[i]) === -1) {
  130. res.push(hooks[i]);
  131. }
  132. }
  133. return res;
  134. }
  135. function removeHook(hooks, hook) {
  136. var index = hooks.indexOf(hook);
  137. if (index !== -1) {
  138. hooks.splice(index, 1);
  139. }
  140. }
  141. function mergeInterceptorHook(interceptor, option) {
  142. Object.keys(option).forEach(function (hook) {
  143. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  144. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  145. }
  146. });
  147. }
  148. function removeInterceptorHook(interceptor, option) {
  149. if (!interceptor || !option) {
  150. return;
  151. }
  152. Object.keys(option).forEach(function (hook) {
  153. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  154. removeHook(interceptor[hook], option[hook]);
  155. }
  156. });
  157. }
  158. function addInterceptor(method, option) {
  159. if (typeof method === 'string' && isPlainObject(option)) {
  160. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  161. } else if (isPlainObject(method)) {
  162. mergeInterceptorHook(globalInterceptors, method);
  163. }
  164. }
  165. function removeInterceptor(method, option) {
  166. if (typeof method === 'string') {
  167. if (isPlainObject(option)) {
  168. removeInterceptorHook(scopedInterceptors[method], option);
  169. } else {
  170. delete scopedInterceptors[method];
  171. }
  172. } else if (isPlainObject(method)) {
  173. removeInterceptorHook(globalInterceptors, method);
  174. }
  175. }
  176. function wrapperHook(hook) {
  177. return function (data) {
  178. return hook(data) || data;
  179. };
  180. }
  181. function isPromise(obj) {
  182. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  183. }
  184. function queue(hooks, data) {
  185. var promise = false;
  186. for (var i = 0; i < hooks.length; i++) {
  187. var hook = hooks[i];
  188. if (promise) {
  189. promise = Promise.resolve(wrapperHook(hook));
  190. } else {
  191. var res = hook(data);
  192. if (isPromise(res)) {
  193. promise = Promise.resolve(res);
  194. }
  195. if (res === false) {
  196. return {
  197. then: function then() {} };
  198. }
  199. }
  200. }
  201. return promise || {
  202. then: function then(callback) {
  203. return callback(data);
  204. } };
  205. }
  206. function wrapperOptions(interceptor) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  207. ['success', 'fail', 'complete'].forEach(function (name) {
  208. if (Array.isArray(interceptor[name])) {
  209. var oldCallback = options[name];
  210. options[name] = function callbackInterceptor(res) {
  211. queue(interceptor[name], res).then(function (res) {
  212. /* eslint-disable no-mixed-operators */
  213. return isFn(oldCallback) && oldCallback(res) || res;
  214. });
  215. };
  216. }
  217. });
  218. return options;
  219. }
  220. function wrapperReturnValue(method, returnValue) {
  221. var returnValueHooks = [];
  222. if (Array.isArray(globalInterceptors.returnValue)) {
  223. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(globalInterceptors.returnValue));
  224. }
  225. var interceptor = scopedInterceptors[method];
  226. if (interceptor && Array.isArray(interceptor.returnValue)) {
  227. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(interceptor.returnValue));
  228. }
  229. returnValueHooks.forEach(function (hook) {
  230. returnValue = hook(returnValue) || returnValue;
  231. });
  232. return returnValue;
  233. }
  234. function getApiInterceptorHooks(method) {
  235. var interceptor = Object.create(null);
  236. Object.keys(globalInterceptors).forEach(function (hook) {
  237. if (hook !== 'returnValue') {
  238. interceptor[hook] = globalInterceptors[hook].slice();
  239. }
  240. });
  241. var scopedInterceptor = scopedInterceptors[method];
  242. if (scopedInterceptor) {
  243. Object.keys(scopedInterceptor).forEach(function (hook) {
  244. if (hook !== 'returnValue') {
  245. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  246. }
  247. });
  248. }
  249. return interceptor;
  250. }
  251. function invokeApi(method, api, options) {for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {params[_key - 3] = arguments[_key];}
  252. var interceptor = getApiInterceptorHooks(method);
  253. if (interceptor && Object.keys(interceptor).length) {
  254. if (Array.isArray(interceptor.invoke)) {
  255. var res = queue(interceptor.invoke, options);
  256. return res.then(function (options) {
  257. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  258. });
  259. } else {
  260. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  261. }
  262. }
  263. return api.apply(void 0, [options].concat(params));
  264. }
  265. var promiseInterceptor = {
  266. returnValue: function returnValue(res) {
  267. if (!isPromise(res)) {
  268. return res;
  269. }
  270. return new Promise(function (resolve, reject) {
  271. res.then(function (res) {
  272. if (res[0]) {
  273. reject(res[0]);
  274. } else {
  275. resolve(res[1]);
  276. }
  277. });
  278. });
  279. } };
  280. var SYNC_API_RE =
  281. /^\$|Window$|WindowStyle$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale/;
  282. var CONTEXT_API_RE = /^create|Manager$/;
  283. // Context例外情况
  284. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  285. // 同步例外情况
  286. var ASYNC_API = ['createBLEConnection'];
  287. var CALLBACK_API_RE = /^on|^off/;
  288. function isContextApi(name) {
  289. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  290. }
  291. function isSyncApi(name) {
  292. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  293. }
  294. function isCallbackApi(name) {
  295. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  296. }
  297. function handlePromise(promise) {
  298. return promise.then(function (data) {
  299. return [null, data];
  300. }).
  301. catch(function (err) {return [err];});
  302. }
  303. function shouldPromise(name) {
  304. if (
  305. isContextApi(name) ||
  306. isSyncApi(name) ||
  307. isCallbackApi(name))
  308. {
  309. return false;
  310. }
  311. return true;
  312. }
  313. /* eslint-disable no-extend-native */
  314. if (!Promise.prototype.finally) {
  315. Promise.prototype.finally = function (callback) {
  316. var promise = this.constructor;
  317. return this.then(
  318. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  319. function (reason) {return promise.resolve(callback()).then(function () {
  320. throw reason;
  321. });});
  322. };
  323. }
  324. function promisify(name, api) {
  325. if (!shouldPromise(name)) {
  326. return api;
  327. }
  328. return function promiseApi() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {params[_key2 - 1] = arguments[_key2];}
  329. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  330. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  331. }
  332. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  333. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  334. success: resolve,
  335. fail: reject })].concat(
  336. params));
  337. })));
  338. };
  339. }
  340. var EPS = 1e-4;
  341. var BASE_DEVICE_WIDTH = 750;
  342. var isIOS = false;
  343. var deviceWidth = 0;
  344. var deviceDPR = 0;
  345. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  346. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  347. deviceWidth = windowWidth;
  348. deviceDPR = pixelRatio;
  349. isIOS = platform === 'ios';
  350. }
  351. function upx2px(number, newDeviceWidth) {
  352. if (deviceWidth === 0) {
  353. checkDeviceWidth();
  354. }
  355. number = Number(number);
  356. if (number === 0) {
  357. return 0;
  358. }
  359. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  360. if (result < 0) {
  361. result = -result;
  362. }
  363. result = Math.floor(result + EPS);
  364. if (result === 0) {
  365. if (deviceDPR === 1 || !isIOS) {
  366. result = 1;
  367. } else {
  368. result = 0.5;
  369. }
  370. }
  371. return number < 0 ? -result : result;
  372. }
  373. function getLocale() {
  374. // 优先使用 $locale
  375. var app = getApp({
  376. allowDefault: true });
  377. if (app && app.$vm) {
  378. return app.$vm.$locale;
  379. }
  380. return wx.getSystemInfoSync().language || 'zh-Hans';
  381. }
  382. function setLocale(locale) {
  383. var app = getApp();
  384. if (!app) {
  385. return false;
  386. }
  387. var oldLocale = app.$vm.$locale;
  388. if (oldLocale !== locale) {
  389. app.$vm.$locale = locale;
  390. onLocaleChangeCallbacks.forEach(function (fn) {return fn({
  391. locale: locale });});
  392. return true;
  393. }
  394. return false;
  395. }
  396. var onLocaleChangeCallbacks = [];
  397. function onLocaleChange(fn) {
  398. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  399. onLocaleChangeCallbacks.push(fn);
  400. }
  401. }
  402. if (typeof global !== 'undefined') {
  403. global.getLocale = getLocale;
  404. }
  405. var interceptors = {
  406. promiseInterceptor: promiseInterceptor };
  407. var baseApi = /*#__PURE__*/Object.freeze({
  408. __proto__: null,
  409. upx2px: upx2px,
  410. getLocale: getLocale,
  411. setLocale: setLocale,
  412. onLocaleChange: onLocaleChange,
  413. addInterceptor: addInterceptor,
  414. removeInterceptor: removeInterceptor,
  415. interceptors: interceptors });
  416. function findExistsPageIndex(url) {
  417. var pages = getCurrentPages();
  418. var len = pages.length;
  419. while (len--) {
  420. var page = pages[len];
  421. if (page.$page && page.$page.fullPath === url) {
  422. return len;
  423. }
  424. }
  425. return -1;
  426. }
  427. var redirectTo = {
  428. name: function name(fromArgs) {
  429. if (fromArgs.exists === 'back' && fromArgs.delta) {
  430. return 'navigateBack';
  431. }
  432. return 'redirectTo';
  433. },
  434. args: function args(fromArgs) {
  435. if (fromArgs.exists === 'back' && fromArgs.url) {
  436. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  437. if (existsPageIndex !== -1) {
  438. var delta = getCurrentPages().length - 1 - existsPageIndex;
  439. if (delta > 0) {
  440. fromArgs.delta = delta;
  441. }
  442. }
  443. }
  444. } };
  445. var previewImage = {
  446. args: function args(fromArgs) {
  447. var currentIndex = parseInt(fromArgs.current);
  448. if (isNaN(currentIndex)) {
  449. return;
  450. }
  451. var urls = fromArgs.urls;
  452. if (!Array.isArray(urls)) {
  453. return;
  454. }
  455. var len = urls.length;
  456. if (!len) {
  457. return;
  458. }
  459. if (currentIndex < 0) {
  460. currentIndex = 0;
  461. } else if (currentIndex >= len) {
  462. currentIndex = len - 1;
  463. }
  464. if (currentIndex > 0) {
  465. fromArgs.current = urls[currentIndex];
  466. fromArgs.urls = urls.filter(
  467. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  468. } else {
  469. fromArgs.current = urls[0];
  470. }
  471. return {
  472. indicator: false,
  473. loop: false };
  474. } };
  475. var UUID_KEY = '__DC_STAT_UUID';
  476. var deviceId;
  477. function addUuid(result) {
  478. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  479. if (!deviceId) {
  480. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  481. wx.setStorage({
  482. key: UUID_KEY,
  483. data: deviceId });
  484. }
  485. result.deviceId = deviceId;
  486. }
  487. function addSafeAreaInsets(result) {
  488. if (result.safeArea) {
  489. var safeArea = result.safeArea;
  490. result.safeAreaInsets = {
  491. top: safeArea.top,
  492. left: safeArea.left,
  493. right: result.windowWidth - safeArea.right,
  494. bottom: result.windowHeight - safeArea.bottom };
  495. }
  496. }
  497. var getSystemInfo = {
  498. returnValue: function returnValue(result) {
  499. addUuid(result);
  500. addSafeAreaInsets(result);
  501. } };
  502. // import navigateTo from 'uni-helpers/navigate-to'
  503. var protocols = {
  504. redirectTo: redirectTo,
  505. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  506. previewImage: previewImage,
  507. getSystemInfo: getSystemInfo,
  508. getSystemInfoSync: getSystemInfo };
  509. var todos = [
  510. 'vibrate',
  511. 'preloadPage',
  512. 'unPreloadPage',
  513. 'loadSubPackage'];
  514. var canIUses = [];
  515. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  516. function processCallback(methodName, method, returnValue) {
  517. return function (res) {
  518. return method(processReturnValue(methodName, res, returnValue));
  519. };
  520. }
  521. function processArgs(methodName, fromArgs) {var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  522. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  523. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  524. if (isFn(argsOption)) {
  525. argsOption = argsOption(fromArgs, toArgs) || {};
  526. }
  527. for (var key in fromArgs) {
  528. if (hasOwn(argsOption, key)) {
  529. var keyOption = argsOption[key];
  530. if (isFn(keyOption)) {
  531. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  532. }
  533. if (!keyOption) {// 不支持的参数
  534. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  535. } else if (isStr(keyOption)) {// 重写参数 key
  536. toArgs[keyOption] = fromArgs[key];
  537. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  538. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  539. }
  540. } else if (CALLBACKS.indexOf(key) !== -1) {
  541. if (isFn(fromArgs[key])) {
  542. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  543. }
  544. } else {
  545. if (!keepFromArgs) {
  546. toArgs[key] = fromArgs[key];
  547. }
  548. }
  549. }
  550. return toArgs;
  551. } else if (isFn(fromArgs)) {
  552. fromArgs = processCallback(methodName, fromArgs, returnValue);
  553. }
  554. return fromArgs;
  555. }
  556. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  557. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  558. res = protocols.returnValue(methodName, res);
  559. }
  560. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  561. }
  562. function wrapper(methodName, method) {
  563. if (hasOwn(protocols, methodName)) {
  564. var protocol = protocols[methodName];
  565. if (!protocol) {// 暂不支持的 api
  566. return function () {
  567. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  568. };
  569. }
  570. return function (arg1, arg2) {// 目前 api 最多两个参数
  571. var options = protocol;
  572. if (isFn(protocol)) {
  573. options = protocol(arg1);
  574. }
  575. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  576. var args = [arg1];
  577. if (typeof arg2 !== 'undefined') {
  578. args.push(arg2);
  579. }
  580. if (isFn(options.name)) {
  581. methodName = options.name(arg1);
  582. } else if (isStr(options.name)) {
  583. methodName = options.name;
  584. }
  585. var returnValue = wx[methodName].apply(wx, args);
  586. if (isSyncApi(methodName)) {// 同步 api
  587. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  588. }
  589. return returnValue;
  590. };
  591. }
  592. return method;
  593. }
  594. var todoApis = Object.create(null);
  595. var TODOS = [
  596. 'onTabBarMidButtonTap',
  597. 'subscribePush',
  598. 'unsubscribePush',
  599. 'onPush',
  600. 'offPush',
  601. 'share'];
  602. function createTodoApi(name) {
  603. return function todoApi(_ref)
  604. {var fail = _ref.fail,complete = _ref.complete;
  605. var res = {
  606. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported") };
  607. isFn(fail) && fail(res);
  608. isFn(complete) && complete(res);
  609. };
  610. }
  611. TODOS.forEach(function (name) {
  612. todoApis[name] = createTodoApi(name);
  613. });
  614. var providers = {
  615. oauth: ['weixin'],
  616. share: ['weixin'],
  617. payment: ['wxpay'],
  618. push: ['weixin'] };
  619. function getProvider(_ref2)
  620. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  621. var res = false;
  622. if (providers[service]) {
  623. res = {
  624. errMsg: 'getProvider:ok',
  625. service: service,
  626. provider: providers[service] };
  627. isFn(success) && success(res);
  628. } else {
  629. res = {
  630. errMsg: 'getProvider:fail service not found' };
  631. isFn(fail) && fail(res);
  632. }
  633. isFn(complete) && complete(res);
  634. }
  635. var extraApi = /*#__PURE__*/Object.freeze({
  636. __proto__: null,
  637. getProvider: getProvider });
  638. var getEmitter = function () {
  639. var Emitter;
  640. return function getUniEmitter() {
  641. if (!Emitter) {
  642. Emitter = new _vue.default();
  643. }
  644. return Emitter;
  645. };
  646. }();
  647. function apply(ctx, method, args) {
  648. return ctx[method].apply(ctx, args);
  649. }
  650. function $on() {
  651. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  652. }
  653. function $off() {
  654. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  655. }
  656. function $once() {
  657. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  658. }
  659. function $emit() {
  660. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  661. }
  662. var eventApi = /*#__PURE__*/Object.freeze({
  663. __proto__: null,
  664. $on: $on,
  665. $off: $off,
  666. $once: $once,
  667. $emit: $emit });
  668. var api = /*#__PURE__*/Object.freeze({
  669. __proto__: null });
  670. var MPPage = Page;
  671. var MPComponent = Component;
  672. var customizeRE = /:/g;
  673. var customize = cached(function (str) {
  674. return camelize(str.replace(customizeRE, '-'));
  675. });
  676. function initTriggerEvent(mpInstance) {
  677. var oldTriggerEvent = mpInstance.triggerEvent;
  678. mpInstance.triggerEvent = function (event) {for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {args[_key3 - 1] = arguments[_key3];}
  679. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  680. };
  681. }
  682. function initHook(name, options, isComponent) {
  683. var oldHook = options[name];
  684. if (!oldHook) {
  685. options[name] = function () {
  686. initTriggerEvent(this);
  687. };
  688. } else {
  689. options[name] = function () {
  690. initTriggerEvent(this);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}
  691. return oldHook.apply(this, args);
  692. };
  693. }
  694. }
  695. if (!MPPage.__$wrappered) {
  696. MPPage.__$wrappered = true;
  697. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  698. initHook('onLoad', options);
  699. return MPPage(options);
  700. };
  701. Page.after = MPPage.after;
  702. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  703. initHook('created', options);
  704. return MPComponent(options);
  705. };
  706. }
  707. var PAGE_EVENT_HOOKS = [
  708. 'onPullDownRefresh',
  709. 'onReachBottom',
  710. 'onAddToFavorites',
  711. 'onShareTimeline',
  712. 'onShareAppMessage',
  713. 'onPageScroll',
  714. 'onResize',
  715. 'onTabItemTap'];
  716. function initMocks(vm, mocks) {
  717. var mpInstance = vm.$mp[vm.mpType];
  718. mocks.forEach(function (mock) {
  719. if (hasOwn(mpInstance, mock)) {
  720. vm[mock] = mpInstance[mock];
  721. }
  722. });
  723. }
  724. function hasHook(hook, vueOptions) {
  725. if (!vueOptions) {
  726. return true;
  727. }
  728. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  729. return true;
  730. }
  731. vueOptions = vueOptions.default || vueOptions;
  732. if (isFn(vueOptions)) {
  733. if (isFn(vueOptions.extendOptions[hook])) {
  734. return true;
  735. }
  736. if (vueOptions.super &&
  737. vueOptions.super.options &&
  738. Array.isArray(vueOptions.super.options[hook])) {
  739. return true;
  740. }
  741. return false;
  742. }
  743. if (isFn(vueOptions[hook])) {
  744. return true;
  745. }
  746. var mixins = vueOptions.mixins;
  747. if (Array.isArray(mixins)) {
  748. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  749. }
  750. }
  751. function initHooks(mpOptions, hooks, vueOptions) {
  752. hooks.forEach(function (hook) {
  753. if (hasHook(hook, vueOptions)) {
  754. mpOptions[hook] = function (args) {
  755. return this.$vm && this.$vm.__call_hook(hook, args);
  756. };
  757. }
  758. });
  759. }
  760. function initVueComponent(Vue, vueOptions) {
  761. vueOptions = vueOptions.default || vueOptions;
  762. var VueComponent;
  763. if (isFn(vueOptions)) {
  764. VueComponent = vueOptions;
  765. } else {
  766. VueComponent = Vue.extend(vueOptions);
  767. }
  768. vueOptions = VueComponent.options;
  769. return [VueComponent, vueOptions];
  770. }
  771. function initSlots(vm, vueSlots) {
  772. if (Array.isArray(vueSlots) && vueSlots.length) {
  773. var $slots = Object.create(null);
  774. vueSlots.forEach(function (slotName) {
  775. $slots[slotName] = true;
  776. });
  777. vm.$scopedSlots = vm.$slots = $slots;
  778. }
  779. }
  780. function initVueIds(vueIds, mpInstance) {
  781. vueIds = (vueIds || '').split(',');
  782. var len = vueIds.length;
  783. if (len === 1) {
  784. mpInstance._$vueId = vueIds[0];
  785. } else if (len === 2) {
  786. mpInstance._$vueId = vueIds[0];
  787. mpInstance._$vuePid = vueIds[1];
  788. }
  789. }
  790. function initData(vueOptions, context) {
  791. var data = vueOptions.data || {};
  792. var methods = vueOptions.methods || {};
  793. if (typeof data === 'function') {
  794. try {
  795. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  796. } catch (e) {
  797. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"caimei-applets-hehe","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  798. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  799. }
  800. }
  801. } else {
  802. try {
  803. // 对 data 格式化
  804. data = JSON.parse(JSON.stringify(data));
  805. } catch (e) {}
  806. }
  807. if (!isPlainObject(data)) {
  808. data = {};
  809. }
  810. Object.keys(methods).forEach(function (methodName) {
  811. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  812. data[methodName] = methods[methodName];
  813. }
  814. });
  815. return data;
  816. }
  817. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  818. function createObserver(name) {
  819. return function observer(newVal, oldVal) {
  820. if (this.$vm) {
  821. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  822. }
  823. };
  824. }
  825. function initBehaviors(vueOptions, initBehavior) {
  826. var vueBehaviors = vueOptions.behaviors;
  827. var vueExtends = vueOptions.extends;
  828. var vueMixins = vueOptions.mixins;
  829. var vueProps = vueOptions.props;
  830. if (!vueProps) {
  831. vueOptions.props = vueProps = [];
  832. }
  833. var behaviors = [];
  834. if (Array.isArray(vueBehaviors)) {
  835. vueBehaviors.forEach(function (behavior) {
  836. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  837. if (behavior === 'uni://form-field') {
  838. if (Array.isArray(vueProps)) {
  839. vueProps.push('name');
  840. vueProps.push('value');
  841. } else {
  842. vueProps.name = {
  843. type: String,
  844. default: '' };
  845. vueProps.value = {
  846. type: [String, Number, Boolean, Array, Object, Date],
  847. default: '' };
  848. }
  849. }
  850. });
  851. }
  852. if (isPlainObject(vueExtends) && vueExtends.props) {
  853. behaviors.push(
  854. initBehavior({
  855. properties: initProperties(vueExtends.props, true) }));
  856. }
  857. if (Array.isArray(vueMixins)) {
  858. vueMixins.forEach(function (vueMixin) {
  859. if (isPlainObject(vueMixin) && vueMixin.props) {
  860. behaviors.push(
  861. initBehavior({
  862. properties: initProperties(vueMixin.props, true) }));
  863. }
  864. });
  865. }
  866. return behaviors;
  867. }
  868. function parsePropType(key, type, defaultValue, file) {
  869. // [String]=>String
  870. if (Array.isArray(type) && type.length === 1) {
  871. return type[0];
  872. }
  873. return type;
  874. }
  875. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  876. var properties = {};
  877. if (!isBehavior) {
  878. properties.vueId = {
  879. type: String,
  880. value: '' };
  881. // 用于字节跳动小程序模拟抽象节点
  882. properties.generic = {
  883. type: Object,
  884. value: null };
  885. // scopedSlotsCompiler auto
  886. properties.scopedSlotsCompiler = {
  887. type: String,
  888. value: '' };
  889. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  890. type: null,
  891. value: [],
  892. observer: function observer(newVal, oldVal) {
  893. var $slots = Object.create(null);
  894. newVal.forEach(function (slotName) {
  895. $slots[slotName] = true;
  896. });
  897. this.setData({
  898. $slots: $slots });
  899. } };
  900. }
  901. if (Array.isArray(props)) {// ['title']
  902. props.forEach(function (key) {
  903. properties[key] = {
  904. type: null,
  905. observer: createObserver(key) };
  906. });
  907. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  908. Object.keys(props).forEach(function (key) {
  909. var opts = props[key];
  910. if (isPlainObject(opts)) {// title:{type:String,default:''}
  911. var value = opts.default;
  912. if (isFn(value)) {
  913. value = value();
  914. }
  915. opts.type = parsePropType(key, opts.type);
  916. properties[key] = {
  917. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  918. value: value,
  919. observer: createObserver(key) };
  920. } else {// content:String
  921. var type = parsePropType(key, opts);
  922. properties[key] = {
  923. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  924. observer: createObserver(key) };
  925. }
  926. });
  927. }
  928. return properties;
  929. }
  930. function wrapper$1(event) {
  931. // TODO 又得兼容 mpvue 的 mp 对象
  932. try {
  933. event.mp = JSON.parse(JSON.stringify(event));
  934. } catch (e) {}
  935. event.stopPropagation = noop;
  936. event.preventDefault = noop;
  937. event.target = event.target || {};
  938. if (!hasOwn(event, 'detail')) {
  939. event.detail = {};
  940. }
  941. if (hasOwn(event, 'markerId')) {
  942. event.detail = typeof event.detail === 'object' ? event.detail : {};
  943. event.detail.markerId = event.markerId;
  944. }
  945. if (isPlainObject(event.detail)) {
  946. event.target = Object.assign({}, event.target, event.detail);
  947. }
  948. return event;
  949. }
  950. function getExtraValue(vm, dataPathsArray) {
  951. var context = vm;
  952. dataPathsArray.forEach(function (dataPathArray) {
  953. var dataPath = dataPathArray[0];
  954. var value = dataPathArray[2];
  955. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  956. var propPath = dataPathArray[1];
  957. var valuePath = dataPathArray[3];
  958. var vFor;
  959. if (Number.isInteger(dataPath)) {
  960. vFor = dataPath;
  961. } else if (!dataPath) {
  962. vFor = context;
  963. } else if (typeof dataPath === 'string' && dataPath) {
  964. if (dataPath.indexOf('#s#') === 0) {
  965. vFor = dataPath.substr(3);
  966. } else {
  967. vFor = vm.__get_value(dataPath, context);
  968. }
  969. }
  970. if (Number.isInteger(vFor)) {
  971. context = value;
  972. } else if (!propPath) {
  973. context = vFor[value];
  974. } else {
  975. if (Array.isArray(vFor)) {
  976. context = vFor.find(function (vForItem) {
  977. return vm.__get_value(propPath, vForItem) === value;
  978. });
  979. } else if (isPlainObject(vFor)) {
  980. context = Object.keys(vFor).find(function (vForKey) {
  981. return vm.__get_value(propPath, vFor[vForKey]) === value;
  982. });
  983. } else {
  984. console.error('v-for 暂不支持循环数据:', vFor);
  985. }
  986. }
  987. if (valuePath) {
  988. context = vm.__get_value(valuePath, context);
  989. }
  990. }
  991. });
  992. return context;
  993. }
  994. function processEventExtra(vm, extra, event) {
  995. var extraObj = {};
  996. if (Array.isArray(extra) && extra.length) {
  997. /**
  998. *[
  999. * ['data.items', 'data.id', item.data.id],
  1000. * ['metas', 'id', meta.id]
  1001. *],
  1002. *[
  1003. * ['data.items', 'data.id', item.data.id],
  1004. * ['metas', 'id', meta.id]
  1005. *],
  1006. *'test'
  1007. */
  1008. extra.forEach(function (dataPath, index) {
  1009. if (typeof dataPath === 'string') {
  1010. if (!dataPath) {// model,prop.sync
  1011. extraObj['$' + index] = vm;
  1012. } else {
  1013. if (dataPath === '$event') {// $event
  1014. extraObj['$' + index] = event;
  1015. } else if (dataPath === 'arguments') {
  1016. if (event.detail && event.detail.__args__) {
  1017. extraObj['$' + index] = event.detail.__args__;
  1018. } else {
  1019. extraObj['$' + index] = [event];
  1020. }
  1021. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  1022. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  1023. } else {
  1024. extraObj['$' + index] = vm.__get_value(dataPath);
  1025. }
  1026. }
  1027. } else {
  1028. extraObj['$' + index] = getExtraValue(vm, dataPath);
  1029. }
  1030. });
  1031. }
  1032. return extraObj;
  1033. }
  1034. function getObjByArray(arr) {
  1035. var obj = {};
  1036. for (var i = 1; i < arr.length; i++) {
  1037. var element = arr[i];
  1038. obj[element[0]] = element[1];
  1039. }
  1040. return obj;
  1041. }
  1042. function processEventArgs(vm, event) {var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];var isCustom = arguments.length > 4 ? arguments[4] : undefined;var methodName = arguments.length > 5 ? arguments[5] : undefined;
  1043. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1044. if (isCustom) {// 自定义事件
  1045. isCustomMPEvent = event.currentTarget &&
  1046. event.currentTarget.dataset &&
  1047. event.currentTarget.dataset.comType === 'wx';
  1048. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  1049. if (isCustomMPEvent) {
  1050. return [event];
  1051. }
  1052. return event.detail.__args__ || event.detail;
  1053. }
  1054. }
  1055. var extraObj = processEventExtra(vm, extra, event);
  1056. var ret = [];
  1057. args.forEach(function (arg) {
  1058. if (arg === '$event') {
  1059. if (methodName === '__set_model' && !isCustom) {// input v-model value
  1060. ret.push(event.target.value);
  1061. } else {
  1062. if (isCustom && !isCustomMPEvent) {
  1063. ret.push(event.detail.__args__[0]);
  1064. } else {// wxcomponent 组件或内置组件
  1065. ret.push(event);
  1066. }
  1067. }
  1068. } else {
  1069. if (Array.isArray(arg) && arg[0] === 'o') {
  1070. ret.push(getObjByArray(arg));
  1071. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1072. ret.push(extraObj[arg]);
  1073. } else {
  1074. ret.push(arg);
  1075. }
  1076. }
  1077. });
  1078. return ret;
  1079. }
  1080. var ONCE = '~';
  1081. var CUSTOM = '^';
  1082. function isMatchEventType(eventType, optType) {
  1083. return eventType === optType ||
  1084. optType === 'regionchange' && (
  1085. eventType === 'begin' ||
  1086. eventType === 'end');
  1087. }
  1088. function getContextVm(vm) {
  1089. var $parent = vm.$parent;
  1090. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1091. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1092. $parent = $parent.$parent;
  1093. }
  1094. return $parent && $parent.$parent;
  1095. }
  1096. function handleEvent(event) {var _this = this;
  1097. event = wrapper$1(event);
  1098. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1099. var dataset = (event.currentTarget || event.target).dataset;
  1100. if (!dataset) {
  1101. return console.warn('事件信息不存在');
  1102. }
  1103. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1104. if (!eventOpts) {
  1105. return console.warn('事件信息不存在');
  1106. }
  1107. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1108. var eventType = event.type;
  1109. var ret = [];
  1110. eventOpts.forEach(function (eventOpt) {
  1111. var type = eventOpt[0];
  1112. var eventsArray = eventOpt[1];
  1113. var isCustom = type.charAt(0) === CUSTOM;
  1114. type = isCustom ? type.slice(1) : type;
  1115. var isOnce = type.charAt(0) === ONCE;
  1116. type = isOnce ? type.slice(1) : type;
  1117. if (eventsArray && isMatchEventType(eventType, type)) {
  1118. eventsArray.forEach(function (eventArray) {
  1119. var methodName = eventArray[0];
  1120. if (methodName) {
  1121. var handlerCtx = _this.$vm;
  1122. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1123. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1124. }
  1125. if (methodName === '$emit') {
  1126. handlerCtx.$emit.apply(handlerCtx,
  1127. processEventArgs(
  1128. _this.$vm,
  1129. event,
  1130. eventArray[1],
  1131. eventArray[2],
  1132. isCustom,
  1133. methodName));
  1134. return;
  1135. }
  1136. var handler = handlerCtx[methodName];
  1137. if (!isFn(handler)) {
  1138. throw new Error(" _vm.".concat(methodName, " is not a function"));
  1139. }
  1140. if (isOnce) {
  1141. if (handler.once) {
  1142. return;
  1143. }
  1144. handler.once = true;
  1145. }
  1146. var params = processEventArgs(
  1147. _this.$vm,
  1148. event,
  1149. eventArray[1],
  1150. eventArray[2],
  1151. isCustom,
  1152. methodName);
  1153. params = Array.isArray(params) ? params : [];
  1154. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1155. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1156. // eslint-disable-next-line no-sparse-arrays
  1157. params = params.concat([,,,,,,,,,, event]);
  1158. }
  1159. ret.push(handler.apply(handlerCtx, params));
  1160. }
  1161. });
  1162. }
  1163. });
  1164. if (
  1165. eventType === 'input' &&
  1166. ret.length === 1 &&
  1167. typeof ret[0] !== 'undefined')
  1168. {
  1169. return ret[0];
  1170. }
  1171. }
  1172. var locale;
  1173. {
  1174. locale = wx.getSystemInfoSync().language;
  1175. }
  1176. var i18n = (0, _uniI18n.initVueI18n)(
  1177. locale,
  1178. {});
  1179. var t = i18n.t;
  1180. var i18nMixin = i18n.mixin = {
  1181. beforeCreate: function beforeCreate() {var _this2 = this;
  1182. var unwatch = i18n.i18n.watchLocale(function () {
  1183. _this2.$forceUpdate();
  1184. });
  1185. this.$once('hook:beforeDestroy', function () {
  1186. unwatch();
  1187. });
  1188. },
  1189. methods: {
  1190. $$t: function $$t(key, values) {
  1191. return t(key, values);
  1192. } } };
  1193. var setLocale$1 = i18n.setLocale;
  1194. var getLocale$1 = i18n.getLocale;
  1195. function initAppLocale(Vue, appVm, locale) {
  1196. var state = Vue.observable({
  1197. locale: locale || i18n.getLocale() });
  1198. var localeWatchers = [];
  1199. appVm.$watchLocale = function (fn) {
  1200. localeWatchers.push(fn);
  1201. };
  1202. Object.defineProperty(appVm, '$locale', {
  1203. get: function get() {
  1204. return state.locale;
  1205. },
  1206. set: function set(v) {
  1207. state.locale = v;
  1208. localeWatchers.forEach(function (watch) {return watch(v);});
  1209. } });
  1210. }
  1211. var eventChannels = {};
  1212. var eventChannelStack = [];
  1213. function getEventChannel(id) {
  1214. if (id) {
  1215. var eventChannel = eventChannels[id];
  1216. delete eventChannels[id];
  1217. return eventChannel;
  1218. }
  1219. return eventChannelStack.shift();
  1220. }
  1221. var hooks = [
  1222. 'onShow',
  1223. 'onHide',
  1224. 'onError',
  1225. 'onPageNotFound',
  1226. 'onThemeChange',
  1227. 'onUnhandledRejection'];
  1228. function initEventChannel() {
  1229. _vue.default.prototype.getOpenerEventChannel = function () {
  1230. // 微信小程序使用自身getOpenerEventChannel
  1231. {
  1232. return this.$scope.getOpenerEventChannel();
  1233. }
  1234. };
  1235. var callHook = _vue.default.prototype.__call_hook;
  1236. _vue.default.prototype.__call_hook = function (hook, args) {
  1237. if (hook === 'onLoad' && args && args.__id__) {
  1238. this.__eventChannel__ = getEventChannel(args.__id__);
  1239. delete args.__id__;
  1240. }
  1241. return callHook.call(this, hook, args);
  1242. };
  1243. }
  1244. function initScopedSlotsParams() {
  1245. var center = {};
  1246. var parents = {};
  1247. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1248. var has = center[vueId];
  1249. if (!has) {
  1250. parents[vueId] = this;
  1251. this.$on('hook:destroyed', function () {
  1252. delete parents[vueId];
  1253. });
  1254. }
  1255. return has;
  1256. };
  1257. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1258. var data = center[vueId];
  1259. if (data) {
  1260. var object = data[name] || {};
  1261. return key ? object[key] : object;
  1262. } else {
  1263. parents[vueId] = this;
  1264. this.$on('hook:destroyed', function () {
  1265. delete parents[vueId];
  1266. });
  1267. }
  1268. };
  1269. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1270. var vueIds = this.$options.propsData.vueId;
  1271. if (vueIds) {
  1272. var vueId = vueIds.split(',')[0];
  1273. var object = center[vueId] = center[vueId] || {};
  1274. object[name] = value;
  1275. if (parents[vueId]) {
  1276. parents[vueId].$forceUpdate();
  1277. }
  1278. }
  1279. };
  1280. _vue.default.mixin({
  1281. destroyed: function destroyed() {
  1282. var propsData = this.$options.propsData;
  1283. var vueId = propsData && propsData.vueId;
  1284. if (vueId) {
  1285. delete center[vueId];
  1286. delete parents[vueId];
  1287. }
  1288. } });
  1289. }
  1290. function parseBaseApp(vm, _ref3)
  1291. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1292. initEventChannel();
  1293. {
  1294. initScopedSlotsParams();
  1295. }
  1296. if (vm.$options.store) {
  1297. _vue.default.prototype.$store = vm.$options.store;
  1298. }
  1299. uniIdMixin(_vue.default);
  1300. _vue.default.prototype.mpHost = "mp-weixin";
  1301. _vue.default.mixin({
  1302. beforeCreate: function beforeCreate() {
  1303. if (!this.$options.mpType) {
  1304. return;
  1305. }
  1306. this.mpType = this.$options.mpType;
  1307. this.$mp = _defineProperty({
  1308. data: {} },
  1309. this.mpType, this.$options.mpInstance);
  1310. this.$scope = this.$options.mpInstance;
  1311. delete this.$options.mpType;
  1312. delete this.$options.mpInstance;
  1313. if (this.mpType === 'page' && typeof getApp === 'function') {// hack vue-i18n
  1314. var app = getApp();
  1315. if (app.$vm && app.$vm.$i18n) {
  1316. this._i18n = app.$vm.$i18n;
  1317. }
  1318. }
  1319. if (this.mpType !== 'app') {
  1320. initRefs(this);
  1321. initMocks(this, mocks);
  1322. }
  1323. } });
  1324. var appOptions = {
  1325. onLaunch: function onLaunch(args) {
  1326. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1327. return;
  1328. }
  1329. {
  1330. if (wx.canIUse && !wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1331. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1332. }
  1333. }
  1334. this.$vm = vm;
  1335. this.$vm.$mp = {
  1336. app: this };
  1337. this.$vm.$scope = this;
  1338. // vm 上也挂载 globalData
  1339. this.$vm.globalData = this.globalData;
  1340. this.$vm._isMounted = true;
  1341. this.$vm.__call_hook('mounted', args);
  1342. this.$vm.__call_hook('onLaunch', args);
  1343. } };
  1344. // 兼容旧版本 globalData
  1345. appOptions.globalData = vm.$options.globalData || {};
  1346. // 将 methods 中的方法挂在 getApp() 中
  1347. var methods = vm.$options.methods;
  1348. if (methods) {
  1349. Object.keys(methods).forEach(function (name) {
  1350. appOptions[name] = methods[name];
  1351. });
  1352. }
  1353. initAppLocale(_vue.default, vm, wx.getSystemInfoSync().language || 'zh-Hans');
  1354. initHooks(appOptions, hooks);
  1355. return appOptions;
  1356. }
  1357. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1358. function findVmByVueId(vm, vuePid) {
  1359. var $children = vm.$children;
  1360. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1361. for (var i = $children.length - 1; i >= 0; i--) {
  1362. var childVm = $children[i];
  1363. if (childVm.$scope._$vueId === vuePid) {
  1364. return childVm;
  1365. }
  1366. }
  1367. // 反向递归查找
  1368. var parentVm;
  1369. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1370. parentVm = findVmByVueId($children[_i], vuePid);
  1371. if (parentVm) {
  1372. return parentVm;
  1373. }
  1374. }
  1375. }
  1376. function initBehavior(options) {
  1377. return Behavior(options);
  1378. }
  1379. function isPage() {
  1380. return !!this.route;
  1381. }
  1382. function initRelation(detail) {
  1383. this.triggerEvent('__l', detail);
  1384. }
  1385. function selectAllComponents(mpInstance, selector, $refs) {
  1386. var components = mpInstance.selectAllComponents(selector);
  1387. components.forEach(function (component) {
  1388. var ref = component.dataset.ref;
  1389. $refs[ref] = component.$vm || component;
  1390. {
  1391. if (component.dataset.vueGeneric === 'scoped') {
  1392. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1393. selectAllComponents(scopedComponent, selector, $refs);
  1394. });
  1395. }
  1396. }
  1397. });
  1398. }
  1399. function initRefs(vm) {
  1400. var mpInstance = vm.$scope;
  1401. Object.defineProperty(vm, '$refs', {
  1402. get: function get() {
  1403. var $refs = {};
  1404. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1405. // TODO 暂不考虑 for 中的 scoped
  1406. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1407. forComponents.forEach(function (component) {
  1408. var ref = component.dataset.ref;
  1409. if (!$refs[ref]) {
  1410. $refs[ref] = [];
  1411. }
  1412. $refs[ref].push(component.$vm || component);
  1413. });
  1414. return $refs;
  1415. } });
  1416. }
  1417. function handleLink(event) {var _ref4 =
  1418. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1419. var parentVm;
  1420. if (vuePid) {
  1421. parentVm = findVmByVueId(this.$vm, vuePid);
  1422. }
  1423. if (!parentVm) {
  1424. parentVm = this.$vm;
  1425. }
  1426. vueOptions.parent = parentVm;
  1427. }
  1428. function parseApp(vm) {
  1429. return parseBaseApp(vm, {
  1430. mocks: mocks,
  1431. initRefs: initRefs });
  1432. }
  1433. function createApp(vm) {
  1434. App(parseApp(vm));
  1435. return vm;
  1436. }
  1437. var encodeReserveRE = /[!'()*]/g;
  1438. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  1439. var commaRE = /%2C/g;
  1440. // fixed encodeURIComponent which is more conformant to RFC3986:
  1441. // - escapes [!'()*]
  1442. // - preserve commas
  1443. var encode = function encode(str) {return encodeURIComponent(str).
  1444. replace(encodeReserveRE, encodeReserveReplacer).
  1445. replace(commaRE, ',');};
  1446. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  1447. var res = obj ? Object.keys(obj).map(function (key) {
  1448. var val = obj[key];
  1449. if (val === undefined) {
  1450. return '';
  1451. }
  1452. if (val === null) {
  1453. return encodeStr(key);
  1454. }
  1455. if (Array.isArray(val)) {
  1456. var result = [];
  1457. val.forEach(function (val2) {
  1458. if (val2 === undefined) {
  1459. return;
  1460. }
  1461. if (val2 === null) {
  1462. result.push(encodeStr(key));
  1463. } else {
  1464. result.push(encodeStr(key) + '=' + encodeStr(val2));
  1465. }
  1466. });
  1467. return result.join('&');
  1468. }
  1469. return encodeStr(key) + '=' + encodeStr(val);
  1470. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  1471. return res ? "?".concat(res) : '';
  1472. }
  1473. function parseBaseComponent(vueComponentOptions)
  1474. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1475. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1476. var options = _objectSpread({
  1477. multipleSlots: true,
  1478. addGlobalClass: true },
  1479. vueOptions.options || {});
  1480. {
  1481. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1482. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1483. Object.assign(options, vueOptions['mp-weixin'].options);
  1484. }
  1485. }
  1486. var componentOptions = {
  1487. options: options,
  1488. data: initData(vueOptions, _vue.default.prototype),
  1489. behaviors: initBehaviors(vueOptions, initBehavior),
  1490. properties: initProperties(vueOptions.props, false, vueOptions.__file),
  1491. lifetimes: {
  1492. attached: function attached() {
  1493. var properties = this.properties;
  1494. var options = {
  1495. mpType: isPage.call(this) ? 'page' : 'component',
  1496. mpInstance: this,
  1497. propsData: properties };
  1498. initVueIds(properties.vueId, this);
  1499. // 处理父子关系
  1500. initRelation.call(this, {
  1501. vuePid: this._$vuePid,
  1502. vueOptions: options });
  1503. // 初始化 vue 实例
  1504. this.$vm = new VueComponent(options);
  1505. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1506. initSlots(this.$vm, properties.vueSlots);
  1507. // 触发首次 setData
  1508. this.$vm.$mount();
  1509. },
  1510. ready: function ready() {
  1511. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1512. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1513. if (this.$vm) {
  1514. this.$vm._isMounted = true;
  1515. this.$vm.__call_hook('mounted');
  1516. this.$vm.__call_hook('onReady');
  1517. }
  1518. },
  1519. detached: function detached() {
  1520. this.$vm && this.$vm.$destroy();
  1521. } },
  1522. pageLifetimes: {
  1523. show: function show(args) {
  1524. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1525. },
  1526. hide: function hide() {
  1527. this.$vm && this.$vm.__call_hook('onPageHide');
  1528. },
  1529. resize: function resize(size) {
  1530. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1531. } },
  1532. methods: {
  1533. __l: handleLink,
  1534. __e: handleEvent } };
  1535. // externalClasses
  1536. if (vueOptions.externalClasses) {
  1537. componentOptions.externalClasses = vueOptions.externalClasses;
  1538. }
  1539. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1540. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1541. componentOptions.methods[callMethod] = function (args) {
  1542. return this.$vm[callMethod](args);
  1543. };
  1544. });
  1545. }
  1546. if (isPage) {
  1547. return componentOptions;
  1548. }
  1549. return [componentOptions, VueComponent];
  1550. }
  1551. function parseComponent(vueComponentOptions) {
  1552. return parseBaseComponent(vueComponentOptions, {
  1553. isPage: isPage,
  1554. initRelation: initRelation });
  1555. }
  1556. var hooks$1 = [
  1557. 'onShow',
  1558. 'onHide',
  1559. 'onUnload'];
  1560. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1561. function parseBasePage(vuePageOptions, _ref6)
  1562. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1563. var pageOptions = parseComponent(vuePageOptions);
  1564. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1565. pageOptions.methods.onLoad = function (query) {
  1566. this.options = query;
  1567. var copyQuery = Object.assign({}, query);
  1568. delete copyQuery.__id__;
  1569. this.$page = {
  1570. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery) };
  1571. this.$vm.$mp.query = query; // 兼容 mpvue
  1572. this.$vm.__call_hook('onLoad', query);
  1573. };
  1574. return pageOptions;
  1575. }
  1576. function parsePage(vuePageOptions) {
  1577. return parseBasePage(vuePageOptions, {
  1578. isPage: isPage,
  1579. initRelation: initRelation });
  1580. }
  1581. function createPage(vuePageOptions) {
  1582. {
  1583. return Component(parsePage(vuePageOptions));
  1584. }
  1585. }
  1586. function createComponent(vueOptions) {
  1587. {
  1588. return Component(parseComponent(vueOptions));
  1589. }
  1590. }
  1591. function createSubpackageApp(vm) {
  1592. var appOptions = parseApp(vm);
  1593. var app = getApp({
  1594. allowDefault: true });
  1595. vm.$scope = app;
  1596. var globalData = app.globalData;
  1597. if (globalData) {
  1598. Object.keys(appOptions.globalData).forEach(function (name) {
  1599. if (!hasOwn(globalData, name)) {
  1600. globalData[name] = appOptions.globalData[name];
  1601. }
  1602. });
  1603. }
  1604. Object.keys(appOptions).forEach(function (name) {
  1605. if (!hasOwn(app, name)) {
  1606. app[name] = appOptions[name];
  1607. }
  1608. });
  1609. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1610. wx.onAppShow(function () {for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  1611. vm.__call_hook('onShow', args);
  1612. });
  1613. }
  1614. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1615. wx.onAppHide(function () {for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {args[_key6] = arguments[_key6];}
  1616. vm.__call_hook('onHide', args);
  1617. });
  1618. }
  1619. if (isFn(appOptions.onLaunch)) {
  1620. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1621. vm.__call_hook('onLaunch', args);
  1622. }
  1623. return vm;
  1624. }
  1625. function createPlugin(vm) {
  1626. var appOptions = parseApp(vm);
  1627. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1628. wx.onAppShow(function () {for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {args[_key7] = arguments[_key7];}
  1629. appOptions.onShow.apply(vm, args);
  1630. });
  1631. }
  1632. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1633. wx.onAppHide(function () {for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {args[_key8] = arguments[_key8];}
  1634. appOptions.onHide.apply(vm, args);
  1635. });
  1636. }
  1637. if (isFn(appOptions.onLaunch)) {
  1638. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1639. appOptions.onLaunch.call(vm, args);
  1640. }
  1641. return vm;
  1642. }
  1643. todos.forEach(function (todoApi) {
  1644. protocols[todoApi] = false;
  1645. });
  1646. canIUses.forEach(function (canIUseApi) {
  1647. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  1648. canIUseApi;
  1649. if (!wx.canIUse(apiName)) {
  1650. protocols[canIUseApi] = false;
  1651. }
  1652. });
  1653. var uni = {};
  1654. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  1655. uni = new Proxy({}, {
  1656. get: function get(target, name) {
  1657. if (hasOwn(target, name)) {
  1658. return target[name];
  1659. }
  1660. if (baseApi[name]) {
  1661. return baseApi[name];
  1662. }
  1663. if (api[name]) {
  1664. return promisify(name, api[name]);
  1665. }
  1666. {
  1667. if (extraApi[name]) {
  1668. return promisify(name, extraApi[name]);
  1669. }
  1670. if (todoApis[name]) {
  1671. return promisify(name, todoApis[name]);
  1672. }
  1673. }
  1674. if (eventApi[name]) {
  1675. return eventApi[name];
  1676. }
  1677. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  1678. return;
  1679. }
  1680. return promisify(name, wrapper(name, wx[name]));
  1681. },
  1682. set: function set(target, name, value) {
  1683. target[name] = value;
  1684. return true;
  1685. } });
  1686. } else {
  1687. Object.keys(baseApi).forEach(function (name) {
  1688. uni[name] = baseApi[name];
  1689. });
  1690. {
  1691. Object.keys(todoApis).forEach(function (name) {
  1692. uni[name] = promisify(name, todoApis[name]);
  1693. });
  1694. Object.keys(extraApi).forEach(function (name) {
  1695. uni[name] = promisify(name, todoApis[name]);
  1696. });
  1697. }
  1698. Object.keys(eventApi).forEach(function (name) {
  1699. uni[name] = eventApi[name];
  1700. });
  1701. Object.keys(api).forEach(function (name) {
  1702. uni[name] = promisify(name, api[name]);
  1703. });
  1704. Object.keys(wx).forEach(function (name) {
  1705. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  1706. uni[name] = promisify(name, wrapper(name, wx[name]));
  1707. }
  1708. });
  1709. }
  1710. wx.createApp = createApp;
  1711. wx.createPage = createPage;
  1712. wx.createComponent = createComponent;
  1713. wx.createSubpackageApp = createSubpackageApp;
  1714. wx.createPlugin = createPlugin;
  1715. var uni$1 = uni;var _default =
  1716. uni$1;exports.default = _default;
  1717. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  1718. /***/ }),
  1719. /* 2 */
  1720. /*!***********************************!*\
  1721. !*** (webpack)/buildin/global.js ***!
  1722. \***********************************/
  1723. /*! no static exports found */
  1724. /***/ (function(module, exports) {
  1725. var g;
  1726. // This works in non-strict mode
  1727. g = (function() {
  1728. return this;
  1729. })();
  1730. try {
  1731. // This works if eval is allowed (see CSP)
  1732. g = g || new Function("return this")();
  1733. } catch (e) {
  1734. // This works if the window reference is available
  1735. if (typeof window === "object") g = window;
  1736. }
  1737. // g can still be undefined, but nothing to do about it...
  1738. // We return undefined, instead of nothing here, so it's
  1739. // easier to handle this case. if(!global) { ...}
  1740. module.exports = g;
  1741. /***/ }),
  1742. /* 3 */
  1743. /*!******************************************************************************************!*\
  1744. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  1745. \******************************************************************************************/
  1746. /*! exports provided: default */
  1747. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1748. "use strict";
  1749. __webpack_require__.r(__webpack_exports__);
  1750. /* WEBPACK VAR INJECTION */(function(global) {/*!
  1751. * Vue.js v2.6.11
  1752. * (c) 2014-2021 Evan You
  1753. * Released under the MIT License.
  1754. */
  1755. /* */
  1756. var emptyObject = Object.freeze({});
  1757. // These helpers produce better VM code in JS engines due to their
  1758. // explicitness and function inlining.
  1759. function isUndef (v) {
  1760. return v === undefined || v === null
  1761. }
  1762. function isDef (v) {
  1763. return v !== undefined && v !== null
  1764. }
  1765. function isTrue (v) {
  1766. return v === true
  1767. }
  1768. function isFalse (v) {
  1769. return v === false
  1770. }
  1771. /**
  1772. * Check if value is primitive.
  1773. */
  1774. function isPrimitive (value) {
  1775. return (
  1776. typeof value === 'string' ||
  1777. typeof value === 'number' ||
  1778. // $flow-disable-line
  1779. typeof value === 'symbol' ||
  1780. typeof value === 'boolean'
  1781. )
  1782. }
  1783. /**
  1784. * Quick object check - this is primarily used to tell
  1785. * Objects from primitive values when we know the value
  1786. * is a JSON-compliant type.
  1787. */
  1788. function isObject (obj) {
  1789. return obj !== null && typeof obj === 'object'
  1790. }
  1791. /**
  1792. * Get the raw type string of a value, e.g., [object Object].
  1793. */
  1794. var _toString = Object.prototype.toString;
  1795. function toRawType (value) {
  1796. return _toString.call(value).slice(8, -1)
  1797. }
  1798. /**
  1799. * Strict object type check. Only returns true
  1800. * for plain JavaScript objects.
  1801. */
  1802. function isPlainObject (obj) {
  1803. return _toString.call(obj) === '[object Object]'
  1804. }
  1805. function isRegExp (v) {
  1806. return _toString.call(v) === '[object RegExp]'
  1807. }
  1808. /**
  1809. * Check if val is a valid array index.
  1810. */
  1811. function isValidArrayIndex (val) {
  1812. var n = parseFloat(String(val));
  1813. return n >= 0 && Math.floor(n) === n && isFinite(val)
  1814. }
  1815. function isPromise (val) {
  1816. return (
  1817. isDef(val) &&
  1818. typeof val.then === 'function' &&
  1819. typeof val.catch === 'function'
  1820. )
  1821. }
  1822. /**
  1823. * Convert a value to a string that is actually rendered.
  1824. */
  1825. function toString (val) {
  1826. return val == null
  1827. ? ''
  1828. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  1829. ? JSON.stringify(val, null, 2)
  1830. : String(val)
  1831. }
  1832. /**
  1833. * Convert an input value to a number for persistence.
  1834. * If the conversion fails, return original string.
  1835. */
  1836. function toNumber (val) {
  1837. var n = parseFloat(val);
  1838. return isNaN(n) ? val : n
  1839. }
  1840. /**
  1841. * Make a map and return a function for checking if a key
  1842. * is in that map.
  1843. */
  1844. function makeMap (
  1845. str,
  1846. expectsLowerCase
  1847. ) {
  1848. var map = Object.create(null);
  1849. var list = str.split(',');
  1850. for (var i = 0; i < list.length; i++) {
  1851. map[list[i]] = true;
  1852. }
  1853. return expectsLowerCase
  1854. ? function (val) { return map[val.toLowerCase()]; }
  1855. : function (val) { return map[val]; }
  1856. }
  1857. /**
  1858. * Check if a tag is a built-in tag.
  1859. */
  1860. var isBuiltInTag = makeMap('slot,component', true);
  1861. /**
  1862. * Check if an attribute is a reserved attribute.
  1863. */
  1864. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  1865. /**
  1866. * Remove an item from an array.
  1867. */
  1868. function remove (arr, item) {
  1869. if (arr.length) {
  1870. var index = arr.indexOf(item);
  1871. if (index > -1) {
  1872. return arr.splice(index, 1)
  1873. }
  1874. }
  1875. }
  1876. /**
  1877. * Check whether an object has the property.
  1878. */
  1879. var hasOwnProperty = Object.prototype.hasOwnProperty;
  1880. function hasOwn (obj, key) {
  1881. return hasOwnProperty.call(obj, key)
  1882. }
  1883. /**
  1884. * Create a cached version of a pure function.
  1885. */
  1886. function cached (fn) {
  1887. var cache = Object.create(null);
  1888. return (function cachedFn (str) {
  1889. var hit = cache[str];
  1890. return hit || (cache[str] = fn(str))
  1891. })
  1892. }
  1893. /**
  1894. * Camelize a hyphen-delimited string.
  1895. */
  1896. var camelizeRE = /-(\w)/g;
  1897. var camelize = cached(function (str) {
  1898. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  1899. });
  1900. /**
  1901. * Capitalize a string.
  1902. */
  1903. var capitalize = cached(function (str) {
  1904. return str.charAt(0).toUpperCase() + str.slice(1)
  1905. });
  1906. /**
  1907. * Hyphenate a camelCase string.
  1908. */
  1909. var hyphenateRE = /\B([A-Z])/g;
  1910. var hyphenate = cached(function (str) {
  1911. return str.replace(hyphenateRE, '-$1').toLowerCase()
  1912. });
  1913. /**
  1914. * Simple bind polyfill for environments that do not support it,
  1915. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  1916. * since native bind is now performant enough in most browsers.
  1917. * But removing it would mean breaking code that was able to run in
  1918. * PhantomJS 1.x, so this must be kept for backward compatibility.
  1919. */
  1920. /* istanbul ignore next */
  1921. function polyfillBind (fn, ctx) {
  1922. function boundFn (a) {
  1923. var l = arguments.length;
  1924. return l
  1925. ? l > 1
  1926. ? fn.apply(ctx, arguments)
  1927. : fn.call(ctx, a)
  1928. : fn.call(ctx)
  1929. }
  1930. boundFn._length = fn.length;
  1931. return boundFn
  1932. }
  1933. function nativeBind (fn, ctx) {
  1934. return fn.bind(ctx)
  1935. }
  1936. var bind = Function.prototype.bind
  1937. ? nativeBind
  1938. : polyfillBind;
  1939. /**
  1940. * Convert an Array-like object to a real Array.
  1941. */
  1942. function toArray (list, start) {
  1943. start = start || 0;
  1944. var i = list.length - start;
  1945. var ret = new Array(i);
  1946. while (i--) {
  1947. ret[i] = list[i + start];
  1948. }
  1949. return ret
  1950. }
  1951. /**
  1952. * Mix properties into target object.
  1953. */
  1954. function extend (to, _from) {
  1955. for (var key in _from) {
  1956. to[key] = _from[key];
  1957. }
  1958. return to
  1959. }
  1960. /**
  1961. * Merge an Array of Objects into a single Object.
  1962. */
  1963. function toObject (arr) {
  1964. var res = {};
  1965. for (var i = 0; i < arr.length; i++) {
  1966. if (arr[i]) {
  1967. extend(res, arr[i]);
  1968. }
  1969. }
  1970. return res
  1971. }
  1972. /* eslint-disable no-unused-vars */
  1973. /**
  1974. * Perform no operation.
  1975. * Stubbing args to make Flow happy without leaving useless transpiled code
  1976. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  1977. */
  1978. function noop (a, b, c) {}
  1979. /**
  1980. * Always return false.
  1981. */
  1982. var no = function (a, b, c) { return false; };
  1983. /* eslint-enable no-unused-vars */
  1984. /**
  1985. * Return the same value.
  1986. */
  1987. var identity = function (_) { return _; };
  1988. /**
  1989. * Check if two values are loosely equal - that is,
  1990. * if they are plain objects, do they have the same shape?
  1991. */
  1992. function looseEqual (a, b) {
  1993. if (a === b) { return true }
  1994. var isObjectA = isObject(a);
  1995. var isObjectB = isObject(b);
  1996. if (isObjectA && isObjectB) {
  1997. try {
  1998. var isArrayA = Array.isArray(a);
  1999. var isArrayB = Array.isArray(b);
  2000. if (isArrayA && isArrayB) {
  2001. return a.length === b.length && a.every(function (e, i) {
  2002. return looseEqual(e, b[i])
  2003. })
  2004. } else if (a instanceof Date && b instanceof Date) {
  2005. return a.getTime() === b.getTime()
  2006. } else if (!isArrayA && !isArrayB) {
  2007. var keysA = Object.keys(a);
  2008. var keysB = Object.keys(b);
  2009. return keysA.length === keysB.length && keysA.every(function (key) {
  2010. return looseEqual(a[key], b[key])
  2011. })
  2012. } else {
  2013. /* istanbul ignore next */
  2014. return false
  2015. }
  2016. } catch (e) {
  2017. /* istanbul ignore next */
  2018. return false
  2019. }
  2020. } else if (!isObjectA && !isObjectB) {
  2021. return String(a) === String(b)
  2022. } else {
  2023. return false
  2024. }
  2025. }
  2026. /**
  2027. * Return the first index at which a loosely equal value can be
  2028. * found in the array (if value is a plain object, the array must
  2029. * contain an object of the same shape), or -1 if it is not present.
  2030. */
  2031. function looseIndexOf (arr, val) {
  2032. for (var i = 0; i < arr.length; i++) {
  2033. if (looseEqual(arr[i], val)) { return i }
  2034. }
  2035. return -1
  2036. }
  2037. /**
  2038. * Ensure a function is called only once.
  2039. */
  2040. function once (fn) {
  2041. var called = false;
  2042. return function () {
  2043. if (!called) {
  2044. called = true;
  2045. fn.apply(this, arguments);
  2046. }
  2047. }
  2048. }
  2049. var ASSET_TYPES = [
  2050. 'component',
  2051. 'directive',
  2052. 'filter'
  2053. ];
  2054. var LIFECYCLE_HOOKS = [
  2055. 'beforeCreate',
  2056. 'created',
  2057. 'beforeMount',
  2058. 'mounted',
  2059. 'beforeUpdate',
  2060. 'updated',
  2061. 'beforeDestroy',
  2062. 'destroyed',
  2063. 'activated',
  2064. 'deactivated',
  2065. 'errorCaptured',
  2066. 'serverPrefetch'
  2067. ];
  2068. /* */
  2069. var config = ({
  2070. /**
  2071. * Option merge strategies (used in core/util/options)
  2072. */
  2073. // $flow-disable-line
  2074. optionMergeStrategies: Object.create(null),
  2075. /**
  2076. * Whether to suppress warnings.
  2077. */
  2078. silent: false,
  2079. /**
  2080. * Show production mode tip message on boot?
  2081. */
  2082. productionTip: "development" !== 'production',
  2083. /**
  2084. * Whether to enable devtools
  2085. */
  2086. devtools: "development" !== 'production',
  2087. /**
  2088. * Whether to record perf
  2089. */
  2090. performance: false,
  2091. /**
  2092. * Error handler for watcher errors
  2093. */
  2094. errorHandler: null,
  2095. /**
  2096. * Warn handler for watcher warns
  2097. */
  2098. warnHandler: null,
  2099. /**
  2100. * Ignore certain custom elements
  2101. */
  2102. ignoredElements: [],
  2103. /**
  2104. * Custom user key aliases for v-on
  2105. */
  2106. // $flow-disable-line
  2107. keyCodes: Object.create(null),
  2108. /**
  2109. * Check if a tag is reserved so that it cannot be registered as a
  2110. * component. This is platform-dependent and may be overwritten.
  2111. */
  2112. isReservedTag: no,
  2113. /**
  2114. * Check if an attribute is reserved so that it cannot be used as a component
  2115. * prop. This is platform-dependent and may be overwritten.
  2116. */
  2117. isReservedAttr: no,
  2118. /**
  2119. * Check if a tag is an unknown element.
  2120. * Platform-dependent.
  2121. */
  2122. isUnknownElement: no,
  2123. /**
  2124. * Get the namespace of an element
  2125. */
  2126. getTagNamespace: noop,
  2127. /**
  2128. * Parse the real tag name for the specific platform.
  2129. */
  2130. parsePlatformTagName: identity,
  2131. /**
  2132. * Check if an attribute must be bound using property, e.g. value
  2133. * Platform-dependent.
  2134. */
  2135. mustUseProp: no,
  2136. /**
  2137. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  2138. * This will significantly reduce performance if set to false.
  2139. */
  2140. async: true,
  2141. /**
  2142. * Exposed for legacy reasons
  2143. */
  2144. _lifecycleHooks: LIFECYCLE_HOOKS
  2145. });
  2146. /* */
  2147. /**
  2148. * unicode letters used for parsing html tags, component names and property paths.
  2149. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  2150. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  2151. */
  2152. var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;
  2153. /**
  2154. * Check if a string starts with $ or _
  2155. */
  2156. function isReserved (str) {
  2157. var c = (str + '').charCodeAt(0);
  2158. return c === 0x24 || c === 0x5F
  2159. }
  2160. /**
  2161. * Define a property.
  2162. */
  2163. function def (obj, key, val, enumerable) {
  2164. Object.defineProperty(obj, key, {
  2165. value: val,
  2166. enumerable: !!enumerable,
  2167. writable: true,
  2168. configurable: true
  2169. });
  2170. }
  2171. /**
  2172. * Parse simple path.
  2173. */
  2174. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  2175. function parsePath (path) {
  2176. if (bailRE.test(path)) {
  2177. return
  2178. }
  2179. var segments = path.split('.');
  2180. return function (obj) {
  2181. for (var i = 0; i < segments.length; i++) {
  2182. if (!obj) { return }
  2183. obj = obj[segments[i]];
  2184. }
  2185. return obj
  2186. }
  2187. }
  2188. /* */
  2189. // can we use __proto__?
  2190. var hasProto = '__proto__' in {};
  2191. // Browser environment sniffing
  2192. var inBrowser = typeof window !== 'undefined';
  2193. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  2194. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  2195. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  2196. var isIE = UA && /msie|trident/.test(UA);
  2197. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  2198. var isEdge = UA && UA.indexOf('edge/') > 0;
  2199. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  2200. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  2201. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  2202. var isPhantomJS = UA && /phantomjs/.test(UA);
  2203. var isFF = UA && UA.match(/firefox\/(\d+)/);
  2204. // Firefox has a "watch" function on Object.prototype...
  2205. var nativeWatch = ({}).watch;
  2206. if (inBrowser) {
  2207. try {
  2208. var opts = {};
  2209. Object.defineProperty(opts, 'passive', ({
  2210. get: function get () {
  2211. }
  2212. })); // https://github.com/facebook/flow/issues/285
  2213. window.addEventListener('test-passive', null, opts);
  2214. } catch (e) {}
  2215. }
  2216. // this needs to be lazy-evaled because vue may be required before
  2217. // vue-server-renderer can set VUE_ENV
  2218. var _isServer;
  2219. var isServerRendering = function () {
  2220. if (_isServer === undefined) {
  2221. /* istanbul ignore if */
  2222. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  2223. // detect presence of vue-server-renderer and avoid
  2224. // Webpack shimming the process
  2225. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  2226. } else {
  2227. _isServer = false;
  2228. }
  2229. }
  2230. return _isServer
  2231. };
  2232. // detect devtools
  2233. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  2234. /* istanbul ignore next */
  2235. function isNative (Ctor) {
  2236. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  2237. }
  2238. var hasSymbol =
  2239. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  2240. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  2241. var _Set;
  2242. /* istanbul ignore if */ // $flow-disable-line
  2243. if (typeof Set !== 'undefined' && isNative(Set)) {
  2244. // use native Set when available.
  2245. _Set = Set;
  2246. } else {
  2247. // a non-standard Set polyfill that only works with primitive keys.
  2248. _Set = /*@__PURE__*/(function () {
  2249. function Set () {
  2250. this.set = Object.create(null);
  2251. }
  2252. Set.prototype.has = function has (key) {
  2253. return this.set[key] === true
  2254. };
  2255. Set.prototype.add = function add (key) {
  2256. this.set[key] = true;
  2257. };
  2258. Set.prototype.clear = function clear () {
  2259. this.set = Object.create(null);
  2260. };
  2261. return Set;
  2262. }());
  2263. }
  2264. /* */
  2265. var warn = noop;
  2266. var tip = noop;
  2267. var generateComponentTrace = (noop); // work around flow check
  2268. var formatComponentName = (noop);
  2269. if (true) {
  2270. var hasConsole = typeof console !== 'undefined';
  2271. var classifyRE = /(?:^|[-_])(\w)/g;
  2272. var classify = function (str) { return str
  2273. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  2274. .replace(/[-_]/g, ''); };
  2275. warn = function (msg, vm) {
  2276. var trace = vm ? generateComponentTrace(vm) : '';
  2277. if (config.warnHandler) {
  2278. config.warnHandler.call(null, msg, vm, trace);
  2279. } else if (hasConsole && (!config.silent)) {
  2280. console.error(("[Vue warn]: " + msg + trace));
  2281. }
  2282. };
  2283. tip = function (msg, vm) {
  2284. if (hasConsole && (!config.silent)) {
  2285. console.warn("[Vue tip]: " + msg + (
  2286. vm ? generateComponentTrace(vm) : ''
  2287. ));
  2288. }
  2289. };
  2290. formatComponentName = function (vm, includeFile) {
  2291. if (vm.$root === vm) {
  2292. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  2293. return ('') + vm.$options.__file
  2294. }
  2295. return '<Root>'
  2296. }
  2297. var options = typeof vm === 'function' && vm.cid != null
  2298. ? vm.options
  2299. : vm._isVue
  2300. ? vm.$options || vm.constructor.options
  2301. : vm;
  2302. var name = options.name || options._componentTag;
  2303. var file = options.__file;
  2304. if (!name && file) {
  2305. var match = file.match(/([^/\\]+)\.vue$/);
  2306. name = match && match[1];
  2307. }
  2308. return (
  2309. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  2310. (file && includeFile !== false ? (" at " + file) : '')
  2311. )
  2312. };
  2313. var repeat = function (str, n) {
  2314. var res = '';
  2315. while (n) {
  2316. if (n % 2 === 1) { res += str; }
  2317. if (n > 1) { str += str; }
  2318. n >>= 1;
  2319. }
  2320. return res
  2321. };
  2322. generateComponentTrace = function (vm) {
  2323. if (vm._isVue && vm.$parent) {
  2324. var tree = [];
  2325. var currentRecursiveSequence = 0;
  2326. while (vm && vm.$options.name !== 'PageBody') {
  2327. if (tree.length > 0) {
  2328. var last = tree[tree.length - 1];
  2329. if (last.constructor === vm.constructor) {
  2330. currentRecursiveSequence++;
  2331. vm = vm.$parent;
  2332. continue
  2333. } else if (currentRecursiveSequence > 0) {
  2334. tree[tree.length - 1] = [last, currentRecursiveSequence];
  2335. currentRecursiveSequence = 0;
  2336. }
  2337. }
  2338. !vm.$options.isReserved && tree.push(vm);
  2339. vm = vm.$parent;
  2340. }
  2341. return '\n\nfound in\n\n' + tree
  2342. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  2343. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  2344. : formatComponentName(vm))); })
  2345. .join('\n')
  2346. } else {
  2347. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  2348. }
  2349. };
  2350. }
  2351. /* */
  2352. var uid = 0;
  2353. /**
  2354. * A dep is an observable that can have multiple
  2355. * directives subscribing to it.
  2356. */
  2357. var Dep = function Dep () {
  2358. this.id = uid++;
  2359. this.subs = [];
  2360. };
  2361. Dep.prototype.addSub = function addSub (sub) {
  2362. this.subs.push(sub);
  2363. };
  2364. Dep.prototype.removeSub = function removeSub (sub) {
  2365. remove(this.subs, sub);
  2366. };
  2367. Dep.prototype.depend = function depend () {
  2368. if (Dep.SharedObject.target) {
  2369. Dep.SharedObject.target.addDep(this);
  2370. }
  2371. };
  2372. Dep.prototype.notify = function notify () {
  2373. // stabilize the subscriber list first
  2374. var subs = this.subs.slice();
  2375. if ( true && !config.async) {
  2376. // subs aren't sorted in scheduler if not running async
  2377. // we need to sort them now to make sure they fire in correct
  2378. // order
  2379. subs.sort(function (a, b) { return a.id - b.id; });
  2380. }
  2381. for (var i = 0, l = subs.length; i < l; i++) {
  2382. subs[i].update();
  2383. }
  2384. };
  2385. // The current target watcher being evaluated.
  2386. // This is globally unique because only one watcher
  2387. // can be evaluated at a time.
  2388. // fixed by xxxxxx (nvue shared vuex)
  2389. /* eslint-disable no-undef */
  2390. Dep.SharedObject = {};
  2391. Dep.SharedObject.target = null;
  2392. Dep.SharedObject.targetStack = [];
  2393. function pushTarget (target) {
  2394. Dep.SharedObject.targetStack.push(target);
  2395. Dep.SharedObject.target = target;
  2396. Dep.target = target;
  2397. }
  2398. function popTarget () {
  2399. Dep.SharedObject.targetStack.pop();
  2400. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  2401. Dep.target = Dep.SharedObject.target;
  2402. }
  2403. /* */
  2404. var VNode = function VNode (
  2405. tag,
  2406. data,
  2407. children,
  2408. text,
  2409. elm,
  2410. context,
  2411. componentOptions,
  2412. asyncFactory
  2413. ) {
  2414. this.tag = tag;
  2415. this.data = data;
  2416. this.children = children;
  2417. this.text = text;
  2418. this.elm = elm;
  2419. this.ns = undefined;
  2420. this.context = context;
  2421. this.fnContext = undefined;
  2422. this.fnOptions = undefined;
  2423. this.fnScopeId = undefined;
  2424. this.key = data && data.key;
  2425. this.componentOptions = componentOptions;
  2426. this.componentInstance = undefined;
  2427. this.parent = undefined;
  2428. this.raw = false;
  2429. this.isStatic = false;
  2430. this.isRootInsert = true;
  2431. this.isComment = false;
  2432. this.isCloned = false;
  2433. this.isOnce = false;
  2434. this.asyncFactory = asyncFactory;
  2435. this.asyncMeta = undefined;
  2436. this.isAsyncPlaceholder = false;
  2437. };
  2438. var prototypeAccessors = { child: { configurable: true } };
  2439. // DEPRECATED: alias for componentInstance for backwards compat.
  2440. /* istanbul ignore next */
  2441. prototypeAccessors.child.get = function () {
  2442. return this.componentInstance
  2443. };
  2444. Object.defineProperties( VNode.prototype, prototypeAccessors );
  2445. var createEmptyVNode = function (text) {
  2446. if ( text === void 0 ) text = '';
  2447. var node = new VNode();
  2448. node.text = text;
  2449. node.isComment = true;
  2450. return node
  2451. };
  2452. function createTextVNode (val) {
  2453. return new VNode(undefined, undefined, undefined, String(val))
  2454. }
  2455. // optimized shallow clone
  2456. // used for static nodes and slot nodes because they may be reused across
  2457. // multiple renders, cloning them avoids errors when DOM manipulations rely
  2458. // on their elm reference.
  2459. function cloneVNode (vnode) {
  2460. var cloned = new VNode(
  2461. vnode.tag,
  2462. vnode.data,
  2463. // #7975
  2464. // clone children array to avoid mutating original in case of cloning
  2465. // a child.
  2466. vnode.children && vnode.children.slice(),
  2467. vnode.text,
  2468. vnode.elm,
  2469. vnode.context,
  2470. vnode.componentOptions,
  2471. vnode.asyncFactory
  2472. );
  2473. cloned.ns = vnode.ns;
  2474. cloned.isStatic = vnode.isStatic;
  2475. cloned.key = vnode.key;
  2476. cloned.isComment = vnode.isComment;
  2477. cloned.fnContext = vnode.fnContext;
  2478. cloned.fnOptions = vnode.fnOptions;
  2479. cloned.fnScopeId = vnode.fnScopeId;
  2480. cloned.asyncMeta = vnode.asyncMeta;
  2481. cloned.isCloned = true;
  2482. return cloned
  2483. }
  2484. /*
  2485. * not type checking this file because flow doesn't play well with
  2486. * dynamically accessing methods on Array prototype
  2487. */
  2488. var arrayProto = Array.prototype;
  2489. var arrayMethods = Object.create(arrayProto);
  2490. var methodsToPatch = [
  2491. 'push',
  2492. 'pop',
  2493. 'shift',
  2494. 'unshift',
  2495. 'splice',
  2496. 'sort',
  2497. 'reverse'
  2498. ];
  2499. /**
  2500. * Intercept mutating methods and emit events
  2501. */
  2502. methodsToPatch.forEach(function (method) {
  2503. // cache original method
  2504. var original = arrayProto[method];
  2505. def(arrayMethods, method, function mutator () {
  2506. var args = [], len = arguments.length;
  2507. while ( len-- ) args[ len ] = arguments[ len ];
  2508. var result = original.apply(this, args);
  2509. var ob = this.__ob__;
  2510. var inserted;
  2511. switch (method) {
  2512. case 'push':
  2513. case 'unshift':
  2514. inserted = args;
  2515. break
  2516. case 'splice':
  2517. inserted = args.slice(2);
  2518. break
  2519. }
  2520. if (inserted) { ob.observeArray(inserted); }
  2521. // notify change
  2522. ob.dep.notify();
  2523. return result
  2524. });
  2525. });
  2526. /* */
  2527. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  2528. /**
  2529. * In some cases we may want to disable observation inside a component's
  2530. * update computation.
  2531. */
  2532. var shouldObserve = true;
  2533. function toggleObserving (value) {
  2534. shouldObserve = value;
  2535. }
  2536. /**
  2537. * Observer class that is attached to each observed
  2538. * object. Once attached, the observer converts the target
  2539. * object's property keys into getter/setters that
  2540. * collect dependencies and dispatch updates.
  2541. */
  2542. var Observer = function Observer (value) {
  2543. this.value = value;
  2544. this.dep = new Dep();
  2545. this.vmCount = 0;
  2546. def(value, '__ob__', this);
  2547. if (Array.isArray(value)) {
  2548. if (hasProto) {
  2549. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  2550. if(value.push !== value.__proto__.push){
  2551. copyAugment(value, arrayMethods, arrayKeys);
  2552. } else {
  2553. protoAugment(value, arrayMethods);
  2554. }
  2555. }
  2556. } else {
  2557. copyAugment(value, arrayMethods, arrayKeys);
  2558. }
  2559. this.observeArray(value);
  2560. } else {
  2561. this.walk(value);
  2562. }
  2563. };
  2564. /**
  2565. * Walk through all properties and convert them into
  2566. * getter/setters. This method should only be called when
  2567. * value type is Object.
  2568. */
  2569. Observer.prototype.walk = function walk (obj) {
  2570. var keys = Object.keys(obj);
  2571. for (var i = 0; i < keys.length; i++) {
  2572. defineReactive$$1(obj, keys[i]);
  2573. }
  2574. };
  2575. /**
  2576. * Observe a list of Array items.
  2577. */
  2578. Observer.prototype.observeArray = function observeArray (items) {
  2579. for (var i = 0, l = items.length; i < l; i++) {
  2580. observe(items[i]);
  2581. }
  2582. };
  2583. // helpers
  2584. /**
  2585. * Augment a target Object or Array by intercepting
  2586. * the prototype chain using __proto__
  2587. */
  2588. function protoAugment (target, src) {
  2589. /* eslint-disable no-proto */
  2590. target.__proto__ = src;
  2591. /* eslint-enable no-proto */
  2592. }
  2593. /**
  2594. * Augment a target Object or Array by defining
  2595. * hidden properties.
  2596. */
  2597. /* istanbul ignore next */
  2598. function copyAugment (target, src, keys) {
  2599. for (var i = 0, l = keys.length; i < l; i++) {
  2600. var key = keys[i];
  2601. def(target, key, src[key]);
  2602. }
  2603. }
  2604. /**
  2605. * Attempt to create an observer instance for a value,
  2606. * returns the new observer if successfully observed,
  2607. * or the existing observer if the value already has one.
  2608. */
  2609. function observe (value, asRootData) {
  2610. if (!isObject(value) || value instanceof VNode) {
  2611. return
  2612. }
  2613. var ob;
  2614. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  2615. ob = value.__ob__;
  2616. } else if (
  2617. shouldObserve &&
  2618. !isServerRendering() &&
  2619. (Array.isArray(value) || isPlainObject(value)) &&
  2620. Object.isExtensible(value) &&
  2621. !value._isVue
  2622. ) {
  2623. ob = new Observer(value);
  2624. }
  2625. if (asRootData && ob) {
  2626. ob.vmCount++;
  2627. }
  2628. return ob
  2629. }
  2630. /**
  2631. * Define a reactive property on an Object.
  2632. */
  2633. function defineReactive$$1 (
  2634. obj,
  2635. key,
  2636. val,
  2637. customSetter,
  2638. shallow
  2639. ) {
  2640. var dep = new Dep();
  2641. var property = Object.getOwnPropertyDescriptor(obj, key);
  2642. if (property && property.configurable === false) {
  2643. return
  2644. }
  2645. // cater for pre-defined getter/setters
  2646. var getter = property && property.get;
  2647. var setter = property && property.set;
  2648. if ((!getter || setter) && arguments.length === 2) {
  2649. val = obj[key];
  2650. }
  2651. var childOb = !shallow && observe(val);
  2652. Object.defineProperty(obj, key, {
  2653. enumerable: true,
  2654. configurable: true,
  2655. get: function reactiveGetter () {
  2656. var value = getter ? getter.call(obj) : val;
  2657. if (Dep.SharedObject.target) { // fixed by xxxxxx
  2658. dep.depend();
  2659. if (childOb) {
  2660. childOb.dep.depend();
  2661. if (Array.isArray(value)) {
  2662. dependArray(value);
  2663. }
  2664. }
  2665. }
  2666. return value
  2667. },
  2668. set: function reactiveSetter (newVal) {
  2669. var value = getter ? getter.call(obj) : val;
  2670. /* eslint-disable no-self-compare */
  2671. if (newVal === value || (newVal !== newVal && value !== value)) {
  2672. return
  2673. }
  2674. /* eslint-enable no-self-compare */
  2675. if ( true && customSetter) {
  2676. customSetter();
  2677. }
  2678. // #7981: for accessor properties without setter
  2679. if (getter && !setter) { return }
  2680. if (setter) {
  2681. setter.call(obj, newVal);
  2682. } else {
  2683. val = newVal;
  2684. }
  2685. childOb = !shallow && observe(newVal);
  2686. dep.notify();
  2687. }
  2688. });
  2689. }
  2690. /**
  2691. * Set a property on an object. Adds the new property and
  2692. * triggers change notification if the property doesn't
  2693. * already exist.
  2694. */
  2695. function set (target, key, val) {
  2696. if ( true &&
  2697. (isUndef(target) || isPrimitive(target))
  2698. ) {
  2699. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  2700. }
  2701. if (Array.isArray(target) && isValidArrayIndex(key)) {
  2702. target.length = Math.max(target.length, key);
  2703. target.splice(key, 1, val);
  2704. return val
  2705. }
  2706. if (key in target && !(key in Object.prototype)) {
  2707. target[key] = val;
  2708. return val
  2709. }
  2710. var ob = (target).__ob__;
  2711. if (target._isVue || (ob && ob.vmCount)) {
  2712. true && warn(
  2713. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  2714. 'at runtime - declare it upfront in the data option.'
  2715. );
  2716. return val
  2717. }
  2718. if (!ob) {
  2719. target[key] = val;
  2720. return val
  2721. }
  2722. defineReactive$$1(ob.value, key, val);
  2723. ob.dep.notify();
  2724. return val
  2725. }
  2726. /**
  2727. * Delete a property and trigger change if necessary.
  2728. */
  2729. function del (target, key) {
  2730. if ( true &&
  2731. (isUndef(target) || isPrimitive(target))
  2732. ) {
  2733. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  2734. }
  2735. if (Array.isArray(target) && isValidArrayIndex(key)) {
  2736. target.splice(key, 1);
  2737. return
  2738. }
  2739. var ob = (target).__ob__;
  2740. if (target._isVue || (ob && ob.vmCount)) {
  2741. true && warn(
  2742. 'Avoid deleting properties on a Vue instance or its root $data ' +
  2743. '- just set it to null.'
  2744. );
  2745. return
  2746. }
  2747. if (!hasOwn(target, key)) {
  2748. return
  2749. }
  2750. delete target[key];
  2751. if (!ob) {
  2752. return
  2753. }
  2754. ob.dep.notify();
  2755. }
  2756. /**
  2757. * Collect dependencies on array elements when the array is touched, since
  2758. * we cannot intercept array element access like property getters.
  2759. */
  2760. function dependArray (value) {
  2761. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  2762. e = value[i];
  2763. e && e.__ob__ && e.__ob__.dep.depend();
  2764. if (Array.isArray(e)) {
  2765. dependArray(e);
  2766. }
  2767. }
  2768. }
  2769. /* */
  2770. /**
  2771. * Option overwriting strategies are functions that handle
  2772. * how to merge a parent option value and a child option
  2773. * value into the final value.
  2774. */
  2775. var strats = config.optionMergeStrategies;
  2776. /**
  2777. * Options with restrictions
  2778. */
  2779. if (true) {
  2780. strats.el = strats.propsData = function (parent, child, vm, key) {
  2781. if (!vm) {
  2782. warn(
  2783. "option \"" + key + "\" can only be used during instance " +
  2784. 'creation with the `new` keyword.'
  2785. );
  2786. }
  2787. return defaultStrat(parent, child)
  2788. };
  2789. }
  2790. /**
  2791. * Helper that recursively merges two data objects together.
  2792. */
  2793. function mergeData (to, from) {
  2794. if (!from) { return to }
  2795. var key, toVal, fromVal;
  2796. var keys = hasSymbol
  2797. ? Reflect.ownKeys(from)
  2798. : Object.keys(from);
  2799. for (var i = 0; i < keys.length; i++) {
  2800. key = keys[i];
  2801. // in case the object is already observed...
  2802. if (key === '__ob__') { continue }
  2803. toVal = to[key];
  2804. fromVal = from[key];
  2805. if (!hasOwn(to, key)) {
  2806. set(to, key, fromVal);
  2807. } else if (
  2808. toVal !== fromVal &&
  2809. isPlainObject(toVal) &&
  2810. isPlainObject(fromVal)
  2811. ) {
  2812. mergeData(toVal, fromVal);
  2813. }
  2814. }
  2815. return to
  2816. }
  2817. /**
  2818. * Data
  2819. */
  2820. function mergeDataOrFn (
  2821. parentVal,
  2822. childVal,
  2823. vm
  2824. ) {
  2825. if (!vm) {
  2826. // in a Vue.extend merge, both should be functions
  2827. if (!childVal) {
  2828. return parentVal
  2829. }
  2830. if (!parentVal) {
  2831. return childVal
  2832. }
  2833. // when parentVal & childVal are both present,
  2834. // we need to return a function that returns the
  2835. // merged result of both functions... no need to
  2836. // check if parentVal is a function here because
  2837. // it has to be a function to pass previous merges.
  2838. return function mergedDataFn () {
  2839. return mergeData(
  2840. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  2841. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  2842. )
  2843. }
  2844. } else {
  2845. return function mergedInstanceDataFn () {
  2846. // instance merge
  2847. var instanceData = typeof childVal === 'function'
  2848. ? childVal.call(vm, vm)
  2849. : childVal;
  2850. var defaultData = typeof parentVal === 'function'
  2851. ? parentVal.call(vm, vm)
  2852. : parentVal;
  2853. if (instanceData) {
  2854. return mergeData(instanceData, defaultData)
  2855. } else {
  2856. return defaultData
  2857. }
  2858. }
  2859. }
  2860. }
  2861. strats.data = function (
  2862. parentVal,
  2863. childVal,
  2864. vm
  2865. ) {
  2866. if (!vm) {
  2867. if (childVal && typeof childVal !== 'function') {
  2868. true && warn(
  2869. 'The "data" option should be a function ' +
  2870. 'that returns a per-instance value in component ' +
  2871. 'definitions.',
  2872. vm
  2873. );
  2874. return parentVal
  2875. }
  2876. return mergeDataOrFn(parentVal, childVal)
  2877. }
  2878. return mergeDataOrFn(parentVal, childVal, vm)
  2879. };
  2880. /**
  2881. * Hooks and props are merged as arrays.
  2882. */
  2883. function mergeHook (
  2884. parentVal,
  2885. childVal
  2886. ) {
  2887. var res = childVal
  2888. ? parentVal
  2889. ? parentVal.concat(childVal)
  2890. : Array.isArray(childVal)
  2891. ? childVal
  2892. : [childVal]
  2893. : parentVal;
  2894. return res
  2895. ? dedupeHooks(res)
  2896. : res
  2897. }
  2898. function dedupeHooks (hooks) {
  2899. var res = [];
  2900. for (var i = 0; i < hooks.length; i++) {
  2901. if (res.indexOf(hooks[i]) === -1) {
  2902. res.push(hooks[i]);
  2903. }
  2904. }
  2905. return res
  2906. }
  2907. LIFECYCLE_HOOKS.forEach(function (hook) {
  2908. strats[hook] = mergeHook;
  2909. });
  2910. /**
  2911. * Assets
  2912. *
  2913. * When a vm is present (instance creation), we need to do
  2914. * a three-way merge between constructor options, instance
  2915. * options and parent options.
  2916. */
  2917. function mergeAssets (
  2918. parentVal,
  2919. childVal,
  2920. vm,
  2921. key
  2922. ) {
  2923. var res = Object.create(parentVal || null);
  2924. if (childVal) {
  2925. true && assertObjectType(key, childVal, vm);
  2926. return extend(res, childVal)
  2927. } else {
  2928. return res
  2929. }
  2930. }
  2931. ASSET_TYPES.forEach(function (type) {
  2932. strats[type + 's'] = mergeAssets;
  2933. });
  2934. /**
  2935. * Watchers.
  2936. *
  2937. * Watchers hashes should not overwrite one
  2938. * another, so we merge them as arrays.
  2939. */
  2940. strats.watch = function (
  2941. parentVal,
  2942. childVal,
  2943. vm,
  2944. key
  2945. ) {
  2946. // work around Firefox's Object.prototype.watch...
  2947. if (parentVal === nativeWatch) { parentVal = undefined; }
  2948. if (childVal === nativeWatch) { childVal = undefined; }
  2949. /* istanbul ignore if */
  2950. if (!childVal) { return Object.create(parentVal || null) }
  2951. if (true) {
  2952. assertObjectType(key, childVal, vm);
  2953. }
  2954. if (!parentVal) { return childVal }
  2955. var ret = {};
  2956. extend(ret, parentVal);
  2957. for (var key$1 in childVal) {
  2958. var parent = ret[key$1];
  2959. var child = childVal[key$1];
  2960. if (parent && !Array.isArray(parent)) {
  2961. parent = [parent];
  2962. }
  2963. ret[key$1] = parent
  2964. ? parent.concat(child)
  2965. : Array.isArray(child) ? child : [child];
  2966. }
  2967. return ret
  2968. };
  2969. /**
  2970. * Other object hashes.
  2971. */
  2972. strats.props =
  2973. strats.methods =
  2974. strats.inject =
  2975. strats.computed = function (
  2976. parentVal,
  2977. childVal,
  2978. vm,
  2979. key
  2980. ) {
  2981. if (childVal && "development" !== 'production') {
  2982. assertObjectType(key, childVal, vm);
  2983. }
  2984. if (!parentVal) { return childVal }
  2985. var ret = Object.create(null);
  2986. extend(ret, parentVal);
  2987. if (childVal) { extend(ret, childVal); }
  2988. return ret
  2989. };
  2990. strats.provide = mergeDataOrFn;
  2991. /**
  2992. * Default strategy.
  2993. */
  2994. var defaultStrat = function (parentVal, childVal) {
  2995. return childVal === undefined
  2996. ? parentVal
  2997. : childVal
  2998. };
  2999. /**
  3000. * Validate component names
  3001. */
  3002. function checkComponents (options) {
  3003. for (var key in options.components) {
  3004. validateComponentName(key);
  3005. }
  3006. }
  3007. function validateComponentName (name) {
  3008. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  3009. warn(
  3010. 'Invalid component name: "' + name + '". Component names ' +
  3011. 'should conform to valid custom element name in html5 specification.'
  3012. );
  3013. }
  3014. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  3015. warn(
  3016. 'Do not use built-in or reserved HTML elements as component ' +
  3017. 'id: ' + name
  3018. );
  3019. }
  3020. }
  3021. /**
  3022. * Ensure all props option syntax are normalized into the
  3023. * Object-based format.
  3024. */
  3025. function normalizeProps (options, vm) {
  3026. var props = options.props;
  3027. if (!props) { return }
  3028. var res = {};
  3029. var i, val, name;
  3030. if (Array.isArray(props)) {
  3031. i = props.length;
  3032. while (i--) {
  3033. val = props[i];
  3034. if (typeof val === 'string') {
  3035. name = camelize(val);
  3036. res[name] = { type: null };
  3037. } else if (true) {
  3038. warn('props must be strings when using array syntax.');
  3039. }
  3040. }
  3041. } else if (isPlainObject(props)) {
  3042. for (var key in props) {
  3043. val = props[key];
  3044. name = camelize(key);
  3045. res[name] = isPlainObject(val)
  3046. ? val
  3047. : { type: val };
  3048. }
  3049. } else if (true) {
  3050. warn(
  3051. "Invalid value for option \"props\": expected an Array or an Object, " +
  3052. "but got " + (toRawType(props)) + ".",
  3053. vm
  3054. );
  3055. }
  3056. options.props = res;
  3057. }
  3058. /**
  3059. * Normalize all injections into Object-based format
  3060. */
  3061. function normalizeInject (options, vm) {
  3062. var inject = options.inject;
  3063. if (!inject) { return }
  3064. var normalized = options.inject = {};
  3065. if (Array.isArray(inject)) {
  3066. for (var i = 0; i < inject.length; i++) {
  3067. normalized[inject[i]] = { from: inject[i] };
  3068. }
  3069. } else if (isPlainObject(inject)) {
  3070. for (var key in inject) {
  3071. var val = inject[key];
  3072. normalized[key] = isPlainObject(val)
  3073. ? extend({ from: key }, val)
  3074. : { from: val };
  3075. }
  3076. } else if (true) {
  3077. warn(
  3078. "Invalid value for option \"inject\": expected an Array or an Object, " +
  3079. "but got " + (toRawType(inject)) + ".",
  3080. vm
  3081. );
  3082. }
  3083. }
  3084. /**
  3085. * Normalize raw function directives into object format.
  3086. */
  3087. function normalizeDirectives (options) {
  3088. var dirs = options.directives;
  3089. if (dirs) {
  3090. for (var key in dirs) {
  3091. var def$$1 = dirs[key];
  3092. if (typeof def$$1 === 'function') {
  3093. dirs[key] = { bind: def$$1, update: def$$1 };
  3094. }
  3095. }
  3096. }
  3097. }
  3098. function assertObjectType (name, value, vm) {
  3099. if (!isPlainObject(value)) {
  3100. warn(
  3101. "Invalid value for option \"" + name + "\": expected an Object, " +
  3102. "but got " + (toRawType(value)) + ".",
  3103. vm
  3104. );
  3105. }
  3106. }
  3107. /**
  3108. * Merge two option objects into a new one.
  3109. * Core utility used in both instantiation and inheritance.
  3110. */
  3111. function mergeOptions (
  3112. parent,
  3113. child,
  3114. vm
  3115. ) {
  3116. if (true) {
  3117. checkComponents(child);
  3118. }
  3119. if (typeof child === 'function') {
  3120. child = child.options;
  3121. }
  3122. normalizeProps(child, vm);
  3123. normalizeInject(child, vm);
  3124. normalizeDirectives(child);
  3125. // Apply extends and mixins on the child options,
  3126. // but only if it is a raw options object that isn't
  3127. // the result of another mergeOptions call.
  3128. // Only merged options has the _base property.
  3129. if (!child._base) {
  3130. if (child.extends) {
  3131. parent = mergeOptions(parent, child.extends, vm);
  3132. }
  3133. if (child.mixins) {
  3134. for (var i = 0, l = child.mixins.length; i < l; i++) {
  3135. parent = mergeOptions(parent, child.mixins[i], vm);
  3136. }
  3137. }
  3138. }
  3139. var options = {};
  3140. var key;
  3141. for (key in parent) {
  3142. mergeField(key);
  3143. }
  3144. for (key in child) {
  3145. if (!hasOwn(parent, key)) {
  3146. mergeField(key);
  3147. }
  3148. }
  3149. function mergeField (key) {
  3150. var strat = strats[key] || defaultStrat;
  3151. options[key] = strat(parent[key], child[key], vm, key);
  3152. }
  3153. return options
  3154. }
  3155. /**
  3156. * Resolve an asset.
  3157. * This function is used because child instances need access
  3158. * to assets defined in its ancestor chain.
  3159. */
  3160. function resolveAsset (
  3161. options,
  3162. type,
  3163. id,
  3164. warnMissing
  3165. ) {
  3166. /* istanbul ignore if */
  3167. if (typeof id !== 'string') {
  3168. return
  3169. }
  3170. var assets = options[type];
  3171. // check local registration variations first
  3172. if (hasOwn(assets, id)) { return assets[id] }
  3173. var camelizedId = camelize(id);
  3174. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  3175. var PascalCaseId = capitalize(camelizedId);
  3176. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  3177. // fallback to prototype chain
  3178. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  3179. if ( true && warnMissing && !res) {
  3180. warn(
  3181. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  3182. options
  3183. );
  3184. }
  3185. return res
  3186. }
  3187. /* */
  3188. function validateProp (
  3189. key,
  3190. propOptions,
  3191. propsData,
  3192. vm
  3193. ) {
  3194. var prop = propOptions[key];
  3195. var absent = !hasOwn(propsData, key);
  3196. var value = propsData[key];
  3197. // boolean casting
  3198. var booleanIndex = getTypeIndex(Boolean, prop.type);
  3199. if (booleanIndex > -1) {
  3200. if (absent && !hasOwn(prop, 'default')) {
  3201. value = false;
  3202. } else if (value === '' || value === hyphenate(key)) {
  3203. // only cast empty string / same name to boolean if
  3204. // boolean has higher priority
  3205. var stringIndex = getTypeIndex(String, prop.type);
  3206. if (stringIndex < 0 || booleanIndex < stringIndex) {
  3207. value = true;
  3208. }
  3209. }
  3210. }
  3211. // check default value
  3212. if (value === undefined) {
  3213. value = getPropDefaultValue(vm, prop, key);
  3214. // since the default value is a fresh copy,
  3215. // make sure to observe it.
  3216. var prevShouldObserve = shouldObserve;
  3217. toggleObserving(true);
  3218. observe(value);
  3219. toggleObserving(prevShouldObserve);
  3220. }
  3221. if (
  3222. true
  3223. ) {
  3224. assertProp(prop, key, value, vm, absent);
  3225. }
  3226. return value
  3227. }
  3228. /**
  3229. * Get the default value of a prop.
  3230. */
  3231. function getPropDefaultValue (vm, prop, key) {
  3232. // no default, return undefined
  3233. if (!hasOwn(prop, 'default')) {
  3234. return undefined
  3235. }
  3236. var def = prop.default;
  3237. // warn against non-factory defaults for Object & Array
  3238. if ( true && isObject(def)) {
  3239. warn(
  3240. 'Invalid default value for prop "' + key + '": ' +
  3241. 'Props with type Object/Array must use a factory function ' +
  3242. 'to return the default value.',
  3243. vm
  3244. );
  3245. }
  3246. // the raw prop value was also undefined from previous render,
  3247. // return previous default value to avoid unnecessary watcher trigger
  3248. if (vm && vm.$options.propsData &&
  3249. vm.$options.propsData[key] === undefined &&
  3250. vm._props[key] !== undefined
  3251. ) {
  3252. return vm._props[key]
  3253. }
  3254. // call factory function for non-Function types
  3255. // a value is Function if its prototype is function even across different execution context
  3256. return typeof def === 'function' && getType(prop.type) !== 'Function'
  3257. ? def.call(vm)
  3258. : def
  3259. }
  3260. /**
  3261. * Assert whether a prop is valid.
  3262. */
  3263. function assertProp (
  3264. prop,
  3265. name,
  3266. value,
  3267. vm,
  3268. absent
  3269. ) {
  3270. if (prop.required && absent) {
  3271. warn(
  3272. 'Missing required prop: "' + name + '"',
  3273. vm
  3274. );
  3275. return
  3276. }
  3277. if (value == null && !prop.required) {
  3278. return
  3279. }
  3280. var type = prop.type;
  3281. var valid = !type || type === true;
  3282. var expectedTypes = [];
  3283. if (type) {
  3284. if (!Array.isArray(type)) {
  3285. type = [type];
  3286. }
  3287. for (var i = 0; i < type.length && !valid; i++) {
  3288. var assertedType = assertType(value, type[i]);
  3289. expectedTypes.push(assertedType.expectedType || '');
  3290. valid = assertedType.valid;
  3291. }
  3292. }
  3293. if (!valid) {
  3294. warn(
  3295. getInvalidTypeMessage(name, value, expectedTypes),
  3296. vm
  3297. );
  3298. return
  3299. }
  3300. var validator = prop.validator;
  3301. if (validator) {
  3302. if (!validator(value)) {
  3303. warn(
  3304. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  3305. vm
  3306. );
  3307. }
  3308. }
  3309. }
  3310. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  3311. function assertType (value, type) {
  3312. var valid;
  3313. var expectedType = getType(type);
  3314. if (simpleCheckRE.test(expectedType)) {
  3315. var t = typeof value;
  3316. valid = t === expectedType.toLowerCase();
  3317. // for primitive wrapper objects
  3318. if (!valid && t === 'object') {
  3319. valid = value instanceof type;
  3320. }
  3321. } else if (expectedType === 'Object') {
  3322. valid = isPlainObject(value);
  3323. } else if (expectedType === 'Array') {
  3324. valid = Array.isArray(value);
  3325. } else {
  3326. valid = value instanceof type;
  3327. }
  3328. return {
  3329. valid: valid,
  3330. expectedType: expectedType
  3331. }
  3332. }
  3333. /**
  3334. * Use function string name to check built-in types,
  3335. * because a simple equality check will fail when running
  3336. * across different vms / iframes.
  3337. */
  3338. function getType (fn) {
  3339. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  3340. return match ? match[1] : ''
  3341. }
  3342. function isSameType (a, b) {
  3343. return getType(a) === getType(b)
  3344. }
  3345. function getTypeIndex (type, expectedTypes) {
  3346. if (!Array.isArray(expectedTypes)) {
  3347. return isSameType(expectedTypes, type) ? 0 : -1
  3348. }
  3349. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  3350. if (isSameType(expectedTypes[i], type)) {
  3351. return i
  3352. }
  3353. }
  3354. return -1
  3355. }
  3356. function getInvalidTypeMessage (name, value, expectedTypes) {
  3357. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  3358. " Expected " + (expectedTypes.map(capitalize).join(', '));
  3359. var expectedType = expectedTypes[0];
  3360. var receivedType = toRawType(value);
  3361. var expectedValue = styleValue(value, expectedType);
  3362. var receivedValue = styleValue(value, receivedType);
  3363. // check if we need to specify expected value
  3364. if (expectedTypes.length === 1 &&
  3365. isExplicable(expectedType) &&
  3366. !isBoolean(expectedType, receivedType)) {
  3367. message += " with value " + expectedValue;
  3368. }
  3369. message += ", got " + receivedType + " ";
  3370. // check if we need to specify received value
  3371. if (isExplicable(receivedType)) {
  3372. message += "with value " + receivedValue + ".";
  3373. }
  3374. return message
  3375. }
  3376. function styleValue (value, type) {
  3377. if (type === 'String') {
  3378. return ("\"" + value + "\"")
  3379. } else if (type === 'Number') {
  3380. return ("" + (Number(value)))
  3381. } else {
  3382. return ("" + value)
  3383. }
  3384. }
  3385. function isExplicable (value) {
  3386. var explicitTypes = ['string', 'number', 'boolean'];
  3387. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  3388. }
  3389. function isBoolean () {
  3390. var args = [], len = arguments.length;
  3391. while ( len-- ) args[ len ] = arguments[ len ];
  3392. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  3393. }
  3394. /* */
  3395. function handleError (err, vm, info) {
  3396. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  3397. // See: https://github.com/vuejs/vuex/issues/1505
  3398. pushTarget();
  3399. try {
  3400. if (vm) {
  3401. var cur = vm;
  3402. while ((cur = cur.$parent)) {
  3403. var hooks = cur.$options.errorCaptured;
  3404. if (hooks) {
  3405. for (var i = 0; i < hooks.length; i++) {
  3406. try {
  3407. var capture = hooks[i].call(cur, err, vm, info) === false;
  3408. if (capture) { return }
  3409. } catch (e) {
  3410. globalHandleError(e, cur, 'errorCaptured hook');
  3411. }
  3412. }
  3413. }
  3414. }
  3415. }
  3416. globalHandleError(err, vm, info);
  3417. } finally {
  3418. popTarget();
  3419. }
  3420. }
  3421. function invokeWithErrorHandling (
  3422. handler,
  3423. context,
  3424. args,
  3425. vm,
  3426. info
  3427. ) {
  3428. var res;
  3429. try {
  3430. res = args ? handler.apply(context, args) : handler.call(context);
  3431. if (res && !res._isVue && isPromise(res) && !res._handled) {
  3432. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  3433. // issue #9511
  3434. // avoid catch triggering multiple times when nested calls
  3435. res._handled = true;
  3436. }
  3437. } catch (e) {
  3438. handleError(e, vm, info);
  3439. }
  3440. return res
  3441. }
  3442. function globalHandleError (err, vm, info) {
  3443. if (config.errorHandler) {
  3444. try {
  3445. return config.errorHandler.call(null, err, vm, info)
  3446. } catch (e) {
  3447. // if the user intentionally throws the original error in the handler,
  3448. // do not log it twice
  3449. if (e !== err) {
  3450. logError(e, null, 'config.errorHandler');
  3451. }
  3452. }
  3453. }
  3454. logError(err, vm, info);
  3455. }
  3456. function logError (err, vm, info) {
  3457. if (true) {
  3458. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  3459. }
  3460. /* istanbul ignore else */
  3461. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  3462. console.error(err);
  3463. } else {
  3464. throw err
  3465. }
  3466. }
  3467. /* */
  3468. var callbacks = [];
  3469. var pending = false;
  3470. function flushCallbacks () {
  3471. pending = false;
  3472. var copies = callbacks.slice(0);
  3473. callbacks.length = 0;
  3474. for (var i = 0; i < copies.length; i++) {
  3475. copies[i]();
  3476. }
  3477. }
  3478. // Here we have async deferring wrappers using microtasks.
  3479. // In 2.5 we used (macro) tasks (in combination with microtasks).
  3480. // However, it has subtle problems when state is changed right before repaint
  3481. // (e.g. #6813, out-in transitions).
  3482. // Also, using (macro) tasks in event handler would cause some weird behaviors
  3483. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  3484. // So we now use microtasks everywhere, again.
  3485. // A major drawback of this tradeoff is that there are some scenarios
  3486. // where microtasks have too high a priority and fire in between supposedly
  3487. // sequential events (e.g. #4521, #6690, which have workarounds)
  3488. // or even between bubbling of the same event (#6566).
  3489. var timerFunc;
  3490. // The nextTick behavior leverages the microtask queue, which can be accessed
  3491. // via either native Promise.then or MutationObserver.
  3492. // MutationObserver has wider support, however it is seriously bugged in
  3493. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  3494. // completely stops working after triggering a few times... so, if native
  3495. // Promise is available, we will use it:
  3496. /* istanbul ignore next, $flow-disable-line */
  3497. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  3498. var p = Promise.resolve();
  3499. timerFunc = function () {
  3500. p.then(flushCallbacks);
  3501. // In problematic UIWebViews, Promise.then doesn't completely break, but
  3502. // it can get stuck in a weird state where callbacks are pushed into the
  3503. // microtask queue but the queue isn't being flushed, until the browser
  3504. // needs to do some other work, e.g. handle a timer. Therefore we can
  3505. // "force" the microtask queue to be flushed by adding an empty timer.
  3506. if (isIOS) { setTimeout(noop); }
  3507. };
  3508. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  3509. isNative(MutationObserver) ||
  3510. // PhantomJS and iOS 7.x
  3511. MutationObserver.toString() === '[object MutationObserverConstructor]'
  3512. )) {
  3513. // Use MutationObserver where native Promise is not available,
  3514. // e.g. PhantomJS, iOS7, Android 4.4
  3515. // (#6466 MutationObserver is unreliable in IE11)
  3516. var counter = 1;
  3517. var observer = new MutationObserver(flushCallbacks);
  3518. var textNode = document.createTextNode(String(counter));
  3519. observer.observe(textNode, {
  3520. characterData: true
  3521. });
  3522. timerFunc = function () {
  3523. counter = (counter + 1) % 2;
  3524. textNode.data = String(counter);
  3525. };
  3526. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  3527. // Fallback to setImmediate.
  3528. // Technically it leverages the (macro) task queue,
  3529. // but it is still a better choice than setTimeout.
  3530. timerFunc = function () {
  3531. setImmediate(flushCallbacks);
  3532. };
  3533. } else {
  3534. // Fallback to setTimeout.
  3535. timerFunc = function () {
  3536. setTimeout(flushCallbacks, 0);
  3537. };
  3538. }
  3539. function nextTick (cb, ctx) {
  3540. var _resolve;
  3541. callbacks.push(function () {
  3542. if (cb) {
  3543. try {
  3544. cb.call(ctx);
  3545. } catch (e) {
  3546. handleError(e, ctx, 'nextTick');
  3547. }
  3548. } else if (_resolve) {
  3549. _resolve(ctx);
  3550. }
  3551. });
  3552. if (!pending) {
  3553. pending = true;
  3554. timerFunc();
  3555. }
  3556. // $flow-disable-line
  3557. if (!cb && typeof Promise !== 'undefined') {
  3558. return new Promise(function (resolve) {
  3559. _resolve = resolve;
  3560. })
  3561. }
  3562. }
  3563. /* */
  3564. /* not type checking this file because flow doesn't play well with Proxy */
  3565. var initProxy;
  3566. if (true) {
  3567. var allowedGlobals = makeMap(
  3568. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  3569. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  3570. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  3571. 'require' // for Webpack/Browserify
  3572. );
  3573. var warnNonPresent = function (target, key) {
  3574. warn(
  3575. "Property or method \"" + key + "\" is not defined on the instance but " +
  3576. 'referenced during render. Make sure that this property is reactive, ' +
  3577. 'either in the data option, or for class-based components, by ' +
  3578. 'initializing the property. ' +
  3579. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  3580. target
  3581. );
  3582. };
  3583. var warnReservedPrefix = function (target, key) {
  3584. warn(
  3585. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  3586. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  3587. 'prevent conflicts with Vue internals. ' +
  3588. 'See: https://vuejs.org/v2/api/#data',
  3589. target
  3590. );
  3591. };
  3592. var hasProxy =
  3593. typeof Proxy !== 'undefined' && isNative(Proxy);
  3594. if (hasProxy) {
  3595. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  3596. config.keyCodes = new Proxy(config.keyCodes, {
  3597. set: function set (target, key, value) {
  3598. if (isBuiltInModifier(key)) {
  3599. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  3600. return false
  3601. } else {
  3602. target[key] = value;
  3603. return true
  3604. }
  3605. }
  3606. });
  3607. }
  3608. var hasHandler = {
  3609. has: function has (target, key) {
  3610. var has = key in target;
  3611. var isAllowed = allowedGlobals(key) ||
  3612. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  3613. if (!has && !isAllowed) {
  3614. if (key in target.$data) { warnReservedPrefix(target, key); }
  3615. else { warnNonPresent(target, key); }
  3616. }
  3617. return has || !isAllowed
  3618. }
  3619. };
  3620. var getHandler = {
  3621. get: function get (target, key) {
  3622. if (typeof key === 'string' && !(key in target)) {
  3623. if (key in target.$data) { warnReservedPrefix(target, key); }
  3624. else { warnNonPresent(target, key); }
  3625. }
  3626. return target[key]
  3627. }
  3628. };
  3629. initProxy = function initProxy (vm) {
  3630. if (hasProxy) {
  3631. // determine which proxy handler to use
  3632. var options = vm.$options;
  3633. var handlers = options.render && options.render._withStripped
  3634. ? getHandler
  3635. : hasHandler;
  3636. vm._renderProxy = new Proxy(vm, handlers);
  3637. } else {
  3638. vm._renderProxy = vm;
  3639. }
  3640. };
  3641. }
  3642. /* */
  3643. var seenObjects = new _Set();
  3644. /**
  3645. * Recursively traverse an object to evoke all converted
  3646. * getters, so that every nested property inside the object
  3647. * is collected as a "deep" dependency.
  3648. */
  3649. function traverse (val) {
  3650. _traverse(val, seenObjects);
  3651. seenObjects.clear();
  3652. }
  3653. function _traverse (val, seen) {
  3654. var i, keys;
  3655. var isA = Array.isArray(val);
  3656. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  3657. return
  3658. }
  3659. if (val.__ob__) {
  3660. var depId = val.__ob__.dep.id;
  3661. if (seen.has(depId)) {
  3662. return
  3663. }
  3664. seen.add(depId);
  3665. }
  3666. if (isA) {
  3667. i = val.length;
  3668. while (i--) { _traverse(val[i], seen); }
  3669. } else {
  3670. keys = Object.keys(val);
  3671. i = keys.length;
  3672. while (i--) { _traverse(val[keys[i]], seen); }
  3673. }
  3674. }
  3675. var mark;
  3676. var measure;
  3677. if (true) {
  3678. var perf = inBrowser && window.performance;
  3679. /* istanbul ignore if */
  3680. if (
  3681. perf &&
  3682. perf.mark &&
  3683. perf.measure &&
  3684. perf.clearMarks &&
  3685. perf.clearMeasures
  3686. ) {
  3687. mark = function (tag) { return perf.mark(tag); };
  3688. measure = function (name, startTag, endTag) {
  3689. perf.measure(name, startTag, endTag);
  3690. perf.clearMarks(startTag);
  3691. perf.clearMarks(endTag);
  3692. // perf.clearMeasures(name)
  3693. };
  3694. }
  3695. }
  3696. /* */
  3697. var normalizeEvent = cached(function (name) {
  3698. var passive = name.charAt(0) === '&';
  3699. name = passive ? name.slice(1) : name;
  3700. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  3701. name = once$$1 ? name.slice(1) : name;
  3702. var capture = name.charAt(0) === '!';
  3703. name = capture ? name.slice(1) : name;
  3704. return {
  3705. name: name,
  3706. once: once$$1,
  3707. capture: capture,
  3708. passive: passive
  3709. }
  3710. });
  3711. function createFnInvoker (fns, vm) {
  3712. function invoker () {
  3713. var arguments$1 = arguments;
  3714. var fns = invoker.fns;
  3715. if (Array.isArray(fns)) {
  3716. var cloned = fns.slice();
  3717. for (var i = 0; i < cloned.length; i++) {
  3718. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  3719. }
  3720. } else {
  3721. // return handler return value for single handlers
  3722. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  3723. }
  3724. }
  3725. invoker.fns = fns;
  3726. return invoker
  3727. }
  3728. function updateListeners (
  3729. on,
  3730. oldOn,
  3731. add,
  3732. remove$$1,
  3733. createOnceHandler,
  3734. vm
  3735. ) {
  3736. var name, def$$1, cur, old, event;
  3737. for (name in on) {
  3738. def$$1 = cur = on[name];
  3739. old = oldOn[name];
  3740. event = normalizeEvent(name);
  3741. if (isUndef(cur)) {
  3742. true && warn(
  3743. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  3744. vm
  3745. );
  3746. } else if (isUndef(old)) {
  3747. if (isUndef(cur.fns)) {
  3748. cur = on[name] = createFnInvoker(cur, vm);
  3749. }
  3750. if (isTrue(event.once)) {
  3751. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  3752. }
  3753. add(event.name, cur, event.capture, event.passive, event.params);
  3754. } else if (cur !== old) {
  3755. old.fns = cur;
  3756. on[name] = old;
  3757. }
  3758. }
  3759. for (name in oldOn) {
  3760. if (isUndef(on[name])) {
  3761. event = normalizeEvent(name);
  3762. remove$$1(event.name, oldOn[name], event.capture);
  3763. }
  3764. }
  3765. }
  3766. /* */
  3767. /* */
  3768. // fixed by xxxxxx (mp properties)
  3769. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  3770. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  3771. if (isUndef(propOptions)) {
  3772. return res
  3773. }
  3774. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  3775. var attrs = data.attrs;
  3776. var props = data.props;
  3777. if (isDef(attrs) || isDef(props)) {
  3778. for (var key in propOptions) {
  3779. var altKey = hyphenate(key);
  3780. var result = checkProp(res, props, key, altKey, true) ||
  3781. checkProp(res, attrs, key, altKey, false);
  3782. // externalClass
  3783. if (
  3784. result &&
  3785. res[key] &&
  3786. externalClasses.indexOf(altKey) !== -1 &&
  3787. context[camelize(res[key])]
  3788. ) {
  3789. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  3790. res[key] = context[camelize(res[key])];
  3791. }
  3792. }
  3793. }
  3794. return res
  3795. }
  3796. function extractPropsFromVNodeData (
  3797. data,
  3798. Ctor,
  3799. tag,
  3800. context// fixed by xxxxxx
  3801. ) {
  3802. // we are only extracting raw values here.
  3803. // validation and default values are handled in the child
  3804. // component itself.
  3805. var propOptions = Ctor.options.props;
  3806. if (isUndef(propOptions)) {
  3807. // fixed by xxxxxx
  3808. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  3809. }
  3810. var res = {};
  3811. var attrs = data.attrs;
  3812. var props = data.props;
  3813. if (isDef(attrs) || isDef(props)) {
  3814. for (var key in propOptions) {
  3815. var altKey = hyphenate(key);
  3816. if (true) {
  3817. var keyInLowerCase = key.toLowerCase();
  3818. if (
  3819. key !== keyInLowerCase &&
  3820. attrs && hasOwn(attrs, keyInLowerCase)
  3821. ) {
  3822. tip(
  3823. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  3824. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  3825. " \"" + key + "\". " +
  3826. "Note that HTML attributes are case-insensitive and camelCased " +
  3827. "props need to use their kebab-case equivalents when using in-DOM " +
  3828. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  3829. );
  3830. }
  3831. }
  3832. checkProp(res, props, key, altKey, true) ||
  3833. checkProp(res, attrs, key, altKey, false);
  3834. }
  3835. }
  3836. // fixed by xxxxxx
  3837. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  3838. }
  3839. function checkProp (
  3840. res,
  3841. hash,
  3842. key,
  3843. altKey,
  3844. preserve
  3845. ) {
  3846. if (isDef(hash)) {
  3847. if (hasOwn(hash, key)) {
  3848. res[key] = hash[key];
  3849. if (!preserve) {
  3850. delete hash[key];
  3851. }
  3852. return true
  3853. } else if (hasOwn(hash, altKey)) {
  3854. res[key] = hash[altKey];
  3855. if (!preserve) {
  3856. delete hash[altKey];
  3857. }
  3858. return true
  3859. }
  3860. }
  3861. return false
  3862. }
  3863. /* */
  3864. // The template compiler attempts to minimize the need for normalization by
  3865. // statically analyzing the template at compile time.
  3866. //
  3867. // For plain HTML markup, normalization can be completely skipped because the
  3868. // generated render function is guaranteed to return Array<VNode>. There are
  3869. // two cases where extra normalization is needed:
  3870. // 1. When the children contains components - because a functional component
  3871. // may return an Array instead of a single root. In this case, just a simple
  3872. // normalization is needed - if any child is an Array, we flatten the whole
  3873. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  3874. // because functional components already normalize their own children.
  3875. function simpleNormalizeChildren (children) {
  3876. for (var i = 0; i < children.length; i++) {
  3877. if (Array.isArray(children[i])) {
  3878. return Array.prototype.concat.apply([], children)
  3879. }
  3880. }
  3881. return children
  3882. }
  3883. // 2. When the children contains constructs that always generated nested Arrays,
  3884. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  3885. // with hand-written render functions / JSX. In such cases a full normalization
  3886. // is needed to cater to all possible types of children values.
  3887. function normalizeChildren (children) {
  3888. return isPrimitive(children)
  3889. ? [createTextVNode(children)]
  3890. : Array.isArray(children)
  3891. ? normalizeArrayChildren(children)
  3892. : undefined
  3893. }
  3894. function isTextNode (node) {
  3895. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  3896. }
  3897. function normalizeArrayChildren (children, nestedIndex) {
  3898. var res = [];
  3899. var i, c, lastIndex, last;
  3900. for (i = 0; i < children.length; i++) {
  3901. c = children[i];
  3902. if (isUndef(c) || typeof c === 'boolean') { continue }
  3903. lastIndex = res.length - 1;
  3904. last = res[lastIndex];
  3905. // nested
  3906. if (Array.isArray(c)) {
  3907. if (c.length > 0) {
  3908. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  3909. // merge adjacent text nodes
  3910. if (isTextNode(c[0]) && isTextNode(last)) {
  3911. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  3912. c.shift();
  3913. }
  3914. res.push.apply(res, c);
  3915. }
  3916. } else if (isPrimitive(c)) {
  3917. if (isTextNode(last)) {
  3918. // merge adjacent text nodes
  3919. // this is necessary for SSR hydration because text nodes are
  3920. // essentially merged when rendered to HTML strings
  3921. res[lastIndex] = createTextVNode(last.text + c);
  3922. } else if (c !== '') {
  3923. // convert primitive to vnode
  3924. res.push(createTextVNode(c));
  3925. }
  3926. } else {
  3927. if (isTextNode(c) && isTextNode(last)) {
  3928. // merge adjacent text nodes
  3929. res[lastIndex] = createTextVNode(last.text + c.text);
  3930. } else {
  3931. // default key for nested array children (likely generated by v-for)
  3932. if (isTrue(children._isVList) &&
  3933. isDef(c.tag) &&
  3934. isUndef(c.key) &&
  3935. isDef(nestedIndex)) {
  3936. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  3937. }
  3938. res.push(c);
  3939. }
  3940. }
  3941. }
  3942. return res
  3943. }
  3944. /* */
  3945. function initProvide (vm) {
  3946. var provide = vm.$options.provide;
  3947. if (provide) {
  3948. vm._provided = typeof provide === 'function'
  3949. ? provide.call(vm)
  3950. : provide;
  3951. }
  3952. }
  3953. function initInjections (vm) {
  3954. var result = resolveInject(vm.$options.inject, vm);
  3955. if (result) {
  3956. toggleObserving(false);
  3957. Object.keys(result).forEach(function (key) {
  3958. /* istanbul ignore else */
  3959. if (true) {
  3960. defineReactive$$1(vm, key, result[key], function () {
  3961. warn(
  3962. "Avoid mutating an injected value directly since the changes will be " +
  3963. "overwritten whenever the provided component re-renders. " +
  3964. "injection being mutated: \"" + key + "\"",
  3965. vm
  3966. );
  3967. });
  3968. } else {}
  3969. });
  3970. toggleObserving(true);
  3971. }
  3972. }
  3973. function resolveInject (inject, vm) {
  3974. if (inject) {
  3975. // inject is :any because flow is not smart enough to figure out cached
  3976. var result = Object.create(null);
  3977. var keys = hasSymbol
  3978. ? Reflect.ownKeys(inject)
  3979. : Object.keys(inject);
  3980. for (var i = 0; i < keys.length; i++) {
  3981. var key = keys[i];
  3982. // #6574 in case the inject object is observed...
  3983. if (key === '__ob__') { continue }
  3984. var provideKey = inject[key].from;
  3985. var source = vm;
  3986. while (source) {
  3987. if (source._provided && hasOwn(source._provided, provideKey)) {
  3988. result[key] = source._provided[provideKey];
  3989. break
  3990. }
  3991. source = source.$parent;
  3992. }
  3993. if (!source) {
  3994. if ('default' in inject[key]) {
  3995. var provideDefault = inject[key].default;
  3996. result[key] = typeof provideDefault === 'function'
  3997. ? provideDefault.call(vm)
  3998. : provideDefault;
  3999. } else if (true) {
  4000. warn(("Injection \"" + key + "\" not found"), vm);
  4001. }
  4002. }
  4003. }
  4004. return result
  4005. }
  4006. }
  4007. /* */
  4008. /**
  4009. * Runtime helper for resolving raw children VNodes into a slot object.
  4010. */
  4011. function resolveSlots (
  4012. children,
  4013. context
  4014. ) {
  4015. if (!children || !children.length) {
  4016. return {}
  4017. }
  4018. var slots = {};
  4019. for (var i = 0, l = children.length; i < l; i++) {
  4020. var child = children[i];
  4021. var data = child.data;
  4022. // remove slot attribute if the node is resolved as a Vue slot node
  4023. if (data && data.attrs && data.attrs.slot) {
  4024. delete data.attrs.slot;
  4025. }
  4026. // named slots should only be respected if the vnode was rendered in the
  4027. // same context.
  4028. if ((child.context === context || child.fnContext === context) &&
  4029. data && data.slot != null
  4030. ) {
  4031. var name = data.slot;
  4032. var slot = (slots[name] || (slots[name] = []));
  4033. if (child.tag === 'template') {
  4034. slot.push.apply(slot, child.children || []);
  4035. } else {
  4036. slot.push(child);
  4037. }
  4038. } else {
  4039. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  4040. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  4041. (slots['page'] || (slots['page'] = [])).push(child);
  4042. }else{
  4043. (slots.default || (slots.default = [])).push(child);
  4044. }
  4045. }
  4046. }
  4047. // ignore slots that contains only whitespace
  4048. for (var name$1 in slots) {
  4049. if (slots[name$1].every(isWhitespace)) {
  4050. delete slots[name$1];
  4051. }
  4052. }
  4053. return slots
  4054. }
  4055. function isWhitespace (node) {
  4056. return (node.isComment && !node.asyncFactory) || node.text === ' '
  4057. }
  4058. /* */
  4059. function normalizeScopedSlots (
  4060. slots,
  4061. normalSlots,
  4062. prevSlots
  4063. ) {
  4064. var res;
  4065. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  4066. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  4067. var key = slots && slots.$key;
  4068. if (!slots) {
  4069. res = {};
  4070. } else if (slots._normalized) {
  4071. // fast path 1: child component re-render only, parent did not change
  4072. return slots._normalized
  4073. } else if (
  4074. isStable &&
  4075. prevSlots &&
  4076. prevSlots !== emptyObject &&
  4077. key === prevSlots.$key &&
  4078. !hasNormalSlots &&
  4079. !prevSlots.$hasNormal
  4080. ) {
  4081. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  4082. // only need to normalize once
  4083. return prevSlots
  4084. } else {
  4085. res = {};
  4086. for (var key$1 in slots) {
  4087. if (slots[key$1] && key$1[0] !== '$') {
  4088. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  4089. }
  4090. }
  4091. }
  4092. // expose normal slots on scopedSlots
  4093. for (var key$2 in normalSlots) {
  4094. if (!(key$2 in res)) {
  4095. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  4096. }
  4097. }
  4098. // avoriaz seems to mock a non-extensible $scopedSlots object
  4099. // and when that is passed down this would cause an error
  4100. if (slots && Object.isExtensible(slots)) {
  4101. (slots)._normalized = res;
  4102. }
  4103. def(res, '$stable', isStable);
  4104. def(res, '$key', key);
  4105. def(res, '$hasNormal', hasNormalSlots);
  4106. return res
  4107. }
  4108. function normalizeScopedSlot(normalSlots, key, fn) {
  4109. var normalized = function () {
  4110. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  4111. res = res && typeof res === 'object' && !Array.isArray(res)
  4112. ? [res] // single vnode
  4113. : normalizeChildren(res);
  4114. return res && (
  4115. res.length === 0 ||
  4116. (res.length === 1 && res[0].isComment) // #9658
  4117. ) ? undefined
  4118. : res
  4119. };
  4120. // this is a slot using the new v-slot syntax without scope. although it is
  4121. // compiled as a scoped slot, render fn users would expect it to be present
  4122. // on this.$slots because the usage is semantically a normal slot.
  4123. if (fn.proxy) {
  4124. Object.defineProperty(normalSlots, key, {
  4125. get: normalized,
  4126. enumerable: true,
  4127. configurable: true
  4128. });
  4129. }
  4130. return normalized
  4131. }
  4132. function proxyNormalSlot(slots, key) {
  4133. return function () { return slots[key]; }
  4134. }
  4135. /* */
  4136. /**
  4137. * Runtime helper for rendering v-for lists.
  4138. */
  4139. function renderList (
  4140. val,
  4141. render
  4142. ) {
  4143. var ret, i, l, keys, key;
  4144. if (Array.isArray(val) || typeof val === 'string') {
  4145. ret = new Array(val.length);
  4146. for (i = 0, l = val.length; i < l; i++) {
  4147. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  4148. }
  4149. } else if (typeof val === 'number') {
  4150. ret = new Array(val);
  4151. for (i = 0; i < val; i++) {
  4152. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  4153. }
  4154. } else if (isObject(val)) {
  4155. if (hasSymbol && val[Symbol.iterator]) {
  4156. ret = [];
  4157. var iterator = val[Symbol.iterator]();
  4158. var result = iterator.next();
  4159. while (!result.done) {
  4160. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  4161. result = iterator.next();
  4162. }
  4163. } else {
  4164. keys = Object.keys(val);
  4165. ret = new Array(keys.length);
  4166. for (i = 0, l = keys.length; i < l; i++) {
  4167. key = keys[i];
  4168. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  4169. }
  4170. }
  4171. }
  4172. if (!isDef(ret)) {
  4173. ret = [];
  4174. }
  4175. (ret)._isVList = true;
  4176. return ret
  4177. }
  4178. /* */
  4179. /**
  4180. * Runtime helper for rendering <slot>
  4181. */
  4182. function renderSlot (
  4183. name,
  4184. fallback,
  4185. props,
  4186. bindObject
  4187. ) {
  4188. var scopedSlotFn = this.$scopedSlots[name];
  4189. var nodes;
  4190. if (scopedSlotFn) { // scoped slot
  4191. props = props || {};
  4192. if (bindObject) {
  4193. if ( true && !isObject(bindObject)) {
  4194. warn(
  4195. 'slot v-bind without argument expects an Object',
  4196. this
  4197. );
  4198. }
  4199. props = extend(extend({}, bindObject), props);
  4200. }
  4201. // fixed by xxxxxx app-plus scopedSlot
  4202. nodes = scopedSlotFn(props, this, props._i) || fallback;
  4203. } else {
  4204. nodes = this.$slots[name] || fallback;
  4205. }
  4206. var target = props && props.slot;
  4207. if (target) {
  4208. return this.$createElement('template', { slot: target }, nodes)
  4209. } else {
  4210. return nodes
  4211. }
  4212. }
  4213. /* */
  4214. /**
  4215. * Runtime helper for resolving filters
  4216. */
  4217. function resolveFilter (id) {
  4218. return resolveAsset(this.$options, 'filters', id, true) || identity
  4219. }
  4220. /* */
  4221. function isKeyNotMatch (expect, actual) {
  4222. if (Array.isArray(expect)) {
  4223. return expect.indexOf(actual) === -1
  4224. } else {
  4225. return expect !== actual
  4226. }
  4227. }
  4228. /**
  4229. * Runtime helper for checking keyCodes from config.
  4230. * exposed as Vue.prototype._k
  4231. * passing in eventKeyName as last argument separately for backwards compat
  4232. */
  4233. function checkKeyCodes (
  4234. eventKeyCode,
  4235. key,
  4236. builtInKeyCode,
  4237. eventKeyName,
  4238. builtInKeyName
  4239. ) {
  4240. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  4241. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  4242. return isKeyNotMatch(builtInKeyName, eventKeyName)
  4243. } else if (mappedKeyCode) {
  4244. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  4245. } else if (eventKeyName) {
  4246. return hyphenate(eventKeyName) !== key
  4247. }
  4248. }
  4249. /* */
  4250. /**
  4251. * Runtime helper for merging v-bind="object" into a VNode's data.
  4252. */
  4253. function bindObjectProps (
  4254. data,
  4255. tag,
  4256. value,
  4257. asProp,
  4258. isSync
  4259. ) {
  4260. if (value) {
  4261. if (!isObject(value)) {
  4262. true && warn(
  4263. 'v-bind without argument expects an Object or Array value',
  4264. this
  4265. );
  4266. } else {
  4267. if (Array.isArray(value)) {
  4268. value = toObject(value);
  4269. }
  4270. var hash;
  4271. var loop = function ( key ) {
  4272. if (
  4273. key === 'class' ||
  4274. key === 'style' ||
  4275. isReservedAttribute(key)
  4276. ) {
  4277. hash = data;
  4278. } else {
  4279. var type = data.attrs && data.attrs.type;
  4280. hash = asProp || config.mustUseProp(tag, type, key)
  4281. ? data.domProps || (data.domProps = {})
  4282. : data.attrs || (data.attrs = {});
  4283. }
  4284. var camelizedKey = camelize(key);
  4285. var hyphenatedKey = hyphenate(key);
  4286. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  4287. hash[key] = value[key];
  4288. if (isSync) {
  4289. var on = data.on || (data.on = {});
  4290. on[("update:" + key)] = function ($event) {
  4291. value[key] = $event;
  4292. };
  4293. }
  4294. }
  4295. };
  4296. for (var key in value) loop( key );
  4297. }
  4298. }
  4299. return data
  4300. }
  4301. /* */
  4302. /**
  4303. * Runtime helper for rendering static trees.
  4304. */
  4305. function renderStatic (
  4306. index,
  4307. isInFor
  4308. ) {
  4309. var cached = this._staticTrees || (this._staticTrees = []);
  4310. var tree = cached[index];
  4311. // if has already-rendered static tree and not inside v-for,
  4312. // we can reuse the same tree.
  4313. if (tree && !isInFor) {
  4314. return tree
  4315. }
  4316. // otherwise, render a fresh tree.
  4317. tree = cached[index] = this.$options.staticRenderFns[index].call(
  4318. this._renderProxy,
  4319. null,
  4320. this // for render fns generated for functional component templates
  4321. );
  4322. markStatic(tree, ("__static__" + index), false);
  4323. return tree
  4324. }
  4325. /**
  4326. * Runtime helper for v-once.
  4327. * Effectively it means marking the node as static with a unique key.
  4328. */
  4329. function markOnce (
  4330. tree,
  4331. index,
  4332. key
  4333. ) {
  4334. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  4335. return tree
  4336. }
  4337. function markStatic (
  4338. tree,
  4339. key,
  4340. isOnce
  4341. ) {
  4342. if (Array.isArray(tree)) {
  4343. for (var i = 0; i < tree.length; i++) {
  4344. if (tree[i] && typeof tree[i] !== 'string') {
  4345. markStaticNode(tree[i], (key + "_" + i), isOnce);
  4346. }
  4347. }
  4348. } else {
  4349. markStaticNode(tree, key, isOnce);
  4350. }
  4351. }
  4352. function markStaticNode (node, key, isOnce) {
  4353. node.isStatic = true;
  4354. node.key = key;
  4355. node.isOnce = isOnce;
  4356. }
  4357. /* */
  4358. function bindObjectListeners (data, value) {
  4359. if (value) {
  4360. if (!isPlainObject(value)) {
  4361. true && warn(
  4362. 'v-on without argument expects an Object value',
  4363. this
  4364. );
  4365. } else {
  4366. var on = data.on = data.on ? extend({}, data.on) : {};
  4367. for (var key in value) {
  4368. var existing = on[key];
  4369. var ours = value[key];
  4370. on[key] = existing ? [].concat(existing, ours) : ours;
  4371. }
  4372. }
  4373. }
  4374. return data
  4375. }
  4376. /* */
  4377. function resolveScopedSlots (
  4378. fns, // see flow/vnode
  4379. res,
  4380. // the following are added in 2.6
  4381. hasDynamicKeys,
  4382. contentHashKey
  4383. ) {
  4384. res = res || { $stable: !hasDynamicKeys };
  4385. for (var i = 0; i < fns.length; i++) {
  4386. var slot = fns[i];
  4387. if (Array.isArray(slot)) {
  4388. resolveScopedSlots(slot, res, hasDynamicKeys);
  4389. } else if (slot) {
  4390. // marker for reverse proxying v-slot without scope on this.$slots
  4391. if (slot.proxy) {
  4392. slot.fn.proxy = true;
  4393. }
  4394. res[slot.key] = slot.fn;
  4395. }
  4396. }
  4397. if (contentHashKey) {
  4398. (res).$key = contentHashKey;
  4399. }
  4400. return res
  4401. }
  4402. /* */
  4403. function bindDynamicKeys (baseObj, values) {
  4404. for (var i = 0; i < values.length; i += 2) {
  4405. var key = values[i];
  4406. if (typeof key === 'string' && key) {
  4407. baseObj[values[i]] = values[i + 1];
  4408. } else if ( true && key !== '' && key !== null) {
  4409. // null is a special value for explicitly removing a binding
  4410. warn(
  4411. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  4412. this
  4413. );
  4414. }
  4415. }
  4416. return baseObj
  4417. }
  4418. // helper to dynamically append modifier runtime markers to event names.
  4419. // ensure only append when value is already string, otherwise it will be cast
  4420. // to string and cause the type check to miss.
  4421. function prependModifier (value, symbol) {
  4422. return typeof value === 'string' ? symbol + value : value
  4423. }
  4424. /* */
  4425. function installRenderHelpers (target) {
  4426. target._o = markOnce;
  4427. target._n = toNumber;
  4428. target._s = toString;
  4429. target._l = renderList;
  4430. target._t = renderSlot;
  4431. target._q = looseEqual;
  4432. target._i = looseIndexOf;
  4433. target._m = renderStatic;
  4434. target._f = resolveFilter;
  4435. target._k = checkKeyCodes;
  4436. target._b = bindObjectProps;
  4437. target._v = createTextVNode;
  4438. target._e = createEmptyVNode;
  4439. target._u = resolveScopedSlots;
  4440. target._g = bindObjectListeners;
  4441. target._d = bindDynamicKeys;
  4442. target._p = prependModifier;
  4443. }
  4444. /* */
  4445. function FunctionalRenderContext (
  4446. data,
  4447. props,
  4448. children,
  4449. parent,
  4450. Ctor
  4451. ) {
  4452. var this$1 = this;
  4453. var options = Ctor.options;
  4454. // ensure the createElement function in functional components
  4455. // gets a unique context - this is necessary for correct named slot check
  4456. var contextVm;
  4457. if (hasOwn(parent, '_uid')) {
  4458. contextVm = Object.create(parent);
  4459. // $flow-disable-line
  4460. contextVm._original = parent;
  4461. } else {
  4462. // the context vm passed in is a functional context as well.
  4463. // in this case we want to make sure we are able to get a hold to the
  4464. // real context instance.
  4465. contextVm = parent;
  4466. // $flow-disable-line
  4467. parent = parent._original;
  4468. }
  4469. var isCompiled = isTrue(options._compiled);
  4470. var needNormalization = !isCompiled;
  4471. this.data = data;
  4472. this.props = props;
  4473. this.children = children;
  4474. this.parent = parent;
  4475. this.listeners = data.on || emptyObject;
  4476. this.injections = resolveInject(options.inject, parent);
  4477. this.slots = function () {
  4478. if (!this$1.$slots) {
  4479. normalizeScopedSlots(
  4480. data.scopedSlots,
  4481. this$1.$slots = resolveSlots(children, parent)
  4482. );
  4483. }
  4484. return this$1.$slots
  4485. };
  4486. Object.defineProperty(this, 'scopedSlots', ({
  4487. enumerable: true,
  4488. get: function get () {
  4489. return normalizeScopedSlots(data.scopedSlots, this.slots())
  4490. }
  4491. }));
  4492. // support for compiled functional template
  4493. if (isCompiled) {
  4494. // exposing $options for renderStatic()
  4495. this.$options = options;
  4496. // pre-resolve slots for renderSlot()
  4497. this.$slots = this.slots();
  4498. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  4499. }
  4500. if (options._scopeId) {
  4501. this._c = function (a, b, c, d) {
  4502. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  4503. if (vnode && !Array.isArray(vnode)) {
  4504. vnode.fnScopeId = options._scopeId;
  4505. vnode.fnContext = parent;
  4506. }
  4507. return vnode
  4508. };
  4509. } else {
  4510. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  4511. }
  4512. }
  4513. installRenderHelpers(FunctionalRenderContext.prototype);
  4514. function createFunctionalComponent (
  4515. Ctor,
  4516. propsData,
  4517. data,
  4518. contextVm,
  4519. children
  4520. ) {
  4521. var options = Ctor.options;
  4522. var props = {};
  4523. var propOptions = options.props;
  4524. if (isDef(propOptions)) {
  4525. for (var key in propOptions) {
  4526. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  4527. }
  4528. } else {
  4529. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  4530. if (isDef(data.props)) { mergeProps(props, data.props); }
  4531. }
  4532. var renderContext = new FunctionalRenderContext(
  4533. data,
  4534. props,
  4535. children,
  4536. contextVm,
  4537. Ctor
  4538. );
  4539. var vnode = options.render.call(null, renderContext._c, renderContext);
  4540. if (vnode instanceof VNode) {
  4541. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  4542. } else if (Array.isArray(vnode)) {
  4543. var vnodes = normalizeChildren(vnode) || [];
  4544. var res = new Array(vnodes.length);
  4545. for (var i = 0; i < vnodes.length; i++) {
  4546. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  4547. }
  4548. return res
  4549. }
  4550. }
  4551. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  4552. // #7817 clone node before setting fnContext, otherwise if the node is reused
  4553. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  4554. // that should not be matched to match.
  4555. var clone = cloneVNode(vnode);
  4556. clone.fnContext = contextVm;
  4557. clone.fnOptions = options;
  4558. if (true) {
  4559. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  4560. }
  4561. if (data.slot) {
  4562. (clone.data || (clone.data = {})).slot = data.slot;
  4563. }
  4564. return clone
  4565. }
  4566. function mergeProps (to, from) {
  4567. for (var key in from) {
  4568. to[camelize(key)] = from[key];
  4569. }
  4570. }
  4571. /* */
  4572. /* */
  4573. /* */
  4574. /* */
  4575. // inline hooks to be invoked on component VNodes during patch
  4576. var componentVNodeHooks = {
  4577. init: function init (vnode, hydrating) {
  4578. if (
  4579. vnode.componentInstance &&
  4580. !vnode.componentInstance._isDestroyed &&
  4581. vnode.data.keepAlive
  4582. ) {
  4583. // kept-alive components, treat as a patch
  4584. var mountedNode = vnode; // work around flow
  4585. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  4586. } else {
  4587. var child = vnode.componentInstance = createComponentInstanceForVnode(
  4588. vnode,
  4589. activeInstance
  4590. );
  4591. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  4592. }
  4593. },
  4594. prepatch: function prepatch (oldVnode, vnode) {
  4595. var options = vnode.componentOptions;
  4596. var child = vnode.componentInstance = oldVnode.componentInstance;
  4597. updateChildComponent(
  4598. child,
  4599. options.propsData, // updated props
  4600. options.listeners, // updated listeners
  4601. vnode, // new parent vnode
  4602. options.children // new children
  4603. );
  4604. },
  4605. insert: function insert (vnode) {
  4606. var context = vnode.context;
  4607. var componentInstance = vnode.componentInstance;
  4608. if (!componentInstance._isMounted) {
  4609. callHook(componentInstance, 'onServiceCreated');
  4610. callHook(componentInstance, 'onServiceAttached');
  4611. componentInstance._isMounted = true;
  4612. callHook(componentInstance, 'mounted');
  4613. }
  4614. if (vnode.data.keepAlive) {
  4615. if (context._isMounted) {
  4616. // vue-router#1212
  4617. // During updates, a kept-alive component's child components may
  4618. // change, so directly walking the tree here may call activated hooks
  4619. // on incorrect children. Instead we push them into a queue which will
  4620. // be processed after the whole patch process ended.
  4621. queueActivatedComponent(componentInstance);
  4622. } else {
  4623. activateChildComponent(componentInstance, true /* direct */);
  4624. }
  4625. }
  4626. },
  4627. destroy: function destroy (vnode) {
  4628. var componentInstance = vnode.componentInstance;
  4629. if (!componentInstance._isDestroyed) {
  4630. if (!vnode.data.keepAlive) {
  4631. componentInstance.$destroy();
  4632. } else {
  4633. deactivateChildComponent(componentInstance, true /* direct */);
  4634. }
  4635. }
  4636. }
  4637. };
  4638. var hooksToMerge = Object.keys(componentVNodeHooks);
  4639. function createComponent (
  4640. Ctor,
  4641. data,
  4642. context,
  4643. children,
  4644. tag
  4645. ) {
  4646. if (isUndef(Ctor)) {
  4647. return
  4648. }
  4649. var baseCtor = context.$options._base;
  4650. // plain options object: turn it into a constructor
  4651. if (isObject(Ctor)) {
  4652. Ctor = baseCtor.extend(Ctor);
  4653. }
  4654. // if at this stage it's not a constructor or an async component factory,
  4655. // reject.
  4656. if (typeof Ctor !== 'function') {
  4657. if (true) {
  4658. warn(("Invalid Component definition: " + (String(Ctor))), context);
  4659. }
  4660. return
  4661. }
  4662. // async component
  4663. var asyncFactory;
  4664. if (isUndef(Ctor.cid)) {
  4665. asyncFactory = Ctor;
  4666. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  4667. if (Ctor === undefined) {
  4668. // return a placeholder node for async component, which is rendered
  4669. // as a comment node but preserves all the raw information for the node.
  4670. // the information will be used for async server-rendering and hydration.
  4671. return createAsyncPlaceholder(
  4672. asyncFactory,
  4673. data,
  4674. context,
  4675. children,
  4676. tag
  4677. )
  4678. }
  4679. }
  4680. data = data || {};
  4681. // resolve constructor options in case global mixins are applied after
  4682. // component constructor creation
  4683. resolveConstructorOptions(Ctor);
  4684. // transform component v-model data into props & events
  4685. if (isDef(data.model)) {
  4686. transformModel(Ctor.options, data);
  4687. }
  4688. // extract props
  4689. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  4690. // functional component
  4691. if (isTrue(Ctor.options.functional)) {
  4692. return createFunctionalComponent(Ctor, propsData, data, context, children)
  4693. }
  4694. // extract listeners, since these needs to be treated as
  4695. // child component listeners instead of DOM listeners
  4696. var listeners = data.on;
  4697. // replace with listeners with .native modifier
  4698. // so it gets processed during parent component patch.
  4699. data.on = data.nativeOn;
  4700. if (isTrue(Ctor.options.abstract)) {
  4701. // abstract components do not keep anything
  4702. // other than props & listeners & slot
  4703. // work around flow
  4704. var slot = data.slot;
  4705. data = {};
  4706. if (slot) {
  4707. data.slot = slot;
  4708. }
  4709. }
  4710. // install component management hooks onto the placeholder node
  4711. installComponentHooks(data);
  4712. // return a placeholder vnode
  4713. var name = Ctor.options.name || tag;
  4714. var vnode = new VNode(
  4715. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  4716. data, undefined, undefined, undefined, context,
  4717. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  4718. asyncFactory
  4719. );
  4720. return vnode
  4721. }
  4722. function createComponentInstanceForVnode (
  4723. vnode, // we know it's MountedComponentVNode but flow doesn't
  4724. parent // activeInstance in lifecycle state
  4725. ) {
  4726. var options = {
  4727. _isComponent: true,
  4728. _parentVnode: vnode,
  4729. parent: parent
  4730. };
  4731. // check inline-template render functions
  4732. var inlineTemplate = vnode.data.inlineTemplate;
  4733. if (isDef(inlineTemplate)) {
  4734. options.render = inlineTemplate.render;
  4735. options.staticRenderFns = inlineTemplate.staticRenderFns;
  4736. }
  4737. return new vnode.componentOptions.Ctor(options)
  4738. }
  4739. function installComponentHooks (data) {
  4740. var hooks = data.hook || (data.hook = {});
  4741. for (var i = 0; i < hooksToMerge.length; i++) {
  4742. var key = hooksToMerge[i];
  4743. var existing = hooks[key];
  4744. var toMerge = componentVNodeHooks[key];
  4745. if (existing !== toMerge && !(existing && existing._merged)) {
  4746. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  4747. }
  4748. }
  4749. }
  4750. function mergeHook$1 (f1, f2) {
  4751. var merged = function (a, b) {
  4752. // flow complains about extra args which is why we use any
  4753. f1(a, b);
  4754. f2(a, b);
  4755. };
  4756. merged._merged = true;
  4757. return merged
  4758. }
  4759. // transform component v-model info (value and callback) into
  4760. // prop and event handler respectively.
  4761. function transformModel (options, data) {
  4762. var prop = (options.model && options.model.prop) || 'value';
  4763. var event = (options.model && options.model.event) || 'input'
  4764. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  4765. var on = data.on || (data.on = {});
  4766. var existing = on[event];
  4767. var callback = data.model.callback;
  4768. if (isDef(existing)) {
  4769. if (
  4770. Array.isArray(existing)
  4771. ? existing.indexOf(callback) === -1
  4772. : existing !== callback
  4773. ) {
  4774. on[event] = [callback].concat(existing);
  4775. }
  4776. } else {
  4777. on[event] = callback;
  4778. }
  4779. }
  4780. /* */
  4781. var SIMPLE_NORMALIZE = 1;
  4782. var ALWAYS_NORMALIZE = 2;
  4783. // wrapper function for providing a more flexible interface
  4784. // without getting yelled at by flow
  4785. function createElement (
  4786. context,
  4787. tag,
  4788. data,
  4789. children,
  4790. normalizationType,
  4791. alwaysNormalize
  4792. ) {
  4793. if (Array.isArray(data) || isPrimitive(data)) {
  4794. normalizationType = children;
  4795. children = data;
  4796. data = undefined;
  4797. }
  4798. if (isTrue(alwaysNormalize)) {
  4799. normalizationType = ALWAYS_NORMALIZE;
  4800. }
  4801. return _createElement(context, tag, data, children, normalizationType)
  4802. }
  4803. function _createElement (
  4804. context,
  4805. tag,
  4806. data,
  4807. children,
  4808. normalizationType
  4809. ) {
  4810. if (isDef(data) && isDef((data).__ob__)) {
  4811. true && warn(
  4812. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  4813. 'Always create fresh vnode data objects in each render!',
  4814. context
  4815. );
  4816. return createEmptyVNode()
  4817. }
  4818. // object syntax in v-bind
  4819. if (isDef(data) && isDef(data.is)) {
  4820. tag = data.is;
  4821. }
  4822. if (!tag) {
  4823. // in case of component :is set to falsy value
  4824. return createEmptyVNode()
  4825. }
  4826. // warn against non-primitive key
  4827. if ( true &&
  4828. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  4829. ) {
  4830. {
  4831. warn(
  4832. 'Avoid using non-primitive value as key, ' +
  4833. 'use string/number value instead.',
  4834. context
  4835. );
  4836. }
  4837. }
  4838. // support single function children as default scoped slot
  4839. if (Array.isArray(children) &&
  4840. typeof children[0] === 'function'
  4841. ) {
  4842. data = data || {};
  4843. data.scopedSlots = { default: children[0] };
  4844. children.length = 0;
  4845. }
  4846. if (normalizationType === ALWAYS_NORMALIZE) {
  4847. children = normalizeChildren(children);
  4848. } else if (normalizationType === SIMPLE_NORMALIZE) {
  4849. children = simpleNormalizeChildren(children);
  4850. }
  4851. var vnode, ns;
  4852. if (typeof tag === 'string') {
  4853. var Ctor;
  4854. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  4855. if (config.isReservedTag(tag)) {
  4856. // platform built-in elements
  4857. if ( true && isDef(data) && isDef(data.nativeOn)) {
  4858. warn(
  4859. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  4860. context
  4861. );
  4862. }
  4863. vnode = new VNode(
  4864. config.parsePlatformTagName(tag), data, children,
  4865. undefined, undefined, context
  4866. );
  4867. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  4868. // component
  4869. vnode = createComponent(Ctor, data, context, children, tag);
  4870. } else {
  4871. // unknown or unlisted namespaced elements
  4872. // check at runtime because it may get assigned a namespace when its
  4873. // parent normalizes children
  4874. vnode = new VNode(
  4875. tag, data, children,
  4876. undefined, undefined, context
  4877. );
  4878. }
  4879. } else {
  4880. // direct component options / constructor
  4881. vnode = createComponent(tag, data, context, children);
  4882. }
  4883. if (Array.isArray(vnode)) {
  4884. return vnode
  4885. } else if (isDef(vnode)) {
  4886. if (isDef(ns)) { applyNS(vnode, ns); }
  4887. if (isDef(data)) { registerDeepBindings(data); }
  4888. return vnode
  4889. } else {
  4890. return createEmptyVNode()
  4891. }
  4892. }
  4893. function applyNS (vnode, ns, force) {
  4894. vnode.ns = ns;
  4895. if (vnode.tag === 'foreignObject') {
  4896. // use default namespace inside foreignObject
  4897. ns = undefined;
  4898. force = true;
  4899. }
  4900. if (isDef(vnode.children)) {
  4901. for (var i = 0, l = vnode.children.length; i < l; i++) {
  4902. var child = vnode.children[i];
  4903. if (isDef(child.tag) && (
  4904. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  4905. applyNS(child, ns, force);
  4906. }
  4907. }
  4908. }
  4909. }
  4910. // ref #5318
  4911. // necessary to ensure parent re-render when deep bindings like :style and
  4912. // :class are used on slot nodes
  4913. function registerDeepBindings (data) {
  4914. if (isObject(data.style)) {
  4915. traverse(data.style);
  4916. }
  4917. if (isObject(data.class)) {
  4918. traverse(data.class);
  4919. }
  4920. }
  4921. /* */
  4922. function initRender (vm) {
  4923. vm._vnode = null; // the root of the child tree
  4924. vm._staticTrees = null; // v-once cached trees
  4925. var options = vm.$options;
  4926. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  4927. var renderContext = parentVnode && parentVnode.context;
  4928. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  4929. vm.$scopedSlots = emptyObject;
  4930. // bind the createElement fn to this instance
  4931. // so that we get proper render context inside it.
  4932. // args order: tag, data, children, normalizationType, alwaysNormalize
  4933. // internal version is used by render functions compiled from templates
  4934. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  4935. // normalization is always applied for the public version, used in
  4936. // user-written render functions.
  4937. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  4938. // $attrs & $listeners are exposed for easier HOC creation.
  4939. // they need to be reactive so that HOCs using them are always updated
  4940. var parentData = parentVnode && parentVnode.data;
  4941. /* istanbul ignore else */
  4942. if (true) {
  4943. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  4944. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  4945. }, true);
  4946. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  4947. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  4948. }, true);
  4949. } else {}
  4950. }
  4951. var currentRenderingInstance = null;
  4952. function renderMixin (Vue) {
  4953. // install runtime convenience helpers
  4954. installRenderHelpers(Vue.prototype);
  4955. Vue.prototype.$nextTick = function (fn) {
  4956. return nextTick(fn, this)
  4957. };
  4958. Vue.prototype._render = function () {
  4959. var vm = this;
  4960. var ref = vm.$options;
  4961. var render = ref.render;
  4962. var _parentVnode = ref._parentVnode;
  4963. if (_parentVnode) {
  4964. vm.$scopedSlots = normalizeScopedSlots(
  4965. _parentVnode.data.scopedSlots,
  4966. vm.$slots,
  4967. vm.$scopedSlots
  4968. );
  4969. }
  4970. // set parent vnode. this allows render functions to have access
  4971. // to the data on the placeholder node.
  4972. vm.$vnode = _parentVnode;
  4973. // render self
  4974. var vnode;
  4975. try {
  4976. // There's no need to maintain a stack because all render fns are called
  4977. // separately from one another. Nested component's render fns are called
  4978. // when parent component is patched.
  4979. currentRenderingInstance = vm;
  4980. vnode = render.call(vm._renderProxy, vm.$createElement);
  4981. } catch (e) {
  4982. handleError(e, vm, "render");
  4983. // return error render result,
  4984. // or previous vnode to prevent render error causing blank component
  4985. /* istanbul ignore else */
  4986. if ( true && vm.$options.renderError) {
  4987. try {
  4988. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  4989. } catch (e) {
  4990. handleError(e, vm, "renderError");
  4991. vnode = vm._vnode;
  4992. }
  4993. } else {
  4994. vnode = vm._vnode;
  4995. }
  4996. } finally {
  4997. currentRenderingInstance = null;
  4998. }
  4999. // if the returned array contains only a single node, allow it
  5000. if (Array.isArray(vnode) && vnode.length === 1) {
  5001. vnode = vnode[0];
  5002. }
  5003. // return empty vnode in case the render function errored out
  5004. if (!(vnode instanceof VNode)) {
  5005. if ( true && Array.isArray(vnode)) {
  5006. warn(
  5007. 'Multiple root nodes returned from render function. Render function ' +
  5008. 'should return a single root node.',
  5009. vm
  5010. );
  5011. }
  5012. vnode = createEmptyVNode();
  5013. }
  5014. // set parent
  5015. vnode.parent = _parentVnode;
  5016. return vnode
  5017. };
  5018. }
  5019. /* */
  5020. function ensureCtor (comp, base) {
  5021. if (
  5022. comp.__esModule ||
  5023. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  5024. ) {
  5025. comp = comp.default;
  5026. }
  5027. return isObject(comp)
  5028. ? base.extend(comp)
  5029. : comp
  5030. }
  5031. function createAsyncPlaceholder (
  5032. factory,
  5033. data,
  5034. context,
  5035. children,
  5036. tag
  5037. ) {
  5038. var node = createEmptyVNode();
  5039. node.asyncFactory = factory;
  5040. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  5041. return node
  5042. }
  5043. function resolveAsyncComponent (
  5044. factory,
  5045. baseCtor
  5046. ) {
  5047. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  5048. return factory.errorComp
  5049. }
  5050. if (isDef(factory.resolved)) {
  5051. return factory.resolved
  5052. }
  5053. var owner = currentRenderingInstance;
  5054. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  5055. // already pending
  5056. factory.owners.push(owner);
  5057. }
  5058. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  5059. return factory.loadingComp
  5060. }
  5061. if (owner && !isDef(factory.owners)) {
  5062. var owners = factory.owners = [owner];
  5063. var sync = true;
  5064. var timerLoading = null;
  5065. var timerTimeout = null
  5066. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  5067. var forceRender = function (renderCompleted) {
  5068. for (var i = 0, l = owners.length; i < l; i++) {
  5069. (owners[i]).$forceUpdate();
  5070. }
  5071. if (renderCompleted) {
  5072. owners.length = 0;
  5073. if (timerLoading !== null) {
  5074. clearTimeout(timerLoading);
  5075. timerLoading = null;
  5076. }
  5077. if (timerTimeout !== null) {
  5078. clearTimeout(timerTimeout);
  5079. timerTimeout = null;
  5080. }
  5081. }
  5082. };
  5083. var resolve = once(function (res) {
  5084. // cache resolved
  5085. factory.resolved = ensureCtor(res, baseCtor);
  5086. // invoke callbacks only if this is not a synchronous resolve
  5087. // (async resolves are shimmed as synchronous during SSR)
  5088. if (!sync) {
  5089. forceRender(true);
  5090. } else {
  5091. owners.length = 0;
  5092. }
  5093. });
  5094. var reject = once(function (reason) {
  5095. true && warn(
  5096. "Failed to resolve async component: " + (String(factory)) +
  5097. (reason ? ("\nReason: " + reason) : '')
  5098. );
  5099. if (isDef(factory.errorComp)) {
  5100. factory.error = true;
  5101. forceRender(true);
  5102. }
  5103. });
  5104. var res = factory(resolve, reject);
  5105. if (isObject(res)) {
  5106. if (isPromise(res)) {
  5107. // () => Promise
  5108. if (isUndef(factory.resolved)) {
  5109. res.then(resolve, reject);
  5110. }
  5111. } else if (isPromise(res.component)) {
  5112. res.component.then(resolve, reject);
  5113. if (isDef(res.error)) {
  5114. factory.errorComp = ensureCtor(res.error, baseCtor);
  5115. }
  5116. if (isDef(res.loading)) {
  5117. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  5118. if (res.delay === 0) {
  5119. factory.loading = true;
  5120. } else {
  5121. timerLoading = setTimeout(function () {
  5122. timerLoading = null;
  5123. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  5124. factory.loading = true;
  5125. forceRender(false);
  5126. }
  5127. }, res.delay || 200);
  5128. }
  5129. }
  5130. if (isDef(res.timeout)) {
  5131. timerTimeout = setTimeout(function () {
  5132. timerTimeout = null;
  5133. if (isUndef(factory.resolved)) {
  5134. reject(
  5135. true
  5136. ? ("timeout (" + (res.timeout) + "ms)")
  5137. : undefined
  5138. );
  5139. }
  5140. }, res.timeout);
  5141. }
  5142. }
  5143. }
  5144. sync = false;
  5145. // return in case resolved synchronously
  5146. return factory.loading
  5147. ? factory.loadingComp
  5148. : factory.resolved
  5149. }
  5150. }
  5151. /* */
  5152. function isAsyncPlaceholder (node) {
  5153. return node.isComment && node.asyncFactory
  5154. }
  5155. /* */
  5156. function getFirstComponentChild (children) {
  5157. if (Array.isArray(children)) {
  5158. for (var i = 0; i < children.length; i++) {
  5159. var c = children[i];
  5160. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  5161. return c
  5162. }
  5163. }
  5164. }
  5165. }
  5166. /* */
  5167. /* */
  5168. function initEvents (vm) {
  5169. vm._events = Object.create(null);
  5170. vm._hasHookEvent = false;
  5171. // init parent attached events
  5172. var listeners = vm.$options._parentListeners;
  5173. if (listeners) {
  5174. updateComponentListeners(vm, listeners);
  5175. }
  5176. }
  5177. var target;
  5178. function add (event, fn) {
  5179. target.$on(event, fn);
  5180. }
  5181. function remove$1 (event, fn) {
  5182. target.$off(event, fn);
  5183. }
  5184. function createOnceHandler (event, fn) {
  5185. var _target = target;
  5186. return function onceHandler () {
  5187. var res = fn.apply(null, arguments);
  5188. if (res !== null) {
  5189. _target.$off(event, onceHandler);
  5190. }
  5191. }
  5192. }
  5193. function updateComponentListeners (
  5194. vm,
  5195. listeners,
  5196. oldListeners
  5197. ) {
  5198. target = vm;
  5199. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  5200. target = undefined;
  5201. }
  5202. function eventsMixin (Vue) {
  5203. var hookRE = /^hook:/;
  5204. Vue.prototype.$on = function (event, fn) {
  5205. var vm = this;
  5206. if (Array.isArray(event)) {
  5207. for (var i = 0, l = event.length; i < l; i++) {
  5208. vm.$on(event[i], fn);
  5209. }
  5210. } else {
  5211. (vm._events[event] || (vm._events[event] = [])).push(fn);
  5212. // optimize hook:event cost by using a boolean flag marked at registration
  5213. // instead of a hash lookup
  5214. if (hookRE.test(event)) {
  5215. vm._hasHookEvent = true;
  5216. }
  5217. }
  5218. return vm
  5219. };
  5220. Vue.prototype.$once = function (event, fn) {
  5221. var vm = this;
  5222. function on () {
  5223. vm.$off(event, on);
  5224. fn.apply(vm, arguments);
  5225. }
  5226. on.fn = fn;
  5227. vm.$on(event, on);
  5228. return vm
  5229. };
  5230. Vue.prototype.$off = function (event, fn) {
  5231. var vm = this;
  5232. // all
  5233. if (!arguments.length) {
  5234. vm._events = Object.create(null);
  5235. return vm
  5236. }
  5237. // array of events
  5238. if (Array.isArray(event)) {
  5239. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  5240. vm.$off(event[i$1], fn);
  5241. }
  5242. return vm
  5243. }
  5244. // specific event
  5245. var cbs = vm._events[event];
  5246. if (!cbs) {
  5247. return vm
  5248. }
  5249. if (!fn) {
  5250. vm._events[event] = null;
  5251. return vm
  5252. }
  5253. // specific handler
  5254. var cb;
  5255. var i = cbs.length;
  5256. while (i--) {
  5257. cb = cbs[i];
  5258. if (cb === fn || cb.fn === fn) {
  5259. cbs.splice(i, 1);
  5260. break
  5261. }
  5262. }
  5263. return vm
  5264. };
  5265. Vue.prototype.$emit = function (event) {
  5266. var vm = this;
  5267. if (true) {
  5268. var lowerCaseEvent = event.toLowerCase();
  5269. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  5270. tip(
  5271. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  5272. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  5273. "Note that HTML attributes are case-insensitive and you cannot use " +
  5274. "v-on to listen to camelCase events when using in-DOM templates. " +
  5275. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  5276. );
  5277. }
  5278. }
  5279. var cbs = vm._events[event];
  5280. if (cbs) {
  5281. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  5282. var args = toArray(arguments, 1);
  5283. var info = "event handler for \"" + event + "\"";
  5284. for (var i = 0, l = cbs.length; i < l; i++) {
  5285. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  5286. }
  5287. }
  5288. return vm
  5289. };
  5290. }
  5291. /* */
  5292. var activeInstance = null;
  5293. var isUpdatingChildComponent = false;
  5294. function setActiveInstance(vm) {
  5295. var prevActiveInstance = activeInstance;
  5296. activeInstance = vm;
  5297. return function () {
  5298. activeInstance = prevActiveInstance;
  5299. }
  5300. }
  5301. function initLifecycle (vm) {
  5302. var options = vm.$options;
  5303. // locate first non-abstract parent
  5304. var parent = options.parent;
  5305. if (parent && !options.abstract) {
  5306. while (parent.$options.abstract && parent.$parent) {
  5307. parent = parent.$parent;
  5308. }
  5309. parent.$children.push(vm);
  5310. }
  5311. vm.$parent = parent;
  5312. vm.$root = parent ? parent.$root : vm;
  5313. vm.$children = [];
  5314. vm.$refs = {};
  5315. vm._watcher = null;
  5316. vm._inactive = null;
  5317. vm._directInactive = false;
  5318. vm._isMounted = false;
  5319. vm._isDestroyed = false;
  5320. vm._isBeingDestroyed = false;
  5321. }
  5322. function lifecycleMixin (Vue) {
  5323. Vue.prototype._update = function (vnode, hydrating) {
  5324. var vm = this;
  5325. var prevEl = vm.$el;
  5326. var prevVnode = vm._vnode;
  5327. var restoreActiveInstance = setActiveInstance(vm);
  5328. vm._vnode = vnode;
  5329. // Vue.prototype.__patch__ is injected in entry points
  5330. // based on the rendering backend used.
  5331. if (!prevVnode) {
  5332. // initial render
  5333. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  5334. } else {
  5335. // updates
  5336. vm.$el = vm.__patch__(prevVnode, vnode);
  5337. }
  5338. restoreActiveInstance();
  5339. // update __vue__ reference
  5340. if (prevEl) {
  5341. prevEl.__vue__ = null;
  5342. }
  5343. if (vm.$el) {
  5344. vm.$el.__vue__ = vm;
  5345. }
  5346. // if parent is an HOC, update its $el as well
  5347. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  5348. vm.$parent.$el = vm.$el;
  5349. }
  5350. // updated hook is called by the scheduler to ensure that children are
  5351. // updated in a parent's updated hook.
  5352. };
  5353. Vue.prototype.$forceUpdate = function () {
  5354. var vm = this;
  5355. if (vm._watcher) {
  5356. vm._watcher.update();
  5357. }
  5358. };
  5359. Vue.prototype.$destroy = function () {
  5360. var vm = this;
  5361. if (vm._isBeingDestroyed) {
  5362. return
  5363. }
  5364. callHook(vm, 'beforeDestroy');
  5365. vm._isBeingDestroyed = true;
  5366. // remove self from parent
  5367. var parent = vm.$parent;
  5368. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  5369. remove(parent.$children, vm);
  5370. }
  5371. // teardown watchers
  5372. if (vm._watcher) {
  5373. vm._watcher.teardown();
  5374. }
  5375. var i = vm._watchers.length;
  5376. while (i--) {
  5377. vm._watchers[i].teardown();
  5378. }
  5379. // remove reference from data ob
  5380. // frozen object may not have observer.
  5381. if (vm._data.__ob__) {
  5382. vm._data.__ob__.vmCount--;
  5383. }
  5384. // call the last hook...
  5385. vm._isDestroyed = true;
  5386. // invoke destroy hooks on current rendered tree
  5387. vm.__patch__(vm._vnode, null);
  5388. // fire destroyed hook
  5389. callHook(vm, 'destroyed');
  5390. // turn off all instance listeners.
  5391. vm.$off();
  5392. // remove __vue__ reference
  5393. if (vm.$el) {
  5394. vm.$el.__vue__ = null;
  5395. }
  5396. // release circular reference (#6759)
  5397. if (vm.$vnode) {
  5398. vm.$vnode.parent = null;
  5399. }
  5400. };
  5401. }
  5402. function updateChildComponent (
  5403. vm,
  5404. propsData,
  5405. listeners,
  5406. parentVnode,
  5407. renderChildren
  5408. ) {
  5409. if (true) {
  5410. isUpdatingChildComponent = true;
  5411. }
  5412. // determine whether component has slot children
  5413. // we need to do this before overwriting $options._renderChildren.
  5414. // check if there are dynamic scopedSlots (hand-written or compiled but with
  5415. // dynamic slot names). Static scoped slots compiled from template has the
  5416. // "$stable" marker.
  5417. var newScopedSlots = parentVnode.data.scopedSlots;
  5418. var oldScopedSlots = vm.$scopedSlots;
  5419. var hasDynamicScopedSlot = !!(
  5420. (newScopedSlots && !newScopedSlots.$stable) ||
  5421. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  5422. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  5423. );
  5424. // Any static slot children from the parent may have changed during parent's
  5425. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  5426. // update is necessary to ensure correctness.
  5427. var needsForceUpdate = !!(
  5428. renderChildren || // has new static slots
  5429. vm.$options._renderChildren || // has old static slots
  5430. hasDynamicScopedSlot
  5431. );
  5432. vm.$options._parentVnode = parentVnode;
  5433. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  5434. if (vm._vnode) { // update child tree's parent
  5435. vm._vnode.parent = parentVnode;
  5436. }
  5437. vm.$options._renderChildren = renderChildren;
  5438. // update $attrs and $listeners hash
  5439. // these are also reactive so they may trigger child update if the child
  5440. // used them during render
  5441. vm.$attrs = parentVnode.data.attrs || emptyObject;
  5442. vm.$listeners = listeners || emptyObject;
  5443. // update props
  5444. if (propsData && vm.$options.props) {
  5445. toggleObserving(false);
  5446. var props = vm._props;
  5447. var propKeys = vm.$options._propKeys || [];
  5448. for (var i = 0; i < propKeys.length; i++) {
  5449. var key = propKeys[i];
  5450. var propOptions = vm.$options.props; // wtf flow?
  5451. props[key] = validateProp(key, propOptions, propsData, vm);
  5452. }
  5453. toggleObserving(true);
  5454. // keep a copy of raw propsData
  5455. vm.$options.propsData = propsData;
  5456. }
  5457. // fixed by xxxxxx update properties(mp runtime)
  5458. vm._$updateProperties && vm._$updateProperties(vm);
  5459. // update listeners
  5460. listeners = listeners || emptyObject;
  5461. var oldListeners = vm.$options._parentListeners;
  5462. vm.$options._parentListeners = listeners;
  5463. updateComponentListeners(vm, listeners, oldListeners);
  5464. // resolve slots + force update if has children
  5465. if (needsForceUpdate) {
  5466. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  5467. vm.$forceUpdate();
  5468. }
  5469. if (true) {
  5470. isUpdatingChildComponent = false;
  5471. }
  5472. }
  5473. function isInInactiveTree (vm) {
  5474. while (vm && (vm = vm.$parent)) {
  5475. if (vm._inactive) { return true }
  5476. }
  5477. return false
  5478. }
  5479. function activateChildComponent (vm, direct) {
  5480. if (direct) {
  5481. vm._directInactive = false;
  5482. if (isInInactiveTree(vm)) {
  5483. return
  5484. }
  5485. } else if (vm._directInactive) {
  5486. return
  5487. }
  5488. if (vm._inactive || vm._inactive === null) {
  5489. vm._inactive = false;
  5490. for (var i = 0; i < vm.$children.length; i++) {
  5491. activateChildComponent(vm.$children[i]);
  5492. }
  5493. callHook(vm, 'activated');
  5494. }
  5495. }
  5496. function deactivateChildComponent (vm, direct) {
  5497. if (direct) {
  5498. vm._directInactive = true;
  5499. if (isInInactiveTree(vm)) {
  5500. return
  5501. }
  5502. }
  5503. if (!vm._inactive) {
  5504. vm._inactive = true;
  5505. for (var i = 0; i < vm.$children.length; i++) {
  5506. deactivateChildComponent(vm.$children[i]);
  5507. }
  5508. callHook(vm, 'deactivated');
  5509. }
  5510. }
  5511. function callHook (vm, hook) {
  5512. // #7573 disable dep collection when invoking lifecycle hooks
  5513. pushTarget();
  5514. var handlers = vm.$options[hook];
  5515. var info = hook + " hook";
  5516. if (handlers) {
  5517. for (var i = 0, j = handlers.length; i < j; i++) {
  5518. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  5519. }
  5520. }
  5521. if (vm._hasHookEvent) {
  5522. vm.$emit('hook:' + hook);
  5523. }
  5524. popTarget();
  5525. }
  5526. /* */
  5527. var MAX_UPDATE_COUNT = 100;
  5528. var queue = [];
  5529. var activatedChildren = [];
  5530. var has = {};
  5531. var circular = {};
  5532. var waiting = false;
  5533. var flushing = false;
  5534. var index = 0;
  5535. /**
  5536. * Reset the scheduler's state.
  5537. */
  5538. function resetSchedulerState () {
  5539. index = queue.length = activatedChildren.length = 0;
  5540. has = {};
  5541. if (true) {
  5542. circular = {};
  5543. }
  5544. waiting = flushing = false;
  5545. }
  5546. // Async edge case #6566 requires saving the timestamp when event listeners are
  5547. // attached. However, calling performance.now() has a perf overhead especially
  5548. // if the page has thousands of event listeners. Instead, we take a timestamp
  5549. // every time the scheduler flushes and use that for all event listeners
  5550. // attached during that flush.
  5551. var currentFlushTimestamp = 0;
  5552. // Async edge case fix requires storing an event listener's attach timestamp.
  5553. var getNow = Date.now;
  5554. // Determine what event timestamp the browser is using. Annoyingly, the
  5555. // timestamp can either be hi-res (relative to page load) or low-res
  5556. // (relative to UNIX epoch), so in order to compare time we have to use the
  5557. // same timestamp type when saving the flush timestamp.
  5558. // All IE versions use low-res event timestamps, and have problematic clock
  5559. // implementations (#9632)
  5560. if (inBrowser && !isIE) {
  5561. var performance = window.performance;
  5562. if (
  5563. performance &&
  5564. typeof performance.now === 'function' &&
  5565. getNow() > document.createEvent('Event').timeStamp
  5566. ) {
  5567. // if the event timestamp, although evaluated AFTER the Date.now(), is
  5568. // smaller than it, it means the event is using a hi-res timestamp,
  5569. // and we need to use the hi-res version for event listener timestamps as
  5570. // well.
  5571. getNow = function () { return performance.now(); };
  5572. }
  5573. }
  5574. /**
  5575. * Flush both queues and run the watchers.
  5576. */
  5577. function flushSchedulerQueue () {
  5578. currentFlushTimestamp = getNow();
  5579. flushing = true;
  5580. var watcher, id;
  5581. // Sort queue before flush.
  5582. // This ensures that:
  5583. // 1. Components are updated from parent to child. (because parent is always
  5584. // created before the child)
  5585. // 2. A component's user watchers are run before its render watcher (because
  5586. // user watchers are created before the render watcher)
  5587. // 3. If a component is destroyed during a parent component's watcher run,
  5588. // its watchers can be skipped.
  5589. queue.sort(function (a, b) { return a.id - b.id; });
  5590. // do not cache length because more watchers might be pushed
  5591. // as we run existing watchers
  5592. for (index = 0; index < queue.length; index++) {
  5593. watcher = queue[index];
  5594. if (watcher.before) {
  5595. watcher.before();
  5596. }
  5597. id = watcher.id;
  5598. has[id] = null;
  5599. watcher.run();
  5600. // in dev build, check and stop circular updates.
  5601. if ( true && has[id] != null) {
  5602. circular[id] = (circular[id] || 0) + 1;
  5603. if (circular[id] > MAX_UPDATE_COUNT) {
  5604. warn(
  5605. 'You may have an infinite update loop ' + (
  5606. watcher.user
  5607. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  5608. : "in a component render function."
  5609. ),
  5610. watcher.vm
  5611. );
  5612. break
  5613. }
  5614. }
  5615. }
  5616. // keep copies of post queues before resetting state
  5617. var activatedQueue = activatedChildren.slice();
  5618. var updatedQueue = queue.slice();
  5619. resetSchedulerState();
  5620. // call component updated and activated hooks
  5621. callActivatedHooks(activatedQueue);
  5622. callUpdatedHooks(updatedQueue);
  5623. // devtool hook
  5624. /* istanbul ignore if */
  5625. if (devtools && config.devtools) {
  5626. devtools.emit('flush');
  5627. }
  5628. }
  5629. function callUpdatedHooks (queue) {
  5630. var i = queue.length;
  5631. while (i--) {
  5632. var watcher = queue[i];
  5633. var vm = watcher.vm;
  5634. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  5635. callHook(vm, 'updated');
  5636. }
  5637. }
  5638. }
  5639. /**
  5640. * Queue a kept-alive component that was activated during patch.
  5641. * The queue will be processed after the entire tree has been patched.
  5642. */
  5643. function queueActivatedComponent (vm) {
  5644. // setting _inactive to false here so that a render function can
  5645. // rely on checking whether it's in an inactive tree (e.g. router-view)
  5646. vm._inactive = false;
  5647. activatedChildren.push(vm);
  5648. }
  5649. function callActivatedHooks (queue) {
  5650. for (var i = 0; i < queue.length; i++) {
  5651. queue[i]._inactive = true;
  5652. activateChildComponent(queue[i], true /* true */);
  5653. }
  5654. }
  5655. /**
  5656. * Push a watcher into the watcher queue.
  5657. * Jobs with duplicate IDs will be skipped unless it's
  5658. * pushed when the queue is being flushed.
  5659. */
  5660. function queueWatcher (watcher) {
  5661. var id = watcher.id;
  5662. if (has[id] == null) {
  5663. has[id] = true;
  5664. if (!flushing) {
  5665. queue.push(watcher);
  5666. } else {
  5667. // if already flushing, splice the watcher based on its id
  5668. // if already past its id, it will be run next immediately.
  5669. var i = queue.length - 1;
  5670. while (i > index && queue[i].id > watcher.id) {
  5671. i--;
  5672. }
  5673. queue.splice(i + 1, 0, watcher);
  5674. }
  5675. // queue the flush
  5676. if (!waiting) {
  5677. waiting = true;
  5678. if ( true && !config.async) {
  5679. flushSchedulerQueue();
  5680. return
  5681. }
  5682. nextTick(flushSchedulerQueue);
  5683. }
  5684. }
  5685. }
  5686. /* */
  5687. var uid$2 = 0;
  5688. /**
  5689. * A watcher parses an expression, collects dependencies,
  5690. * and fires callback when the expression value changes.
  5691. * This is used for both the $watch() api and directives.
  5692. */
  5693. var Watcher = function Watcher (
  5694. vm,
  5695. expOrFn,
  5696. cb,
  5697. options,
  5698. isRenderWatcher
  5699. ) {
  5700. this.vm = vm;
  5701. if (isRenderWatcher) {
  5702. vm._watcher = this;
  5703. }
  5704. vm._watchers.push(this);
  5705. // options
  5706. if (options) {
  5707. this.deep = !!options.deep;
  5708. this.user = !!options.user;
  5709. this.lazy = !!options.lazy;
  5710. this.sync = !!options.sync;
  5711. this.before = options.before;
  5712. } else {
  5713. this.deep = this.user = this.lazy = this.sync = false;
  5714. }
  5715. this.cb = cb;
  5716. this.id = ++uid$2; // uid for batching
  5717. this.active = true;
  5718. this.dirty = this.lazy; // for lazy watchers
  5719. this.deps = [];
  5720. this.newDeps = [];
  5721. this.depIds = new _Set();
  5722. this.newDepIds = new _Set();
  5723. this.expression = true
  5724. ? expOrFn.toString()
  5725. : undefined;
  5726. // parse expression for getter
  5727. if (typeof expOrFn === 'function') {
  5728. this.getter = expOrFn;
  5729. } else {
  5730. this.getter = parsePath(expOrFn);
  5731. if (!this.getter) {
  5732. this.getter = noop;
  5733. true && warn(
  5734. "Failed watching path: \"" + expOrFn + "\" " +
  5735. 'Watcher only accepts simple dot-delimited paths. ' +
  5736. 'For full control, use a function instead.',
  5737. vm
  5738. );
  5739. }
  5740. }
  5741. this.value = this.lazy
  5742. ? undefined
  5743. : this.get();
  5744. };
  5745. /**
  5746. * Evaluate the getter, and re-collect dependencies.
  5747. */
  5748. Watcher.prototype.get = function get () {
  5749. pushTarget(this);
  5750. var value;
  5751. var vm = this.vm;
  5752. try {
  5753. value = this.getter.call(vm, vm);
  5754. } catch (e) {
  5755. if (this.user) {
  5756. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  5757. } else {
  5758. throw e
  5759. }
  5760. } finally {
  5761. // "touch" every property so they are all tracked as
  5762. // dependencies for deep watching
  5763. if (this.deep) {
  5764. traverse(value);
  5765. }
  5766. popTarget();
  5767. this.cleanupDeps();
  5768. }
  5769. return value
  5770. };
  5771. /**
  5772. * Add a dependency to this directive.
  5773. */
  5774. Watcher.prototype.addDep = function addDep (dep) {
  5775. var id = dep.id;
  5776. if (!this.newDepIds.has(id)) {
  5777. this.newDepIds.add(id);
  5778. this.newDeps.push(dep);
  5779. if (!this.depIds.has(id)) {
  5780. dep.addSub(this);
  5781. }
  5782. }
  5783. };
  5784. /**
  5785. * Clean up for dependency collection.
  5786. */
  5787. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  5788. var i = this.deps.length;
  5789. while (i--) {
  5790. var dep = this.deps[i];
  5791. if (!this.newDepIds.has(dep.id)) {
  5792. dep.removeSub(this);
  5793. }
  5794. }
  5795. var tmp = this.depIds;
  5796. this.depIds = this.newDepIds;
  5797. this.newDepIds = tmp;
  5798. this.newDepIds.clear();
  5799. tmp = this.deps;
  5800. this.deps = this.newDeps;
  5801. this.newDeps = tmp;
  5802. this.newDeps.length = 0;
  5803. };
  5804. /**
  5805. * Subscriber interface.
  5806. * Will be called when a dependency changes.
  5807. */
  5808. Watcher.prototype.update = function update () {
  5809. /* istanbul ignore else */
  5810. if (this.lazy) {
  5811. this.dirty = true;
  5812. } else if (this.sync) {
  5813. this.run();
  5814. } else {
  5815. queueWatcher(this);
  5816. }
  5817. };
  5818. /**
  5819. * Scheduler job interface.
  5820. * Will be called by the scheduler.
  5821. */
  5822. Watcher.prototype.run = function run () {
  5823. if (this.active) {
  5824. var value = this.get();
  5825. if (
  5826. value !== this.value ||
  5827. // Deep watchers and watchers on Object/Arrays should fire even
  5828. // when the value is the same, because the value may
  5829. // have mutated.
  5830. isObject(value) ||
  5831. this.deep
  5832. ) {
  5833. // set new value
  5834. var oldValue = this.value;
  5835. this.value = value;
  5836. if (this.user) {
  5837. try {
  5838. this.cb.call(this.vm, value, oldValue);
  5839. } catch (e) {
  5840. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  5841. }
  5842. } else {
  5843. this.cb.call(this.vm, value, oldValue);
  5844. }
  5845. }
  5846. }
  5847. };
  5848. /**
  5849. * Evaluate the value of the watcher.
  5850. * This only gets called for lazy watchers.
  5851. */
  5852. Watcher.prototype.evaluate = function evaluate () {
  5853. this.value = this.get();
  5854. this.dirty = false;
  5855. };
  5856. /**
  5857. * Depend on all deps collected by this watcher.
  5858. */
  5859. Watcher.prototype.depend = function depend () {
  5860. var i = this.deps.length;
  5861. while (i--) {
  5862. this.deps[i].depend();
  5863. }
  5864. };
  5865. /**
  5866. * Remove self from all dependencies' subscriber list.
  5867. */
  5868. Watcher.prototype.teardown = function teardown () {
  5869. if (this.active) {
  5870. // remove self from vm's watcher list
  5871. // this is a somewhat expensive operation so we skip it
  5872. // if the vm is being destroyed.
  5873. if (!this.vm._isBeingDestroyed) {
  5874. remove(this.vm._watchers, this);
  5875. }
  5876. var i = this.deps.length;
  5877. while (i--) {
  5878. this.deps[i].removeSub(this);
  5879. }
  5880. this.active = false;
  5881. }
  5882. };
  5883. /* */
  5884. var sharedPropertyDefinition = {
  5885. enumerable: true,
  5886. configurable: true,
  5887. get: noop,
  5888. set: noop
  5889. };
  5890. function proxy (target, sourceKey, key) {
  5891. sharedPropertyDefinition.get = function proxyGetter () {
  5892. return this[sourceKey][key]
  5893. };
  5894. sharedPropertyDefinition.set = function proxySetter (val) {
  5895. this[sourceKey][key] = val;
  5896. };
  5897. Object.defineProperty(target, key, sharedPropertyDefinition);
  5898. }
  5899. function initState (vm) {
  5900. vm._watchers = [];
  5901. var opts = vm.$options;
  5902. if (opts.props) { initProps(vm, opts.props); }
  5903. if (opts.methods) { initMethods(vm, opts.methods); }
  5904. if (opts.data) {
  5905. initData(vm);
  5906. } else {
  5907. observe(vm._data = {}, true /* asRootData */);
  5908. }
  5909. if (opts.computed) { initComputed(vm, opts.computed); }
  5910. if (opts.watch && opts.watch !== nativeWatch) {
  5911. initWatch(vm, opts.watch);
  5912. }
  5913. }
  5914. function initProps (vm, propsOptions) {
  5915. var propsData = vm.$options.propsData || {};
  5916. var props = vm._props = {};
  5917. // cache prop keys so that future props updates can iterate using Array
  5918. // instead of dynamic object key enumeration.
  5919. var keys = vm.$options._propKeys = [];
  5920. var isRoot = !vm.$parent;
  5921. // root instance props should be converted
  5922. if (!isRoot) {
  5923. toggleObserving(false);
  5924. }
  5925. var loop = function ( key ) {
  5926. keys.push(key);
  5927. var value = validateProp(key, propsOptions, propsData, vm);
  5928. /* istanbul ignore else */
  5929. if (true) {
  5930. var hyphenatedKey = hyphenate(key);
  5931. if (isReservedAttribute(hyphenatedKey) ||
  5932. config.isReservedAttr(hyphenatedKey)) {
  5933. warn(
  5934. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  5935. vm
  5936. );
  5937. }
  5938. defineReactive$$1(props, key, value, function () {
  5939. if (!isRoot && !isUpdatingChildComponent) {
  5940. {
  5941. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou'){//百度、快手 observer 在 setData callback 之后触发,直接忽略该 warn
  5942. return
  5943. }
  5944. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  5945. if(
  5946. key === 'value' &&
  5947. Array.isArray(vm.$options.behaviors) &&
  5948. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  5949. ){
  5950. return
  5951. }
  5952. if(vm._getFormData){
  5953. return
  5954. }
  5955. var $parent = vm.$parent;
  5956. while($parent){
  5957. if($parent.__next_tick_pending){
  5958. return
  5959. }
  5960. $parent = $parent.$parent;
  5961. }
  5962. }
  5963. warn(
  5964. "Avoid mutating a prop directly since the value will be " +
  5965. "overwritten whenever the parent component re-renders. " +
  5966. "Instead, use a data or computed property based on the prop's " +
  5967. "value. Prop being mutated: \"" + key + "\"",
  5968. vm
  5969. );
  5970. }
  5971. });
  5972. } else {}
  5973. // static props are already proxied on the component's prototype
  5974. // during Vue.extend(). We only need to proxy props defined at
  5975. // instantiation here.
  5976. if (!(key in vm)) {
  5977. proxy(vm, "_props", key);
  5978. }
  5979. };
  5980. for (var key in propsOptions) loop( key );
  5981. toggleObserving(true);
  5982. }
  5983. function initData (vm) {
  5984. var data = vm.$options.data;
  5985. data = vm._data = typeof data === 'function'
  5986. ? getData(data, vm)
  5987. : data || {};
  5988. if (!isPlainObject(data)) {
  5989. data = {};
  5990. true && warn(
  5991. 'data functions should return an object:\n' +
  5992. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  5993. vm
  5994. );
  5995. }
  5996. // proxy data on instance
  5997. var keys = Object.keys(data);
  5998. var props = vm.$options.props;
  5999. var methods = vm.$options.methods;
  6000. var i = keys.length;
  6001. while (i--) {
  6002. var key = keys[i];
  6003. if (true) {
  6004. if (methods && hasOwn(methods, key)) {
  6005. warn(
  6006. ("Method \"" + key + "\" has already been defined as a data property."),
  6007. vm
  6008. );
  6009. }
  6010. }
  6011. if (props && hasOwn(props, key)) {
  6012. true && warn(
  6013. "The data property \"" + key + "\" is already declared as a prop. " +
  6014. "Use prop default value instead.",
  6015. vm
  6016. );
  6017. } else if (!isReserved(key)) {
  6018. proxy(vm, "_data", key);
  6019. }
  6020. }
  6021. // observe data
  6022. observe(data, true /* asRootData */);
  6023. }
  6024. function getData (data, vm) {
  6025. // #7573 disable dep collection when invoking data getters
  6026. pushTarget();
  6027. try {
  6028. return data.call(vm, vm)
  6029. } catch (e) {
  6030. handleError(e, vm, "data()");
  6031. return {}
  6032. } finally {
  6033. popTarget();
  6034. }
  6035. }
  6036. var computedWatcherOptions = { lazy: true };
  6037. function initComputed (vm, computed) {
  6038. // $flow-disable-line
  6039. var watchers = vm._computedWatchers = Object.create(null);
  6040. // computed properties are just getters during SSR
  6041. var isSSR = isServerRendering();
  6042. for (var key in computed) {
  6043. var userDef = computed[key];
  6044. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  6045. if ( true && getter == null) {
  6046. warn(
  6047. ("Getter is missing for computed property \"" + key + "\"."),
  6048. vm
  6049. );
  6050. }
  6051. if (!isSSR) {
  6052. // create internal watcher for the computed property.
  6053. watchers[key] = new Watcher(
  6054. vm,
  6055. getter || noop,
  6056. noop,
  6057. computedWatcherOptions
  6058. );
  6059. }
  6060. // component-defined computed properties are already defined on the
  6061. // component prototype. We only need to define computed properties defined
  6062. // at instantiation here.
  6063. if (!(key in vm)) {
  6064. defineComputed(vm, key, userDef);
  6065. } else if (true) {
  6066. if (key in vm.$data) {
  6067. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  6068. } else if (vm.$options.props && key in vm.$options.props) {
  6069. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  6070. }
  6071. }
  6072. }
  6073. }
  6074. function defineComputed (
  6075. target,
  6076. key,
  6077. userDef
  6078. ) {
  6079. var shouldCache = !isServerRendering();
  6080. if (typeof userDef === 'function') {
  6081. sharedPropertyDefinition.get = shouldCache
  6082. ? createComputedGetter(key)
  6083. : createGetterInvoker(userDef);
  6084. sharedPropertyDefinition.set = noop;
  6085. } else {
  6086. sharedPropertyDefinition.get = userDef.get
  6087. ? shouldCache && userDef.cache !== false
  6088. ? createComputedGetter(key)
  6089. : createGetterInvoker(userDef.get)
  6090. : noop;
  6091. sharedPropertyDefinition.set = userDef.set || noop;
  6092. }
  6093. if ( true &&
  6094. sharedPropertyDefinition.set === noop) {
  6095. sharedPropertyDefinition.set = function () {
  6096. warn(
  6097. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  6098. this
  6099. );
  6100. };
  6101. }
  6102. Object.defineProperty(target, key, sharedPropertyDefinition);
  6103. }
  6104. function createComputedGetter (key) {
  6105. return function computedGetter () {
  6106. var watcher = this._computedWatchers && this._computedWatchers[key];
  6107. if (watcher) {
  6108. if (watcher.dirty) {
  6109. watcher.evaluate();
  6110. }
  6111. if (Dep.SharedObject.target) {// fixed by xxxxxx
  6112. watcher.depend();
  6113. }
  6114. return watcher.value
  6115. }
  6116. }
  6117. }
  6118. function createGetterInvoker(fn) {
  6119. return function computedGetter () {
  6120. return fn.call(this, this)
  6121. }
  6122. }
  6123. function initMethods (vm, methods) {
  6124. var props = vm.$options.props;
  6125. for (var key in methods) {
  6126. if (true) {
  6127. if (typeof methods[key] !== 'function') {
  6128. warn(
  6129. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  6130. "Did you reference the function correctly?",
  6131. vm
  6132. );
  6133. }
  6134. if (props && hasOwn(props, key)) {
  6135. warn(
  6136. ("Method \"" + key + "\" has already been defined as a prop."),
  6137. vm
  6138. );
  6139. }
  6140. if ((key in vm) && isReserved(key)) {
  6141. warn(
  6142. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  6143. "Avoid defining component methods that start with _ or $."
  6144. );
  6145. }
  6146. }
  6147. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  6148. }
  6149. }
  6150. function initWatch (vm, watch) {
  6151. for (var key in watch) {
  6152. var handler = watch[key];
  6153. if (Array.isArray(handler)) {
  6154. for (var i = 0; i < handler.length; i++) {
  6155. createWatcher(vm, key, handler[i]);
  6156. }
  6157. } else {
  6158. createWatcher(vm, key, handler);
  6159. }
  6160. }
  6161. }
  6162. function createWatcher (
  6163. vm,
  6164. expOrFn,
  6165. handler,
  6166. options
  6167. ) {
  6168. if (isPlainObject(handler)) {
  6169. options = handler;
  6170. handler = handler.handler;
  6171. }
  6172. if (typeof handler === 'string') {
  6173. handler = vm[handler];
  6174. }
  6175. return vm.$watch(expOrFn, handler, options)
  6176. }
  6177. function stateMixin (Vue) {
  6178. // flow somehow has problems with directly declared definition object
  6179. // when using Object.defineProperty, so we have to procedurally build up
  6180. // the object here.
  6181. var dataDef = {};
  6182. dataDef.get = function () { return this._data };
  6183. var propsDef = {};
  6184. propsDef.get = function () { return this._props };
  6185. if (true) {
  6186. dataDef.set = function () {
  6187. warn(
  6188. 'Avoid replacing instance root $data. ' +
  6189. 'Use nested data properties instead.',
  6190. this
  6191. );
  6192. };
  6193. propsDef.set = function () {
  6194. warn("$props is readonly.", this);
  6195. };
  6196. }
  6197. Object.defineProperty(Vue.prototype, '$data', dataDef);
  6198. Object.defineProperty(Vue.prototype, '$props', propsDef);
  6199. Vue.prototype.$set = set;
  6200. Vue.prototype.$delete = del;
  6201. Vue.prototype.$watch = function (
  6202. expOrFn,
  6203. cb,
  6204. options
  6205. ) {
  6206. var vm = this;
  6207. if (isPlainObject(cb)) {
  6208. return createWatcher(vm, expOrFn, cb, options)
  6209. }
  6210. options = options || {};
  6211. options.user = true;
  6212. var watcher = new Watcher(vm, expOrFn, cb, options);
  6213. if (options.immediate) {
  6214. try {
  6215. cb.call(vm, watcher.value);
  6216. } catch (error) {
  6217. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  6218. }
  6219. }
  6220. return function unwatchFn () {
  6221. watcher.teardown();
  6222. }
  6223. };
  6224. }
  6225. /* */
  6226. var uid$3 = 0;
  6227. function initMixin (Vue) {
  6228. Vue.prototype._init = function (options) {
  6229. var vm = this;
  6230. // a uid
  6231. vm._uid = uid$3++;
  6232. var startTag, endTag;
  6233. /* istanbul ignore if */
  6234. if ( true && config.performance && mark) {
  6235. startTag = "vue-perf-start:" + (vm._uid);
  6236. endTag = "vue-perf-end:" + (vm._uid);
  6237. mark(startTag);
  6238. }
  6239. // a flag to avoid this being observed
  6240. vm._isVue = true;
  6241. // merge options
  6242. if (options && options._isComponent) {
  6243. // optimize internal component instantiation
  6244. // since dynamic options merging is pretty slow, and none of the
  6245. // internal component options needs special treatment.
  6246. initInternalComponent(vm, options);
  6247. } else {
  6248. vm.$options = mergeOptions(
  6249. resolveConstructorOptions(vm.constructor),
  6250. options || {},
  6251. vm
  6252. );
  6253. }
  6254. /* istanbul ignore else */
  6255. if (true) {
  6256. initProxy(vm);
  6257. } else {}
  6258. // expose real self
  6259. vm._self = vm;
  6260. initLifecycle(vm);
  6261. initEvents(vm);
  6262. initRender(vm);
  6263. callHook(vm, 'beforeCreate');
  6264. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  6265. initState(vm);
  6266. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  6267. !vm._$fallback && callHook(vm, 'created');
  6268. /* istanbul ignore if */
  6269. if ( true && config.performance && mark) {
  6270. vm._name = formatComponentName(vm, false);
  6271. mark(endTag);
  6272. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  6273. }
  6274. if (vm.$options.el) {
  6275. vm.$mount(vm.$options.el);
  6276. }
  6277. };
  6278. }
  6279. function initInternalComponent (vm, options) {
  6280. var opts = vm.$options = Object.create(vm.constructor.options);
  6281. // doing this because it's faster than dynamic enumeration.
  6282. var parentVnode = options._parentVnode;
  6283. opts.parent = options.parent;
  6284. opts._parentVnode = parentVnode;
  6285. var vnodeComponentOptions = parentVnode.componentOptions;
  6286. opts.propsData = vnodeComponentOptions.propsData;
  6287. opts._parentListeners = vnodeComponentOptions.listeners;
  6288. opts._renderChildren = vnodeComponentOptions.children;
  6289. opts._componentTag = vnodeComponentOptions.tag;
  6290. if (options.render) {
  6291. opts.render = options.render;
  6292. opts.staticRenderFns = options.staticRenderFns;
  6293. }
  6294. }
  6295. function resolveConstructorOptions (Ctor) {
  6296. var options = Ctor.options;
  6297. if (Ctor.super) {
  6298. var superOptions = resolveConstructorOptions(Ctor.super);
  6299. var cachedSuperOptions = Ctor.superOptions;
  6300. if (superOptions !== cachedSuperOptions) {
  6301. // super option changed,
  6302. // need to resolve new options.
  6303. Ctor.superOptions = superOptions;
  6304. // check if there are any late-modified/attached options (#4976)
  6305. var modifiedOptions = resolveModifiedOptions(Ctor);
  6306. // update base extend options
  6307. if (modifiedOptions) {
  6308. extend(Ctor.extendOptions, modifiedOptions);
  6309. }
  6310. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  6311. if (options.name) {
  6312. options.components[options.name] = Ctor;
  6313. }
  6314. }
  6315. }
  6316. return options
  6317. }
  6318. function resolveModifiedOptions (Ctor) {
  6319. var modified;
  6320. var latest = Ctor.options;
  6321. var sealed = Ctor.sealedOptions;
  6322. for (var key in latest) {
  6323. if (latest[key] !== sealed[key]) {
  6324. if (!modified) { modified = {}; }
  6325. modified[key] = latest[key];
  6326. }
  6327. }
  6328. return modified
  6329. }
  6330. function Vue (options) {
  6331. if ( true &&
  6332. !(this instanceof Vue)
  6333. ) {
  6334. warn('Vue is a constructor and should be called with the `new` keyword');
  6335. }
  6336. this._init(options);
  6337. }
  6338. initMixin(Vue);
  6339. stateMixin(Vue);
  6340. eventsMixin(Vue);
  6341. lifecycleMixin(Vue);
  6342. renderMixin(Vue);
  6343. /* */
  6344. function initUse (Vue) {
  6345. Vue.use = function (plugin) {
  6346. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  6347. if (installedPlugins.indexOf(plugin) > -1) {
  6348. return this
  6349. }
  6350. // additional parameters
  6351. var args = toArray(arguments, 1);
  6352. args.unshift(this);
  6353. if (typeof plugin.install === 'function') {
  6354. plugin.install.apply(plugin, args);
  6355. } else if (typeof plugin === 'function') {
  6356. plugin.apply(null, args);
  6357. }
  6358. installedPlugins.push(plugin);
  6359. return this
  6360. };
  6361. }
  6362. /* */
  6363. function initMixin$1 (Vue) {
  6364. Vue.mixin = function (mixin) {
  6365. this.options = mergeOptions(this.options, mixin);
  6366. return this
  6367. };
  6368. }
  6369. /* */
  6370. function initExtend (Vue) {
  6371. /**
  6372. * Each instance constructor, including Vue, has a unique
  6373. * cid. This enables us to create wrapped "child
  6374. * constructors" for prototypal inheritance and cache them.
  6375. */
  6376. Vue.cid = 0;
  6377. var cid = 1;
  6378. /**
  6379. * Class inheritance
  6380. */
  6381. Vue.extend = function (extendOptions) {
  6382. extendOptions = extendOptions || {};
  6383. var Super = this;
  6384. var SuperId = Super.cid;
  6385. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  6386. if (cachedCtors[SuperId]) {
  6387. return cachedCtors[SuperId]
  6388. }
  6389. var name = extendOptions.name || Super.options.name;
  6390. if ( true && name) {
  6391. validateComponentName(name);
  6392. }
  6393. var Sub = function VueComponent (options) {
  6394. this._init(options);
  6395. };
  6396. Sub.prototype = Object.create(Super.prototype);
  6397. Sub.prototype.constructor = Sub;
  6398. Sub.cid = cid++;
  6399. Sub.options = mergeOptions(
  6400. Super.options,
  6401. extendOptions
  6402. );
  6403. Sub['super'] = Super;
  6404. // For props and computed properties, we define the proxy getters on
  6405. // the Vue instances at extension time, on the extended prototype. This
  6406. // avoids Object.defineProperty calls for each instance created.
  6407. if (Sub.options.props) {
  6408. initProps$1(Sub);
  6409. }
  6410. if (Sub.options.computed) {
  6411. initComputed$1(Sub);
  6412. }
  6413. // allow further extension/mixin/plugin usage
  6414. Sub.extend = Super.extend;
  6415. Sub.mixin = Super.mixin;
  6416. Sub.use = Super.use;
  6417. // create asset registers, so extended classes
  6418. // can have their private assets too.
  6419. ASSET_TYPES.forEach(function (type) {
  6420. Sub[type] = Super[type];
  6421. });
  6422. // enable recursive self-lookup
  6423. if (name) {
  6424. Sub.options.components[name] = Sub;
  6425. }
  6426. // keep a reference to the super options at extension time.
  6427. // later at instantiation we can check if Super's options have
  6428. // been updated.
  6429. Sub.superOptions = Super.options;
  6430. Sub.extendOptions = extendOptions;
  6431. Sub.sealedOptions = extend({}, Sub.options);
  6432. // cache constructor
  6433. cachedCtors[SuperId] = Sub;
  6434. return Sub
  6435. };
  6436. }
  6437. function initProps$1 (Comp) {
  6438. var props = Comp.options.props;
  6439. for (var key in props) {
  6440. proxy(Comp.prototype, "_props", key);
  6441. }
  6442. }
  6443. function initComputed$1 (Comp) {
  6444. var computed = Comp.options.computed;
  6445. for (var key in computed) {
  6446. defineComputed(Comp.prototype, key, computed[key]);
  6447. }
  6448. }
  6449. /* */
  6450. function initAssetRegisters (Vue) {
  6451. /**
  6452. * Create asset registration methods.
  6453. */
  6454. ASSET_TYPES.forEach(function (type) {
  6455. Vue[type] = function (
  6456. id,
  6457. definition
  6458. ) {
  6459. if (!definition) {
  6460. return this.options[type + 's'][id]
  6461. } else {
  6462. /* istanbul ignore if */
  6463. if ( true && type === 'component') {
  6464. validateComponentName(id);
  6465. }
  6466. if (type === 'component' && isPlainObject(definition)) {
  6467. definition.name = definition.name || id;
  6468. definition = this.options._base.extend(definition);
  6469. }
  6470. if (type === 'directive' && typeof definition === 'function') {
  6471. definition = { bind: definition, update: definition };
  6472. }
  6473. this.options[type + 's'][id] = definition;
  6474. return definition
  6475. }
  6476. };
  6477. });
  6478. }
  6479. /* */
  6480. function getComponentName (opts) {
  6481. return opts && (opts.Ctor.options.name || opts.tag)
  6482. }
  6483. function matches (pattern, name) {
  6484. if (Array.isArray(pattern)) {
  6485. return pattern.indexOf(name) > -1
  6486. } else if (typeof pattern === 'string') {
  6487. return pattern.split(',').indexOf(name) > -1
  6488. } else if (isRegExp(pattern)) {
  6489. return pattern.test(name)
  6490. }
  6491. /* istanbul ignore next */
  6492. return false
  6493. }
  6494. function pruneCache (keepAliveInstance, filter) {
  6495. var cache = keepAliveInstance.cache;
  6496. var keys = keepAliveInstance.keys;
  6497. var _vnode = keepAliveInstance._vnode;
  6498. for (var key in cache) {
  6499. var cachedNode = cache[key];
  6500. if (cachedNode) {
  6501. var name = getComponentName(cachedNode.componentOptions);
  6502. if (name && !filter(name)) {
  6503. pruneCacheEntry(cache, key, keys, _vnode);
  6504. }
  6505. }
  6506. }
  6507. }
  6508. function pruneCacheEntry (
  6509. cache,
  6510. key,
  6511. keys,
  6512. current
  6513. ) {
  6514. var cached$$1 = cache[key];
  6515. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  6516. cached$$1.componentInstance.$destroy();
  6517. }
  6518. cache[key] = null;
  6519. remove(keys, key);
  6520. }
  6521. var patternTypes = [String, RegExp, Array];
  6522. var KeepAlive = {
  6523. name: 'keep-alive',
  6524. abstract: true,
  6525. props: {
  6526. include: patternTypes,
  6527. exclude: patternTypes,
  6528. max: [String, Number]
  6529. },
  6530. created: function created () {
  6531. this.cache = Object.create(null);
  6532. this.keys = [];
  6533. },
  6534. destroyed: function destroyed () {
  6535. for (var key in this.cache) {
  6536. pruneCacheEntry(this.cache, key, this.keys);
  6537. }
  6538. },
  6539. mounted: function mounted () {
  6540. var this$1 = this;
  6541. this.$watch('include', function (val) {
  6542. pruneCache(this$1, function (name) { return matches(val, name); });
  6543. });
  6544. this.$watch('exclude', function (val) {
  6545. pruneCache(this$1, function (name) { return !matches(val, name); });
  6546. });
  6547. },
  6548. render: function render () {
  6549. var slot = this.$slots.default;
  6550. var vnode = getFirstComponentChild(slot);
  6551. var componentOptions = vnode && vnode.componentOptions;
  6552. if (componentOptions) {
  6553. // check pattern
  6554. var name = getComponentName(componentOptions);
  6555. var ref = this;
  6556. var include = ref.include;
  6557. var exclude = ref.exclude;
  6558. if (
  6559. // not included
  6560. (include && (!name || !matches(include, name))) ||
  6561. // excluded
  6562. (exclude && name && matches(exclude, name))
  6563. ) {
  6564. return vnode
  6565. }
  6566. var ref$1 = this;
  6567. var cache = ref$1.cache;
  6568. var keys = ref$1.keys;
  6569. var key = vnode.key == null
  6570. // same constructor may get registered as different local components
  6571. // so cid alone is not enough (#3269)
  6572. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  6573. : vnode.key;
  6574. if (cache[key]) {
  6575. vnode.componentInstance = cache[key].componentInstance;
  6576. // make current key freshest
  6577. remove(keys, key);
  6578. keys.push(key);
  6579. } else {
  6580. cache[key] = vnode;
  6581. keys.push(key);
  6582. // prune oldest entry
  6583. if (this.max && keys.length > parseInt(this.max)) {
  6584. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  6585. }
  6586. }
  6587. vnode.data.keepAlive = true;
  6588. }
  6589. return vnode || (slot && slot[0])
  6590. }
  6591. };
  6592. var builtInComponents = {
  6593. KeepAlive: KeepAlive
  6594. };
  6595. /* */
  6596. function initGlobalAPI (Vue) {
  6597. // config
  6598. var configDef = {};
  6599. configDef.get = function () { return config; };
  6600. if (true) {
  6601. configDef.set = function () {
  6602. warn(
  6603. 'Do not replace the Vue.config object, set individual fields instead.'
  6604. );
  6605. };
  6606. }
  6607. Object.defineProperty(Vue, 'config', configDef);
  6608. // exposed util methods.
  6609. // NOTE: these are not considered part of the public API - avoid relying on
  6610. // them unless you are aware of the risk.
  6611. Vue.util = {
  6612. warn: warn,
  6613. extend: extend,
  6614. mergeOptions: mergeOptions,
  6615. defineReactive: defineReactive$$1
  6616. };
  6617. Vue.set = set;
  6618. Vue.delete = del;
  6619. Vue.nextTick = nextTick;
  6620. // 2.6 explicit observable API
  6621. Vue.observable = function (obj) {
  6622. observe(obj);
  6623. return obj
  6624. };
  6625. Vue.options = Object.create(null);
  6626. ASSET_TYPES.forEach(function (type) {
  6627. Vue.options[type + 's'] = Object.create(null);
  6628. });
  6629. // this is used to identify the "base" constructor to extend all plain-object
  6630. // components with in Weex's multi-instance scenarios.
  6631. Vue.options._base = Vue;
  6632. extend(Vue.options.components, builtInComponents);
  6633. initUse(Vue);
  6634. initMixin$1(Vue);
  6635. initExtend(Vue);
  6636. initAssetRegisters(Vue);
  6637. }
  6638. initGlobalAPI(Vue);
  6639. Object.defineProperty(Vue.prototype, '$isServer', {
  6640. get: isServerRendering
  6641. });
  6642. Object.defineProperty(Vue.prototype, '$ssrContext', {
  6643. get: function get () {
  6644. /* istanbul ignore next */
  6645. return this.$vnode && this.$vnode.ssrContext
  6646. }
  6647. });
  6648. // expose FunctionalRenderContext for ssr runtime helper installation
  6649. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  6650. value: FunctionalRenderContext
  6651. });
  6652. Vue.version = '2.6.11';
  6653. /**
  6654. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  6655. */
  6656. var ARRAYTYPE = '[object Array]';
  6657. var OBJECTTYPE = '[object Object]';
  6658. // const FUNCTIONTYPE = '[object Function]'
  6659. function diff(current, pre) {
  6660. var result = {};
  6661. syncKeys(current, pre);
  6662. _diff(current, pre, '', result);
  6663. return result
  6664. }
  6665. function syncKeys(current, pre) {
  6666. if (current === pre) { return }
  6667. var rootCurrentType = type(current);
  6668. var rootPreType = type(pre);
  6669. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  6670. if(Object.keys(current).length >= Object.keys(pre).length){
  6671. for (var key in pre) {
  6672. var currentValue = current[key];
  6673. if (currentValue === undefined) {
  6674. current[key] = null;
  6675. } else {
  6676. syncKeys(currentValue, pre[key]);
  6677. }
  6678. }
  6679. }
  6680. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  6681. if (current.length >= pre.length) {
  6682. pre.forEach(function (item, index) {
  6683. syncKeys(current[index], item);
  6684. });
  6685. }
  6686. }
  6687. }
  6688. function _diff(current, pre, path, result) {
  6689. if (current === pre) { return }
  6690. var rootCurrentType = type(current);
  6691. var rootPreType = type(pre);
  6692. if (rootCurrentType == OBJECTTYPE) {
  6693. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  6694. setResult(result, path, current);
  6695. } else {
  6696. var loop = function ( key ) {
  6697. var currentValue = current[key];
  6698. var preValue = pre[key];
  6699. var currentType = type(currentValue);
  6700. var preType = type(preValue);
  6701. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  6702. // NOTE 此处将 != 修改为 !==。涉及地方太多恐怕测试不到,如果出现数据对比问题,将其修改回来。
  6703. if (currentValue !== pre[key]) {
  6704. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6705. }
  6706. } else if (currentType == ARRAYTYPE) {
  6707. if (preType != ARRAYTYPE) {
  6708. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6709. } else {
  6710. if (currentValue.length < preValue.length) {
  6711. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6712. } else {
  6713. currentValue.forEach(function (item, index) {
  6714. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  6715. });
  6716. }
  6717. }
  6718. } else if (currentType == OBJECTTYPE) {
  6719. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  6720. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6721. } else {
  6722. for (var subKey in currentValue) {
  6723. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  6724. }
  6725. }
  6726. }
  6727. };
  6728. for (var key in current) loop( key );
  6729. }
  6730. } else if (rootCurrentType == ARRAYTYPE) {
  6731. if (rootPreType != ARRAYTYPE) {
  6732. setResult(result, path, current);
  6733. } else {
  6734. if (current.length < pre.length) {
  6735. setResult(result, path, current);
  6736. } else {
  6737. current.forEach(function (item, index) {
  6738. _diff(item, pre[index], path + '[' + index + ']', result);
  6739. });
  6740. }
  6741. }
  6742. } else {
  6743. setResult(result, path, current);
  6744. }
  6745. }
  6746. function setResult(result, k, v) {
  6747. // if (type(v) != FUNCTIONTYPE) {
  6748. result[k] = v;
  6749. // }
  6750. }
  6751. function type(obj) {
  6752. return Object.prototype.toString.call(obj)
  6753. }
  6754. /* */
  6755. function flushCallbacks$1(vm) {
  6756. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  6757. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"caimei-applets-hehe","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  6758. var mpInstance = vm.$scope;
  6759. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  6760. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  6761. }
  6762. var copies = vm.__next_tick_callbacks.slice(0);
  6763. vm.__next_tick_callbacks.length = 0;
  6764. for (var i = 0; i < copies.length; i++) {
  6765. copies[i]();
  6766. }
  6767. }
  6768. }
  6769. function hasRenderWatcher(vm) {
  6770. return queue.find(function (watcher) { return vm._watcher === watcher; })
  6771. }
  6772. function nextTick$1(vm, cb) {
  6773. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  6774. //2.nextTick 之前存在 render watcher
  6775. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  6776. if(Object({"NODE_ENV":"development","VUE_APP_NAME":"caimei-applets-hehe","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  6777. var mpInstance = vm.$scope;
  6778. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  6779. ']:nextVueTick');
  6780. }
  6781. return nextTick(cb, vm)
  6782. }else{
  6783. if(Object({"NODE_ENV":"development","VUE_APP_NAME":"caimei-applets-hehe","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  6784. var mpInstance$1 = vm.$scope;
  6785. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  6786. ']:nextMPTick');
  6787. }
  6788. }
  6789. var _resolve;
  6790. if (!vm.__next_tick_callbacks) {
  6791. vm.__next_tick_callbacks = [];
  6792. }
  6793. vm.__next_tick_callbacks.push(function () {
  6794. if (cb) {
  6795. try {
  6796. cb.call(vm);
  6797. } catch (e) {
  6798. handleError(e, vm, 'nextTick');
  6799. }
  6800. } else if (_resolve) {
  6801. _resolve(vm);
  6802. }
  6803. });
  6804. // $flow-disable-line
  6805. if (!cb && typeof Promise !== 'undefined') {
  6806. return new Promise(function (resolve) {
  6807. _resolve = resolve;
  6808. })
  6809. }
  6810. }
  6811. /* */
  6812. function cloneWithData(vm) {
  6813. // 确保当前 vm 所有数据被同步
  6814. var ret = Object.create(null);
  6815. var dataKeys = [].concat(
  6816. Object.keys(vm._data || {}),
  6817. Object.keys(vm._computedWatchers || {}));
  6818. dataKeys.reduce(function(ret, key) {
  6819. ret[key] = vm[key];
  6820. return ret
  6821. }, ret);
  6822. // vue-composition-api
  6823. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  6824. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  6825. if (rawBindings) {
  6826. Object.keys(rawBindings).forEach(function (key) {
  6827. ret[key] = vm[key];
  6828. });
  6829. }
  6830. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  6831. Object.assign(ret, vm.$mp.data || {});
  6832. if (
  6833. Array.isArray(vm.$options.behaviors) &&
  6834. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  6835. ) { //form-field
  6836. ret['name'] = vm.name;
  6837. ret['value'] = vm.value;
  6838. }
  6839. return JSON.parse(JSON.stringify(ret))
  6840. }
  6841. var patch = function(oldVnode, vnode) {
  6842. var this$1 = this;
  6843. if (vnode === null) { //destroy
  6844. return
  6845. }
  6846. if (this.mpType === 'page' || this.mpType === 'component') {
  6847. var mpInstance = this.$scope;
  6848. var data = Object.create(null);
  6849. try {
  6850. data = cloneWithData(this);
  6851. } catch (err) {
  6852. console.error(err);
  6853. }
  6854. data.__webviewId__ = mpInstance.data.__webviewId__;
  6855. var mpData = Object.create(null);
  6856. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  6857. mpData[key] = mpInstance.data[key];
  6858. });
  6859. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  6860. if (Object.keys(diffData).length) {
  6861. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"caimei-applets-hehe","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  6862. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  6863. ']差量更新',
  6864. JSON.stringify(diffData));
  6865. }
  6866. this.__next_tick_pending = true;
  6867. mpInstance.setData(diffData, function () {
  6868. this$1.__next_tick_pending = false;
  6869. flushCallbacks$1(this$1);
  6870. });
  6871. } else {
  6872. flushCallbacks$1(this);
  6873. }
  6874. }
  6875. };
  6876. /* */
  6877. function createEmptyRender() {
  6878. }
  6879. function mountComponent$1(
  6880. vm,
  6881. el,
  6882. hydrating
  6883. ) {
  6884. if (!vm.mpType) {//main.js 中的 new Vue
  6885. return vm
  6886. }
  6887. if (vm.mpType === 'app') {
  6888. vm.$options.render = createEmptyRender;
  6889. }
  6890. if (!vm.$options.render) {
  6891. vm.$options.render = createEmptyRender;
  6892. if (true) {
  6893. /* istanbul ignore if */
  6894. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  6895. vm.$options.el || el) {
  6896. warn(
  6897. 'You are using the runtime-only build of Vue where the template ' +
  6898. 'compiler is not available. Either pre-compile the templates into ' +
  6899. 'render functions, or use the compiler-included build.',
  6900. vm
  6901. );
  6902. } else {
  6903. warn(
  6904. 'Failed to mount component: template or render function not defined.',
  6905. vm
  6906. );
  6907. }
  6908. }
  6909. }
  6910. !vm._$fallback && callHook(vm, 'beforeMount');
  6911. var updateComponent = function () {
  6912. vm._update(vm._render(), hydrating);
  6913. };
  6914. // we set this to vm._watcher inside the watcher's constructor
  6915. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  6916. // component's mounted hook), which relies on vm._watcher being already defined
  6917. new Watcher(vm, updateComponent, noop, {
  6918. before: function before() {
  6919. if (vm._isMounted && !vm._isDestroyed) {
  6920. callHook(vm, 'beforeUpdate');
  6921. }
  6922. }
  6923. }, true /* isRenderWatcher */);
  6924. hydrating = false;
  6925. return vm
  6926. }
  6927. /* */
  6928. function renderClass (
  6929. staticClass,
  6930. dynamicClass
  6931. ) {
  6932. if (isDef(staticClass) || isDef(dynamicClass)) {
  6933. return concat(staticClass, stringifyClass(dynamicClass))
  6934. }
  6935. /* istanbul ignore next */
  6936. return ''
  6937. }
  6938. function concat (a, b) {
  6939. return a ? b ? (a + ' ' + b) : a : (b || '')
  6940. }
  6941. function stringifyClass (value) {
  6942. if (Array.isArray(value)) {
  6943. return stringifyArray(value)
  6944. }
  6945. if (isObject(value)) {
  6946. return stringifyObject(value)
  6947. }
  6948. if (typeof value === 'string') {
  6949. return value
  6950. }
  6951. /* istanbul ignore next */
  6952. return ''
  6953. }
  6954. function stringifyArray (value) {
  6955. var res = '';
  6956. var stringified;
  6957. for (var i = 0, l = value.length; i < l; i++) {
  6958. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  6959. if (res) { res += ' '; }
  6960. res += stringified;
  6961. }
  6962. }
  6963. return res
  6964. }
  6965. function stringifyObject (value) {
  6966. var res = '';
  6967. for (var key in value) {
  6968. if (value[key]) {
  6969. if (res) { res += ' '; }
  6970. res += key;
  6971. }
  6972. }
  6973. return res
  6974. }
  6975. /* */
  6976. var parseStyleText = cached(function (cssText) {
  6977. var res = {};
  6978. var listDelimiter = /;(?![^(]*\))/g;
  6979. var propertyDelimiter = /:(.+)/;
  6980. cssText.split(listDelimiter).forEach(function (item) {
  6981. if (item) {
  6982. var tmp = item.split(propertyDelimiter);
  6983. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  6984. }
  6985. });
  6986. return res
  6987. });
  6988. // normalize possible array / string values into Object
  6989. function normalizeStyleBinding (bindingStyle) {
  6990. if (Array.isArray(bindingStyle)) {
  6991. return toObject(bindingStyle)
  6992. }
  6993. if (typeof bindingStyle === 'string') {
  6994. return parseStyleText(bindingStyle)
  6995. }
  6996. return bindingStyle
  6997. }
  6998. /* */
  6999. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  7000. function getTarget(obj, path) {
  7001. var parts = path.split('.');
  7002. var key = parts[0];
  7003. if (key.indexOf('__$n') === 0) { //number index
  7004. key = parseInt(key.replace('__$n', ''));
  7005. }
  7006. if (parts.length === 1) {
  7007. return obj[key]
  7008. }
  7009. return getTarget(obj[key], parts.slice(1).join('.'))
  7010. }
  7011. function internalMixin(Vue) {
  7012. Vue.config.errorHandler = function(err, vm, info) {
  7013. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  7014. console.error(err);
  7015. /* eslint-disable no-undef */
  7016. var app = typeof getApp === 'function' && getApp();
  7017. if (app && app.onError) {
  7018. app.onError(err);
  7019. }
  7020. };
  7021. var oldEmit = Vue.prototype.$emit;
  7022. Vue.prototype.$emit = function(event) {
  7023. if (this.$scope && event) {
  7024. this.$scope['triggerEvent'](event, {
  7025. __args__: toArray(arguments, 1)
  7026. });
  7027. }
  7028. return oldEmit.apply(this, arguments)
  7029. };
  7030. Vue.prototype.$nextTick = function(fn) {
  7031. return nextTick$1(this, fn)
  7032. };
  7033. MP_METHODS.forEach(function (method) {
  7034. Vue.prototype[method] = function(args) {
  7035. if (this.$scope && this.$scope[method]) {
  7036. return this.$scope[method](args)
  7037. }
  7038. // mp-alipay
  7039. if (typeof my === 'undefined') {
  7040. return
  7041. }
  7042. if (method === 'createSelectorQuery') {
  7043. /* eslint-disable no-undef */
  7044. return my.createSelectorQuery(args)
  7045. } else if (method === 'createIntersectionObserver') {
  7046. /* eslint-disable no-undef */
  7047. return my.createIntersectionObserver(args)
  7048. }
  7049. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  7050. };
  7051. });
  7052. Vue.prototype.__init_provide = initProvide;
  7053. Vue.prototype.__init_injections = initInjections;
  7054. Vue.prototype.__call_hook = function(hook, args) {
  7055. var vm = this;
  7056. // #7573 disable dep collection when invoking lifecycle hooks
  7057. pushTarget();
  7058. var handlers = vm.$options[hook];
  7059. var info = hook + " hook";
  7060. var ret;
  7061. if (handlers) {
  7062. for (var i = 0, j = handlers.length; i < j; i++) {
  7063. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  7064. }
  7065. }
  7066. if (vm._hasHookEvent) {
  7067. vm.$emit('hook:' + hook, args);
  7068. }
  7069. popTarget();
  7070. return ret
  7071. };
  7072. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  7073. if (Array.isArray(modifiers)) {
  7074. if (modifiers.indexOf('trim') !== -1) {
  7075. value = value.trim();
  7076. }
  7077. if (modifiers.indexOf('number') !== -1) {
  7078. value = this._n(value);
  7079. }
  7080. }
  7081. if (!target) {
  7082. target = this;
  7083. }
  7084. target[key] = value;
  7085. };
  7086. Vue.prototype.__set_sync = function(target, key, value) {
  7087. if (!target) {
  7088. target = this;
  7089. }
  7090. target[key] = value;
  7091. };
  7092. Vue.prototype.__get_orig = function(item) {
  7093. if (isPlainObject(item)) {
  7094. return item['$orig'] || item
  7095. }
  7096. return item
  7097. };
  7098. Vue.prototype.__get_value = function(dataPath, target) {
  7099. return getTarget(target || this, dataPath)
  7100. };
  7101. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  7102. return renderClass(staticClass, dynamicClass)
  7103. };
  7104. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  7105. if (!dynamicStyle && !staticStyle) {
  7106. return ''
  7107. }
  7108. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  7109. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  7110. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  7111. };
  7112. Vue.prototype.__map = function(val, iteratee) {
  7113. //TODO 暂不考虑 string
  7114. var ret, i, l, keys, key;
  7115. if (Array.isArray(val)) {
  7116. ret = new Array(val.length);
  7117. for (i = 0, l = val.length; i < l; i++) {
  7118. ret[i] = iteratee(val[i], i);
  7119. }
  7120. return ret
  7121. } else if (isObject(val)) {
  7122. keys = Object.keys(val);
  7123. ret = Object.create(null);
  7124. for (i = 0, l = keys.length; i < l; i++) {
  7125. key = keys[i];
  7126. ret[key] = iteratee(val[key], key, i);
  7127. }
  7128. return ret
  7129. } else if (typeof val === 'number') {
  7130. ret = new Array(val);
  7131. for (i = 0, l = val; i < l; i++) {
  7132. // 第一个参数暂时仍和小程序一致
  7133. ret[i] = iteratee(i, i);
  7134. }
  7135. return ret
  7136. }
  7137. return []
  7138. };
  7139. }
  7140. /* */
  7141. var LIFECYCLE_HOOKS$1 = [
  7142. //App
  7143. 'onLaunch',
  7144. 'onShow',
  7145. 'onHide',
  7146. 'onUniNViewMessage',
  7147. 'onPageNotFound',
  7148. 'onThemeChange',
  7149. 'onError',
  7150. 'onUnhandledRejection',
  7151. //Page
  7152. 'onInit',
  7153. 'onLoad',
  7154. // 'onShow',
  7155. 'onReady',
  7156. // 'onHide',
  7157. 'onUnload',
  7158. 'onPullDownRefresh',
  7159. 'onReachBottom',
  7160. 'onTabItemTap',
  7161. 'onAddToFavorites',
  7162. 'onShareTimeline',
  7163. 'onShareAppMessage',
  7164. 'onResize',
  7165. 'onPageScroll',
  7166. 'onNavigationBarButtonTap',
  7167. 'onBackPress',
  7168. 'onNavigationBarSearchInputChanged',
  7169. 'onNavigationBarSearchInputConfirmed',
  7170. 'onNavigationBarSearchInputClicked',
  7171. //Component
  7172. // 'onReady', // 兼容旧版本,应该移除该事件
  7173. 'onPageShow',
  7174. 'onPageHide',
  7175. 'onPageResize'
  7176. ];
  7177. function lifecycleMixin$1(Vue) {
  7178. //fixed vue-class-component
  7179. var oldExtend = Vue.extend;
  7180. Vue.extend = function(extendOptions) {
  7181. extendOptions = extendOptions || {};
  7182. var methods = extendOptions.methods;
  7183. if (methods) {
  7184. Object.keys(methods).forEach(function (methodName) {
  7185. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  7186. extendOptions[methodName] = methods[methodName];
  7187. delete methods[methodName];
  7188. }
  7189. });
  7190. }
  7191. return oldExtend.call(this, extendOptions)
  7192. };
  7193. var strategies = Vue.config.optionMergeStrategies;
  7194. var mergeHook = strategies.created;
  7195. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  7196. strategies[hook] = mergeHook;
  7197. });
  7198. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  7199. }
  7200. /* */
  7201. // install platform patch function
  7202. Vue.prototype.__patch__ = patch;
  7203. // public mount method
  7204. Vue.prototype.$mount = function(
  7205. el ,
  7206. hydrating
  7207. ) {
  7208. return mountComponent$1(this, el, hydrating)
  7209. };
  7210. lifecycleMixin$1(Vue);
  7211. internalMixin(Vue);
  7212. /* */
  7213. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  7214. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2)))
  7215. /***/ }),
  7216. /* 4 */
  7217. /*!*************************************************************!*\
  7218. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  7219. \*************************************************************/
  7220. /*! no static exports found */
  7221. /***/ (function(module, exports, __webpack_require__) {
  7222. "use strict";
  7223. /* WEBPACK VAR INJECTION */(function(uni, global) {Object.defineProperty(exports, "__esModule", { value: true });exports.compileI18nJsonStr = compileI18nJsonStr;exports.hasI18nJson = hasI18nJson;exports.initVueI18n = initVueI18n;exports.isI18nStr = isI18nStr;exports.normalizeLocale = normalizeLocale;exports.parseI18nJson = parseI18nJson;exports.resolveLocale = resolveLocale;exports.isString = exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}var isArray = Array.isArray;
  7224. var isObject = function isObject(val) {return val !== null && typeof val === 'object';};
  7225. var defaultDelimiters = ['{', '}'];var
  7226. BaseFormatter = /*#__PURE__*/function () {
  7227. function BaseFormatter() {_classCallCheck(this, BaseFormatter);
  7228. this._caches = Object.create(null);
  7229. }_createClass(BaseFormatter, [{ key: "interpolate", value: function interpolate(
  7230. message, values) {var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  7231. if (!values) {
  7232. return [message];
  7233. }
  7234. var tokens = this._caches[message];
  7235. if (!tokens) {
  7236. tokens = parse(message, delimiters);
  7237. this._caches[message] = tokens;
  7238. }
  7239. return compile(tokens, values);
  7240. } }]);return BaseFormatter;}();exports.Formatter = BaseFormatter;
  7241. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  7242. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  7243. function parse(format, _ref) {var _ref2 = _slicedToArray(_ref, 2),startDelimiter = _ref2[0],endDelimiter = _ref2[1];
  7244. var tokens = [];
  7245. var position = 0;
  7246. var text = '';
  7247. while (position < format.length) {
  7248. var char = format[position++];
  7249. if (char === startDelimiter) {
  7250. if (text) {
  7251. tokens.push({ type: 'text', value: text });
  7252. }
  7253. text = '';
  7254. var sub = '';
  7255. char = format[position++];
  7256. while (char !== undefined && char !== endDelimiter) {
  7257. sub += char;
  7258. char = format[position++];
  7259. }
  7260. var isClosed = char === endDelimiter;
  7261. var type = RE_TOKEN_LIST_VALUE.test(sub) ?
  7262. 'list' :
  7263. isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ?
  7264. 'named' :
  7265. 'unknown';
  7266. tokens.push({ value: sub, type: type });
  7267. }
  7268. // else if (char === '%') {
  7269. // // when found rails i18n syntax, skip text capture
  7270. // if (format[position] !== '{') {
  7271. // text += char
  7272. // }
  7273. // }
  7274. else {
  7275. text += char;
  7276. }
  7277. }
  7278. text && tokens.push({ type: 'text', value: text });
  7279. return tokens;
  7280. }
  7281. function compile(tokens, values) {
  7282. var compiled = [];
  7283. var index = 0;
  7284. var mode = isArray(values) ?
  7285. 'list' :
  7286. isObject(values) ?
  7287. 'named' :
  7288. 'unknown';
  7289. if (mode === 'unknown') {
  7290. return compiled;
  7291. }
  7292. while (index < tokens.length) {
  7293. var token = tokens[index];
  7294. switch (token.type) {
  7295. case 'text':
  7296. compiled.push(token.value);
  7297. break;
  7298. case 'list':
  7299. compiled.push(values[parseInt(token.value, 10)]);
  7300. break;
  7301. case 'named':
  7302. if (mode === 'named') {
  7303. compiled.push(values[token.value]);
  7304. } else
  7305. {
  7306. if (true) {
  7307. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  7308. }
  7309. }
  7310. break;
  7311. case 'unknown':
  7312. if (true) {
  7313. console.warn("Detect 'unknown' type of token!");
  7314. }
  7315. break;}
  7316. index++;
  7317. }
  7318. return compiled;
  7319. }
  7320. var LOCALE_ZH_HANS = 'zh-Hans';exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  7321. var LOCALE_ZH_HANT = 'zh-Hant';exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  7322. var LOCALE_EN = 'en';exports.LOCALE_EN = LOCALE_EN;
  7323. var LOCALE_FR = 'fr';exports.LOCALE_FR = LOCALE_FR;
  7324. var LOCALE_ES = 'es';exports.LOCALE_ES = LOCALE_ES;
  7325. var hasOwnProperty = Object.prototype.hasOwnProperty;
  7326. var hasOwn = function hasOwn(val, key) {return hasOwnProperty.call(val, key);};
  7327. var defaultFormatter = new BaseFormatter();
  7328. function include(str, parts) {
  7329. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  7330. }
  7331. function startsWith(str, parts) {
  7332. return parts.find(function (part) {return str.indexOf(part) === 0;});
  7333. }
  7334. function normalizeLocale(locale, messages) {
  7335. if (!locale) {
  7336. return;
  7337. }
  7338. locale = locale.trim().replace(/_/g, '-');
  7339. if (messages && messages[locale]) {
  7340. return locale;
  7341. }
  7342. locale = locale.toLowerCase();
  7343. if (locale.indexOf('zh') === 0) {
  7344. if (locale.indexOf('-hans') > -1) {
  7345. return LOCALE_ZH_HANS;
  7346. }
  7347. if (locale.indexOf('-hant') > -1) {
  7348. return LOCALE_ZH_HANT;
  7349. }
  7350. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  7351. return LOCALE_ZH_HANT;
  7352. }
  7353. return LOCALE_ZH_HANS;
  7354. }
  7355. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  7356. if (lang) {
  7357. return lang;
  7358. }
  7359. }var
  7360. I18n = /*#__PURE__*/function () {
  7361. function I18n(_ref3) {var locale = _ref3.locale,fallbackLocale = _ref3.fallbackLocale,messages = _ref3.messages,watcher = _ref3.watcher,formater = _ref3.formater;_classCallCheck(this, I18n);
  7362. this.locale = LOCALE_EN;
  7363. this.fallbackLocale = LOCALE_EN;
  7364. this.message = {};
  7365. this.messages = {};
  7366. this.watchers = [];
  7367. if (fallbackLocale) {
  7368. this.fallbackLocale = fallbackLocale;
  7369. }
  7370. this.formater = formater || defaultFormatter;
  7371. this.messages = messages || {};
  7372. this.setLocale(locale || LOCALE_EN);
  7373. if (watcher) {
  7374. this.watchLocale(watcher);
  7375. }
  7376. }_createClass(I18n, [{ key: "setLocale", value: function setLocale(
  7377. locale) {var _this = this;
  7378. var oldLocale = this.locale;
  7379. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  7380. if (!this.messages[this.locale]) {
  7381. // 可能初始化时不存在
  7382. this.messages[this.locale] = {};
  7383. }
  7384. this.message = this.messages[this.locale];
  7385. // 仅发生变化时,通知
  7386. if (oldLocale !== this.locale) {
  7387. this.watchers.forEach(function (watcher) {
  7388. watcher(_this.locale, oldLocale);
  7389. });
  7390. }
  7391. } }, { key: "getLocale", value: function getLocale()
  7392. {
  7393. return this.locale;
  7394. } }, { key: "watchLocale", value: function watchLocale(
  7395. fn) {var _this2 = this;
  7396. var index = this.watchers.push(fn) - 1;
  7397. return function () {
  7398. _this2.watchers.splice(index, 1);
  7399. };
  7400. } }, { key: "add", value: function add(
  7401. locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  7402. var curMessages = this.messages[locale];
  7403. if (curMessages) {
  7404. if (override) {
  7405. Object.assign(curMessages, message);
  7406. } else
  7407. {
  7408. Object.keys(message).forEach(function (key) {
  7409. if (!hasOwn(curMessages, key)) {
  7410. curMessages[key] = message[key];
  7411. }
  7412. });
  7413. }
  7414. } else
  7415. {
  7416. this.messages[locale] = message;
  7417. }
  7418. } }, { key: "f", value: function f(
  7419. message, values, delimiters) {
  7420. return this.formater.interpolate(message, values, delimiters).join('');
  7421. } }, { key: "t", value: function t(
  7422. key, locale, values) {
  7423. var message = this.message;
  7424. if (typeof locale === 'string') {
  7425. locale = normalizeLocale(locale, this.messages);
  7426. locale && (message = this.messages[locale]);
  7427. } else
  7428. {
  7429. values = locale;
  7430. }
  7431. if (!hasOwn(message, key)) {
  7432. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  7433. return key;
  7434. }
  7435. return this.formater.interpolate(message[key], values).join('');
  7436. } }]);return I18n;}();exports.I18n = I18n;
  7437. function watchAppLocale(appVm, i18n) {
  7438. // 需要保证 watch 的触发在组件渲染之前
  7439. if (appVm.$watchLocale) {
  7440. // vue2
  7441. appVm.$watchLocale(function (newLocale) {
  7442. i18n.setLocale(newLocale);
  7443. });
  7444. } else
  7445. {
  7446. appVm.$watch(function () {return appVm.$locale;}, function (newLocale) {
  7447. i18n.setLocale(newLocale);
  7448. });
  7449. }
  7450. }
  7451. function getDefaultLocale() {
  7452. if (typeof uni !== 'undefined' && uni.getLocale) {
  7453. return uni.getLocale();
  7454. }
  7455. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  7456. if (typeof global !== 'undefined' && global.getLocale) {
  7457. return global.getLocale();
  7458. }
  7459. return LOCALE_EN;
  7460. }
  7461. function initVueI18n(locale) {var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;var watcher = arguments.length > 3 ? arguments[3] : undefined;
  7462. // 兼容旧版本入参
  7463. if (typeof locale !== 'string') {var _ref4 =
  7464. [
  7465. messages,
  7466. locale];locale = _ref4[0];messages = _ref4[1];
  7467. }
  7468. if (typeof locale !== 'string') {
  7469. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  7470. locale = getDefaultLocale();
  7471. }
  7472. if (typeof fallbackLocale !== 'string') {
  7473. fallbackLocale =
  7474. typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale ||
  7475. LOCALE_EN;
  7476. }
  7477. var i18n = new I18n({
  7478. locale: locale,
  7479. fallbackLocale: fallbackLocale,
  7480. messages: messages,
  7481. watcher: watcher });
  7482. var _t = function t(key, values) {
  7483. if (typeof getApp !== 'function') {
  7484. // app view
  7485. /* eslint-disable no-func-assign */
  7486. _t = function t(key, values) {
  7487. return i18n.t(key, values);
  7488. };
  7489. } else
  7490. {
  7491. var isWatchedAppLocale = false;
  7492. _t = function t(key, values) {
  7493. var appVm = getApp().$vm;
  7494. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  7495. // options: {
  7496. // type: Array,
  7497. // default () {
  7498. // return [{
  7499. // icon: 'shop',
  7500. // text: t("uni-goods-nav.options.shop"),
  7501. // }, {
  7502. // icon: 'cart',
  7503. // text: t("uni-goods-nav.options.cart")
  7504. // }]
  7505. // }
  7506. // },
  7507. if (appVm) {
  7508. // 触发响应式
  7509. appVm.$locale;
  7510. if (!isWatchedAppLocale) {
  7511. isWatchedAppLocale = true;
  7512. watchAppLocale(appVm, i18n);
  7513. }
  7514. }
  7515. return i18n.t(key, values);
  7516. };
  7517. }
  7518. return _t(key, values);
  7519. };
  7520. return {
  7521. i18n: i18n,
  7522. f: function f(message, values, delimiters) {
  7523. return i18n.f(message, values, delimiters);
  7524. },
  7525. t: function t(key, values) {
  7526. return _t(key, values);
  7527. },
  7528. add: function add(locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  7529. return i18n.add(locale, message, override);
  7530. },
  7531. watch: function watch(fn) {
  7532. return i18n.watchLocale(fn);
  7533. },
  7534. getLocale: function getLocale() {
  7535. return i18n.getLocale();
  7536. },
  7537. setLocale: function setLocale(newLocale) {
  7538. return i18n.setLocale(newLocale);
  7539. } };
  7540. }
  7541. var isString = function isString(val) {return typeof val === 'string';};exports.isString = isString;
  7542. var formater;
  7543. function hasI18nJson(jsonObj, delimiters) {
  7544. if (!formater) {
  7545. formater = new BaseFormatter();
  7546. }
  7547. return walkJsonObj(jsonObj, function (jsonObj, key) {
  7548. var value = jsonObj[key];
  7549. if (isString(value)) {
  7550. if (isI18nStr(value, delimiters)) {
  7551. return true;
  7552. }
  7553. } else
  7554. {
  7555. return hasI18nJson(value, delimiters);
  7556. }
  7557. });
  7558. }
  7559. function parseI18nJson(jsonObj, values, delimiters) {
  7560. if (!formater) {
  7561. formater = new BaseFormatter();
  7562. }
  7563. walkJsonObj(jsonObj, function (jsonObj, key) {
  7564. var value = jsonObj[key];
  7565. if (isString(value)) {
  7566. if (isI18nStr(value, delimiters)) {
  7567. jsonObj[key] = compileStr(value, values, delimiters);
  7568. }
  7569. } else
  7570. {
  7571. parseI18nJson(value, values, delimiters);
  7572. }
  7573. });
  7574. return jsonObj;
  7575. }
  7576. function compileI18nJsonStr(jsonStr, _ref5) {var locale = _ref5.locale,locales = _ref5.locales,delimiters = _ref5.delimiters;
  7577. if (!isI18nStr(jsonStr, delimiters)) {
  7578. return jsonStr;
  7579. }
  7580. if (!formater) {
  7581. formater = new BaseFormatter();
  7582. }
  7583. var localeValues = [];
  7584. Object.keys(locales).forEach(function (name) {
  7585. if (name !== locale) {
  7586. localeValues.push({
  7587. locale: name,
  7588. values: locales[name] });
  7589. }
  7590. });
  7591. localeValues.unshift({ locale: locale, values: locales[locale] });
  7592. try {
  7593. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  7594. }
  7595. catch (e) {}
  7596. return jsonStr;
  7597. }
  7598. function isI18nStr(value, delimiters) {
  7599. return value.indexOf(delimiters[0]) > -1;
  7600. }
  7601. function compileStr(value, values, delimiters) {
  7602. return formater.interpolate(value, values, delimiters).join('');
  7603. }
  7604. function compileValue(jsonObj, key, localeValues, delimiters) {
  7605. var value = jsonObj[key];
  7606. if (isString(value)) {
  7607. // 存在国际化
  7608. if (isI18nStr(value, delimiters)) {
  7609. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  7610. if (localeValues.length > 1) {
  7611. // 格式化国际化语言
  7612. var valueLocales = jsonObj[key + 'Locales'] = {};
  7613. localeValues.forEach(function (localValue) {
  7614. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  7615. });
  7616. }
  7617. }
  7618. } else
  7619. {
  7620. compileJsonObj(value, localeValues, delimiters);
  7621. }
  7622. }
  7623. function compileJsonObj(jsonObj, localeValues, delimiters) {
  7624. walkJsonObj(jsonObj, function (jsonObj, key) {
  7625. compileValue(jsonObj, key, localeValues, delimiters);
  7626. });
  7627. return jsonObj;
  7628. }
  7629. function walkJsonObj(jsonObj, walk) {
  7630. if (isArray(jsonObj)) {
  7631. for (var i = 0; i < jsonObj.length; i++) {
  7632. if (walk(jsonObj, i)) {
  7633. return true;
  7634. }
  7635. }
  7636. } else
  7637. if (isObject(jsonObj)) {
  7638. for (var key in jsonObj) {
  7639. if (walk(jsonObj, key)) {
  7640. return true;
  7641. }
  7642. }
  7643. }
  7644. return false;
  7645. }
  7646. function resolveLocale(locales) {
  7647. return function (locale) {
  7648. if (!locale) {
  7649. return locale;
  7650. }
  7651. locale = normalizeLocale(locale) || locale;
  7652. return resolveLocaleChain(locale).find(function (locale) {return locales.indexOf(locale) > -1;});
  7653. };
  7654. }
  7655. function resolveLocaleChain(locale) {
  7656. var chain = [];
  7657. var tokens = locale.split('-');
  7658. while (tokens.length) {
  7659. chain.push(tokens.join('-'));
  7660. tokens.pop();
  7661. }
  7662. return chain;
  7663. }
  7664. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  7665. /***/ }),
  7666. /* 5 */
  7667. /*!*******************************************************!*\
  7668. !*** D:/zheng_dev2021/caimei-applets-hehe/pages.json ***!
  7669. \*******************************************************/
  7670. /*! no static exports found */
  7671. /***/ (function(module, exports) {
  7672. /***/ }),
  7673. /* 6 */
  7674. /*!*******************************************************!*\
  7675. !*** ./node_modules/@dcloudio/uni-stat/dist/index.js ***!
  7676. \*******************************************************/
  7677. /*! no static exports found */
  7678. /***/ (function(module, exports, __webpack_require__) {
  7679. "use strict";
  7680. /* WEBPACK VAR INJECTION */(function(uni) {var _package = __webpack_require__(/*! ../package.json */ 7);function _inherits(subClass, superClass) {if (typeof superClass !== "function" && superClass !== null) {throw new TypeError("Super expression must either be null or a function");}subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });if (superClass) _setPrototypeOf(subClass, superClass);}function _setPrototypeOf(o, p) {_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {o.__proto__ = p;return o;};return _setPrototypeOf(o, p);}function _createSuper(Derived) {var hasNativeReflectConstruct = _isNativeReflectConstruct();return function _createSuperInternal() {var Super = _getPrototypeOf(Derived),result;if (hasNativeReflectConstruct) {var NewTarget = _getPrototypeOf(this).constructor;result = Reflect.construct(Super, arguments, NewTarget);} else {result = Super.apply(this, arguments);}return _possibleConstructorReturn(this, result);};}function _possibleConstructorReturn(self, call) {if (call && (typeof call === "object" || typeof call === "function")) {return call;}return _assertThisInitialized(self);}function _assertThisInitialized(self) {if (self === void 0) {throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct() {if (typeof Reflect === "undefined" || !Reflect.construct) return false;if (Reflect.construct.sham) return false;if (typeof Proxy === "function") return true;try {Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));return true;} catch (e) {return false;}}function _getPrototypeOf(o) {_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {return o.__proto__ || Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}
  7681. var STAT_VERSION = _package.version;
  7682. var STAT_URL = 'https://tongji.dcloud.io/uni/stat';
  7683. var STAT_H5_URL = 'https://tongji.dcloud.io/uni/stat.gif';
  7684. var PAGE_PVER_TIME = 1800;
  7685. var APP_PVER_TIME = 300;
  7686. var OPERATING_TIME = 10;
  7687. var DIFF_TIME = 60 * 1000 * 60 * 24;
  7688. var statConfig = __webpack_require__(/*! uni-stat-config */ 8).default || __webpack_require__(/*! uni-stat-config */ 8);
  7689. var UUID_KEY = '__DC_STAT_UUID';
  7690. var UUID_VALUE = '__DC_UUID_VALUE';
  7691. function getUuid() {
  7692. var uuid = '';
  7693. if (getPlatformName() === 'n') {
  7694. try {
  7695. uuid = plus.runtime.getDCloudId();
  7696. } catch (e) {
  7697. uuid = '';
  7698. }
  7699. return uuid;
  7700. }
  7701. try {
  7702. uuid = uni.getStorageSync(UUID_KEY);
  7703. } catch (e) {
  7704. uuid = UUID_VALUE;
  7705. }
  7706. if (!uuid) {
  7707. uuid = Date.now() + '' + Math.floor(Math.random() * 1e7);
  7708. try {
  7709. uni.setStorageSync(UUID_KEY, uuid);
  7710. } catch (e) {
  7711. uni.setStorageSync(UUID_KEY, UUID_VALUE);
  7712. }
  7713. }
  7714. return uuid;
  7715. }
  7716. var getSgin = function getSgin(statData) {
  7717. var arr = Object.keys(statData);
  7718. var sortArr = arr.sort();
  7719. var sgin = {};
  7720. var sginStr = '';
  7721. for (var i in sortArr) {
  7722. sgin[sortArr[i]] = statData[sortArr[i]];
  7723. sginStr += sortArr[i] + '=' + statData[sortArr[i]] + '&';
  7724. }
  7725. // const options = sginStr.substr(0, sginStr.length - 1)
  7726. // sginStr = sginStr.substr(0, sginStr.length - 1) + '&key=' + STAT_KEY;
  7727. // const si = crypto.createHash('md5').update(sginStr).digest('hex');
  7728. return {
  7729. sign: '',
  7730. options: sginStr.substr(0, sginStr.length - 1) };
  7731. };
  7732. var getSplicing = function getSplicing(data) {
  7733. var str = '';
  7734. for (var i in data) {
  7735. str += i + '=' + data[i] + '&';
  7736. }
  7737. return str.substr(0, str.length - 1);
  7738. };
  7739. var getTime = function getTime() {
  7740. return parseInt(new Date().getTime() / 1000);
  7741. };
  7742. var getPlatformName = function getPlatformName() {var _platformList;
  7743. var aliArr = ['y', 'a', 'p', 'mp-ali'];
  7744. var platformList = (_platformList = {
  7745. 'app-plus': 'n',
  7746. 'h5': 'h5',
  7747. 'mp-weixin': 'wx' }, _defineProperty(_platformList,
  7748. aliArr.reverse().join(''), 'ali'), _defineProperty(_platformList,
  7749. 'mp-baidu', 'bd'), _defineProperty(_platformList,
  7750. 'mp-toutiao', 'tt'), _defineProperty(_platformList,
  7751. 'mp-qq', 'qq'), _defineProperty(_platformList,
  7752. 'quickapp-native', 'qn'), _defineProperty(_platformList,
  7753. 'mp-kuaishou', 'ks'), _platformList);
  7754. return platformList["mp-weixin"];
  7755. };
  7756. var getPackName = function getPackName() {
  7757. var packName = '';
  7758. if (getPlatformName() === 'wx' || getPlatformName() === 'qq') {
  7759. // 兼容微信小程序低版本基础库
  7760. if (uni.canIUse('getAccountInfoSync')) {
  7761. packName = uni.getAccountInfoSync().miniProgram.appId || '';
  7762. }
  7763. }
  7764. return packName;
  7765. };
  7766. var getVersion = function getVersion() {
  7767. return getPlatformName() === 'n' ? plus.runtime.version : '';
  7768. };
  7769. var getChannel = function getChannel() {
  7770. var platformName = getPlatformName();
  7771. var channel = '';
  7772. if (platformName === 'n') {
  7773. channel = plus.runtime.channel;
  7774. }
  7775. return channel;
  7776. };
  7777. var getScene = function getScene(options) {
  7778. var platformName = getPlatformName();
  7779. var scene = '';
  7780. if (options) {
  7781. return options;
  7782. }
  7783. if (platformName === 'wx') {
  7784. scene = uni.getLaunchOptionsSync().scene;
  7785. }
  7786. return scene;
  7787. };
  7788. var First__Visit__Time__KEY = 'First__Visit__Time';
  7789. var Last__Visit__Time__KEY = 'Last__Visit__Time';
  7790. var getFirstVisitTime = function getFirstVisitTime() {
  7791. var timeStorge = uni.getStorageSync(First__Visit__Time__KEY);
  7792. var time = 0;
  7793. if (timeStorge) {
  7794. time = timeStorge;
  7795. } else {
  7796. time = getTime();
  7797. uni.setStorageSync(First__Visit__Time__KEY, time);
  7798. uni.removeStorageSync(Last__Visit__Time__KEY);
  7799. }
  7800. return time;
  7801. };
  7802. var getLastVisitTime = function getLastVisitTime() {
  7803. var timeStorge = uni.getStorageSync(Last__Visit__Time__KEY);
  7804. var time = 0;
  7805. if (timeStorge) {
  7806. time = timeStorge;
  7807. } else {
  7808. time = '';
  7809. }
  7810. uni.setStorageSync(Last__Visit__Time__KEY, getTime());
  7811. return time;
  7812. };
  7813. var PAGE_RESIDENCE_TIME = '__page__residence__time';
  7814. var First_Page_residence_time = 0;
  7815. var Last_Page_residence_time = 0;
  7816. var setPageResidenceTime = function setPageResidenceTime() {
  7817. First_Page_residence_time = getTime();
  7818. if (getPlatformName() === 'n') {
  7819. uni.setStorageSync(PAGE_RESIDENCE_TIME, getTime());
  7820. }
  7821. return First_Page_residence_time;
  7822. };
  7823. var getPageResidenceTime = function getPageResidenceTime() {
  7824. Last_Page_residence_time = getTime();
  7825. if (getPlatformName() === 'n') {
  7826. First_Page_residence_time = uni.getStorageSync(PAGE_RESIDENCE_TIME);
  7827. }
  7828. return Last_Page_residence_time - First_Page_residence_time;
  7829. };
  7830. var TOTAL__VISIT__COUNT = 'Total__Visit__Count';
  7831. var getTotalVisitCount = function getTotalVisitCount() {
  7832. var timeStorge = uni.getStorageSync(TOTAL__VISIT__COUNT);
  7833. var count = 1;
  7834. if (timeStorge) {
  7835. count = timeStorge;
  7836. count++;
  7837. }
  7838. uni.setStorageSync(TOTAL__VISIT__COUNT, count);
  7839. return count;
  7840. };
  7841. var GetEncodeURIComponentOptions = function GetEncodeURIComponentOptions(statData) {
  7842. var data = {};
  7843. for (var prop in statData) {
  7844. data[prop] = encodeURIComponent(statData[prop]);
  7845. }
  7846. return data;
  7847. };
  7848. var Set__First__Time = 0;
  7849. var Set__Last__Time = 0;
  7850. var getFirstTime = function getFirstTime() {
  7851. var time = new Date().getTime();
  7852. Set__First__Time = time;
  7853. Set__Last__Time = 0;
  7854. return time;
  7855. };
  7856. var getLastTime = function getLastTime() {
  7857. var time = new Date().getTime();
  7858. Set__Last__Time = time;
  7859. return time;
  7860. };
  7861. var getResidenceTime = function getResidenceTime(type) {
  7862. var residenceTime = 0;
  7863. if (Set__First__Time !== 0) {
  7864. residenceTime = Set__Last__Time - Set__First__Time;
  7865. }
  7866. residenceTime = parseInt(residenceTime / 1000);
  7867. residenceTime = residenceTime < 1 ? 1 : residenceTime;
  7868. if (type === 'app') {
  7869. var overtime = residenceTime > APP_PVER_TIME ? true : false;
  7870. return {
  7871. residenceTime: residenceTime,
  7872. overtime: overtime };
  7873. }
  7874. if (type === 'page') {
  7875. var _overtime = residenceTime > PAGE_PVER_TIME ? true : false;
  7876. return {
  7877. residenceTime: residenceTime,
  7878. overtime: _overtime };
  7879. }
  7880. return {
  7881. residenceTime: residenceTime };
  7882. };
  7883. var getRoute = function getRoute() {
  7884. var pages = getCurrentPages();
  7885. var page = pages[pages.length - 1];
  7886. if (!page) return '';
  7887. var _self = page.$vm;
  7888. if (getPlatformName() === 'bd') {
  7889. return _self.$mp && _self.$mp.page.is;
  7890. } else {
  7891. return _self.$scope && _self.$scope.route || _self.$mp && _self.$mp.page.route;
  7892. }
  7893. };
  7894. var getPageRoute = function getPageRoute(self) {
  7895. var pages = getCurrentPages();
  7896. var page = pages[pages.length - 1];
  7897. if (!page) return '';
  7898. var _self = page.$vm;
  7899. var query = self._query;
  7900. var str = query && JSON.stringify(query) !== '{}' ? '?' + JSON.stringify(query) : '';
  7901. // clear
  7902. self._query = '';
  7903. if (getPlatformName() === 'bd') {
  7904. return _self.$mp && _self.$mp.page.is + str;
  7905. } else {
  7906. return _self.$scope && _self.$scope.route + str || _self.$mp && _self.$mp.page.route + str;
  7907. }
  7908. };
  7909. var getPageTypes = function getPageTypes(self) {
  7910. if (self.mpType === 'page' || self.$mp && self.$mp.mpType === 'page' || self.$options.mpType === 'page') {
  7911. return true;
  7912. }
  7913. return false;
  7914. };
  7915. var calibration = function calibration(eventName, options) {
  7916. // login 、 share 、pay_success 、pay_fail 、register 、title
  7917. if (!eventName) {
  7918. console.error("uni.report \u7F3A\u5C11 [eventName] \u53C2\u6570");
  7919. return true;
  7920. }
  7921. if (typeof eventName !== 'string') {
  7922. console.error("uni.report [eventName] \u53C2\u6570\u7C7B\u578B\u9519\u8BEF,\u53EA\u80FD\u4E3A String \u7C7B\u578B");
  7923. return true;
  7924. }
  7925. if (eventName.length > 255) {
  7926. console.error("uni.report [eventName] \u53C2\u6570\u957F\u5EA6\u4E0D\u80FD\u5927\u4E8E 255");
  7927. return true;
  7928. }
  7929. if (typeof options !== 'string' && typeof options !== 'object') {
  7930. console.error("uni.report [options] \u53C2\u6570\u7C7B\u578B\u9519\u8BEF,\u53EA\u80FD\u4E3A String \u6216 Object \u7C7B\u578B");
  7931. return true;
  7932. }
  7933. if (typeof options === 'string' && options.length > 255) {
  7934. console.error("uni.report [options] \u53C2\u6570\u957F\u5EA6\u4E0D\u80FD\u5927\u4E8E 255");
  7935. return true;
  7936. }
  7937. if (eventName === 'title' && typeof options !== 'string') {
  7938. console.error('uni.report [eventName] 参数为 title 时,[options] 参数只能为 String 类型');
  7939. return true;
  7940. }
  7941. };
  7942. var Report_Data_Time = 'Report_Data_Time';
  7943. var Report_Status = 'Report_Status';
  7944. var isReportData = function isReportData() {
  7945. return new Promise(function (resolve, reject) {
  7946. var start_time = '';
  7947. var end_time = new Date().getTime();
  7948. var diff_time = DIFF_TIME;
  7949. var report_status = 1;
  7950. try {
  7951. start_time = uni.getStorageSync(Report_Data_Time);
  7952. report_status = uni.getStorageSync(Report_Status);
  7953. } catch (e) {
  7954. start_time = '';
  7955. report_status = 1;
  7956. }
  7957. if (report_status === '') {
  7958. requestData(function (_ref)
  7959. {var enable = _ref.enable;
  7960. uni.setStorageSync(Report_Data_Time, end_time);
  7961. uni.setStorageSync(Report_Status, enable);
  7962. if (enable === 1) {
  7963. resolve();
  7964. }
  7965. });
  7966. return;
  7967. }
  7968. if (report_status === 1) {
  7969. resolve();
  7970. }
  7971. if (!start_time) {
  7972. uni.setStorageSync(Report_Data_Time, end_time);
  7973. start_time = end_time;
  7974. }
  7975. if (end_time - start_time > diff_time) {
  7976. requestData(function (_ref2)
  7977. {var enable = _ref2.enable;
  7978. uni.setStorageSync(Report_Data_Time, end_time);
  7979. uni.setStorageSync(Report_Status, enable);
  7980. });
  7981. }
  7982. });
  7983. };
  7984. var requestData = function requestData(done) {
  7985. var formData = {
  7986. usv: STAT_VERSION,
  7987. conf: JSON.stringify({
  7988. ak: statConfig.appid }) };
  7989. uni.request({
  7990. url: STAT_URL,
  7991. method: 'GET',
  7992. data: formData,
  7993. success: function success(res) {var
  7994. data =
  7995. res.data;
  7996. if (data.ret === 0) {
  7997. typeof done === 'function' && done({
  7998. enable: data.enable });
  7999. }
  8000. },
  8001. fail: function fail(e) {
  8002. var report_status_code = 1;
  8003. try {
  8004. report_status_code = uni.getStorageSync(Report_Status);
  8005. } catch (e) {
  8006. report_status_code = 1;
  8007. }
  8008. if (report_status_code === '') {
  8009. report_status_code = 1;
  8010. }
  8011. typeof done === 'function' && done({
  8012. enable: report_status_code });
  8013. } });
  8014. };
  8015. var PagesJson = __webpack_require__(/*! uni-pages?{"type":"style"} */ 9).default;
  8016. var statConfig$1 = __webpack_require__(/*! uni-stat-config */ 8).default || __webpack_require__(/*! uni-stat-config */ 8);
  8017. var resultOptions = uni.getSystemInfoSync();var
  8018. Util = /*#__PURE__*/function () {
  8019. function Util() {_classCallCheck(this, Util);
  8020. this.self = '';
  8021. this._retry = 0;
  8022. this._platform = '';
  8023. this._query = {};
  8024. this._navigationBarTitle = {
  8025. config: '',
  8026. page: '',
  8027. report: '',
  8028. lt: '' };
  8029. this._operatingTime = 0;
  8030. this._reportingRequestData = {
  8031. '1': [],
  8032. '11': [] };
  8033. this.__prevent_triggering = false;
  8034. this.__licationHide = false;
  8035. this.__licationShow = false;
  8036. this._lastPageRoute = '';
  8037. this.statData = {
  8038. uuid: getUuid(),
  8039. ut: getPlatformName(),
  8040. mpn: getPackName(),
  8041. ak: statConfig$1.appid,
  8042. usv: STAT_VERSION,
  8043. v: getVersion(),
  8044. ch: getChannel(),
  8045. cn: '',
  8046. pn: '',
  8047. ct: '',
  8048. t: getTime(),
  8049. tt: '',
  8050. p: resultOptions.platform === 'android' ? 'a' : 'i',
  8051. brand: resultOptions.brand || '',
  8052. md: resultOptions.model,
  8053. sv: resultOptions.system.replace(/(Android|iOS)\s/, ''),
  8054. mpsdk: resultOptions.SDKVersion || '',
  8055. mpv: resultOptions.version || '',
  8056. lang: resultOptions.language,
  8057. pr: resultOptions.pixelRatio,
  8058. ww: resultOptions.windowWidth,
  8059. wh: resultOptions.windowHeight,
  8060. sw: resultOptions.screenWidth,
  8061. sh: resultOptions.screenHeight };
  8062. }_createClass(Util, [{ key: "getIsReportData", value: function getIsReportData()
  8063. {
  8064. return isReportData();
  8065. } }, { key: "_applicationShow", value: function _applicationShow()
  8066. {
  8067. if (this.__licationHide) {
  8068. getLastTime();
  8069. var time = getResidenceTime('app');
  8070. if (time.overtime) {
  8071. var options = {
  8072. path: this._lastPageRoute,
  8073. scene: this.statData.sc };
  8074. this._sendReportRequest(options);
  8075. }
  8076. this.__licationHide = false;
  8077. }
  8078. } }, { key: "_applicationHide", value: function _applicationHide(
  8079. self, type) {
  8080. this.__licationHide = true;
  8081. getLastTime();
  8082. var time = getResidenceTime();
  8083. getFirstTime();
  8084. var route = getPageRoute(this);
  8085. this._sendHideRequest({
  8086. urlref: route,
  8087. urlref_ts: time.residenceTime },
  8088. type);
  8089. } }, { key: "_pageShow", value: function _pageShow()
  8090. {
  8091. var route = getPageRoute(this);
  8092. var routepath = getRoute();
  8093. this._navigationBarTitle.config = PagesJson &&
  8094. PagesJson.pages[routepath] &&
  8095. PagesJson.pages[routepath].titleNView &&
  8096. PagesJson.pages[routepath].titleNView.titleText ||
  8097. PagesJson &&
  8098. PagesJson.pages[routepath] &&
  8099. PagesJson.pages[routepath].navigationBarTitleText || '';
  8100. if (this.__licationShow) {
  8101. getFirstTime();
  8102. this.__licationShow = false;
  8103. // console.log('这是 onLauch 之后执行的第一次 pageShow ,为下次记录时间做准备');
  8104. this._lastPageRoute = route;
  8105. return;
  8106. }
  8107. getLastTime();
  8108. this._lastPageRoute = route;
  8109. var time = getResidenceTime('page');
  8110. if (time.overtime) {
  8111. var options = {
  8112. path: this._lastPageRoute,
  8113. scene: this.statData.sc };
  8114. this._sendReportRequest(options);
  8115. }
  8116. getFirstTime();
  8117. } }, { key: "_pageHide", value: function _pageHide()
  8118. {
  8119. if (!this.__licationHide) {
  8120. getLastTime();
  8121. var time = getResidenceTime('page');
  8122. this._sendPageRequest({
  8123. url: this._lastPageRoute,
  8124. urlref: this._lastPageRoute,
  8125. urlref_ts: time.residenceTime });
  8126. this._navigationBarTitle = {
  8127. config: '',
  8128. page: '',
  8129. report: '',
  8130. lt: '' };
  8131. return;
  8132. }
  8133. } }, { key: "_login", value: function _login()
  8134. {
  8135. this._sendEventRequest({
  8136. key: 'login' },
  8137. 0);
  8138. } }, { key: "_share", value: function _share()
  8139. {
  8140. this._sendEventRequest({
  8141. key: 'share' },
  8142. 0);
  8143. } }, { key: "_payment", value: function _payment(
  8144. key) {
  8145. this._sendEventRequest({
  8146. key: key },
  8147. 0);
  8148. } }, { key: "_sendReportRequest", value: function _sendReportRequest(
  8149. options) {
  8150. this._navigationBarTitle.lt = '1';
  8151. var query = options.query && JSON.stringify(options.query) !== '{}' ? '?' + JSON.stringify(options.query) : '';
  8152. this.statData.lt = '1';
  8153. this.statData.url = options.path + query || '';
  8154. this.statData.t = getTime();
  8155. this.statData.sc = getScene(options.scene);
  8156. this.statData.fvts = getFirstVisitTime();
  8157. this.statData.lvts = getLastVisitTime();
  8158. this.statData.tvc = getTotalVisitCount();
  8159. if (getPlatformName() === 'n') {
  8160. this.getProperty();
  8161. } else {
  8162. this.getNetworkInfo();
  8163. }
  8164. } }, { key: "_sendPageRequest", value: function _sendPageRequest(
  8165. opt) {var
  8166. url =
  8167. opt.url,urlref = opt.urlref,urlref_ts = opt.urlref_ts;
  8168. this._navigationBarTitle.lt = '11';
  8169. var options = {
  8170. ak: this.statData.ak,
  8171. uuid: this.statData.uuid,
  8172. lt: '11',
  8173. ut: this.statData.ut,
  8174. url: url,
  8175. tt: this.statData.tt,
  8176. urlref: urlref,
  8177. urlref_ts: urlref_ts,
  8178. ch: this.statData.ch,
  8179. usv: this.statData.usv,
  8180. t: getTime(),
  8181. p: this.statData.p };
  8182. this.request(options);
  8183. } }, { key: "_sendHideRequest", value: function _sendHideRequest(
  8184. opt, type) {var
  8185. urlref =
  8186. opt.urlref,urlref_ts = opt.urlref_ts;
  8187. var options = {
  8188. ak: this.statData.ak,
  8189. uuid: this.statData.uuid,
  8190. lt: '3',
  8191. ut: this.statData.ut,
  8192. urlref: urlref,
  8193. urlref_ts: urlref_ts,
  8194. ch: this.statData.ch,
  8195. usv: this.statData.usv,
  8196. t: getTime(),
  8197. p: this.statData.p };
  8198. this.request(options, type);
  8199. } }, { key: "_sendEventRequest", value: function _sendEventRequest()
  8200. {var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},_ref3$key = _ref3.key,key = _ref3$key === void 0 ? '' : _ref3$key,_ref3$value = _ref3.value,value = _ref3$value === void 0 ? "" : _ref3$value;
  8201. var route = this._lastPageRoute;
  8202. var options = {
  8203. ak: this.statData.ak,
  8204. uuid: this.statData.uuid,
  8205. lt: '21',
  8206. ut: this.statData.ut,
  8207. url: route,
  8208. ch: this.statData.ch,
  8209. e_n: key,
  8210. e_v: typeof value === 'object' ? JSON.stringify(value) : value.toString(),
  8211. usv: this.statData.usv,
  8212. t: getTime(),
  8213. p: this.statData.p };
  8214. this.request(options);
  8215. } }, { key: "getNetworkInfo", value: function getNetworkInfo()
  8216. {var _this = this;
  8217. uni.getNetworkType({
  8218. success: function success(result) {
  8219. _this.statData.net = result.networkType;
  8220. _this.getLocation();
  8221. } });
  8222. } }, { key: "getProperty", value: function getProperty()
  8223. {var _this2 = this;
  8224. plus.runtime.getProperty(plus.runtime.appid, function (wgtinfo) {
  8225. _this2.statData.v = wgtinfo.version || '';
  8226. _this2.getNetworkInfo();
  8227. });
  8228. } }, { key: "getLocation", value: function getLocation()
  8229. {var _this3 = this;
  8230. if (statConfig$1.getLocation) {
  8231. uni.getLocation({
  8232. type: 'wgs84',
  8233. geocode: true,
  8234. success: function success(result) {
  8235. if (result.address) {
  8236. _this3.statData.cn = result.address.country;
  8237. _this3.statData.pn = result.address.province;
  8238. _this3.statData.ct = result.address.city;
  8239. }
  8240. _this3.statData.lat = result.latitude;
  8241. _this3.statData.lng = result.longitude;
  8242. _this3.request(_this3.statData);
  8243. } });
  8244. } else {
  8245. this.statData.lat = 0;
  8246. this.statData.lng = 0;
  8247. this.request(this.statData);
  8248. }
  8249. } }, { key: "request", value: function request(
  8250. data, type) {var _this4 = this;
  8251. var time = getTime();
  8252. var title = this._navigationBarTitle;
  8253. data.ttn = title.page;
  8254. data.ttpj = title.config;
  8255. data.ttc = title.report;
  8256. var requestData = this._reportingRequestData;
  8257. if (getPlatformName() === 'n') {
  8258. requestData = uni.getStorageSync('__UNI__STAT__DATA') || {};
  8259. }
  8260. if (!requestData[data.lt]) {
  8261. requestData[data.lt] = [];
  8262. }
  8263. requestData[data.lt].push(data);
  8264. if (getPlatformName() === 'n') {
  8265. uni.setStorageSync('__UNI__STAT__DATA', requestData);
  8266. }
  8267. if (getPageResidenceTime() < OPERATING_TIME && !type) {
  8268. return;
  8269. }
  8270. var uniStatData = this._reportingRequestData;
  8271. if (getPlatformName() === 'n') {
  8272. uniStatData = uni.getStorageSync('__UNI__STAT__DATA');
  8273. }
  8274. // 时间超过,重新获取时间戳
  8275. setPageResidenceTime();
  8276. var firstArr = [];
  8277. var contentArr = [];
  8278. var lastArr = [];var _loop = function _loop(
  8279. i) {
  8280. var rd = uniStatData[i];
  8281. rd.forEach(function (elm) {
  8282. var newData = getSplicing(elm);
  8283. if (i === 0) {
  8284. firstArr.push(newData);
  8285. } else if (i === 3) {
  8286. lastArr.push(newData);
  8287. } else {
  8288. contentArr.push(newData);
  8289. }
  8290. });};for (var i in uniStatData) {_loop(i);
  8291. }
  8292. firstArr.push.apply(firstArr, contentArr.concat(lastArr));
  8293. var optionsData = {
  8294. usv: STAT_VERSION, //统计 SDK 版本号
  8295. t: time, //发送请求时的时间戮
  8296. requests: JSON.stringify(firstArr) };
  8297. this._reportingRequestData = {};
  8298. if (getPlatformName() === 'n') {
  8299. uni.removeStorageSync('__UNI__STAT__DATA');
  8300. }
  8301. if (data.ut === 'h5') {
  8302. this.imageRequest(optionsData);
  8303. return;
  8304. }
  8305. if (getPlatformName() === 'n' && this.statData.p === 'a') {
  8306. setTimeout(function () {
  8307. _this4._sendRequest(optionsData);
  8308. }, 200);
  8309. return;
  8310. }
  8311. this._sendRequest(optionsData);
  8312. } }, { key: "_sendRequest", value: function _sendRequest(
  8313. optionsData) {var _this5 = this;
  8314. this.getIsReportData().then(function () {
  8315. uni.request({
  8316. url: STAT_URL,
  8317. method: 'POST',
  8318. // header: {
  8319. // 'content-type': 'application/json' // 默认值
  8320. // },
  8321. data: optionsData,
  8322. success: function success() {
  8323. // if (process.env.NODE_ENV === 'development') {
  8324. // console.log('stat request success');
  8325. // }
  8326. },
  8327. fail: function fail(e) {
  8328. if (++_this5._retry < 3) {
  8329. setTimeout(function () {
  8330. _this5._sendRequest(optionsData);
  8331. }, 1000);
  8332. }
  8333. } });
  8334. });
  8335. }
  8336. /**
  8337. * h5 请求
  8338. */ }, { key: "imageRequest", value: function imageRequest(
  8339. data) {
  8340. this.getIsReportData().then(function () {
  8341. var image = new Image();
  8342. var options = getSgin(GetEncodeURIComponentOptions(data)).options;
  8343. image.src = STAT_H5_URL + '?' + options;
  8344. });
  8345. } }, { key: "sendEvent", value: function sendEvent(
  8346. key, value) {
  8347. // 校验 type 参数
  8348. if (calibration(key, value)) return;
  8349. if (key === 'title') {
  8350. this._navigationBarTitle.report = value;
  8351. return;
  8352. }
  8353. this._sendEventRequest({
  8354. key: key,
  8355. value: typeof value === 'object' ? JSON.stringify(value) : value },
  8356. 1);
  8357. } }]);return Util;}();var
  8358. Stat = /*#__PURE__*/function (_Util) {_inherits(Stat, _Util);var _super = _createSuper(Stat);_createClass(Stat, null, [{ key: "getInstance", value: function getInstance()
  8359. {
  8360. if (!this.instance) {
  8361. this.instance = new Stat();
  8362. }
  8363. return this.instance;
  8364. } }]);
  8365. function Stat() {var _this6;_classCallCheck(this, Stat);
  8366. _this6 = _super.call(this);
  8367. _this6.instance = null;
  8368. // 注册拦截器
  8369. if (typeof uni.addInterceptor === 'function' && "development" !== 'development') {
  8370. _this6.addInterceptorInit();
  8371. _this6.interceptLogin();
  8372. _this6.interceptShare(true);
  8373. _this6.interceptRequestPayment();
  8374. }return _this6;
  8375. }_createClass(Stat, [{ key: "addInterceptorInit", value: function addInterceptorInit()
  8376. {
  8377. var self = this;
  8378. uni.addInterceptor('setNavigationBarTitle', {
  8379. invoke: function invoke(args) {
  8380. self._navigationBarTitle.page = args.title;
  8381. } });
  8382. } }, { key: "interceptLogin", value: function interceptLogin()
  8383. {
  8384. var self = this;
  8385. uni.addInterceptor('login', {
  8386. complete: function complete() {
  8387. self._login();
  8388. } });
  8389. } }, { key: "interceptShare", value: function interceptShare(
  8390. type) {
  8391. var self = this;
  8392. if (!type) {
  8393. self._share();
  8394. return;
  8395. }
  8396. uni.addInterceptor('share', {
  8397. success: function success() {
  8398. self._share();
  8399. },
  8400. fail: function fail() {
  8401. self._share();
  8402. } });
  8403. } }, { key: "interceptRequestPayment", value: function interceptRequestPayment()
  8404. {
  8405. var self = this;
  8406. uni.addInterceptor('requestPayment', {
  8407. success: function success() {
  8408. self._payment('pay_success');
  8409. },
  8410. fail: function fail() {
  8411. self._payment('pay_fail');
  8412. } });
  8413. } }, { key: "report", value: function report(
  8414. options, self) {
  8415. this.self = self;
  8416. // if (process.env.NODE_ENV === 'development') {
  8417. // console.log('report init');
  8418. // }
  8419. setPageResidenceTime();
  8420. this.__licationShow = true;
  8421. this._sendReportRequest(options, true);
  8422. } }, { key: "load", value: function load(
  8423. options, self) {
  8424. if (!self.$scope && !self.$mp) {
  8425. var page = getCurrentPages();
  8426. self.$scope = page[page.length - 1];
  8427. }
  8428. this.self = self;
  8429. this._query = options;
  8430. } }, { key: "show", value: function show(
  8431. self) {
  8432. this.self = self;
  8433. if (getPageTypes(self)) {
  8434. this._pageShow(self);
  8435. } else {
  8436. this._applicationShow(self);
  8437. }
  8438. } }, { key: "ready", value: function ready(
  8439. self) {
  8440. // this.self = self;
  8441. // if (getPageTypes(self)) {
  8442. // this._pageShow(self);
  8443. // }
  8444. } }, { key: "hide", value: function hide(
  8445. self) {
  8446. this.self = self;
  8447. if (getPageTypes(self)) {
  8448. this._pageHide(self);
  8449. } else {
  8450. this._applicationHide(self, true);
  8451. }
  8452. } }, { key: "error", value: function error(
  8453. em) {
  8454. if (this._platform === 'devtools') {
  8455. if (true) {
  8456. console.info('当前运行环境为开发者工具,不上报数据。');
  8457. }
  8458. // return;
  8459. }
  8460. var emVal = '';
  8461. if (!em.message) {
  8462. emVal = JSON.stringify(em);
  8463. } else {
  8464. emVal = em.stack;
  8465. }
  8466. var options = {
  8467. ak: this.statData.ak,
  8468. uuid: this.statData.uuid,
  8469. lt: '31',
  8470. ut: this.statData.ut,
  8471. ch: this.statData.ch,
  8472. mpsdk: this.statData.mpsdk,
  8473. mpv: this.statData.mpv,
  8474. v: this.statData.v,
  8475. em: emVal,
  8476. usv: this.statData.usv,
  8477. t: getTime(),
  8478. p: this.statData.p };
  8479. this.request(options);
  8480. } }]);return Stat;}(Util);
  8481. var stat = Stat.getInstance();
  8482. var isHide = false;
  8483. var lifecycle = {
  8484. onLaunch: function onLaunch(options) {
  8485. stat.report(options, this);
  8486. },
  8487. onReady: function onReady() {
  8488. stat.ready(this);
  8489. },
  8490. onLoad: function onLoad(options) {
  8491. stat.load(options, this);
  8492. // 重写分享,获取分享上报事件
  8493. if (this.$scope && this.$scope.onShareAppMessage) {
  8494. var oldShareAppMessage = this.$scope.onShareAppMessage;
  8495. this.$scope.onShareAppMessage = function (options) {
  8496. stat.interceptShare(false);
  8497. return oldShareAppMessage.call(this, options);
  8498. };
  8499. }
  8500. },
  8501. onShow: function onShow() {
  8502. isHide = false;
  8503. stat.show(this);
  8504. },
  8505. onHide: function onHide() {
  8506. isHide = true;
  8507. stat.hide(this);
  8508. },
  8509. onUnload: function onUnload() {
  8510. if (isHide) {
  8511. isHide = false;
  8512. return;
  8513. }
  8514. stat.hide(this);
  8515. },
  8516. onError: function onError(e) {
  8517. stat.error(e);
  8518. } };
  8519. function main() {
  8520. if (true) {
  8521. uni.report = function (type, options) {};
  8522. } else { var Vue; }
  8523. }
  8524. main();
  8525. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  8526. /***/ }),
  8527. /* 7 */
  8528. /*!******************************************************!*\
  8529. !*** ./node_modules/@dcloudio/uni-stat/package.json ***!
  8530. \******************************************************/
  8531. /*! exports provided: _from, _id, _inBundle, _integrity, _location, _phantomChildren, _requested, _requiredBy, _resolved, _shasum, _spec, _where, author, bugs, bundleDependencies, deprecated, description, devDependencies, files, gitHead, homepage, license, main, name, repository, scripts, version, default */
  8532. /***/ (function(module) {
  8533. module.exports = JSON.parse("{\"_from\":\"@dcloudio/uni-stat@next\",\"_id\":\"@dcloudio/uni-stat@2.0.0-32920211119001\",\"_inBundle\":false,\"_integrity\":\"sha512-ZHsT433Njrg7gU6pQSyxf3NQCRAgFPqW6pC3Tym6aeKomAAuMofJIkes4vVv2HtYLwvphknU8NJK7dXwvEBtgA==\",\"_location\":\"/@dcloudio/uni-stat\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"tag\",\"registry\":true,\"raw\":\"@dcloudio/uni-stat@next\",\"name\":\"@dcloudio/uni-stat\",\"escapedName\":\"@dcloudio%2funi-stat\",\"scope\":\"@dcloudio\",\"rawSpec\":\"next\",\"saveSpec\":null,\"fetchSpec\":\"next\"},\"_requiredBy\":[\"#USER\",\"/\",\"/@dcloudio/vue-cli-plugin-uni\"],\"_resolved\":\"https://registry.npmjs.org/@dcloudio/uni-stat/-/uni-stat-2.0.0-32920211119001.tgz\",\"_shasum\":\"907715d9a9802a619f81d05b03c8a8665436c5dc\",\"_spec\":\"@dcloudio/uni-stat@next\",\"_where\":\"/Users/guoshengqiang/Documents/dcloud-plugins-new/release/uniapp-cli\",\"author\":\"\",\"bugs\":{\"url\":\"https://github.com/dcloudio/uni-app/issues\"},\"bundleDependencies\":false,\"deprecated\":false,\"description\":\"\",\"devDependencies\":{\"@babel/core\":\"^7.5.5\",\"@babel/preset-env\":\"^7.5.5\",\"eslint\":\"^6.1.0\",\"rollup\":\"^1.19.3\",\"rollup-plugin-babel\":\"^4.3.3\",\"rollup-plugin-clear\":\"^2.0.7\",\"rollup-plugin-commonjs\":\"^10.0.2\",\"rollup-plugin-copy\":\"^3.1.0\",\"rollup-plugin-eslint\":\"^7.0.0\",\"rollup-plugin-json\":\"^4.0.0\",\"rollup-plugin-node-resolve\":\"^5.2.0\",\"rollup-plugin-replace\":\"^2.2.0\",\"rollup-plugin-uglify\":\"^6.0.2\"},\"files\":[\"dist\",\"package.json\",\"LICENSE\"],\"gitHead\":\"330826b26bcda49d88f01d8da04ab470a0772d45\",\"homepage\":\"https://github.com/dcloudio/uni-app#readme\",\"license\":\"Apache-2.0\",\"main\":\"dist/index.js\",\"name\":\"@dcloudio/uni-stat\",\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/dcloudio/uni-app.git\",\"directory\":\"packages/uni-stat\"},\"scripts\":{\"build\":\"NODE_ENV=production rollup -c rollup.config.js\",\"dev\":\"NODE_ENV=development rollup -w -c rollup.config.js\"},\"version\":\"2.0.0-32920211119001\"}");
  8534. /***/ }),
  8535. /* 8 */
  8536. /*!***********************************************************************!*\
  8537. !*** D:/zheng_dev2021/caimei-applets-hehe/pages.json?{"type":"stat"} ***!
  8538. \***********************************************************************/
  8539. /*! no static exports found */
  8540. /***/ (function(module, exports, __webpack_require__) {
  8541. "use strict";
  8542. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = { "appid": "__UNI__1EA8401" };exports.default = _default;
  8543. /***/ }),
  8544. /* 9 */
  8545. /*!************************************************************************!*\
  8546. !*** D:/zheng_dev2021/caimei-applets-hehe/pages.json?{"type":"style"} ***!
  8547. \************************************************************************/
  8548. /*! no static exports found */
  8549. /***/ (function(module, exports, __webpack_require__) {
  8550. "use strict";
  8551. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = { "pages": { "pages/tabBar/index/index": { "navigationBarTitleText": "呵呵商城", "enablePullDownRefresh": true, "backgroundColor": "#F952B7", "navigationBarBackgroundColor": "#F952B7", "navigationBarTextStyle": "white", "usingComponents": { "banner": "/components/cm-module/homeIndex/banner", "cm-active-popup": "/components/cm-module/cm-active-popup/cm-active-popup", "cm-selector-coupons": "/components/cm-module/cm-selector-coupons/cm-selector-coupons", "cm-product": "/components/cm-module/cm-product/cm-product" }, "usingAutoImportComponents": { "tui-skeleton": "/components/thorui/tui-skeleton/tui-skeleton", "scroll-top": "/components/cm-module/scrollTop/scrollTop" } }, "pages/tabBar/cart/index": { "navigationBarTitleText": "购物车", "enablePullDownRefresh": true, "usingComponents": { "cm-coupon-list": "/components/cm-module/cm-coupon-list/cm-coupon-list", "cm-drawer": "/components/cm-module/cm-drawer/cm-drawer", "cm-cart-product": "/components/cm-module/cm-cart-product/cm-cart-product", "cm-empty": "/components/cm-module/cm-empty/cm-empty" }, "usingAutoImportComponents": { "tui-skeleton": "/components/thorui/tui-skeleton/tui-skeleton", "tui-modal": "/components/thorui/tui-modal/tui-modal" } }, "pages/tabBar/user/index": { "navigationBarTitleText": "个人中心", "enablePullDownRefresh": true, "usingComponents": { "nut-badge": "/components/thorui/tui-badge/tui-badge" }, "usingAutoImportComponents": { "tui-badge": "/components/thorui/tui-badge/tui-badge" } }, "pages/authorize/authorize": { "navigationBarTitleText": "微信授权", "usingComponents": {}, "usingAutoImportComponents": {} }, "pages/login/login": { "navigationBarTitleText": "登录", "usingComponents": { "cm-loading": "/components/cm-module/cm-loading/cm-loading" }, "usingAutoImportComponents": {} }, "pages/goods/list": { "navigationBarTitleText": "立即下单", "usingComponents": { "product-list": "/components/cm-module/listTemplate/productList" }, "usingAutoImportComponents": {} }, "pages/goods/cart": { "navigationBarTitleText": "购物车", "enablePullDownRefresh": true, "navigationStyle": "custom", "usingComponents": { "cm-coupon-list": "/components/cm-module/cm-coupon-list/cm-coupon-list", "cm-drawer": "/components/cm-module/cm-drawer/cm-drawer", "cm-cart-product": "/components/cm-module/cm-cart-product/cm-cart-product", "header-cart": "/components/cm-module/headerNavbar/header-cart", "cm-empty": "/components/cm-module/cm-empty/cm-empty" }, "usingAutoImportComponents": { "tui-skeleton": "/components/thorui/tui-skeleton/tui-skeleton", "tui-modal": "/components/thorui/tui-modal/tui-modal" } }, "pages/goods/search": { "navigationBarTitleText": "搜索", "usingComponents": { "modal-layer": "/components/cm-module/modal-layer/modal-layer" }, "usingAutoImportComponents": { "tui-modal": "/components/thorui/tui-modal/tui-modal" } }, "pages/goods/product-detail": { "navigationBarTitleText": "商品详情", "usingComponents": { "parser": "/components/jyf-Parser/index", "cm-product-price": "/components/cm-module/cm-product-price/cm-product-price", "cm-product-info": "/components/cm-module/cm-product-info/cm-product-info", "cm-coupon-list": "/components/cm-module/cm-coupon-list/cm-coupon-list", "cm-product-params": "/components/cm-module/cm-product-params/cm-product-params", "cm-goods-nav": "/components/cm-module/cm-goods-nav/cm-goods-nav" }, "usingAutoImportComponents": { "tui-skeleton": "/components/thorui/tui-skeleton/tui-skeleton", "tui-tabs": "/components/thorui/tui-tabs/tui-tabs", "uni-swiper-dot": "/components/uni-components/uni-swiper-dot/uni-swiper-dot", "tui-scroll-top": "/components/thorui/tui-scroll-top/tui-scroll-top" } }, "pages/goods/goods-floorMore": { "navigationBarTitleText": "商品列表", "enablePullDownRefresh": true, "usingComponents": { "cm-product": "/components/cm-module/cm-product/cm-product" }, "usingAutoImportComponents": { "tui-skeleton": "/components/thorui/tui-skeleton/tui-skeleton", "tui-loadmore": "/components/thorui/tui-loadmore/tui-loadmore", "tui-nomore": "/components/thorui/tui-nomore/tui-nomore", "scroll-top": "/components/cm-module/scrollTop/scrollTop" } }, "pages/goods/goods-coupon-list": { "navigationBarTitleText": "优惠券商品列表", "enablePullDownRefresh": true, "usingComponents": { "cm-empty": "/components/cm-module/cm-empty/cm-empty", "sui-search": "/components/sui-search/sui-search", "cm-product": "/components/cm-module/cm-product/cm-product", "cm-drag": "/components/cm-module/cm-drag/cm-drag" }, "usingAutoImportComponents": { "tui-skeleton": "/components/thorui/tui-skeleton/tui-skeleton", "sui-search": "/components/sui-search/sui-search", "tui-loadmore": "/components/thorui/tui-loadmore/tui-loadmore", "tui-nomore": "/components/thorui/tui-nomore/tui-nomore", "scroll-top": "/components/cm-module/scrollTop/scrollTop" } }, "pages/goods/goods-coupon-list-search": { "navigationBarTitleText": "搜索", "usingComponents": { "sui-search": "/components/sui-search/sui-search", "cm-empty": "/components/cm-module/cm-empty/cm-empty", "cm-drag": "/components/cm-module/cm-drag/cm-drag" }, "usingAutoImportComponents": { "sui-search": "/components/sui-search/sui-search", "tui-loadmore": "/components/thorui/tui-loadmore/tui-loadmore", "tui-nomore": "/components/thorui/tui-nomore/tui-nomore", "scroll-top": "/components/cm-module/scrollTop/scrollTop", "tui-modal": "/components/thorui/tui-modal/tui-modal" } }, "pages/user/address/addressManage": { "navigationBarTitleText": "添加新地址", "usingComponents": { "city-picker": "/components/mpvue-citypicker/mpvueCityPicker" }, "usingAutoImportComponents": {} }, "pages/user/address/address": { "navigationBarTitleText": "地址列表", "enablePullDownRefresh": true, "onReachBottomDistance": 50, "usingComponents": {}, "usingAutoImportComponents": { "tui-modal": "/components/thorui/tui-modal/tui-modal" } }, "pages/user/order/create-order": { "navigationBarTitleText": "确认订单", "usingComponents": { "choice-address": "/components/cm-module/createOrder/address", "goods-list": "/components/cm-module/createOrder/goodsList", "seller-freight": "/components/cm-module/createOrder/sellerFreight", "cm-coupon-list": "/components/cm-module/cm-coupon-list/cm-coupon-list", "cm-loading": "/components/cm-module/cm-loading/cm-loading" }, "usingAutoImportComponents": { "tui-skeleton": "/components/thorui/tui-skeleton/tui-skeleton" } }, "pages/user/order/success": { "navigationBarTitleText": "支付结果", "navigationStyle": "custom", "usingComponents": { "header-pay": "/components/cm-module/headerNavbar/header-pay", "cm-loading": "/components/cm-module/cm-loading/cm-loading" }, "usingAutoImportComponents": {} }, "pages/user/order/error": { "navigationBarTitleText": "支付结果", "navigationStyle": "custom", "usingComponents": { "header-pay": "/components/cm-module/headerNavbar/header-pay", "cm-loading": "/components/cm-module/cm-loading/cm-loading" }, "usingAutoImportComponents": {} }, "pages/user/order/order-list": { "navigationBarTitleText": "我的订单", "navigationStyle": "custom", "usingComponents": { "header-order": "/components/cm-module/headerNavbar/header-order", "empty": "/components/cm-module/empty/empty", "order-button": "/components/cm-module/orderDetails/orderListButton", "modal-layer": "/components/cm-module/modal-layer/modal-layer", "cm-loading": "/components/cm-module/cm-loading/cm-loading" }, "usingAutoImportComponents": { "tui-skeleton": "/components/thorui/tui-skeleton/tui-skeleton", "tui-loadmore": "/components/thorui/tui-loadmore/tui-loadmore", "tui-nomore": "/components/thorui/tui-nomore/tui-nomore", "tui-modal": "/components/thorui/tui-modal/tui-modal" } }, "pages/user/order/order-list-retail": { "navigationBarTitleText": "我的订单", "navigationStyle": "custom", "usingComponents": { "header-order": "/components/cm-module/headerNavbar/header-order", "empty": "/components/cm-module/empty/empty", "order-button": "/components/cm-module/orderDetails/orderListButton", "modal-layer": "/components/cm-module/modal-layer/modal-layer", "cm-loading": "/components/cm-module/cm-loading/cm-loading" }, "usingAutoImportComponents": { "tui-skeleton": "/components/thorui/tui-skeleton/tui-skeleton", "tui-loadmore": "/components/thorui/tui-loadmore/tui-loadmore", "tui-nomore": "/components/thorui/tui-nomore/tui-nomore", "tui-modal": "/components/thorui/tui-modal/tui-modal" } }, "pages/user/order/order-details": { "navigationBarTitleText": "订单详情", "navigationStyle": "custom", "usingComponents": { "header-order": "/components/cm-module/headerNavbar/header-order", "order-information": "/components/cm-module/orderDetails/orderInformation", "order-address": "/components/cm-module/orderDetails/orderAddress", "goods-list": "/components/cm-module/orderDetails/goodsList", "cm-loading": "/components/cm-module/cm-loading/cm-loading", "transfe-record": "/components/cm-module/orderDetails/transfeRecord", "payment-record": "/components/cm-module/orderDetails/paymentRecord", "refund-record": "/components/cm-module/orderDetails/refundRecord", "order-button": "/components/cm-module/orderDetails/orderButton" }, "usingAutoImportComponents": { "tui-modal": "/components/thorui/tui-modal/tui-modal" } }, "pages/user/order/order-payment": { "navigationBarTitleText": "收银台", "navigationStyle": "custom", "usingComponents": { "header-payment": "/components/cm-module/headerNavbar/header-payment" }, "usingAutoImportComponents": {} }, "pages/user/order/search-order": { "navigationBarTitleText": "订单搜索", "usingComponents": { "order-button": "/components/cm-module/orderDetails/orderListButton", "empty": "/components/cm-module/empty/empty", "cm-loading": "/components/cm-module/cm-loading/cm-loading" }, "usingAutoImportComponents": { "tui-loadmore": "/components/thorui/tui-loadmore/tui-loadmore", "tui-nomore": "/components/thorui/tui-nomore/tui-nomore", "tui-modal": "/components/thorui/tui-modal/tui-modal" } }, "pages/user/order/order-logistics": { "navigationBarTitleText": "物流信息", "usingComponents": {}, "usingAutoImportComponents": {} }, "pages/user/activity/activity": { "navigationBarTitleText": "活动详情", "enablePullDownRefresh": true, "backgroundColor": "#ff457b", "backgroundTextStyle": "light", "onReachBottomDistance": 50, "usingComponents": { "cm-drag": "/components/cm-module/cm-drag/cm-drag" }, "usingAutoImportComponents": { "tui-skeleton": "/components/thorui/tui-skeleton/tui-skeleton", "tui-loadmore": "/components/thorui/tui-loadmore/tui-loadmore", "tui-nomore": "/components/thorui/tui-nomore/tui-nomore" } }, "pages/user/activity/activity-list": { "navigationBarTitleText": "活动专区", "enablePullDownRefresh": true, "onReachBottomDistance": 50, "usingComponents": {}, "usingAutoImportComponents": { "tui-skeleton": "/components/thorui/tui-skeleton/tui-skeleton", "tui-loadmore": "/components/thorui/tui-loadmore/tui-loadmore", "tui-nomore": "/components/thorui/tui-nomore/tui-nomore" } }, "pages/user/activity/coupon-find-list": { "navigationBarTitleText": "领券中心", "usingComponents": { "message-popup": "/components/message-popup/message-popup", "cm-coupon": "/components/cm-module/cm-coupon/cm-coupon", "cm-empty": "/components/cm-module/cm-empty/cm-empty", "cm-drawer": "/components/cm-module/cm-drawer/cm-drawer" }, "usingAutoImportComponents": { "tui-skeleton": "/components/thorui/tui-skeleton/tui-skeleton", "tui-loadmore": "/components/thorui/tui-loadmore/tui-loadmore", "tui-nomore": "/components/thorui/tui-nomore/tui-nomore", "scroll-top": "/components/cm-module/scrollTop/scrollTop", "message-popup": "/components/message-popup/message-popup" } }, "pages/user/activity/coupon-list": { "navigationBarTitleText": "优惠券", "usingComponents": { "cm-coupon": "/components/cm-module/cm-coupon/cm-coupon", "cm-empty": "/components/cm-module/cm-empty/cm-empty" }, "usingAutoImportComponents": { "tui-skeleton": "/components/thorui/tui-skeleton/tui-skeleton", "tui-tabs": "/components/thorui/tui-tabs/tui-tabs", "tui-loadmore": "/components/thorui/tui-loadmore/tui-loadmore", "tui-nomore": "/components/thorui/tui-nomore/tui-nomore" } }, "pages/goods/good-floorMore": { "navigationBarTitleText": "商品列表", "enablePullDownRefresh": true } }, "globalStyle": { "navigationBarTextStyle": "black", "navigationBarTitleText": "呵呵商城", "navigationBarBackgroundColor": "#FFFFFF", "backgroundColor": "#FFFFFF" } };exports.default = _default;
  8552. /***/ }),
  8553. /* 10 */
  8554. /*!***********************************************************!*\
  8555. !*** D:/zheng_dev2021/caimei-applets-hehe/store/index.js ***!
  8556. \***********************************************************/
  8557. /*! no static exports found */
  8558. /***/ (function(module, exports, __webpack_require__) {
  8559. "use strict";
  8560. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 3));
  8561. var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 11));
  8562. var _getters = _interopRequireDefault(__webpack_require__(/*! ./getters */ 12));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  8563. _vue.default.use(_vuex.default);
  8564. // https://webpack.js.org/guides/dependency-management/#requirecontext
  8565. var modulesFiles = __webpack_require__(13);
  8566. // you do not need `import app from './modules/app'`
  8567. // it will auto require all vuex module from modules file
  8568. var modules = modulesFiles.keys().reduce(function (modules, modulePath) {
  8569. // set './app.js' => 'app'
  8570. var moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1');
  8571. var value = modulesFiles(modulePath);
  8572. modules[moduleName] = value.default;
  8573. return modules;
  8574. }, {});
  8575. var store = new _vuex.default.Store({
  8576. modules: modules,
  8577. getters: _getters.default });var _default =
  8578. store;exports.default = _default;
  8579. /***/ }),
  8580. /* 11 */
  8581. /*!**************************************************************************************!*\
  8582. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vuex3/dist/vuex.common.js ***!
  8583. \**************************************************************************************/
  8584. /*! no static exports found */
  8585. /***/ (function(module, exports, __webpack_require__) {
  8586. "use strict";
  8587. /* WEBPACK VAR INJECTION */(function(global) {/*!
  8588. * vuex v3.6.2
  8589. * (c) 2021 Evan You
  8590. * @license MIT
  8591. */
  8592. function applyMixin (Vue) {
  8593. var version = Number(Vue.version.split('.')[0]);
  8594. if (version >= 2) {
  8595. Vue.mixin({ beforeCreate: vuexInit });
  8596. } else {
  8597. // override init and inject vuex init procedure
  8598. // for 1.x backwards compatibility.
  8599. var _init = Vue.prototype._init;
  8600. Vue.prototype._init = function (options) {
  8601. if ( options === void 0 ) options = {};
  8602. options.init = options.init
  8603. ? [vuexInit].concat(options.init)
  8604. : vuexInit;
  8605. _init.call(this, options);
  8606. };
  8607. }
  8608. /**
  8609. * Vuex init hook, injected into each instances init hooks list.
  8610. */
  8611. function vuexInit () {
  8612. var options = this.$options;
  8613. // store injection
  8614. if (options.store) {
  8615. this.$store = typeof options.store === 'function'
  8616. ? options.store()
  8617. : options.store;
  8618. } else if (options.parent && options.parent.$store) {
  8619. this.$store = options.parent.$store;
  8620. }
  8621. }
  8622. }
  8623. var target = typeof window !== 'undefined'
  8624. ? window
  8625. : typeof global !== 'undefined'
  8626. ? global
  8627. : {};
  8628. var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  8629. function devtoolPlugin (store) {
  8630. if (!devtoolHook) { return }
  8631. store._devtoolHook = devtoolHook;
  8632. devtoolHook.emit('vuex:init', store);
  8633. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  8634. store.replaceState(targetState);
  8635. });
  8636. store.subscribe(function (mutation, state) {
  8637. devtoolHook.emit('vuex:mutation', mutation, state);
  8638. }, { prepend: true });
  8639. store.subscribeAction(function (action, state) {
  8640. devtoolHook.emit('vuex:action', action, state);
  8641. }, { prepend: true });
  8642. }
  8643. /**
  8644. * Get the first item that pass the test
  8645. * by second argument function
  8646. *
  8647. * @param {Array} list
  8648. * @param {Function} f
  8649. * @return {*}
  8650. */
  8651. function find (list, f) {
  8652. return list.filter(f)[0]
  8653. }
  8654. /**
  8655. * Deep copy the given object considering circular structure.
  8656. * This function caches all nested objects and its copies.
  8657. * If it detects circular structure, use cached copy to avoid infinite loop.
  8658. *
  8659. * @param {*} obj
  8660. * @param {Array<Object>} cache
  8661. * @return {*}
  8662. */
  8663. function deepCopy (obj, cache) {
  8664. if ( cache === void 0 ) cache = [];
  8665. // just return if obj is immutable value
  8666. if (obj === null || typeof obj !== 'object') {
  8667. return obj
  8668. }
  8669. // if obj is hit, it is in circular structure
  8670. var hit = find(cache, function (c) { return c.original === obj; });
  8671. if (hit) {
  8672. return hit.copy
  8673. }
  8674. var copy = Array.isArray(obj) ? [] : {};
  8675. // put the copy into cache at first
  8676. // because we want to refer it in recursive deepCopy
  8677. cache.push({
  8678. original: obj,
  8679. copy: copy
  8680. });
  8681. Object.keys(obj).forEach(function (key) {
  8682. copy[key] = deepCopy(obj[key], cache);
  8683. });
  8684. return copy
  8685. }
  8686. /**
  8687. * forEach for object
  8688. */
  8689. function forEachValue (obj, fn) {
  8690. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  8691. }
  8692. function isObject (obj) {
  8693. return obj !== null && typeof obj === 'object'
  8694. }
  8695. function isPromise (val) {
  8696. return val && typeof val.then === 'function'
  8697. }
  8698. function assert (condition, msg) {
  8699. if (!condition) { throw new Error(("[vuex] " + msg)) }
  8700. }
  8701. function partial (fn, arg) {
  8702. return function () {
  8703. return fn(arg)
  8704. }
  8705. }
  8706. // Base data struct for store's module, package with some attribute and method
  8707. var Module = function Module (rawModule, runtime) {
  8708. this.runtime = runtime;
  8709. // Store some children item
  8710. this._children = Object.create(null);
  8711. // Store the origin module object which passed by programmer
  8712. this._rawModule = rawModule;
  8713. var rawState = rawModule.state;
  8714. // Store the origin module's state
  8715. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  8716. };
  8717. var prototypeAccessors = { namespaced: { configurable: true } };
  8718. prototypeAccessors.namespaced.get = function () {
  8719. return !!this._rawModule.namespaced
  8720. };
  8721. Module.prototype.addChild = function addChild (key, module) {
  8722. this._children[key] = module;
  8723. };
  8724. Module.prototype.removeChild = function removeChild (key) {
  8725. delete this._children[key];
  8726. };
  8727. Module.prototype.getChild = function getChild (key) {
  8728. return this._children[key]
  8729. };
  8730. Module.prototype.hasChild = function hasChild (key) {
  8731. return key in this._children
  8732. };
  8733. Module.prototype.update = function update (rawModule) {
  8734. this._rawModule.namespaced = rawModule.namespaced;
  8735. if (rawModule.actions) {
  8736. this._rawModule.actions = rawModule.actions;
  8737. }
  8738. if (rawModule.mutations) {
  8739. this._rawModule.mutations = rawModule.mutations;
  8740. }
  8741. if (rawModule.getters) {
  8742. this._rawModule.getters = rawModule.getters;
  8743. }
  8744. };
  8745. Module.prototype.forEachChild = function forEachChild (fn) {
  8746. forEachValue(this._children, fn);
  8747. };
  8748. Module.prototype.forEachGetter = function forEachGetter (fn) {
  8749. if (this._rawModule.getters) {
  8750. forEachValue(this._rawModule.getters, fn);
  8751. }
  8752. };
  8753. Module.prototype.forEachAction = function forEachAction (fn) {
  8754. if (this._rawModule.actions) {
  8755. forEachValue(this._rawModule.actions, fn);
  8756. }
  8757. };
  8758. Module.prototype.forEachMutation = function forEachMutation (fn) {
  8759. if (this._rawModule.mutations) {
  8760. forEachValue(this._rawModule.mutations, fn);
  8761. }
  8762. };
  8763. Object.defineProperties( Module.prototype, prototypeAccessors );
  8764. var ModuleCollection = function ModuleCollection (rawRootModule) {
  8765. // register root module (Vuex.Store options)
  8766. this.register([], rawRootModule, false);
  8767. };
  8768. ModuleCollection.prototype.get = function get (path) {
  8769. return path.reduce(function (module, key) {
  8770. return module.getChild(key)
  8771. }, this.root)
  8772. };
  8773. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  8774. var module = this.root;
  8775. return path.reduce(function (namespace, key) {
  8776. module = module.getChild(key);
  8777. return namespace + (module.namespaced ? key + '/' : '')
  8778. }, '')
  8779. };
  8780. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  8781. update([], this.root, rawRootModule);
  8782. };
  8783. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  8784. var this$1 = this;
  8785. if ( runtime === void 0 ) runtime = true;
  8786. if ((true)) {
  8787. assertRawModule(path, rawModule);
  8788. }
  8789. var newModule = new Module(rawModule, runtime);
  8790. if (path.length === 0) {
  8791. this.root = newModule;
  8792. } else {
  8793. var parent = this.get(path.slice(0, -1));
  8794. parent.addChild(path[path.length - 1], newModule);
  8795. }
  8796. // register nested modules
  8797. if (rawModule.modules) {
  8798. forEachValue(rawModule.modules, function (rawChildModule, key) {
  8799. this$1.register(path.concat(key), rawChildModule, runtime);
  8800. });
  8801. }
  8802. };
  8803. ModuleCollection.prototype.unregister = function unregister (path) {
  8804. var parent = this.get(path.slice(0, -1));
  8805. var key = path[path.length - 1];
  8806. var child = parent.getChild(key);
  8807. if (!child) {
  8808. if ((true)) {
  8809. console.warn(
  8810. "[vuex] trying to unregister module '" + key + "', which is " +
  8811. "not registered"
  8812. );
  8813. }
  8814. return
  8815. }
  8816. if (!child.runtime) {
  8817. return
  8818. }
  8819. parent.removeChild(key);
  8820. };
  8821. ModuleCollection.prototype.isRegistered = function isRegistered (path) {
  8822. var parent = this.get(path.slice(0, -1));
  8823. var key = path[path.length - 1];
  8824. if (parent) {
  8825. return parent.hasChild(key)
  8826. }
  8827. return false
  8828. };
  8829. function update (path, targetModule, newModule) {
  8830. if ((true)) {
  8831. assertRawModule(path, newModule);
  8832. }
  8833. // update target module
  8834. targetModule.update(newModule);
  8835. // update nested modules
  8836. if (newModule.modules) {
  8837. for (var key in newModule.modules) {
  8838. if (!targetModule.getChild(key)) {
  8839. if ((true)) {
  8840. console.warn(
  8841. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  8842. 'manual reload is needed'
  8843. );
  8844. }
  8845. return
  8846. }
  8847. update(
  8848. path.concat(key),
  8849. targetModule.getChild(key),
  8850. newModule.modules[key]
  8851. );
  8852. }
  8853. }
  8854. }
  8855. var functionAssert = {
  8856. assert: function (value) { return typeof value === 'function'; },
  8857. expected: 'function'
  8858. };
  8859. var objectAssert = {
  8860. assert: function (value) { return typeof value === 'function' ||
  8861. (typeof value === 'object' && typeof value.handler === 'function'); },
  8862. expected: 'function or object with "handler" function'
  8863. };
  8864. var assertTypes = {
  8865. getters: functionAssert,
  8866. mutations: functionAssert,
  8867. actions: objectAssert
  8868. };
  8869. function assertRawModule (path, rawModule) {
  8870. Object.keys(assertTypes).forEach(function (key) {
  8871. if (!rawModule[key]) { return }
  8872. var assertOptions = assertTypes[key];
  8873. forEachValue(rawModule[key], function (value, type) {
  8874. assert(
  8875. assertOptions.assert(value),
  8876. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  8877. );
  8878. });
  8879. });
  8880. }
  8881. function makeAssertionMessage (path, key, type, value, expected) {
  8882. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  8883. if (path.length > 0) {
  8884. buf += " in module \"" + (path.join('.')) + "\"";
  8885. }
  8886. buf += " is " + (JSON.stringify(value)) + ".";
  8887. return buf
  8888. }
  8889. var Vue; // bind on install
  8890. var Store = function Store (options) {
  8891. var this$1 = this;
  8892. if ( options === void 0 ) options = {};
  8893. // Auto install if it is not done yet and `window` has `Vue`.
  8894. // To allow users to avoid auto-installation in some cases,
  8895. // this code should be placed here. See #731
  8896. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  8897. install(window.Vue);
  8898. }
  8899. if ((true)) {
  8900. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  8901. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  8902. assert(this instanceof Store, "store must be called with the new operator.");
  8903. }
  8904. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  8905. var strict = options.strict; if ( strict === void 0 ) strict = false;
  8906. // store internal state
  8907. this._committing = false;
  8908. this._actions = Object.create(null);
  8909. this._actionSubscribers = [];
  8910. this._mutations = Object.create(null);
  8911. this._wrappedGetters = Object.create(null);
  8912. this._modules = new ModuleCollection(options);
  8913. this._modulesNamespaceMap = Object.create(null);
  8914. this._subscribers = [];
  8915. this._watcherVM = new Vue();
  8916. this._makeLocalGettersCache = Object.create(null);
  8917. // bind commit and dispatch to self
  8918. var store = this;
  8919. var ref = this;
  8920. var dispatch = ref.dispatch;
  8921. var commit = ref.commit;
  8922. this.dispatch = function boundDispatch (type, payload) {
  8923. return dispatch.call(store, type, payload)
  8924. };
  8925. this.commit = function boundCommit (type, payload, options) {
  8926. return commit.call(store, type, payload, options)
  8927. };
  8928. // strict mode
  8929. this.strict = strict;
  8930. var state = this._modules.root.state;
  8931. // init root module.
  8932. // this also recursively registers all sub-modules
  8933. // and collects all module getters inside this._wrappedGetters
  8934. installModule(this, state, [], this._modules.root);
  8935. // initialize the store vm, which is responsible for the reactivity
  8936. // (also registers _wrappedGetters as computed properties)
  8937. resetStoreVM(this, state);
  8938. // apply plugins
  8939. plugins.forEach(function (plugin) { return plugin(this$1); });
  8940. var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
  8941. if (useDevtools) {
  8942. devtoolPlugin(this);
  8943. }
  8944. };
  8945. var prototypeAccessors$1 = { state: { configurable: true } };
  8946. prototypeAccessors$1.state.get = function () {
  8947. return this._vm._data.$$state
  8948. };
  8949. prototypeAccessors$1.state.set = function (v) {
  8950. if ((true)) {
  8951. assert(false, "use store.replaceState() to explicit replace store state.");
  8952. }
  8953. };
  8954. Store.prototype.commit = function commit (_type, _payload, _options) {
  8955. var this$1 = this;
  8956. // check object-style commit
  8957. var ref = unifyObjectStyle(_type, _payload, _options);
  8958. var type = ref.type;
  8959. var payload = ref.payload;
  8960. var options = ref.options;
  8961. var mutation = { type: type, payload: payload };
  8962. var entry = this._mutations[type];
  8963. if (!entry) {
  8964. if ((true)) {
  8965. console.error(("[vuex] unknown mutation type: " + type));
  8966. }
  8967. return
  8968. }
  8969. this._withCommit(function () {
  8970. entry.forEach(function commitIterator (handler) {
  8971. handler(payload);
  8972. });
  8973. });
  8974. this._subscribers
  8975. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  8976. .forEach(function (sub) { return sub(mutation, this$1.state); });
  8977. if (
  8978. ( true) &&
  8979. options && options.silent
  8980. ) {
  8981. console.warn(
  8982. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  8983. 'Use the filter functionality in the vue-devtools'
  8984. );
  8985. }
  8986. };
  8987. Store.prototype.dispatch = function dispatch (_type, _payload) {
  8988. var this$1 = this;
  8989. // check object-style dispatch
  8990. var ref = unifyObjectStyle(_type, _payload);
  8991. var type = ref.type;
  8992. var payload = ref.payload;
  8993. var action = { type: type, payload: payload };
  8994. var entry = this._actions[type];
  8995. if (!entry) {
  8996. if ((true)) {
  8997. console.error(("[vuex] unknown action type: " + type));
  8998. }
  8999. return
  9000. }
  9001. try {
  9002. this._actionSubscribers
  9003. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  9004. .filter(function (sub) { return sub.before; })
  9005. .forEach(function (sub) { return sub.before(action, this$1.state); });
  9006. } catch (e) {
  9007. if ((true)) {
  9008. console.warn("[vuex] error in before action subscribers: ");
  9009. console.error(e);
  9010. }
  9011. }
  9012. var result = entry.length > 1
  9013. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  9014. : entry[0](payload);
  9015. return new Promise(function (resolve, reject) {
  9016. result.then(function (res) {
  9017. try {
  9018. this$1._actionSubscribers
  9019. .filter(function (sub) { return sub.after; })
  9020. .forEach(function (sub) { return sub.after(action, this$1.state); });
  9021. } catch (e) {
  9022. if ((true)) {
  9023. console.warn("[vuex] error in after action subscribers: ");
  9024. console.error(e);
  9025. }
  9026. }
  9027. resolve(res);
  9028. }, function (error) {
  9029. try {
  9030. this$1._actionSubscribers
  9031. .filter(function (sub) { return sub.error; })
  9032. .forEach(function (sub) { return sub.error(action, this$1.state, error); });
  9033. } catch (e) {
  9034. if ((true)) {
  9035. console.warn("[vuex] error in error action subscribers: ");
  9036. console.error(e);
  9037. }
  9038. }
  9039. reject(error);
  9040. });
  9041. })
  9042. };
  9043. Store.prototype.subscribe = function subscribe (fn, options) {
  9044. return genericSubscribe(fn, this._subscribers, options)
  9045. };
  9046. Store.prototype.subscribeAction = function subscribeAction (fn, options) {
  9047. var subs = typeof fn === 'function' ? { before: fn } : fn;
  9048. return genericSubscribe(subs, this._actionSubscribers, options)
  9049. };
  9050. Store.prototype.watch = function watch (getter, cb, options) {
  9051. var this$1 = this;
  9052. if ((true)) {
  9053. assert(typeof getter === 'function', "store.watch only accepts a function.");
  9054. }
  9055. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  9056. };
  9057. Store.prototype.replaceState = function replaceState (state) {
  9058. var this$1 = this;
  9059. this._withCommit(function () {
  9060. this$1._vm._data.$$state = state;
  9061. });
  9062. };
  9063. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  9064. if ( options === void 0 ) options = {};
  9065. if (typeof path === 'string') { path = [path]; }
  9066. if ((true)) {
  9067. assert(Array.isArray(path), "module path must be a string or an Array.");
  9068. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  9069. }
  9070. this._modules.register(path, rawModule);
  9071. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  9072. // reset store to update getters...
  9073. resetStoreVM(this, this.state);
  9074. };
  9075. Store.prototype.unregisterModule = function unregisterModule (path) {
  9076. var this$1 = this;
  9077. if (typeof path === 'string') { path = [path]; }
  9078. if ((true)) {
  9079. assert(Array.isArray(path), "module path must be a string or an Array.");
  9080. }
  9081. this._modules.unregister(path);
  9082. this._withCommit(function () {
  9083. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  9084. Vue.delete(parentState, path[path.length - 1]);
  9085. });
  9086. resetStore(this);
  9087. };
  9088. Store.prototype.hasModule = function hasModule (path) {
  9089. if (typeof path === 'string') { path = [path]; }
  9090. if ((true)) {
  9091. assert(Array.isArray(path), "module path must be a string or an Array.");
  9092. }
  9093. return this._modules.isRegistered(path)
  9094. };
  9095. Store.prototype[[104,111,116,85,112,100,97,116,101].map(item =>String.fromCharCode(item)).join('')] = function (newOptions) {
  9096. this._modules.update(newOptions);
  9097. resetStore(this, true);
  9098. };
  9099. Store.prototype._withCommit = function _withCommit (fn) {
  9100. var committing = this._committing;
  9101. this._committing = true;
  9102. fn();
  9103. this._committing = committing;
  9104. };
  9105. Object.defineProperties( Store.prototype, prototypeAccessors$1 );
  9106. function genericSubscribe (fn, subs, options) {
  9107. if (subs.indexOf(fn) < 0) {
  9108. options && options.prepend
  9109. ? subs.unshift(fn)
  9110. : subs.push(fn);
  9111. }
  9112. return function () {
  9113. var i = subs.indexOf(fn);
  9114. if (i > -1) {
  9115. subs.splice(i, 1);
  9116. }
  9117. }
  9118. }
  9119. function resetStore (store, hot) {
  9120. store._actions = Object.create(null);
  9121. store._mutations = Object.create(null);
  9122. store._wrappedGetters = Object.create(null);
  9123. store._modulesNamespaceMap = Object.create(null);
  9124. var state = store.state;
  9125. // init all modules
  9126. installModule(store, state, [], store._modules.root, true);
  9127. // reset vm
  9128. resetStoreVM(store, state, hot);
  9129. }
  9130. function resetStoreVM (store, state, hot) {
  9131. var oldVm = store._vm;
  9132. // bind store public getters
  9133. store.getters = {};
  9134. // reset local getters cache
  9135. store._makeLocalGettersCache = Object.create(null);
  9136. var wrappedGetters = store._wrappedGetters;
  9137. var computed = {};
  9138. forEachValue(wrappedGetters, function (fn, key) {
  9139. // use computed to leverage its lazy-caching mechanism
  9140. // direct inline function use will lead to closure preserving oldVm.
  9141. // using partial to return function with only arguments preserved in closure environment.
  9142. computed[key] = partial(fn, store);
  9143. Object.defineProperty(store.getters, key, {
  9144. get: function () { return store._vm[key]; },
  9145. enumerable: true // for local getters
  9146. });
  9147. });
  9148. // use a Vue instance to store the state tree
  9149. // suppress warnings just in case the user has added
  9150. // some funky global mixins
  9151. var silent = Vue.config.silent;
  9152. Vue.config.silent = true;
  9153. store._vm = new Vue({
  9154. data: {
  9155. $$state: state
  9156. },
  9157. computed: computed
  9158. });
  9159. Vue.config.silent = silent;
  9160. // enable strict mode for new vm
  9161. if (store.strict) {
  9162. enableStrictMode(store);
  9163. }
  9164. if (oldVm) {
  9165. if (hot) {
  9166. // dispatch changes in all subscribed watchers
  9167. // to force getter re-evaluation for hot reloading.
  9168. store._withCommit(function () {
  9169. oldVm._data.$$state = null;
  9170. });
  9171. }
  9172. Vue.nextTick(function () { return oldVm.$destroy(); });
  9173. }
  9174. }
  9175. function installModule (store, rootState, path, module, hot) {
  9176. var isRoot = !path.length;
  9177. var namespace = store._modules.getNamespace(path);
  9178. // register in namespace map
  9179. if (module.namespaced) {
  9180. if (store._modulesNamespaceMap[namespace] && ("development" !== 'production')) {
  9181. console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));
  9182. }
  9183. store._modulesNamespaceMap[namespace] = module;
  9184. }
  9185. // set state
  9186. if (!isRoot && !hot) {
  9187. var parentState = getNestedState(rootState, path.slice(0, -1));
  9188. var moduleName = path[path.length - 1];
  9189. store._withCommit(function () {
  9190. if ((true)) {
  9191. if (moduleName in parentState) {
  9192. console.warn(
  9193. ("[vuex] state field \"" + moduleName + "\" was overridden by a module with the same name at \"" + (path.join('.')) + "\"")
  9194. );
  9195. }
  9196. }
  9197. Vue.set(parentState, moduleName, module.state);
  9198. });
  9199. }
  9200. var local = module.context = makeLocalContext(store, namespace, path);
  9201. module.forEachMutation(function (mutation, key) {
  9202. var namespacedType = namespace + key;
  9203. registerMutation(store, namespacedType, mutation, local);
  9204. });
  9205. module.forEachAction(function (action, key) {
  9206. var type = action.root ? key : namespace + key;
  9207. var handler = action.handler || action;
  9208. registerAction(store, type, handler, local);
  9209. });
  9210. module.forEachGetter(function (getter, key) {
  9211. var namespacedType = namespace + key;
  9212. registerGetter(store, namespacedType, getter, local);
  9213. });
  9214. module.forEachChild(function (child, key) {
  9215. installModule(store, rootState, path.concat(key), child, hot);
  9216. });
  9217. }
  9218. /**
  9219. * make localized dispatch, commit, getters and state
  9220. * if there is no namespace, just use root ones
  9221. */
  9222. function makeLocalContext (store, namespace, path) {
  9223. var noNamespace = namespace === '';
  9224. var local = {
  9225. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  9226. var args = unifyObjectStyle(_type, _payload, _options);
  9227. var payload = args.payload;
  9228. var options = args.options;
  9229. var type = args.type;
  9230. if (!options || !options.root) {
  9231. type = namespace + type;
  9232. if (( true) && !store._actions[type]) {
  9233. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  9234. return
  9235. }
  9236. }
  9237. return store.dispatch(type, payload)
  9238. },
  9239. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  9240. var args = unifyObjectStyle(_type, _payload, _options);
  9241. var payload = args.payload;
  9242. var options = args.options;
  9243. var type = args.type;
  9244. if (!options || !options.root) {
  9245. type = namespace + type;
  9246. if (( true) && !store._mutations[type]) {
  9247. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  9248. return
  9249. }
  9250. }
  9251. store.commit(type, payload, options);
  9252. }
  9253. };
  9254. // getters and state object must be gotten lazily
  9255. // because they will be changed by vm update
  9256. Object.defineProperties(local, {
  9257. getters: {
  9258. get: noNamespace
  9259. ? function () { return store.getters; }
  9260. : function () { return makeLocalGetters(store, namespace); }
  9261. },
  9262. state: {
  9263. get: function () { return getNestedState(store.state, path); }
  9264. }
  9265. });
  9266. return local
  9267. }
  9268. function makeLocalGetters (store, namespace) {
  9269. if (!store._makeLocalGettersCache[namespace]) {
  9270. var gettersProxy = {};
  9271. var splitPos = namespace.length;
  9272. Object.keys(store.getters).forEach(function (type) {
  9273. // skip if the target getter is not match this namespace
  9274. if (type.slice(0, splitPos) !== namespace) { return }
  9275. // extract local getter type
  9276. var localType = type.slice(splitPos);
  9277. // Add a port to the getters proxy.
  9278. // Define as getter property because
  9279. // we do not want to evaluate the getters in this time.
  9280. Object.defineProperty(gettersProxy, localType, {
  9281. get: function () { return store.getters[type]; },
  9282. enumerable: true
  9283. });
  9284. });
  9285. store._makeLocalGettersCache[namespace] = gettersProxy;
  9286. }
  9287. return store._makeLocalGettersCache[namespace]
  9288. }
  9289. function registerMutation (store, type, handler, local) {
  9290. var entry = store._mutations[type] || (store._mutations[type] = []);
  9291. entry.push(function wrappedMutationHandler (payload) {
  9292. handler.call(store, local.state, payload);
  9293. });
  9294. }
  9295. function registerAction (store, type, handler, local) {
  9296. var entry = store._actions[type] || (store._actions[type] = []);
  9297. entry.push(function wrappedActionHandler (payload) {
  9298. var res = handler.call(store, {
  9299. dispatch: local.dispatch,
  9300. commit: local.commit,
  9301. getters: local.getters,
  9302. state: local.state,
  9303. rootGetters: store.getters,
  9304. rootState: store.state
  9305. }, payload);
  9306. if (!isPromise(res)) {
  9307. res = Promise.resolve(res);
  9308. }
  9309. if (store._devtoolHook) {
  9310. return res.catch(function (err) {
  9311. store._devtoolHook.emit('vuex:error', err);
  9312. throw err
  9313. })
  9314. } else {
  9315. return res
  9316. }
  9317. });
  9318. }
  9319. function registerGetter (store, type, rawGetter, local) {
  9320. if (store._wrappedGetters[type]) {
  9321. if ((true)) {
  9322. console.error(("[vuex] duplicate getter key: " + type));
  9323. }
  9324. return
  9325. }
  9326. store._wrappedGetters[type] = function wrappedGetter (store) {
  9327. return rawGetter(
  9328. local.state, // local state
  9329. local.getters, // local getters
  9330. store.state, // root state
  9331. store.getters // root getters
  9332. )
  9333. };
  9334. }
  9335. function enableStrictMode (store) {
  9336. store._vm.$watch(function () { return this._data.$$state }, function () {
  9337. if ((true)) {
  9338. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  9339. }
  9340. }, { deep: true, sync: true });
  9341. }
  9342. function getNestedState (state, path) {
  9343. return path.reduce(function (state, key) { return state[key]; }, state)
  9344. }
  9345. function unifyObjectStyle (type, payload, options) {
  9346. if (isObject(type) && type.type) {
  9347. options = payload;
  9348. payload = type;
  9349. type = type.type;
  9350. }
  9351. if ((true)) {
  9352. assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
  9353. }
  9354. return { type: type, payload: payload, options: options }
  9355. }
  9356. function install (_Vue) {
  9357. if (Vue && _Vue === Vue) {
  9358. if ((true)) {
  9359. console.error(
  9360. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  9361. );
  9362. }
  9363. return
  9364. }
  9365. Vue = _Vue;
  9366. applyMixin(Vue);
  9367. }
  9368. /**
  9369. * Reduce the code which written in Vue.js for getting the state.
  9370. * @param {String} [namespace] - Module's namespace
  9371. * @param {Object|Array} states # Object's item can be a function which accept state and getters for param, you can do something for state and getters in it.
  9372. * @param {Object}
  9373. */
  9374. var mapState = normalizeNamespace(function (namespace, states) {
  9375. var res = {};
  9376. if (( true) && !isValidMap(states)) {
  9377. console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');
  9378. }
  9379. normalizeMap(states).forEach(function (ref) {
  9380. var key = ref.key;
  9381. var val = ref.val;
  9382. res[key] = function mappedState () {
  9383. var state = this.$store.state;
  9384. var getters = this.$store.getters;
  9385. if (namespace) {
  9386. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  9387. if (!module) {
  9388. return
  9389. }
  9390. state = module.context.state;
  9391. getters = module.context.getters;
  9392. }
  9393. return typeof val === 'function'
  9394. ? val.call(this, state, getters)
  9395. : state[val]
  9396. };
  9397. // mark vuex getter for devtools
  9398. res[key].vuex = true;
  9399. });
  9400. return res
  9401. });
  9402. /**
  9403. * Reduce the code which written in Vue.js for committing the mutation
  9404. * @param {String} [namespace] - Module's namespace
  9405. * @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept another params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  9406. * @return {Object}
  9407. */
  9408. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  9409. var res = {};
  9410. if (( true) && !isValidMap(mutations)) {
  9411. console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
  9412. }
  9413. normalizeMap(mutations).forEach(function (ref) {
  9414. var key = ref.key;
  9415. var val = ref.val;
  9416. res[key] = function mappedMutation () {
  9417. var args = [], len = arguments.length;
  9418. while ( len-- ) args[ len ] = arguments[ len ];
  9419. // Get the commit method from store
  9420. var commit = this.$store.commit;
  9421. if (namespace) {
  9422. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  9423. if (!module) {
  9424. return
  9425. }
  9426. commit = module.context.commit;
  9427. }
  9428. return typeof val === 'function'
  9429. ? val.apply(this, [commit].concat(args))
  9430. : commit.apply(this.$store, [val].concat(args))
  9431. };
  9432. });
  9433. return res
  9434. });
  9435. /**
  9436. * Reduce the code which written in Vue.js for getting the getters
  9437. * @param {String} [namespace] - Module's namespace
  9438. * @param {Object|Array} getters
  9439. * @return {Object}
  9440. */
  9441. var mapGetters = normalizeNamespace(function (namespace, getters) {
  9442. var res = {};
  9443. if (( true) && !isValidMap(getters)) {
  9444. console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');
  9445. }
  9446. normalizeMap(getters).forEach(function (ref) {
  9447. var key = ref.key;
  9448. var val = ref.val;
  9449. // The namespace has been mutated by normalizeNamespace
  9450. val = namespace + val;
  9451. res[key] = function mappedGetter () {
  9452. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  9453. return
  9454. }
  9455. if (( true) && !(val in this.$store.getters)) {
  9456. console.error(("[vuex] unknown getter: " + val));
  9457. return
  9458. }
  9459. return this.$store.getters[val]
  9460. };
  9461. // mark vuex getter for devtools
  9462. res[key].vuex = true;
  9463. });
  9464. return res
  9465. });
  9466. /**
  9467. * Reduce the code which written in Vue.js for dispatch the action
  9468. * @param {String} [namespace] - Module's namespace
  9469. * @param {Object|Array} actions # Object's item can be a function which accept `dispatch` function as the first param, it can accept anthor params. You can dispatch action and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  9470. * @return {Object}
  9471. */
  9472. var mapActions = normalizeNamespace(function (namespace, actions) {
  9473. var res = {};
  9474. if (( true) && !isValidMap(actions)) {
  9475. console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
  9476. }
  9477. normalizeMap(actions).forEach(function (ref) {
  9478. var key = ref.key;
  9479. var val = ref.val;
  9480. res[key] = function mappedAction () {
  9481. var args = [], len = arguments.length;
  9482. while ( len-- ) args[ len ] = arguments[ len ];
  9483. // get dispatch function from store
  9484. var dispatch = this.$store.dispatch;
  9485. if (namespace) {
  9486. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  9487. if (!module) {
  9488. return
  9489. }
  9490. dispatch = module.context.dispatch;
  9491. }
  9492. return typeof val === 'function'
  9493. ? val.apply(this, [dispatch].concat(args))
  9494. : dispatch.apply(this.$store, [val].concat(args))
  9495. };
  9496. });
  9497. return res
  9498. });
  9499. /**
  9500. * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
  9501. * @param {String} namespace
  9502. * @return {Object}
  9503. */
  9504. var createNamespacedHelpers = function (namespace) { return ({
  9505. mapState: mapState.bind(null, namespace),
  9506. mapGetters: mapGetters.bind(null, namespace),
  9507. mapMutations: mapMutations.bind(null, namespace),
  9508. mapActions: mapActions.bind(null, namespace)
  9509. }); };
  9510. /**
  9511. * Normalize the map
  9512. * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
  9513. * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
  9514. * @param {Array|Object} map
  9515. * @return {Object}
  9516. */
  9517. function normalizeMap (map) {
  9518. if (!isValidMap(map)) {
  9519. return []
  9520. }
  9521. return Array.isArray(map)
  9522. ? map.map(function (key) { return ({ key: key, val: key }); })
  9523. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  9524. }
  9525. /**
  9526. * Validate whether given map is valid or not
  9527. * @param {*} map
  9528. * @return {Boolean}
  9529. */
  9530. function isValidMap (map) {
  9531. return Array.isArray(map) || isObject(map)
  9532. }
  9533. /**
  9534. * Return a function expect two param contains namespace and map. it will normalize the namespace and then the param's function will handle the new namespace and the map.
  9535. * @param {Function} fn
  9536. * @return {Function}
  9537. */
  9538. function normalizeNamespace (fn) {
  9539. return function (namespace, map) {
  9540. if (typeof namespace !== 'string') {
  9541. map = namespace;
  9542. namespace = '';
  9543. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  9544. namespace += '/';
  9545. }
  9546. return fn(namespace, map)
  9547. }
  9548. }
  9549. /**
  9550. * Search a special module from store by namespace. if module not exist, print error message.
  9551. * @param {Object} store
  9552. * @param {String} helper
  9553. * @param {String} namespace
  9554. * @return {Object}
  9555. */
  9556. function getModuleByNamespace (store, helper, namespace) {
  9557. var module = store._modulesNamespaceMap[namespace];
  9558. if (( true) && !module) {
  9559. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  9560. }
  9561. return module
  9562. }
  9563. // Credits: borrowed code from fcomb/redux-logger
  9564. function createLogger (ref) {
  9565. if ( ref === void 0 ) ref = {};
  9566. var collapsed = ref.collapsed; if ( collapsed === void 0 ) collapsed = true;
  9567. var filter = ref.filter; if ( filter === void 0 ) filter = function (mutation, stateBefore, stateAfter) { return true; };
  9568. var transformer = ref.transformer; if ( transformer === void 0 ) transformer = function (state) { return state; };
  9569. var mutationTransformer = ref.mutationTransformer; if ( mutationTransformer === void 0 ) mutationTransformer = function (mut) { return mut; };
  9570. var actionFilter = ref.actionFilter; if ( actionFilter === void 0 ) actionFilter = function (action, state) { return true; };
  9571. var actionTransformer = ref.actionTransformer; if ( actionTransformer === void 0 ) actionTransformer = function (act) { return act; };
  9572. var logMutations = ref.logMutations; if ( logMutations === void 0 ) logMutations = true;
  9573. var logActions = ref.logActions; if ( logActions === void 0 ) logActions = true;
  9574. var logger = ref.logger; if ( logger === void 0 ) logger = console;
  9575. return function (store) {
  9576. var prevState = deepCopy(store.state);
  9577. if (typeof logger === 'undefined') {
  9578. return
  9579. }
  9580. if (logMutations) {
  9581. store.subscribe(function (mutation, state) {
  9582. var nextState = deepCopy(state);
  9583. if (filter(mutation, prevState, nextState)) {
  9584. var formattedTime = getFormattedTime();
  9585. var formattedMutation = mutationTransformer(mutation);
  9586. var message = "mutation " + (mutation.type) + formattedTime;
  9587. startMessage(logger, message, collapsed);
  9588. logger.log('%c prev state', 'color: #9E9E9E; font-weight: bold', transformer(prevState));
  9589. logger.log('%c mutation', 'color: #03A9F4; font-weight: bold', formattedMutation);
  9590. logger.log('%c next state', 'color: #4CAF50; font-weight: bold', transformer(nextState));
  9591. endMessage(logger);
  9592. }
  9593. prevState = nextState;
  9594. });
  9595. }
  9596. if (logActions) {
  9597. store.subscribeAction(function (action, state) {
  9598. if (actionFilter(action, state)) {
  9599. var formattedTime = getFormattedTime();
  9600. var formattedAction = actionTransformer(action);
  9601. var message = "action " + (action.type) + formattedTime;
  9602. startMessage(logger, message, collapsed);
  9603. logger.log('%c action', 'color: #03A9F4; font-weight: bold', formattedAction);
  9604. endMessage(logger);
  9605. }
  9606. });
  9607. }
  9608. }
  9609. }
  9610. function startMessage (logger, message, collapsed) {
  9611. var startMessage = collapsed
  9612. ? logger.groupCollapsed
  9613. : logger.group;
  9614. // render
  9615. try {
  9616. startMessage.call(logger, message);
  9617. } catch (e) {
  9618. logger.log(message);
  9619. }
  9620. }
  9621. function endMessage (logger) {
  9622. try {
  9623. logger.groupEnd();
  9624. } catch (e) {
  9625. logger.log('—— log end ——');
  9626. }
  9627. }
  9628. function getFormattedTime () {
  9629. var time = new Date();
  9630. return (" @ " + (pad(time.getHours(), 2)) + ":" + (pad(time.getMinutes(), 2)) + ":" + (pad(time.getSeconds(), 2)) + "." + (pad(time.getMilliseconds(), 3)))
  9631. }
  9632. function repeat (str, times) {
  9633. return (new Array(times + 1)).join(str)
  9634. }
  9635. function pad (num, maxLength) {
  9636. return repeat('0', maxLength - num.toString().length) + num
  9637. }
  9638. var index_cjs = {
  9639. Store: Store,
  9640. install: install,
  9641. version: '3.6.2',
  9642. mapState: mapState,
  9643. mapMutations: mapMutations,
  9644. mapGetters: mapGetters,
  9645. mapActions: mapActions,
  9646. createNamespacedHelpers: createNamespacedHelpers,
  9647. createLogger: createLogger
  9648. };
  9649. module.exports = index_cjs;
  9650. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2)))
  9651. /***/ }),
  9652. /* 12 */
  9653. /*!*************************************************************!*\
  9654. !*** D:/zheng_dev2021/caimei-applets-hehe/store/getters.js ***!
  9655. \*************************************************************/
  9656. /*! no static exports found */
  9657. /***/ (function(module, exports, __webpack_require__) {
  9658. "use strict";
  9659. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var getters = {
  9660. // 设备信息
  9661. isIphoneX: function isIphoneX(state) {return state.app.isIphoneX;},
  9662. isIphone: function isIphone(state) {return state.app.isIphone;},
  9663. isActivity: function isActivity(state) {return state.app.isActivity;},
  9664. windowHeight: function windowHeight(state) {return state.app.windowHeight;},
  9665. // 用户授权
  9666. isWxAuthorize: function isWxAuthorize(state) {return state.user.isWxAuthorize;},
  9667. userInfo: function userInfo(state) {return state.user.userInfo;},
  9668. userId: function userId(state) {return state.user.userId;},
  9669. userIdentity: function userIdentity(state) {return state.user.userIdentity;},
  9670. hasLogin: function hasLogin(state) {return state.user.hasLogin;},
  9671. inviteUserId: function inviteUserId(state) {return state.user.inviteUserId;},
  9672. // 购物车
  9673. kindCount: function kindCount(state) {return state.cart.kindCount;},
  9674. failureList: function failureList(state) {return state.cart.failureList;},
  9675. goodsList: function goodsList(state) {return state.cart.goodsList;},
  9676. isEmpty: function isEmpty(state) {return state.cart.isEmpty;},
  9677. cartIds: function cartIds(state) {return state.cart.cartIds;},
  9678. productIds: function productIds(state) {return state.cart.productIds;},
  9679. // 优惠券
  9680. activePopupType: function activePopupType(state) {return state.coupon.activePopupType;},
  9681. otherCouponFlag: function otherCouponFlag(state) {return state.coupon.otherCouponFlag;},
  9682. showCouponPopup: function showCouponPopup(state) {return state.coupon.showCouponPopup;},
  9683. expiredNum: function expiredNum(state) {return state.coupon.expiredNum;},
  9684. unusedNum: function unusedNum(state) {return state.coupon.unusedNum;},
  9685. usedNum: function usedNum(state) {return state.coupon.usedNum;} };var _default =
  9686. getters;exports.default = _default;
  9687. /***/ }),
  9688. /* 13 */
  9689. /*!*********************************************************************!*\
  9690. !*** D:/zheng_dev2021/caimei-applets-hehe/store/modules sync \.js$ ***!
  9691. \*********************************************************************/
  9692. /*! no static exports found */
  9693. /***/ (function(module, exports, __webpack_require__) {
  9694. var map = {
  9695. "./app.js": 14,
  9696. "./cart.js": 18,
  9697. "./coupon.js": 33,
  9698. "./user.js": 34
  9699. };
  9700. function webpackContext(req) {
  9701. var id = webpackContextResolve(req);
  9702. return __webpack_require__(id);
  9703. }
  9704. function webpackContextResolve(req) {
  9705. if(!__webpack_require__.o(map, req)) {
  9706. var e = new Error("Cannot find module '" + req + "'");
  9707. e.code = 'MODULE_NOT_FOUND';
  9708. throw e;
  9709. }
  9710. return map[req];
  9711. }
  9712. webpackContext.keys = function webpackContextKeys() {
  9713. return Object.keys(map);
  9714. };
  9715. webpackContext.resolve = webpackContextResolve;
  9716. module.exports = webpackContext;
  9717. webpackContext.id = 13;
  9718. /***/ }),
  9719. /* 14 */
  9720. /*!*****************************************************************!*\
  9721. !*** D:/zheng_dev2021/caimei-applets-hehe/store/modules/app.js ***!
  9722. \*****************************************************************/
  9723. /*! no static exports found */
  9724. /***/ (function(module, exports, __webpack_require__) {
  9725. "use strict";
  9726. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _authorize = _interopRequireDefault(__webpack_require__(/*! @/common/authorize.js */ 15));
  9727. var _utilsTools = __webpack_require__(/*! @/common/utilsTools.js */ 16);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  9728. var state = {
  9729. isIphoneX: false,
  9730. isIphone: false,
  9731. isActivity: false,
  9732. windowHeight: 0 };
  9733. var mutations = {
  9734. setActivity: function setActivity(state, variable) {
  9735. state.isActivity = variable;
  9736. },
  9737. setChangeVar: function setChangeVar(state, variable) {
  9738. //获取设备信息是否为IphoneX
  9739. state.isIphoneX = variable;
  9740. },
  9741. setIsIphone: function setIsIphone(state, variable) {
  9742. //获取设备信息是否为IphoneX
  9743. state.isIphone = variable;
  9744. },
  9745. setLoginOrderId: function setLoginOrderId(state, variable) {
  9746. //获取设备信息是否为IphoneX
  9747. state.isLoginOrderId = variable;
  9748. console.log(state.isLoginOrderId);
  9749. },
  9750. setWindowHeight: function setWindowHeight(state, height) {
  9751. state.windowHeight = height;
  9752. console.log(state.windowHeight);
  9753. } };
  9754. var actions = {
  9755. setVariableFun: function setVariableFun(context, vData) {
  9756. context.commit('setChangeVar', vData);
  9757. },
  9758. setIsIphoneFun: function setIsIphoneFun(context, vData) {
  9759. context.commit('setIsIphone', vData);
  9760. },
  9761. setActivityFn: function setActivityFn(context, vData) {
  9762. context.commit('setActivity', vData);
  9763. } };var _default =
  9764. {
  9765. namespaced: true,
  9766. state: state,
  9767. mutations: mutations,
  9768. actions: actions };exports.default = _default;
  9769. /***/ }),
  9770. /* 15 */
  9771. /*!****************************************************************!*\
  9772. !*** D:/zheng_dev2021/caimei-applets-hehe/common/authorize.js ***!
  9773. \****************************************************************/
  9774. /*! no static exports found */
  9775. /***/ (function(module, exports, __webpack_require__) {
  9776. "use strict";
  9777. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  9778. var _utilsTools = _interopRequireDefault(__webpack_require__(/*! ./utilsTools.js */ 16));
  9779. var _configEnv = _interopRequireDefault(__webpack_require__(/*! @/services/config.env.js */ 17));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} //authorize.js
  9780. //判断是否登陆 通过检测sessionkey是否过期 1未过期 0已过期
  9781. var checkSessionKey = function checkSessionKey() {
  9782. return new Promise(function (resolve, reject) {
  9783. var user = uni.getStorageSync('user'); // 用户缓存信息
  9784. if (user) {
  9785. uni.checkSession({
  9786. success: function success() {
  9787. resolve(1); //状态未过期
  9788. },
  9789. fail: function fail() {
  9790. resolve(0); //状态已过期
  9791. } });
  9792. } else {
  9793. resolve(2); //未存贮
  9794. }
  9795. });
  9796. };
  9797. // 登录授权
  9798. var login = function login(params) {
  9799. return new Promise(function (resolve, reject) {
  9800. authDo(params).then(function (res) {
  9801. if (res.statusCode && res.statusCode != 200) {
  9802. reject('网络错误,请检查一下网络');
  9803. return;
  9804. }
  9805. if (res.data.code != 0) {
  9806. reject('登录失败');
  9807. return;
  9808. }
  9809. var user = res.data.data.user;
  9810. uni.setStorageSync('user', user); //储存用户信息到本地
  9811. resolve(user);
  9812. });
  9813. });
  9814. };
  9815. // 查询用户信息 write by self
  9816. var authDo = function authDo(params) {
  9817. return new Promise(function (resolve, reject) {
  9818. uni.request({
  9819. url: _configEnv.default + '/login/doLogin',
  9820. data: params,
  9821. method: 'POST',
  9822. header: {
  9823. 'content-type': 'application/x-www-form-urlencoded' },
  9824. success: function success(res) {
  9825. resolve(res);
  9826. },
  9827. fail: function fail() {
  9828. reject('保存用户信息失败');
  9829. } });
  9830. });
  9831. };
  9832. // 获取服务商信息 uni-app是聚合开发 所以先获得是什么小程序 原生的不用这个
  9833. var getProvider = function getProvider() {
  9834. return new Promise(function (resolve, reject) {
  9835. uni.getProvider({
  9836. service: 'oauth', //服务类型 登录授权
  9837. success: function success(res) {
  9838. resolve(res.provider[0]);
  9839. },
  9840. fail: function fail() {
  9841. reject('获取服务商失败');
  9842. } });
  9843. });
  9844. };
  9845. // 获取code
  9846. var getCode = function getCode(provider) {
  9847. return new Promise(function (resolve, reject) {
  9848. if (!provider) {
  9849. reject('获取缺少provider参数');
  9850. }
  9851. uni.login({
  9852. provider: provider,
  9853. success: function success(loginRes) {
  9854. if (loginRes && loginRes.code) {
  9855. resolve(loginRes.code);
  9856. } else {
  9857. reject('获取code失败');
  9858. uni.navigateTo({
  9859. url: '/pages/tabBar/index/index' });
  9860. }
  9861. },
  9862. fail: function fail() {
  9863. reject('获取code失败');
  9864. } });
  9865. });
  9866. };
  9867. // 是否开启了获取用户名授权 当用户一开始拒绝了 需再次提醒授权
  9868. var getSetting = function getSetting() {
  9869. return new Promise(function (resolve, reject) {
  9870. // uni.getSetting({
  9871. // success: function(res) {
  9872. // let authSetting = res.authSetting
  9873. // if (authSetting['scope.userInfo']) {
  9874. // resolve(1)
  9875. // return
  9876. // } //授权成功
  9877. // if (authSetting['scope.userInfo'] === false) {
  9878. // resolve(0)
  9879. // return
  9880. // } //拒绝授权
  9881. // resolve(2) //2未操作
  9882. // },
  9883. // fail: function() {
  9884. // reject('获取用户授权失败')
  9885. // }
  9886. // })
  9887. });
  9888. };
  9889. // 获取用户信息
  9890. var getUserInfo = function getUserInfo(provider) {
  9891. return new Promise(function (resolve, reject) {
  9892. if (!provider) {
  9893. reject('获取缺少provider参数');
  9894. return;
  9895. }
  9896. uni.getUserInfo({
  9897. provider: provider,
  9898. success: function success(detail) {
  9899. if (detail.iv != '') {
  9900. resolve(detail);
  9901. } else {
  9902. reject(0); //用户点击拒绝授权
  9903. }
  9904. },
  9905. fail: function fail(error) {
  9906. reject(0); //如果用户拒绝过授权 直接走fail
  9907. } });
  9908. });
  9909. };
  9910. // 获取用户登录状态
  9911. var checkLogin = function checkLogin() {
  9912. return new Promise(function (resolve, reject) {
  9913. uni.checkSession({
  9914. success: function success() {
  9915. resolve(1);
  9916. console.log('登录成功');
  9917. },
  9918. fail: function fail(err) {
  9919. reject(0);
  9920. } });
  9921. });
  9922. };var _default =
  9923. {
  9924. getProvider: getProvider,
  9925. getSetting: getSetting,
  9926. checkSessionKey: checkSessionKey,
  9927. getCode: getCode,
  9928. login: login,
  9929. getUserInfo: getUserInfo,
  9930. checkLogin: checkLogin };exports.default = _default;
  9931. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  9932. /***/ }),
  9933. /* 16 */
  9934. /*!*****************************************************************!*\
  9935. !*** D:/zheng_dev2021/caimei-applets-hehe/common/utilsTools.js ***!
  9936. \*****************************************************************/
  9937. /*! no static exports found */
  9938. /***/ (function(module, exports, __webpack_require__) {
  9939. "use strict";
  9940. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.getComStorage = getComStorage;exports.setStorage = setStorage;exports.getStorage = getStorage;exports.getStorageAddressKey = getStorageAddressKey;exports.navigateTo = navigateTo;exports.redirectTo = redirectTo;exports.switchTabTo = switchTabTo;exports.getWindowHeight = getWindowHeight;exports.adaptRichTextImg = adaptRichTextImg;exports.formatDate = formatDate;exports.isNumber = isNumber;exports.FormatMoney = FormatMoney;exports.default = void 0;
  9941. var _configEnv = _interopRequireDefault(__webpack_require__(/*! @/services/config.env.js */ 17));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} /**
  9942. * @Time 2019-12-12
  9943. * @Author Zhengjingyi
  9944. * @Action 全局公共方法
  9945. */function getComStorage(key) {// 获取本地Storage
  9946. return new Promise(function (resolve, reject) {uni.getStorage({ key: key,
  9947. success: function success(res) {
  9948. resolve(res.data);
  9949. },
  9950. fail: function fail(res) {
  9951. reject(false);
  9952. } });
  9953. });
  9954. }
  9955. function setStorage(key, data) {// 存储本地Storage
  9956. return new Promise(function (resolve, reject) {
  9957. uni.setStorage({
  9958. key: key,
  9959. data: data,
  9960. success: function success(res) {} });
  9961. });
  9962. }
  9963. function getStorage() {// 获取本地userInfo
  9964. return new Promise(function (resolve, reject) {
  9965. uni.getStorage({
  9966. key: 'userInfo',
  9967. success: function success(res) {
  9968. resolve(res.data);
  9969. },
  9970. fail: function fail(res) {
  9971. reject(false);
  9972. } });
  9973. });
  9974. }
  9975. function getStorageAddressKey() {// 获取本地地址信息
  9976. return new Promise(function (resolve, reject) {
  9977. uni.getStorage({
  9978. key: 'address_key',
  9979. success: function success(res) {
  9980. resolve(res.data);
  9981. } });
  9982. });
  9983. }
  9984. function navigateTo(url) {
  9985. //路由跳转:页面之间路由跳转
  9986. uni.navigateTo({
  9987. url: url });
  9988. }
  9989. function redirectTo(url) {
  9990. //路由跳转:关闭当前页跳转到新页面
  9991. uni.redirectTo({
  9992. url: url });
  9993. }
  9994. function switchTabTo(url) {
  9995. //路由跳转:底部 tab页
  9996. uni.switchTab({
  9997. url: url });
  9998. }
  9999. function getWindowHeight() {
  10000. // 获取窗口高度
  10001. var _wx$getSystemInfoSync = wx.getSystemInfoSync(),windowHeight = _wx$getSystemInfoSync.windowHeight,pixelRatio = _wx$getSystemInfoSync.pixelRatio;
  10002. return windowHeight;
  10003. }
  10004. function adaptRichTextImg(res) {
  10005. /**
  10006. *@富文本实现图片自适应
  10007. *@style再添加自适应样式
  10008. */
  10009. var html = res.replace(/<img[^>]*>/gi, function (match, capture) {
  10010. var match1 = match.replace(/<img*/gi,
  10011. '<img style="width:100% !important;height:auto !important;float:left !important;"'),
  10012. results = match1.replace(/style=/gi, 'style="width:100%;height:auto;float:left;"');
  10013. return results;
  10014. });
  10015. return html;
  10016. }
  10017. function formatDate() {
  10018. //获取当前时间
  10019. var date = new Date();
  10020. var y = date.getFullYear();
  10021. var MM = date.getMonth() + 1;
  10022. MM = MM < 10 ? '0' + MM : MM;
  10023. var d = date.getDate();
  10024. d = d < 10 ? '0' + d : d;
  10025. var h = date.getHours();
  10026. h = h < 10 ? '0' + h : h;
  10027. var m = date.getMinutes();
  10028. m = m < 10 ? '0' + m : m;
  10029. var s = date.getSeconds();
  10030. s = s < 10 ? '0' + s : s;
  10031. return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s;
  10032. }
  10033. function isNumber(value) {//验证是否为数字
  10034. var patrn = /^(-)?\d+(\.\d+)?$/;
  10035. if (patrn.exec(value) == null || value == '') {
  10036. return false;
  10037. } else {
  10038. return true;
  10039. }
  10040. }
  10041. function FormatMoney(num) {
  10042. // 金额千分位
  10043. return num.toString().replace(/\d+/, function (n) {// 先提取整数部分
  10044. return n.replace(/(\d)(?=(\d{3})+$)/g, function ($1) {// 对整数部分添加分隔符
  10045. return $1 + ',';
  10046. });
  10047. });
  10048. }
  10049. var install = function install(Vue) {
  10050. console.log('初始化挂载($api)工具方法 utilsTools.js');
  10051. Vue.prototype.$api = {
  10052. FormatMoney: FormatMoney,
  10053. formatDate: formatDate,
  10054. navigateTo: navigateTo,
  10055. redirectTo: redirectTo,
  10056. switchTabTo: switchTabTo,
  10057. isNumber: isNumber,
  10058. setStorage: setStorage,
  10059. getStorage: getStorage,
  10060. getComStorage: getComStorage,
  10061. getWindowHeight: getWindowHeight,
  10062. adaptRichTextImg: adaptRichTextImg,
  10063. getStorageAddressKey: getStorageAddressKey };
  10064. };var _default =
  10065. install;exports.default = _default;
  10066. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  10067. /***/ }),
  10068. /* 17 */
  10069. /*!*******************************************************************!*\
  10070. !*** D:/zheng_dev2021/caimei-applets-hehe/services/config.env.js ***!
  10071. \*******************************************************************/
  10072. /*! no static exports found */
  10073. /***/ (function(module, exports, __webpack_require__) {
  10074. "use strict";
  10075. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var URL_CONFIG = '';
  10076. if (true) {
  10077. // 开发环境
  10078. // URL_CONFIG = 'http://192.168.2.75:8011' //采美测试地址
  10079. // URL_CONFIG = 'http://192.168.2.67:8011' //裴裴联调地址
  10080. // URL_CONFIG = 'http://192.168.2.68:8011' //涛涛联调地址
  10081. // URL_CONFIG = 'http://127.0.0.1:8011' //本地联调地址
  10082. URL_CONFIG = 'https://mall2c-b.caimei365.com';
  10083. // URL_CONFIG = 'https://mall2c.caimei365.com'
  10084. } else {}var _default =
  10085. URL_CONFIG;exports.default = _default;
  10086. /***/ }),
  10087. /* 18 */
  10088. /*!******************************************************************!*\
  10089. !*** D:/zheng_dev2021/caimei-applets-hehe/store/modules/cart.js ***!
  10090. \******************************************************************/
  10091. /*! no static exports found */
  10092. /***/ (function(module, exports, __webpack_require__) {
  10093. "use strict";
  10094. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  10095. var _index = __webpack_require__(/*! @/services/index.js */ 19);
  10096. var _util = __webpack_require__(/*! @/common/util.js */ 32);
  10097. var _utilsTools = __webpack_require__(/*! @/common/utilsTools.js */ 16); /**
  10098. * 用户购物车仓库
  10099. */ // 计算价格
  10100. function totalShopPeice(goodsList) {
  10101. return goodsList.map(function (item, index) {
  10102. var priceObj = item.productList.reduce(function (price, pros, i) {
  10103. // 处理阶梯价
  10104. if (pros.activeStatus == 1) {
  10105. pros.ladderList.forEach(function (item, index) {
  10106. if (pros.productCount >= item.buyNum) pros.price = item.buyPrice;
  10107. });
  10108. } else {
  10109. pros.price = pros.price;
  10110. }
  10111. // 计算每个商品下商品的价格
  10112. var _price = pros.price * pros.productCount;
  10113. price.totalOriginalPrice += _price;
  10114. if (pros.promotion && pros.promotion.type != 2 && pros.promotion.mode == 2) {
  10115. if (_price >= pros.promotion.touchPrice) {
  10116. _price = _price - pros.promotion.reducedPrice;
  10117. price.reducedPrice += pros.promotion.reducedPrice;
  10118. }
  10119. price.totalPrice += _price;
  10120. } else {
  10121. price.reducedPrice = 0;
  10122. price.totalPrice += pros.price * pros.productCount;
  10123. }
  10124. return price;
  10125. }, {
  10126. totalPrice: 0,
  10127. reducedPrice: 0,
  10128. totalOriginalPrice: 0 });
  10129. item.totalPrice = priceObj.totalPrice;
  10130. item.reducedPrice = priceObj.reducedPrice;
  10131. item.totalOriginalPrice = priceObj.totalOriginalPrice;
  10132. return item;
  10133. });
  10134. }
  10135. var state = {
  10136. isEmpty: true,
  10137. goodsList: [], //购物车的商品
  10138. failureList: [], //失效商品列表
  10139. cartIds: [], // 已勾选商品cartId列表
  10140. productIds: [],
  10141. kindCount: 0 };
  10142. var mutations = {
  10143. // 设置购物车商品数量
  10144. setKindCount: function setKindCount(state, count) {
  10145. state.kindCount = count;
  10146. },
  10147. // 设置购物车有效商品
  10148. setGoodsList: function setGoodsList(state, list) {
  10149. state.goodsList = list;
  10150. },
  10151. // 设置购物车失效商品
  10152. setFailureList: function setFailureList(state, list) {
  10153. state.failureList = list;
  10154. },
  10155. // 设置购物车是否为空
  10156. setEmptyType: function setEmptyType(state, flag) {
  10157. state.isEmpty = flag;
  10158. },
  10159. saveCartIds: function saveCartIds(state, ids) {
  10160. state.cartIds = ids;
  10161. },
  10162. saveProductIds: function saveProductIds(state, ids) {
  10163. state.productIds = ids;
  10164. },
  10165. // 勾选/不勾选 失效商品
  10166. selectFailure: function selectFailure(state, _ref) {var productId = _ref.productId,checked = _ref.checked;
  10167. state.failureList.forEach(function (prod) {
  10168. if (prod.productId === productId) prod.productsChecked = checked;
  10169. });
  10170. },
  10171. // 勾选/取消勾选所有失效商品
  10172. selectAllFailure: function selectAllFailure(state, checked) {
  10173. state.failureList.forEach(function (prod) {
  10174. prod.productsChecked = checked;
  10175. });
  10176. },
  10177. // 重选商品
  10178. resetSelectProducts: function resetSelectProducts(state) {var cartIds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  10179. state.goodsList.forEach(function (shop) {
  10180. shop.productList.forEach(function (prod) {
  10181. if (cartIds.includes(prod.cartId)) prod.productsChecked = true;
  10182. });
  10183. shop.checked = shop.productList.every(function (prod) {return prod.productsChecked === true;});
  10184. });
  10185. },
  10186. // 勾选商品
  10187. selectProduct: function selectProduct(state, _ref2) {var shopId = _ref2.shopId,productId = _ref2.productId,checked = _ref2.checked;
  10188. state.goodsList.forEach(function (shop) {
  10189. if (shop.shopId !== shopId) return;
  10190. shop.productList.forEach(function (prod) {
  10191. if (prod.productId !== productId) return;
  10192. prod.productsChecked = checked;
  10193. });
  10194. shop.checked = shop.productList.every(function (prod) {return prod.productsChecked === true;});
  10195. });
  10196. },
  10197. // 全选/全不选 供应商下所有商品
  10198. selectAllShopProduct: function selectAllShopProduct(state, _ref3) {var shopId = _ref3.shopId,checked = _ref3.checked;
  10199. state.goodsList.forEach(function (shop) {
  10200. if (shop.shopId !== shopId) return;
  10201. shop.checked = checked;
  10202. shop.productList.forEach(function (prod) {
  10203. prod.productsChecked = checked;
  10204. });
  10205. });
  10206. },
  10207. // 全选/全不选 部商品
  10208. selectAllProduct: function selectAllProduct(state, checked) {
  10209. state.goodsList.forEach(function (shop) {
  10210. shop.checked = checked;
  10211. shop.productList.forEach(function (prod) {
  10212. prod.productsChecked = checked;
  10213. });
  10214. });
  10215. },
  10216. // 设置购物车商品数量角标
  10217. setTabBarBadge: function setTabBarBadge(state, num) {
  10218. if (num >= 100) {
  10219. uni.setTabBarBadge({
  10220. index: 1,
  10221. text: '99+' });
  10222. } else if (num > 0) {
  10223. uni.setTabBarBadge({
  10224. index: 1,
  10225. text: String(num) });
  10226. } else {
  10227. uni.removeTabBarBadge({
  10228. index: 1 });
  10229. }
  10230. } };
  10231. var actions = {
  10232. // 初始化购物车
  10233. initCart: function initCart(_ref4) {var rootGetters = _ref4.rootGetters,commit = _ref4.commit,state = _ref4.state;
  10234. return _index.productService.QueryShoppingCartList({ userId: rootGetters.userId }).
  10235. then(function (response) {
  10236. var data = response.data;
  10237. commit('setTabBarBadge', data.cartQuantity);
  10238. commit('setKindCount', data.cartQuantity);
  10239. if (data.shopList.length > 0 || data.products.length > 0) {
  10240. commit('setEmptyType', false);
  10241. } else {
  10242. commit('setEmptyType', true);
  10243. }
  10244. if (data.shopList && data.shopList.length > 0) {
  10245. commit('setGoodsList', totalShopPeice(data.shopList));
  10246. commit('resetSelectProducts', state.cartIds); // 勾选已选商品
  10247. } else {
  10248. commit('setGoodsList', []);
  10249. }
  10250. if (data.products && data.products.length > 0) {
  10251. commit('setFailureList', data.products);
  10252. } else {
  10253. commit('setFailureList', []);
  10254. }
  10255. }).
  10256. catch(function (error) {
  10257. (0, _util.msg)(error.msg, 2000);
  10258. });
  10259. },
  10260. // 获取购物车商品数量
  10261. getCartNumber: function getCartNumber(_ref5) {var commit = _ref5.commit,rootGetters = _ref5.rootGetters;
  10262. _index.productService.QueryShoppingQuantity({ userId: rootGetters.userId }).
  10263. then(function (response) {
  10264. commit('setTabBarBadge', response.data);
  10265. commit('setKindCount', response.data);
  10266. }).
  10267. catch(function (error) {
  10268. console.log('查询购物车数量错误信息', error);
  10269. });
  10270. },
  10271. // 添加购物车
  10272. addToCart: function addToCart(_ref6, _ref7) {var dispatch = _ref6.dispatch,rootGetters = _ref6.rootGetters;var productId = _ref7.productId,_ref7$productCount = _ref7.productCount,productCount = _ref7$productCount === void 0 ? 1 : _ref7$productCount,_ref7$heUserId = _ref7.heUserId,heUserId = _ref7$heUserId === void 0 ? 0 : _ref7$heUserId;
  10273. if (!rootGetters.hasLogin) return (0, _utilsTools.navigateTo)('/pages/login/login');
  10274. _index.productService.shoppingAddCart({
  10275. productId: productId,
  10276. userId: rootGetters.userId,
  10277. productCount: productCount,
  10278. heUserId: heUserId }).
  10279. then(function (response) {
  10280. (0, _util.msg)('加入购物车成功', 1500, true, 'success');
  10281. dispatch('getCartNumber');
  10282. }).catch(function (error) {
  10283. (0, _util.msg)(error.msg, 2000);
  10284. });
  10285. },
  10286. // 从购物车移除
  10287. removeFromCart: function removeFromCart(_ref8) {var dispatch = _ref8.dispatch,state = _ref8.state;var cartIds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  10288. // 从哪里获取cartIds
  10289. var removeCartIds = cartIds.length > 0 ? cartIds : state.cartIds;
  10290. return _index.productService.ShoppingCartDelete({
  10291. cartIds: removeCartIds.join(',') }).
  10292. then(function (response) {
  10293. dispatch('initCart');
  10294. (0, _util.msg)('删除成功', 2000);
  10295. }).catch(function (error) {
  10296. (0, _util.msg)(error.msg, 2000);
  10297. });
  10298. },
  10299. // 删除失效商品
  10300. removeFailureFromCart: function removeFailureFromCart(_ref9) {var dispatch = _ref9.dispatch,state = _ref9.state;
  10301. var cartIds = state.failureList.reduce(function (cartIds, prod) {
  10302. cartIds.push(prod.cartId);
  10303. return cartIds;
  10304. }, []);
  10305. return dispatch('removeFromCart', cartIds);
  10306. },
  10307. // 加减购物车商品更新到后台
  10308. updateShoppogCount: function updateShoppogCount(_ref10, _ref11) {var dispatch = _ref10.dispatch,state = _ref10.state;var cartId = _ref11.cartId,productCount = _ref11.productCount;
  10309. return _index.productService.ShoppingCartUpdate({
  10310. cartId: cartId,
  10311. productCount: productCount }).
  10312. finally(function () {
  10313. dispatch('initCart');
  10314. });
  10315. } };var _default =
  10316. {
  10317. namespaced: true,
  10318. state: state,
  10319. mutations: mutations,
  10320. actions: actions };exports.default = _default;
  10321. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  10322. /***/ }),
  10323. /* 19 */
  10324. /*!**************************************************************!*\
  10325. !*** D:/zheng_dev2021/caimei-applets-hehe/services/index.js ***!
  10326. \**************************************************************/
  10327. /*! no static exports found */
  10328. /***/ (function(module, exports, __webpack_require__) {
  10329. "use strict";
  10330. Object.defineProperty(exports, "__esModule", { value: true });exports.default = exports.couponService = exports.publicService = exports.orderService = exports.payService = exports.productService = exports.userService = exports.locateService = exports.commonService = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 3));
  10331. var _ajaxService = _interopRequireDefault(__webpack_require__(/*! ./ajax.service.js */ 20));
  10332. var _common = _interopRequireDefault(__webpack_require__(/*! ./common.service */ 21));
  10333. var _locate = _interopRequireDefault(__webpack_require__(/*! ./locate.service */ 22));
  10334. var _user = _interopRequireDefault(__webpack_require__(/*! ./user.service */ 26));
  10335. var _product = _interopRequireDefault(__webpack_require__(/*! ./product.service */ 27));
  10336. var _pay = _interopRequireDefault(__webpack_require__(/*! ./pay.service */ 28));
  10337. var _order = _interopRequireDefault(__webpack_require__(/*! ./order.service */ 29));
  10338. var _publicService = _interopRequireDefault(__webpack_require__(/*! ./public.service.js */ 30));
  10339. var _couponService = _interopRequireDefault(__webpack_require__(/*! ./coupon.service.js */ 31));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  10340. var commonService = new _common.default(_ajaxService.default);exports.commonService = commonService;
  10341. var locateService = new _locate.default(_ajaxService.default);exports.locateService = locateService;
  10342. var userService = new _user.default(_ajaxService.default);exports.userService = userService;
  10343. var productService = new _product.default(_ajaxService.default);exports.productService = productService;
  10344. var payService = new _pay.default(_ajaxService.default);exports.payService = payService;
  10345. var orderService = new _order.default(_ajaxService.default);exports.orderService = orderService;
  10346. var publicService = new _publicService.default(_ajaxService.default);exports.publicService = publicService;
  10347. var couponService = new _couponService.default(_ajaxService.default);exports.couponService = couponService;
  10348. var install = function install(Vue) {
  10349. console.log('初始化挂载接口方法');
  10350. Vue.prototype.AjaxService = _ajaxService.default;
  10351. Vue.prototype.CommonService = commonService;
  10352. Vue.prototype.LocateService = locateService;
  10353. Vue.prototype.UserService = userService;
  10354. Vue.prototype.ProductService = productService;
  10355. Vue.prototype.PayService = payService;
  10356. Vue.prototype.OrderService = orderService;
  10357. Vue.prototype.PublicService = publicService;
  10358. Vue.prototype.CouponService = couponService;
  10359. };var _default =
  10360. install;exports.default = _default;
  10361. /***/ }),
  10362. /* 20 */
  10363. /*!*********************************************************************!*\
  10364. !*** D:/zheng_dev2021/caimei-applets-hehe/services/ajax.service.js ***!
  10365. \*********************************************************************/
  10366. /*! no static exports found */
  10367. /***/ (function(module, exports, __webpack_require__) {
  10368. "use strict";
  10369. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  10370. var _config = _interopRequireDefault(__webpack_require__(/*! ./config.env */ 17));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}var
  10371. AjaxService = /*#__PURE__*/function () {
  10372. function AjaxService() {_classCallCheck(this, AjaxService);
  10373. this.name = 'AjaxService';
  10374. }_createClass(AjaxService, [{ key: "getBaseUrl", value: function getBaseUrl()
  10375. {var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  10376. return url.indexOf('://') > -1 ? url : _config.default + url;
  10377. } }, { key: "getHeaders", value: function getHeaders(_ref)
  10378. {var _ref$header = _ref.header,header = _ref$header === void 0 ? {} : _ref$header;
  10379. header['Accept'] = 'application/json';
  10380. header['Content-Type'] = 'application/json';
  10381. return header;
  10382. } }, { key: "request", value: function request()
  10383. {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  10384. var header = this.getHeaders(options);
  10385. var url = this.getBaseUrl(options.url);
  10386. if (options.header) {
  10387. header = Object.assign(header, options.header);
  10388. }var _options$isLoading =
  10389. options.isLoading,isLoading = _options$isLoading === void 0 ? true : _options$isLoading;
  10390. if (isLoading) {
  10391. uni.showLoading({ title: '加载中' });
  10392. }
  10393. var requestPromise = new Promise(function (resolve, reject) {
  10394. uni.request({
  10395. url: url,
  10396. method: options.method || 'POST',
  10397. data: options.data || {},
  10398. header: header,
  10399. success: function success(res) {
  10400. if (isLoading) uni.hideLoading();
  10401. if (options.isStatus) {
  10402. resolve(res.data);
  10403. } else {
  10404. if (res.data.code === 0) {
  10405. resolve(res.data);
  10406. } else {
  10407. reject(res.data);
  10408. }
  10409. }
  10410. },
  10411. fail: function fail(error) {
  10412. reject(error);
  10413. uni.hideLoading();
  10414. } });
  10415. });
  10416. return requestPromise;
  10417. } }, { key: "get", value: function get(
  10418. options) {
  10419. options.method = 'GET';
  10420. return this.request(options);
  10421. } }, { key: "post", value: function post(
  10422. options) {
  10423. options.method = 'POST';
  10424. return this.request(options);
  10425. } }]);return AjaxService;}();var _default =
  10426. new AjaxService();exports.default = _default;
  10427. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  10428. /***/ }),
  10429. /* 21 */
  10430. /*!***********************************************************************!*\
  10431. !*** D:/zheng_dev2021/caimei-applets-hehe/services/common.service.js ***!
  10432. \***********************************************************************/
  10433. /*! no static exports found */
  10434. /***/ (function(module, exports, __webpack_require__) {
  10435. "use strict";
  10436. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;} /**
  10437. * 这是所有模块公用业务逻辑的服务
  10438. */var
  10439. CommonService = /*#__PURE__*/function () {
  10440. function CommonService(AjaxService) {_classCallCheck(this, CommonService);
  10441. Object.assign(this, { AjaxService: AjaxService });
  10442. this.name = 'CommonService';
  10443. }
  10444. /* 商城首页轮播图 */_createClass(CommonService, [{ key: "GetProductCarousel", value: function GetProductCarousel()
  10445. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  10446. return this.AjaxService.get({
  10447. url: '/product/carousel',
  10448. data: data,
  10449. isLoading: false });
  10450. }
  10451. /* 商城首页初始化数据查询 */ }, { key: "GetHomeModulesDataInfo", value: function GetHomeModulesDataInfo()
  10452. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  10453. return this.AjaxService.get({
  10454. url: '/home/modules',
  10455. data: data,
  10456. isLoading: false });
  10457. } }]);return CommonService;}();exports.default = CommonService;
  10458. /***/ }),
  10459. /* 22 */
  10460. /*!***********************************************************************!*\
  10461. !*** D:/zheng_dev2021/caimei-applets-hehe/services/locate.service.js ***!
  10462. \***********************************************************************/
  10463. /*! no static exports found */
  10464. /***/ (function(module, exports, __webpack_require__) {
  10465. "use strict";
  10466. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 23));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;} /**
  10467. * 定位相关的业务服务
  10468. */
  10469. // import { qqMapKey } from '@/common/config.js'
  10470. // const QQMapWX = require('@/static/base/js/qqmap-wx-jssdk.min.js')
  10471. // const qqmapsdk = new QQMapWX({
  10472. // coord_type: 5,
  10473. // key: qqMapKey
  10474. // })
  10475. var
  10476. LocateService = /*#__PURE__*/function () {
  10477. function LocateService(AjaxService) {_classCallCheck(this, LocateService);
  10478. Object.assign(this, { AjaxService: AjaxService });
  10479. this.name = 'LocateService';
  10480. }
  10481. /* 获取当前的地理位置 */_createClass(LocateService, [{ key: "getGeoLocation", value: function getGeoLocation()
  10482. {
  10483. return new Promise(function (reslove, reject) {
  10484. wx.getLocation({
  10485. type: 'gcj02',
  10486. success: function success(res) {
  10487. reslove(res);
  10488. },
  10489. fail: function fail(err) {
  10490. reject(err);
  10491. },
  10492. complete: function complete(res) {} });
  10493. });
  10494. }
  10495. /* 获取城市名 */ }, { key: "getCityName", value: function getCityName(
  10496. lat, lon) {
  10497. return new Promise(function (reslove, reject) {
  10498. qqmapsdk.reverseGeocoder({
  10499. location: {
  10500. latitude: lat,
  10501. longitude: lon },
  10502. success: function success(res) {var _ref =
  10503. res.result || {},addressInfo = _ref.ad_info,location = _ref.location,_ref$formatted_addres = _ref.formatted_addresses,formattedAddress = _ref$formatted_addres === void 0 ? {} : _ref$formatted_addres,address = _ref.address;
  10504. var locationInfo = {
  10505. cityName: addressInfo.city,
  10506. location: location,
  10507. address: formattedAddress.recommend || address };
  10508. console.log('locationInfo: ' + locationInfo);
  10509. reslove(locationInfo);
  10510. },
  10511. fail: function fail(err) {
  10512. reject(err);
  10513. } });
  10514. });
  10515. }
  10516. /* 获取当前定位 */ }, { key: "getLocationByLocate", value: function () {var _getLocationByLocate = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee() {var locationInfo, _ref2, latitude, longitude, cityInfo, _cityInfo$location, location, cityName, address;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:_context.next = 2;return (
  10517. this.getGeoLocation());case 2:locationInfo = _context.sent;_ref2 =
  10518. locationInfo || {}, latitude = _ref2.latitude, longitude = _ref2.longitude;
  10519. // 获取城市名
  10520. _context.next = 6;return this.getCityName(latitude, longitude);case 6:cityInfo = _context.sent;_cityInfo$location =
  10521. cityInfo.location, location = _cityInfo$location === void 0 ? {} : _cityInfo$location, cityName = cityInfo.cityName, address = cityInfo.address;case 8:case "end":return _context.stop();}}}, _callee, this);}));function getLocationByLocate() {return _getLocationByLocate.apply(this, arguments);}return getLocationByLocate;}() }]);return LocateService;}();exports.default = LocateService;
  10522. /***/ }),
  10523. /* 23 */
  10524. /*!**********************************************************!*\
  10525. !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
  10526. \**********************************************************/
  10527. /*! no static exports found */
  10528. /***/ (function(module, exports, __webpack_require__) {
  10529. module.exports = __webpack_require__(/*! regenerator-runtime */ 24);
  10530. /***/ }),
  10531. /* 24 */
  10532. /*!************************************************************!*\
  10533. !*** ./node_modules/regenerator-runtime/runtime-module.js ***!
  10534. \************************************************************/
  10535. /*! no static exports found */
  10536. /***/ (function(module, exports, __webpack_require__) {
  10537. /**
  10538. * Copyright (c) 2014-present, Facebook, Inc.
  10539. *
  10540. * This source code is licensed under the MIT license found in the
  10541. * LICENSE file in the root directory of this source tree.
  10542. */
  10543. // This method of obtaining a reference to the global object needs to be
  10544. // kept identical to the way it is obtained in runtime.js
  10545. var g = (function() {
  10546. return this || (typeof self === "object" && self);
  10547. })() || Function("return this")();
  10548. // Use `getOwnPropertyNames` because not all browsers support calling
  10549. // `hasOwnProperty` on the global `self` object in a worker. See #183.
  10550. var hadRuntime = g.regeneratorRuntime &&
  10551. Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
  10552. // Save the old regeneratorRuntime in case it needs to be restored later.
  10553. var oldRuntime = hadRuntime && g.regeneratorRuntime;
  10554. // Force reevalutation of runtime.js.
  10555. g.regeneratorRuntime = undefined;
  10556. module.exports = __webpack_require__(/*! ./runtime */ 25);
  10557. if (hadRuntime) {
  10558. // Restore the original runtime.
  10559. g.regeneratorRuntime = oldRuntime;
  10560. } else {
  10561. // Remove the global property added by runtime.js.
  10562. try {
  10563. delete g.regeneratorRuntime;
  10564. } catch(e) {
  10565. g.regeneratorRuntime = undefined;
  10566. }
  10567. }
  10568. /***/ }),
  10569. /* 25 */
  10570. /*!*****************************************************!*\
  10571. !*** ./node_modules/regenerator-runtime/runtime.js ***!
  10572. \*****************************************************/
  10573. /*! no static exports found */
  10574. /***/ (function(module, exports) {
  10575. /**
  10576. * Copyright (c) 2014-present, Facebook, Inc.
  10577. *
  10578. * This source code is licensed under the MIT license found in the
  10579. * LICENSE file in the root directory of this source tree.
  10580. */
  10581. !(function(global) {
  10582. "use strict";
  10583. var Op = Object.prototype;
  10584. var hasOwn = Op.hasOwnProperty;
  10585. var undefined; // More compressible than void 0.
  10586. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  10587. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  10588. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  10589. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  10590. var inModule = typeof module === "object";
  10591. var runtime = global.regeneratorRuntime;
  10592. if (runtime) {
  10593. if (inModule) {
  10594. // If regeneratorRuntime is defined globally and we're in a module,
  10595. // make the exports object identical to regeneratorRuntime.
  10596. module.exports = runtime;
  10597. }
  10598. // Don't bother evaluating the rest of this file if the runtime was
  10599. // already defined globally.
  10600. return;
  10601. }
  10602. // Define the runtime globally (as expected by generated code) as either
  10603. // module.exports (if we're in a module) or a new, empty object.
  10604. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  10605. function wrap(innerFn, outerFn, self, tryLocsList) {
  10606. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  10607. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  10608. var generator = Object.create(protoGenerator.prototype);
  10609. var context = new Context(tryLocsList || []);
  10610. // The ._invoke method unifies the implementations of the .next,
  10611. // .throw, and .return methods.
  10612. generator._invoke = makeInvokeMethod(innerFn, self, context);
  10613. return generator;
  10614. }
  10615. runtime.wrap = wrap;
  10616. // Try/catch helper to minimize deoptimizations. Returns a completion
  10617. // record like context.tryEntries[i].completion. This interface could
  10618. // have been (and was previously) designed to take a closure to be
  10619. // invoked without arguments, but in all the cases we care about we
  10620. // already have an existing method we want to call, so there's no need
  10621. // to create a new function object. We can even get away with assuming
  10622. // the method takes exactly one argument, since that happens to be true
  10623. // in every case, so we don't have to touch the arguments object. The
  10624. // only additional allocation required is the completion record, which
  10625. // has a stable shape and so hopefully should be cheap to allocate.
  10626. function tryCatch(fn, obj, arg) {
  10627. try {
  10628. return { type: "normal", arg: fn.call(obj, arg) };
  10629. } catch (err) {
  10630. return { type: "throw", arg: err };
  10631. }
  10632. }
  10633. var GenStateSuspendedStart = "suspendedStart";
  10634. var GenStateSuspendedYield = "suspendedYield";
  10635. var GenStateExecuting = "executing";
  10636. var GenStateCompleted = "completed";
  10637. // Returning this object from the innerFn has the same effect as
  10638. // breaking out of the dispatch switch statement.
  10639. var ContinueSentinel = {};
  10640. // Dummy constructor functions that we use as the .constructor and
  10641. // .constructor.prototype properties for functions that return Generator
  10642. // objects. For full spec compliance, you may wish to configure your
  10643. // minifier not to mangle the names of these two functions.
  10644. function Generator() {}
  10645. function GeneratorFunction() {}
  10646. function GeneratorFunctionPrototype() {}
  10647. // This is a polyfill for %IteratorPrototype% for environments that
  10648. // don't natively support it.
  10649. var IteratorPrototype = {};
  10650. IteratorPrototype[iteratorSymbol] = function () {
  10651. return this;
  10652. };
  10653. var getProto = Object.getPrototypeOf;
  10654. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  10655. if (NativeIteratorPrototype &&
  10656. NativeIteratorPrototype !== Op &&
  10657. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  10658. // This environment has a native %IteratorPrototype%; use it instead
  10659. // of the polyfill.
  10660. IteratorPrototype = NativeIteratorPrototype;
  10661. }
  10662. var Gp = GeneratorFunctionPrototype.prototype =
  10663. Generator.prototype = Object.create(IteratorPrototype);
  10664. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  10665. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  10666. GeneratorFunctionPrototype[toStringTagSymbol] =
  10667. GeneratorFunction.displayName = "GeneratorFunction";
  10668. // Helper for defining the .next, .throw, and .return methods of the
  10669. // Iterator interface in terms of a single ._invoke method.
  10670. function defineIteratorMethods(prototype) {
  10671. ["next", "throw", "return"].forEach(function(method) {
  10672. prototype[method] = function(arg) {
  10673. return this._invoke(method, arg);
  10674. };
  10675. });
  10676. }
  10677. runtime.isGeneratorFunction = function(genFun) {
  10678. var ctor = typeof genFun === "function" && genFun.constructor;
  10679. return ctor
  10680. ? ctor === GeneratorFunction ||
  10681. // For the native GeneratorFunction constructor, the best we can
  10682. // do is to check its .name property.
  10683. (ctor.displayName || ctor.name) === "GeneratorFunction"
  10684. : false;
  10685. };
  10686. runtime.mark = function(genFun) {
  10687. if (Object.setPrototypeOf) {
  10688. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  10689. } else {
  10690. genFun.__proto__ = GeneratorFunctionPrototype;
  10691. if (!(toStringTagSymbol in genFun)) {
  10692. genFun[toStringTagSymbol] = "GeneratorFunction";
  10693. }
  10694. }
  10695. genFun.prototype = Object.create(Gp);
  10696. return genFun;
  10697. };
  10698. // Within the body of any async function, `await x` is transformed to
  10699. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  10700. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  10701. // meant to be awaited.
  10702. runtime.awrap = function(arg) {
  10703. return { __await: arg };
  10704. };
  10705. function AsyncIterator(generator) {
  10706. function invoke(method, arg, resolve, reject) {
  10707. var record = tryCatch(generator[method], generator, arg);
  10708. if (record.type === "throw") {
  10709. reject(record.arg);
  10710. } else {
  10711. var result = record.arg;
  10712. var value = result.value;
  10713. if (value &&
  10714. typeof value === "object" &&
  10715. hasOwn.call(value, "__await")) {
  10716. return Promise.resolve(value.__await).then(function(value) {
  10717. invoke("next", value, resolve, reject);
  10718. }, function(err) {
  10719. invoke("throw", err, resolve, reject);
  10720. });
  10721. }
  10722. return Promise.resolve(value).then(function(unwrapped) {
  10723. // When a yielded Promise is resolved, its final value becomes
  10724. // the .value of the Promise<{value,done}> result for the
  10725. // current iteration.
  10726. result.value = unwrapped;
  10727. resolve(result);
  10728. }, function(error) {
  10729. // If a rejected Promise was yielded, throw the rejection back
  10730. // into the async generator function so it can be handled there.
  10731. return invoke("throw", error, resolve, reject);
  10732. });
  10733. }
  10734. }
  10735. var previousPromise;
  10736. function enqueue(method, arg) {
  10737. function callInvokeWithMethodAndArg() {
  10738. return new Promise(function(resolve, reject) {
  10739. invoke(method, arg, resolve, reject);
  10740. });
  10741. }
  10742. return previousPromise =
  10743. // If enqueue has been called before, then we want to wait until
  10744. // all previous Promises have been resolved before calling invoke,
  10745. // so that results are always delivered in the correct order. If
  10746. // enqueue has not been called before, then it is important to
  10747. // call invoke immediately, without waiting on a callback to fire,
  10748. // so that the async generator function has the opportunity to do
  10749. // any necessary setup in a predictable way. This predictability
  10750. // is why the Promise constructor synchronously invokes its
  10751. // executor callback, and why async functions synchronously
  10752. // execute code before the first await. Since we implement simple
  10753. // async functions in terms of async generators, it is especially
  10754. // important to get this right, even though it requires care.
  10755. previousPromise ? previousPromise.then(
  10756. callInvokeWithMethodAndArg,
  10757. // Avoid propagating failures to Promises returned by later
  10758. // invocations of the iterator.
  10759. callInvokeWithMethodAndArg
  10760. ) : callInvokeWithMethodAndArg();
  10761. }
  10762. // Define the unified helper method that is used to implement .next,
  10763. // .throw, and .return (see defineIteratorMethods).
  10764. this._invoke = enqueue;
  10765. }
  10766. defineIteratorMethods(AsyncIterator.prototype);
  10767. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  10768. return this;
  10769. };
  10770. runtime.AsyncIterator = AsyncIterator;
  10771. // Note that simple async functions are implemented on top of
  10772. // AsyncIterator objects; they just return a Promise for the value of
  10773. // the final result produced by the iterator.
  10774. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  10775. var iter = new AsyncIterator(
  10776. wrap(innerFn, outerFn, self, tryLocsList)
  10777. );
  10778. return runtime.isGeneratorFunction(outerFn)
  10779. ? iter // If outerFn is a generator, return the full iterator.
  10780. : iter.next().then(function(result) {
  10781. return result.done ? result.value : iter.next();
  10782. });
  10783. };
  10784. function makeInvokeMethod(innerFn, self, context) {
  10785. var state = GenStateSuspendedStart;
  10786. return function invoke(method, arg) {
  10787. if (state === GenStateExecuting) {
  10788. throw new Error("Generator is already running");
  10789. }
  10790. if (state === GenStateCompleted) {
  10791. if (method === "throw") {
  10792. throw arg;
  10793. }
  10794. // Be forgiving, per 25.3.3.3.3 of the spec:
  10795. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  10796. return doneResult();
  10797. }
  10798. context.method = method;
  10799. context.arg = arg;
  10800. while (true) {
  10801. var delegate = context.delegate;
  10802. if (delegate) {
  10803. var delegateResult = maybeInvokeDelegate(delegate, context);
  10804. if (delegateResult) {
  10805. if (delegateResult === ContinueSentinel) continue;
  10806. return delegateResult;
  10807. }
  10808. }
  10809. if (context.method === "next") {
  10810. // Setting context._sent for legacy support of Babel's
  10811. // function.sent implementation.
  10812. context.sent = context._sent = context.arg;
  10813. } else if (context.method === "throw") {
  10814. if (state === GenStateSuspendedStart) {
  10815. state = GenStateCompleted;
  10816. throw context.arg;
  10817. }
  10818. context.dispatchException(context.arg);
  10819. } else if (context.method === "return") {
  10820. context.abrupt("return", context.arg);
  10821. }
  10822. state = GenStateExecuting;
  10823. var record = tryCatch(innerFn, self, context);
  10824. if (record.type === "normal") {
  10825. // If an exception is thrown from innerFn, we leave state ===
  10826. // GenStateExecuting and loop back for another invocation.
  10827. state = context.done
  10828. ? GenStateCompleted
  10829. : GenStateSuspendedYield;
  10830. if (record.arg === ContinueSentinel) {
  10831. continue;
  10832. }
  10833. return {
  10834. value: record.arg,
  10835. done: context.done
  10836. };
  10837. } else if (record.type === "throw") {
  10838. state = GenStateCompleted;
  10839. // Dispatch the exception by looping back around to the
  10840. // context.dispatchException(context.arg) call above.
  10841. context.method = "throw";
  10842. context.arg = record.arg;
  10843. }
  10844. }
  10845. };
  10846. }
  10847. // Call delegate.iterator[context.method](context.arg) and handle the
  10848. // result, either by returning a { value, done } result from the
  10849. // delegate iterator, or by modifying context.method and context.arg,
  10850. // setting context.delegate to null, and returning the ContinueSentinel.
  10851. function maybeInvokeDelegate(delegate, context) {
  10852. var method = delegate.iterator[context.method];
  10853. if (method === undefined) {
  10854. // A .throw or .return when the delegate iterator has no .throw
  10855. // method always terminates the yield* loop.
  10856. context.delegate = null;
  10857. if (context.method === "throw") {
  10858. if (delegate.iterator.return) {
  10859. // If the delegate iterator has a return method, give it a
  10860. // chance to clean up.
  10861. context.method = "return";
  10862. context.arg = undefined;
  10863. maybeInvokeDelegate(delegate, context);
  10864. if (context.method === "throw") {
  10865. // If maybeInvokeDelegate(context) changed context.method from
  10866. // "return" to "throw", let that override the TypeError below.
  10867. return ContinueSentinel;
  10868. }
  10869. }
  10870. context.method = "throw";
  10871. context.arg = new TypeError(
  10872. "The iterator does not provide a 'throw' method");
  10873. }
  10874. return ContinueSentinel;
  10875. }
  10876. var record = tryCatch(method, delegate.iterator, context.arg);
  10877. if (record.type === "throw") {
  10878. context.method = "throw";
  10879. context.arg = record.arg;
  10880. context.delegate = null;
  10881. return ContinueSentinel;
  10882. }
  10883. var info = record.arg;
  10884. if (! info) {
  10885. context.method = "throw";
  10886. context.arg = new TypeError("iterator result is not an object");
  10887. context.delegate = null;
  10888. return ContinueSentinel;
  10889. }
  10890. if (info.done) {
  10891. // Assign the result of the finished delegate to the temporary
  10892. // variable specified by delegate.resultName (see delegateYield).
  10893. context[delegate.resultName] = info.value;
  10894. // Resume execution at the desired location (see delegateYield).
  10895. context.next = delegate.nextLoc;
  10896. // If context.method was "throw" but the delegate handled the
  10897. // exception, let the outer generator proceed normally. If
  10898. // context.method was "next", forget context.arg since it has been
  10899. // "consumed" by the delegate iterator. If context.method was
  10900. // "return", allow the original .return call to continue in the
  10901. // outer generator.
  10902. if (context.method !== "return") {
  10903. context.method = "next";
  10904. context.arg = undefined;
  10905. }
  10906. } else {
  10907. // Re-yield the result returned by the delegate method.
  10908. return info;
  10909. }
  10910. // The delegate iterator is finished, so forget it and continue with
  10911. // the outer generator.
  10912. context.delegate = null;
  10913. return ContinueSentinel;
  10914. }
  10915. // Define Generator.prototype.{next,throw,return} in terms of the
  10916. // unified ._invoke helper method.
  10917. defineIteratorMethods(Gp);
  10918. Gp[toStringTagSymbol] = "Generator";
  10919. // A Generator should always return itself as the iterator object when the
  10920. // @@iterator function is called on it. Some browsers' implementations of the
  10921. // iterator prototype chain incorrectly implement this, causing the Generator
  10922. // object to not be returned from this call. This ensures that doesn't happen.
  10923. // See https://github.com/facebook/regenerator/issues/274 for more details.
  10924. Gp[iteratorSymbol] = function() {
  10925. return this;
  10926. };
  10927. Gp.toString = function() {
  10928. return "[object Generator]";
  10929. };
  10930. function pushTryEntry(locs) {
  10931. var entry = { tryLoc: locs[0] };
  10932. if (1 in locs) {
  10933. entry.catchLoc = locs[1];
  10934. }
  10935. if (2 in locs) {
  10936. entry.finallyLoc = locs[2];
  10937. entry.afterLoc = locs[3];
  10938. }
  10939. this.tryEntries.push(entry);
  10940. }
  10941. function resetTryEntry(entry) {
  10942. var record = entry.completion || {};
  10943. record.type = "normal";
  10944. delete record.arg;
  10945. entry.completion = record;
  10946. }
  10947. function Context(tryLocsList) {
  10948. // The root entry object (effectively a try statement without a catch
  10949. // or a finally block) gives us a place to store values thrown from
  10950. // locations where there is no enclosing try statement.
  10951. this.tryEntries = [{ tryLoc: "root" }];
  10952. tryLocsList.forEach(pushTryEntry, this);
  10953. this.reset(true);
  10954. }
  10955. runtime.keys = function(object) {
  10956. var keys = [];
  10957. for (var key in object) {
  10958. keys.push(key);
  10959. }
  10960. keys.reverse();
  10961. // Rather than returning an object with a next method, we keep
  10962. // things simple and return the next function itself.
  10963. return function next() {
  10964. while (keys.length) {
  10965. var key = keys.pop();
  10966. if (key in object) {
  10967. next.value = key;
  10968. next.done = false;
  10969. return next;
  10970. }
  10971. }
  10972. // To avoid creating an additional object, we just hang the .value
  10973. // and .done properties off the next function object itself. This
  10974. // also ensures that the minifier will not anonymize the function.
  10975. next.done = true;
  10976. return next;
  10977. };
  10978. };
  10979. function values(iterable) {
  10980. if (iterable) {
  10981. var iteratorMethod = iterable[iteratorSymbol];
  10982. if (iteratorMethod) {
  10983. return iteratorMethod.call(iterable);
  10984. }
  10985. if (typeof iterable.next === "function") {
  10986. return iterable;
  10987. }
  10988. if (!isNaN(iterable.length)) {
  10989. var i = -1, next = function next() {
  10990. while (++i < iterable.length) {
  10991. if (hasOwn.call(iterable, i)) {
  10992. next.value = iterable[i];
  10993. next.done = false;
  10994. return next;
  10995. }
  10996. }
  10997. next.value = undefined;
  10998. next.done = true;
  10999. return next;
  11000. };
  11001. return next.next = next;
  11002. }
  11003. }
  11004. // Return an iterator with no values.
  11005. return { next: doneResult };
  11006. }
  11007. runtime.values = values;
  11008. function doneResult() {
  11009. return { value: undefined, done: true };
  11010. }
  11011. Context.prototype = {
  11012. constructor: Context,
  11013. reset: function(skipTempReset) {
  11014. this.prev = 0;
  11015. this.next = 0;
  11016. // Resetting context._sent for legacy support of Babel's
  11017. // function.sent implementation.
  11018. this.sent = this._sent = undefined;
  11019. this.done = false;
  11020. this.delegate = null;
  11021. this.method = "next";
  11022. this.arg = undefined;
  11023. this.tryEntries.forEach(resetTryEntry);
  11024. if (!skipTempReset) {
  11025. for (var name in this) {
  11026. // Not sure about the optimal order of these conditions:
  11027. if (name.charAt(0) === "t" &&
  11028. hasOwn.call(this, name) &&
  11029. !isNaN(+name.slice(1))) {
  11030. this[name] = undefined;
  11031. }
  11032. }
  11033. }
  11034. },
  11035. stop: function() {
  11036. this.done = true;
  11037. var rootEntry = this.tryEntries[0];
  11038. var rootRecord = rootEntry.completion;
  11039. if (rootRecord.type === "throw") {
  11040. throw rootRecord.arg;
  11041. }
  11042. return this.rval;
  11043. },
  11044. dispatchException: function(exception) {
  11045. if (this.done) {
  11046. throw exception;
  11047. }
  11048. var context = this;
  11049. function handle(loc, caught) {
  11050. record.type = "throw";
  11051. record.arg = exception;
  11052. context.next = loc;
  11053. if (caught) {
  11054. // If the dispatched exception was caught by a catch block,
  11055. // then let that catch block handle the exception normally.
  11056. context.method = "next";
  11057. context.arg = undefined;
  11058. }
  11059. return !! caught;
  11060. }
  11061. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  11062. var entry = this.tryEntries[i];
  11063. var record = entry.completion;
  11064. if (entry.tryLoc === "root") {
  11065. // Exception thrown outside of any try block that could handle
  11066. // it, so set the completion value of the entire function to
  11067. // throw the exception.
  11068. return handle("end");
  11069. }
  11070. if (entry.tryLoc <= this.prev) {
  11071. var hasCatch = hasOwn.call(entry, "catchLoc");
  11072. var hasFinally = hasOwn.call(entry, "finallyLoc");
  11073. if (hasCatch && hasFinally) {
  11074. if (this.prev < entry.catchLoc) {
  11075. return handle(entry.catchLoc, true);
  11076. } else if (this.prev < entry.finallyLoc) {
  11077. return handle(entry.finallyLoc);
  11078. }
  11079. } else if (hasCatch) {
  11080. if (this.prev < entry.catchLoc) {
  11081. return handle(entry.catchLoc, true);
  11082. }
  11083. } else if (hasFinally) {
  11084. if (this.prev < entry.finallyLoc) {
  11085. return handle(entry.finallyLoc);
  11086. }
  11087. } else {
  11088. throw new Error("try statement without catch or finally");
  11089. }
  11090. }
  11091. }
  11092. },
  11093. abrupt: function(type, arg) {
  11094. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  11095. var entry = this.tryEntries[i];
  11096. if (entry.tryLoc <= this.prev &&
  11097. hasOwn.call(entry, "finallyLoc") &&
  11098. this.prev < entry.finallyLoc) {
  11099. var finallyEntry = entry;
  11100. break;
  11101. }
  11102. }
  11103. if (finallyEntry &&
  11104. (type === "break" ||
  11105. type === "continue") &&
  11106. finallyEntry.tryLoc <= arg &&
  11107. arg <= finallyEntry.finallyLoc) {
  11108. // Ignore the finally entry if control is not jumping to a
  11109. // location outside the try/catch block.
  11110. finallyEntry = null;
  11111. }
  11112. var record = finallyEntry ? finallyEntry.completion : {};
  11113. record.type = type;
  11114. record.arg = arg;
  11115. if (finallyEntry) {
  11116. this.method = "next";
  11117. this.next = finallyEntry.finallyLoc;
  11118. return ContinueSentinel;
  11119. }
  11120. return this.complete(record);
  11121. },
  11122. complete: function(record, afterLoc) {
  11123. if (record.type === "throw") {
  11124. throw record.arg;
  11125. }
  11126. if (record.type === "break" ||
  11127. record.type === "continue") {
  11128. this.next = record.arg;
  11129. } else if (record.type === "return") {
  11130. this.rval = this.arg = record.arg;
  11131. this.method = "return";
  11132. this.next = "end";
  11133. } else if (record.type === "normal" && afterLoc) {
  11134. this.next = afterLoc;
  11135. }
  11136. return ContinueSentinel;
  11137. },
  11138. finish: function(finallyLoc) {
  11139. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  11140. var entry = this.tryEntries[i];
  11141. if (entry.finallyLoc === finallyLoc) {
  11142. this.complete(entry.completion, entry.afterLoc);
  11143. resetTryEntry(entry);
  11144. return ContinueSentinel;
  11145. }
  11146. }
  11147. },
  11148. "catch": function(tryLoc) {
  11149. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  11150. var entry = this.tryEntries[i];
  11151. if (entry.tryLoc === tryLoc) {
  11152. var record = entry.completion;
  11153. if (record.type === "throw") {
  11154. var thrown = record.arg;
  11155. resetTryEntry(entry);
  11156. }
  11157. return thrown;
  11158. }
  11159. }
  11160. // The context.catch method must only be called with a location
  11161. // argument that corresponds to a known catch block.
  11162. throw new Error("illegal catch attempt");
  11163. },
  11164. delegateYield: function(iterable, resultName, nextLoc) {
  11165. this.delegate = {
  11166. iterator: values(iterable),
  11167. resultName: resultName,
  11168. nextLoc: nextLoc
  11169. };
  11170. if (this.method === "next") {
  11171. // Deliberately forget the last sent value so that we don't
  11172. // accidentally pass it on to the delegate.
  11173. this.arg = undefined;
  11174. }
  11175. return ContinueSentinel;
  11176. }
  11177. };
  11178. })(
  11179. // In sloppy mode, unbound `this` refers to the global object, fallback to
  11180. // Function constructor if we're in global strict mode. That is sadly a form
  11181. // of indirect eval which violates Content Security Policy.
  11182. (function() {
  11183. return this || (typeof self === "object" && self);
  11184. })() || Function("return this")()
  11185. );
  11186. /***/ }),
  11187. /* 26 */
  11188. /*!*********************************************************************!*\
  11189. !*** D:/zheng_dev2021/caimei-applets-hehe/services/user.service.js ***!
  11190. \*********************************************************************/
  11191. /*! no static exports found */
  11192. /***/ (function(module, exports, __webpack_require__) {
  11193. "use strict";
  11194. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;} /**
  11195. * 这是用户业务逻辑的服务
  11196. */var
  11197. UserService = /*#__PURE__*/function () {
  11198. function UserService(AjaxService) {_classCallCheck(this, UserService);
  11199. Object.assign(this, {
  11200. AjaxService: AjaxService });
  11201. this.name = 'UserService';
  11202. }
  11203. /* 初始化授权登录 */_createClass(UserService, [{ key: "UserWechatAuthorLogin", value: function UserWechatAuthorLogin()
  11204. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11205. return this.AjaxService.get({
  11206. url: '/user/he/authorization',
  11207. data: data,
  11208. isLoading: false,
  11209. isStatus: false,
  11210. isHost: true });
  11211. }
  11212. /* 手机号验证码登录 */ }, { key: "UserMobileLogin", value: function UserMobileLogin()
  11213. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11214. return this.AjaxService.post({
  11215. url: '/user/he/mobile/login',
  11216. data: data,
  11217. isLoading: false,
  11218. isStatus: false });
  11219. }
  11220. /**
  11221. * @地址列表查询
  11222. * @param:userId 用户ID(必传),
  11223. * @param:pageNum 页码
  11224. * @param:pageSize 每页条数
  11225. */ }, { key: "QueryAddressList", value: function QueryAddressList()
  11226. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11227. return this.AjaxService.get({
  11228. url: '/other/findAddress',
  11229. data: data,
  11230. isLoading: false });
  11231. }
  11232. /**
  11233. * @添加&&修改地址
  11234. */ }, { key: "AddOtherSaveAddress", value: function AddOtherSaveAddress()
  11235. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11236. return this.AjaxService.post({
  11237. url: '/other/saveAddress',
  11238. data: data,
  11239. isLoading: true });
  11240. }
  11241. /**
  11242. * @删除地址
  11243. * @param:addressId 地址ID,,
  11244. */ }, { key: "DeleteOtherAddress", value: function DeleteOtherAddress()
  11245. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11246. return this.AjaxService.get({
  11247. url: '/other/deleteAddress',
  11248. data: data,
  11249. isLoading: true });
  11250. }
  11251. /**
  11252. * @设置默认地址
  11253. * @param:userId 用户ID(必传),
  11254. * @param:addressId 地址ID,
  11255. */ }, { key: "SetDefaultOtherAddress", value: function SetDefaultOtherAddress()
  11256. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11257. return this.AjaxService.get({
  11258. url: '/other/defaultAddress',
  11259. data: data,
  11260. isLoading: false });
  11261. }
  11262. /**
  11263. * @设置默认地址
  11264. * @param:userId 用户ID(必传),
  11265. * @param:addressId 地址ID,
  11266. */ }, { key: "GetUserOrderTotal", value: function GetUserOrderTotal()
  11267. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11268. return this.AjaxService.get({
  11269. url: '/order/order/total',
  11270. data: data,
  11271. isLoading: false });
  11272. } }]);return UserService;}();exports.default = UserService;
  11273. /***/ }),
  11274. /* 27 */
  11275. /*!************************************************************************!*\
  11276. !*** D:/zheng_dev2021/caimei-applets-hehe/services/product.service.js ***!
  11277. \************************************************************************/
  11278. /*! no static exports found */
  11279. /***/ (function(module, exports, __webpack_require__) {
  11280. "use strict";
  11281. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;} /**
  11282. * 这是与购物有关的业务逻辑的服务
  11283. */var
  11284. ProductService = /*#__PURE__*/function () {
  11285. function ProductService(AjaxService) {_classCallCheck(this, ProductService);
  11286. Object.assign(this, { AjaxService: AjaxService });
  11287. this.name = 'ProductService';
  11288. }
  11289. /**
  11290. * @description 获取楼层数据
  11291. */_createClass(ProductService, [{ key: "QueryProductFloor", value: function QueryProductFloor()
  11292. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11293. return this.AjaxService.get({
  11294. url: '/product/floor',
  11295. data: data,
  11296. isLoading: false });
  11297. }
  11298. /**
  11299. * @description 获取楼层商品详情
  11300. * @param:name 商品名称关键词
  11301. * @param:pageNum 页码
  11302. * @param:pageSize 条数
  11303. */ }, { key: "QueryProductList", value: function QueryProductList()
  11304. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11305. return this.AjaxService.get({
  11306. url: '/product/floor/detail',
  11307. data: data,
  11308. isLoading: false });
  11309. }
  11310. /**
  11311. * @description 获取商品列表
  11312. * @param:name 商品名称关键词
  11313. * @param:pageNum 页码
  11314. * @param:pageSize 条数
  11315. */ }, { key: "GetProductList", value: function GetProductList()
  11316. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11317. return this.AjaxService.get({
  11318. url: '/product/list',
  11319. data: data,
  11320. isLoading: false });
  11321. }
  11322. /**
  11323. * @商品详情-查询商品详情
  11324. * @param:userId 用户ID(未登录传0或者'')
  11325. * @param:productIds 商品ID
  11326. */ }, { key: "QueryProductDetils", value: function QueryProductDetils()
  11327. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11328. return this.AjaxService.get({
  11329. url: '/product/details',
  11330. data: data,
  11331. isLoading: false });
  11332. }
  11333. /**
  11334. * @加入购物车
  11335. * @param:userId 用户ID(必填)
  11336. * @param:productId 用户ID(必填)
  11337. * @param:productCount 商品数量(必填)
  11338. */ }, { key: "shoppingAddCart", value: function shoppingAddCart()
  11339. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11340. return this.AjaxService.post({
  11341. url: '/shopping/add/cart',
  11342. data: data,
  11343. isLoading: false });
  11344. }
  11345. /**
  11346. * @再次购买----一键加入购物车
  11347. * @param:orderId 用户ID(必填)
  11348. */ }, { key: "ShoppingAgainCart", value: function ShoppingAgainCart()
  11349. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11350. return this.AjaxService.get({
  11351. url: '/shopping/addCart',
  11352. data: data,
  11353. isLoading: false });
  11354. }
  11355. /**
  11356. * @购物车列表
  11357. * @param:userId 用户ID(必填)
  11358. */ }, { key: "QueryShoppingCartList", value: function QueryShoppingCartList()
  11359. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11360. return this.AjaxService.get({
  11361. url: '/shopping/info',
  11362. data: data,
  11363. isLoading: false });
  11364. }
  11365. /**
  11366. * @查询购物车数量
  11367. * @param:userId 用户ID(必填)
  11368. */ }, { key: "QueryShoppingQuantity", value: function QueryShoppingQuantity()
  11369. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11370. return this.AjaxService.get({
  11371. url: '/shopping/quantity',
  11372. data: data,
  11373. isLoading: false });
  11374. }
  11375. /**
  11376. * @更新购物车商品增减
  11377. * @param:cartId 购物车ID
  11378. * @param:productCount 商品数量ID(必填)
  11379. */ }, { key: "ShoppingCartUpdate", value: function ShoppingCartUpdate()
  11380. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11381. return this.AjaxService.post({
  11382. url: '/shopping/update',
  11383. data: data,
  11384. isLoading: false });
  11385. }
  11386. /**
  11387. * @删除购物车商品
  11388. * @param:cartIds 购物车ID(用','号拼接)
  11389. */ }, { key: "ShoppingCartDelete", value: function ShoppingCartDelete()
  11390. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11391. return this.AjaxService.post({
  11392. url: '/shopping/delete',
  11393. data: data,
  11394. isLoading: false });
  11395. }
  11396. /* 查询搜索历史记录 */ }, { key: "GetProductSearchHistory", value: function GetProductSearchHistory()
  11397. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11398. return this.AjaxService.get({
  11399. url: '/product/search/history',
  11400. data: data,
  11401. isLoading: false });
  11402. }
  11403. /* 清除搜索历史记录 */ }, { key: "GetDeleteProductSearchHistory", value: function GetDeleteProductSearchHistory()
  11404. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11405. return this.AjaxService.get({
  11406. url: '/product/delete/history',
  11407. data: data,
  11408. isLoading: false });
  11409. }
  11410. /* 搜索商品列表 */ }, { key: "GetProductSearchList", value: function GetProductSearchList()
  11411. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11412. return this.AjaxService.get({
  11413. url: '/search/query/product',
  11414. data: data,
  11415. isLoading: true });
  11416. }
  11417. /* 活动专区 */ }, { key: "GetProductActivityAreaList", value: function GetProductActivityAreaList()
  11418. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11419. return this.AjaxService.get({
  11420. url: '/product/activityArea',
  11421. data: data,
  11422. isLoading: false });
  11423. }
  11424. /* 活动详情 */ }, { key: "GetProductActivityDetails", value: function GetProductActivityDetails()
  11425. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11426. return this.AjaxService.get({
  11427. url: '/product/activity/details',
  11428. data: data,
  11429. isLoading: false });
  11430. } }]);return ProductService;}();exports.default = ProductService;
  11431. /***/ }),
  11432. /* 28 */
  11433. /*!********************************************************************!*\
  11434. !*** D:/zheng_dev2021/caimei-applets-hehe/services/pay.service.js ***!
  11435. \********************************************************************/
  11436. /*! no static exports found */
  11437. /***/ (function(module, exports, __webpack_require__) {
  11438. "use strict";
  11439. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;} /**
  11440. * 这是支付相关的业务逻辑的服务
  11441. */var
  11442. PayService = /*#__PURE__*/function () {
  11443. function PayService(AjaxService) {_classCallCheck(this, PayService);
  11444. Object.assign(this, { AjaxService: AjaxService });
  11445. this.name = 'PayService';
  11446. }
  11447. /**
  11448. *小程序支付-微信支付
  11449. *@param amount支付金额,单位分,必须大于2
  11450. *@param payWay银联:UNIONPAY,微信:WEIXIN,支付宝:ALIPAY
  11451. *@param payType 微信小程序支付: MINIAPP_WEIXIN ,微信公众号支付: JSAPI_WEIXIN
  11452. *@param code 微信小程序code,微信小程序支付使用
  11453. *@param orderId 主订单ID
  11454. */_createClass(PayService, [{ key: "WeChatMiniWxPay", value: function WeChatMiniWxPay()
  11455. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11456. return this.AjaxService.post({
  11457. url: '/PayOrder/miniWxPay',
  11458. data: data,
  11459. isLoading: false });
  11460. }
  11461. /**
  11462. *小程序线上支付开关
  11463. */ }, { key: "PayOrderOnLineSwitch", value: function PayOrderOnLineSwitch()
  11464. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11465. return this.AjaxService.get({
  11466. url: '/PayOrder/onLineSwitch',
  11467. data: data,
  11468. isLoading: false });
  11469. } }]);return PayService;}();exports.default = PayService;
  11470. /***/ }),
  11471. /* 29 */
  11472. /*!**********************************************************************!*\
  11473. !*** D:/zheng_dev2021/caimei-applets-hehe/services/order.service.js ***!
  11474. \**********************************************************************/
  11475. /*! no static exports found */
  11476. /***/ (function(module, exports, __webpack_require__) {
  11477. "use strict";
  11478. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;} /**
  11479. * 这是与购物有关的业务逻辑的服务
  11480. */var
  11481. OrderService = /*#__PURE__*/function () {
  11482. function OrderService(AjaxService) {_classCallCheck(this, OrderService);
  11483. Object.assign(this, { AjaxService: AjaxService });
  11484. this.name = 'OrderService';
  11485. }
  11486. /* 订单结算初始化 */_createClass(OrderService, [{ key: "QueryOrderConfirm", value: function QueryOrderConfirm()
  11487. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11488. return this.AjaxService.get({
  11489. url: '/order/confirm',
  11490. data: data,
  11491. isLoading: false });
  11492. }
  11493. /* 提交订单 */ }, { key: "QueryOrderSubmit", value: function QueryOrderSubmit()
  11494. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11495. return this.AjaxService.get({
  11496. url: '/order/submit',
  11497. data: data,
  11498. isLoading: true });
  11499. }
  11500. /* 订单列表 */ }, { key: "QueryOrderList", value: function QueryOrderList()
  11501. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11502. return this.AjaxService.get({
  11503. url: '/order/list',
  11504. data: data,
  11505. isLoading: true });
  11506. }
  11507. /* 分销者订单列表 */ }, { key: "QueryOrderDealerList", value: function QueryOrderDealerList()
  11508. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11509. return this.AjaxService.get({
  11510. url: '/order/dealer/list',
  11511. data: data,
  11512. isLoading: false });
  11513. }
  11514. /* 查询订单详情 */ }, { key: "QueryOrderDetails", value: function QueryOrderDetails()
  11515. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11516. return this.AjaxService.get({
  11517. url: '/order/detail',
  11518. data: data,
  11519. isLoading: true });
  11520. }
  11521. /* 操作取消订单 */ }, { key: "CancelOrder", value: function CancelOrder()
  11522. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11523. return this.AjaxService.get({
  11524. url: '/order/cancel',
  11525. data: data,
  11526. isLoading: true });
  11527. }
  11528. /* 操作删除订单 */ }, { key: "DeleteOrder", value: function DeleteOrder()
  11529. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11530. return this.AjaxService.get({
  11531. url: '/order/delete',
  11532. data: data,
  11533. isLoading: true });
  11534. }
  11535. /* 确认收货操作 */ }, { key: "ConfirmReceipt", value: function ConfirmReceipt()
  11536. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11537. return this.AjaxService.get({
  11538. url: '/order/affirm',
  11539. data: data,
  11540. isLoading: true });
  11541. }
  11542. /* 再次购买查询操作 */ }, { key: "GetOrderBuyAgain", value: function GetOrderBuyAgain()
  11543. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11544. return this.AjaxService.get({
  11545. url: '/order/buyAgain',
  11546. data: data,
  11547. isLoading: false });
  11548. }
  11549. /* 查询物流 */ }, { key: "QueryLogistics", value: function QueryLogistics()
  11550. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11551. return this.AjaxService.get({
  11552. url: '/order/logistics',
  11553. data: data,
  11554. isLoading: true });
  11555. }
  11556. /**
  11557. *机构搜索订单
  11558. *@param searchWord 关键词
  11559. *@param userId 用户ID
  11560. *@param pageNum 页码
  11561. *@param pageSize 条数
  11562. */ }, { key: "SearchOrderInfo", value: function SearchOrderInfo()
  11563. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11564. return this.AjaxService.get({
  11565. url: '/order/search',
  11566. data: data,
  11567. isLoading: true });
  11568. }
  11569. /**
  11570. *搜索订单历史记录
  11571. *@param organizeId 用户ID
  11572. */ }, { key: "SearchOrderHistory", value: function SearchOrderHistory()
  11573. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11574. return this.AjaxService.get({
  11575. url: '/order/searchHistory',
  11576. data: data,
  11577. isLoading: false });
  11578. }
  11579. /**
  11580. *清除订单历史记录
  11581. *@param organizeId 用户ID
  11582. */ }, { key: "ClearOrderHistory", value: function ClearOrderHistory()
  11583. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11584. return this.AjaxService.get({
  11585. url: '/order/searchHistory/delete',
  11586. data: data,
  11587. isLoading: true });
  11588. }
  11589. /**
  11590. *@确认订单-获取邮费信息
  11591. *@param productIds 商品ID【”,”分割】
  11592. *@param totalPrice 商品总额
  11593. *@param userId 用户ID
  11594. *@param townID 地址区ID
  11595. */ }, { key: "GetOrderPostage", value: function GetOrderPostage()
  11596. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11597. return this.AjaxService.get({
  11598. url: '/order/postage',
  11599. data: data,
  11600. isLoading: false });
  11601. }
  11602. /* 提交订单 orderId 订单ID */ }, { key: "CreatedOrderSubmit", value: function CreatedOrderSubmit()
  11603. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11604. return this.AjaxService.post({
  11605. url: '/order/submit',
  11606. data: data,
  11607. isLoading: false });
  11608. } }]);return OrderService;}();exports.default = OrderService;
  11609. /***/ }),
  11610. /* 30 */
  11611. /*!***********************************************************************!*\
  11612. !*** D:/zheng_dev2021/caimei-applets-hehe/services/public.service.js ***!
  11613. \***********************************************************************/
  11614. /*! no static exports found */
  11615. /***/ (function(module, exports, __webpack_require__) {
  11616. "use strict";
  11617. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;} /**
  11618. * 这是所有模块公用业务逻辑的服务
  11619. */var
  11620. PublicService = /*#__PURE__*/function () {
  11621. function PublicService(AjaxService) {_classCallCheck(this, PublicService);
  11622. Object.assign(this, { AjaxService: AjaxService });
  11623. this.name = 'PublicService';
  11624. }
  11625. /**
  11626. * 获取地址
  11627. */_createClass(PublicService, [{ key: "GetAllAddressData", value: function GetAllAddressData()
  11628. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11629. return this.AjaxService.get({
  11630. url: '/other/list',
  11631. data: data,
  11632. isLoading: false });
  11633. }
  11634. /**
  11635. * 发送手机验证码
  11636. * mobile 手机号
  11637. */ }, { key: "GetheHeSend", value: function GetheHeSend()
  11638. {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11639. return this.AjaxService.get({
  11640. url: '/user/he/send',
  11641. data: data,
  11642. isLoading: true });
  11643. } }]);return PublicService;}();exports.default = PublicService;
  11644. /***/ }),
  11645. /* 31 */
  11646. /*!***********************************************************************!*\
  11647. !*** D:/zheng_dev2021/caimei-applets-hehe/services/coupon.service.js ***!
  11648. \***********************************************************************/
  11649. /*! no static exports found */
  11650. /***/ (function(module, exports, __webpack_require__) {
  11651. "use strict";
  11652. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;} /**
  11653. * 这是所有模块公用业务逻辑的服务
  11654. */var
  11655. CouponService = /*#__PURE__*/function () {
  11656. function CouponService(AjaxService) {_classCallCheck(this, CouponService);
  11657. Object.assign(this, { AjaxService: AjaxService });
  11658. this.name = 'CouponService';
  11659. }
  11660. // 领券中心
  11661. _createClass(CouponService, [{ key: "GetCouponCenterInfo", value: function GetCouponCenterInfo() {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11662. return this.AjaxService.get({
  11663. url: '/coupon/center',
  11664. data: data,
  11665. isLoading: false });
  11666. }
  11667. // 领取优惠券
  11668. }, { key: "ReceiveCoupon", value: function ReceiveCoupon() {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11669. return this.AjaxService.post({
  11670. url: '/coupon/collar',
  11671. data: data,
  11672. isLoading: false });
  11673. }
  11674. // 首页优惠券弹窗展示
  11675. }, { key: "CouponActivityPopup", value: function CouponActivityPopup() {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11676. return this.AjaxService.get({
  11677. url: '/coupon/display',
  11678. data: data,
  11679. isLoading: false });
  11680. }
  11681. // 优惠券部分商品数据
  11682. }, { key: "ProductInfoByCoupon", value: function ProductInfoByCoupon() {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11683. return this.AjaxService.get({
  11684. url: '/coupon/product/page',
  11685. data: data,
  11686. isLoading: false });
  11687. }
  11688. // 统计已领取优惠券数量
  11689. }, { key: "CouponReceiveCount", value: function CouponReceiveCount() {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11690. return this.AjaxService.get({
  11691. url: '/coupon/receive/count',
  11692. data: data,
  11693. isLoading: false });
  11694. }
  11695. // 已领取优惠券中心
  11696. }, { key: "CouponReceiveList", value: function CouponReceiveList() {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11697. return this.AjaxService.get({
  11698. url: '/coupon/receive/list',
  11699. data: data,
  11700. isLoading: false });
  11701. }
  11702. // 商品详情优惠券
  11703. }, { key: "GetCouponByProduct", value: function GetCouponByProduct() {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11704. return this.AjaxService.get({
  11705. url: '/coupon/product/detail',
  11706. data: data,
  11707. isLoading: false });
  11708. }
  11709. // 根据商品id列表获取优惠券
  11710. }, { key: "GetCouponByProductIds", value: function GetCouponByProductIds() {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11711. return this.AjaxService.get({
  11712. url: '/coupon/productIds',
  11713. data: data,
  11714. isLoading: false });
  11715. } }]);return CouponService;}();exports.default = CouponService;
  11716. /***/ }),
  11717. /* 32 */
  11718. /*!***********************************************************!*\
  11719. !*** D:/zheng_dev2021/caimei-applets-hehe/common/util.js ***!
  11720. \***********************************************************/
  11721. /*! no static exports found */
  11722. /***/ (function(module, exports, __webpack_require__) {
  11723. "use strict";
  11724. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = exports.makeQueryStr = exports.isIntersect = exports.dateFormat = exports.prePage = exports.json = exports.modal = exports.msg = void 0; /* 常用工具函数 */
  11725. var msg = function msg(title) {var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1500;var mask = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;var icon = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'none';
  11726. //统一提示方便全局修改
  11727. if (Boolean(title) === false) {
  11728. return;
  11729. }
  11730. uni.showToast({
  11731. title: title,
  11732. duration: duration,
  11733. mask: mask,
  11734. icon: icon });
  11735. };exports.msg = msg;
  11736. var modal = function modal(title, content, confirmText, cancelText) {var showCancel = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;var callBack = arguments.length > 5 ? arguments[5] : undefined;
  11737. uni.showModal({
  11738. title: title,
  11739. content: content,
  11740. confirmText: confirmText,
  11741. cancelText: cancelText,
  11742. confirmColor: '#E15616',
  11743. showCancel: showCancel,
  11744. success: function success(res) {
  11745. if (res.confirm) {
  11746. callBack();
  11747. }
  11748. } });
  11749. };exports.modal = modal;
  11750. var json = function json(type) {
  11751. //模拟异步请求数据
  11752. return new Promise(function (resolve) {
  11753. setTimeout(function () {
  11754. // console.log(resolve+'======='+type);
  11755. resolve(Json[type]);
  11756. }, 500);
  11757. });
  11758. };exports.json = json;
  11759. var prePage = function prePage() {
  11760. var pages = getCurrentPages();
  11761. var prePage = pages[pages.length - 2];
  11762. return prePage.$vm;
  11763. };
  11764. /** 时间格式化
  11765. * @param {dateTime} date 标准时间格式 -> new Date()
  11766. * @param {string} format 时间格式化的格式 'yyyy-MM-dd hh:mm:ss'
  11767. * @returns {string} 格式化后的时间 '2017-01-01 01:00:00'
  11768. */exports.prePage = prePage;
  11769. var dateFormat = function dateFormat() {var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-MM-dd hh:mm:ss';
  11770. var o = {
  11771. 'M+': date.getMonth() + 1, // month
  11772. 'd+': date.getDate(), // day
  11773. 'h+': date.getHours(), // hour
  11774. 'm+': date.getMinutes(), // minute
  11775. 's+': date.getSeconds(), // second
  11776. 'q+': Math.floor((date.getMonth() + 3) / 3), // quarter
  11777. S: date.getMilliseconds() // millisecond
  11778. };
  11779. if (/(y+)/.test(format)) {
  11780. format = format.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
  11781. }
  11782. for (var k in o) {
  11783. if (new RegExp('(' + k + ')').test(format)) {
  11784. format = format.replace(RegExp.$1, RegExp.$1.length === 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).
  11785. length));
  11786. }
  11787. }
  11788. return format;
  11789. };
  11790. // 两个简单数组是否交集
  11791. exports.dateFormat = dateFormat;var isIntersect = function isIntersect() {var arr1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];var arr2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  11792. // console.log(arr1, arr2)
  11793. return arr1.some(function (v) {return arr2.indexOf(v.toString()) > -1;});
  11794. };
  11795. // 将对象转为querystring参数
  11796. exports.isIntersect = isIntersect;var makeQueryStr = function makeQueryStr(obj) {
  11797. var strs = [];
  11798. for (var key in obj) {
  11799. strs.push(key + '=' + obj[key]);
  11800. }
  11801. return strs.join('&');
  11802. };exports.makeQueryStr = makeQueryStr;
  11803. var install = function install(Vue, vm) {
  11804. console.log('初始化挂载($util)工具方法 util.js ');
  11805. Vue.prototype.$util = { msg: msg, prePage: prePage, modal: modal, makeQueryStr: makeQueryStr };
  11806. };var _default =
  11807. install;exports.default = _default;
  11808. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  11809. /***/ }),
  11810. /* 33 */
  11811. /*!********************************************************************!*\
  11812. !*** D:/zheng_dev2021/caimei-applets-hehe/store/modules/coupon.js ***!
  11813. \********************************************************************/
  11814. /*! no static exports found */
  11815. /***/ (function(module, exports, __webpack_require__) {
  11816. "use strict";
  11817. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  11818. var _index = __webpack_require__(/*! @/services/index.js */ 19);
  11819. var _util = __webpack_require__(/*! @/common/util.js */ 32); /**
  11820. * 用户优惠券仓库
  11821. */var timer = null;
  11822. var state = {
  11823. showCouponPopup: true, // 是否显示优惠券入口弹窗
  11824. activePopupType: 0, // 0 禁用 1 老用户 2 新用户
  11825. otherCouponFlag: false, // 有待领取优惠券弹窗
  11826. expiredNum: 0,
  11827. unusedNum: 0,
  11828. usedNum: 0 };
  11829. var mutations = {
  11830. // 设置已领取优惠券数量
  11831. setReceiveCouponCount: function setReceiveCouponCount(state, data) {
  11832. state.unusedNum = data.unusedNum;
  11833. state.usedNum = data.usedNum;
  11834. state.expiredNum = data.expiredNum;
  11835. },
  11836. // 更新弹窗类型
  11837. updatePopupType: function updatePopupType(state, type) {
  11838. state.activePopupType = type <= 0 ? 0 : type;
  11839. },
  11840. // 设置优惠券弹窗是否显示
  11841. setCouponPopupStatus: function setCouponPopupStatus(state, status) {
  11842. state.showCouponPopup = status;
  11843. },
  11844. // 设置是否有优惠券领取提示
  11845. setOtherCouponFlag: function setOtherCouponFlag(state, value) {
  11846. state.otherCouponFlag = value === 1;
  11847. } };
  11848. var actions = {
  11849. // 领取优惠券
  11850. receiveCoupon: function receiveCoupon(_ref, _ref2) {var rootGetters = _ref.rootGetters,dispatch = _ref.dispatch;var couponId = _ref2.couponId,couponShareId = _ref2.couponShareId;
  11851. return _index.couponService.ReceiveCoupon({ couponId: couponId, couponShareId: couponShareId, userId: rootGetters.userId }).then(function (res) {
  11852. dispatch('initReceiveCouponCount');
  11853. (0, _util.msg)('领取成功', 1500, false, 'success');
  11854. }).catch(function (error) {
  11855. (0, _util.msg)(error.msg, 2000);
  11856. });
  11857. },
  11858. // 初始化已领取优惠券数量
  11859. initReceiveCouponCount: function initReceiveCouponCount(_ref3) {var commit = _ref3.commit,rootGetters = _ref3.rootGetters;
  11860. _index.couponService.CouponReceiveCount({ userId: rootGetters.userId }).then(function (res) {
  11861. commit('setReceiveCouponCount', res.data);
  11862. });
  11863. },
  11864. // 优惠券活动弹窗信息
  11865. getCouponActivity: function getCouponActivity(_ref4) {var commit = _ref4.commit,rootGetters = _ref4.rootGetters,state = _ref4.state,dispatch = _ref4.dispatch;
  11866. // clearTimeout(timer)
  11867. _index.couponService.CouponActivityPopup({
  11868. userId: rootGetters.userId }).
  11869. then(function (response) {var _response$data =
  11870. response.data,newUserCouponFlag = _response$data.newUserCouponFlag,actCouponFlag = _response$data.actCouponFlag,otherCouponFlag = _response$data.otherCouponFlag;
  11871. // debugger
  11872. // 全部用户弹窗
  11873. if (actCouponFlag !== 0) {
  11874. commit('updatePopupType', 1);
  11875. }
  11876. // 是否是新用户
  11877. if (newUserCouponFlag !== 0) {
  11878. commit('updatePopupType', 2);
  11879. }
  11880. // 是否有新的优惠券可领取
  11881. commit('setOtherCouponFlag', otherCouponFlag);
  11882. setTimeout(function () {
  11883. commit('setOtherCouponFlag', false);
  11884. }, 5000);
  11885. // 每次5分钟刷新一次 10 * 1000 5 * 60 * 1000
  11886. // if (rootGetters.hasLogin) {
  11887. // timer = setTimeout(() => {
  11888. // dispatch('getCouponActivity')
  11889. // }, 5 * 60 * 1000)
  11890. // }
  11891. });
  11892. } };var _default =
  11893. {
  11894. namespaced: true,
  11895. state: state,
  11896. mutations: mutations,
  11897. actions: actions };exports.default = _default;
  11898. /***/ }),
  11899. /* 34 */
  11900. /*!******************************************************************!*\
  11901. !*** D:/zheng_dev2021/caimei-applets-hehe/store/modules/user.js ***!
  11902. \******************************************************************/
  11903. /*! no static exports found */
  11904. /***/ (function(module, exports, __webpack_require__) {
  11905. "use strict";
  11906. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 23));var _index = __webpack_require__(/*! @/services/index.js */ 19);
  11907. var _authorize = _interopRequireDefault(__webpack_require__(/*! @/common/authorize.js */ 15));
  11908. var _util = __webpack_require__(/*! @/common/util.js */ 32);
  11909. var _utilsTools = __webpack_require__(/*! @/common/utilsTools.js */ 16);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}
  11910. var state = {
  11911. userId: '',
  11912. userIdentity: '',
  11913. userInfo: null,
  11914. hasLogin: false,
  11915. isWxAuthorize: false,
  11916. inviteUserId: 0 };
  11917. var mutations = {
  11918. // 用户登录
  11919. LOGIN: function LOGIN(state, data) {
  11920. var userInfo = JSON.parse(data);
  11921. state.userInfo = userInfo;
  11922. state.hasLogin = true;
  11923. state.isWxAuthorize = true;
  11924. state.userId = userInfo.userId;
  11925. state.userIdentity = userInfo.userIdentity;
  11926. uni.setStorageSync('openId', userInfo.openId);
  11927. },
  11928. // 退出登录
  11929. LOGIN_OUT: function LOGIN_OUT(state, data) {
  11930. var userInfo = JSON.parse(data) || null;
  11931. state.userInfo = userInfo;
  11932. state.hasLogin = false;
  11933. state.isWxAuthorize = false;
  11934. state.userId = '';
  11935. state.userIdentity = '';
  11936. userInfo && uni.setStorageSync('openId', userInfo.openId);
  11937. },
  11938. // 设置邀请用户id
  11939. setInviteUserId: function setInviteUserId(state, id) {
  11940. state.inviteUserId = parseInt(id);
  11941. } };
  11942. var actions = {
  11943. // 微信授权登录
  11944. wechatlogin: function wechatlogin(_ref) {return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee() {var commit, dispatch, state, code;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:commit = _ref.commit, dispatch = _ref.dispatch, state = _ref.state;_context.next = 3;return (
  11945. _authorize.default.getCode('weixin'));case 3:code = _context.sent;
  11946. _index.userService.UserWechatAuthorLogin({ code: code }).
  11947. then(function (response) {
  11948. console.log('登录成功');
  11949. commit('LOGIN', response.data);
  11950. dispatch('cart/getCartNumber', state.userId, { root: true }); // 获取购物车数量信息
  11951. dispatch('coupon/getCouponActivity', null, { root: true }); // 获取优惠券弹窗信息
  11952. dispatch('coupon/initReceiveCouponCount', null, { root: true }); // 获取已领取优惠券数量
  11953. }).
  11954. catch(function (error) {
  11955. console.log('游客');
  11956. dispatch('coupon/getCouponActivity', null, { root: true }); // 游客也要获取优惠券弹窗信息
  11957. commit('LOGIN_OUT', error.data);
  11958. });case 5:case "end":return _context.stop();}}}, _callee);}))();
  11959. },
  11960. // 手机号注册登录
  11961. customLogin: function customLogin(_ref2, params) {var commit = _ref2.commit,state = _ref2.state,dispatch = _ref2.dispatch;
  11962. params.shareUserId = state.inviteUserId;
  11963. return _index.userService.UserMobileLogin(params).
  11964. then(function (response) {
  11965. // 保存用户信息
  11966. commit('LOGIN', response.data);
  11967. dispatch('cart/getCartNumber', state.userId, { root: true }); // 获取购物车数量信息
  11968. dispatch('coupon/getCouponActivity', null, { root: true }); // 获取优惠券弹窗信息
  11969. dispatch('coupon/initReceiveCouponCount', null, { root: true }); // 获取已领取优惠券数量
  11970. // 登录成功提示
  11971. (0, _util.msg)('登录成功', 1500, false, 'success');
  11972. setTimeout(function () {
  11973. (0, _utilsTools.switchTabTo)('/pages/tabBar/index/index');
  11974. }, 1500);
  11975. }).
  11976. catch(function (error) {
  11977. (0, _util.msg)(error.msg, 2000);
  11978. });
  11979. } };var _default =
  11980. {
  11981. namespaced: true,
  11982. state: state,
  11983. mutations: mutations,
  11984. actions: actions };exports.default = _default;
  11985. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  11986. /***/ }),
  11987. /* 35 */,
  11988. /* 36 */,
  11989. /* 37 */,
  11990. /* 38 */,
  11991. /* 39 */,
  11992. /* 40 */
  11993. /*!**********************************************************************************************************!*\
  11994. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  11995. \**********************************************************************************************************/
  11996. /*! exports provided: default */
  11997. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11998. "use strict";
  11999. __webpack_require__.r(__webpack_exports__);
  12000. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  12001. /* globals __VUE_SSR_CONTEXT__ */
  12002. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  12003. // This module is a runtime utility for cleaner component module output and will
  12004. // be included in the final webpack user bundle.
  12005. function normalizeComponent (
  12006. scriptExports,
  12007. render,
  12008. staticRenderFns,
  12009. functionalTemplate,
  12010. injectStyles,
  12011. scopeId,
  12012. moduleIdentifier, /* server only */
  12013. shadowMode, /* vue-cli only */
  12014. components, // fixed by xxxxxx auto components
  12015. renderjs // fixed by xxxxxx renderjs
  12016. ) {
  12017. // Vue.extend constructor export interop
  12018. var options = typeof scriptExports === 'function'
  12019. ? scriptExports.options
  12020. : scriptExports
  12021. // fixed by xxxxxx auto components
  12022. if (components) {
  12023. if (!options.components) {
  12024. options.components = {}
  12025. }
  12026. var hasOwn = Object.prototype.hasOwnProperty
  12027. for (var name in components) {
  12028. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  12029. options.components[name] = components[name]
  12030. }
  12031. }
  12032. }
  12033. // fixed by xxxxxx renderjs
  12034. if (renderjs) {
  12035. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  12036. this[renderjs.__module] = this
  12037. });
  12038. (options.mixins || (options.mixins = [])).push(renderjs)
  12039. }
  12040. // render functions
  12041. if (render) {
  12042. options.render = render
  12043. options.staticRenderFns = staticRenderFns
  12044. options._compiled = true
  12045. }
  12046. // functional template
  12047. if (functionalTemplate) {
  12048. options.functional = true
  12049. }
  12050. // scopedId
  12051. if (scopeId) {
  12052. options._scopeId = 'data-v-' + scopeId
  12053. }
  12054. var hook
  12055. if (moduleIdentifier) { // server build
  12056. hook = function (context) {
  12057. // 2.3 injection
  12058. context =
  12059. context || // cached call
  12060. (this.$vnode && this.$vnode.ssrContext) || // stateful
  12061. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  12062. // 2.2 with runInNewContext: true
  12063. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  12064. context = __VUE_SSR_CONTEXT__
  12065. }
  12066. // inject component styles
  12067. if (injectStyles) {
  12068. injectStyles.call(this, context)
  12069. }
  12070. // register component module identifier for async chunk inferrence
  12071. if (context && context._registeredComponents) {
  12072. context._registeredComponents.add(moduleIdentifier)
  12073. }
  12074. }
  12075. // used by ssr in case component is cached and beforeCreate
  12076. // never gets called
  12077. options._ssrRegister = hook
  12078. } else if (injectStyles) {
  12079. hook = shadowMode
  12080. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  12081. : injectStyles
  12082. }
  12083. if (hook) {
  12084. if (options.functional) {
  12085. // for template-only hot-reload because in that case the render fn doesn't
  12086. // go through the normalizer
  12087. options._injectStyles = hook
  12088. // register for functioal component in vue file
  12089. var originalRender = options.render
  12090. options.render = function renderWithStyleInjection (h, context) {
  12091. hook.call(context)
  12092. return originalRender(h, context)
  12093. }
  12094. } else {
  12095. // inject component registration as beforeCreate hook
  12096. var existing = options.beforeCreate
  12097. options.beforeCreate = existing
  12098. ? [].concat(existing, hook)
  12099. : [hook]
  12100. }
  12101. }
  12102. return {
  12103. exports: scriptExports,
  12104. options: options
  12105. }
  12106. }
  12107. /***/ }),
  12108. /* 41 */
  12109. /*!*************************************************************!*\
  12110. !*** D:/zheng_dev2021/caimei-applets-hehe/common/common.js ***!
  12111. \*************************************************************/
  12112. /*! no static exports found */
  12113. /***/ (function(module, exports, __webpack_require__) {
  12114. "use strict";
  12115. Object.defineProperty(exports, "__esModule", { value: true });exports.isNullOrEmpty = isNullOrEmpty;exports.trim = trim;exports.isEmail = isEmail;exports.isMobile = isMobile;exports.isFloat = isFloat;exports.isNum = isNum;exports.isEmailCode = isEmailCode;exports.isMobileCode = isMobileCode;exports.isCredit = isCredit;exports.checkPwd = checkPwd;exports.hidePhone = hidePhone;exports.interceptHtmlFn = interceptHtmlFn;exports.desensitizationName = desensitizationName;exports.formatNum = formatNum;exports.rmoney = rmoney;exports.bankRegex = bankRegex;exports.checkData = checkData;exports.formatDate = formatDate;exports.throttle = throttle;exports.debounce = debounce;exports.default = void 0; //公共js,主要做表单验证,以及基本方法封装
  12116. function isNullOrEmpty(value) {
  12117. //是否为空
  12118. return value === null || value === '' || value === undefined ? true : false;
  12119. }
  12120. function trim(value) {
  12121. //去空格
  12122. return value.replace(/(^\s*)|(\s*$)/g, '');
  12123. }
  12124. function isEmail(value) {
  12125. //是否为邮箱
  12126. return RegExp(
  12127. /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/).
  12128. test(value);
  12129. }
  12130. function isMobile(value) {
  12131. //是否为手机号
  12132. return RegExp(/^1[1-9][0-9]{9}$/).test(value);
  12133. }
  12134. function isFloat(value) {
  12135. //金额,只允许保留两位小数
  12136. return RegExp(/^([0-9]*[.]?[0-9])[0-9]{0,1}$/).test(value);
  12137. }
  12138. function isNum(value) {
  12139. //是否全为数字
  12140. return RegExp(/^[0-9]+$/).test(value);
  12141. }
  12142. function isEmailCode(value) {
  12143. return RegExp(/^\d{4}$/).test(value);
  12144. }
  12145. function isMobileCode(value) {
  12146. return RegExp(/^\d{6}$/).test(value);
  12147. }
  12148. function isCredit(value) {//统一社会信用代码
  12149. return RegExp(/^[0-9A-HJ-NPQRTUWXY]{2}\\d{6}[0-9A-HJ-NPQRTUWXY]{10}$/).test(value);
  12150. }
  12151. function checkPwd(value) {
  12152. //密码为8~20位数字和字母组合
  12153. return RegExp(/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,16}$/).test(value);
  12154. }
  12155. function hidePhone(value) {
  12156. return value.replace(/^(\d{3})\d{4}(\d+)/, '$1****$2');
  12157. }
  12158. function interceptHtmlFn(value) {
  12159. return value.replace(/<[^>]+>/g, '');
  12160. }
  12161. function desensitizationName(value) {
  12162. if (null != value && value != undefined) {
  12163. if (value.length <= 3) {
  12164. var ruten = value.substring(1);
  12165. return value.replace(ruten, '**');
  12166. } else if (value.length > 3 && value.length <= 6) {
  12167. var _ruten = value.substring(2);
  12168. return value.replace(_ruten, '**');
  12169. }
  12170. } else {
  12171. return '';
  12172. }
  12173. }
  12174. function formatNum(num) {
  12175. //格式化手机号码
  12176. if (utils.isMobile(num)) {
  12177. num = num.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2');
  12178. }
  12179. return num;
  12180. }
  12181. function rmoney(money) {
  12182. //金额格式化
  12183. return parseFloat(money).toFixed(2).toString().split('').reverse().join('').replace(/(\d{3})/g, '$1,').
  12184. replace(
  12185. /\,$/, '').split('').reverse().join('');
  12186. }
  12187. function bankRegex(num) {
  12188. var bankNum = '';
  12189. bankNum = num.replace(/\D/g, '').replace(/(....)(?=.)/g, '$1 ');
  12190. return bankNum;
  12191. }
  12192. function checkData(value) {
  12193. var data;
  12194. if (value == null || value == '') {
  12195. data = '';
  12196. } else {
  12197. data = value;
  12198. }
  12199. return data;
  12200. }
  12201. function formatDate(formatStr, fdate) {
  12202. //日期格式化
  12203. if (fdate) {
  12204. if (~fdate.indexOf('.')) {
  12205. fdate = fdate.substring(0, fdate.indexOf('.'));
  12206. }
  12207. fdate = fdate.toString().replace('T', ' ').replace(/\-/g, '/');
  12208. var fTime,fStr = 'ymdhis';
  12209. if (!formatStr)
  12210. formatStr = 'y-m-d h:i:s';
  12211. if (fdate)
  12212. fTime = new Date(fdate);else
  12213. fTime = new Date();
  12214. var month = fTime.getMonth() + 1;
  12215. var day = fTime.getDate();
  12216. var hours = fTime.getHours();
  12217. var minu = fTime.getMinutes();
  12218. var second = fTime.getSeconds();
  12219. month = month < 10 ? '0' + month : month;
  12220. day = day < 10 ? '0' + day : day;
  12221. hours = hours < 10 ? '0' + hours : hours;
  12222. minu = minu < 10 ? '0' + minu : minu;
  12223. second = second < 10 ? '0' + second : second;
  12224. var formatArr = [
  12225. fTime.getFullYear().toString(),
  12226. month.toString(),
  12227. day.toString(),
  12228. hours.toString(),
  12229. minu.toString(),
  12230. second.toString()];
  12231. for (var i = 0; i < formatArr.length; i++) {
  12232. formatStr = formatStr.replace(fStr.charAt(i), formatArr[i]);
  12233. }
  12234. return formatStr;
  12235. } else {
  12236. return '';
  12237. }
  12238. }
  12239. function throttle(fn, gapTime) {
  12240. if (gapTime == null || gapTime == undefined) {
  12241. gapTime = 1500;
  12242. }
  12243. var _lastTime = null;
  12244. // 返回新的函数
  12245. return function () {
  12246. var _nowTime = +new Date();
  12247. if (_nowTime - _lastTime > gapTime || !_lastTime) {
  12248. fn.apply(this, arguments); //将this和参数传给原函数
  12249. _lastTime = _nowTime;
  12250. }
  12251. };
  12252. }
  12253. function debounce(fn, delay, isImmediate) {
  12254. var timer = null; //初始化timer,作为计时清除依据
  12255. return function () {
  12256. var context = this; //获取函数所在作用域this
  12257. var args = arguments; //取得传入参数
  12258. clearTimeout(timer);
  12259. if (isImmediate && timer === null) {
  12260. //时间间隔外立即执行
  12261. fn.apply(context, args);
  12262. timer = 0;
  12263. return;
  12264. }
  12265. timer = setTimeout(function () {
  12266. fn.apply(context, args);
  12267. timer = null;
  12268. }, delay);
  12269. };
  12270. }
  12271. var install = function install(Vue) {
  12272. console.log('初始化挂载($reg)工具库 common.js');
  12273. Vue.prototype.$reg = {
  12274. isNullOrEmpty: isNullOrEmpty,
  12275. trim: trim,
  12276. isMobile: isMobile,
  12277. isEmail: isEmail,
  12278. isFloat: isFloat,
  12279. isNum: isNum,
  12280. isEmailCode: isEmailCode,
  12281. isMobileCode: isMobileCode,
  12282. checkPwd: checkPwd,
  12283. formatNum: formatNum,
  12284. rmoney: rmoney,
  12285. formatDate: formatDate,
  12286. bankRegex: bankRegex,
  12287. checkData: checkData,
  12288. hidePhone: hidePhone,
  12289. interceptHtmlFn: interceptHtmlFn,
  12290. desensitizationName: desensitizationName,
  12291. throttle: throttle,
  12292. debounce: debounce };
  12293. };var _default =
  12294. install;exports.default = _default;
  12295. /***/ }),
  12296. /* 42 */
  12297. /*!*************************************************************!*\
  12298. !*** D:/zheng_dev2021/caimei-applets-hehe/common/crypto.js ***!
  12299. \*************************************************************/
  12300. /*! no static exports found */
  12301. /***/ (function(module, exports, __webpack_require__) {
  12302. "use strict";
  12303. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _cryptoJsMin = _interopRequireDefault(__webpack_require__(/*! ./libs/crypto-js.min.js */ 43));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  12304. var aseKey = 'HEHEMINI'; //秘钥必须为:8/16/32位
  12305. //加密
  12306. var encrypt = function encrypt(data) {
  12307. return _cryptoJsMin.default.AES.encrypt(JSON.stringify(data), _cryptoJsMin.default.enc.Utf8.parse(aseKey), {
  12308. mode: _cryptoJsMin.default.mode.ECB,
  12309. padding: _cryptoJsMin.default.pad.Pkcs7 }).
  12310. toString();
  12311. };
  12312. //解密
  12313. var decrypt = function decrypt(encrypt) {
  12314. return _cryptoJsMin.default.AES.decrypt(encrypt, _cryptoJsMin.default.enc.Utf8.parse(aseKey), {
  12315. mode: _cryptoJsMin.default.mode.ECB,
  12316. padding: _cryptoJsMin.default.pad.Pkcs7 }).
  12317. toString(_cryptoJsMin.default.enc.Utf8);
  12318. };
  12319. var install = function install(Vue) {
  12320. Vue.prototype.$crypto = {
  12321. encrypt: encrypt,
  12322. decrypt: decrypt };
  12323. };var _default =
  12324. install;exports.default = _default;
  12325. /***/ }),
  12326. /* 43 */
  12327. /*!*************************************************************************!*\
  12328. !*** D:/zheng_dev2021/caimei-applets-hehe/common/libs/crypto-js.min.js ***!
  12329. \*************************************************************************/
  12330. /*! no static exports found */
  12331. /***/ (function(module, exports, __webpack_require__) {
  12332. /* WEBPACK VAR INJECTION */(function(global) {!function (t, e) { true ? module.exports = exports = e() : undefined;}(this, function () {var n,o,s,a,h,t,e,l,r,i,c,f,d,u,p,S,x,b,A,H,z,_,v,g,y,B,w,k,m,C,D,E,R,M,F,P,W,O,I,U = U || function (h) {var i;if ("undefined" != typeof window && window.crypto && (i = window.crypto), "undefined" != typeof self && self.crypto && (i = self.crypto), !(i = !(i = !(i = "undefined" != typeof globalThis && globalThis.crypto ? globalThis.crypto : i) && "undefined" != typeof window && window.msCrypto ? window.msCrypto : i) && "undefined" != typeof global && global.crypto ? global.crypto : i) && "function" == "function") try {i = __webpack_require__(/*! crypto */ 44);} catch (t) {}var r = Object.create || function (t) {return e.prototype = t, t = new e(), e.prototype = null, t;};function e() {}var t = {},n = t.lib = {},o = n.Base = { extend: function extend(t) {var e = r(this);return t && e.mixIn(t), e.hasOwnProperty("init") && this.init !== e.init || (e.init = function () {e.$super.init.apply(this, arguments);}), (e.init.prototype = e).$super = this, e;}, create: function create() {var t = this.extend();return t.init.apply(t, arguments), t;}, init: function init() {}, mixIn: function mixIn(t) {for (var e in t) {t.hasOwnProperty(e) && (this[e] = t[e]);}t.hasOwnProperty("toString") && (this.toString = t.toString);}, clone: function clone() {return this.init.prototype.extend(this);} },l = n.WordArray = o.extend({ init: function init(t, e) {t = this.words = t || [], this.sigBytes = null != e ? e : 4 * t.length;}, toString: function toString(t) {return (t || c).stringify(this);}, concat: function concat(t) {var e = this.words,r = t.words,i = this.sigBytes,n = t.sigBytes;if (this.clamp(), i % 4) for (var o = 0; o < n; o++) {var s = r[o >>> 2] >>> 24 - o % 4 * 8 & 255;e[i + o >>> 2] |= s << 24 - (i + o) % 4 * 8;} else for (var c = 0; c < n; c += 4) {e[i + c >>> 2] = r[c >>> 2];}return this.sigBytes += n, this;}, clamp: function clamp() {var t = this.words,e = this.sigBytes;t[e >>> 2] &= 4294967295 << 32 - e % 4 * 8, t.length = h.ceil(e / 4);}, clone: function clone() {var t = o.clone.call(this);return t.words = this.words.slice(0), t;}, random: function random(t) {for (var e = [], r = 0; r < t; r += 4) {e.push(function () {if (i) {if ("function" == typeof i.getRandomValues) try {return i.getRandomValues(new Uint32Array(1))[0];} catch (t) {}if ("function" == typeof i.randomBytes) try {return i.randomBytes(4).readInt32LE();} catch (t) {}}throw new Error("Native crypto module could not be used to get secure random number.");}());}return new l.init(e, t);} }),s = t.enc = {},c = s.Hex = { stringify: function stringify(t) {for (var e = t.words, r = t.sigBytes, i = [], n = 0; n < r; n++) {var o = e[n >>> 2] >>> 24 - n % 4 * 8 & 255;i.push((o >>> 4).toString(16)), i.push((15 & o).toString(16));}return i.join("");}, parse: function parse(t) {for (var e = t.length, r = [], i = 0; i < e; i += 2) {r[i >>> 3] |= parseInt(t.substr(i, 2), 16) << 24 - i % 8 * 4;}return new l.init(r, e / 2);} },a = s.Latin1 = { stringify: function stringify(t) {for (var e = t.words, r = t.sigBytes, i = [], n = 0; n < r; n++) {var o = e[n >>> 2] >>> 24 - n % 4 * 8 & 255;i.push(String.fromCharCode(o));}return i.join("");}, parse: function parse(t) {for (var e = t.length, r = [], i = 0; i < e; i++) {r[i >>> 2] |= (255 & t.charCodeAt(i)) << 24 - i % 4 * 8;}return new l.init(r, e);} },f = s.Utf8 = { stringify: function stringify(t) {try {return decodeURIComponent(escape(a.stringify(t)));} catch (t) {throw new Error("Malformed UTF-8 data");}}, parse: function parse(t) {return a.parse(unescape(encodeURIComponent(t)));} },d = n.BufferedBlockAlgorithm = o.extend({ reset: function reset() {this._data = new l.init(), this._nDataBytes = 0;}, _append: function _append(t) {"string" == typeof t && (t = f.parse(t)), this._data.concat(t), this._nDataBytes += t.sigBytes;}, _process: function _process(t) {var e,r = this._data,i = r.words,n = r.sigBytes,o = this.blockSize,s = n / (4 * o),c = (s = t ? h.ceil(s) : h.max((0 | s) - this._minBufferSize, 0)) * o,n = h.min(4 * c, n);if (c) {for (var a = 0; a < c; a += o) {this._doProcessBlock(i, a);}e = i.splice(0, c), r.sigBytes -= n;}return new l.init(e, n);}, clone: function clone() {var t = o.clone.call(this);return t._data = this._data.clone(), t;}, _minBufferSize: 0 }),u = (n.Hasher = d.extend({ cfg: o.extend(), init: function init(t) {this.cfg = this.cfg.extend(t), this.reset();}, reset: function reset() {d.reset.call(this), this._doReset();}, update: function update(t) {return this._append(t), this._process(), this;}, finalize: function finalize(t) {return t && this._append(t), this._doFinalize();}, blockSize: 16, _createHelper: function _createHelper(r) {return function (t, e) {return new r.init(e).finalize(t);};}, _createHmacHelper: function _createHmacHelper(r) {return function (t, e) {return new u.HMAC.init(r, e).finalize(t);};} }), t.algo = {});return t;}(Math);function K(t, e, r) {return t & e | ~t & r;}function X(t, e, r) {return t & r | e & ~r;}function L(t, e) {return t << e | t >>> 32 - e;}function j(t, e, r, i) {var n,o = this._iv;o ? (n = o.slice(0), this._iv = void 0) : n = this._prevBlock, i.encryptBlock(n, 0);for (var s = 0; s < r; s++) {t[e + s] ^= n[s];}}function T(t) {var e, r, i;return 255 == (t >> 24 & 255) ? (r = t >> 8 & 255, i = 255 & t, 255 === (e = t >> 16 & 255) ? (e = 0, 255 === r ? (r = 0, 255 === i ? i = 0 : ++i) : ++r) : ++e, t = 0, t += e << 16, t += r << 8, t += i) : t += 1 << 24, t;}function N() {for (var t = this._X, e = this._C, r = 0; r < 8; r++) {E[r] = e[r];}e[0] = e[0] + 1295307597 + this._b | 0, e[1] = e[1] + 3545052371 + (e[0] >>> 0 < E[0] >>> 0 ? 1 : 0) | 0, e[2] = e[2] + 886263092 + (e[1] >>> 0 < E[1] >>> 0 ? 1 : 0) | 0, e[3] = e[3] + 1295307597 + (e[2] >>> 0 < E[2] >>> 0 ? 1 : 0) | 0, e[4] = e[4] + 3545052371 + (e[3] >>> 0 < E[3] >>> 0 ? 1 : 0) | 0, e[5] = e[5] + 886263092 + (e[4] >>> 0 < E[4] >>> 0 ? 1 : 0) | 0, e[6] = e[6] + 1295307597 + (e[5] >>> 0 < E[5] >>> 0 ? 1 : 0) | 0, e[7] = e[7] + 3545052371 + (e[6] >>> 0 < E[6] >>> 0 ? 1 : 0) | 0, this._b = e[7] >>> 0 < E[7] >>> 0 ? 1 : 0;for (r = 0; r < 8; r++) {var i = t[r] + e[r],n = 65535 & i,o = i >>> 16;R[r] = ((n * n >>> 17) + n * o >>> 15) + o * o ^ ((4294901760 & i) * i | 0) + ((65535 & i) * i | 0);}t[0] = R[0] + (R[7] << 16 | R[7] >>> 16) + (R[6] << 16 | R[6] >>> 16) | 0, t[1] = R[1] + (R[0] << 8 | R[0] >>> 24) + R[7] | 0, t[2] = R[2] + (R[1] << 16 | R[1] >>> 16) + (R[0] << 16 | R[0] >>> 16) | 0, t[3] = R[3] + (R[2] << 8 | R[2] >>> 24) + R[1] | 0, t[4] = R[4] + (R[3] << 16 | R[3] >>> 16) + (R[2] << 16 | R[2] >>> 16) | 0, t[5] = R[5] + (R[4] << 8 | R[4] >>> 24) + R[3] | 0, t[6] = R[6] + (R[5] << 16 | R[5] >>> 16) + (R[4] << 16 | R[4] >>> 16) | 0, t[7] = R[7] + (R[6] << 8 | R[6] >>> 24) + R[5] | 0;}function q() {for (var t = this._X, e = this._C, r = 0; r < 8; r++) {O[r] = e[r];}e[0] = e[0] + 1295307597 + this._b | 0, e[1] = e[1] + 3545052371 + (e[0] >>> 0 < O[0] >>> 0 ? 1 : 0) | 0, e[2] = e[2] + 886263092 + (e[1] >>> 0 < O[1] >>> 0 ? 1 : 0) | 0, e[3] = e[3] + 1295307597 + (e[2] >>> 0 < O[2] >>> 0 ? 1 : 0) | 0, e[4] = e[4] + 3545052371 + (e[3] >>> 0 < O[3] >>> 0 ? 1 : 0) | 0, e[5] = e[5] + 886263092 + (e[4] >>> 0 < O[4] >>> 0 ? 1 : 0) | 0, e[6] = e[6] + 1295307597 + (e[5] >>> 0 < O[5] >>> 0 ? 1 : 0) | 0, e[7] = e[7] + 3545052371 + (e[6] >>> 0 < O[6] >>> 0 ? 1 : 0) | 0, this._b = e[7] >>> 0 < O[7] >>> 0 ? 1 : 0;for (r = 0; r < 8; r++) {var i = t[r] + e[r],n = 65535 & i,o = i >>> 16;I[r] = ((n * n >>> 17) + n * o >>> 15) + o * o ^ ((4294901760 & i) * i | 0) + ((65535 & i) * i | 0);}t[0] = I[0] + (I[7] << 16 | I[7] >>> 16) + (I[6] << 16 | I[6] >>> 16) | 0, t[1] = I[1] + (I[0] << 8 | I[0] >>> 24) + I[7] | 0, t[2] = I[2] + (I[1] << 16 | I[1] >>> 16) + (I[0] << 16 | I[0] >>> 16) | 0, t[3] = I[3] + (I[2] << 8 | I[2] >>> 24) + I[1] | 0, t[4] = I[4] + (I[3] << 16 | I[3] >>> 16) + (I[2] << 16 | I[2] >>> 16) | 0, t[5] = I[5] + (I[4] << 8 | I[4] >>> 24) + I[3] | 0, t[6] = I[6] + (I[5] << 16 | I[5] >>> 16) + (I[4] << 16 | I[4] >>> 16) | 0, t[7] = I[7] + (I[6] << 8 | I[6] >>> 24) + I[5] | 0;}return F = (M = U).lib, n = F.Base, o = F.WordArray, (M = M.x64 = {}).Word = n.extend({ init: function init(t, e) {this.high = t, this.low = e;} }), M.WordArray = n.extend({ init: function init(t, e) {t = this.words = t || [], this.sigBytes = null != e ? e : 8 * t.length;}, toX32: function toX32() {for (var t = this.words, e = t.length, r = [], i = 0; i < e; i++) {var n = t[i];r.push(n.high), r.push(n.low);}return o.create(r, this.sigBytes);}, clone: function clone() {for (var t = n.clone.call(this), e = t.words = this.words.slice(0), r = e.length, i = 0; i < r; i++) {e[i] = e[i].clone();}return t;} }), "function" == typeof ArrayBuffer && (P = U.lib.WordArray, s = P.init, (P.init = function (t) {if ((t = (t = t instanceof ArrayBuffer ? new Uint8Array(t) : t) instanceof Int8Array || "undefined" != typeof Uint8ClampedArray && t instanceof Uint8ClampedArray || t instanceof Int16Array || t instanceof Uint16Array || t instanceof Int32Array || t instanceof Uint32Array || t instanceof Float32Array || t instanceof Float64Array ? new Uint8Array(t.buffer, t.byteOffset, t.byteLength) : t) instanceof Uint8Array) {for (var e = t.byteLength, r = [], i = 0; i < e; i++) {r[i >>> 2] |= t[i] << 24 - i % 4 * 8;}s.call(this, r, e);} else s.apply(this, arguments);}).prototype = P), function () {var t = U,n = t.lib.WordArray,t = t.enc;t.Utf16 = t.Utf16BE = { stringify: function stringify(t) {for (var e = t.words, r = t.sigBytes, i = [], n = 0; n < r; n += 2) {var o = e[n >>> 2] >>> 16 - n % 4 * 8 & 65535;i.push(String.fromCharCode(o));}return i.join("");}, parse: function parse(t) {for (var e = t.length, r = [], i = 0; i < e; i++) {r[i >>> 1] |= t.charCodeAt(i) << 16 - i % 2 * 16;}return n.create(r, 2 * e);} };function s(t) {return t << 8 & 4278255360 | t >>> 8 & 16711935;}t.Utf16LE = { stringify: function stringify(t) {for (var e = t.words, r = t.sigBytes, i = [], n = 0; n < r; n += 2) {var o = s(e[n >>> 2] >>> 16 - n % 4 * 8 & 65535);i.push(String.fromCharCode(o));}return i.join("");}, parse: function parse(t) {for (var e = t.length, r = [], i = 0; i < e; i++) {r[i >>> 1] |= s(t.charCodeAt(i) << 16 - i % 2 * 16);}return n.create(r, 2 * e);} };}(), a = (w = U).lib.WordArray, w.enc.Base64 = { stringify: function stringify(t) {var e = t.words,r = t.sigBytes,i = this._map;t.clamp();for (var n = [], o = 0; o < r; o += 3) {for (var s = (e[o >>> 2] >>> 24 - o % 4 * 8 & 255) << 16 | (e[o + 1 >>> 2] >>> 24 - (o + 1) % 4 * 8 & 255) << 8 | e[o + 2 >>> 2] >>> 24 - (o + 2) % 4 * 8 & 255, c = 0; c < 4 && o + .75 * c < r; c++) {n.push(i.charAt(s >>> 6 * (3 - c) & 63));}}var a = i.charAt(64);if (a) for (; n.length % 4;) {n.push(a);}return n.join("");}, parse: function parse(t) {var e = t.length,r = this._map;if (!(i = this._reverseMap)) for (var i = this._reverseMap = [], n = 0; n < r.length; n++) {i[r.charCodeAt(n)] = n;}var o = r.charAt(64);return !o || -1 !== (o = t.indexOf(o)) && (e = o), function (t, e, r) {for (var i = [], n = 0, o = 0; o < e; o++) {var s, c;o % 4 && (s = r[t.charCodeAt(o - 1)] << o % 4 * 2, c = r[t.charCodeAt(o)] >>> 6 - o % 4 * 2, c = s | c, i[n >>> 2] |= c << 24 - n % 4 * 8, n++);}return a.create(i, n);}(t, e, i);}, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" }, h = (F = U).lib.WordArray, F.enc.Base64url = { stringify: function stringify(t) {var e = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;var r = t.words,i = t.sigBytes,n = e ? this._safe_map : this._map;t.clamp();for (var o = [], s = 0; s < i; s += 3) {for (var c = (r[s >>> 2] >>> 24 - s % 4 * 8 & 255) << 16 | (r[s + 1 >>> 2] >>> 24 - (s + 1) % 4 * 8 & 255) << 8 | r[s + 2 >>> 2] >>> 24 - (s + 2) % 4 * 8 & 255, a = 0; a < 4 && s + .75 * a < i; a++) {o.push(n.charAt(c >>> 6 * (3 - a) & 63));}}var h = n.charAt(64);if (h) for (; o.length % 4;) {o.push(h);}return o.join("");}, parse: function parse(t) {var e = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;var r = t.length,i = e ? this._safe_map : this._map;if (!(n = this._reverseMap)) for (var n = this._reverseMap = [], o = 0; o < i.length; o++) {n[i.charCodeAt(o)] = o;}e = i.charAt(64);return !e || -1 !== (e = t.indexOf(e)) && (r = e), function (t, e, r) {for (var i = [], n = 0, o = 0; o < e; o++) {var s, c;o % 4 && (s = r[t.charCodeAt(o - 1)] << o % 4 * 2, c = r[t.charCodeAt(o)] >>> 6 - o % 4 * 2, c = s | c, i[n >>> 2] |= c << 24 - n % 4 * 8, n++);}return h.create(i, n);}(t, r, n);}, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", _safe_map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_" }, function (a) {var t = U,e = t.lib,r = e.WordArray,i = e.Hasher,e = t.algo,A = [];!function () {for (var t = 0; t < 64; t++) {A[t] = 4294967296 * a.abs(a.sin(t + 1)) | 0;}}();e = e.MD5 = i.extend({ _doReset: function _doReset() {this._hash = new r.init([1732584193, 4023233417, 2562383102, 271733878]);}, _doProcessBlock: function _doProcessBlock(t, e) {for (var r = 0; r < 16; r++) {var i = e + r,n = t[i];t[i] = 16711935 & (n << 8 | n >>> 24) | 4278255360 & (n << 24 | n >>> 8);}var o = this._hash.words,s = t[e + 0],c = t[e + 1],a = t[e + 2],h = t[e + 3],l = t[e + 4],f = t[e + 5],d = t[e + 6],u = t[e + 7],p = t[e + 8],_ = t[e + 9],y = t[e + 10],v = t[e + 11],g = t[e + 12],B = t[e + 13],w = t[e + 14],k = t[e + 15],m = H(m = o[0], b = o[1], x = o[2], S = o[3], s, 7, A[0]),S = H(S, m, b, x, c, 12, A[1]),x = H(x, S, m, b, a, 17, A[2]),b = H(b, x, S, m, h, 22, A[3]);m = H(m, b, x, S, l, 7, A[4]), S = H(S, m, b, x, f, 12, A[5]), x = H(x, S, m, b, d, 17, A[6]), b = H(b, x, S, m, u, 22, A[7]), m = H(m, b, x, S, p, 7, A[8]), S = H(S, m, b, x, _, 12, A[9]), x = H(x, S, m, b, y, 17, A[10]), b = H(b, x, S, m, v, 22, A[11]), m = H(m, b, x, S, g, 7, A[12]), S = H(S, m, b, x, B, 12, A[13]), x = H(x, S, m, b, w, 17, A[14]), m = z(m, b = H(b, x, S, m, k, 22, A[15]), x, S, c, 5, A[16]), S = z(S, m, b, x, d, 9, A[17]), x = z(x, S, m, b, v, 14, A[18]), b = z(b, x, S, m, s, 20, A[19]), m = z(m, b, x, S, f, 5, A[20]), S = z(S, m, b, x, y, 9, A[21]), x = z(x, S, m, b, k, 14, A[22]), b = z(b, x, S, m, l, 20, A[23]), m = z(m, b, x, S, _, 5, A[24]), S = z(S, m, b, x, w, 9, A[25]), x = z(x, S, m, b, h, 14, A[26]), b = z(b, x, S, m, p, 20, A[27]), m = z(m, b, x, S, B, 5, A[28]), S = z(S, m, b, x, a, 9, A[29]), x = z(x, S, m, b, u, 14, A[30]), m = C(m, b = z(b, x, S, m, g, 20, A[31]), x, S, f, 4, A[32]), S = C(S, m, b, x, p, 11, A[33]), x = C(x, S, m, b, v, 16, A[34]), b = C(b, x, S, m, w, 23, A[35]), m = C(m, b, x, S, c, 4, A[36]), S = C(S, m, b, x, l, 11, A[37]), x = C(x, S, m, b, u, 16, A[38]), b = C(b, x, S, m, y, 23, A[39]), m = C(m, b, x, S, B, 4, A[40]), S = C(S, m, b, x, s, 11, A[41]), x = C(x, S, m, b, h, 16, A[42]), b = C(b, x, S, m, d, 23, A[43]), m = C(m, b, x, S, _, 4, A[44]), S = C(S, m, b, x, g, 11, A[45]), x = C(x, S, m, b, k, 16, A[46]), m = D(m, b = C(b, x, S, m, a, 23, A[47]), x, S, s, 6, A[48]), S = D(S, m, b, x, u, 10, A[49]), x = D(x, S, m, b, w, 15, A[50]), b = D(b, x, S, m, f, 21, A[51]), m = D(m, b, x, S, g, 6, A[52]), S = D(S, m, b, x, h, 10, A[53]), x = D(x, S, m, b, y, 15, A[54]), b = D(b, x, S, m, c, 21, A[55]), m = D(m, b, x, S, p, 6, A[56]), S = D(S, m, b, x, k, 10, A[57]), x = D(x, S, m, b, d, 15, A[58]), b = D(b, x, S, m, B, 21, A[59]), m = D(m, b, x, S, l, 6, A[60]), S = D(S, m, b, x, v, 10, A[61]), x = D(x, S, m, b, a, 15, A[62]), b = D(b, x, S, m, _, 21, A[63]), o[0] = o[0] + m | 0, o[1] = o[1] + b | 0, o[2] = o[2] + x | 0, o[3] = o[3] + S | 0;}, _doFinalize: function _doFinalize() {var t = this._data,e = t.words,r = 8 * this._nDataBytes,i = 8 * t.sigBytes;e[i >>> 5] |= 128 << 24 - i % 32;var n = a.floor(r / 4294967296),r = r;e[15 + (64 + i >>> 9 << 4)] = 16711935 & (n << 8 | n >>> 24) | 4278255360 & (n << 24 | n >>> 8), e[14 + (64 + i >>> 9 << 4)] = 16711935 & (r << 8 | r >>> 24) | 4278255360 & (r << 24 | r >>> 8), t.sigBytes = 4 * (e.length + 1), this._process();for (var e = this._hash, o = e.words, s = 0; s < 4; s++) {var c = o[s];o[s] = 16711935 & (c << 8 | c >>> 24) | 4278255360 & (c << 24 | c >>> 8);}return e;}, clone: function clone() {var t = i.clone.call(this);return t._hash = this._hash.clone(), t;} });function H(t, e, r, i, n, o, s) {s = t + (e & r | ~e & i) + n + s;return (s << o | s >>> 32 - o) + e;}function z(t, e, r, i, n, o, s) {s = t + (e & i | r & ~i) + n + s;return (s << o | s >>> 32 - o) + e;}function C(t, e, r, i, n, o, s) {s = t + (e ^ r ^ i) + n + s;return (s << o | s >>> 32 - o) + e;}function D(t, e, r, i, n, o, s) {s = t + (r ^ (e | ~i)) + n + s;return (s << o | s >>> 32 - o) + e;}t.MD5 = i._createHelper(e), t.HmacMD5 = i._createHmacHelper(e);}(Math), P = (M = U).lib, t = P.WordArray, e = P.Hasher, P = M.algo, l = [], P = P.SHA1 = e.extend({ _doReset: function _doReset() {this._hash = new t.init([1732584193, 4023233417, 2562383102, 271733878, 3285377520]);}, _doProcessBlock: function _doProcessBlock(t, e) {for (var r = this._hash.words, i = r[0], n = r[1], o = r[2], s = r[3], c = r[4], a = 0; a < 80; a++) {a < 16 ? l[a] = 0 | t[e + a] : (h = l[a - 3] ^ l[a - 8] ^ l[a - 14] ^ l[a - 16], l[a] = h << 1 | h >>> 31);var h = (i << 5 | i >>> 27) + c + l[a];h += a < 20 ? 1518500249 + (n & o | ~n & s) : a < 40 ? 1859775393 + (n ^ o ^ s) : a < 60 ? (n & o | n & s | o & s) - 1894007588 : (n ^ o ^ s) - 899497514, c = s, s = o, o = n << 30 | n >>> 2, n = i, i = h;}r[0] = r[0] + i | 0, r[1] = r[1] + n | 0, r[2] = r[2] + o | 0, r[3] = r[3] + s | 0, r[4] = r[4] + c | 0;}, _doFinalize: function _doFinalize() {var t = this._data,e = t.words,r = 8 * this._nDataBytes,i = 8 * t.sigBytes;return e[i >>> 5] |= 128 << 24 - i % 32, e[14 + (64 + i >>> 9 << 4)] = Math.floor(r / 4294967296), e[15 + (64 + i >>> 9 << 4)] = r, t.sigBytes = 4 * e.length, this._process(), this._hash;}, clone: function clone() {var t = e.clone.call(this);return t._hash = this._hash.clone(), t;} }), M.SHA1 = e._createHelper(P), M.HmacSHA1 = e._createHmacHelper(P), function (n) {var t = U,e = t.lib,r = e.WordArray,i = e.Hasher,e = t.algo,o = [],p = [];!function () {function t(t) {return 4294967296 * (t - (0 | t)) | 0;}for (var e = 2, r = 0; r < 64;) {!function (t) {for (var e = n.sqrt(t), r = 2; r <= e; r++) {if (!(t % r)) return;}return 1;}(e) || (r < 8 && (o[r] = t(n.pow(e, .5))), p[r] = t(n.pow(e, 1 / 3)), r++), e++;}}();var _ = [],e = e.SHA256 = i.extend({ _doReset: function _doReset() {this._hash = new r.init(o.slice(0));}, _doProcessBlock: function _doProcessBlock(t, e) {for (var r = this._hash.words, i = r[0], n = r[1], o = r[2], s = r[3], c = r[4], a = r[5], h = r[6], l = r[7], f = 0; f < 64; f++) {f < 16 ? _[f] = 0 | t[e + f] : (d = _[f - 15], u = _[f - 2], _[f] = ((d << 25 | d >>> 7) ^ (d << 14 | d >>> 18) ^ d >>> 3) + _[f - 7] + ((u << 15 | u >>> 17) ^ (u << 13 | u >>> 19) ^ u >>> 10) + _[f - 16]);var d = i & n ^ i & o ^ n & o,u = l + ((c << 26 | c >>> 6) ^ (c << 21 | c >>> 11) ^ (c << 7 | c >>> 25)) + (c & a ^ ~c & h) + p[f] + _[f],l = h,h = a,a = c,c = s + u | 0,s = o,o = n,n = i,i = u + (((i << 30 | i >>> 2) ^ (i << 19 | i >>> 13) ^ (i << 10 | i >>> 22)) + d) | 0;}r[0] = r[0] + i | 0, r[1] = r[1] + n | 0, r[2] = r[2] + o | 0, r[3] = r[3] + s | 0, r[4] = r[4] + c | 0, r[5] = r[5] + a | 0, r[6] = r[6] + h | 0, r[7] = r[7] + l | 0;}, _doFinalize: function _doFinalize() {var t = this._data,e = t.words,r = 8 * this._nDataBytes,i = 8 * t.sigBytes;return e[i >>> 5] |= 128 << 24 - i % 32, e[14 + (64 + i >>> 9 << 4)] = n.floor(r / 4294967296), e[15 + (64 + i >>> 9 << 4)] = r, t.sigBytes = 4 * e.length, this._process(), this._hash;}, clone: function clone() {var t = i.clone.call(this);return t._hash = this._hash.clone(), t;} });t.SHA256 = i._createHelper(e), t.HmacSHA256 = i._createHmacHelper(e);}(Math), r = (w = U).lib.WordArray, F = w.algo, i = F.SHA256, F = F.SHA224 = i.extend({ _doReset: function _doReset() {this._hash = new r.init([3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428]);}, _doFinalize: function _doFinalize() {var t = i._doFinalize.call(this);return t.sigBytes -= 4, t;} }), w.SHA224 = i._createHelper(F), w.HmacSHA224 = i._createHmacHelper(F), function () {var t = U,e = t.lib.Hasher,r = t.x64,i = r.Word,n = r.WordArray,r = t.algo;function o() {return i.create.apply(i, arguments);}var t1 = [o(1116352408, 3609767458), o(1899447441, 602891725), o(3049323471, 3964484399), o(3921009573, 2173295548), o(961987163, 4081628472), o(1508970993, 3053834265), o(2453635748, 2937671579), o(2870763221, 3664609560), o(3624381080, 2734883394), o(310598401, 1164996542), o(607225278, 1323610764), o(1426881987, 3590304994), o(1925078388, 4068182383), o(2162078206, 991336113), o(2614888103, 633803317), o(3248222580, 3479774868), o(3835390401, 2666613458), o(4022224774, 944711139), o(264347078, 2341262773), o(604807628, 2007800933), o(770255983, 1495990901), o(1249150122, 1856431235), o(1555081692, 3175218132), o(1996064986, 2198950837), o(2554220882, 3999719339), o(2821834349, 766784016), o(2952996808, 2566594879), o(3210313671, 3203337956), o(3336571891, 1034457026), o(3584528711, 2466948901), o(113926993, 3758326383), o(338241895, 168717936), o(666307205, 1188179964), o(773529912, 1546045734), o(1294757372, 1522805485), o(1396182291, 2643833823), o(1695183700, 2343527390), o(1986661051, 1014477480), o(2177026350, 1206759142), o(2456956037, 344077627), o(2730485921, 1290863460), o(2820302411, 3158454273), o(3259730800, 3505952657), o(3345764771, 106217008), o(3516065817, 3606008344), o(3600352804, 1432725776), o(4094571909, 1467031594), o(275423344, 851169720), o(430227734, 3100823752), o(506948616, 1363258195), o(659060556, 3750685593), o(883997877, 3785050280), o(958139571, 3318307427), o(1322822218, 3812723403), o(1537002063, 2003034995), o(1747873779, 3602036899), o(1955562222, 1575990012), o(2024104815, 1125592928), o(2227730452, 2716904306), o(2361852424, 442776044), o(2428436474, 593698344), o(2756734187, 3733110249), o(3204031479, 2999351573), o(3329325298, 3815920427), o(3391569614, 3928383900), o(3515267271, 566280711), o(3940187606, 3454069534), o(4118630271, 4000239992), o(116418474, 1914138554), o(174292421, 2731055270), o(289380356, 3203993006), o(460393269, 320620315), o(685471733, 587496836), o(852142971, 1086792851), o(1017036298, 365543100), o(1126000580, 2618297676), o(1288033470, 3409855158), o(1501505948, 4234509866), o(1607167915, 987167468), o(1816402316, 1246189591)],e1 = [];!function () {for (var t = 0; t < 80; t++) {e1[t] = o();}}();r = r.SHA512 = e.extend({ _doReset: function _doReset() {this._hash = new n.init([new i.init(1779033703, 4089235720), new i.init(3144134277, 2227873595), new i.init(1013904242, 4271175723), new i.init(2773480762, 1595750129), new i.init(1359893119, 2917565137), new i.init(2600822924, 725511199), new i.init(528734635, 4215389547), new i.init(1541459225, 327033209)]);}, _doProcessBlock: function _doProcessBlock(t, e) {for (var r = this._hash.words, i = r[0], n = r[1], o = r[2], s = r[3], c = r[4], a = r[5], h = r[6], l = r[7], f = i.high, d = i.low, u = n.high, p = n.low, _ = o.high, y = o.low, v = s.high, g = s.low, B = c.high, w = c.low, k = a.high, m = a.low, S = h.high, x = h.low, b = l.high, r = l.low, A = f, H = d, z = u, C = p, D = _, E = y, R = v, M = g, F = B, P = w, W = k, O = m, I = S, U = x, K = b, X = r, L = 0; L < 80; L++) {var j,T,N = e1[L];L < 16 ? (T = N.high = 0 | t[e + 2 * L], j = N.low = 0 | t[e + 2 * L + 1]) : ($ = (q = e1[L - 15]).high, J = q.low, G = (Q = e1[L - 2]).high, V = Q.low, Z = (Y = e1[L - 7]).high, q = Y.low, Y = (Q = e1[L - 16]).high, T = (T = (($ >>> 1 | J << 31) ^ ($ >>> 8 | J << 24) ^ $ >>> 7) + Z + ((j = (Z = (J >>> 1 | $ << 31) ^ (J >>> 8 | $ << 24) ^ (J >>> 7 | $ << 25)) + q) >>> 0 < Z >>> 0 ? 1 : 0)) + ((G >>> 19 | V << 13) ^ (G << 3 | V >>> 29) ^ G >>> 6) + ((j += J = (V >>> 19 | G << 13) ^ (V << 3 | G >>> 29) ^ (V >>> 6 | G << 26)) >>> 0 < J >>> 0 ? 1 : 0), j += $ = Q.low, N.high = T = T + Y + (j >>> 0 < $ >>> 0 ? 1 : 0), N.low = j);var q = F & W ^ ~F & I,Z = P & O ^ ~P & U,V = A & z ^ A & D ^ z & D,G = (H >>> 28 | A << 4) ^ (H << 30 | A >>> 2) ^ (H << 25 | A >>> 7),J = t1[L],Q = J.high,Y = J.low,$ = X + ((P >>> 14 | F << 18) ^ (P >>> 18 | F << 14) ^ (P << 23 | F >>> 9)),N = K + ((F >>> 14 | P << 18) ^ (F >>> 18 | P << 14) ^ (F << 23 | P >>> 9)) + ($ >>> 0 < X >>> 0 ? 1 : 0),J = G + (H & C ^ H & E ^ C & E),K = I,X = U,I = W,U = O,W = F,O = P,F = R + (N = (N = (N = N + q + (($ = $ + Z) >>> 0 < Z >>> 0 ? 1 : 0)) + Q + (($ = $ + Y) >>> 0 < Y >>> 0 ? 1 : 0)) + T + (($ = $ + j) >>> 0 < j >>> 0 ? 1 : 0)) + ((P = M + $ | 0) >>> 0 < M >>> 0 ? 1 : 0) | 0,R = D,M = E,D = z,E = C,z = A,C = H,A = N + (((A >>> 28 | H << 4) ^ (A << 30 | H >>> 2) ^ (A << 25 | H >>> 7)) + V + (J >>> 0 < G >>> 0 ? 1 : 0)) + ((H = $ + J | 0) >>> 0 < $ >>> 0 ? 1 : 0) | 0;}d = i.low = d + H, i.high = f + A + (d >>> 0 < H >>> 0 ? 1 : 0), p = n.low = p + C, n.high = u + z + (p >>> 0 < C >>> 0 ? 1 : 0), y = o.low = y + E, o.high = _ + D + (y >>> 0 < E >>> 0 ? 1 : 0), g = s.low = g + M, s.high = v + R + (g >>> 0 < M >>> 0 ? 1 : 0), w = c.low = w + P, c.high = B + F + (w >>> 0 < P >>> 0 ? 1 : 0), m = a.low = m + O, a.high = k + W + (m >>> 0 < O >>> 0 ? 1 : 0), x = h.low = x + U, h.high = S + I + (x >>> 0 < U >>> 0 ? 1 : 0), r = l.low = r + X, l.high = b + K + (r >>> 0 < X >>> 0 ? 1 : 0);}, _doFinalize: function _doFinalize() {var t = this._data,e = t.words,r = 8 * this._nDataBytes,i = 8 * t.sigBytes;return e[i >>> 5] |= 128 << 24 - i % 32, e[30 + (128 + i >>> 10 << 5)] = Math.floor(r / 4294967296), e[31 + (128 + i >>> 10 << 5)] = r, t.sigBytes = 4 * e.length, this._process(), this._hash.toX32();}, clone: function clone() {var t = e.clone.call(this);return t._hash = this._hash.clone(), t;}, blockSize: 32 });t.SHA512 = e._createHelper(r), t.HmacSHA512 = e._createHmacHelper(r);}(), P = (M = U).x64, c = P.Word, f = P.WordArray, P = M.algo, d = P.SHA512, P = P.SHA384 = d.extend({ _doReset: function _doReset() {this._hash = new f.init([new c.init(3418070365, 3238371032), new c.init(1654270250, 914150663), new c.init(2438529370, 812702999), new c.init(355462360, 4144912697), new c.init(1731405415, 4290775857), new c.init(2394180231, 1750603025), new c.init(3675008525, 1694076839), new c.init(1203062813, 3204075428)]);}, _doFinalize: function _doFinalize() {var t = d._doFinalize.call(this);return t.sigBytes -= 16, t;} }), M.SHA384 = d._createHelper(P), M.HmacSHA384 = d._createHmacHelper(P), function (l) {var t = U,e = t.lib,f = e.WordArray,i = e.Hasher,d = t.x64.Word,e = t.algo,A = [],H = [],z = [];!function () {for (var t = 1, e = 0, r = 0; r < 24; r++) {A[t + 5 * e] = (r + 1) * (r + 2) / 2 % 64;var i = (2 * t + 3 * e) % 5;t = e % 5, e = i;}for (t = 0; t < 5; t++) {for (e = 0; e < 5; e++) {H[t + 5 * e] = e + (2 * t + 3 * e) % 5 * 5;}}for (var n = 1, o = 0; o < 24; o++) {for (var s, c = 0, a = 0, h = 0; h < 7; h++) {1 & n && ((s = (1 << h) - 1) < 32 ? a ^= 1 << s : c ^= 1 << s - 32), 128 & n ? n = n << 1 ^ 113 : n <<= 1;}z[o] = d.create(c, a);}}();var C = [];!function () {for (var t = 0; t < 25; t++) {C[t] = d.create();}}();e = e.SHA3 = i.extend({ cfg: i.cfg.extend({ outputLength: 512 }), _doReset: function _doReset() {for (var t = this._state = [], e = 0; e < 25; e++) {t[e] = new d.init();}this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32;}, _doProcessBlock: function _doProcessBlock(t, e) {for (var r = this._state, i = this.blockSize / 2, n = 0; n < i; n++) {var o = t[e + 2 * n],s = t[e + 2 * n + 1],o = 16711935 & (o << 8 | o >>> 24) | 4278255360 & (o << 24 | o >>> 8);(m = r[n]).high ^= s = 16711935 & (s << 8 | s >>> 24) | 4278255360 & (s << 24 | s >>> 8), m.low ^= o;}for (var c = 0; c < 24; c++) {for (var a = 0; a < 5; a++) {for (var h = 0, l = 0, f = 0; f < 5; f++) {h ^= (m = r[a + 5 * f]).high, l ^= m.low;}var d = C[a];d.high = h, d.low = l;}for (a = 0; a < 5; a++) {for (var u = C[(a + 4) % 5], p = C[(a + 1) % 5], _ = p.high, p = p.low, h = u.high ^ (_ << 1 | p >>> 31), l = u.low ^ (p << 1 | _ >>> 31), f = 0; f < 5; f++) {(m = r[a + 5 * f]).high ^= h, m.low ^= l;}}for (var y = 1; y < 25; y++) {var v = (m = r[y]).high,g = m.low,B = A[y];l = B < 32 ? (h = v << B | g >>> 32 - B, g << B | v >>> 32 - B) : (h = g << B - 32 | v >>> 64 - B, v << B - 32 | g >>> 64 - B);B = C[H[y]];B.high = h, B.low = l;}var w = C[0],k = r[0];w.high = k.high, w.low = k.low;for (a = 0; a < 5; a++) {for (f = 0; f < 5; f++) {var m = r[y = a + 5 * f],S = C[y],x = C[(a + 1) % 5 + 5 * f],b = C[(a + 2) % 5 + 5 * f];m.high = S.high ^ ~x.high & b.high, m.low = S.low ^ ~x.low & b.low;}}m = r[0], k = z[c];m.high ^= k.high, m.low ^= k.low;}}, _doFinalize: function _doFinalize() {var t = this._data,e = t.words,r = (this._nDataBytes, 8 * t.sigBytes),i = 32 * this.blockSize;e[r >>> 5] |= 1 << 24 - r % 32, e[(l.ceil((1 + r) / i) * i >>> 5) - 1] |= 128, t.sigBytes = 4 * e.length, this._process();for (var n = this._state, e = this.cfg.outputLength / 8, o = e / 8, s = [], c = 0; c < o; c++) {var a = n[c],h = a.high,a = a.low,h = 16711935 & (h << 8 | h >>> 24) | 4278255360 & (h << 24 | h >>> 8);s.push(a = 16711935 & (a << 8 | a >>> 24) | 4278255360 & (a << 24 | a >>> 8)), s.push(h);}return new f.init(s, e);}, clone: function clone() {for (var t = i.clone.call(this), e = t._state = this._state.slice(0), r = 0; r < 25; r++) {e[r] = e[r].clone();}return t;} });t.SHA3 = i._createHelper(e), t.HmacSHA3 = i._createHmacHelper(e);}(Math), Math, F = (w = U).lib, u = F.WordArray, p = F.Hasher, F = w.algo, S = u.create([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]), x = u.create([5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]), b = u.create([11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6]), A = u.create([8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11]), H = u.create([0, 1518500249, 1859775393, 2400959708, 2840853838]), z = u.create([1352829926, 1548603684, 1836072691, 2053994217, 0]), F = F.RIPEMD160 = p.extend({ _doReset: function _doReset() {this._hash = u.create([1732584193, 4023233417, 2562383102, 271733878, 3285377520]);}, _doProcessBlock: function _doProcessBlock(t, e) {for (var r = 0; r < 16; r++) {var i = e + r,n = t[i];t[i] = 16711935 & (n << 8 | n >>> 24) | 4278255360 & (n << 24 | n >>> 8);}for (var o, s, c, a, h, l, f = this._hash.words, d = H.words, u = z.words, p = S.words, _ = x.words, y = b.words, v = A.words, g = o = f[0], B = s = f[1], w = c = f[2], k = a = f[3], m = h = f[4], r = 0; r < 80; r += 1) {l = o + t[e + p[r]] | 0, l += r < 16 ? (s ^ c ^ a) + d[0] : r < 32 ? K(s, c, a) + d[1] : r < 48 ? ((s | ~c) ^ a) + d[2] : r < 64 ? X(s, c, a) + d[3] : (s ^ (c | ~a)) + d[4], l = (l = L(l |= 0, y[r])) + h | 0, o = h, h = a, a = L(c, 10), c = s, s = l, l = g + t[e + _[r]] | 0, l += r < 16 ? (B ^ (w | ~k)) + u[0] : r < 32 ? X(B, w, k) + u[1] : r < 48 ? ((B | ~w) ^ k) + u[2] : r < 64 ? K(B, w, k) + u[3] : (B ^ w ^ k) + u[4], l = (l = L(l |= 0, v[r])) + m | 0, g = m, m = k, k = L(w, 10), w = B, B = l;}l = f[1] + c + k | 0, f[1] = f[2] + a + m | 0, f[2] = f[3] + h + g | 0, f[3] = f[4] + o + B | 0, f[4] = f[0] + s + w | 0, f[0] = l;}, _doFinalize: function _doFinalize() {var t = this._data,e = t.words,r = 8 * this._nDataBytes,i = 8 * t.sigBytes;e[i >>> 5] |= 128 << 24 - i % 32, e[14 + (64 + i >>> 9 << 4)] = 16711935 & (r << 8 | r >>> 24) | 4278255360 & (r << 24 | r >>> 8), t.sigBytes = 4 * (e.length + 1), this._process();for (var e = this._hash, n = e.words, o = 0; o < 5; o++) {var s = n[o];n[o] = 16711935 & (s << 8 | s >>> 24) | 4278255360 & (s << 24 | s >>> 8);}return e;}, clone: function clone() {var t = p.clone.call(this);return t._hash = this._hash.clone(), t;} }), w.RIPEMD160 = p._createHelper(F), w.HmacRIPEMD160 = p._createHmacHelper(F), P = (M = U).lib.Base, _ = M.enc.Utf8, M.algo.HMAC = P.extend({ init: function init(t, e) {t = this._hasher = new t.init(), "string" == typeof e && (e = _.parse(e));var r = t.blockSize,i = 4 * r;(e = e.sigBytes > i ? t.finalize(e) : e).clamp();for (var t = this._oKey = e.clone(), e = this._iKey = e.clone(), n = t.words, o = e.words, s = 0; s < r; s++) {n[s] ^= 1549556828, o[s] ^= 909522486;}t.sigBytes = e.sigBytes = i, this.reset();}, reset: function reset() {var t = this._hasher;t.reset(), t.update(this._iKey);}, update: function update(t) {return this._hasher.update(t), this;}, finalize: function finalize(t) {var e = this._hasher,t = e.finalize(t);return e.reset(), e.finalize(this._oKey.clone().concat(t));} }), F = (w = U).lib, M = F.Base, v = F.WordArray, P = w.algo, F = P.SHA1, g = P.HMAC, y = P.PBKDF2 = M.extend({ cfg: M.extend({ keySize: 4, hasher: F, iterations: 1 }), init: function init(t) {this.cfg = this.cfg.extend(t);}, compute: function compute(t, e) {for (var r = this.cfg, i = g.create(r.hasher, t), n = v.create(), o = v.create([1]), s = n.words, c = o.words, a = r.keySize, h = r.iterations; s.length < a;) {var l = i.update(e).finalize(o);i.reset();for (var f = l.words, d = f.length, u = l, p = 1; p < h; p++) {u = i.finalize(u), i.reset();for (var _ = u.words, y = 0; y < d; y++) {f[y] ^= _[y];}}n.concat(l), c[0]++;}return n.sigBytes = 4 * a, n;} }), w.PBKDF2 = function (t, e, r) {return y.create(r).compute(t, e);}, M = (P = U).lib, F = M.Base, B = M.WordArray, w = P.algo, M = w.MD5, k = w.EvpKDF = F.extend({ cfg: F.extend({ keySize: 4, hasher: M, iterations: 1 }), init: function init(t) {this.cfg = this.cfg.extend(t);}, compute: function compute(t, e) {for (var r, i = this.cfg, n = i.hasher.create(), o = B.create(), s = o.words, c = i.keySize, a = i.iterations; s.length < c;) {r && n.update(r), r = n.update(t).finalize(e), n.reset();for (var h = 1; h < a; h++) {r = n.finalize(r), n.reset();}o.concat(r);}return o.sigBytes = 4 * c, o;} }), P.EvpKDF = function (t, e, r) {return k.create(r).compute(t, e);}, U.lib.Cipher || function () {var t = U,e = t.lib,r = e.Base,s = e.WordArray,i = e.BufferedBlockAlgorithm,n = t.enc,o = (n.Utf8, n.Base64),c = t.algo.EvpKDF,a = e.Cipher = i.extend({ cfg: r.extend(), createEncryptor: function createEncryptor(t, e) {return this.create(this._ENC_XFORM_MODE, t, e);}, createDecryptor: function createDecryptor(t, e) {return this.create(this._DEC_XFORM_MODE, t, e);}, init: function init(t, e, r) {this.cfg = this.cfg.extend(r), this._xformMode = t, this._key = e, this.reset();}, reset: function reset() {i.reset.call(this), this._doReset();}, process: function process(t) {return this._append(t), this._process();}, finalize: function finalize(t) {return t && this._append(t), this._doFinalize();}, keySize: 4, ivSize: 4, _ENC_XFORM_MODE: 1, _DEC_XFORM_MODE: 2, _createHelper: function _createHelper(i) {return { encrypt: function encrypt(t, e, r) {return h(e).encrypt(i, t, e, r);}, decrypt: function decrypt(t, e, r) {return h(e).decrypt(i, t, e, r);} };} });function h(t) {return "string" == typeof t ? p : u;}e.StreamCipher = a.extend({ _doFinalize: function _doFinalize() {return this._process(!0);}, blockSize: 1 });var l = t.mode = {},n = e.BlockCipherMode = r.extend({ createEncryptor: function createEncryptor(t, e) {return this.Encryptor.create(t, e);}, createDecryptor: function createDecryptor(t, e) {return this.Decryptor.create(t, e);}, init: function init(t, e) {this._cipher = t, this._iv = e;} }),n = l.CBC = ((l = n.extend()).Encryptor = l.extend({ processBlock: function processBlock(t, e) {var r = this._cipher,i = r.blockSize;f.call(this, t, e, i), r.encryptBlock(t, e), this._prevBlock = t.slice(e, e + i);} }), l.Decryptor = l.extend({ processBlock: function processBlock(t, e) {var r = this._cipher,i = r.blockSize,n = t.slice(e, e + i);r.decryptBlock(t, e), f.call(this, t, e, i), this._prevBlock = n;} }), l);function f(t, e, r) {var i,n = this._iv;n ? (i = n, this._iv = void 0) : i = this._prevBlock;for (var o = 0; o < r; o++) {t[e + o] ^= i[o];}}var l = (t.pad = {}).Pkcs7 = { pad: function pad(t, e) {for (var e = 4 * e, r = e - t.sigBytes % e, i = r << 24 | r << 16 | r << 8 | r, n = [], o = 0; o < r; o += 4) {n.push(i);}e = s.create(n, r);t.concat(e);}, unpad: function unpad(t) {var e = 255 & t.words[t.sigBytes - 1 >>> 2];t.sigBytes -= e;} },d = (e.BlockCipher = a.extend({ cfg: a.cfg.extend({ mode: n, padding: l }), reset: function reset() {var t;a.reset.call(this);var e = this.cfg,r = e.iv,e = e.mode;this._xformMode == this._ENC_XFORM_MODE ? t = e.createEncryptor : (t = e.createDecryptor, this._minBufferSize = 1), this._mode && this._mode.__creator == t ? this._mode.init(this, r && r.words) : (this._mode = t.call(e, this, r && r.words), this._mode.__creator = t);}, _doProcessBlock: function _doProcessBlock(t, e) {this._mode.processBlock(t, e);}, _doFinalize: function _doFinalize() {var t,e = this.cfg.padding;return this._xformMode == this._ENC_XFORM_MODE ? (e.pad(this._data, this.blockSize), t = this._process(!0)) : (t = this._process(!0), e.unpad(t)), t;}, blockSize: 4 }), e.CipherParams = r.extend({ init: function init(t) {this.mixIn(t);}, toString: function toString(t) {return (t || this.formatter).stringify(this);} })),l = (t.format = {}).OpenSSL = { stringify: function stringify(t) {var e = t.ciphertext,t = t.salt,e = t ? s.create([1398893684, 1701076831]).concat(t).concat(e) : e;return e.toString(o);}, parse: function parse(t) {var e,r = o.parse(t),t = r.words;return 1398893684 == t[0] && 1701076831 == t[1] && (e = s.create(t.slice(2, 4)), t.splice(0, 4), r.sigBytes -= 16), d.create({ ciphertext: r, salt: e });} },u = e.SerializableCipher = r.extend({ cfg: r.extend({ format: l }), encrypt: function encrypt(t, e, r, i) {i = this.cfg.extend(i);var n = t.createEncryptor(r, i),e = n.finalize(e),n = n.cfg;return d.create({ ciphertext: e, key: r, iv: n.iv, algorithm: t, mode: n.mode, padding: n.padding, blockSize: t.blockSize, formatter: i.format });}, decrypt: function decrypt(t, e, r, i) {return i = this.cfg.extend(i), e = this._parse(e, i.format), t.createDecryptor(r, i).finalize(e.ciphertext);}, _parse: function _parse(t, e) {return "string" == typeof t ? e.parse(t, this) : t;} }),t = (t.kdf = {}).OpenSSL = { execute: function execute(t, e, r, i) {i = i || s.random(8);t = c.create({ keySize: e + r }).compute(t, i), r = s.create(t.words.slice(e), 4 * r);return t.sigBytes = 4 * e, d.create({ key: t, iv: r, salt: i });} },p = e.PasswordBasedCipher = u.extend({ cfg: u.cfg.extend({ kdf: t }), encrypt: function encrypt(t, e, r, i) {r = (i = this.cfg.extend(i)).kdf.execute(r, t.keySize, t.ivSize);i.iv = r.iv;i = u.encrypt.call(this, t, e, r.key, i);return i.mixIn(r), i;}, decrypt: function decrypt(t, e, r, i) {i = this.cfg.extend(i), e = this._parse(e, i.format);r = i.kdf.execute(r, t.keySize, t.ivSize, e.salt);return i.iv = r.iv, u.decrypt.call(this, t, e, r.key, i);} });}(), U.mode.CFB = ((F = U.lib.BlockCipherMode.extend()).Encryptor = F.extend({ processBlock: function processBlock(t, e) {var r = this._cipher,i = r.blockSize;j.call(this, t, e, i, r), this._prevBlock = t.slice(e, e + i);} }), F.Decryptor = F.extend({ processBlock: function processBlock(t, e) {var r = this._cipher,i = r.blockSize,n = t.slice(e, e + i);j.call(this, t, e, i, r), this._prevBlock = n;} }), F), U.mode.CTR = (M = U.lib.BlockCipherMode.extend(), P = M.Encryptor = M.extend({ processBlock: function processBlock(t, e) {var r = this._cipher,i = r.blockSize,n = this._iv,o = this._counter;n && (o = this._counter = n.slice(0), this._iv = void 0);var s = o.slice(0);r.encryptBlock(s, 0), o[i - 1] = o[i - 1] + 1 | 0;for (var c = 0; c < i; c++) {t[e + c] ^= s[c];}} }), M.Decryptor = P, M), U.mode.CTRGladman = (F = U.lib.BlockCipherMode.extend(), P = F.Encryptor = F.extend({ processBlock: function processBlock(t, e) {var r = this._cipher,i = r.blockSize,n = this._iv,o = this._counter;n && (o = this._counter = n.slice(0), this._iv = void 0), 0 === ((n = o)[0] = T(n[0])) && (n[1] = T(n[1]));var s = o.slice(0);r.encryptBlock(s, 0);for (var c = 0; c < i; c++) {t[e + c] ^= s[c];}} }), F.Decryptor = P, F), U.mode.OFB = (M = U.lib.BlockCipherMode.extend(), P = M.Encryptor = M.extend({ processBlock: function processBlock(t, e) {var r = this._cipher,i = r.blockSize,n = this._iv,o = this._keystream;n && (o = this._keystream = n.slice(0), this._iv = void 0), r.encryptBlock(o, 0);for (var s = 0; s < i; s++) {t[e + s] ^= o[s];}} }), M.Decryptor = P, M), U.mode.ECB = ((F = U.lib.BlockCipherMode.extend()).Encryptor = F.extend({ processBlock: function processBlock(t, e) {this._cipher.encryptBlock(t, e);} }), F.Decryptor = F.extend({ processBlock: function processBlock(t, e) {this._cipher.decryptBlock(t, e);} }), F), U.pad.AnsiX923 = { pad: function pad(t, e) {var r = t.sigBytes,e = 4 * e,e = e - r % e,r = r + e - 1;t.clamp(), t.words[r >>> 2] |= e << 24 - r % 4 * 8, t.sigBytes += e;}, unpad: function unpad(t) {var e = 255 & t.words[t.sigBytes - 1 >>> 2];t.sigBytes -= e;} }, U.pad.Iso10126 = { pad: function pad(t, e) {e *= 4, e -= t.sigBytes % e;t.concat(U.lib.WordArray.random(e - 1)).concat(U.lib.WordArray.create([e << 24], 1));}, unpad: function unpad(t) {var e = 255 & t.words[t.sigBytes - 1 >>> 2];t.sigBytes -= e;} }, U.pad.Iso97971 = { pad: function pad(t, e) {t.concat(U.lib.WordArray.create([2147483648], 1)), U.pad.ZeroPadding.pad(t, e);}, unpad: function unpad(t) {U.pad.ZeroPadding.unpad(t), t.sigBytes--;} }, U.pad.ZeroPadding = { pad: function pad(t, e) {e *= 4;t.clamp(), t.sigBytes += e - (t.sigBytes % e || e);}, unpad: function unpad(t) {for (var e = t.words, r = t.sigBytes - 1, r = t.sigBytes - 1; 0 <= r; r--) {if (e[r >>> 2] >>> 24 - r % 4 * 8 & 255) {t.sigBytes = r + 1;break;}}} }, U.pad.NoPadding = { pad: function pad() {}, unpad: function unpad() {} }, m = (P = U).lib.CipherParams, C = P.enc.Hex, P.format.Hex = { stringify: function stringify(t) {return t.ciphertext.toString(C);}, parse: function parse(t) {t = C.parse(t);return m.create({ ciphertext: t });} }, function () {var t = U,e = t.lib.BlockCipher,r = t.algo,h = [],l = [],f = [],d = [],u = [],p = [],_ = [],y = [],v = [],g = [];!function () {for (var t = [], e = 0; e < 256; e++) {t[e] = e < 128 ? e << 1 : e << 1 ^ 283;}for (var r = 0, i = 0, e = 0; e < 256; e++) {var n = i ^ i << 1 ^ i << 2 ^ i << 3 ^ i << 4;h[r] = n = n >>> 8 ^ 255 & n ^ 99;var o = t[l[n] = r],s = t[o],c = t[s],a = 257 * t[n] ^ 16843008 * n;f[r] = a << 24 | a >>> 8, d[r] = a << 16 | a >>> 16, u[r] = a << 8 | a >>> 24, p[r] = a, _[n] = (a = 16843009 * c ^ 65537 * s ^ 257 * o ^ 16843008 * r) << 24 | a >>> 8, y[n] = a << 16 | a >>> 16, v[n] = a << 8 | a >>> 24, g[n] = a, r ? (r = o ^ t[t[t[c ^ o]]], i ^= t[t[i]]) : r = i = 1;}}();var B = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54],r = r.AES = e.extend({ _doReset: function _doReset() {if (!this._nRounds || this._keyPriorReset !== this._key) {for (var t = this._keyPriorReset = this._key, e = t.words, r = t.sigBytes / 4, i = 4 * (1 + (this._nRounds = 6 + r)), n = this._keySchedule = [], o = 0; o < i; o++) {o < r ? n[o] = e[o] : (a = n[o - 1], o % r ? 6 < r && o % r == 4 && (a = h[a >>> 24] << 24 | h[a >>> 16 & 255] << 16 | h[a >>> 8 & 255] << 8 | h[255 & a]) : (a = h[(a = a << 8 | a >>> 24) >>> 24] << 24 | h[a >>> 16 & 255] << 16 | h[a >>> 8 & 255] << 8 | h[255 & a], a ^= B[o / r | 0] << 24), n[o] = n[o - r] ^ a);}for (var s = this._invKeySchedule = [], c = 0; c < i; c++) {var a,o = i - c;a = c % 4 ? n[o] : n[o - 4], s[c] = c < 4 || o <= 4 ? a : _[h[a >>> 24]] ^ y[h[a >>> 16 & 255]] ^ v[h[a >>> 8 & 255]] ^ g[h[255 & a]];}}}, encryptBlock: function encryptBlock(t, e) {this._doCryptBlock(t, e, this._keySchedule, f, d, u, p, h);}, decryptBlock: function decryptBlock(t, e) {var r = t[e + 1];t[e + 1] = t[e + 3], t[e + 3] = r, this._doCryptBlock(t, e, this._invKeySchedule, _, y, v, g, l);r = t[e + 1];t[e + 1] = t[e + 3], t[e + 3] = r;}, _doCryptBlock: function _doCryptBlock(t, e, r, i, n, o, s, c) {for (var a = this._nRounds, h = t[e] ^ r[0], l = t[e + 1] ^ r[1], f = t[e + 2] ^ r[2], d = t[e + 3] ^ r[3], u = 4, p = 1; p < a; p++) {var _ = i[h >>> 24] ^ n[l >>> 16 & 255] ^ o[f >>> 8 & 255] ^ s[255 & d] ^ r[u++],y = i[l >>> 24] ^ n[f >>> 16 & 255] ^ o[d >>> 8 & 255] ^ s[255 & h] ^ r[u++],v = i[f >>> 24] ^ n[d >>> 16 & 255] ^ o[h >>> 8 & 255] ^ s[255 & l] ^ r[u++],g = i[d >>> 24] ^ n[h >>> 16 & 255] ^ o[l >>> 8 & 255] ^ s[255 & f] ^ r[u++],h = _,l = y,f = v,d = g;}_ = (c[h >>> 24] << 24 | c[l >>> 16 & 255] << 16 | c[f >>> 8 & 255] << 8 | c[255 & d]) ^ r[u++], y = (c[l >>> 24] << 24 | c[f >>> 16 & 255] << 16 | c[d >>> 8 & 255] << 8 | c[255 & h]) ^ r[u++], v = (c[f >>> 24] << 24 | c[d >>> 16 & 255] << 16 | c[h >>> 8 & 255] << 8 | c[255 & l]) ^ r[u++], g = (c[d >>> 24] << 24 | c[h >>> 16 & 255] << 16 | c[l >>> 8 & 255] << 8 | c[255 & f]) ^ r[u++];t[e] = _, t[e + 1] = y, t[e + 2] = v, t[e + 3] = g;}, keySize: 8 });t.AES = e._createHelper(r);}(), function () {var t = U,e = t.lib,i = e.WordArray,r = e.BlockCipher,e = t.algo,h = [57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36, 63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4],l = [14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10, 23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2, 41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48, 44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32],f = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28],d = [{ 0: 8421888, 268435456: 32768, 536870912: 8421378, 805306368: 2, 1073741824: 512, 1342177280: 8421890, 1610612736: 8389122, 1879048192: 8388608, 2147483648: 514, 2415919104: 8389120, 2684354560: 33280, 2952790016: 8421376, 3221225472: 32770, 3489660928: 8388610, 3758096384: 0, 4026531840: 33282, 134217728: 0, 402653184: 8421890, 671088640: 33282, 939524096: 32768, 1207959552: 8421888, 1476395008: 512, 1744830464: 8421378, 2013265920: 2, 2281701376: 8389120, 2550136832: 33280, 2818572288: 8421376, 3087007744: 8389122, 3355443200: 8388610, 3623878656: 32770, 3892314112: 514, 4160749568: 8388608, 1: 32768, 268435457: 2, 536870913: 8421888, 805306369: 8388608, 1073741825: 8421378, 1342177281: 33280, 1610612737: 512, 1879048193: 8389122, 2147483649: 8421890, 2415919105: 8421376, 2684354561: 8388610, 2952790017: 33282, 3221225473: 514, 3489660929: 8389120, 3758096385: 32770, 4026531841: 0, 134217729: 8421890, 402653185: 8421376, 671088641: 8388608, 939524097: 512, 1207959553: 32768, 1476395009: 8388610, 1744830465: 2, 2013265921: 33282, 2281701377: 32770, 2550136833: 8389122, 2818572289: 514, 3087007745: 8421888, 3355443201: 8389120, 3623878657: 0, 3892314113: 33280, 4160749569: 8421378 }, { 0: 1074282512, 16777216: 16384, 33554432: 524288, 50331648: 1074266128, 67108864: 1073741840, 83886080: 1074282496, 100663296: 1073758208, 117440512: 16, 134217728: 540672, 150994944: 1073758224, 167772160: 1073741824, 184549376: 540688, 201326592: 524304, 218103808: 0, 234881024: 16400, 251658240: 1074266112, 8388608: 1073758208, 25165824: 540688, 41943040: 16, 58720256: 1073758224, 75497472: 1074282512, 92274688: 1073741824, 109051904: 524288, 125829120: 1074266128, 142606336: 524304, 159383552: 0, 176160768: 16384, 192937984: 1074266112, 209715200: 1073741840, 226492416: 540672, 243269632: 1074282496, 260046848: 16400, 268435456: 0, 285212672: 1074266128, 301989888: 1073758224, 318767104: 1074282496, 335544320: 1074266112, 352321536: 16, 369098752: 540688, 385875968: 16384, 402653184: 16400, 419430400: 524288, 436207616: 524304, 452984832: 1073741840, 469762048: 540672, 486539264: 1073758208, 503316480: 1073741824, 520093696: 1074282512, 276824064: 540688, 293601280: 524288, 310378496: 1074266112, 327155712: 16384, 343932928: 1073758208, 360710144: 1074282512, 377487360: 16, 394264576: 1073741824, 411041792: 1074282496, 427819008: 1073741840, 444596224: 1073758224, 461373440: 524304, 478150656: 0, 494927872: 16400, 511705088: 1074266128, 528482304: 540672 }, { 0: 260, 1048576: 0, 2097152: 67109120, 3145728: 65796, 4194304: 65540, 5242880: 67108868, 6291456: 67174660, 7340032: 67174400, 8388608: 67108864, 9437184: 67174656, 10485760: 65792, 11534336: 67174404, 12582912: 67109124, 13631488: 65536, 14680064: 4, 15728640: 256, 524288: 67174656, 1572864: 67174404, 2621440: 0, 3670016: 67109120, 4718592: 67108868, 5767168: 65536, 6815744: 65540, 7864320: 260, 8912896: 4, 9961472: 256, 11010048: 67174400, 12058624: 65796, 13107200: 65792, 14155776: 67109124, 15204352: 67174660, 16252928: 67108864, 16777216: 67174656, 17825792: 65540, 18874368: 65536, 19922944: 67109120, 20971520: 256, 22020096: 67174660, 23068672: 67108868, 24117248: 0, 25165824: 67109124, 26214400: 67108864, 27262976: 4, 28311552: 65792, 29360128: 67174400, 30408704: 260, 31457280: 65796, 32505856: 67174404, 17301504: 67108864, 18350080: 260, 19398656: 67174656, 20447232: 0, 21495808: 65540, 22544384: 67109120, 23592960: 256, 24641536: 67174404, 25690112: 65536, 26738688: 67174660, 27787264: 65796, 28835840: 67108868, 29884416: 67109124, 30932992: 67174400, 31981568: 4, 33030144: 65792 }, { 0: 2151682048, 65536: 2147487808, 131072: 4198464, 196608: 2151677952, 262144: 0, 327680: 4198400, 393216: 2147483712, 458752: 4194368, 524288: 2147483648, 589824: 4194304, 655360: 64, 720896: 2147487744, 786432: 2151678016, 851968: 4160, 917504: 4096, 983040: 2151682112, 32768: 2147487808, 98304: 64, 163840: 2151678016, 229376: 2147487744, 294912: 4198400, 360448: 2151682112, 425984: 0, 491520: 2151677952, 557056: 4096, 622592: 2151682048, 688128: 4194304, 753664: 4160, 819200: 2147483648, 884736: 4194368, 950272: 4198464, 1015808: 2147483712, 1048576: 4194368, 1114112: 4198400, 1179648: 2147483712, 1245184: 0, 1310720: 4160, 1376256: 2151678016, 1441792: 2151682048, 1507328: 2147487808, 1572864: 2151682112, 1638400: 2147483648, 1703936: 2151677952, 1769472: 4198464, 1835008: 2147487744, 1900544: 4194304, 1966080: 64, 2031616: 4096, 1081344: 2151677952, 1146880: 2151682112, 1212416: 0, 1277952: 4198400, 1343488: 4194368, 1409024: 2147483648, 1474560: 2147487808, 1540096: 64, 1605632: 2147483712, 1671168: 4096, 1736704: 2147487744, 1802240: 2151678016, 1867776: 4160, 1933312: 2151682048, 1998848: 4194304, 2064384: 4198464 }, { 0: 128, 4096: 17039360, 8192: 262144, 12288: 536870912, 16384: 537133184, 20480: 16777344, 24576: 553648256, 28672: 262272, 32768: 16777216, 36864: 537133056, 40960: 536871040, 45056: 553910400, 49152: 553910272, 53248: 0, 57344: 17039488, 61440: 553648128, 2048: 17039488, 6144: 553648256, 10240: 128, 14336: 17039360, 18432: 262144, 22528: 537133184, 26624: 553910272, 30720: 536870912, 34816: 537133056, 38912: 0, 43008: 553910400, 47104: 16777344, 51200: 536871040, 55296: 553648128, 59392: 16777216, 63488: 262272, 65536: 262144, 69632: 128, 73728: 536870912, 77824: 553648256, 81920: 16777344, 86016: 553910272, 90112: 537133184, 94208: 16777216, 98304: 553910400, 102400: 553648128, 106496: 17039360, 110592: 537133056, 114688: 262272, 118784: 536871040, 122880: 0, 126976: 17039488, 67584: 553648256, 71680: 16777216, 75776: 17039360, 79872: 537133184, 83968: 536870912, 88064: 17039488, 92160: 128, 96256: 553910272, 100352: 262272, 104448: 553910400, 108544: 0, 112640: 553648128, 116736: 16777344, 120832: 262144, 124928: 537133056, 129024: 536871040 }, { 0: 268435464, 256: 8192, 512: 270532608, 768: 270540808, 1024: 268443648, 1280: 2097152, 1536: 2097160, 1792: 268435456, 2048: 0, 2304: 268443656, 2560: 2105344, 2816: 8, 3072: 270532616, 3328: 2105352, 3584: 8200, 3840: 270540800, 128: 270532608, 384: 270540808, 640: 8, 896: 2097152, 1152: 2105352, 1408: 268435464, 1664: 268443648, 1920: 8200, 2176: 2097160, 2432: 8192, 2688: 268443656, 2944: 270532616, 3200: 0, 3456: 270540800, 3712: 2105344, 3968: 268435456, 4096: 268443648, 4352: 270532616, 4608: 270540808, 4864: 8200, 5120: 2097152, 5376: 268435456, 5632: 268435464, 5888: 2105344, 6144: 2105352, 6400: 0, 6656: 8, 6912: 270532608, 7168: 8192, 7424: 268443656, 7680: 270540800, 7936: 2097160, 4224: 8, 4480: 2105344, 4736: 2097152, 4992: 268435464, 5248: 268443648, 5504: 8200, 5760: 270540808, 6016: 270532608, 6272: 270540800, 6528: 270532616, 6784: 8192, 7040: 2105352, 7296: 2097160, 7552: 0, 7808: 268435456, 8064: 268443656 }, { 0: 1048576, 16: 33555457, 32: 1024, 48: 1049601, 64: 34604033, 80: 0, 96: 1, 112: 34603009, 128: 33555456, 144: 1048577, 160: 33554433, 176: 34604032, 192: 34603008, 208: 1025, 224: 1049600, 240: 33554432, 8: 34603009, 24: 0, 40: 33555457, 56: 34604032, 72: 1048576, 88: 33554433, 104: 33554432, 120: 1025, 136: 1049601, 152: 33555456, 168: 34603008, 184: 1048577, 200: 1024, 216: 34604033, 232: 1, 248: 1049600, 256: 33554432, 272: 1048576, 288: 33555457, 304: 34603009, 320: 1048577, 336: 33555456, 352: 34604032, 368: 1049601, 384: 1025, 400: 34604033, 416: 1049600, 432: 1, 448: 0, 464: 34603008, 480: 33554433, 496: 1024, 264: 1049600, 280: 33555457, 296: 34603009, 312: 1, 328: 33554432, 344: 1048576, 360: 1025, 376: 34604032, 392: 33554433, 408: 34603008, 424: 0, 440: 34604033, 456: 1049601, 472: 1024, 488: 33555456, 504: 1048577 }, { 0: 134219808, 1: 131072, 2: 134217728, 3: 32, 4: 131104, 5: 134350880, 6: 134350848, 7: 2048, 8: 134348800, 9: 134219776, 10: 133120, 11: 134348832, 12: 2080, 13: 0, 14: 134217760, 15: 133152, 2147483648: 2048, 2147483649: 134350880, 2147483650: 134219808, 2147483651: 134217728, 2147483652: 134348800, 2147483653: 133120, 2147483654: 133152, 2147483655: 32, 2147483656: 134217760, 2147483657: 2080, 2147483658: 131104, 2147483659: 134350848, 2147483660: 0, 2147483661: 134348832, 2147483662: 134219776, 2147483663: 131072, 16: 133152, 17: 134350848, 18: 32, 19: 2048, 20: 134219776, 21: 134217760, 22: 134348832, 23: 131072, 24: 0, 25: 131104, 26: 134348800, 27: 134219808, 28: 134350880, 29: 133120, 30: 2080, 31: 134217728, 2147483664: 131072, 2147483665: 2048, 2147483666: 134348832, 2147483667: 133152, 2147483668: 32, 2147483669: 134348800, 2147483670: 134217728, 2147483671: 134219808, 2147483672: 134350880, 2147483673: 134217760, 2147483674: 134219776, 2147483675: 0, 2147483676: 133120, 2147483677: 2080, 2147483678: 131104, 2147483679: 134350848 }],u = [4160749569, 528482304, 33030144, 2064384, 129024, 8064, 504, 2147483679],n = e.DES = r.extend({ _doReset: function _doReset() {for (var t = this._key.words, e = [], r = 0; r < 56; r++) {var i = h[r] - 1;e[r] = t[i >>> 5] >>> 31 - i % 32 & 1;}for (var n = this._subKeys = [], o = 0; o < 16; o++) {for (var s = n[o] = [], c = f[o], r = 0; r < 24; r++) {s[r / 6 | 0] |= e[(l[r] - 1 + c) % 28] << 31 - r % 6, s[4 + (r / 6 | 0)] |= e[28 + (l[r + 24] - 1 + c) % 28] << 31 - r % 6;}s[0] = s[0] << 1 | s[0] >>> 31;for (r = 1; r < 7; r++) {s[r] = s[r] >>> 4 * (r - 1) + 3;}s[7] = s[7] << 5 | s[7] >>> 27;}for (var a = this._invSubKeys = [], r = 0; r < 16; r++) {a[r] = n[15 - r];}}, encryptBlock: function encryptBlock(t, e) {this._doCryptBlock(t, e, this._subKeys);}, decryptBlock: function decryptBlock(t, e) {this._doCryptBlock(t, e, this._invSubKeys);}, _doCryptBlock: function _doCryptBlock(t, e, r) {this._lBlock = t[e], this._rBlock = t[e + 1], p.call(this, 4, 252645135), p.call(this, 16, 65535), _.call(this, 2, 858993459), _.call(this, 8, 16711935), p.call(this, 1, 1431655765);for (var i = 0; i < 16; i++) {for (var n = r[i], o = this._lBlock, s = this._rBlock, c = 0, a = 0; a < 8; a++) {c |= d[a][((s ^ n[a]) & u[a]) >>> 0];}this._lBlock = s, this._rBlock = o ^ c;}var h = this._lBlock;this._lBlock = this._rBlock, this._rBlock = h, p.call(this, 1, 1431655765), _.call(this, 8, 16711935), _.call(this, 2, 858993459), p.call(this, 16, 65535), p.call(this, 4, 252645135), t[e] = this._lBlock, t[e + 1] = this._rBlock;}, keySize: 2, ivSize: 2, blockSize: 2 });function p(t, e) {e = (this._lBlock >>> t ^ this._rBlock) & e;this._rBlock ^= e, this._lBlock ^= e << t;}function _(t, e) {e = (this._rBlock >>> t ^ this._lBlock) & e;this._lBlock ^= e, this._rBlock ^= e << t;}t.DES = r._createHelper(n);e = e.TripleDES = r.extend({ _doReset: function _doReset() {var t = this._key.words;if (2 !== t.length && 4 !== t.length && t.length < 6) throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var e = t.slice(0, 2),r = t.length < 4 ? t.slice(0, 2) : t.slice(2, 4),t = t.length < 6 ? t.slice(0, 2) : t.slice(4, 6);this._des1 = n.createEncryptor(i.create(e)), this._des2 = n.createEncryptor(i.create(r)), this._des3 = n.createEncryptor(i.create(t));}, encryptBlock: function encryptBlock(t, e) {this._des1.encryptBlock(t, e), this._des2.decryptBlock(t, e), this._des3.encryptBlock(t, e);}, decryptBlock: function decryptBlock(t, e) {this._des3.decryptBlock(t, e), this._des2.encryptBlock(t, e), this._des1.decryptBlock(t, e);}, keySize: 6, ivSize: 2, blockSize: 2 });t.TripleDES = r._createHelper(e);}(), function () {var t = U,e = t.lib.StreamCipher,r = t.algo,i = r.RC4 = e.extend({ _doReset: function _doReset() {for (var t = this._key, e = t.words, r = t.sigBytes, i = this._S = [], n = 0; n < 256; n++) {i[n] = n;}for (var n = 0, o = 0; n < 256; n++) {var s = n % r,s = e[s >>> 2] >>> 24 - s % 4 * 8 & 255,o = (o + i[n] + s) % 256,s = i[n];i[n] = i[o], i[o] = s;}this._i = this._j = 0;}, _doProcessBlock: function _doProcessBlock(t, e) {t[e] ^= n.call(this);}, keySize: 8, ivSize: 0 });function n() {for (var t = this._S, e = this._i, r = this._j, i = 0, n = 0; n < 4; n++) {var r = (r + t[e = (e + 1) % 256]) % 256,o = t[e];t[e] = t[r], t[r] = o, i |= t[(t[e] + t[r]) % 256] << 24 - 8 * n;}return this._i = e, this._j = r, i;}t.RC4 = e._createHelper(i);r = r.RC4Drop = i.extend({ cfg: i.cfg.extend({ drop: 192 }), _doReset: function _doReset() {i._doReset.call(this);for (var t = this.cfg.drop; 0 < t; t--) {n.call(this);}} });t.RC4Drop = e._createHelper(r);}(), F = (M = U).lib.StreamCipher, P = M.algo, D = [], E = [], R = [], P = P.Rabbit = F.extend({ _doReset: function _doReset() {for (var t = this._key.words, e = this.cfg.iv, r = 0; r < 4; r++) {t[r] = 16711935 & (t[r] << 8 | t[r] >>> 24) | 4278255360 & (t[r] << 24 | t[r] >>> 8);}for (var i = this._X = [t[0], t[3] << 16 | t[2] >>> 16, t[1], t[0] << 16 | t[3] >>> 16, t[2], t[1] << 16 | t[0] >>> 16, t[3], t[2] << 16 | t[1] >>> 16], n = this._C = [t[2] << 16 | t[2] >>> 16, 4294901760 & t[0] | 65535 & t[1], t[3] << 16 | t[3] >>> 16, 4294901760 & t[1] | 65535 & t[2], t[0] << 16 | t[0] >>> 16, 4294901760 & t[2] | 65535 & t[3], t[1] << 16 | t[1] >>> 16, 4294901760 & t[3] | 65535 & t[0]], r = this._b = 0; r < 4; r++) {N.call(this);}for (r = 0; r < 8; r++) {n[r] ^= i[r + 4 & 7];}if (e) {var o = e.words,s = o[0],c = o[1],e = 16711935 & (s << 8 | s >>> 24) | 4278255360 & (s << 24 | s >>> 8),o = 16711935 & (c << 8 | c >>> 24) | 4278255360 & (c << 24 | c >>> 8),s = e >>> 16 | 4294901760 & o,c = o << 16 | 65535 & e;n[0] ^= e, n[1] ^= s, n[2] ^= o, n[3] ^= c, n[4] ^= e, n[5] ^= s, n[6] ^= o, n[7] ^= c;for (r = 0; r < 4; r++) {N.call(this);}}}, _doProcessBlock: function _doProcessBlock(t, e) {var r = this._X;N.call(this), D[0] = r[0] ^ r[5] >>> 16 ^ r[3] << 16, D[1] = r[2] ^ r[7] >>> 16 ^ r[5] << 16, D[2] = r[4] ^ r[1] >>> 16 ^ r[7] << 16, D[3] = r[6] ^ r[3] >>> 16 ^ r[1] << 16;for (var i = 0; i < 4; i++) {D[i] = 16711935 & (D[i] << 8 | D[i] >>> 24) | 4278255360 & (D[i] << 24 | D[i] >>> 8), t[e + i] ^= D[i];}}, blockSize: 4, ivSize: 2 }), M.Rabbit = F._createHelper(P), F = (M = U).lib.StreamCipher, P = M.algo, W = [], O = [], I = [], P = P.RabbitLegacy = F.extend({ _doReset: function _doReset() {for (var t = this._key.words, e = this.cfg.iv, r = this._X = [t[0], t[3] << 16 | t[2] >>> 16, t[1], t[0] << 16 | t[3] >>> 16, t[2], t[1] << 16 | t[0] >>> 16, t[3], t[2] << 16 | t[1] >>> 16], i = this._C = [t[2] << 16 | t[2] >>> 16, 4294901760 & t[0] | 65535 & t[1], t[3] << 16 | t[3] >>> 16, 4294901760 & t[1] | 65535 & t[2], t[0] << 16 | t[0] >>> 16, 4294901760 & t[2] | 65535 & t[3], t[1] << 16 | t[1] >>> 16, 4294901760 & t[3] | 65535 & t[0]], n = this._b = 0; n < 4; n++) {q.call(this);}for (n = 0; n < 8; n++) {i[n] ^= r[n + 4 & 7];}if (e) {var o = e.words,s = o[0],t = o[1],e = 16711935 & (s << 8 | s >>> 24) | 4278255360 & (s << 24 | s >>> 8),o = 16711935 & (t << 8 | t >>> 24) | 4278255360 & (t << 24 | t >>> 8),s = e >>> 16 | 4294901760 & o,t = o << 16 | 65535 & e;i[0] ^= e, i[1] ^= s, i[2] ^= o, i[3] ^= t, i[4] ^= e, i[5] ^= s, i[6] ^= o, i[7] ^= t;for (n = 0; n < 4; n++) {q.call(this);}}}, _doProcessBlock: function _doProcessBlock(t, e) {var r = this._X;q.call(this), W[0] = r[0] ^ r[5] >>> 16 ^ r[3] << 16, W[1] = r[2] ^ r[7] >>> 16 ^ r[5] << 16, W[2] = r[4] ^ r[1] >>> 16 ^ r[7] << 16, W[3] = r[6] ^ r[3] >>> 16 ^ r[1] << 16;for (var i = 0; i < 4; i++) {W[i] = 16711935 & (W[i] << 8 | W[i] >>> 24) | 4278255360 & (W[i] << 24 | W[i] >>> 8), t[e + i] ^= W[i];}}, blockSize: 4, ivSize: 2 }), M.RabbitLegacy = F._createHelper(P), U;});
  12333. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../IDEA/HBuilderX/plugins/uniapp-cli/node_modules/webpack/buildin/global.js */ 2)))
  12334. /***/ }),
  12335. /* 44 */
  12336. /*!*************************************************!*\
  12337. !*** ./node_modules/crypto-browserify/index.js ***!
  12338. \*************************************************/
  12339. /*! no static exports found */
  12340. /***/ (function(module, exports, __webpack_require__) {
  12341. "use strict";
  12342. exports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = __webpack_require__(/*! randombytes */ 45)
  12343. exports.createHash = exports.Hash = __webpack_require__(/*! create-hash */ 53)
  12344. exports.createHmac = exports.Hmac = __webpack_require__(/*! create-hmac */ 88)
  12345. var algos = __webpack_require__(/*! browserify-sign/algos */ 91)
  12346. var algoKeys = Object.keys(algos)
  12347. var hashes = ['sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'md5', 'rmd160'].concat(algoKeys)
  12348. exports.getHashes = function () {
  12349. return hashes
  12350. }
  12351. var p = __webpack_require__(/*! pbkdf2 */ 93)
  12352. exports.pbkdf2 = p.pbkdf2
  12353. exports.pbkdf2Sync = p.pbkdf2Sync
  12354. var aes = __webpack_require__(/*! browserify-cipher */ 99)
  12355. exports.Cipher = aes.Cipher
  12356. exports.createCipher = aes.createCipher
  12357. exports.Cipheriv = aes.Cipheriv
  12358. exports.createCipheriv = aes.createCipheriv
  12359. exports.Decipher = aes.Decipher
  12360. exports.createDecipher = aes.createDecipher
  12361. exports.Decipheriv = aes.Decipheriv
  12362. exports.createDecipheriv = aes.createDecipheriv
  12363. exports.getCiphers = aes.getCiphers
  12364. exports.listCiphers = aes.listCiphers
  12365. var dh = __webpack_require__(/*! diffie-hellman */ 128)
  12366. exports.DiffieHellmanGroup = dh.DiffieHellmanGroup
  12367. exports.createDiffieHellmanGroup = dh.createDiffieHellmanGroup
  12368. exports.getDiffieHellman = dh.getDiffieHellman
  12369. exports.createDiffieHellman = dh.createDiffieHellman
  12370. exports.DiffieHellman = dh.DiffieHellman
  12371. var sign = __webpack_require__(/*! browserify-sign */ 138)
  12372. exports.createSign = sign.createSign
  12373. exports.Sign = sign.Sign
  12374. exports.createVerify = sign.createVerify
  12375. exports.Verify = sign.Verify
  12376. exports.createECDH = __webpack_require__(/*! create-ecdh */ 193)
  12377. var publicEncrypt = __webpack_require__(/*! public-encrypt */ 194)
  12378. exports.publicEncrypt = publicEncrypt.publicEncrypt
  12379. exports.privateEncrypt = publicEncrypt.privateEncrypt
  12380. exports.publicDecrypt = publicEncrypt.publicDecrypt
  12381. exports.privateDecrypt = publicEncrypt.privateDecrypt
  12382. // the least I can do is make error messages for the rest of the node.js/crypto api.
  12383. // ;[
  12384. // 'createCredentials'
  12385. // ].forEach(function (name) {
  12386. // exports[name] = function () {
  12387. // throw new Error([
  12388. // 'sorry, ' + name + ' is not implemented yet',
  12389. // 'we accept pull requests',
  12390. // 'https://github.com/crypto-browserify/crypto-browserify'
  12391. // ].join('\n'))
  12392. // }
  12393. // })
  12394. var rf = __webpack_require__(/*! randomfill */ 200)
  12395. exports.randomFill = rf.randomFill
  12396. exports.randomFillSync = rf.randomFillSync
  12397. exports.createCredentials = function () {
  12398. throw new Error([
  12399. 'sorry, createCredentials is not implemented yet',
  12400. 'we accept pull requests',
  12401. 'https://github.com/crypto-browserify/crypto-browserify'
  12402. ].join('\n'))
  12403. }
  12404. exports.constants = {
  12405. 'DH_CHECK_P_NOT_SAFE_PRIME': 2,
  12406. 'DH_CHECK_P_NOT_PRIME': 1,
  12407. 'DH_UNABLE_TO_CHECK_GENERATOR': 4,
  12408. 'DH_NOT_SUITABLE_GENERATOR': 8,
  12409. 'NPN_ENABLED': 1,
  12410. 'ALPN_ENABLED': 1,
  12411. 'RSA_PKCS1_PADDING': 1,
  12412. 'RSA_SSLV23_PADDING': 2,
  12413. 'RSA_NO_PADDING': 3,
  12414. 'RSA_PKCS1_OAEP_PADDING': 4,
  12415. 'RSA_X931_PADDING': 5,
  12416. 'RSA_PKCS1_PSS_PADDING': 6,
  12417. 'POINT_CONVERSION_COMPRESSED': 2,
  12418. 'POINT_CONVERSION_UNCOMPRESSED': 4,
  12419. 'POINT_CONVERSION_HYBRID': 6
  12420. }
  12421. /***/ }),
  12422. /* 45 */
  12423. /*!*********************************************!*\
  12424. !*** ./node_modules/randombytes/browser.js ***!
  12425. \*********************************************/
  12426. /*! no static exports found */
  12427. /***/ (function(module, exports, __webpack_require__) {
  12428. "use strict";
  12429. /* WEBPACK VAR INJECTION */(function(global, process) {
  12430. // limit of Crypto.getRandomValues()
  12431. // https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues
  12432. var MAX_BYTES = 65536
  12433. // Node supports requesting up to this number of bytes
  12434. // https://github.com/nodejs/node/blob/master/lib/internal/crypto/random.js#L48
  12435. var MAX_UINT32 = 4294967295
  12436. function oldBrowser () {
  12437. throw new Error('Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11')
  12438. }
  12439. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  12440. var crypto = global.crypto || global.msCrypto
  12441. if (crypto && crypto.getRandomValues) {
  12442. module.exports = randomBytes
  12443. } else {
  12444. module.exports = oldBrowser
  12445. }
  12446. function randomBytes (size, cb) {
  12447. // phantomjs needs to throw
  12448. if (size > MAX_UINT32) throw new RangeError('requested too many random bytes')
  12449. var bytes = Buffer.allocUnsafe(size)
  12450. if (size > 0) { // getRandomValues fails on IE if size == 0
  12451. if (size > MAX_BYTES) { // this is the max bytes crypto.getRandomValues
  12452. // can do at once see https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues
  12453. for (var generated = 0; generated < size; generated += MAX_BYTES) {
  12454. // buffer.slice automatically checks if the end is past the end of
  12455. // the buffer so we don't have to here
  12456. crypto.getRandomValues(bytes.slice(generated, generated + MAX_BYTES))
  12457. }
  12458. } else {
  12459. crypto.getRandomValues(bytes)
  12460. }
  12461. }
  12462. if (typeof cb === 'function') {
  12463. return process.nextTick(function () {
  12464. cb(null, bytes)
  12465. })
  12466. }
  12467. return bytes
  12468. }
  12469. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ 2), __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 46)))
  12470. /***/ }),
  12471. /* 46 */
  12472. /*!********************************************************!*\
  12473. !*** ./node_modules/node-libs-browser/mock/process.js ***!
  12474. \********************************************************/
  12475. /*! no static exports found */
  12476. /***/ (function(module, exports, __webpack_require__) {
  12477. exports.nextTick = function nextTick(fn) {
  12478. var args = Array.prototype.slice.call(arguments);
  12479. args.shift();
  12480. setTimeout(function () {
  12481. fn.apply(null, args);
  12482. }, 0);
  12483. };
  12484. exports.platform = exports.arch =
  12485. exports.execPath = exports.title = 'browser';
  12486. exports.pid = 1;
  12487. exports.browser = true;
  12488. exports.env = {};
  12489. exports.argv = [];
  12490. exports.binding = function (name) {
  12491. throw new Error('No such module. (Possibly not yet loaded)')
  12492. };
  12493. (function () {
  12494. var cwd = '/';
  12495. var path;
  12496. exports.cwd = function () { return cwd };
  12497. exports.chdir = function (dir) {
  12498. if (!path) path = __webpack_require__(/*! path */ 47);
  12499. cwd = path.resolve(dir, cwd);
  12500. };
  12501. })();
  12502. exports.exit = exports.kill =
  12503. exports.umask = exports.dlopen =
  12504. exports.uptime = exports.memoryUsage =
  12505. exports.uvCounters = function() {};
  12506. exports.features = {};
  12507. /***/ }),
  12508. /* 47 */
  12509. /*!***********************************************!*\
  12510. !*** ./node_modules/path-browserify/index.js ***!
  12511. \***********************************************/
  12512. /*! no static exports found */
  12513. /***/ (function(module, exports, __webpack_require__) {
  12514. /* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,
  12515. // backported and transplited with Babel, with backwards-compat fixes
  12516. // Copyright Joyent, Inc. and other Node contributors.
  12517. //
  12518. // Permission is hereby granted, free of charge, to any person obtaining a
  12519. // copy of this software and associated documentation files (the
  12520. // "Software"), to deal in the Software without restriction, including
  12521. // without limitation the rights to use, copy, modify, merge, publish,
  12522. // distribute, sublicense, and/or sell copies of the Software, and to permit
  12523. // persons to whom the Software is furnished to do so, subject to the
  12524. // following conditions:
  12525. //
  12526. // The above copyright notice and this permission notice shall be included
  12527. // in all copies or substantial portions of the Software.
  12528. //
  12529. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  12530. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  12531. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  12532. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  12533. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  12534. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  12535. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  12536. // resolves . and .. elements in a path array with directory names there
  12537. // must be no slashes, empty elements, or device names (c:\) in the array
  12538. // (so also no leading and trailing slashes - it does not distinguish
  12539. // relative and absolute paths)
  12540. function normalizeArray(parts, allowAboveRoot) {
  12541. // if the path tries to go above the root, `up` ends up > 0
  12542. var up = 0;
  12543. for (var i = parts.length - 1; i >= 0; i--) {
  12544. var last = parts[i];
  12545. if (last === '.') {
  12546. parts.splice(i, 1);
  12547. } else if (last === '..') {
  12548. parts.splice(i, 1);
  12549. up++;
  12550. } else if (up) {
  12551. parts.splice(i, 1);
  12552. up--;
  12553. }
  12554. }
  12555. // if the path is allowed to go above the root, restore leading ..s
  12556. if (allowAboveRoot) {
  12557. for (; up--; up) {
  12558. parts.unshift('..');
  12559. }
  12560. }
  12561. return parts;
  12562. }
  12563. // path.resolve([from ...], to)
  12564. // posix version
  12565. exports.resolve = function() {
  12566. var resolvedPath = '',
  12567. resolvedAbsolute = false;
  12568. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  12569. var path = (i >= 0) ? arguments[i] : process.cwd();
  12570. // Skip empty and invalid entries
  12571. if (typeof path !== 'string') {
  12572. throw new TypeError('Arguments to path.resolve must be strings');
  12573. } else if (!path) {
  12574. continue;
  12575. }
  12576. resolvedPath = path + '/' + resolvedPath;
  12577. resolvedAbsolute = path.charAt(0) === '/';
  12578. }
  12579. // At this point the path should be resolved to a full absolute path, but
  12580. // handle relative paths to be safe (might happen when process.cwd() fails)
  12581. // Normalize the path
  12582. resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
  12583. return !!p;
  12584. }), !resolvedAbsolute).join('/');
  12585. return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
  12586. };
  12587. // path.normalize(path)
  12588. // posix version
  12589. exports.normalize = function(path) {
  12590. var isAbsolute = exports.isAbsolute(path),
  12591. trailingSlash = substr(path, -1) === '/';
  12592. // Normalize the path
  12593. path = normalizeArray(filter(path.split('/'), function(p) {
  12594. return !!p;
  12595. }), !isAbsolute).join('/');
  12596. if (!path && !isAbsolute) {
  12597. path = '.';
  12598. }
  12599. if (path && trailingSlash) {
  12600. path += '/';
  12601. }
  12602. return (isAbsolute ? '/' : '') + path;
  12603. };
  12604. // posix version
  12605. exports.isAbsolute = function(path) {
  12606. return path.charAt(0) === '/';
  12607. };
  12608. // posix version
  12609. exports.join = function() {
  12610. var paths = Array.prototype.slice.call(arguments, 0);
  12611. return exports.normalize(filter(paths, function(p, index) {
  12612. if (typeof p !== 'string') {
  12613. throw new TypeError('Arguments to path.join must be strings');
  12614. }
  12615. return p;
  12616. }).join('/'));
  12617. };
  12618. // path.relative(from, to)
  12619. // posix version
  12620. exports.relative = function(from, to) {
  12621. from = exports.resolve(from).substr(1);
  12622. to = exports.resolve(to).substr(1);
  12623. function trim(arr) {
  12624. var start = 0;
  12625. for (; start < arr.length; start++) {
  12626. if (arr[start] !== '') break;
  12627. }
  12628. var end = arr.length - 1;
  12629. for (; end >= 0; end--) {
  12630. if (arr[end] !== '') break;
  12631. }
  12632. if (start > end) return [];
  12633. return arr.slice(start, end - start + 1);
  12634. }
  12635. var fromParts = trim(from.split('/'));
  12636. var toParts = trim(to.split('/'));
  12637. var length = Math.min(fromParts.length, toParts.length);
  12638. var samePartsLength = length;
  12639. for (var i = 0; i < length; i++) {
  12640. if (fromParts[i] !== toParts[i]) {
  12641. samePartsLength = i;
  12642. break;
  12643. }
  12644. }
  12645. var outputParts = [];
  12646. for (var i = samePartsLength; i < fromParts.length; i++) {
  12647. outputParts.push('..');
  12648. }
  12649. outputParts = outputParts.concat(toParts.slice(samePartsLength));
  12650. return outputParts.join('/');
  12651. };
  12652. exports.sep = '/';
  12653. exports.delimiter = ':';
  12654. exports.dirname = function (path) {
  12655. if (typeof path !== 'string') path = path + '';
  12656. if (path.length === 0) return '.';
  12657. var code = path.charCodeAt(0);
  12658. var hasRoot = code === 47 /*/*/;
  12659. var end = -1;
  12660. var matchedSlash = true;
  12661. for (var i = path.length - 1; i >= 1; --i) {
  12662. code = path.charCodeAt(i);
  12663. if (code === 47 /*/*/) {
  12664. if (!matchedSlash) {
  12665. end = i;
  12666. break;
  12667. }
  12668. } else {
  12669. // We saw the first non-path separator
  12670. matchedSlash = false;
  12671. }
  12672. }
  12673. if (end === -1) return hasRoot ? '/' : '.';
  12674. if (hasRoot && end === 1) {
  12675. // return '//';
  12676. // Backwards-compat fix:
  12677. return '/';
  12678. }
  12679. return path.slice(0, end);
  12680. };
  12681. function basename(path) {
  12682. if (typeof path !== 'string') path = path + '';
  12683. var start = 0;
  12684. var end = -1;
  12685. var matchedSlash = true;
  12686. var i;
  12687. for (i = path.length - 1; i >= 0; --i) {
  12688. if (path.charCodeAt(i) === 47 /*/*/) {
  12689. // If we reached a path separator that was not part of a set of path
  12690. // separators at the end of the string, stop now
  12691. if (!matchedSlash) {
  12692. start = i + 1;
  12693. break;
  12694. }
  12695. } else if (end === -1) {
  12696. // We saw the first non-path separator, mark this as the end of our
  12697. // path component
  12698. matchedSlash = false;
  12699. end = i + 1;
  12700. }
  12701. }
  12702. if (end === -1) return '';
  12703. return path.slice(start, end);
  12704. }
  12705. // Uses a mixed approach for backwards-compatibility, as ext behavior changed
  12706. // in new Node.js versions, so only basename() above is backported here
  12707. exports.basename = function (path, ext) {
  12708. var f = basename(path);
  12709. if (ext && f.substr(-1 * ext.length) === ext) {
  12710. f = f.substr(0, f.length - ext.length);
  12711. }
  12712. return f;
  12713. };
  12714. exports.extname = function (path) {
  12715. if (typeof path !== 'string') path = path + '';
  12716. var startDot = -1;
  12717. var startPart = 0;
  12718. var end = -1;
  12719. var matchedSlash = true;
  12720. // Track the state of characters (if any) we see before our first dot and
  12721. // after any path separator we find
  12722. var preDotState = 0;
  12723. for (var i = path.length - 1; i >= 0; --i) {
  12724. var code = path.charCodeAt(i);
  12725. if (code === 47 /*/*/) {
  12726. // If we reached a path separator that was not part of a set of path
  12727. // separators at the end of the string, stop now
  12728. if (!matchedSlash) {
  12729. startPart = i + 1;
  12730. break;
  12731. }
  12732. continue;
  12733. }
  12734. if (end === -1) {
  12735. // We saw the first non-path separator, mark this as the end of our
  12736. // extension
  12737. matchedSlash = false;
  12738. end = i + 1;
  12739. }
  12740. if (code === 46 /*.*/) {
  12741. // If this is our first dot, mark it as the start of our extension
  12742. if (startDot === -1)
  12743. startDot = i;
  12744. else if (preDotState !== 1)
  12745. preDotState = 1;
  12746. } else if (startDot !== -1) {
  12747. // We saw a non-dot and non-path separator before our dot, so we should
  12748. // have a good chance at having a non-empty extension
  12749. preDotState = -1;
  12750. }
  12751. }
  12752. if (startDot === -1 || end === -1 ||
  12753. // We saw a non-dot character immediately before the dot
  12754. preDotState === 0 ||
  12755. // The (right-most) trimmed path component is exactly '..'
  12756. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  12757. return '';
  12758. }
  12759. return path.slice(startDot, end);
  12760. };
  12761. function filter (xs, f) {
  12762. if (xs.filter) return xs.filter(f);
  12763. var res = [];
  12764. for (var i = 0; i < xs.length; i++) {
  12765. if (f(xs[i], i, xs)) res.push(xs[i]);
  12766. }
  12767. return res;
  12768. }
  12769. // String.prototype.substr - negative index don't work in IE8
  12770. var substr = 'ab'.substr(-1) === 'b'
  12771. ? function (str, start, len) { return str.substr(start, len) }
  12772. : function (str, start, len) {
  12773. if (start < 0) start = str.length + start;
  12774. return str.substr(start, len);
  12775. }
  12776. ;
  12777. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 46)))
  12778. /***/ }),
  12779. /* 48 */
  12780. /*!*******************************************!*\
  12781. !*** ./node_modules/safe-buffer/index.js ***!
  12782. \*******************************************/
  12783. /*! no static exports found */
  12784. /***/ (function(module, exports, __webpack_require__) {
  12785. /* eslint-disable node/no-deprecated-api */
  12786. var buffer = __webpack_require__(/*! buffer */ 49)
  12787. var Buffer = buffer.Buffer
  12788. // alternative to using Object.keys for old browsers
  12789. function copyProps (src, dst) {
  12790. for (var key in src) {
  12791. dst[key] = src[key]
  12792. }
  12793. }
  12794. if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
  12795. module.exports = buffer
  12796. } else {
  12797. // Copy properties from require('buffer')
  12798. copyProps(buffer, exports)
  12799. exports.Buffer = SafeBuffer
  12800. }
  12801. function SafeBuffer (arg, encodingOrOffset, length) {
  12802. return Buffer(arg, encodingOrOffset, length)
  12803. }
  12804. // Copy static methods from Buffer
  12805. copyProps(Buffer, SafeBuffer)
  12806. SafeBuffer.from = function (arg, encodingOrOffset, length) {
  12807. if (typeof arg === 'number') {
  12808. throw new TypeError('Argument must not be a number')
  12809. }
  12810. return Buffer(arg, encodingOrOffset, length)
  12811. }
  12812. SafeBuffer.alloc = function (size, fill, encoding) {
  12813. if (typeof size !== 'number') {
  12814. throw new TypeError('Argument must be a number')
  12815. }
  12816. var buf = Buffer(size)
  12817. if (fill !== undefined) {
  12818. if (typeof encoding === 'string') {
  12819. buf.fill(fill, encoding)
  12820. } else {
  12821. buf.fill(fill)
  12822. }
  12823. } else {
  12824. buf.fill(0)
  12825. }
  12826. return buf
  12827. }
  12828. SafeBuffer.allocUnsafe = function (size) {
  12829. if (typeof size !== 'number') {
  12830. throw new TypeError('Argument must be a number')
  12831. }
  12832. return Buffer(size)
  12833. }
  12834. SafeBuffer.allocUnsafeSlow = function (size) {
  12835. if (typeof size !== 'number') {
  12836. throw new TypeError('Argument must be a number')
  12837. }
  12838. return buffer.SlowBuffer(size)
  12839. }
  12840. /***/ }),
  12841. /* 49 */
  12842. /*!**************************************!*\
  12843. !*** ./node_modules/buffer/index.js ***!
  12844. \**************************************/
  12845. /*! no static exports found */
  12846. /***/ (function(module, exports, __webpack_require__) {
  12847. "use strict";
  12848. /* WEBPACK VAR INJECTION */(function(global) {/*!
  12849. * The buffer module from node.js, for the browser.
  12850. *
  12851. * @author Feross Aboukhadijeh <http://feross.org>
  12852. * @license MIT
  12853. */
  12854. /* eslint-disable no-proto */
  12855. var base64 = __webpack_require__(/*! base64-js */ 50)
  12856. var ieee754 = __webpack_require__(/*! ieee754 */ 51)
  12857. var isArray = __webpack_require__(/*! isarray */ 52)
  12858. exports.Buffer = Buffer
  12859. exports.SlowBuffer = SlowBuffer
  12860. exports.INSPECT_MAX_BYTES = 50
  12861. /**
  12862. * If `Buffer.TYPED_ARRAY_SUPPORT`:
  12863. * === true Use Uint8Array implementation (fastest)
  12864. * === false Use Object implementation (most compatible, even IE6)
  12865. *
  12866. * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
  12867. * Opera 11.6+, iOS 4.2+.
  12868. *
  12869. * Due to various browser bugs, sometimes the Object implementation will be used even
  12870. * when the browser supports typed arrays.
  12871. *
  12872. * Note:
  12873. *
  12874. * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
  12875. * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
  12876. *
  12877. * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
  12878. *
  12879. * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
  12880. * incorrect length in some situations.
  12881. * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
  12882. * get the Object implementation, which is slower but behaves correctly.
  12883. */
  12884. Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
  12885. ? global.TYPED_ARRAY_SUPPORT
  12886. : typedArraySupport()
  12887. /*
  12888. * Export kMaxLength after typed array support is determined.
  12889. */
  12890. exports.kMaxLength = kMaxLength()
  12891. function typedArraySupport () {
  12892. try {
  12893. var arr = new Uint8Array(1)
  12894. arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
  12895. return arr.foo() === 42 && // typed array instances can be augmented
  12896. typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
  12897. arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
  12898. } catch (e) {
  12899. return false
  12900. }
  12901. }
  12902. function kMaxLength () {
  12903. return Buffer.TYPED_ARRAY_SUPPORT
  12904. ? 0x7fffffff
  12905. : 0x3fffffff
  12906. }
  12907. function createBuffer (that, length) {
  12908. if (kMaxLength() < length) {
  12909. throw new RangeError('Invalid typed array length')
  12910. }
  12911. if (Buffer.TYPED_ARRAY_SUPPORT) {
  12912. // Return an augmented `Uint8Array` instance, for best performance
  12913. that = new Uint8Array(length)
  12914. that.__proto__ = Buffer.prototype
  12915. } else {
  12916. // Fallback: Return an object instance of the Buffer class
  12917. if (that === null) {
  12918. that = new Buffer(length)
  12919. }
  12920. that.length = length
  12921. }
  12922. return that
  12923. }
  12924. /**
  12925. * The Buffer constructor returns instances of `Uint8Array` that have their
  12926. * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
  12927. * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
  12928. * and the `Uint8Array` methods. Square bracket notation works as expected -- it
  12929. * returns a single octet.
  12930. *
  12931. * The `Uint8Array` prototype remains unmodified.
  12932. */
  12933. function Buffer (arg, encodingOrOffset, length) {
  12934. if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
  12935. return new Buffer(arg, encodingOrOffset, length)
  12936. }
  12937. // Common case.
  12938. if (typeof arg === 'number') {
  12939. if (typeof encodingOrOffset === 'string') {
  12940. throw new Error(
  12941. 'If encoding is specified then the first argument must be a string'
  12942. )
  12943. }
  12944. return allocUnsafe(this, arg)
  12945. }
  12946. return from(this, arg, encodingOrOffset, length)
  12947. }
  12948. Buffer.poolSize = 8192 // not used by this implementation
  12949. // TODO: Legacy, not needed anymore. Remove in next major version.
  12950. Buffer._augment = function (arr) {
  12951. arr.__proto__ = Buffer.prototype
  12952. return arr
  12953. }
  12954. function from (that, value, encodingOrOffset, length) {
  12955. if (typeof value === 'number') {
  12956. throw new TypeError('"value" argument must not be a number')
  12957. }
  12958. if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
  12959. return fromArrayBuffer(that, value, encodingOrOffset, length)
  12960. }
  12961. if (typeof value === 'string') {
  12962. return fromString(that, value, encodingOrOffset)
  12963. }
  12964. return fromObject(that, value)
  12965. }
  12966. /**
  12967. * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
  12968. * if value is a number.
  12969. * Buffer.from(str[, encoding])
  12970. * Buffer.from(array)
  12971. * Buffer.from(buffer)
  12972. * Buffer.from(arrayBuffer[, byteOffset[, length]])
  12973. **/
  12974. Buffer.from = function (value, encodingOrOffset, length) {
  12975. return from(null, value, encodingOrOffset, length)
  12976. }
  12977. if (Buffer.TYPED_ARRAY_SUPPORT) {
  12978. Buffer.prototype.__proto__ = Uint8Array.prototype
  12979. Buffer.__proto__ = Uint8Array
  12980. if (typeof Symbol !== 'undefined' && Symbol.species &&
  12981. Buffer[Symbol.species] === Buffer) {
  12982. // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
  12983. Object.defineProperty(Buffer, Symbol.species, {
  12984. value: null,
  12985. configurable: true
  12986. })
  12987. }
  12988. }
  12989. function assertSize (size) {
  12990. if (typeof size !== 'number') {
  12991. throw new TypeError('"size" argument must be a number')
  12992. } else if (size < 0) {
  12993. throw new RangeError('"size" argument must not be negative')
  12994. }
  12995. }
  12996. function alloc (that, size, fill, encoding) {
  12997. assertSize(size)
  12998. if (size <= 0) {
  12999. return createBuffer(that, size)
  13000. }
  13001. if (fill !== undefined) {
  13002. // Only pay attention to encoding if it's a string. This
  13003. // prevents accidentally sending in a number that would
  13004. // be interpretted as a start offset.
  13005. return typeof encoding === 'string'
  13006. ? createBuffer(that, size).fill(fill, encoding)
  13007. : createBuffer(that, size).fill(fill)
  13008. }
  13009. return createBuffer(that, size)
  13010. }
  13011. /**
  13012. * Creates a new filled Buffer instance.
  13013. * alloc(size[, fill[, encoding]])
  13014. **/
  13015. Buffer.alloc = function (size, fill, encoding) {
  13016. return alloc(null, size, fill, encoding)
  13017. }
  13018. function allocUnsafe (that, size) {
  13019. assertSize(size)
  13020. that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
  13021. if (!Buffer.TYPED_ARRAY_SUPPORT) {
  13022. for (var i = 0; i < size; ++i) {
  13023. that[i] = 0
  13024. }
  13025. }
  13026. return that
  13027. }
  13028. /**
  13029. * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
  13030. * */
  13031. Buffer.allocUnsafe = function (size) {
  13032. return allocUnsafe(null, size)
  13033. }
  13034. /**
  13035. * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
  13036. */
  13037. Buffer.allocUnsafeSlow = function (size) {
  13038. return allocUnsafe(null, size)
  13039. }
  13040. function fromString (that, string, encoding) {
  13041. if (typeof encoding !== 'string' || encoding === '') {
  13042. encoding = 'utf8'
  13043. }
  13044. if (!Buffer.isEncoding(encoding)) {
  13045. throw new TypeError('"encoding" must be a valid string encoding')
  13046. }
  13047. var length = byteLength(string, encoding) | 0
  13048. that = createBuffer(that, length)
  13049. var actual = that.write(string, encoding)
  13050. if (actual !== length) {
  13051. // Writing a hex string, for example, that contains invalid characters will
  13052. // cause everything after the first invalid character to be ignored. (e.g.
  13053. // 'abxxcd' will be treated as 'ab')
  13054. that = that.slice(0, actual)
  13055. }
  13056. return that
  13057. }
  13058. function fromArrayLike (that, array) {
  13059. var length = array.length < 0 ? 0 : checked(array.length) | 0
  13060. that = createBuffer(that, length)
  13061. for (var i = 0; i < length; i += 1) {
  13062. that[i] = array[i] & 255
  13063. }
  13064. return that
  13065. }
  13066. function fromArrayBuffer (that, array, byteOffset, length) {
  13067. array.byteLength // this throws if `array` is not a valid ArrayBuffer
  13068. if (byteOffset < 0 || array.byteLength < byteOffset) {
  13069. throw new RangeError('\'offset\' is out of bounds')
  13070. }
  13071. if (array.byteLength < byteOffset + (length || 0)) {
  13072. throw new RangeError('\'length\' is out of bounds')
  13073. }
  13074. if (byteOffset === undefined && length === undefined) {
  13075. array = new Uint8Array(array)
  13076. } else if (length === undefined) {
  13077. array = new Uint8Array(array, byteOffset)
  13078. } else {
  13079. array = new Uint8Array(array, byteOffset, length)
  13080. }
  13081. if (Buffer.TYPED_ARRAY_SUPPORT) {
  13082. // Return an augmented `Uint8Array` instance, for best performance
  13083. that = array
  13084. that.__proto__ = Buffer.prototype
  13085. } else {
  13086. // Fallback: Return an object instance of the Buffer class
  13087. that = fromArrayLike(that, array)
  13088. }
  13089. return that
  13090. }
  13091. function fromObject (that, obj) {
  13092. if (Buffer.isBuffer(obj)) {
  13093. var len = checked(obj.length) | 0
  13094. that = createBuffer(that, len)
  13095. if (that.length === 0) {
  13096. return that
  13097. }
  13098. obj.copy(that, 0, 0, len)
  13099. return that
  13100. }
  13101. if (obj) {
  13102. if ((typeof ArrayBuffer !== 'undefined' &&
  13103. obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
  13104. if (typeof obj.length !== 'number' || isnan(obj.length)) {
  13105. return createBuffer(that, 0)
  13106. }
  13107. return fromArrayLike(that, obj)
  13108. }
  13109. if (obj.type === 'Buffer' && isArray(obj.data)) {
  13110. return fromArrayLike(that, obj.data)
  13111. }
  13112. }
  13113. throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
  13114. }
  13115. function checked (length) {
  13116. // Note: cannot use `length < kMaxLength()` here because that fails when
  13117. // length is NaN (which is otherwise coerced to zero.)
  13118. if (length >= kMaxLength()) {
  13119. throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
  13120. 'size: 0x' + kMaxLength().toString(16) + ' bytes')
  13121. }
  13122. return length | 0
  13123. }
  13124. function SlowBuffer (length) {
  13125. if (+length != length) { // eslint-disable-line eqeqeq
  13126. length = 0
  13127. }
  13128. return Buffer.alloc(+length)
  13129. }
  13130. Buffer.isBuffer = function isBuffer (b) {
  13131. return !!(b != null && b._isBuffer)
  13132. }
  13133. Buffer.compare = function compare (a, b) {
  13134. if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
  13135. throw new TypeError('Arguments must be Buffers')
  13136. }
  13137. if (a === b) return 0
  13138. var x = a.length
  13139. var y = b.length
  13140. for (var i = 0, len = Math.min(x, y); i < len; ++i) {
  13141. if (a[i] !== b[i]) {
  13142. x = a[i]
  13143. y = b[i]
  13144. break
  13145. }
  13146. }
  13147. if (x < y) return -1
  13148. if (y < x) return 1
  13149. return 0
  13150. }
  13151. Buffer.isEncoding = function isEncoding (encoding) {
  13152. switch (String(encoding).toLowerCase()) {
  13153. case 'hex':
  13154. case 'utf8':
  13155. case 'utf-8':
  13156. case 'ascii':
  13157. case 'latin1':
  13158. case 'binary':
  13159. case 'base64':
  13160. case 'ucs2':
  13161. case 'ucs-2':
  13162. case 'utf16le':
  13163. case 'utf-16le':
  13164. return true
  13165. default:
  13166. return false
  13167. }
  13168. }
  13169. Buffer.concat = function concat (list, length) {
  13170. if (!isArray(list)) {
  13171. throw new TypeError('"list" argument must be an Array of Buffers')
  13172. }
  13173. if (list.length === 0) {
  13174. return Buffer.alloc(0)
  13175. }
  13176. var i
  13177. if (length === undefined) {
  13178. length = 0
  13179. for (i = 0; i < list.length; ++i) {
  13180. length += list[i].length
  13181. }
  13182. }
  13183. var buffer = Buffer.allocUnsafe(length)
  13184. var pos = 0
  13185. for (i = 0; i < list.length; ++i) {
  13186. var buf = list[i]
  13187. if (!Buffer.isBuffer(buf)) {
  13188. throw new TypeError('"list" argument must be an Array of Buffers')
  13189. }
  13190. buf.copy(buffer, pos)
  13191. pos += buf.length
  13192. }
  13193. return buffer
  13194. }
  13195. function byteLength (string, encoding) {
  13196. if (Buffer.isBuffer(string)) {
  13197. return string.length
  13198. }
  13199. if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
  13200. (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
  13201. return string.byteLength
  13202. }
  13203. if (typeof string !== 'string') {
  13204. string = '' + string
  13205. }
  13206. var len = string.length
  13207. if (len === 0) return 0
  13208. // Use a for loop to avoid recursion
  13209. var loweredCase = false
  13210. for (;;) {
  13211. switch (encoding) {
  13212. case 'ascii':
  13213. case 'latin1':
  13214. case 'binary':
  13215. return len
  13216. case 'utf8':
  13217. case 'utf-8':
  13218. case undefined:
  13219. return utf8ToBytes(string).length
  13220. case 'ucs2':
  13221. case 'ucs-2':
  13222. case 'utf16le':
  13223. case 'utf-16le':
  13224. return len * 2
  13225. case 'hex':
  13226. return len >>> 1
  13227. case 'base64':
  13228. return base64ToBytes(string).length
  13229. default:
  13230. if (loweredCase) return utf8ToBytes(string).length // assume utf8
  13231. encoding = ('' + encoding).toLowerCase()
  13232. loweredCase = true
  13233. }
  13234. }
  13235. }
  13236. Buffer.byteLength = byteLength
  13237. function slowToString (encoding, start, end) {
  13238. var loweredCase = false
  13239. // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
  13240. // property of a typed array.
  13241. // This behaves neither like String nor Uint8Array in that we set start/end
  13242. // to their upper/lower bounds if the value passed is out of range.
  13243. // undefined is handled specially as per ECMA-262 6th Edition,
  13244. // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
  13245. if (start === undefined || start < 0) {
  13246. start = 0
  13247. }
  13248. // Return early if start > this.length. Done here to prevent potential uint32
  13249. // coercion fail below.
  13250. if (start > this.length) {
  13251. return ''
  13252. }
  13253. if (end === undefined || end > this.length) {
  13254. end = this.length
  13255. }
  13256. if (end <= 0) {
  13257. return ''
  13258. }
  13259. // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
  13260. end >>>= 0
  13261. start >>>= 0
  13262. if (end <= start) {
  13263. return ''
  13264. }
  13265. if (!encoding) encoding = 'utf8'
  13266. while (true) {
  13267. switch (encoding) {
  13268. case 'hex':
  13269. return hexSlice(this, start, end)
  13270. case 'utf8':
  13271. case 'utf-8':
  13272. return utf8Slice(this, start, end)
  13273. case 'ascii':
  13274. return asciiSlice(this, start, end)
  13275. case 'latin1':
  13276. case 'binary':
  13277. return latin1Slice(this, start, end)
  13278. case 'base64':
  13279. return base64Slice(this, start, end)
  13280. case 'ucs2':
  13281. case 'ucs-2':
  13282. case 'utf16le':
  13283. case 'utf-16le':
  13284. return utf16leSlice(this, start, end)
  13285. default:
  13286. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  13287. encoding = (encoding + '').toLowerCase()
  13288. loweredCase = true
  13289. }
  13290. }
  13291. }
  13292. // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
  13293. // Buffer instances.
  13294. Buffer.prototype._isBuffer = true
  13295. function swap (b, n, m) {
  13296. var i = b[n]
  13297. b[n] = b[m]
  13298. b[m] = i
  13299. }
  13300. Buffer.prototype.swap16 = function swap16 () {
  13301. var len = this.length
  13302. if (len % 2 !== 0) {
  13303. throw new RangeError('Buffer size must be a multiple of 16-bits')
  13304. }
  13305. for (var i = 0; i < len; i += 2) {
  13306. swap(this, i, i + 1)
  13307. }
  13308. return this
  13309. }
  13310. Buffer.prototype.swap32 = function swap32 () {
  13311. var len = this.length
  13312. if (len % 4 !== 0) {
  13313. throw new RangeError('Buffer size must be a multiple of 32-bits')
  13314. }
  13315. for (var i = 0; i < len; i += 4) {
  13316. swap(this, i, i + 3)
  13317. swap(this, i + 1, i + 2)
  13318. }
  13319. return this
  13320. }
  13321. Buffer.prototype.swap64 = function swap64 () {
  13322. var len = this.length
  13323. if (len % 8 !== 0) {
  13324. throw new RangeError('Buffer size must be a multiple of 64-bits')
  13325. }
  13326. for (var i = 0; i < len; i += 8) {
  13327. swap(this, i, i + 7)
  13328. swap(this, i + 1, i + 6)
  13329. swap(this, i + 2, i + 5)
  13330. swap(this, i + 3, i + 4)
  13331. }
  13332. return this
  13333. }
  13334. Buffer.prototype.toString = function toString () {
  13335. var length = this.length | 0
  13336. if (length === 0) return ''
  13337. if (arguments.length === 0) return utf8Slice(this, 0, length)
  13338. return slowToString.apply(this, arguments)
  13339. }
  13340. Buffer.prototype.equals = function equals (b) {
  13341. if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
  13342. if (this === b) return true
  13343. return Buffer.compare(this, b) === 0
  13344. }
  13345. Buffer.prototype.inspect = function inspect () {
  13346. var str = ''
  13347. var max = exports.INSPECT_MAX_BYTES
  13348. if (this.length > 0) {
  13349. str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
  13350. if (this.length > max) str += ' ... '
  13351. }
  13352. return '<Buffer ' + str + '>'
  13353. }
  13354. Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
  13355. if (!Buffer.isBuffer(target)) {
  13356. throw new TypeError('Argument must be a Buffer')
  13357. }
  13358. if (start === undefined) {
  13359. start = 0
  13360. }
  13361. if (end === undefined) {
  13362. end = target ? target.length : 0
  13363. }
  13364. if (thisStart === undefined) {
  13365. thisStart = 0
  13366. }
  13367. if (thisEnd === undefined) {
  13368. thisEnd = this.length
  13369. }
  13370. if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
  13371. throw new RangeError('out of range index')
  13372. }
  13373. if (thisStart >= thisEnd && start >= end) {
  13374. return 0
  13375. }
  13376. if (thisStart >= thisEnd) {
  13377. return -1
  13378. }
  13379. if (start >= end) {
  13380. return 1
  13381. }
  13382. start >>>= 0
  13383. end >>>= 0
  13384. thisStart >>>= 0
  13385. thisEnd >>>= 0
  13386. if (this === target) return 0
  13387. var x = thisEnd - thisStart
  13388. var y = end - start
  13389. var len = Math.min(x, y)
  13390. var thisCopy = this.slice(thisStart, thisEnd)
  13391. var targetCopy = target.slice(start, end)
  13392. for (var i = 0; i < len; ++i) {
  13393. if (thisCopy[i] !== targetCopy[i]) {
  13394. x = thisCopy[i]
  13395. y = targetCopy[i]
  13396. break
  13397. }
  13398. }
  13399. if (x < y) return -1
  13400. if (y < x) return 1
  13401. return 0
  13402. }
  13403. // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
  13404. // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
  13405. //
  13406. // Arguments:
  13407. // - buffer - a Buffer to search
  13408. // - val - a string, Buffer, or number
  13409. // - byteOffset - an index into `buffer`; will be clamped to an int32
  13410. // - encoding - an optional encoding, relevant is val is a string
  13411. // - dir - true for indexOf, false for lastIndexOf
  13412. function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
  13413. // Empty buffer means no match
  13414. if (buffer.length === 0) return -1
  13415. // Normalize byteOffset
  13416. if (typeof byteOffset === 'string') {
  13417. encoding = byteOffset
  13418. byteOffset = 0
  13419. } else if (byteOffset > 0x7fffffff) {
  13420. byteOffset = 0x7fffffff
  13421. } else if (byteOffset < -0x80000000) {
  13422. byteOffset = -0x80000000
  13423. }
  13424. byteOffset = +byteOffset // Coerce to Number.
  13425. if (isNaN(byteOffset)) {
  13426. // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
  13427. byteOffset = dir ? 0 : (buffer.length - 1)
  13428. }
  13429. // Normalize byteOffset: negative offsets start from the end of the buffer
  13430. if (byteOffset < 0) byteOffset = buffer.length + byteOffset
  13431. if (byteOffset >= buffer.length) {
  13432. if (dir) return -1
  13433. else byteOffset = buffer.length - 1
  13434. } else if (byteOffset < 0) {
  13435. if (dir) byteOffset = 0
  13436. else return -1
  13437. }
  13438. // Normalize val
  13439. if (typeof val === 'string') {
  13440. val = Buffer.from(val, encoding)
  13441. }
  13442. // Finally, search either indexOf (if dir is true) or lastIndexOf
  13443. if (Buffer.isBuffer(val)) {
  13444. // Special case: looking for empty string/buffer always fails
  13445. if (val.length === 0) {
  13446. return -1
  13447. }
  13448. return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
  13449. } else if (typeof val === 'number') {
  13450. val = val & 0xFF // Search for a byte value [0-255]
  13451. if (Buffer.TYPED_ARRAY_SUPPORT &&
  13452. typeof Uint8Array.prototype.indexOf === 'function') {
  13453. if (dir) {
  13454. return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
  13455. } else {
  13456. return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
  13457. }
  13458. }
  13459. return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
  13460. }
  13461. throw new TypeError('val must be string, number or Buffer')
  13462. }
  13463. function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
  13464. var indexSize = 1
  13465. var arrLength = arr.length
  13466. var valLength = val.length
  13467. if (encoding !== undefined) {
  13468. encoding = String(encoding).toLowerCase()
  13469. if (encoding === 'ucs2' || encoding === 'ucs-2' ||
  13470. encoding === 'utf16le' || encoding === 'utf-16le') {
  13471. if (arr.length < 2 || val.length < 2) {
  13472. return -1
  13473. }
  13474. indexSize = 2
  13475. arrLength /= 2
  13476. valLength /= 2
  13477. byteOffset /= 2
  13478. }
  13479. }
  13480. function read (buf, i) {
  13481. if (indexSize === 1) {
  13482. return buf[i]
  13483. } else {
  13484. return buf.readUInt16BE(i * indexSize)
  13485. }
  13486. }
  13487. var i
  13488. if (dir) {
  13489. var foundIndex = -1
  13490. for (i = byteOffset; i < arrLength; i++) {
  13491. if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
  13492. if (foundIndex === -1) foundIndex = i
  13493. if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
  13494. } else {
  13495. if (foundIndex !== -1) i -= i - foundIndex
  13496. foundIndex = -1
  13497. }
  13498. }
  13499. } else {
  13500. if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
  13501. for (i = byteOffset; i >= 0; i--) {
  13502. var found = true
  13503. for (var j = 0; j < valLength; j++) {
  13504. if (read(arr, i + j) !== read(val, j)) {
  13505. found = false
  13506. break
  13507. }
  13508. }
  13509. if (found) return i
  13510. }
  13511. }
  13512. return -1
  13513. }
  13514. Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
  13515. return this.indexOf(val, byteOffset, encoding) !== -1
  13516. }
  13517. Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
  13518. return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
  13519. }
  13520. Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
  13521. return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
  13522. }
  13523. function hexWrite (buf, string, offset, length) {
  13524. offset = Number(offset) || 0
  13525. var remaining = buf.length - offset
  13526. if (!length) {
  13527. length = remaining
  13528. } else {
  13529. length = Number(length)
  13530. if (length > remaining) {
  13531. length = remaining
  13532. }
  13533. }
  13534. // must be an even number of digits
  13535. var strLen = string.length
  13536. if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
  13537. if (length > strLen / 2) {
  13538. length = strLen / 2
  13539. }
  13540. for (var i = 0; i < length; ++i) {
  13541. var parsed = parseInt(string.substr(i * 2, 2), 16)
  13542. if (isNaN(parsed)) return i
  13543. buf[offset + i] = parsed
  13544. }
  13545. return i
  13546. }
  13547. function utf8Write (buf, string, offset, length) {
  13548. return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
  13549. }
  13550. function asciiWrite (buf, string, offset, length) {
  13551. return blitBuffer(asciiToBytes(string), buf, offset, length)
  13552. }
  13553. function latin1Write (buf, string, offset, length) {
  13554. return asciiWrite(buf, string, offset, length)
  13555. }
  13556. function base64Write (buf, string, offset, length) {
  13557. return blitBuffer(base64ToBytes(string), buf, offset, length)
  13558. }
  13559. function ucs2Write (buf, string, offset, length) {
  13560. return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
  13561. }
  13562. Buffer.prototype.write = function write (string, offset, length, encoding) {
  13563. // Buffer#write(string)
  13564. if (offset === undefined) {
  13565. encoding = 'utf8'
  13566. length = this.length
  13567. offset = 0
  13568. // Buffer#write(string, encoding)
  13569. } else if (length === undefined && typeof offset === 'string') {
  13570. encoding = offset
  13571. length = this.length
  13572. offset = 0
  13573. // Buffer#write(string, offset[, length][, encoding])
  13574. } else if (isFinite(offset)) {
  13575. offset = offset | 0
  13576. if (isFinite(length)) {
  13577. length = length | 0
  13578. if (encoding === undefined) encoding = 'utf8'
  13579. } else {
  13580. encoding = length
  13581. length = undefined
  13582. }
  13583. // legacy write(string, encoding, offset, length) - remove in v0.13
  13584. } else {
  13585. throw new Error(
  13586. 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
  13587. )
  13588. }
  13589. var remaining = this.length - offset
  13590. if (length === undefined || length > remaining) length = remaining
  13591. if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
  13592. throw new RangeError('Attempt to write outside buffer bounds')
  13593. }
  13594. if (!encoding) encoding = 'utf8'
  13595. var loweredCase = false
  13596. for (;;) {
  13597. switch (encoding) {
  13598. case 'hex':
  13599. return hexWrite(this, string, offset, length)
  13600. case 'utf8':
  13601. case 'utf-8':
  13602. return utf8Write(this, string, offset, length)
  13603. case 'ascii':
  13604. return asciiWrite(this, string, offset, length)
  13605. case 'latin1':
  13606. case 'binary':
  13607. return latin1Write(this, string, offset, length)
  13608. case 'base64':
  13609. // Warning: maxLength not taken into account in base64Write
  13610. return base64Write(this, string, offset, length)
  13611. case 'ucs2':
  13612. case 'ucs-2':
  13613. case 'utf16le':
  13614. case 'utf-16le':
  13615. return ucs2Write(this, string, offset, length)
  13616. default:
  13617. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  13618. encoding = ('' + encoding).toLowerCase()
  13619. loweredCase = true
  13620. }
  13621. }
  13622. }
  13623. Buffer.prototype.toJSON = function toJSON () {
  13624. return {
  13625. type: 'Buffer',
  13626. data: Array.prototype.slice.call(this._arr || this, 0)
  13627. }
  13628. }
  13629. function base64Slice (buf, start, end) {
  13630. if (start === 0 && end === buf.length) {
  13631. return base64.fromByteArray(buf)
  13632. } else {
  13633. return base64.fromByteArray(buf.slice(start, end))
  13634. }
  13635. }
  13636. function utf8Slice (buf, start, end) {
  13637. end = Math.min(buf.length, end)
  13638. var res = []
  13639. var i = start
  13640. while (i < end) {
  13641. var firstByte = buf[i]
  13642. var codePoint = null
  13643. var bytesPerSequence = (firstByte > 0xEF) ? 4
  13644. : (firstByte > 0xDF) ? 3
  13645. : (firstByte > 0xBF) ? 2
  13646. : 1
  13647. if (i + bytesPerSequence <= end) {
  13648. var secondByte, thirdByte, fourthByte, tempCodePoint
  13649. switch (bytesPerSequence) {
  13650. case 1:
  13651. if (firstByte < 0x80) {
  13652. codePoint = firstByte
  13653. }
  13654. break
  13655. case 2:
  13656. secondByte = buf[i + 1]
  13657. if ((secondByte & 0xC0) === 0x80) {
  13658. tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
  13659. if (tempCodePoint > 0x7F) {
  13660. codePoint = tempCodePoint
  13661. }
  13662. }
  13663. break
  13664. case 3:
  13665. secondByte = buf[i + 1]
  13666. thirdByte = buf[i + 2]
  13667. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
  13668. tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
  13669. if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
  13670. codePoint = tempCodePoint
  13671. }
  13672. }
  13673. break
  13674. case 4:
  13675. secondByte = buf[i + 1]
  13676. thirdByte = buf[i + 2]
  13677. fourthByte = buf[i + 3]
  13678. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
  13679. tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
  13680. if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
  13681. codePoint = tempCodePoint
  13682. }
  13683. }
  13684. }
  13685. }
  13686. if (codePoint === null) {
  13687. // we did not generate a valid codePoint so insert a
  13688. // replacement char (U+FFFD) and advance only 1 byte
  13689. codePoint = 0xFFFD
  13690. bytesPerSequence = 1
  13691. } else if (codePoint > 0xFFFF) {
  13692. // encode to utf16 (surrogate pair dance)
  13693. codePoint -= 0x10000
  13694. res.push(codePoint >>> 10 & 0x3FF | 0xD800)
  13695. codePoint = 0xDC00 | codePoint & 0x3FF
  13696. }
  13697. res.push(codePoint)
  13698. i += bytesPerSequence
  13699. }
  13700. return decodeCodePointsArray(res)
  13701. }
  13702. // Based on http://stackoverflow.com/a/22747272/680742, the browser with
  13703. // the lowest limit is Chrome, with 0x10000 args.
  13704. // We go 1 magnitude less, for safety
  13705. var MAX_ARGUMENTS_LENGTH = 0x1000
  13706. function decodeCodePointsArray (codePoints) {
  13707. var len = codePoints.length
  13708. if (len <= MAX_ARGUMENTS_LENGTH) {
  13709. return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
  13710. }
  13711. // Decode in chunks to avoid "call stack size exceeded".
  13712. var res = ''
  13713. var i = 0
  13714. while (i < len) {
  13715. res += String.fromCharCode.apply(
  13716. String,
  13717. codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
  13718. )
  13719. }
  13720. return res
  13721. }
  13722. function asciiSlice (buf, start, end) {
  13723. var ret = ''
  13724. end = Math.min(buf.length, end)
  13725. for (var i = start; i < end; ++i) {
  13726. ret += String.fromCharCode(buf[i] & 0x7F)
  13727. }
  13728. return ret
  13729. }
  13730. function latin1Slice (buf, start, end) {
  13731. var ret = ''
  13732. end = Math.min(buf.length, end)
  13733. for (var i = start; i < end; ++i) {
  13734. ret += String.fromCharCode(buf[i])
  13735. }
  13736. return ret
  13737. }
  13738. function hexSlice (buf, start, end) {
  13739. var len = buf.length
  13740. if (!start || start < 0) start = 0
  13741. if (!end || end < 0 || end > len) end = len
  13742. var out = ''
  13743. for (var i = start; i < end; ++i) {
  13744. out += toHex(buf[i])
  13745. }
  13746. return out
  13747. }
  13748. function utf16leSlice (buf, start, end) {
  13749. var bytes = buf.slice(start, end)
  13750. var res = ''
  13751. for (var i = 0; i < bytes.length; i += 2) {
  13752. res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
  13753. }
  13754. return res
  13755. }
  13756. Buffer.prototype.slice = function slice (start, end) {
  13757. var len = this.length
  13758. start = ~~start
  13759. end = end === undefined ? len : ~~end
  13760. if (start < 0) {
  13761. start += len
  13762. if (start < 0) start = 0
  13763. } else if (start > len) {
  13764. start = len
  13765. }
  13766. if (end < 0) {
  13767. end += len
  13768. if (end < 0) end = 0
  13769. } else if (end > len) {
  13770. end = len
  13771. }
  13772. if (end < start) end = start
  13773. var newBuf
  13774. if (Buffer.TYPED_ARRAY_SUPPORT) {
  13775. newBuf = this.subarray(start, end)
  13776. newBuf.__proto__ = Buffer.prototype
  13777. } else {
  13778. var sliceLen = end - start
  13779. newBuf = new Buffer(sliceLen, undefined)
  13780. for (var i = 0; i < sliceLen; ++i) {
  13781. newBuf[i] = this[i + start]
  13782. }
  13783. }
  13784. return newBuf
  13785. }
  13786. /*
  13787. * Need to make sure that buffer isn't trying to write out of bounds.
  13788. */
  13789. function checkOffset (offset, ext, length) {
  13790. if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
  13791. if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
  13792. }
  13793. Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
  13794. offset = offset | 0
  13795. byteLength = byteLength | 0
  13796. if (!noAssert) checkOffset(offset, byteLength, this.length)
  13797. var val = this[offset]
  13798. var mul = 1
  13799. var i = 0
  13800. while (++i < byteLength && (mul *= 0x100)) {
  13801. val += this[offset + i] * mul
  13802. }
  13803. return val
  13804. }
  13805. Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
  13806. offset = offset | 0
  13807. byteLength = byteLength | 0
  13808. if (!noAssert) {
  13809. checkOffset(offset, byteLength, this.length)
  13810. }
  13811. var val = this[offset + --byteLength]
  13812. var mul = 1
  13813. while (byteLength > 0 && (mul *= 0x100)) {
  13814. val += this[offset + --byteLength] * mul
  13815. }
  13816. return val
  13817. }
  13818. Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
  13819. if (!noAssert) checkOffset(offset, 1, this.length)
  13820. return this[offset]
  13821. }
  13822. Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
  13823. if (!noAssert) checkOffset(offset, 2, this.length)
  13824. return this[offset] | (this[offset + 1] << 8)
  13825. }
  13826. Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
  13827. if (!noAssert) checkOffset(offset, 2, this.length)
  13828. return (this[offset] << 8) | this[offset + 1]
  13829. }
  13830. Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
  13831. if (!noAssert) checkOffset(offset, 4, this.length)
  13832. return ((this[offset]) |
  13833. (this[offset + 1] << 8) |
  13834. (this[offset + 2] << 16)) +
  13835. (this[offset + 3] * 0x1000000)
  13836. }
  13837. Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
  13838. if (!noAssert) checkOffset(offset, 4, this.length)
  13839. return (this[offset] * 0x1000000) +
  13840. ((this[offset + 1] << 16) |
  13841. (this[offset + 2] << 8) |
  13842. this[offset + 3])
  13843. }
  13844. Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
  13845. offset = offset | 0
  13846. byteLength = byteLength | 0
  13847. if (!noAssert) checkOffset(offset, byteLength, this.length)
  13848. var val = this[offset]
  13849. var mul = 1
  13850. var i = 0
  13851. while (++i < byteLength && (mul *= 0x100)) {
  13852. val += this[offset + i] * mul
  13853. }
  13854. mul *= 0x80
  13855. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  13856. return val
  13857. }
  13858. Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
  13859. offset = offset | 0
  13860. byteLength = byteLength | 0
  13861. if (!noAssert) checkOffset(offset, byteLength, this.length)
  13862. var i = byteLength
  13863. var mul = 1
  13864. var val = this[offset + --i]
  13865. while (i > 0 && (mul *= 0x100)) {
  13866. val += this[offset + --i] * mul
  13867. }
  13868. mul *= 0x80
  13869. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  13870. return val
  13871. }
  13872. Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
  13873. if (!noAssert) checkOffset(offset, 1, this.length)
  13874. if (!(this[offset] & 0x80)) return (this[offset])
  13875. return ((0xff - this[offset] + 1) * -1)
  13876. }
  13877. Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
  13878. if (!noAssert) checkOffset(offset, 2, this.length)
  13879. var val = this[offset] | (this[offset + 1] << 8)
  13880. return (val & 0x8000) ? val | 0xFFFF0000 : val
  13881. }
  13882. Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
  13883. if (!noAssert) checkOffset(offset, 2, this.length)
  13884. var val = this[offset + 1] | (this[offset] << 8)
  13885. return (val & 0x8000) ? val | 0xFFFF0000 : val
  13886. }
  13887. Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
  13888. if (!noAssert) checkOffset(offset, 4, this.length)
  13889. return (this[offset]) |
  13890. (this[offset + 1] << 8) |
  13891. (this[offset + 2] << 16) |
  13892. (this[offset + 3] << 24)
  13893. }
  13894. Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
  13895. if (!noAssert) checkOffset(offset, 4, this.length)
  13896. return (this[offset] << 24) |
  13897. (this[offset + 1] << 16) |
  13898. (this[offset + 2] << 8) |
  13899. (this[offset + 3])
  13900. }
  13901. Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
  13902. if (!noAssert) checkOffset(offset, 4, this.length)
  13903. return ieee754.read(this, offset, true, 23, 4)
  13904. }
  13905. Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
  13906. if (!noAssert) checkOffset(offset, 4, this.length)
  13907. return ieee754.read(this, offset, false, 23, 4)
  13908. }
  13909. Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
  13910. if (!noAssert) checkOffset(offset, 8, this.length)
  13911. return ieee754.read(this, offset, true, 52, 8)
  13912. }
  13913. Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
  13914. if (!noAssert) checkOffset(offset, 8, this.length)
  13915. return ieee754.read(this, offset, false, 52, 8)
  13916. }
  13917. function checkInt (buf, value, offset, ext, max, min) {
  13918. if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
  13919. if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
  13920. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  13921. }
  13922. Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
  13923. value = +value
  13924. offset = offset | 0
  13925. byteLength = byteLength | 0
  13926. if (!noAssert) {
  13927. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  13928. checkInt(this, value, offset, byteLength, maxBytes, 0)
  13929. }
  13930. var mul = 1
  13931. var i = 0
  13932. this[offset] = value & 0xFF
  13933. while (++i < byteLength && (mul *= 0x100)) {
  13934. this[offset + i] = (value / mul) & 0xFF
  13935. }
  13936. return offset + byteLength
  13937. }
  13938. Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
  13939. value = +value
  13940. offset = offset | 0
  13941. byteLength = byteLength | 0
  13942. if (!noAssert) {
  13943. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  13944. checkInt(this, value, offset, byteLength, maxBytes, 0)
  13945. }
  13946. var i = byteLength - 1
  13947. var mul = 1
  13948. this[offset + i] = value & 0xFF
  13949. while (--i >= 0 && (mul *= 0x100)) {
  13950. this[offset + i] = (value / mul) & 0xFF
  13951. }
  13952. return offset + byteLength
  13953. }
  13954. Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
  13955. value = +value
  13956. offset = offset | 0
  13957. if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
  13958. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  13959. this[offset] = (value & 0xff)
  13960. return offset + 1
  13961. }
  13962. function objectWriteUInt16 (buf, value, offset, littleEndian) {
  13963. if (value < 0) value = 0xffff + value + 1
  13964. for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
  13965. buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
  13966. (littleEndian ? i : 1 - i) * 8
  13967. }
  13968. }
  13969. Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
  13970. value = +value
  13971. offset = offset | 0
  13972. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  13973. if (Buffer.TYPED_ARRAY_SUPPORT) {
  13974. this[offset] = (value & 0xff)
  13975. this[offset + 1] = (value >>> 8)
  13976. } else {
  13977. objectWriteUInt16(this, value, offset, true)
  13978. }
  13979. return offset + 2
  13980. }
  13981. Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
  13982. value = +value
  13983. offset = offset | 0
  13984. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  13985. if (Buffer.TYPED_ARRAY_SUPPORT) {
  13986. this[offset] = (value >>> 8)
  13987. this[offset + 1] = (value & 0xff)
  13988. } else {
  13989. objectWriteUInt16(this, value, offset, false)
  13990. }
  13991. return offset + 2
  13992. }
  13993. function objectWriteUInt32 (buf, value, offset, littleEndian) {
  13994. if (value < 0) value = 0xffffffff + value + 1
  13995. for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
  13996. buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
  13997. }
  13998. }
  13999. Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
  14000. value = +value
  14001. offset = offset | 0
  14002. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  14003. if (Buffer.TYPED_ARRAY_SUPPORT) {
  14004. this[offset + 3] = (value >>> 24)
  14005. this[offset + 2] = (value >>> 16)
  14006. this[offset + 1] = (value >>> 8)
  14007. this[offset] = (value & 0xff)
  14008. } else {
  14009. objectWriteUInt32(this, value, offset, true)
  14010. }
  14011. return offset + 4
  14012. }
  14013. Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
  14014. value = +value
  14015. offset = offset | 0
  14016. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  14017. if (Buffer.TYPED_ARRAY_SUPPORT) {
  14018. this[offset] = (value >>> 24)
  14019. this[offset + 1] = (value >>> 16)
  14020. this[offset + 2] = (value >>> 8)
  14021. this[offset + 3] = (value & 0xff)
  14022. } else {
  14023. objectWriteUInt32(this, value, offset, false)
  14024. }
  14025. return offset + 4
  14026. }
  14027. Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
  14028. value = +value
  14029. offset = offset | 0
  14030. if (!noAssert) {
  14031. var limit = Math.pow(2, 8 * byteLength - 1)
  14032. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  14033. }
  14034. var i = 0
  14035. var mul = 1
  14036. var sub = 0
  14037. this[offset] = value & 0xFF
  14038. while (++i < byteLength && (mul *= 0x100)) {
  14039. if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
  14040. sub = 1
  14041. }
  14042. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  14043. }
  14044. return offset + byteLength
  14045. }
  14046. Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
  14047. value = +value
  14048. offset = offset | 0
  14049. if (!noAssert) {
  14050. var limit = Math.pow(2, 8 * byteLength - 1)
  14051. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  14052. }
  14053. var i = byteLength - 1
  14054. var mul = 1
  14055. var sub = 0
  14056. this[offset + i] = value & 0xFF
  14057. while (--i >= 0 && (mul *= 0x100)) {
  14058. if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
  14059. sub = 1
  14060. }
  14061. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  14062. }
  14063. return offset + byteLength
  14064. }
  14065. Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
  14066. value = +value
  14067. offset = offset | 0
  14068. if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
  14069. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  14070. if (value < 0) value = 0xff + value + 1
  14071. this[offset] = (value & 0xff)
  14072. return offset + 1
  14073. }
  14074. Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
  14075. value = +value
  14076. offset = offset | 0
  14077. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  14078. if (Buffer.TYPED_ARRAY_SUPPORT) {
  14079. this[offset] = (value & 0xff)
  14080. this[offset + 1] = (value >>> 8)
  14081. } else {
  14082. objectWriteUInt16(this, value, offset, true)
  14083. }
  14084. return offset + 2
  14085. }
  14086. Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
  14087. value = +value
  14088. offset = offset | 0
  14089. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  14090. if (Buffer.TYPED_ARRAY_SUPPORT) {
  14091. this[offset] = (value >>> 8)
  14092. this[offset + 1] = (value & 0xff)
  14093. } else {
  14094. objectWriteUInt16(this, value, offset, false)
  14095. }
  14096. return offset + 2
  14097. }
  14098. Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
  14099. value = +value
  14100. offset = offset | 0
  14101. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  14102. if (Buffer.TYPED_ARRAY_SUPPORT) {
  14103. this[offset] = (value & 0xff)
  14104. this[offset + 1] = (value >>> 8)
  14105. this[offset + 2] = (value >>> 16)
  14106. this[offset + 3] = (value >>> 24)
  14107. } else {
  14108. objectWriteUInt32(this, value, offset, true)
  14109. }
  14110. return offset + 4
  14111. }
  14112. Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
  14113. value = +value
  14114. offset = offset | 0
  14115. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  14116. if (value < 0) value = 0xffffffff + value + 1
  14117. if (Buffer.TYPED_ARRAY_SUPPORT) {
  14118. this[offset] = (value >>> 24)
  14119. this[offset + 1] = (value >>> 16)
  14120. this[offset + 2] = (value >>> 8)
  14121. this[offset + 3] = (value & 0xff)
  14122. } else {
  14123. objectWriteUInt32(this, value, offset, false)
  14124. }
  14125. return offset + 4
  14126. }
  14127. function checkIEEE754 (buf, value, offset, ext, max, min) {
  14128. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  14129. if (offset < 0) throw new RangeError('Index out of range')
  14130. }
  14131. function writeFloat (buf, value, offset, littleEndian, noAssert) {
  14132. if (!noAssert) {
  14133. checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
  14134. }
  14135. ieee754.write(buf, value, offset, littleEndian, 23, 4)
  14136. return offset + 4
  14137. }
  14138. Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
  14139. return writeFloat(this, value, offset, true, noAssert)
  14140. }
  14141. Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
  14142. return writeFloat(this, value, offset, false, noAssert)
  14143. }
  14144. function writeDouble (buf, value, offset, littleEndian, noAssert) {
  14145. if (!noAssert) {
  14146. checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
  14147. }
  14148. ieee754.write(buf, value, offset, littleEndian, 52, 8)
  14149. return offset + 8
  14150. }
  14151. Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
  14152. return writeDouble(this, value, offset, true, noAssert)
  14153. }
  14154. Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
  14155. return writeDouble(this, value, offset, false, noAssert)
  14156. }
  14157. // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
  14158. Buffer.prototype.copy = function copy (target, targetStart, start, end) {
  14159. if (!start) start = 0
  14160. if (!end && end !== 0) end = this.length
  14161. if (targetStart >= target.length) targetStart = target.length
  14162. if (!targetStart) targetStart = 0
  14163. if (end > 0 && end < start) end = start
  14164. // Copy 0 bytes; we're done
  14165. if (end === start) return 0
  14166. if (target.length === 0 || this.length === 0) return 0
  14167. // Fatal error conditions
  14168. if (targetStart < 0) {
  14169. throw new RangeError('targetStart out of bounds')
  14170. }
  14171. if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
  14172. if (end < 0) throw new RangeError('sourceEnd out of bounds')
  14173. // Are we oob?
  14174. if (end > this.length) end = this.length
  14175. if (target.length - targetStart < end - start) {
  14176. end = target.length - targetStart + start
  14177. }
  14178. var len = end - start
  14179. var i
  14180. if (this === target && start < targetStart && targetStart < end) {
  14181. // descending copy from end
  14182. for (i = len - 1; i >= 0; --i) {
  14183. target[i + targetStart] = this[i + start]
  14184. }
  14185. } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
  14186. // ascending copy from start
  14187. for (i = 0; i < len; ++i) {
  14188. target[i + targetStart] = this[i + start]
  14189. }
  14190. } else {
  14191. Uint8Array.prototype.set.call(
  14192. target,
  14193. this.subarray(start, start + len),
  14194. targetStart
  14195. )
  14196. }
  14197. return len
  14198. }
  14199. // Usage:
  14200. // buffer.fill(number[, offset[, end]])
  14201. // buffer.fill(buffer[, offset[, end]])
  14202. // buffer.fill(string[, offset[, end]][, encoding])
  14203. Buffer.prototype.fill = function fill (val, start, end, encoding) {
  14204. // Handle string cases:
  14205. if (typeof val === 'string') {
  14206. if (typeof start === 'string') {
  14207. encoding = start
  14208. start = 0
  14209. end = this.length
  14210. } else if (typeof end === 'string') {
  14211. encoding = end
  14212. end = this.length
  14213. }
  14214. if (val.length === 1) {
  14215. var code = val.charCodeAt(0)
  14216. if (code < 256) {
  14217. val = code
  14218. }
  14219. }
  14220. if (encoding !== undefined && typeof encoding !== 'string') {
  14221. throw new TypeError('encoding must be a string')
  14222. }
  14223. if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
  14224. throw new TypeError('Unknown encoding: ' + encoding)
  14225. }
  14226. } else if (typeof val === 'number') {
  14227. val = val & 255
  14228. }
  14229. // Invalid ranges are not set to a default, so can range check early.
  14230. if (start < 0 || this.length < start || this.length < end) {
  14231. throw new RangeError('Out of range index')
  14232. }
  14233. if (end <= start) {
  14234. return this
  14235. }
  14236. start = start >>> 0
  14237. end = end === undefined ? this.length : end >>> 0
  14238. if (!val) val = 0
  14239. var i
  14240. if (typeof val === 'number') {
  14241. for (i = start; i < end; ++i) {
  14242. this[i] = val
  14243. }
  14244. } else {
  14245. var bytes = Buffer.isBuffer(val)
  14246. ? val
  14247. : utf8ToBytes(new Buffer(val, encoding).toString())
  14248. var len = bytes.length
  14249. for (i = 0; i < end - start; ++i) {
  14250. this[i + start] = bytes[i % len]
  14251. }
  14252. }
  14253. return this
  14254. }
  14255. // HELPER FUNCTIONS
  14256. // ================
  14257. var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
  14258. function base64clean (str) {
  14259. // Node strips out invalid characters like \n and \t from the string, base64-js does not
  14260. str = stringtrim(str).replace(INVALID_BASE64_RE, '')
  14261. // Node converts strings with length < 2 to ''
  14262. if (str.length < 2) return ''
  14263. // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
  14264. while (str.length % 4 !== 0) {
  14265. str = str + '='
  14266. }
  14267. return str
  14268. }
  14269. function stringtrim (str) {
  14270. if (str.trim) return str.trim()
  14271. return str.replace(/^\s+|\s+$/g, '')
  14272. }
  14273. function toHex (n) {
  14274. if (n < 16) return '0' + n.toString(16)
  14275. return n.toString(16)
  14276. }
  14277. function utf8ToBytes (string, units) {
  14278. units = units || Infinity
  14279. var codePoint
  14280. var length = string.length
  14281. var leadSurrogate = null
  14282. var bytes = []
  14283. for (var i = 0; i < length; ++i) {
  14284. codePoint = string.charCodeAt(i)
  14285. // is surrogate component
  14286. if (codePoint > 0xD7FF && codePoint < 0xE000) {
  14287. // last char was a lead
  14288. if (!leadSurrogate) {
  14289. // no lead yet
  14290. if (codePoint > 0xDBFF) {
  14291. // unexpected trail
  14292. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  14293. continue
  14294. } else if (i + 1 === length) {
  14295. // unpaired lead
  14296. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  14297. continue
  14298. }
  14299. // valid lead
  14300. leadSurrogate = codePoint
  14301. continue
  14302. }
  14303. // 2 leads in a row
  14304. if (codePoint < 0xDC00) {
  14305. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  14306. leadSurrogate = codePoint
  14307. continue
  14308. }
  14309. // valid surrogate pair
  14310. codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
  14311. } else if (leadSurrogate) {
  14312. // valid bmp char, but last char was a lead
  14313. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  14314. }
  14315. leadSurrogate = null
  14316. // encode utf8
  14317. if (codePoint < 0x80) {
  14318. if ((units -= 1) < 0) break
  14319. bytes.push(codePoint)
  14320. } else if (codePoint < 0x800) {
  14321. if ((units -= 2) < 0) break
  14322. bytes.push(
  14323. codePoint >> 0x6 | 0xC0,
  14324. codePoint & 0x3F | 0x80
  14325. )
  14326. } else if (codePoint < 0x10000) {
  14327. if ((units -= 3) < 0) break
  14328. bytes.push(
  14329. codePoint >> 0xC | 0xE0,
  14330. codePoint >> 0x6 & 0x3F | 0x80,
  14331. codePoint & 0x3F | 0x80
  14332. )
  14333. } else if (codePoint < 0x110000) {
  14334. if ((units -= 4) < 0) break
  14335. bytes.push(
  14336. codePoint >> 0x12 | 0xF0,
  14337. codePoint >> 0xC & 0x3F | 0x80,
  14338. codePoint >> 0x6 & 0x3F | 0x80,
  14339. codePoint & 0x3F | 0x80
  14340. )
  14341. } else {
  14342. throw new Error('Invalid code point')
  14343. }
  14344. }
  14345. return bytes
  14346. }
  14347. function asciiToBytes (str) {
  14348. var byteArray = []
  14349. for (var i = 0; i < str.length; ++i) {
  14350. // Node's code seems to be doing this and not & 0x7F..
  14351. byteArray.push(str.charCodeAt(i) & 0xFF)
  14352. }
  14353. return byteArray
  14354. }
  14355. function utf16leToBytes (str, units) {
  14356. var c, hi, lo
  14357. var byteArray = []
  14358. for (var i = 0; i < str.length; ++i) {
  14359. if ((units -= 2) < 0) break
  14360. c = str.charCodeAt(i)
  14361. hi = c >> 8
  14362. lo = c % 256
  14363. byteArray.push(lo)
  14364. byteArray.push(hi)
  14365. }
  14366. return byteArray
  14367. }
  14368. function base64ToBytes (str) {
  14369. return base64.toByteArray(base64clean(str))
  14370. }
  14371. function blitBuffer (src, dst, offset, length) {
  14372. for (var i = 0; i < length; ++i) {
  14373. if ((i + offset >= dst.length) || (i >= src.length)) break
  14374. dst[i + offset] = src[i]
  14375. }
  14376. return i
  14377. }
  14378. function isnan (val) {
  14379. return val !== val // eslint-disable-line no-self-compare
  14380. }
  14381. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ 2)))
  14382. /***/ }),
  14383. /* 50 */
  14384. /*!*****************************************!*\
  14385. !*** ./node_modules/base64-js/index.js ***!
  14386. \*****************************************/
  14387. /*! no static exports found */
  14388. /***/ (function(module, exports, __webpack_require__) {
  14389. "use strict";
  14390. exports.byteLength = byteLength
  14391. exports.toByteArray = toByteArray
  14392. exports.fromByteArray = fromByteArray
  14393. var lookup = []
  14394. var revLookup = []
  14395. var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
  14396. var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
  14397. for (var i = 0, len = code.length; i < len; ++i) {
  14398. lookup[i] = code[i]
  14399. revLookup[code.charCodeAt(i)] = i
  14400. }
  14401. // Support decoding URL-safe base64 strings, as Node.js does.
  14402. // See: https://en.wikipedia.org/wiki/Base64#URL_applications
  14403. revLookup['-'.charCodeAt(0)] = 62
  14404. revLookup['_'.charCodeAt(0)] = 63
  14405. function getLens (b64) {
  14406. var len = b64.length
  14407. if (len % 4 > 0) {
  14408. throw new Error('Invalid string. Length must be a multiple of 4')
  14409. }
  14410. // Trim off extra bytes after placeholder bytes are found
  14411. // See: https://github.com/beatgammit/base64-js/issues/42
  14412. var validLen = b64.indexOf('=')
  14413. if (validLen === -1) validLen = len
  14414. var placeHoldersLen = validLen === len
  14415. ? 0
  14416. : 4 - (validLen % 4)
  14417. return [validLen, placeHoldersLen]
  14418. }
  14419. // base64 is 4/3 + up to two characters of the original data
  14420. function byteLength (b64) {
  14421. var lens = getLens(b64)
  14422. var validLen = lens[0]
  14423. var placeHoldersLen = lens[1]
  14424. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  14425. }
  14426. function _byteLength (b64, validLen, placeHoldersLen) {
  14427. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  14428. }
  14429. function toByteArray (b64) {
  14430. var tmp
  14431. var lens = getLens(b64)
  14432. var validLen = lens[0]
  14433. var placeHoldersLen = lens[1]
  14434. var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
  14435. var curByte = 0
  14436. // if there are placeholders, only get up to the last complete 4 chars
  14437. var len = placeHoldersLen > 0
  14438. ? validLen - 4
  14439. : validLen
  14440. var i
  14441. for (i = 0; i < len; i += 4) {
  14442. tmp =
  14443. (revLookup[b64.charCodeAt(i)] << 18) |
  14444. (revLookup[b64.charCodeAt(i + 1)] << 12) |
  14445. (revLookup[b64.charCodeAt(i + 2)] << 6) |
  14446. revLookup[b64.charCodeAt(i + 3)]
  14447. arr[curByte++] = (tmp >> 16) & 0xFF
  14448. arr[curByte++] = (tmp >> 8) & 0xFF
  14449. arr[curByte++] = tmp & 0xFF
  14450. }
  14451. if (placeHoldersLen === 2) {
  14452. tmp =
  14453. (revLookup[b64.charCodeAt(i)] << 2) |
  14454. (revLookup[b64.charCodeAt(i + 1)] >> 4)
  14455. arr[curByte++] = tmp & 0xFF
  14456. }
  14457. if (placeHoldersLen === 1) {
  14458. tmp =
  14459. (revLookup[b64.charCodeAt(i)] << 10) |
  14460. (revLookup[b64.charCodeAt(i + 1)] << 4) |
  14461. (revLookup[b64.charCodeAt(i + 2)] >> 2)
  14462. arr[curByte++] = (tmp >> 8) & 0xFF
  14463. arr[curByte++] = tmp & 0xFF
  14464. }
  14465. return arr
  14466. }
  14467. function tripletToBase64 (num) {
  14468. return lookup[num >> 18 & 0x3F] +
  14469. lookup[num >> 12 & 0x3F] +
  14470. lookup[num >> 6 & 0x3F] +
  14471. lookup[num & 0x3F]
  14472. }
  14473. function encodeChunk (uint8, start, end) {
  14474. var tmp
  14475. var output = []
  14476. for (var i = start; i < end; i += 3) {
  14477. tmp =
  14478. ((uint8[i] << 16) & 0xFF0000) +
  14479. ((uint8[i + 1] << 8) & 0xFF00) +
  14480. (uint8[i + 2] & 0xFF)
  14481. output.push(tripletToBase64(tmp))
  14482. }
  14483. return output.join('')
  14484. }
  14485. function fromByteArray (uint8) {
  14486. var tmp
  14487. var len = uint8.length
  14488. var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
  14489. var parts = []
  14490. var maxChunkLength = 16383 // must be multiple of 3
  14491. // go through the array every three bytes, we'll deal with trailing stuff later
  14492. for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
  14493. parts.push(encodeChunk(
  14494. uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)
  14495. ))
  14496. }
  14497. // pad the end with zeros, but make sure to not forget the extra bytes
  14498. if (extraBytes === 1) {
  14499. tmp = uint8[len - 1]
  14500. parts.push(
  14501. lookup[tmp >> 2] +
  14502. lookup[(tmp << 4) & 0x3F] +
  14503. '=='
  14504. )
  14505. } else if (extraBytes === 2) {
  14506. tmp = (uint8[len - 2] << 8) + uint8[len - 1]
  14507. parts.push(
  14508. lookup[tmp >> 10] +
  14509. lookup[(tmp >> 4) & 0x3F] +
  14510. lookup[(tmp << 2) & 0x3F] +
  14511. '='
  14512. )
  14513. }
  14514. return parts.join('')
  14515. }
  14516. /***/ }),
  14517. /* 51 */
  14518. /*!***************************************!*\
  14519. !*** ./node_modules/ieee754/index.js ***!
  14520. \***************************************/
  14521. /*! no static exports found */
  14522. /***/ (function(module, exports) {
  14523. exports.read = function (buffer, offset, isLE, mLen, nBytes) {
  14524. var e, m
  14525. var eLen = (nBytes * 8) - mLen - 1
  14526. var eMax = (1 << eLen) - 1
  14527. var eBias = eMax >> 1
  14528. var nBits = -7
  14529. var i = isLE ? (nBytes - 1) : 0
  14530. var d = isLE ? -1 : 1
  14531. var s = buffer[offset + i]
  14532. i += d
  14533. e = s & ((1 << (-nBits)) - 1)
  14534. s >>= (-nBits)
  14535. nBits += eLen
  14536. for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  14537. m = e & ((1 << (-nBits)) - 1)
  14538. e >>= (-nBits)
  14539. nBits += mLen
  14540. for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  14541. if (e === 0) {
  14542. e = 1 - eBias
  14543. } else if (e === eMax) {
  14544. return m ? NaN : ((s ? -1 : 1) * Infinity)
  14545. } else {
  14546. m = m + Math.pow(2, mLen)
  14547. e = e - eBias
  14548. }
  14549. return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
  14550. }
  14551. exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
  14552. var e, m, c
  14553. var eLen = (nBytes * 8) - mLen - 1
  14554. var eMax = (1 << eLen) - 1
  14555. var eBias = eMax >> 1
  14556. var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
  14557. var i = isLE ? 0 : (nBytes - 1)
  14558. var d = isLE ? 1 : -1
  14559. var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
  14560. value = Math.abs(value)
  14561. if (isNaN(value) || value === Infinity) {
  14562. m = isNaN(value) ? 1 : 0
  14563. e = eMax
  14564. } else {
  14565. e = Math.floor(Math.log(value) / Math.LN2)
  14566. if (value * (c = Math.pow(2, -e)) < 1) {
  14567. e--
  14568. c *= 2
  14569. }
  14570. if (e + eBias >= 1) {
  14571. value += rt / c
  14572. } else {
  14573. value += rt * Math.pow(2, 1 - eBias)
  14574. }
  14575. if (value * c >= 2) {
  14576. e++
  14577. c /= 2
  14578. }
  14579. if (e + eBias >= eMax) {
  14580. m = 0
  14581. e = eMax
  14582. } else if (e + eBias >= 1) {
  14583. m = ((value * c) - 1) * Math.pow(2, mLen)
  14584. e = e + eBias
  14585. } else {
  14586. m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
  14587. e = 0
  14588. }
  14589. }
  14590. for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
  14591. e = (e << mLen) | m
  14592. eLen += mLen
  14593. for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
  14594. buffer[offset + i - d] |= s * 128
  14595. }
  14596. /***/ }),
  14597. /* 52 */
  14598. /*!***************************************!*\
  14599. !*** ./node_modules/isarray/index.js ***!
  14600. \***************************************/
  14601. /*! no static exports found */
  14602. /***/ (function(module, exports) {
  14603. var toString = {}.toString;
  14604. module.exports = Array.isArray || function (arr) {
  14605. return toString.call(arr) == '[object Array]';
  14606. };
  14607. /***/ }),
  14608. /* 53 */
  14609. /*!*********************************************!*\
  14610. !*** ./node_modules/create-hash/browser.js ***!
  14611. \*********************************************/
  14612. /*! no static exports found */
  14613. /***/ (function(module, exports, __webpack_require__) {
  14614. "use strict";
  14615. var inherits = __webpack_require__(/*! inherits */ 54)
  14616. var MD5 = __webpack_require__(/*! md5.js */ 55)
  14617. var RIPEMD160 = __webpack_require__(/*! ripemd160 */ 73)
  14618. var sha = __webpack_require__(/*! sha.js */ 74)
  14619. var Base = __webpack_require__(/*! cipher-base */ 82)
  14620. function Hash (hash) {
  14621. Base.call(this, 'digest')
  14622. this._hash = hash
  14623. }
  14624. inherits(Hash, Base)
  14625. Hash.prototype._update = function (data) {
  14626. this._hash.update(data)
  14627. }
  14628. Hash.prototype._final = function () {
  14629. return this._hash.digest()
  14630. }
  14631. module.exports = function createHash (alg) {
  14632. alg = alg.toLowerCase()
  14633. if (alg === 'md5') return new MD5()
  14634. if (alg === 'rmd160' || alg === 'ripemd160') return new RIPEMD160()
  14635. return new Hash(sha(alg))
  14636. }
  14637. /***/ }),
  14638. /* 54 */
  14639. /*!***************************************************!*\
  14640. !*** ./node_modules/inherits/inherits_browser.js ***!
  14641. \***************************************************/
  14642. /*! no static exports found */
  14643. /***/ (function(module, exports) {
  14644. if (typeof Object.create === 'function') {
  14645. // implementation from standard node.js 'util' module
  14646. module.exports = function inherits(ctor, superCtor) {
  14647. if (superCtor) {
  14648. ctor.super_ = superCtor
  14649. ctor.prototype = Object.create(superCtor.prototype, {
  14650. constructor: {
  14651. value: ctor,
  14652. enumerable: false,
  14653. writable: true,
  14654. configurable: true
  14655. }
  14656. })
  14657. }
  14658. };
  14659. } else {
  14660. // old school shim for old browsers
  14661. module.exports = function inherits(ctor, superCtor) {
  14662. if (superCtor) {
  14663. ctor.super_ = superCtor
  14664. var TempCtor = function () {}
  14665. TempCtor.prototype = superCtor.prototype
  14666. ctor.prototype = new TempCtor()
  14667. ctor.prototype.constructor = ctor
  14668. }
  14669. }
  14670. }
  14671. /***/ }),
  14672. /* 55 */
  14673. /*!**************************************!*\
  14674. !*** ./node_modules/md5.js/index.js ***!
  14675. \**************************************/
  14676. /*! no static exports found */
  14677. /***/ (function(module, exports, __webpack_require__) {
  14678. "use strict";
  14679. var inherits = __webpack_require__(/*! inherits */ 54)
  14680. var HashBase = __webpack_require__(/*! hash-base */ 56)
  14681. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  14682. var ARRAY16 = new Array(16)
  14683. function MD5 () {
  14684. HashBase.call(this, 64)
  14685. // state
  14686. this._a = 0x67452301
  14687. this._b = 0xefcdab89
  14688. this._c = 0x98badcfe
  14689. this._d = 0x10325476
  14690. }
  14691. inherits(MD5, HashBase)
  14692. MD5.prototype._update = function () {
  14693. var M = ARRAY16
  14694. for (var i = 0; i < 16; ++i) M[i] = this._block.readInt32LE(i * 4)
  14695. var a = this._a
  14696. var b = this._b
  14697. var c = this._c
  14698. var d = this._d
  14699. a = fnF(a, b, c, d, M[0], 0xd76aa478, 7)
  14700. d = fnF(d, a, b, c, M[1], 0xe8c7b756, 12)
  14701. c = fnF(c, d, a, b, M[2], 0x242070db, 17)
  14702. b = fnF(b, c, d, a, M[3], 0xc1bdceee, 22)
  14703. a = fnF(a, b, c, d, M[4], 0xf57c0faf, 7)
  14704. d = fnF(d, a, b, c, M[5], 0x4787c62a, 12)
  14705. c = fnF(c, d, a, b, M[6], 0xa8304613, 17)
  14706. b = fnF(b, c, d, a, M[7], 0xfd469501, 22)
  14707. a = fnF(a, b, c, d, M[8], 0x698098d8, 7)
  14708. d = fnF(d, a, b, c, M[9], 0x8b44f7af, 12)
  14709. c = fnF(c, d, a, b, M[10], 0xffff5bb1, 17)
  14710. b = fnF(b, c, d, a, M[11], 0x895cd7be, 22)
  14711. a = fnF(a, b, c, d, M[12], 0x6b901122, 7)
  14712. d = fnF(d, a, b, c, M[13], 0xfd987193, 12)
  14713. c = fnF(c, d, a, b, M[14], 0xa679438e, 17)
  14714. b = fnF(b, c, d, a, M[15], 0x49b40821, 22)
  14715. a = fnG(a, b, c, d, M[1], 0xf61e2562, 5)
  14716. d = fnG(d, a, b, c, M[6], 0xc040b340, 9)
  14717. c = fnG(c, d, a, b, M[11], 0x265e5a51, 14)
  14718. b = fnG(b, c, d, a, M[0], 0xe9b6c7aa, 20)
  14719. a = fnG(a, b, c, d, M[5], 0xd62f105d, 5)
  14720. d = fnG(d, a, b, c, M[10], 0x02441453, 9)
  14721. c = fnG(c, d, a, b, M[15], 0xd8a1e681, 14)
  14722. b = fnG(b, c, d, a, M[4], 0xe7d3fbc8, 20)
  14723. a = fnG(a, b, c, d, M[9], 0x21e1cde6, 5)
  14724. d = fnG(d, a, b, c, M[14], 0xc33707d6, 9)
  14725. c = fnG(c, d, a, b, M[3], 0xf4d50d87, 14)
  14726. b = fnG(b, c, d, a, M[8], 0x455a14ed, 20)
  14727. a = fnG(a, b, c, d, M[13], 0xa9e3e905, 5)
  14728. d = fnG(d, a, b, c, M[2], 0xfcefa3f8, 9)
  14729. c = fnG(c, d, a, b, M[7], 0x676f02d9, 14)
  14730. b = fnG(b, c, d, a, M[12], 0x8d2a4c8a, 20)
  14731. a = fnH(a, b, c, d, M[5], 0xfffa3942, 4)
  14732. d = fnH(d, a, b, c, M[8], 0x8771f681, 11)
  14733. c = fnH(c, d, a, b, M[11], 0x6d9d6122, 16)
  14734. b = fnH(b, c, d, a, M[14], 0xfde5380c, 23)
  14735. a = fnH(a, b, c, d, M[1], 0xa4beea44, 4)
  14736. d = fnH(d, a, b, c, M[4], 0x4bdecfa9, 11)
  14737. c = fnH(c, d, a, b, M[7], 0xf6bb4b60, 16)
  14738. b = fnH(b, c, d, a, M[10], 0xbebfbc70, 23)
  14739. a = fnH(a, b, c, d, M[13], 0x289b7ec6, 4)
  14740. d = fnH(d, a, b, c, M[0], 0xeaa127fa, 11)
  14741. c = fnH(c, d, a, b, M[3], 0xd4ef3085, 16)
  14742. b = fnH(b, c, d, a, M[6], 0x04881d05, 23)
  14743. a = fnH(a, b, c, d, M[9], 0xd9d4d039, 4)
  14744. d = fnH(d, a, b, c, M[12], 0xe6db99e5, 11)
  14745. c = fnH(c, d, a, b, M[15], 0x1fa27cf8, 16)
  14746. b = fnH(b, c, d, a, M[2], 0xc4ac5665, 23)
  14747. a = fnI(a, b, c, d, M[0], 0xf4292244, 6)
  14748. d = fnI(d, a, b, c, M[7], 0x432aff97, 10)
  14749. c = fnI(c, d, a, b, M[14], 0xab9423a7, 15)
  14750. b = fnI(b, c, d, a, M[5], 0xfc93a039, 21)
  14751. a = fnI(a, b, c, d, M[12], 0x655b59c3, 6)
  14752. d = fnI(d, a, b, c, M[3], 0x8f0ccc92, 10)
  14753. c = fnI(c, d, a, b, M[10], 0xffeff47d, 15)
  14754. b = fnI(b, c, d, a, M[1], 0x85845dd1, 21)
  14755. a = fnI(a, b, c, d, M[8], 0x6fa87e4f, 6)
  14756. d = fnI(d, a, b, c, M[15], 0xfe2ce6e0, 10)
  14757. c = fnI(c, d, a, b, M[6], 0xa3014314, 15)
  14758. b = fnI(b, c, d, a, M[13], 0x4e0811a1, 21)
  14759. a = fnI(a, b, c, d, M[4], 0xf7537e82, 6)
  14760. d = fnI(d, a, b, c, M[11], 0xbd3af235, 10)
  14761. c = fnI(c, d, a, b, M[2], 0x2ad7d2bb, 15)
  14762. b = fnI(b, c, d, a, M[9], 0xeb86d391, 21)
  14763. this._a = (this._a + a) | 0
  14764. this._b = (this._b + b) | 0
  14765. this._c = (this._c + c) | 0
  14766. this._d = (this._d + d) | 0
  14767. }
  14768. MD5.prototype._digest = function () {
  14769. // create padding and handle blocks
  14770. this._block[this._blockOffset++] = 0x80
  14771. if (this._blockOffset > 56) {
  14772. this._block.fill(0, this._blockOffset, 64)
  14773. this._update()
  14774. this._blockOffset = 0
  14775. }
  14776. this._block.fill(0, this._blockOffset, 56)
  14777. this._block.writeUInt32LE(this._length[0], 56)
  14778. this._block.writeUInt32LE(this._length[1], 60)
  14779. this._update()
  14780. // produce result
  14781. var buffer = Buffer.allocUnsafe(16)
  14782. buffer.writeInt32LE(this._a, 0)
  14783. buffer.writeInt32LE(this._b, 4)
  14784. buffer.writeInt32LE(this._c, 8)
  14785. buffer.writeInt32LE(this._d, 12)
  14786. return buffer
  14787. }
  14788. function rotl (x, n) {
  14789. return (x << n) | (x >>> (32 - n))
  14790. }
  14791. function fnF (a, b, c, d, m, k, s) {
  14792. return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + b) | 0
  14793. }
  14794. function fnG (a, b, c, d, m, k, s) {
  14795. return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + b) | 0
  14796. }
  14797. function fnH (a, b, c, d, m, k, s) {
  14798. return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + b) | 0
  14799. }
  14800. function fnI (a, b, c, d, m, k, s) {
  14801. return (rotl((a + ((c ^ (b | (~d)))) + m + k) | 0, s) + b) | 0
  14802. }
  14803. module.exports = MD5
  14804. /***/ }),
  14805. /* 56 */
  14806. /*!*****************************************!*\
  14807. !*** ./node_modules/hash-base/index.js ***!
  14808. \*****************************************/
  14809. /*! no static exports found */
  14810. /***/ (function(module, exports, __webpack_require__) {
  14811. "use strict";
  14812. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  14813. var Transform = __webpack_require__(/*! readable-stream */ 57).Transform
  14814. var inherits = __webpack_require__(/*! inherits */ 54)
  14815. function throwIfNotStringOrBuffer (val, prefix) {
  14816. if (!Buffer.isBuffer(val) && typeof val !== 'string') {
  14817. throw new TypeError(prefix + ' must be a string or a buffer')
  14818. }
  14819. }
  14820. function HashBase (blockSize) {
  14821. Transform.call(this)
  14822. this._block = Buffer.allocUnsafe(blockSize)
  14823. this._blockSize = blockSize
  14824. this._blockOffset = 0
  14825. this._length = [0, 0, 0, 0]
  14826. this._finalized = false
  14827. }
  14828. inherits(HashBase, Transform)
  14829. HashBase.prototype._transform = function (chunk, encoding, callback) {
  14830. var error = null
  14831. try {
  14832. this.update(chunk, encoding)
  14833. } catch (err) {
  14834. error = err
  14835. }
  14836. callback(error)
  14837. }
  14838. HashBase.prototype._flush = function (callback) {
  14839. var error = null
  14840. try {
  14841. this.push(this.digest())
  14842. } catch (err) {
  14843. error = err
  14844. }
  14845. callback(error)
  14846. }
  14847. HashBase.prototype.update = function (data, encoding) {
  14848. throwIfNotStringOrBuffer(data, 'Data')
  14849. if (this._finalized) throw new Error('Digest already called')
  14850. if (!Buffer.isBuffer(data)) data = Buffer.from(data, encoding)
  14851. // consume data
  14852. var block = this._block
  14853. var offset = 0
  14854. while (this._blockOffset + data.length - offset >= this._blockSize) {
  14855. for (var i = this._blockOffset; i < this._blockSize;) block[i++] = data[offset++]
  14856. this._update()
  14857. this._blockOffset = 0
  14858. }
  14859. while (offset < data.length) block[this._blockOffset++] = data[offset++]
  14860. // update length
  14861. for (var j = 0, carry = data.length * 8; carry > 0; ++j) {
  14862. this._length[j] += carry
  14863. carry = (this._length[j] / 0x0100000000) | 0
  14864. if (carry > 0) this._length[j] -= 0x0100000000 * carry
  14865. }
  14866. return this
  14867. }
  14868. HashBase.prototype._update = function () {
  14869. throw new Error('_update is not implemented')
  14870. }
  14871. HashBase.prototype.digest = function (encoding) {
  14872. if (this._finalized) throw new Error('Digest already called')
  14873. this._finalized = true
  14874. var digest = this._digest()
  14875. if (encoding !== undefined) digest = digest.toString(encoding)
  14876. // reset state
  14877. this._block.fill(0)
  14878. this._blockOffset = 0
  14879. for (var i = 0; i < 4; ++i) this._length[i] = 0
  14880. return digest
  14881. }
  14882. HashBase.prototype._digest = function () {
  14883. throw new Error('_digest is not implemented')
  14884. }
  14885. module.exports = HashBase
  14886. /***/ }),
  14887. /* 57 */
  14888. /*!**********************************************************!*\
  14889. !*** ./node_modules/readable-stream/readable-browser.js ***!
  14890. \**********************************************************/
  14891. /*! no static exports found */
  14892. /***/ (function(module, exports, __webpack_require__) {
  14893. exports = module.exports = __webpack_require__(/*! ./lib/_stream_readable.js */ 58);
  14894. exports.Stream = exports;
  14895. exports.Readable = exports;
  14896. exports.Writable = __webpack_require__(/*! ./lib/_stream_writable.js */ 68);
  14897. exports.Duplex = __webpack_require__(/*! ./lib/_stream_duplex.js */ 67);
  14898. exports.Transform = __webpack_require__(/*! ./lib/_stream_transform.js */ 71);
  14899. exports.PassThrough = __webpack_require__(/*! ./lib/_stream_passthrough.js */ 72);
  14900. /***/ }),
  14901. /* 58 */
  14902. /*!**************************************************************!*\
  14903. !*** ./node_modules/readable-stream/lib/_stream_readable.js ***!
  14904. \**************************************************************/
  14905. /*! no static exports found */
  14906. /***/ (function(module, exports, __webpack_require__) {
  14907. "use strict";
  14908. /* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.
  14909. //
  14910. // Permission is hereby granted, free of charge, to any person obtaining a
  14911. // copy of this software and associated documentation files (the
  14912. // "Software"), to deal in the Software without restriction, including
  14913. // without limitation the rights to use, copy, modify, merge, publish,
  14914. // distribute, sublicense, and/or sell copies of the Software, and to permit
  14915. // persons to whom the Software is furnished to do so, subject to the
  14916. // following conditions:
  14917. //
  14918. // The above copyright notice and this permission notice shall be included
  14919. // in all copies or substantial portions of the Software.
  14920. //
  14921. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  14922. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  14923. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  14924. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  14925. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  14926. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  14927. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  14928. /*<replacement>*/
  14929. var pna = __webpack_require__(/*! process-nextick-args */ 59);
  14930. /*</replacement>*/
  14931. module.exports = Readable;
  14932. /*<replacement>*/
  14933. var isArray = __webpack_require__(/*! isarray */ 52);
  14934. /*</replacement>*/
  14935. /*<replacement>*/
  14936. var Duplex;
  14937. /*</replacement>*/
  14938. Readable.ReadableState = ReadableState;
  14939. /*<replacement>*/
  14940. var EE = __webpack_require__(/*! events */ 60).EventEmitter;
  14941. var EElistenerCount = function (emitter, type) {
  14942. return emitter.listeners(type).length;
  14943. };
  14944. /*</replacement>*/
  14945. /*<replacement>*/
  14946. var Stream = __webpack_require__(/*! ./internal/streams/stream */ 61);
  14947. /*</replacement>*/
  14948. /*<replacement>*/
  14949. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer;
  14950. var OurUint8Array = global.Uint8Array || function () {};
  14951. function _uint8ArrayToBuffer(chunk) {
  14952. return Buffer.from(chunk);
  14953. }
  14954. function _isUint8Array(obj) {
  14955. return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
  14956. }
  14957. /*</replacement>*/
  14958. /*<replacement>*/
  14959. var util = Object.create(__webpack_require__(/*! core-util-is */ 62));
  14960. util.inherits = __webpack_require__(/*! inherits */ 54);
  14961. /*</replacement>*/
  14962. /*<replacement>*/
  14963. var debugUtil = __webpack_require__(/*! util */ 63);
  14964. var debug = void 0;
  14965. if (debugUtil && debugUtil.debuglog) {
  14966. debug = debugUtil.debuglog('stream');
  14967. } else {
  14968. debug = function () {};
  14969. }
  14970. /*</replacement>*/
  14971. var BufferList = __webpack_require__(/*! ./internal/streams/BufferList */ 64);
  14972. var destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ 66);
  14973. var StringDecoder;
  14974. util.inherits(Readable, Stream);
  14975. var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
  14976. function prependListener(emitter, event, fn) {
  14977. // Sadly this is not cacheable as some libraries bundle their own
  14978. // event emitter implementation with them.
  14979. if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);
  14980. // This is a hack to make sure that our error handler is attached before any
  14981. // userland ones. NEVER DO THIS. This is here only because this code needs
  14982. // to continue to work with older versions of Node.js that do not include
  14983. // the prependListener() method. The goal is to eventually remove this hack.
  14984. if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
  14985. }
  14986. function ReadableState(options, stream) {
  14987. Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ 67);
  14988. options = options || {};
  14989. // Duplex streams are both readable and writable, but share
  14990. // the same options object.
  14991. // However, some cases require setting options to different
  14992. // values for the readable and the writable sides of the duplex stream.
  14993. // These options can be provided separately as readableXXX and writableXXX.
  14994. var isDuplex = stream instanceof Duplex;
  14995. // object stream flag. Used to make read(n) ignore n and to
  14996. // make all the buffer merging and length checks go away
  14997. this.objectMode = !!options.objectMode;
  14998. if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
  14999. // the point at which it stops calling _read() to fill the buffer
  15000. // Note: 0 is a valid value, means "don't call _read preemptively ever"
  15001. var hwm = options.highWaterMark;
  15002. var readableHwm = options.readableHighWaterMark;
  15003. var defaultHwm = this.objectMode ? 16 : 16 * 1024;
  15004. if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;
  15005. // cast to ints.
  15006. this.highWaterMark = Math.floor(this.highWaterMark);
  15007. // A linked list is used to store data chunks instead of an array because the
  15008. // linked list can remove elements from the beginning faster than
  15009. // array.shift()
  15010. this.buffer = new BufferList();
  15011. this.length = 0;
  15012. this.pipes = null;
  15013. this.pipesCount = 0;
  15014. this.flowing = null;
  15015. this.ended = false;
  15016. this.endEmitted = false;
  15017. this.reading = false;
  15018. // a flag to be able to tell if the event 'readable'/'data' is emitted
  15019. // immediately, or on a later tick. We set this to true at first, because
  15020. // any actions that shouldn't happen until "later" should generally also
  15021. // not happen before the first read call.
  15022. this.sync = true;
  15023. // whenever we return null, then we set a flag to say
  15024. // that we're awaiting a 'readable' event emission.
  15025. this.needReadable = false;
  15026. this.emittedReadable = false;
  15027. this.readableListening = false;
  15028. this.resumeScheduled = false;
  15029. // has it been destroyed
  15030. this.destroyed = false;
  15031. // Crypto is kind of old and crusty. Historically, its default string
  15032. // encoding is 'binary' so we have to make this configurable.
  15033. // Everything else in the universe uses 'utf8', though.
  15034. this.defaultEncoding = options.defaultEncoding || 'utf8';
  15035. // the number of writers that are awaiting a drain event in .pipe()s
  15036. this.awaitDrain = 0;
  15037. // if true, a maybeReadMore has been scheduled
  15038. this.readingMore = false;
  15039. this.decoder = null;
  15040. this.encoding = null;
  15041. if (options.encoding) {
  15042. if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ 70).StringDecoder;
  15043. this.decoder = new StringDecoder(options.encoding);
  15044. this.encoding = options.encoding;
  15045. }
  15046. }
  15047. function Readable(options) {
  15048. Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ 67);
  15049. if (!(this instanceof Readable)) return new Readable(options);
  15050. this._readableState = new ReadableState(options, this);
  15051. // legacy
  15052. this.readable = true;
  15053. if (options) {
  15054. if (typeof options.read === 'function') this._read = options.read;
  15055. if (typeof options.destroy === 'function') this._destroy = options.destroy;
  15056. }
  15057. Stream.call(this);
  15058. }
  15059. Object.defineProperty(Readable.prototype, 'destroyed', {
  15060. get: function () {
  15061. if (this._readableState === undefined) {
  15062. return false;
  15063. }
  15064. return this._readableState.destroyed;
  15065. },
  15066. set: function (value) {
  15067. // we ignore the value if the stream
  15068. // has not been initialized yet
  15069. if (!this._readableState) {
  15070. return;
  15071. }
  15072. // backward compatibility, the user is explicitly
  15073. // managing destroyed
  15074. this._readableState.destroyed = value;
  15075. }
  15076. });
  15077. Readable.prototype.destroy = destroyImpl.destroy;
  15078. Readable.prototype._undestroy = destroyImpl.undestroy;
  15079. Readable.prototype._destroy = function (err, cb) {
  15080. this.push(null);
  15081. cb(err);
  15082. };
  15083. // Manually shove something into the read() buffer.
  15084. // This returns true if the highWaterMark has not been hit yet,
  15085. // similar to how Writable.write() returns true if you should
  15086. // write() some more.
  15087. Readable.prototype.push = function (chunk, encoding) {
  15088. var state = this._readableState;
  15089. var skipChunkCheck;
  15090. if (!state.objectMode) {
  15091. if (typeof chunk === 'string') {
  15092. encoding = encoding || state.defaultEncoding;
  15093. if (encoding !== state.encoding) {
  15094. chunk = Buffer.from(chunk, encoding);
  15095. encoding = '';
  15096. }
  15097. skipChunkCheck = true;
  15098. }
  15099. } else {
  15100. skipChunkCheck = true;
  15101. }
  15102. return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
  15103. };
  15104. // Unshift should *always* be something directly out of read()
  15105. Readable.prototype.unshift = function (chunk) {
  15106. return readableAddChunk(this, chunk, null, true, false);
  15107. };
  15108. function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
  15109. var state = stream._readableState;
  15110. if (chunk === null) {
  15111. state.reading = false;
  15112. onEofChunk(stream, state);
  15113. } else {
  15114. var er;
  15115. if (!skipChunkCheck) er = chunkInvalid(state, chunk);
  15116. if (er) {
  15117. stream.emit('error', er);
  15118. } else if (state.objectMode || chunk && chunk.length > 0) {
  15119. if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
  15120. chunk = _uint8ArrayToBuffer(chunk);
  15121. }
  15122. if (addToFront) {
  15123. if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);
  15124. } else if (state.ended) {
  15125. stream.emit('error', new Error('stream.push() after EOF'));
  15126. } else {
  15127. state.reading = false;
  15128. if (state.decoder && !encoding) {
  15129. chunk = state.decoder.write(chunk);
  15130. if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
  15131. } else {
  15132. addChunk(stream, state, chunk, false);
  15133. }
  15134. }
  15135. } else if (!addToFront) {
  15136. state.reading = false;
  15137. }
  15138. }
  15139. return needMoreData(state);
  15140. }
  15141. function addChunk(stream, state, chunk, addToFront) {
  15142. if (state.flowing && state.length === 0 && !state.sync) {
  15143. stream.emit('data', chunk);
  15144. stream.read(0);
  15145. } else {
  15146. // update the buffer info.
  15147. state.length += state.objectMode ? 1 : chunk.length;
  15148. if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
  15149. if (state.needReadable) emitReadable(stream);
  15150. }
  15151. maybeReadMore(stream, state);
  15152. }
  15153. function chunkInvalid(state, chunk) {
  15154. var er;
  15155. if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
  15156. er = new TypeError('Invalid non-string/buffer chunk');
  15157. }
  15158. return er;
  15159. }
  15160. // if it's past the high water mark, we can push in some more.
  15161. // Also, if we have no data yet, we can stand some
  15162. // more bytes. This is to work around cases where hwm=0,
  15163. // such as the repl. Also, if the push() triggered a
  15164. // readable event, and the user called read(largeNumber) such that
  15165. // needReadable was set, then we ought to push more, so that another
  15166. // 'readable' event will be triggered.
  15167. function needMoreData(state) {
  15168. return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
  15169. }
  15170. Readable.prototype.isPaused = function () {
  15171. return this._readableState.flowing === false;
  15172. };
  15173. // backwards compatibility.
  15174. Readable.prototype.setEncoding = function (enc) {
  15175. if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ 70).StringDecoder;
  15176. this._readableState.decoder = new StringDecoder(enc);
  15177. this._readableState.encoding = enc;
  15178. return this;
  15179. };
  15180. // Don't raise the hwm > 8MB
  15181. var MAX_HWM = 0x800000;
  15182. function computeNewHighWaterMark(n) {
  15183. if (n >= MAX_HWM) {
  15184. n = MAX_HWM;
  15185. } else {
  15186. // Get the next highest power of 2 to prevent increasing hwm excessively in
  15187. // tiny amounts
  15188. n--;
  15189. n |= n >>> 1;
  15190. n |= n >>> 2;
  15191. n |= n >>> 4;
  15192. n |= n >>> 8;
  15193. n |= n >>> 16;
  15194. n++;
  15195. }
  15196. return n;
  15197. }
  15198. // This function is designed to be inlinable, so please take care when making
  15199. // changes to the function body.
  15200. function howMuchToRead(n, state) {
  15201. if (n <= 0 || state.length === 0 && state.ended) return 0;
  15202. if (state.objectMode) return 1;
  15203. if (n !== n) {
  15204. // Only flow one buffer at a time
  15205. if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
  15206. }
  15207. // If we're asking for more than the current hwm, then raise the hwm.
  15208. if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
  15209. if (n <= state.length) return n;
  15210. // Don't have enough
  15211. if (!state.ended) {
  15212. state.needReadable = true;
  15213. return 0;
  15214. }
  15215. return state.length;
  15216. }
  15217. // you can override either this method, or the async _read(n) below.
  15218. Readable.prototype.read = function (n) {
  15219. debug('read', n);
  15220. n = parseInt(n, 10);
  15221. var state = this._readableState;
  15222. var nOrig = n;
  15223. if (n !== 0) state.emittedReadable = false;
  15224. // if we're doing read(0) to trigger a readable event, but we
  15225. // already have a bunch of data in the buffer, then just trigger
  15226. // the 'readable' event and move on.
  15227. if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
  15228. debug('read: emitReadable', state.length, state.ended);
  15229. if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
  15230. return null;
  15231. }
  15232. n = howMuchToRead(n, state);
  15233. // if we've ended, and we're now clear, then finish it up.
  15234. if (n === 0 && state.ended) {
  15235. if (state.length === 0) endReadable(this);
  15236. return null;
  15237. }
  15238. // All the actual chunk generation logic needs to be
  15239. // *below* the call to _read. The reason is that in certain
  15240. // synthetic stream cases, such as passthrough streams, _read
  15241. // may be a completely synchronous operation which may change
  15242. // the state of the read buffer, providing enough data when
  15243. // before there was *not* enough.
  15244. //
  15245. // So, the steps are:
  15246. // 1. Figure out what the state of things will be after we do
  15247. // a read from the buffer.
  15248. //
  15249. // 2. If that resulting state will trigger a _read, then call _read.
  15250. // Note that this may be asynchronous, or synchronous. Yes, it is
  15251. // deeply ugly to write APIs this way, but that still doesn't mean
  15252. // that the Readable class should behave improperly, as streams are
  15253. // designed to be sync/async agnostic.
  15254. // Take note if the _read call is sync or async (ie, if the read call
  15255. // has returned yet), so that we know whether or not it's safe to emit
  15256. // 'readable' etc.
  15257. //
  15258. // 3. Actually pull the requested chunks out of the buffer and return.
  15259. // if we need a readable event, then we need to do some reading.
  15260. var doRead = state.needReadable;
  15261. debug('need readable', doRead);
  15262. // if we currently have less than the highWaterMark, then also read some
  15263. if (state.length === 0 || state.length - n < state.highWaterMark) {
  15264. doRead = true;
  15265. debug('length less than watermark', doRead);
  15266. }
  15267. // however, if we've ended, then there's no point, and if we're already
  15268. // reading, then it's unnecessary.
  15269. if (state.ended || state.reading) {
  15270. doRead = false;
  15271. debug('reading or ended', doRead);
  15272. } else if (doRead) {
  15273. debug('do read');
  15274. state.reading = true;
  15275. state.sync = true;
  15276. // if the length is currently zero, then we *need* a readable event.
  15277. if (state.length === 0) state.needReadable = true;
  15278. // call internal read method
  15279. this._read(state.highWaterMark);
  15280. state.sync = false;
  15281. // If _read pushed data synchronously, then `reading` will be false,
  15282. // and we need to re-evaluate how much data we can return to the user.
  15283. if (!state.reading) n = howMuchToRead(nOrig, state);
  15284. }
  15285. var ret;
  15286. if (n > 0) ret = fromList(n, state);else ret = null;
  15287. if (ret === null) {
  15288. state.needReadable = true;
  15289. n = 0;
  15290. } else {
  15291. state.length -= n;
  15292. }
  15293. if (state.length === 0) {
  15294. // If we have nothing in the buffer, then we want to know
  15295. // as soon as we *do* get something into the buffer.
  15296. if (!state.ended) state.needReadable = true;
  15297. // If we tried to read() past the EOF, then emit end on the next tick.
  15298. if (nOrig !== n && state.ended) endReadable(this);
  15299. }
  15300. if (ret !== null) this.emit('data', ret);
  15301. return ret;
  15302. };
  15303. function onEofChunk(stream, state) {
  15304. if (state.ended) return;
  15305. if (state.decoder) {
  15306. var chunk = state.decoder.end();
  15307. if (chunk && chunk.length) {
  15308. state.buffer.push(chunk);
  15309. state.length += state.objectMode ? 1 : chunk.length;
  15310. }
  15311. }
  15312. state.ended = true;
  15313. // emit 'readable' now to make sure it gets picked up.
  15314. emitReadable(stream);
  15315. }
  15316. // Don't emit readable right away in sync mode, because this can trigger
  15317. // another read() call => stack overflow. This way, it might trigger
  15318. // a nextTick recursion warning, but that's not so bad.
  15319. function emitReadable(stream) {
  15320. var state = stream._readableState;
  15321. state.needReadable = false;
  15322. if (!state.emittedReadable) {
  15323. debug('emitReadable', state.flowing);
  15324. state.emittedReadable = true;
  15325. if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);
  15326. }
  15327. }
  15328. function emitReadable_(stream) {
  15329. debug('emit readable');
  15330. stream.emit('readable');
  15331. flow(stream);
  15332. }
  15333. // at this point, the user has presumably seen the 'readable' event,
  15334. // and called read() to consume some data. that may have triggered
  15335. // in turn another _read(n) call, in which case reading = true if
  15336. // it's in progress.
  15337. // However, if we're not ended, or reading, and the length < hwm,
  15338. // then go ahead and try to read some more preemptively.
  15339. function maybeReadMore(stream, state) {
  15340. if (!state.readingMore) {
  15341. state.readingMore = true;
  15342. pna.nextTick(maybeReadMore_, stream, state);
  15343. }
  15344. }
  15345. function maybeReadMore_(stream, state) {
  15346. var len = state.length;
  15347. while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
  15348. debug('maybeReadMore read 0');
  15349. stream.read(0);
  15350. if (len === state.length)
  15351. // didn't get any data, stop spinning.
  15352. break;else len = state.length;
  15353. }
  15354. state.readingMore = false;
  15355. }
  15356. // abstract method. to be overridden in specific implementation classes.
  15357. // call cb(er, data) where data is <= n in length.
  15358. // for virtual (non-string, non-buffer) streams, "length" is somewhat
  15359. // arbitrary, and perhaps not very meaningful.
  15360. Readable.prototype._read = function (n) {
  15361. this.emit('error', new Error('_read() is not implemented'));
  15362. };
  15363. Readable.prototype.pipe = function (dest, pipeOpts) {
  15364. var src = this;
  15365. var state = this._readableState;
  15366. switch (state.pipesCount) {
  15367. case 0:
  15368. state.pipes = dest;
  15369. break;
  15370. case 1:
  15371. state.pipes = [state.pipes, dest];
  15372. break;
  15373. default:
  15374. state.pipes.push(dest);
  15375. break;
  15376. }
  15377. state.pipesCount += 1;
  15378. debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
  15379. var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
  15380. var endFn = doEnd ? onend : unpipe;
  15381. if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);
  15382. dest.on('unpipe', onunpipe);
  15383. function onunpipe(readable, unpipeInfo) {
  15384. debug('onunpipe');
  15385. if (readable === src) {
  15386. if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
  15387. unpipeInfo.hasUnpiped = true;
  15388. cleanup();
  15389. }
  15390. }
  15391. }
  15392. function onend() {
  15393. debug('onend');
  15394. dest.end();
  15395. }
  15396. // when the dest drains, it reduces the awaitDrain counter
  15397. // on the source. This would be more elegant with a .once()
  15398. // handler in flow(), but adding and removing repeatedly is
  15399. // too slow.
  15400. var ondrain = pipeOnDrain(src);
  15401. dest.on('drain', ondrain);
  15402. var cleanedUp = false;
  15403. function cleanup() {
  15404. debug('cleanup');
  15405. // cleanup event handlers once the pipe is broken
  15406. dest.removeListener('close', onclose);
  15407. dest.removeListener('finish', onfinish);
  15408. dest.removeListener('drain', ondrain);
  15409. dest.removeListener('error', onerror);
  15410. dest.removeListener('unpipe', onunpipe);
  15411. src.removeListener('end', onend);
  15412. src.removeListener('end', unpipe);
  15413. src.removeListener('data', ondata);
  15414. cleanedUp = true;
  15415. // if the reader is waiting for a drain event from this
  15416. // specific writer, then it would cause it to never start
  15417. // flowing again.
  15418. // So, if this is awaiting a drain, then we just call it now.
  15419. // If we don't know, then assume that we are waiting for one.
  15420. if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
  15421. }
  15422. // If the user pushes more data while we're writing to dest then we'll end up
  15423. // in ondata again. However, we only want to increase awaitDrain once because
  15424. // dest will only emit one 'drain' event for the multiple writes.
  15425. // => Introduce a guard on increasing awaitDrain.
  15426. var increasedAwaitDrain = false;
  15427. src.on('data', ondata);
  15428. function ondata(chunk) {
  15429. debug('ondata');
  15430. increasedAwaitDrain = false;
  15431. var ret = dest.write(chunk);
  15432. if (false === ret && !increasedAwaitDrain) {
  15433. // If the user unpiped during `dest.write()`, it is possible
  15434. // to get stuck in a permanently paused state if that write
  15435. // also returned false.
  15436. // => Check whether `dest` is still a piping destination.
  15437. if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
  15438. debug('false write response, pause', src._readableState.awaitDrain);
  15439. src._readableState.awaitDrain++;
  15440. increasedAwaitDrain = true;
  15441. }
  15442. src.pause();
  15443. }
  15444. }
  15445. // if the dest has an error, then stop piping into it.
  15446. // however, don't suppress the throwing behavior for this.
  15447. function onerror(er) {
  15448. debug('onerror', er);
  15449. unpipe();
  15450. dest.removeListener('error', onerror);
  15451. if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
  15452. }
  15453. // Make sure our error handler is attached before userland ones.
  15454. prependListener(dest, 'error', onerror);
  15455. // Both close and finish should trigger unpipe, but only once.
  15456. function onclose() {
  15457. dest.removeListener('finish', onfinish);
  15458. unpipe();
  15459. }
  15460. dest.once('close', onclose);
  15461. function onfinish() {
  15462. debug('onfinish');
  15463. dest.removeListener('close', onclose);
  15464. unpipe();
  15465. }
  15466. dest.once('finish', onfinish);
  15467. function unpipe() {
  15468. debug('unpipe');
  15469. src.unpipe(dest);
  15470. }
  15471. // tell the dest that it's being piped to
  15472. dest.emit('pipe', src);
  15473. // start the flow if it hasn't been started already.
  15474. if (!state.flowing) {
  15475. debug('pipe resume');
  15476. src.resume();
  15477. }
  15478. return dest;
  15479. };
  15480. function pipeOnDrain(src) {
  15481. return function () {
  15482. var state = src._readableState;
  15483. debug('pipeOnDrain', state.awaitDrain);
  15484. if (state.awaitDrain) state.awaitDrain--;
  15485. if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
  15486. state.flowing = true;
  15487. flow(src);
  15488. }
  15489. };
  15490. }
  15491. Readable.prototype.unpipe = function (dest) {
  15492. var state = this._readableState;
  15493. var unpipeInfo = { hasUnpiped: false };
  15494. // if we're not piping anywhere, then do nothing.
  15495. if (state.pipesCount === 0) return this;
  15496. // just one destination. most common case.
  15497. if (state.pipesCount === 1) {
  15498. // passed in one, but it's not the right one.
  15499. if (dest && dest !== state.pipes) return this;
  15500. if (!dest) dest = state.pipes;
  15501. // got a match.
  15502. state.pipes = null;
  15503. state.pipesCount = 0;
  15504. state.flowing = false;
  15505. if (dest) dest.emit('unpipe', this, unpipeInfo);
  15506. return this;
  15507. }
  15508. // slow case. multiple pipe destinations.
  15509. if (!dest) {
  15510. // remove all.
  15511. var dests = state.pipes;
  15512. var len = state.pipesCount;
  15513. state.pipes = null;
  15514. state.pipesCount = 0;
  15515. state.flowing = false;
  15516. for (var i = 0; i < len; i++) {
  15517. dests[i].emit('unpipe', this, unpipeInfo);
  15518. }return this;
  15519. }
  15520. // try to find the right one.
  15521. var index = indexOf(state.pipes, dest);
  15522. if (index === -1) return this;
  15523. state.pipes.splice(index, 1);
  15524. state.pipesCount -= 1;
  15525. if (state.pipesCount === 1) state.pipes = state.pipes[0];
  15526. dest.emit('unpipe', this, unpipeInfo);
  15527. return this;
  15528. };
  15529. // set up data events if they are asked for
  15530. // Ensure readable listeners eventually get something
  15531. Readable.prototype.on = function (ev, fn) {
  15532. var res = Stream.prototype.on.call(this, ev, fn);
  15533. if (ev === 'data') {
  15534. // Start flowing on next tick if stream isn't explicitly paused
  15535. if (this._readableState.flowing !== false) this.resume();
  15536. } else if (ev === 'readable') {
  15537. var state = this._readableState;
  15538. if (!state.endEmitted && !state.readableListening) {
  15539. state.readableListening = state.needReadable = true;
  15540. state.emittedReadable = false;
  15541. if (!state.reading) {
  15542. pna.nextTick(nReadingNextTick, this);
  15543. } else if (state.length) {
  15544. emitReadable(this);
  15545. }
  15546. }
  15547. }
  15548. return res;
  15549. };
  15550. Readable.prototype.addListener = Readable.prototype.on;
  15551. function nReadingNextTick(self) {
  15552. debug('readable nexttick read 0');
  15553. self.read(0);
  15554. }
  15555. // pause() and resume() are remnants of the legacy readable stream API
  15556. // If the user uses them, then switch into old mode.
  15557. Readable.prototype.resume = function () {
  15558. var state = this._readableState;
  15559. if (!state.flowing) {
  15560. debug('resume');
  15561. state.flowing = true;
  15562. resume(this, state);
  15563. }
  15564. return this;
  15565. };
  15566. function resume(stream, state) {
  15567. if (!state.resumeScheduled) {
  15568. state.resumeScheduled = true;
  15569. pna.nextTick(resume_, stream, state);
  15570. }
  15571. }
  15572. function resume_(stream, state) {
  15573. if (!state.reading) {
  15574. debug('resume read 0');
  15575. stream.read(0);
  15576. }
  15577. state.resumeScheduled = false;
  15578. state.awaitDrain = 0;
  15579. stream.emit('resume');
  15580. flow(stream);
  15581. if (state.flowing && !state.reading) stream.read(0);
  15582. }
  15583. Readable.prototype.pause = function () {
  15584. debug('call pause flowing=%j', this._readableState.flowing);
  15585. if (false !== this._readableState.flowing) {
  15586. debug('pause');
  15587. this._readableState.flowing = false;
  15588. this.emit('pause');
  15589. }
  15590. return this;
  15591. };
  15592. function flow(stream) {
  15593. var state = stream._readableState;
  15594. debug('flow', state.flowing);
  15595. while (state.flowing && stream.read() !== null) {}
  15596. }
  15597. // wrap an old-style stream as the async data source.
  15598. // This is *not* part of the readable stream interface.
  15599. // It is an ugly unfortunate mess of history.
  15600. Readable.prototype.wrap = function (stream) {
  15601. var _this = this;
  15602. var state = this._readableState;
  15603. var paused = false;
  15604. stream.on('end', function () {
  15605. debug('wrapped end');
  15606. if (state.decoder && !state.ended) {
  15607. var chunk = state.decoder.end();
  15608. if (chunk && chunk.length) _this.push(chunk);
  15609. }
  15610. _this.push(null);
  15611. });
  15612. stream.on('data', function (chunk) {
  15613. debug('wrapped data');
  15614. if (state.decoder) chunk = state.decoder.write(chunk);
  15615. // don't skip over falsy values in objectMode
  15616. if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
  15617. var ret = _this.push(chunk);
  15618. if (!ret) {
  15619. paused = true;
  15620. stream.pause();
  15621. }
  15622. });
  15623. // proxy all the other methods.
  15624. // important when wrapping filters and duplexes.
  15625. for (var i in stream) {
  15626. if (this[i] === undefined && typeof stream[i] === 'function') {
  15627. this[i] = function (method) {
  15628. return function () {
  15629. return stream[method].apply(stream, arguments);
  15630. };
  15631. }(i);
  15632. }
  15633. }
  15634. // proxy certain important events.
  15635. for (var n = 0; n < kProxyEvents.length; n++) {
  15636. stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
  15637. }
  15638. // when we try to consume some more bytes, simply unpause the
  15639. // underlying stream.
  15640. this._read = function (n) {
  15641. debug('wrapped _read', n);
  15642. if (paused) {
  15643. paused = false;
  15644. stream.resume();
  15645. }
  15646. };
  15647. return this;
  15648. };
  15649. Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
  15650. // making it explicit this property is not enumerable
  15651. // because otherwise some prototype manipulation in
  15652. // userland will fail
  15653. enumerable: false,
  15654. get: function () {
  15655. return this._readableState.highWaterMark;
  15656. }
  15657. });
  15658. // exposed for testing purposes only.
  15659. Readable._fromList = fromList;
  15660. // Pluck off n bytes from an array of buffers.
  15661. // Length is the combined lengths of all the buffers in the list.
  15662. // This function is designed to be inlinable, so please take care when making
  15663. // changes to the function body.
  15664. function fromList(n, state) {
  15665. // nothing buffered
  15666. if (state.length === 0) return null;
  15667. var ret;
  15668. if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
  15669. // read it all, truncate the list
  15670. if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
  15671. state.buffer.clear();
  15672. } else {
  15673. // read part of list
  15674. ret = fromListPartial(n, state.buffer, state.decoder);
  15675. }
  15676. return ret;
  15677. }
  15678. // Extracts only enough buffered data to satisfy the amount requested.
  15679. // This function is designed to be inlinable, so please take care when making
  15680. // changes to the function body.
  15681. function fromListPartial(n, list, hasStrings) {
  15682. var ret;
  15683. if (n < list.head.data.length) {
  15684. // slice is the same for buffers and strings
  15685. ret = list.head.data.slice(0, n);
  15686. list.head.data = list.head.data.slice(n);
  15687. } else if (n === list.head.data.length) {
  15688. // first chunk is a perfect match
  15689. ret = list.shift();
  15690. } else {
  15691. // result spans more than one buffer
  15692. ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
  15693. }
  15694. return ret;
  15695. }
  15696. // Copies a specified amount of characters from the list of buffered data
  15697. // chunks.
  15698. // This function is designed to be inlinable, so please take care when making
  15699. // changes to the function body.
  15700. function copyFromBufferString(n, list) {
  15701. var p = list.head;
  15702. var c = 1;
  15703. var ret = p.data;
  15704. n -= ret.length;
  15705. while (p = p.next) {
  15706. var str = p.data;
  15707. var nb = n > str.length ? str.length : n;
  15708. if (nb === str.length) ret += str;else ret += str.slice(0, n);
  15709. n -= nb;
  15710. if (n === 0) {
  15711. if (nb === str.length) {
  15712. ++c;
  15713. if (p.next) list.head = p.next;else list.head = list.tail = null;
  15714. } else {
  15715. list.head = p;
  15716. p.data = str.slice(nb);
  15717. }
  15718. break;
  15719. }
  15720. ++c;
  15721. }
  15722. list.length -= c;
  15723. return ret;
  15724. }
  15725. // Copies a specified amount of bytes from the list of buffered data chunks.
  15726. // This function is designed to be inlinable, so please take care when making
  15727. // changes to the function body.
  15728. function copyFromBuffer(n, list) {
  15729. var ret = Buffer.allocUnsafe(n);
  15730. var p = list.head;
  15731. var c = 1;
  15732. p.data.copy(ret);
  15733. n -= p.data.length;
  15734. while (p = p.next) {
  15735. var buf = p.data;
  15736. var nb = n > buf.length ? buf.length : n;
  15737. buf.copy(ret, ret.length - n, 0, nb);
  15738. n -= nb;
  15739. if (n === 0) {
  15740. if (nb === buf.length) {
  15741. ++c;
  15742. if (p.next) list.head = p.next;else list.head = list.tail = null;
  15743. } else {
  15744. list.head = p;
  15745. p.data = buf.slice(nb);
  15746. }
  15747. break;
  15748. }
  15749. ++c;
  15750. }
  15751. list.length -= c;
  15752. return ret;
  15753. }
  15754. function endReadable(stream) {
  15755. var state = stream._readableState;
  15756. // If we get here before consuming all the bytes, then that is a
  15757. // bug in node. Should never happen.
  15758. if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
  15759. if (!state.endEmitted) {
  15760. state.ended = true;
  15761. pna.nextTick(endReadableNT, state, stream);
  15762. }
  15763. }
  15764. function endReadableNT(state, stream) {
  15765. // Check that we didn't get one last unshift.
  15766. if (!state.endEmitted && state.length === 0) {
  15767. state.endEmitted = true;
  15768. stream.readable = false;
  15769. stream.emit('end');
  15770. }
  15771. }
  15772. function indexOf(xs, x) {
  15773. for (var i = 0, l = xs.length; i < l; i++) {
  15774. if (xs[i] === x) return i;
  15775. }
  15776. return -1;
  15777. }
  15778. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ 2), __webpack_require__(/*! ./../../node-libs-browser/mock/process.js */ 46)))
  15779. /***/ }),
  15780. /* 59 */
  15781. /*!****************************************************!*\
  15782. !*** ./node_modules/process-nextick-args/index.js ***!
  15783. \****************************************************/
  15784. /*! no static exports found */
  15785. /***/ (function(module, exports, __webpack_require__) {
  15786. "use strict";
  15787. /* WEBPACK VAR INJECTION */(function(process) {
  15788. if (typeof process === 'undefined' ||
  15789. !process.version ||
  15790. process.version.indexOf('v0.') === 0 ||
  15791. process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
  15792. module.exports = { nextTick: nextTick };
  15793. } else {
  15794. module.exports = process
  15795. }
  15796. function nextTick(fn, arg1, arg2, arg3) {
  15797. if (typeof fn !== 'function') {
  15798. throw new TypeError('"callback" argument must be a function');
  15799. }
  15800. var len = arguments.length;
  15801. var args, i;
  15802. switch (len) {
  15803. case 0:
  15804. case 1:
  15805. return process.nextTick(fn);
  15806. case 2:
  15807. return process.nextTick(function afterTickOne() {
  15808. fn.call(null, arg1);
  15809. });
  15810. case 3:
  15811. return process.nextTick(function afterTickTwo() {
  15812. fn.call(null, arg1, arg2);
  15813. });
  15814. case 4:
  15815. return process.nextTick(function afterTickThree() {
  15816. fn.call(null, arg1, arg2, arg3);
  15817. });
  15818. default:
  15819. args = new Array(len - 1);
  15820. i = 0;
  15821. while (i < args.length) {
  15822. args[i++] = arguments[i];
  15823. }
  15824. return process.nextTick(function afterTick() {
  15825. fn.apply(null, args);
  15826. });
  15827. }
  15828. }
  15829. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 46)))
  15830. /***/ }),
  15831. /* 60 */
  15832. /*!***************************************!*\
  15833. !*** ./node_modules/events/events.js ***!
  15834. \***************************************/
  15835. /*! no static exports found */
  15836. /***/ (function(module, exports, __webpack_require__) {
  15837. "use strict";
  15838. // Copyright Joyent, Inc. and other Node contributors.
  15839. //
  15840. // Permission is hereby granted, free of charge, to any person obtaining a
  15841. // copy of this software and associated documentation files (the
  15842. // "Software"), to deal in the Software without restriction, including
  15843. // without limitation the rights to use, copy, modify, merge, publish,
  15844. // distribute, sublicense, and/or sell copies of the Software, and to permit
  15845. // persons to whom the Software is furnished to do so, subject to the
  15846. // following conditions:
  15847. //
  15848. // The above copyright notice and this permission notice shall be included
  15849. // in all copies or substantial portions of the Software.
  15850. //
  15851. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  15852. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  15853. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  15854. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  15855. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  15856. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  15857. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  15858. var R = typeof Reflect === 'object' ? Reflect : null
  15859. var ReflectApply = R && typeof R.apply === 'function'
  15860. ? R.apply
  15861. : function ReflectApply(target, receiver, args) {
  15862. return Function.prototype.apply.call(target, receiver, args);
  15863. }
  15864. var ReflectOwnKeys
  15865. if (R && typeof R.ownKeys === 'function') {
  15866. ReflectOwnKeys = R.ownKeys
  15867. } else if (Object.getOwnPropertySymbols) {
  15868. ReflectOwnKeys = function ReflectOwnKeys(target) {
  15869. return Object.getOwnPropertyNames(target)
  15870. .concat(Object.getOwnPropertySymbols(target));
  15871. };
  15872. } else {
  15873. ReflectOwnKeys = function ReflectOwnKeys(target) {
  15874. return Object.getOwnPropertyNames(target);
  15875. };
  15876. }
  15877. function ProcessEmitWarning(warning) {
  15878. if (console && console.warn) console.warn(warning);
  15879. }
  15880. var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
  15881. return value !== value;
  15882. }
  15883. function EventEmitter() {
  15884. EventEmitter.init.call(this);
  15885. }
  15886. module.exports = EventEmitter;
  15887. // Backwards-compat with node 0.10.x
  15888. EventEmitter.EventEmitter = EventEmitter;
  15889. EventEmitter.prototype._events = undefined;
  15890. EventEmitter.prototype._eventsCount = 0;
  15891. EventEmitter.prototype._maxListeners = undefined;
  15892. // By default EventEmitters will print a warning if more than 10 listeners are
  15893. // added to it. This is a useful default which helps finding memory leaks.
  15894. var defaultMaxListeners = 10;
  15895. function checkListener(listener) {
  15896. if (typeof listener !== 'function') {
  15897. throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
  15898. }
  15899. }
  15900. Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
  15901. enumerable: true,
  15902. get: function() {
  15903. return defaultMaxListeners;
  15904. },
  15905. set: function(arg) {
  15906. if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
  15907. throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
  15908. }
  15909. defaultMaxListeners = arg;
  15910. }
  15911. });
  15912. EventEmitter.init = function() {
  15913. if (this._events === undefined ||
  15914. this._events === Object.getPrototypeOf(this)._events) {
  15915. this._events = Object.create(null);
  15916. this._eventsCount = 0;
  15917. }
  15918. this._maxListeners = this._maxListeners || undefined;
  15919. };
  15920. // Obviously not all Emitters should be limited to 10. This function allows
  15921. // that to be increased. Set to zero for unlimited.
  15922. EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
  15923. if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
  15924. throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
  15925. }
  15926. this._maxListeners = n;
  15927. return this;
  15928. };
  15929. function _getMaxListeners(that) {
  15930. if (that._maxListeners === undefined)
  15931. return EventEmitter.defaultMaxListeners;
  15932. return that._maxListeners;
  15933. }
  15934. EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
  15935. return _getMaxListeners(this);
  15936. };
  15937. EventEmitter.prototype.emit = function emit(type) {
  15938. var args = [];
  15939. for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
  15940. var doError = (type === 'error');
  15941. var events = this._events;
  15942. if (events !== undefined)
  15943. doError = (doError && events.error === undefined);
  15944. else if (!doError)
  15945. return false;
  15946. // If there is no 'error' event listener then throw.
  15947. if (doError) {
  15948. var er;
  15949. if (args.length > 0)
  15950. er = args[0];
  15951. if (er instanceof Error) {
  15952. // Note: The comments on the `throw` lines are intentional, they show
  15953. // up in Node's output if this results in an unhandled exception.
  15954. throw er; // Unhandled 'error' event
  15955. }
  15956. // At least give some kind of context to the user
  15957. var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
  15958. err.context = er;
  15959. throw err; // Unhandled 'error' event
  15960. }
  15961. var handler = events[type];
  15962. if (handler === undefined)
  15963. return false;
  15964. if (typeof handler === 'function') {
  15965. ReflectApply(handler, this, args);
  15966. } else {
  15967. var len = handler.length;
  15968. var listeners = arrayClone(handler, len);
  15969. for (var i = 0; i < len; ++i)
  15970. ReflectApply(listeners[i], this, args);
  15971. }
  15972. return true;
  15973. };
  15974. function _addListener(target, type, listener, prepend) {
  15975. var m;
  15976. var events;
  15977. var existing;
  15978. checkListener(listener);
  15979. events = target._events;
  15980. if (events === undefined) {
  15981. events = target._events = Object.create(null);
  15982. target._eventsCount = 0;
  15983. } else {
  15984. // To avoid recursion in the case that type === "newListener"! Before
  15985. // adding it to the listeners, first emit "newListener".
  15986. if (events.newListener !== undefined) {
  15987. target.emit('newListener', type,
  15988. listener.listener ? listener.listener : listener);
  15989. // Re-assign `events` because a newListener handler could have caused the
  15990. // this._events to be assigned to a new object
  15991. events = target._events;
  15992. }
  15993. existing = events[type];
  15994. }
  15995. if (existing === undefined) {
  15996. // Optimize the case of one listener. Don't need the extra array object.
  15997. existing = events[type] = listener;
  15998. ++target._eventsCount;
  15999. } else {
  16000. if (typeof existing === 'function') {
  16001. // Adding the second element, need to change to array.
  16002. existing = events[type] =
  16003. prepend ? [listener, existing] : [existing, listener];
  16004. // If we've already got an array, just append.
  16005. } else if (prepend) {
  16006. existing.unshift(listener);
  16007. } else {
  16008. existing.push(listener);
  16009. }
  16010. // Check for listener leak
  16011. m = _getMaxListeners(target);
  16012. if (m > 0 && existing.length > m && !existing.warned) {
  16013. existing.warned = true;
  16014. // No error code for this since it is a Warning
  16015. // eslint-disable-next-line no-restricted-syntax
  16016. var w = new Error('Possible EventEmitter memory leak detected. ' +
  16017. existing.length + ' ' + String(type) + ' listeners ' +
  16018. 'added. Use emitter.setMaxListeners() to ' +
  16019. 'increase limit');
  16020. w.name = 'MaxListenersExceededWarning';
  16021. w.emitter = target;
  16022. w.type = type;
  16023. w.count = existing.length;
  16024. ProcessEmitWarning(w);
  16025. }
  16026. }
  16027. return target;
  16028. }
  16029. EventEmitter.prototype.addListener = function addListener(type, listener) {
  16030. return _addListener(this, type, listener, false);
  16031. };
  16032. EventEmitter.prototype.on = EventEmitter.prototype.addListener;
  16033. EventEmitter.prototype.prependListener =
  16034. function prependListener(type, listener) {
  16035. return _addListener(this, type, listener, true);
  16036. };
  16037. function onceWrapper() {
  16038. if (!this.fired) {
  16039. this.target.removeListener(this.type, this.wrapFn);
  16040. this.fired = true;
  16041. if (arguments.length === 0)
  16042. return this.listener.call(this.target);
  16043. return this.listener.apply(this.target, arguments);
  16044. }
  16045. }
  16046. function _onceWrap(target, type, listener) {
  16047. var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
  16048. var wrapped = onceWrapper.bind(state);
  16049. wrapped.listener = listener;
  16050. state.wrapFn = wrapped;
  16051. return wrapped;
  16052. }
  16053. EventEmitter.prototype.once = function once(type, listener) {
  16054. checkListener(listener);
  16055. this.on(type, _onceWrap(this, type, listener));
  16056. return this;
  16057. };
  16058. EventEmitter.prototype.prependOnceListener =
  16059. function prependOnceListener(type, listener) {
  16060. checkListener(listener);
  16061. this.prependListener(type, _onceWrap(this, type, listener));
  16062. return this;
  16063. };
  16064. // Emits a 'removeListener' event if and only if the listener was removed.
  16065. EventEmitter.prototype.removeListener =
  16066. function removeListener(type, listener) {
  16067. var list, events, position, i, originalListener;
  16068. checkListener(listener);
  16069. events = this._events;
  16070. if (events === undefined)
  16071. return this;
  16072. list = events[type];
  16073. if (list === undefined)
  16074. return this;
  16075. if (list === listener || list.listener === listener) {
  16076. if (--this._eventsCount === 0)
  16077. this._events = Object.create(null);
  16078. else {
  16079. delete events[type];
  16080. if (events.removeListener)
  16081. this.emit('removeListener', type, list.listener || listener);
  16082. }
  16083. } else if (typeof list !== 'function') {
  16084. position = -1;
  16085. for (i = list.length - 1; i >= 0; i--) {
  16086. if (list[i] === listener || list[i].listener === listener) {
  16087. originalListener = list[i].listener;
  16088. position = i;
  16089. break;
  16090. }
  16091. }
  16092. if (position < 0)
  16093. return this;
  16094. if (position === 0)
  16095. list.shift();
  16096. else {
  16097. spliceOne(list, position);
  16098. }
  16099. if (list.length === 1)
  16100. events[type] = list[0];
  16101. if (events.removeListener !== undefined)
  16102. this.emit('removeListener', type, originalListener || listener);
  16103. }
  16104. return this;
  16105. };
  16106. EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
  16107. EventEmitter.prototype.removeAllListeners =
  16108. function removeAllListeners(type) {
  16109. var listeners, events, i;
  16110. events = this._events;
  16111. if (events === undefined)
  16112. return this;
  16113. // not listening for removeListener, no need to emit
  16114. if (events.removeListener === undefined) {
  16115. if (arguments.length === 0) {
  16116. this._events = Object.create(null);
  16117. this._eventsCount = 0;
  16118. } else if (events[type] !== undefined) {
  16119. if (--this._eventsCount === 0)
  16120. this._events = Object.create(null);
  16121. else
  16122. delete events[type];
  16123. }
  16124. return this;
  16125. }
  16126. // emit removeListener for all listeners on all events
  16127. if (arguments.length === 0) {
  16128. var keys = Object.keys(events);
  16129. var key;
  16130. for (i = 0; i < keys.length; ++i) {
  16131. key = keys[i];
  16132. if (key === 'removeListener') continue;
  16133. this.removeAllListeners(key);
  16134. }
  16135. this.removeAllListeners('removeListener');
  16136. this._events = Object.create(null);
  16137. this._eventsCount = 0;
  16138. return this;
  16139. }
  16140. listeners = events[type];
  16141. if (typeof listeners === 'function') {
  16142. this.removeListener(type, listeners);
  16143. } else if (listeners !== undefined) {
  16144. // LIFO order
  16145. for (i = listeners.length - 1; i >= 0; i--) {
  16146. this.removeListener(type, listeners[i]);
  16147. }
  16148. }
  16149. return this;
  16150. };
  16151. function _listeners(target, type, unwrap) {
  16152. var events = target._events;
  16153. if (events === undefined)
  16154. return [];
  16155. var evlistener = events[type];
  16156. if (evlistener === undefined)
  16157. return [];
  16158. if (typeof evlistener === 'function')
  16159. return unwrap ? [evlistener.listener || evlistener] : [evlistener];
  16160. return unwrap ?
  16161. unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
  16162. }
  16163. EventEmitter.prototype.listeners = function listeners(type) {
  16164. return _listeners(this, type, true);
  16165. };
  16166. EventEmitter.prototype.rawListeners = function rawListeners(type) {
  16167. return _listeners(this, type, false);
  16168. };
  16169. EventEmitter.listenerCount = function(emitter, type) {
  16170. if (typeof emitter.listenerCount === 'function') {
  16171. return emitter.listenerCount(type);
  16172. } else {
  16173. return listenerCount.call(emitter, type);
  16174. }
  16175. };
  16176. EventEmitter.prototype.listenerCount = listenerCount;
  16177. function listenerCount(type) {
  16178. var events = this._events;
  16179. if (events !== undefined) {
  16180. var evlistener = events[type];
  16181. if (typeof evlistener === 'function') {
  16182. return 1;
  16183. } else if (evlistener !== undefined) {
  16184. return evlistener.length;
  16185. }
  16186. }
  16187. return 0;
  16188. }
  16189. EventEmitter.prototype.eventNames = function eventNames() {
  16190. return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
  16191. };
  16192. function arrayClone(arr, n) {
  16193. var copy = new Array(n);
  16194. for (var i = 0; i < n; ++i)
  16195. copy[i] = arr[i];
  16196. return copy;
  16197. }
  16198. function spliceOne(list, index) {
  16199. for (; index + 1 < list.length; index++)
  16200. list[index] = list[index + 1];
  16201. list.pop();
  16202. }
  16203. function unwrapListeners(arr) {
  16204. var ret = new Array(arr.length);
  16205. for (var i = 0; i < ret.length; ++i) {
  16206. ret[i] = arr[i].listener || arr[i];
  16207. }
  16208. return ret;
  16209. }
  16210. /***/ }),
  16211. /* 61 */
  16212. /*!*****************************************************************************!*\
  16213. !*** ./node_modules/readable-stream/lib/internal/streams/stream-browser.js ***!
  16214. \*****************************************************************************/
  16215. /*! no static exports found */
  16216. /***/ (function(module, exports, __webpack_require__) {
  16217. module.exports = __webpack_require__(/*! events */ 60).EventEmitter;
  16218. /***/ }),
  16219. /* 62 */
  16220. /*!***********************************************!*\
  16221. !*** ./node_modules/core-util-is/lib/util.js ***!
  16222. \***********************************************/
  16223. /*! no static exports found */
  16224. /***/ (function(module, exports, __webpack_require__) {
  16225. /* WEBPACK VAR INJECTION */(function(Buffer) {// Copyright Joyent, Inc. and other Node contributors.
  16226. //
  16227. // Permission is hereby granted, free of charge, to any person obtaining a
  16228. // copy of this software and associated documentation files (the
  16229. // "Software"), to deal in the Software without restriction, including
  16230. // without limitation the rights to use, copy, modify, merge, publish,
  16231. // distribute, sublicense, and/or sell copies of the Software, and to permit
  16232. // persons to whom the Software is furnished to do so, subject to the
  16233. // following conditions:
  16234. //
  16235. // The above copyright notice and this permission notice shall be included
  16236. // in all copies or substantial portions of the Software.
  16237. //
  16238. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  16239. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  16240. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  16241. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  16242. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  16243. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  16244. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  16245. // NOTE: These type checking functions intentionally don't use `instanceof`
  16246. // because it is fragile and can be easily faked with `Object.create()`.
  16247. function isArray(arg) {
  16248. if (Array.isArray) {
  16249. return Array.isArray(arg);
  16250. }
  16251. return objectToString(arg) === '[object Array]';
  16252. }
  16253. exports.isArray = isArray;
  16254. function isBoolean(arg) {
  16255. return typeof arg === 'boolean';
  16256. }
  16257. exports.isBoolean = isBoolean;
  16258. function isNull(arg) {
  16259. return arg === null;
  16260. }
  16261. exports.isNull = isNull;
  16262. function isNullOrUndefined(arg) {
  16263. return arg == null;
  16264. }
  16265. exports.isNullOrUndefined = isNullOrUndefined;
  16266. function isNumber(arg) {
  16267. return typeof arg === 'number';
  16268. }
  16269. exports.isNumber = isNumber;
  16270. function isString(arg) {
  16271. return typeof arg === 'string';
  16272. }
  16273. exports.isString = isString;
  16274. function isSymbol(arg) {
  16275. return typeof arg === 'symbol';
  16276. }
  16277. exports.isSymbol = isSymbol;
  16278. function isUndefined(arg) {
  16279. return arg === void 0;
  16280. }
  16281. exports.isUndefined = isUndefined;
  16282. function isRegExp(re) {
  16283. return objectToString(re) === '[object RegExp]';
  16284. }
  16285. exports.isRegExp = isRegExp;
  16286. function isObject(arg) {
  16287. return typeof arg === 'object' && arg !== null;
  16288. }
  16289. exports.isObject = isObject;
  16290. function isDate(d) {
  16291. return objectToString(d) === '[object Date]';
  16292. }
  16293. exports.isDate = isDate;
  16294. function isError(e) {
  16295. return (objectToString(e) === '[object Error]' || e instanceof Error);
  16296. }
  16297. exports.isError = isError;
  16298. function isFunction(arg) {
  16299. return typeof arg === 'function';
  16300. }
  16301. exports.isFunction = isFunction;
  16302. function isPrimitive(arg) {
  16303. return arg === null ||
  16304. typeof arg === 'boolean' ||
  16305. typeof arg === 'number' ||
  16306. typeof arg === 'string' ||
  16307. typeof arg === 'symbol' || // ES6 symbol
  16308. typeof arg === 'undefined';
  16309. }
  16310. exports.isPrimitive = isPrimitive;
  16311. exports.isBuffer = Buffer.isBuffer;
  16312. function objectToString(o) {
  16313. return Object.prototype.toString.call(o);
  16314. }
  16315. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../buffer/index.js */ 49).Buffer))
  16316. /***/ }),
  16317. /* 63 */
  16318. /*!**********************!*\
  16319. !*** util (ignored) ***!
  16320. \**********************/
  16321. /*! no static exports found */
  16322. /***/ (function(module, exports) {
  16323. /* (ignored) */
  16324. /***/ }),
  16325. /* 64 */
  16326. /*!*************************************************************************!*\
  16327. !*** ./node_modules/readable-stream/lib/internal/streams/BufferList.js ***!
  16328. \*************************************************************************/
  16329. /*! no static exports found */
  16330. /***/ (function(module, exports, __webpack_require__) {
  16331. "use strict";
  16332. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16333. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer;
  16334. var util = __webpack_require__(/*! util */ 65);
  16335. function copyBuffer(src, target, offset) {
  16336. src.copy(target, offset);
  16337. }
  16338. module.exports = function () {
  16339. function BufferList() {
  16340. _classCallCheck(this, BufferList);
  16341. this.head = null;
  16342. this.tail = null;
  16343. this.length = 0;
  16344. }
  16345. BufferList.prototype.push = function push(v) {
  16346. var entry = { data: v, next: null };
  16347. if (this.length > 0) this.tail.next = entry;else this.head = entry;
  16348. this.tail = entry;
  16349. ++this.length;
  16350. };
  16351. BufferList.prototype.unshift = function unshift(v) {
  16352. var entry = { data: v, next: this.head };
  16353. if (this.length === 0) this.tail = entry;
  16354. this.head = entry;
  16355. ++this.length;
  16356. };
  16357. BufferList.prototype.shift = function shift() {
  16358. if (this.length === 0) return;
  16359. var ret = this.head.data;
  16360. if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
  16361. --this.length;
  16362. return ret;
  16363. };
  16364. BufferList.prototype.clear = function clear() {
  16365. this.head = this.tail = null;
  16366. this.length = 0;
  16367. };
  16368. BufferList.prototype.join = function join(s) {
  16369. if (this.length === 0) return '';
  16370. var p = this.head;
  16371. var ret = '' + p.data;
  16372. while (p = p.next) {
  16373. ret += s + p.data;
  16374. }return ret;
  16375. };
  16376. BufferList.prototype.concat = function concat(n) {
  16377. if (this.length === 0) return Buffer.alloc(0);
  16378. if (this.length === 1) return this.head.data;
  16379. var ret = Buffer.allocUnsafe(n >>> 0);
  16380. var p = this.head;
  16381. var i = 0;
  16382. while (p) {
  16383. copyBuffer(p.data, ret, i);
  16384. i += p.data.length;
  16385. p = p.next;
  16386. }
  16387. return ret;
  16388. };
  16389. return BufferList;
  16390. }();
  16391. if (util && util.inspect && util.inspect.custom) {
  16392. module.exports.prototype[util.inspect.custom] = function () {
  16393. var obj = util.inspect({ length: this.length });
  16394. return this.constructor.name + ' ' + obj;
  16395. };
  16396. }
  16397. /***/ }),
  16398. /* 65 */
  16399. /*!**********************!*\
  16400. !*** util (ignored) ***!
  16401. \**********************/
  16402. /*! no static exports found */
  16403. /***/ (function(module, exports) {
  16404. /* (ignored) */
  16405. /***/ }),
  16406. /* 66 */
  16407. /*!**********************************************************************!*\
  16408. !*** ./node_modules/readable-stream/lib/internal/streams/destroy.js ***!
  16409. \**********************************************************************/
  16410. /*! no static exports found */
  16411. /***/ (function(module, exports, __webpack_require__) {
  16412. "use strict";
  16413. /*<replacement>*/
  16414. var pna = __webpack_require__(/*! process-nextick-args */ 59);
  16415. /*</replacement>*/
  16416. // undocumented cb() API, needed for core, not for public API
  16417. function destroy(err, cb) {
  16418. var _this = this;
  16419. var readableDestroyed = this._readableState && this._readableState.destroyed;
  16420. var writableDestroyed = this._writableState && this._writableState.destroyed;
  16421. if (readableDestroyed || writableDestroyed) {
  16422. if (cb) {
  16423. cb(err);
  16424. } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {
  16425. pna.nextTick(emitErrorNT, this, err);
  16426. }
  16427. return this;
  16428. }
  16429. // we set destroyed to true before firing error callbacks in order
  16430. // to make it re-entrance safe in case destroy() is called within callbacks
  16431. if (this._readableState) {
  16432. this._readableState.destroyed = true;
  16433. }
  16434. // if this is a duplex stream mark the writable part as destroyed as well
  16435. if (this._writableState) {
  16436. this._writableState.destroyed = true;
  16437. }
  16438. this._destroy(err || null, function (err) {
  16439. if (!cb && err) {
  16440. pna.nextTick(emitErrorNT, _this, err);
  16441. if (_this._writableState) {
  16442. _this._writableState.errorEmitted = true;
  16443. }
  16444. } else if (cb) {
  16445. cb(err);
  16446. }
  16447. });
  16448. return this;
  16449. }
  16450. function undestroy() {
  16451. if (this._readableState) {
  16452. this._readableState.destroyed = false;
  16453. this._readableState.reading = false;
  16454. this._readableState.ended = false;
  16455. this._readableState.endEmitted = false;
  16456. }
  16457. if (this._writableState) {
  16458. this._writableState.destroyed = false;
  16459. this._writableState.ended = false;
  16460. this._writableState.ending = false;
  16461. this._writableState.finished = false;
  16462. this._writableState.errorEmitted = false;
  16463. }
  16464. }
  16465. function emitErrorNT(self, err) {
  16466. self.emit('error', err);
  16467. }
  16468. module.exports = {
  16469. destroy: destroy,
  16470. undestroy: undestroy
  16471. };
  16472. /***/ }),
  16473. /* 67 */
  16474. /*!************************************************************!*\
  16475. !*** ./node_modules/readable-stream/lib/_stream_duplex.js ***!
  16476. \************************************************************/
  16477. /*! no static exports found */
  16478. /***/ (function(module, exports, __webpack_require__) {
  16479. "use strict";
  16480. // Copyright Joyent, Inc. and other Node contributors.
  16481. //
  16482. // Permission is hereby granted, free of charge, to any person obtaining a
  16483. // copy of this software and associated documentation files (the
  16484. // "Software"), to deal in the Software without restriction, including
  16485. // without limitation the rights to use, copy, modify, merge, publish,
  16486. // distribute, sublicense, and/or sell copies of the Software, and to permit
  16487. // persons to whom the Software is furnished to do so, subject to the
  16488. // following conditions:
  16489. //
  16490. // The above copyright notice and this permission notice shall be included
  16491. // in all copies or substantial portions of the Software.
  16492. //
  16493. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  16494. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  16495. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  16496. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  16497. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  16498. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  16499. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  16500. // a duplex stream is just a stream that is both readable and writable.
  16501. // Since JS doesn't have multiple prototypal inheritance, this class
  16502. // prototypally inherits from Readable, and then parasitically from
  16503. // Writable.
  16504. /*<replacement>*/
  16505. var pna = __webpack_require__(/*! process-nextick-args */ 59);
  16506. /*</replacement>*/
  16507. /*<replacement>*/
  16508. var objectKeys = Object.keys || function (obj) {
  16509. var keys = [];
  16510. for (var key in obj) {
  16511. keys.push(key);
  16512. }return keys;
  16513. };
  16514. /*</replacement>*/
  16515. module.exports = Duplex;
  16516. /*<replacement>*/
  16517. var util = Object.create(__webpack_require__(/*! core-util-is */ 62));
  16518. util.inherits = __webpack_require__(/*! inherits */ 54);
  16519. /*</replacement>*/
  16520. var Readable = __webpack_require__(/*! ./_stream_readable */ 58);
  16521. var Writable = __webpack_require__(/*! ./_stream_writable */ 68);
  16522. util.inherits(Duplex, Readable);
  16523. {
  16524. // avoid scope creep, the keys array can then be collected
  16525. var keys = objectKeys(Writable.prototype);
  16526. for (var v = 0; v < keys.length; v++) {
  16527. var method = keys[v];
  16528. if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
  16529. }
  16530. }
  16531. function Duplex(options) {
  16532. if (!(this instanceof Duplex)) return new Duplex(options);
  16533. Readable.call(this, options);
  16534. Writable.call(this, options);
  16535. if (options && options.readable === false) this.readable = false;
  16536. if (options && options.writable === false) this.writable = false;
  16537. this.allowHalfOpen = true;
  16538. if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
  16539. this.once('end', onend);
  16540. }
  16541. Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
  16542. // making it explicit this property is not enumerable
  16543. // because otherwise some prototype manipulation in
  16544. // userland will fail
  16545. enumerable: false,
  16546. get: function () {
  16547. return this._writableState.highWaterMark;
  16548. }
  16549. });
  16550. // the no-half-open enforcer
  16551. function onend() {
  16552. // if we allow half-open state, or if the writable side ended,
  16553. // then we're ok.
  16554. if (this.allowHalfOpen || this._writableState.ended) return;
  16555. // no more data can be written.
  16556. // But allow more writes to happen in this tick.
  16557. pna.nextTick(onEndNT, this);
  16558. }
  16559. function onEndNT(self) {
  16560. self.end();
  16561. }
  16562. Object.defineProperty(Duplex.prototype, 'destroyed', {
  16563. get: function () {
  16564. if (this._readableState === undefined || this._writableState === undefined) {
  16565. return false;
  16566. }
  16567. return this._readableState.destroyed && this._writableState.destroyed;
  16568. },
  16569. set: function (value) {
  16570. // we ignore the value if the stream
  16571. // has not been initialized yet
  16572. if (this._readableState === undefined || this._writableState === undefined) {
  16573. return;
  16574. }
  16575. // backward compatibility, the user is explicitly
  16576. // managing destroyed
  16577. this._readableState.destroyed = value;
  16578. this._writableState.destroyed = value;
  16579. }
  16580. });
  16581. Duplex.prototype._destroy = function (err, cb) {
  16582. this.push(null);
  16583. this.end();
  16584. pna.nextTick(cb, err);
  16585. };
  16586. /***/ }),
  16587. /* 68 */
  16588. /*!**************************************************************!*\
  16589. !*** ./node_modules/readable-stream/lib/_stream_writable.js ***!
  16590. \**************************************************************/
  16591. /*! no static exports found */
  16592. /***/ (function(module, exports, __webpack_require__) {
  16593. "use strict";
  16594. /* WEBPACK VAR INJECTION */(function(process, global) {// Copyright Joyent, Inc. and other Node contributors.
  16595. //
  16596. // Permission is hereby granted, free of charge, to any person obtaining a
  16597. // copy of this software and associated documentation files (the
  16598. // "Software"), to deal in the Software without restriction, including
  16599. // without limitation the rights to use, copy, modify, merge, publish,
  16600. // distribute, sublicense, and/or sell copies of the Software, and to permit
  16601. // persons to whom the Software is furnished to do so, subject to the
  16602. // following conditions:
  16603. //
  16604. // The above copyright notice and this permission notice shall be included
  16605. // in all copies or substantial portions of the Software.
  16606. //
  16607. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  16608. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  16609. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  16610. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  16611. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  16612. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  16613. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  16614. // A bit simpler than readable streams.
  16615. // Implement an async ._write(chunk, encoding, cb), and it'll handle all
  16616. // the drain event emission and buffering.
  16617. /*<replacement>*/
  16618. var pna = __webpack_require__(/*! process-nextick-args */ 59);
  16619. /*</replacement>*/
  16620. module.exports = Writable;
  16621. /* <replacement> */
  16622. function WriteReq(chunk, encoding, cb) {
  16623. this.chunk = chunk;
  16624. this.encoding = encoding;
  16625. this.callback = cb;
  16626. this.next = null;
  16627. }
  16628. // It seems a linked list but it is not
  16629. // there will be only 2 of these for each stream
  16630. function CorkedRequest(state) {
  16631. var _this = this;
  16632. this.next = null;
  16633. this.entry = null;
  16634. this.finish = function () {
  16635. onCorkedFinish(_this, state);
  16636. };
  16637. }
  16638. /* </replacement> */
  16639. /*<replacement>*/
  16640. var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
  16641. /*</replacement>*/
  16642. /*<replacement>*/
  16643. var Duplex;
  16644. /*</replacement>*/
  16645. Writable.WritableState = WritableState;
  16646. /*<replacement>*/
  16647. var util = Object.create(__webpack_require__(/*! core-util-is */ 62));
  16648. util.inherits = __webpack_require__(/*! inherits */ 54);
  16649. /*</replacement>*/
  16650. /*<replacement>*/
  16651. var internalUtil = {
  16652. deprecate: __webpack_require__(/*! util-deprecate */ 69)
  16653. };
  16654. /*</replacement>*/
  16655. /*<replacement>*/
  16656. var Stream = __webpack_require__(/*! ./internal/streams/stream */ 61);
  16657. /*</replacement>*/
  16658. /*<replacement>*/
  16659. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer;
  16660. var OurUint8Array = global.Uint8Array || function () {};
  16661. function _uint8ArrayToBuffer(chunk) {
  16662. return Buffer.from(chunk);
  16663. }
  16664. function _isUint8Array(obj) {
  16665. return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
  16666. }
  16667. /*</replacement>*/
  16668. var destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ 66);
  16669. util.inherits(Writable, Stream);
  16670. function nop() {}
  16671. function WritableState(options, stream) {
  16672. Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ 67);
  16673. options = options || {};
  16674. // Duplex streams are both readable and writable, but share
  16675. // the same options object.
  16676. // However, some cases require setting options to different
  16677. // values for the readable and the writable sides of the duplex stream.
  16678. // These options can be provided separately as readableXXX and writableXXX.
  16679. var isDuplex = stream instanceof Duplex;
  16680. // object stream flag to indicate whether or not this stream
  16681. // contains buffers or objects.
  16682. this.objectMode = !!options.objectMode;
  16683. if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
  16684. // the point at which write() starts returning false
  16685. // Note: 0 is a valid value, means that we always return false if
  16686. // the entire buffer is not flushed immediately on write()
  16687. var hwm = options.highWaterMark;
  16688. var writableHwm = options.writableHighWaterMark;
  16689. var defaultHwm = this.objectMode ? 16 : 16 * 1024;
  16690. if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;
  16691. // cast to ints.
  16692. this.highWaterMark = Math.floor(this.highWaterMark);
  16693. // if _final has been called
  16694. this.finalCalled = false;
  16695. // drain event flag.
  16696. this.needDrain = false;
  16697. // at the start of calling end()
  16698. this.ending = false;
  16699. // when end() has been called, and returned
  16700. this.ended = false;
  16701. // when 'finish' is emitted
  16702. this.finished = false;
  16703. // has it been destroyed
  16704. this.destroyed = false;
  16705. // should we decode strings into buffers before passing to _write?
  16706. // this is here so that some node-core streams can optimize string
  16707. // handling at a lower level.
  16708. var noDecode = options.decodeStrings === false;
  16709. this.decodeStrings = !noDecode;
  16710. // Crypto is kind of old and crusty. Historically, its default string
  16711. // encoding is 'binary' so we have to make this configurable.
  16712. // Everything else in the universe uses 'utf8', though.
  16713. this.defaultEncoding = options.defaultEncoding || 'utf8';
  16714. // not an actual buffer we keep track of, but a measurement
  16715. // of how much we're waiting to get pushed to some underlying
  16716. // socket or file.
  16717. this.length = 0;
  16718. // a flag to see when we're in the middle of a write.
  16719. this.writing = false;
  16720. // when true all writes will be buffered until .uncork() call
  16721. this.corked = 0;
  16722. // a flag to be able to tell if the onwrite cb is called immediately,
  16723. // or on a later tick. We set this to true at first, because any
  16724. // actions that shouldn't happen until "later" should generally also
  16725. // not happen before the first write call.
  16726. this.sync = true;
  16727. // a flag to know if we're processing previously buffered items, which
  16728. // may call the _write() callback in the same tick, so that we don't
  16729. // end up in an overlapped onwrite situation.
  16730. this.bufferProcessing = false;
  16731. // the callback that's passed to _write(chunk,cb)
  16732. this.onwrite = function (er) {
  16733. onwrite(stream, er);
  16734. };
  16735. // the callback that the user supplies to write(chunk,encoding,cb)
  16736. this.writecb = null;
  16737. // the amount that is being written when _write is called.
  16738. this.writelen = 0;
  16739. this.bufferedRequest = null;
  16740. this.lastBufferedRequest = null;
  16741. // number of pending user-supplied write callbacks
  16742. // this must be 0 before 'finish' can be emitted
  16743. this.pendingcb = 0;
  16744. // emit prefinish if the only thing we're waiting for is _write cbs
  16745. // This is relevant for synchronous Transform streams
  16746. this.prefinished = false;
  16747. // True if the error was already emitted and should not be thrown again
  16748. this.errorEmitted = false;
  16749. // count buffered requests
  16750. this.bufferedRequestCount = 0;
  16751. // allocate the first CorkedRequest, there is always
  16752. // one allocated and free to use, and we maintain at most two
  16753. this.corkedRequestsFree = new CorkedRequest(this);
  16754. }
  16755. WritableState.prototype.getBuffer = function getBuffer() {
  16756. var current = this.bufferedRequest;
  16757. var out = [];
  16758. while (current) {
  16759. out.push(current);
  16760. current = current.next;
  16761. }
  16762. return out;
  16763. };
  16764. (function () {
  16765. try {
  16766. Object.defineProperty(WritableState.prototype, 'buffer', {
  16767. get: internalUtil.deprecate(function () {
  16768. return this.getBuffer();
  16769. }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
  16770. });
  16771. } catch (_) {}
  16772. })();
  16773. // Test _writableState for inheritance to account for Duplex streams,
  16774. // whose prototype chain only points to Readable.
  16775. var realHasInstance;
  16776. if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
  16777. realHasInstance = Function.prototype[Symbol.hasInstance];
  16778. Object.defineProperty(Writable, Symbol.hasInstance, {
  16779. value: function (object) {
  16780. if (realHasInstance.call(this, object)) return true;
  16781. if (this !== Writable) return false;
  16782. return object && object._writableState instanceof WritableState;
  16783. }
  16784. });
  16785. } else {
  16786. realHasInstance = function (object) {
  16787. return object instanceof this;
  16788. };
  16789. }
  16790. function Writable(options) {
  16791. Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ 67);
  16792. // Writable ctor is applied to Duplexes, too.
  16793. // `realHasInstance` is necessary because using plain `instanceof`
  16794. // would return false, as no `_writableState` property is attached.
  16795. // Trying to use the custom `instanceof` for Writable here will also break the
  16796. // Node.js LazyTransform implementation, which has a non-trivial getter for
  16797. // `_writableState` that would lead to infinite recursion.
  16798. if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
  16799. return new Writable(options);
  16800. }
  16801. this._writableState = new WritableState(options, this);
  16802. // legacy.
  16803. this.writable = true;
  16804. if (options) {
  16805. if (typeof options.write === 'function') this._write = options.write;
  16806. if (typeof options.writev === 'function') this._writev = options.writev;
  16807. if (typeof options.destroy === 'function') this._destroy = options.destroy;
  16808. if (typeof options.final === 'function') this._final = options.final;
  16809. }
  16810. Stream.call(this);
  16811. }
  16812. // Otherwise people can pipe Writable streams, which is just wrong.
  16813. Writable.prototype.pipe = function () {
  16814. this.emit('error', new Error('Cannot pipe, not readable'));
  16815. };
  16816. function writeAfterEnd(stream, cb) {
  16817. var er = new Error('write after end');
  16818. // TODO: defer error events consistently everywhere, not just the cb
  16819. stream.emit('error', er);
  16820. pna.nextTick(cb, er);
  16821. }
  16822. // Checks that a user-supplied chunk is valid, especially for the particular
  16823. // mode the stream is in. Currently this means that `null` is never accepted
  16824. // and undefined/non-string values are only allowed in object mode.
  16825. function validChunk(stream, state, chunk, cb) {
  16826. var valid = true;
  16827. var er = false;
  16828. if (chunk === null) {
  16829. er = new TypeError('May not write null values to stream');
  16830. } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
  16831. er = new TypeError('Invalid non-string/buffer chunk');
  16832. }
  16833. if (er) {
  16834. stream.emit('error', er);
  16835. pna.nextTick(cb, er);
  16836. valid = false;
  16837. }
  16838. return valid;
  16839. }
  16840. Writable.prototype.write = function (chunk, encoding, cb) {
  16841. var state = this._writableState;
  16842. var ret = false;
  16843. var isBuf = !state.objectMode && _isUint8Array(chunk);
  16844. if (isBuf && !Buffer.isBuffer(chunk)) {
  16845. chunk = _uint8ArrayToBuffer(chunk);
  16846. }
  16847. if (typeof encoding === 'function') {
  16848. cb = encoding;
  16849. encoding = null;
  16850. }
  16851. if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
  16852. if (typeof cb !== 'function') cb = nop;
  16853. if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
  16854. state.pendingcb++;
  16855. ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
  16856. }
  16857. return ret;
  16858. };
  16859. Writable.prototype.cork = function () {
  16860. var state = this._writableState;
  16861. state.corked++;
  16862. };
  16863. Writable.prototype.uncork = function () {
  16864. var state = this._writableState;
  16865. if (state.corked) {
  16866. state.corked--;
  16867. if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
  16868. }
  16869. };
  16870. Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
  16871. // node::ParseEncoding() requires lower case.
  16872. if (typeof encoding === 'string') encoding = encoding.toLowerCase();
  16873. if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
  16874. this._writableState.defaultEncoding = encoding;
  16875. return this;
  16876. };
  16877. function decodeChunk(state, chunk, encoding) {
  16878. if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
  16879. chunk = Buffer.from(chunk, encoding);
  16880. }
  16881. return chunk;
  16882. }
  16883. Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
  16884. // making it explicit this property is not enumerable
  16885. // because otherwise some prototype manipulation in
  16886. // userland will fail
  16887. enumerable: false,
  16888. get: function () {
  16889. return this._writableState.highWaterMark;
  16890. }
  16891. });
  16892. // if we're already writing something, then just put this
  16893. // in the queue, and wait our turn. Otherwise, call _write
  16894. // If we return false, then we need a drain event, so set that flag.
  16895. function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
  16896. if (!isBuf) {
  16897. var newChunk = decodeChunk(state, chunk, encoding);
  16898. if (chunk !== newChunk) {
  16899. isBuf = true;
  16900. encoding = 'buffer';
  16901. chunk = newChunk;
  16902. }
  16903. }
  16904. var len = state.objectMode ? 1 : chunk.length;
  16905. state.length += len;
  16906. var ret = state.length < state.highWaterMark;
  16907. // we must ensure that previous needDrain will not be reset to false.
  16908. if (!ret) state.needDrain = true;
  16909. if (state.writing || state.corked) {
  16910. var last = state.lastBufferedRequest;
  16911. state.lastBufferedRequest = {
  16912. chunk: chunk,
  16913. encoding: encoding,
  16914. isBuf: isBuf,
  16915. callback: cb,
  16916. next: null
  16917. };
  16918. if (last) {
  16919. last.next = state.lastBufferedRequest;
  16920. } else {
  16921. state.bufferedRequest = state.lastBufferedRequest;
  16922. }
  16923. state.bufferedRequestCount += 1;
  16924. } else {
  16925. doWrite(stream, state, false, len, chunk, encoding, cb);
  16926. }
  16927. return ret;
  16928. }
  16929. function doWrite(stream, state, writev, len, chunk, encoding, cb) {
  16930. state.writelen = len;
  16931. state.writecb = cb;
  16932. state.writing = true;
  16933. state.sync = true;
  16934. if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
  16935. state.sync = false;
  16936. }
  16937. function onwriteError(stream, state, sync, er, cb) {
  16938. --state.pendingcb;
  16939. if (sync) {
  16940. // defer the callback if we are being called synchronously
  16941. // to avoid piling up things on the stack
  16942. pna.nextTick(cb, er);
  16943. // this can emit finish, and it will always happen
  16944. // after error
  16945. pna.nextTick(finishMaybe, stream, state);
  16946. stream._writableState.errorEmitted = true;
  16947. stream.emit('error', er);
  16948. } else {
  16949. // the caller expect this to happen before if
  16950. // it is async
  16951. cb(er);
  16952. stream._writableState.errorEmitted = true;
  16953. stream.emit('error', er);
  16954. // this can emit finish, but finish must
  16955. // always follow error
  16956. finishMaybe(stream, state);
  16957. }
  16958. }
  16959. function onwriteStateUpdate(state) {
  16960. state.writing = false;
  16961. state.writecb = null;
  16962. state.length -= state.writelen;
  16963. state.writelen = 0;
  16964. }
  16965. function onwrite(stream, er) {
  16966. var state = stream._writableState;
  16967. var sync = state.sync;
  16968. var cb = state.writecb;
  16969. onwriteStateUpdate(state);
  16970. if (er) onwriteError(stream, state, sync, er, cb);else {
  16971. // Check if we're actually ready to finish, but don't emit yet
  16972. var finished = needFinish(state);
  16973. if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
  16974. clearBuffer(stream, state);
  16975. }
  16976. if (sync) {
  16977. /*<replacement>*/
  16978. asyncWrite(afterWrite, stream, state, finished, cb);
  16979. /*</replacement>*/
  16980. } else {
  16981. afterWrite(stream, state, finished, cb);
  16982. }
  16983. }
  16984. }
  16985. function afterWrite(stream, state, finished, cb) {
  16986. if (!finished) onwriteDrain(stream, state);
  16987. state.pendingcb--;
  16988. cb();
  16989. finishMaybe(stream, state);
  16990. }
  16991. // Must force callback to be called on nextTick, so that we don't
  16992. // emit 'drain' before the write() consumer gets the 'false' return
  16993. // value, and has a chance to attach a 'drain' listener.
  16994. function onwriteDrain(stream, state) {
  16995. if (state.length === 0 && state.needDrain) {
  16996. state.needDrain = false;
  16997. stream.emit('drain');
  16998. }
  16999. }
  17000. // if there's something in the buffer waiting, then process it
  17001. function clearBuffer(stream, state) {
  17002. state.bufferProcessing = true;
  17003. var entry = state.bufferedRequest;
  17004. if (stream._writev && entry && entry.next) {
  17005. // Fast case, write everything using _writev()
  17006. var l = state.bufferedRequestCount;
  17007. var buffer = new Array(l);
  17008. var holder = state.corkedRequestsFree;
  17009. holder.entry = entry;
  17010. var count = 0;
  17011. var allBuffers = true;
  17012. while (entry) {
  17013. buffer[count] = entry;
  17014. if (!entry.isBuf) allBuffers = false;
  17015. entry = entry.next;
  17016. count += 1;
  17017. }
  17018. buffer.allBuffers = allBuffers;
  17019. doWrite(stream, state, true, state.length, buffer, '', holder.finish);
  17020. // doWrite is almost always async, defer these to save a bit of time
  17021. // as the hot path ends with doWrite
  17022. state.pendingcb++;
  17023. state.lastBufferedRequest = null;
  17024. if (holder.next) {
  17025. state.corkedRequestsFree = holder.next;
  17026. holder.next = null;
  17027. } else {
  17028. state.corkedRequestsFree = new CorkedRequest(state);
  17029. }
  17030. state.bufferedRequestCount = 0;
  17031. } else {
  17032. // Slow case, write chunks one-by-one
  17033. while (entry) {
  17034. var chunk = entry.chunk;
  17035. var encoding = entry.encoding;
  17036. var cb = entry.callback;
  17037. var len = state.objectMode ? 1 : chunk.length;
  17038. doWrite(stream, state, false, len, chunk, encoding, cb);
  17039. entry = entry.next;
  17040. state.bufferedRequestCount--;
  17041. // if we didn't call the onwrite immediately, then
  17042. // it means that we need to wait until it does.
  17043. // also, that means that the chunk and cb are currently
  17044. // being processed, so move the buffer counter past them.
  17045. if (state.writing) {
  17046. break;
  17047. }
  17048. }
  17049. if (entry === null) state.lastBufferedRequest = null;
  17050. }
  17051. state.bufferedRequest = entry;
  17052. state.bufferProcessing = false;
  17053. }
  17054. Writable.prototype._write = function (chunk, encoding, cb) {
  17055. cb(new Error('_write() is not implemented'));
  17056. };
  17057. Writable.prototype._writev = null;
  17058. Writable.prototype.end = function (chunk, encoding, cb) {
  17059. var state = this._writableState;
  17060. if (typeof chunk === 'function') {
  17061. cb = chunk;
  17062. chunk = null;
  17063. encoding = null;
  17064. } else if (typeof encoding === 'function') {
  17065. cb = encoding;
  17066. encoding = null;
  17067. }
  17068. if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
  17069. // .end() fully uncorks
  17070. if (state.corked) {
  17071. state.corked = 1;
  17072. this.uncork();
  17073. }
  17074. // ignore unnecessary end() calls.
  17075. if (!state.ending && !state.finished) endWritable(this, state, cb);
  17076. };
  17077. function needFinish(state) {
  17078. return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
  17079. }
  17080. function callFinal(stream, state) {
  17081. stream._final(function (err) {
  17082. state.pendingcb--;
  17083. if (err) {
  17084. stream.emit('error', err);
  17085. }
  17086. state.prefinished = true;
  17087. stream.emit('prefinish');
  17088. finishMaybe(stream, state);
  17089. });
  17090. }
  17091. function prefinish(stream, state) {
  17092. if (!state.prefinished && !state.finalCalled) {
  17093. if (typeof stream._final === 'function') {
  17094. state.pendingcb++;
  17095. state.finalCalled = true;
  17096. pna.nextTick(callFinal, stream, state);
  17097. } else {
  17098. state.prefinished = true;
  17099. stream.emit('prefinish');
  17100. }
  17101. }
  17102. }
  17103. function finishMaybe(stream, state) {
  17104. var need = needFinish(state);
  17105. if (need) {
  17106. prefinish(stream, state);
  17107. if (state.pendingcb === 0) {
  17108. state.finished = true;
  17109. stream.emit('finish');
  17110. }
  17111. }
  17112. return need;
  17113. }
  17114. function endWritable(stream, state, cb) {
  17115. state.ending = true;
  17116. finishMaybe(stream, state);
  17117. if (cb) {
  17118. if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);
  17119. }
  17120. state.ended = true;
  17121. stream.writable = false;
  17122. }
  17123. function onCorkedFinish(corkReq, state, err) {
  17124. var entry = corkReq.entry;
  17125. corkReq.entry = null;
  17126. while (entry) {
  17127. var cb = entry.callback;
  17128. state.pendingcb--;
  17129. cb(err);
  17130. entry = entry.next;
  17131. }
  17132. if (state.corkedRequestsFree) {
  17133. state.corkedRequestsFree.next = corkReq;
  17134. } else {
  17135. state.corkedRequestsFree = corkReq;
  17136. }
  17137. }
  17138. Object.defineProperty(Writable.prototype, 'destroyed', {
  17139. get: function () {
  17140. if (this._writableState === undefined) {
  17141. return false;
  17142. }
  17143. return this._writableState.destroyed;
  17144. },
  17145. set: function (value) {
  17146. // we ignore the value if the stream
  17147. // has not been initialized yet
  17148. if (!this._writableState) {
  17149. return;
  17150. }
  17151. // backward compatibility, the user is explicitly
  17152. // managing destroyed
  17153. this._writableState.destroyed = value;
  17154. }
  17155. });
  17156. Writable.prototype.destroy = destroyImpl.destroy;
  17157. Writable.prototype._undestroy = destroyImpl.undestroy;
  17158. Writable.prototype._destroy = function (err, cb) {
  17159. this.end();
  17160. cb(err);
  17161. };
  17162. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/mock/process.js */ 46), __webpack_require__(/*! ./../../webpack/buildin/global.js */ 2)))
  17163. /***/ }),
  17164. /* 69 */
  17165. /*!************************************************!*\
  17166. !*** ./node_modules/util-deprecate/browser.js ***!
  17167. \************************************************/
  17168. /*! no static exports found */
  17169. /***/ (function(module, exports, __webpack_require__) {
  17170. /* WEBPACK VAR INJECTION */(function(global) {
  17171. /**
  17172. * Module exports.
  17173. */
  17174. module.exports = deprecate;
  17175. /**
  17176. * Mark that a method should not be used.
  17177. * Returns a modified function which warns once by default.
  17178. *
  17179. * If `localStorage.noDeprecation = true` is set, then it is a no-op.
  17180. *
  17181. * If `localStorage.throwDeprecation = true` is set, then deprecated functions
  17182. * will throw an Error when invoked.
  17183. *
  17184. * If `localStorage.traceDeprecation = true` is set, then deprecated functions
  17185. * will invoke `console.trace()` instead of `console.error()`.
  17186. *
  17187. * @param {Function} fn - the function to deprecate
  17188. * @param {String} msg - the string to print to the console when `fn` is invoked
  17189. * @returns {Function} a new "deprecated" version of `fn`
  17190. * @api public
  17191. */
  17192. function deprecate (fn, msg) {
  17193. if (config('noDeprecation')) {
  17194. return fn;
  17195. }
  17196. var warned = false;
  17197. function deprecated() {
  17198. if (!warned) {
  17199. if (config('throwDeprecation')) {
  17200. throw new Error(msg);
  17201. } else if (config('traceDeprecation')) {
  17202. console.trace(msg);
  17203. } else {
  17204. console.warn(msg);
  17205. }
  17206. warned = true;
  17207. }
  17208. return fn.apply(this, arguments);
  17209. }
  17210. return deprecated;
  17211. }
  17212. /**
  17213. * Checks `localStorage` for boolean values for the given `name`.
  17214. *
  17215. * @param {String} name
  17216. * @returns {Boolean}
  17217. * @api private
  17218. */
  17219. function config (name) {
  17220. // accessing global.localStorage can trigger a DOMException in sandboxed iframes
  17221. try {
  17222. if (!global.localStorage) return false;
  17223. } catch (_) {
  17224. return false;
  17225. }
  17226. var val = global.localStorage[name];
  17227. if (null == val) return false;
  17228. return String(val).toLowerCase() === 'true';
  17229. }
  17230. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ 2)))
  17231. /***/ }),
  17232. /* 70 */
  17233. /*!***********************************************************!*\
  17234. !*** ./node_modules/string_decoder/lib/string_decoder.js ***!
  17235. \***********************************************************/
  17236. /*! no static exports found */
  17237. /***/ (function(module, exports, __webpack_require__) {
  17238. "use strict";
  17239. // Copyright Joyent, Inc. and other Node contributors.
  17240. //
  17241. // Permission is hereby granted, free of charge, to any person obtaining a
  17242. // copy of this software and associated documentation files (the
  17243. // "Software"), to deal in the Software without restriction, including
  17244. // without limitation the rights to use, copy, modify, merge, publish,
  17245. // distribute, sublicense, and/or sell copies of the Software, and to permit
  17246. // persons to whom the Software is furnished to do so, subject to the
  17247. // following conditions:
  17248. //
  17249. // The above copyright notice and this permission notice shall be included
  17250. // in all copies or substantial portions of the Software.
  17251. //
  17252. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  17253. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  17254. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  17255. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  17256. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  17257. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  17258. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  17259. /*<replacement>*/
  17260. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer;
  17261. /*</replacement>*/
  17262. var isEncoding = Buffer.isEncoding || function (encoding) {
  17263. encoding = '' + encoding;
  17264. switch (encoding && encoding.toLowerCase()) {
  17265. case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
  17266. return true;
  17267. default:
  17268. return false;
  17269. }
  17270. };
  17271. function _normalizeEncoding(enc) {
  17272. if (!enc) return 'utf8';
  17273. var retried;
  17274. while (true) {
  17275. switch (enc) {
  17276. case 'utf8':
  17277. case 'utf-8':
  17278. return 'utf8';
  17279. case 'ucs2':
  17280. case 'ucs-2':
  17281. case 'utf16le':
  17282. case 'utf-16le':
  17283. return 'utf16le';
  17284. case 'latin1':
  17285. case 'binary':
  17286. return 'latin1';
  17287. case 'base64':
  17288. case 'ascii':
  17289. case 'hex':
  17290. return enc;
  17291. default:
  17292. if (retried) return; // undefined
  17293. enc = ('' + enc).toLowerCase();
  17294. retried = true;
  17295. }
  17296. }
  17297. };
  17298. // Do not cache `Buffer.isEncoding` when checking encoding names as some
  17299. // modules monkey-patch it to support additional encodings
  17300. function normalizeEncoding(enc) {
  17301. var nenc = _normalizeEncoding(enc);
  17302. if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
  17303. return nenc || enc;
  17304. }
  17305. // StringDecoder provides an interface for efficiently splitting a series of
  17306. // buffers into a series of JS strings without breaking apart multi-byte
  17307. // characters.
  17308. exports.StringDecoder = StringDecoder;
  17309. function StringDecoder(encoding) {
  17310. this.encoding = normalizeEncoding(encoding);
  17311. var nb;
  17312. switch (this.encoding) {
  17313. case 'utf16le':
  17314. this.text = utf16Text;
  17315. this.end = utf16End;
  17316. nb = 4;
  17317. break;
  17318. case 'utf8':
  17319. this.fillLast = utf8FillLast;
  17320. nb = 4;
  17321. break;
  17322. case 'base64':
  17323. this.text = base64Text;
  17324. this.end = base64End;
  17325. nb = 3;
  17326. break;
  17327. default:
  17328. this.write = simpleWrite;
  17329. this.end = simpleEnd;
  17330. return;
  17331. }
  17332. this.lastNeed = 0;
  17333. this.lastTotal = 0;
  17334. this.lastChar = Buffer.allocUnsafe(nb);
  17335. }
  17336. StringDecoder.prototype.write = function (buf) {
  17337. if (buf.length === 0) return '';
  17338. var r;
  17339. var i;
  17340. if (this.lastNeed) {
  17341. r = this.fillLast(buf);
  17342. if (r === undefined) return '';
  17343. i = this.lastNeed;
  17344. this.lastNeed = 0;
  17345. } else {
  17346. i = 0;
  17347. }
  17348. if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
  17349. return r || '';
  17350. };
  17351. StringDecoder.prototype.end = utf8End;
  17352. // Returns only complete characters in a Buffer
  17353. StringDecoder.prototype.text = utf8Text;
  17354. // Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
  17355. StringDecoder.prototype.fillLast = function (buf) {
  17356. if (this.lastNeed <= buf.length) {
  17357. buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
  17358. return this.lastChar.toString(this.encoding, 0, this.lastTotal);
  17359. }
  17360. buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
  17361. this.lastNeed -= buf.length;
  17362. };
  17363. // Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
  17364. // continuation byte. If an invalid byte is detected, -2 is returned.
  17365. function utf8CheckByte(byte) {
  17366. if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
  17367. return byte >> 6 === 0x02 ? -1 : -2;
  17368. }
  17369. // Checks at most 3 bytes at the end of a Buffer in order to detect an
  17370. // incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
  17371. // needed to complete the UTF-8 character (if applicable) are returned.
  17372. function utf8CheckIncomplete(self, buf, i) {
  17373. var j = buf.length - 1;
  17374. if (j < i) return 0;
  17375. var nb = utf8CheckByte(buf[j]);
  17376. if (nb >= 0) {
  17377. if (nb > 0) self.lastNeed = nb - 1;
  17378. return nb;
  17379. }
  17380. if (--j < i || nb === -2) return 0;
  17381. nb = utf8CheckByte(buf[j]);
  17382. if (nb >= 0) {
  17383. if (nb > 0) self.lastNeed = nb - 2;
  17384. return nb;
  17385. }
  17386. if (--j < i || nb === -2) return 0;
  17387. nb = utf8CheckByte(buf[j]);
  17388. if (nb >= 0) {
  17389. if (nb > 0) {
  17390. if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
  17391. }
  17392. return nb;
  17393. }
  17394. return 0;
  17395. }
  17396. // Validates as many continuation bytes for a multi-byte UTF-8 character as
  17397. // needed or are available. If we see a non-continuation byte where we expect
  17398. // one, we "replace" the validated continuation bytes we've seen so far with
  17399. // a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
  17400. // behavior. The continuation byte check is included three times in the case
  17401. // where all of the continuation bytes for a character exist in the same buffer.
  17402. // It is also done this way as a slight performance increase instead of using a
  17403. // loop.
  17404. function utf8CheckExtraBytes(self, buf, p) {
  17405. if ((buf[0] & 0xC0) !== 0x80) {
  17406. self.lastNeed = 0;
  17407. return '\ufffd';
  17408. }
  17409. if (self.lastNeed > 1 && buf.length > 1) {
  17410. if ((buf[1] & 0xC0) !== 0x80) {
  17411. self.lastNeed = 1;
  17412. return '\ufffd';
  17413. }
  17414. if (self.lastNeed > 2 && buf.length > 2) {
  17415. if ((buf[2] & 0xC0) !== 0x80) {
  17416. self.lastNeed = 2;
  17417. return '\ufffd';
  17418. }
  17419. }
  17420. }
  17421. }
  17422. // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
  17423. function utf8FillLast(buf) {
  17424. var p = this.lastTotal - this.lastNeed;
  17425. var r = utf8CheckExtraBytes(this, buf, p);
  17426. if (r !== undefined) return r;
  17427. if (this.lastNeed <= buf.length) {
  17428. buf.copy(this.lastChar, p, 0, this.lastNeed);
  17429. return this.lastChar.toString(this.encoding, 0, this.lastTotal);
  17430. }
  17431. buf.copy(this.lastChar, p, 0, buf.length);
  17432. this.lastNeed -= buf.length;
  17433. }
  17434. // Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
  17435. // partial character, the character's bytes are buffered until the required
  17436. // number of bytes are available.
  17437. function utf8Text(buf, i) {
  17438. var total = utf8CheckIncomplete(this, buf, i);
  17439. if (!this.lastNeed) return buf.toString('utf8', i);
  17440. this.lastTotal = total;
  17441. var end = buf.length - (total - this.lastNeed);
  17442. buf.copy(this.lastChar, 0, end);
  17443. return buf.toString('utf8', i, end);
  17444. }
  17445. // For UTF-8, a replacement character is added when ending on a partial
  17446. // character.
  17447. function utf8End(buf) {
  17448. var r = buf && buf.length ? this.write(buf) : '';
  17449. if (this.lastNeed) return r + '\ufffd';
  17450. return r;
  17451. }
  17452. // UTF-16LE typically needs two bytes per character, but even if we have an even
  17453. // number of bytes available, we need to check if we end on a leading/high
  17454. // surrogate. In that case, we need to wait for the next two bytes in order to
  17455. // decode the last character properly.
  17456. function utf16Text(buf, i) {
  17457. if ((buf.length - i) % 2 === 0) {
  17458. var r = buf.toString('utf16le', i);
  17459. if (r) {
  17460. var c = r.charCodeAt(r.length - 1);
  17461. if (c >= 0xD800 && c <= 0xDBFF) {
  17462. this.lastNeed = 2;
  17463. this.lastTotal = 4;
  17464. this.lastChar[0] = buf[buf.length - 2];
  17465. this.lastChar[1] = buf[buf.length - 1];
  17466. return r.slice(0, -1);
  17467. }
  17468. }
  17469. return r;
  17470. }
  17471. this.lastNeed = 1;
  17472. this.lastTotal = 2;
  17473. this.lastChar[0] = buf[buf.length - 1];
  17474. return buf.toString('utf16le', i, buf.length - 1);
  17475. }
  17476. // For UTF-16LE we do not explicitly append special replacement characters if we
  17477. // end on a partial character, we simply let v8 handle that.
  17478. function utf16End(buf) {
  17479. var r = buf && buf.length ? this.write(buf) : '';
  17480. if (this.lastNeed) {
  17481. var end = this.lastTotal - this.lastNeed;
  17482. return r + this.lastChar.toString('utf16le', 0, end);
  17483. }
  17484. return r;
  17485. }
  17486. function base64Text(buf, i) {
  17487. var n = (buf.length - i) % 3;
  17488. if (n === 0) return buf.toString('base64', i);
  17489. this.lastNeed = 3 - n;
  17490. this.lastTotal = 3;
  17491. if (n === 1) {
  17492. this.lastChar[0] = buf[buf.length - 1];
  17493. } else {
  17494. this.lastChar[0] = buf[buf.length - 2];
  17495. this.lastChar[1] = buf[buf.length - 1];
  17496. }
  17497. return buf.toString('base64', i, buf.length - n);
  17498. }
  17499. function base64End(buf) {
  17500. var r = buf && buf.length ? this.write(buf) : '';
  17501. if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
  17502. return r;
  17503. }
  17504. // Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
  17505. function simpleWrite(buf) {
  17506. return buf.toString(this.encoding);
  17507. }
  17508. function simpleEnd(buf) {
  17509. return buf && buf.length ? this.write(buf) : '';
  17510. }
  17511. /***/ }),
  17512. /* 71 */
  17513. /*!***************************************************************!*\
  17514. !*** ./node_modules/readable-stream/lib/_stream_transform.js ***!
  17515. \***************************************************************/
  17516. /*! no static exports found */
  17517. /***/ (function(module, exports, __webpack_require__) {
  17518. "use strict";
  17519. // Copyright Joyent, Inc. and other Node contributors.
  17520. //
  17521. // Permission is hereby granted, free of charge, to any person obtaining a
  17522. // copy of this software and associated documentation files (the
  17523. // "Software"), to deal in the Software without restriction, including
  17524. // without limitation the rights to use, copy, modify, merge, publish,
  17525. // distribute, sublicense, and/or sell copies of the Software, and to permit
  17526. // persons to whom the Software is furnished to do so, subject to the
  17527. // following conditions:
  17528. //
  17529. // The above copyright notice and this permission notice shall be included
  17530. // in all copies or substantial portions of the Software.
  17531. //
  17532. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  17533. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  17534. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  17535. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  17536. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  17537. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  17538. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  17539. // a transform stream is a readable/writable stream where you do
  17540. // something with the data. Sometimes it's called a "filter",
  17541. // but that's not a great name for it, since that implies a thing where
  17542. // some bits pass through, and others are simply ignored. (That would
  17543. // be a valid example of a transform, of course.)
  17544. //
  17545. // While the output is causally related to the input, it's not a
  17546. // necessarily symmetric or synchronous transformation. For example,
  17547. // a zlib stream might take multiple plain-text writes(), and then
  17548. // emit a single compressed chunk some time in the future.
  17549. //
  17550. // Here's how this works:
  17551. //
  17552. // The Transform stream has all the aspects of the readable and writable
  17553. // stream classes. When you write(chunk), that calls _write(chunk,cb)
  17554. // internally, and returns false if there's a lot of pending writes
  17555. // buffered up. When you call read(), that calls _read(n) until
  17556. // there's enough pending readable data buffered up.
  17557. //
  17558. // In a transform stream, the written data is placed in a buffer. When
  17559. // _read(n) is called, it transforms the queued up data, calling the
  17560. // buffered _write cb's as it consumes chunks. If consuming a single
  17561. // written chunk would result in multiple output chunks, then the first
  17562. // outputted bit calls the readcb, and subsequent chunks just go into
  17563. // the read buffer, and will cause it to emit 'readable' if necessary.
  17564. //
  17565. // This way, back-pressure is actually determined by the reading side,
  17566. // since _read has to be called to start processing a new chunk. However,
  17567. // a pathological inflate type of transform can cause excessive buffering
  17568. // here. For example, imagine a stream where every byte of input is
  17569. // interpreted as an integer from 0-255, and then results in that many
  17570. // bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
  17571. // 1kb of data being output. In this case, you could write a very small
  17572. // amount of input, and end up with a very large amount of output. In
  17573. // such a pathological inflating mechanism, there'd be no way to tell
  17574. // the system to stop doing the transform. A single 4MB write could
  17575. // cause the system to run out of memory.
  17576. //
  17577. // However, even in such a pathological case, only a single written chunk
  17578. // would be consumed, and then the rest would wait (un-transformed) until
  17579. // the results of the previous transformed chunk were consumed.
  17580. module.exports = Transform;
  17581. var Duplex = __webpack_require__(/*! ./_stream_duplex */ 67);
  17582. /*<replacement>*/
  17583. var util = Object.create(__webpack_require__(/*! core-util-is */ 62));
  17584. util.inherits = __webpack_require__(/*! inherits */ 54);
  17585. /*</replacement>*/
  17586. util.inherits(Transform, Duplex);
  17587. function afterTransform(er, data) {
  17588. var ts = this._transformState;
  17589. ts.transforming = false;
  17590. var cb = ts.writecb;
  17591. if (!cb) {
  17592. return this.emit('error', new Error('write callback called multiple times'));
  17593. }
  17594. ts.writechunk = null;
  17595. ts.writecb = null;
  17596. if (data != null) // single equals check for both `null` and `undefined`
  17597. this.push(data);
  17598. cb(er);
  17599. var rs = this._readableState;
  17600. rs.reading = false;
  17601. if (rs.needReadable || rs.length < rs.highWaterMark) {
  17602. this._read(rs.highWaterMark);
  17603. }
  17604. }
  17605. function Transform(options) {
  17606. if (!(this instanceof Transform)) return new Transform(options);
  17607. Duplex.call(this, options);
  17608. this._transformState = {
  17609. afterTransform: afterTransform.bind(this),
  17610. needTransform: false,
  17611. transforming: false,
  17612. writecb: null,
  17613. writechunk: null,
  17614. writeencoding: null
  17615. };
  17616. // start out asking for a readable event once data is transformed.
  17617. this._readableState.needReadable = true;
  17618. // we have implemented the _read method, and done the other things
  17619. // that Readable wants before the first _read call, so unset the
  17620. // sync guard flag.
  17621. this._readableState.sync = false;
  17622. if (options) {
  17623. if (typeof options.transform === 'function') this._transform = options.transform;
  17624. if (typeof options.flush === 'function') this._flush = options.flush;
  17625. }
  17626. // When the writable side finishes, then flush out anything remaining.
  17627. this.on('prefinish', prefinish);
  17628. }
  17629. function prefinish() {
  17630. var _this = this;
  17631. if (typeof this._flush === 'function') {
  17632. this._flush(function (er, data) {
  17633. done(_this, er, data);
  17634. });
  17635. } else {
  17636. done(this, null, null);
  17637. }
  17638. }
  17639. Transform.prototype.push = function (chunk, encoding) {
  17640. this._transformState.needTransform = false;
  17641. return Duplex.prototype.push.call(this, chunk, encoding);
  17642. };
  17643. // This is the part where you do stuff!
  17644. // override this function in implementation classes.
  17645. // 'chunk' is an input chunk.
  17646. //
  17647. // Call `push(newChunk)` to pass along transformed output
  17648. // to the readable side. You may call 'push' zero or more times.
  17649. //
  17650. // Call `cb(err)` when you are done with this chunk. If you pass
  17651. // an error, then that'll put the hurt on the whole operation. If you
  17652. // never call cb(), then you'll never get another chunk.
  17653. Transform.prototype._transform = function (chunk, encoding, cb) {
  17654. throw new Error('_transform() is not implemented');
  17655. };
  17656. Transform.prototype._write = function (chunk, encoding, cb) {
  17657. var ts = this._transformState;
  17658. ts.writecb = cb;
  17659. ts.writechunk = chunk;
  17660. ts.writeencoding = encoding;
  17661. if (!ts.transforming) {
  17662. var rs = this._readableState;
  17663. if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
  17664. }
  17665. };
  17666. // Doesn't matter what the args are here.
  17667. // _transform does all the work.
  17668. // That we got here means that the readable side wants more data.
  17669. Transform.prototype._read = function (n) {
  17670. var ts = this._transformState;
  17671. if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
  17672. ts.transforming = true;
  17673. this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
  17674. } else {
  17675. // mark that we need a transform, so that any data that comes in
  17676. // will get processed, now that we've asked for it.
  17677. ts.needTransform = true;
  17678. }
  17679. };
  17680. Transform.prototype._destroy = function (err, cb) {
  17681. var _this2 = this;
  17682. Duplex.prototype._destroy.call(this, err, function (err2) {
  17683. cb(err2);
  17684. _this2.emit('close');
  17685. });
  17686. };
  17687. function done(stream, er, data) {
  17688. if (er) return stream.emit('error', er);
  17689. if (data != null) // single equals check for both `null` and `undefined`
  17690. stream.push(data);
  17691. // if there's nothing in the write buffer, then that means
  17692. // that nothing more will ever be provided
  17693. if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');
  17694. if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');
  17695. return stream.push(null);
  17696. }
  17697. /***/ }),
  17698. /* 72 */
  17699. /*!*****************************************************************!*\
  17700. !*** ./node_modules/readable-stream/lib/_stream_passthrough.js ***!
  17701. \*****************************************************************/
  17702. /*! no static exports found */
  17703. /***/ (function(module, exports, __webpack_require__) {
  17704. "use strict";
  17705. // Copyright Joyent, Inc. and other Node contributors.
  17706. //
  17707. // Permission is hereby granted, free of charge, to any person obtaining a
  17708. // copy of this software and associated documentation files (the
  17709. // "Software"), to deal in the Software without restriction, including
  17710. // without limitation the rights to use, copy, modify, merge, publish,
  17711. // distribute, sublicense, and/or sell copies of the Software, and to permit
  17712. // persons to whom the Software is furnished to do so, subject to the
  17713. // following conditions:
  17714. //
  17715. // The above copyright notice and this permission notice shall be included
  17716. // in all copies or substantial portions of the Software.
  17717. //
  17718. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  17719. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  17720. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  17721. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  17722. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  17723. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  17724. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  17725. // a passthrough stream.
  17726. // basically just the most minimal sort of Transform stream.
  17727. // Every written chunk gets output as-is.
  17728. module.exports = PassThrough;
  17729. var Transform = __webpack_require__(/*! ./_stream_transform */ 71);
  17730. /*<replacement>*/
  17731. var util = Object.create(__webpack_require__(/*! core-util-is */ 62));
  17732. util.inherits = __webpack_require__(/*! inherits */ 54);
  17733. /*</replacement>*/
  17734. util.inherits(PassThrough, Transform);
  17735. function PassThrough(options) {
  17736. if (!(this instanceof PassThrough)) return new PassThrough(options);
  17737. Transform.call(this, options);
  17738. }
  17739. PassThrough.prototype._transform = function (chunk, encoding, cb) {
  17740. cb(null, chunk);
  17741. };
  17742. /***/ }),
  17743. /* 73 */
  17744. /*!*****************************************!*\
  17745. !*** ./node_modules/ripemd160/index.js ***!
  17746. \*****************************************/
  17747. /*! no static exports found */
  17748. /***/ (function(module, exports, __webpack_require__) {
  17749. "use strict";
  17750. var Buffer = __webpack_require__(/*! buffer */ 49).Buffer
  17751. var inherits = __webpack_require__(/*! inherits */ 54)
  17752. var HashBase = __webpack_require__(/*! hash-base */ 56)
  17753. var ARRAY16 = new Array(16)
  17754. var zl = [
  17755. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  17756. 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
  17757. 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
  17758. 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
  17759. 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13
  17760. ]
  17761. var zr = [
  17762. 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
  17763. 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
  17764. 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
  17765. 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
  17766. 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11
  17767. ]
  17768. var sl = [
  17769. 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
  17770. 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
  17771. 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
  17772. 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
  17773. 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6
  17774. ]
  17775. var sr = [
  17776. 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
  17777. 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
  17778. 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
  17779. 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
  17780. 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11
  17781. ]
  17782. var hl = [0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e]
  17783. var hr = [0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000]
  17784. function RIPEMD160 () {
  17785. HashBase.call(this, 64)
  17786. // state
  17787. this._a = 0x67452301
  17788. this._b = 0xefcdab89
  17789. this._c = 0x98badcfe
  17790. this._d = 0x10325476
  17791. this._e = 0xc3d2e1f0
  17792. }
  17793. inherits(RIPEMD160, HashBase)
  17794. RIPEMD160.prototype._update = function () {
  17795. var words = ARRAY16
  17796. for (var j = 0; j < 16; ++j) words[j] = this._block.readInt32LE(j * 4)
  17797. var al = this._a | 0
  17798. var bl = this._b | 0
  17799. var cl = this._c | 0
  17800. var dl = this._d | 0
  17801. var el = this._e | 0
  17802. var ar = this._a | 0
  17803. var br = this._b | 0
  17804. var cr = this._c | 0
  17805. var dr = this._d | 0
  17806. var er = this._e | 0
  17807. // computation
  17808. for (var i = 0; i < 80; i += 1) {
  17809. var tl
  17810. var tr
  17811. if (i < 16) {
  17812. tl = fn1(al, bl, cl, dl, el, words[zl[i]], hl[0], sl[i])
  17813. tr = fn5(ar, br, cr, dr, er, words[zr[i]], hr[0], sr[i])
  17814. } else if (i < 32) {
  17815. tl = fn2(al, bl, cl, dl, el, words[zl[i]], hl[1], sl[i])
  17816. tr = fn4(ar, br, cr, dr, er, words[zr[i]], hr[1], sr[i])
  17817. } else if (i < 48) {
  17818. tl = fn3(al, bl, cl, dl, el, words[zl[i]], hl[2], sl[i])
  17819. tr = fn3(ar, br, cr, dr, er, words[zr[i]], hr[2], sr[i])
  17820. } else if (i < 64) {
  17821. tl = fn4(al, bl, cl, dl, el, words[zl[i]], hl[3], sl[i])
  17822. tr = fn2(ar, br, cr, dr, er, words[zr[i]], hr[3], sr[i])
  17823. } else { // if (i<80) {
  17824. tl = fn5(al, bl, cl, dl, el, words[zl[i]], hl[4], sl[i])
  17825. tr = fn1(ar, br, cr, dr, er, words[zr[i]], hr[4], sr[i])
  17826. }
  17827. al = el
  17828. el = dl
  17829. dl = rotl(cl, 10)
  17830. cl = bl
  17831. bl = tl
  17832. ar = er
  17833. er = dr
  17834. dr = rotl(cr, 10)
  17835. cr = br
  17836. br = tr
  17837. }
  17838. // update state
  17839. var t = (this._b + cl + dr) | 0
  17840. this._b = (this._c + dl + er) | 0
  17841. this._c = (this._d + el + ar) | 0
  17842. this._d = (this._e + al + br) | 0
  17843. this._e = (this._a + bl + cr) | 0
  17844. this._a = t
  17845. }
  17846. RIPEMD160.prototype._digest = function () {
  17847. // create padding and handle blocks
  17848. this._block[this._blockOffset++] = 0x80
  17849. if (this._blockOffset > 56) {
  17850. this._block.fill(0, this._blockOffset, 64)
  17851. this._update()
  17852. this._blockOffset = 0
  17853. }
  17854. this._block.fill(0, this._blockOffset, 56)
  17855. this._block.writeUInt32LE(this._length[0], 56)
  17856. this._block.writeUInt32LE(this._length[1], 60)
  17857. this._update()
  17858. // produce result
  17859. var buffer = Buffer.alloc ? Buffer.alloc(20) : new Buffer(20)
  17860. buffer.writeInt32LE(this._a, 0)
  17861. buffer.writeInt32LE(this._b, 4)
  17862. buffer.writeInt32LE(this._c, 8)
  17863. buffer.writeInt32LE(this._d, 12)
  17864. buffer.writeInt32LE(this._e, 16)
  17865. return buffer
  17866. }
  17867. function rotl (x, n) {
  17868. return (x << n) | (x >>> (32 - n))
  17869. }
  17870. function fn1 (a, b, c, d, e, m, k, s) {
  17871. return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + e) | 0
  17872. }
  17873. function fn2 (a, b, c, d, e, m, k, s) {
  17874. return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + e) | 0
  17875. }
  17876. function fn3 (a, b, c, d, e, m, k, s) {
  17877. return (rotl((a + ((b | (~c)) ^ d) + m + k) | 0, s) + e) | 0
  17878. }
  17879. function fn4 (a, b, c, d, e, m, k, s) {
  17880. return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + e) | 0
  17881. }
  17882. function fn5 (a, b, c, d, e, m, k, s) {
  17883. return (rotl((a + (b ^ (c | (~d))) + m + k) | 0, s) + e) | 0
  17884. }
  17885. module.exports = RIPEMD160
  17886. /***/ }),
  17887. /* 74 */
  17888. /*!**************************************!*\
  17889. !*** ./node_modules/sha.js/index.js ***!
  17890. \**************************************/
  17891. /*! no static exports found */
  17892. /***/ (function(module, exports, __webpack_require__) {
  17893. var exports = module.exports = function SHA (algorithm) {
  17894. algorithm = algorithm.toLowerCase()
  17895. var Algorithm = exports[algorithm]
  17896. if (!Algorithm) throw new Error(algorithm + ' is not supported (we accept pull requests)')
  17897. return new Algorithm()
  17898. }
  17899. exports.sha = __webpack_require__(/*! ./sha */ 75)
  17900. exports.sha1 = __webpack_require__(/*! ./sha1 */ 77)
  17901. exports.sha224 = __webpack_require__(/*! ./sha224 */ 78)
  17902. exports.sha256 = __webpack_require__(/*! ./sha256 */ 79)
  17903. exports.sha384 = __webpack_require__(/*! ./sha384 */ 80)
  17904. exports.sha512 = __webpack_require__(/*! ./sha512 */ 81)
  17905. /***/ }),
  17906. /* 75 */
  17907. /*!************************************!*\
  17908. !*** ./node_modules/sha.js/sha.js ***!
  17909. \************************************/
  17910. /*! no static exports found */
  17911. /***/ (function(module, exports, __webpack_require__) {
  17912. /*
  17913. * A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined
  17914. * in FIPS PUB 180-1
  17915. * This source code is derived from sha1.js of the same repository.
  17916. * The difference between SHA-0 and SHA-1 is just a bitwise rotate left
  17917. * operation was added.
  17918. */
  17919. var inherits = __webpack_require__(/*! inherits */ 54)
  17920. var Hash = __webpack_require__(/*! ./hash */ 76)
  17921. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  17922. var K = [
  17923. 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0
  17924. ]
  17925. var W = new Array(80)
  17926. function Sha () {
  17927. this.init()
  17928. this._w = W
  17929. Hash.call(this, 64, 56)
  17930. }
  17931. inherits(Sha, Hash)
  17932. Sha.prototype.init = function () {
  17933. this._a = 0x67452301
  17934. this._b = 0xefcdab89
  17935. this._c = 0x98badcfe
  17936. this._d = 0x10325476
  17937. this._e = 0xc3d2e1f0
  17938. return this
  17939. }
  17940. function rotl5 (num) {
  17941. return (num << 5) | (num >>> 27)
  17942. }
  17943. function rotl30 (num) {
  17944. return (num << 30) | (num >>> 2)
  17945. }
  17946. function ft (s, b, c, d) {
  17947. if (s === 0) return (b & c) | ((~b) & d)
  17948. if (s === 2) return (b & c) | (b & d) | (c & d)
  17949. return b ^ c ^ d
  17950. }
  17951. Sha.prototype._update = function (M) {
  17952. var W = this._w
  17953. var a = this._a | 0
  17954. var b = this._b | 0
  17955. var c = this._c | 0
  17956. var d = this._d | 0
  17957. var e = this._e | 0
  17958. for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
  17959. for (; i < 80; ++i) W[i] = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]
  17960. for (var j = 0; j < 80; ++j) {
  17961. var s = ~~(j / 20)
  17962. var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0
  17963. e = d
  17964. d = c
  17965. c = rotl30(b)
  17966. b = a
  17967. a = t
  17968. }
  17969. this._a = (a + this._a) | 0
  17970. this._b = (b + this._b) | 0
  17971. this._c = (c + this._c) | 0
  17972. this._d = (d + this._d) | 0
  17973. this._e = (e + this._e) | 0
  17974. }
  17975. Sha.prototype._hash = function () {
  17976. var H = Buffer.allocUnsafe(20)
  17977. H.writeInt32BE(this._a | 0, 0)
  17978. H.writeInt32BE(this._b | 0, 4)
  17979. H.writeInt32BE(this._c | 0, 8)
  17980. H.writeInt32BE(this._d | 0, 12)
  17981. H.writeInt32BE(this._e | 0, 16)
  17982. return H
  17983. }
  17984. module.exports = Sha
  17985. /***/ }),
  17986. /* 76 */
  17987. /*!*************************************!*\
  17988. !*** ./node_modules/sha.js/hash.js ***!
  17989. \*************************************/
  17990. /*! no static exports found */
  17991. /***/ (function(module, exports, __webpack_require__) {
  17992. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  17993. // prototype class for hash functions
  17994. function Hash (blockSize, finalSize) {
  17995. this._block = Buffer.alloc(blockSize)
  17996. this._finalSize = finalSize
  17997. this._blockSize = blockSize
  17998. this._len = 0
  17999. }
  18000. Hash.prototype.update = function (data, enc) {
  18001. if (typeof data === 'string') {
  18002. enc = enc || 'utf8'
  18003. data = Buffer.from(data, enc)
  18004. }
  18005. var block = this._block
  18006. var blockSize = this._blockSize
  18007. var length = data.length
  18008. var accum = this._len
  18009. for (var offset = 0; offset < length;) {
  18010. var assigned = accum % blockSize
  18011. var remainder = Math.min(length - offset, blockSize - assigned)
  18012. for (var i = 0; i < remainder; i++) {
  18013. block[assigned + i] = data[offset + i]
  18014. }
  18015. accum += remainder
  18016. offset += remainder
  18017. if ((accum % blockSize) === 0) {
  18018. this._update(block)
  18019. }
  18020. }
  18021. this._len += length
  18022. return this
  18023. }
  18024. Hash.prototype.digest = function (enc) {
  18025. var rem = this._len % this._blockSize
  18026. this._block[rem] = 0x80
  18027. // zero (rem + 1) trailing bits, where (rem + 1) is the smallest
  18028. // non-negative solution to the equation (length + 1 + (rem + 1)) === finalSize mod blockSize
  18029. this._block.fill(0, rem + 1)
  18030. if (rem >= this._finalSize) {
  18031. this._update(this._block)
  18032. this._block.fill(0)
  18033. }
  18034. var bits = this._len * 8
  18035. // uint32
  18036. if (bits <= 0xffffffff) {
  18037. this._block.writeUInt32BE(bits, this._blockSize - 4)
  18038. // uint64
  18039. } else {
  18040. var lowBits = (bits & 0xffffffff) >>> 0
  18041. var highBits = (bits - lowBits) / 0x100000000
  18042. this._block.writeUInt32BE(highBits, this._blockSize - 8)
  18043. this._block.writeUInt32BE(lowBits, this._blockSize - 4)
  18044. }
  18045. this._update(this._block)
  18046. var hash = this._hash()
  18047. return enc ? hash.toString(enc) : hash
  18048. }
  18049. Hash.prototype._update = function () {
  18050. throw new Error('_update must be implemented by subclass')
  18051. }
  18052. module.exports = Hash
  18053. /***/ }),
  18054. /* 77 */
  18055. /*!*************************************!*\
  18056. !*** ./node_modules/sha.js/sha1.js ***!
  18057. \*************************************/
  18058. /*! no static exports found */
  18059. /***/ (function(module, exports, __webpack_require__) {
  18060. /*
  18061. * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
  18062. * in FIPS PUB 180-1
  18063. * Version 2.1a Copyright Paul Johnston 2000 - 2002.
  18064. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
  18065. * Distributed under the BSD License
  18066. * See http://pajhome.org.uk/crypt/md5 for details.
  18067. */
  18068. var inherits = __webpack_require__(/*! inherits */ 54)
  18069. var Hash = __webpack_require__(/*! ./hash */ 76)
  18070. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  18071. var K = [
  18072. 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0
  18073. ]
  18074. var W = new Array(80)
  18075. function Sha1 () {
  18076. this.init()
  18077. this._w = W
  18078. Hash.call(this, 64, 56)
  18079. }
  18080. inherits(Sha1, Hash)
  18081. Sha1.prototype.init = function () {
  18082. this._a = 0x67452301
  18083. this._b = 0xefcdab89
  18084. this._c = 0x98badcfe
  18085. this._d = 0x10325476
  18086. this._e = 0xc3d2e1f0
  18087. return this
  18088. }
  18089. function rotl1 (num) {
  18090. return (num << 1) | (num >>> 31)
  18091. }
  18092. function rotl5 (num) {
  18093. return (num << 5) | (num >>> 27)
  18094. }
  18095. function rotl30 (num) {
  18096. return (num << 30) | (num >>> 2)
  18097. }
  18098. function ft (s, b, c, d) {
  18099. if (s === 0) return (b & c) | ((~b) & d)
  18100. if (s === 2) return (b & c) | (b & d) | (c & d)
  18101. return b ^ c ^ d
  18102. }
  18103. Sha1.prototype._update = function (M) {
  18104. var W = this._w
  18105. var a = this._a | 0
  18106. var b = this._b | 0
  18107. var c = this._c | 0
  18108. var d = this._d | 0
  18109. var e = this._e | 0
  18110. for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
  18111. for (; i < 80; ++i) W[i] = rotl1(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16])
  18112. for (var j = 0; j < 80; ++j) {
  18113. var s = ~~(j / 20)
  18114. var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0
  18115. e = d
  18116. d = c
  18117. c = rotl30(b)
  18118. b = a
  18119. a = t
  18120. }
  18121. this._a = (a + this._a) | 0
  18122. this._b = (b + this._b) | 0
  18123. this._c = (c + this._c) | 0
  18124. this._d = (d + this._d) | 0
  18125. this._e = (e + this._e) | 0
  18126. }
  18127. Sha1.prototype._hash = function () {
  18128. var H = Buffer.allocUnsafe(20)
  18129. H.writeInt32BE(this._a | 0, 0)
  18130. H.writeInt32BE(this._b | 0, 4)
  18131. H.writeInt32BE(this._c | 0, 8)
  18132. H.writeInt32BE(this._d | 0, 12)
  18133. H.writeInt32BE(this._e | 0, 16)
  18134. return H
  18135. }
  18136. module.exports = Sha1
  18137. /***/ }),
  18138. /* 78 */
  18139. /*!***************************************!*\
  18140. !*** ./node_modules/sha.js/sha224.js ***!
  18141. \***************************************/
  18142. /*! no static exports found */
  18143. /***/ (function(module, exports, __webpack_require__) {
  18144. /**
  18145. * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
  18146. * in FIPS 180-2
  18147. * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
  18148. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
  18149. *
  18150. */
  18151. var inherits = __webpack_require__(/*! inherits */ 54)
  18152. var Sha256 = __webpack_require__(/*! ./sha256 */ 79)
  18153. var Hash = __webpack_require__(/*! ./hash */ 76)
  18154. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  18155. var W = new Array(64)
  18156. function Sha224 () {
  18157. this.init()
  18158. this._w = W // new Array(64)
  18159. Hash.call(this, 64, 56)
  18160. }
  18161. inherits(Sha224, Sha256)
  18162. Sha224.prototype.init = function () {
  18163. this._a = 0xc1059ed8
  18164. this._b = 0x367cd507
  18165. this._c = 0x3070dd17
  18166. this._d = 0xf70e5939
  18167. this._e = 0xffc00b31
  18168. this._f = 0x68581511
  18169. this._g = 0x64f98fa7
  18170. this._h = 0xbefa4fa4
  18171. return this
  18172. }
  18173. Sha224.prototype._hash = function () {
  18174. var H = Buffer.allocUnsafe(28)
  18175. H.writeInt32BE(this._a, 0)
  18176. H.writeInt32BE(this._b, 4)
  18177. H.writeInt32BE(this._c, 8)
  18178. H.writeInt32BE(this._d, 12)
  18179. H.writeInt32BE(this._e, 16)
  18180. H.writeInt32BE(this._f, 20)
  18181. H.writeInt32BE(this._g, 24)
  18182. return H
  18183. }
  18184. module.exports = Sha224
  18185. /***/ }),
  18186. /* 79 */
  18187. /*!***************************************!*\
  18188. !*** ./node_modules/sha.js/sha256.js ***!
  18189. \***************************************/
  18190. /*! no static exports found */
  18191. /***/ (function(module, exports, __webpack_require__) {
  18192. /**
  18193. * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
  18194. * in FIPS 180-2
  18195. * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
  18196. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
  18197. *
  18198. */
  18199. var inherits = __webpack_require__(/*! inherits */ 54)
  18200. var Hash = __webpack_require__(/*! ./hash */ 76)
  18201. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  18202. var K = [
  18203. 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,
  18204. 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,
  18205. 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,
  18206. 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,
  18207. 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,
  18208. 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,
  18209. 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,
  18210. 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,
  18211. 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,
  18212. 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,
  18213. 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,
  18214. 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,
  18215. 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,
  18216. 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,
  18217. 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,
  18218. 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2
  18219. ]
  18220. var W = new Array(64)
  18221. function Sha256 () {
  18222. this.init()
  18223. this._w = W // new Array(64)
  18224. Hash.call(this, 64, 56)
  18225. }
  18226. inherits(Sha256, Hash)
  18227. Sha256.prototype.init = function () {
  18228. this._a = 0x6a09e667
  18229. this._b = 0xbb67ae85
  18230. this._c = 0x3c6ef372
  18231. this._d = 0xa54ff53a
  18232. this._e = 0x510e527f
  18233. this._f = 0x9b05688c
  18234. this._g = 0x1f83d9ab
  18235. this._h = 0x5be0cd19
  18236. return this
  18237. }
  18238. function ch (x, y, z) {
  18239. return z ^ (x & (y ^ z))
  18240. }
  18241. function maj (x, y, z) {
  18242. return (x & y) | (z & (x | y))
  18243. }
  18244. function sigma0 (x) {
  18245. return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10)
  18246. }
  18247. function sigma1 (x) {
  18248. return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7)
  18249. }
  18250. function gamma0 (x) {
  18251. return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3)
  18252. }
  18253. function gamma1 (x) {
  18254. return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10)
  18255. }
  18256. Sha256.prototype._update = function (M) {
  18257. var W = this._w
  18258. var a = this._a | 0
  18259. var b = this._b | 0
  18260. var c = this._c | 0
  18261. var d = this._d | 0
  18262. var e = this._e | 0
  18263. var f = this._f | 0
  18264. var g = this._g | 0
  18265. var h = this._h | 0
  18266. for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
  18267. for (; i < 64; ++i) W[i] = (gamma1(W[i - 2]) + W[i - 7] + gamma0(W[i - 15]) + W[i - 16]) | 0
  18268. for (var j = 0; j < 64; ++j) {
  18269. var T1 = (h + sigma1(e) + ch(e, f, g) + K[j] + W[j]) | 0
  18270. var T2 = (sigma0(a) + maj(a, b, c)) | 0
  18271. h = g
  18272. g = f
  18273. f = e
  18274. e = (d + T1) | 0
  18275. d = c
  18276. c = b
  18277. b = a
  18278. a = (T1 + T2) | 0
  18279. }
  18280. this._a = (a + this._a) | 0
  18281. this._b = (b + this._b) | 0
  18282. this._c = (c + this._c) | 0
  18283. this._d = (d + this._d) | 0
  18284. this._e = (e + this._e) | 0
  18285. this._f = (f + this._f) | 0
  18286. this._g = (g + this._g) | 0
  18287. this._h = (h + this._h) | 0
  18288. }
  18289. Sha256.prototype._hash = function () {
  18290. var H = Buffer.allocUnsafe(32)
  18291. H.writeInt32BE(this._a, 0)
  18292. H.writeInt32BE(this._b, 4)
  18293. H.writeInt32BE(this._c, 8)
  18294. H.writeInt32BE(this._d, 12)
  18295. H.writeInt32BE(this._e, 16)
  18296. H.writeInt32BE(this._f, 20)
  18297. H.writeInt32BE(this._g, 24)
  18298. H.writeInt32BE(this._h, 28)
  18299. return H
  18300. }
  18301. module.exports = Sha256
  18302. /***/ }),
  18303. /* 80 */
  18304. /*!***************************************!*\
  18305. !*** ./node_modules/sha.js/sha384.js ***!
  18306. \***************************************/
  18307. /*! no static exports found */
  18308. /***/ (function(module, exports, __webpack_require__) {
  18309. var inherits = __webpack_require__(/*! inherits */ 54)
  18310. var SHA512 = __webpack_require__(/*! ./sha512 */ 81)
  18311. var Hash = __webpack_require__(/*! ./hash */ 76)
  18312. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  18313. var W = new Array(160)
  18314. function Sha384 () {
  18315. this.init()
  18316. this._w = W
  18317. Hash.call(this, 128, 112)
  18318. }
  18319. inherits(Sha384, SHA512)
  18320. Sha384.prototype.init = function () {
  18321. this._ah = 0xcbbb9d5d
  18322. this._bh = 0x629a292a
  18323. this._ch = 0x9159015a
  18324. this._dh = 0x152fecd8
  18325. this._eh = 0x67332667
  18326. this._fh = 0x8eb44a87
  18327. this._gh = 0xdb0c2e0d
  18328. this._hh = 0x47b5481d
  18329. this._al = 0xc1059ed8
  18330. this._bl = 0x367cd507
  18331. this._cl = 0x3070dd17
  18332. this._dl = 0xf70e5939
  18333. this._el = 0xffc00b31
  18334. this._fl = 0x68581511
  18335. this._gl = 0x64f98fa7
  18336. this._hl = 0xbefa4fa4
  18337. return this
  18338. }
  18339. Sha384.prototype._hash = function () {
  18340. var H = Buffer.allocUnsafe(48)
  18341. function writeInt64BE (h, l, offset) {
  18342. H.writeInt32BE(h, offset)
  18343. H.writeInt32BE(l, offset + 4)
  18344. }
  18345. writeInt64BE(this._ah, this._al, 0)
  18346. writeInt64BE(this._bh, this._bl, 8)
  18347. writeInt64BE(this._ch, this._cl, 16)
  18348. writeInt64BE(this._dh, this._dl, 24)
  18349. writeInt64BE(this._eh, this._el, 32)
  18350. writeInt64BE(this._fh, this._fl, 40)
  18351. return H
  18352. }
  18353. module.exports = Sha384
  18354. /***/ }),
  18355. /* 81 */
  18356. /*!***************************************!*\
  18357. !*** ./node_modules/sha.js/sha512.js ***!
  18358. \***************************************/
  18359. /*! no static exports found */
  18360. /***/ (function(module, exports, __webpack_require__) {
  18361. var inherits = __webpack_require__(/*! inherits */ 54)
  18362. var Hash = __webpack_require__(/*! ./hash */ 76)
  18363. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  18364. var K = [
  18365. 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,
  18366. 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
  18367. 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,
  18368. 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
  18369. 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,
  18370. 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
  18371. 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,
  18372. 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
  18373. 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,
  18374. 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
  18375. 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,
  18376. 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
  18377. 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,
  18378. 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
  18379. 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,
  18380. 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
  18381. 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,
  18382. 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
  18383. 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,
  18384. 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
  18385. 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,
  18386. 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
  18387. 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,
  18388. 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
  18389. 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,
  18390. 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
  18391. 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,
  18392. 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
  18393. 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,
  18394. 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
  18395. 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,
  18396. 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
  18397. 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,
  18398. 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
  18399. 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,
  18400. 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
  18401. 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,
  18402. 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
  18403. 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,
  18404. 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817
  18405. ]
  18406. var W = new Array(160)
  18407. function Sha512 () {
  18408. this.init()
  18409. this._w = W
  18410. Hash.call(this, 128, 112)
  18411. }
  18412. inherits(Sha512, Hash)
  18413. Sha512.prototype.init = function () {
  18414. this._ah = 0x6a09e667
  18415. this._bh = 0xbb67ae85
  18416. this._ch = 0x3c6ef372
  18417. this._dh = 0xa54ff53a
  18418. this._eh = 0x510e527f
  18419. this._fh = 0x9b05688c
  18420. this._gh = 0x1f83d9ab
  18421. this._hh = 0x5be0cd19
  18422. this._al = 0xf3bcc908
  18423. this._bl = 0x84caa73b
  18424. this._cl = 0xfe94f82b
  18425. this._dl = 0x5f1d36f1
  18426. this._el = 0xade682d1
  18427. this._fl = 0x2b3e6c1f
  18428. this._gl = 0xfb41bd6b
  18429. this._hl = 0x137e2179
  18430. return this
  18431. }
  18432. function Ch (x, y, z) {
  18433. return z ^ (x & (y ^ z))
  18434. }
  18435. function maj (x, y, z) {
  18436. return (x & y) | (z & (x | y))
  18437. }
  18438. function sigma0 (x, xl) {
  18439. return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25)
  18440. }
  18441. function sigma1 (x, xl) {
  18442. return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23)
  18443. }
  18444. function Gamma0 (x, xl) {
  18445. return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7)
  18446. }
  18447. function Gamma0l (x, xl) {
  18448. return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25)
  18449. }
  18450. function Gamma1 (x, xl) {
  18451. return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6)
  18452. }
  18453. function Gamma1l (x, xl) {
  18454. return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26)
  18455. }
  18456. function getCarry (a, b) {
  18457. return (a >>> 0) < (b >>> 0) ? 1 : 0
  18458. }
  18459. Sha512.prototype._update = function (M) {
  18460. var W = this._w
  18461. var ah = this._ah | 0
  18462. var bh = this._bh | 0
  18463. var ch = this._ch | 0
  18464. var dh = this._dh | 0
  18465. var eh = this._eh | 0
  18466. var fh = this._fh | 0
  18467. var gh = this._gh | 0
  18468. var hh = this._hh | 0
  18469. var al = this._al | 0
  18470. var bl = this._bl | 0
  18471. var cl = this._cl | 0
  18472. var dl = this._dl | 0
  18473. var el = this._el | 0
  18474. var fl = this._fl | 0
  18475. var gl = this._gl | 0
  18476. var hl = this._hl | 0
  18477. for (var i = 0; i < 32; i += 2) {
  18478. W[i] = M.readInt32BE(i * 4)
  18479. W[i + 1] = M.readInt32BE(i * 4 + 4)
  18480. }
  18481. for (; i < 160; i += 2) {
  18482. var xh = W[i - 15 * 2]
  18483. var xl = W[i - 15 * 2 + 1]
  18484. var gamma0 = Gamma0(xh, xl)
  18485. var gamma0l = Gamma0l(xl, xh)
  18486. xh = W[i - 2 * 2]
  18487. xl = W[i - 2 * 2 + 1]
  18488. var gamma1 = Gamma1(xh, xl)
  18489. var gamma1l = Gamma1l(xl, xh)
  18490. // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]
  18491. var Wi7h = W[i - 7 * 2]
  18492. var Wi7l = W[i - 7 * 2 + 1]
  18493. var Wi16h = W[i - 16 * 2]
  18494. var Wi16l = W[i - 16 * 2 + 1]
  18495. var Wil = (gamma0l + Wi7l) | 0
  18496. var Wih = (gamma0 + Wi7h + getCarry(Wil, gamma0l)) | 0
  18497. Wil = (Wil + gamma1l) | 0
  18498. Wih = (Wih + gamma1 + getCarry(Wil, gamma1l)) | 0
  18499. Wil = (Wil + Wi16l) | 0
  18500. Wih = (Wih + Wi16h + getCarry(Wil, Wi16l)) | 0
  18501. W[i] = Wih
  18502. W[i + 1] = Wil
  18503. }
  18504. for (var j = 0; j < 160; j += 2) {
  18505. Wih = W[j]
  18506. Wil = W[j + 1]
  18507. var majh = maj(ah, bh, ch)
  18508. var majl = maj(al, bl, cl)
  18509. var sigma0h = sigma0(ah, al)
  18510. var sigma0l = sigma0(al, ah)
  18511. var sigma1h = sigma1(eh, el)
  18512. var sigma1l = sigma1(el, eh)
  18513. // t1 = h + sigma1 + ch + K[j] + W[j]
  18514. var Kih = K[j]
  18515. var Kil = K[j + 1]
  18516. var chh = Ch(eh, fh, gh)
  18517. var chl = Ch(el, fl, gl)
  18518. var t1l = (hl + sigma1l) | 0
  18519. var t1h = (hh + sigma1h + getCarry(t1l, hl)) | 0
  18520. t1l = (t1l + chl) | 0
  18521. t1h = (t1h + chh + getCarry(t1l, chl)) | 0
  18522. t1l = (t1l + Kil) | 0
  18523. t1h = (t1h + Kih + getCarry(t1l, Kil)) | 0
  18524. t1l = (t1l + Wil) | 0
  18525. t1h = (t1h + Wih + getCarry(t1l, Wil)) | 0
  18526. // t2 = sigma0 + maj
  18527. var t2l = (sigma0l + majl) | 0
  18528. var t2h = (sigma0h + majh + getCarry(t2l, sigma0l)) | 0
  18529. hh = gh
  18530. hl = gl
  18531. gh = fh
  18532. gl = fl
  18533. fh = eh
  18534. fl = el
  18535. el = (dl + t1l) | 0
  18536. eh = (dh + t1h + getCarry(el, dl)) | 0
  18537. dh = ch
  18538. dl = cl
  18539. ch = bh
  18540. cl = bl
  18541. bh = ah
  18542. bl = al
  18543. al = (t1l + t2l) | 0
  18544. ah = (t1h + t2h + getCarry(al, t1l)) | 0
  18545. }
  18546. this._al = (this._al + al) | 0
  18547. this._bl = (this._bl + bl) | 0
  18548. this._cl = (this._cl + cl) | 0
  18549. this._dl = (this._dl + dl) | 0
  18550. this._el = (this._el + el) | 0
  18551. this._fl = (this._fl + fl) | 0
  18552. this._gl = (this._gl + gl) | 0
  18553. this._hl = (this._hl + hl) | 0
  18554. this._ah = (this._ah + ah + getCarry(this._al, al)) | 0
  18555. this._bh = (this._bh + bh + getCarry(this._bl, bl)) | 0
  18556. this._ch = (this._ch + ch + getCarry(this._cl, cl)) | 0
  18557. this._dh = (this._dh + dh + getCarry(this._dl, dl)) | 0
  18558. this._eh = (this._eh + eh + getCarry(this._el, el)) | 0
  18559. this._fh = (this._fh + fh + getCarry(this._fl, fl)) | 0
  18560. this._gh = (this._gh + gh + getCarry(this._gl, gl)) | 0
  18561. this._hh = (this._hh + hh + getCarry(this._hl, hl)) | 0
  18562. }
  18563. Sha512.prototype._hash = function () {
  18564. var H = Buffer.allocUnsafe(64)
  18565. function writeInt64BE (h, l, offset) {
  18566. H.writeInt32BE(h, offset)
  18567. H.writeInt32BE(l, offset + 4)
  18568. }
  18569. writeInt64BE(this._ah, this._al, 0)
  18570. writeInt64BE(this._bh, this._bl, 8)
  18571. writeInt64BE(this._ch, this._cl, 16)
  18572. writeInt64BE(this._dh, this._dl, 24)
  18573. writeInt64BE(this._eh, this._el, 32)
  18574. writeInt64BE(this._fh, this._fl, 40)
  18575. writeInt64BE(this._gh, this._gl, 48)
  18576. writeInt64BE(this._hh, this._hl, 56)
  18577. return H
  18578. }
  18579. module.exports = Sha512
  18580. /***/ }),
  18581. /* 82 */
  18582. /*!*******************************************!*\
  18583. !*** ./node_modules/cipher-base/index.js ***!
  18584. \*******************************************/
  18585. /*! no static exports found */
  18586. /***/ (function(module, exports, __webpack_require__) {
  18587. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  18588. var Transform = __webpack_require__(/*! stream */ 83).Transform
  18589. var StringDecoder = __webpack_require__(/*! string_decoder */ 70).StringDecoder
  18590. var inherits = __webpack_require__(/*! inherits */ 54)
  18591. function CipherBase (hashMode) {
  18592. Transform.call(this)
  18593. this.hashMode = typeof hashMode === 'string'
  18594. if (this.hashMode) {
  18595. this[hashMode] = this._finalOrDigest
  18596. } else {
  18597. this.final = this._finalOrDigest
  18598. }
  18599. if (this._final) {
  18600. this.__final = this._final
  18601. this._final = null
  18602. }
  18603. this._decoder = null
  18604. this._encoding = null
  18605. }
  18606. inherits(CipherBase, Transform)
  18607. CipherBase.prototype.update = function (data, inputEnc, outputEnc) {
  18608. if (typeof data === 'string') {
  18609. data = Buffer.from(data, inputEnc)
  18610. }
  18611. var outData = this._update(data)
  18612. if (this.hashMode) return this
  18613. if (outputEnc) {
  18614. outData = this._toString(outData, outputEnc)
  18615. }
  18616. return outData
  18617. }
  18618. CipherBase.prototype.setAutoPadding = function () {}
  18619. CipherBase.prototype.getAuthTag = function () {
  18620. throw new Error('trying to get auth tag in unsupported state')
  18621. }
  18622. CipherBase.prototype.setAuthTag = function () {
  18623. throw new Error('trying to set auth tag in unsupported state')
  18624. }
  18625. CipherBase.prototype.setAAD = function () {
  18626. throw new Error('trying to set aad in unsupported state')
  18627. }
  18628. CipherBase.prototype._transform = function (data, _, next) {
  18629. var err
  18630. try {
  18631. if (this.hashMode) {
  18632. this._update(data)
  18633. } else {
  18634. this.push(this._update(data))
  18635. }
  18636. } catch (e) {
  18637. err = e
  18638. } finally {
  18639. next(err)
  18640. }
  18641. }
  18642. CipherBase.prototype._flush = function (done) {
  18643. var err
  18644. try {
  18645. this.push(this.__final())
  18646. } catch (e) {
  18647. err = e
  18648. }
  18649. done(err)
  18650. }
  18651. CipherBase.prototype._finalOrDigest = function (outputEnc) {
  18652. var outData = this.__final() || Buffer.alloc(0)
  18653. if (outputEnc) {
  18654. outData = this._toString(outData, outputEnc, true)
  18655. }
  18656. return outData
  18657. }
  18658. CipherBase.prototype._toString = function (value, enc, fin) {
  18659. if (!this._decoder) {
  18660. this._decoder = new StringDecoder(enc)
  18661. this._encoding = enc
  18662. }
  18663. if (this._encoding !== enc) throw new Error('can\'t switch encodings')
  18664. var out = this._decoder.write(value)
  18665. if (fin) {
  18666. out += this._decoder.end()
  18667. }
  18668. return out
  18669. }
  18670. module.exports = CipherBase
  18671. /***/ }),
  18672. /* 83 */
  18673. /*!*************************************************!*\
  18674. !*** ./node_modules/stream-browserify/index.js ***!
  18675. \*************************************************/
  18676. /*! no static exports found */
  18677. /***/ (function(module, exports, __webpack_require__) {
  18678. // Copyright Joyent, Inc. and other Node contributors.
  18679. //
  18680. // Permission is hereby granted, free of charge, to any person obtaining a
  18681. // copy of this software and associated documentation files (the
  18682. // "Software"), to deal in the Software without restriction, including
  18683. // without limitation the rights to use, copy, modify, merge, publish,
  18684. // distribute, sublicense, and/or sell copies of the Software, and to permit
  18685. // persons to whom the Software is furnished to do so, subject to the
  18686. // following conditions:
  18687. //
  18688. // The above copyright notice and this permission notice shall be included
  18689. // in all copies or substantial portions of the Software.
  18690. //
  18691. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  18692. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  18693. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  18694. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  18695. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  18696. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  18697. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  18698. module.exports = Stream;
  18699. var EE = __webpack_require__(/*! events */ 60).EventEmitter;
  18700. var inherits = __webpack_require__(/*! inherits */ 54);
  18701. inherits(Stream, EE);
  18702. Stream.Readable = __webpack_require__(/*! readable-stream/readable.js */ 57);
  18703. Stream.Writable = __webpack_require__(/*! readable-stream/writable.js */ 84);
  18704. Stream.Duplex = __webpack_require__(/*! readable-stream/duplex.js */ 85);
  18705. Stream.Transform = __webpack_require__(/*! readable-stream/transform.js */ 86);
  18706. Stream.PassThrough = __webpack_require__(/*! readable-stream/passthrough.js */ 87);
  18707. // Backwards-compat with node 0.4.x
  18708. Stream.Stream = Stream;
  18709. // old-style streams. Note that the pipe method (the only relevant
  18710. // part of this class) is overridden in the Readable class.
  18711. function Stream() {
  18712. EE.call(this);
  18713. }
  18714. Stream.prototype.pipe = function(dest, options) {
  18715. var source = this;
  18716. function ondata(chunk) {
  18717. if (dest.writable) {
  18718. if (false === dest.write(chunk) && source.pause) {
  18719. source.pause();
  18720. }
  18721. }
  18722. }
  18723. source.on('data', ondata);
  18724. function ondrain() {
  18725. if (source.readable && source.resume) {
  18726. source.resume();
  18727. }
  18728. }
  18729. dest.on('drain', ondrain);
  18730. // If the 'end' option is not supplied, dest.end() will be called when
  18731. // source gets the 'end' or 'close' events. Only dest.end() once.
  18732. if (!dest._isStdio && (!options || options.end !== false)) {
  18733. source.on('end', onend);
  18734. source.on('close', onclose);
  18735. }
  18736. var didOnEnd = false;
  18737. function onend() {
  18738. if (didOnEnd) return;
  18739. didOnEnd = true;
  18740. dest.end();
  18741. }
  18742. function onclose() {
  18743. if (didOnEnd) return;
  18744. didOnEnd = true;
  18745. if (typeof dest.destroy === 'function') dest.destroy();
  18746. }
  18747. // don't leave dangling pipes when there are errors.
  18748. function onerror(er) {
  18749. cleanup();
  18750. if (EE.listenerCount(this, 'error') === 0) {
  18751. throw er; // Unhandled stream error in pipe.
  18752. }
  18753. }
  18754. source.on('error', onerror);
  18755. dest.on('error', onerror);
  18756. // remove all the event listeners that were added.
  18757. function cleanup() {
  18758. source.removeListener('data', ondata);
  18759. dest.removeListener('drain', ondrain);
  18760. source.removeListener('end', onend);
  18761. source.removeListener('close', onclose);
  18762. source.removeListener('error', onerror);
  18763. dest.removeListener('error', onerror);
  18764. source.removeListener('end', cleanup);
  18765. source.removeListener('close', cleanup);
  18766. dest.removeListener('close', cleanup);
  18767. }
  18768. source.on('end', cleanup);
  18769. source.on('close', cleanup);
  18770. dest.on('close', cleanup);
  18771. dest.emit('pipe', source);
  18772. // Allow for unix-like usage: A.pipe(B).pipe(C)
  18773. return dest;
  18774. };
  18775. /***/ }),
  18776. /* 84 */
  18777. /*!**********************************************************!*\
  18778. !*** ./node_modules/readable-stream/writable-browser.js ***!
  18779. \**********************************************************/
  18780. /*! no static exports found */
  18781. /***/ (function(module, exports, __webpack_require__) {
  18782. module.exports = __webpack_require__(/*! ./lib/_stream_writable.js */ 68);
  18783. /***/ }),
  18784. /* 85 */
  18785. /*!********************************************************!*\
  18786. !*** ./node_modules/readable-stream/duplex-browser.js ***!
  18787. \********************************************************/
  18788. /*! no static exports found */
  18789. /***/ (function(module, exports, __webpack_require__) {
  18790. module.exports = __webpack_require__(/*! ./lib/_stream_duplex.js */ 67);
  18791. /***/ }),
  18792. /* 86 */
  18793. /*!***************************************************!*\
  18794. !*** ./node_modules/readable-stream/transform.js ***!
  18795. \***************************************************/
  18796. /*! no static exports found */
  18797. /***/ (function(module, exports, __webpack_require__) {
  18798. module.exports = __webpack_require__(/*! ./readable */ 57).Transform
  18799. /***/ }),
  18800. /* 87 */
  18801. /*!*****************************************************!*\
  18802. !*** ./node_modules/readable-stream/passthrough.js ***!
  18803. \*****************************************************/
  18804. /*! no static exports found */
  18805. /***/ (function(module, exports, __webpack_require__) {
  18806. module.exports = __webpack_require__(/*! ./readable */ 57).PassThrough
  18807. /***/ }),
  18808. /* 88 */
  18809. /*!*********************************************!*\
  18810. !*** ./node_modules/create-hmac/browser.js ***!
  18811. \*********************************************/
  18812. /*! no static exports found */
  18813. /***/ (function(module, exports, __webpack_require__) {
  18814. "use strict";
  18815. var inherits = __webpack_require__(/*! inherits */ 54)
  18816. var Legacy = __webpack_require__(/*! ./legacy */ 89)
  18817. var Base = __webpack_require__(/*! cipher-base */ 82)
  18818. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  18819. var md5 = __webpack_require__(/*! create-hash/md5 */ 90)
  18820. var RIPEMD160 = __webpack_require__(/*! ripemd160 */ 73)
  18821. var sha = __webpack_require__(/*! sha.js */ 74)
  18822. var ZEROS = Buffer.alloc(128)
  18823. function Hmac (alg, key) {
  18824. Base.call(this, 'digest')
  18825. if (typeof key === 'string') {
  18826. key = Buffer.from(key)
  18827. }
  18828. var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64
  18829. this._alg = alg
  18830. this._key = key
  18831. if (key.length > blocksize) {
  18832. var hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg)
  18833. key = hash.update(key).digest()
  18834. } else if (key.length < blocksize) {
  18835. key = Buffer.concat([key, ZEROS], blocksize)
  18836. }
  18837. var ipad = this._ipad = Buffer.allocUnsafe(blocksize)
  18838. var opad = this._opad = Buffer.allocUnsafe(blocksize)
  18839. for (var i = 0; i < blocksize; i++) {
  18840. ipad[i] = key[i] ^ 0x36
  18841. opad[i] = key[i] ^ 0x5C
  18842. }
  18843. this._hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg)
  18844. this._hash.update(ipad)
  18845. }
  18846. inherits(Hmac, Base)
  18847. Hmac.prototype._update = function (data) {
  18848. this._hash.update(data)
  18849. }
  18850. Hmac.prototype._final = function () {
  18851. var h = this._hash.digest()
  18852. var hash = this._alg === 'rmd160' ? new RIPEMD160() : sha(this._alg)
  18853. return hash.update(this._opad).update(h).digest()
  18854. }
  18855. module.exports = function createHmac (alg, key) {
  18856. alg = alg.toLowerCase()
  18857. if (alg === 'rmd160' || alg === 'ripemd160') {
  18858. return new Hmac('rmd160', key)
  18859. }
  18860. if (alg === 'md5') {
  18861. return new Legacy(md5, key)
  18862. }
  18863. return new Hmac(alg, key)
  18864. }
  18865. /***/ }),
  18866. /* 89 */
  18867. /*!********************************************!*\
  18868. !*** ./node_modules/create-hmac/legacy.js ***!
  18869. \********************************************/
  18870. /*! no static exports found */
  18871. /***/ (function(module, exports, __webpack_require__) {
  18872. "use strict";
  18873. var inherits = __webpack_require__(/*! inherits */ 54)
  18874. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  18875. var Base = __webpack_require__(/*! cipher-base */ 82)
  18876. var ZEROS = Buffer.alloc(128)
  18877. var blocksize = 64
  18878. function Hmac (alg, key) {
  18879. Base.call(this, 'digest')
  18880. if (typeof key === 'string') {
  18881. key = Buffer.from(key)
  18882. }
  18883. this._alg = alg
  18884. this._key = key
  18885. if (key.length > blocksize) {
  18886. key = alg(key)
  18887. } else if (key.length < blocksize) {
  18888. key = Buffer.concat([key, ZEROS], blocksize)
  18889. }
  18890. var ipad = this._ipad = Buffer.allocUnsafe(blocksize)
  18891. var opad = this._opad = Buffer.allocUnsafe(blocksize)
  18892. for (var i = 0; i < blocksize; i++) {
  18893. ipad[i] = key[i] ^ 0x36
  18894. opad[i] = key[i] ^ 0x5C
  18895. }
  18896. this._hash = [ipad]
  18897. }
  18898. inherits(Hmac, Base)
  18899. Hmac.prototype._update = function (data) {
  18900. this._hash.push(data)
  18901. }
  18902. Hmac.prototype._final = function () {
  18903. var h = this._alg(Buffer.concat(this._hash))
  18904. return this._alg(Buffer.concat([this._opad, h]))
  18905. }
  18906. module.exports = Hmac
  18907. /***/ }),
  18908. /* 90 */
  18909. /*!*****************************************!*\
  18910. !*** ./node_modules/create-hash/md5.js ***!
  18911. \*****************************************/
  18912. /*! no static exports found */
  18913. /***/ (function(module, exports, __webpack_require__) {
  18914. var MD5 = __webpack_require__(/*! md5.js */ 55)
  18915. module.exports = function (buffer) {
  18916. return new MD5().update(buffer).digest()
  18917. }
  18918. /***/ }),
  18919. /* 91 */
  18920. /*!***********************************************!*\
  18921. !*** ./node_modules/browserify-sign/algos.js ***!
  18922. \***********************************************/
  18923. /*! no static exports found */
  18924. /***/ (function(module, exports, __webpack_require__) {
  18925. module.exports = __webpack_require__(/*! ./browser/algorithms.json */ 92)
  18926. /***/ }),
  18927. /* 92 */
  18928. /*!**************************************************************!*\
  18929. !*** ./node_modules/browserify-sign/browser/algorithms.json ***!
  18930. \**************************************************************/
  18931. /*! exports provided: sha224WithRSAEncryption, RSA-SHA224, sha256WithRSAEncryption, RSA-SHA256, sha384WithRSAEncryption, RSA-SHA384, sha512WithRSAEncryption, RSA-SHA512, RSA-SHA1, ecdsa-with-SHA1, sha256, sha224, sha384, sha512, DSA-SHA, DSA-SHA1, DSA, DSA-WITH-SHA224, DSA-SHA224, DSA-WITH-SHA256, DSA-SHA256, DSA-WITH-SHA384, DSA-SHA384, DSA-WITH-SHA512, DSA-SHA512, DSA-RIPEMD160, ripemd160WithRSA, RSA-RIPEMD160, md5WithRSAEncryption, RSA-MD5, default */
  18932. /***/ (function(module) {
  18933. module.exports = JSON.parse("{\"sha224WithRSAEncryption\":{\"sign\":\"rsa\",\"hash\":\"sha224\",\"id\":\"302d300d06096086480165030402040500041c\"},\"RSA-SHA224\":{\"sign\":\"ecdsa/rsa\",\"hash\":\"sha224\",\"id\":\"302d300d06096086480165030402040500041c\"},\"sha256WithRSAEncryption\":{\"sign\":\"rsa\",\"hash\":\"sha256\",\"id\":\"3031300d060960864801650304020105000420\"},\"RSA-SHA256\":{\"sign\":\"ecdsa/rsa\",\"hash\":\"sha256\",\"id\":\"3031300d060960864801650304020105000420\"},\"sha384WithRSAEncryption\":{\"sign\":\"rsa\",\"hash\":\"sha384\",\"id\":\"3041300d060960864801650304020205000430\"},\"RSA-SHA384\":{\"sign\":\"ecdsa/rsa\",\"hash\":\"sha384\",\"id\":\"3041300d060960864801650304020205000430\"},\"sha512WithRSAEncryption\":{\"sign\":\"rsa\",\"hash\":\"sha512\",\"id\":\"3051300d060960864801650304020305000440\"},\"RSA-SHA512\":{\"sign\":\"ecdsa/rsa\",\"hash\":\"sha512\",\"id\":\"3051300d060960864801650304020305000440\"},\"RSA-SHA1\":{\"sign\":\"rsa\",\"hash\":\"sha1\",\"id\":\"3021300906052b0e03021a05000414\"},\"ecdsa-with-SHA1\":{\"sign\":\"ecdsa\",\"hash\":\"sha1\",\"id\":\"\"},\"sha256\":{\"sign\":\"ecdsa\",\"hash\":\"sha256\",\"id\":\"\"},\"sha224\":{\"sign\":\"ecdsa\",\"hash\":\"sha224\",\"id\":\"\"},\"sha384\":{\"sign\":\"ecdsa\",\"hash\":\"sha384\",\"id\":\"\"},\"sha512\":{\"sign\":\"ecdsa\",\"hash\":\"sha512\",\"id\":\"\"},\"DSA-SHA\":{\"sign\":\"dsa\",\"hash\":\"sha1\",\"id\":\"\"},\"DSA-SHA1\":{\"sign\":\"dsa\",\"hash\":\"sha1\",\"id\":\"\"},\"DSA\":{\"sign\":\"dsa\",\"hash\":\"sha1\",\"id\":\"\"},\"DSA-WITH-SHA224\":{\"sign\":\"dsa\",\"hash\":\"sha224\",\"id\":\"\"},\"DSA-SHA224\":{\"sign\":\"dsa\",\"hash\":\"sha224\",\"id\":\"\"},\"DSA-WITH-SHA256\":{\"sign\":\"dsa\",\"hash\":\"sha256\",\"id\":\"\"},\"DSA-SHA256\":{\"sign\":\"dsa\",\"hash\":\"sha256\",\"id\":\"\"},\"DSA-WITH-SHA384\":{\"sign\":\"dsa\",\"hash\":\"sha384\",\"id\":\"\"},\"DSA-SHA384\":{\"sign\":\"dsa\",\"hash\":\"sha384\",\"id\":\"\"},\"DSA-WITH-SHA512\":{\"sign\":\"dsa\",\"hash\":\"sha512\",\"id\":\"\"},\"DSA-SHA512\":{\"sign\":\"dsa\",\"hash\":\"sha512\",\"id\":\"\"},\"DSA-RIPEMD160\":{\"sign\":\"dsa\",\"hash\":\"rmd160\",\"id\":\"\"},\"ripemd160WithRSA\":{\"sign\":\"rsa\",\"hash\":\"rmd160\",\"id\":\"3021300906052b2403020105000414\"},\"RSA-RIPEMD160\":{\"sign\":\"rsa\",\"hash\":\"rmd160\",\"id\":\"3021300906052b2403020105000414\"},\"md5WithRSAEncryption\":{\"sign\":\"rsa\",\"hash\":\"md5\",\"id\":\"3020300c06082a864886f70d020505000410\"},\"RSA-MD5\":{\"sign\":\"rsa\",\"hash\":\"md5\",\"id\":\"3020300c06082a864886f70d020505000410\"}}");
  18934. /***/ }),
  18935. /* 93 */
  18936. /*!****************************************!*\
  18937. !*** ./node_modules/pbkdf2/browser.js ***!
  18938. \****************************************/
  18939. /*! no static exports found */
  18940. /***/ (function(module, exports, __webpack_require__) {
  18941. exports.pbkdf2 = __webpack_require__(/*! ./lib/async */ 94)
  18942. exports.pbkdf2Sync = __webpack_require__(/*! ./lib/sync */ 97)
  18943. /***/ }),
  18944. /* 94 */
  18945. /*!******************************************!*\
  18946. !*** ./node_modules/pbkdf2/lib/async.js ***!
  18947. \******************************************/
  18948. /*! no static exports found */
  18949. /***/ (function(module, exports, __webpack_require__) {
  18950. /* WEBPACK VAR INJECTION */(function(global, process) {var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  18951. var checkParameters = __webpack_require__(/*! ./precondition */ 95)
  18952. var defaultEncoding = __webpack_require__(/*! ./default-encoding */ 96)
  18953. var sync = __webpack_require__(/*! ./sync */ 97)
  18954. var toBuffer = __webpack_require__(/*! ./to-buffer */ 98)
  18955. var ZERO_BUF
  18956. var subtle = global.crypto && global.crypto.subtle
  18957. var toBrowser = {
  18958. sha: 'SHA-1',
  18959. 'sha-1': 'SHA-1',
  18960. sha1: 'SHA-1',
  18961. sha256: 'SHA-256',
  18962. 'sha-256': 'SHA-256',
  18963. sha384: 'SHA-384',
  18964. 'sha-384': 'SHA-384',
  18965. 'sha-512': 'SHA-512',
  18966. sha512: 'SHA-512'
  18967. }
  18968. var checks = []
  18969. function checkNative (algo) {
  18970. if (global.process && !global.process.browser) {
  18971. return Promise.resolve(false)
  18972. }
  18973. if (!subtle || !subtle.importKey || !subtle.deriveBits) {
  18974. return Promise.resolve(false)
  18975. }
  18976. if (checks[algo] !== undefined) {
  18977. return checks[algo]
  18978. }
  18979. ZERO_BUF = ZERO_BUF || Buffer.alloc(8)
  18980. var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo)
  18981. .then(function () {
  18982. return true
  18983. }).catch(function () {
  18984. return false
  18985. })
  18986. checks[algo] = prom
  18987. return prom
  18988. }
  18989. function browserPbkdf2 (password, salt, iterations, length, algo) {
  18990. return subtle.importKey(
  18991. 'raw', password, { name: 'PBKDF2' }, false, ['deriveBits']
  18992. ).then(function (key) {
  18993. return subtle.deriveBits({
  18994. name: 'PBKDF2',
  18995. salt: salt,
  18996. iterations: iterations,
  18997. hash: {
  18998. name: algo
  18999. }
  19000. }, key, length << 3)
  19001. }).then(function (res) {
  19002. return Buffer.from(res)
  19003. })
  19004. }
  19005. function resolvePromise (promise, callback) {
  19006. promise.then(function (out) {
  19007. process.nextTick(function () {
  19008. callback(null, out)
  19009. })
  19010. }, function (e) {
  19011. process.nextTick(function () {
  19012. callback(e)
  19013. })
  19014. })
  19015. }
  19016. module.exports = function (password, salt, iterations, keylen, digest, callback) {
  19017. if (typeof digest === 'function') {
  19018. callback = digest
  19019. digest = undefined
  19020. }
  19021. digest = digest || 'sha1'
  19022. var algo = toBrowser[digest.toLowerCase()]
  19023. if (!algo || typeof global.Promise !== 'function') {
  19024. return process.nextTick(function () {
  19025. var out
  19026. try {
  19027. out = sync(password, salt, iterations, keylen, digest)
  19028. } catch (e) {
  19029. return callback(e)
  19030. }
  19031. callback(null, out)
  19032. })
  19033. }
  19034. checkParameters(iterations, keylen)
  19035. password = toBuffer(password, defaultEncoding, 'Password')
  19036. salt = toBuffer(salt, defaultEncoding, 'Salt')
  19037. if (typeof callback !== 'function') throw new Error('No callback provided to pbkdf2')
  19038. resolvePromise(checkNative(algo).then(function (resp) {
  19039. if (resp) return browserPbkdf2(password, salt, iterations, keylen, algo)
  19040. return sync(password, salt, iterations, keylen, digest)
  19041. }), callback)
  19042. }
  19043. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ 2), __webpack_require__(/*! ./../../node-libs-browser/mock/process.js */ 46)))
  19044. /***/ }),
  19045. /* 95 */
  19046. /*!*************************************************!*\
  19047. !*** ./node_modules/pbkdf2/lib/precondition.js ***!
  19048. \*************************************************/
  19049. /*! no static exports found */
  19050. /***/ (function(module, exports) {
  19051. var MAX_ALLOC = Math.pow(2, 30) - 1 // default in iojs
  19052. module.exports = function (iterations, keylen) {
  19053. if (typeof iterations !== 'number') {
  19054. throw new TypeError('Iterations not a number')
  19055. }
  19056. if (iterations < 0) {
  19057. throw new TypeError('Bad iterations')
  19058. }
  19059. if (typeof keylen !== 'number') {
  19060. throw new TypeError('Key length not a number')
  19061. }
  19062. if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen) { /* eslint no-self-compare: 0 */
  19063. throw new TypeError('Bad key length')
  19064. }
  19065. }
  19066. /***/ }),
  19067. /* 96 */
  19068. /*!*****************************************************!*\
  19069. !*** ./node_modules/pbkdf2/lib/default-encoding.js ***!
  19070. \*****************************************************/
  19071. /*! no static exports found */
  19072. /***/ (function(module, exports, __webpack_require__) {
  19073. /* WEBPACK VAR INJECTION */(function(process) {var defaultEncoding
  19074. /* istanbul ignore next */
  19075. if (process.browser) {
  19076. defaultEncoding = 'utf-8'
  19077. } else if (process.version) {
  19078. var pVersionMajor = parseInt(process.version.split('.')[0].slice(1), 10)
  19079. defaultEncoding = pVersionMajor >= 6 ? 'utf-8' : 'binary'
  19080. } else {
  19081. defaultEncoding = 'utf-8'
  19082. }
  19083. module.exports = defaultEncoding
  19084. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/mock/process.js */ 46)))
  19085. /***/ }),
  19086. /* 97 */
  19087. /*!*************************************************!*\
  19088. !*** ./node_modules/pbkdf2/lib/sync-browser.js ***!
  19089. \*************************************************/
  19090. /*! no static exports found */
  19091. /***/ (function(module, exports, __webpack_require__) {
  19092. var md5 = __webpack_require__(/*! create-hash/md5 */ 90)
  19093. var RIPEMD160 = __webpack_require__(/*! ripemd160 */ 73)
  19094. var sha = __webpack_require__(/*! sha.js */ 74)
  19095. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  19096. var checkParameters = __webpack_require__(/*! ./precondition */ 95)
  19097. var defaultEncoding = __webpack_require__(/*! ./default-encoding */ 96)
  19098. var toBuffer = __webpack_require__(/*! ./to-buffer */ 98)
  19099. var ZEROS = Buffer.alloc(128)
  19100. var sizes = {
  19101. md5: 16,
  19102. sha1: 20,
  19103. sha224: 28,
  19104. sha256: 32,
  19105. sha384: 48,
  19106. sha512: 64,
  19107. rmd160: 20,
  19108. ripemd160: 20
  19109. }
  19110. function Hmac (alg, key, saltLen) {
  19111. var hash = getDigest(alg)
  19112. var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64
  19113. if (key.length > blocksize) {
  19114. key = hash(key)
  19115. } else if (key.length < blocksize) {
  19116. key = Buffer.concat([key, ZEROS], blocksize)
  19117. }
  19118. var ipad = Buffer.allocUnsafe(blocksize + sizes[alg])
  19119. var opad = Buffer.allocUnsafe(blocksize + sizes[alg])
  19120. for (var i = 0; i < blocksize; i++) {
  19121. ipad[i] = key[i] ^ 0x36
  19122. opad[i] = key[i] ^ 0x5C
  19123. }
  19124. var ipad1 = Buffer.allocUnsafe(blocksize + saltLen + 4)
  19125. ipad.copy(ipad1, 0, 0, blocksize)
  19126. this.ipad1 = ipad1
  19127. this.ipad2 = ipad
  19128. this.opad = opad
  19129. this.alg = alg
  19130. this.blocksize = blocksize
  19131. this.hash = hash
  19132. this.size = sizes[alg]
  19133. }
  19134. Hmac.prototype.run = function (data, ipad) {
  19135. data.copy(ipad, this.blocksize)
  19136. var h = this.hash(ipad)
  19137. h.copy(this.opad, this.blocksize)
  19138. return this.hash(this.opad)
  19139. }
  19140. function getDigest (alg) {
  19141. function shaFunc (data) {
  19142. return sha(alg).update(data).digest()
  19143. }
  19144. function rmd160Func (data) {
  19145. return new RIPEMD160().update(data).digest()
  19146. }
  19147. if (alg === 'rmd160' || alg === 'ripemd160') return rmd160Func
  19148. if (alg === 'md5') return md5
  19149. return shaFunc
  19150. }
  19151. function pbkdf2 (password, salt, iterations, keylen, digest) {
  19152. checkParameters(iterations, keylen)
  19153. password = toBuffer(password, defaultEncoding, 'Password')
  19154. salt = toBuffer(salt, defaultEncoding, 'Salt')
  19155. digest = digest || 'sha1'
  19156. var hmac = new Hmac(digest, password, salt.length)
  19157. var DK = Buffer.allocUnsafe(keylen)
  19158. var block1 = Buffer.allocUnsafe(salt.length + 4)
  19159. salt.copy(block1, 0, 0, salt.length)
  19160. var destPos = 0
  19161. var hLen = sizes[digest]
  19162. var l = Math.ceil(keylen / hLen)
  19163. for (var i = 1; i <= l; i++) {
  19164. block1.writeUInt32BE(i, salt.length)
  19165. var T = hmac.run(block1, hmac.ipad1)
  19166. var U = T
  19167. for (var j = 1; j < iterations; j++) {
  19168. U = hmac.run(U, hmac.ipad2)
  19169. for (var k = 0; k < hLen; k++) T[k] ^= U[k]
  19170. }
  19171. T.copy(DK, destPos)
  19172. destPos += hLen
  19173. }
  19174. return DK
  19175. }
  19176. module.exports = pbkdf2
  19177. /***/ }),
  19178. /* 98 */
  19179. /*!**********************************************!*\
  19180. !*** ./node_modules/pbkdf2/lib/to-buffer.js ***!
  19181. \**********************************************/
  19182. /*! no static exports found */
  19183. /***/ (function(module, exports, __webpack_require__) {
  19184. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  19185. module.exports = function (thing, encoding, name) {
  19186. if (Buffer.isBuffer(thing)) {
  19187. return thing
  19188. } else if (typeof thing === 'string') {
  19189. return Buffer.from(thing, encoding)
  19190. } else if (ArrayBuffer.isView(thing)) {
  19191. return Buffer.from(thing.buffer)
  19192. } else {
  19193. throw new TypeError(name + ' must be a string, a Buffer, a typed array or a DataView')
  19194. }
  19195. }
  19196. /***/ }),
  19197. /* 99 */
  19198. /*!***************************************************!*\
  19199. !*** ./node_modules/browserify-cipher/browser.js ***!
  19200. \***************************************************/
  19201. /*! no static exports found */
  19202. /***/ (function(module, exports, __webpack_require__) {
  19203. var DES = __webpack_require__(/*! browserify-des */ 100)
  19204. var aes = __webpack_require__(/*! browserify-aes/browser */ 108)
  19205. var aesModes = __webpack_require__(/*! browserify-aes/modes */ 110)
  19206. var desModes = __webpack_require__(/*! browserify-des/modes */ 127)
  19207. var ebtk = __webpack_require__(/*! evp_bytestokey */ 125)
  19208. function createCipher (suite, password) {
  19209. suite = suite.toLowerCase()
  19210. var keyLen, ivLen
  19211. if (aesModes[suite]) {
  19212. keyLen = aesModes[suite].key
  19213. ivLen = aesModes[suite].iv
  19214. } else if (desModes[suite]) {
  19215. keyLen = desModes[suite].key * 8
  19216. ivLen = desModes[suite].iv
  19217. } else {
  19218. throw new TypeError('invalid suite type')
  19219. }
  19220. var keys = ebtk(password, false, keyLen, ivLen)
  19221. return createCipheriv(suite, keys.key, keys.iv)
  19222. }
  19223. function createDecipher (suite, password) {
  19224. suite = suite.toLowerCase()
  19225. var keyLen, ivLen
  19226. if (aesModes[suite]) {
  19227. keyLen = aesModes[suite].key
  19228. ivLen = aesModes[suite].iv
  19229. } else if (desModes[suite]) {
  19230. keyLen = desModes[suite].key * 8
  19231. ivLen = desModes[suite].iv
  19232. } else {
  19233. throw new TypeError('invalid suite type')
  19234. }
  19235. var keys = ebtk(password, false, keyLen, ivLen)
  19236. return createDecipheriv(suite, keys.key, keys.iv)
  19237. }
  19238. function createCipheriv (suite, key, iv) {
  19239. suite = suite.toLowerCase()
  19240. if (aesModes[suite]) return aes.createCipheriv(suite, key, iv)
  19241. if (desModes[suite]) return new DES({ key: key, iv: iv, mode: suite })
  19242. throw new TypeError('invalid suite type')
  19243. }
  19244. function createDecipheriv (suite, key, iv) {
  19245. suite = suite.toLowerCase()
  19246. if (aesModes[suite]) return aes.createDecipheriv(suite, key, iv)
  19247. if (desModes[suite]) return new DES({ key: key, iv: iv, mode: suite, decrypt: true })
  19248. throw new TypeError('invalid suite type')
  19249. }
  19250. function getCiphers () {
  19251. return Object.keys(desModes).concat(aes.getCiphers())
  19252. }
  19253. exports.createCipher = exports.Cipher = createCipher
  19254. exports.createCipheriv = exports.Cipheriv = createCipheriv
  19255. exports.createDecipher = exports.Decipher = createDecipher
  19256. exports.createDecipheriv = exports.Decipheriv = createDecipheriv
  19257. exports.listCiphers = exports.getCiphers = getCiphers
  19258. /***/ }),
  19259. /* 100 */
  19260. /*!**********************************************!*\
  19261. !*** ./node_modules/browserify-des/index.js ***!
  19262. \**********************************************/
  19263. /*! no static exports found */
  19264. /***/ (function(module, exports, __webpack_require__) {
  19265. var CipherBase = __webpack_require__(/*! cipher-base */ 82)
  19266. var des = __webpack_require__(/*! des.js */ 101)
  19267. var inherits = __webpack_require__(/*! inherits */ 54)
  19268. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  19269. var modes = {
  19270. 'des-ede3-cbc': des.CBC.instantiate(des.EDE),
  19271. 'des-ede3': des.EDE,
  19272. 'des-ede-cbc': des.CBC.instantiate(des.EDE),
  19273. 'des-ede': des.EDE,
  19274. 'des-cbc': des.CBC.instantiate(des.DES),
  19275. 'des-ecb': des.DES
  19276. }
  19277. modes.des = modes['des-cbc']
  19278. modes.des3 = modes['des-ede3-cbc']
  19279. module.exports = DES
  19280. inherits(DES, CipherBase)
  19281. function DES (opts) {
  19282. CipherBase.call(this)
  19283. var modeName = opts.mode.toLowerCase()
  19284. var mode = modes[modeName]
  19285. var type
  19286. if (opts.decrypt) {
  19287. type = 'decrypt'
  19288. } else {
  19289. type = 'encrypt'
  19290. }
  19291. var key = opts.key
  19292. if (!Buffer.isBuffer(key)) {
  19293. key = Buffer.from(key)
  19294. }
  19295. if (modeName === 'des-ede' || modeName === 'des-ede-cbc') {
  19296. key = Buffer.concat([key, key.slice(0, 8)])
  19297. }
  19298. var iv = opts.iv
  19299. if (!Buffer.isBuffer(iv)) {
  19300. iv = Buffer.from(iv)
  19301. }
  19302. this._des = mode.create({
  19303. key: key,
  19304. iv: iv,
  19305. type: type
  19306. })
  19307. }
  19308. DES.prototype._update = function (data) {
  19309. return Buffer.from(this._des.update(data))
  19310. }
  19311. DES.prototype._final = function () {
  19312. return Buffer.from(this._des.final())
  19313. }
  19314. /***/ }),
  19315. /* 101 */
  19316. /*!****************************************!*\
  19317. !*** ./node_modules/des.js/lib/des.js ***!
  19318. \****************************************/
  19319. /*! no static exports found */
  19320. /***/ (function(module, exports, __webpack_require__) {
  19321. "use strict";
  19322. exports.utils = __webpack_require__(/*! ./des/utils */ 102);
  19323. exports.Cipher = __webpack_require__(/*! ./des/cipher */ 103);
  19324. exports.DES = __webpack_require__(/*! ./des/des */ 105);
  19325. exports.CBC = __webpack_require__(/*! ./des/cbc */ 106);
  19326. exports.EDE = __webpack_require__(/*! ./des/ede */ 107);
  19327. /***/ }),
  19328. /* 102 */
  19329. /*!**********************************************!*\
  19330. !*** ./node_modules/des.js/lib/des/utils.js ***!
  19331. \**********************************************/
  19332. /*! no static exports found */
  19333. /***/ (function(module, exports, __webpack_require__) {
  19334. "use strict";
  19335. exports.readUInt32BE = function readUInt32BE(bytes, off) {
  19336. var res = (bytes[0 + off] << 24) |
  19337. (bytes[1 + off] << 16) |
  19338. (bytes[2 + off] << 8) |
  19339. bytes[3 + off];
  19340. return res >>> 0;
  19341. };
  19342. exports.writeUInt32BE = function writeUInt32BE(bytes, value, off) {
  19343. bytes[0 + off] = value >>> 24;
  19344. bytes[1 + off] = (value >>> 16) & 0xff;
  19345. bytes[2 + off] = (value >>> 8) & 0xff;
  19346. bytes[3 + off] = value & 0xff;
  19347. };
  19348. exports.ip = function ip(inL, inR, out, off) {
  19349. var outL = 0;
  19350. var outR = 0;
  19351. for (var i = 6; i >= 0; i -= 2) {
  19352. for (var j = 0; j <= 24; j += 8) {
  19353. outL <<= 1;
  19354. outL |= (inR >>> (j + i)) & 1;
  19355. }
  19356. for (var j = 0; j <= 24; j += 8) {
  19357. outL <<= 1;
  19358. outL |= (inL >>> (j + i)) & 1;
  19359. }
  19360. }
  19361. for (var i = 6; i >= 0; i -= 2) {
  19362. for (var j = 1; j <= 25; j += 8) {
  19363. outR <<= 1;
  19364. outR |= (inR >>> (j + i)) & 1;
  19365. }
  19366. for (var j = 1; j <= 25; j += 8) {
  19367. outR <<= 1;
  19368. outR |= (inL >>> (j + i)) & 1;
  19369. }
  19370. }
  19371. out[off + 0] = outL >>> 0;
  19372. out[off + 1] = outR >>> 0;
  19373. };
  19374. exports.rip = function rip(inL, inR, out, off) {
  19375. var outL = 0;
  19376. var outR = 0;
  19377. for (var i = 0; i < 4; i++) {
  19378. for (var j = 24; j >= 0; j -= 8) {
  19379. outL <<= 1;
  19380. outL |= (inR >>> (j + i)) & 1;
  19381. outL <<= 1;
  19382. outL |= (inL >>> (j + i)) & 1;
  19383. }
  19384. }
  19385. for (var i = 4; i < 8; i++) {
  19386. for (var j = 24; j >= 0; j -= 8) {
  19387. outR <<= 1;
  19388. outR |= (inR >>> (j + i)) & 1;
  19389. outR <<= 1;
  19390. outR |= (inL >>> (j + i)) & 1;
  19391. }
  19392. }
  19393. out[off + 0] = outL >>> 0;
  19394. out[off + 1] = outR >>> 0;
  19395. };
  19396. exports.pc1 = function pc1(inL, inR, out, off) {
  19397. var outL = 0;
  19398. var outR = 0;
  19399. // 7, 15, 23, 31, 39, 47, 55, 63
  19400. // 6, 14, 22, 30, 39, 47, 55, 63
  19401. // 5, 13, 21, 29, 39, 47, 55, 63
  19402. // 4, 12, 20, 28
  19403. for (var i = 7; i >= 5; i--) {
  19404. for (var j = 0; j <= 24; j += 8) {
  19405. outL <<= 1;
  19406. outL |= (inR >> (j + i)) & 1;
  19407. }
  19408. for (var j = 0; j <= 24; j += 8) {
  19409. outL <<= 1;
  19410. outL |= (inL >> (j + i)) & 1;
  19411. }
  19412. }
  19413. for (var j = 0; j <= 24; j += 8) {
  19414. outL <<= 1;
  19415. outL |= (inR >> (j + i)) & 1;
  19416. }
  19417. // 1, 9, 17, 25, 33, 41, 49, 57
  19418. // 2, 10, 18, 26, 34, 42, 50, 58
  19419. // 3, 11, 19, 27, 35, 43, 51, 59
  19420. // 36, 44, 52, 60
  19421. for (var i = 1; i <= 3; i++) {
  19422. for (var j = 0; j <= 24; j += 8) {
  19423. outR <<= 1;
  19424. outR |= (inR >> (j + i)) & 1;
  19425. }
  19426. for (var j = 0; j <= 24; j += 8) {
  19427. outR <<= 1;
  19428. outR |= (inL >> (j + i)) & 1;
  19429. }
  19430. }
  19431. for (var j = 0; j <= 24; j += 8) {
  19432. outR <<= 1;
  19433. outR |= (inL >> (j + i)) & 1;
  19434. }
  19435. out[off + 0] = outL >>> 0;
  19436. out[off + 1] = outR >>> 0;
  19437. };
  19438. exports.r28shl = function r28shl(num, shift) {
  19439. return ((num << shift) & 0xfffffff) | (num >>> (28 - shift));
  19440. };
  19441. var pc2table = [
  19442. // inL => outL
  19443. 14, 11, 17, 4, 27, 23, 25, 0,
  19444. 13, 22, 7, 18, 5, 9, 16, 24,
  19445. 2, 20, 12, 21, 1, 8, 15, 26,
  19446. // inR => outR
  19447. 15, 4, 25, 19, 9, 1, 26, 16,
  19448. 5, 11, 23, 8, 12, 7, 17, 0,
  19449. 22, 3, 10, 14, 6, 20, 27, 24
  19450. ];
  19451. exports.pc2 = function pc2(inL, inR, out, off) {
  19452. var outL = 0;
  19453. var outR = 0;
  19454. var len = pc2table.length >>> 1;
  19455. for (var i = 0; i < len; i++) {
  19456. outL <<= 1;
  19457. outL |= (inL >>> pc2table[i]) & 0x1;
  19458. }
  19459. for (var i = len; i < pc2table.length; i++) {
  19460. outR <<= 1;
  19461. outR |= (inR >>> pc2table[i]) & 0x1;
  19462. }
  19463. out[off + 0] = outL >>> 0;
  19464. out[off + 1] = outR >>> 0;
  19465. };
  19466. exports.expand = function expand(r, out, off) {
  19467. var outL = 0;
  19468. var outR = 0;
  19469. outL = ((r & 1) << 5) | (r >>> 27);
  19470. for (var i = 23; i >= 15; i -= 4) {
  19471. outL <<= 6;
  19472. outL |= (r >>> i) & 0x3f;
  19473. }
  19474. for (var i = 11; i >= 3; i -= 4) {
  19475. outR |= (r >>> i) & 0x3f;
  19476. outR <<= 6;
  19477. }
  19478. outR |= ((r & 0x1f) << 1) | (r >>> 31);
  19479. out[off + 0] = outL >>> 0;
  19480. out[off + 1] = outR >>> 0;
  19481. };
  19482. var sTable = [
  19483. 14, 0, 4, 15, 13, 7, 1, 4, 2, 14, 15, 2, 11, 13, 8, 1,
  19484. 3, 10, 10, 6, 6, 12, 12, 11, 5, 9, 9, 5, 0, 3, 7, 8,
  19485. 4, 15, 1, 12, 14, 8, 8, 2, 13, 4, 6, 9, 2, 1, 11, 7,
  19486. 15, 5, 12, 11, 9, 3, 7, 14, 3, 10, 10, 0, 5, 6, 0, 13,
  19487. 15, 3, 1, 13, 8, 4, 14, 7, 6, 15, 11, 2, 3, 8, 4, 14,
  19488. 9, 12, 7, 0, 2, 1, 13, 10, 12, 6, 0, 9, 5, 11, 10, 5,
  19489. 0, 13, 14, 8, 7, 10, 11, 1, 10, 3, 4, 15, 13, 4, 1, 2,
  19490. 5, 11, 8, 6, 12, 7, 6, 12, 9, 0, 3, 5, 2, 14, 15, 9,
  19491. 10, 13, 0, 7, 9, 0, 14, 9, 6, 3, 3, 4, 15, 6, 5, 10,
  19492. 1, 2, 13, 8, 12, 5, 7, 14, 11, 12, 4, 11, 2, 15, 8, 1,
  19493. 13, 1, 6, 10, 4, 13, 9, 0, 8, 6, 15, 9, 3, 8, 0, 7,
  19494. 11, 4, 1, 15, 2, 14, 12, 3, 5, 11, 10, 5, 14, 2, 7, 12,
  19495. 7, 13, 13, 8, 14, 11, 3, 5, 0, 6, 6, 15, 9, 0, 10, 3,
  19496. 1, 4, 2, 7, 8, 2, 5, 12, 11, 1, 12, 10, 4, 14, 15, 9,
  19497. 10, 3, 6, 15, 9, 0, 0, 6, 12, 10, 11, 1, 7, 13, 13, 8,
  19498. 15, 9, 1, 4, 3, 5, 14, 11, 5, 12, 2, 7, 8, 2, 4, 14,
  19499. 2, 14, 12, 11, 4, 2, 1, 12, 7, 4, 10, 7, 11, 13, 6, 1,
  19500. 8, 5, 5, 0, 3, 15, 15, 10, 13, 3, 0, 9, 14, 8, 9, 6,
  19501. 4, 11, 2, 8, 1, 12, 11, 7, 10, 1, 13, 14, 7, 2, 8, 13,
  19502. 15, 6, 9, 15, 12, 0, 5, 9, 6, 10, 3, 4, 0, 5, 14, 3,
  19503. 12, 10, 1, 15, 10, 4, 15, 2, 9, 7, 2, 12, 6, 9, 8, 5,
  19504. 0, 6, 13, 1, 3, 13, 4, 14, 14, 0, 7, 11, 5, 3, 11, 8,
  19505. 9, 4, 14, 3, 15, 2, 5, 12, 2, 9, 8, 5, 12, 15, 3, 10,
  19506. 7, 11, 0, 14, 4, 1, 10, 7, 1, 6, 13, 0, 11, 8, 6, 13,
  19507. 4, 13, 11, 0, 2, 11, 14, 7, 15, 4, 0, 9, 8, 1, 13, 10,
  19508. 3, 14, 12, 3, 9, 5, 7, 12, 5, 2, 10, 15, 6, 8, 1, 6,
  19509. 1, 6, 4, 11, 11, 13, 13, 8, 12, 1, 3, 4, 7, 10, 14, 7,
  19510. 10, 9, 15, 5, 6, 0, 8, 15, 0, 14, 5, 2, 9, 3, 2, 12,
  19511. 13, 1, 2, 15, 8, 13, 4, 8, 6, 10, 15, 3, 11, 7, 1, 4,
  19512. 10, 12, 9, 5, 3, 6, 14, 11, 5, 0, 0, 14, 12, 9, 7, 2,
  19513. 7, 2, 11, 1, 4, 14, 1, 7, 9, 4, 12, 10, 14, 8, 2, 13,
  19514. 0, 15, 6, 12, 10, 9, 13, 0, 15, 3, 3, 5, 5, 6, 8, 11
  19515. ];
  19516. exports.substitute = function substitute(inL, inR) {
  19517. var out = 0;
  19518. for (var i = 0; i < 4; i++) {
  19519. var b = (inL >>> (18 - i * 6)) & 0x3f;
  19520. var sb = sTable[i * 0x40 + b];
  19521. out <<= 4;
  19522. out |= sb;
  19523. }
  19524. for (var i = 0; i < 4; i++) {
  19525. var b = (inR >>> (18 - i * 6)) & 0x3f;
  19526. var sb = sTable[4 * 0x40 + i * 0x40 + b];
  19527. out <<= 4;
  19528. out |= sb;
  19529. }
  19530. return out >>> 0;
  19531. };
  19532. var permuteTable = [
  19533. 16, 25, 12, 11, 3, 20, 4, 15, 31, 17, 9, 6, 27, 14, 1, 22,
  19534. 30, 24, 8, 18, 0, 5, 29, 23, 13, 19, 2, 26, 10, 21, 28, 7
  19535. ];
  19536. exports.permute = function permute(num) {
  19537. var out = 0;
  19538. for (var i = 0; i < permuteTable.length; i++) {
  19539. out <<= 1;
  19540. out |= (num >>> permuteTable[i]) & 0x1;
  19541. }
  19542. return out >>> 0;
  19543. };
  19544. exports.padSplit = function padSplit(num, size, group) {
  19545. var str = num.toString(2);
  19546. while (str.length < size)
  19547. str = '0' + str;
  19548. var out = [];
  19549. for (var i = 0; i < size; i += group)
  19550. out.push(str.slice(i, i + group));
  19551. return out.join(' ');
  19552. };
  19553. /***/ }),
  19554. /* 103 */
  19555. /*!***********************************************!*\
  19556. !*** ./node_modules/des.js/lib/des/cipher.js ***!
  19557. \***********************************************/
  19558. /*! no static exports found */
  19559. /***/ (function(module, exports, __webpack_require__) {
  19560. "use strict";
  19561. var assert = __webpack_require__(/*! minimalistic-assert */ 104);
  19562. function Cipher(options) {
  19563. this.options = options;
  19564. this.type = this.options.type;
  19565. this.blockSize = 8;
  19566. this._init();
  19567. this.buffer = new Array(this.blockSize);
  19568. this.bufferOff = 0;
  19569. }
  19570. module.exports = Cipher;
  19571. Cipher.prototype._init = function _init() {
  19572. // Might be overrided
  19573. };
  19574. Cipher.prototype.update = function update(data) {
  19575. if (data.length === 0)
  19576. return [];
  19577. if (this.type === 'decrypt')
  19578. return this._updateDecrypt(data);
  19579. else
  19580. return this._updateEncrypt(data);
  19581. };
  19582. Cipher.prototype._buffer = function _buffer(data, off) {
  19583. // Append data to buffer
  19584. var min = Math.min(this.buffer.length - this.bufferOff, data.length - off);
  19585. for (var i = 0; i < min; i++)
  19586. this.buffer[this.bufferOff + i] = data[off + i];
  19587. this.bufferOff += min;
  19588. // Shift next
  19589. return min;
  19590. };
  19591. Cipher.prototype._flushBuffer = function _flushBuffer(out, off) {
  19592. this._update(this.buffer, 0, out, off);
  19593. this.bufferOff = 0;
  19594. return this.blockSize;
  19595. };
  19596. Cipher.prototype._updateEncrypt = function _updateEncrypt(data) {
  19597. var inputOff = 0;
  19598. var outputOff = 0;
  19599. var count = ((this.bufferOff + data.length) / this.blockSize) | 0;
  19600. var out = new Array(count * this.blockSize);
  19601. if (this.bufferOff !== 0) {
  19602. inputOff += this._buffer(data, inputOff);
  19603. if (this.bufferOff === this.buffer.length)
  19604. outputOff += this._flushBuffer(out, outputOff);
  19605. }
  19606. // Write blocks
  19607. var max = data.length - ((data.length - inputOff) % this.blockSize);
  19608. for (; inputOff < max; inputOff += this.blockSize) {
  19609. this._update(data, inputOff, out, outputOff);
  19610. outputOff += this.blockSize;
  19611. }
  19612. // Queue rest
  19613. for (; inputOff < data.length; inputOff++, this.bufferOff++)
  19614. this.buffer[this.bufferOff] = data[inputOff];
  19615. return out;
  19616. };
  19617. Cipher.prototype._updateDecrypt = function _updateDecrypt(data) {
  19618. var inputOff = 0;
  19619. var outputOff = 0;
  19620. var count = Math.ceil((this.bufferOff + data.length) / this.blockSize) - 1;
  19621. var out = new Array(count * this.blockSize);
  19622. // TODO(indutny): optimize it, this is far from optimal
  19623. for (; count > 0; count--) {
  19624. inputOff += this._buffer(data, inputOff);
  19625. outputOff += this._flushBuffer(out, outputOff);
  19626. }
  19627. // Buffer rest of the input
  19628. inputOff += this._buffer(data, inputOff);
  19629. return out;
  19630. };
  19631. Cipher.prototype.final = function final(buffer) {
  19632. var first;
  19633. if (buffer)
  19634. first = this.update(buffer);
  19635. var last;
  19636. if (this.type === 'encrypt')
  19637. last = this._finalEncrypt();
  19638. else
  19639. last = this._finalDecrypt();
  19640. if (first)
  19641. return first.concat(last);
  19642. else
  19643. return last;
  19644. };
  19645. Cipher.prototype._pad = function _pad(buffer, off) {
  19646. if (off === 0)
  19647. return false;
  19648. while (off < buffer.length)
  19649. buffer[off++] = 0;
  19650. return true;
  19651. };
  19652. Cipher.prototype._finalEncrypt = function _finalEncrypt() {
  19653. if (!this._pad(this.buffer, this.bufferOff))
  19654. return [];
  19655. var out = new Array(this.blockSize);
  19656. this._update(this.buffer, 0, out, 0);
  19657. return out;
  19658. };
  19659. Cipher.prototype._unpad = function _unpad(buffer) {
  19660. return buffer;
  19661. };
  19662. Cipher.prototype._finalDecrypt = function _finalDecrypt() {
  19663. assert.equal(this.bufferOff, this.blockSize, 'Not enough data to decrypt');
  19664. var out = new Array(this.blockSize);
  19665. this._flushBuffer(out, 0);
  19666. return this._unpad(out);
  19667. };
  19668. /***/ }),
  19669. /* 104 */
  19670. /*!***************************************************!*\
  19671. !*** ./node_modules/minimalistic-assert/index.js ***!
  19672. \***************************************************/
  19673. /*! no static exports found */
  19674. /***/ (function(module, exports) {
  19675. module.exports = assert;
  19676. function assert(val, msg) {
  19677. if (!val)
  19678. throw new Error(msg || 'Assertion failed');
  19679. }
  19680. assert.equal = function assertEqual(l, r, msg) {
  19681. if (l != r)
  19682. throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r));
  19683. };
  19684. /***/ }),
  19685. /* 105 */
  19686. /*!********************************************!*\
  19687. !*** ./node_modules/des.js/lib/des/des.js ***!
  19688. \********************************************/
  19689. /*! no static exports found */
  19690. /***/ (function(module, exports, __webpack_require__) {
  19691. "use strict";
  19692. var assert = __webpack_require__(/*! minimalistic-assert */ 104);
  19693. var inherits = __webpack_require__(/*! inherits */ 54);
  19694. var utils = __webpack_require__(/*! ./utils */ 102);
  19695. var Cipher = __webpack_require__(/*! ./cipher */ 103);
  19696. function DESState() {
  19697. this.tmp = new Array(2);
  19698. this.keys = null;
  19699. }
  19700. function DES(options) {
  19701. Cipher.call(this, options);
  19702. var state = new DESState();
  19703. this._desState = state;
  19704. this.deriveKeys(state, options.key);
  19705. }
  19706. inherits(DES, Cipher);
  19707. module.exports = DES;
  19708. DES.create = function create(options) {
  19709. return new DES(options);
  19710. };
  19711. var shiftTable = [
  19712. 1, 1, 2, 2, 2, 2, 2, 2,
  19713. 1, 2, 2, 2, 2, 2, 2, 1
  19714. ];
  19715. DES.prototype.deriveKeys = function deriveKeys(state, key) {
  19716. state.keys = new Array(16 * 2);
  19717. assert.equal(key.length, this.blockSize, 'Invalid key length');
  19718. var kL = utils.readUInt32BE(key, 0);
  19719. var kR = utils.readUInt32BE(key, 4);
  19720. utils.pc1(kL, kR, state.tmp, 0);
  19721. kL = state.tmp[0];
  19722. kR = state.tmp[1];
  19723. for (var i = 0; i < state.keys.length; i += 2) {
  19724. var shift = shiftTable[i >>> 1];
  19725. kL = utils.r28shl(kL, shift);
  19726. kR = utils.r28shl(kR, shift);
  19727. utils.pc2(kL, kR, state.keys, i);
  19728. }
  19729. };
  19730. DES.prototype._update = function _update(inp, inOff, out, outOff) {
  19731. var state = this._desState;
  19732. var l = utils.readUInt32BE(inp, inOff);
  19733. var r = utils.readUInt32BE(inp, inOff + 4);
  19734. // Initial Permutation
  19735. utils.ip(l, r, state.tmp, 0);
  19736. l = state.tmp[0];
  19737. r = state.tmp[1];
  19738. if (this.type === 'encrypt')
  19739. this._encrypt(state, l, r, state.tmp, 0);
  19740. else
  19741. this._decrypt(state, l, r, state.tmp, 0);
  19742. l = state.tmp[0];
  19743. r = state.tmp[1];
  19744. utils.writeUInt32BE(out, l, outOff);
  19745. utils.writeUInt32BE(out, r, outOff + 4);
  19746. };
  19747. DES.prototype._pad = function _pad(buffer, off) {
  19748. var value = buffer.length - off;
  19749. for (var i = off; i < buffer.length; i++)
  19750. buffer[i] = value;
  19751. return true;
  19752. };
  19753. DES.prototype._unpad = function _unpad(buffer) {
  19754. var pad = buffer[buffer.length - 1];
  19755. for (var i = buffer.length - pad; i < buffer.length; i++)
  19756. assert.equal(buffer[i], pad);
  19757. return buffer.slice(0, buffer.length - pad);
  19758. };
  19759. DES.prototype._encrypt = function _encrypt(state, lStart, rStart, out, off) {
  19760. var l = lStart;
  19761. var r = rStart;
  19762. // Apply f() x16 times
  19763. for (var i = 0; i < state.keys.length; i += 2) {
  19764. var keyL = state.keys[i];
  19765. var keyR = state.keys[i + 1];
  19766. // f(r, k)
  19767. utils.expand(r, state.tmp, 0);
  19768. keyL ^= state.tmp[0];
  19769. keyR ^= state.tmp[1];
  19770. var s = utils.substitute(keyL, keyR);
  19771. var f = utils.permute(s);
  19772. var t = r;
  19773. r = (l ^ f) >>> 0;
  19774. l = t;
  19775. }
  19776. // Reverse Initial Permutation
  19777. utils.rip(r, l, out, off);
  19778. };
  19779. DES.prototype._decrypt = function _decrypt(state, lStart, rStart, out, off) {
  19780. var l = rStart;
  19781. var r = lStart;
  19782. // Apply f() x16 times
  19783. for (var i = state.keys.length - 2; i >= 0; i -= 2) {
  19784. var keyL = state.keys[i];
  19785. var keyR = state.keys[i + 1];
  19786. // f(r, k)
  19787. utils.expand(l, state.tmp, 0);
  19788. keyL ^= state.tmp[0];
  19789. keyR ^= state.tmp[1];
  19790. var s = utils.substitute(keyL, keyR);
  19791. var f = utils.permute(s);
  19792. var t = l;
  19793. l = (r ^ f) >>> 0;
  19794. r = t;
  19795. }
  19796. // Reverse Initial Permutation
  19797. utils.rip(l, r, out, off);
  19798. };
  19799. /***/ }),
  19800. /* 106 */
  19801. /*!********************************************!*\
  19802. !*** ./node_modules/des.js/lib/des/cbc.js ***!
  19803. \********************************************/
  19804. /*! no static exports found */
  19805. /***/ (function(module, exports, __webpack_require__) {
  19806. "use strict";
  19807. var assert = __webpack_require__(/*! minimalistic-assert */ 104);
  19808. var inherits = __webpack_require__(/*! inherits */ 54);
  19809. var proto = {};
  19810. function CBCState(iv) {
  19811. assert.equal(iv.length, 8, 'Invalid IV length');
  19812. this.iv = new Array(8);
  19813. for (var i = 0; i < this.iv.length; i++)
  19814. this.iv[i] = iv[i];
  19815. }
  19816. function instantiate(Base) {
  19817. function CBC(options) {
  19818. Base.call(this, options);
  19819. this._cbcInit();
  19820. }
  19821. inherits(CBC, Base);
  19822. var keys = Object.keys(proto);
  19823. for (var i = 0; i < keys.length; i++) {
  19824. var key = keys[i];
  19825. CBC.prototype[key] = proto[key];
  19826. }
  19827. CBC.create = function create(options) {
  19828. return new CBC(options);
  19829. };
  19830. return CBC;
  19831. }
  19832. exports.instantiate = instantiate;
  19833. proto._cbcInit = function _cbcInit() {
  19834. var state = new CBCState(this.options.iv);
  19835. this._cbcState = state;
  19836. };
  19837. proto._update = function _update(inp, inOff, out, outOff) {
  19838. var state = this._cbcState;
  19839. var superProto = this.constructor.super_.prototype;
  19840. var iv = state.iv;
  19841. if (this.type === 'encrypt') {
  19842. for (var i = 0; i < this.blockSize; i++)
  19843. iv[i] ^= inp[inOff + i];
  19844. superProto._update.call(this, iv, 0, out, outOff);
  19845. for (var i = 0; i < this.blockSize; i++)
  19846. iv[i] = out[outOff + i];
  19847. } else {
  19848. superProto._update.call(this, inp, inOff, out, outOff);
  19849. for (var i = 0; i < this.blockSize; i++)
  19850. out[outOff + i] ^= iv[i];
  19851. for (var i = 0; i < this.blockSize; i++)
  19852. iv[i] = inp[inOff + i];
  19853. }
  19854. };
  19855. /***/ }),
  19856. /* 107 */
  19857. /*!********************************************!*\
  19858. !*** ./node_modules/des.js/lib/des/ede.js ***!
  19859. \********************************************/
  19860. /*! no static exports found */
  19861. /***/ (function(module, exports, __webpack_require__) {
  19862. "use strict";
  19863. var assert = __webpack_require__(/*! minimalistic-assert */ 104);
  19864. var inherits = __webpack_require__(/*! inherits */ 54);
  19865. var Cipher = __webpack_require__(/*! ./cipher */ 103);
  19866. var DES = __webpack_require__(/*! ./des */ 105);
  19867. function EDEState(type, key) {
  19868. assert.equal(key.length, 24, 'Invalid key length');
  19869. var k1 = key.slice(0, 8);
  19870. var k2 = key.slice(8, 16);
  19871. var k3 = key.slice(16, 24);
  19872. if (type === 'encrypt') {
  19873. this.ciphers = [
  19874. DES.create({ type: 'encrypt', key: k1 }),
  19875. DES.create({ type: 'decrypt', key: k2 }),
  19876. DES.create({ type: 'encrypt', key: k3 })
  19877. ];
  19878. } else {
  19879. this.ciphers = [
  19880. DES.create({ type: 'decrypt', key: k3 }),
  19881. DES.create({ type: 'encrypt', key: k2 }),
  19882. DES.create({ type: 'decrypt', key: k1 })
  19883. ];
  19884. }
  19885. }
  19886. function EDE(options) {
  19887. Cipher.call(this, options);
  19888. var state = new EDEState(this.type, this.options.key);
  19889. this._edeState = state;
  19890. }
  19891. inherits(EDE, Cipher);
  19892. module.exports = EDE;
  19893. EDE.create = function create(options) {
  19894. return new EDE(options);
  19895. };
  19896. EDE.prototype._update = function _update(inp, inOff, out, outOff) {
  19897. var state = this._edeState;
  19898. state.ciphers[0]._update(inp, inOff, out, outOff);
  19899. state.ciphers[1]._update(out, outOff, out, outOff);
  19900. state.ciphers[2]._update(out, outOff, out, outOff);
  19901. };
  19902. EDE.prototype._pad = DES.prototype._pad;
  19903. EDE.prototype._unpad = DES.prototype._unpad;
  19904. /***/ }),
  19905. /* 108 */
  19906. /*!************************************************!*\
  19907. !*** ./node_modules/browserify-aes/browser.js ***!
  19908. \************************************************/
  19909. /*! no static exports found */
  19910. /***/ (function(module, exports, __webpack_require__) {
  19911. var ciphers = __webpack_require__(/*! ./encrypter */ 109)
  19912. var deciphers = __webpack_require__(/*! ./decrypter */ 126)
  19913. var modes = __webpack_require__(/*! ./modes/list.json */ 120)
  19914. function getCiphers () {
  19915. return Object.keys(modes)
  19916. }
  19917. exports.createCipher = exports.Cipher = ciphers.createCipher
  19918. exports.createCipheriv = exports.Cipheriv = ciphers.createCipheriv
  19919. exports.createDecipher = exports.Decipher = deciphers.createDecipher
  19920. exports.createDecipheriv = exports.Decipheriv = deciphers.createDecipheriv
  19921. exports.listCiphers = exports.getCiphers = getCiphers
  19922. /***/ }),
  19923. /* 109 */
  19924. /*!**************************************************!*\
  19925. !*** ./node_modules/browserify-aes/encrypter.js ***!
  19926. \**************************************************/
  19927. /*! no static exports found */
  19928. /***/ (function(module, exports, __webpack_require__) {
  19929. var MODES = __webpack_require__(/*! ./modes */ 110)
  19930. var AuthCipher = __webpack_require__(/*! ./authCipher */ 121)
  19931. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  19932. var StreamCipher = __webpack_require__(/*! ./streamCipher */ 124)
  19933. var Transform = __webpack_require__(/*! cipher-base */ 82)
  19934. var aes = __webpack_require__(/*! ./aes */ 122)
  19935. var ebtk = __webpack_require__(/*! evp_bytestokey */ 125)
  19936. var inherits = __webpack_require__(/*! inherits */ 54)
  19937. function Cipher (mode, key, iv) {
  19938. Transform.call(this)
  19939. this._cache = new Splitter()
  19940. this._cipher = new aes.AES(key)
  19941. this._prev = Buffer.from(iv)
  19942. this._mode = mode
  19943. this._autopadding = true
  19944. }
  19945. inherits(Cipher, Transform)
  19946. Cipher.prototype._update = function (data) {
  19947. this._cache.add(data)
  19948. var chunk
  19949. var thing
  19950. var out = []
  19951. while ((chunk = this._cache.get())) {
  19952. thing = this._mode.encrypt(this, chunk)
  19953. out.push(thing)
  19954. }
  19955. return Buffer.concat(out)
  19956. }
  19957. var PADDING = Buffer.alloc(16, 0x10)
  19958. Cipher.prototype._final = function () {
  19959. var chunk = this._cache.flush()
  19960. if (this._autopadding) {
  19961. chunk = this._mode.encrypt(this, chunk)
  19962. this._cipher.scrub()
  19963. return chunk
  19964. }
  19965. if (!chunk.equals(PADDING)) {
  19966. this._cipher.scrub()
  19967. throw new Error('data not multiple of block length')
  19968. }
  19969. }
  19970. Cipher.prototype.setAutoPadding = function (setTo) {
  19971. this._autopadding = !!setTo
  19972. return this
  19973. }
  19974. function Splitter () {
  19975. this.cache = Buffer.allocUnsafe(0)
  19976. }
  19977. Splitter.prototype.add = function (data) {
  19978. this.cache = Buffer.concat([this.cache, data])
  19979. }
  19980. Splitter.prototype.get = function () {
  19981. if (this.cache.length > 15) {
  19982. var out = this.cache.slice(0, 16)
  19983. this.cache = this.cache.slice(16)
  19984. return out
  19985. }
  19986. return null
  19987. }
  19988. Splitter.prototype.flush = function () {
  19989. var len = 16 - this.cache.length
  19990. var padBuff = Buffer.allocUnsafe(len)
  19991. var i = -1
  19992. while (++i < len) {
  19993. padBuff.writeUInt8(len, i)
  19994. }
  19995. return Buffer.concat([this.cache, padBuff])
  19996. }
  19997. function createCipheriv (suite, password, iv) {
  19998. var config = MODES[suite.toLowerCase()]
  19999. if (!config) throw new TypeError('invalid suite type')
  20000. if (typeof password === 'string') password = Buffer.from(password)
  20001. if (password.length !== config.key / 8) throw new TypeError('invalid key length ' + password.length)
  20002. if (typeof iv === 'string') iv = Buffer.from(iv)
  20003. if (config.mode !== 'GCM' && iv.length !== config.iv) throw new TypeError('invalid iv length ' + iv.length)
  20004. if (config.type === 'stream') {
  20005. return new StreamCipher(config.module, password, iv)
  20006. } else if (config.type === 'auth') {
  20007. return new AuthCipher(config.module, password, iv)
  20008. }
  20009. return new Cipher(config.module, password, iv)
  20010. }
  20011. function createCipher (suite, password) {
  20012. var config = MODES[suite.toLowerCase()]
  20013. if (!config) throw new TypeError('invalid suite type')
  20014. var keys = ebtk(password, false, config.key, config.iv)
  20015. return createCipheriv(suite, keys.key, keys.iv)
  20016. }
  20017. exports.createCipheriv = createCipheriv
  20018. exports.createCipher = createCipher
  20019. /***/ }),
  20020. /* 110 */
  20021. /*!****************************************************!*\
  20022. !*** ./node_modules/browserify-aes/modes/index.js ***!
  20023. \****************************************************/
  20024. /*! no static exports found */
  20025. /***/ (function(module, exports, __webpack_require__) {
  20026. var modeModules = {
  20027. ECB: __webpack_require__(/*! ./ecb */ 111),
  20028. CBC: __webpack_require__(/*! ./cbc */ 112),
  20029. CFB: __webpack_require__(/*! ./cfb */ 114),
  20030. CFB8: __webpack_require__(/*! ./cfb8 */ 115),
  20031. CFB1: __webpack_require__(/*! ./cfb1 */ 116),
  20032. OFB: __webpack_require__(/*! ./ofb */ 117),
  20033. CTR: __webpack_require__(/*! ./ctr */ 118),
  20034. GCM: __webpack_require__(/*! ./ctr */ 118)
  20035. }
  20036. var modes = __webpack_require__(/*! ./list.json */ 120)
  20037. for (var key in modes) {
  20038. modes[key].module = modeModules[modes[key].mode]
  20039. }
  20040. module.exports = modes
  20041. /***/ }),
  20042. /* 111 */
  20043. /*!**************************************************!*\
  20044. !*** ./node_modules/browserify-aes/modes/ecb.js ***!
  20045. \**************************************************/
  20046. /*! no static exports found */
  20047. /***/ (function(module, exports) {
  20048. exports.encrypt = function (self, block) {
  20049. return self._cipher.encryptBlock(block)
  20050. }
  20051. exports.decrypt = function (self, block) {
  20052. return self._cipher.decryptBlock(block)
  20053. }
  20054. /***/ }),
  20055. /* 112 */
  20056. /*!**************************************************!*\
  20057. !*** ./node_modules/browserify-aes/modes/cbc.js ***!
  20058. \**************************************************/
  20059. /*! no static exports found */
  20060. /***/ (function(module, exports, __webpack_require__) {
  20061. var xor = __webpack_require__(/*! buffer-xor */ 113)
  20062. exports.encrypt = function (self, block) {
  20063. var data = xor(block, self._prev)
  20064. self._prev = self._cipher.encryptBlock(data)
  20065. return self._prev
  20066. }
  20067. exports.decrypt = function (self, block) {
  20068. var pad = self._prev
  20069. self._prev = block
  20070. var out = self._cipher.decryptBlock(block)
  20071. return xor(out, pad)
  20072. }
  20073. /***/ }),
  20074. /* 113 */
  20075. /*!******************************************!*\
  20076. !*** ./node_modules/buffer-xor/index.js ***!
  20077. \******************************************/
  20078. /*! no static exports found */
  20079. /***/ (function(module, exports, __webpack_require__) {
  20080. /* WEBPACK VAR INJECTION */(function(Buffer) {module.exports = function xor (a, b) {
  20081. var length = Math.min(a.length, b.length)
  20082. var buffer = new Buffer(length)
  20083. for (var i = 0; i < length; ++i) {
  20084. buffer[i] = a[i] ^ b[i]
  20085. }
  20086. return buffer
  20087. }
  20088. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ 49).Buffer))
  20089. /***/ }),
  20090. /* 114 */
  20091. /*!**************************************************!*\
  20092. !*** ./node_modules/browserify-aes/modes/cfb.js ***!
  20093. \**************************************************/
  20094. /*! no static exports found */
  20095. /***/ (function(module, exports, __webpack_require__) {
  20096. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  20097. var xor = __webpack_require__(/*! buffer-xor */ 113)
  20098. function encryptStart (self, data, decrypt) {
  20099. var len = data.length
  20100. var out = xor(data, self._cache)
  20101. self._cache = self._cache.slice(len)
  20102. self._prev = Buffer.concat([self._prev, decrypt ? data : out])
  20103. return out
  20104. }
  20105. exports.encrypt = function (self, data, decrypt) {
  20106. var out = Buffer.allocUnsafe(0)
  20107. var len
  20108. while (data.length) {
  20109. if (self._cache.length === 0) {
  20110. self._cache = self._cipher.encryptBlock(self._prev)
  20111. self._prev = Buffer.allocUnsafe(0)
  20112. }
  20113. if (self._cache.length <= data.length) {
  20114. len = self._cache.length
  20115. out = Buffer.concat([out, encryptStart(self, data.slice(0, len), decrypt)])
  20116. data = data.slice(len)
  20117. } else {
  20118. out = Buffer.concat([out, encryptStart(self, data, decrypt)])
  20119. break
  20120. }
  20121. }
  20122. return out
  20123. }
  20124. /***/ }),
  20125. /* 115 */
  20126. /*!***************************************************!*\
  20127. !*** ./node_modules/browserify-aes/modes/cfb8.js ***!
  20128. \***************************************************/
  20129. /*! no static exports found */
  20130. /***/ (function(module, exports, __webpack_require__) {
  20131. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  20132. function encryptByte (self, byteParam, decrypt) {
  20133. var pad = self._cipher.encryptBlock(self._prev)
  20134. var out = pad[0] ^ byteParam
  20135. self._prev = Buffer.concat([
  20136. self._prev.slice(1),
  20137. Buffer.from([decrypt ? byteParam : out])
  20138. ])
  20139. return out
  20140. }
  20141. exports.encrypt = function (self, chunk, decrypt) {
  20142. var len = chunk.length
  20143. var out = Buffer.allocUnsafe(len)
  20144. var i = -1
  20145. while (++i < len) {
  20146. out[i] = encryptByte(self, chunk[i], decrypt)
  20147. }
  20148. return out
  20149. }
  20150. /***/ }),
  20151. /* 116 */
  20152. /*!***************************************************!*\
  20153. !*** ./node_modules/browserify-aes/modes/cfb1.js ***!
  20154. \***************************************************/
  20155. /*! no static exports found */
  20156. /***/ (function(module, exports, __webpack_require__) {
  20157. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  20158. function encryptByte (self, byteParam, decrypt) {
  20159. var pad
  20160. var i = -1
  20161. var len = 8
  20162. var out = 0
  20163. var bit, value
  20164. while (++i < len) {
  20165. pad = self._cipher.encryptBlock(self._prev)
  20166. bit = (byteParam & (1 << (7 - i))) ? 0x80 : 0
  20167. value = pad[0] ^ bit
  20168. out += ((value & 0x80) >> (i % 8))
  20169. self._prev = shiftIn(self._prev, decrypt ? bit : value)
  20170. }
  20171. return out
  20172. }
  20173. function shiftIn (buffer, value) {
  20174. var len = buffer.length
  20175. var i = -1
  20176. var out = Buffer.allocUnsafe(buffer.length)
  20177. buffer = Buffer.concat([buffer, Buffer.from([value])])
  20178. while (++i < len) {
  20179. out[i] = buffer[i] << 1 | buffer[i + 1] >> (7)
  20180. }
  20181. return out
  20182. }
  20183. exports.encrypt = function (self, chunk, decrypt) {
  20184. var len = chunk.length
  20185. var out = Buffer.allocUnsafe(len)
  20186. var i = -1
  20187. while (++i < len) {
  20188. out[i] = encryptByte(self, chunk[i], decrypt)
  20189. }
  20190. return out
  20191. }
  20192. /***/ }),
  20193. /* 117 */
  20194. /*!**************************************************!*\
  20195. !*** ./node_modules/browserify-aes/modes/ofb.js ***!
  20196. \**************************************************/
  20197. /*! no static exports found */
  20198. /***/ (function(module, exports, __webpack_require__) {
  20199. /* WEBPACK VAR INJECTION */(function(Buffer) {var xor = __webpack_require__(/*! buffer-xor */ 113)
  20200. function getBlock (self) {
  20201. self._prev = self._cipher.encryptBlock(self._prev)
  20202. return self._prev
  20203. }
  20204. exports.encrypt = function (self, chunk) {
  20205. while (self._cache.length < chunk.length) {
  20206. self._cache = Buffer.concat([self._cache, getBlock(self)])
  20207. }
  20208. var pad = self._cache.slice(0, chunk.length)
  20209. self._cache = self._cache.slice(chunk.length)
  20210. return xor(chunk, pad)
  20211. }
  20212. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../buffer/index.js */ 49).Buffer))
  20213. /***/ }),
  20214. /* 118 */
  20215. /*!**************************************************!*\
  20216. !*** ./node_modules/browserify-aes/modes/ctr.js ***!
  20217. \**************************************************/
  20218. /*! no static exports found */
  20219. /***/ (function(module, exports, __webpack_require__) {
  20220. var xor = __webpack_require__(/*! buffer-xor */ 113)
  20221. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  20222. var incr32 = __webpack_require__(/*! ../incr32 */ 119)
  20223. function getBlock (self) {
  20224. var out = self._cipher.encryptBlockRaw(self._prev)
  20225. incr32(self._prev)
  20226. return out
  20227. }
  20228. var blockSize = 16
  20229. exports.encrypt = function (self, chunk) {
  20230. var chunkNum = Math.ceil(chunk.length / blockSize)
  20231. var start = self._cache.length
  20232. self._cache = Buffer.concat([
  20233. self._cache,
  20234. Buffer.allocUnsafe(chunkNum * blockSize)
  20235. ])
  20236. for (var i = 0; i < chunkNum; i++) {
  20237. var out = getBlock(self)
  20238. var offset = start + i * blockSize
  20239. self._cache.writeUInt32BE(out[0], offset + 0)
  20240. self._cache.writeUInt32BE(out[1], offset + 4)
  20241. self._cache.writeUInt32BE(out[2], offset + 8)
  20242. self._cache.writeUInt32BE(out[3], offset + 12)
  20243. }
  20244. var pad = self._cache.slice(0, chunk.length)
  20245. self._cache = self._cache.slice(chunk.length)
  20246. return xor(chunk, pad)
  20247. }
  20248. /***/ }),
  20249. /* 119 */
  20250. /*!***********************************************!*\
  20251. !*** ./node_modules/browserify-aes/incr32.js ***!
  20252. \***********************************************/
  20253. /*! no static exports found */
  20254. /***/ (function(module, exports) {
  20255. function incr32 (iv) {
  20256. var len = iv.length
  20257. var item
  20258. while (len--) {
  20259. item = iv.readUInt8(len)
  20260. if (item === 255) {
  20261. iv.writeUInt8(0, len)
  20262. } else {
  20263. item++
  20264. iv.writeUInt8(item, len)
  20265. break
  20266. }
  20267. }
  20268. }
  20269. module.exports = incr32
  20270. /***/ }),
  20271. /* 120 */
  20272. /*!*****************************************************!*\
  20273. !*** ./node_modules/browserify-aes/modes/list.json ***!
  20274. \*****************************************************/
  20275. /*! exports provided: aes-128-ecb, aes-192-ecb, aes-256-ecb, aes-128-cbc, aes-192-cbc, aes-256-cbc, aes128, aes192, aes256, aes-128-cfb, aes-192-cfb, aes-256-cfb, aes-128-cfb8, aes-192-cfb8, aes-256-cfb8, aes-128-cfb1, aes-192-cfb1, aes-256-cfb1, aes-128-ofb, aes-192-ofb, aes-256-ofb, aes-128-ctr, aes-192-ctr, aes-256-ctr, aes-128-gcm, aes-192-gcm, aes-256-gcm, default */
  20276. /***/ (function(module) {
  20277. module.exports = JSON.parse("{\"aes-128-ecb\":{\"cipher\":\"AES\",\"key\":128,\"iv\":0,\"mode\":\"ECB\",\"type\":\"block\"},\"aes-192-ecb\":{\"cipher\":\"AES\",\"key\":192,\"iv\":0,\"mode\":\"ECB\",\"type\":\"block\"},\"aes-256-ecb\":{\"cipher\":\"AES\",\"key\":256,\"iv\":0,\"mode\":\"ECB\",\"type\":\"block\"},\"aes-128-cbc\":{\"cipher\":\"AES\",\"key\":128,\"iv\":16,\"mode\":\"CBC\",\"type\":\"block\"},\"aes-192-cbc\":{\"cipher\":\"AES\",\"key\":192,\"iv\":16,\"mode\":\"CBC\",\"type\":\"block\"},\"aes-256-cbc\":{\"cipher\":\"AES\",\"key\":256,\"iv\":16,\"mode\":\"CBC\",\"type\":\"block\"},\"aes128\":{\"cipher\":\"AES\",\"key\":128,\"iv\":16,\"mode\":\"CBC\",\"type\":\"block\"},\"aes192\":{\"cipher\":\"AES\",\"key\":192,\"iv\":16,\"mode\":\"CBC\",\"type\":\"block\"},\"aes256\":{\"cipher\":\"AES\",\"key\":256,\"iv\":16,\"mode\":\"CBC\",\"type\":\"block\"},\"aes-128-cfb\":{\"cipher\":\"AES\",\"key\":128,\"iv\":16,\"mode\":\"CFB\",\"type\":\"stream\"},\"aes-192-cfb\":{\"cipher\":\"AES\",\"key\":192,\"iv\":16,\"mode\":\"CFB\",\"type\":\"stream\"},\"aes-256-cfb\":{\"cipher\":\"AES\",\"key\":256,\"iv\":16,\"mode\":\"CFB\",\"type\":\"stream\"},\"aes-128-cfb8\":{\"cipher\":\"AES\",\"key\":128,\"iv\":16,\"mode\":\"CFB8\",\"type\":\"stream\"},\"aes-192-cfb8\":{\"cipher\":\"AES\",\"key\":192,\"iv\":16,\"mode\":\"CFB8\",\"type\":\"stream\"},\"aes-256-cfb8\":{\"cipher\":\"AES\",\"key\":256,\"iv\":16,\"mode\":\"CFB8\",\"type\":\"stream\"},\"aes-128-cfb1\":{\"cipher\":\"AES\",\"key\":128,\"iv\":16,\"mode\":\"CFB1\",\"type\":\"stream\"},\"aes-192-cfb1\":{\"cipher\":\"AES\",\"key\":192,\"iv\":16,\"mode\":\"CFB1\",\"type\":\"stream\"},\"aes-256-cfb1\":{\"cipher\":\"AES\",\"key\":256,\"iv\":16,\"mode\":\"CFB1\",\"type\":\"stream\"},\"aes-128-ofb\":{\"cipher\":\"AES\",\"key\":128,\"iv\":16,\"mode\":\"OFB\",\"type\":\"stream\"},\"aes-192-ofb\":{\"cipher\":\"AES\",\"key\":192,\"iv\":16,\"mode\":\"OFB\",\"type\":\"stream\"},\"aes-256-ofb\":{\"cipher\":\"AES\",\"key\":256,\"iv\":16,\"mode\":\"OFB\",\"type\":\"stream\"},\"aes-128-ctr\":{\"cipher\":\"AES\",\"key\":128,\"iv\":16,\"mode\":\"CTR\",\"type\":\"stream\"},\"aes-192-ctr\":{\"cipher\":\"AES\",\"key\":192,\"iv\":16,\"mode\":\"CTR\",\"type\":\"stream\"},\"aes-256-ctr\":{\"cipher\":\"AES\",\"key\":256,\"iv\":16,\"mode\":\"CTR\",\"type\":\"stream\"},\"aes-128-gcm\":{\"cipher\":\"AES\",\"key\":128,\"iv\":12,\"mode\":\"GCM\",\"type\":\"auth\"},\"aes-192-gcm\":{\"cipher\":\"AES\",\"key\":192,\"iv\":12,\"mode\":\"GCM\",\"type\":\"auth\"},\"aes-256-gcm\":{\"cipher\":\"AES\",\"key\":256,\"iv\":12,\"mode\":\"GCM\",\"type\":\"auth\"}}");
  20278. /***/ }),
  20279. /* 121 */
  20280. /*!***************************************************!*\
  20281. !*** ./node_modules/browserify-aes/authCipher.js ***!
  20282. \***************************************************/
  20283. /*! no static exports found */
  20284. /***/ (function(module, exports, __webpack_require__) {
  20285. var aes = __webpack_require__(/*! ./aes */ 122)
  20286. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  20287. var Transform = __webpack_require__(/*! cipher-base */ 82)
  20288. var inherits = __webpack_require__(/*! inherits */ 54)
  20289. var GHASH = __webpack_require__(/*! ./ghash */ 123)
  20290. var xor = __webpack_require__(/*! buffer-xor */ 113)
  20291. var incr32 = __webpack_require__(/*! ./incr32 */ 119)
  20292. function xorTest (a, b) {
  20293. var out = 0
  20294. if (a.length !== b.length) out++
  20295. var len = Math.min(a.length, b.length)
  20296. for (var i = 0; i < len; ++i) {
  20297. out += (a[i] ^ b[i])
  20298. }
  20299. return out
  20300. }
  20301. function calcIv (self, iv, ck) {
  20302. if (iv.length === 12) {
  20303. self._finID = Buffer.concat([iv, Buffer.from([0, 0, 0, 1])])
  20304. return Buffer.concat([iv, Buffer.from([0, 0, 0, 2])])
  20305. }
  20306. var ghash = new GHASH(ck)
  20307. var len = iv.length
  20308. var toPad = len % 16
  20309. ghash.update(iv)
  20310. if (toPad) {
  20311. toPad = 16 - toPad
  20312. ghash.update(Buffer.alloc(toPad, 0))
  20313. }
  20314. ghash.update(Buffer.alloc(8, 0))
  20315. var ivBits = len * 8
  20316. var tail = Buffer.alloc(8)
  20317. tail.writeUIntBE(ivBits, 0, 8)
  20318. ghash.update(tail)
  20319. self._finID = ghash.state
  20320. var out = Buffer.from(self._finID)
  20321. incr32(out)
  20322. return out
  20323. }
  20324. function StreamCipher (mode, key, iv, decrypt) {
  20325. Transform.call(this)
  20326. var h = Buffer.alloc(4, 0)
  20327. this._cipher = new aes.AES(key)
  20328. var ck = this._cipher.encryptBlock(h)
  20329. this._ghash = new GHASH(ck)
  20330. iv = calcIv(this, iv, ck)
  20331. this._prev = Buffer.from(iv)
  20332. this._cache = Buffer.allocUnsafe(0)
  20333. this._secCache = Buffer.allocUnsafe(0)
  20334. this._decrypt = decrypt
  20335. this._alen = 0
  20336. this._len = 0
  20337. this._mode = mode
  20338. this._authTag = null
  20339. this._called = false
  20340. }
  20341. inherits(StreamCipher, Transform)
  20342. StreamCipher.prototype._update = function (chunk) {
  20343. if (!this._called && this._alen) {
  20344. var rump = 16 - (this._alen % 16)
  20345. if (rump < 16) {
  20346. rump = Buffer.alloc(rump, 0)
  20347. this._ghash.update(rump)
  20348. }
  20349. }
  20350. this._called = true
  20351. var out = this._mode.encrypt(this, chunk)
  20352. if (this._decrypt) {
  20353. this._ghash.update(chunk)
  20354. } else {
  20355. this._ghash.update(out)
  20356. }
  20357. this._len += chunk.length
  20358. return out
  20359. }
  20360. StreamCipher.prototype._final = function () {
  20361. if (this._decrypt && !this._authTag) throw new Error('Unsupported state or unable to authenticate data')
  20362. var tag = xor(this._ghash.final(this._alen * 8, this._len * 8), this._cipher.encryptBlock(this._finID))
  20363. if (this._decrypt && xorTest(tag, this._authTag)) throw new Error('Unsupported state or unable to authenticate data')
  20364. this._authTag = tag
  20365. this._cipher.scrub()
  20366. }
  20367. StreamCipher.prototype.getAuthTag = function getAuthTag () {
  20368. if (this._decrypt || !Buffer.isBuffer(this._authTag)) throw new Error('Attempting to get auth tag in unsupported state')
  20369. return this._authTag
  20370. }
  20371. StreamCipher.prototype.setAuthTag = function setAuthTag (tag) {
  20372. if (!this._decrypt) throw new Error('Attempting to set auth tag in unsupported state')
  20373. this._authTag = tag
  20374. }
  20375. StreamCipher.prototype.setAAD = function setAAD (buf) {
  20376. if (this._called) throw new Error('Attempting to set AAD in unsupported state')
  20377. this._ghash.update(buf)
  20378. this._alen += buf.length
  20379. }
  20380. module.exports = StreamCipher
  20381. /***/ }),
  20382. /* 122 */
  20383. /*!********************************************!*\
  20384. !*** ./node_modules/browserify-aes/aes.js ***!
  20385. \********************************************/
  20386. /*! no static exports found */
  20387. /***/ (function(module, exports, __webpack_require__) {
  20388. // based on the aes implimentation in triple sec
  20389. // https://github.com/keybase/triplesec
  20390. // which is in turn based on the one from crypto-js
  20391. // https://code.google.com/p/crypto-js/
  20392. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  20393. function asUInt32Array (buf) {
  20394. if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)
  20395. var len = (buf.length / 4) | 0
  20396. var out = new Array(len)
  20397. for (var i = 0; i < len; i++) {
  20398. out[i] = buf.readUInt32BE(i * 4)
  20399. }
  20400. return out
  20401. }
  20402. function scrubVec (v) {
  20403. for (var i = 0; i < v.length; v++) {
  20404. v[i] = 0
  20405. }
  20406. }
  20407. function cryptBlock (M, keySchedule, SUB_MIX, SBOX, nRounds) {
  20408. var SUB_MIX0 = SUB_MIX[0]
  20409. var SUB_MIX1 = SUB_MIX[1]
  20410. var SUB_MIX2 = SUB_MIX[2]
  20411. var SUB_MIX3 = SUB_MIX[3]
  20412. var s0 = M[0] ^ keySchedule[0]
  20413. var s1 = M[1] ^ keySchedule[1]
  20414. var s2 = M[2] ^ keySchedule[2]
  20415. var s3 = M[3] ^ keySchedule[3]
  20416. var t0, t1, t2, t3
  20417. var ksRow = 4
  20418. for (var round = 1; round < nRounds; round++) {
  20419. t0 = SUB_MIX0[s0 >>> 24] ^ SUB_MIX1[(s1 >>> 16) & 0xff] ^ SUB_MIX2[(s2 >>> 8) & 0xff] ^ SUB_MIX3[s3 & 0xff] ^ keySchedule[ksRow++]
  20420. t1 = SUB_MIX0[s1 >>> 24] ^ SUB_MIX1[(s2 >>> 16) & 0xff] ^ SUB_MIX2[(s3 >>> 8) & 0xff] ^ SUB_MIX3[s0 & 0xff] ^ keySchedule[ksRow++]
  20421. t2 = SUB_MIX0[s2 >>> 24] ^ SUB_MIX1[(s3 >>> 16) & 0xff] ^ SUB_MIX2[(s0 >>> 8) & 0xff] ^ SUB_MIX3[s1 & 0xff] ^ keySchedule[ksRow++]
  20422. t3 = SUB_MIX0[s3 >>> 24] ^ SUB_MIX1[(s0 >>> 16) & 0xff] ^ SUB_MIX2[(s1 >>> 8) & 0xff] ^ SUB_MIX3[s2 & 0xff] ^ keySchedule[ksRow++]
  20423. s0 = t0
  20424. s1 = t1
  20425. s2 = t2
  20426. s3 = t3
  20427. }
  20428. t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++]
  20429. t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++]
  20430. t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++]
  20431. t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++]
  20432. t0 = t0 >>> 0
  20433. t1 = t1 >>> 0
  20434. t2 = t2 >>> 0
  20435. t3 = t3 >>> 0
  20436. return [t0, t1, t2, t3]
  20437. }
  20438. // AES constants
  20439. var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36]
  20440. var G = (function () {
  20441. // Compute double table
  20442. var d = new Array(256)
  20443. for (var j = 0; j < 256; j++) {
  20444. if (j < 128) {
  20445. d[j] = j << 1
  20446. } else {
  20447. d[j] = (j << 1) ^ 0x11b
  20448. }
  20449. }
  20450. var SBOX = []
  20451. var INV_SBOX = []
  20452. var SUB_MIX = [[], [], [], []]
  20453. var INV_SUB_MIX = [[], [], [], []]
  20454. // Walk GF(2^8)
  20455. var x = 0
  20456. var xi = 0
  20457. for (var i = 0; i < 256; ++i) {
  20458. // Compute sbox
  20459. var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4)
  20460. sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63
  20461. SBOX[x] = sx
  20462. INV_SBOX[sx] = x
  20463. // Compute multiplication
  20464. var x2 = d[x]
  20465. var x4 = d[x2]
  20466. var x8 = d[x4]
  20467. // Compute sub bytes, mix columns tables
  20468. var t = (d[sx] * 0x101) ^ (sx * 0x1010100)
  20469. SUB_MIX[0][x] = (t << 24) | (t >>> 8)
  20470. SUB_MIX[1][x] = (t << 16) | (t >>> 16)
  20471. SUB_MIX[2][x] = (t << 8) | (t >>> 24)
  20472. SUB_MIX[3][x] = t
  20473. // Compute inv sub bytes, inv mix columns tables
  20474. t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100)
  20475. INV_SUB_MIX[0][sx] = (t << 24) | (t >>> 8)
  20476. INV_SUB_MIX[1][sx] = (t << 16) | (t >>> 16)
  20477. INV_SUB_MIX[2][sx] = (t << 8) | (t >>> 24)
  20478. INV_SUB_MIX[3][sx] = t
  20479. if (x === 0) {
  20480. x = xi = 1
  20481. } else {
  20482. x = x2 ^ d[d[d[x8 ^ x2]]]
  20483. xi ^= d[d[xi]]
  20484. }
  20485. }
  20486. return {
  20487. SBOX: SBOX,
  20488. INV_SBOX: INV_SBOX,
  20489. SUB_MIX: SUB_MIX,
  20490. INV_SUB_MIX: INV_SUB_MIX
  20491. }
  20492. })()
  20493. function AES (key) {
  20494. this._key = asUInt32Array(key)
  20495. this._reset()
  20496. }
  20497. AES.blockSize = 4 * 4
  20498. AES.keySize = 256 / 8
  20499. AES.prototype.blockSize = AES.blockSize
  20500. AES.prototype.keySize = AES.keySize
  20501. AES.prototype._reset = function () {
  20502. var keyWords = this._key
  20503. var keySize = keyWords.length
  20504. var nRounds = keySize + 6
  20505. var ksRows = (nRounds + 1) * 4
  20506. var keySchedule = []
  20507. for (var k = 0; k < keySize; k++) {
  20508. keySchedule[k] = keyWords[k]
  20509. }
  20510. for (k = keySize; k < ksRows; k++) {
  20511. var t = keySchedule[k - 1]
  20512. if (k % keySize === 0) {
  20513. t = (t << 8) | (t >>> 24)
  20514. t =
  20515. (G.SBOX[t >>> 24] << 24) |
  20516. (G.SBOX[(t >>> 16) & 0xff] << 16) |
  20517. (G.SBOX[(t >>> 8) & 0xff] << 8) |
  20518. (G.SBOX[t & 0xff])
  20519. t ^= RCON[(k / keySize) | 0] << 24
  20520. } else if (keySize > 6 && k % keySize === 4) {
  20521. t =
  20522. (G.SBOX[t >>> 24] << 24) |
  20523. (G.SBOX[(t >>> 16) & 0xff] << 16) |
  20524. (G.SBOX[(t >>> 8) & 0xff] << 8) |
  20525. (G.SBOX[t & 0xff])
  20526. }
  20527. keySchedule[k] = keySchedule[k - keySize] ^ t
  20528. }
  20529. var invKeySchedule = []
  20530. for (var ik = 0; ik < ksRows; ik++) {
  20531. var ksR = ksRows - ik
  20532. var tt = keySchedule[ksR - (ik % 4 ? 0 : 4)]
  20533. if (ik < 4 || ksR <= 4) {
  20534. invKeySchedule[ik] = tt
  20535. } else {
  20536. invKeySchedule[ik] =
  20537. G.INV_SUB_MIX[0][G.SBOX[tt >>> 24]] ^
  20538. G.INV_SUB_MIX[1][G.SBOX[(tt >>> 16) & 0xff]] ^
  20539. G.INV_SUB_MIX[2][G.SBOX[(tt >>> 8) & 0xff]] ^
  20540. G.INV_SUB_MIX[3][G.SBOX[tt & 0xff]]
  20541. }
  20542. }
  20543. this._nRounds = nRounds
  20544. this._keySchedule = keySchedule
  20545. this._invKeySchedule = invKeySchedule
  20546. }
  20547. AES.prototype.encryptBlockRaw = function (M) {
  20548. M = asUInt32Array(M)
  20549. return cryptBlock(M, this._keySchedule, G.SUB_MIX, G.SBOX, this._nRounds)
  20550. }
  20551. AES.prototype.encryptBlock = function (M) {
  20552. var out = this.encryptBlockRaw(M)
  20553. var buf = Buffer.allocUnsafe(16)
  20554. buf.writeUInt32BE(out[0], 0)
  20555. buf.writeUInt32BE(out[1], 4)
  20556. buf.writeUInt32BE(out[2], 8)
  20557. buf.writeUInt32BE(out[3], 12)
  20558. return buf
  20559. }
  20560. AES.prototype.decryptBlock = function (M) {
  20561. M = asUInt32Array(M)
  20562. // swap
  20563. var m1 = M[1]
  20564. M[1] = M[3]
  20565. M[3] = m1
  20566. var out = cryptBlock(M, this._invKeySchedule, G.INV_SUB_MIX, G.INV_SBOX, this._nRounds)
  20567. var buf = Buffer.allocUnsafe(16)
  20568. buf.writeUInt32BE(out[0], 0)
  20569. buf.writeUInt32BE(out[3], 4)
  20570. buf.writeUInt32BE(out[2], 8)
  20571. buf.writeUInt32BE(out[1], 12)
  20572. return buf
  20573. }
  20574. AES.prototype.scrub = function () {
  20575. scrubVec(this._keySchedule)
  20576. scrubVec(this._invKeySchedule)
  20577. scrubVec(this._key)
  20578. }
  20579. module.exports.AES = AES
  20580. /***/ }),
  20581. /* 123 */
  20582. /*!**********************************************!*\
  20583. !*** ./node_modules/browserify-aes/ghash.js ***!
  20584. \**********************************************/
  20585. /*! no static exports found */
  20586. /***/ (function(module, exports, __webpack_require__) {
  20587. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  20588. var ZEROES = Buffer.alloc(16, 0)
  20589. function toArray (buf) {
  20590. return [
  20591. buf.readUInt32BE(0),
  20592. buf.readUInt32BE(4),
  20593. buf.readUInt32BE(8),
  20594. buf.readUInt32BE(12)
  20595. ]
  20596. }
  20597. function fromArray (out) {
  20598. var buf = Buffer.allocUnsafe(16)
  20599. buf.writeUInt32BE(out[0] >>> 0, 0)
  20600. buf.writeUInt32BE(out[1] >>> 0, 4)
  20601. buf.writeUInt32BE(out[2] >>> 0, 8)
  20602. buf.writeUInt32BE(out[3] >>> 0, 12)
  20603. return buf
  20604. }
  20605. function GHASH (key) {
  20606. this.h = key
  20607. this.state = Buffer.alloc(16, 0)
  20608. this.cache = Buffer.allocUnsafe(0)
  20609. }
  20610. // from http://bitwiseshiftleft.github.io/sjcl/doc/symbols/src/core_gcm.js.html
  20611. // by Juho Vähä-Herttua
  20612. GHASH.prototype.ghash = function (block) {
  20613. var i = -1
  20614. while (++i < block.length) {
  20615. this.state[i] ^= block[i]
  20616. }
  20617. this._multiply()
  20618. }
  20619. GHASH.prototype._multiply = function () {
  20620. var Vi = toArray(this.h)
  20621. var Zi = [0, 0, 0, 0]
  20622. var j, xi, lsbVi
  20623. var i = -1
  20624. while (++i < 128) {
  20625. xi = (this.state[~~(i / 8)] & (1 << (7 - (i % 8)))) !== 0
  20626. if (xi) {
  20627. // Z_i+1 = Z_i ^ V_i
  20628. Zi[0] ^= Vi[0]
  20629. Zi[1] ^= Vi[1]
  20630. Zi[2] ^= Vi[2]
  20631. Zi[3] ^= Vi[3]
  20632. }
  20633. // Store the value of LSB(V_i)
  20634. lsbVi = (Vi[3] & 1) !== 0
  20635. // V_i+1 = V_i >> 1
  20636. for (j = 3; j > 0; j--) {
  20637. Vi[j] = (Vi[j] >>> 1) | ((Vi[j - 1] & 1) << 31)
  20638. }
  20639. Vi[0] = Vi[0] >>> 1
  20640. // If LSB(V_i) is 1, V_i+1 = (V_i >> 1) ^ R
  20641. if (lsbVi) {
  20642. Vi[0] = Vi[0] ^ (0xe1 << 24)
  20643. }
  20644. }
  20645. this.state = fromArray(Zi)
  20646. }
  20647. GHASH.prototype.update = function (buf) {
  20648. this.cache = Buffer.concat([this.cache, buf])
  20649. var chunk
  20650. while (this.cache.length >= 16) {
  20651. chunk = this.cache.slice(0, 16)
  20652. this.cache = this.cache.slice(16)
  20653. this.ghash(chunk)
  20654. }
  20655. }
  20656. GHASH.prototype.final = function (abl, bl) {
  20657. if (this.cache.length) {
  20658. this.ghash(Buffer.concat([this.cache, ZEROES], 16))
  20659. }
  20660. this.ghash(fromArray([0, abl, 0, bl]))
  20661. return this.state
  20662. }
  20663. module.exports = GHASH
  20664. /***/ }),
  20665. /* 124 */
  20666. /*!*****************************************************!*\
  20667. !*** ./node_modules/browserify-aes/streamCipher.js ***!
  20668. \*****************************************************/
  20669. /*! no static exports found */
  20670. /***/ (function(module, exports, __webpack_require__) {
  20671. var aes = __webpack_require__(/*! ./aes */ 122)
  20672. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  20673. var Transform = __webpack_require__(/*! cipher-base */ 82)
  20674. var inherits = __webpack_require__(/*! inherits */ 54)
  20675. function StreamCipher (mode, key, iv, decrypt) {
  20676. Transform.call(this)
  20677. this._cipher = new aes.AES(key)
  20678. this._prev = Buffer.from(iv)
  20679. this._cache = Buffer.allocUnsafe(0)
  20680. this._secCache = Buffer.allocUnsafe(0)
  20681. this._decrypt = decrypt
  20682. this._mode = mode
  20683. }
  20684. inherits(StreamCipher, Transform)
  20685. StreamCipher.prototype._update = function (chunk) {
  20686. return this._mode.encrypt(this, chunk, this._decrypt)
  20687. }
  20688. StreamCipher.prototype._final = function () {
  20689. this._cipher.scrub()
  20690. }
  20691. module.exports = StreamCipher
  20692. /***/ }),
  20693. /* 125 */
  20694. /*!**********************************************!*\
  20695. !*** ./node_modules/evp_bytestokey/index.js ***!
  20696. \**********************************************/
  20697. /*! no static exports found */
  20698. /***/ (function(module, exports, __webpack_require__) {
  20699. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  20700. var MD5 = __webpack_require__(/*! md5.js */ 55)
  20701. /* eslint-disable camelcase */
  20702. function EVP_BytesToKey (password, salt, keyBits, ivLen) {
  20703. if (!Buffer.isBuffer(password)) password = Buffer.from(password, 'binary')
  20704. if (salt) {
  20705. if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, 'binary')
  20706. if (salt.length !== 8) throw new RangeError('salt should be Buffer with 8 byte length')
  20707. }
  20708. var keyLen = keyBits / 8
  20709. var key = Buffer.alloc(keyLen)
  20710. var iv = Buffer.alloc(ivLen || 0)
  20711. var tmp = Buffer.alloc(0)
  20712. while (keyLen > 0 || ivLen > 0) {
  20713. var hash = new MD5()
  20714. hash.update(tmp)
  20715. hash.update(password)
  20716. if (salt) hash.update(salt)
  20717. tmp = hash.digest()
  20718. var used = 0
  20719. if (keyLen > 0) {
  20720. var keyStart = key.length - keyLen
  20721. used = Math.min(keyLen, tmp.length)
  20722. tmp.copy(key, keyStart, 0, used)
  20723. keyLen -= used
  20724. }
  20725. if (used < tmp.length && ivLen > 0) {
  20726. var ivStart = iv.length - ivLen
  20727. var length = Math.min(ivLen, tmp.length - used)
  20728. tmp.copy(iv, ivStart, used, used + length)
  20729. ivLen -= length
  20730. }
  20731. }
  20732. tmp.fill(0)
  20733. return { key: key, iv: iv }
  20734. }
  20735. module.exports = EVP_BytesToKey
  20736. /***/ }),
  20737. /* 126 */
  20738. /*!**************************************************!*\
  20739. !*** ./node_modules/browserify-aes/decrypter.js ***!
  20740. \**************************************************/
  20741. /*! no static exports found */
  20742. /***/ (function(module, exports, __webpack_require__) {
  20743. var AuthCipher = __webpack_require__(/*! ./authCipher */ 121)
  20744. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  20745. var MODES = __webpack_require__(/*! ./modes */ 110)
  20746. var StreamCipher = __webpack_require__(/*! ./streamCipher */ 124)
  20747. var Transform = __webpack_require__(/*! cipher-base */ 82)
  20748. var aes = __webpack_require__(/*! ./aes */ 122)
  20749. var ebtk = __webpack_require__(/*! evp_bytestokey */ 125)
  20750. var inherits = __webpack_require__(/*! inherits */ 54)
  20751. function Decipher (mode, key, iv) {
  20752. Transform.call(this)
  20753. this._cache = new Splitter()
  20754. this._last = void 0
  20755. this._cipher = new aes.AES(key)
  20756. this._prev = Buffer.from(iv)
  20757. this._mode = mode
  20758. this._autopadding = true
  20759. }
  20760. inherits(Decipher, Transform)
  20761. Decipher.prototype._update = function (data) {
  20762. this._cache.add(data)
  20763. var chunk
  20764. var thing
  20765. var out = []
  20766. while ((chunk = this._cache.get(this._autopadding))) {
  20767. thing = this._mode.decrypt(this, chunk)
  20768. out.push(thing)
  20769. }
  20770. return Buffer.concat(out)
  20771. }
  20772. Decipher.prototype._final = function () {
  20773. var chunk = this._cache.flush()
  20774. if (this._autopadding) {
  20775. return unpad(this._mode.decrypt(this, chunk))
  20776. } else if (chunk) {
  20777. throw new Error('data not multiple of block length')
  20778. }
  20779. }
  20780. Decipher.prototype.setAutoPadding = function (setTo) {
  20781. this._autopadding = !!setTo
  20782. return this
  20783. }
  20784. function Splitter () {
  20785. this.cache = Buffer.allocUnsafe(0)
  20786. }
  20787. Splitter.prototype.add = function (data) {
  20788. this.cache = Buffer.concat([this.cache, data])
  20789. }
  20790. Splitter.prototype.get = function (autoPadding) {
  20791. var out
  20792. if (autoPadding) {
  20793. if (this.cache.length > 16) {
  20794. out = this.cache.slice(0, 16)
  20795. this.cache = this.cache.slice(16)
  20796. return out
  20797. }
  20798. } else {
  20799. if (this.cache.length >= 16) {
  20800. out = this.cache.slice(0, 16)
  20801. this.cache = this.cache.slice(16)
  20802. return out
  20803. }
  20804. }
  20805. return null
  20806. }
  20807. Splitter.prototype.flush = function () {
  20808. if (this.cache.length) return this.cache
  20809. }
  20810. function unpad (last) {
  20811. var padded = last[15]
  20812. if (padded < 1 || padded > 16) {
  20813. throw new Error('unable to decrypt data')
  20814. }
  20815. var i = -1
  20816. while (++i < padded) {
  20817. if (last[(i + (16 - padded))] !== padded) {
  20818. throw new Error('unable to decrypt data')
  20819. }
  20820. }
  20821. if (padded === 16) return
  20822. return last.slice(0, 16 - padded)
  20823. }
  20824. function createDecipheriv (suite, password, iv) {
  20825. var config = MODES[suite.toLowerCase()]
  20826. if (!config) throw new TypeError('invalid suite type')
  20827. if (typeof iv === 'string') iv = Buffer.from(iv)
  20828. if (config.mode !== 'GCM' && iv.length !== config.iv) throw new TypeError('invalid iv length ' + iv.length)
  20829. if (typeof password === 'string') password = Buffer.from(password)
  20830. if (password.length !== config.key / 8) throw new TypeError('invalid key length ' + password.length)
  20831. if (config.type === 'stream') {
  20832. return new StreamCipher(config.module, password, iv, true)
  20833. } else if (config.type === 'auth') {
  20834. return new AuthCipher(config.module, password, iv, true)
  20835. }
  20836. return new Decipher(config.module, password, iv)
  20837. }
  20838. function createDecipher (suite, password) {
  20839. var config = MODES[suite.toLowerCase()]
  20840. if (!config) throw new TypeError('invalid suite type')
  20841. var keys = ebtk(password, false, config.key, config.iv)
  20842. return createDecipheriv(suite, keys.key, keys.iv)
  20843. }
  20844. exports.createDecipher = createDecipher
  20845. exports.createDecipheriv = createDecipheriv
  20846. /***/ }),
  20847. /* 127 */
  20848. /*!**********************************************!*\
  20849. !*** ./node_modules/browserify-des/modes.js ***!
  20850. \**********************************************/
  20851. /*! no static exports found */
  20852. /***/ (function(module, exports) {
  20853. exports['des-ecb'] = {
  20854. key: 8,
  20855. iv: 0
  20856. }
  20857. exports['des-cbc'] = exports.des = {
  20858. key: 8,
  20859. iv: 8
  20860. }
  20861. exports['des-ede3-cbc'] = exports.des3 = {
  20862. key: 24,
  20863. iv: 8
  20864. }
  20865. exports['des-ede3'] = {
  20866. key: 24,
  20867. iv: 0
  20868. }
  20869. exports['des-ede-cbc'] = {
  20870. key: 16,
  20871. iv: 8
  20872. }
  20873. exports['des-ede'] = {
  20874. key: 16,
  20875. iv: 0
  20876. }
  20877. /***/ }),
  20878. /* 128 */
  20879. /*!************************************************!*\
  20880. !*** ./node_modules/diffie-hellman/browser.js ***!
  20881. \************************************************/
  20882. /*! no static exports found */
  20883. /***/ (function(module, exports, __webpack_require__) {
  20884. /* WEBPACK VAR INJECTION */(function(Buffer) {var generatePrime = __webpack_require__(/*! ./lib/generatePrime */ 129)
  20885. var primes = __webpack_require__(/*! ./lib/primes.json */ 136)
  20886. var DH = __webpack_require__(/*! ./lib/dh */ 137)
  20887. function getDiffieHellman (mod) {
  20888. var prime = new Buffer(primes[mod].prime, 'hex')
  20889. var gen = new Buffer(primes[mod].gen, 'hex')
  20890. return new DH(prime, gen)
  20891. }
  20892. var ENCODINGS = {
  20893. 'binary': true, 'hex': true, 'base64': true
  20894. }
  20895. function createDiffieHellman (prime, enc, generator, genc) {
  20896. if (Buffer.isBuffer(enc) || ENCODINGS[enc] === undefined) {
  20897. return createDiffieHellman(prime, 'binary', enc, generator)
  20898. }
  20899. enc = enc || 'binary'
  20900. genc = genc || 'binary'
  20901. generator = generator || new Buffer([2])
  20902. if (!Buffer.isBuffer(generator)) {
  20903. generator = new Buffer(generator, genc)
  20904. }
  20905. if (typeof prime === 'number') {
  20906. return new DH(generatePrime(prime, generator), generator, true)
  20907. }
  20908. if (!Buffer.isBuffer(prime)) {
  20909. prime = new Buffer(prime, enc)
  20910. }
  20911. return new DH(prime, generator, true)
  20912. }
  20913. exports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffieHellman = getDiffieHellman
  20914. exports.createDiffieHellman = exports.DiffieHellman = createDiffieHellman
  20915. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ 49).Buffer))
  20916. /***/ }),
  20917. /* 129 */
  20918. /*!**********************************************************!*\
  20919. !*** ./node_modules/diffie-hellman/lib/generatePrime.js ***!
  20920. \**********************************************************/
  20921. /*! no static exports found */
  20922. /***/ (function(module, exports, __webpack_require__) {
  20923. var randomBytes = __webpack_require__(/*! randombytes */ 45);
  20924. module.exports = findPrime;
  20925. findPrime.simpleSieve = simpleSieve;
  20926. findPrime.fermatTest = fermatTest;
  20927. var BN = __webpack_require__(/*! bn.js */ 130);
  20928. var TWENTYFOUR = new BN(24);
  20929. var MillerRabin = __webpack_require__(/*! miller-rabin */ 133);
  20930. var millerRabin = new MillerRabin();
  20931. var ONE = new BN(1);
  20932. var TWO = new BN(2);
  20933. var FIVE = new BN(5);
  20934. var SIXTEEN = new BN(16);
  20935. var EIGHT = new BN(8);
  20936. var TEN = new BN(10);
  20937. var THREE = new BN(3);
  20938. var SEVEN = new BN(7);
  20939. var ELEVEN = new BN(11);
  20940. var FOUR = new BN(4);
  20941. var TWELVE = new BN(12);
  20942. var primes = null;
  20943. function _getPrimes() {
  20944. if (primes !== null)
  20945. return primes;
  20946. var limit = 0x100000;
  20947. var res = [];
  20948. res[0] = 2;
  20949. for (var i = 1, k = 3; k < limit; k += 2) {
  20950. var sqrt = Math.ceil(Math.sqrt(k));
  20951. for (var j = 0; j < i && res[j] <= sqrt; j++)
  20952. if (k % res[j] === 0)
  20953. break;
  20954. if (i !== j && res[j] <= sqrt)
  20955. continue;
  20956. res[i++] = k;
  20957. }
  20958. primes = res;
  20959. return res;
  20960. }
  20961. function simpleSieve(p) {
  20962. var primes = _getPrimes();
  20963. for (var i = 0; i < primes.length; i++)
  20964. if (p.modn(primes[i]) === 0) {
  20965. if (p.cmpn(primes[i]) === 0) {
  20966. return true;
  20967. } else {
  20968. return false;
  20969. }
  20970. }
  20971. return true;
  20972. }
  20973. function fermatTest(p) {
  20974. var red = BN.mont(p);
  20975. return TWO.toRed(red).redPow(p.subn(1)).fromRed().cmpn(1) === 0;
  20976. }
  20977. function findPrime(bits, gen) {
  20978. if (bits < 16) {
  20979. // this is what openssl does
  20980. if (gen === 2 || gen === 5) {
  20981. return new BN([0x8c, 0x7b]);
  20982. } else {
  20983. return new BN([0x8c, 0x27]);
  20984. }
  20985. }
  20986. gen = new BN(gen);
  20987. var num, n2;
  20988. while (true) {
  20989. num = new BN(randomBytes(Math.ceil(bits / 8)));
  20990. while (num.bitLength() > bits) {
  20991. num.ishrn(1);
  20992. }
  20993. if (num.isEven()) {
  20994. num.iadd(ONE);
  20995. }
  20996. if (!num.testn(1)) {
  20997. num.iadd(TWO);
  20998. }
  20999. if (!gen.cmp(TWO)) {
  21000. while (num.mod(TWENTYFOUR).cmp(ELEVEN)) {
  21001. num.iadd(FOUR);
  21002. }
  21003. } else if (!gen.cmp(FIVE)) {
  21004. while (num.mod(TEN).cmp(THREE)) {
  21005. num.iadd(FOUR);
  21006. }
  21007. }
  21008. n2 = num.shrn(1);
  21009. if (simpleSieve(n2) && simpleSieve(num) &&
  21010. fermatTest(n2) && fermatTest(num) &&
  21011. millerRabin.test(n2) && millerRabin.test(num)) {
  21012. return num;
  21013. }
  21014. }
  21015. }
  21016. /***/ }),
  21017. /* 130 */
  21018. /*!**************************************!*\
  21019. !*** ./node_modules/bn.js/lib/bn.js ***!
  21020. \**************************************/
  21021. /*! no static exports found */
  21022. /***/ (function(module, exports, __webpack_require__) {
  21023. /* WEBPACK VAR INJECTION */(function(module) {(function (module, exports) {
  21024. 'use strict';
  21025. // Utils
  21026. function assert (val, msg) {
  21027. if (!val) throw new Error(msg || 'Assertion failed');
  21028. }
  21029. // Could use `inherits` module, but don't want to move from single file
  21030. // architecture yet.
  21031. function inherits (ctor, superCtor) {
  21032. ctor.super_ = superCtor;
  21033. var TempCtor = function () {};
  21034. TempCtor.prototype = superCtor.prototype;
  21035. ctor.prototype = new TempCtor();
  21036. ctor.prototype.constructor = ctor;
  21037. }
  21038. // BN
  21039. function BN (number, base, endian) {
  21040. if (BN.isBN(number)) {
  21041. return number;
  21042. }
  21043. this.negative = 0;
  21044. this.words = null;
  21045. this.length = 0;
  21046. // Reduction context
  21047. this.red = null;
  21048. if (number !== null) {
  21049. if (base === 'le' || base === 'be') {
  21050. endian = base;
  21051. base = 10;
  21052. }
  21053. this._init(number || 0, base || 10, endian || 'be');
  21054. }
  21055. }
  21056. if (typeof module === 'object') {
  21057. module.exports = BN;
  21058. } else {
  21059. exports.BN = BN;
  21060. }
  21061. BN.BN = BN;
  21062. BN.wordSize = 26;
  21063. var Buffer;
  21064. try {
  21065. Buffer = __webpack_require__(/*! buffer */ 132).Buffer;
  21066. } catch (e) {
  21067. }
  21068. BN.isBN = function isBN (num) {
  21069. if (num instanceof BN) {
  21070. return true;
  21071. }
  21072. return num !== null && typeof num === 'object' &&
  21073. num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);
  21074. };
  21075. BN.max = function max (left, right) {
  21076. if (left.cmp(right) > 0) return left;
  21077. return right;
  21078. };
  21079. BN.min = function min (left, right) {
  21080. if (left.cmp(right) < 0) return left;
  21081. return right;
  21082. };
  21083. BN.prototype._init = function init (number, base, endian) {
  21084. if (typeof number === 'number') {
  21085. return this._initNumber(number, base, endian);
  21086. }
  21087. if (typeof number === 'object') {
  21088. return this._initArray(number, base, endian);
  21089. }
  21090. if (base === 'hex') {
  21091. base = 16;
  21092. }
  21093. assert(base === (base | 0) && base >= 2 && base <= 36);
  21094. number = number.toString().replace(/\s+/g, '');
  21095. var start = 0;
  21096. if (number[0] === '-') {
  21097. start++;
  21098. }
  21099. if (base === 16) {
  21100. this._parseHex(number, start);
  21101. } else {
  21102. this._parseBase(number, base, start);
  21103. }
  21104. if (number[0] === '-') {
  21105. this.negative = 1;
  21106. }
  21107. this._strip();
  21108. if (endian !== 'le') return;
  21109. this._initArray(this.toArray(), base, endian);
  21110. };
  21111. BN.prototype._initNumber = function _initNumber (number, base, endian) {
  21112. if (number < 0) {
  21113. this.negative = 1;
  21114. number = -number;
  21115. }
  21116. if (number < 0x4000000) {
  21117. this.words = [number & 0x3ffffff];
  21118. this.length = 1;
  21119. } else if (number < 0x10000000000000) {
  21120. this.words = [
  21121. number & 0x3ffffff,
  21122. (number / 0x4000000) & 0x3ffffff
  21123. ];
  21124. this.length = 2;
  21125. } else {
  21126. assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)
  21127. this.words = [
  21128. number & 0x3ffffff,
  21129. (number / 0x4000000) & 0x3ffffff,
  21130. 1
  21131. ];
  21132. this.length = 3;
  21133. }
  21134. if (endian !== 'le') return;
  21135. // Reverse the bytes
  21136. this._initArray(this.toArray(), base, endian);
  21137. };
  21138. BN.prototype._initArray = function _initArray (number, base, endian) {
  21139. // Perhaps a Uint8Array
  21140. assert(typeof number.length === 'number');
  21141. if (number.length <= 0) {
  21142. this.words = [0];
  21143. this.length = 1;
  21144. return this;
  21145. }
  21146. this.length = Math.ceil(number.length / 3);
  21147. this.words = new Array(this.length);
  21148. for (var i = 0; i < this.length; i++) {
  21149. this.words[i] = 0;
  21150. }
  21151. var j, w;
  21152. var off = 0;
  21153. if (endian === 'be') {
  21154. for (i = number.length - 1, j = 0; i >= 0; i -= 3) {
  21155. w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);
  21156. this.words[j] |= (w << off) & 0x3ffffff;
  21157. this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;
  21158. off += 24;
  21159. if (off >= 26) {
  21160. off -= 26;
  21161. j++;
  21162. }
  21163. }
  21164. } else if (endian === 'le') {
  21165. for (i = 0, j = 0; i < number.length; i += 3) {
  21166. w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);
  21167. this.words[j] |= (w << off) & 0x3ffffff;
  21168. this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;
  21169. off += 24;
  21170. if (off >= 26) {
  21171. off -= 26;
  21172. j++;
  21173. }
  21174. }
  21175. }
  21176. return this._strip();
  21177. };
  21178. function parseHex (str, start, end) {
  21179. var r = 0;
  21180. var len = Math.min(str.length, end);
  21181. var z = 0;
  21182. for (var i = start; i < len; i++) {
  21183. var c = str.charCodeAt(i) - 48;
  21184. r <<= 4;
  21185. var b;
  21186. // 'a' - 'f'
  21187. if (c >= 49 && c <= 54) {
  21188. b = c - 49 + 0xa;
  21189. // 'A' - 'F'
  21190. } else if (c >= 17 && c <= 22) {
  21191. b = c - 17 + 0xa;
  21192. // '0' - '9'
  21193. } else {
  21194. b = c;
  21195. }
  21196. r |= b;
  21197. z |= b;
  21198. }
  21199. assert(!(z & 0xf0), 'Invalid character in ' + str);
  21200. return r;
  21201. }
  21202. BN.prototype._parseHex = function _parseHex (number, start) {
  21203. // Create possibly bigger array to ensure that it fits the number
  21204. this.length = Math.ceil((number.length - start) / 6);
  21205. this.words = new Array(this.length);
  21206. for (var i = 0; i < this.length; i++) {
  21207. this.words[i] = 0;
  21208. }
  21209. var j, w;
  21210. // Scan 24-bit chunks and add them to the number
  21211. var off = 0;
  21212. for (i = number.length - 6, j = 0; i >= start; i -= 6) {
  21213. w = parseHex(number, i, i + 6);
  21214. this.words[j] |= (w << off) & 0x3ffffff;
  21215. // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb
  21216. this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;
  21217. off += 24;
  21218. if (off >= 26) {
  21219. off -= 26;
  21220. j++;
  21221. }
  21222. }
  21223. if (i + 6 !== start) {
  21224. w = parseHex(number, start, i + 6);
  21225. this.words[j] |= (w << off) & 0x3ffffff;
  21226. this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;
  21227. }
  21228. this._strip();
  21229. };
  21230. function parseBase (str, start, end, mul) {
  21231. var r = 0;
  21232. var b = 0;
  21233. var len = Math.min(str.length, end);
  21234. for (var i = start; i < len; i++) {
  21235. var c = str.charCodeAt(i) - 48;
  21236. r *= mul;
  21237. // 'a'
  21238. if (c >= 49) {
  21239. b = c - 49 + 0xa;
  21240. // 'A'
  21241. } else if (c >= 17) {
  21242. b = c - 17 + 0xa;
  21243. // '0' - '9'
  21244. } else {
  21245. b = c;
  21246. }
  21247. assert(c >= 0 && b < mul, 'Invalid character');
  21248. r += b;
  21249. }
  21250. return r;
  21251. }
  21252. BN.prototype._parseBase = function _parseBase (number, base, start) {
  21253. // Initialize as zero
  21254. this.words = [0];
  21255. this.length = 1;
  21256. // Find length of limb in base
  21257. for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {
  21258. limbLen++;
  21259. }
  21260. limbLen--;
  21261. limbPow = (limbPow / base) | 0;
  21262. var total = number.length - start;
  21263. var mod = total % limbLen;
  21264. var end = Math.min(total, total - mod) + start;
  21265. var word = 0;
  21266. for (var i = start; i < end; i += limbLen) {
  21267. word = parseBase(number, i, i + limbLen, base);
  21268. this.imuln(limbPow);
  21269. if (this.words[0] + word < 0x4000000) {
  21270. this.words[0] += word;
  21271. } else {
  21272. this._iaddn(word);
  21273. }
  21274. }
  21275. if (mod !== 0) {
  21276. var pow = 1;
  21277. word = parseBase(number, i, number.length, base);
  21278. for (i = 0; i < mod; i++) {
  21279. pow *= base;
  21280. }
  21281. this.imuln(pow);
  21282. if (this.words[0] + word < 0x4000000) {
  21283. this.words[0] += word;
  21284. } else {
  21285. this._iaddn(word);
  21286. }
  21287. }
  21288. };
  21289. BN.prototype.copy = function copy (dest) {
  21290. dest.words = new Array(this.length);
  21291. for (var i = 0; i < this.length; i++) {
  21292. dest.words[i] = this.words[i];
  21293. }
  21294. dest.length = this.length;
  21295. dest.negative = this.negative;
  21296. dest.red = this.red;
  21297. };
  21298. function move (dest, src) {
  21299. dest.words = src.words;
  21300. dest.length = src.length;
  21301. dest.negative = src.negative;
  21302. dest.red = src.red;
  21303. }
  21304. BN.prototype._move = function _move (dest) {
  21305. move(dest, this);
  21306. };
  21307. BN.prototype.clone = function clone () {
  21308. var r = new BN(null);
  21309. this.copy(r);
  21310. return r;
  21311. };
  21312. BN.prototype._expand = function _expand (size) {
  21313. while (this.length < size) {
  21314. this.words[this.length++] = 0;
  21315. }
  21316. return this;
  21317. };
  21318. // Remove leading `0` from `this`
  21319. BN.prototype._strip = function strip () {
  21320. while (this.length > 1 && this.words[this.length - 1] === 0) {
  21321. this.length--;
  21322. }
  21323. return this._normSign();
  21324. };
  21325. BN.prototype._normSign = function _normSign () {
  21326. // -0 = 0
  21327. if (this.length === 1 && this.words[0] === 0) {
  21328. this.negative = 0;
  21329. }
  21330. return this;
  21331. };
  21332. // Check Symbol.for because not everywhere where Symbol defined
  21333. // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#Browser_compatibility
  21334. if (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function') {
  21335. BN.prototype[Symbol.for('nodejs.util.inspect.custom')] = inspect;
  21336. } else {
  21337. BN.prototype.inspect = inspect;
  21338. }
  21339. function inspect () {
  21340. return (this.red ? '<BN-R: ' : '<BN: ') + this.toString(16) + '>';
  21341. }
  21342. /*
  21343. var zeros = [];
  21344. var groupSizes = [];
  21345. var groupBases = [];
  21346. var s = '';
  21347. var i = -1;
  21348. while (++i < BN.wordSize) {
  21349. zeros[i] = s;
  21350. s += '0';
  21351. }
  21352. groupSizes[0] = 0;
  21353. groupSizes[1] = 0;
  21354. groupBases[0] = 0;
  21355. groupBases[1] = 0;
  21356. var base = 2 - 1;
  21357. while (++base < 36 + 1) {
  21358. var groupSize = 0;
  21359. var groupBase = 1;
  21360. while (groupBase < (1 << BN.wordSize) / base) {
  21361. groupBase *= base;
  21362. groupSize += 1;
  21363. }
  21364. groupSizes[base] = groupSize;
  21365. groupBases[base] = groupBase;
  21366. }
  21367. */
  21368. var zeros = [
  21369. '',
  21370. '0',
  21371. '00',
  21372. '000',
  21373. '0000',
  21374. '00000',
  21375. '000000',
  21376. '0000000',
  21377. '00000000',
  21378. '000000000',
  21379. '0000000000',
  21380. '00000000000',
  21381. '000000000000',
  21382. '0000000000000',
  21383. '00000000000000',
  21384. '000000000000000',
  21385. '0000000000000000',
  21386. '00000000000000000',
  21387. '000000000000000000',
  21388. '0000000000000000000',
  21389. '00000000000000000000',
  21390. '000000000000000000000',
  21391. '0000000000000000000000',
  21392. '00000000000000000000000',
  21393. '000000000000000000000000',
  21394. '0000000000000000000000000'
  21395. ];
  21396. var groupSizes = [
  21397. 0, 0,
  21398. 25, 16, 12, 11, 10, 9, 8,
  21399. 8, 7, 7, 7, 7, 6, 6,
  21400. 6, 6, 6, 6, 6, 5, 5,
  21401. 5, 5, 5, 5, 5, 5, 5,
  21402. 5, 5, 5, 5, 5, 5, 5
  21403. ];
  21404. var groupBases = [
  21405. 0, 0,
  21406. 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,
  21407. 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,
  21408. 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,
  21409. 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,
  21410. 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176
  21411. ];
  21412. BN.prototype.toString = function toString (base, padding) {
  21413. base = base || 10;
  21414. padding = padding | 0 || 1;
  21415. var out;
  21416. if (base === 16 || base === 'hex') {
  21417. out = '';
  21418. var off = 0;
  21419. var carry = 0;
  21420. for (var i = 0; i < this.length; i++) {
  21421. var w = this.words[i];
  21422. var word = (((w << off) | carry) & 0xffffff).toString(16);
  21423. carry = (w >>> (24 - off)) & 0xffffff;
  21424. if (carry !== 0 || i !== this.length - 1) {
  21425. out = zeros[6 - word.length] + word + out;
  21426. } else {
  21427. out = word + out;
  21428. }
  21429. off += 2;
  21430. if (off >= 26) {
  21431. off -= 26;
  21432. i--;
  21433. }
  21434. }
  21435. if (carry !== 0) {
  21436. out = carry.toString(16) + out;
  21437. }
  21438. while (out.length % padding !== 0) {
  21439. out = '0' + out;
  21440. }
  21441. if (this.negative !== 0) {
  21442. out = '-' + out;
  21443. }
  21444. return out;
  21445. }
  21446. if (base === (base | 0) && base >= 2 && base <= 36) {
  21447. // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));
  21448. var groupSize = groupSizes[base];
  21449. // var groupBase = Math.pow(base, groupSize);
  21450. var groupBase = groupBases[base];
  21451. out = '';
  21452. var c = this.clone();
  21453. c.negative = 0;
  21454. while (!c.isZero()) {
  21455. var r = c.modrn(groupBase).toString(base);
  21456. c = c.idivn(groupBase);
  21457. if (!c.isZero()) {
  21458. out = zeros[groupSize - r.length] + r + out;
  21459. } else {
  21460. out = r + out;
  21461. }
  21462. }
  21463. if (this.isZero()) {
  21464. out = '0' + out;
  21465. }
  21466. while (out.length % padding !== 0) {
  21467. out = '0' + out;
  21468. }
  21469. if (this.negative !== 0) {
  21470. out = '-' + out;
  21471. }
  21472. return out;
  21473. }
  21474. assert(false, 'Base should be between 2 and 36');
  21475. };
  21476. BN.prototype.toNumber = function toNumber () {
  21477. var ret = this.words[0];
  21478. if (this.length === 2) {
  21479. ret += this.words[1] * 0x4000000;
  21480. } else if (this.length === 3 && this.words[2] === 0x01) {
  21481. // NOTE: at this stage it is known that the top bit is set
  21482. ret += 0x10000000000000 + (this.words[1] * 0x4000000);
  21483. } else if (this.length > 2) {
  21484. assert(false, 'Number can only safely store up to 53 bits');
  21485. }
  21486. return (this.negative !== 0) ? -ret : ret;
  21487. };
  21488. BN.prototype.toJSON = function toJSON () {
  21489. return this.toString(16, 2);
  21490. };
  21491. if (Buffer) {
  21492. BN.prototype.toBuffer = function toBuffer (endian, length) {
  21493. return this.toArrayLike(Buffer, endian, length);
  21494. };
  21495. }
  21496. BN.prototype.toArray = function toArray (endian, length) {
  21497. return this.toArrayLike(Array, endian, length);
  21498. };
  21499. var allocate = function allocate (ArrayType, size) {
  21500. if (ArrayType.allocUnsafe) {
  21501. return ArrayType.allocUnsafe(size);
  21502. }
  21503. return new ArrayType(size);
  21504. };
  21505. BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {
  21506. this._strip();
  21507. var byteLength = this.byteLength();
  21508. var reqLength = length || Math.max(1, byteLength);
  21509. assert(byteLength <= reqLength, 'byte array longer than desired length');
  21510. assert(reqLength > 0, 'Requested array length <= 0');
  21511. var res = allocate(ArrayType, reqLength);
  21512. var postfix = endian === 'le' ? 'LE' : 'BE';
  21513. this['_toArrayLike' + postfix](res, byteLength);
  21514. return res;
  21515. };
  21516. BN.prototype._toArrayLikeLE = function _toArrayLikeLE (res, byteLength) {
  21517. var position = 0;
  21518. var carry = 0;
  21519. for (var i = 0, shift = 0; i < this.length; i++) {
  21520. var word = (this.words[i] << shift) | carry;
  21521. res[position++] = word & 0xff;
  21522. if (position < res.length) {
  21523. res[position++] = (word >> 8) & 0xff;
  21524. }
  21525. if (position < res.length) {
  21526. res[position++] = (word >> 16) & 0xff;
  21527. }
  21528. if (shift === 6) {
  21529. if (position < res.length) {
  21530. res[position++] = (word >> 24) & 0xff;
  21531. }
  21532. carry = 0;
  21533. shift = 0;
  21534. } else {
  21535. carry = word >>> 24;
  21536. shift += 2;
  21537. }
  21538. }
  21539. if (position < res.length) {
  21540. res[position++] = carry;
  21541. while (position < res.length) {
  21542. res[position++] = 0;
  21543. }
  21544. }
  21545. };
  21546. BN.prototype._toArrayLikeBE = function _toArrayLikeBE (res, byteLength) {
  21547. var position = res.length - 1;
  21548. var carry = 0;
  21549. for (var i = 0, shift = 0; i < this.length; i++) {
  21550. var word = (this.words[i] << shift) | carry;
  21551. res[position--] = word & 0xff;
  21552. if (position >= 0) {
  21553. res[position--] = (word >> 8) & 0xff;
  21554. }
  21555. if (position >= 0) {
  21556. res[position--] = (word >> 16) & 0xff;
  21557. }
  21558. if (shift === 6) {
  21559. if (position >= 0) {
  21560. res[position--] = (word >> 24) & 0xff;
  21561. }
  21562. carry = 0;
  21563. shift = 0;
  21564. } else {
  21565. carry = word >>> 24;
  21566. shift += 2;
  21567. }
  21568. }
  21569. if (position >= 0) {
  21570. res[position--] = carry;
  21571. while (position >= 0) {
  21572. res[position--] = 0;
  21573. }
  21574. }
  21575. };
  21576. if (Math.clz32) {
  21577. BN.prototype._countBits = function _countBits (w) {
  21578. return 32 - Math.clz32(w);
  21579. };
  21580. } else {
  21581. BN.prototype._countBits = function _countBits (w) {
  21582. var t = w;
  21583. var r = 0;
  21584. if (t >= 0x1000) {
  21585. r += 13;
  21586. t >>>= 13;
  21587. }
  21588. if (t >= 0x40) {
  21589. r += 7;
  21590. t >>>= 7;
  21591. }
  21592. if (t >= 0x8) {
  21593. r += 4;
  21594. t >>>= 4;
  21595. }
  21596. if (t >= 0x02) {
  21597. r += 2;
  21598. t >>>= 2;
  21599. }
  21600. return r + t;
  21601. };
  21602. }
  21603. BN.prototype._zeroBits = function _zeroBits (w) {
  21604. // Short-cut
  21605. if (w === 0) return 26;
  21606. var t = w;
  21607. var r = 0;
  21608. if ((t & 0x1fff) === 0) {
  21609. r += 13;
  21610. t >>>= 13;
  21611. }
  21612. if ((t & 0x7f) === 0) {
  21613. r += 7;
  21614. t >>>= 7;
  21615. }
  21616. if ((t & 0xf) === 0) {
  21617. r += 4;
  21618. t >>>= 4;
  21619. }
  21620. if ((t & 0x3) === 0) {
  21621. r += 2;
  21622. t >>>= 2;
  21623. }
  21624. if ((t & 0x1) === 0) {
  21625. r++;
  21626. }
  21627. return r;
  21628. };
  21629. // Return number of used bits in a BN
  21630. BN.prototype.bitLength = function bitLength () {
  21631. var w = this.words[this.length - 1];
  21632. var hi = this._countBits(w);
  21633. return (this.length - 1) * 26 + hi;
  21634. };
  21635. function toBitArray (num) {
  21636. var w = new Array(num.bitLength());
  21637. for (var bit = 0; bit < w.length; bit++) {
  21638. var off = (bit / 26) | 0;
  21639. var wbit = bit % 26;
  21640. w[bit] = (num.words[off] >>> wbit) & 0x01;
  21641. }
  21642. return w;
  21643. }
  21644. // Number of trailing zero bits
  21645. BN.prototype.zeroBits = function zeroBits () {
  21646. if (this.isZero()) return 0;
  21647. var r = 0;
  21648. for (var i = 0; i < this.length; i++) {
  21649. var b = this._zeroBits(this.words[i]);
  21650. r += b;
  21651. if (b !== 26) break;
  21652. }
  21653. return r;
  21654. };
  21655. BN.prototype.byteLength = function byteLength () {
  21656. return Math.ceil(this.bitLength() / 8);
  21657. };
  21658. BN.prototype.toTwos = function toTwos (width) {
  21659. if (this.negative !== 0) {
  21660. return this.abs().inotn(width).iaddn(1);
  21661. }
  21662. return this.clone();
  21663. };
  21664. BN.prototype.fromTwos = function fromTwos (width) {
  21665. if (this.testn(width - 1)) {
  21666. return this.notn(width).iaddn(1).ineg();
  21667. }
  21668. return this.clone();
  21669. };
  21670. BN.prototype.isNeg = function isNeg () {
  21671. return this.negative !== 0;
  21672. };
  21673. // Return negative clone of `this`
  21674. BN.prototype.neg = function neg () {
  21675. return this.clone().ineg();
  21676. };
  21677. BN.prototype.ineg = function ineg () {
  21678. if (!this.isZero()) {
  21679. this.negative ^= 1;
  21680. }
  21681. return this;
  21682. };
  21683. // Or `num` with `this` in-place
  21684. BN.prototype.iuor = function iuor (num) {
  21685. while (this.length < num.length) {
  21686. this.words[this.length++] = 0;
  21687. }
  21688. for (var i = 0; i < num.length; i++) {
  21689. this.words[i] = this.words[i] | num.words[i];
  21690. }
  21691. return this._strip();
  21692. };
  21693. BN.prototype.ior = function ior (num) {
  21694. assert((this.negative | num.negative) === 0);
  21695. return this.iuor(num);
  21696. };
  21697. // Or `num` with `this`
  21698. BN.prototype.or = function or (num) {
  21699. if (this.length > num.length) return this.clone().ior(num);
  21700. return num.clone().ior(this);
  21701. };
  21702. BN.prototype.uor = function uor (num) {
  21703. if (this.length > num.length) return this.clone().iuor(num);
  21704. return num.clone().iuor(this);
  21705. };
  21706. // And `num` with `this` in-place
  21707. BN.prototype.iuand = function iuand (num) {
  21708. // b = min-length(num, this)
  21709. var b;
  21710. if (this.length > num.length) {
  21711. b = num;
  21712. } else {
  21713. b = this;
  21714. }
  21715. for (var i = 0; i < b.length; i++) {
  21716. this.words[i] = this.words[i] & num.words[i];
  21717. }
  21718. this.length = b.length;
  21719. return this._strip();
  21720. };
  21721. BN.prototype.iand = function iand (num) {
  21722. assert((this.negative | num.negative) === 0);
  21723. return this.iuand(num);
  21724. };
  21725. // And `num` with `this`
  21726. BN.prototype.and = function and (num) {
  21727. if (this.length > num.length) return this.clone().iand(num);
  21728. return num.clone().iand(this);
  21729. };
  21730. BN.prototype.uand = function uand (num) {
  21731. if (this.length > num.length) return this.clone().iuand(num);
  21732. return num.clone().iuand(this);
  21733. };
  21734. // Xor `num` with `this` in-place
  21735. BN.prototype.iuxor = function iuxor (num) {
  21736. // a.length > b.length
  21737. var a;
  21738. var b;
  21739. if (this.length > num.length) {
  21740. a = this;
  21741. b = num;
  21742. } else {
  21743. a = num;
  21744. b = this;
  21745. }
  21746. for (var i = 0; i < b.length; i++) {
  21747. this.words[i] = a.words[i] ^ b.words[i];
  21748. }
  21749. if (this !== a) {
  21750. for (; i < a.length; i++) {
  21751. this.words[i] = a.words[i];
  21752. }
  21753. }
  21754. this.length = a.length;
  21755. return this._strip();
  21756. };
  21757. BN.prototype.ixor = function ixor (num) {
  21758. assert((this.negative | num.negative) === 0);
  21759. return this.iuxor(num);
  21760. };
  21761. // Xor `num` with `this`
  21762. BN.prototype.xor = function xor (num) {
  21763. if (this.length > num.length) return this.clone().ixor(num);
  21764. return num.clone().ixor(this);
  21765. };
  21766. BN.prototype.uxor = function uxor (num) {
  21767. if (this.length > num.length) return this.clone().iuxor(num);
  21768. return num.clone().iuxor(this);
  21769. };
  21770. // Not ``this`` with ``width`` bitwidth
  21771. BN.prototype.inotn = function inotn (width) {
  21772. assert(typeof width === 'number' && width >= 0);
  21773. var bytesNeeded = Math.ceil(width / 26) | 0;
  21774. var bitsLeft = width % 26;
  21775. // Extend the buffer with leading zeroes
  21776. this._expand(bytesNeeded);
  21777. if (bitsLeft > 0) {
  21778. bytesNeeded--;
  21779. }
  21780. // Handle complete words
  21781. for (var i = 0; i < bytesNeeded; i++) {
  21782. this.words[i] = ~this.words[i] & 0x3ffffff;
  21783. }
  21784. // Handle the residue
  21785. if (bitsLeft > 0) {
  21786. this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));
  21787. }
  21788. // And remove leading zeroes
  21789. return this._strip();
  21790. };
  21791. BN.prototype.notn = function notn (width) {
  21792. return this.clone().inotn(width);
  21793. };
  21794. // Set `bit` of `this`
  21795. BN.prototype.setn = function setn (bit, val) {
  21796. assert(typeof bit === 'number' && bit >= 0);
  21797. var off = (bit / 26) | 0;
  21798. var wbit = bit % 26;
  21799. this._expand(off + 1);
  21800. if (val) {
  21801. this.words[off] = this.words[off] | (1 << wbit);
  21802. } else {
  21803. this.words[off] = this.words[off] & ~(1 << wbit);
  21804. }
  21805. return this._strip();
  21806. };
  21807. // Add `num` to `this` in-place
  21808. BN.prototype.iadd = function iadd (num) {
  21809. var r;
  21810. // negative + positive
  21811. if (this.negative !== 0 && num.negative === 0) {
  21812. this.negative = 0;
  21813. r = this.isub(num);
  21814. this.negative ^= 1;
  21815. return this._normSign();
  21816. // positive + negative
  21817. } else if (this.negative === 0 && num.negative !== 0) {
  21818. num.negative = 0;
  21819. r = this.isub(num);
  21820. num.negative = 1;
  21821. return r._normSign();
  21822. }
  21823. // a.length > b.length
  21824. var a, b;
  21825. if (this.length > num.length) {
  21826. a = this;
  21827. b = num;
  21828. } else {
  21829. a = num;
  21830. b = this;
  21831. }
  21832. var carry = 0;
  21833. for (var i = 0; i < b.length; i++) {
  21834. r = (a.words[i] | 0) + (b.words[i] | 0) + carry;
  21835. this.words[i] = r & 0x3ffffff;
  21836. carry = r >>> 26;
  21837. }
  21838. for (; carry !== 0 && i < a.length; i++) {
  21839. r = (a.words[i] | 0) + carry;
  21840. this.words[i] = r & 0x3ffffff;
  21841. carry = r >>> 26;
  21842. }
  21843. this.length = a.length;
  21844. if (carry !== 0) {
  21845. this.words[this.length] = carry;
  21846. this.length++;
  21847. // Copy the rest of the words
  21848. } else if (a !== this) {
  21849. for (; i < a.length; i++) {
  21850. this.words[i] = a.words[i];
  21851. }
  21852. }
  21853. return this;
  21854. };
  21855. // Add `num` to `this`
  21856. BN.prototype.add = function add (num) {
  21857. var res;
  21858. if (num.negative !== 0 && this.negative === 0) {
  21859. num.negative = 0;
  21860. res = this.sub(num);
  21861. num.negative ^= 1;
  21862. return res;
  21863. } else if (num.negative === 0 && this.negative !== 0) {
  21864. this.negative = 0;
  21865. res = num.sub(this);
  21866. this.negative = 1;
  21867. return res;
  21868. }
  21869. if (this.length > num.length) return this.clone().iadd(num);
  21870. return num.clone().iadd(this);
  21871. };
  21872. // Subtract `num` from `this` in-place
  21873. BN.prototype.isub = function isub (num) {
  21874. // this - (-num) = this + num
  21875. if (num.negative !== 0) {
  21876. num.negative = 0;
  21877. var r = this.iadd(num);
  21878. num.negative = 1;
  21879. return r._normSign();
  21880. // -this - num = -(this + num)
  21881. } else if (this.negative !== 0) {
  21882. this.negative = 0;
  21883. this.iadd(num);
  21884. this.negative = 1;
  21885. return this._normSign();
  21886. }
  21887. // At this point both numbers are positive
  21888. var cmp = this.cmp(num);
  21889. // Optimization - zeroify
  21890. if (cmp === 0) {
  21891. this.negative = 0;
  21892. this.length = 1;
  21893. this.words[0] = 0;
  21894. return this;
  21895. }
  21896. // a > b
  21897. var a, b;
  21898. if (cmp > 0) {
  21899. a = this;
  21900. b = num;
  21901. } else {
  21902. a = num;
  21903. b = this;
  21904. }
  21905. var carry = 0;
  21906. for (var i = 0; i < b.length; i++) {
  21907. r = (a.words[i] | 0) - (b.words[i] | 0) + carry;
  21908. carry = r >> 26;
  21909. this.words[i] = r & 0x3ffffff;
  21910. }
  21911. for (; carry !== 0 && i < a.length; i++) {
  21912. r = (a.words[i] | 0) + carry;
  21913. carry = r >> 26;
  21914. this.words[i] = r & 0x3ffffff;
  21915. }
  21916. // Copy rest of the words
  21917. if (carry === 0 && i < a.length && a !== this) {
  21918. for (; i < a.length; i++) {
  21919. this.words[i] = a.words[i];
  21920. }
  21921. }
  21922. this.length = Math.max(this.length, i);
  21923. if (a !== this) {
  21924. this.negative = 1;
  21925. }
  21926. return this._strip();
  21927. };
  21928. // Subtract `num` from `this`
  21929. BN.prototype.sub = function sub (num) {
  21930. return this.clone().isub(num);
  21931. };
  21932. function smallMulTo (self, num, out) {
  21933. out.negative = num.negative ^ self.negative;
  21934. var len = (self.length + num.length) | 0;
  21935. out.length = len;
  21936. len = (len - 1) | 0;
  21937. // Peel one iteration (compiler can't do it, because of code complexity)
  21938. var a = self.words[0] | 0;
  21939. var b = num.words[0] | 0;
  21940. var r = a * b;
  21941. var lo = r & 0x3ffffff;
  21942. var carry = (r / 0x4000000) | 0;
  21943. out.words[0] = lo;
  21944. for (var k = 1; k < len; k++) {
  21945. // Sum all words with the same `i + j = k` and accumulate `ncarry`,
  21946. // note that ncarry could be >= 0x3ffffff
  21947. var ncarry = carry >>> 26;
  21948. var rword = carry & 0x3ffffff;
  21949. var maxJ = Math.min(k, num.length - 1);
  21950. for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
  21951. var i = (k - j) | 0;
  21952. a = self.words[i] | 0;
  21953. b = num.words[j] | 0;
  21954. r = a * b + rword;
  21955. ncarry += (r / 0x4000000) | 0;
  21956. rword = r & 0x3ffffff;
  21957. }
  21958. out.words[k] = rword | 0;
  21959. carry = ncarry | 0;
  21960. }
  21961. if (carry !== 0) {
  21962. out.words[k] = carry | 0;
  21963. } else {
  21964. out.length--;
  21965. }
  21966. return out._strip();
  21967. }
  21968. // TODO(indutny): it may be reasonable to omit it for users who don't need
  21969. // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit
  21970. // multiplication (like elliptic secp256k1).
  21971. var comb10MulTo = function comb10MulTo (self, num, out) {
  21972. var a = self.words;
  21973. var b = num.words;
  21974. var o = out.words;
  21975. var c = 0;
  21976. var lo;
  21977. var mid;
  21978. var hi;
  21979. var a0 = a[0] | 0;
  21980. var al0 = a0 & 0x1fff;
  21981. var ah0 = a0 >>> 13;
  21982. var a1 = a[1] | 0;
  21983. var al1 = a1 & 0x1fff;
  21984. var ah1 = a1 >>> 13;
  21985. var a2 = a[2] | 0;
  21986. var al2 = a2 & 0x1fff;
  21987. var ah2 = a2 >>> 13;
  21988. var a3 = a[3] | 0;
  21989. var al3 = a3 & 0x1fff;
  21990. var ah3 = a3 >>> 13;
  21991. var a4 = a[4] | 0;
  21992. var al4 = a4 & 0x1fff;
  21993. var ah4 = a4 >>> 13;
  21994. var a5 = a[5] | 0;
  21995. var al5 = a5 & 0x1fff;
  21996. var ah5 = a5 >>> 13;
  21997. var a6 = a[6] | 0;
  21998. var al6 = a6 & 0x1fff;
  21999. var ah6 = a6 >>> 13;
  22000. var a7 = a[7] | 0;
  22001. var al7 = a7 & 0x1fff;
  22002. var ah7 = a7 >>> 13;
  22003. var a8 = a[8] | 0;
  22004. var al8 = a8 & 0x1fff;
  22005. var ah8 = a8 >>> 13;
  22006. var a9 = a[9] | 0;
  22007. var al9 = a9 & 0x1fff;
  22008. var ah9 = a9 >>> 13;
  22009. var b0 = b[0] | 0;
  22010. var bl0 = b0 & 0x1fff;
  22011. var bh0 = b0 >>> 13;
  22012. var b1 = b[1] | 0;
  22013. var bl1 = b1 & 0x1fff;
  22014. var bh1 = b1 >>> 13;
  22015. var b2 = b[2] | 0;
  22016. var bl2 = b2 & 0x1fff;
  22017. var bh2 = b2 >>> 13;
  22018. var b3 = b[3] | 0;
  22019. var bl3 = b3 & 0x1fff;
  22020. var bh3 = b3 >>> 13;
  22021. var b4 = b[4] | 0;
  22022. var bl4 = b4 & 0x1fff;
  22023. var bh4 = b4 >>> 13;
  22024. var b5 = b[5] | 0;
  22025. var bl5 = b5 & 0x1fff;
  22026. var bh5 = b5 >>> 13;
  22027. var b6 = b[6] | 0;
  22028. var bl6 = b6 & 0x1fff;
  22029. var bh6 = b6 >>> 13;
  22030. var b7 = b[7] | 0;
  22031. var bl7 = b7 & 0x1fff;
  22032. var bh7 = b7 >>> 13;
  22033. var b8 = b[8] | 0;
  22034. var bl8 = b8 & 0x1fff;
  22035. var bh8 = b8 >>> 13;
  22036. var b9 = b[9] | 0;
  22037. var bl9 = b9 & 0x1fff;
  22038. var bh9 = b9 >>> 13;
  22039. out.negative = self.negative ^ num.negative;
  22040. out.length = 19;
  22041. /* k = 0 */
  22042. lo = Math.imul(al0, bl0);
  22043. mid = Math.imul(al0, bh0);
  22044. mid = (mid + Math.imul(ah0, bl0)) | 0;
  22045. hi = Math.imul(ah0, bh0);
  22046. var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  22047. c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;
  22048. w0 &= 0x3ffffff;
  22049. /* k = 1 */
  22050. lo = Math.imul(al1, bl0);
  22051. mid = Math.imul(al1, bh0);
  22052. mid = (mid + Math.imul(ah1, bl0)) | 0;
  22053. hi = Math.imul(ah1, bh0);
  22054. lo = (lo + Math.imul(al0, bl1)) | 0;
  22055. mid = (mid + Math.imul(al0, bh1)) | 0;
  22056. mid = (mid + Math.imul(ah0, bl1)) | 0;
  22057. hi = (hi + Math.imul(ah0, bh1)) | 0;
  22058. var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  22059. c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;
  22060. w1 &= 0x3ffffff;
  22061. /* k = 2 */
  22062. lo = Math.imul(al2, bl0);
  22063. mid = Math.imul(al2, bh0);
  22064. mid = (mid + Math.imul(ah2, bl0)) | 0;
  22065. hi = Math.imul(ah2, bh0);
  22066. lo = (lo + Math.imul(al1, bl1)) | 0;
  22067. mid = (mid + Math.imul(al1, bh1)) | 0;
  22068. mid = (mid + Math.imul(ah1, bl1)) | 0;
  22069. hi = (hi + Math.imul(ah1, bh1)) | 0;
  22070. lo = (lo + Math.imul(al0, bl2)) | 0;
  22071. mid = (mid + Math.imul(al0, bh2)) | 0;
  22072. mid = (mid + Math.imul(ah0, bl2)) | 0;
  22073. hi = (hi + Math.imul(ah0, bh2)) | 0;
  22074. var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  22075. c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;
  22076. w2 &= 0x3ffffff;
  22077. /* k = 3 */
  22078. lo = Math.imul(al3, bl0);
  22079. mid = Math.imul(al3, bh0);
  22080. mid = (mid + Math.imul(ah3, bl0)) | 0;
  22081. hi = Math.imul(ah3, bh0);
  22082. lo = (lo + Math.imul(al2, bl1)) | 0;
  22083. mid = (mid + Math.imul(al2, bh1)) | 0;
  22084. mid = (mid + Math.imul(ah2, bl1)) | 0;
  22085. hi = (hi + Math.imul(ah2, bh1)) | 0;
  22086. lo = (lo + Math.imul(al1, bl2)) | 0;
  22087. mid = (mid + Math.imul(al1, bh2)) | 0;
  22088. mid = (mid + Math.imul(ah1, bl2)) | 0;
  22089. hi = (hi + Math.imul(ah1, bh2)) | 0;
  22090. lo = (lo + Math.imul(al0, bl3)) | 0;
  22091. mid = (mid + Math.imul(al0, bh3)) | 0;
  22092. mid = (mid + Math.imul(ah0, bl3)) | 0;
  22093. hi = (hi + Math.imul(ah0, bh3)) | 0;
  22094. var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  22095. c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;
  22096. w3 &= 0x3ffffff;
  22097. /* k = 4 */
  22098. lo = Math.imul(al4, bl0);
  22099. mid = Math.imul(al4, bh0);
  22100. mid = (mid + Math.imul(ah4, bl0)) | 0;
  22101. hi = Math.imul(ah4, bh0);
  22102. lo = (lo + Math.imul(al3, bl1)) | 0;
  22103. mid = (mid + Math.imul(al3, bh1)) | 0;
  22104. mid = (mid + Math.imul(ah3, bl1)) | 0;
  22105. hi = (hi + Math.imul(ah3, bh1)) | 0;
  22106. lo = (lo + Math.imul(al2, bl2)) | 0;
  22107. mid = (mid + Math.imul(al2, bh2)) | 0;
  22108. mid = (mid + Math.imul(ah2, bl2)) | 0;
  22109. hi = (hi + Math.imul(ah2, bh2)) | 0;
  22110. lo = (lo + Math.imul(al1, bl3)) | 0;
  22111. mid = (mid + Math.imul(al1, bh3)) | 0;
  22112. mid = (mid + Math.imul(ah1, bl3)) | 0;
  22113. hi = (hi + Math.imul(ah1, bh3)) | 0;
  22114. lo = (lo + Math.imul(al0, bl4)) | 0;
  22115. mid = (mid + Math.imul(al0, bh4)) | 0;
  22116. mid = (mid + Math.imul(ah0, bl4)) | 0;
  22117. hi = (hi + Math.imul(ah0, bh4)) | 0;
  22118. var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  22119. c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;
  22120. w4 &= 0x3ffffff;
  22121. /* k = 5 */
  22122. lo = Math.imul(al5, bl0);
  22123. mid = Math.imul(al5, bh0);
  22124. mid = (mid + Math.imul(ah5, bl0)) | 0;
  22125. hi = Math.imul(ah5, bh0);
  22126. lo = (lo + Math.imul(al4, bl1)) | 0;
  22127. mid = (mid + Math.imul(al4, bh1)) | 0;
  22128. mid = (mid + Math.imul(ah4, bl1)) | 0;
  22129. hi = (hi + Math.imul(ah4, bh1)) | 0;
  22130. lo = (lo + Math.imul(al3, bl2)) | 0;
  22131. mid = (mid + Math.imul(al3, bh2)) | 0;
  22132. mid = (mid + Math.imul(ah3, bl2)) | 0;
  22133. hi = (hi + Math.imul(ah3, bh2)) | 0;
  22134. lo = (lo + Math.imul(al2, bl3)) | 0;
  22135. mid = (mid + Math.imul(al2, bh3)) | 0;
  22136. mid = (mid + Math.imul(ah2, bl3)) | 0;
  22137. hi = (hi + Math.imul(ah2, bh3)) | 0;
  22138. lo = (lo + Math.imul(al1, bl4)) | 0;
  22139. mid = (mid + Math.imul(al1, bh4)) | 0;
  22140. mid = (mid + Math.imul(ah1, bl4)) | 0;
  22141. hi = (hi + Math.imul(ah1, bh4)) | 0;
  22142. lo = (lo + Math.imul(al0, bl5)) | 0;
  22143. mid = (mid + Math.imul(al0, bh5)) | 0;
  22144. mid = (mid + Math.imul(ah0, bl5)) | 0;
  22145. hi = (hi + Math.imul(ah0, bh5)) | 0;
  22146. var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  22147. c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;
  22148. w5 &= 0x3ffffff;
  22149. /* k = 6 */
  22150. lo = Math.imul(al6, bl0);
  22151. mid = Math.imul(al6, bh0);
  22152. mid = (mid + Math.imul(ah6, bl0)) | 0;
  22153. hi = Math.imul(ah6, bh0);
  22154. lo = (lo + Math.imul(al5, bl1)) | 0;
  22155. mid = (mid + Math.imul(al5, bh1)) | 0;
  22156. mid = (mid + Math.imul(ah5, bl1)) | 0;
  22157. hi = (hi + Math.imul(ah5, bh1)) | 0;
  22158. lo = (lo + Math.imul(al4, bl2)) | 0;
  22159. mid = (mid + Math.imul(al4, bh2)) | 0;
  22160. mid = (mid + Math.imul(ah4, bl2)) | 0;
  22161. hi = (hi + Math.imul(ah4, bh2)) | 0;
  22162. lo = (lo + Math.imul(al3, bl3)) | 0;
  22163. mid = (mid + Math.imul(al3, bh3)) | 0;
  22164. mid = (mid + Math.imul(ah3, bl3)) | 0;
  22165. hi = (hi + Math.imul(ah3, bh3)) | 0;
  22166. lo = (lo + Math.imul(al2, bl4)) | 0;
  22167. mid = (mid + Math.imul(al2, bh4)) | 0;
  22168. mid = (mid + Math.imul(ah2, bl4)) | 0;
  22169. hi = (hi + Math.imul(ah2, bh4)) | 0;
  22170. lo = (lo + Math.imul(al1, bl5)) | 0;
  22171. mid = (mid + Math.imul(al1, bh5)) | 0;
  22172. mid = (mid + Math.imul(ah1, bl5)) | 0;
  22173. hi = (hi + Math.imul(ah1, bh5)) | 0;
  22174. lo = (lo + Math.imul(al0, bl6)) | 0;
  22175. mid = (mid + Math.imul(al0, bh6)) | 0;
  22176. mid = (mid + Math.imul(ah0, bl6)) | 0;
  22177. hi = (hi + Math.imul(ah0, bh6)) | 0;
  22178. var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  22179. c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;
  22180. w6 &= 0x3ffffff;
  22181. /* k = 7 */
  22182. lo = Math.imul(al7, bl0);
  22183. mid = Math.imul(al7, bh0);
  22184. mid = (mid + Math.imul(ah7, bl0)) | 0;
  22185. hi = Math.imul(ah7, bh0);
  22186. lo = (lo + Math.imul(al6, bl1)) | 0;
  22187. mid = (mid + Math.imul(al6, bh1)) | 0;
  22188. mid = (mid + Math.imul(ah6, bl1)) | 0;
  22189. hi = (hi + Math.imul(ah6, bh1)) | 0;
  22190. lo = (lo + Math.imul(al5, bl2)) | 0;
  22191. mid = (mid + Math.imul(al5, bh2)) | 0;
  22192. mid = (mid + Math.imul(ah5, bl2)) | 0;
  22193. hi = (hi + Math.imul(ah5, bh2)) | 0;
  22194. lo = (lo + Math.imul(al4, bl3)) | 0;
  22195. mid = (mid + Math.imul(al4, bh3)) | 0;
  22196. mid = (mid + Math.imul(ah4, bl3)) | 0;
  22197. hi = (hi + Math.imul(ah4, bh3)) | 0;
  22198. lo = (lo + Math.imul(al3, bl4)) | 0;
  22199. mid = (mid + Math.imul(al3, bh4)) | 0;
  22200. mid = (mid + Math.imul(ah3, bl4)) | 0;
  22201. hi = (hi + Math.imul(ah3, bh4)) | 0;
  22202. lo = (lo + Math.imul(al2, bl5)) | 0;
  22203. mid = (mid + Math.imul(al2, bh5)) | 0;
  22204. mid = (mid + Math.imul(ah2, bl5)) | 0;
  22205. hi = (hi + Math.imul(ah2, bh5)) | 0;
  22206. lo = (lo + Math.imul(al1, bl6)) | 0;
  22207. mid = (mid + Math.imul(al1, bh6)) | 0;
  22208. mid = (mid + Math.imul(ah1, bl6)) | 0;
  22209. hi = (hi + Math.imul(ah1, bh6)) | 0;
  22210. lo = (lo + Math.imul(al0, bl7)) | 0;
  22211. mid = (mid + Math.imul(al0, bh7)) | 0;
  22212. mid = (mid + Math.imul(ah0, bl7)) | 0;
  22213. hi = (hi + Math.imul(ah0, bh7)) | 0;
  22214. var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  22215. c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;
  22216. w7 &= 0x3ffffff;
  22217. /* k = 8 */
  22218. lo = Math.imul(al8, bl0);
  22219. mid = Math.imul(al8, bh0);
  22220. mid = (mid + Math.imul(ah8, bl0)) | 0;
  22221. hi = Math.imul(ah8, bh0);
  22222. lo = (lo + Math.imul(al7, bl1)) | 0;
  22223. mid = (mid + Math.imul(al7, bh1)) | 0;
  22224. mid = (mid + Math.imul(ah7, bl1)) | 0;
  22225. hi = (hi + Math.imul(ah7, bh1)) | 0;
  22226. lo = (lo + Math.imul(al6, bl2)) | 0;
  22227. mid = (mid + Math.imul(al6, bh2)) | 0;
  22228. mid = (mid + Math.imul(ah6, bl2)) | 0;
  22229. hi = (hi + Math.imul(ah6, bh2)) | 0;
  22230. lo = (lo + Math.imul(al5, bl3)) | 0;
  22231. mid = (mid + Math.imul(al5, bh3)) | 0;
  22232. mid = (mid + Math.imul(ah5, bl3)) | 0;
  22233. hi = (hi + Math.imul(ah5, bh3)) | 0;
  22234. lo = (lo + Math.imul(al4, bl4)) | 0;
  22235. mid = (mid + Math.imul(al4, bh4)) | 0;
  22236. mid = (mid + Math.imul(ah4, bl4)) | 0;
  22237. hi = (hi + Math.imul(ah4, bh4)) | 0;
  22238. lo = (lo + Math.imul(al3, bl5)) | 0;
  22239. mid = (mid + Math.imul(al3, bh5)) | 0;
  22240. mid = (mid + Math.imul(ah3, bl5)) | 0;
  22241. hi = (hi + Math.imul(ah3, bh5)) | 0;
  22242. lo = (lo + Math.imul(al2, bl6)) | 0;
  22243. mid = (mid + Math.imul(al2, bh6)) | 0;
  22244. mid = (mid + Math.imul(ah2, bl6)) | 0;
  22245. hi = (hi + Math.imul(ah2, bh6)) | 0;
  22246. lo = (lo + Math.imul(al1, bl7)) | 0;
  22247. mid = (mid + Math.imul(al1, bh7)) | 0;
  22248. mid = (mid + Math.imul(ah1, bl7)) | 0;
  22249. hi = (hi + Math.imul(ah1, bh7)) | 0;
  22250. lo = (lo + Math.imul(al0, bl8)) | 0;
  22251. mid = (mid + Math.imul(al0, bh8)) | 0;
  22252. mid = (mid + Math.imul(ah0, bl8)) | 0;
  22253. hi = (hi + Math.imul(ah0, bh8)) | 0;
  22254. var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  22255. c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;
  22256. w8 &= 0x3ffffff;
  22257. /* k = 9 */
  22258. lo = Math.imul(al9, bl0);
  22259. mid = Math.imul(al9, bh0);
  22260. mid = (mid + Math.imul(ah9, bl0)) | 0;
  22261. hi = Math.imul(ah9, bh0);
  22262. lo = (lo + Math.imul(al8, bl1)) | 0;
  22263. mid = (mid + Math.imul(al8, bh1)) | 0;
  22264. mid = (mid + Math.imul(ah8, bl1)) | 0;
  22265. hi = (hi + Math.imul(ah8, bh1)) | 0;
  22266. lo = (lo + Math.imul(al7, bl2)) | 0;
  22267. mid = (mid + Math.imul(al7, bh2)) | 0;
  22268. mid = (mid + Math.imul(ah7, bl2)) | 0;
  22269. hi = (hi + Math.imul(ah7, bh2)) | 0;
  22270. lo = (lo + Math.imul(al6, bl3)) | 0;
  22271. mid = (mid + Math.imul(al6, bh3)) | 0;
  22272. mid = (mid + Math.imul(ah6, bl3)) | 0;
  22273. hi = (hi + Math.imul(ah6, bh3)) | 0;
  22274. lo = (lo + Math.imul(al5, bl4)) | 0;
  22275. mid = (mid + Math.imul(al5, bh4)) | 0;
  22276. mid = (mid + Math.imul(ah5, bl4)) | 0;
  22277. hi = (hi + Math.imul(ah5, bh4)) | 0;
  22278. lo = (lo + Math.imul(al4, bl5)) | 0;
  22279. mid = (mid + Math.imul(al4, bh5)) | 0;
  22280. mid = (mid + Math.imul(ah4, bl5)) | 0;
  22281. hi = (hi + Math.imul(ah4, bh5)) | 0;
  22282. lo = (lo + Math.imul(al3, bl6)) | 0;
  22283. mid = (mid + Math.imul(al3, bh6)) | 0;
  22284. mid = (mid + Math.imul(ah3, bl6)) | 0;
  22285. hi = (hi + Math.imul(ah3, bh6)) | 0;
  22286. lo = (lo + Math.imul(al2, bl7)) | 0;
  22287. mid = (mid + Math.imul(al2, bh7)) | 0;
  22288. mid = (mid + Math.imul(ah2, bl7)) | 0;
  22289. hi = (hi + Math.imul(ah2, bh7)) | 0;
  22290. lo = (lo + Math.imul(al1, bl8)) | 0;
  22291. mid = (mid + Math.imul(al1, bh8)) | 0;
  22292. mid = (mid + Math.imul(ah1, bl8)) | 0;
  22293. hi = (hi + Math.imul(ah1, bh8)) | 0;
  22294. lo = (lo + Math.imul(al0, bl9)) | 0;
  22295. mid = (mid + Math.imul(al0, bh9)) | 0;
  22296. mid = (mid + Math.imul(ah0, bl9)) | 0;
  22297. hi = (hi + Math.imul(ah0, bh9)) | 0;
  22298. var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  22299. c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;
  22300. w9 &= 0x3ffffff;
  22301. /* k = 10 */
  22302. lo = Math.imul(al9, bl1);
  22303. mid = Math.imul(al9, bh1);
  22304. mid = (mid + Math.imul(ah9, bl1)) | 0;
  22305. hi = Math.imul(ah9, bh1);
  22306. lo = (lo + Math.imul(al8, bl2)) | 0;
  22307. mid = (mid + Math.imul(al8, bh2)) | 0;
  22308. mid = (mid + Math.imul(ah8, bl2)) | 0;
  22309. hi = (hi + Math.imul(ah8, bh2)) | 0;
  22310. lo = (lo + Math.imul(al7, bl3)) | 0;
  22311. mid = (mid + Math.imul(al7, bh3)) | 0;
  22312. mid = (mid + Math.imul(ah7, bl3)) | 0;
  22313. hi = (hi + Math.imul(ah7, bh3)) | 0;
  22314. lo = (lo + Math.imul(al6, bl4)) | 0;
  22315. mid = (mid + Math.imul(al6, bh4)) | 0;
  22316. mid = (mid + Math.imul(ah6, bl4)) | 0;
  22317. hi = (hi + Math.imul(ah6, bh4)) | 0;
  22318. lo = (lo + Math.imul(al5, bl5)) | 0;
  22319. mid = (mid + Math.imul(al5, bh5)) | 0;
  22320. mid = (mid + Math.imul(ah5, bl5)) | 0;
  22321. hi = (hi + Math.imul(ah5, bh5)) | 0;
  22322. lo = (lo + Math.imul(al4, bl6)) | 0;
  22323. mid = (mid + Math.imul(al4, bh6)) | 0;
  22324. mid = (mid + Math.imul(ah4, bl6)) | 0;
  22325. hi = (hi + Math.imul(ah4, bh6)) | 0;
  22326. lo = (lo + Math.imul(al3, bl7)) | 0;
  22327. mid = (mid + Math.imul(al3, bh7)) | 0;
  22328. mid = (mid + Math.imul(ah3, bl7)) | 0;
  22329. hi = (hi + Math.imul(ah3, bh7)) | 0;
  22330. lo = (lo + Math.imul(al2, bl8)) | 0;
  22331. mid = (mid + Math.imul(al2, bh8)) | 0;
  22332. mid = (mid + Math.imul(ah2, bl8)) | 0;
  22333. hi = (hi + Math.imul(ah2, bh8)) | 0;
  22334. lo = (lo + Math.imul(al1, bl9)) | 0;
  22335. mid = (mid + Math.imul(al1, bh9)) | 0;
  22336. mid = (mid + Math.imul(ah1, bl9)) | 0;
  22337. hi = (hi + Math.imul(ah1, bh9)) | 0;
  22338. var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  22339. c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;
  22340. w10 &= 0x3ffffff;
  22341. /* k = 11 */
  22342. lo = Math.imul(al9, bl2);
  22343. mid = Math.imul(al9, bh2);
  22344. mid = (mid + Math.imul(ah9, bl2)) | 0;
  22345. hi = Math.imul(ah9, bh2);
  22346. lo = (lo + Math.imul(al8, bl3)) | 0;
  22347. mid = (mid + Math.imul(al8, bh3)) | 0;
  22348. mid = (mid + Math.imul(ah8, bl3)) | 0;
  22349. hi = (hi + Math.imul(ah8, bh3)) | 0;
  22350. lo = (lo + Math.imul(al7, bl4)) | 0;
  22351. mid = (mid + Math.imul(al7, bh4)) | 0;
  22352. mid = (mid + Math.imul(ah7, bl4)) | 0;
  22353. hi = (hi + Math.imul(ah7, bh4)) | 0;
  22354. lo = (lo + Math.imul(al6, bl5)) | 0;
  22355. mid = (mid + Math.imul(al6, bh5)) | 0;
  22356. mid = (mid + Math.imul(ah6, bl5)) | 0;
  22357. hi = (hi + Math.imul(ah6, bh5)) | 0;
  22358. lo = (lo + Math.imul(al5, bl6)) | 0;
  22359. mid = (mid + Math.imul(al5, bh6)) | 0;
  22360. mid = (mid + Math.imul(ah5, bl6)) | 0;
  22361. hi = (hi + Math.imul(ah5, bh6)) | 0;
  22362. lo = (lo + Math.imul(al4, bl7)) | 0;
  22363. mid = (mid + Math.imul(al4, bh7)) | 0;
  22364. mid = (mid + Math.imul(ah4, bl7)) | 0;
  22365. hi = (hi + Math.imul(ah4, bh7)) | 0;
  22366. lo = (lo + Math.imul(al3, bl8)) | 0;
  22367. mid = (mid + Math.imul(al3, bh8)) | 0;
  22368. mid = (mid + Math.imul(ah3, bl8)) | 0;
  22369. hi = (hi + Math.imul(ah3, bh8)) | 0;
  22370. lo = (lo + Math.imul(al2, bl9)) | 0;
  22371. mid = (mid + Math.imul(al2, bh9)) | 0;
  22372. mid = (mid + Math.imul(ah2, bl9)) | 0;
  22373. hi = (hi + Math.imul(ah2, bh9)) | 0;
  22374. var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  22375. c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;
  22376. w11 &= 0x3ffffff;
  22377. /* k = 12 */
  22378. lo = Math.imul(al9, bl3);
  22379. mid = Math.imul(al9, bh3);
  22380. mid = (mid + Math.imul(ah9, bl3)) | 0;
  22381. hi = Math.imul(ah9, bh3);
  22382. lo = (lo + Math.imul(al8, bl4)) | 0;
  22383. mid = (mid + Math.imul(al8, bh4)) | 0;
  22384. mid = (mid + Math.imul(ah8, bl4)) | 0;
  22385. hi = (hi + Math.imul(ah8, bh4)) | 0;
  22386. lo = (lo + Math.imul(al7, bl5)) | 0;
  22387. mid = (mid + Math.imul(al7, bh5)) | 0;
  22388. mid = (mid + Math.imul(ah7, bl5)) | 0;
  22389. hi = (hi + Math.imul(ah7, bh5)) | 0;
  22390. lo = (lo + Math.imul(al6, bl6)) | 0;
  22391. mid = (mid + Math.imul(al6, bh6)) | 0;
  22392. mid = (mid + Math.imul(ah6, bl6)) | 0;
  22393. hi = (hi + Math.imul(ah6, bh6)) | 0;
  22394. lo = (lo + Math.imul(al5, bl7)) | 0;
  22395. mid = (mid + Math.imul(al5, bh7)) | 0;
  22396. mid = (mid + Math.imul(ah5, bl7)) | 0;
  22397. hi = (hi + Math.imul(ah5, bh7)) | 0;
  22398. lo = (lo + Math.imul(al4, bl8)) | 0;
  22399. mid = (mid + Math.imul(al4, bh8)) | 0;
  22400. mid = (mid + Math.imul(ah4, bl8)) | 0;
  22401. hi = (hi + Math.imul(ah4, bh8)) | 0;
  22402. lo = (lo + Math.imul(al3, bl9)) | 0;
  22403. mid = (mid + Math.imul(al3, bh9)) | 0;
  22404. mid = (mid + Math.imul(ah3, bl9)) | 0;
  22405. hi = (hi + Math.imul(ah3, bh9)) | 0;
  22406. var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  22407. c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;
  22408. w12 &= 0x3ffffff;
  22409. /* k = 13 */
  22410. lo = Math.imul(al9, bl4);
  22411. mid = Math.imul(al9, bh4);
  22412. mid = (mid + Math.imul(ah9, bl4)) | 0;
  22413. hi = Math.imul(ah9, bh4);
  22414. lo = (lo + Math.imul(al8, bl5)) | 0;
  22415. mid = (mid + Math.imul(al8, bh5)) | 0;
  22416. mid = (mid + Math.imul(ah8, bl5)) | 0;
  22417. hi = (hi + Math.imul(ah8, bh5)) | 0;
  22418. lo = (lo + Math.imul(al7, bl6)) | 0;
  22419. mid = (mid + Math.imul(al7, bh6)) | 0;
  22420. mid = (mid + Math.imul(ah7, bl6)) | 0;
  22421. hi = (hi + Math.imul(ah7, bh6)) | 0;
  22422. lo = (lo + Math.imul(al6, bl7)) | 0;
  22423. mid = (mid + Math.imul(al6, bh7)) | 0;
  22424. mid = (mid + Math.imul(ah6, bl7)) | 0;
  22425. hi = (hi + Math.imul(ah6, bh7)) | 0;
  22426. lo = (lo + Math.imul(al5, bl8)) | 0;
  22427. mid = (mid + Math.imul(al5, bh8)) | 0;
  22428. mid = (mid + Math.imul(ah5, bl8)) | 0;
  22429. hi = (hi + Math.imul(ah5, bh8)) | 0;
  22430. lo = (lo + Math.imul(al4, bl9)) | 0;
  22431. mid = (mid + Math.imul(al4, bh9)) | 0;
  22432. mid = (mid + Math.imul(ah4, bl9)) | 0;
  22433. hi = (hi + Math.imul(ah4, bh9)) | 0;
  22434. var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  22435. c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;
  22436. w13 &= 0x3ffffff;
  22437. /* k = 14 */
  22438. lo = Math.imul(al9, bl5);
  22439. mid = Math.imul(al9, bh5);
  22440. mid = (mid + Math.imul(ah9, bl5)) | 0;
  22441. hi = Math.imul(ah9, bh5);
  22442. lo = (lo + Math.imul(al8, bl6)) | 0;
  22443. mid = (mid + Math.imul(al8, bh6)) | 0;
  22444. mid = (mid + Math.imul(ah8, bl6)) | 0;
  22445. hi = (hi + Math.imul(ah8, bh6)) | 0;
  22446. lo = (lo + Math.imul(al7, bl7)) | 0;
  22447. mid = (mid + Math.imul(al7, bh7)) | 0;
  22448. mid = (mid + Math.imul(ah7, bl7)) | 0;
  22449. hi = (hi + Math.imul(ah7, bh7)) | 0;
  22450. lo = (lo + Math.imul(al6, bl8)) | 0;
  22451. mid = (mid + Math.imul(al6, bh8)) | 0;
  22452. mid = (mid + Math.imul(ah6, bl8)) | 0;
  22453. hi = (hi + Math.imul(ah6, bh8)) | 0;
  22454. lo = (lo + Math.imul(al5, bl9)) | 0;
  22455. mid = (mid + Math.imul(al5, bh9)) | 0;
  22456. mid = (mid + Math.imul(ah5, bl9)) | 0;
  22457. hi = (hi + Math.imul(ah5, bh9)) | 0;
  22458. var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  22459. c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;
  22460. w14 &= 0x3ffffff;
  22461. /* k = 15 */
  22462. lo = Math.imul(al9, bl6);
  22463. mid = Math.imul(al9, bh6);
  22464. mid = (mid + Math.imul(ah9, bl6)) | 0;
  22465. hi = Math.imul(ah9, bh6);
  22466. lo = (lo + Math.imul(al8, bl7)) | 0;
  22467. mid = (mid + Math.imul(al8, bh7)) | 0;
  22468. mid = (mid + Math.imul(ah8, bl7)) | 0;
  22469. hi = (hi + Math.imul(ah8, bh7)) | 0;
  22470. lo = (lo + Math.imul(al7, bl8)) | 0;
  22471. mid = (mid + Math.imul(al7, bh8)) | 0;
  22472. mid = (mid + Math.imul(ah7, bl8)) | 0;
  22473. hi = (hi + Math.imul(ah7, bh8)) | 0;
  22474. lo = (lo + Math.imul(al6, bl9)) | 0;
  22475. mid = (mid + Math.imul(al6, bh9)) | 0;
  22476. mid = (mid + Math.imul(ah6, bl9)) | 0;
  22477. hi = (hi + Math.imul(ah6, bh9)) | 0;
  22478. var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  22479. c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;
  22480. w15 &= 0x3ffffff;
  22481. /* k = 16 */
  22482. lo = Math.imul(al9, bl7);
  22483. mid = Math.imul(al9, bh7);
  22484. mid = (mid + Math.imul(ah9, bl7)) | 0;
  22485. hi = Math.imul(ah9, bh7);
  22486. lo = (lo + Math.imul(al8, bl8)) | 0;
  22487. mid = (mid + Math.imul(al8, bh8)) | 0;
  22488. mid = (mid + Math.imul(ah8, bl8)) | 0;
  22489. hi = (hi + Math.imul(ah8, bh8)) | 0;
  22490. lo = (lo + Math.imul(al7, bl9)) | 0;
  22491. mid = (mid + Math.imul(al7, bh9)) | 0;
  22492. mid = (mid + Math.imul(ah7, bl9)) | 0;
  22493. hi = (hi + Math.imul(ah7, bh9)) | 0;
  22494. var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  22495. c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;
  22496. w16 &= 0x3ffffff;
  22497. /* k = 17 */
  22498. lo = Math.imul(al9, bl8);
  22499. mid = Math.imul(al9, bh8);
  22500. mid = (mid + Math.imul(ah9, bl8)) | 0;
  22501. hi = Math.imul(ah9, bh8);
  22502. lo = (lo + Math.imul(al8, bl9)) | 0;
  22503. mid = (mid + Math.imul(al8, bh9)) | 0;
  22504. mid = (mid + Math.imul(ah8, bl9)) | 0;
  22505. hi = (hi + Math.imul(ah8, bh9)) | 0;
  22506. var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  22507. c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;
  22508. w17 &= 0x3ffffff;
  22509. /* k = 18 */
  22510. lo = Math.imul(al9, bl9);
  22511. mid = Math.imul(al9, bh9);
  22512. mid = (mid + Math.imul(ah9, bl9)) | 0;
  22513. hi = Math.imul(ah9, bh9);
  22514. var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  22515. c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;
  22516. w18 &= 0x3ffffff;
  22517. o[0] = w0;
  22518. o[1] = w1;
  22519. o[2] = w2;
  22520. o[3] = w3;
  22521. o[4] = w4;
  22522. o[5] = w5;
  22523. o[6] = w6;
  22524. o[7] = w7;
  22525. o[8] = w8;
  22526. o[9] = w9;
  22527. o[10] = w10;
  22528. o[11] = w11;
  22529. o[12] = w12;
  22530. o[13] = w13;
  22531. o[14] = w14;
  22532. o[15] = w15;
  22533. o[16] = w16;
  22534. o[17] = w17;
  22535. o[18] = w18;
  22536. if (c !== 0) {
  22537. o[19] = c;
  22538. out.length++;
  22539. }
  22540. return out;
  22541. };
  22542. // Polyfill comb
  22543. if (!Math.imul) {
  22544. comb10MulTo = smallMulTo;
  22545. }
  22546. function bigMulTo (self, num, out) {
  22547. out.negative = num.negative ^ self.negative;
  22548. out.length = self.length + num.length;
  22549. var carry = 0;
  22550. var hncarry = 0;
  22551. for (var k = 0; k < out.length - 1; k++) {
  22552. // Sum all words with the same `i + j = k` and accumulate `ncarry`,
  22553. // note that ncarry could be >= 0x3ffffff
  22554. var ncarry = hncarry;
  22555. hncarry = 0;
  22556. var rword = carry & 0x3ffffff;
  22557. var maxJ = Math.min(k, num.length - 1);
  22558. for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
  22559. var i = k - j;
  22560. var a = self.words[i] | 0;
  22561. var b = num.words[j] | 0;
  22562. var r = a * b;
  22563. var lo = r & 0x3ffffff;
  22564. ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;
  22565. lo = (lo + rword) | 0;
  22566. rword = lo & 0x3ffffff;
  22567. ncarry = (ncarry + (lo >>> 26)) | 0;
  22568. hncarry += ncarry >>> 26;
  22569. ncarry &= 0x3ffffff;
  22570. }
  22571. out.words[k] = rword;
  22572. carry = ncarry;
  22573. ncarry = hncarry;
  22574. }
  22575. if (carry !== 0) {
  22576. out.words[k] = carry;
  22577. } else {
  22578. out.length--;
  22579. }
  22580. return out._strip();
  22581. }
  22582. function jumboMulTo (self, num, out) {
  22583. // Temporary disable, see https://github.com/indutny/bn.js/issues/211
  22584. // var fftm = new FFTM();
  22585. // return fftm.mulp(self, num, out);
  22586. return bigMulTo(self, num, out);
  22587. }
  22588. BN.prototype.mulTo = function mulTo (num, out) {
  22589. var res;
  22590. var len = this.length + num.length;
  22591. if (this.length === 10 && num.length === 10) {
  22592. res = comb10MulTo(this, num, out);
  22593. } else if (len < 63) {
  22594. res = smallMulTo(this, num, out);
  22595. } else if (len < 1024) {
  22596. res = bigMulTo(this, num, out);
  22597. } else {
  22598. res = jumboMulTo(this, num, out);
  22599. }
  22600. return res;
  22601. };
  22602. // Cooley-Tukey algorithm for FFT
  22603. // slightly revisited to rely on looping instead of recursion
  22604. function FFTM (x, y) {
  22605. this.x = x;
  22606. this.y = y;
  22607. }
  22608. FFTM.prototype.makeRBT = function makeRBT (N) {
  22609. var t = new Array(N);
  22610. var l = BN.prototype._countBits(N) - 1;
  22611. for (var i = 0; i < N; i++) {
  22612. t[i] = this.revBin(i, l, N);
  22613. }
  22614. return t;
  22615. };
  22616. // Returns binary-reversed representation of `x`
  22617. FFTM.prototype.revBin = function revBin (x, l, N) {
  22618. if (x === 0 || x === N - 1) return x;
  22619. var rb = 0;
  22620. for (var i = 0; i < l; i++) {
  22621. rb |= (x & 1) << (l - i - 1);
  22622. x >>= 1;
  22623. }
  22624. return rb;
  22625. };
  22626. // Performs "tweedling" phase, therefore 'emulating'
  22627. // behaviour of the recursive algorithm
  22628. FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {
  22629. for (var i = 0; i < N; i++) {
  22630. rtws[i] = rws[rbt[i]];
  22631. itws[i] = iws[rbt[i]];
  22632. }
  22633. };
  22634. FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {
  22635. this.permute(rbt, rws, iws, rtws, itws, N);
  22636. for (var s = 1; s < N; s <<= 1) {
  22637. var l = s << 1;
  22638. var rtwdf = Math.cos(2 * Math.PI / l);
  22639. var itwdf = Math.sin(2 * Math.PI / l);
  22640. for (var p = 0; p < N; p += l) {
  22641. var rtwdf_ = rtwdf;
  22642. var itwdf_ = itwdf;
  22643. for (var j = 0; j < s; j++) {
  22644. var re = rtws[p + j];
  22645. var ie = itws[p + j];
  22646. var ro = rtws[p + j + s];
  22647. var io = itws[p + j + s];
  22648. var rx = rtwdf_ * ro - itwdf_ * io;
  22649. io = rtwdf_ * io + itwdf_ * ro;
  22650. ro = rx;
  22651. rtws[p + j] = re + ro;
  22652. itws[p + j] = ie + io;
  22653. rtws[p + j + s] = re - ro;
  22654. itws[p + j + s] = ie - io;
  22655. /* jshint maxdepth : false */
  22656. if (j !== l) {
  22657. rx = rtwdf * rtwdf_ - itwdf * itwdf_;
  22658. itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;
  22659. rtwdf_ = rx;
  22660. }
  22661. }
  22662. }
  22663. }
  22664. };
  22665. FFTM.prototype.guessLen13b = function guessLen13b (n, m) {
  22666. var N = Math.max(m, n) | 1;
  22667. var odd = N & 1;
  22668. var i = 0;
  22669. for (N = N / 2 | 0; N; N = N >>> 1) {
  22670. i++;
  22671. }
  22672. return 1 << i + 1 + odd;
  22673. };
  22674. FFTM.prototype.conjugate = function conjugate (rws, iws, N) {
  22675. if (N <= 1) return;
  22676. for (var i = 0; i < N / 2; i++) {
  22677. var t = rws[i];
  22678. rws[i] = rws[N - i - 1];
  22679. rws[N - i - 1] = t;
  22680. t = iws[i];
  22681. iws[i] = -iws[N - i - 1];
  22682. iws[N - i - 1] = -t;
  22683. }
  22684. };
  22685. FFTM.prototype.normalize13b = function normalize13b (ws, N) {
  22686. var carry = 0;
  22687. for (var i = 0; i < N / 2; i++) {
  22688. var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +
  22689. Math.round(ws[2 * i] / N) +
  22690. carry;
  22691. ws[i] = w & 0x3ffffff;
  22692. if (w < 0x4000000) {
  22693. carry = 0;
  22694. } else {
  22695. carry = w / 0x4000000 | 0;
  22696. }
  22697. }
  22698. return ws;
  22699. };
  22700. FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {
  22701. var carry = 0;
  22702. for (var i = 0; i < len; i++) {
  22703. carry = carry + (ws[i] | 0);
  22704. rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;
  22705. rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;
  22706. }
  22707. // Pad with zeroes
  22708. for (i = 2 * len; i < N; ++i) {
  22709. rws[i] = 0;
  22710. }
  22711. assert(carry === 0);
  22712. assert((carry & ~0x1fff) === 0);
  22713. };
  22714. FFTM.prototype.stub = function stub (N) {
  22715. var ph = new Array(N);
  22716. for (var i = 0; i < N; i++) {
  22717. ph[i] = 0;
  22718. }
  22719. return ph;
  22720. };
  22721. FFTM.prototype.mulp = function mulp (x, y, out) {
  22722. var N = 2 * this.guessLen13b(x.length, y.length);
  22723. var rbt = this.makeRBT(N);
  22724. var _ = this.stub(N);
  22725. var rws = new Array(N);
  22726. var rwst = new Array(N);
  22727. var iwst = new Array(N);
  22728. var nrws = new Array(N);
  22729. var nrwst = new Array(N);
  22730. var niwst = new Array(N);
  22731. var rmws = out.words;
  22732. rmws.length = N;
  22733. this.convert13b(x.words, x.length, rws, N);
  22734. this.convert13b(y.words, y.length, nrws, N);
  22735. this.transform(rws, _, rwst, iwst, N, rbt);
  22736. this.transform(nrws, _, nrwst, niwst, N, rbt);
  22737. for (var i = 0; i < N; i++) {
  22738. var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];
  22739. iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];
  22740. rwst[i] = rx;
  22741. }
  22742. this.conjugate(rwst, iwst, N);
  22743. this.transform(rwst, iwst, rmws, _, N, rbt);
  22744. this.conjugate(rmws, _, N);
  22745. this.normalize13b(rmws, N);
  22746. out.negative = x.negative ^ y.negative;
  22747. out.length = x.length + y.length;
  22748. return out._strip();
  22749. };
  22750. // Multiply `this` by `num`
  22751. BN.prototype.mul = function mul (num) {
  22752. var out = new BN(null);
  22753. out.words = new Array(this.length + num.length);
  22754. return this.mulTo(num, out);
  22755. };
  22756. // Multiply employing FFT
  22757. BN.prototype.mulf = function mulf (num) {
  22758. var out = new BN(null);
  22759. out.words = new Array(this.length + num.length);
  22760. return jumboMulTo(this, num, out);
  22761. };
  22762. // In-place Multiplication
  22763. BN.prototype.imul = function imul (num) {
  22764. return this.clone().mulTo(num, this);
  22765. };
  22766. BN.prototype.imuln = function imuln (num) {
  22767. var isNegNum = num < 0;
  22768. if (isNegNum) num = -num;
  22769. assert(typeof num === 'number');
  22770. assert(num < 0x4000000);
  22771. // Carry
  22772. var carry = 0;
  22773. for (var i = 0; i < this.length; i++) {
  22774. var w = (this.words[i] | 0) * num;
  22775. var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);
  22776. carry >>= 26;
  22777. carry += (w / 0x4000000) | 0;
  22778. // NOTE: lo is 27bit maximum
  22779. carry += lo >>> 26;
  22780. this.words[i] = lo & 0x3ffffff;
  22781. }
  22782. if (carry !== 0) {
  22783. this.words[i] = carry;
  22784. this.length++;
  22785. }
  22786. return isNegNum ? this.ineg() : this;
  22787. };
  22788. BN.prototype.muln = function muln (num) {
  22789. return this.clone().imuln(num);
  22790. };
  22791. // `this` * `this`
  22792. BN.prototype.sqr = function sqr () {
  22793. return this.mul(this);
  22794. };
  22795. // `this` * `this` in-place
  22796. BN.prototype.isqr = function isqr () {
  22797. return this.imul(this.clone());
  22798. };
  22799. // Math.pow(`this`, `num`)
  22800. BN.prototype.pow = function pow (num) {
  22801. var w = toBitArray(num);
  22802. if (w.length === 0) return new BN(1);
  22803. // Skip leading zeroes
  22804. var res = this;
  22805. for (var i = 0; i < w.length; i++, res = res.sqr()) {
  22806. if (w[i] !== 0) break;
  22807. }
  22808. if (++i < w.length) {
  22809. for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {
  22810. if (w[i] === 0) continue;
  22811. res = res.mul(q);
  22812. }
  22813. }
  22814. return res;
  22815. };
  22816. // Shift-left in-place
  22817. BN.prototype.iushln = function iushln (bits) {
  22818. assert(typeof bits === 'number' && bits >= 0);
  22819. var r = bits % 26;
  22820. var s = (bits - r) / 26;
  22821. var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);
  22822. var i;
  22823. if (r !== 0) {
  22824. var carry = 0;
  22825. for (i = 0; i < this.length; i++) {
  22826. var newCarry = this.words[i] & carryMask;
  22827. var c = ((this.words[i] | 0) - newCarry) << r;
  22828. this.words[i] = c | carry;
  22829. carry = newCarry >>> (26 - r);
  22830. }
  22831. if (carry) {
  22832. this.words[i] = carry;
  22833. this.length++;
  22834. }
  22835. }
  22836. if (s !== 0) {
  22837. for (i = this.length - 1; i >= 0; i--) {
  22838. this.words[i + s] = this.words[i];
  22839. }
  22840. for (i = 0; i < s; i++) {
  22841. this.words[i] = 0;
  22842. }
  22843. this.length += s;
  22844. }
  22845. return this._strip();
  22846. };
  22847. BN.prototype.ishln = function ishln (bits) {
  22848. // TODO(indutny): implement me
  22849. assert(this.negative === 0);
  22850. return this.iushln(bits);
  22851. };
  22852. // Shift-right in-place
  22853. // NOTE: `hint` is a lowest bit before trailing zeroes
  22854. // NOTE: if `extended` is present - it will be filled with destroyed bits
  22855. BN.prototype.iushrn = function iushrn (bits, hint, extended) {
  22856. assert(typeof bits === 'number' && bits >= 0);
  22857. var h;
  22858. if (hint) {
  22859. h = (hint - (hint % 26)) / 26;
  22860. } else {
  22861. h = 0;
  22862. }
  22863. var r = bits % 26;
  22864. var s = Math.min((bits - r) / 26, this.length);
  22865. var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);
  22866. var maskedWords = extended;
  22867. h -= s;
  22868. h = Math.max(0, h);
  22869. // Extended mode, copy masked part
  22870. if (maskedWords) {
  22871. for (var i = 0; i < s; i++) {
  22872. maskedWords.words[i] = this.words[i];
  22873. }
  22874. maskedWords.length = s;
  22875. }
  22876. if (s === 0) {
  22877. // No-op, we should not move anything at all
  22878. } else if (this.length > s) {
  22879. this.length -= s;
  22880. for (i = 0; i < this.length; i++) {
  22881. this.words[i] = this.words[i + s];
  22882. }
  22883. } else {
  22884. this.words[0] = 0;
  22885. this.length = 1;
  22886. }
  22887. var carry = 0;
  22888. for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {
  22889. var word = this.words[i] | 0;
  22890. this.words[i] = (carry << (26 - r)) | (word >>> r);
  22891. carry = word & mask;
  22892. }
  22893. // Push carried bits as a mask
  22894. if (maskedWords && carry !== 0) {
  22895. maskedWords.words[maskedWords.length++] = carry;
  22896. }
  22897. if (this.length === 0) {
  22898. this.words[0] = 0;
  22899. this.length = 1;
  22900. }
  22901. return this._strip();
  22902. };
  22903. BN.prototype.ishrn = function ishrn (bits, hint, extended) {
  22904. // TODO(indutny): implement me
  22905. assert(this.negative === 0);
  22906. return this.iushrn(bits, hint, extended);
  22907. };
  22908. // Shift-left
  22909. BN.prototype.shln = function shln (bits) {
  22910. return this.clone().ishln(bits);
  22911. };
  22912. BN.prototype.ushln = function ushln (bits) {
  22913. return this.clone().iushln(bits);
  22914. };
  22915. // Shift-right
  22916. BN.prototype.shrn = function shrn (bits) {
  22917. return this.clone().ishrn(bits);
  22918. };
  22919. BN.prototype.ushrn = function ushrn (bits) {
  22920. return this.clone().iushrn(bits);
  22921. };
  22922. // Test if n bit is set
  22923. BN.prototype.testn = function testn (bit) {
  22924. assert(typeof bit === 'number' && bit >= 0);
  22925. var r = bit % 26;
  22926. var s = (bit - r) / 26;
  22927. var q = 1 << r;
  22928. // Fast case: bit is much higher than all existing words
  22929. if (this.length <= s) return false;
  22930. // Check bit and return
  22931. var w = this.words[s];
  22932. return !!(w & q);
  22933. };
  22934. // Return only lowers bits of number (in-place)
  22935. BN.prototype.imaskn = function imaskn (bits) {
  22936. assert(typeof bits === 'number' && bits >= 0);
  22937. var r = bits % 26;
  22938. var s = (bits - r) / 26;
  22939. assert(this.negative === 0, 'imaskn works only with positive numbers');
  22940. if (this.length <= s) {
  22941. return this;
  22942. }
  22943. if (r !== 0) {
  22944. s++;
  22945. }
  22946. this.length = Math.min(s, this.length);
  22947. if (r !== 0) {
  22948. var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);
  22949. this.words[this.length - 1] &= mask;
  22950. }
  22951. return this._strip();
  22952. };
  22953. // Return only lowers bits of number
  22954. BN.prototype.maskn = function maskn (bits) {
  22955. return this.clone().imaskn(bits);
  22956. };
  22957. // Add plain number `num` to `this`
  22958. BN.prototype.iaddn = function iaddn (num) {
  22959. assert(typeof num === 'number');
  22960. assert(num < 0x4000000);
  22961. if (num < 0) return this.isubn(-num);
  22962. // Possible sign change
  22963. if (this.negative !== 0) {
  22964. if (this.length === 1 && (this.words[0] | 0) <= num) {
  22965. this.words[0] = num - (this.words[0] | 0);
  22966. this.negative = 0;
  22967. return this;
  22968. }
  22969. this.negative = 0;
  22970. this.isubn(num);
  22971. this.negative = 1;
  22972. return this;
  22973. }
  22974. // Add without checks
  22975. return this._iaddn(num);
  22976. };
  22977. BN.prototype._iaddn = function _iaddn (num) {
  22978. this.words[0] += num;
  22979. // Carry
  22980. for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {
  22981. this.words[i] -= 0x4000000;
  22982. if (i === this.length - 1) {
  22983. this.words[i + 1] = 1;
  22984. } else {
  22985. this.words[i + 1]++;
  22986. }
  22987. }
  22988. this.length = Math.max(this.length, i + 1);
  22989. return this;
  22990. };
  22991. // Subtract plain number `num` from `this`
  22992. BN.prototype.isubn = function isubn (num) {
  22993. assert(typeof num === 'number');
  22994. assert(num < 0x4000000);
  22995. if (num < 0) return this.iaddn(-num);
  22996. if (this.negative !== 0) {
  22997. this.negative = 0;
  22998. this.iaddn(num);
  22999. this.negative = 1;
  23000. return this;
  23001. }
  23002. this.words[0] -= num;
  23003. if (this.length === 1 && this.words[0] < 0) {
  23004. this.words[0] = -this.words[0];
  23005. this.negative = 1;
  23006. } else {
  23007. // Carry
  23008. for (var i = 0; i < this.length && this.words[i] < 0; i++) {
  23009. this.words[i] += 0x4000000;
  23010. this.words[i + 1] -= 1;
  23011. }
  23012. }
  23013. return this._strip();
  23014. };
  23015. BN.prototype.addn = function addn (num) {
  23016. return this.clone().iaddn(num);
  23017. };
  23018. BN.prototype.subn = function subn (num) {
  23019. return this.clone().isubn(num);
  23020. };
  23021. BN.prototype.iabs = function iabs () {
  23022. this.negative = 0;
  23023. return this;
  23024. };
  23025. BN.prototype.abs = function abs () {
  23026. return this.clone().iabs();
  23027. };
  23028. BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {
  23029. var len = num.length + shift;
  23030. var i;
  23031. this._expand(len);
  23032. var w;
  23033. var carry = 0;
  23034. for (i = 0; i < num.length; i++) {
  23035. w = (this.words[i + shift] | 0) + carry;
  23036. var right = (num.words[i] | 0) * mul;
  23037. w -= right & 0x3ffffff;
  23038. carry = (w >> 26) - ((right / 0x4000000) | 0);
  23039. this.words[i + shift] = w & 0x3ffffff;
  23040. }
  23041. for (; i < this.length - shift; i++) {
  23042. w = (this.words[i + shift] | 0) + carry;
  23043. carry = w >> 26;
  23044. this.words[i + shift] = w & 0x3ffffff;
  23045. }
  23046. if (carry === 0) return this._strip();
  23047. // Subtraction overflow
  23048. assert(carry === -1);
  23049. carry = 0;
  23050. for (i = 0; i < this.length; i++) {
  23051. w = -(this.words[i] | 0) + carry;
  23052. carry = w >> 26;
  23053. this.words[i] = w & 0x3ffffff;
  23054. }
  23055. this.negative = 1;
  23056. return this._strip();
  23057. };
  23058. BN.prototype._wordDiv = function _wordDiv (num, mode) {
  23059. var shift = this.length - num.length;
  23060. var a = this.clone();
  23061. var b = num;
  23062. // Normalize
  23063. var bhi = b.words[b.length - 1] | 0;
  23064. var bhiBits = this._countBits(bhi);
  23065. shift = 26 - bhiBits;
  23066. if (shift !== 0) {
  23067. b = b.ushln(shift);
  23068. a.iushln(shift);
  23069. bhi = b.words[b.length - 1] | 0;
  23070. }
  23071. // Initialize quotient
  23072. var m = a.length - b.length;
  23073. var q;
  23074. if (mode !== 'mod') {
  23075. q = new BN(null);
  23076. q.length = m + 1;
  23077. q.words = new Array(q.length);
  23078. for (var i = 0; i < q.length; i++) {
  23079. q.words[i] = 0;
  23080. }
  23081. }
  23082. var diff = a.clone()._ishlnsubmul(b, 1, m);
  23083. if (diff.negative === 0) {
  23084. a = diff;
  23085. if (q) {
  23086. q.words[m] = 1;
  23087. }
  23088. }
  23089. for (var j = m - 1; j >= 0; j--) {
  23090. var qj = (a.words[b.length + j] | 0) * 0x4000000 +
  23091. (a.words[b.length + j - 1] | 0);
  23092. // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max
  23093. // (0x7ffffff)
  23094. qj = Math.min((qj / bhi) | 0, 0x3ffffff);
  23095. a._ishlnsubmul(b, qj, j);
  23096. while (a.negative !== 0) {
  23097. qj--;
  23098. a.negative = 0;
  23099. a._ishlnsubmul(b, 1, j);
  23100. if (!a.isZero()) {
  23101. a.negative ^= 1;
  23102. }
  23103. }
  23104. if (q) {
  23105. q.words[j] = qj;
  23106. }
  23107. }
  23108. if (q) {
  23109. q._strip();
  23110. }
  23111. a._strip();
  23112. // Denormalize
  23113. if (mode !== 'div' && shift !== 0) {
  23114. a.iushrn(shift);
  23115. }
  23116. return {
  23117. div: q || null,
  23118. mod: a
  23119. };
  23120. };
  23121. // NOTE: 1) `mode` can be set to `mod` to request mod only,
  23122. // to `div` to request div only, or be absent to
  23123. // request both div & mod
  23124. // 2) `positive` is true if unsigned mod is requested
  23125. BN.prototype.divmod = function divmod (num, mode, positive) {
  23126. assert(!num.isZero());
  23127. if (this.isZero()) {
  23128. return {
  23129. div: new BN(0),
  23130. mod: new BN(0)
  23131. };
  23132. }
  23133. var div, mod, res;
  23134. if (this.negative !== 0 && num.negative === 0) {
  23135. res = this.neg().divmod(num, mode);
  23136. if (mode !== 'mod') {
  23137. div = res.div.neg();
  23138. }
  23139. if (mode !== 'div') {
  23140. mod = res.mod.neg();
  23141. if (positive && mod.negative !== 0) {
  23142. mod.iadd(num);
  23143. }
  23144. }
  23145. return {
  23146. div: div,
  23147. mod: mod
  23148. };
  23149. }
  23150. if (this.negative === 0 && num.negative !== 0) {
  23151. res = this.divmod(num.neg(), mode);
  23152. if (mode !== 'mod') {
  23153. div = res.div.neg();
  23154. }
  23155. return {
  23156. div: div,
  23157. mod: res.mod
  23158. };
  23159. }
  23160. if ((this.negative & num.negative) !== 0) {
  23161. res = this.neg().divmod(num.neg(), mode);
  23162. if (mode !== 'div') {
  23163. mod = res.mod.neg();
  23164. if (positive && mod.negative !== 0) {
  23165. mod.isub(num);
  23166. }
  23167. }
  23168. return {
  23169. div: res.div,
  23170. mod: mod
  23171. };
  23172. }
  23173. // Both numbers are positive at this point
  23174. // Strip both numbers to approximate shift value
  23175. if (num.length > this.length || this.cmp(num) < 0) {
  23176. return {
  23177. div: new BN(0),
  23178. mod: this
  23179. };
  23180. }
  23181. // Very short reduction
  23182. if (num.length === 1) {
  23183. if (mode === 'div') {
  23184. return {
  23185. div: this.divn(num.words[0]),
  23186. mod: null
  23187. };
  23188. }
  23189. if (mode === 'mod') {
  23190. return {
  23191. div: null,
  23192. mod: new BN(this.modrn(num.words[0]))
  23193. };
  23194. }
  23195. return {
  23196. div: this.divn(num.words[0]),
  23197. mod: new BN(this.modrn(num.words[0]))
  23198. };
  23199. }
  23200. return this._wordDiv(num, mode);
  23201. };
  23202. // Find `this` / `num`
  23203. BN.prototype.div = function div (num) {
  23204. return this.divmod(num, 'div', false).div;
  23205. };
  23206. // Find `this` % `num`
  23207. BN.prototype.mod = function mod (num) {
  23208. return this.divmod(num, 'mod', false).mod;
  23209. };
  23210. BN.prototype.umod = function umod (num) {
  23211. return this.divmod(num, 'mod', true).mod;
  23212. };
  23213. // Find Round(`this` / `num`)
  23214. BN.prototype.divRound = function divRound (num) {
  23215. var dm = this.divmod(num);
  23216. // Fast case - exact division
  23217. if (dm.mod.isZero()) return dm.div;
  23218. var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;
  23219. var half = num.ushrn(1);
  23220. var r2 = num.andln(1);
  23221. var cmp = mod.cmp(half);
  23222. // Round down
  23223. if (cmp < 0 || (r2 === 1 && cmp === 0)) return dm.div;
  23224. // Round up
  23225. return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);
  23226. };
  23227. BN.prototype.modrn = function modrn (num) {
  23228. var isNegNum = num < 0;
  23229. if (isNegNum) num = -num;
  23230. assert(num <= 0x3ffffff);
  23231. var p = (1 << 26) % num;
  23232. var acc = 0;
  23233. for (var i = this.length - 1; i >= 0; i--) {
  23234. acc = (p * acc + (this.words[i] | 0)) % num;
  23235. }
  23236. return isNegNum ? -acc : acc;
  23237. };
  23238. // WARNING: DEPRECATED
  23239. BN.prototype.modn = function modn (num) {
  23240. return this.modrn(num);
  23241. };
  23242. // In-place division by number
  23243. BN.prototype.idivn = function idivn (num) {
  23244. var isNegNum = num < 0;
  23245. if (isNegNum) num = -num;
  23246. assert(num <= 0x3ffffff);
  23247. var carry = 0;
  23248. for (var i = this.length - 1; i >= 0; i--) {
  23249. var w = (this.words[i] | 0) + carry * 0x4000000;
  23250. this.words[i] = (w / num) | 0;
  23251. carry = w % num;
  23252. }
  23253. this._strip();
  23254. return isNegNum ? this.ineg() : this;
  23255. };
  23256. BN.prototype.divn = function divn (num) {
  23257. return this.clone().idivn(num);
  23258. };
  23259. BN.prototype.egcd = function egcd (p) {
  23260. assert(p.negative === 0);
  23261. assert(!p.isZero());
  23262. var x = this;
  23263. var y = p.clone();
  23264. if (x.negative !== 0) {
  23265. x = x.umod(p);
  23266. } else {
  23267. x = x.clone();
  23268. }
  23269. // A * x + B * y = x
  23270. var A = new BN(1);
  23271. var B = new BN(0);
  23272. // C * x + D * y = y
  23273. var C = new BN(0);
  23274. var D = new BN(1);
  23275. var g = 0;
  23276. while (x.isEven() && y.isEven()) {
  23277. x.iushrn(1);
  23278. y.iushrn(1);
  23279. ++g;
  23280. }
  23281. var yp = y.clone();
  23282. var xp = x.clone();
  23283. while (!x.isZero()) {
  23284. for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);
  23285. if (i > 0) {
  23286. x.iushrn(i);
  23287. while (i-- > 0) {
  23288. if (A.isOdd() || B.isOdd()) {
  23289. A.iadd(yp);
  23290. B.isub(xp);
  23291. }
  23292. A.iushrn(1);
  23293. B.iushrn(1);
  23294. }
  23295. }
  23296. for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);
  23297. if (j > 0) {
  23298. y.iushrn(j);
  23299. while (j-- > 0) {
  23300. if (C.isOdd() || D.isOdd()) {
  23301. C.iadd(yp);
  23302. D.isub(xp);
  23303. }
  23304. C.iushrn(1);
  23305. D.iushrn(1);
  23306. }
  23307. }
  23308. if (x.cmp(y) >= 0) {
  23309. x.isub(y);
  23310. A.isub(C);
  23311. B.isub(D);
  23312. } else {
  23313. y.isub(x);
  23314. C.isub(A);
  23315. D.isub(B);
  23316. }
  23317. }
  23318. return {
  23319. a: C,
  23320. b: D,
  23321. gcd: y.iushln(g)
  23322. };
  23323. };
  23324. // This is reduced incarnation of the binary EEA
  23325. // above, designated to invert members of the
  23326. // _prime_ fields F(p) at a maximal speed
  23327. BN.prototype._invmp = function _invmp (p) {
  23328. assert(p.negative === 0);
  23329. assert(!p.isZero());
  23330. var a = this;
  23331. var b = p.clone();
  23332. if (a.negative !== 0) {
  23333. a = a.umod(p);
  23334. } else {
  23335. a = a.clone();
  23336. }
  23337. var x1 = new BN(1);
  23338. var x2 = new BN(0);
  23339. var delta = b.clone();
  23340. while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {
  23341. for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);
  23342. if (i > 0) {
  23343. a.iushrn(i);
  23344. while (i-- > 0) {
  23345. if (x1.isOdd()) {
  23346. x1.iadd(delta);
  23347. }
  23348. x1.iushrn(1);
  23349. }
  23350. }
  23351. for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);
  23352. if (j > 0) {
  23353. b.iushrn(j);
  23354. while (j-- > 0) {
  23355. if (x2.isOdd()) {
  23356. x2.iadd(delta);
  23357. }
  23358. x2.iushrn(1);
  23359. }
  23360. }
  23361. if (a.cmp(b) >= 0) {
  23362. a.isub(b);
  23363. x1.isub(x2);
  23364. } else {
  23365. b.isub(a);
  23366. x2.isub(x1);
  23367. }
  23368. }
  23369. var res;
  23370. if (a.cmpn(1) === 0) {
  23371. res = x1;
  23372. } else {
  23373. res = x2;
  23374. }
  23375. if (res.cmpn(0) < 0) {
  23376. res.iadd(p);
  23377. }
  23378. return res;
  23379. };
  23380. BN.prototype.gcd = function gcd (num) {
  23381. if (this.isZero()) return num.abs();
  23382. if (num.isZero()) return this.abs();
  23383. var a = this.clone();
  23384. var b = num.clone();
  23385. a.negative = 0;
  23386. b.negative = 0;
  23387. // Remove common factor of two
  23388. for (var shift = 0; a.isEven() && b.isEven(); shift++) {
  23389. a.iushrn(1);
  23390. b.iushrn(1);
  23391. }
  23392. do {
  23393. while (a.isEven()) {
  23394. a.iushrn(1);
  23395. }
  23396. while (b.isEven()) {
  23397. b.iushrn(1);
  23398. }
  23399. var r = a.cmp(b);
  23400. if (r < 0) {
  23401. // Swap `a` and `b` to make `a` always bigger than `b`
  23402. var t = a;
  23403. a = b;
  23404. b = t;
  23405. } else if (r === 0 || b.cmpn(1) === 0) {
  23406. break;
  23407. }
  23408. a.isub(b);
  23409. } while (true);
  23410. return b.iushln(shift);
  23411. };
  23412. // Invert number in the field F(num)
  23413. BN.prototype.invm = function invm (num) {
  23414. return this.egcd(num).a.umod(num);
  23415. };
  23416. BN.prototype.isEven = function isEven () {
  23417. return (this.words[0] & 1) === 0;
  23418. };
  23419. BN.prototype.isOdd = function isOdd () {
  23420. return (this.words[0] & 1) === 1;
  23421. };
  23422. // And first word and num
  23423. BN.prototype.andln = function andln (num) {
  23424. return this.words[0] & num;
  23425. };
  23426. // Increment at the bit position in-line
  23427. BN.prototype.bincn = function bincn (bit) {
  23428. assert(typeof bit === 'number');
  23429. var r = bit % 26;
  23430. var s = (bit - r) / 26;
  23431. var q = 1 << r;
  23432. // Fast case: bit is much higher than all existing words
  23433. if (this.length <= s) {
  23434. this._expand(s + 1);
  23435. this.words[s] |= q;
  23436. return this;
  23437. }
  23438. // Add bit and propagate, if needed
  23439. var carry = q;
  23440. for (var i = s; carry !== 0 && i < this.length; i++) {
  23441. var w = this.words[i] | 0;
  23442. w += carry;
  23443. carry = w >>> 26;
  23444. w &= 0x3ffffff;
  23445. this.words[i] = w;
  23446. }
  23447. if (carry !== 0) {
  23448. this.words[i] = carry;
  23449. this.length++;
  23450. }
  23451. return this;
  23452. };
  23453. BN.prototype.isZero = function isZero () {
  23454. return this.length === 1 && this.words[0] === 0;
  23455. };
  23456. BN.prototype.cmpn = function cmpn (num) {
  23457. var negative = num < 0;
  23458. if (this.negative !== 0 && !negative) return -1;
  23459. if (this.negative === 0 && negative) return 1;
  23460. this._strip();
  23461. var res;
  23462. if (this.length > 1) {
  23463. res = 1;
  23464. } else {
  23465. if (negative) {
  23466. num = -num;
  23467. }
  23468. assert(num <= 0x3ffffff, 'Number is too big');
  23469. var w = this.words[0] | 0;
  23470. res = w === num ? 0 : w < num ? -1 : 1;
  23471. }
  23472. if (this.negative !== 0) return -res | 0;
  23473. return res;
  23474. };
  23475. // Compare two numbers and return:
  23476. // 1 - if `this` > `num`
  23477. // 0 - if `this` == `num`
  23478. // -1 - if `this` < `num`
  23479. BN.prototype.cmp = function cmp (num) {
  23480. if (this.negative !== 0 && num.negative === 0) return -1;
  23481. if (this.negative === 0 && num.negative !== 0) return 1;
  23482. var res = this.ucmp(num);
  23483. if (this.negative !== 0) return -res | 0;
  23484. return res;
  23485. };
  23486. // Unsigned comparison
  23487. BN.prototype.ucmp = function ucmp (num) {
  23488. // At this point both numbers have the same sign
  23489. if (this.length > num.length) return 1;
  23490. if (this.length < num.length) return -1;
  23491. var res = 0;
  23492. for (var i = this.length - 1; i >= 0; i--) {
  23493. var a = this.words[i] | 0;
  23494. var b = num.words[i] | 0;
  23495. if (a === b) continue;
  23496. if (a < b) {
  23497. res = -1;
  23498. } else if (a > b) {
  23499. res = 1;
  23500. }
  23501. break;
  23502. }
  23503. return res;
  23504. };
  23505. BN.prototype.gtn = function gtn (num) {
  23506. return this.cmpn(num) === 1;
  23507. };
  23508. BN.prototype.gt = function gt (num) {
  23509. return this.cmp(num) === 1;
  23510. };
  23511. BN.prototype.gten = function gten (num) {
  23512. return this.cmpn(num) >= 0;
  23513. };
  23514. BN.prototype.gte = function gte (num) {
  23515. return this.cmp(num) >= 0;
  23516. };
  23517. BN.prototype.ltn = function ltn (num) {
  23518. return this.cmpn(num) === -1;
  23519. };
  23520. BN.prototype.lt = function lt (num) {
  23521. return this.cmp(num) === -1;
  23522. };
  23523. BN.prototype.lten = function lten (num) {
  23524. return this.cmpn(num) <= 0;
  23525. };
  23526. BN.prototype.lte = function lte (num) {
  23527. return this.cmp(num) <= 0;
  23528. };
  23529. BN.prototype.eqn = function eqn (num) {
  23530. return this.cmpn(num) === 0;
  23531. };
  23532. BN.prototype.eq = function eq (num) {
  23533. return this.cmp(num) === 0;
  23534. };
  23535. //
  23536. // A reduce context, could be using montgomery or something better, depending
  23537. // on the `m` itself.
  23538. //
  23539. BN.red = function red (num) {
  23540. return new Red(num);
  23541. };
  23542. BN.prototype.toRed = function toRed (ctx) {
  23543. assert(!this.red, 'Already a number in reduction context');
  23544. assert(this.negative === 0, 'red works only with positives');
  23545. return ctx.convertTo(this)._forceRed(ctx);
  23546. };
  23547. BN.prototype.fromRed = function fromRed () {
  23548. assert(this.red, 'fromRed works only with numbers in reduction context');
  23549. return this.red.convertFrom(this);
  23550. };
  23551. BN.prototype._forceRed = function _forceRed (ctx) {
  23552. this.red = ctx;
  23553. return this;
  23554. };
  23555. BN.prototype.forceRed = function forceRed (ctx) {
  23556. assert(!this.red, 'Already a number in reduction context');
  23557. return this._forceRed(ctx);
  23558. };
  23559. BN.prototype.redAdd = function redAdd (num) {
  23560. assert(this.red, 'redAdd works only with red numbers');
  23561. return this.red.add(this, num);
  23562. };
  23563. BN.prototype.redIAdd = function redIAdd (num) {
  23564. assert(this.red, 'redIAdd works only with red numbers');
  23565. return this.red.iadd(this, num);
  23566. };
  23567. BN.prototype.redSub = function redSub (num) {
  23568. assert(this.red, 'redSub works only with red numbers');
  23569. return this.red.sub(this, num);
  23570. };
  23571. BN.prototype.redISub = function redISub (num) {
  23572. assert(this.red, 'redISub works only with red numbers');
  23573. return this.red.isub(this, num);
  23574. };
  23575. BN.prototype.redShl = function redShl (num) {
  23576. assert(this.red, 'redShl works only with red numbers');
  23577. return this.red.shl(this, num);
  23578. };
  23579. BN.prototype.redMul = function redMul (num) {
  23580. assert(this.red, 'redMul works only with red numbers');
  23581. this.red._verify2(this, num);
  23582. return this.red.mul(this, num);
  23583. };
  23584. BN.prototype.redIMul = function redIMul (num) {
  23585. assert(this.red, 'redMul works only with red numbers');
  23586. this.red._verify2(this, num);
  23587. return this.red.imul(this, num);
  23588. };
  23589. BN.prototype.redSqr = function redSqr () {
  23590. assert(this.red, 'redSqr works only with red numbers');
  23591. this.red._verify1(this);
  23592. return this.red.sqr(this);
  23593. };
  23594. BN.prototype.redISqr = function redISqr () {
  23595. assert(this.red, 'redISqr works only with red numbers');
  23596. this.red._verify1(this);
  23597. return this.red.isqr(this);
  23598. };
  23599. // Square root over p
  23600. BN.prototype.redSqrt = function redSqrt () {
  23601. assert(this.red, 'redSqrt works only with red numbers');
  23602. this.red._verify1(this);
  23603. return this.red.sqrt(this);
  23604. };
  23605. BN.prototype.redInvm = function redInvm () {
  23606. assert(this.red, 'redInvm works only with red numbers');
  23607. this.red._verify1(this);
  23608. return this.red.invm(this);
  23609. };
  23610. // Return negative clone of `this` % `red modulo`
  23611. BN.prototype.redNeg = function redNeg () {
  23612. assert(this.red, 'redNeg works only with red numbers');
  23613. this.red._verify1(this);
  23614. return this.red.neg(this);
  23615. };
  23616. BN.prototype.redPow = function redPow (num) {
  23617. assert(this.red && !num.red, 'redPow(normalNum)');
  23618. this.red._verify1(this);
  23619. return this.red.pow(this, num);
  23620. };
  23621. // Prime numbers with efficient reduction
  23622. var primes = {
  23623. k256: null,
  23624. p224: null,
  23625. p192: null,
  23626. p25519: null
  23627. };
  23628. // Pseudo-Mersenne prime
  23629. function MPrime (name, p) {
  23630. // P = 2 ^ N - K
  23631. this.name = name;
  23632. this.p = new BN(p, 16);
  23633. this.n = this.p.bitLength();
  23634. this.k = new BN(1).iushln(this.n).isub(this.p);
  23635. this.tmp = this._tmp();
  23636. }
  23637. MPrime.prototype._tmp = function _tmp () {
  23638. var tmp = new BN(null);
  23639. tmp.words = new Array(Math.ceil(this.n / 13));
  23640. return tmp;
  23641. };
  23642. MPrime.prototype.ireduce = function ireduce (num) {
  23643. // Assumes that `num` is less than `P^2`
  23644. // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)
  23645. var r = num;
  23646. var rlen;
  23647. do {
  23648. this.split(r, this.tmp);
  23649. r = this.imulK(r);
  23650. r = r.iadd(this.tmp);
  23651. rlen = r.bitLength();
  23652. } while (rlen > this.n);
  23653. var cmp = rlen < this.n ? -1 : r.ucmp(this.p);
  23654. if (cmp === 0) {
  23655. r.words[0] = 0;
  23656. r.length = 1;
  23657. } else if (cmp > 0) {
  23658. r.isub(this.p);
  23659. } else {
  23660. if (r.strip !== undefined) {
  23661. // r is a BN v4 instance
  23662. r.strip();
  23663. } else {
  23664. // r is a BN v5 instance
  23665. r._strip();
  23666. }
  23667. }
  23668. return r;
  23669. };
  23670. MPrime.prototype.split = function split (input, out) {
  23671. input.iushrn(this.n, 0, out);
  23672. };
  23673. MPrime.prototype.imulK = function imulK (num) {
  23674. return num.imul(this.k);
  23675. };
  23676. function K256 () {
  23677. MPrime.call(
  23678. this,
  23679. 'k256',
  23680. 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');
  23681. }
  23682. inherits(K256, MPrime);
  23683. K256.prototype.split = function split (input, output) {
  23684. // 256 = 9 * 26 + 22
  23685. var mask = 0x3fffff;
  23686. var outLen = Math.min(input.length, 9);
  23687. for (var i = 0; i < outLen; i++) {
  23688. output.words[i] = input.words[i];
  23689. }
  23690. output.length = outLen;
  23691. if (input.length <= 9) {
  23692. input.words[0] = 0;
  23693. input.length = 1;
  23694. return;
  23695. }
  23696. // Shift by 9 limbs
  23697. var prev = input.words[9];
  23698. output.words[output.length++] = prev & mask;
  23699. for (i = 10; i < input.length; i++) {
  23700. var next = input.words[i] | 0;
  23701. input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);
  23702. prev = next;
  23703. }
  23704. prev >>>= 22;
  23705. input.words[i - 10] = prev;
  23706. if (prev === 0 && input.length > 10) {
  23707. input.length -= 10;
  23708. } else {
  23709. input.length -= 9;
  23710. }
  23711. };
  23712. K256.prototype.imulK = function imulK (num) {
  23713. // K = 0x1000003d1 = [ 0x40, 0x3d1 ]
  23714. num.words[num.length] = 0;
  23715. num.words[num.length + 1] = 0;
  23716. num.length += 2;
  23717. // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390
  23718. var lo = 0;
  23719. for (var i = 0; i < num.length; i++) {
  23720. var w = num.words[i] | 0;
  23721. lo += w * 0x3d1;
  23722. num.words[i] = lo & 0x3ffffff;
  23723. lo = w * 0x40 + ((lo / 0x4000000) | 0);
  23724. }
  23725. // Fast length reduction
  23726. if (num.words[num.length - 1] === 0) {
  23727. num.length--;
  23728. if (num.words[num.length - 1] === 0) {
  23729. num.length--;
  23730. }
  23731. }
  23732. return num;
  23733. };
  23734. function P224 () {
  23735. MPrime.call(
  23736. this,
  23737. 'p224',
  23738. 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');
  23739. }
  23740. inherits(P224, MPrime);
  23741. function P192 () {
  23742. MPrime.call(
  23743. this,
  23744. 'p192',
  23745. 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');
  23746. }
  23747. inherits(P192, MPrime);
  23748. function P25519 () {
  23749. // 2 ^ 255 - 19
  23750. MPrime.call(
  23751. this,
  23752. '25519',
  23753. '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');
  23754. }
  23755. inherits(P25519, MPrime);
  23756. P25519.prototype.imulK = function imulK (num) {
  23757. // K = 0x13
  23758. var carry = 0;
  23759. for (var i = 0; i < num.length; i++) {
  23760. var hi = (num.words[i] | 0) * 0x13 + carry;
  23761. var lo = hi & 0x3ffffff;
  23762. hi >>>= 26;
  23763. num.words[i] = lo;
  23764. carry = hi;
  23765. }
  23766. if (carry !== 0) {
  23767. num.words[num.length++] = carry;
  23768. }
  23769. return num;
  23770. };
  23771. // Exported mostly for testing purposes, use plain name instead
  23772. BN._prime = function prime (name) {
  23773. // Cached version of prime
  23774. if (primes[name]) return primes[name];
  23775. var prime;
  23776. if (name === 'k256') {
  23777. prime = new K256();
  23778. } else if (name === 'p224') {
  23779. prime = new P224();
  23780. } else if (name === 'p192') {
  23781. prime = new P192();
  23782. } else if (name === 'p25519') {
  23783. prime = new P25519();
  23784. } else {
  23785. throw new Error('Unknown prime ' + name);
  23786. }
  23787. primes[name] = prime;
  23788. return prime;
  23789. };
  23790. //
  23791. // Base reduction engine
  23792. //
  23793. function Red (m) {
  23794. if (typeof m === 'string') {
  23795. var prime = BN._prime(m);
  23796. this.m = prime.p;
  23797. this.prime = prime;
  23798. } else {
  23799. assert(m.gtn(1), 'modulus must be greater than 1');
  23800. this.m = m;
  23801. this.prime = null;
  23802. }
  23803. }
  23804. Red.prototype._verify1 = function _verify1 (a) {
  23805. assert(a.negative === 0, 'red works only with positives');
  23806. assert(a.red, 'red works only with red numbers');
  23807. };
  23808. Red.prototype._verify2 = function _verify2 (a, b) {
  23809. assert((a.negative | b.negative) === 0, 'red works only with positives');
  23810. assert(a.red && a.red === b.red,
  23811. 'red works only with red numbers');
  23812. };
  23813. Red.prototype.imod = function imod (a) {
  23814. if (this.prime) return this.prime.ireduce(a)._forceRed(this);
  23815. move(a, a.umod(this.m)._forceRed(this));
  23816. return a;
  23817. };
  23818. Red.prototype.neg = function neg (a) {
  23819. if (a.isZero()) {
  23820. return a.clone();
  23821. }
  23822. return this.m.sub(a)._forceRed(this);
  23823. };
  23824. Red.prototype.add = function add (a, b) {
  23825. this._verify2(a, b);
  23826. var res = a.add(b);
  23827. if (res.cmp(this.m) >= 0) {
  23828. res.isub(this.m);
  23829. }
  23830. return res._forceRed(this);
  23831. };
  23832. Red.prototype.iadd = function iadd (a, b) {
  23833. this._verify2(a, b);
  23834. var res = a.iadd(b);
  23835. if (res.cmp(this.m) >= 0) {
  23836. res.isub(this.m);
  23837. }
  23838. return res;
  23839. };
  23840. Red.prototype.sub = function sub (a, b) {
  23841. this._verify2(a, b);
  23842. var res = a.sub(b);
  23843. if (res.cmpn(0) < 0) {
  23844. res.iadd(this.m);
  23845. }
  23846. return res._forceRed(this);
  23847. };
  23848. Red.prototype.isub = function isub (a, b) {
  23849. this._verify2(a, b);
  23850. var res = a.isub(b);
  23851. if (res.cmpn(0) < 0) {
  23852. res.iadd(this.m);
  23853. }
  23854. return res;
  23855. };
  23856. Red.prototype.shl = function shl (a, num) {
  23857. this._verify1(a);
  23858. return this.imod(a.ushln(num));
  23859. };
  23860. Red.prototype.imul = function imul (a, b) {
  23861. this._verify2(a, b);
  23862. return this.imod(a.imul(b));
  23863. };
  23864. Red.prototype.mul = function mul (a, b) {
  23865. this._verify2(a, b);
  23866. return this.imod(a.mul(b));
  23867. };
  23868. Red.prototype.isqr = function isqr (a) {
  23869. return this.imul(a, a.clone());
  23870. };
  23871. Red.prototype.sqr = function sqr (a) {
  23872. return this.mul(a, a);
  23873. };
  23874. Red.prototype.sqrt = function sqrt (a) {
  23875. if (a.isZero()) return a.clone();
  23876. var mod3 = this.m.andln(3);
  23877. assert(mod3 % 2 === 1);
  23878. // Fast case
  23879. if (mod3 === 3) {
  23880. var pow = this.m.add(new BN(1)).iushrn(2);
  23881. return this.pow(a, pow);
  23882. }
  23883. // Tonelli-Shanks algorithm (Totally unoptimized and slow)
  23884. //
  23885. // Find Q and S, that Q * 2 ^ S = (P - 1)
  23886. var q = this.m.subn(1);
  23887. var s = 0;
  23888. while (!q.isZero() && q.andln(1) === 0) {
  23889. s++;
  23890. q.iushrn(1);
  23891. }
  23892. assert(!q.isZero());
  23893. var one = new BN(1).toRed(this);
  23894. var nOne = one.redNeg();
  23895. // Find quadratic non-residue
  23896. // NOTE: Max is such because of generalized Riemann hypothesis.
  23897. var lpow = this.m.subn(1).iushrn(1);
  23898. var z = this.m.bitLength();
  23899. z = new BN(2 * z * z).toRed(this);
  23900. while (this.pow(z, lpow).cmp(nOne) !== 0) {
  23901. z.redIAdd(nOne);
  23902. }
  23903. var c = this.pow(z, q);
  23904. var r = this.pow(a, q.addn(1).iushrn(1));
  23905. var t = this.pow(a, q);
  23906. var m = s;
  23907. while (t.cmp(one) !== 0) {
  23908. var tmp = t;
  23909. for (var i = 0; tmp.cmp(one) !== 0; i++) {
  23910. tmp = tmp.redSqr();
  23911. }
  23912. assert(i < m);
  23913. var b = this.pow(c, new BN(1).iushln(m - i - 1));
  23914. r = r.redMul(b);
  23915. c = b.redSqr();
  23916. t = t.redMul(c);
  23917. m = i;
  23918. }
  23919. return r;
  23920. };
  23921. Red.prototype.invm = function invm (a) {
  23922. var inv = a._invmp(this.m);
  23923. if (inv.negative !== 0) {
  23924. inv.negative = 0;
  23925. return this.imod(inv).redNeg();
  23926. } else {
  23927. return this.imod(inv);
  23928. }
  23929. };
  23930. Red.prototype.pow = function pow (a, num) {
  23931. if (num.isZero()) return new BN(1).toRed(this);
  23932. if (num.cmpn(1) === 0) return a.clone();
  23933. var windowSize = 4;
  23934. var wnd = new Array(1 << windowSize);
  23935. wnd[0] = new BN(1).toRed(this);
  23936. wnd[1] = a;
  23937. for (var i = 2; i < wnd.length; i++) {
  23938. wnd[i] = this.mul(wnd[i - 1], a);
  23939. }
  23940. var res = wnd[0];
  23941. var current = 0;
  23942. var currentLen = 0;
  23943. var start = num.bitLength() % 26;
  23944. if (start === 0) {
  23945. start = 26;
  23946. }
  23947. for (i = num.length - 1; i >= 0; i--) {
  23948. var word = num.words[i];
  23949. for (var j = start - 1; j >= 0; j--) {
  23950. var bit = (word >> j) & 1;
  23951. if (res !== wnd[0]) {
  23952. res = this.sqr(res);
  23953. }
  23954. if (bit === 0 && current === 0) {
  23955. currentLen = 0;
  23956. continue;
  23957. }
  23958. current <<= 1;
  23959. current |= bit;
  23960. currentLen++;
  23961. if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;
  23962. res = this.mul(res, wnd[current]);
  23963. currentLen = 0;
  23964. current = 0;
  23965. }
  23966. start = 26;
  23967. }
  23968. return res;
  23969. };
  23970. Red.prototype.convertTo = function convertTo (num) {
  23971. var r = num.umod(this.m);
  23972. return r === num ? r.clone() : r;
  23973. };
  23974. Red.prototype.convertFrom = function convertFrom (num) {
  23975. var res = num.clone();
  23976. res.red = null;
  23977. return res;
  23978. };
  23979. //
  23980. // Montgomery method engine
  23981. //
  23982. BN.mont = function mont (num) {
  23983. return new Mont(num);
  23984. };
  23985. function Mont (m) {
  23986. Red.call(this, m);
  23987. this.shift = this.m.bitLength();
  23988. if (this.shift % 26 !== 0) {
  23989. this.shift += 26 - (this.shift % 26);
  23990. }
  23991. this.r = new BN(1).iushln(this.shift);
  23992. this.r2 = this.imod(this.r.sqr());
  23993. this.rinv = this.r._invmp(this.m);
  23994. this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);
  23995. this.minv = this.minv.umod(this.r);
  23996. this.minv = this.r.sub(this.minv);
  23997. }
  23998. inherits(Mont, Red);
  23999. Mont.prototype.convertTo = function convertTo (num) {
  24000. return this.imod(num.ushln(this.shift));
  24001. };
  24002. Mont.prototype.convertFrom = function convertFrom (num) {
  24003. var r = this.imod(num.mul(this.rinv));
  24004. r.red = null;
  24005. return r;
  24006. };
  24007. Mont.prototype.imul = function imul (a, b) {
  24008. if (a.isZero() || b.isZero()) {
  24009. a.words[0] = 0;
  24010. a.length = 1;
  24011. return a;
  24012. }
  24013. var t = a.imul(b);
  24014. var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
  24015. var u = t.isub(c).iushrn(this.shift);
  24016. var res = u;
  24017. if (u.cmp(this.m) >= 0) {
  24018. res = u.isub(this.m);
  24019. } else if (u.cmpn(0) < 0) {
  24020. res = u.iadd(this.m);
  24021. }
  24022. return res._forceRed(this);
  24023. };
  24024. Mont.prototype.mul = function mul (a, b) {
  24025. if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);
  24026. var t = a.mul(b);
  24027. var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
  24028. var u = t.isub(c).iushrn(this.shift);
  24029. var res = u;
  24030. if (u.cmp(this.m) >= 0) {
  24031. res = u.isub(this.m);
  24032. } else if (u.cmpn(0) < 0) {
  24033. res = u.iadd(this.m);
  24034. }
  24035. return res._forceRed(this);
  24036. };
  24037. Mont.prototype.invm = function invm (a) {
  24038. // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R
  24039. var res = this.imod(a._invmp(this.m).mul(this.r2));
  24040. return res._forceRed(this);
  24041. };
  24042. })( false || module, this);
  24043. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/module.js */ 131)(module)))
  24044. /***/ }),
  24045. /* 131 */
  24046. /*!***********************************!*\
  24047. !*** (webpack)/buildin/module.js ***!
  24048. \***********************************/
  24049. /*! no static exports found */
  24050. /***/ (function(module, exports) {
  24051. module.exports = function(module) {
  24052. if (!module.webpackPolyfill) {
  24053. module.deprecate = function() {};
  24054. module.paths = [];
  24055. // module.parent = undefined by default
  24056. if (!module.children) module.children = [];
  24057. Object.defineProperty(module, "loaded", {
  24058. enumerable: true,
  24059. get: function() {
  24060. return module.l;
  24061. }
  24062. });
  24063. Object.defineProperty(module, "id", {
  24064. enumerable: true,
  24065. get: function() {
  24066. return module.i;
  24067. }
  24068. });
  24069. module.webpackPolyfill = 1;
  24070. }
  24071. return module;
  24072. };
  24073. /***/ }),
  24074. /* 132 */
  24075. /*!************************!*\
  24076. !*** buffer (ignored) ***!
  24077. \************************/
  24078. /*! no static exports found */
  24079. /***/ (function(module, exports) {
  24080. /* (ignored) */
  24081. /***/ }),
  24082. /* 133 */
  24083. /*!*********************************************!*\
  24084. !*** ./node_modules/miller-rabin/lib/mr.js ***!
  24085. \*********************************************/
  24086. /*! no static exports found */
  24087. /***/ (function(module, exports, __webpack_require__) {
  24088. var bn = __webpack_require__(/*! bn.js */ 130);
  24089. var brorand = __webpack_require__(/*! brorand */ 134);
  24090. function MillerRabin(rand) {
  24091. this.rand = rand || new brorand.Rand();
  24092. }
  24093. module.exports = MillerRabin;
  24094. MillerRabin.create = function create(rand) {
  24095. return new MillerRabin(rand);
  24096. };
  24097. MillerRabin.prototype._randbelow = function _randbelow(n) {
  24098. var len = n.bitLength();
  24099. var min_bytes = Math.ceil(len / 8);
  24100. // Generage random bytes until a number less than n is found.
  24101. // This ensures that 0..n-1 have an equal probability of being selected.
  24102. do
  24103. var a = new bn(this.rand.generate(min_bytes));
  24104. while (a.cmp(n) >= 0);
  24105. return a;
  24106. };
  24107. MillerRabin.prototype._randrange = function _randrange(start, stop) {
  24108. // Generate a random number greater than or equal to start and less than stop.
  24109. var size = stop.sub(start);
  24110. return start.add(this._randbelow(size));
  24111. };
  24112. MillerRabin.prototype.test = function test(n, k, cb) {
  24113. var len = n.bitLength();
  24114. var red = bn.mont(n);
  24115. var rone = new bn(1).toRed(red);
  24116. if (!k)
  24117. k = Math.max(1, (len / 48) | 0);
  24118. // Find d and s, (n - 1) = (2 ^ s) * d;
  24119. var n1 = n.subn(1);
  24120. for (var s = 0; !n1.testn(s); s++) {}
  24121. var d = n.shrn(s);
  24122. var rn1 = n1.toRed(red);
  24123. var prime = true;
  24124. for (; k > 0; k--) {
  24125. var a = this._randrange(new bn(2), n1);
  24126. if (cb)
  24127. cb(a);
  24128. var x = a.toRed(red).redPow(d);
  24129. if (x.cmp(rone) === 0 || x.cmp(rn1) === 0)
  24130. continue;
  24131. for (var i = 1; i < s; i++) {
  24132. x = x.redSqr();
  24133. if (x.cmp(rone) === 0)
  24134. return false;
  24135. if (x.cmp(rn1) === 0)
  24136. break;
  24137. }
  24138. if (i === s)
  24139. return false;
  24140. }
  24141. return prime;
  24142. };
  24143. MillerRabin.prototype.getDivisor = function getDivisor(n, k) {
  24144. var len = n.bitLength();
  24145. var red = bn.mont(n);
  24146. var rone = new bn(1).toRed(red);
  24147. if (!k)
  24148. k = Math.max(1, (len / 48) | 0);
  24149. // Find d and s, (n - 1) = (2 ^ s) * d;
  24150. var n1 = n.subn(1);
  24151. for (var s = 0; !n1.testn(s); s++) {}
  24152. var d = n.shrn(s);
  24153. var rn1 = n1.toRed(red);
  24154. for (; k > 0; k--) {
  24155. var a = this._randrange(new bn(2), n1);
  24156. var g = n.gcd(a);
  24157. if (g.cmpn(1) !== 0)
  24158. return g;
  24159. var x = a.toRed(red).redPow(d);
  24160. if (x.cmp(rone) === 0 || x.cmp(rn1) === 0)
  24161. continue;
  24162. for (var i = 1; i < s; i++) {
  24163. x = x.redSqr();
  24164. if (x.cmp(rone) === 0)
  24165. return x.fromRed().subn(1).gcd(n);
  24166. if (x.cmp(rn1) === 0)
  24167. break;
  24168. }
  24169. if (i === s) {
  24170. x = x.redSqr();
  24171. return x.fromRed().subn(1).gcd(n);
  24172. }
  24173. }
  24174. return false;
  24175. };
  24176. /***/ }),
  24177. /* 134 */
  24178. /*!***************************************!*\
  24179. !*** ./node_modules/brorand/index.js ***!
  24180. \***************************************/
  24181. /*! no static exports found */
  24182. /***/ (function(module, exports, __webpack_require__) {
  24183. var r;
  24184. module.exports = function rand(len) {
  24185. if (!r)
  24186. r = new Rand(null);
  24187. return r.generate(len);
  24188. };
  24189. function Rand(rand) {
  24190. this.rand = rand;
  24191. }
  24192. module.exports.Rand = Rand;
  24193. Rand.prototype.generate = function generate(len) {
  24194. return this._rand(len);
  24195. };
  24196. // Emulate crypto API using randy
  24197. Rand.prototype._rand = function _rand(n) {
  24198. if (this.rand.getBytes)
  24199. return this.rand.getBytes(n);
  24200. var res = new Uint8Array(n);
  24201. for (var i = 0; i < res.length; i++)
  24202. res[i] = this.rand.getByte();
  24203. return res;
  24204. };
  24205. if (typeof self === 'object') {
  24206. if (self.crypto && self.crypto.getRandomValues) {
  24207. // Modern browsers
  24208. Rand.prototype._rand = function _rand(n) {
  24209. var arr = new Uint8Array(n);
  24210. self.crypto.getRandomValues(arr);
  24211. return arr;
  24212. };
  24213. } else if (self.msCrypto && self.msCrypto.getRandomValues) {
  24214. // IE
  24215. Rand.prototype._rand = function _rand(n) {
  24216. var arr = new Uint8Array(n);
  24217. self.msCrypto.getRandomValues(arr);
  24218. return arr;
  24219. };
  24220. // Safari's WebWorkers do not have `crypto`
  24221. } else if (typeof window === 'object') {
  24222. // Old junk
  24223. Rand.prototype._rand = function() {
  24224. throw new Error('Not implemented yet');
  24225. };
  24226. }
  24227. } else {
  24228. // Node.js or Web worker with no crypto support
  24229. try {
  24230. var crypto = __webpack_require__(/*! crypto */ 135);
  24231. if (typeof crypto.randomBytes !== 'function')
  24232. throw new Error('Not supported');
  24233. Rand.prototype._rand = function _rand(n) {
  24234. return crypto.randomBytes(n);
  24235. };
  24236. } catch (e) {
  24237. }
  24238. }
  24239. /***/ }),
  24240. /* 135 */
  24241. /*!************************!*\
  24242. !*** crypto (ignored) ***!
  24243. \************************/
  24244. /*! no static exports found */
  24245. /***/ (function(module, exports) {
  24246. /* (ignored) */
  24247. /***/ }),
  24248. /* 136 */
  24249. /*!*****************************************************!*\
  24250. !*** ./node_modules/diffie-hellman/lib/primes.json ***!
  24251. \*****************************************************/
  24252. /*! exports provided: modp1, modp2, modp5, modp14, modp15, modp16, modp17, modp18, default */
  24253. /***/ (function(module) {
  24254. module.exports = JSON.parse("{\"modp1\":{\"gen\":\"02\",\"prime\":\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff\"},\"modp2\":{\"gen\":\"02\",\"prime\":\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff\"},\"modp5\":{\"gen\":\"02\",\"prime\":\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff\"},\"modp14\":{\"gen\":\"02\",\"prime\":\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff\"},\"modp15\":{\"gen\":\"02\",\"prime\":\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff\"},\"modp16\":{\"gen\":\"02\",\"prime\":\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff\"},\"modp17\":{\"gen\":\"02\",\"prime\":\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff\"},\"modp18\":{\"gen\":\"02\",\"prime\":\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff\"}}");
  24255. /***/ }),
  24256. /* 137 */
  24257. /*!***********************************************!*\
  24258. !*** ./node_modules/diffie-hellman/lib/dh.js ***!
  24259. \***********************************************/
  24260. /*! no static exports found */
  24261. /***/ (function(module, exports, __webpack_require__) {
  24262. /* WEBPACK VAR INJECTION */(function(Buffer) {var BN = __webpack_require__(/*! bn.js */ 130);
  24263. var MillerRabin = __webpack_require__(/*! miller-rabin */ 133);
  24264. var millerRabin = new MillerRabin();
  24265. var TWENTYFOUR = new BN(24);
  24266. var ELEVEN = new BN(11);
  24267. var TEN = new BN(10);
  24268. var THREE = new BN(3);
  24269. var SEVEN = new BN(7);
  24270. var primes = __webpack_require__(/*! ./generatePrime */ 129);
  24271. var randomBytes = __webpack_require__(/*! randombytes */ 45);
  24272. module.exports = DH;
  24273. function setPublicKey(pub, enc) {
  24274. enc = enc || 'utf8';
  24275. if (!Buffer.isBuffer(pub)) {
  24276. pub = new Buffer(pub, enc);
  24277. }
  24278. this._pub = new BN(pub);
  24279. return this;
  24280. }
  24281. function setPrivateKey(priv, enc) {
  24282. enc = enc || 'utf8';
  24283. if (!Buffer.isBuffer(priv)) {
  24284. priv = new Buffer(priv, enc);
  24285. }
  24286. this._priv = new BN(priv);
  24287. return this;
  24288. }
  24289. var primeCache = {};
  24290. function checkPrime(prime, generator) {
  24291. var gen = generator.toString('hex');
  24292. var hex = [gen, prime.toString(16)].join('_');
  24293. if (hex in primeCache) {
  24294. return primeCache[hex];
  24295. }
  24296. var error = 0;
  24297. if (prime.isEven() ||
  24298. !primes.simpleSieve ||
  24299. !primes.fermatTest(prime) ||
  24300. !millerRabin.test(prime)) {
  24301. //not a prime so +1
  24302. error += 1;
  24303. if (gen === '02' || gen === '05') {
  24304. // we'd be able to check the generator
  24305. // it would fail so +8
  24306. error += 8;
  24307. } else {
  24308. //we wouldn't be able to test the generator
  24309. // so +4
  24310. error += 4;
  24311. }
  24312. primeCache[hex] = error;
  24313. return error;
  24314. }
  24315. if (!millerRabin.test(prime.shrn(1))) {
  24316. //not a safe prime
  24317. error += 2;
  24318. }
  24319. var rem;
  24320. switch (gen) {
  24321. case '02':
  24322. if (prime.mod(TWENTYFOUR).cmp(ELEVEN)) {
  24323. // unsuidable generator
  24324. error += 8;
  24325. }
  24326. break;
  24327. case '05':
  24328. rem = prime.mod(TEN);
  24329. if (rem.cmp(THREE) && rem.cmp(SEVEN)) {
  24330. // prime mod 10 needs to equal 3 or 7
  24331. error += 8;
  24332. }
  24333. break;
  24334. default:
  24335. error += 4;
  24336. }
  24337. primeCache[hex] = error;
  24338. return error;
  24339. }
  24340. function DH(prime, generator, malleable) {
  24341. this.setGenerator(generator);
  24342. this.__prime = new BN(prime);
  24343. this._prime = BN.mont(this.__prime);
  24344. this._primeLen = prime.length;
  24345. this._pub = undefined;
  24346. this._priv = undefined;
  24347. this._primeCode = undefined;
  24348. if (malleable) {
  24349. this.setPublicKey = setPublicKey;
  24350. this.setPrivateKey = setPrivateKey;
  24351. } else {
  24352. this._primeCode = 8;
  24353. }
  24354. }
  24355. Object.defineProperty(DH.prototype, 'verifyError', {
  24356. enumerable: true,
  24357. get: function () {
  24358. if (typeof this._primeCode !== 'number') {
  24359. this._primeCode = checkPrime(this.__prime, this.__gen);
  24360. }
  24361. return this._primeCode;
  24362. }
  24363. });
  24364. DH.prototype.generateKeys = function () {
  24365. if (!this._priv) {
  24366. this._priv = new BN(randomBytes(this._primeLen));
  24367. }
  24368. this._pub = this._gen.toRed(this._prime).redPow(this._priv).fromRed();
  24369. return this.getPublicKey();
  24370. };
  24371. DH.prototype.computeSecret = function (other) {
  24372. other = new BN(other);
  24373. other = other.toRed(this._prime);
  24374. var secret = other.redPow(this._priv).fromRed();
  24375. var out = new Buffer(secret.toArray());
  24376. var prime = this.getPrime();
  24377. if (out.length < prime.length) {
  24378. var front = new Buffer(prime.length - out.length);
  24379. front.fill(0);
  24380. out = Buffer.concat([front, out]);
  24381. }
  24382. return out;
  24383. };
  24384. DH.prototype.getPublicKey = function getPublicKey(enc) {
  24385. return formatReturnValue(this._pub, enc);
  24386. };
  24387. DH.prototype.getPrivateKey = function getPrivateKey(enc) {
  24388. return formatReturnValue(this._priv, enc);
  24389. };
  24390. DH.prototype.getPrime = function (enc) {
  24391. return formatReturnValue(this.__prime, enc);
  24392. };
  24393. DH.prototype.getGenerator = function (enc) {
  24394. return formatReturnValue(this._gen, enc);
  24395. };
  24396. DH.prototype.setGenerator = function (gen, enc) {
  24397. enc = enc || 'utf8';
  24398. if (!Buffer.isBuffer(gen)) {
  24399. gen = new Buffer(gen, enc);
  24400. }
  24401. this.__gen = gen;
  24402. this._gen = new BN(gen);
  24403. return this;
  24404. };
  24405. function formatReturnValue(bn, enc) {
  24406. var buf = new Buffer(bn.toArray());
  24407. if (!enc) {
  24408. return buf;
  24409. } else {
  24410. return buf.toString(enc);
  24411. }
  24412. }
  24413. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../buffer/index.js */ 49).Buffer))
  24414. /***/ }),
  24415. /* 138 */
  24416. /*!*******************************************************!*\
  24417. !*** ./node_modules/browserify-sign/browser/index.js ***!
  24418. \*******************************************************/
  24419. /*! no static exports found */
  24420. /***/ (function(module, exports, __webpack_require__) {
  24421. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  24422. var createHash = __webpack_require__(/*! create-hash */ 53)
  24423. var stream = __webpack_require__(/*! readable-stream */ 57)
  24424. var inherits = __webpack_require__(/*! inherits */ 54)
  24425. var sign = __webpack_require__(/*! ./sign */ 139)
  24426. var verify = __webpack_require__(/*! ./verify */ 192)
  24427. var algorithms = __webpack_require__(/*! ./algorithms.json */ 92)
  24428. Object.keys(algorithms).forEach(function (key) {
  24429. algorithms[key].id = Buffer.from(algorithms[key].id, 'hex')
  24430. algorithms[key.toLowerCase()] = algorithms[key]
  24431. })
  24432. function Sign (algorithm) {
  24433. stream.Writable.call(this)
  24434. var data = algorithms[algorithm]
  24435. if (!data) throw new Error('Unknown message digest')
  24436. this._hashType = data.hash
  24437. this._hash = createHash(data.hash)
  24438. this._tag = data.id
  24439. this._signType = data.sign
  24440. }
  24441. inherits(Sign, stream.Writable)
  24442. Sign.prototype._write = function _write (data, _, done) {
  24443. this._hash.update(data)
  24444. done()
  24445. }
  24446. Sign.prototype.update = function update (data, enc) {
  24447. if (typeof data === 'string') data = Buffer.from(data, enc)
  24448. this._hash.update(data)
  24449. return this
  24450. }
  24451. Sign.prototype.sign = function signMethod (key, enc) {
  24452. this.end()
  24453. var hash = this._hash.digest()
  24454. var sig = sign(hash, key, this._hashType, this._signType, this._tag)
  24455. return enc ? sig.toString(enc) : sig
  24456. }
  24457. function Verify (algorithm) {
  24458. stream.Writable.call(this)
  24459. var data = algorithms[algorithm]
  24460. if (!data) throw new Error('Unknown message digest')
  24461. this._hash = createHash(data.hash)
  24462. this._tag = data.id
  24463. this._signType = data.sign
  24464. }
  24465. inherits(Verify, stream.Writable)
  24466. Verify.prototype._write = function _write (data, _, done) {
  24467. this._hash.update(data)
  24468. done()
  24469. }
  24470. Verify.prototype.update = function update (data, enc) {
  24471. if (typeof data === 'string') data = Buffer.from(data, enc)
  24472. this._hash.update(data)
  24473. return this
  24474. }
  24475. Verify.prototype.verify = function verifyMethod (key, sig, enc) {
  24476. if (typeof sig === 'string') sig = Buffer.from(sig, enc)
  24477. this.end()
  24478. var hash = this._hash.digest()
  24479. return verify(sig, hash, key, this._signType, this._tag)
  24480. }
  24481. function createSign (algorithm) {
  24482. return new Sign(algorithm)
  24483. }
  24484. function createVerify (algorithm) {
  24485. return new Verify(algorithm)
  24486. }
  24487. module.exports = {
  24488. Sign: createSign,
  24489. Verify: createVerify,
  24490. createSign: createSign,
  24491. createVerify: createVerify
  24492. }
  24493. /***/ }),
  24494. /* 139 */
  24495. /*!******************************************************!*\
  24496. !*** ./node_modules/browserify-sign/browser/sign.js ***!
  24497. \******************************************************/
  24498. /*! no static exports found */
  24499. /***/ (function(module, exports, __webpack_require__) {
  24500. // much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js
  24501. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  24502. var createHmac = __webpack_require__(/*! create-hmac */ 88)
  24503. var crt = __webpack_require__(/*! browserify-rsa */ 140)
  24504. var EC = __webpack_require__(/*! elliptic */ 141).ec
  24505. var BN = __webpack_require__(/*! bn.js */ 130)
  24506. var parseKeys = __webpack_require__(/*! parse-asn1 */ 171)
  24507. var curves = __webpack_require__(/*! ./curves.json */ 191)
  24508. function sign (hash, key, hashType, signType, tag) {
  24509. var priv = parseKeys(key)
  24510. if (priv.curve) {
  24511. // rsa keys can be interpreted as ecdsa ones in openssl
  24512. if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') throw new Error('wrong private key type')
  24513. return ecSign(hash, priv)
  24514. } else if (priv.type === 'dsa') {
  24515. if (signType !== 'dsa') throw new Error('wrong private key type')
  24516. return dsaSign(hash, priv, hashType)
  24517. } else {
  24518. if (signType !== 'rsa' && signType !== 'ecdsa/rsa') throw new Error('wrong private key type')
  24519. }
  24520. hash = Buffer.concat([tag, hash])
  24521. var len = priv.modulus.byteLength()
  24522. var pad = [0, 1]
  24523. while (hash.length + pad.length + 1 < len) pad.push(0xff)
  24524. pad.push(0x00)
  24525. var i = -1
  24526. while (++i < hash.length) pad.push(hash[i])
  24527. var out = crt(pad, priv)
  24528. return out
  24529. }
  24530. function ecSign (hash, priv) {
  24531. var curveId = curves[priv.curve.join('.')]
  24532. if (!curveId) throw new Error('unknown curve ' + priv.curve.join('.'))
  24533. var curve = new EC(curveId)
  24534. var key = curve.keyFromPrivate(priv.privateKey)
  24535. var out = key.sign(hash)
  24536. return Buffer.from(out.toDER())
  24537. }
  24538. function dsaSign (hash, priv, algo) {
  24539. var x = priv.params.priv_key
  24540. var p = priv.params.p
  24541. var q = priv.params.q
  24542. var g = priv.params.g
  24543. var r = new BN(0)
  24544. var k
  24545. var H = bits2int(hash, q).mod(q)
  24546. var s = false
  24547. var kv = getKey(x, q, hash, algo)
  24548. while (s === false) {
  24549. k = makeKey(q, kv, algo)
  24550. r = makeR(g, k, p, q)
  24551. s = k.invm(q).imul(H.add(x.mul(r))).mod(q)
  24552. if (s.cmpn(0) === 0) {
  24553. s = false
  24554. r = new BN(0)
  24555. }
  24556. }
  24557. return toDER(r, s)
  24558. }
  24559. function toDER (r, s) {
  24560. r = r.toArray()
  24561. s = s.toArray()
  24562. // Pad values
  24563. if (r[0] & 0x80) r = [0].concat(r)
  24564. if (s[0] & 0x80) s = [0].concat(s)
  24565. var total = r.length + s.length + 4
  24566. var res = [0x30, total, 0x02, r.length]
  24567. res = res.concat(r, [0x02, s.length], s)
  24568. return Buffer.from(res)
  24569. }
  24570. function getKey (x, q, hash, algo) {
  24571. x = Buffer.from(x.toArray())
  24572. if (x.length < q.byteLength()) {
  24573. var zeros = Buffer.alloc(q.byteLength() - x.length)
  24574. x = Buffer.concat([zeros, x])
  24575. }
  24576. var hlen = hash.length
  24577. var hbits = bits2octets(hash, q)
  24578. var v = Buffer.alloc(hlen)
  24579. v.fill(1)
  24580. var k = Buffer.alloc(hlen)
  24581. k = createHmac(algo, k).update(v).update(Buffer.from([0])).update(x).update(hbits).digest()
  24582. v = createHmac(algo, k).update(v).digest()
  24583. k = createHmac(algo, k).update(v).update(Buffer.from([1])).update(x).update(hbits).digest()
  24584. v = createHmac(algo, k).update(v).digest()
  24585. return { k: k, v: v }
  24586. }
  24587. function bits2int (obits, q) {
  24588. var bits = new BN(obits)
  24589. var shift = (obits.length << 3) - q.bitLength()
  24590. if (shift > 0) bits.ishrn(shift)
  24591. return bits
  24592. }
  24593. function bits2octets (bits, q) {
  24594. bits = bits2int(bits, q)
  24595. bits = bits.mod(q)
  24596. var out = Buffer.from(bits.toArray())
  24597. if (out.length < q.byteLength()) {
  24598. var zeros = Buffer.alloc(q.byteLength() - out.length)
  24599. out = Buffer.concat([zeros, out])
  24600. }
  24601. return out
  24602. }
  24603. function makeKey (q, kv, algo) {
  24604. var t
  24605. var k
  24606. do {
  24607. t = Buffer.alloc(0)
  24608. while (t.length * 8 < q.bitLength()) {
  24609. kv.v = createHmac(algo, kv.k).update(kv.v).digest()
  24610. t = Buffer.concat([t, kv.v])
  24611. }
  24612. k = bits2int(t, q)
  24613. kv.k = createHmac(algo, kv.k).update(kv.v).update(Buffer.from([0])).digest()
  24614. kv.v = createHmac(algo, kv.k).update(kv.v).digest()
  24615. } while (k.cmp(q) !== -1)
  24616. return k
  24617. }
  24618. function makeR (g, k, p, q) {
  24619. return g.toRed(BN.mont(p)).redPow(k).fromRed().mod(q)
  24620. }
  24621. module.exports = sign
  24622. module.exports.getKey = getKey
  24623. module.exports.makeKey = makeKey
  24624. /***/ }),
  24625. /* 140 */
  24626. /*!**********************************************!*\
  24627. !*** ./node_modules/browserify-rsa/index.js ***!
  24628. \**********************************************/
  24629. /*! no static exports found */
  24630. /***/ (function(module, exports, __webpack_require__) {
  24631. /* WEBPACK VAR INJECTION */(function(Buffer) {var bn = __webpack_require__(/*! bn.js */ 130);
  24632. var randomBytes = __webpack_require__(/*! randombytes */ 45);
  24633. module.exports = crt;
  24634. function blind(priv) {
  24635. var r = getr(priv);
  24636. var blinder = r.toRed(bn.mont(priv.modulus))
  24637. .redPow(new bn(priv.publicExponent)).fromRed();
  24638. return {
  24639. blinder: blinder,
  24640. unblinder:r.invm(priv.modulus)
  24641. };
  24642. }
  24643. function crt(msg, priv) {
  24644. var blinds = blind(priv);
  24645. var len = priv.modulus.byteLength();
  24646. var mod = bn.mont(priv.modulus);
  24647. var blinded = new bn(msg).mul(blinds.blinder).umod(priv.modulus);
  24648. var c1 = blinded.toRed(bn.mont(priv.prime1));
  24649. var c2 = blinded.toRed(bn.mont(priv.prime2));
  24650. var qinv = priv.coefficient;
  24651. var p = priv.prime1;
  24652. var q = priv.prime2;
  24653. var m1 = c1.redPow(priv.exponent1);
  24654. var m2 = c2.redPow(priv.exponent2);
  24655. m1 = m1.fromRed();
  24656. m2 = m2.fromRed();
  24657. var h = m1.isub(m2).imul(qinv).umod(p);
  24658. h.imul(q);
  24659. m2.iadd(h);
  24660. return new Buffer(m2.imul(blinds.unblinder).umod(priv.modulus).toArray(false, len));
  24661. }
  24662. crt.getr = getr;
  24663. function getr(priv) {
  24664. var len = priv.modulus.byteLength();
  24665. var r = new bn(randomBytes(len));
  24666. while (r.cmp(priv.modulus) >= 0 || !r.umod(priv.prime1) || !r.umod(priv.prime2)) {
  24667. r = new bn(randomBytes(len));
  24668. }
  24669. return r;
  24670. }
  24671. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ 49).Buffer))
  24672. /***/ }),
  24673. /* 141 */
  24674. /*!***********************************************!*\
  24675. !*** ./node_modules/elliptic/lib/elliptic.js ***!
  24676. \***********************************************/
  24677. /*! no static exports found */
  24678. /***/ (function(module, exports, __webpack_require__) {
  24679. "use strict";
  24680. var elliptic = exports;
  24681. elliptic.version = __webpack_require__(/*! ../package.json */ 142).version;
  24682. elliptic.utils = __webpack_require__(/*! ./elliptic/utils */ 143);
  24683. elliptic.rand = __webpack_require__(/*! brorand */ 134);
  24684. elliptic.curve = __webpack_require__(/*! ./elliptic/curve */ 145);
  24685. elliptic.curves = __webpack_require__(/*! ./elliptic/curves */ 150);
  24686. // Protocols
  24687. elliptic.ec = __webpack_require__(/*! ./elliptic/ec */ 164);
  24688. elliptic.eddsa = __webpack_require__(/*! ./elliptic/eddsa */ 168);
  24689. /***/ }),
  24690. /* 142 */
  24691. /*!********************************************!*\
  24692. !*** ./node_modules/elliptic/package.json ***!
  24693. \********************************************/
  24694. /*! exports provided: _from, _id, _inBundle, _integrity, _location, _phantomChildren, _requested, _requiredBy, _resolved, _shasum, _spec, _where, author, bugs, bundleDependencies, dependencies, deprecated, description, devDependencies, files, homepage, keywords, license, main, name, repository, scripts, version, default */
  24695. /***/ (function(module) {
  24696. module.exports = JSON.parse("{\"_from\":\"elliptic@^6.5.2\",\"_id\":\"elliptic@6.5.2\",\"_inBundle\":false,\"_integrity\":\"sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==\",\"_location\":\"/elliptic\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"range\",\"registry\":true,\"raw\":\"elliptic@^6.5.2\",\"name\":\"elliptic\",\"escapedName\":\"elliptic\",\"rawSpec\":\"^6.5.2\",\"saveSpec\":null,\"fetchSpec\":\"^6.5.2\"},\"_requiredBy\":[\"/browserify-sign\",\"/create-ecdh\"],\"_resolved\":\"https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz\",\"_shasum\":\"05c5678d7173c049d8ca433552224a495d0e3762\",\"_spec\":\"elliptic@^6.5.2\",\"_where\":\"/Users/fxy/Documents/DCloud/HbuilderX-plugins/alpha/uniapp-cli/node_modules/browserify-sign\",\"author\":{\"name\":\"Fedor Indutny\",\"email\":\"fedor@indutny.com\"},\"bugs\":{\"url\":\"https://github.com/indutny/elliptic/issues\"},\"bundleDependencies\":false,\"dependencies\":{\"bn.js\":\"^4.4.0\",\"brorand\":\"^1.0.1\",\"hash.js\":\"^1.0.0\",\"hmac-drbg\":\"^1.0.0\",\"inherits\":\"^2.0.1\",\"minimalistic-assert\":\"^1.0.0\",\"minimalistic-crypto-utils\":\"^1.0.0\"},\"deprecated\":false,\"description\":\"EC cryptography\",\"devDependencies\":{\"brfs\":\"^1.4.3\",\"coveralls\":\"^3.0.8\",\"grunt\":\"^1.0.4\",\"grunt-browserify\":\"^5.0.0\",\"grunt-cli\":\"^1.2.0\",\"grunt-contrib-connect\":\"^1.0.0\",\"grunt-contrib-copy\":\"^1.0.0\",\"grunt-contrib-uglify\":\"^1.0.1\",\"grunt-mocha-istanbul\":\"^3.0.1\",\"grunt-saucelabs\":\"^9.0.1\",\"istanbul\":\"^0.4.2\",\"jscs\":\"^3.0.7\",\"jshint\":\"^2.10.3\",\"mocha\":\"^6.2.2\"},\"files\":[\"lib\"],\"homepage\":\"https://github.com/indutny/elliptic\",\"keywords\":[\"EC\",\"Elliptic\",\"curve\",\"Cryptography\"],\"license\":\"MIT\",\"main\":\"lib/elliptic.js\",\"name\":\"elliptic\",\"repository\":{\"type\":\"git\",\"url\":\"git+ssh://git@github.com/indutny/elliptic.git\"},\"scripts\":{\"jscs\":\"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js\",\"jshint\":\"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js\",\"lint\":\"npm run jscs && npm run jshint\",\"test\":\"npm run lint && npm run unit\",\"unit\":\"istanbul test _mocha --reporter=spec test/index.js\",\"version\":\"grunt dist && git add dist/\"},\"version\":\"6.5.2\"}");
  24697. /***/ }),
  24698. /* 143 */
  24699. /*!*****************************************************!*\
  24700. !*** ./node_modules/elliptic/lib/elliptic/utils.js ***!
  24701. \*****************************************************/
  24702. /*! no static exports found */
  24703. /***/ (function(module, exports, __webpack_require__) {
  24704. "use strict";
  24705. var utils = exports;
  24706. var BN = __webpack_require__(/*! bn.js */ 130);
  24707. var minAssert = __webpack_require__(/*! minimalistic-assert */ 104);
  24708. var minUtils = __webpack_require__(/*! minimalistic-crypto-utils */ 144);
  24709. utils.assert = minAssert;
  24710. utils.toArray = minUtils.toArray;
  24711. utils.zero2 = minUtils.zero2;
  24712. utils.toHex = minUtils.toHex;
  24713. utils.encode = minUtils.encode;
  24714. // Represent num in a w-NAF form
  24715. function getNAF(num, w, bits) {
  24716. var naf = new Array(Math.max(num.bitLength(), bits) + 1);
  24717. naf.fill(0);
  24718. var ws = 1 << (w + 1);
  24719. var k = num.clone();
  24720. for (var i = 0; i < naf.length; i++) {
  24721. var z;
  24722. var mod = k.andln(ws - 1);
  24723. if (k.isOdd()) {
  24724. if (mod > (ws >> 1) - 1)
  24725. z = (ws >> 1) - mod;
  24726. else
  24727. z = mod;
  24728. k.isubn(z);
  24729. } else {
  24730. z = 0;
  24731. }
  24732. naf[i] = z;
  24733. k.iushrn(1);
  24734. }
  24735. return naf;
  24736. }
  24737. utils.getNAF = getNAF;
  24738. // Represent k1, k2 in a Joint Sparse Form
  24739. function getJSF(k1, k2) {
  24740. var jsf = [
  24741. [],
  24742. []
  24743. ];
  24744. k1 = k1.clone();
  24745. k2 = k2.clone();
  24746. var d1 = 0;
  24747. var d2 = 0;
  24748. while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) {
  24749. // First phase
  24750. var m14 = (k1.andln(3) + d1) & 3;
  24751. var m24 = (k2.andln(3) + d2) & 3;
  24752. if (m14 === 3)
  24753. m14 = -1;
  24754. if (m24 === 3)
  24755. m24 = -1;
  24756. var u1;
  24757. if ((m14 & 1) === 0) {
  24758. u1 = 0;
  24759. } else {
  24760. var m8 = (k1.andln(7) + d1) & 7;
  24761. if ((m8 === 3 || m8 === 5) && m24 === 2)
  24762. u1 = -m14;
  24763. else
  24764. u1 = m14;
  24765. }
  24766. jsf[0].push(u1);
  24767. var u2;
  24768. if ((m24 & 1) === 0) {
  24769. u2 = 0;
  24770. } else {
  24771. var m8 = (k2.andln(7) + d2) & 7;
  24772. if ((m8 === 3 || m8 === 5) && m14 === 2)
  24773. u2 = -m24;
  24774. else
  24775. u2 = m24;
  24776. }
  24777. jsf[1].push(u2);
  24778. // Second phase
  24779. if (2 * d1 === u1 + 1)
  24780. d1 = 1 - d1;
  24781. if (2 * d2 === u2 + 1)
  24782. d2 = 1 - d2;
  24783. k1.iushrn(1);
  24784. k2.iushrn(1);
  24785. }
  24786. return jsf;
  24787. }
  24788. utils.getJSF = getJSF;
  24789. function cachedProperty(obj, name, computer) {
  24790. var key = '_' + name;
  24791. obj.prototype[name] = function cachedProperty() {
  24792. return this[key] !== undefined ? this[key] :
  24793. this[key] = computer.call(this);
  24794. };
  24795. }
  24796. utils.cachedProperty = cachedProperty;
  24797. function parseBytes(bytes) {
  24798. return typeof bytes === 'string' ? utils.toArray(bytes, 'hex') :
  24799. bytes;
  24800. }
  24801. utils.parseBytes = parseBytes;
  24802. function intFromLE(bytes) {
  24803. return new BN(bytes, 'hex', 'le');
  24804. }
  24805. utils.intFromLE = intFromLE;
  24806. /***/ }),
  24807. /* 144 */
  24808. /*!*************************************************************!*\
  24809. !*** ./node_modules/minimalistic-crypto-utils/lib/utils.js ***!
  24810. \*************************************************************/
  24811. /*! no static exports found */
  24812. /***/ (function(module, exports, __webpack_require__) {
  24813. "use strict";
  24814. var utils = exports;
  24815. function toArray(msg, enc) {
  24816. if (Array.isArray(msg))
  24817. return msg.slice();
  24818. if (!msg)
  24819. return [];
  24820. var res = [];
  24821. if (typeof msg !== 'string') {
  24822. for (var i = 0; i < msg.length; i++)
  24823. res[i] = msg[i] | 0;
  24824. return res;
  24825. }
  24826. if (enc === 'hex') {
  24827. msg = msg.replace(/[^a-z0-9]+/ig, '');
  24828. if (msg.length % 2 !== 0)
  24829. msg = '0' + msg;
  24830. for (var i = 0; i < msg.length; i += 2)
  24831. res.push(parseInt(msg[i] + msg[i + 1], 16));
  24832. } else {
  24833. for (var i = 0; i < msg.length; i++) {
  24834. var c = msg.charCodeAt(i);
  24835. var hi = c >> 8;
  24836. var lo = c & 0xff;
  24837. if (hi)
  24838. res.push(hi, lo);
  24839. else
  24840. res.push(lo);
  24841. }
  24842. }
  24843. return res;
  24844. }
  24845. utils.toArray = toArray;
  24846. function zero2(word) {
  24847. if (word.length === 1)
  24848. return '0' + word;
  24849. else
  24850. return word;
  24851. }
  24852. utils.zero2 = zero2;
  24853. function toHex(msg) {
  24854. var res = '';
  24855. for (var i = 0; i < msg.length; i++)
  24856. res += zero2(msg[i].toString(16));
  24857. return res;
  24858. }
  24859. utils.toHex = toHex;
  24860. utils.encode = function encode(arr, enc) {
  24861. if (enc === 'hex')
  24862. return toHex(arr);
  24863. else
  24864. return arr;
  24865. };
  24866. /***/ }),
  24867. /* 145 */
  24868. /*!***********************************************************!*\
  24869. !*** ./node_modules/elliptic/lib/elliptic/curve/index.js ***!
  24870. \***********************************************************/
  24871. /*! no static exports found */
  24872. /***/ (function(module, exports, __webpack_require__) {
  24873. "use strict";
  24874. var curve = exports;
  24875. curve.base = __webpack_require__(/*! ./base */ 146);
  24876. curve.short = __webpack_require__(/*! ./short */ 147);
  24877. curve.mont = __webpack_require__(/*! ./mont */ 148);
  24878. curve.edwards = __webpack_require__(/*! ./edwards */ 149);
  24879. /***/ }),
  24880. /* 146 */
  24881. /*!**********************************************************!*\
  24882. !*** ./node_modules/elliptic/lib/elliptic/curve/base.js ***!
  24883. \**********************************************************/
  24884. /*! no static exports found */
  24885. /***/ (function(module, exports, __webpack_require__) {
  24886. "use strict";
  24887. var BN = __webpack_require__(/*! bn.js */ 130);
  24888. var utils = __webpack_require__(/*! ../utils */ 143);
  24889. var getNAF = utils.getNAF;
  24890. var getJSF = utils.getJSF;
  24891. var assert = utils.assert;
  24892. function BaseCurve(type, conf) {
  24893. this.type = type;
  24894. this.p = new BN(conf.p, 16);
  24895. // Use Montgomery, when there is no fast reduction for the prime
  24896. this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p);
  24897. // Useful for many curves
  24898. this.zero = new BN(0).toRed(this.red);
  24899. this.one = new BN(1).toRed(this.red);
  24900. this.two = new BN(2).toRed(this.red);
  24901. // Curve configuration, optional
  24902. this.n = conf.n && new BN(conf.n, 16);
  24903. this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed);
  24904. // Temporary arrays
  24905. this._wnafT1 = new Array(4);
  24906. this._wnafT2 = new Array(4);
  24907. this._wnafT3 = new Array(4);
  24908. this._wnafT4 = new Array(4);
  24909. this._bitLength = this.n ? this.n.bitLength() : 0;
  24910. // Generalized Greg Maxwell's trick
  24911. var adjustCount = this.n && this.p.div(this.n);
  24912. if (!adjustCount || adjustCount.cmpn(100) > 0) {
  24913. this.redN = null;
  24914. } else {
  24915. this._maxwellTrick = true;
  24916. this.redN = this.n.toRed(this.red);
  24917. }
  24918. }
  24919. module.exports = BaseCurve;
  24920. BaseCurve.prototype.point = function point() {
  24921. throw new Error('Not implemented');
  24922. };
  24923. BaseCurve.prototype.validate = function validate() {
  24924. throw new Error('Not implemented');
  24925. };
  24926. BaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) {
  24927. assert(p.precomputed);
  24928. var doubles = p._getDoubles();
  24929. var naf = getNAF(k, 1, this._bitLength);
  24930. var I = (1 << (doubles.step + 1)) - (doubles.step % 2 === 0 ? 2 : 1);
  24931. I /= 3;
  24932. // Translate into more windowed form
  24933. var repr = [];
  24934. for (var j = 0; j < naf.length; j += doubles.step) {
  24935. var nafW = 0;
  24936. for (var k = j + doubles.step - 1; k >= j; k--)
  24937. nafW = (nafW << 1) + naf[k];
  24938. repr.push(nafW);
  24939. }
  24940. var a = this.jpoint(null, null, null);
  24941. var b = this.jpoint(null, null, null);
  24942. for (var i = I; i > 0; i--) {
  24943. for (var j = 0; j < repr.length; j++) {
  24944. var nafW = repr[j];
  24945. if (nafW === i)
  24946. b = b.mixedAdd(doubles.points[j]);
  24947. else if (nafW === -i)
  24948. b = b.mixedAdd(doubles.points[j].neg());
  24949. }
  24950. a = a.add(b);
  24951. }
  24952. return a.toP();
  24953. };
  24954. BaseCurve.prototype._wnafMul = function _wnafMul(p, k) {
  24955. var w = 4;
  24956. // Precompute window
  24957. var nafPoints = p._getNAFPoints(w);
  24958. w = nafPoints.wnd;
  24959. var wnd = nafPoints.points;
  24960. // Get NAF form
  24961. var naf = getNAF(k, w, this._bitLength);
  24962. // Add `this`*(N+1) for every w-NAF index
  24963. var acc = this.jpoint(null, null, null);
  24964. for (var i = naf.length - 1; i >= 0; i--) {
  24965. // Count zeroes
  24966. for (var k = 0; i >= 0 && naf[i] === 0; i--)
  24967. k++;
  24968. if (i >= 0)
  24969. k++;
  24970. acc = acc.dblp(k);
  24971. if (i < 0)
  24972. break;
  24973. var z = naf[i];
  24974. assert(z !== 0);
  24975. if (p.type === 'affine') {
  24976. // J +- P
  24977. if (z > 0)
  24978. acc = acc.mixedAdd(wnd[(z - 1) >> 1]);
  24979. else
  24980. acc = acc.mixedAdd(wnd[(-z - 1) >> 1].neg());
  24981. } else {
  24982. // J +- J
  24983. if (z > 0)
  24984. acc = acc.add(wnd[(z - 1) >> 1]);
  24985. else
  24986. acc = acc.add(wnd[(-z - 1) >> 1].neg());
  24987. }
  24988. }
  24989. return p.type === 'affine' ? acc.toP() : acc;
  24990. };
  24991. BaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW,
  24992. points,
  24993. coeffs,
  24994. len,
  24995. jacobianResult) {
  24996. var wndWidth = this._wnafT1;
  24997. var wnd = this._wnafT2;
  24998. var naf = this._wnafT3;
  24999. // Fill all arrays
  25000. var max = 0;
  25001. for (var i = 0; i < len; i++) {
  25002. var p = points[i];
  25003. var nafPoints = p._getNAFPoints(defW);
  25004. wndWidth[i] = nafPoints.wnd;
  25005. wnd[i] = nafPoints.points;
  25006. }
  25007. // Comb small window NAFs
  25008. for (var i = len - 1; i >= 1; i -= 2) {
  25009. var a = i - 1;
  25010. var b = i;
  25011. if (wndWidth[a] !== 1 || wndWidth[b] !== 1) {
  25012. naf[a] = getNAF(coeffs[a], wndWidth[a], this._bitLength);
  25013. naf[b] = getNAF(coeffs[b], wndWidth[b], this._bitLength);
  25014. max = Math.max(naf[a].length, max);
  25015. max = Math.max(naf[b].length, max);
  25016. continue;
  25017. }
  25018. var comb = [
  25019. points[a], /* 1 */
  25020. null, /* 3 */
  25021. null, /* 5 */
  25022. points[b] /* 7 */
  25023. ];
  25024. // Try to avoid Projective points, if possible
  25025. if (points[a].y.cmp(points[b].y) === 0) {
  25026. comb[1] = points[a].add(points[b]);
  25027. comb[2] = points[a].toJ().mixedAdd(points[b].neg());
  25028. } else if (points[a].y.cmp(points[b].y.redNeg()) === 0) {
  25029. comb[1] = points[a].toJ().mixedAdd(points[b]);
  25030. comb[2] = points[a].add(points[b].neg());
  25031. } else {
  25032. comb[1] = points[a].toJ().mixedAdd(points[b]);
  25033. comb[2] = points[a].toJ().mixedAdd(points[b].neg());
  25034. }
  25035. var index = [
  25036. -3, /* -1 -1 */
  25037. -1, /* -1 0 */
  25038. -5, /* -1 1 */
  25039. -7, /* 0 -1 */
  25040. 0, /* 0 0 */
  25041. 7, /* 0 1 */
  25042. 5, /* 1 -1 */
  25043. 1, /* 1 0 */
  25044. 3 /* 1 1 */
  25045. ];
  25046. var jsf = getJSF(coeffs[a], coeffs[b]);
  25047. max = Math.max(jsf[0].length, max);
  25048. naf[a] = new Array(max);
  25049. naf[b] = new Array(max);
  25050. for (var j = 0; j < max; j++) {
  25051. var ja = jsf[0][j] | 0;
  25052. var jb = jsf[1][j] | 0;
  25053. naf[a][j] = index[(ja + 1) * 3 + (jb + 1)];
  25054. naf[b][j] = 0;
  25055. wnd[a] = comb;
  25056. }
  25057. }
  25058. var acc = this.jpoint(null, null, null);
  25059. var tmp = this._wnafT4;
  25060. for (var i = max; i >= 0; i--) {
  25061. var k = 0;
  25062. while (i >= 0) {
  25063. var zero = true;
  25064. for (var j = 0; j < len; j++) {
  25065. tmp[j] = naf[j][i] | 0;
  25066. if (tmp[j] !== 0)
  25067. zero = false;
  25068. }
  25069. if (!zero)
  25070. break;
  25071. k++;
  25072. i--;
  25073. }
  25074. if (i >= 0)
  25075. k++;
  25076. acc = acc.dblp(k);
  25077. if (i < 0)
  25078. break;
  25079. for (var j = 0; j < len; j++) {
  25080. var z = tmp[j];
  25081. var p;
  25082. if (z === 0)
  25083. continue;
  25084. else if (z > 0)
  25085. p = wnd[j][(z - 1) >> 1];
  25086. else if (z < 0)
  25087. p = wnd[j][(-z - 1) >> 1].neg();
  25088. if (p.type === 'affine')
  25089. acc = acc.mixedAdd(p);
  25090. else
  25091. acc = acc.add(p);
  25092. }
  25093. }
  25094. // Zeroify references
  25095. for (var i = 0; i < len; i++)
  25096. wnd[i] = null;
  25097. if (jacobianResult)
  25098. return acc;
  25099. else
  25100. return acc.toP();
  25101. };
  25102. function BasePoint(curve, type) {
  25103. this.curve = curve;
  25104. this.type = type;
  25105. this.precomputed = null;
  25106. }
  25107. BaseCurve.BasePoint = BasePoint;
  25108. BasePoint.prototype.eq = function eq(/*other*/) {
  25109. throw new Error('Not implemented');
  25110. };
  25111. BasePoint.prototype.validate = function validate() {
  25112. return this.curve.validate(this);
  25113. };
  25114. BaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) {
  25115. bytes = utils.toArray(bytes, enc);
  25116. var len = this.p.byteLength();
  25117. // uncompressed, hybrid-odd, hybrid-even
  25118. if ((bytes[0] === 0x04 || bytes[0] === 0x06 || bytes[0] === 0x07) &&
  25119. bytes.length - 1 === 2 * len) {
  25120. if (bytes[0] === 0x06)
  25121. assert(bytes[bytes.length - 1] % 2 === 0);
  25122. else if (bytes[0] === 0x07)
  25123. assert(bytes[bytes.length - 1] % 2 === 1);
  25124. var res = this.point(bytes.slice(1, 1 + len),
  25125. bytes.slice(1 + len, 1 + 2 * len));
  25126. return res;
  25127. } else if ((bytes[0] === 0x02 || bytes[0] === 0x03) &&
  25128. bytes.length - 1 === len) {
  25129. return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 0x03);
  25130. }
  25131. throw new Error('Unknown point format');
  25132. };
  25133. BasePoint.prototype.encodeCompressed = function encodeCompressed(enc) {
  25134. return this.encode(enc, true);
  25135. };
  25136. BasePoint.prototype._encode = function _encode(compact) {
  25137. var len = this.curve.p.byteLength();
  25138. var x = this.getX().toArray('be', len);
  25139. if (compact)
  25140. return [ this.getY().isEven() ? 0x02 : 0x03 ].concat(x);
  25141. return [ 0x04 ].concat(x, this.getY().toArray('be', len)) ;
  25142. };
  25143. BasePoint.prototype.encode = function encode(enc, compact) {
  25144. return utils.encode(this._encode(compact), enc);
  25145. };
  25146. BasePoint.prototype.precompute = function precompute(power) {
  25147. if (this.precomputed)
  25148. return this;
  25149. var precomputed = {
  25150. doubles: null,
  25151. naf: null,
  25152. beta: null
  25153. };
  25154. precomputed.naf = this._getNAFPoints(8);
  25155. precomputed.doubles = this._getDoubles(4, power);
  25156. precomputed.beta = this._getBeta();
  25157. this.precomputed = precomputed;
  25158. return this;
  25159. };
  25160. BasePoint.prototype._hasDoubles = function _hasDoubles(k) {
  25161. if (!this.precomputed)
  25162. return false;
  25163. var doubles = this.precomputed.doubles;
  25164. if (!doubles)
  25165. return false;
  25166. return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step);
  25167. };
  25168. BasePoint.prototype._getDoubles = function _getDoubles(step, power) {
  25169. if (this.precomputed && this.precomputed.doubles)
  25170. return this.precomputed.doubles;
  25171. var doubles = [ this ];
  25172. var acc = this;
  25173. for (var i = 0; i < power; i += step) {
  25174. for (var j = 0; j < step; j++)
  25175. acc = acc.dbl();
  25176. doubles.push(acc);
  25177. }
  25178. return {
  25179. step: step,
  25180. points: doubles
  25181. };
  25182. };
  25183. BasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) {
  25184. if (this.precomputed && this.precomputed.naf)
  25185. return this.precomputed.naf;
  25186. var res = [ this ];
  25187. var max = (1 << wnd) - 1;
  25188. var dbl = max === 1 ? null : this.dbl();
  25189. for (var i = 1; i < max; i++)
  25190. res[i] = res[i - 1].add(dbl);
  25191. return {
  25192. wnd: wnd,
  25193. points: res
  25194. };
  25195. };
  25196. BasePoint.prototype._getBeta = function _getBeta() {
  25197. return null;
  25198. };
  25199. BasePoint.prototype.dblp = function dblp(k) {
  25200. var r = this;
  25201. for (var i = 0; i < k; i++)
  25202. r = r.dbl();
  25203. return r;
  25204. };
  25205. /***/ }),
  25206. /* 147 */
  25207. /*!***********************************************************!*\
  25208. !*** ./node_modules/elliptic/lib/elliptic/curve/short.js ***!
  25209. \***********************************************************/
  25210. /*! no static exports found */
  25211. /***/ (function(module, exports, __webpack_require__) {
  25212. "use strict";
  25213. var utils = __webpack_require__(/*! ../utils */ 143);
  25214. var BN = __webpack_require__(/*! bn.js */ 130);
  25215. var inherits = __webpack_require__(/*! inherits */ 54);
  25216. var Base = __webpack_require__(/*! ./base */ 146);
  25217. var assert = utils.assert;
  25218. function ShortCurve(conf) {
  25219. Base.call(this, 'short', conf);
  25220. this.a = new BN(conf.a, 16).toRed(this.red);
  25221. this.b = new BN(conf.b, 16).toRed(this.red);
  25222. this.tinv = this.two.redInvm();
  25223. this.zeroA = this.a.fromRed().cmpn(0) === 0;
  25224. this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0;
  25225. // If the curve is endomorphic, precalculate beta and lambda
  25226. this.endo = this._getEndomorphism(conf);
  25227. this._endoWnafT1 = new Array(4);
  25228. this._endoWnafT2 = new Array(4);
  25229. }
  25230. inherits(ShortCurve, Base);
  25231. module.exports = ShortCurve;
  25232. ShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) {
  25233. // No efficient endomorphism
  25234. if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1)
  25235. return;
  25236. // Compute beta and lambda, that lambda * P = (beta * Px; Py)
  25237. var beta;
  25238. var lambda;
  25239. if (conf.beta) {
  25240. beta = new BN(conf.beta, 16).toRed(this.red);
  25241. } else {
  25242. var betas = this._getEndoRoots(this.p);
  25243. // Choose the smallest beta
  25244. beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1];
  25245. beta = beta.toRed(this.red);
  25246. }
  25247. if (conf.lambda) {
  25248. lambda = new BN(conf.lambda, 16);
  25249. } else {
  25250. // Choose the lambda that is matching selected beta
  25251. var lambdas = this._getEndoRoots(this.n);
  25252. if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) {
  25253. lambda = lambdas[0];
  25254. } else {
  25255. lambda = lambdas[1];
  25256. assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0);
  25257. }
  25258. }
  25259. // Get basis vectors, used for balanced length-two representation
  25260. var basis;
  25261. if (conf.basis) {
  25262. basis = conf.basis.map(function(vec) {
  25263. return {
  25264. a: new BN(vec.a, 16),
  25265. b: new BN(vec.b, 16)
  25266. };
  25267. });
  25268. } else {
  25269. basis = this._getEndoBasis(lambda);
  25270. }
  25271. return {
  25272. beta: beta,
  25273. lambda: lambda,
  25274. basis: basis
  25275. };
  25276. };
  25277. ShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) {
  25278. // Find roots of for x^2 + x + 1 in F
  25279. // Root = (-1 +- Sqrt(-3)) / 2
  25280. //
  25281. var red = num === this.p ? this.red : BN.mont(num);
  25282. var tinv = new BN(2).toRed(red).redInvm();
  25283. var ntinv = tinv.redNeg();
  25284. var s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv);
  25285. var l1 = ntinv.redAdd(s).fromRed();
  25286. var l2 = ntinv.redSub(s).fromRed();
  25287. return [ l1, l2 ];
  25288. };
  25289. ShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) {
  25290. // aprxSqrt >= sqrt(this.n)
  25291. var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2));
  25292. // 3.74
  25293. // Run EGCD, until r(L + 1) < aprxSqrt
  25294. var u = lambda;
  25295. var v = this.n.clone();
  25296. var x1 = new BN(1);
  25297. var y1 = new BN(0);
  25298. var x2 = new BN(0);
  25299. var y2 = new BN(1);
  25300. // NOTE: all vectors are roots of: a + b * lambda = 0 (mod n)
  25301. var a0;
  25302. var b0;
  25303. // First vector
  25304. var a1;
  25305. var b1;
  25306. // Second vector
  25307. var a2;
  25308. var b2;
  25309. var prevR;
  25310. var i = 0;
  25311. var r;
  25312. var x;
  25313. while (u.cmpn(0) !== 0) {
  25314. var q = v.div(u);
  25315. r = v.sub(q.mul(u));
  25316. x = x2.sub(q.mul(x1));
  25317. var y = y2.sub(q.mul(y1));
  25318. if (!a1 && r.cmp(aprxSqrt) < 0) {
  25319. a0 = prevR.neg();
  25320. b0 = x1;
  25321. a1 = r.neg();
  25322. b1 = x;
  25323. } else if (a1 && ++i === 2) {
  25324. break;
  25325. }
  25326. prevR = r;
  25327. v = u;
  25328. u = r;
  25329. x2 = x1;
  25330. x1 = x;
  25331. y2 = y1;
  25332. y1 = y;
  25333. }
  25334. a2 = r.neg();
  25335. b2 = x;
  25336. var len1 = a1.sqr().add(b1.sqr());
  25337. var len2 = a2.sqr().add(b2.sqr());
  25338. if (len2.cmp(len1) >= 0) {
  25339. a2 = a0;
  25340. b2 = b0;
  25341. }
  25342. // Normalize signs
  25343. if (a1.negative) {
  25344. a1 = a1.neg();
  25345. b1 = b1.neg();
  25346. }
  25347. if (a2.negative) {
  25348. a2 = a2.neg();
  25349. b2 = b2.neg();
  25350. }
  25351. return [
  25352. { a: a1, b: b1 },
  25353. { a: a2, b: b2 }
  25354. ];
  25355. };
  25356. ShortCurve.prototype._endoSplit = function _endoSplit(k) {
  25357. var basis = this.endo.basis;
  25358. var v1 = basis[0];
  25359. var v2 = basis[1];
  25360. var c1 = v2.b.mul(k).divRound(this.n);
  25361. var c2 = v1.b.neg().mul(k).divRound(this.n);
  25362. var p1 = c1.mul(v1.a);
  25363. var p2 = c2.mul(v2.a);
  25364. var q1 = c1.mul(v1.b);
  25365. var q2 = c2.mul(v2.b);
  25366. // Calculate answer
  25367. var k1 = k.sub(p1).sub(p2);
  25368. var k2 = q1.add(q2).neg();
  25369. return { k1: k1, k2: k2 };
  25370. };
  25371. ShortCurve.prototype.pointFromX = function pointFromX(x, odd) {
  25372. x = new BN(x, 16);
  25373. if (!x.red)
  25374. x = x.toRed(this.red);
  25375. var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b);
  25376. var y = y2.redSqrt();
  25377. if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)
  25378. throw new Error('invalid point');
  25379. // XXX Is there any way to tell if the number is odd without converting it
  25380. // to non-red form?
  25381. var isOdd = y.fromRed().isOdd();
  25382. if (odd && !isOdd || !odd && isOdd)
  25383. y = y.redNeg();
  25384. return this.point(x, y);
  25385. };
  25386. ShortCurve.prototype.validate = function validate(point) {
  25387. if (point.inf)
  25388. return true;
  25389. var x = point.x;
  25390. var y = point.y;
  25391. var ax = this.a.redMul(x);
  25392. var rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);
  25393. return y.redSqr().redISub(rhs).cmpn(0) === 0;
  25394. };
  25395. ShortCurve.prototype._endoWnafMulAdd =
  25396. function _endoWnafMulAdd(points, coeffs, jacobianResult) {
  25397. var npoints = this._endoWnafT1;
  25398. var ncoeffs = this._endoWnafT2;
  25399. for (var i = 0; i < points.length; i++) {
  25400. var split = this._endoSplit(coeffs[i]);
  25401. var p = points[i];
  25402. var beta = p._getBeta();
  25403. if (split.k1.negative) {
  25404. split.k1.ineg();
  25405. p = p.neg(true);
  25406. }
  25407. if (split.k2.negative) {
  25408. split.k2.ineg();
  25409. beta = beta.neg(true);
  25410. }
  25411. npoints[i * 2] = p;
  25412. npoints[i * 2 + 1] = beta;
  25413. ncoeffs[i * 2] = split.k1;
  25414. ncoeffs[i * 2 + 1] = split.k2;
  25415. }
  25416. var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult);
  25417. // Clean-up references to points and coefficients
  25418. for (var j = 0; j < i * 2; j++) {
  25419. npoints[j] = null;
  25420. ncoeffs[j] = null;
  25421. }
  25422. return res;
  25423. };
  25424. function Point(curve, x, y, isRed) {
  25425. Base.BasePoint.call(this, curve, 'affine');
  25426. if (x === null && y === null) {
  25427. this.x = null;
  25428. this.y = null;
  25429. this.inf = true;
  25430. } else {
  25431. this.x = new BN(x, 16);
  25432. this.y = new BN(y, 16);
  25433. // Force redgomery representation when loading from JSON
  25434. if (isRed) {
  25435. this.x.forceRed(this.curve.red);
  25436. this.y.forceRed(this.curve.red);
  25437. }
  25438. if (!this.x.red)
  25439. this.x = this.x.toRed(this.curve.red);
  25440. if (!this.y.red)
  25441. this.y = this.y.toRed(this.curve.red);
  25442. this.inf = false;
  25443. }
  25444. }
  25445. inherits(Point, Base.BasePoint);
  25446. ShortCurve.prototype.point = function point(x, y, isRed) {
  25447. return new Point(this, x, y, isRed);
  25448. };
  25449. ShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) {
  25450. return Point.fromJSON(this, obj, red);
  25451. };
  25452. Point.prototype._getBeta = function _getBeta() {
  25453. if (!this.curve.endo)
  25454. return;
  25455. var pre = this.precomputed;
  25456. if (pre && pre.beta)
  25457. return pre.beta;
  25458. var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y);
  25459. if (pre) {
  25460. var curve = this.curve;
  25461. var endoMul = function(p) {
  25462. return curve.point(p.x.redMul(curve.endo.beta), p.y);
  25463. };
  25464. pre.beta = beta;
  25465. beta.precomputed = {
  25466. beta: null,
  25467. naf: pre.naf && {
  25468. wnd: pre.naf.wnd,
  25469. points: pre.naf.points.map(endoMul)
  25470. },
  25471. doubles: pre.doubles && {
  25472. step: pre.doubles.step,
  25473. points: pre.doubles.points.map(endoMul)
  25474. }
  25475. };
  25476. }
  25477. return beta;
  25478. };
  25479. Point.prototype.toJSON = function toJSON() {
  25480. if (!this.precomputed)
  25481. return [ this.x, this.y ];
  25482. return [ this.x, this.y, this.precomputed && {
  25483. doubles: this.precomputed.doubles && {
  25484. step: this.precomputed.doubles.step,
  25485. points: this.precomputed.doubles.points.slice(1)
  25486. },
  25487. naf: this.precomputed.naf && {
  25488. wnd: this.precomputed.naf.wnd,
  25489. points: this.precomputed.naf.points.slice(1)
  25490. }
  25491. } ];
  25492. };
  25493. Point.fromJSON = function fromJSON(curve, obj, red) {
  25494. if (typeof obj === 'string')
  25495. obj = JSON.parse(obj);
  25496. var res = curve.point(obj[0], obj[1], red);
  25497. if (!obj[2])
  25498. return res;
  25499. function obj2point(obj) {
  25500. return curve.point(obj[0], obj[1], red);
  25501. }
  25502. var pre = obj[2];
  25503. res.precomputed = {
  25504. beta: null,
  25505. doubles: pre.doubles && {
  25506. step: pre.doubles.step,
  25507. points: [ res ].concat(pre.doubles.points.map(obj2point))
  25508. },
  25509. naf: pre.naf && {
  25510. wnd: pre.naf.wnd,
  25511. points: [ res ].concat(pre.naf.points.map(obj2point))
  25512. }
  25513. };
  25514. return res;
  25515. };
  25516. Point.prototype.inspect = function inspect() {
  25517. if (this.isInfinity())
  25518. return '<EC Point Infinity>';
  25519. return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +
  25520. ' y: ' + this.y.fromRed().toString(16, 2) + '>';
  25521. };
  25522. Point.prototype.isInfinity = function isInfinity() {
  25523. return this.inf;
  25524. };
  25525. Point.prototype.add = function add(p) {
  25526. // O + P = P
  25527. if (this.inf)
  25528. return p;
  25529. // P + O = P
  25530. if (p.inf)
  25531. return this;
  25532. // P + P = 2P
  25533. if (this.eq(p))
  25534. return this.dbl();
  25535. // P + (-P) = O
  25536. if (this.neg().eq(p))
  25537. return this.curve.point(null, null);
  25538. // P + Q = O
  25539. if (this.x.cmp(p.x) === 0)
  25540. return this.curve.point(null, null);
  25541. var c = this.y.redSub(p.y);
  25542. if (c.cmpn(0) !== 0)
  25543. c = c.redMul(this.x.redSub(p.x).redInvm());
  25544. var nx = c.redSqr().redISub(this.x).redISub(p.x);
  25545. var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);
  25546. return this.curve.point(nx, ny);
  25547. };
  25548. Point.prototype.dbl = function dbl() {
  25549. if (this.inf)
  25550. return this;
  25551. // 2P = O
  25552. var ys1 = this.y.redAdd(this.y);
  25553. if (ys1.cmpn(0) === 0)
  25554. return this.curve.point(null, null);
  25555. var a = this.curve.a;
  25556. var x2 = this.x.redSqr();
  25557. var dyinv = ys1.redInvm();
  25558. var c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv);
  25559. var nx = c.redSqr().redISub(this.x.redAdd(this.x));
  25560. var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);
  25561. return this.curve.point(nx, ny);
  25562. };
  25563. Point.prototype.getX = function getX() {
  25564. return this.x.fromRed();
  25565. };
  25566. Point.prototype.getY = function getY() {
  25567. return this.y.fromRed();
  25568. };
  25569. Point.prototype.mul = function mul(k) {
  25570. k = new BN(k, 16);
  25571. if (this.isInfinity())
  25572. return this;
  25573. else if (this._hasDoubles(k))
  25574. return this.curve._fixedNafMul(this, k);
  25575. else if (this.curve.endo)
  25576. return this.curve._endoWnafMulAdd([ this ], [ k ]);
  25577. else
  25578. return this.curve._wnafMul(this, k);
  25579. };
  25580. Point.prototype.mulAdd = function mulAdd(k1, p2, k2) {
  25581. var points = [ this, p2 ];
  25582. var coeffs = [ k1, k2 ];
  25583. if (this.curve.endo)
  25584. return this.curve._endoWnafMulAdd(points, coeffs);
  25585. else
  25586. return this.curve._wnafMulAdd(1, points, coeffs, 2);
  25587. };
  25588. Point.prototype.jmulAdd = function jmulAdd(k1, p2, k2) {
  25589. var points = [ this, p2 ];
  25590. var coeffs = [ k1, k2 ];
  25591. if (this.curve.endo)
  25592. return this.curve._endoWnafMulAdd(points, coeffs, true);
  25593. else
  25594. return this.curve._wnafMulAdd(1, points, coeffs, 2, true);
  25595. };
  25596. Point.prototype.eq = function eq(p) {
  25597. return this === p ||
  25598. this.inf === p.inf &&
  25599. (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0);
  25600. };
  25601. Point.prototype.neg = function neg(_precompute) {
  25602. if (this.inf)
  25603. return this;
  25604. var res = this.curve.point(this.x, this.y.redNeg());
  25605. if (_precompute && this.precomputed) {
  25606. var pre = this.precomputed;
  25607. var negate = function(p) {
  25608. return p.neg();
  25609. };
  25610. res.precomputed = {
  25611. naf: pre.naf && {
  25612. wnd: pre.naf.wnd,
  25613. points: pre.naf.points.map(negate)
  25614. },
  25615. doubles: pre.doubles && {
  25616. step: pre.doubles.step,
  25617. points: pre.doubles.points.map(negate)
  25618. }
  25619. };
  25620. }
  25621. return res;
  25622. };
  25623. Point.prototype.toJ = function toJ() {
  25624. if (this.inf)
  25625. return this.curve.jpoint(null, null, null);
  25626. var res = this.curve.jpoint(this.x, this.y, this.curve.one);
  25627. return res;
  25628. };
  25629. function JPoint(curve, x, y, z) {
  25630. Base.BasePoint.call(this, curve, 'jacobian');
  25631. if (x === null && y === null && z === null) {
  25632. this.x = this.curve.one;
  25633. this.y = this.curve.one;
  25634. this.z = new BN(0);
  25635. } else {
  25636. this.x = new BN(x, 16);
  25637. this.y = new BN(y, 16);
  25638. this.z = new BN(z, 16);
  25639. }
  25640. if (!this.x.red)
  25641. this.x = this.x.toRed(this.curve.red);
  25642. if (!this.y.red)
  25643. this.y = this.y.toRed(this.curve.red);
  25644. if (!this.z.red)
  25645. this.z = this.z.toRed(this.curve.red);
  25646. this.zOne = this.z === this.curve.one;
  25647. }
  25648. inherits(JPoint, Base.BasePoint);
  25649. ShortCurve.prototype.jpoint = function jpoint(x, y, z) {
  25650. return new JPoint(this, x, y, z);
  25651. };
  25652. JPoint.prototype.toP = function toP() {
  25653. if (this.isInfinity())
  25654. return this.curve.point(null, null);
  25655. var zinv = this.z.redInvm();
  25656. var zinv2 = zinv.redSqr();
  25657. var ax = this.x.redMul(zinv2);
  25658. var ay = this.y.redMul(zinv2).redMul(zinv);
  25659. return this.curve.point(ax, ay);
  25660. };
  25661. JPoint.prototype.neg = function neg() {
  25662. return this.curve.jpoint(this.x, this.y.redNeg(), this.z);
  25663. };
  25664. JPoint.prototype.add = function add(p) {
  25665. // O + P = P
  25666. if (this.isInfinity())
  25667. return p;
  25668. // P + O = P
  25669. if (p.isInfinity())
  25670. return this;
  25671. // 12M + 4S + 7A
  25672. var pz2 = p.z.redSqr();
  25673. var z2 = this.z.redSqr();
  25674. var u1 = this.x.redMul(pz2);
  25675. var u2 = p.x.redMul(z2);
  25676. var s1 = this.y.redMul(pz2.redMul(p.z));
  25677. var s2 = p.y.redMul(z2.redMul(this.z));
  25678. var h = u1.redSub(u2);
  25679. var r = s1.redSub(s2);
  25680. if (h.cmpn(0) === 0) {
  25681. if (r.cmpn(0) !== 0)
  25682. return this.curve.jpoint(null, null, null);
  25683. else
  25684. return this.dbl();
  25685. }
  25686. var h2 = h.redSqr();
  25687. var h3 = h2.redMul(h);
  25688. var v = u1.redMul(h2);
  25689. var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);
  25690. var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));
  25691. var nz = this.z.redMul(p.z).redMul(h);
  25692. return this.curve.jpoint(nx, ny, nz);
  25693. };
  25694. JPoint.prototype.mixedAdd = function mixedAdd(p) {
  25695. // O + P = P
  25696. if (this.isInfinity())
  25697. return p.toJ();
  25698. // P + O = P
  25699. if (p.isInfinity())
  25700. return this;
  25701. // 8M + 3S + 7A
  25702. var z2 = this.z.redSqr();
  25703. var u1 = this.x;
  25704. var u2 = p.x.redMul(z2);
  25705. var s1 = this.y;
  25706. var s2 = p.y.redMul(z2).redMul(this.z);
  25707. var h = u1.redSub(u2);
  25708. var r = s1.redSub(s2);
  25709. if (h.cmpn(0) === 0) {
  25710. if (r.cmpn(0) !== 0)
  25711. return this.curve.jpoint(null, null, null);
  25712. else
  25713. return this.dbl();
  25714. }
  25715. var h2 = h.redSqr();
  25716. var h3 = h2.redMul(h);
  25717. var v = u1.redMul(h2);
  25718. var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);
  25719. var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));
  25720. var nz = this.z.redMul(h);
  25721. return this.curve.jpoint(nx, ny, nz);
  25722. };
  25723. JPoint.prototype.dblp = function dblp(pow) {
  25724. if (pow === 0)
  25725. return this;
  25726. if (this.isInfinity())
  25727. return this;
  25728. if (!pow)
  25729. return this.dbl();
  25730. if (this.curve.zeroA || this.curve.threeA) {
  25731. var r = this;
  25732. for (var i = 0; i < pow; i++)
  25733. r = r.dbl();
  25734. return r;
  25735. }
  25736. // 1M + 2S + 1A + N * (4S + 5M + 8A)
  25737. // N = 1 => 6M + 6S + 9A
  25738. var a = this.curve.a;
  25739. var tinv = this.curve.tinv;
  25740. var jx = this.x;
  25741. var jy = this.y;
  25742. var jz = this.z;
  25743. var jz4 = jz.redSqr().redSqr();
  25744. // Reuse results
  25745. var jyd = jy.redAdd(jy);
  25746. for (var i = 0; i < pow; i++) {
  25747. var jx2 = jx.redSqr();
  25748. var jyd2 = jyd.redSqr();
  25749. var jyd4 = jyd2.redSqr();
  25750. var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));
  25751. var t1 = jx.redMul(jyd2);
  25752. var nx = c.redSqr().redISub(t1.redAdd(t1));
  25753. var t2 = t1.redISub(nx);
  25754. var dny = c.redMul(t2);
  25755. dny = dny.redIAdd(dny).redISub(jyd4);
  25756. var nz = jyd.redMul(jz);
  25757. if (i + 1 < pow)
  25758. jz4 = jz4.redMul(jyd4);
  25759. jx = nx;
  25760. jz = nz;
  25761. jyd = dny;
  25762. }
  25763. return this.curve.jpoint(jx, jyd.redMul(tinv), jz);
  25764. };
  25765. JPoint.prototype.dbl = function dbl() {
  25766. if (this.isInfinity())
  25767. return this;
  25768. if (this.curve.zeroA)
  25769. return this._zeroDbl();
  25770. else if (this.curve.threeA)
  25771. return this._threeDbl();
  25772. else
  25773. return this._dbl();
  25774. };
  25775. JPoint.prototype._zeroDbl = function _zeroDbl() {
  25776. var nx;
  25777. var ny;
  25778. var nz;
  25779. // Z = 1
  25780. if (this.zOne) {
  25781. // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html
  25782. // #doubling-mdbl-2007-bl
  25783. // 1M + 5S + 14A
  25784. // XX = X1^2
  25785. var xx = this.x.redSqr();
  25786. // YY = Y1^2
  25787. var yy = this.y.redSqr();
  25788. // YYYY = YY^2
  25789. var yyyy = yy.redSqr();
  25790. // S = 2 * ((X1 + YY)^2 - XX - YYYY)
  25791. var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);
  25792. s = s.redIAdd(s);
  25793. // M = 3 * XX + a; a = 0
  25794. var m = xx.redAdd(xx).redIAdd(xx);
  25795. // T = M ^ 2 - 2*S
  25796. var t = m.redSqr().redISub(s).redISub(s);
  25797. // 8 * YYYY
  25798. var yyyy8 = yyyy.redIAdd(yyyy);
  25799. yyyy8 = yyyy8.redIAdd(yyyy8);
  25800. yyyy8 = yyyy8.redIAdd(yyyy8);
  25801. // X3 = T
  25802. nx = t;
  25803. // Y3 = M * (S - T) - 8 * YYYY
  25804. ny = m.redMul(s.redISub(t)).redISub(yyyy8);
  25805. // Z3 = 2*Y1
  25806. nz = this.y.redAdd(this.y);
  25807. } else {
  25808. // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html
  25809. // #doubling-dbl-2009-l
  25810. // 2M + 5S + 13A
  25811. // A = X1^2
  25812. var a = this.x.redSqr();
  25813. // B = Y1^2
  25814. var b = this.y.redSqr();
  25815. // C = B^2
  25816. var c = b.redSqr();
  25817. // D = 2 * ((X1 + B)^2 - A - C)
  25818. var d = this.x.redAdd(b).redSqr().redISub(a).redISub(c);
  25819. d = d.redIAdd(d);
  25820. // E = 3 * A
  25821. var e = a.redAdd(a).redIAdd(a);
  25822. // F = E^2
  25823. var f = e.redSqr();
  25824. // 8 * C
  25825. var c8 = c.redIAdd(c);
  25826. c8 = c8.redIAdd(c8);
  25827. c8 = c8.redIAdd(c8);
  25828. // X3 = F - 2 * D
  25829. nx = f.redISub(d).redISub(d);
  25830. // Y3 = E * (D - X3) - 8 * C
  25831. ny = e.redMul(d.redISub(nx)).redISub(c8);
  25832. // Z3 = 2 * Y1 * Z1
  25833. nz = this.y.redMul(this.z);
  25834. nz = nz.redIAdd(nz);
  25835. }
  25836. return this.curve.jpoint(nx, ny, nz);
  25837. };
  25838. JPoint.prototype._threeDbl = function _threeDbl() {
  25839. var nx;
  25840. var ny;
  25841. var nz;
  25842. // Z = 1
  25843. if (this.zOne) {
  25844. // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html
  25845. // #doubling-mdbl-2007-bl
  25846. // 1M + 5S + 15A
  25847. // XX = X1^2
  25848. var xx = this.x.redSqr();
  25849. // YY = Y1^2
  25850. var yy = this.y.redSqr();
  25851. // YYYY = YY^2
  25852. var yyyy = yy.redSqr();
  25853. // S = 2 * ((X1 + YY)^2 - XX - YYYY)
  25854. var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);
  25855. s = s.redIAdd(s);
  25856. // M = 3 * XX + a
  25857. var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a);
  25858. // T = M^2 - 2 * S
  25859. var t = m.redSqr().redISub(s).redISub(s);
  25860. // X3 = T
  25861. nx = t;
  25862. // Y3 = M * (S - T) - 8 * YYYY
  25863. var yyyy8 = yyyy.redIAdd(yyyy);
  25864. yyyy8 = yyyy8.redIAdd(yyyy8);
  25865. yyyy8 = yyyy8.redIAdd(yyyy8);
  25866. ny = m.redMul(s.redISub(t)).redISub(yyyy8);
  25867. // Z3 = 2 * Y1
  25868. nz = this.y.redAdd(this.y);
  25869. } else {
  25870. // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b
  25871. // 3M + 5S
  25872. // delta = Z1^2
  25873. var delta = this.z.redSqr();
  25874. // gamma = Y1^2
  25875. var gamma = this.y.redSqr();
  25876. // beta = X1 * gamma
  25877. var beta = this.x.redMul(gamma);
  25878. // alpha = 3 * (X1 - delta) * (X1 + delta)
  25879. var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta));
  25880. alpha = alpha.redAdd(alpha).redIAdd(alpha);
  25881. // X3 = alpha^2 - 8 * beta
  25882. var beta4 = beta.redIAdd(beta);
  25883. beta4 = beta4.redIAdd(beta4);
  25884. var beta8 = beta4.redAdd(beta4);
  25885. nx = alpha.redSqr().redISub(beta8);
  25886. // Z3 = (Y1 + Z1)^2 - gamma - delta
  25887. nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);
  25888. // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2
  25889. var ggamma8 = gamma.redSqr();
  25890. ggamma8 = ggamma8.redIAdd(ggamma8);
  25891. ggamma8 = ggamma8.redIAdd(ggamma8);
  25892. ggamma8 = ggamma8.redIAdd(ggamma8);
  25893. ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8);
  25894. }
  25895. return this.curve.jpoint(nx, ny, nz);
  25896. };
  25897. JPoint.prototype._dbl = function _dbl() {
  25898. var a = this.curve.a;
  25899. // 4M + 6S + 10A
  25900. var jx = this.x;
  25901. var jy = this.y;
  25902. var jz = this.z;
  25903. var jz4 = jz.redSqr().redSqr();
  25904. var jx2 = jx.redSqr();
  25905. var jy2 = jy.redSqr();
  25906. var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));
  25907. var jxd4 = jx.redAdd(jx);
  25908. jxd4 = jxd4.redIAdd(jxd4);
  25909. var t1 = jxd4.redMul(jy2);
  25910. var nx = c.redSqr().redISub(t1.redAdd(t1));
  25911. var t2 = t1.redISub(nx);
  25912. var jyd8 = jy2.redSqr();
  25913. jyd8 = jyd8.redIAdd(jyd8);
  25914. jyd8 = jyd8.redIAdd(jyd8);
  25915. jyd8 = jyd8.redIAdd(jyd8);
  25916. var ny = c.redMul(t2).redISub(jyd8);
  25917. var nz = jy.redAdd(jy).redMul(jz);
  25918. return this.curve.jpoint(nx, ny, nz);
  25919. };
  25920. JPoint.prototype.trpl = function trpl() {
  25921. if (!this.curve.zeroA)
  25922. return this.dbl().add(this);
  25923. // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#tripling-tpl-2007-bl
  25924. // 5M + 10S + ...
  25925. // XX = X1^2
  25926. var xx = this.x.redSqr();
  25927. // YY = Y1^2
  25928. var yy = this.y.redSqr();
  25929. // ZZ = Z1^2
  25930. var zz = this.z.redSqr();
  25931. // YYYY = YY^2
  25932. var yyyy = yy.redSqr();
  25933. // M = 3 * XX + a * ZZ2; a = 0
  25934. var m = xx.redAdd(xx).redIAdd(xx);
  25935. // MM = M^2
  25936. var mm = m.redSqr();
  25937. // E = 6 * ((X1 + YY)^2 - XX - YYYY) - MM
  25938. var e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);
  25939. e = e.redIAdd(e);
  25940. e = e.redAdd(e).redIAdd(e);
  25941. e = e.redISub(mm);
  25942. // EE = E^2
  25943. var ee = e.redSqr();
  25944. // T = 16*YYYY
  25945. var t = yyyy.redIAdd(yyyy);
  25946. t = t.redIAdd(t);
  25947. t = t.redIAdd(t);
  25948. t = t.redIAdd(t);
  25949. // U = (M + E)^2 - MM - EE - T
  25950. var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t);
  25951. // X3 = 4 * (X1 * EE - 4 * YY * U)
  25952. var yyu4 = yy.redMul(u);
  25953. yyu4 = yyu4.redIAdd(yyu4);
  25954. yyu4 = yyu4.redIAdd(yyu4);
  25955. var nx = this.x.redMul(ee).redISub(yyu4);
  25956. nx = nx.redIAdd(nx);
  25957. nx = nx.redIAdd(nx);
  25958. // Y3 = 8 * Y1 * (U * (T - U) - E * EE)
  25959. var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee)));
  25960. ny = ny.redIAdd(ny);
  25961. ny = ny.redIAdd(ny);
  25962. ny = ny.redIAdd(ny);
  25963. // Z3 = (Z1 + E)^2 - ZZ - EE
  25964. var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee);
  25965. return this.curve.jpoint(nx, ny, nz);
  25966. };
  25967. JPoint.prototype.mul = function mul(k, kbase) {
  25968. k = new BN(k, kbase);
  25969. return this.curve._wnafMul(this, k);
  25970. };
  25971. JPoint.prototype.eq = function eq(p) {
  25972. if (p.type === 'affine')
  25973. return this.eq(p.toJ());
  25974. if (this === p)
  25975. return true;
  25976. // x1 * z2^2 == x2 * z1^2
  25977. var z2 = this.z.redSqr();
  25978. var pz2 = p.z.redSqr();
  25979. if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0)
  25980. return false;
  25981. // y1 * z2^3 == y2 * z1^3
  25982. var z3 = z2.redMul(this.z);
  25983. var pz3 = pz2.redMul(p.z);
  25984. return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0;
  25985. };
  25986. JPoint.prototype.eqXToP = function eqXToP(x) {
  25987. var zs = this.z.redSqr();
  25988. var rx = x.toRed(this.curve.red).redMul(zs);
  25989. if (this.x.cmp(rx) === 0)
  25990. return true;
  25991. var xc = x.clone();
  25992. var t = this.curve.redN.redMul(zs);
  25993. for (;;) {
  25994. xc.iadd(this.curve.n);
  25995. if (xc.cmp(this.curve.p) >= 0)
  25996. return false;
  25997. rx.redIAdd(t);
  25998. if (this.x.cmp(rx) === 0)
  25999. return true;
  26000. }
  26001. };
  26002. JPoint.prototype.inspect = function inspect() {
  26003. if (this.isInfinity())
  26004. return '<EC JPoint Infinity>';
  26005. return '<EC JPoint x: ' + this.x.toString(16, 2) +
  26006. ' y: ' + this.y.toString(16, 2) +
  26007. ' z: ' + this.z.toString(16, 2) + '>';
  26008. };
  26009. JPoint.prototype.isInfinity = function isInfinity() {
  26010. // XXX This code assumes that zero is always zero in red
  26011. return this.z.cmpn(0) === 0;
  26012. };
  26013. /***/ }),
  26014. /* 148 */
  26015. /*!**********************************************************!*\
  26016. !*** ./node_modules/elliptic/lib/elliptic/curve/mont.js ***!
  26017. \**********************************************************/
  26018. /*! no static exports found */
  26019. /***/ (function(module, exports, __webpack_require__) {
  26020. "use strict";
  26021. var BN = __webpack_require__(/*! bn.js */ 130);
  26022. var inherits = __webpack_require__(/*! inherits */ 54);
  26023. var Base = __webpack_require__(/*! ./base */ 146);
  26024. var utils = __webpack_require__(/*! ../utils */ 143);
  26025. function MontCurve(conf) {
  26026. Base.call(this, 'mont', conf);
  26027. this.a = new BN(conf.a, 16).toRed(this.red);
  26028. this.b = new BN(conf.b, 16).toRed(this.red);
  26029. this.i4 = new BN(4).toRed(this.red).redInvm();
  26030. this.two = new BN(2).toRed(this.red);
  26031. this.a24 = this.i4.redMul(this.a.redAdd(this.two));
  26032. }
  26033. inherits(MontCurve, Base);
  26034. module.exports = MontCurve;
  26035. MontCurve.prototype.validate = function validate(point) {
  26036. var x = point.normalize().x;
  26037. var x2 = x.redSqr();
  26038. var rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x);
  26039. var y = rhs.redSqrt();
  26040. return y.redSqr().cmp(rhs) === 0;
  26041. };
  26042. function Point(curve, x, z) {
  26043. Base.BasePoint.call(this, curve, 'projective');
  26044. if (x === null && z === null) {
  26045. this.x = this.curve.one;
  26046. this.z = this.curve.zero;
  26047. } else {
  26048. this.x = new BN(x, 16);
  26049. this.z = new BN(z, 16);
  26050. if (!this.x.red)
  26051. this.x = this.x.toRed(this.curve.red);
  26052. if (!this.z.red)
  26053. this.z = this.z.toRed(this.curve.red);
  26054. }
  26055. }
  26056. inherits(Point, Base.BasePoint);
  26057. MontCurve.prototype.decodePoint = function decodePoint(bytes, enc) {
  26058. return this.point(utils.toArray(bytes, enc), 1);
  26059. };
  26060. MontCurve.prototype.point = function point(x, z) {
  26061. return new Point(this, x, z);
  26062. };
  26063. MontCurve.prototype.pointFromJSON = function pointFromJSON(obj) {
  26064. return Point.fromJSON(this, obj);
  26065. };
  26066. Point.prototype.precompute = function precompute() {
  26067. // No-op
  26068. };
  26069. Point.prototype._encode = function _encode() {
  26070. return this.getX().toArray('be', this.curve.p.byteLength());
  26071. };
  26072. Point.fromJSON = function fromJSON(curve, obj) {
  26073. return new Point(curve, obj[0], obj[1] || curve.one);
  26074. };
  26075. Point.prototype.inspect = function inspect() {
  26076. if (this.isInfinity())
  26077. return '<EC Point Infinity>';
  26078. return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +
  26079. ' z: ' + this.z.fromRed().toString(16, 2) + '>';
  26080. };
  26081. Point.prototype.isInfinity = function isInfinity() {
  26082. // XXX This code assumes that zero is always zero in red
  26083. return this.z.cmpn(0) === 0;
  26084. };
  26085. Point.prototype.dbl = function dbl() {
  26086. // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#doubling-dbl-1987-m-3
  26087. // 2M + 2S + 4A
  26088. // A = X1 + Z1
  26089. var a = this.x.redAdd(this.z);
  26090. // AA = A^2
  26091. var aa = a.redSqr();
  26092. // B = X1 - Z1
  26093. var b = this.x.redSub(this.z);
  26094. // BB = B^2
  26095. var bb = b.redSqr();
  26096. // C = AA - BB
  26097. var c = aa.redSub(bb);
  26098. // X3 = AA * BB
  26099. var nx = aa.redMul(bb);
  26100. // Z3 = C * (BB + A24 * C)
  26101. var nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c)));
  26102. return this.curve.point(nx, nz);
  26103. };
  26104. Point.prototype.add = function add() {
  26105. throw new Error('Not supported on Montgomery curve');
  26106. };
  26107. Point.prototype.diffAdd = function diffAdd(p, diff) {
  26108. // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#diffadd-dadd-1987-m-3
  26109. // 4M + 2S + 6A
  26110. // A = X2 + Z2
  26111. var a = this.x.redAdd(this.z);
  26112. // B = X2 - Z2
  26113. var b = this.x.redSub(this.z);
  26114. // C = X3 + Z3
  26115. var c = p.x.redAdd(p.z);
  26116. // D = X3 - Z3
  26117. var d = p.x.redSub(p.z);
  26118. // DA = D * A
  26119. var da = d.redMul(a);
  26120. // CB = C * B
  26121. var cb = c.redMul(b);
  26122. // X5 = Z1 * (DA + CB)^2
  26123. var nx = diff.z.redMul(da.redAdd(cb).redSqr());
  26124. // Z5 = X1 * (DA - CB)^2
  26125. var nz = diff.x.redMul(da.redISub(cb).redSqr());
  26126. return this.curve.point(nx, nz);
  26127. };
  26128. Point.prototype.mul = function mul(k) {
  26129. var t = k.clone();
  26130. var a = this; // (N / 2) * Q + Q
  26131. var b = this.curve.point(null, null); // (N / 2) * Q
  26132. var c = this; // Q
  26133. for (var bits = []; t.cmpn(0) !== 0; t.iushrn(1))
  26134. bits.push(t.andln(1));
  26135. for (var i = bits.length - 1; i >= 0; i--) {
  26136. if (bits[i] === 0) {
  26137. // N * Q + Q = ((N / 2) * Q + Q)) + (N / 2) * Q
  26138. a = a.diffAdd(b, c);
  26139. // N * Q = 2 * ((N / 2) * Q + Q))
  26140. b = b.dbl();
  26141. } else {
  26142. // N * Q = ((N / 2) * Q + Q) + ((N / 2) * Q)
  26143. b = a.diffAdd(b, c);
  26144. // N * Q + Q = 2 * ((N / 2) * Q + Q)
  26145. a = a.dbl();
  26146. }
  26147. }
  26148. return b;
  26149. };
  26150. Point.prototype.mulAdd = function mulAdd() {
  26151. throw new Error('Not supported on Montgomery curve');
  26152. };
  26153. Point.prototype.jumlAdd = function jumlAdd() {
  26154. throw new Error('Not supported on Montgomery curve');
  26155. };
  26156. Point.prototype.eq = function eq(other) {
  26157. return this.getX().cmp(other.getX()) === 0;
  26158. };
  26159. Point.prototype.normalize = function normalize() {
  26160. this.x = this.x.redMul(this.z.redInvm());
  26161. this.z = this.curve.one;
  26162. return this;
  26163. };
  26164. Point.prototype.getX = function getX() {
  26165. // Normalize coordinates
  26166. this.normalize();
  26167. return this.x.fromRed();
  26168. };
  26169. /***/ }),
  26170. /* 149 */
  26171. /*!*************************************************************!*\
  26172. !*** ./node_modules/elliptic/lib/elliptic/curve/edwards.js ***!
  26173. \*************************************************************/
  26174. /*! no static exports found */
  26175. /***/ (function(module, exports, __webpack_require__) {
  26176. "use strict";
  26177. var utils = __webpack_require__(/*! ../utils */ 143);
  26178. var BN = __webpack_require__(/*! bn.js */ 130);
  26179. var inherits = __webpack_require__(/*! inherits */ 54);
  26180. var Base = __webpack_require__(/*! ./base */ 146);
  26181. var assert = utils.assert;
  26182. function EdwardsCurve(conf) {
  26183. // NOTE: Important as we are creating point in Base.call()
  26184. this.twisted = (conf.a | 0) !== 1;
  26185. this.mOneA = this.twisted && (conf.a | 0) === -1;
  26186. this.extended = this.mOneA;
  26187. Base.call(this, 'edwards', conf);
  26188. this.a = new BN(conf.a, 16).umod(this.red.m);
  26189. this.a = this.a.toRed(this.red);
  26190. this.c = new BN(conf.c, 16).toRed(this.red);
  26191. this.c2 = this.c.redSqr();
  26192. this.d = new BN(conf.d, 16).toRed(this.red);
  26193. this.dd = this.d.redAdd(this.d);
  26194. assert(!this.twisted || this.c.fromRed().cmpn(1) === 0);
  26195. this.oneC = (conf.c | 0) === 1;
  26196. }
  26197. inherits(EdwardsCurve, Base);
  26198. module.exports = EdwardsCurve;
  26199. EdwardsCurve.prototype._mulA = function _mulA(num) {
  26200. if (this.mOneA)
  26201. return num.redNeg();
  26202. else
  26203. return this.a.redMul(num);
  26204. };
  26205. EdwardsCurve.prototype._mulC = function _mulC(num) {
  26206. if (this.oneC)
  26207. return num;
  26208. else
  26209. return this.c.redMul(num);
  26210. };
  26211. // Just for compatibility with Short curve
  26212. EdwardsCurve.prototype.jpoint = function jpoint(x, y, z, t) {
  26213. return this.point(x, y, z, t);
  26214. };
  26215. EdwardsCurve.prototype.pointFromX = function pointFromX(x, odd) {
  26216. x = new BN(x, 16);
  26217. if (!x.red)
  26218. x = x.toRed(this.red);
  26219. var x2 = x.redSqr();
  26220. var rhs = this.c2.redSub(this.a.redMul(x2));
  26221. var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2));
  26222. var y2 = rhs.redMul(lhs.redInvm());
  26223. var y = y2.redSqrt();
  26224. if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)
  26225. throw new Error('invalid point');
  26226. var isOdd = y.fromRed().isOdd();
  26227. if (odd && !isOdd || !odd && isOdd)
  26228. y = y.redNeg();
  26229. return this.point(x, y);
  26230. };
  26231. EdwardsCurve.prototype.pointFromY = function pointFromY(y, odd) {
  26232. y = new BN(y, 16);
  26233. if (!y.red)
  26234. y = y.toRed(this.red);
  26235. // x^2 = (y^2 - c^2) / (c^2 d y^2 - a)
  26236. var y2 = y.redSqr();
  26237. var lhs = y2.redSub(this.c2);
  26238. var rhs = y2.redMul(this.d).redMul(this.c2).redSub(this.a);
  26239. var x2 = lhs.redMul(rhs.redInvm());
  26240. if (x2.cmp(this.zero) === 0) {
  26241. if (odd)
  26242. throw new Error('invalid point');
  26243. else
  26244. return this.point(this.zero, y);
  26245. }
  26246. var x = x2.redSqrt();
  26247. if (x.redSqr().redSub(x2).cmp(this.zero) !== 0)
  26248. throw new Error('invalid point');
  26249. if (x.fromRed().isOdd() !== odd)
  26250. x = x.redNeg();
  26251. return this.point(x, y);
  26252. };
  26253. EdwardsCurve.prototype.validate = function validate(point) {
  26254. if (point.isInfinity())
  26255. return true;
  26256. // Curve: A * X^2 + Y^2 = C^2 * (1 + D * X^2 * Y^2)
  26257. point.normalize();
  26258. var x2 = point.x.redSqr();
  26259. var y2 = point.y.redSqr();
  26260. var lhs = x2.redMul(this.a).redAdd(y2);
  26261. var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2)));
  26262. return lhs.cmp(rhs) === 0;
  26263. };
  26264. function Point(curve, x, y, z, t) {
  26265. Base.BasePoint.call(this, curve, 'projective');
  26266. if (x === null && y === null && z === null) {
  26267. this.x = this.curve.zero;
  26268. this.y = this.curve.one;
  26269. this.z = this.curve.one;
  26270. this.t = this.curve.zero;
  26271. this.zOne = true;
  26272. } else {
  26273. this.x = new BN(x, 16);
  26274. this.y = new BN(y, 16);
  26275. this.z = z ? new BN(z, 16) : this.curve.one;
  26276. this.t = t && new BN(t, 16);
  26277. if (!this.x.red)
  26278. this.x = this.x.toRed(this.curve.red);
  26279. if (!this.y.red)
  26280. this.y = this.y.toRed(this.curve.red);
  26281. if (!this.z.red)
  26282. this.z = this.z.toRed(this.curve.red);
  26283. if (this.t && !this.t.red)
  26284. this.t = this.t.toRed(this.curve.red);
  26285. this.zOne = this.z === this.curve.one;
  26286. // Use extended coordinates
  26287. if (this.curve.extended && !this.t) {
  26288. this.t = this.x.redMul(this.y);
  26289. if (!this.zOne)
  26290. this.t = this.t.redMul(this.z.redInvm());
  26291. }
  26292. }
  26293. }
  26294. inherits(Point, Base.BasePoint);
  26295. EdwardsCurve.prototype.pointFromJSON = function pointFromJSON(obj) {
  26296. return Point.fromJSON(this, obj);
  26297. };
  26298. EdwardsCurve.prototype.point = function point(x, y, z, t) {
  26299. return new Point(this, x, y, z, t);
  26300. };
  26301. Point.fromJSON = function fromJSON(curve, obj) {
  26302. return new Point(curve, obj[0], obj[1], obj[2]);
  26303. };
  26304. Point.prototype.inspect = function inspect() {
  26305. if (this.isInfinity())
  26306. return '<EC Point Infinity>';
  26307. return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +
  26308. ' y: ' + this.y.fromRed().toString(16, 2) +
  26309. ' z: ' + this.z.fromRed().toString(16, 2) + '>';
  26310. };
  26311. Point.prototype.isInfinity = function isInfinity() {
  26312. // XXX This code assumes that zero is always zero in red
  26313. return this.x.cmpn(0) === 0 &&
  26314. (this.y.cmp(this.z) === 0 ||
  26315. (this.zOne && this.y.cmp(this.curve.c) === 0));
  26316. };
  26317. Point.prototype._extDbl = function _extDbl() {
  26318. // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html
  26319. // #doubling-dbl-2008-hwcd
  26320. // 4M + 4S
  26321. // A = X1^2
  26322. var a = this.x.redSqr();
  26323. // B = Y1^2
  26324. var b = this.y.redSqr();
  26325. // C = 2 * Z1^2
  26326. var c = this.z.redSqr();
  26327. c = c.redIAdd(c);
  26328. // D = a * A
  26329. var d = this.curve._mulA(a);
  26330. // E = (X1 + Y1)^2 - A - B
  26331. var e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b);
  26332. // G = D + B
  26333. var g = d.redAdd(b);
  26334. // F = G - C
  26335. var f = g.redSub(c);
  26336. // H = D - B
  26337. var h = d.redSub(b);
  26338. // X3 = E * F
  26339. var nx = e.redMul(f);
  26340. // Y3 = G * H
  26341. var ny = g.redMul(h);
  26342. // T3 = E * H
  26343. var nt = e.redMul(h);
  26344. // Z3 = F * G
  26345. var nz = f.redMul(g);
  26346. return this.curve.point(nx, ny, nz, nt);
  26347. };
  26348. Point.prototype._projDbl = function _projDbl() {
  26349. // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html
  26350. // #doubling-dbl-2008-bbjlp
  26351. // #doubling-dbl-2007-bl
  26352. // and others
  26353. // Generally 3M + 4S or 2M + 4S
  26354. // B = (X1 + Y1)^2
  26355. var b = this.x.redAdd(this.y).redSqr();
  26356. // C = X1^2
  26357. var c = this.x.redSqr();
  26358. // D = Y1^2
  26359. var d = this.y.redSqr();
  26360. var nx;
  26361. var ny;
  26362. var nz;
  26363. if (this.curve.twisted) {
  26364. // E = a * C
  26365. var e = this.curve._mulA(c);
  26366. // F = E + D
  26367. var f = e.redAdd(d);
  26368. if (this.zOne) {
  26369. // X3 = (B - C - D) * (F - 2)
  26370. nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two));
  26371. // Y3 = F * (E - D)
  26372. ny = f.redMul(e.redSub(d));
  26373. // Z3 = F^2 - 2 * F
  26374. nz = f.redSqr().redSub(f).redSub(f);
  26375. } else {
  26376. // H = Z1^2
  26377. var h = this.z.redSqr();
  26378. // J = F - 2 * H
  26379. var j = f.redSub(h).redISub(h);
  26380. // X3 = (B-C-D)*J
  26381. nx = b.redSub(c).redISub(d).redMul(j);
  26382. // Y3 = F * (E - D)
  26383. ny = f.redMul(e.redSub(d));
  26384. // Z3 = F * J
  26385. nz = f.redMul(j);
  26386. }
  26387. } else {
  26388. // E = C + D
  26389. var e = c.redAdd(d);
  26390. // H = (c * Z1)^2
  26391. var h = this.curve._mulC(this.z).redSqr();
  26392. // J = E - 2 * H
  26393. var j = e.redSub(h).redSub(h);
  26394. // X3 = c * (B - E) * J
  26395. nx = this.curve._mulC(b.redISub(e)).redMul(j);
  26396. // Y3 = c * E * (C - D)
  26397. ny = this.curve._mulC(e).redMul(c.redISub(d));
  26398. // Z3 = E * J
  26399. nz = e.redMul(j);
  26400. }
  26401. return this.curve.point(nx, ny, nz);
  26402. };
  26403. Point.prototype.dbl = function dbl() {
  26404. if (this.isInfinity())
  26405. return this;
  26406. // Double in extended coordinates
  26407. if (this.curve.extended)
  26408. return this._extDbl();
  26409. else
  26410. return this._projDbl();
  26411. };
  26412. Point.prototype._extAdd = function _extAdd(p) {
  26413. // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html
  26414. // #addition-add-2008-hwcd-3
  26415. // 8M
  26416. // A = (Y1 - X1) * (Y2 - X2)
  26417. var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x));
  26418. // B = (Y1 + X1) * (Y2 + X2)
  26419. var b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x));
  26420. // C = T1 * k * T2
  26421. var c = this.t.redMul(this.curve.dd).redMul(p.t);
  26422. // D = Z1 * 2 * Z2
  26423. var d = this.z.redMul(p.z.redAdd(p.z));
  26424. // E = B - A
  26425. var e = b.redSub(a);
  26426. // F = D - C
  26427. var f = d.redSub(c);
  26428. // G = D + C
  26429. var g = d.redAdd(c);
  26430. // H = B + A
  26431. var h = b.redAdd(a);
  26432. // X3 = E * F
  26433. var nx = e.redMul(f);
  26434. // Y3 = G * H
  26435. var ny = g.redMul(h);
  26436. // T3 = E * H
  26437. var nt = e.redMul(h);
  26438. // Z3 = F * G
  26439. var nz = f.redMul(g);
  26440. return this.curve.point(nx, ny, nz, nt);
  26441. };
  26442. Point.prototype._projAdd = function _projAdd(p) {
  26443. // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html
  26444. // #addition-add-2008-bbjlp
  26445. // #addition-add-2007-bl
  26446. // 10M + 1S
  26447. // A = Z1 * Z2
  26448. var a = this.z.redMul(p.z);
  26449. // B = A^2
  26450. var b = a.redSqr();
  26451. // C = X1 * X2
  26452. var c = this.x.redMul(p.x);
  26453. // D = Y1 * Y2
  26454. var d = this.y.redMul(p.y);
  26455. // E = d * C * D
  26456. var e = this.curve.d.redMul(c).redMul(d);
  26457. // F = B - E
  26458. var f = b.redSub(e);
  26459. // G = B + E
  26460. var g = b.redAdd(e);
  26461. // X3 = A * F * ((X1 + Y1) * (X2 + Y2) - C - D)
  26462. var tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d);
  26463. var nx = a.redMul(f).redMul(tmp);
  26464. var ny;
  26465. var nz;
  26466. if (this.curve.twisted) {
  26467. // Y3 = A * G * (D - a * C)
  26468. ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c)));
  26469. // Z3 = F * G
  26470. nz = f.redMul(g);
  26471. } else {
  26472. // Y3 = A * G * (D - C)
  26473. ny = a.redMul(g).redMul(d.redSub(c));
  26474. // Z3 = c * F * G
  26475. nz = this.curve._mulC(f).redMul(g);
  26476. }
  26477. return this.curve.point(nx, ny, nz);
  26478. };
  26479. Point.prototype.add = function add(p) {
  26480. if (this.isInfinity())
  26481. return p;
  26482. if (p.isInfinity())
  26483. return this;
  26484. if (this.curve.extended)
  26485. return this._extAdd(p);
  26486. else
  26487. return this._projAdd(p);
  26488. };
  26489. Point.prototype.mul = function mul(k) {
  26490. if (this._hasDoubles(k))
  26491. return this.curve._fixedNafMul(this, k);
  26492. else
  26493. return this.curve._wnafMul(this, k);
  26494. };
  26495. Point.prototype.mulAdd = function mulAdd(k1, p, k2) {
  26496. return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, false);
  26497. };
  26498. Point.prototype.jmulAdd = function jmulAdd(k1, p, k2) {
  26499. return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, true);
  26500. };
  26501. Point.prototype.normalize = function normalize() {
  26502. if (this.zOne)
  26503. return this;
  26504. // Normalize coordinates
  26505. var zi = this.z.redInvm();
  26506. this.x = this.x.redMul(zi);
  26507. this.y = this.y.redMul(zi);
  26508. if (this.t)
  26509. this.t = this.t.redMul(zi);
  26510. this.z = this.curve.one;
  26511. this.zOne = true;
  26512. return this;
  26513. };
  26514. Point.prototype.neg = function neg() {
  26515. return this.curve.point(this.x.redNeg(),
  26516. this.y,
  26517. this.z,
  26518. this.t && this.t.redNeg());
  26519. };
  26520. Point.prototype.getX = function getX() {
  26521. this.normalize();
  26522. return this.x.fromRed();
  26523. };
  26524. Point.prototype.getY = function getY() {
  26525. this.normalize();
  26526. return this.y.fromRed();
  26527. };
  26528. Point.prototype.eq = function eq(other) {
  26529. return this === other ||
  26530. this.getX().cmp(other.getX()) === 0 &&
  26531. this.getY().cmp(other.getY()) === 0;
  26532. };
  26533. Point.prototype.eqXToP = function eqXToP(x) {
  26534. var rx = x.toRed(this.curve.red).redMul(this.z);
  26535. if (this.x.cmp(rx) === 0)
  26536. return true;
  26537. var xc = x.clone();
  26538. var t = this.curve.redN.redMul(this.z);
  26539. for (;;) {
  26540. xc.iadd(this.curve.n);
  26541. if (xc.cmp(this.curve.p) >= 0)
  26542. return false;
  26543. rx.redIAdd(t);
  26544. if (this.x.cmp(rx) === 0)
  26545. return true;
  26546. }
  26547. };
  26548. // Compatibility with BaseCurve
  26549. Point.prototype.toP = Point.prototype.normalize;
  26550. Point.prototype.mixedAdd = Point.prototype.add;
  26551. /***/ }),
  26552. /* 150 */
  26553. /*!******************************************************!*\
  26554. !*** ./node_modules/elliptic/lib/elliptic/curves.js ***!
  26555. \******************************************************/
  26556. /*! no static exports found */
  26557. /***/ (function(module, exports, __webpack_require__) {
  26558. "use strict";
  26559. var curves = exports;
  26560. var hash = __webpack_require__(/*! hash.js */ 151);
  26561. var curve = __webpack_require__(/*! ./curve */ 145);
  26562. var utils = __webpack_require__(/*! ./utils */ 143);
  26563. var assert = utils.assert;
  26564. function PresetCurve(options) {
  26565. if (options.type === 'short')
  26566. this.curve = new curve.short(options);
  26567. else if (options.type === 'edwards')
  26568. this.curve = new curve.edwards(options);
  26569. else
  26570. this.curve = new curve.mont(options);
  26571. this.g = this.curve.g;
  26572. this.n = this.curve.n;
  26573. this.hash = options.hash;
  26574. assert(this.g.validate(), 'Invalid curve');
  26575. assert(this.g.mul(this.n).isInfinity(), 'Invalid curve, G*N != O');
  26576. }
  26577. curves.PresetCurve = PresetCurve;
  26578. function defineCurve(name, options) {
  26579. Object.defineProperty(curves, name, {
  26580. configurable: true,
  26581. enumerable: true,
  26582. get: function() {
  26583. var curve = new PresetCurve(options);
  26584. Object.defineProperty(curves, name, {
  26585. configurable: true,
  26586. enumerable: true,
  26587. value: curve
  26588. });
  26589. return curve;
  26590. }
  26591. });
  26592. }
  26593. defineCurve('p192', {
  26594. type: 'short',
  26595. prime: 'p192',
  26596. p: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff',
  26597. a: 'ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc',
  26598. b: '64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1',
  26599. n: 'ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831',
  26600. hash: hash.sha256,
  26601. gRed: false,
  26602. g: [
  26603. '188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012',
  26604. '07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811'
  26605. ]
  26606. });
  26607. defineCurve('p224', {
  26608. type: 'short',
  26609. prime: 'p224',
  26610. p: 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001',
  26611. a: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe',
  26612. b: 'b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4',
  26613. n: 'ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d',
  26614. hash: hash.sha256,
  26615. gRed: false,
  26616. g: [
  26617. 'b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21',
  26618. 'bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34'
  26619. ]
  26620. });
  26621. defineCurve('p256', {
  26622. type: 'short',
  26623. prime: null,
  26624. p: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff',
  26625. a: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc',
  26626. b: '5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b',
  26627. n: 'ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551',
  26628. hash: hash.sha256,
  26629. gRed: false,
  26630. g: [
  26631. '6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296',
  26632. '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5'
  26633. ]
  26634. });
  26635. defineCurve('p384', {
  26636. type: 'short',
  26637. prime: null,
  26638. p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  26639. 'fffffffe ffffffff 00000000 00000000 ffffffff',
  26640. a: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  26641. 'fffffffe ffffffff 00000000 00000000 fffffffc',
  26642. b: 'b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f ' +
  26643. '5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef',
  26644. n: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 ' +
  26645. 'f4372ddf 581a0db2 48b0a77a ecec196a ccc52973',
  26646. hash: hash.sha384,
  26647. gRed: false,
  26648. g: [
  26649. 'aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 ' +
  26650. '5502f25d bf55296c 3a545e38 72760ab7',
  26651. '3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 ' +
  26652. '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f'
  26653. ]
  26654. });
  26655. defineCurve('p521', {
  26656. type: 'short',
  26657. prime: null,
  26658. p: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  26659. 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  26660. 'ffffffff ffffffff ffffffff ffffffff ffffffff',
  26661. a: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  26662. 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  26663. 'ffffffff ffffffff ffffffff ffffffff fffffffc',
  26664. b: '00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b ' +
  26665. '99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd ' +
  26666. '3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00',
  26667. n: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  26668. 'ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 ' +
  26669. 'f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409',
  26670. hash: hash.sha512,
  26671. gRed: false,
  26672. g: [
  26673. '000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 ' +
  26674. '053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 ' +
  26675. 'a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66',
  26676. '00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 ' +
  26677. '579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 ' +
  26678. '3fad0761 353c7086 a272c240 88be9476 9fd16650'
  26679. ]
  26680. });
  26681. defineCurve('curve25519', {
  26682. type: 'mont',
  26683. prime: 'p25519',
  26684. p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',
  26685. a: '76d06',
  26686. b: '1',
  26687. n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',
  26688. hash: hash.sha256,
  26689. gRed: false,
  26690. g: [
  26691. '9'
  26692. ]
  26693. });
  26694. defineCurve('ed25519', {
  26695. type: 'edwards',
  26696. prime: 'p25519',
  26697. p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',
  26698. a: '-1',
  26699. c: '1',
  26700. // -121665 * (121666^(-1)) (mod P)
  26701. d: '52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3',
  26702. n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',
  26703. hash: hash.sha256,
  26704. gRed: false,
  26705. g: [
  26706. '216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a',
  26707. // 4/5
  26708. '6666666666666666666666666666666666666666666666666666666666666658'
  26709. ]
  26710. });
  26711. var pre;
  26712. try {
  26713. pre = __webpack_require__(/*! ./precomputed/secp256k1 */ 163);
  26714. } catch (e) {
  26715. pre = undefined;
  26716. }
  26717. defineCurve('secp256k1', {
  26718. type: 'short',
  26719. prime: 'k256',
  26720. p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f',
  26721. a: '0',
  26722. b: '7',
  26723. n: 'ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141',
  26724. h: '1',
  26725. hash: hash.sha256,
  26726. // Precomputed endomorphism
  26727. beta: '7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee',
  26728. lambda: '5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72',
  26729. basis: [
  26730. {
  26731. a: '3086d221a7d46bcde86c90e49284eb15',
  26732. b: '-e4437ed6010e88286f547fa90abfe4c3'
  26733. },
  26734. {
  26735. a: '114ca50f7a8e2f3f657c1108d9d44cfd8',
  26736. b: '3086d221a7d46bcde86c90e49284eb15'
  26737. }
  26738. ],
  26739. gRed: false,
  26740. g: [
  26741. '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798',
  26742. '483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8',
  26743. pre
  26744. ]
  26745. });
  26746. /***/ }),
  26747. /* 151 */
  26748. /*!******************************************!*\
  26749. !*** ./node_modules/hash.js/lib/hash.js ***!
  26750. \******************************************/
  26751. /*! no static exports found */
  26752. /***/ (function(module, exports, __webpack_require__) {
  26753. var hash = exports;
  26754. hash.utils = __webpack_require__(/*! ./hash/utils */ 152);
  26755. hash.common = __webpack_require__(/*! ./hash/common */ 153);
  26756. hash.sha = __webpack_require__(/*! ./hash/sha */ 154);
  26757. hash.ripemd = __webpack_require__(/*! ./hash/ripemd */ 161);
  26758. hash.hmac = __webpack_require__(/*! ./hash/hmac */ 162);
  26759. // Proxy hash functions to the main object
  26760. hash.sha1 = hash.sha.sha1;
  26761. hash.sha256 = hash.sha.sha256;
  26762. hash.sha224 = hash.sha.sha224;
  26763. hash.sha384 = hash.sha.sha384;
  26764. hash.sha512 = hash.sha.sha512;
  26765. hash.ripemd160 = hash.ripemd.ripemd160;
  26766. /***/ }),
  26767. /* 152 */
  26768. /*!************************************************!*\
  26769. !*** ./node_modules/hash.js/lib/hash/utils.js ***!
  26770. \************************************************/
  26771. /*! no static exports found */
  26772. /***/ (function(module, exports, __webpack_require__) {
  26773. "use strict";
  26774. var assert = __webpack_require__(/*! minimalistic-assert */ 104);
  26775. var inherits = __webpack_require__(/*! inherits */ 54);
  26776. exports.inherits = inherits;
  26777. function isSurrogatePair(msg, i) {
  26778. if ((msg.charCodeAt(i) & 0xFC00) !== 0xD800) {
  26779. return false;
  26780. }
  26781. if (i < 0 || i + 1 >= msg.length) {
  26782. return false;
  26783. }
  26784. return (msg.charCodeAt(i + 1) & 0xFC00) === 0xDC00;
  26785. }
  26786. function toArray(msg, enc) {
  26787. if (Array.isArray(msg))
  26788. return msg.slice();
  26789. if (!msg)
  26790. return [];
  26791. var res = [];
  26792. if (typeof msg === 'string') {
  26793. if (!enc) {
  26794. // Inspired by stringToUtf8ByteArray() in closure-library by Google
  26795. // https://github.com/google/closure-library/blob/8598d87242af59aac233270742c8984e2b2bdbe0/closure/goog/crypt/crypt.js#L117-L143
  26796. // Apache License 2.0
  26797. // https://github.com/google/closure-library/blob/master/LICENSE
  26798. var p = 0;
  26799. for (var i = 0; i < msg.length; i++) {
  26800. var c = msg.charCodeAt(i);
  26801. if (c < 128) {
  26802. res[p++] = c;
  26803. } else if (c < 2048) {
  26804. res[p++] = (c >> 6) | 192;
  26805. res[p++] = (c & 63) | 128;
  26806. } else if (isSurrogatePair(msg, i)) {
  26807. c = 0x10000 + ((c & 0x03FF) << 10) + (msg.charCodeAt(++i) & 0x03FF);
  26808. res[p++] = (c >> 18) | 240;
  26809. res[p++] = ((c >> 12) & 63) | 128;
  26810. res[p++] = ((c >> 6) & 63) | 128;
  26811. res[p++] = (c & 63) | 128;
  26812. } else {
  26813. res[p++] = (c >> 12) | 224;
  26814. res[p++] = ((c >> 6) & 63) | 128;
  26815. res[p++] = (c & 63) | 128;
  26816. }
  26817. }
  26818. } else if (enc === 'hex') {
  26819. msg = msg.replace(/[^a-z0-9]+/ig, '');
  26820. if (msg.length % 2 !== 0)
  26821. msg = '0' + msg;
  26822. for (i = 0; i < msg.length; i += 2)
  26823. res.push(parseInt(msg[i] + msg[i + 1], 16));
  26824. }
  26825. } else {
  26826. for (i = 0; i < msg.length; i++)
  26827. res[i] = msg[i] | 0;
  26828. }
  26829. return res;
  26830. }
  26831. exports.toArray = toArray;
  26832. function toHex(msg) {
  26833. var res = '';
  26834. for (var i = 0; i < msg.length; i++)
  26835. res += zero2(msg[i].toString(16));
  26836. return res;
  26837. }
  26838. exports.toHex = toHex;
  26839. function htonl(w) {
  26840. var res = (w >>> 24) |
  26841. ((w >>> 8) & 0xff00) |
  26842. ((w << 8) & 0xff0000) |
  26843. ((w & 0xff) << 24);
  26844. return res >>> 0;
  26845. }
  26846. exports.htonl = htonl;
  26847. function toHex32(msg, endian) {
  26848. var res = '';
  26849. for (var i = 0; i < msg.length; i++) {
  26850. var w = msg[i];
  26851. if (endian === 'little')
  26852. w = htonl(w);
  26853. res += zero8(w.toString(16));
  26854. }
  26855. return res;
  26856. }
  26857. exports.toHex32 = toHex32;
  26858. function zero2(word) {
  26859. if (word.length === 1)
  26860. return '0' + word;
  26861. else
  26862. return word;
  26863. }
  26864. exports.zero2 = zero2;
  26865. function zero8(word) {
  26866. if (word.length === 7)
  26867. return '0' + word;
  26868. else if (word.length === 6)
  26869. return '00' + word;
  26870. else if (word.length === 5)
  26871. return '000' + word;
  26872. else if (word.length === 4)
  26873. return '0000' + word;
  26874. else if (word.length === 3)
  26875. return '00000' + word;
  26876. else if (word.length === 2)
  26877. return '000000' + word;
  26878. else if (word.length === 1)
  26879. return '0000000' + word;
  26880. else
  26881. return word;
  26882. }
  26883. exports.zero8 = zero8;
  26884. function join32(msg, start, end, endian) {
  26885. var len = end - start;
  26886. assert(len % 4 === 0);
  26887. var res = new Array(len / 4);
  26888. for (var i = 0, k = start; i < res.length; i++, k += 4) {
  26889. var w;
  26890. if (endian === 'big')
  26891. w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3];
  26892. else
  26893. w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k];
  26894. res[i] = w >>> 0;
  26895. }
  26896. return res;
  26897. }
  26898. exports.join32 = join32;
  26899. function split32(msg, endian) {
  26900. var res = new Array(msg.length * 4);
  26901. for (var i = 0, k = 0; i < msg.length; i++, k += 4) {
  26902. var m = msg[i];
  26903. if (endian === 'big') {
  26904. res[k] = m >>> 24;
  26905. res[k + 1] = (m >>> 16) & 0xff;
  26906. res[k + 2] = (m >>> 8) & 0xff;
  26907. res[k + 3] = m & 0xff;
  26908. } else {
  26909. res[k + 3] = m >>> 24;
  26910. res[k + 2] = (m >>> 16) & 0xff;
  26911. res[k + 1] = (m >>> 8) & 0xff;
  26912. res[k] = m & 0xff;
  26913. }
  26914. }
  26915. return res;
  26916. }
  26917. exports.split32 = split32;
  26918. function rotr32(w, b) {
  26919. return (w >>> b) | (w << (32 - b));
  26920. }
  26921. exports.rotr32 = rotr32;
  26922. function rotl32(w, b) {
  26923. return (w << b) | (w >>> (32 - b));
  26924. }
  26925. exports.rotl32 = rotl32;
  26926. function sum32(a, b) {
  26927. return (a + b) >>> 0;
  26928. }
  26929. exports.sum32 = sum32;
  26930. function sum32_3(a, b, c) {
  26931. return (a + b + c) >>> 0;
  26932. }
  26933. exports.sum32_3 = sum32_3;
  26934. function sum32_4(a, b, c, d) {
  26935. return (a + b + c + d) >>> 0;
  26936. }
  26937. exports.sum32_4 = sum32_4;
  26938. function sum32_5(a, b, c, d, e) {
  26939. return (a + b + c + d + e) >>> 0;
  26940. }
  26941. exports.sum32_5 = sum32_5;
  26942. function sum64(buf, pos, ah, al) {
  26943. var bh = buf[pos];
  26944. var bl = buf[pos + 1];
  26945. var lo = (al + bl) >>> 0;
  26946. var hi = (lo < al ? 1 : 0) + ah + bh;
  26947. buf[pos] = hi >>> 0;
  26948. buf[pos + 1] = lo;
  26949. }
  26950. exports.sum64 = sum64;
  26951. function sum64_hi(ah, al, bh, bl) {
  26952. var lo = (al + bl) >>> 0;
  26953. var hi = (lo < al ? 1 : 0) + ah + bh;
  26954. return hi >>> 0;
  26955. }
  26956. exports.sum64_hi = sum64_hi;
  26957. function sum64_lo(ah, al, bh, bl) {
  26958. var lo = al + bl;
  26959. return lo >>> 0;
  26960. }
  26961. exports.sum64_lo = sum64_lo;
  26962. function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {
  26963. var carry = 0;
  26964. var lo = al;
  26965. lo = (lo + bl) >>> 0;
  26966. carry += lo < al ? 1 : 0;
  26967. lo = (lo + cl) >>> 0;
  26968. carry += lo < cl ? 1 : 0;
  26969. lo = (lo + dl) >>> 0;
  26970. carry += lo < dl ? 1 : 0;
  26971. var hi = ah + bh + ch + dh + carry;
  26972. return hi >>> 0;
  26973. }
  26974. exports.sum64_4_hi = sum64_4_hi;
  26975. function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {
  26976. var lo = al + bl + cl + dl;
  26977. return lo >>> 0;
  26978. }
  26979. exports.sum64_4_lo = sum64_4_lo;
  26980. function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
  26981. var carry = 0;
  26982. var lo = al;
  26983. lo = (lo + bl) >>> 0;
  26984. carry += lo < al ? 1 : 0;
  26985. lo = (lo + cl) >>> 0;
  26986. carry += lo < cl ? 1 : 0;
  26987. lo = (lo + dl) >>> 0;
  26988. carry += lo < dl ? 1 : 0;
  26989. lo = (lo + el) >>> 0;
  26990. carry += lo < el ? 1 : 0;
  26991. var hi = ah + bh + ch + dh + eh + carry;
  26992. return hi >>> 0;
  26993. }
  26994. exports.sum64_5_hi = sum64_5_hi;
  26995. function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
  26996. var lo = al + bl + cl + dl + el;
  26997. return lo >>> 0;
  26998. }
  26999. exports.sum64_5_lo = sum64_5_lo;
  27000. function rotr64_hi(ah, al, num) {
  27001. var r = (al << (32 - num)) | (ah >>> num);
  27002. return r >>> 0;
  27003. }
  27004. exports.rotr64_hi = rotr64_hi;
  27005. function rotr64_lo(ah, al, num) {
  27006. var r = (ah << (32 - num)) | (al >>> num);
  27007. return r >>> 0;
  27008. }
  27009. exports.rotr64_lo = rotr64_lo;
  27010. function shr64_hi(ah, al, num) {
  27011. return ah >>> num;
  27012. }
  27013. exports.shr64_hi = shr64_hi;
  27014. function shr64_lo(ah, al, num) {
  27015. var r = (ah << (32 - num)) | (al >>> num);
  27016. return r >>> 0;
  27017. }
  27018. exports.shr64_lo = shr64_lo;
  27019. /***/ }),
  27020. /* 153 */
  27021. /*!*************************************************!*\
  27022. !*** ./node_modules/hash.js/lib/hash/common.js ***!
  27023. \*************************************************/
  27024. /*! no static exports found */
  27025. /***/ (function(module, exports, __webpack_require__) {
  27026. "use strict";
  27027. var utils = __webpack_require__(/*! ./utils */ 152);
  27028. var assert = __webpack_require__(/*! minimalistic-assert */ 104);
  27029. function BlockHash() {
  27030. this.pending = null;
  27031. this.pendingTotal = 0;
  27032. this.blockSize = this.constructor.blockSize;
  27033. this.outSize = this.constructor.outSize;
  27034. this.hmacStrength = this.constructor.hmacStrength;
  27035. this.padLength = this.constructor.padLength / 8;
  27036. this.endian = 'big';
  27037. this._delta8 = this.blockSize / 8;
  27038. this._delta32 = this.blockSize / 32;
  27039. }
  27040. exports.BlockHash = BlockHash;
  27041. BlockHash.prototype.update = function update(msg, enc) {
  27042. // Convert message to array, pad it, and join into 32bit blocks
  27043. msg = utils.toArray(msg, enc);
  27044. if (!this.pending)
  27045. this.pending = msg;
  27046. else
  27047. this.pending = this.pending.concat(msg);
  27048. this.pendingTotal += msg.length;
  27049. // Enough data, try updating
  27050. if (this.pending.length >= this._delta8) {
  27051. msg = this.pending;
  27052. // Process pending data in blocks
  27053. var r = msg.length % this._delta8;
  27054. this.pending = msg.slice(msg.length - r, msg.length);
  27055. if (this.pending.length === 0)
  27056. this.pending = null;
  27057. msg = utils.join32(msg, 0, msg.length - r, this.endian);
  27058. for (var i = 0; i < msg.length; i += this._delta32)
  27059. this._update(msg, i, i + this._delta32);
  27060. }
  27061. return this;
  27062. };
  27063. BlockHash.prototype.digest = function digest(enc) {
  27064. this.update(this._pad());
  27065. assert(this.pending === null);
  27066. return this._digest(enc);
  27067. };
  27068. BlockHash.prototype._pad = function pad() {
  27069. var len = this.pendingTotal;
  27070. var bytes = this._delta8;
  27071. var k = bytes - ((len + this.padLength) % bytes);
  27072. var res = new Array(k + this.padLength);
  27073. res[0] = 0x80;
  27074. for (var i = 1; i < k; i++)
  27075. res[i] = 0;
  27076. // Append length
  27077. len <<= 3;
  27078. if (this.endian === 'big') {
  27079. for (var t = 8; t < this.padLength; t++)
  27080. res[i++] = 0;
  27081. res[i++] = 0;
  27082. res[i++] = 0;
  27083. res[i++] = 0;
  27084. res[i++] = 0;
  27085. res[i++] = (len >>> 24) & 0xff;
  27086. res[i++] = (len >>> 16) & 0xff;
  27087. res[i++] = (len >>> 8) & 0xff;
  27088. res[i++] = len & 0xff;
  27089. } else {
  27090. res[i++] = len & 0xff;
  27091. res[i++] = (len >>> 8) & 0xff;
  27092. res[i++] = (len >>> 16) & 0xff;
  27093. res[i++] = (len >>> 24) & 0xff;
  27094. res[i++] = 0;
  27095. res[i++] = 0;
  27096. res[i++] = 0;
  27097. res[i++] = 0;
  27098. for (t = 8; t < this.padLength; t++)
  27099. res[i++] = 0;
  27100. }
  27101. return res;
  27102. };
  27103. /***/ }),
  27104. /* 154 */
  27105. /*!**********************************************!*\
  27106. !*** ./node_modules/hash.js/lib/hash/sha.js ***!
  27107. \**********************************************/
  27108. /*! no static exports found */
  27109. /***/ (function(module, exports, __webpack_require__) {
  27110. "use strict";
  27111. exports.sha1 = __webpack_require__(/*! ./sha/1 */ 155);
  27112. exports.sha224 = __webpack_require__(/*! ./sha/224 */ 157);
  27113. exports.sha256 = __webpack_require__(/*! ./sha/256 */ 158);
  27114. exports.sha384 = __webpack_require__(/*! ./sha/384 */ 159);
  27115. exports.sha512 = __webpack_require__(/*! ./sha/512 */ 160);
  27116. /***/ }),
  27117. /* 155 */
  27118. /*!************************************************!*\
  27119. !*** ./node_modules/hash.js/lib/hash/sha/1.js ***!
  27120. \************************************************/
  27121. /*! no static exports found */
  27122. /***/ (function(module, exports, __webpack_require__) {
  27123. "use strict";
  27124. var utils = __webpack_require__(/*! ../utils */ 152);
  27125. var common = __webpack_require__(/*! ../common */ 153);
  27126. var shaCommon = __webpack_require__(/*! ./common */ 156);
  27127. var rotl32 = utils.rotl32;
  27128. var sum32 = utils.sum32;
  27129. var sum32_5 = utils.sum32_5;
  27130. var ft_1 = shaCommon.ft_1;
  27131. var BlockHash = common.BlockHash;
  27132. var sha1_K = [
  27133. 0x5A827999, 0x6ED9EBA1,
  27134. 0x8F1BBCDC, 0xCA62C1D6
  27135. ];
  27136. function SHA1() {
  27137. if (!(this instanceof SHA1))
  27138. return new SHA1();
  27139. BlockHash.call(this);
  27140. this.h = [
  27141. 0x67452301, 0xefcdab89, 0x98badcfe,
  27142. 0x10325476, 0xc3d2e1f0 ];
  27143. this.W = new Array(80);
  27144. }
  27145. utils.inherits(SHA1, BlockHash);
  27146. module.exports = SHA1;
  27147. SHA1.blockSize = 512;
  27148. SHA1.outSize = 160;
  27149. SHA1.hmacStrength = 80;
  27150. SHA1.padLength = 64;
  27151. SHA1.prototype._update = function _update(msg, start) {
  27152. var W = this.W;
  27153. for (var i = 0; i < 16; i++)
  27154. W[i] = msg[start + i];
  27155. for(; i < W.length; i++)
  27156. W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);
  27157. var a = this.h[0];
  27158. var b = this.h[1];
  27159. var c = this.h[2];
  27160. var d = this.h[3];
  27161. var e = this.h[4];
  27162. for (i = 0; i < W.length; i++) {
  27163. var s = ~~(i / 20);
  27164. var t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]);
  27165. e = d;
  27166. d = c;
  27167. c = rotl32(b, 30);
  27168. b = a;
  27169. a = t;
  27170. }
  27171. this.h[0] = sum32(this.h[0], a);
  27172. this.h[1] = sum32(this.h[1], b);
  27173. this.h[2] = sum32(this.h[2], c);
  27174. this.h[3] = sum32(this.h[3], d);
  27175. this.h[4] = sum32(this.h[4], e);
  27176. };
  27177. SHA1.prototype._digest = function digest(enc) {
  27178. if (enc === 'hex')
  27179. return utils.toHex32(this.h, 'big');
  27180. else
  27181. return utils.split32(this.h, 'big');
  27182. };
  27183. /***/ }),
  27184. /* 156 */
  27185. /*!*****************************************************!*\
  27186. !*** ./node_modules/hash.js/lib/hash/sha/common.js ***!
  27187. \*****************************************************/
  27188. /*! no static exports found */
  27189. /***/ (function(module, exports, __webpack_require__) {
  27190. "use strict";
  27191. var utils = __webpack_require__(/*! ../utils */ 152);
  27192. var rotr32 = utils.rotr32;
  27193. function ft_1(s, x, y, z) {
  27194. if (s === 0)
  27195. return ch32(x, y, z);
  27196. if (s === 1 || s === 3)
  27197. return p32(x, y, z);
  27198. if (s === 2)
  27199. return maj32(x, y, z);
  27200. }
  27201. exports.ft_1 = ft_1;
  27202. function ch32(x, y, z) {
  27203. return (x & y) ^ ((~x) & z);
  27204. }
  27205. exports.ch32 = ch32;
  27206. function maj32(x, y, z) {
  27207. return (x & y) ^ (x & z) ^ (y & z);
  27208. }
  27209. exports.maj32 = maj32;
  27210. function p32(x, y, z) {
  27211. return x ^ y ^ z;
  27212. }
  27213. exports.p32 = p32;
  27214. function s0_256(x) {
  27215. return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);
  27216. }
  27217. exports.s0_256 = s0_256;
  27218. function s1_256(x) {
  27219. return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);
  27220. }
  27221. exports.s1_256 = s1_256;
  27222. function g0_256(x) {
  27223. return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3);
  27224. }
  27225. exports.g0_256 = g0_256;
  27226. function g1_256(x) {
  27227. return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10);
  27228. }
  27229. exports.g1_256 = g1_256;
  27230. /***/ }),
  27231. /* 157 */
  27232. /*!**************************************************!*\
  27233. !*** ./node_modules/hash.js/lib/hash/sha/224.js ***!
  27234. \**************************************************/
  27235. /*! no static exports found */
  27236. /***/ (function(module, exports, __webpack_require__) {
  27237. "use strict";
  27238. var utils = __webpack_require__(/*! ../utils */ 152);
  27239. var SHA256 = __webpack_require__(/*! ./256 */ 158);
  27240. function SHA224() {
  27241. if (!(this instanceof SHA224))
  27242. return new SHA224();
  27243. SHA256.call(this);
  27244. this.h = [
  27245. 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,
  27246. 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ];
  27247. }
  27248. utils.inherits(SHA224, SHA256);
  27249. module.exports = SHA224;
  27250. SHA224.blockSize = 512;
  27251. SHA224.outSize = 224;
  27252. SHA224.hmacStrength = 192;
  27253. SHA224.padLength = 64;
  27254. SHA224.prototype._digest = function digest(enc) {
  27255. // Just truncate output
  27256. if (enc === 'hex')
  27257. return utils.toHex32(this.h.slice(0, 7), 'big');
  27258. else
  27259. return utils.split32(this.h.slice(0, 7), 'big');
  27260. };
  27261. /***/ }),
  27262. /* 158 */
  27263. /*!**************************************************!*\
  27264. !*** ./node_modules/hash.js/lib/hash/sha/256.js ***!
  27265. \**************************************************/
  27266. /*! no static exports found */
  27267. /***/ (function(module, exports, __webpack_require__) {
  27268. "use strict";
  27269. var utils = __webpack_require__(/*! ../utils */ 152);
  27270. var common = __webpack_require__(/*! ../common */ 153);
  27271. var shaCommon = __webpack_require__(/*! ./common */ 156);
  27272. var assert = __webpack_require__(/*! minimalistic-assert */ 104);
  27273. var sum32 = utils.sum32;
  27274. var sum32_4 = utils.sum32_4;
  27275. var sum32_5 = utils.sum32_5;
  27276. var ch32 = shaCommon.ch32;
  27277. var maj32 = shaCommon.maj32;
  27278. var s0_256 = shaCommon.s0_256;
  27279. var s1_256 = shaCommon.s1_256;
  27280. var g0_256 = shaCommon.g0_256;
  27281. var g1_256 = shaCommon.g1_256;
  27282. var BlockHash = common.BlockHash;
  27283. var sha256_K = [
  27284. 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
  27285. 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
  27286. 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
  27287. 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
  27288. 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
  27289. 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
  27290. 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,
  27291. 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
  27292. 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
  27293. 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
  27294. 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,
  27295. 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
  27296. 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,
  27297. 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
  27298. 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
  27299. 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
  27300. ];
  27301. function SHA256() {
  27302. if (!(this instanceof SHA256))
  27303. return new SHA256();
  27304. BlockHash.call(this);
  27305. this.h = [
  27306. 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
  27307. 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19
  27308. ];
  27309. this.k = sha256_K;
  27310. this.W = new Array(64);
  27311. }
  27312. utils.inherits(SHA256, BlockHash);
  27313. module.exports = SHA256;
  27314. SHA256.blockSize = 512;
  27315. SHA256.outSize = 256;
  27316. SHA256.hmacStrength = 192;
  27317. SHA256.padLength = 64;
  27318. SHA256.prototype._update = function _update(msg, start) {
  27319. var W = this.W;
  27320. for (var i = 0; i < 16; i++)
  27321. W[i] = msg[start + i];
  27322. for (; i < W.length; i++)
  27323. W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);
  27324. var a = this.h[0];
  27325. var b = this.h[1];
  27326. var c = this.h[2];
  27327. var d = this.h[3];
  27328. var e = this.h[4];
  27329. var f = this.h[5];
  27330. var g = this.h[6];
  27331. var h = this.h[7];
  27332. assert(this.k.length === W.length);
  27333. for (i = 0; i < W.length; i++) {
  27334. var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]);
  27335. var T2 = sum32(s0_256(a), maj32(a, b, c));
  27336. h = g;
  27337. g = f;
  27338. f = e;
  27339. e = sum32(d, T1);
  27340. d = c;
  27341. c = b;
  27342. b = a;
  27343. a = sum32(T1, T2);
  27344. }
  27345. this.h[0] = sum32(this.h[0], a);
  27346. this.h[1] = sum32(this.h[1], b);
  27347. this.h[2] = sum32(this.h[2], c);
  27348. this.h[3] = sum32(this.h[3], d);
  27349. this.h[4] = sum32(this.h[4], e);
  27350. this.h[5] = sum32(this.h[5], f);
  27351. this.h[6] = sum32(this.h[6], g);
  27352. this.h[7] = sum32(this.h[7], h);
  27353. };
  27354. SHA256.prototype._digest = function digest(enc) {
  27355. if (enc === 'hex')
  27356. return utils.toHex32(this.h, 'big');
  27357. else
  27358. return utils.split32(this.h, 'big');
  27359. };
  27360. /***/ }),
  27361. /* 159 */
  27362. /*!**************************************************!*\
  27363. !*** ./node_modules/hash.js/lib/hash/sha/384.js ***!
  27364. \**************************************************/
  27365. /*! no static exports found */
  27366. /***/ (function(module, exports, __webpack_require__) {
  27367. "use strict";
  27368. var utils = __webpack_require__(/*! ../utils */ 152);
  27369. var SHA512 = __webpack_require__(/*! ./512 */ 160);
  27370. function SHA384() {
  27371. if (!(this instanceof SHA384))
  27372. return new SHA384();
  27373. SHA512.call(this);
  27374. this.h = [
  27375. 0xcbbb9d5d, 0xc1059ed8,
  27376. 0x629a292a, 0x367cd507,
  27377. 0x9159015a, 0x3070dd17,
  27378. 0x152fecd8, 0xf70e5939,
  27379. 0x67332667, 0xffc00b31,
  27380. 0x8eb44a87, 0x68581511,
  27381. 0xdb0c2e0d, 0x64f98fa7,
  27382. 0x47b5481d, 0xbefa4fa4 ];
  27383. }
  27384. utils.inherits(SHA384, SHA512);
  27385. module.exports = SHA384;
  27386. SHA384.blockSize = 1024;
  27387. SHA384.outSize = 384;
  27388. SHA384.hmacStrength = 192;
  27389. SHA384.padLength = 128;
  27390. SHA384.prototype._digest = function digest(enc) {
  27391. if (enc === 'hex')
  27392. return utils.toHex32(this.h.slice(0, 12), 'big');
  27393. else
  27394. return utils.split32(this.h.slice(0, 12), 'big');
  27395. };
  27396. /***/ }),
  27397. /* 160 */
  27398. /*!**************************************************!*\
  27399. !*** ./node_modules/hash.js/lib/hash/sha/512.js ***!
  27400. \**************************************************/
  27401. /*! no static exports found */
  27402. /***/ (function(module, exports, __webpack_require__) {
  27403. "use strict";
  27404. var utils = __webpack_require__(/*! ../utils */ 152);
  27405. var common = __webpack_require__(/*! ../common */ 153);
  27406. var assert = __webpack_require__(/*! minimalistic-assert */ 104);
  27407. var rotr64_hi = utils.rotr64_hi;
  27408. var rotr64_lo = utils.rotr64_lo;
  27409. var shr64_hi = utils.shr64_hi;
  27410. var shr64_lo = utils.shr64_lo;
  27411. var sum64 = utils.sum64;
  27412. var sum64_hi = utils.sum64_hi;
  27413. var sum64_lo = utils.sum64_lo;
  27414. var sum64_4_hi = utils.sum64_4_hi;
  27415. var sum64_4_lo = utils.sum64_4_lo;
  27416. var sum64_5_hi = utils.sum64_5_hi;
  27417. var sum64_5_lo = utils.sum64_5_lo;
  27418. var BlockHash = common.BlockHash;
  27419. var sha512_K = [
  27420. 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,
  27421. 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
  27422. 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,
  27423. 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
  27424. 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,
  27425. 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
  27426. 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,
  27427. 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
  27428. 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,
  27429. 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
  27430. 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,
  27431. 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
  27432. 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,
  27433. 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
  27434. 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,
  27435. 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
  27436. 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,
  27437. 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
  27438. 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,
  27439. 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
  27440. 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,
  27441. 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
  27442. 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,
  27443. 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
  27444. 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,
  27445. 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
  27446. 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,
  27447. 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
  27448. 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,
  27449. 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
  27450. 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,
  27451. 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
  27452. 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,
  27453. 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
  27454. 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,
  27455. 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
  27456. 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,
  27457. 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
  27458. 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,
  27459. 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817
  27460. ];
  27461. function SHA512() {
  27462. if (!(this instanceof SHA512))
  27463. return new SHA512();
  27464. BlockHash.call(this);
  27465. this.h = [
  27466. 0x6a09e667, 0xf3bcc908,
  27467. 0xbb67ae85, 0x84caa73b,
  27468. 0x3c6ef372, 0xfe94f82b,
  27469. 0xa54ff53a, 0x5f1d36f1,
  27470. 0x510e527f, 0xade682d1,
  27471. 0x9b05688c, 0x2b3e6c1f,
  27472. 0x1f83d9ab, 0xfb41bd6b,
  27473. 0x5be0cd19, 0x137e2179 ];
  27474. this.k = sha512_K;
  27475. this.W = new Array(160);
  27476. }
  27477. utils.inherits(SHA512, BlockHash);
  27478. module.exports = SHA512;
  27479. SHA512.blockSize = 1024;
  27480. SHA512.outSize = 512;
  27481. SHA512.hmacStrength = 192;
  27482. SHA512.padLength = 128;
  27483. SHA512.prototype._prepareBlock = function _prepareBlock(msg, start) {
  27484. var W = this.W;
  27485. // 32 x 32bit words
  27486. for (var i = 0; i < 32; i++)
  27487. W[i] = msg[start + i];
  27488. for (; i < W.length; i += 2) {
  27489. var c0_hi = g1_512_hi(W[i - 4], W[i - 3]); // i - 2
  27490. var c0_lo = g1_512_lo(W[i - 4], W[i - 3]);
  27491. var c1_hi = W[i - 14]; // i - 7
  27492. var c1_lo = W[i - 13];
  27493. var c2_hi = g0_512_hi(W[i - 30], W[i - 29]); // i - 15
  27494. var c2_lo = g0_512_lo(W[i - 30], W[i - 29]);
  27495. var c3_hi = W[i - 32]; // i - 16
  27496. var c3_lo = W[i - 31];
  27497. W[i] = sum64_4_hi(
  27498. c0_hi, c0_lo,
  27499. c1_hi, c1_lo,
  27500. c2_hi, c2_lo,
  27501. c3_hi, c3_lo);
  27502. W[i + 1] = sum64_4_lo(
  27503. c0_hi, c0_lo,
  27504. c1_hi, c1_lo,
  27505. c2_hi, c2_lo,
  27506. c3_hi, c3_lo);
  27507. }
  27508. };
  27509. SHA512.prototype._update = function _update(msg, start) {
  27510. this._prepareBlock(msg, start);
  27511. var W = this.W;
  27512. var ah = this.h[0];
  27513. var al = this.h[1];
  27514. var bh = this.h[2];
  27515. var bl = this.h[3];
  27516. var ch = this.h[4];
  27517. var cl = this.h[5];
  27518. var dh = this.h[6];
  27519. var dl = this.h[7];
  27520. var eh = this.h[8];
  27521. var el = this.h[9];
  27522. var fh = this.h[10];
  27523. var fl = this.h[11];
  27524. var gh = this.h[12];
  27525. var gl = this.h[13];
  27526. var hh = this.h[14];
  27527. var hl = this.h[15];
  27528. assert(this.k.length === W.length);
  27529. for (var i = 0; i < W.length; i += 2) {
  27530. var c0_hi = hh;
  27531. var c0_lo = hl;
  27532. var c1_hi = s1_512_hi(eh, el);
  27533. var c1_lo = s1_512_lo(eh, el);
  27534. var c2_hi = ch64_hi(eh, el, fh, fl, gh, gl);
  27535. var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl);
  27536. var c3_hi = this.k[i];
  27537. var c3_lo = this.k[i + 1];
  27538. var c4_hi = W[i];
  27539. var c4_lo = W[i + 1];
  27540. var T1_hi = sum64_5_hi(
  27541. c0_hi, c0_lo,
  27542. c1_hi, c1_lo,
  27543. c2_hi, c2_lo,
  27544. c3_hi, c3_lo,
  27545. c4_hi, c4_lo);
  27546. var T1_lo = sum64_5_lo(
  27547. c0_hi, c0_lo,
  27548. c1_hi, c1_lo,
  27549. c2_hi, c2_lo,
  27550. c3_hi, c3_lo,
  27551. c4_hi, c4_lo);
  27552. c0_hi = s0_512_hi(ah, al);
  27553. c0_lo = s0_512_lo(ah, al);
  27554. c1_hi = maj64_hi(ah, al, bh, bl, ch, cl);
  27555. c1_lo = maj64_lo(ah, al, bh, bl, ch, cl);
  27556. var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo);
  27557. var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo);
  27558. hh = gh;
  27559. hl = gl;
  27560. gh = fh;
  27561. gl = fl;
  27562. fh = eh;
  27563. fl = el;
  27564. eh = sum64_hi(dh, dl, T1_hi, T1_lo);
  27565. el = sum64_lo(dl, dl, T1_hi, T1_lo);
  27566. dh = ch;
  27567. dl = cl;
  27568. ch = bh;
  27569. cl = bl;
  27570. bh = ah;
  27571. bl = al;
  27572. ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo);
  27573. al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo);
  27574. }
  27575. sum64(this.h, 0, ah, al);
  27576. sum64(this.h, 2, bh, bl);
  27577. sum64(this.h, 4, ch, cl);
  27578. sum64(this.h, 6, dh, dl);
  27579. sum64(this.h, 8, eh, el);
  27580. sum64(this.h, 10, fh, fl);
  27581. sum64(this.h, 12, gh, gl);
  27582. sum64(this.h, 14, hh, hl);
  27583. };
  27584. SHA512.prototype._digest = function digest(enc) {
  27585. if (enc === 'hex')
  27586. return utils.toHex32(this.h, 'big');
  27587. else
  27588. return utils.split32(this.h, 'big');
  27589. };
  27590. function ch64_hi(xh, xl, yh, yl, zh) {
  27591. var r = (xh & yh) ^ ((~xh) & zh);
  27592. if (r < 0)
  27593. r += 0x100000000;
  27594. return r;
  27595. }
  27596. function ch64_lo(xh, xl, yh, yl, zh, zl) {
  27597. var r = (xl & yl) ^ ((~xl) & zl);
  27598. if (r < 0)
  27599. r += 0x100000000;
  27600. return r;
  27601. }
  27602. function maj64_hi(xh, xl, yh, yl, zh) {
  27603. var r = (xh & yh) ^ (xh & zh) ^ (yh & zh);
  27604. if (r < 0)
  27605. r += 0x100000000;
  27606. return r;
  27607. }
  27608. function maj64_lo(xh, xl, yh, yl, zh, zl) {
  27609. var r = (xl & yl) ^ (xl & zl) ^ (yl & zl);
  27610. if (r < 0)
  27611. r += 0x100000000;
  27612. return r;
  27613. }
  27614. function s0_512_hi(xh, xl) {
  27615. var c0_hi = rotr64_hi(xh, xl, 28);
  27616. var c1_hi = rotr64_hi(xl, xh, 2); // 34
  27617. var c2_hi = rotr64_hi(xl, xh, 7); // 39
  27618. var r = c0_hi ^ c1_hi ^ c2_hi;
  27619. if (r < 0)
  27620. r += 0x100000000;
  27621. return r;
  27622. }
  27623. function s0_512_lo(xh, xl) {
  27624. var c0_lo = rotr64_lo(xh, xl, 28);
  27625. var c1_lo = rotr64_lo(xl, xh, 2); // 34
  27626. var c2_lo = rotr64_lo(xl, xh, 7); // 39
  27627. var r = c0_lo ^ c1_lo ^ c2_lo;
  27628. if (r < 0)
  27629. r += 0x100000000;
  27630. return r;
  27631. }
  27632. function s1_512_hi(xh, xl) {
  27633. var c0_hi = rotr64_hi(xh, xl, 14);
  27634. var c1_hi = rotr64_hi(xh, xl, 18);
  27635. var c2_hi = rotr64_hi(xl, xh, 9); // 41
  27636. var r = c0_hi ^ c1_hi ^ c2_hi;
  27637. if (r < 0)
  27638. r += 0x100000000;
  27639. return r;
  27640. }
  27641. function s1_512_lo(xh, xl) {
  27642. var c0_lo = rotr64_lo(xh, xl, 14);
  27643. var c1_lo = rotr64_lo(xh, xl, 18);
  27644. var c2_lo = rotr64_lo(xl, xh, 9); // 41
  27645. var r = c0_lo ^ c1_lo ^ c2_lo;
  27646. if (r < 0)
  27647. r += 0x100000000;
  27648. return r;
  27649. }
  27650. function g0_512_hi(xh, xl) {
  27651. var c0_hi = rotr64_hi(xh, xl, 1);
  27652. var c1_hi = rotr64_hi(xh, xl, 8);
  27653. var c2_hi = shr64_hi(xh, xl, 7);
  27654. var r = c0_hi ^ c1_hi ^ c2_hi;
  27655. if (r < 0)
  27656. r += 0x100000000;
  27657. return r;
  27658. }
  27659. function g0_512_lo(xh, xl) {
  27660. var c0_lo = rotr64_lo(xh, xl, 1);
  27661. var c1_lo = rotr64_lo(xh, xl, 8);
  27662. var c2_lo = shr64_lo(xh, xl, 7);
  27663. var r = c0_lo ^ c1_lo ^ c2_lo;
  27664. if (r < 0)
  27665. r += 0x100000000;
  27666. return r;
  27667. }
  27668. function g1_512_hi(xh, xl) {
  27669. var c0_hi = rotr64_hi(xh, xl, 19);
  27670. var c1_hi = rotr64_hi(xl, xh, 29); // 61
  27671. var c2_hi = shr64_hi(xh, xl, 6);
  27672. var r = c0_hi ^ c1_hi ^ c2_hi;
  27673. if (r < 0)
  27674. r += 0x100000000;
  27675. return r;
  27676. }
  27677. function g1_512_lo(xh, xl) {
  27678. var c0_lo = rotr64_lo(xh, xl, 19);
  27679. var c1_lo = rotr64_lo(xl, xh, 29); // 61
  27680. var c2_lo = shr64_lo(xh, xl, 6);
  27681. var r = c0_lo ^ c1_lo ^ c2_lo;
  27682. if (r < 0)
  27683. r += 0x100000000;
  27684. return r;
  27685. }
  27686. /***/ }),
  27687. /* 161 */
  27688. /*!*************************************************!*\
  27689. !*** ./node_modules/hash.js/lib/hash/ripemd.js ***!
  27690. \*************************************************/
  27691. /*! no static exports found */
  27692. /***/ (function(module, exports, __webpack_require__) {
  27693. "use strict";
  27694. var utils = __webpack_require__(/*! ./utils */ 152);
  27695. var common = __webpack_require__(/*! ./common */ 153);
  27696. var rotl32 = utils.rotl32;
  27697. var sum32 = utils.sum32;
  27698. var sum32_3 = utils.sum32_3;
  27699. var sum32_4 = utils.sum32_4;
  27700. var BlockHash = common.BlockHash;
  27701. function RIPEMD160() {
  27702. if (!(this instanceof RIPEMD160))
  27703. return new RIPEMD160();
  27704. BlockHash.call(this);
  27705. this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ];
  27706. this.endian = 'little';
  27707. }
  27708. utils.inherits(RIPEMD160, BlockHash);
  27709. exports.ripemd160 = RIPEMD160;
  27710. RIPEMD160.blockSize = 512;
  27711. RIPEMD160.outSize = 160;
  27712. RIPEMD160.hmacStrength = 192;
  27713. RIPEMD160.padLength = 64;
  27714. RIPEMD160.prototype._update = function update(msg, start) {
  27715. var A = this.h[0];
  27716. var B = this.h[1];
  27717. var C = this.h[2];
  27718. var D = this.h[3];
  27719. var E = this.h[4];
  27720. var Ah = A;
  27721. var Bh = B;
  27722. var Ch = C;
  27723. var Dh = D;
  27724. var Eh = E;
  27725. for (var j = 0; j < 80; j++) {
  27726. var T = sum32(
  27727. rotl32(
  27728. sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)),
  27729. s[j]),
  27730. E);
  27731. A = E;
  27732. E = D;
  27733. D = rotl32(C, 10);
  27734. C = B;
  27735. B = T;
  27736. T = sum32(
  27737. rotl32(
  27738. sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)),
  27739. sh[j]),
  27740. Eh);
  27741. Ah = Eh;
  27742. Eh = Dh;
  27743. Dh = rotl32(Ch, 10);
  27744. Ch = Bh;
  27745. Bh = T;
  27746. }
  27747. T = sum32_3(this.h[1], C, Dh);
  27748. this.h[1] = sum32_3(this.h[2], D, Eh);
  27749. this.h[2] = sum32_3(this.h[3], E, Ah);
  27750. this.h[3] = sum32_3(this.h[4], A, Bh);
  27751. this.h[4] = sum32_3(this.h[0], B, Ch);
  27752. this.h[0] = T;
  27753. };
  27754. RIPEMD160.prototype._digest = function digest(enc) {
  27755. if (enc === 'hex')
  27756. return utils.toHex32(this.h, 'little');
  27757. else
  27758. return utils.split32(this.h, 'little');
  27759. };
  27760. function f(j, x, y, z) {
  27761. if (j <= 15)
  27762. return x ^ y ^ z;
  27763. else if (j <= 31)
  27764. return (x & y) | ((~x) & z);
  27765. else if (j <= 47)
  27766. return (x | (~y)) ^ z;
  27767. else if (j <= 63)
  27768. return (x & z) | (y & (~z));
  27769. else
  27770. return x ^ (y | (~z));
  27771. }
  27772. function K(j) {
  27773. if (j <= 15)
  27774. return 0x00000000;
  27775. else if (j <= 31)
  27776. return 0x5a827999;
  27777. else if (j <= 47)
  27778. return 0x6ed9eba1;
  27779. else if (j <= 63)
  27780. return 0x8f1bbcdc;
  27781. else
  27782. return 0xa953fd4e;
  27783. }
  27784. function Kh(j) {
  27785. if (j <= 15)
  27786. return 0x50a28be6;
  27787. else if (j <= 31)
  27788. return 0x5c4dd124;
  27789. else if (j <= 47)
  27790. return 0x6d703ef3;
  27791. else if (j <= 63)
  27792. return 0x7a6d76e9;
  27793. else
  27794. return 0x00000000;
  27795. }
  27796. var r = [
  27797. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  27798. 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
  27799. 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
  27800. 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
  27801. 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13
  27802. ];
  27803. var rh = [
  27804. 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
  27805. 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
  27806. 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
  27807. 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
  27808. 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11
  27809. ];
  27810. var s = [
  27811. 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
  27812. 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
  27813. 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
  27814. 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
  27815. 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6
  27816. ];
  27817. var sh = [
  27818. 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
  27819. 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
  27820. 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
  27821. 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
  27822. 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11
  27823. ];
  27824. /***/ }),
  27825. /* 162 */
  27826. /*!***********************************************!*\
  27827. !*** ./node_modules/hash.js/lib/hash/hmac.js ***!
  27828. \***********************************************/
  27829. /*! no static exports found */
  27830. /***/ (function(module, exports, __webpack_require__) {
  27831. "use strict";
  27832. var utils = __webpack_require__(/*! ./utils */ 152);
  27833. var assert = __webpack_require__(/*! minimalistic-assert */ 104);
  27834. function Hmac(hash, key, enc) {
  27835. if (!(this instanceof Hmac))
  27836. return new Hmac(hash, key, enc);
  27837. this.Hash = hash;
  27838. this.blockSize = hash.blockSize / 8;
  27839. this.outSize = hash.outSize / 8;
  27840. this.inner = null;
  27841. this.outer = null;
  27842. this._init(utils.toArray(key, enc));
  27843. }
  27844. module.exports = Hmac;
  27845. Hmac.prototype._init = function init(key) {
  27846. // Shorten key, if needed
  27847. if (key.length > this.blockSize)
  27848. key = new this.Hash().update(key).digest();
  27849. assert(key.length <= this.blockSize);
  27850. // Add padding to key
  27851. for (var i = key.length; i < this.blockSize; i++)
  27852. key.push(0);
  27853. for (i = 0; i < key.length; i++)
  27854. key[i] ^= 0x36;
  27855. this.inner = new this.Hash().update(key);
  27856. // 0x36 ^ 0x5c = 0x6a
  27857. for (i = 0; i < key.length; i++)
  27858. key[i] ^= 0x6a;
  27859. this.outer = new this.Hash().update(key);
  27860. };
  27861. Hmac.prototype.update = function update(msg, enc) {
  27862. this.inner.update(msg, enc);
  27863. return this;
  27864. };
  27865. Hmac.prototype.digest = function digest(enc) {
  27866. this.outer.update(this.inner.digest());
  27867. return this.outer.digest(enc);
  27868. };
  27869. /***/ }),
  27870. /* 163 */
  27871. /*!*********************************************************************!*\
  27872. !*** ./node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js ***!
  27873. \*********************************************************************/
  27874. /*! no static exports found */
  27875. /***/ (function(module, exports) {
  27876. module.exports = {
  27877. doubles: {
  27878. step: 4,
  27879. points: [
  27880. [
  27881. 'e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a',
  27882. 'f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821'
  27883. ],
  27884. [
  27885. '8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508',
  27886. '11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf'
  27887. ],
  27888. [
  27889. '175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739',
  27890. 'd3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695'
  27891. ],
  27892. [
  27893. '363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640',
  27894. '4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9'
  27895. ],
  27896. [
  27897. '8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c',
  27898. '4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36'
  27899. ],
  27900. [
  27901. '723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda',
  27902. '96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f'
  27903. ],
  27904. [
  27905. 'eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa',
  27906. '5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999'
  27907. ],
  27908. [
  27909. '100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0',
  27910. 'cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09'
  27911. ],
  27912. [
  27913. 'e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d',
  27914. '9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d'
  27915. ],
  27916. [
  27917. 'feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d',
  27918. 'e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088'
  27919. ],
  27920. [
  27921. 'da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1',
  27922. '9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d'
  27923. ],
  27924. [
  27925. '53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0',
  27926. '5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8'
  27927. ],
  27928. [
  27929. '8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047',
  27930. '10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a'
  27931. ],
  27932. [
  27933. '385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862',
  27934. '283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453'
  27935. ],
  27936. [
  27937. '6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7',
  27938. '7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160'
  27939. ],
  27940. [
  27941. '3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd',
  27942. '56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0'
  27943. ],
  27944. [
  27945. '85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83',
  27946. '7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6'
  27947. ],
  27948. [
  27949. '948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a',
  27950. '53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589'
  27951. ],
  27952. [
  27953. '6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8',
  27954. 'bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17'
  27955. ],
  27956. [
  27957. 'e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d',
  27958. '4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda'
  27959. ],
  27960. [
  27961. 'e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725',
  27962. '7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd'
  27963. ],
  27964. [
  27965. '213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754',
  27966. '4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2'
  27967. ],
  27968. [
  27969. '4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c',
  27970. '17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6'
  27971. ],
  27972. [
  27973. 'fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6',
  27974. '6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f'
  27975. ],
  27976. [
  27977. '76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39',
  27978. 'c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01'
  27979. ],
  27980. [
  27981. 'c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891',
  27982. '893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3'
  27983. ],
  27984. [
  27985. 'd895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b',
  27986. 'febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f'
  27987. ],
  27988. [
  27989. 'b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03',
  27990. '2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7'
  27991. ],
  27992. [
  27993. 'e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d',
  27994. 'eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78'
  27995. ],
  27996. [
  27997. 'a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070',
  27998. '7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1'
  27999. ],
  28000. [
  28001. '90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4',
  28002. 'e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150'
  28003. ],
  28004. [
  28005. '8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da',
  28006. '662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82'
  28007. ],
  28008. [
  28009. 'e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11',
  28010. '1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc'
  28011. ],
  28012. [
  28013. '8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e',
  28014. 'efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b'
  28015. ],
  28016. [
  28017. 'e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41',
  28018. '2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51'
  28019. ],
  28020. [
  28021. 'b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef',
  28022. '67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45'
  28023. ],
  28024. [
  28025. 'd68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8',
  28026. 'db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120'
  28027. ],
  28028. [
  28029. '324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d',
  28030. '648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84'
  28031. ],
  28032. [
  28033. '4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96',
  28034. '35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d'
  28035. ],
  28036. [
  28037. '9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd',
  28038. 'ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d'
  28039. ],
  28040. [
  28041. '6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5',
  28042. '9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8'
  28043. ],
  28044. [
  28045. 'a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266',
  28046. '40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8'
  28047. ],
  28048. [
  28049. '7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71',
  28050. '34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac'
  28051. ],
  28052. [
  28053. '928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac',
  28054. 'c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f'
  28055. ],
  28056. [
  28057. '85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751',
  28058. '1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962'
  28059. ],
  28060. [
  28061. 'ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e',
  28062. '493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907'
  28063. ],
  28064. [
  28065. '827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241',
  28066. 'c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec'
  28067. ],
  28068. [
  28069. 'eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3',
  28070. 'be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d'
  28071. ],
  28072. [
  28073. 'e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f',
  28074. '4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414'
  28075. ],
  28076. [
  28077. '1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19',
  28078. 'aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd'
  28079. ],
  28080. [
  28081. '146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be',
  28082. 'b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0'
  28083. ],
  28084. [
  28085. 'fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9',
  28086. '6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811'
  28087. ],
  28088. [
  28089. 'da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2',
  28090. '8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1'
  28091. ],
  28092. [
  28093. 'a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13',
  28094. '7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c'
  28095. ],
  28096. [
  28097. '174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c',
  28098. 'ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73'
  28099. ],
  28100. [
  28101. '959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba',
  28102. '2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd'
  28103. ],
  28104. [
  28105. 'd2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151',
  28106. 'e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405'
  28107. ],
  28108. [
  28109. '64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073',
  28110. 'd99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589'
  28111. ],
  28112. [
  28113. '8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458',
  28114. '38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e'
  28115. ],
  28116. [
  28117. '13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b',
  28118. '69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27'
  28119. ],
  28120. [
  28121. 'bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366',
  28122. 'd3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1'
  28123. ],
  28124. [
  28125. '8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa',
  28126. '40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482'
  28127. ],
  28128. [
  28129. '8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0',
  28130. '620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945'
  28131. ],
  28132. [
  28133. 'dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787',
  28134. '7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573'
  28135. ],
  28136. [
  28137. 'f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e',
  28138. 'ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82'
  28139. ]
  28140. ]
  28141. },
  28142. naf: {
  28143. wnd: 7,
  28144. points: [
  28145. [
  28146. 'f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9',
  28147. '388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672'
  28148. ],
  28149. [
  28150. '2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4',
  28151. 'd8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6'
  28152. ],
  28153. [
  28154. '5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc',
  28155. '6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da'
  28156. ],
  28157. [
  28158. 'acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe',
  28159. 'cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37'
  28160. ],
  28161. [
  28162. '774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb',
  28163. 'd984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b'
  28164. ],
  28165. [
  28166. 'f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8',
  28167. 'ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81'
  28168. ],
  28169. [
  28170. 'd7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e',
  28171. '581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58'
  28172. ],
  28173. [
  28174. 'defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34',
  28175. '4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77'
  28176. ],
  28177. [
  28178. '2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c',
  28179. '85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a'
  28180. ],
  28181. [
  28182. '352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5',
  28183. '321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c'
  28184. ],
  28185. [
  28186. '2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f',
  28187. '2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67'
  28188. ],
  28189. [
  28190. '9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714',
  28191. '73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402'
  28192. ],
  28193. [
  28194. 'daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729',
  28195. 'a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55'
  28196. ],
  28197. [
  28198. 'c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db',
  28199. '2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482'
  28200. ],
  28201. [
  28202. '6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4',
  28203. 'e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82'
  28204. ],
  28205. [
  28206. '1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5',
  28207. 'b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396'
  28208. ],
  28209. [
  28210. '605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479',
  28211. '2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49'
  28212. ],
  28213. [
  28214. '62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d',
  28215. '80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf'
  28216. ],
  28217. [
  28218. '80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f',
  28219. '1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a'
  28220. ],
  28221. [
  28222. '7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb',
  28223. 'd0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7'
  28224. ],
  28225. [
  28226. 'd528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9',
  28227. 'eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933'
  28228. ],
  28229. [
  28230. '49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963',
  28231. '758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a'
  28232. ],
  28233. [
  28234. '77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74',
  28235. '958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6'
  28236. ],
  28237. [
  28238. 'f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530',
  28239. 'e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37'
  28240. ],
  28241. [
  28242. '463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b',
  28243. '5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e'
  28244. ],
  28245. [
  28246. 'f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247',
  28247. 'cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6'
  28248. ],
  28249. [
  28250. 'caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1',
  28251. 'cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476'
  28252. ],
  28253. [
  28254. '2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120',
  28255. '4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40'
  28256. ],
  28257. [
  28258. '7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435',
  28259. '91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61'
  28260. ],
  28261. [
  28262. '754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18',
  28263. '673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683'
  28264. ],
  28265. [
  28266. 'e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8',
  28267. '59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5'
  28268. ],
  28269. [
  28270. '186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb',
  28271. '3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b'
  28272. ],
  28273. [
  28274. 'df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f',
  28275. '55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417'
  28276. ],
  28277. [
  28278. '5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143',
  28279. 'efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868'
  28280. ],
  28281. [
  28282. '290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba',
  28283. 'e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a'
  28284. ],
  28285. [
  28286. 'af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45',
  28287. 'f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6'
  28288. ],
  28289. [
  28290. '766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a',
  28291. '744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996'
  28292. ],
  28293. [
  28294. '59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e',
  28295. 'c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e'
  28296. ],
  28297. [
  28298. 'f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8',
  28299. 'e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d'
  28300. ],
  28301. [
  28302. '7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c',
  28303. '30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2'
  28304. ],
  28305. [
  28306. '948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519',
  28307. 'e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e'
  28308. ],
  28309. [
  28310. '7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab',
  28311. '100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437'
  28312. ],
  28313. [
  28314. '3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca',
  28315. 'ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311'
  28316. ],
  28317. [
  28318. 'd3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf',
  28319. '8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4'
  28320. ],
  28321. [
  28322. '1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610',
  28323. '68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575'
  28324. ],
  28325. [
  28326. '733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4',
  28327. 'f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d'
  28328. ],
  28329. [
  28330. '15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c',
  28331. 'd56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d'
  28332. ],
  28333. [
  28334. 'a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940',
  28335. 'edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629'
  28336. ],
  28337. [
  28338. 'e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980',
  28339. 'a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06'
  28340. ],
  28341. [
  28342. '311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3',
  28343. '66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374'
  28344. ],
  28345. [
  28346. '34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf',
  28347. '9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee'
  28348. ],
  28349. [
  28350. 'f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63',
  28351. '4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1'
  28352. ],
  28353. [
  28354. 'd7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448',
  28355. 'fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b'
  28356. ],
  28357. [
  28358. '32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf',
  28359. '5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661'
  28360. ],
  28361. [
  28362. '7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5',
  28363. '8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6'
  28364. ],
  28365. [
  28366. 'ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6',
  28367. '8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e'
  28368. ],
  28369. [
  28370. '16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5',
  28371. '5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d'
  28372. ],
  28373. [
  28374. 'eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99',
  28375. 'f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc'
  28376. ],
  28377. [
  28378. '78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51',
  28379. 'f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4'
  28380. ],
  28381. [
  28382. '494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5',
  28383. '42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c'
  28384. ],
  28385. [
  28386. 'a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5',
  28387. '204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b'
  28388. ],
  28389. [
  28390. 'c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997',
  28391. '4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913'
  28392. ],
  28393. [
  28394. '841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881',
  28395. '73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154'
  28396. ],
  28397. [
  28398. '5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5',
  28399. '39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865'
  28400. ],
  28401. [
  28402. '36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66',
  28403. 'd2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc'
  28404. ],
  28405. [
  28406. '336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726',
  28407. 'ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224'
  28408. ],
  28409. [
  28410. '8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede',
  28411. '6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e'
  28412. ],
  28413. [
  28414. '1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94',
  28415. '60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6'
  28416. ],
  28417. [
  28418. '85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31',
  28419. '3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511'
  28420. ],
  28421. [
  28422. '29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51',
  28423. 'b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b'
  28424. ],
  28425. [
  28426. 'a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252',
  28427. 'ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2'
  28428. ],
  28429. [
  28430. '4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5',
  28431. 'cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c'
  28432. ],
  28433. [
  28434. 'd24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b',
  28435. '6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3'
  28436. ],
  28437. [
  28438. 'ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4',
  28439. '322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d'
  28440. ],
  28441. [
  28442. 'af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f',
  28443. '6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700'
  28444. ],
  28445. [
  28446. 'e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889',
  28447. '2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4'
  28448. ],
  28449. [
  28450. '591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246',
  28451. 'b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196'
  28452. ],
  28453. [
  28454. '11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984',
  28455. '998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4'
  28456. ],
  28457. [
  28458. '3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a',
  28459. 'b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257'
  28460. ],
  28461. [
  28462. 'cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030',
  28463. 'bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13'
  28464. ],
  28465. [
  28466. 'c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197',
  28467. '6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096'
  28468. ],
  28469. [
  28470. 'c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593',
  28471. 'c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38'
  28472. ],
  28473. [
  28474. 'a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef',
  28475. '21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f'
  28476. ],
  28477. [
  28478. '347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38',
  28479. '60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448'
  28480. ],
  28481. [
  28482. 'da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a',
  28483. '49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a'
  28484. ],
  28485. [
  28486. 'c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111',
  28487. '5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4'
  28488. ],
  28489. [
  28490. '4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502',
  28491. '7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437'
  28492. ],
  28493. [
  28494. '3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea',
  28495. 'be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7'
  28496. ],
  28497. [
  28498. 'cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26',
  28499. '8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d'
  28500. ],
  28501. [
  28502. 'b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986',
  28503. '39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a'
  28504. ],
  28505. [
  28506. 'd4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e',
  28507. '62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54'
  28508. ],
  28509. [
  28510. '48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4',
  28511. '25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77'
  28512. ],
  28513. [
  28514. 'dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda',
  28515. 'ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517'
  28516. ],
  28517. [
  28518. '6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859',
  28519. 'cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10'
  28520. ],
  28521. [
  28522. 'e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f',
  28523. 'f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125'
  28524. ],
  28525. [
  28526. 'eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c',
  28527. '6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e'
  28528. ],
  28529. [
  28530. '13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942',
  28531. 'fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1'
  28532. ],
  28533. [
  28534. 'ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a',
  28535. '1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2'
  28536. ],
  28537. [
  28538. 'b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80',
  28539. '5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423'
  28540. ],
  28541. [
  28542. 'ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d',
  28543. '438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8'
  28544. ],
  28545. [
  28546. '8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1',
  28547. 'cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758'
  28548. ],
  28549. [
  28550. '52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63',
  28551. 'c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375'
  28552. ],
  28553. [
  28554. 'e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352',
  28555. '6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d'
  28556. ],
  28557. [
  28558. '7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193',
  28559. 'ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec'
  28560. ],
  28561. [
  28562. '5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00',
  28563. '9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0'
  28564. ],
  28565. [
  28566. '32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58',
  28567. 'ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c'
  28568. ],
  28569. [
  28570. 'e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7',
  28571. 'd3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4'
  28572. ],
  28573. [
  28574. '8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8',
  28575. 'c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f'
  28576. ],
  28577. [
  28578. '4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e',
  28579. '67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649'
  28580. ],
  28581. [
  28582. '3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d',
  28583. 'cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826'
  28584. ],
  28585. [
  28586. '674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b',
  28587. '299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5'
  28588. ],
  28589. [
  28590. 'd32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f',
  28591. 'f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87'
  28592. ],
  28593. [
  28594. '30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6',
  28595. '462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b'
  28596. ],
  28597. [
  28598. 'be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297',
  28599. '62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc'
  28600. ],
  28601. [
  28602. '93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a',
  28603. '7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c'
  28604. ],
  28605. [
  28606. 'b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c',
  28607. 'ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f'
  28608. ],
  28609. [
  28610. 'd5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52',
  28611. '4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a'
  28612. ],
  28613. [
  28614. 'd3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb',
  28615. 'bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46'
  28616. ],
  28617. [
  28618. '463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065',
  28619. 'bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f'
  28620. ],
  28621. [
  28622. '7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917',
  28623. '603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03'
  28624. ],
  28625. [
  28626. '74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9',
  28627. 'cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08'
  28628. ],
  28629. [
  28630. '30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3',
  28631. '553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8'
  28632. ],
  28633. [
  28634. '9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57',
  28635. '712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373'
  28636. ],
  28637. [
  28638. '176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66',
  28639. 'ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3'
  28640. ],
  28641. [
  28642. '75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8',
  28643. '9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8'
  28644. ],
  28645. [
  28646. '809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721',
  28647. '9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1'
  28648. ],
  28649. [
  28650. '1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180',
  28651. '4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9'
  28652. ]
  28653. ]
  28654. }
  28655. };
  28656. /***/ }),
  28657. /* 164 */
  28658. /*!********************************************************!*\
  28659. !*** ./node_modules/elliptic/lib/elliptic/ec/index.js ***!
  28660. \********************************************************/
  28661. /*! no static exports found */
  28662. /***/ (function(module, exports, __webpack_require__) {
  28663. "use strict";
  28664. var BN = __webpack_require__(/*! bn.js */ 130);
  28665. var HmacDRBG = __webpack_require__(/*! hmac-drbg */ 165);
  28666. var utils = __webpack_require__(/*! ../utils */ 143);
  28667. var curves = __webpack_require__(/*! ../curves */ 150);
  28668. var rand = __webpack_require__(/*! brorand */ 134);
  28669. var assert = utils.assert;
  28670. var KeyPair = __webpack_require__(/*! ./key */ 166);
  28671. var Signature = __webpack_require__(/*! ./signature */ 167);
  28672. function EC(options) {
  28673. if (!(this instanceof EC))
  28674. return new EC(options);
  28675. // Shortcut `elliptic.ec(curve-name)`
  28676. if (typeof options === 'string') {
  28677. assert(curves.hasOwnProperty(options), 'Unknown curve ' + options);
  28678. options = curves[options];
  28679. }
  28680. // Shortcut for `elliptic.ec(elliptic.curves.curveName)`
  28681. if (options instanceof curves.PresetCurve)
  28682. options = { curve: options };
  28683. this.curve = options.curve.curve;
  28684. this.n = this.curve.n;
  28685. this.nh = this.n.ushrn(1);
  28686. this.g = this.curve.g;
  28687. // Point on curve
  28688. this.g = options.curve.g;
  28689. this.g.precompute(options.curve.n.bitLength() + 1);
  28690. // Hash for function for DRBG
  28691. this.hash = options.hash || options.curve.hash;
  28692. }
  28693. module.exports = EC;
  28694. EC.prototype.keyPair = function keyPair(options) {
  28695. return new KeyPair(this, options);
  28696. };
  28697. EC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) {
  28698. return KeyPair.fromPrivate(this, priv, enc);
  28699. };
  28700. EC.prototype.keyFromPublic = function keyFromPublic(pub, enc) {
  28701. return KeyPair.fromPublic(this, pub, enc);
  28702. };
  28703. EC.prototype.genKeyPair = function genKeyPair(options) {
  28704. if (!options)
  28705. options = {};
  28706. // Instantiate Hmac_DRBG
  28707. var drbg = new HmacDRBG({
  28708. hash: this.hash,
  28709. pers: options.pers,
  28710. persEnc: options.persEnc || 'utf8',
  28711. entropy: options.entropy || rand(this.hash.hmacStrength),
  28712. entropyEnc: options.entropy && options.entropyEnc || 'utf8',
  28713. nonce: this.n.toArray()
  28714. });
  28715. var bytes = this.n.byteLength();
  28716. var ns2 = this.n.sub(new BN(2));
  28717. do {
  28718. var priv = new BN(drbg.generate(bytes));
  28719. if (priv.cmp(ns2) > 0)
  28720. continue;
  28721. priv.iaddn(1);
  28722. return this.keyFromPrivate(priv);
  28723. } while (true);
  28724. };
  28725. EC.prototype._truncateToN = function truncateToN(msg, truncOnly) {
  28726. var delta = msg.byteLength() * 8 - this.n.bitLength();
  28727. if (delta > 0)
  28728. msg = msg.ushrn(delta);
  28729. if (!truncOnly && msg.cmp(this.n) >= 0)
  28730. return msg.sub(this.n);
  28731. else
  28732. return msg;
  28733. };
  28734. EC.prototype.sign = function sign(msg, key, enc, options) {
  28735. if (typeof enc === 'object') {
  28736. options = enc;
  28737. enc = null;
  28738. }
  28739. if (!options)
  28740. options = {};
  28741. key = this.keyFromPrivate(key, enc);
  28742. msg = this._truncateToN(new BN(msg, 16));
  28743. // Zero-extend key to provide enough entropy
  28744. var bytes = this.n.byteLength();
  28745. var bkey = key.getPrivate().toArray('be', bytes);
  28746. // Zero-extend nonce to have the same byte size as N
  28747. var nonce = msg.toArray('be', bytes);
  28748. // Instantiate Hmac_DRBG
  28749. var drbg = new HmacDRBG({
  28750. hash: this.hash,
  28751. entropy: bkey,
  28752. nonce: nonce,
  28753. pers: options.pers,
  28754. persEnc: options.persEnc || 'utf8'
  28755. });
  28756. // Number of bytes to generate
  28757. var ns1 = this.n.sub(new BN(1));
  28758. for (var iter = 0; true; iter++) {
  28759. var k = options.k ?
  28760. options.k(iter) :
  28761. new BN(drbg.generate(this.n.byteLength()));
  28762. k = this._truncateToN(k, true);
  28763. if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0)
  28764. continue;
  28765. var kp = this.g.mul(k);
  28766. if (kp.isInfinity())
  28767. continue;
  28768. var kpX = kp.getX();
  28769. var r = kpX.umod(this.n);
  28770. if (r.cmpn(0) === 0)
  28771. continue;
  28772. var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg));
  28773. s = s.umod(this.n);
  28774. if (s.cmpn(0) === 0)
  28775. continue;
  28776. var recoveryParam = (kp.getY().isOdd() ? 1 : 0) |
  28777. (kpX.cmp(r) !== 0 ? 2 : 0);
  28778. // Use complement of `s`, if it is > `n / 2`
  28779. if (options.canonical && s.cmp(this.nh) > 0) {
  28780. s = this.n.sub(s);
  28781. recoveryParam ^= 1;
  28782. }
  28783. return new Signature({ r: r, s: s, recoveryParam: recoveryParam });
  28784. }
  28785. };
  28786. EC.prototype.verify = function verify(msg, signature, key, enc) {
  28787. msg = this._truncateToN(new BN(msg, 16));
  28788. key = this.keyFromPublic(key, enc);
  28789. signature = new Signature(signature, 'hex');
  28790. // Perform primitive values validation
  28791. var r = signature.r;
  28792. var s = signature.s;
  28793. if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0)
  28794. return false;
  28795. if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0)
  28796. return false;
  28797. // Validate signature
  28798. var sinv = s.invm(this.n);
  28799. var u1 = sinv.mul(msg).umod(this.n);
  28800. var u2 = sinv.mul(r).umod(this.n);
  28801. if (!this.curve._maxwellTrick) {
  28802. var p = this.g.mulAdd(u1, key.getPublic(), u2);
  28803. if (p.isInfinity())
  28804. return false;
  28805. return p.getX().umod(this.n).cmp(r) === 0;
  28806. }
  28807. // NOTE: Greg Maxwell's trick, inspired by:
  28808. // https://git.io/vad3K
  28809. var p = this.g.jmulAdd(u1, key.getPublic(), u2);
  28810. if (p.isInfinity())
  28811. return false;
  28812. // Compare `p.x` of Jacobian point with `r`,
  28813. // this will do `p.x == r * p.z^2` instead of multiplying `p.x` by the
  28814. // inverse of `p.z^2`
  28815. return p.eqXToP(r);
  28816. };
  28817. EC.prototype.recoverPubKey = function(msg, signature, j, enc) {
  28818. assert((3 & j) === j, 'The recovery param is more than two bits');
  28819. signature = new Signature(signature, enc);
  28820. var n = this.n;
  28821. var e = new BN(msg);
  28822. var r = signature.r;
  28823. var s = signature.s;
  28824. // A set LSB signifies that the y-coordinate is odd
  28825. var isYOdd = j & 1;
  28826. var isSecondKey = j >> 1;
  28827. if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey)
  28828. throw new Error('Unable to find sencond key candinate');
  28829. // 1.1. Let x = r + jn.
  28830. if (isSecondKey)
  28831. r = this.curve.pointFromX(r.add(this.curve.n), isYOdd);
  28832. else
  28833. r = this.curve.pointFromX(r, isYOdd);
  28834. var rInv = signature.r.invm(n);
  28835. var s1 = n.sub(e).mul(rInv).umod(n);
  28836. var s2 = s.mul(rInv).umod(n);
  28837. // 1.6.1 Compute Q = r^-1 (sR - eG)
  28838. // Q = r^-1 (sR + -eG)
  28839. return this.g.mulAdd(s1, r, s2);
  28840. };
  28841. EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) {
  28842. signature = new Signature(signature, enc);
  28843. if (signature.recoveryParam !== null)
  28844. return signature.recoveryParam;
  28845. for (var i = 0; i < 4; i++) {
  28846. var Qprime;
  28847. try {
  28848. Qprime = this.recoverPubKey(e, signature, i);
  28849. } catch (e) {
  28850. continue;
  28851. }
  28852. if (Qprime.eq(Q))
  28853. return i;
  28854. }
  28855. throw new Error('Unable to find valid recovery factor');
  28856. };
  28857. /***/ }),
  28858. /* 165 */
  28859. /*!*************************************************!*\
  28860. !*** ./node_modules/hmac-drbg/lib/hmac-drbg.js ***!
  28861. \*************************************************/
  28862. /*! no static exports found */
  28863. /***/ (function(module, exports, __webpack_require__) {
  28864. "use strict";
  28865. var hash = __webpack_require__(/*! hash.js */ 151);
  28866. var utils = __webpack_require__(/*! minimalistic-crypto-utils */ 144);
  28867. var assert = __webpack_require__(/*! minimalistic-assert */ 104);
  28868. function HmacDRBG(options) {
  28869. if (!(this instanceof HmacDRBG))
  28870. return new HmacDRBG(options);
  28871. this.hash = options.hash;
  28872. this.predResist = !!options.predResist;
  28873. this.outLen = this.hash.outSize;
  28874. this.minEntropy = options.minEntropy || this.hash.hmacStrength;
  28875. this._reseed = null;
  28876. this.reseedInterval = null;
  28877. this.K = null;
  28878. this.V = null;
  28879. var entropy = utils.toArray(options.entropy, options.entropyEnc || 'hex');
  28880. var nonce = utils.toArray(options.nonce, options.nonceEnc || 'hex');
  28881. var pers = utils.toArray(options.pers, options.persEnc || 'hex');
  28882. assert(entropy.length >= (this.minEntropy / 8),
  28883. 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');
  28884. this._init(entropy, nonce, pers);
  28885. }
  28886. module.exports = HmacDRBG;
  28887. HmacDRBG.prototype._init = function init(entropy, nonce, pers) {
  28888. var seed = entropy.concat(nonce).concat(pers);
  28889. this.K = new Array(this.outLen / 8);
  28890. this.V = new Array(this.outLen / 8);
  28891. for (var i = 0; i < this.V.length; i++) {
  28892. this.K[i] = 0x00;
  28893. this.V[i] = 0x01;
  28894. }
  28895. this._update(seed);
  28896. this._reseed = 1;
  28897. this.reseedInterval = 0x1000000000000; // 2^48
  28898. };
  28899. HmacDRBG.prototype._hmac = function hmac() {
  28900. return new hash.hmac(this.hash, this.K);
  28901. };
  28902. HmacDRBG.prototype._update = function update(seed) {
  28903. var kmac = this._hmac()
  28904. .update(this.V)
  28905. .update([ 0x00 ]);
  28906. if (seed)
  28907. kmac = kmac.update(seed);
  28908. this.K = kmac.digest();
  28909. this.V = this._hmac().update(this.V).digest();
  28910. if (!seed)
  28911. return;
  28912. this.K = this._hmac()
  28913. .update(this.V)
  28914. .update([ 0x01 ])
  28915. .update(seed)
  28916. .digest();
  28917. this.V = this._hmac().update(this.V).digest();
  28918. };
  28919. HmacDRBG.prototype.reseed = function reseed(entropy, entropyEnc, add, addEnc) {
  28920. // Optional entropy enc
  28921. if (typeof entropyEnc !== 'string') {
  28922. addEnc = add;
  28923. add = entropyEnc;
  28924. entropyEnc = null;
  28925. }
  28926. entropy = utils.toArray(entropy, entropyEnc);
  28927. add = utils.toArray(add, addEnc);
  28928. assert(entropy.length >= (this.minEntropy / 8),
  28929. 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');
  28930. this._update(entropy.concat(add || []));
  28931. this._reseed = 1;
  28932. };
  28933. HmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) {
  28934. if (this._reseed > this.reseedInterval)
  28935. throw new Error('Reseed is required');
  28936. // Optional encoding
  28937. if (typeof enc !== 'string') {
  28938. addEnc = add;
  28939. add = enc;
  28940. enc = null;
  28941. }
  28942. // Optional additional data
  28943. if (add) {
  28944. add = utils.toArray(add, addEnc || 'hex');
  28945. this._update(add);
  28946. }
  28947. var temp = [];
  28948. while (temp.length < len) {
  28949. this.V = this._hmac().update(this.V).digest();
  28950. temp = temp.concat(this.V);
  28951. }
  28952. var res = temp.slice(0, len);
  28953. this._update(add);
  28954. this._reseed++;
  28955. return utils.encode(res, enc);
  28956. };
  28957. /***/ }),
  28958. /* 166 */
  28959. /*!******************************************************!*\
  28960. !*** ./node_modules/elliptic/lib/elliptic/ec/key.js ***!
  28961. \******************************************************/
  28962. /*! no static exports found */
  28963. /***/ (function(module, exports, __webpack_require__) {
  28964. "use strict";
  28965. var BN = __webpack_require__(/*! bn.js */ 130);
  28966. var utils = __webpack_require__(/*! ../utils */ 143);
  28967. var assert = utils.assert;
  28968. function KeyPair(ec, options) {
  28969. this.ec = ec;
  28970. this.priv = null;
  28971. this.pub = null;
  28972. // KeyPair(ec, { priv: ..., pub: ... })
  28973. if (options.priv)
  28974. this._importPrivate(options.priv, options.privEnc);
  28975. if (options.pub)
  28976. this._importPublic(options.pub, options.pubEnc);
  28977. }
  28978. module.exports = KeyPair;
  28979. KeyPair.fromPublic = function fromPublic(ec, pub, enc) {
  28980. if (pub instanceof KeyPair)
  28981. return pub;
  28982. return new KeyPair(ec, {
  28983. pub: pub,
  28984. pubEnc: enc
  28985. });
  28986. };
  28987. KeyPair.fromPrivate = function fromPrivate(ec, priv, enc) {
  28988. if (priv instanceof KeyPair)
  28989. return priv;
  28990. return new KeyPair(ec, {
  28991. priv: priv,
  28992. privEnc: enc
  28993. });
  28994. };
  28995. KeyPair.prototype.validate = function validate() {
  28996. var pub = this.getPublic();
  28997. if (pub.isInfinity())
  28998. return { result: false, reason: 'Invalid public key' };
  28999. if (!pub.validate())
  29000. return { result: false, reason: 'Public key is not a point' };
  29001. if (!pub.mul(this.ec.curve.n).isInfinity())
  29002. return { result: false, reason: 'Public key * N != O' };
  29003. return { result: true, reason: null };
  29004. };
  29005. KeyPair.prototype.getPublic = function getPublic(compact, enc) {
  29006. // compact is optional argument
  29007. if (typeof compact === 'string') {
  29008. enc = compact;
  29009. compact = null;
  29010. }
  29011. if (!this.pub)
  29012. this.pub = this.ec.g.mul(this.priv);
  29013. if (!enc)
  29014. return this.pub;
  29015. return this.pub.encode(enc, compact);
  29016. };
  29017. KeyPair.prototype.getPrivate = function getPrivate(enc) {
  29018. if (enc === 'hex')
  29019. return this.priv.toString(16, 2);
  29020. else
  29021. return this.priv;
  29022. };
  29023. KeyPair.prototype._importPrivate = function _importPrivate(key, enc) {
  29024. this.priv = new BN(key, enc || 16);
  29025. // Ensure that the priv won't be bigger than n, otherwise we may fail
  29026. // in fixed multiplication method
  29027. this.priv = this.priv.umod(this.ec.curve.n);
  29028. };
  29029. KeyPair.prototype._importPublic = function _importPublic(key, enc) {
  29030. if (key.x || key.y) {
  29031. // Montgomery points only have an `x` coordinate.
  29032. // Weierstrass/Edwards points on the other hand have both `x` and
  29033. // `y` coordinates.
  29034. if (this.ec.curve.type === 'mont') {
  29035. assert(key.x, 'Need x coordinate');
  29036. } else if (this.ec.curve.type === 'short' ||
  29037. this.ec.curve.type === 'edwards') {
  29038. assert(key.x && key.y, 'Need both x and y coordinate');
  29039. }
  29040. this.pub = this.ec.curve.point(key.x, key.y);
  29041. return;
  29042. }
  29043. this.pub = this.ec.curve.decodePoint(key, enc);
  29044. };
  29045. // ECDH
  29046. KeyPair.prototype.derive = function derive(pub) {
  29047. return pub.mul(this.priv).getX();
  29048. };
  29049. // ECDSA
  29050. KeyPair.prototype.sign = function sign(msg, enc, options) {
  29051. return this.ec.sign(msg, this, enc, options);
  29052. };
  29053. KeyPair.prototype.verify = function verify(msg, signature) {
  29054. return this.ec.verify(msg, signature, this);
  29055. };
  29056. KeyPair.prototype.inspect = function inspect() {
  29057. return '<Key priv: ' + (this.priv && this.priv.toString(16, 2)) +
  29058. ' pub: ' + (this.pub && this.pub.inspect()) + ' >';
  29059. };
  29060. /***/ }),
  29061. /* 167 */
  29062. /*!************************************************************!*\
  29063. !*** ./node_modules/elliptic/lib/elliptic/ec/signature.js ***!
  29064. \************************************************************/
  29065. /*! no static exports found */
  29066. /***/ (function(module, exports, __webpack_require__) {
  29067. "use strict";
  29068. var BN = __webpack_require__(/*! bn.js */ 130);
  29069. var utils = __webpack_require__(/*! ../utils */ 143);
  29070. var assert = utils.assert;
  29071. function Signature(options, enc) {
  29072. if (options instanceof Signature)
  29073. return options;
  29074. if (this._importDER(options, enc))
  29075. return;
  29076. assert(options.r && options.s, 'Signature without r or s');
  29077. this.r = new BN(options.r, 16);
  29078. this.s = new BN(options.s, 16);
  29079. if (options.recoveryParam === undefined)
  29080. this.recoveryParam = null;
  29081. else
  29082. this.recoveryParam = options.recoveryParam;
  29083. }
  29084. module.exports = Signature;
  29085. function Position() {
  29086. this.place = 0;
  29087. }
  29088. function getLength(buf, p) {
  29089. var initial = buf[p.place++];
  29090. if (!(initial & 0x80)) {
  29091. return initial;
  29092. }
  29093. var octetLen = initial & 0xf;
  29094. var val = 0;
  29095. for (var i = 0, off = p.place; i < octetLen; i++, off++) {
  29096. val <<= 8;
  29097. val |= buf[off];
  29098. }
  29099. p.place = off;
  29100. return val;
  29101. }
  29102. function rmPadding(buf) {
  29103. var i = 0;
  29104. var len = buf.length - 1;
  29105. while (!buf[i] && !(buf[i + 1] & 0x80) && i < len) {
  29106. i++;
  29107. }
  29108. if (i === 0) {
  29109. return buf;
  29110. }
  29111. return buf.slice(i);
  29112. }
  29113. Signature.prototype._importDER = function _importDER(data, enc) {
  29114. data = utils.toArray(data, enc);
  29115. var p = new Position();
  29116. if (data[p.place++] !== 0x30) {
  29117. return false;
  29118. }
  29119. var len = getLength(data, p);
  29120. if ((len + p.place) !== data.length) {
  29121. return false;
  29122. }
  29123. if (data[p.place++] !== 0x02) {
  29124. return false;
  29125. }
  29126. var rlen = getLength(data, p);
  29127. var r = data.slice(p.place, rlen + p.place);
  29128. p.place += rlen;
  29129. if (data[p.place++] !== 0x02) {
  29130. return false;
  29131. }
  29132. var slen = getLength(data, p);
  29133. if (data.length !== slen + p.place) {
  29134. return false;
  29135. }
  29136. var s = data.slice(p.place, slen + p.place);
  29137. if (r[0] === 0 && (r[1] & 0x80)) {
  29138. r = r.slice(1);
  29139. }
  29140. if (s[0] === 0 && (s[1] & 0x80)) {
  29141. s = s.slice(1);
  29142. }
  29143. this.r = new BN(r);
  29144. this.s = new BN(s);
  29145. this.recoveryParam = null;
  29146. return true;
  29147. };
  29148. function constructLength(arr, len) {
  29149. if (len < 0x80) {
  29150. arr.push(len);
  29151. return;
  29152. }
  29153. var octets = 1 + (Math.log(len) / Math.LN2 >>> 3);
  29154. arr.push(octets | 0x80);
  29155. while (--octets) {
  29156. arr.push((len >>> (octets << 3)) & 0xff);
  29157. }
  29158. arr.push(len);
  29159. }
  29160. Signature.prototype.toDER = function toDER(enc) {
  29161. var r = this.r.toArray();
  29162. var s = this.s.toArray();
  29163. // Pad values
  29164. if (r[0] & 0x80)
  29165. r = [ 0 ].concat(r);
  29166. // Pad values
  29167. if (s[0] & 0x80)
  29168. s = [ 0 ].concat(s);
  29169. r = rmPadding(r);
  29170. s = rmPadding(s);
  29171. while (!s[0] && !(s[1] & 0x80)) {
  29172. s = s.slice(1);
  29173. }
  29174. var arr = [ 0x02 ];
  29175. constructLength(arr, r.length);
  29176. arr = arr.concat(r);
  29177. arr.push(0x02);
  29178. constructLength(arr, s.length);
  29179. var backHalf = arr.concat(s);
  29180. var res = [ 0x30 ];
  29181. constructLength(res, backHalf.length);
  29182. res = res.concat(backHalf);
  29183. return utils.encode(res, enc);
  29184. };
  29185. /***/ }),
  29186. /* 168 */
  29187. /*!***********************************************************!*\
  29188. !*** ./node_modules/elliptic/lib/elliptic/eddsa/index.js ***!
  29189. \***********************************************************/
  29190. /*! no static exports found */
  29191. /***/ (function(module, exports, __webpack_require__) {
  29192. "use strict";
  29193. var hash = __webpack_require__(/*! hash.js */ 151);
  29194. var curves = __webpack_require__(/*! ../curves */ 150);
  29195. var utils = __webpack_require__(/*! ../utils */ 143);
  29196. var assert = utils.assert;
  29197. var parseBytes = utils.parseBytes;
  29198. var KeyPair = __webpack_require__(/*! ./key */ 169);
  29199. var Signature = __webpack_require__(/*! ./signature */ 170);
  29200. function EDDSA(curve) {
  29201. assert(curve === 'ed25519', 'only tested with ed25519 so far');
  29202. if (!(this instanceof EDDSA))
  29203. return new EDDSA(curve);
  29204. var curve = curves[curve].curve;
  29205. this.curve = curve;
  29206. this.g = curve.g;
  29207. this.g.precompute(curve.n.bitLength() + 1);
  29208. this.pointClass = curve.point().constructor;
  29209. this.encodingLength = Math.ceil(curve.n.bitLength() / 8);
  29210. this.hash = hash.sha512;
  29211. }
  29212. module.exports = EDDSA;
  29213. /**
  29214. * @param {Array|String} message - message bytes
  29215. * @param {Array|String|KeyPair} secret - secret bytes or a keypair
  29216. * @returns {Signature} - signature
  29217. */
  29218. EDDSA.prototype.sign = function sign(message, secret) {
  29219. message = parseBytes(message);
  29220. var key = this.keyFromSecret(secret);
  29221. var r = this.hashInt(key.messagePrefix(), message);
  29222. var R = this.g.mul(r);
  29223. var Rencoded = this.encodePoint(R);
  29224. var s_ = this.hashInt(Rencoded, key.pubBytes(), message)
  29225. .mul(key.priv());
  29226. var S = r.add(s_).umod(this.curve.n);
  29227. return this.makeSignature({ R: R, S: S, Rencoded: Rencoded });
  29228. };
  29229. /**
  29230. * @param {Array} message - message bytes
  29231. * @param {Array|String|Signature} sig - sig bytes
  29232. * @param {Array|String|Point|KeyPair} pub - public key
  29233. * @returns {Boolean} - true if public key matches sig of message
  29234. */
  29235. EDDSA.prototype.verify = function verify(message, sig, pub) {
  29236. message = parseBytes(message);
  29237. sig = this.makeSignature(sig);
  29238. var key = this.keyFromPublic(pub);
  29239. var h = this.hashInt(sig.Rencoded(), key.pubBytes(), message);
  29240. var SG = this.g.mul(sig.S());
  29241. var RplusAh = sig.R().add(key.pub().mul(h));
  29242. return RplusAh.eq(SG);
  29243. };
  29244. EDDSA.prototype.hashInt = function hashInt() {
  29245. var hash = this.hash();
  29246. for (var i = 0; i < arguments.length; i++)
  29247. hash.update(arguments[i]);
  29248. return utils.intFromLE(hash.digest()).umod(this.curve.n);
  29249. };
  29250. EDDSA.prototype.keyFromPublic = function keyFromPublic(pub) {
  29251. return KeyPair.fromPublic(this, pub);
  29252. };
  29253. EDDSA.prototype.keyFromSecret = function keyFromSecret(secret) {
  29254. return KeyPair.fromSecret(this, secret);
  29255. };
  29256. EDDSA.prototype.makeSignature = function makeSignature(sig) {
  29257. if (sig instanceof Signature)
  29258. return sig;
  29259. return new Signature(this, sig);
  29260. };
  29261. /**
  29262. * * https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-03#section-5.2
  29263. *
  29264. * EDDSA defines methods for encoding and decoding points and integers. These are
  29265. * helper convenience methods, that pass along to utility functions implied
  29266. * parameters.
  29267. *
  29268. */
  29269. EDDSA.prototype.encodePoint = function encodePoint(point) {
  29270. var enc = point.getY().toArray('le', this.encodingLength);
  29271. enc[this.encodingLength - 1] |= point.getX().isOdd() ? 0x80 : 0;
  29272. return enc;
  29273. };
  29274. EDDSA.prototype.decodePoint = function decodePoint(bytes) {
  29275. bytes = utils.parseBytes(bytes);
  29276. var lastIx = bytes.length - 1;
  29277. var normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & ~0x80);
  29278. var xIsOdd = (bytes[lastIx] & 0x80) !== 0;
  29279. var y = utils.intFromLE(normed);
  29280. return this.curve.pointFromY(y, xIsOdd);
  29281. };
  29282. EDDSA.prototype.encodeInt = function encodeInt(num) {
  29283. return num.toArray('le', this.encodingLength);
  29284. };
  29285. EDDSA.prototype.decodeInt = function decodeInt(bytes) {
  29286. return utils.intFromLE(bytes);
  29287. };
  29288. EDDSA.prototype.isPoint = function isPoint(val) {
  29289. return val instanceof this.pointClass;
  29290. };
  29291. /***/ }),
  29292. /* 169 */
  29293. /*!*********************************************************!*\
  29294. !*** ./node_modules/elliptic/lib/elliptic/eddsa/key.js ***!
  29295. \*********************************************************/
  29296. /*! no static exports found */
  29297. /***/ (function(module, exports, __webpack_require__) {
  29298. "use strict";
  29299. var utils = __webpack_require__(/*! ../utils */ 143);
  29300. var assert = utils.assert;
  29301. var parseBytes = utils.parseBytes;
  29302. var cachedProperty = utils.cachedProperty;
  29303. /**
  29304. * @param {EDDSA} eddsa - instance
  29305. * @param {Object} params - public/private key parameters
  29306. *
  29307. * @param {Array<Byte>} [params.secret] - secret seed bytes
  29308. * @param {Point} [params.pub] - public key point (aka `A` in eddsa terms)
  29309. * @param {Array<Byte>} [params.pub] - public key point encoded as bytes
  29310. *
  29311. */
  29312. function KeyPair(eddsa, params) {
  29313. this.eddsa = eddsa;
  29314. this._secret = parseBytes(params.secret);
  29315. if (eddsa.isPoint(params.pub))
  29316. this._pub = params.pub;
  29317. else
  29318. this._pubBytes = parseBytes(params.pub);
  29319. }
  29320. KeyPair.fromPublic = function fromPublic(eddsa, pub) {
  29321. if (pub instanceof KeyPair)
  29322. return pub;
  29323. return new KeyPair(eddsa, { pub: pub });
  29324. };
  29325. KeyPair.fromSecret = function fromSecret(eddsa, secret) {
  29326. if (secret instanceof KeyPair)
  29327. return secret;
  29328. return new KeyPair(eddsa, { secret: secret });
  29329. };
  29330. KeyPair.prototype.secret = function secret() {
  29331. return this._secret;
  29332. };
  29333. cachedProperty(KeyPair, 'pubBytes', function pubBytes() {
  29334. return this.eddsa.encodePoint(this.pub());
  29335. });
  29336. cachedProperty(KeyPair, 'pub', function pub() {
  29337. if (this._pubBytes)
  29338. return this.eddsa.decodePoint(this._pubBytes);
  29339. return this.eddsa.g.mul(this.priv());
  29340. });
  29341. cachedProperty(KeyPair, 'privBytes', function privBytes() {
  29342. var eddsa = this.eddsa;
  29343. var hash = this.hash();
  29344. var lastIx = eddsa.encodingLength - 1;
  29345. var a = hash.slice(0, eddsa.encodingLength);
  29346. a[0] &= 248;
  29347. a[lastIx] &= 127;
  29348. a[lastIx] |= 64;
  29349. return a;
  29350. });
  29351. cachedProperty(KeyPair, 'priv', function priv() {
  29352. return this.eddsa.decodeInt(this.privBytes());
  29353. });
  29354. cachedProperty(KeyPair, 'hash', function hash() {
  29355. return this.eddsa.hash().update(this.secret()).digest();
  29356. });
  29357. cachedProperty(KeyPair, 'messagePrefix', function messagePrefix() {
  29358. return this.hash().slice(this.eddsa.encodingLength);
  29359. });
  29360. KeyPair.prototype.sign = function sign(message) {
  29361. assert(this._secret, 'KeyPair can only verify');
  29362. return this.eddsa.sign(message, this);
  29363. };
  29364. KeyPair.prototype.verify = function verify(message, sig) {
  29365. return this.eddsa.verify(message, sig, this);
  29366. };
  29367. KeyPair.prototype.getSecret = function getSecret(enc) {
  29368. assert(this._secret, 'KeyPair is public only');
  29369. return utils.encode(this.secret(), enc);
  29370. };
  29371. KeyPair.prototype.getPublic = function getPublic(enc) {
  29372. return utils.encode(this.pubBytes(), enc);
  29373. };
  29374. module.exports = KeyPair;
  29375. /***/ }),
  29376. /* 170 */
  29377. /*!***************************************************************!*\
  29378. !*** ./node_modules/elliptic/lib/elliptic/eddsa/signature.js ***!
  29379. \***************************************************************/
  29380. /*! no static exports found */
  29381. /***/ (function(module, exports, __webpack_require__) {
  29382. "use strict";
  29383. var BN = __webpack_require__(/*! bn.js */ 130);
  29384. var utils = __webpack_require__(/*! ../utils */ 143);
  29385. var assert = utils.assert;
  29386. var cachedProperty = utils.cachedProperty;
  29387. var parseBytes = utils.parseBytes;
  29388. /**
  29389. * @param {EDDSA} eddsa - eddsa instance
  29390. * @param {Array<Bytes>|Object} sig -
  29391. * @param {Array<Bytes>|Point} [sig.R] - R point as Point or bytes
  29392. * @param {Array<Bytes>|bn} [sig.S] - S scalar as bn or bytes
  29393. * @param {Array<Bytes>} [sig.Rencoded] - R point encoded
  29394. * @param {Array<Bytes>} [sig.Sencoded] - S scalar encoded
  29395. */
  29396. function Signature(eddsa, sig) {
  29397. this.eddsa = eddsa;
  29398. if (typeof sig !== 'object')
  29399. sig = parseBytes(sig);
  29400. if (Array.isArray(sig)) {
  29401. sig = {
  29402. R: sig.slice(0, eddsa.encodingLength),
  29403. S: sig.slice(eddsa.encodingLength)
  29404. };
  29405. }
  29406. assert(sig.R && sig.S, 'Signature without R or S');
  29407. if (eddsa.isPoint(sig.R))
  29408. this._R = sig.R;
  29409. if (sig.S instanceof BN)
  29410. this._S = sig.S;
  29411. this._Rencoded = Array.isArray(sig.R) ? sig.R : sig.Rencoded;
  29412. this._Sencoded = Array.isArray(sig.S) ? sig.S : sig.Sencoded;
  29413. }
  29414. cachedProperty(Signature, 'S', function S() {
  29415. return this.eddsa.decodeInt(this.Sencoded());
  29416. });
  29417. cachedProperty(Signature, 'R', function R() {
  29418. return this.eddsa.decodePoint(this.Rencoded());
  29419. });
  29420. cachedProperty(Signature, 'Rencoded', function Rencoded() {
  29421. return this.eddsa.encodePoint(this.R());
  29422. });
  29423. cachedProperty(Signature, 'Sencoded', function Sencoded() {
  29424. return this.eddsa.encodeInt(this.S());
  29425. });
  29426. Signature.prototype.toBytes = function toBytes() {
  29427. return this.Rencoded().concat(this.Sencoded());
  29428. };
  29429. Signature.prototype.toHex = function toHex() {
  29430. return utils.encode(this.toBytes(), 'hex').toUpperCase();
  29431. };
  29432. module.exports = Signature;
  29433. /***/ }),
  29434. /* 171 */
  29435. /*!******************************************!*\
  29436. !*** ./node_modules/parse-asn1/index.js ***!
  29437. \******************************************/
  29438. /*! no static exports found */
  29439. /***/ (function(module, exports, __webpack_require__) {
  29440. var asn1 = __webpack_require__(/*! ./asn1 */ 172)
  29441. var aesid = __webpack_require__(/*! ./aesid.json */ 189)
  29442. var fixProc = __webpack_require__(/*! ./fixProc */ 190)
  29443. var ciphers = __webpack_require__(/*! browserify-aes */ 108)
  29444. var compat = __webpack_require__(/*! pbkdf2 */ 93)
  29445. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  29446. module.exports = parseKeys
  29447. function parseKeys (buffer) {
  29448. var password
  29449. if (typeof buffer === 'object' && !Buffer.isBuffer(buffer)) {
  29450. password = buffer.passphrase
  29451. buffer = buffer.key
  29452. }
  29453. if (typeof buffer === 'string') {
  29454. buffer = Buffer.from(buffer)
  29455. }
  29456. var stripped = fixProc(buffer, password)
  29457. var type = stripped.tag
  29458. var data = stripped.data
  29459. var subtype, ndata
  29460. switch (type) {
  29461. case 'CERTIFICATE':
  29462. ndata = asn1.certificate.decode(data, 'der').tbsCertificate.subjectPublicKeyInfo
  29463. // falls through
  29464. case 'PUBLIC KEY':
  29465. if (!ndata) {
  29466. ndata = asn1.PublicKey.decode(data, 'der')
  29467. }
  29468. subtype = ndata.algorithm.algorithm.join('.')
  29469. switch (subtype) {
  29470. case '1.2.840.113549.1.1.1':
  29471. return asn1.RSAPublicKey.decode(ndata.subjectPublicKey.data, 'der')
  29472. case '1.2.840.10045.2.1':
  29473. ndata.subjectPrivateKey = ndata.subjectPublicKey
  29474. return {
  29475. type: 'ec',
  29476. data: ndata
  29477. }
  29478. case '1.2.840.10040.4.1':
  29479. ndata.algorithm.params.pub_key = asn1.DSAparam.decode(ndata.subjectPublicKey.data, 'der')
  29480. return {
  29481. type: 'dsa',
  29482. data: ndata.algorithm.params
  29483. }
  29484. default: throw new Error('unknown key id ' + subtype)
  29485. }
  29486. throw new Error('unknown key type ' + type)
  29487. case 'ENCRYPTED PRIVATE KEY':
  29488. data = asn1.EncryptedPrivateKey.decode(data, 'der')
  29489. data = decrypt(data, password)
  29490. // falls through
  29491. case 'PRIVATE KEY':
  29492. ndata = asn1.PrivateKey.decode(data, 'der')
  29493. subtype = ndata.algorithm.algorithm.join('.')
  29494. switch (subtype) {
  29495. case '1.2.840.113549.1.1.1':
  29496. return asn1.RSAPrivateKey.decode(ndata.subjectPrivateKey, 'der')
  29497. case '1.2.840.10045.2.1':
  29498. return {
  29499. curve: ndata.algorithm.curve,
  29500. privateKey: asn1.ECPrivateKey.decode(ndata.subjectPrivateKey, 'der').privateKey
  29501. }
  29502. case '1.2.840.10040.4.1':
  29503. ndata.algorithm.params.priv_key = asn1.DSAparam.decode(ndata.subjectPrivateKey, 'der')
  29504. return {
  29505. type: 'dsa',
  29506. params: ndata.algorithm.params
  29507. }
  29508. default: throw new Error('unknown key id ' + subtype)
  29509. }
  29510. throw new Error('unknown key type ' + type)
  29511. case 'RSA PUBLIC KEY':
  29512. return asn1.RSAPublicKey.decode(data, 'der')
  29513. case 'RSA PRIVATE KEY':
  29514. return asn1.RSAPrivateKey.decode(data, 'der')
  29515. case 'DSA PRIVATE KEY':
  29516. return {
  29517. type: 'dsa',
  29518. params: asn1.DSAPrivateKey.decode(data, 'der')
  29519. }
  29520. case 'EC PRIVATE KEY':
  29521. data = asn1.ECPrivateKey.decode(data, 'der')
  29522. return {
  29523. curve: data.parameters.value,
  29524. privateKey: data.privateKey
  29525. }
  29526. default: throw new Error('unknown key type ' + type)
  29527. }
  29528. }
  29529. parseKeys.signature = asn1.signature
  29530. function decrypt (data, password) {
  29531. var salt = data.algorithm.decrypt.kde.kdeparams.salt
  29532. var iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10)
  29533. var algo = aesid[data.algorithm.decrypt.cipher.algo.join('.')]
  29534. var iv = data.algorithm.decrypt.cipher.iv
  29535. var cipherText = data.subjectPrivateKey
  29536. var keylen = parseInt(algo.split('-')[1], 10) / 8
  29537. var key = compat.pbkdf2Sync(password, salt, iters, keylen, 'sha1')
  29538. var cipher = ciphers.createDecipheriv(algo, key, iv)
  29539. var out = []
  29540. out.push(cipher.update(cipherText))
  29541. out.push(cipher.final())
  29542. return Buffer.concat(out)
  29543. }
  29544. /***/ }),
  29545. /* 172 */
  29546. /*!*****************************************!*\
  29547. !*** ./node_modules/parse-asn1/asn1.js ***!
  29548. \*****************************************/
  29549. /*! no static exports found */
  29550. /***/ (function(module, exports, __webpack_require__) {
  29551. "use strict";
  29552. // from https://github.com/indutny/self-signed/blob/gh-pages/lib/asn1.js
  29553. // Fedor, you are amazing.
  29554. var asn1 = __webpack_require__(/*! asn1.js */ 173)
  29555. exports.certificate = __webpack_require__(/*! ./certificate */ 188)
  29556. var RSAPrivateKey = asn1.define('RSAPrivateKey', function () {
  29557. this.seq().obj(
  29558. this.key('version').int(),
  29559. this.key('modulus').int(),
  29560. this.key('publicExponent').int(),
  29561. this.key('privateExponent').int(),
  29562. this.key('prime1').int(),
  29563. this.key('prime2').int(),
  29564. this.key('exponent1').int(),
  29565. this.key('exponent2').int(),
  29566. this.key('coefficient').int()
  29567. )
  29568. })
  29569. exports.RSAPrivateKey = RSAPrivateKey
  29570. var RSAPublicKey = asn1.define('RSAPublicKey', function () {
  29571. this.seq().obj(
  29572. this.key('modulus').int(),
  29573. this.key('publicExponent').int()
  29574. )
  29575. })
  29576. exports.RSAPublicKey = RSAPublicKey
  29577. var PublicKey = asn1.define('SubjectPublicKeyInfo', function () {
  29578. this.seq().obj(
  29579. this.key('algorithm').use(AlgorithmIdentifier),
  29580. this.key('subjectPublicKey').bitstr()
  29581. )
  29582. })
  29583. exports.PublicKey = PublicKey
  29584. var AlgorithmIdentifier = asn1.define('AlgorithmIdentifier', function () {
  29585. this.seq().obj(
  29586. this.key('algorithm').objid(),
  29587. this.key('none').null_().optional(),
  29588. this.key('curve').objid().optional(),
  29589. this.key('params').seq().obj(
  29590. this.key('p').int(),
  29591. this.key('q').int(),
  29592. this.key('g').int()
  29593. ).optional()
  29594. )
  29595. })
  29596. var PrivateKeyInfo = asn1.define('PrivateKeyInfo', function () {
  29597. this.seq().obj(
  29598. this.key('version').int(),
  29599. this.key('algorithm').use(AlgorithmIdentifier),
  29600. this.key('subjectPrivateKey').octstr()
  29601. )
  29602. })
  29603. exports.PrivateKey = PrivateKeyInfo
  29604. var EncryptedPrivateKeyInfo = asn1.define('EncryptedPrivateKeyInfo', function () {
  29605. this.seq().obj(
  29606. this.key('algorithm').seq().obj(
  29607. this.key('id').objid(),
  29608. this.key('decrypt').seq().obj(
  29609. this.key('kde').seq().obj(
  29610. this.key('id').objid(),
  29611. this.key('kdeparams').seq().obj(
  29612. this.key('salt').octstr(),
  29613. this.key('iters').int()
  29614. )
  29615. ),
  29616. this.key('cipher').seq().obj(
  29617. this.key('algo').objid(),
  29618. this.key('iv').octstr()
  29619. )
  29620. )
  29621. ),
  29622. this.key('subjectPrivateKey').octstr()
  29623. )
  29624. })
  29625. exports.EncryptedPrivateKey = EncryptedPrivateKeyInfo
  29626. var DSAPrivateKey = asn1.define('DSAPrivateKey', function () {
  29627. this.seq().obj(
  29628. this.key('version').int(),
  29629. this.key('p').int(),
  29630. this.key('q').int(),
  29631. this.key('g').int(),
  29632. this.key('pub_key').int(),
  29633. this.key('priv_key').int()
  29634. )
  29635. })
  29636. exports.DSAPrivateKey = DSAPrivateKey
  29637. exports.DSAparam = asn1.define('DSAparam', function () {
  29638. this.int()
  29639. })
  29640. var ECPrivateKey = asn1.define('ECPrivateKey', function () {
  29641. this.seq().obj(
  29642. this.key('version').int(),
  29643. this.key('privateKey').octstr(),
  29644. this.key('parameters').optional().explicit(0).use(ECParameters),
  29645. this.key('publicKey').optional().explicit(1).bitstr()
  29646. )
  29647. })
  29648. exports.ECPrivateKey = ECPrivateKey
  29649. var ECParameters = asn1.define('ECParameters', function () {
  29650. this.choice({
  29651. namedCurve: this.objid()
  29652. })
  29653. })
  29654. exports.signature = asn1.define('signature', function () {
  29655. this.seq().obj(
  29656. this.key('r').int(),
  29657. this.key('s').int()
  29658. )
  29659. })
  29660. /***/ }),
  29661. /* 173 */
  29662. /*!******************************************!*\
  29663. !*** ./node_modules/asn1.js/lib/asn1.js ***!
  29664. \******************************************/
  29665. /*! no static exports found */
  29666. /***/ (function(module, exports, __webpack_require__) {
  29667. var asn1 = exports;
  29668. asn1.bignum = __webpack_require__(/*! bn.js */ 130);
  29669. asn1.define = __webpack_require__(/*! ./asn1/api */ 174).define;
  29670. asn1.base = __webpack_require__(/*! ./asn1/base */ 176);
  29671. asn1.constants = __webpack_require__(/*! ./asn1/constants */ 180);
  29672. asn1.decoders = __webpack_require__(/*! ./asn1/decoders */ 182);
  29673. asn1.encoders = __webpack_require__(/*! ./asn1/encoders */ 185);
  29674. /***/ }),
  29675. /* 174 */
  29676. /*!**********************************************!*\
  29677. !*** ./node_modules/asn1.js/lib/asn1/api.js ***!
  29678. \**********************************************/
  29679. /*! no static exports found */
  29680. /***/ (function(module, exports, __webpack_require__) {
  29681. var asn1 = __webpack_require__(/*! ../asn1 */ 173);
  29682. var inherits = __webpack_require__(/*! inherits */ 54);
  29683. var api = exports;
  29684. api.define = function define(name, body) {
  29685. return new Entity(name, body);
  29686. };
  29687. function Entity(name, body) {
  29688. this.name = name;
  29689. this.body = body;
  29690. this.decoders = {};
  29691. this.encoders = {};
  29692. };
  29693. Entity.prototype._createNamed = function createNamed(base) {
  29694. var named;
  29695. try {
  29696. named = __webpack_require__(/*! vm */ 175).runInThisContext(
  29697. '(function ' + this.name + '(entity) {\n' +
  29698. ' this._initNamed(entity);\n' +
  29699. '})'
  29700. );
  29701. } catch (e) {
  29702. named = function (entity) {
  29703. this._initNamed(entity);
  29704. };
  29705. }
  29706. inherits(named, base);
  29707. named.prototype._initNamed = function initnamed(entity) {
  29708. base.call(this, entity);
  29709. };
  29710. return new named(this);
  29711. };
  29712. Entity.prototype._getDecoder = function _getDecoder(enc) {
  29713. enc = enc || 'der';
  29714. // Lazily create decoder
  29715. if (!this.decoders.hasOwnProperty(enc))
  29716. this.decoders[enc] = this._createNamed(asn1.decoders[enc]);
  29717. return this.decoders[enc];
  29718. };
  29719. Entity.prototype.decode = function decode(data, enc, options) {
  29720. return this._getDecoder(enc).decode(data, options);
  29721. };
  29722. Entity.prototype._getEncoder = function _getEncoder(enc) {
  29723. enc = enc || 'der';
  29724. // Lazily create encoder
  29725. if (!this.encoders.hasOwnProperty(enc))
  29726. this.encoders[enc] = this._createNamed(asn1.encoders[enc]);
  29727. return this.encoders[enc];
  29728. };
  29729. Entity.prototype.encode = function encode(data, enc, /* internal */ reporter) {
  29730. return this._getEncoder(enc).encode(data, reporter);
  29731. };
  29732. /***/ }),
  29733. /* 175 */
  29734. /*!*********************************************!*\
  29735. !*** ./node_modules/vm-browserify/index.js ***!
  29736. \*********************************************/
  29737. /*! no static exports found */
  29738. /***/ (function(module, exports) {
  29739. var indexOf = function (xs, item) {
  29740. if (xs.indexOf) return xs.indexOf(item);
  29741. else for (var i = 0; i < xs.length; i++) {
  29742. if (xs[i] === item) return i;
  29743. }
  29744. return -1;
  29745. };
  29746. var Object_keys = function (obj) {
  29747. if (Object.keys) return Object.keys(obj)
  29748. else {
  29749. var res = [];
  29750. for (var key in obj) res.push(key)
  29751. return res;
  29752. }
  29753. };
  29754. var forEach = function (xs, fn) {
  29755. if (xs.forEach) return xs.forEach(fn)
  29756. else for (var i = 0; i < xs.length; i++) {
  29757. fn(xs[i], i, xs);
  29758. }
  29759. };
  29760. var defineProp = (function() {
  29761. try {
  29762. Object.defineProperty({}, '_', {});
  29763. return function(obj, name, value) {
  29764. Object.defineProperty(obj, name, {
  29765. writable: true,
  29766. enumerable: false,
  29767. configurable: true,
  29768. value: value
  29769. })
  29770. };
  29771. } catch(e) {
  29772. return function(obj, name, value) {
  29773. obj[name] = value;
  29774. };
  29775. }
  29776. }());
  29777. var globals = ['Array', 'Boolean', 'Date', 'Error', 'EvalError', 'Function',
  29778. 'Infinity', 'JSON', 'Math', 'NaN', 'Number', 'Object', 'RangeError',
  29779. 'ReferenceError', 'RegExp', 'String', 'SyntaxError', 'TypeError', 'URIError',
  29780. 'decodeURI', 'decodeURIComponent', 'encodeURI', 'encodeURIComponent', 'escape',
  29781. 'eval', 'isFinite', 'isNaN', 'parseFloat', 'parseInt', 'undefined', 'unescape'];
  29782. function Context() {}
  29783. Context.prototype = {};
  29784. var Script = exports.Script = function NodeScript (code) {
  29785. if (!(this instanceof Script)) return new Script(code);
  29786. this.code = code;
  29787. };
  29788. Script.prototype.runInContext = function (context) {
  29789. if (!(context instanceof Context)) {
  29790. throw new TypeError("needs a 'context' argument.");
  29791. }
  29792. var iframe = document.createElement('iframe');
  29793. if (!iframe.style) iframe.style = {};
  29794. iframe.style.display = 'none';
  29795. document.body.appendChild(iframe);
  29796. var win = iframe.contentWindow;
  29797. var wEval = win.eval, wExecScript = win.execScript;
  29798. if (!wEval && wExecScript) {
  29799. // win.eval() magically appears when this is called in IE:
  29800. wExecScript.call(win, 'null');
  29801. wEval = win.eval;
  29802. }
  29803. forEach(Object_keys(context), function (key) {
  29804. win[key] = context[key];
  29805. });
  29806. forEach(globals, function (key) {
  29807. if (context[key]) {
  29808. win[key] = context[key];
  29809. }
  29810. });
  29811. var winKeys = Object_keys(win);
  29812. var res = wEval.call(win, this.code);
  29813. forEach(Object_keys(win), function (key) {
  29814. // Avoid copying circular objects like `top` and `window` by only
  29815. // updating existing context properties or new properties in the `win`
  29816. // that was only introduced after the eval.
  29817. if (key in context || indexOf(winKeys, key) === -1) {
  29818. context[key] = win[key];
  29819. }
  29820. });
  29821. forEach(globals, function (key) {
  29822. if (!(key in context)) {
  29823. defineProp(context, key, win[key]);
  29824. }
  29825. });
  29826. document.body.removeChild(iframe);
  29827. return res;
  29828. };
  29829. Script.prototype.runInThisContext = function () {
  29830. return eval(this.code); // maybe...
  29831. };
  29832. Script.prototype.runInNewContext = function (context) {
  29833. var ctx = Script.createContext(context);
  29834. var res = this.runInContext(ctx);
  29835. if (context) {
  29836. forEach(Object_keys(ctx), function (key) {
  29837. context[key] = ctx[key];
  29838. });
  29839. }
  29840. return res;
  29841. };
  29842. forEach(Object_keys(Script.prototype), function (name) {
  29843. exports[name] = Script[name] = function (code) {
  29844. var s = Script(code);
  29845. return s[name].apply(s, [].slice.call(arguments, 1));
  29846. };
  29847. });
  29848. exports.isContext = function (context) {
  29849. return context instanceof Context;
  29850. };
  29851. exports.createScript = function (code) {
  29852. return exports.Script(code);
  29853. };
  29854. exports.createContext = Script.createContext = function (context) {
  29855. var copy = new Context();
  29856. if(typeof context === 'object') {
  29857. forEach(Object_keys(context), function (key) {
  29858. copy[key] = context[key];
  29859. });
  29860. }
  29861. return copy;
  29862. };
  29863. /***/ }),
  29864. /* 176 */
  29865. /*!*****************************************************!*\
  29866. !*** ./node_modules/asn1.js/lib/asn1/base/index.js ***!
  29867. \*****************************************************/
  29868. /*! no static exports found */
  29869. /***/ (function(module, exports, __webpack_require__) {
  29870. var base = exports;
  29871. base.Reporter = __webpack_require__(/*! ./reporter */ 177).Reporter;
  29872. base.DecoderBuffer = __webpack_require__(/*! ./buffer */ 178).DecoderBuffer;
  29873. base.EncoderBuffer = __webpack_require__(/*! ./buffer */ 178).EncoderBuffer;
  29874. base.Node = __webpack_require__(/*! ./node */ 179);
  29875. /***/ }),
  29876. /* 177 */
  29877. /*!********************************************************!*\
  29878. !*** ./node_modules/asn1.js/lib/asn1/base/reporter.js ***!
  29879. \********************************************************/
  29880. /*! no static exports found */
  29881. /***/ (function(module, exports, __webpack_require__) {
  29882. var inherits = __webpack_require__(/*! inherits */ 54);
  29883. function Reporter(options) {
  29884. this._reporterState = {
  29885. obj: null,
  29886. path: [],
  29887. options: options || {},
  29888. errors: []
  29889. };
  29890. }
  29891. exports.Reporter = Reporter;
  29892. Reporter.prototype.isError = function isError(obj) {
  29893. return obj instanceof ReporterError;
  29894. };
  29895. Reporter.prototype.save = function save() {
  29896. var state = this._reporterState;
  29897. return { obj: state.obj, pathLen: state.path.length };
  29898. };
  29899. Reporter.prototype.restore = function restore(data) {
  29900. var state = this._reporterState;
  29901. state.obj = data.obj;
  29902. state.path = state.path.slice(0, data.pathLen);
  29903. };
  29904. Reporter.prototype.enterKey = function enterKey(key) {
  29905. return this._reporterState.path.push(key);
  29906. };
  29907. Reporter.prototype.exitKey = function exitKey(index) {
  29908. var state = this._reporterState;
  29909. state.path = state.path.slice(0, index - 1);
  29910. };
  29911. Reporter.prototype.leaveKey = function leaveKey(index, key, value) {
  29912. var state = this._reporterState;
  29913. this.exitKey(index);
  29914. if (state.obj !== null)
  29915. state.obj[key] = value;
  29916. };
  29917. Reporter.prototype.path = function path() {
  29918. return this._reporterState.path.join('/');
  29919. };
  29920. Reporter.prototype.enterObject = function enterObject() {
  29921. var state = this._reporterState;
  29922. var prev = state.obj;
  29923. state.obj = {};
  29924. return prev;
  29925. };
  29926. Reporter.prototype.leaveObject = function leaveObject(prev) {
  29927. var state = this._reporterState;
  29928. var now = state.obj;
  29929. state.obj = prev;
  29930. return now;
  29931. };
  29932. Reporter.prototype.error = function error(msg) {
  29933. var err;
  29934. var state = this._reporterState;
  29935. var inherited = msg instanceof ReporterError;
  29936. if (inherited) {
  29937. err = msg;
  29938. } else {
  29939. err = new ReporterError(state.path.map(function(elem) {
  29940. return '[' + JSON.stringify(elem) + ']';
  29941. }).join(''), msg.message || msg, msg.stack);
  29942. }
  29943. if (!state.options.partial)
  29944. throw err;
  29945. if (!inherited)
  29946. state.errors.push(err);
  29947. return err;
  29948. };
  29949. Reporter.prototype.wrapResult = function wrapResult(result) {
  29950. var state = this._reporterState;
  29951. if (!state.options.partial)
  29952. return result;
  29953. return {
  29954. result: this.isError(result) ? null : result,
  29955. errors: state.errors
  29956. };
  29957. };
  29958. function ReporterError(path, msg) {
  29959. this.path = path;
  29960. this.rethrow(msg);
  29961. };
  29962. inherits(ReporterError, Error);
  29963. ReporterError.prototype.rethrow = function rethrow(msg) {
  29964. this.message = msg + ' at: ' + (this.path || '(shallow)');
  29965. if (Error.captureStackTrace)
  29966. Error.captureStackTrace(this, ReporterError);
  29967. if (!this.stack) {
  29968. try {
  29969. // IE only adds stack when thrown
  29970. throw new Error(this.message);
  29971. } catch (e) {
  29972. this.stack = e.stack;
  29973. }
  29974. }
  29975. return this;
  29976. };
  29977. /***/ }),
  29978. /* 178 */
  29979. /*!******************************************************!*\
  29980. !*** ./node_modules/asn1.js/lib/asn1/base/buffer.js ***!
  29981. \******************************************************/
  29982. /*! no static exports found */
  29983. /***/ (function(module, exports, __webpack_require__) {
  29984. var inherits = __webpack_require__(/*! inherits */ 54);
  29985. var Reporter = __webpack_require__(/*! ../base */ 176).Reporter;
  29986. var Buffer = __webpack_require__(/*! buffer */ 49).Buffer;
  29987. function DecoderBuffer(base, options) {
  29988. Reporter.call(this, options);
  29989. if (!Buffer.isBuffer(base)) {
  29990. this.error('Input not Buffer');
  29991. return;
  29992. }
  29993. this.base = base;
  29994. this.offset = 0;
  29995. this.length = base.length;
  29996. }
  29997. inherits(DecoderBuffer, Reporter);
  29998. exports.DecoderBuffer = DecoderBuffer;
  29999. DecoderBuffer.prototype.save = function save() {
  30000. return { offset: this.offset, reporter: Reporter.prototype.save.call(this) };
  30001. };
  30002. DecoderBuffer.prototype.restore = function restore(save) {
  30003. // Return skipped data
  30004. var res = new DecoderBuffer(this.base);
  30005. res.offset = save.offset;
  30006. res.length = this.offset;
  30007. this.offset = save.offset;
  30008. Reporter.prototype.restore.call(this, save.reporter);
  30009. return res;
  30010. };
  30011. DecoderBuffer.prototype.isEmpty = function isEmpty() {
  30012. return this.offset === this.length;
  30013. };
  30014. DecoderBuffer.prototype.readUInt8 = function readUInt8(fail) {
  30015. if (this.offset + 1 <= this.length)
  30016. return this.base.readUInt8(this.offset++, true);
  30017. else
  30018. return this.error(fail || 'DecoderBuffer overrun');
  30019. }
  30020. DecoderBuffer.prototype.skip = function skip(bytes, fail) {
  30021. if (!(this.offset + bytes <= this.length))
  30022. return this.error(fail || 'DecoderBuffer overrun');
  30023. var res = new DecoderBuffer(this.base);
  30024. // Share reporter state
  30025. res._reporterState = this._reporterState;
  30026. res.offset = this.offset;
  30027. res.length = this.offset + bytes;
  30028. this.offset += bytes;
  30029. return res;
  30030. }
  30031. DecoderBuffer.prototype.raw = function raw(save) {
  30032. return this.base.slice(save ? save.offset : this.offset, this.length);
  30033. }
  30034. function EncoderBuffer(value, reporter) {
  30035. if (Array.isArray(value)) {
  30036. this.length = 0;
  30037. this.value = value.map(function(item) {
  30038. if (!(item instanceof EncoderBuffer))
  30039. item = new EncoderBuffer(item, reporter);
  30040. this.length += item.length;
  30041. return item;
  30042. }, this);
  30043. } else if (typeof value === 'number') {
  30044. if (!(0 <= value && value <= 0xff))
  30045. return reporter.error('non-byte EncoderBuffer value');
  30046. this.value = value;
  30047. this.length = 1;
  30048. } else if (typeof value === 'string') {
  30049. this.value = value;
  30050. this.length = Buffer.byteLength(value);
  30051. } else if (Buffer.isBuffer(value)) {
  30052. this.value = value;
  30053. this.length = value.length;
  30054. } else {
  30055. return reporter.error('Unsupported type: ' + typeof value);
  30056. }
  30057. }
  30058. exports.EncoderBuffer = EncoderBuffer;
  30059. EncoderBuffer.prototype.join = function join(out, offset) {
  30060. if (!out)
  30061. out = new Buffer(this.length);
  30062. if (!offset)
  30063. offset = 0;
  30064. if (this.length === 0)
  30065. return out;
  30066. if (Array.isArray(this.value)) {
  30067. this.value.forEach(function(item) {
  30068. item.join(out, offset);
  30069. offset += item.length;
  30070. });
  30071. } else {
  30072. if (typeof this.value === 'number')
  30073. out[offset] = this.value;
  30074. else if (typeof this.value === 'string')
  30075. out.write(this.value, offset);
  30076. else if (Buffer.isBuffer(this.value))
  30077. this.value.copy(out, offset);
  30078. offset += this.length;
  30079. }
  30080. return out;
  30081. };
  30082. /***/ }),
  30083. /* 179 */
  30084. /*!****************************************************!*\
  30085. !*** ./node_modules/asn1.js/lib/asn1/base/node.js ***!
  30086. \****************************************************/
  30087. /*! no static exports found */
  30088. /***/ (function(module, exports, __webpack_require__) {
  30089. var Reporter = __webpack_require__(/*! ../base */ 176).Reporter;
  30090. var EncoderBuffer = __webpack_require__(/*! ../base */ 176).EncoderBuffer;
  30091. var DecoderBuffer = __webpack_require__(/*! ../base */ 176).DecoderBuffer;
  30092. var assert = __webpack_require__(/*! minimalistic-assert */ 104);
  30093. // Supported tags
  30094. var tags = [
  30095. 'seq', 'seqof', 'set', 'setof', 'objid', 'bool',
  30096. 'gentime', 'utctime', 'null_', 'enum', 'int', 'objDesc',
  30097. 'bitstr', 'bmpstr', 'charstr', 'genstr', 'graphstr', 'ia5str', 'iso646str',
  30098. 'numstr', 'octstr', 'printstr', 't61str', 'unistr', 'utf8str', 'videostr'
  30099. ];
  30100. // Public methods list
  30101. var methods = [
  30102. 'key', 'obj', 'use', 'optional', 'explicit', 'implicit', 'def', 'choice',
  30103. 'any', 'contains'
  30104. ].concat(tags);
  30105. // Overrided methods list
  30106. var overrided = [
  30107. '_peekTag', '_decodeTag', '_use',
  30108. '_decodeStr', '_decodeObjid', '_decodeTime',
  30109. '_decodeNull', '_decodeInt', '_decodeBool', '_decodeList',
  30110. '_encodeComposite', '_encodeStr', '_encodeObjid', '_encodeTime',
  30111. '_encodeNull', '_encodeInt', '_encodeBool'
  30112. ];
  30113. function Node(enc, parent) {
  30114. var state = {};
  30115. this._baseState = state;
  30116. state.enc = enc;
  30117. state.parent = parent || null;
  30118. state.children = null;
  30119. // State
  30120. state.tag = null;
  30121. state.args = null;
  30122. state.reverseArgs = null;
  30123. state.choice = null;
  30124. state.optional = false;
  30125. state.any = false;
  30126. state.obj = false;
  30127. state.use = null;
  30128. state.useDecoder = null;
  30129. state.key = null;
  30130. state['default'] = null;
  30131. state.explicit = null;
  30132. state.implicit = null;
  30133. state.contains = null;
  30134. // Should create new instance on each method
  30135. if (!state.parent) {
  30136. state.children = [];
  30137. this._wrap();
  30138. }
  30139. }
  30140. module.exports = Node;
  30141. var stateProps = [
  30142. 'enc', 'parent', 'children', 'tag', 'args', 'reverseArgs', 'choice',
  30143. 'optional', 'any', 'obj', 'use', 'alteredUse', 'key', 'default', 'explicit',
  30144. 'implicit', 'contains'
  30145. ];
  30146. Node.prototype.clone = function clone() {
  30147. var state = this._baseState;
  30148. var cstate = {};
  30149. stateProps.forEach(function(prop) {
  30150. cstate[prop] = state[prop];
  30151. });
  30152. var res = new this.constructor(cstate.parent);
  30153. res._baseState = cstate;
  30154. return res;
  30155. };
  30156. Node.prototype._wrap = function wrap() {
  30157. var state = this._baseState;
  30158. methods.forEach(function(method) {
  30159. this[method] = function _wrappedMethod() {
  30160. var clone = new this.constructor(this);
  30161. state.children.push(clone);
  30162. return clone[method].apply(clone, arguments);
  30163. };
  30164. }, this);
  30165. };
  30166. Node.prototype._init = function init(body) {
  30167. var state = this._baseState;
  30168. assert(state.parent === null);
  30169. body.call(this);
  30170. // Filter children
  30171. state.children = state.children.filter(function(child) {
  30172. return child._baseState.parent === this;
  30173. }, this);
  30174. assert.equal(state.children.length, 1, 'Root node can have only one child');
  30175. };
  30176. Node.prototype._useArgs = function useArgs(args) {
  30177. var state = this._baseState;
  30178. // Filter children and args
  30179. var children = args.filter(function(arg) {
  30180. return arg instanceof this.constructor;
  30181. }, this);
  30182. args = args.filter(function(arg) {
  30183. return !(arg instanceof this.constructor);
  30184. }, this);
  30185. if (children.length !== 0) {
  30186. assert(state.children === null);
  30187. state.children = children;
  30188. // Replace parent to maintain backward link
  30189. children.forEach(function(child) {
  30190. child._baseState.parent = this;
  30191. }, this);
  30192. }
  30193. if (args.length !== 0) {
  30194. assert(state.args === null);
  30195. state.args = args;
  30196. state.reverseArgs = args.map(function(arg) {
  30197. if (typeof arg !== 'object' || arg.constructor !== Object)
  30198. return arg;
  30199. var res = {};
  30200. Object.keys(arg).forEach(function(key) {
  30201. if (key == (key | 0))
  30202. key |= 0;
  30203. var value = arg[key];
  30204. res[value] = key;
  30205. });
  30206. return res;
  30207. });
  30208. }
  30209. };
  30210. //
  30211. // Overrided methods
  30212. //
  30213. overrided.forEach(function(method) {
  30214. Node.prototype[method] = function _overrided() {
  30215. var state = this._baseState;
  30216. throw new Error(method + ' not implemented for encoding: ' + state.enc);
  30217. };
  30218. });
  30219. //
  30220. // Public methods
  30221. //
  30222. tags.forEach(function(tag) {
  30223. Node.prototype[tag] = function _tagMethod() {
  30224. var state = this._baseState;
  30225. var args = Array.prototype.slice.call(arguments);
  30226. assert(state.tag === null);
  30227. state.tag = tag;
  30228. this._useArgs(args);
  30229. return this;
  30230. };
  30231. });
  30232. Node.prototype.use = function use(item) {
  30233. assert(item);
  30234. var state = this._baseState;
  30235. assert(state.use === null);
  30236. state.use = item;
  30237. return this;
  30238. };
  30239. Node.prototype.optional = function optional() {
  30240. var state = this._baseState;
  30241. state.optional = true;
  30242. return this;
  30243. };
  30244. Node.prototype.def = function def(val) {
  30245. var state = this._baseState;
  30246. assert(state['default'] === null);
  30247. state['default'] = val;
  30248. state.optional = true;
  30249. return this;
  30250. };
  30251. Node.prototype.explicit = function explicit(num) {
  30252. var state = this._baseState;
  30253. assert(state.explicit === null && state.implicit === null);
  30254. state.explicit = num;
  30255. return this;
  30256. };
  30257. Node.prototype.implicit = function implicit(num) {
  30258. var state = this._baseState;
  30259. assert(state.explicit === null && state.implicit === null);
  30260. state.implicit = num;
  30261. return this;
  30262. };
  30263. Node.prototype.obj = function obj() {
  30264. var state = this._baseState;
  30265. var args = Array.prototype.slice.call(arguments);
  30266. state.obj = true;
  30267. if (args.length !== 0)
  30268. this._useArgs(args);
  30269. return this;
  30270. };
  30271. Node.prototype.key = function key(newKey) {
  30272. var state = this._baseState;
  30273. assert(state.key === null);
  30274. state.key = newKey;
  30275. return this;
  30276. };
  30277. Node.prototype.any = function any() {
  30278. var state = this._baseState;
  30279. state.any = true;
  30280. return this;
  30281. };
  30282. Node.prototype.choice = function choice(obj) {
  30283. var state = this._baseState;
  30284. assert(state.choice === null);
  30285. state.choice = obj;
  30286. this._useArgs(Object.keys(obj).map(function(key) {
  30287. return obj[key];
  30288. }));
  30289. return this;
  30290. };
  30291. Node.prototype.contains = function contains(item) {
  30292. var state = this._baseState;
  30293. assert(state.use === null);
  30294. state.contains = item;
  30295. return this;
  30296. };
  30297. //
  30298. // Decoding
  30299. //
  30300. Node.prototype._decode = function decode(input, options) {
  30301. var state = this._baseState;
  30302. // Decode root node
  30303. if (state.parent === null)
  30304. return input.wrapResult(state.children[0]._decode(input, options));
  30305. var result = state['default'];
  30306. var present = true;
  30307. var prevKey = null;
  30308. if (state.key !== null)
  30309. prevKey = input.enterKey(state.key);
  30310. // Check if tag is there
  30311. if (state.optional) {
  30312. var tag = null;
  30313. if (state.explicit !== null)
  30314. tag = state.explicit;
  30315. else if (state.implicit !== null)
  30316. tag = state.implicit;
  30317. else if (state.tag !== null)
  30318. tag = state.tag;
  30319. if (tag === null && !state.any) {
  30320. // Trial and Error
  30321. var save = input.save();
  30322. try {
  30323. if (state.choice === null)
  30324. this._decodeGeneric(state.tag, input, options);
  30325. else
  30326. this._decodeChoice(input, options);
  30327. present = true;
  30328. } catch (e) {
  30329. present = false;
  30330. }
  30331. input.restore(save);
  30332. } else {
  30333. present = this._peekTag(input, tag, state.any);
  30334. if (input.isError(present))
  30335. return present;
  30336. }
  30337. }
  30338. // Push object on stack
  30339. var prevObj;
  30340. if (state.obj && present)
  30341. prevObj = input.enterObject();
  30342. if (present) {
  30343. // Unwrap explicit values
  30344. if (state.explicit !== null) {
  30345. var explicit = this._decodeTag(input, state.explicit);
  30346. if (input.isError(explicit))
  30347. return explicit;
  30348. input = explicit;
  30349. }
  30350. var start = input.offset;
  30351. // Unwrap implicit and normal values
  30352. if (state.use === null && state.choice === null) {
  30353. if (state.any)
  30354. var save = input.save();
  30355. var body = this._decodeTag(
  30356. input,
  30357. state.implicit !== null ? state.implicit : state.tag,
  30358. state.any
  30359. );
  30360. if (input.isError(body))
  30361. return body;
  30362. if (state.any)
  30363. result = input.raw(save);
  30364. else
  30365. input = body;
  30366. }
  30367. if (options && options.track && state.tag !== null)
  30368. options.track(input.path(), start, input.length, 'tagged');
  30369. if (options && options.track && state.tag !== null)
  30370. options.track(input.path(), input.offset, input.length, 'content');
  30371. // Select proper method for tag
  30372. if (state.any)
  30373. result = result;
  30374. else if (state.choice === null)
  30375. result = this._decodeGeneric(state.tag, input, options);
  30376. else
  30377. result = this._decodeChoice(input, options);
  30378. if (input.isError(result))
  30379. return result;
  30380. // Decode children
  30381. if (!state.any && state.choice === null && state.children !== null) {
  30382. state.children.forEach(function decodeChildren(child) {
  30383. // NOTE: We are ignoring errors here, to let parser continue with other
  30384. // parts of encoded data
  30385. child._decode(input, options);
  30386. });
  30387. }
  30388. // Decode contained/encoded by schema, only in bit or octet strings
  30389. if (state.contains && (state.tag === 'octstr' || state.tag === 'bitstr')) {
  30390. var data = new DecoderBuffer(result);
  30391. result = this._getUse(state.contains, input._reporterState.obj)
  30392. ._decode(data, options);
  30393. }
  30394. }
  30395. // Pop object
  30396. if (state.obj && present)
  30397. result = input.leaveObject(prevObj);
  30398. // Set key
  30399. if (state.key !== null && (result !== null || present === true))
  30400. input.leaveKey(prevKey, state.key, result);
  30401. else if (prevKey !== null)
  30402. input.exitKey(prevKey);
  30403. return result;
  30404. };
  30405. Node.prototype._decodeGeneric = function decodeGeneric(tag, input, options) {
  30406. var state = this._baseState;
  30407. if (tag === 'seq' || tag === 'set')
  30408. return null;
  30409. if (tag === 'seqof' || tag === 'setof')
  30410. return this._decodeList(input, tag, state.args[0], options);
  30411. else if (/str$/.test(tag))
  30412. return this._decodeStr(input, tag, options);
  30413. else if (tag === 'objid' && state.args)
  30414. return this._decodeObjid(input, state.args[0], state.args[1], options);
  30415. else if (tag === 'objid')
  30416. return this._decodeObjid(input, null, null, options);
  30417. else if (tag === 'gentime' || tag === 'utctime')
  30418. return this._decodeTime(input, tag, options);
  30419. else if (tag === 'null_')
  30420. return this._decodeNull(input, options);
  30421. else if (tag === 'bool')
  30422. return this._decodeBool(input, options);
  30423. else if (tag === 'objDesc')
  30424. return this._decodeStr(input, tag, options);
  30425. else if (tag === 'int' || tag === 'enum')
  30426. return this._decodeInt(input, state.args && state.args[0], options);
  30427. if (state.use !== null) {
  30428. return this._getUse(state.use, input._reporterState.obj)
  30429. ._decode(input, options);
  30430. } else {
  30431. return input.error('unknown tag: ' + tag);
  30432. }
  30433. };
  30434. Node.prototype._getUse = function _getUse(entity, obj) {
  30435. var state = this._baseState;
  30436. // Create altered use decoder if implicit is set
  30437. state.useDecoder = this._use(entity, obj);
  30438. assert(state.useDecoder._baseState.parent === null);
  30439. state.useDecoder = state.useDecoder._baseState.children[0];
  30440. if (state.implicit !== state.useDecoder._baseState.implicit) {
  30441. state.useDecoder = state.useDecoder.clone();
  30442. state.useDecoder._baseState.implicit = state.implicit;
  30443. }
  30444. return state.useDecoder;
  30445. };
  30446. Node.prototype._decodeChoice = function decodeChoice(input, options) {
  30447. var state = this._baseState;
  30448. var result = null;
  30449. var match = false;
  30450. Object.keys(state.choice).some(function(key) {
  30451. var save = input.save();
  30452. var node = state.choice[key];
  30453. try {
  30454. var value = node._decode(input, options);
  30455. if (input.isError(value))
  30456. return false;
  30457. result = { type: key, value: value };
  30458. match = true;
  30459. } catch (e) {
  30460. input.restore(save);
  30461. return false;
  30462. }
  30463. return true;
  30464. }, this);
  30465. if (!match)
  30466. return input.error('Choice not matched');
  30467. return result;
  30468. };
  30469. //
  30470. // Encoding
  30471. //
  30472. Node.prototype._createEncoderBuffer = function createEncoderBuffer(data) {
  30473. return new EncoderBuffer(data, this.reporter);
  30474. };
  30475. Node.prototype._encode = function encode(data, reporter, parent) {
  30476. var state = this._baseState;
  30477. if (state['default'] !== null && state['default'] === data)
  30478. return;
  30479. var result = this._encodeValue(data, reporter, parent);
  30480. if (result === undefined)
  30481. return;
  30482. if (this._skipDefault(result, reporter, parent))
  30483. return;
  30484. return result;
  30485. };
  30486. Node.prototype._encodeValue = function encode(data, reporter, parent) {
  30487. var state = this._baseState;
  30488. // Decode root node
  30489. if (state.parent === null)
  30490. return state.children[0]._encode(data, reporter || new Reporter());
  30491. var result = null;
  30492. // Set reporter to share it with a child class
  30493. this.reporter = reporter;
  30494. // Check if data is there
  30495. if (state.optional && data === undefined) {
  30496. if (state['default'] !== null)
  30497. data = state['default']
  30498. else
  30499. return;
  30500. }
  30501. // Encode children first
  30502. var content = null;
  30503. var primitive = false;
  30504. if (state.any) {
  30505. // Anything that was given is translated to buffer
  30506. result = this._createEncoderBuffer(data);
  30507. } else if (state.choice) {
  30508. result = this._encodeChoice(data, reporter);
  30509. } else if (state.contains) {
  30510. content = this._getUse(state.contains, parent)._encode(data, reporter);
  30511. primitive = true;
  30512. } else if (state.children) {
  30513. content = state.children.map(function(child) {
  30514. if (child._baseState.tag === 'null_')
  30515. return child._encode(null, reporter, data);
  30516. if (child._baseState.key === null)
  30517. return reporter.error('Child should have a key');
  30518. var prevKey = reporter.enterKey(child._baseState.key);
  30519. if (typeof data !== 'object')
  30520. return reporter.error('Child expected, but input is not object');
  30521. var res = child._encode(data[child._baseState.key], reporter, data);
  30522. reporter.leaveKey(prevKey);
  30523. return res;
  30524. }, this).filter(function(child) {
  30525. return child;
  30526. });
  30527. content = this._createEncoderBuffer(content);
  30528. } else {
  30529. if (state.tag === 'seqof' || state.tag === 'setof') {
  30530. // TODO(indutny): this should be thrown on DSL level
  30531. if (!(state.args && state.args.length === 1))
  30532. return reporter.error('Too many args for : ' + state.tag);
  30533. if (!Array.isArray(data))
  30534. return reporter.error('seqof/setof, but data is not Array');
  30535. var child = this.clone();
  30536. child._baseState.implicit = null;
  30537. content = this._createEncoderBuffer(data.map(function(item) {
  30538. var state = this._baseState;
  30539. return this._getUse(state.args[0], data)._encode(item, reporter);
  30540. }, child));
  30541. } else if (state.use !== null) {
  30542. result = this._getUse(state.use, parent)._encode(data, reporter);
  30543. } else {
  30544. content = this._encodePrimitive(state.tag, data);
  30545. primitive = true;
  30546. }
  30547. }
  30548. // Encode data itself
  30549. var result;
  30550. if (!state.any && state.choice === null) {
  30551. var tag = state.implicit !== null ? state.implicit : state.tag;
  30552. var cls = state.implicit === null ? 'universal' : 'context';
  30553. if (tag === null) {
  30554. if (state.use === null)
  30555. reporter.error('Tag could be omitted only for .use()');
  30556. } else {
  30557. if (state.use === null)
  30558. result = this._encodeComposite(tag, primitive, cls, content);
  30559. }
  30560. }
  30561. // Wrap in explicit
  30562. if (state.explicit !== null)
  30563. result = this._encodeComposite(state.explicit, false, 'context', result);
  30564. return result;
  30565. };
  30566. Node.prototype._encodeChoice = function encodeChoice(data, reporter) {
  30567. var state = this._baseState;
  30568. var node = state.choice[data.type];
  30569. if (!node) {
  30570. assert(
  30571. false,
  30572. data.type + ' not found in ' +
  30573. JSON.stringify(Object.keys(state.choice)));
  30574. }
  30575. return node._encode(data.value, reporter);
  30576. };
  30577. Node.prototype._encodePrimitive = function encodePrimitive(tag, data) {
  30578. var state = this._baseState;
  30579. if (/str$/.test(tag))
  30580. return this._encodeStr(data, tag);
  30581. else if (tag === 'objid' && state.args)
  30582. return this._encodeObjid(data, state.reverseArgs[0], state.args[1]);
  30583. else if (tag === 'objid')
  30584. return this._encodeObjid(data, null, null);
  30585. else if (tag === 'gentime' || tag === 'utctime')
  30586. return this._encodeTime(data, tag);
  30587. else if (tag === 'null_')
  30588. return this._encodeNull();
  30589. else if (tag === 'int' || tag === 'enum')
  30590. return this._encodeInt(data, state.args && state.reverseArgs[0]);
  30591. else if (tag === 'bool')
  30592. return this._encodeBool(data);
  30593. else if (tag === 'objDesc')
  30594. return this._encodeStr(data, tag);
  30595. else
  30596. throw new Error('Unsupported tag: ' + tag);
  30597. };
  30598. Node.prototype._isNumstr = function isNumstr(str) {
  30599. return /^[0-9 ]*$/.test(str);
  30600. };
  30601. Node.prototype._isPrintstr = function isPrintstr(str) {
  30602. return /^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(str);
  30603. };
  30604. /***/ }),
  30605. /* 180 */
  30606. /*!**********************************************************!*\
  30607. !*** ./node_modules/asn1.js/lib/asn1/constants/index.js ***!
  30608. \**********************************************************/
  30609. /*! no static exports found */
  30610. /***/ (function(module, exports, __webpack_require__) {
  30611. var constants = exports;
  30612. // Helper
  30613. constants._reverse = function reverse(map) {
  30614. var res = {};
  30615. Object.keys(map).forEach(function(key) {
  30616. // Convert key to integer if it is stringified
  30617. if ((key | 0) == key)
  30618. key = key | 0;
  30619. var value = map[key];
  30620. res[value] = key;
  30621. });
  30622. return res;
  30623. };
  30624. constants.der = __webpack_require__(/*! ./der */ 181);
  30625. /***/ }),
  30626. /* 181 */
  30627. /*!********************************************************!*\
  30628. !*** ./node_modules/asn1.js/lib/asn1/constants/der.js ***!
  30629. \********************************************************/
  30630. /*! no static exports found */
  30631. /***/ (function(module, exports, __webpack_require__) {
  30632. var constants = __webpack_require__(/*! ../constants */ 180);
  30633. exports.tagClass = {
  30634. 0: 'universal',
  30635. 1: 'application',
  30636. 2: 'context',
  30637. 3: 'private'
  30638. };
  30639. exports.tagClassByName = constants._reverse(exports.tagClass);
  30640. exports.tag = {
  30641. 0x00: 'end',
  30642. 0x01: 'bool',
  30643. 0x02: 'int',
  30644. 0x03: 'bitstr',
  30645. 0x04: 'octstr',
  30646. 0x05: 'null_',
  30647. 0x06: 'objid',
  30648. 0x07: 'objDesc',
  30649. 0x08: 'external',
  30650. 0x09: 'real',
  30651. 0x0a: 'enum',
  30652. 0x0b: 'embed',
  30653. 0x0c: 'utf8str',
  30654. 0x0d: 'relativeOid',
  30655. 0x10: 'seq',
  30656. 0x11: 'set',
  30657. 0x12: 'numstr',
  30658. 0x13: 'printstr',
  30659. 0x14: 't61str',
  30660. 0x15: 'videostr',
  30661. 0x16: 'ia5str',
  30662. 0x17: 'utctime',
  30663. 0x18: 'gentime',
  30664. 0x19: 'graphstr',
  30665. 0x1a: 'iso646str',
  30666. 0x1b: 'genstr',
  30667. 0x1c: 'unistr',
  30668. 0x1d: 'charstr',
  30669. 0x1e: 'bmpstr'
  30670. };
  30671. exports.tagByName = constants._reverse(exports.tag);
  30672. /***/ }),
  30673. /* 182 */
  30674. /*!*********************************************************!*\
  30675. !*** ./node_modules/asn1.js/lib/asn1/decoders/index.js ***!
  30676. \*********************************************************/
  30677. /*! no static exports found */
  30678. /***/ (function(module, exports, __webpack_require__) {
  30679. var decoders = exports;
  30680. decoders.der = __webpack_require__(/*! ./der */ 183);
  30681. decoders.pem = __webpack_require__(/*! ./pem */ 184);
  30682. /***/ }),
  30683. /* 183 */
  30684. /*!*******************************************************!*\
  30685. !*** ./node_modules/asn1.js/lib/asn1/decoders/der.js ***!
  30686. \*******************************************************/
  30687. /*! no static exports found */
  30688. /***/ (function(module, exports, __webpack_require__) {
  30689. var inherits = __webpack_require__(/*! inherits */ 54);
  30690. var asn1 = __webpack_require__(/*! ../../asn1 */ 173);
  30691. var base = asn1.base;
  30692. var bignum = asn1.bignum;
  30693. // Import DER constants
  30694. var der = asn1.constants.der;
  30695. function DERDecoder(entity) {
  30696. this.enc = 'der';
  30697. this.name = entity.name;
  30698. this.entity = entity;
  30699. // Construct base tree
  30700. this.tree = new DERNode();
  30701. this.tree._init(entity.body);
  30702. };
  30703. module.exports = DERDecoder;
  30704. DERDecoder.prototype.decode = function decode(data, options) {
  30705. if (!(data instanceof base.DecoderBuffer))
  30706. data = new base.DecoderBuffer(data, options);
  30707. return this.tree._decode(data, options);
  30708. };
  30709. // Tree methods
  30710. function DERNode(parent) {
  30711. base.Node.call(this, 'der', parent);
  30712. }
  30713. inherits(DERNode, base.Node);
  30714. DERNode.prototype._peekTag = function peekTag(buffer, tag, any) {
  30715. if (buffer.isEmpty())
  30716. return false;
  30717. var state = buffer.save();
  30718. var decodedTag = derDecodeTag(buffer, 'Failed to peek tag: "' + tag + '"');
  30719. if (buffer.isError(decodedTag))
  30720. return decodedTag;
  30721. buffer.restore(state);
  30722. return decodedTag.tag === tag || decodedTag.tagStr === tag ||
  30723. (decodedTag.tagStr + 'of') === tag || any;
  30724. };
  30725. DERNode.prototype._decodeTag = function decodeTag(buffer, tag, any) {
  30726. var decodedTag = derDecodeTag(buffer,
  30727. 'Failed to decode tag of "' + tag + '"');
  30728. if (buffer.isError(decodedTag))
  30729. return decodedTag;
  30730. var len = derDecodeLen(buffer,
  30731. decodedTag.primitive,
  30732. 'Failed to get length of "' + tag + '"');
  30733. // Failure
  30734. if (buffer.isError(len))
  30735. return len;
  30736. if (!any &&
  30737. decodedTag.tag !== tag &&
  30738. decodedTag.tagStr !== tag &&
  30739. decodedTag.tagStr + 'of' !== tag) {
  30740. return buffer.error('Failed to match tag: "' + tag + '"');
  30741. }
  30742. if (decodedTag.primitive || len !== null)
  30743. return buffer.skip(len, 'Failed to match body of: "' + tag + '"');
  30744. // Indefinite length... find END tag
  30745. var state = buffer.save();
  30746. var res = this._skipUntilEnd(
  30747. buffer,
  30748. 'Failed to skip indefinite length body: "' + this.tag + '"');
  30749. if (buffer.isError(res))
  30750. return res;
  30751. len = buffer.offset - state.offset;
  30752. buffer.restore(state);
  30753. return buffer.skip(len, 'Failed to match body of: "' + tag + '"');
  30754. };
  30755. DERNode.prototype._skipUntilEnd = function skipUntilEnd(buffer, fail) {
  30756. while (true) {
  30757. var tag = derDecodeTag(buffer, fail);
  30758. if (buffer.isError(tag))
  30759. return tag;
  30760. var len = derDecodeLen(buffer, tag.primitive, fail);
  30761. if (buffer.isError(len))
  30762. return len;
  30763. var res;
  30764. if (tag.primitive || len !== null)
  30765. res = buffer.skip(len)
  30766. else
  30767. res = this._skipUntilEnd(buffer, fail);
  30768. // Failure
  30769. if (buffer.isError(res))
  30770. return res;
  30771. if (tag.tagStr === 'end')
  30772. break;
  30773. }
  30774. };
  30775. DERNode.prototype._decodeList = function decodeList(buffer, tag, decoder,
  30776. options) {
  30777. var result = [];
  30778. while (!buffer.isEmpty()) {
  30779. var possibleEnd = this._peekTag(buffer, 'end');
  30780. if (buffer.isError(possibleEnd))
  30781. return possibleEnd;
  30782. var res = decoder.decode(buffer, 'der', options);
  30783. if (buffer.isError(res) && possibleEnd)
  30784. break;
  30785. result.push(res);
  30786. }
  30787. return result;
  30788. };
  30789. DERNode.prototype._decodeStr = function decodeStr(buffer, tag) {
  30790. if (tag === 'bitstr') {
  30791. var unused = buffer.readUInt8();
  30792. if (buffer.isError(unused))
  30793. return unused;
  30794. return { unused: unused, data: buffer.raw() };
  30795. } else if (tag === 'bmpstr') {
  30796. var raw = buffer.raw();
  30797. if (raw.length % 2 === 1)
  30798. return buffer.error('Decoding of string type: bmpstr length mismatch');
  30799. var str = '';
  30800. for (var i = 0; i < raw.length / 2; i++) {
  30801. str += String.fromCharCode(raw.readUInt16BE(i * 2));
  30802. }
  30803. return str;
  30804. } else if (tag === 'numstr') {
  30805. var numstr = buffer.raw().toString('ascii');
  30806. if (!this._isNumstr(numstr)) {
  30807. return buffer.error('Decoding of string type: ' +
  30808. 'numstr unsupported characters');
  30809. }
  30810. return numstr;
  30811. } else if (tag === 'octstr') {
  30812. return buffer.raw();
  30813. } else if (tag === 'objDesc') {
  30814. return buffer.raw();
  30815. } else if (tag === 'printstr') {
  30816. var printstr = buffer.raw().toString('ascii');
  30817. if (!this._isPrintstr(printstr)) {
  30818. return buffer.error('Decoding of string type: ' +
  30819. 'printstr unsupported characters');
  30820. }
  30821. return printstr;
  30822. } else if (/str$/.test(tag)) {
  30823. return buffer.raw().toString();
  30824. } else {
  30825. return buffer.error('Decoding of string type: ' + tag + ' unsupported');
  30826. }
  30827. };
  30828. DERNode.prototype._decodeObjid = function decodeObjid(buffer, values, relative) {
  30829. var result;
  30830. var identifiers = [];
  30831. var ident = 0;
  30832. while (!buffer.isEmpty()) {
  30833. var subident = buffer.readUInt8();
  30834. ident <<= 7;
  30835. ident |= subident & 0x7f;
  30836. if ((subident & 0x80) === 0) {
  30837. identifiers.push(ident);
  30838. ident = 0;
  30839. }
  30840. }
  30841. if (subident & 0x80)
  30842. identifiers.push(ident);
  30843. var first = (identifiers[0] / 40) | 0;
  30844. var second = identifiers[0] % 40;
  30845. if (relative)
  30846. result = identifiers;
  30847. else
  30848. result = [first, second].concat(identifiers.slice(1));
  30849. if (values) {
  30850. var tmp = values[result.join(' ')];
  30851. if (tmp === undefined)
  30852. tmp = values[result.join('.')];
  30853. if (tmp !== undefined)
  30854. result = tmp;
  30855. }
  30856. return result;
  30857. };
  30858. DERNode.prototype._decodeTime = function decodeTime(buffer, tag) {
  30859. var str = buffer.raw().toString();
  30860. if (tag === 'gentime') {
  30861. var year = str.slice(0, 4) | 0;
  30862. var mon = str.slice(4, 6) | 0;
  30863. var day = str.slice(6, 8) | 0;
  30864. var hour = str.slice(8, 10) | 0;
  30865. var min = str.slice(10, 12) | 0;
  30866. var sec = str.slice(12, 14) | 0;
  30867. } else if (tag === 'utctime') {
  30868. var year = str.slice(0, 2) | 0;
  30869. var mon = str.slice(2, 4) | 0;
  30870. var day = str.slice(4, 6) | 0;
  30871. var hour = str.slice(6, 8) | 0;
  30872. var min = str.slice(8, 10) | 0;
  30873. var sec = str.slice(10, 12) | 0;
  30874. if (year < 70)
  30875. year = 2000 + year;
  30876. else
  30877. year = 1900 + year;
  30878. } else {
  30879. return buffer.error('Decoding ' + tag + ' time is not supported yet');
  30880. }
  30881. return Date.UTC(year, mon - 1, day, hour, min, sec, 0);
  30882. };
  30883. DERNode.prototype._decodeNull = function decodeNull(buffer) {
  30884. return null;
  30885. };
  30886. DERNode.prototype._decodeBool = function decodeBool(buffer) {
  30887. var res = buffer.readUInt8();
  30888. if (buffer.isError(res))
  30889. return res;
  30890. else
  30891. return res !== 0;
  30892. };
  30893. DERNode.prototype._decodeInt = function decodeInt(buffer, values) {
  30894. // Bigint, return as it is (assume big endian)
  30895. var raw = buffer.raw();
  30896. var res = new bignum(raw);
  30897. if (values)
  30898. res = values[res.toString(10)] || res;
  30899. return res;
  30900. };
  30901. DERNode.prototype._use = function use(entity, obj) {
  30902. if (typeof entity === 'function')
  30903. entity = entity(obj);
  30904. return entity._getDecoder('der').tree;
  30905. };
  30906. // Utility methods
  30907. function derDecodeTag(buf, fail) {
  30908. var tag = buf.readUInt8(fail);
  30909. if (buf.isError(tag))
  30910. return tag;
  30911. var cls = der.tagClass[tag >> 6];
  30912. var primitive = (tag & 0x20) === 0;
  30913. // Multi-octet tag - load
  30914. if ((tag & 0x1f) === 0x1f) {
  30915. var oct = tag;
  30916. tag = 0;
  30917. while ((oct & 0x80) === 0x80) {
  30918. oct = buf.readUInt8(fail);
  30919. if (buf.isError(oct))
  30920. return oct;
  30921. tag <<= 7;
  30922. tag |= oct & 0x7f;
  30923. }
  30924. } else {
  30925. tag &= 0x1f;
  30926. }
  30927. var tagStr = der.tag[tag];
  30928. return {
  30929. cls: cls,
  30930. primitive: primitive,
  30931. tag: tag,
  30932. tagStr: tagStr
  30933. };
  30934. }
  30935. function derDecodeLen(buf, primitive, fail) {
  30936. var len = buf.readUInt8(fail);
  30937. if (buf.isError(len))
  30938. return len;
  30939. // Indefinite form
  30940. if (!primitive && len === 0x80)
  30941. return null;
  30942. // Definite form
  30943. if ((len & 0x80) === 0) {
  30944. // Short form
  30945. return len;
  30946. }
  30947. // Long form
  30948. var num = len & 0x7f;
  30949. if (num > 4)
  30950. return buf.error('length octect is too long');
  30951. len = 0;
  30952. for (var i = 0; i < num; i++) {
  30953. len <<= 8;
  30954. var j = buf.readUInt8(fail);
  30955. if (buf.isError(j))
  30956. return j;
  30957. len |= j;
  30958. }
  30959. return len;
  30960. }
  30961. /***/ }),
  30962. /* 184 */
  30963. /*!*******************************************************!*\
  30964. !*** ./node_modules/asn1.js/lib/asn1/decoders/pem.js ***!
  30965. \*******************************************************/
  30966. /*! no static exports found */
  30967. /***/ (function(module, exports, __webpack_require__) {
  30968. var inherits = __webpack_require__(/*! inherits */ 54);
  30969. var Buffer = __webpack_require__(/*! buffer */ 49).Buffer;
  30970. var DERDecoder = __webpack_require__(/*! ./der */ 183);
  30971. function PEMDecoder(entity) {
  30972. DERDecoder.call(this, entity);
  30973. this.enc = 'pem';
  30974. };
  30975. inherits(PEMDecoder, DERDecoder);
  30976. module.exports = PEMDecoder;
  30977. PEMDecoder.prototype.decode = function decode(data, options) {
  30978. var lines = data.toString().split(/[\r\n]+/g);
  30979. var label = options.label.toUpperCase();
  30980. var re = /^-----(BEGIN|END) ([^-]+)-----$/;
  30981. var start = -1;
  30982. var end = -1;
  30983. for (var i = 0; i < lines.length; i++) {
  30984. var match = lines[i].match(re);
  30985. if (match === null)
  30986. continue;
  30987. if (match[2] !== label)
  30988. continue;
  30989. if (start === -1) {
  30990. if (match[1] !== 'BEGIN')
  30991. break;
  30992. start = i;
  30993. } else {
  30994. if (match[1] !== 'END')
  30995. break;
  30996. end = i;
  30997. break;
  30998. }
  30999. }
  31000. if (start === -1 || end === -1)
  31001. throw new Error('PEM section not found for: ' + label);
  31002. var base64 = lines.slice(start + 1, end).join('');
  31003. // Remove excessive symbols
  31004. base64.replace(/[^a-z0-9\+\/=]+/gi, '');
  31005. var input = new Buffer(base64, 'base64');
  31006. return DERDecoder.prototype.decode.call(this, input, options);
  31007. };
  31008. /***/ }),
  31009. /* 185 */
  31010. /*!*********************************************************!*\
  31011. !*** ./node_modules/asn1.js/lib/asn1/encoders/index.js ***!
  31012. \*********************************************************/
  31013. /*! no static exports found */
  31014. /***/ (function(module, exports, __webpack_require__) {
  31015. var encoders = exports;
  31016. encoders.der = __webpack_require__(/*! ./der */ 186);
  31017. encoders.pem = __webpack_require__(/*! ./pem */ 187);
  31018. /***/ }),
  31019. /* 186 */
  31020. /*!*******************************************************!*\
  31021. !*** ./node_modules/asn1.js/lib/asn1/encoders/der.js ***!
  31022. \*******************************************************/
  31023. /*! no static exports found */
  31024. /***/ (function(module, exports, __webpack_require__) {
  31025. var inherits = __webpack_require__(/*! inherits */ 54);
  31026. var Buffer = __webpack_require__(/*! buffer */ 49).Buffer;
  31027. var asn1 = __webpack_require__(/*! ../../asn1 */ 173);
  31028. var base = asn1.base;
  31029. // Import DER constants
  31030. var der = asn1.constants.der;
  31031. function DEREncoder(entity) {
  31032. this.enc = 'der';
  31033. this.name = entity.name;
  31034. this.entity = entity;
  31035. // Construct base tree
  31036. this.tree = new DERNode();
  31037. this.tree._init(entity.body);
  31038. };
  31039. module.exports = DEREncoder;
  31040. DEREncoder.prototype.encode = function encode(data, reporter) {
  31041. return this.tree._encode(data, reporter).join();
  31042. };
  31043. // Tree methods
  31044. function DERNode(parent) {
  31045. base.Node.call(this, 'der', parent);
  31046. }
  31047. inherits(DERNode, base.Node);
  31048. DERNode.prototype._encodeComposite = function encodeComposite(tag,
  31049. primitive,
  31050. cls,
  31051. content) {
  31052. var encodedTag = encodeTag(tag, primitive, cls, this.reporter);
  31053. // Short form
  31054. if (content.length < 0x80) {
  31055. var header = new Buffer(2);
  31056. header[0] = encodedTag;
  31057. header[1] = content.length;
  31058. return this._createEncoderBuffer([ header, content ]);
  31059. }
  31060. // Long form
  31061. // Count octets required to store length
  31062. var lenOctets = 1;
  31063. for (var i = content.length; i >= 0x100; i >>= 8)
  31064. lenOctets++;
  31065. var header = new Buffer(1 + 1 + lenOctets);
  31066. header[0] = encodedTag;
  31067. header[1] = 0x80 | lenOctets;
  31068. for (var i = 1 + lenOctets, j = content.length; j > 0; i--, j >>= 8)
  31069. header[i] = j & 0xff;
  31070. return this._createEncoderBuffer([ header, content ]);
  31071. };
  31072. DERNode.prototype._encodeStr = function encodeStr(str, tag) {
  31073. if (tag === 'bitstr') {
  31074. return this._createEncoderBuffer([ str.unused | 0, str.data ]);
  31075. } else if (tag === 'bmpstr') {
  31076. var buf = new Buffer(str.length * 2);
  31077. for (var i = 0; i < str.length; i++) {
  31078. buf.writeUInt16BE(str.charCodeAt(i), i * 2);
  31079. }
  31080. return this._createEncoderBuffer(buf);
  31081. } else if (tag === 'numstr') {
  31082. if (!this._isNumstr(str)) {
  31083. return this.reporter.error('Encoding of string type: numstr supports ' +
  31084. 'only digits and space');
  31085. }
  31086. return this._createEncoderBuffer(str);
  31087. } else if (tag === 'printstr') {
  31088. if (!this._isPrintstr(str)) {
  31089. return this.reporter.error('Encoding of string type: printstr supports ' +
  31090. 'only latin upper and lower case letters, ' +
  31091. 'digits, space, apostrophe, left and rigth ' +
  31092. 'parenthesis, plus sign, comma, hyphen, ' +
  31093. 'dot, slash, colon, equal sign, ' +
  31094. 'question mark');
  31095. }
  31096. return this._createEncoderBuffer(str);
  31097. } else if (/str$/.test(tag)) {
  31098. return this._createEncoderBuffer(str);
  31099. } else if (tag === 'objDesc') {
  31100. return this._createEncoderBuffer(str);
  31101. } else {
  31102. return this.reporter.error('Encoding of string type: ' + tag +
  31103. ' unsupported');
  31104. }
  31105. };
  31106. DERNode.prototype._encodeObjid = function encodeObjid(id, values, relative) {
  31107. if (typeof id === 'string') {
  31108. if (!values)
  31109. return this.reporter.error('string objid given, but no values map found');
  31110. if (!values.hasOwnProperty(id))
  31111. return this.reporter.error('objid not found in values map');
  31112. id = values[id].split(/[\s\.]+/g);
  31113. for (var i = 0; i < id.length; i++)
  31114. id[i] |= 0;
  31115. } else if (Array.isArray(id)) {
  31116. id = id.slice();
  31117. for (var i = 0; i < id.length; i++)
  31118. id[i] |= 0;
  31119. }
  31120. if (!Array.isArray(id)) {
  31121. return this.reporter.error('objid() should be either array or string, ' +
  31122. 'got: ' + JSON.stringify(id));
  31123. }
  31124. if (!relative) {
  31125. if (id[1] >= 40)
  31126. return this.reporter.error('Second objid identifier OOB');
  31127. id.splice(0, 2, id[0] * 40 + id[1]);
  31128. }
  31129. // Count number of octets
  31130. var size = 0;
  31131. for (var i = 0; i < id.length; i++) {
  31132. var ident = id[i];
  31133. for (size++; ident >= 0x80; ident >>= 7)
  31134. size++;
  31135. }
  31136. var objid = new Buffer(size);
  31137. var offset = objid.length - 1;
  31138. for (var i = id.length - 1; i >= 0; i--) {
  31139. var ident = id[i];
  31140. objid[offset--] = ident & 0x7f;
  31141. while ((ident >>= 7) > 0)
  31142. objid[offset--] = 0x80 | (ident & 0x7f);
  31143. }
  31144. return this._createEncoderBuffer(objid);
  31145. };
  31146. function two(num) {
  31147. if (num < 10)
  31148. return '0' + num;
  31149. else
  31150. return num;
  31151. }
  31152. DERNode.prototype._encodeTime = function encodeTime(time, tag) {
  31153. var str;
  31154. var date = new Date(time);
  31155. if (tag === 'gentime') {
  31156. str = [
  31157. two(date.getFullYear()),
  31158. two(date.getUTCMonth() + 1),
  31159. two(date.getUTCDate()),
  31160. two(date.getUTCHours()),
  31161. two(date.getUTCMinutes()),
  31162. two(date.getUTCSeconds()),
  31163. 'Z'
  31164. ].join('');
  31165. } else if (tag === 'utctime') {
  31166. str = [
  31167. two(date.getFullYear() % 100),
  31168. two(date.getUTCMonth() + 1),
  31169. two(date.getUTCDate()),
  31170. two(date.getUTCHours()),
  31171. two(date.getUTCMinutes()),
  31172. two(date.getUTCSeconds()),
  31173. 'Z'
  31174. ].join('');
  31175. } else {
  31176. this.reporter.error('Encoding ' + tag + ' time is not supported yet');
  31177. }
  31178. return this._encodeStr(str, 'octstr');
  31179. };
  31180. DERNode.prototype._encodeNull = function encodeNull() {
  31181. return this._createEncoderBuffer('');
  31182. };
  31183. DERNode.prototype._encodeInt = function encodeInt(num, values) {
  31184. if (typeof num === 'string') {
  31185. if (!values)
  31186. return this.reporter.error('String int or enum given, but no values map');
  31187. if (!values.hasOwnProperty(num)) {
  31188. return this.reporter.error('Values map doesn\'t contain: ' +
  31189. JSON.stringify(num));
  31190. }
  31191. num = values[num];
  31192. }
  31193. // Bignum, assume big endian
  31194. if (typeof num !== 'number' && !Buffer.isBuffer(num)) {
  31195. var numArray = num.toArray();
  31196. if (!num.sign && numArray[0] & 0x80) {
  31197. numArray.unshift(0);
  31198. }
  31199. num = new Buffer(numArray);
  31200. }
  31201. if (Buffer.isBuffer(num)) {
  31202. var size = num.length;
  31203. if (num.length === 0)
  31204. size++;
  31205. var out = new Buffer(size);
  31206. num.copy(out);
  31207. if (num.length === 0)
  31208. out[0] = 0
  31209. return this._createEncoderBuffer(out);
  31210. }
  31211. if (num < 0x80)
  31212. return this._createEncoderBuffer(num);
  31213. if (num < 0x100)
  31214. return this._createEncoderBuffer([0, num]);
  31215. var size = 1;
  31216. for (var i = num; i >= 0x100; i >>= 8)
  31217. size++;
  31218. var out = new Array(size);
  31219. for (var i = out.length - 1; i >= 0; i--) {
  31220. out[i] = num & 0xff;
  31221. num >>= 8;
  31222. }
  31223. if(out[0] & 0x80) {
  31224. out.unshift(0);
  31225. }
  31226. return this._createEncoderBuffer(new Buffer(out));
  31227. };
  31228. DERNode.prototype._encodeBool = function encodeBool(value) {
  31229. return this._createEncoderBuffer(value ? 0xff : 0);
  31230. };
  31231. DERNode.prototype._use = function use(entity, obj) {
  31232. if (typeof entity === 'function')
  31233. entity = entity(obj);
  31234. return entity._getEncoder('der').tree;
  31235. };
  31236. DERNode.prototype._skipDefault = function skipDefault(dataBuffer, reporter, parent) {
  31237. var state = this._baseState;
  31238. var i;
  31239. if (state['default'] === null)
  31240. return false;
  31241. var data = dataBuffer.join();
  31242. if (state.defaultBuffer === undefined)
  31243. state.defaultBuffer = this._encodeValue(state['default'], reporter, parent).join();
  31244. if (data.length !== state.defaultBuffer.length)
  31245. return false;
  31246. for (i=0; i < data.length; i++)
  31247. if (data[i] !== state.defaultBuffer[i])
  31248. return false;
  31249. return true;
  31250. };
  31251. // Utility methods
  31252. function encodeTag(tag, primitive, cls, reporter) {
  31253. var res;
  31254. if (tag === 'seqof')
  31255. tag = 'seq';
  31256. else if (tag === 'setof')
  31257. tag = 'set';
  31258. if (der.tagByName.hasOwnProperty(tag))
  31259. res = der.tagByName[tag];
  31260. else if (typeof tag === 'number' && (tag | 0) === tag)
  31261. res = tag;
  31262. else
  31263. return reporter.error('Unknown tag: ' + tag);
  31264. if (res >= 0x1f)
  31265. return reporter.error('Multi-octet tag encoding unsupported');
  31266. if (!primitive)
  31267. res |= 0x20;
  31268. res |= (der.tagClassByName[cls || 'universal'] << 6);
  31269. return res;
  31270. }
  31271. /***/ }),
  31272. /* 187 */
  31273. /*!*******************************************************!*\
  31274. !*** ./node_modules/asn1.js/lib/asn1/encoders/pem.js ***!
  31275. \*******************************************************/
  31276. /*! no static exports found */
  31277. /***/ (function(module, exports, __webpack_require__) {
  31278. var inherits = __webpack_require__(/*! inherits */ 54);
  31279. var DEREncoder = __webpack_require__(/*! ./der */ 186);
  31280. function PEMEncoder(entity) {
  31281. DEREncoder.call(this, entity);
  31282. this.enc = 'pem';
  31283. };
  31284. inherits(PEMEncoder, DEREncoder);
  31285. module.exports = PEMEncoder;
  31286. PEMEncoder.prototype.encode = function encode(data, options) {
  31287. var buf = DEREncoder.prototype.encode.call(this, data);
  31288. var p = buf.toString('base64');
  31289. var out = [ '-----BEGIN ' + options.label + '-----' ];
  31290. for (var i = 0; i < p.length; i += 64)
  31291. out.push(p.slice(i, i + 64));
  31292. out.push('-----END ' + options.label + '-----');
  31293. return out.join('\n');
  31294. };
  31295. /***/ }),
  31296. /* 188 */
  31297. /*!************************************************!*\
  31298. !*** ./node_modules/parse-asn1/certificate.js ***!
  31299. \************************************************/
  31300. /*! no static exports found */
  31301. /***/ (function(module, exports, __webpack_require__) {
  31302. "use strict";
  31303. // from https://github.com/Rantanen/node-dtls/blob/25a7dc861bda38cfeac93a723500eea4f0ac2e86/Certificate.js
  31304. // thanks to @Rantanen
  31305. var asn = __webpack_require__(/*! asn1.js */ 173)
  31306. var Time = asn.define('Time', function () {
  31307. this.choice({
  31308. utcTime: this.utctime(),
  31309. generalTime: this.gentime()
  31310. })
  31311. })
  31312. var AttributeTypeValue = asn.define('AttributeTypeValue', function () {
  31313. this.seq().obj(
  31314. this.key('type').objid(),
  31315. this.key('value').any()
  31316. )
  31317. })
  31318. var AlgorithmIdentifier = asn.define('AlgorithmIdentifier', function () {
  31319. this.seq().obj(
  31320. this.key('algorithm').objid(),
  31321. this.key('parameters').optional(),
  31322. this.key('curve').objid().optional()
  31323. )
  31324. })
  31325. var SubjectPublicKeyInfo = asn.define('SubjectPublicKeyInfo', function () {
  31326. this.seq().obj(
  31327. this.key('algorithm').use(AlgorithmIdentifier),
  31328. this.key('subjectPublicKey').bitstr()
  31329. )
  31330. })
  31331. var RelativeDistinguishedName = asn.define('RelativeDistinguishedName', function () {
  31332. this.setof(AttributeTypeValue)
  31333. })
  31334. var RDNSequence = asn.define('RDNSequence', function () {
  31335. this.seqof(RelativeDistinguishedName)
  31336. })
  31337. var Name = asn.define('Name', function () {
  31338. this.choice({
  31339. rdnSequence: this.use(RDNSequence)
  31340. })
  31341. })
  31342. var Validity = asn.define('Validity', function () {
  31343. this.seq().obj(
  31344. this.key('notBefore').use(Time),
  31345. this.key('notAfter').use(Time)
  31346. )
  31347. })
  31348. var Extension = asn.define('Extension', function () {
  31349. this.seq().obj(
  31350. this.key('extnID').objid(),
  31351. this.key('critical').bool().def(false),
  31352. this.key('extnValue').octstr()
  31353. )
  31354. })
  31355. var TBSCertificate = asn.define('TBSCertificate', function () {
  31356. this.seq().obj(
  31357. this.key('version').explicit(0).int().optional(),
  31358. this.key('serialNumber').int(),
  31359. this.key('signature').use(AlgorithmIdentifier),
  31360. this.key('issuer').use(Name),
  31361. this.key('validity').use(Validity),
  31362. this.key('subject').use(Name),
  31363. this.key('subjectPublicKeyInfo').use(SubjectPublicKeyInfo),
  31364. this.key('issuerUniqueID').implicit(1).bitstr().optional(),
  31365. this.key('subjectUniqueID').implicit(2).bitstr().optional(),
  31366. this.key('extensions').explicit(3).seqof(Extension).optional()
  31367. )
  31368. })
  31369. var X509Certificate = asn.define('X509Certificate', function () {
  31370. this.seq().obj(
  31371. this.key('tbsCertificate').use(TBSCertificate),
  31372. this.key('signatureAlgorithm').use(AlgorithmIdentifier),
  31373. this.key('signatureValue').bitstr()
  31374. )
  31375. })
  31376. module.exports = X509Certificate
  31377. /***/ }),
  31378. /* 189 */
  31379. /*!********************************************!*\
  31380. !*** ./node_modules/parse-asn1/aesid.json ***!
  31381. \********************************************/
  31382. /*! exports provided: 2.16.840.1.101.3.4.1.1, 2.16.840.1.101.3.4.1.2, 2.16.840.1.101.3.4.1.3, 2.16.840.1.101.3.4.1.4, 2.16.840.1.101.3.4.1.21, 2.16.840.1.101.3.4.1.22, 2.16.840.1.101.3.4.1.23, 2.16.840.1.101.3.4.1.24, 2.16.840.1.101.3.4.1.41, 2.16.840.1.101.3.4.1.42, 2.16.840.1.101.3.4.1.43, 2.16.840.1.101.3.4.1.44, default */
  31383. /***/ (function(module) {
  31384. module.exports = JSON.parse("{\"2.16.840.1.101.3.4.1.1\":\"aes-128-ecb\",\"2.16.840.1.101.3.4.1.2\":\"aes-128-cbc\",\"2.16.840.1.101.3.4.1.3\":\"aes-128-ofb\",\"2.16.840.1.101.3.4.1.4\":\"aes-128-cfb\",\"2.16.840.1.101.3.4.1.21\":\"aes-192-ecb\",\"2.16.840.1.101.3.4.1.22\":\"aes-192-cbc\",\"2.16.840.1.101.3.4.1.23\":\"aes-192-ofb\",\"2.16.840.1.101.3.4.1.24\":\"aes-192-cfb\",\"2.16.840.1.101.3.4.1.41\":\"aes-256-ecb\",\"2.16.840.1.101.3.4.1.42\":\"aes-256-cbc\",\"2.16.840.1.101.3.4.1.43\":\"aes-256-ofb\",\"2.16.840.1.101.3.4.1.44\":\"aes-256-cfb\"}");
  31385. /***/ }),
  31386. /* 190 */
  31387. /*!********************************************!*\
  31388. !*** ./node_modules/parse-asn1/fixProc.js ***!
  31389. \********************************************/
  31390. /*! no static exports found */
  31391. /***/ (function(module, exports, __webpack_require__) {
  31392. // adapted from https://github.com/apatil/pemstrip
  31393. var findProc = /Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r\+\/\=]+)[\n\r]+/m
  31394. var startRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m
  31395. var fullRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m
  31396. var evp = __webpack_require__(/*! evp_bytestokey */ 125)
  31397. var ciphers = __webpack_require__(/*! browserify-aes */ 108)
  31398. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  31399. module.exports = function (okey, password) {
  31400. var key = okey.toString()
  31401. var match = key.match(findProc)
  31402. var decrypted
  31403. if (!match) {
  31404. var match2 = key.match(fullRegex)
  31405. decrypted = new Buffer(match2[2].replace(/[\r\n]/g, ''), 'base64')
  31406. } else {
  31407. var suite = 'aes' + match[1]
  31408. var iv = Buffer.from(match[2], 'hex')
  31409. var cipherText = Buffer.from(match[3].replace(/[\r\n]/g, ''), 'base64')
  31410. var cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key
  31411. var out = []
  31412. var cipher = ciphers.createDecipheriv(suite, cipherKey, iv)
  31413. out.push(cipher.update(cipherText))
  31414. out.push(cipher.final())
  31415. decrypted = Buffer.concat(out)
  31416. }
  31417. var tag = key.match(startRegex)[1]
  31418. return {
  31419. tag: tag,
  31420. data: decrypted
  31421. }
  31422. }
  31423. /***/ }),
  31424. /* 191 */
  31425. /*!**********************************************************!*\
  31426. !*** ./node_modules/browserify-sign/browser/curves.json ***!
  31427. \**********************************************************/
  31428. /*! exports provided: 1.3.132.0.10, 1.3.132.0.33, 1.2.840.10045.3.1.1, 1.2.840.10045.3.1.7, 1.3.132.0.34, 1.3.132.0.35, default */
  31429. /***/ (function(module) {
  31430. module.exports = JSON.parse("{\"1.3.132.0.10\":\"secp256k1\",\"1.3.132.0.33\":\"p224\",\"1.2.840.10045.3.1.1\":\"p192\",\"1.2.840.10045.3.1.7\":\"p256\",\"1.3.132.0.34\":\"p384\",\"1.3.132.0.35\":\"p521\"}");
  31431. /***/ }),
  31432. /* 192 */
  31433. /*!********************************************************!*\
  31434. !*** ./node_modules/browserify-sign/browser/verify.js ***!
  31435. \********************************************************/
  31436. /*! no static exports found */
  31437. /***/ (function(module, exports, __webpack_require__) {
  31438. // much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js
  31439. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  31440. var BN = __webpack_require__(/*! bn.js */ 130)
  31441. var EC = __webpack_require__(/*! elliptic */ 141).ec
  31442. var parseKeys = __webpack_require__(/*! parse-asn1 */ 171)
  31443. var curves = __webpack_require__(/*! ./curves.json */ 191)
  31444. function verify (sig, hash, key, signType, tag) {
  31445. var pub = parseKeys(key)
  31446. if (pub.type === 'ec') {
  31447. // rsa keys can be interpreted as ecdsa ones in openssl
  31448. if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') throw new Error('wrong public key type')
  31449. return ecVerify(sig, hash, pub)
  31450. } else if (pub.type === 'dsa') {
  31451. if (signType !== 'dsa') throw new Error('wrong public key type')
  31452. return dsaVerify(sig, hash, pub)
  31453. } else {
  31454. if (signType !== 'rsa' && signType !== 'ecdsa/rsa') throw new Error('wrong public key type')
  31455. }
  31456. hash = Buffer.concat([tag, hash])
  31457. var len = pub.modulus.byteLength()
  31458. var pad = [1]
  31459. var padNum = 0
  31460. while (hash.length + pad.length + 2 < len) {
  31461. pad.push(0xff)
  31462. padNum++
  31463. }
  31464. pad.push(0x00)
  31465. var i = -1
  31466. while (++i < hash.length) {
  31467. pad.push(hash[i])
  31468. }
  31469. pad = Buffer.from(pad)
  31470. var red = BN.mont(pub.modulus)
  31471. sig = new BN(sig).toRed(red)
  31472. sig = sig.redPow(new BN(pub.publicExponent))
  31473. sig = Buffer.from(sig.fromRed().toArray())
  31474. var out = padNum < 8 ? 1 : 0
  31475. len = Math.min(sig.length, pad.length)
  31476. if (sig.length !== pad.length) out = 1
  31477. i = -1
  31478. while (++i < len) out |= sig[i] ^ pad[i]
  31479. return out === 0
  31480. }
  31481. function ecVerify (sig, hash, pub) {
  31482. var curveId = curves[pub.data.algorithm.curve.join('.')]
  31483. if (!curveId) throw new Error('unknown curve ' + pub.data.algorithm.curve.join('.'))
  31484. var curve = new EC(curveId)
  31485. var pubkey = pub.data.subjectPrivateKey.data
  31486. return curve.verify(hash, sig, pubkey)
  31487. }
  31488. function dsaVerify (sig, hash, pub) {
  31489. var p = pub.data.p
  31490. var q = pub.data.q
  31491. var g = pub.data.g
  31492. var y = pub.data.pub_key
  31493. var unpacked = parseKeys.signature.decode(sig, 'der')
  31494. var s = unpacked.s
  31495. var r = unpacked.r
  31496. checkValue(s, q)
  31497. checkValue(r, q)
  31498. var montp = BN.mont(p)
  31499. var w = s.invm(q)
  31500. var v = g.toRed(montp)
  31501. .redPow(new BN(hash).mul(w).mod(q))
  31502. .fromRed()
  31503. .mul(y.toRed(montp).redPow(r.mul(w).mod(q)).fromRed())
  31504. .mod(p)
  31505. .mod(q)
  31506. return v.cmp(r) === 0
  31507. }
  31508. function checkValue (b, q) {
  31509. if (b.cmpn(0) <= 0) throw new Error('invalid sig')
  31510. if (b.cmp(q) >= q) throw new Error('invalid sig')
  31511. }
  31512. module.exports = verify
  31513. /***/ }),
  31514. /* 193 */
  31515. /*!*********************************************!*\
  31516. !*** ./node_modules/create-ecdh/browser.js ***!
  31517. \*********************************************/
  31518. /*! no static exports found */
  31519. /***/ (function(module, exports, __webpack_require__) {
  31520. /* WEBPACK VAR INJECTION */(function(Buffer) {var elliptic = __webpack_require__(/*! elliptic */ 141)
  31521. var BN = __webpack_require__(/*! bn.js */ 130)
  31522. module.exports = function createECDH (curve) {
  31523. return new ECDH(curve)
  31524. }
  31525. var aliases = {
  31526. secp256k1: {
  31527. name: 'secp256k1',
  31528. byteLength: 32
  31529. },
  31530. secp224r1: {
  31531. name: 'p224',
  31532. byteLength: 28
  31533. },
  31534. prime256v1: {
  31535. name: 'p256',
  31536. byteLength: 32
  31537. },
  31538. prime192v1: {
  31539. name: 'p192',
  31540. byteLength: 24
  31541. },
  31542. ed25519: {
  31543. name: 'ed25519',
  31544. byteLength: 32
  31545. },
  31546. secp384r1: {
  31547. name: 'p384',
  31548. byteLength: 48
  31549. },
  31550. secp521r1: {
  31551. name: 'p521',
  31552. byteLength: 66
  31553. }
  31554. }
  31555. aliases.p224 = aliases.secp224r1
  31556. aliases.p256 = aliases.secp256r1 = aliases.prime256v1
  31557. aliases.p192 = aliases.secp192r1 = aliases.prime192v1
  31558. aliases.p384 = aliases.secp384r1
  31559. aliases.p521 = aliases.secp521r1
  31560. function ECDH (curve) {
  31561. this.curveType = aliases[curve]
  31562. if (!this.curveType) {
  31563. this.curveType = {
  31564. name: curve
  31565. }
  31566. }
  31567. this.curve = new elliptic.ec(this.curveType.name) // eslint-disable-line new-cap
  31568. this.keys = void 0
  31569. }
  31570. ECDH.prototype.generateKeys = function (enc, format) {
  31571. this.keys = this.curve.genKeyPair()
  31572. return this.getPublicKey(enc, format)
  31573. }
  31574. ECDH.prototype.computeSecret = function (other, inenc, enc) {
  31575. inenc = inenc || 'utf8'
  31576. if (!Buffer.isBuffer(other)) {
  31577. other = new Buffer(other, inenc)
  31578. }
  31579. var otherPub = this.curve.keyFromPublic(other).getPublic()
  31580. var out = otherPub.mul(this.keys.getPrivate()).getX()
  31581. return formatReturnValue(out, enc, this.curveType.byteLength)
  31582. }
  31583. ECDH.prototype.getPublicKey = function (enc, format) {
  31584. var key = this.keys.getPublic(format === 'compressed', true)
  31585. if (format === 'hybrid') {
  31586. if (key[key.length - 1] % 2) {
  31587. key[0] = 7
  31588. } else {
  31589. key[0] = 6
  31590. }
  31591. }
  31592. return formatReturnValue(key, enc)
  31593. }
  31594. ECDH.prototype.getPrivateKey = function (enc) {
  31595. return formatReturnValue(this.keys.getPrivate(), enc)
  31596. }
  31597. ECDH.prototype.setPublicKey = function (pub, enc) {
  31598. enc = enc || 'utf8'
  31599. if (!Buffer.isBuffer(pub)) {
  31600. pub = new Buffer(pub, enc)
  31601. }
  31602. this.keys._importPublic(pub)
  31603. return this
  31604. }
  31605. ECDH.prototype.setPrivateKey = function (priv, enc) {
  31606. enc = enc || 'utf8'
  31607. if (!Buffer.isBuffer(priv)) {
  31608. priv = new Buffer(priv, enc)
  31609. }
  31610. var _priv = new BN(priv)
  31611. _priv = _priv.toString(16)
  31612. this.keys = this.curve.genKeyPair()
  31613. this.keys._importPrivate(_priv)
  31614. return this
  31615. }
  31616. function formatReturnValue (bn, enc, len) {
  31617. if (!Array.isArray(bn)) {
  31618. bn = bn.toArray()
  31619. }
  31620. var buf = new Buffer(bn)
  31621. if (len && buf.length < len) {
  31622. var zeros = new Buffer(len - buf.length)
  31623. zeros.fill(0)
  31624. buf = Buffer.concat([zeros, buf])
  31625. }
  31626. if (!enc) {
  31627. return buf
  31628. } else {
  31629. return buf.toString(enc)
  31630. }
  31631. }
  31632. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ 49).Buffer))
  31633. /***/ }),
  31634. /* 194 */
  31635. /*!************************************************!*\
  31636. !*** ./node_modules/public-encrypt/browser.js ***!
  31637. \************************************************/
  31638. /*! no static exports found */
  31639. /***/ (function(module, exports, __webpack_require__) {
  31640. exports.publicEncrypt = __webpack_require__(/*! ./publicEncrypt */ 195)
  31641. exports.privateDecrypt = __webpack_require__(/*! ./privateDecrypt */ 199)
  31642. exports.privateEncrypt = function privateEncrypt (key, buf) {
  31643. return exports.publicEncrypt(key, buf, true)
  31644. }
  31645. exports.publicDecrypt = function publicDecrypt (key, buf) {
  31646. return exports.privateDecrypt(key, buf, true)
  31647. }
  31648. /***/ }),
  31649. /* 195 */
  31650. /*!******************************************************!*\
  31651. !*** ./node_modules/public-encrypt/publicEncrypt.js ***!
  31652. \******************************************************/
  31653. /*! no static exports found */
  31654. /***/ (function(module, exports, __webpack_require__) {
  31655. var parseKeys = __webpack_require__(/*! parse-asn1 */ 171)
  31656. var randomBytes = __webpack_require__(/*! randombytes */ 45)
  31657. var createHash = __webpack_require__(/*! create-hash */ 53)
  31658. var mgf = __webpack_require__(/*! ./mgf */ 196)
  31659. var xor = __webpack_require__(/*! ./xor */ 197)
  31660. var BN = __webpack_require__(/*! bn.js */ 130)
  31661. var withPublic = __webpack_require__(/*! ./withPublic */ 198)
  31662. var crt = __webpack_require__(/*! browserify-rsa */ 140)
  31663. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  31664. module.exports = function publicEncrypt (publicKey, msg, reverse) {
  31665. var padding
  31666. if (publicKey.padding) {
  31667. padding = publicKey.padding
  31668. } else if (reverse) {
  31669. padding = 1
  31670. } else {
  31671. padding = 4
  31672. }
  31673. var key = parseKeys(publicKey)
  31674. var paddedMsg
  31675. if (padding === 4) {
  31676. paddedMsg = oaep(key, msg)
  31677. } else if (padding === 1) {
  31678. paddedMsg = pkcs1(key, msg, reverse)
  31679. } else if (padding === 3) {
  31680. paddedMsg = new BN(msg)
  31681. if (paddedMsg.cmp(key.modulus) >= 0) {
  31682. throw new Error('data too long for modulus')
  31683. }
  31684. } else {
  31685. throw new Error('unknown padding')
  31686. }
  31687. if (reverse) {
  31688. return crt(paddedMsg, key)
  31689. } else {
  31690. return withPublic(paddedMsg, key)
  31691. }
  31692. }
  31693. function oaep (key, msg) {
  31694. var k = key.modulus.byteLength()
  31695. var mLen = msg.length
  31696. var iHash = createHash('sha1').update(Buffer.alloc(0)).digest()
  31697. var hLen = iHash.length
  31698. var hLen2 = 2 * hLen
  31699. if (mLen > k - hLen2 - 2) {
  31700. throw new Error('message too long')
  31701. }
  31702. var ps = Buffer.alloc(k - mLen - hLen2 - 2)
  31703. var dblen = k - hLen - 1
  31704. var seed = randomBytes(hLen)
  31705. var maskedDb = xor(Buffer.concat([iHash, ps, Buffer.alloc(1, 1), msg], dblen), mgf(seed, dblen))
  31706. var maskedSeed = xor(seed, mgf(maskedDb, hLen))
  31707. return new BN(Buffer.concat([Buffer.alloc(1), maskedSeed, maskedDb], k))
  31708. }
  31709. function pkcs1 (key, msg, reverse) {
  31710. var mLen = msg.length
  31711. var k = key.modulus.byteLength()
  31712. if (mLen > k - 11) {
  31713. throw new Error('message too long')
  31714. }
  31715. var ps
  31716. if (reverse) {
  31717. ps = Buffer.alloc(k - mLen - 3, 0xff)
  31718. } else {
  31719. ps = nonZero(k - mLen - 3)
  31720. }
  31721. return new BN(Buffer.concat([Buffer.from([0, reverse ? 1 : 2]), ps, Buffer.alloc(1), msg], k))
  31722. }
  31723. function nonZero (len) {
  31724. var out = Buffer.allocUnsafe(len)
  31725. var i = 0
  31726. var cache = randomBytes(len * 2)
  31727. var cur = 0
  31728. var num
  31729. while (i < len) {
  31730. if (cur === cache.length) {
  31731. cache = randomBytes(len * 2)
  31732. cur = 0
  31733. }
  31734. num = cache[cur++]
  31735. if (num) {
  31736. out[i++] = num
  31737. }
  31738. }
  31739. return out
  31740. }
  31741. /***/ }),
  31742. /* 196 */
  31743. /*!********************************************!*\
  31744. !*** ./node_modules/public-encrypt/mgf.js ***!
  31745. \********************************************/
  31746. /*! no static exports found */
  31747. /***/ (function(module, exports, __webpack_require__) {
  31748. var createHash = __webpack_require__(/*! create-hash */ 53)
  31749. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  31750. module.exports = function (seed, len) {
  31751. var t = Buffer.alloc(0)
  31752. var i = 0
  31753. var c
  31754. while (t.length < len) {
  31755. c = i2ops(i++)
  31756. t = Buffer.concat([t, createHash('sha1').update(seed).update(c).digest()])
  31757. }
  31758. return t.slice(0, len)
  31759. }
  31760. function i2ops (c) {
  31761. var out = Buffer.allocUnsafe(4)
  31762. out.writeUInt32BE(c, 0)
  31763. return out
  31764. }
  31765. /***/ }),
  31766. /* 197 */
  31767. /*!********************************************!*\
  31768. !*** ./node_modules/public-encrypt/xor.js ***!
  31769. \********************************************/
  31770. /*! no static exports found */
  31771. /***/ (function(module, exports) {
  31772. module.exports = function xor (a, b) {
  31773. var len = a.length
  31774. var i = -1
  31775. while (++i < len) {
  31776. a[i] ^= b[i]
  31777. }
  31778. return a
  31779. }
  31780. /***/ }),
  31781. /* 198 */
  31782. /*!***************************************************!*\
  31783. !*** ./node_modules/public-encrypt/withPublic.js ***!
  31784. \***************************************************/
  31785. /*! no static exports found */
  31786. /***/ (function(module, exports, __webpack_require__) {
  31787. var BN = __webpack_require__(/*! bn.js */ 130)
  31788. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  31789. function withPublic (paddedMsg, key) {
  31790. return Buffer.from(paddedMsg
  31791. .toRed(BN.mont(key.modulus))
  31792. .redPow(new BN(key.publicExponent))
  31793. .fromRed()
  31794. .toArray())
  31795. }
  31796. module.exports = withPublic
  31797. /***/ }),
  31798. /* 199 */
  31799. /*!*******************************************************!*\
  31800. !*** ./node_modules/public-encrypt/privateDecrypt.js ***!
  31801. \*******************************************************/
  31802. /*! no static exports found */
  31803. /***/ (function(module, exports, __webpack_require__) {
  31804. var parseKeys = __webpack_require__(/*! parse-asn1 */ 171)
  31805. var mgf = __webpack_require__(/*! ./mgf */ 196)
  31806. var xor = __webpack_require__(/*! ./xor */ 197)
  31807. var BN = __webpack_require__(/*! bn.js */ 130)
  31808. var crt = __webpack_require__(/*! browserify-rsa */ 140)
  31809. var createHash = __webpack_require__(/*! create-hash */ 53)
  31810. var withPublic = __webpack_require__(/*! ./withPublic */ 198)
  31811. var Buffer = __webpack_require__(/*! safe-buffer */ 48).Buffer
  31812. module.exports = function privateDecrypt (privateKey, enc, reverse) {
  31813. var padding
  31814. if (privateKey.padding) {
  31815. padding = privateKey.padding
  31816. } else if (reverse) {
  31817. padding = 1
  31818. } else {
  31819. padding = 4
  31820. }
  31821. var key = parseKeys(privateKey)
  31822. var k = key.modulus.byteLength()
  31823. if (enc.length > k || new BN(enc).cmp(key.modulus) >= 0) {
  31824. throw new Error('decryption error')
  31825. }
  31826. var msg
  31827. if (reverse) {
  31828. msg = withPublic(new BN(enc), key)
  31829. } else {
  31830. msg = crt(enc, key)
  31831. }
  31832. var zBuffer = Buffer.alloc(k - msg.length)
  31833. msg = Buffer.concat([zBuffer, msg], k)
  31834. if (padding === 4) {
  31835. return oaep(key, msg)
  31836. } else if (padding === 1) {
  31837. return pkcs1(key, msg, reverse)
  31838. } else if (padding === 3) {
  31839. return msg
  31840. } else {
  31841. throw new Error('unknown padding')
  31842. }
  31843. }
  31844. function oaep (key, msg) {
  31845. var k = key.modulus.byteLength()
  31846. var iHash = createHash('sha1').update(Buffer.alloc(0)).digest()
  31847. var hLen = iHash.length
  31848. if (msg[0] !== 0) {
  31849. throw new Error('decryption error')
  31850. }
  31851. var maskedSeed = msg.slice(1, hLen + 1)
  31852. var maskedDb = msg.slice(hLen + 1)
  31853. var seed = xor(maskedSeed, mgf(maskedDb, hLen))
  31854. var db = xor(maskedDb, mgf(seed, k - hLen - 1))
  31855. if (compare(iHash, db.slice(0, hLen))) {
  31856. throw new Error('decryption error')
  31857. }
  31858. var i = hLen
  31859. while (db[i] === 0) {
  31860. i++
  31861. }
  31862. if (db[i++] !== 1) {
  31863. throw new Error('decryption error')
  31864. }
  31865. return db.slice(i)
  31866. }
  31867. function pkcs1 (key, msg, reverse) {
  31868. var p1 = msg.slice(0, 2)
  31869. var i = 2
  31870. var status = 0
  31871. while (msg[i++] !== 0) {
  31872. if (i >= msg.length) {
  31873. status++
  31874. break
  31875. }
  31876. }
  31877. var ps = msg.slice(2, i - 1)
  31878. if ((p1.toString('hex') !== '0002' && !reverse) || (p1.toString('hex') !== '0001' && reverse)) {
  31879. status++
  31880. }
  31881. if (ps.length < 8) {
  31882. status++
  31883. }
  31884. if (status) {
  31885. throw new Error('decryption error')
  31886. }
  31887. return msg.slice(i)
  31888. }
  31889. function compare (a, b) {
  31890. a = Buffer.from(a)
  31891. b = Buffer.from(b)
  31892. var dif = 0
  31893. var len = a.length
  31894. if (a.length !== b.length) {
  31895. dif++
  31896. len = Math.min(a.length, b.length)
  31897. }
  31898. var i = -1
  31899. while (++i < len) {
  31900. dif += (a[i] ^ b[i])
  31901. }
  31902. return dif
  31903. }
  31904. /***/ }),
  31905. /* 200 */
  31906. /*!********************************************!*\
  31907. !*** ./node_modules/randomfill/browser.js ***!
  31908. \********************************************/
  31909. /*! no static exports found */
  31910. /***/ (function(module, exports, __webpack_require__) {
  31911. "use strict";
  31912. /* WEBPACK VAR INJECTION */(function(global, process) {
  31913. function oldBrowser () {
  31914. throw new Error('secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11')
  31915. }
  31916. var safeBuffer = __webpack_require__(/*! safe-buffer */ 48)
  31917. var randombytes = __webpack_require__(/*! randombytes */ 45)
  31918. var Buffer = safeBuffer.Buffer
  31919. var kBufferMaxLength = safeBuffer.kMaxLength
  31920. var crypto = global.crypto || global.msCrypto
  31921. var kMaxUint32 = Math.pow(2, 32) - 1
  31922. function assertOffset (offset, length) {
  31923. if (typeof offset !== 'number' || offset !== offset) { // eslint-disable-line no-self-compare
  31924. throw new TypeError('offset must be a number')
  31925. }
  31926. if (offset > kMaxUint32 || offset < 0) {
  31927. throw new TypeError('offset must be a uint32')
  31928. }
  31929. if (offset > kBufferMaxLength || offset > length) {
  31930. throw new RangeError('offset out of range')
  31931. }
  31932. }
  31933. function assertSize (size, offset, length) {
  31934. if (typeof size !== 'number' || size !== size) { // eslint-disable-line no-self-compare
  31935. throw new TypeError('size must be a number')
  31936. }
  31937. if (size > kMaxUint32 || size < 0) {
  31938. throw new TypeError('size must be a uint32')
  31939. }
  31940. if (size + offset > length || size > kBufferMaxLength) {
  31941. throw new RangeError('buffer too small')
  31942. }
  31943. }
  31944. if ((crypto && crypto.getRandomValues) || !process.browser) {
  31945. exports.randomFill = randomFill
  31946. exports.randomFillSync = randomFillSync
  31947. } else {
  31948. exports.randomFill = oldBrowser
  31949. exports.randomFillSync = oldBrowser
  31950. }
  31951. function randomFill (buf, offset, size, cb) {
  31952. if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) {
  31953. throw new TypeError('"buf" argument must be a Buffer or Uint8Array')
  31954. }
  31955. if (typeof offset === 'function') {
  31956. cb = offset
  31957. offset = 0
  31958. size = buf.length
  31959. } else if (typeof size === 'function') {
  31960. cb = size
  31961. size = buf.length - offset
  31962. } else if (typeof cb !== 'function') {
  31963. throw new TypeError('"cb" argument must be a function')
  31964. }
  31965. assertOffset(offset, buf.length)
  31966. assertSize(size, offset, buf.length)
  31967. return actualFill(buf, offset, size, cb)
  31968. }
  31969. function actualFill (buf, offset, size, cb) {
  31970. if (process.browser) {
  31971. var ourBuf = buf.buffer
  31972. var uint = new Uint8Array(ourBuf, offset, size)
  31973. crypto.getRandomValues(uint)
  31974. if (cb) {
  31975. process.nextTick(function () {
  31976. cb(null, buf)
  31977. })
  31978. return
  31979. }
  31980. return buf
  31981. }
  31982. if (cb) {
  31983. randombytes(size, function (err, bytes) {
  31984. if (err) {
  31985. return cb(err)
  31986. }
  31987. bytes.copy(buf, offset)
  31988. cb(null, buf)
  31989. })
  31990. return
  31991. }
  31992. var bytes = randombytes(size)
  31993. bytes.copy(buf, offset)
  31994. return buf
  31995. }
  31996. function randomFillSync (buf, offset, size) {
  31997. if (typeof offset === 'undefined') {
  31998. offset = 0
  31999. }
  32000. if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) {
  32001. throw new TypeError('"buf" argument must be a Buffer or Uint8Array')
  32002. }
  32003. assertOffset(offset, buf.length)
  32004. if (size === undefined) size = buf.length - offset
  32005. assertSize(size, offset, buf.length)
  32006. return actualFill(buf, offset, size)
  32007. }
  32008. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ 2), __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 46)))
  32009. /***/ }),
  32010. /* 201 */,
  32011. /* 202 */,
  32012. /* 203 */,
  32013. /* 204 */,
  32014. /* 205 */,
  32015. /* 206 */,
  32016. /* 207 */
  32017. /*!*****************************************************************!*\
  32018. !*** D:/zheng_dev2021/caimei-applets-hehe/mixins/shareEntry.js ***!
  32019. \*****************************************************************/
  32020. /*! no static exports found */
  32021. /***/ (function(module, exports, __webpack_require__) {
  32022. "use strict";
  32023. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  32024. var _vuex = __webpack_require__(/*! vuex */ 11);function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}
  32025. var shareEntry = {
  32026. data: function data() {
  32027. return {
  32028. // 分享链接携带的数据
  32029. shareData: {
  32030. type: '',
  32031. inviteUserId: '',
  32032. activityId: '',
  32033. productId: '',
  32034. userId: '',
  32035. keyWord: '',
  32036. jumpState: '' } };
  32037. },
  32038. methods: _objectSpread(_objectSpread({},
  32039. (0, _vuex.mapMutations)('user', ['setInviteUserId'])), {}, {
  32040. // 处理分享参数
  32041. shareHandle: function shareHandle(option) {
  32042. var state_str = option.state_str;
  32043. if (!state_str) return;
  32044. state_str = decodeURIComponent(state_str);
  32045. try {
  32046. var decrypt = this.$crypto.decrypt(state_str);
  32047. // 解密参数
  32048. this.shareData = _objectSpread(_objectSpread({},
  32049. this.shareData),
  32050. JSON.parse(decrypt));
  32051. // 保存分享者的用户id
  32052. this.setInviteUserId(this.shareData.inviteUserId);
  32053. this.jumpTopSharePage();
  32054. } catch (e) {
  32055. console.log(e);
  32056. return;
  32057. }
  32058. },
  32059. // 跳转到对应的分享页面
  32060. jumpTopSharePage: function jumpTopSharePage() {var _this = this;
  32061. if (!this.shareData.type || this.shareData.type === 0) return;
  32062. var path = {
  32063. 0: '/pages/tabBar/index/index', //首页
  32064. 1: "/pages/goods/product-detail?productId=".concat(this.shareData.productId, "&jumpState=").concat(this.shareData.jumpState), //商品详情
  32065. 2: "/pages/goods/search?type=share&keyWord=".concat(this.shareData.keyWord), // 搜索页面
  32066. 3: "/pages/user/activity/activity?type=share&activityId=".concat(this.shareData.activityId, "&userId=").concat(this.shareData.userId) //活动商品列表
  32067. };
  32068. // 1000 ms后跳转
  32069. setTimeout(function () {
  32070. _this.$api.navigateTo(path[_this.shareData.type]);
  32071. }, 1000);
  32072. } }) };var _default =
  32073. shareEntry;exports.default = _default;
  32074. /***/ }),
  32075. /* 208 */,
  32076. /* 209 */,
  32077. /* 210 */,
  32078. /* 211 */,
  32079. /* 212 */,
  32080. /* 213 */,
  32081. /* 214 */,
  32082. /* 215 */,
  32083. /* 216 */
  32084. /*!*****************************************************************!*\
  32085. !*** D:/zheng_dev2021/caimei-applets-hehe/common/couponUtil.js ***!
  32086. \*****************************************************************/
  32087. /*! no static exports found */
  32088. /***/ (function(module, exports, __webpack_require__) {
  32089. "use strict";
  32090. Object.defineProperty(exports, "__esModule", { value: true });exports.fetchSelectedProducts = fetchSelectedProducts;exports.findCouponBySelected = findCouponBySelected;exports.canUseCoupon = canUseCoupon;exports.allProdoceUseCheck = allProdoceUseCheck;exports.someProductUseCheck = someProductUseCheck;exports.getCountPrice = getCountPrice;exports.couponSort = couponSort;exports.couponFilterRepeat = couponFilterRepeat;exports.setCouponUniqueId = setCouponUniqueId;var _util = __webpack_require__(/*! @/common/util.js */ 32);function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}
  32091. // 获取选中商品
  32092. function fetchSelectedProducts(goodsList) {
  32093. var productList = [];
  32094. goodsList.forEach(function (shop) {return productList.push.apply(productList, _toConsumableArray(shop.productList.filter(function (prod) {return prod.productsChecked;})));});
  32095. return productList;
  32096. }
  32097. // 根据选中商品筛选可用优惠券并排序
  32098. function findCouponBySelected(productIds, couponList) {
  32099. var list = couponList.filter(function (coupon) {return coupon.productType === 1 || (0, _util.isIntersect)(productIds, coupon.productIds.
  32100. split(','));});
  32101. return couponSort(list);
  32102. }
  32103. /**
  32104. * 优惠券是否可用
  32105. * 1 无门槛
  32106. * 2 有门槛
  32107. * 1 全部商品可用
  32108. * 全部商品价格总计 >= 当前优惠券的触发金额
  32109. * 2 指定商品可用
  32110. * 当前优惠券可用的商品的价格总计 >= 当前优惠券的触发金额
  32111. * */
  32112. // 判断可用优惠券是否满足使用条件 返回抵扣金额最高的优惠券索引 -1:无可用优惠券
  32113. function canUseCoupon(current, productIds, canUseCouponList, selectedPoducts) {
  32114. if (productIds.length <= 0 || canUseCouponList.length <= 0) return -1;
  32115. var len = canUseCouponList.length;
  32116. if (current >= len) return len;
  32117. var currentCoupon = canUseCouponList[current];
  32118. if (
  32119. currentCoupon.noThresholdFlag === 1 ||
  32120. currentCoupon.productType === 1 && allProdoceUseCheck(selectedPoducts, currentCoupon) ||
  32121. currentCoupon.productType === 2 && someProductUseCheck(selectedPoducts, currentCoupon))
  32122. {
  32123. return current;
  32124. } else {
  32125. return canUseCoupon(++current, productIds, canUseCouponList, selectedPoducts);
  32126. }
  32127. }
  32128. // 判断全部商品可用 (全部商品价格总计 是否大于 当前优惠券的触发金额)
  32129. function allProdoceUseCheck(productList, coupon) {
  32130. var countPrice = productList.reduce(function (countPrice, prod) {return countPrice + prod.price * prod.productCount;}, 0);
  32131. return countPrice >= coupon.touchPrice;
  32132. }
  32133. // 判断指定商品可用 (当前优惠券可用的商品的价格总计 是否大于 当前优惠券的触发金额)
  32134. function someProductUseCheck(productList, coupon) {
  32135. var countPrice = productList.reduce(function (countPrice, prod) {
  32136. // 当前优惠券可用的商品总价
  32137. var isIncludes = coupon.productIds.indexOf(prod.productId.toString()) > -1;
  32138. return isIncludes ? countPrice + prod.price * prod.productCount : countPrice;
  32139. }, 0);
  32140. return countPrice >= coupon.touchPrice;
  32141. }
  32142. // 计算当前优惠券可使用的商品的总价
  32143. function getCountPrice(productList, coupon) {
  32144. var countPrice = 0;
  32145. // 针对全部商品
  32146. if (coupon.productType === 1) {
  32147. countPrice = productList.reduce(function (countPrice, prod) {return countPrice + prod.price * prod.productCount;}, 0);
  32148. }
  32149. // 只针对优惠券可用商品
  32150. if (coupon.productType === 2) {
  32151. countPrice = productList.reduce(function (countPrice, prod) {
  32152. // 当前优惠券可用的商品总价
  32153. var isIncludes = coupon.productIds.indexOf(prod.productId.toString()) > -1;
  32154. return isIncludes ? countPrice + prod.price * prod.productCount : countPrice;
  32155. }, 0);
  32156. }
  32157. return countPrice;
  32158. }
  32159. // 将优惠券按抵扣金额从大到小排序
  32160. function couponSort(couponList) {
  32161. return couponList.sort(function (a, b) {return b.couponAmount - a.couponAmount;});
  32162. }
  32163. // 对优惠券去重 过滤掉相同id的优惠券
  32164. function couponFilterRepeat(couponList) {
  32165. var list = [];
  32166. couponList.forEach(function (coupon) {
  32167. if (list.findIndex(function (v) {return v.couponId === coupon.couponId;}) === -1) list.push(coupon);
  32168. });
  32169. return list;
  32170. }
  32171. // 为优惠券设置唯一ID
  32172. function setCouponUniqueId() {var couponList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  32173. return couponList.map(function (coupon, index) {
  32174. coupon.uniqueId = index;
  32175. return coupon;
  32176. });
  32177. }
  32178. /***/ }),
  32179. /* 217 */,
  32180. /* 218 */,
  32181. /* 219 */,
  32182. /* 220 */,
  32183. /* 221 */,
  32184. /* 222 */,
  32185. /* 223 */,
  32186. /* 224 */,
  32187. /* 225 */
  32188. /*!****************************************************************!*\
  32189. !*** D:/zheng_dev2021/caimei-applets-hehe/services/wxLogin.js ***!
  32190. \****************************************************************/
  32191. /*! no static exports found */
  32192. /***/ (function(module, exports, __webpack_require__) {
  32193. "use strict";
  32194. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 23));var _index = _interopRequireDefault(__webpack_require__(/*! @/store/index.js */ 10));
  32195. var _authorize = _interopRequireDefault(__webpack_require__(/*! @/common/authorize.js */ 15));
  32196. var _ajaxService = _interopRequireDefault(__webpack_require__(/*! @/services/ajax.service.js */ 20));
  32197. var _user = _interopRequireDefault(__webpack_require__(/*! @/services/user.service */ 26));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}
  32198. var newUserService = new _user.default(_ajaxService.default);
  32199. // 根据微信的code获取用户登录状态:1已登录过 -1未登录过
  32200. var wxLoginAuthorize = /*#__PURE__*/function () {var _ref = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee() {var wechatCode;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:_context.next = 2;return (
  32201. _authorize.default.getCode('weixin'));case 2:wechatCode = _context.sent; // 根据微信的code获取用户登录状态:1已登录过 -1未登录过
  32202. newUserService.UserWechatAuthorLogin({
  32203. code: wechatCode }).
  32204. then(function (response) {
  32205. var _data = JSON.parse(response.data);
  32206. _index.default.commit('app/updateStatus', _data);
  32207. _index.default.commit('app/login', _data);
  32208. uni.setStorageSync('openId', _data.openId);
  32209. }).
  32210. catch(function (error) {
  32211. var _data = JSON.parse(error.data);
  32212. uni.setStorageSync('openId', _data.openId);
  32213. _index.default.commit('app/logout', _data);
  32214. _index.default.commit('app/updateStatus', _data);
  32215. });case 4:case "end":return _context.stop();}}}, _callee);}));return function wxLoginAuthorize() {return _ref.apply(this, arguments);};}();
  32216. var wxLoginQuick = /*#__PURE__*/function () {var _ref2 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee2() {var wechatCode, getUserInfo, params;return _regenerator.default.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:_context2.next = 2;return (
  32217. _authorize.default.getCode('weixin'));case 2:wechatCode = _context2.sent;_context2.next = 5;return (
  32218. _authorize.default.getUserInfo('weixin'));case 5:getUserInfo = _context2.sent;
  32219. params =
  32220. newUserService.UserWechatAuthorLogin({
  32221. code: wechatCode }).
  32222. then(function (response) {
  32223. var _data = JSON.parse(response.data);
  32224. _index.default.commit('app/updateStatus', _data);
  32225. _index.default.commit('app/login', _data);
  32226. uni.setStorageSync('openId', _data.openId);
  32227. }).
  32228. catch(function (error) {
  32229. var _data = JSON.parse(response.data);
  32230. uni.setStorageSync('openId', _data.openId);
  32231. _index.default.commit('app/logout', _data);
  32232. _index.default.commit('app/updateStatus', _data);
  32233. });case 7:case "end":return _context2.stop();}}}, _callee2);}));return function wxLoginQuick() {return _ref2.apply(this, arguments);};}();var _default =
  32234. {
  32235. wxLoginAuthorize: wxLoginAuthorize,
  32236. wxLoginQuick: wxLoginQuick };exports.default = _default;
  32237. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  32238. /***/ }),
  32239. /* 226 */,
  32240. /* 227 */,
  32241. /* 228 */,
  32242. /* 229 */,
  32243. /* 230 */,
  32244. /* 231 */,
  32245. /* 232 */,
  32246. /* 233 */,
  32247. /* 234 */,
  32248. /* 235 */,
  32249. /* 236 */,
  32250. /* 237 */,
  32251. /* 238 */,
  32252. /* 239 */,
  32253. /* 240 */,
  32254. /* 241 */,
  32255. /* 242 */,
  32256. /* 243 */,
  32257. /* 244 */,
  32258. /* 245 */,
  32259. /* 246 */,
  32260. /* 247 */,
  32261. /* 248 */,
  32262. /* 249 */,
  32263. /* 250 */,
  32264. /* 251 */,
  32265. /* 252 */,
  32266. /* 253 */,
  32267. /* 254 */,
  32268. /* 255 */,
  32269. /* 256 */,
  32270. /* 257 */,
  32271. /* 258 */,
  32272. /* 259 */,
  32273. /* 260 */,
  32274. /* 261 */,
  32275. /* 262 */,
  32276. /* 263 */,
  32277. /* 264 */,
  32278. /* 265 */,
  32279. /* 266 */,
  32280. /* 267 */,
  32281. /* 268 */,
  32282. /* 269 */,
  32283. /* 270 */,
  32284. /* 271 */,
  32285. /* 272 */,
  32286. /* 273 */,
  32287. /* 274 */,
  32288. /* 275 */,
  32289. /* 276 */,
  32290. /* 277 */,
  32291. /* 278 */,
  32292. /* 279 */,
  32293. /* 280 */,
  32294. /* 281 */,
  32295. /* 282 */,
  32296. /* 283 */,
  32297. /* 284 */,
  32298. /* 285 */,
  32299. /* 286 */,
  32300. /* 287 */,
  32301. /* 288 */,
  32302. /* 289 */,
  32303. /* 290 */,
  32304. /* 291 */,
  32305. /* 292 */,
  32306. /* 293 */,
  32307. /* 294 */,
  32308. /* 295 */,
  32309. /* 296 */,
  32310. /* 297 */,
  32311. /* 298 */,
  32312. /* 299 */,
  32313. /* 300 */,
  32314. /* 301 */,
  32315. /* 302 */,
  32316. /* 303 */,
  32317. /* 304 */,
  32318. /* 305 */,
  32319. /* 306 */,
  32320. /* 307 */,
  32321. /* 308 */,
  32322. /* 309 */,
  32323. /* 310 */,
  32324. /* 311 */,
  32325. /* 312 */,
  32326. /* 313 */,
  32327. /* 314 */,
  32328. /* 315 */,
  32329. /* 316 */,
  32330. /* 317 */,
  32331. /* 318 */,
  32332. /* 319 */,
  32333. /* 320 */,
  32334. /* 321 */,
  32335. /* 322 */
  32336. /*!****************************************************************!*\
  32337. !*** D:/zheng_dev2021/caimei-applets-hehe/mixins/wechatPay.js ***!
  32338. \****************************************************************/
  32339. /*! no static exports found */
  32340. /***/ (function(module, exports, __webpack_require__) {
  32341. "use strict";
  32342. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 23));var _authorize = _interopRequireDefault(__webpack_require__(/*! @/common/authorize.js */ 15));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}
  32343. // 调用微信支付
  32344. function wxRequestPayment(payment) {
  32345. return new Promise(function (resolve, reject) {
  32346. uni.requestPayment({
  32347. timeStamp: payment.timeStamp,
  32348. nonceStr: payment.nonceStr,
  32349. package: payment.package,
  32350. signType: payment.signType,
  32351. paySign: payment.paySign,
  32352. success: function success() {
  32353. resolve(true);
  32354. },
  32355. fail: function fail() {
  32356. reject({ msg: 'error' });
  32357. } });
  32358. });
  32359. }
  32360. // 微信支付
  32361. var wechatPay = {
  32362. data: function data() {
  32363. return {
  32364. loadingText: '请稍等...',
  32365. isSubLoading: false };
  32366. },
  32367. methods: {
  32368. // 验证微信支付是否可用
  32369. miniWxPayFor: function miniWxPayFor(data) {var _this = this;
  32370. this.isSubLoading = true;
  32371. this.PayService.PayOrderOnLineSwitch().then(function (response) {
  32372. if (response.data === 1) {
  32373. _this.weChatMiniWxPay(data);
  32374. } else {
  32375. _this.isSubLoading = false;
  32376. _this.$api.navigateTo("/pages/user/order/order-payment?money=".concat(data.payableAmount));
  32377. }
  32378. });
  32379. },
  32380. // 获取微信支付payment
  32381. weChatMiniWxPay: function weChatMiniWxPay(data) {var _this2 = this;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee() {var wechatCode, response, payment, payFlag;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:
  32382. if (_this2.loadingText) _this2.loadingText = '等待支付中';_context.prev = 1;_context.next = 4;return (
  32383. _authorize.default.getCode('weixin'));case 4:wechatCode = _context.sent;_context.next = 7;return (
  32384. _this2.PayService.WeChatMiniWxPay({
  32385. payAmount: data.payableAmount * 100,
  32386. payWay: 'WEIXIN',
  32387. code: wechatCode,
  32388. orderId: data.orderId }));case 7:response = _context.sent;
  32389. // 处理支付信息 调用微信支付
  32390. payment = JSON.parse(response.data.data.payInfo);_context.next = 11;return (
  32391. wxRequestPayment(payment));case 11:payFlag = _context.sent;
  32392. // 支付成功重定向
  32393. uni.setStorageSync('orderInfo', _this2.hanldOrder.order);
  32394. if (payFlag) {
  32395. uni.redirectTo({ url: '/pages/user/order/success' });
  32396. } else {
  32397. uni.redirectTo({ url: '/pages/user/order/error' });
  32398. }_context.next = 19;break;case 16:_context.prev = 16;_context.t0 = _context["catch"](1);
  32399. // 微信支付失败
  32400. if (_context.t0.msg === 'error') {
  32401. uni.setStorageSync('orderInfo', _this2.hanldOrder.order);
  32402. uni.redirectTo({ url: '/pages/user/order/error' });
  32403. } else _this2.$util.msg(_context.t0.msg, 2000);case 19:_context.prev = 19;
  32404. _this2.isSubLoading = false;return _context.finish(19);case 22:case "end":return _context.stop();}}}, _callee, null, [[1, 16, 19, 22]]);}))();
  32405. } } };var _default =
  32406. wechatPay;exports.default = _default;
  32407. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  32408. /***/ }),
  32409. /* 323 */,
  32410. /* 324 */,
  32411. /* 325 */,
  32412. /* 326 */,
  32413. /* 327 */,
  32414. /* 328 */,
  32415. /* 329 */,
  32416. /* 330 */,
  32417. /* 331 */,
  32418. /* 332 */,
  32419. /* 333 */,
  32420. /* 334 */,
  32421. /* 335 */,
  32422. /* 336 */,
  32423. /* 337 */,
  32424. /* 338 */,
  32425. /* 339 */,
  32426. /* 340 */,
  32427. /* 341 */,
  32428. /* 342 */,
  32429. /* 343 */,
  32430. /* 344 */,
  32431. /* 345 */,
  32432. /* 346 */,
  32433. /* 347 */,
  32434. /* 348 */,
  32435. /* 349 */,
  32436. /* 350 */,
  32437. /* 351 */,
  32438. /* 352 */,
  32439. /* 353 */,
  32440. /* 354 */,
  32441. /* 355 */,
  32442. /* 356 */,
  32443. /* 357 */,
  32444. /* 358 */,
  32445. /* 359 */,
  32446. /* 360 */,
  32447. /* 361 */,
  32448. /* 362 */,
  32449. /* 363 */,
  32450. /* 364 */,
  32451. /* 365 */,
  32452. /* 366 */,
  32453. /* 367 */,
  32454. /* 368 */,
  32455. /* 369 */,
  32456. /* 370 */,
  32457. /* 371 */
  32458. /*!*************************************************************************************!*\
  32459. !*** D:/zheng_dev2021/caimei-applets-hehe/components/clipboard/clipboard.thorui.js ***!
  32460. \*************************************************************************************/
  32461. /*! no static exports found */
  32462. /***/ (function(module, exports, __webpack_require__) {
  32463. /* WEBPACK VAR INJECTION */(function(uni) {/**
  32464. * 复制文本 兼容H5
  32465. * 来自 ThorUI www.thorui.cn | 文档地址: www.donarui.com
  32466. * @author echo.
  32467. * @version 1.0.0
  32468. **/
  32469. var thorui = {
  32470. getClipboardData: function getClipboardData(data, callback) {
  32471. uni.setClipboardData({
  32472. data: data,
  32473. success: function success(res) {
  32474. uni.getClipboardData({
  32475. success: function success(res) {
  32476. 'function' == typeof callback && callback(true);
  32477. },
  32478. fail: function fail(res) {
  32479. 'function' == typeof callback && callback(false);
  32480. } });
  32481. },
  32482. fail: function fail(res) {
  32483. 'function' == typeof callback && callback(false);
  32484. } });
  32485. } };
  32486. module.exports = {
  32487. getClipboardData: thorui.getClipboardData };
  32488. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  32489. /***/ }),
  32490. /* 372 */,
  32491. /* 373 */,
  32492. /* 374 */,
  32493. /* 375 */,
  32494. /* 376 */,
  32495. /* 377 */,
  32496. /* 378 */,
  32497. /* 379 */,
  32498. /* 380 */,
  32499. /* 381 */,
  32500. /* 382 */,
  32501. /* 383 */,
  32502. /* 384 */,
  32503. /* 385 */,
  32504. /* 386 */,
  32505. /* 387 */,
  32506. /* 388 */,
  32507. /* 389 */,
  32508. /* 390 */,
  32509. /* 391 */,
  32510. /* 392 */,
  32511. /* 393 */,
  32512. /* 394 */,
  32513. /* 395 */,
  32514. /* 396 */,
  32515. /* 397 */,
  32516. /* 398 */,
  32517. /* 399 */,
  32518. /* 400 */,
  32519. /* 401 */,
  32520. /* 402 */,
  32521. /* 403 */,
  32522. /* 404 */,
  32523. /* 405 */,
  32524. /* 406 */,
  32525. /* 407 */,
  32526. /* 408 */,
  32527. /* 409 */,
  32528. /* 410 */,
  32529. /* 411 */,
  32530. /* 412 */,
  32531. /* 413 */,
  32532. /* 414 */,
  32533. /* 415 */,
  32534. /* 416 */,
  32535. /* 417 */,
  32536. /* 418 */,
  32537. /* 419 */,
  32538. /* 420 */,
  32539. /* 421 */,
  32540. /* 422 */,
  32541. /* 423 */,
  32542. /* 424 */,
  32543. /* 425 */,
  32544. /* 426 */,
  32545. /* 427 */,
  32546. /* 428 */,
  32547. /* 429 */,
  32548. /* 430 */,
  32549. /* 431 */,
  32550. /* 432 */,
  32551. /* 433 */,
  32552. /* 434 */,
  32553. /* 435 */,
  32554. /* 436 */,
  32555. /* 437 */,
  32556. /* 438 */,
  32557. /* 439 */,
  32558. /* 440 */,
  32559. /* 441 */,
  32560. /* 442 */,
  32561. /* 443 */,
  32562. /* 444 */,
  32563. /* 445 */,
  32564. /* 446 */,
  32565. /* 447 */,
  32566. /* 448 */,
  32567. /* 449 */,
  32568. /* 450 */,
  32569. /* 451 */,
  32570. /* 452 */,
  32571. /* 453 */,
  32572. /* 454 */,
  32573. /* 455 */,
  32574. /* 456 */,
  32575. /* 457 */,
  32576. /* 458 */,
  32577. /* 459 */,
  32578. /* 460 */,
  32579. /* 461 */,
  32580. /* 462 */,
  32581. /* 463 */,
  32582. /* 464 */,
  32583. /* 465 */,
  32584. /* 466 */,
  32585. /* 467 */,
  32586. /* 468 */,
  32587. /* 469 */,
  32588. /* 470 */,
  32589. /* 471 */,
  32590. /* 472 */,
  32591. /* 473 */,
  32592. /* 474 */,
  32593. /* 475 */,
  32594. /* 476 */,
  32595. /* 477 */,
  32596. /* 478 */,
  32597. /* 479 */,
  32598. /* 480 */,
  32599. /* 481 */,
  32600. /* 482 */,
  32601. /* 483 */,
  32602. /* 484 */,
  32603. /* 485 */,
  32604. /* 486 */,
  32605. /* 487 */,
  32606. /* 488 */,
  32607. /* 489 */,
  32608. /* 490 */,
  32609. /* 491 */,
  32610. /* 492 */,
  32611. /* 493 */,
  32612. /* 494 */,
  32613. /* 495 */,
  32614. /* 496 */,
  32615. /* 497 */,
  32616. /* 498 */,
  32617. /* 499 */,
  32618. /* 500 */,
  32619. /* 501 */,
  32620. /* 502 */,
  32621. /* 503 */,
  32622. /* 504 */,
  32623. /* 505 */,
  32624. /* 506 */,
  32625. /* 507 */,
  32626. /* 508 */,
  32627. /* 509 */,
  32628. /* 510 */,
  32629. /* 511 */,
  32630. /* 512 */,
  32631. /* 513 */,
  32632. /* 514 */,
  32633. /* 515 */,
  32634. /* 516 */,
  32635. /* 517 */,
  32636. /* 518 */,
  32637. /* 519 */,
  32638. /* 520 */,
  32639. /* 521 */,
  32640. /* 522 */,
  32641. /* 523 */,
  32642. /* 524 */,
  32643. /* 525 */,
  32644. /* 526 */,
  32645. /* 527 */,
  32646. /* 528 */,
  32647. /* 529 */,
  32648. /* 530 */,
  32649. /* 531 */,
  32650. /* 532 */,
  32651. /* 533 */,
  32652. /* 534 */,
  32653. /* 535 */,
  32654. /* 536 */,
  32655. /* 537 */,
  32656. /* 538 */,
  32657. /* 539 */,
  32658. /* 540 */,
  32659. /* 541 */,
  32660. /* 542 */,
  32661. /* 543 */,
  32662. /* 544 */,
  32663. /* 545 */,
  32664. /* 546 */,
  32665. /* 547 */,
  32666. /* 548 */,
  32667. /* 549 */,
  32668. /* 550 */,
  32669. /* 551 */,
  32670. /* 552 */,
  32671. /* 553 */,
  32672. /* 554 */,
  32673. /* 555 */,
  32674. /* 556 */,
  32675. /* 557 */,
  32676. /* 558 */,
  32677. /* 559 */,
  32678. /* 560 */,
  32679. /* 561 */,
  32680. /* 562 */,
  32681. /* 563 */,
  32682. /* 564 */,
  32683. /* 565 */,
  32684. /* 566 */,
  32685. /* 567 */,
  32686. /* 568 */,
  32687. /* 569 */,
  32688. /* 570 */,
  32689. /* 571 */,
  32690. /* 572 */,
  32691. /* 573 */,
  32692. /* 574 */,
  32693. /* 575 */,
  32694. /* 576 */,
  32695. /* 577 */,
  32696. /* 578 */,
  32697. /* 579 */,
  32698. /* 580 */,
  32699. /* 581 */,
  32700. /* 582 */,
  32701. /* 583 */,
  32702. /* 584 */,
  32703. /* 585 */,
  32704. /* 586 */,
  32705. /* 587 */,
  32706. /* 588 */
  32707. /*!****************************************************************************!*\
  32708. !*** D:/zheng_dev2021/caimei-applets-hehe/components/jyf-Parser/Parser.js ***!
  32709. \****************************************************************************/
  32710. /*! no static exports found */
  32711. /***/ (function(module, exports, __webpack_require__) {
  32712. //Parser.js
  32713. var Tokenizer = __webpack_require__(/*! ./Tokenizer.js */ 589);
  32714. var DomHandler = __webpack_require__(/*! ./DomHandler.js */ 590);
  32715. var trustAttrs = {
  32716. align: true,
  32717. alt: true,
  32718. author: true,
  32719. autoplay: true,
  32720. border: true,
  32721. cellpadding: true,
  32722. cellspacing: true,
  32723. class: true,
  32724. color: true,
  32725. colspan: true,
  32726. controls: true,
  32727. "data-src": true,
  32728. dir: true,
  32729. face: true,
  32730. height: true,
  32731. href: true,
  32732. id: true,
  32733. ignore: true,
  32734. loop: true,
  32735. muted: true,
  32736. name: true,
  32737. poster: true,
  32738. rowspan: true,
  32739. size: true,
  32740. span: true,
  32741. src: true,
  32742. start: true,
  32743. style: true,
  32744. type: true,
  32745. "unit-id": true,
  32746. width: true };
  32747. var voidTag = {
  32748. area: true,
  32749. base: true,
  32750. basefont: true,
  32751. br: true,
  32752. col: true,
  32753. circle: true,
  32754. command: true,
  32755. ellipse: true,
  32756. embed: true,
  32757. frame: true,
  32758. hr: true,
  32759. img: true,
  32760. input: true,
  32761. isindex: true,
  32762. keygen: true,
  32763. line: true,
  32764. link: true,
  32765. meta: true,
  32766. param: true,
  32767. path: true,
  32768. polygon: true,
  32769. polyline: true,
  32770. rect: true,
  32771. source: true,
  32772. stop: true,
  32773. track: true,
  32774. use: true,
  32775. wbr: true };
  32776. function Parser(cbs, callback) {
  32777. this._cbs = cbs;
  32778. this._callback = callback;
  32779. this._tagname = "";
  32780. this._attribname = "";
  32781. this._attribvalue = "";
  32782. this._attribs = null;
  32783. this._stack = [];
  32784. this._tokenizer = new Tokenizer(this);
  32785. }
  32786. Parser.prototype.ontext = function (data) {
  32787. this._cbs.ontext(data);
  32788. };
  32789. Parser.prototype.onopentagname = function (name) {
  32790. name = name.toLowerCase();
  32791. this._tagname = name;
  32792. this._attribs = {
  32793. style: '' };
  32794. if (!voidTag[name]) this._stack.push(name);
  32795. };
  32796. Parser.prototype.onopentagend = function () {
  32797. if (this._attribs) {
  32798. this._cbs.onopentag(this._tagname, this._attribs);
  32799. this._attribs = null;
  32800. }
  32801. if (voidTag[this._tagname]) this._cbs.onclosetag(this._tagname);
  32802. this._tagname = "";
  32803. };
  32804. Parser.prototype.onclosetag = function (name) {
  32805. name = name.toLowerCase();
  32806. if (this._stack.length && !voidTag[name]) {
  32807. var pos = this._stack.lastIndexOf(name);
  32808. if (pos !== -1) {
  32809. pos = this._stack.length - pos;
  32810. while (pos--) {this._cbs.onclosetag(this._stack.pop());}
  32811. } else if (name === "p") {
  32812. this.onopentagname(name);
  32813. this._closeCurrentTag();
  32814. }
  32815. } else if (name === "br" || name === "hr" || name === "p") {
  32816. this.onopentagname(name);
  32817. this._closeCurrentTag();
  32818. }
  32819. };
  32820. Parser.prototype._closeCurrentTag = function () {
  32821. var name = this._tagname;
  32822. this.onopentagend();
  32823. if (this._stack[this._stack.length - 1] === name) {
  32824. this._cbs.onclosetag(name);
  32825. this._stack.pop();
  32826. }
  32827. };
  32828. Parser.prototype.onattribend = function () {
  32829. this._attribvalue = this._attribvalue.replace(/&quot;/g, '"');
  32830. if (this._attribs && trustAttrs[this._attribname]) {
  32831. this._attribs[this._attribname] = this._attribvalue;
  32832. }
  32833. this._attribname = "";
  32834. this._attribvalue = "";
  32835. };
  32836. Parser.prototype.onend = function () {
  32837. for (
  32838. var i = this._stack.length; i > 0; this._cbs.onclosetag(this._stack[--i])) {
  32839. ;}
  32840. this._callback({
  32841. 'nodes': this._cbs.nodes,
  32842. 'title': this._cbs.title,
  32843. 'imgList': this._cbs.imgList });
  32844. };
  32845. Parser.prototype.write = function (chunk) {
  32846. this._tokenizer.parse(chunk);
  32847. };
  32848. function html2nodes(data, options) {
  32849. return new Promise(function (resolve, reject) {
  32850. try {
  32851. var style = '';
  32852. data = data.replace(/<style.*?>([\s\S]*?)<\/style>/gi, function () {
  32853. style += arguments[1];
  32854. return '';
  32855. });
  32856. var handler = new DomHandler(style, options);
  32857. new Parser(handler, function (res) {
  32858. return resolve(res);
  32859. }).write(data);
  32860. } catch (err) {
  32861. return reject(err);
  32862. }
  32863. });
  32864. }
  32865. module.exports = html2nodes;
  32866. /***/ }),
  32867. /* 589 */
  32868. /*!*******************************************************************************!*\
  32869. !*** D:/zheng_dev2021/caimei-applets-hehe/components/jyf-Parser/Tokenizer.js ***!
  32870. \*******************************************************************************/
  32871. /*! no static exports found */
  32872. /***/ (function(module, exports) {
  32873. //Tokenizer.js
  32874. function Tokenizer(cbs) {
  32875. this._state = "TEXT";
  32876. this._buffer = "";
  32877. this._sectionStart = 0;
  32878. this._index = 0;
  32879. this._cbs = cbs;
  32880. }
  32881. Tokenizer.prototype.TEXT = function (c) {
  32882. var index = this._buffer.indexOf("<", this._index);
  32883. if (index != -1) {
  32884. this._index = index;
  32885. this._cbs.ontext(this._getSection());
  32886. this._state = "BeforeTag";
  32887. this._sectionStart = this._index;
  32888. } else this._index = this._buffer.length;
  32889. };
  32890. Tokenizer.prototype.BeforeTag = function (c) {
  32891. switch (c) {
  32892. case "/":
  32893. this._state = "BeforeCloseTag";
  32894. break;
  32895. case "!":
  32896. this._state = "BeforeDeclaration";
  32897. break;
  32898. case "?":
  32899. var index = this._buffer.indexOf(">", this._index);
  32900. if (index != -1) {
  32901. this._index = index;
  32902. this._sectionStart = this._index + 1;
  32903. } else this._sectionStart = this._index = this._buffer.length;
  32904. this._state = "TEXT";
  32905. break;
  32906. case ">":
  32907. this._state = "TEXT";
  32908. break;
  32909. case "<":
  32910. this._cbs.ontext(this._getSection());
  32911. this._sectionStart = this._index;
  32912. break;
  32913. default:
  32914. if (/\s/.test(c)) this._state = "TEXT";else
  32915. {
  32916. this._state = "InTag";
  32917. this._sectionStart = this._index;
  32918. }}
  32919. };
  32920. Tokenizer.prototype.InTag = function (c) {
  32921. if (c === "/" || c === ">" || /\s/.test(c)) {
  32922. this._cbs.onopentagname(this._getSection());
  32923. this._state = "BeforeAttrsName";
  32924. this._index--;
  32925. }
  32926. };
  32927. Tokenizer.prototype.BeforeAttrsName = function (c) {
  32928. if (c === ">") {
  32929. this._cbs.onopentagend();
  32930. this._state = "TEXT";
  32931. this._sectionStart = this._index + 1;
  32932. } else if (c === "/") {
  32933. this._state = "InSelfCloseTag";
  32934. } else if (!/\s/.test(c)) {
  32935. this._state = "InAttrsName";
  32936. this._sectionStart = this._index;
  32937. }
  32938. };
  32939. Tokenizer.prototype.InAttrsName = function (c) {
  32940. if (c === "=" || c === "/" || c === ">" || /\s/.test(c)) {
  32941. this._cbs._attribname = this._getSection().toLowerCase();
  32942. this._sectionStart = -1;
  32943. this._state = "AfterAttrsName";
  32944. this._index--;
  32945. }
  32946. };
  32947. Tokenizer.prototype.AfterAttrsName = function (c) {
  32948. if (c === "=") {
  32949. this._state = "BeforeAttrsValue";
  32950. } else if (c === "/" || c === ">") {
  32951. this._cbs.onattribend();
  32952. this._state = "BeforeAttrsName";
  32953. this._index--;
  32954. } else if (!/\s/.test(c)) {
  32955. this._cbs.onattribend();
  32956. this._state = "InAttrsName";
  32957. this._sectionStart = this._index;
  32958. }
  32959. };
  32960. Tokenizer.prototype.BeforeAttrsValue = function (c) {
  32961. if (c === '"') {
  32962. this._state = "InAttrsValueDQ";
  32963. this._sectionStart = this._index + 1;
  32964. } else if (c === "'") {
  32965. this._state = "InAttrsValueSQ";
  32966. this._sectionStart = this._index + 1;
  32967. } else if (!/\s/.test(c)) {
  32968. this._state = "InAttrsValueNQ";
  32969. this._sectionStart = this._index;
  32970. this._index--;
  32971. }
  32972. };
  32973. Tokenizer.prototype.InAttrsValueDQ = function (c) {
  32974. if (c === '"') {
  32975. this._cbs._attribvalue += this._getSection();
  32976. this._cbs.onattribend();
  32977. this._state = "BeforeAttrsName";
  32978. }
  32979. };
  32980. Tokenizer.prototype.InAttrsValueSQ = function (c) {
  32981. if (c === "'") {
  32982. this._cbs._attribvalue += this._getSection();
  32983. this._cbs.onattribend();
  32984. this._state = "BeforeAttrsName";
  32985. }
  32986. };
  32987. Tokenizer.prototype.InAttrsValueNQ = function (c) {
  32988. if (/\s/.test(c) || c === ">") {
  32989. this._cbs._attribvalue += this._getSection();
  32990. this._cbs.onattribend();
  32991. this._state = "BeforeAttrsName";
  32992. this._index--;
  32993. }
  32994. };
  32995. Tokenizer.prototype.BeforeCloseTag = function (c) {
  32996. if (/\s/.test(c)) ;else
  32997. if (c === ">") {
  32998. this._state = "TEXT";
  32999. } else {
  33000. this._state = "InCloseTag";
  33001. this._sectionStart = this._index;
  33002. }
  33003. };
  33004. Tokenizer.prototype.InCloseTag = function (c) {
  33005. if (c === ">" || /\s/.test(c)) {
  33006. this._cbs.onclosetag(this._getSection());
  33007. this._state = "AfterCloseTag";
  33008. this._index--;
  33009. }
  33010. };
  33011. Tokenizer.prototype.InSelfCloseTag = function (c) {
  33012. if (c === ">") {
  33013. this._cbs.onopentagend();
  33014. this._state = "TEXT";
  33015. this._sectionStart = this._index + 1;
  33016. } else if (!/\s/.test(c)) {
  33017. this._state = "BeforeAttrsName";
  33018. this._index--;
  33019. }
  33020. };
  33021. Tokenizer.prototype.AfterCloseTag = function (c) {
  33022. if (c === ">") {
  33023. this._state = "TEXT";
  33024. this._sectionStart = this._index + 1;
  33025. }
  33026. };
  33027. Tokenizer.prototype.BeforeDeclaration = function (c) {
  33028. if (c == '-') this._state = "InComment";else
  33029. if (c == '[') this._state = "BeforeCDATA1";else
  33030. this._state = "InDeclaration";
  33031. };
  33032. Tokenizer.prototype.InDeclaration = function (c) {
  33033. var index = this._buffer.indexOf(">", this._index);
  33034. if (index != -1) {
  33035. this._index = index;
  33036. this._sectionStart = index + 1;
  33037. } else this._sectionStart = this._index = this._buffer.length;
  33038. this._state = "TEXT";
  33039. };
  33040. Tokenizer.prototype.InComment = function (c) {
  33041. var key = c == '-' ? '-->' : '>';
  33042. var index = this._buffer.indexOf(key, this._index);
  33043. if (index != -1) {
  33044. this._index = index + key.length - 1;
  33045. this._sectionStart = this._index + 1;
  33046. } else this._sectionStart = this._index = this._buffer.length;
  33047. this._state = "TEXT";
  33048. };
  33049. Tokenizer.prototype.BeforeCDATA1 = function (c) {
  33050. if (c == 'C') this._state = "BeforeCDATA2";else
  33051. this._state = "InDeclaration";
  33052. };
  33053. Tokenizer.prototype.BeforeCDATA2 = function (c) {
  33054. if (c == 'D') this._state = "BeforeCDATA3";else
  33055. this._state = "InDeclaration";
  33056. };
  33057. Tokenizer.prototype.BeforeCDATA3 = function (c) {
  33058. if (c == 'A') this._state = "BeforeCDATA4";else
  33059. this._state = "InDeclaration";
  33060. };
  33061. Tokenizer.prototype.BeforeCDATA4 = function (c) {
  33062. if (c == 'T') this._state = "BeforeCDATA5";else
  33063. this._state = "InDeclaration";
  33064. };
  33065. Tokenizer.prototype.BeforeCDATA5 = function (c) {
  33066. if (c == 'A') this._state = "InCDATA";else
  33067. this._state = "InDeclaration";
  33068. };
  33069. Tokenizer.prototype.InCDATA = function (c) {
  33070. var key = c == '[' ? ']]>' : '>';
  33071. var index = this._buffer.indexOf(key, this._index);
  33072. if (index != -1) {
  33073. this._index = index + key.length - 1;
  33074. this._sectionStart = this._index + 1;
  33075. } else this._sectionStart = this._index = this._buffer.length;
  33076. this._state = "TEXT";
  33077. };
  33078. Tokenizer.prototype.parse = function (chunk) {
  33079. this._buffer += chunk;
  33080. for (; this._index < this._buffer.length; this._index++) {
  33081. this[this._state](this._buffer[this._index]);}
  33082. if (this._state === "TEXT" && this._sectionStart !== this._index)
  33083. this._cbs.ontext(this._buffer.substr(this._sectionStart));
  33084. this._cbs.onend();
  33085. };
  33086. Tokenizer.prototype._getSection = function () {
  33087. return this._buffer.substring(this._sectionStart, this._index);
  33088. };
  33089. module.exports = Tokenizer;
  33090. /***/ }),
  33091. /* 590 */
  33092. /*!********************************************************************************!*\
  33093. !*** D:/zheng_dev2021/caimei-applets-hehe/components/jyf-Parser/DomHandler.js ***!
  33094. \********************************************************************************/
  33095. /*! no static exports found */
  33096. /***/ (function(module, exports, __webpack_require__) {
  33097. function _createForOfIteratorHelper(o, allowArrayLike) {var it;if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {if (it) o = it;var i = 0;var F = function F() {};return { s: F, n: function n() {if (i >= o.length) return { done: true };return { done: false, value: o[i++] };}, e: function e(_e) {throw _e;}, f: F };}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var normalCompletion = true,didErr = false,err;return { s: function s() {it = o[Symbol.iterator]();}, n: function n() {var step = it.next();normalCompletion = step.done;return step;}, e: function e(_e2) {didErr = true;err = _e2;}, f: function f() {try {if (!normalCompletion && it.return != null) it.return();} finally {if (didErr) throw err;}} };}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;} //DomHandler.js
  33098. var emoji; // 使用emoji补丁包时将此句改为 const emoji = require('./emoji.js');
  33099. var CssHandler = __webpack_require__(/*! ./CssHandler.js */ 591);
  33100. var CanIUse = __webpack_require__(/*! ./api.js */ 592).versionHigherThan('2.7.1');
  33101. var trustTag = {
  33102. a: 0,
  33103. abbr: 1,
  33104. ad: 0,
  33105. audio: 0,
  33106. b: 1,
  33107. blockquote: 1,
  33108. br: 0,
  33109. code: 1,
  33110. col: 0,
  33111. colgroup: 0,
  33112. dd: 1,
  33113. del: 1,
  33114. dl: 1,
  33115. dt: 1,
  33116. div: 1,
  33117. em: 1,
  33118. fieldset: 0,
  33119. font: 1,
  33120. h1: 0,
  33121. h2: 0,
  33122. h3: 0,
  33123. h4: 0,
  33124. h5: 0,
  33125. h6: 0,
  33126. hr: 0,
  33127. i: 1,
  33128. img: 1,
  33129. ins: 1,
  33130. label: 1,
  33131. legend: 0,
  33132. li: 0,
  33133. ol: 0,
  33134. p: 1,
  33135. q: 1,
  33136. source: 0,
  33137. span: 1,
  33138. strong: 1,
  33139. sub: 0,
  33140. sup: 0,
  33141. table: 0,
  33142. tbody: 0,
  33143. td: 0,
  33144. tfoot: 0,
  33145. th: 0,
  33146. thead: 0,
  33147. tr: 0,
  33148. u: 1,
  33149. ul: 0,
  33150. video: 1 };
  33151. var blockTag = {
  33152. address: true,
  33153. article: true,
  33154. aside: true,
  33155. body: true,
  33156. center: true,
  33157. cite: true,
  33158. footer: true,
  33159. header: true,
  33160. html: true,
  33161. nav: true,
  33162. pre: true,
  33163. section: true };
  33164. var ignoreTag = {
  33165. area: true,
  33166. base: true,
  33167. basefont: true,
  33168. canvas: true,
  33169. circle: true,
  33170. command: true,
  33171. ellipse: true,
  33172. embed: true,
  33173. frame: true,
  33174. head: true,
  33175. iframe: true,
  33176. input: true,
  33177. isindex: true,
  33178. keygen: true,
  33179. line: true,
  33180. link: true,
  33181. map: true,
  33182. meta: true,
  33183. param: true,
  33184. path: true,
  33185. polygon: true,
  33186. polyline: true,
  33187. rect: true,
  33188. script: true,
  33189. stop: true,
  33190. textarea: true,
  33191. title: true,
  33192. track: true,
  33193. use: true,
  33194. wbr: true };
  33195. if (CanIUse) {
  33196. trustTag.bdi = 0;
  33197. trustTag.bdo = 0;
  33198. trustTag.caption = 0;
  33199. trustTag.rt = 0;
  33200. trustTag.ruby = 0;
  33201. ignoreTag.rp = true;
  33202. trustTag.big = 1;
  33203. trustTag.small = 1;
  33204. trustTag.pre = 0;
  33205. delete blockTag.pre;
  33206. } else blockTag.caption = true;
  33207. function randomId() {
  33208. var res = "";
  33209. for (var i = 0; i < 5; i++) {
  33210. var rand = parseInt(Math.random() * 52);
  33211. if (rand < 26)
  33212. res = res + String.fromCharCode(65 + rand);else
  33213. res = res + String.fromCharCode(71 + rand);
  33214. }
  33215. return res;
  33216. }
  33217. function DomHandler(style, options) {
  33218. this.imgList = [];
  33219. this.imgIndex = 0;
  33220. this.nodes = [];
  33221. this.title = "";
  33222. this._CssHandler = new CssHandler(style, options.tagStyle);
  33223. this._tagStack = [];
  33224. this._videoNum = 0;
  33225. this._whiteSpace = false;
  33226. this._domain = options.domain;
  33227. this._protocol = /:\/\//.test(options.domain) ? options.domain.split(/:\/\//)[0] : "http";
  33228. this._useAnchor = options.useAnchor;
  33229. }
  33230. DomHandler.prototype._addDomElement = function (element) {
  33231. if (element.name == 'pre' || element.attrs && /white-space\s*:\s*pre/.test(element.attrs.style)) {
  33232. this._whiteSpace = true;
  33233. element.pre = true;
  33234. }
  33235. var parent = this._tagStack[this._tagStack.length - 1];
  33236. var siblings = parent ? parent.children : this.nodes;
  33237. siblings.push(element);
  33238. };
  33239. DomHandler.prototype._bubbling = function () {
  33240. for (var i = this._tagStack.length - 1; i >= 0; i--) {
  33241. if (trustTag[this._tagStack[i].name])
  33242. this._tagStack[i].continue = true;else
  33243. return this._tagStack[i].name;
  33244. }
  33245. };
  33246. DomHandler.prototype.onopentag = function (name, attrs) {
  33247. var element = {
  33248. children: [] };
  33249. var matched = this._CssHandler.match(name, attrs, element);
  33250. //处理属性
  33251. switch (name) {
  33252. case 'div':
  33253. case 'p':
  33254. if (attrs.align) {
  33255. attrs.style += ';text-align:' + attrs.align;
  33256. delete attrs.align;
  33257. }
  33258. break;
  33259. case 'img':
  33260. if (attrs.width) {
  33261. attrs.style = 'width:' + attrs.width + (/[0-9]/.test(attrs.width[attrs.width.length - 1]) ? 'px' : '') + ';' +
  33262. attrs.style;
  33263. delete attrs.width;
  33264. }
  33265. if (attrs['data-src']) {
  33266. attrs.src = attrs.src || attrs['data-src'];
  33267. delete attrs['data-src'];
  33268. }
  33269. if (!attrs.hasOwnProperty('ignore') && attrs.src) {
  33270. if (this._bubbling() == 'a') {
  33271. attrs.ignore = "true"; // 图片在链接中不可预览
  33272. break;
  33273. }
  33274. var url = attrs.src;
  33275. // 去重,至多重试10次
  33276. for (var i = 0; this.imgList.indexOf(url) != -1 && i < 10; i++) {
  33277. // 网络链接
  33278. if (/^http/.test(url)) {
  33279. url = url.replace(/^(https*):\/\/([\S]+?)\//, function () {
  33280. var domain = "";var _iterator = _createForOfIteratorHelper(
  33281. arguments[2]),_step;try {for (_iterator.s(); !(_step = _iterator.n()).done;) {var c = _step.value;
  33282. if (/[a-zA-Z]/.test(c))
  33283. domain += Math.random() >= 0.5 ? c.toUpperCase() : c;else
  33284. domain += c;
  33285. }} catch (err) {_iterator.e(err);} finally {_iterator.f();}
  33286. return arguments[1] + '://' + domain + '/';
  33287. });
  33288. }
  33289. // base64
  33290. else if (/base64/.test(url)) {
  33291. url = url.replace(/^data:(image\/\S+);base64,/, function () {
  33292. var head = "";var _iterator2 = _createForOfIteratorHelper(
  33293. arguments[1]),_step2;try {for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {var c = _step2.value;
  33294. if (/[a-zA-Z]/.test(c))
  33295. head += Math.random() >= 0.5 ? c.toUpperCase() : c;else
  33296. head += c;
  33297. }} catch (err) {_iterator2.e(err);} finally {_iterator2.f();}
  33298. return 'data:' + head + ';base64,';
  33299. });
  33300. } else break;
  33301. }
  33302. element.current = this.imgList.length;
  33303. this.imgList.push(url);
  33304. } else
  33305. attrs.ignore = "true";
  33306. if (this._domain && attrs.src[0] == '/') {
  33307. if (attrs.src[1] == '/') attrs.src = this._protocol + ":" + attrs.src;else
  33308. attrs.src = this._domain + attrs.src;
  33309. }
  33310. break;
  33311. case 'font':
  33312. name = 'span';
  33313. if (attrs.color) {
  33314. attrs.style += ';color:' + attrs.color;
  33315. delete attrs.color;
  33316. }
  33317. if (attrs.face) {
  33318. attrs.style += ";font-family:" + attrs.face;
  33319. delete attrs.face;
  33320. }
  33321. if (attrs.size) {
  33322. var size = parseInt(attrs.size);
  33323. if (size < 1) size = 1;else
  33324. if (size > 7) size = 7;
  33325. var map = [10, 13, 16, 18, 24, 32, 48];
  33326. attrs.style += ";font-size:" + map[size - 1] + "px";
  33327. delete attrs.size;
  33328. }
  33329. break;
  33330. case 'a':
  33331. case 'ad':
  33332. this._bubbling();
  33333. break;
  33334. case 'video':
  33335. case 'audio':
  33336. attrs.loop = attrs.hasOwnProperty('loop');
  33337. attrs.controls = attrs.hasOwnProperty('controls');
  33338. attrs.autoplay = attrs.hasOwnProperty('autoplay');
  33339. if (name == 'video') {
  33340. attrs.muted = attrs.hasOwnProperty('muted');
  33341. if (attrs.width) {
  33342. attrs.style = 'width:' + parseFloat(attrs.width) + 'px;' + attrs.style;
  33343. delete attrs.width;
  33344. }
  33345. if (attrs.height) {
  33346. attrs.style = 'height:' + parseFloat(attrs.height) + 'px;' + attrs.style;
  33347. delete attrs.height;
  33348. }
  33349. }
  33350. attrs.id = randomId() + (name == 'video' ? ++this._videoNum : '');
  33351. attrs.source = [];
  33352. if (attrs.src) attrs.source.push(attrs.src);
  33353. if (!attrs.controls && !attrs.autoplay)
  33354. console.warn('存在没有controls属性的' + name + '标签,可能导致无法播放', attrs);
  33355. this._bubbling();
  33356. break;
  33357. case 'source':
  33358. var parent = this._tagStack[this._tagStack.length - 1];
  33359. if (parent && (parent.name == 'video' || parent.name == 'audio')) {
  33360. parent.attrs.source.push(attrs.src);
  33361. if (!parent.attrs.src) parent.attrs.src = attrs.src;
  33362. }
  33363. this._tagStack.push(element);
  33364. return;}
  33365. if (this._useAnchor && attrs.id) this._bubbling();
  33366. attrs.style = matched + attrs.style;
  33367. if (blockTag[name]) name = 'div';else
  33368. if (!trustTag.hasOwnProperty(name)) name = 'span';
  33369. element.name = name;
  33370. element.attrs = attrs;
  33371. this._addDomElement(element);
  33372. this._tagStack.push(element);
  33373. };
  33374. DomHandler.prototype.ontext = function (data) {
  33375. if (!this._whiteSpace) {
  33376. if (!/\S/.test(data))
  33377. return;
  33378. data = data.replace(/\s+/g, " ");
  33379. }
  33380. var element = {
  33381. type: 'text' };
  33382. data = data.replace(/&nbsp;/g, '&#xA0;'); // 解决连续&nbsp;失效问题
  33383. if (/&#*((?!sp|lt|gt).){2,8};/.test(data)) element.decode = true;
  33384. if (emoji) data = emoji.parseEmoji(data);
  33385. element.text = data;
  33386. this._addDomElement(element);
  33387. };
  33388. DomHandler.prototype.onclosetag = function (name) {
  33389. var element = this._tagStack.pop();
  33390. var parent = this._tagStack.length ? this._tagStack[this._tagStack.length - 1].children : this.nodes;
  33391. if (ignoreTag[name]) {
  33392. if (name == 'title') {
  33393. try {
  33394. this.title = element.children[0].text;
  33395. } catch (e) {}
  33396. }
  33397. parent.pop();
  33398. }
  33399. // 设置表格的边框
  33400. if (name == 'table') {var
  33401. setBorder = function setBorder(node) {
  33402. if (node.type == 'text') return;
  33403. if (node.name == 'th' || node.name == 'td') {
  33404. if (element.attrs.border)
  33405. node.attrs.style += ";border:" + element.attrs.border + "px solid gray;";
  33406. if (element.attrs.hasOwnProperty("cellpadding"))
  33407. node.attrs.style += ";padding:" + element.attrs.cellpadding + "px";
  33408. }var _iterator3 = _createForOfIteratorHelper(
  33409. node.children),_step3;try {for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {var child = _step3.value;
  33410. setBorder(child);}} catch (err) {_iterator3.e(err);} finally {_iterator3.f();}
  33411. };if (element.attrs.border) element.attrs.style += ";border:" + element.attrs.border + "px solid gray;";if (element.attrs.hasOwnProperty("cellspacing")) element.attrs.style += ";border-spacing:" + element.attrs.cellspacing + "px";
  33412. if (element.attrs.border || element.attrs.hasOwnProperty("cellpadding")) {var _iterator4 = _createForOfIteratorHelper(
  33413. element.children),_step4;try {for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {var child = _step4.value;
  33414. setBorder(child);}} catch (err) {_iterator4.e(err);} finally {_iterator4.f();}
  33415. }
  33416. }
  33417. // 合并一些不必要的层,减小节点深度
  33418. if (element.children.length == 1 && element.name == 'div') {
  33419. var _child = element.children[0];
  33420. if (_child.name == 'div' && !/padding/.test(element.attrs.style) && !(/margin/.test(element.attrs.style) &&
  33421. /margin/.test(_child.attrs.style)) && !/display/.test(element.attrs.style) && !/display/.test(_child.attrs.style) &&
  33422. !(element.attrs.id && _child.attrs.id) && !(element.attrs.class && _child.attrs.class)) {
  33423. if (/padding/.test(_child.attrs.style))
  33424. _child.attrs.style = ";box-sizing:border-box;" + _child.attrs.style;
  33425. _child.attrs.style = element.attrs.style + ";" + _child.attrs.style;
  33426. _child.attrs.id = (_child.attrs.id || "") + (element.attrs.id || "");
  33427. _child.attrs.class = (_child.attrs.class || "") + (element.attrs.class || "");
  33428. parent[parent.indexOf(element)] = _child;
  33429. }
  33430. }
  33431. if (element.pre) {
  33432. this._whiteSpace = false;var _iterator5 = _createForOfIteratorHelper(
  33433. this._tagStack),_step5;try {for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {var ele = _step5.value;
  33434. if (ele.pre)
  33435. this._whiteSpace = true;}} catch (err) {_iterator5.e(err);} finally {_iterator5.f();}
  33436. delete element.pre;
  33437. }
  33438. // 多层样式处理
  33439. if (this._CssHandler.pop)
  33440. this._CssHandler.pop(element);
  33441. };
  33442. module.exports = DomHandler;
  33443. /***/ }),
  33444. /* 591 */
  33445. /*!********************************************************************************!*\
  33446. !*** D:/zheng_dev2021/caimei-applets-hehe/components/jyf-Parser/CssHandler.js ***!
  33447. \********************************************************************************/
  33448. /*! no static exports found */
  33449. /***/ (function(module, exports, __webpack_require__) {
  33450. function _createForOfIteratorHelper(o, allowArrayLike) {var it;if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {if (it) o = it;var i = 0;var F = function F() {};return { s: F, n: function n() {if (i >= o.length) return { done: true };return { done: false, value: o[i++] };}, e: function e(_e) {throw _e;}, f: F };}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var normalCompletion = true,didErr = false,err;return { s: function s() {it = o[Symbol.iterator]();}, n: function n() {var step = it.next();normalCompletion = step.done;return step;}, e: function e(_e2) {didErr = true;err = _e2;}, f: function f() {try {if (!normalCompletion && it.return != null) it.return();} finally {if (didErr) throw err;}} };}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;} //CssHandler.js
  33451. var CanIUse = __webpack_require__(/*! ./api.js */ 592).versionHigherThan('2.7.1');
  33452. function CssHandler(style, tagStyle) {
  33453. this._style = new CssTokenizer(style, tagStyle).parse();
  33454. }
  33455. CssHandler.prototype.match = function (name, attrs) {
  33456. var matched = this._style[name] ? this._style[name] + ';' : '';
  33457. if (attrs.id)
  33458. matched += this._style['#' + attrs.id] ? this._style['#' + attrs.id] + ';' : '';
  33459. if (attrs.class) {var _iterator = _createForOfIteratorHelper(
  33460. attrs.class.split(' ')),_step;try {for (_iterator.s(); !(_step = _iterator.n()).done;) {var Class = _step.value;
  33461. matched += this._style['.' + Class] ? this._style['.' + Class] + ';' : '';}} catch (err) {_iterator.e(err);} finally {_iterator.f();}}
  33462. return matched;
  33463. };
  33464. function CssTokenizer() {var style = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';var tagStyle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  33465. this.res = this.initClass(tagStyle);
  33466. this._state = "SPACE";
  33467. this._buffer = style;
  33468. this._sectionStart = 0;
  33469. this._index = 0;
  33470. this._name = '';
  33471. this._content = '';
  33472. this._list = [];
  33473. this._comma = false;
  33474. }
  33475. CssTokenizer.prototype.initClass = function (tagStyle) {
  33476. var initStyle = JSON.parse(JSON.stringify(tagStyle));
  33477. initStyle.a = "display:inline;color:#366092;word-break:break-all;" + (initStyle.a || "");
  33478. initStyle.address = "font-style:italic;" + (initStyle.address || "");
  33479. initStyle.blockquote = initStyle.blockquote ||
  33480. 'background-color:#f6f6f6;border-left:3px solid #dbdbdb;color:#6c6c6c;padding:5px 0 5px 10px;';
  33481. initStyle.center = 'text-align:center;' + (initStyle.center || "");
  33482. initStyle.cite = "font-style:italic;" + (initStyle.cite || "");
  33483. initStyle.code = initStyle.code ||
  33484. 'padding:0 1px 0 1px;margin-left:2px;margin-right:2px;background-color:#f8f8f8;border:1px solid #cccccc;border-radius:3px;';
  33485. initStyle.dd = "margin-left:40px;" + (initStyle.dd || "");
  33486. initStyle.img = "max-width:100%;" + (initStyle.img || "");
  33487. initStyle.mark = "display:inline;background-color:yellow;" + (initStyle.mark || "");
  33488. initStyle.pre = "overflow:scroll;" + (initStyle.pre || 'background-color:#f6f8fa;padding:5px;border-radius:5px;');
  33489. initStyle.s = "display:inline;text-decoration:line-through;" + (initStyle.s || "");
  33490. initStyle.u = "display:inline;text-decoration:underline;" + (initStyle.u || "");
  33491. //低版本兼容
  33492. if (!CanIUse) {
  33493. initStyle.big = "display:inline;font-size:1.2em;" + (initStyle.big || "");
  33494. initStyle.small = "display:inline;font-size:0.8em;" + (initStyle.small || "");
  33495. initStyle.pre = "font-family:monospace;white-space:pre;" + initStyle.pre;
  33496. }
  33497. return initStyle;
  33498. };
  33499. CssTokenizer.prototype.SPACE = function (c) {
  33500. if (/[a-zA-Z.#]/.test(c)) {
  33501. this._sectionStart = this._index;
  33502. this._state = "InName";
  33503. } else if (c == '@') this._state = "Ignore1";else
  33504. if (c == '/') this._state = "BeforeComment";
  33505. };
  33506. CssTokenizer.prototype.BeforeComment = function (c) {
  33507. if (c == '*') this._state = "InComment";else
  33508. {
  33509. this._index--;
  33510. this._state = "SPACE";
  33511. }
  33512. };
  33513. CssTokenizer.prototype.InComment = function (c) {
  33514. if (c == '*') this._state = "AfterComment";
  33515. };
  33516. CssTokenizer.prototype.AfterComment = function (c) {
  33517. if (c == '/') this._state = "SPACE";else
  33518. {
  33519. this._index--;
  33520. this._state = "InComment";
  33521. }
  33522. };
  33523. CssTokenizer.prototype.InName = function (c) {
  33524. if (c == '{') {
  33525. this._list.push(this._buffer.substring(this._sectionStart, this._index));
  33526. this._sectionStart = this._index + 1;
  33527. this._state = "InContent";
  33528. } else if (c == ',') {
  33529. this._list.push(this._buffer.substring(this._sectionStart, this._index));
  33530. this._sectionStart = this._index + 1;
  33531. this._comma = true;
  33532. } else if ((c == '.' || c == '#') && !this._comma) {
  33533. this._buffer = this._buffer.splice(this._index, 1, ' ');
  33534. } else if (/\s/.test(c)) {
  33535. this._name = this._buffer.substring(this._sectionStart, this._index);
  33536. this._state = "NameSpace";
  33537. } else if (/[>:\[]/.test(c)) {
  33538. if (this._list.length) this._state = "IgnoreName";else
  33539. this._state = "Ignore1";
  33540. } else this._comma = false;
  33541. };
  33542. CssTokenizer.prototype.NameSpace = function (c) {
  33543. if (c == '{') {
  33544. this._list.push(this._name);
  33545. this._sectionStart = this._index + 1;
  33546. this._state = "InContent";
  33547. } else if (c == ',') {
  33548. this._comma = true;
  33549. this._list.push(this._name);
  33550. this._sectionStart = this._index + 1;
  33551. this._state = "InName";
  33552. } else if (/\S/.test(c)) {
  33553. if (this._comma) {
  33554. this._sectionStart = this._index;
  33555. this._index--;
  33556. this._state = "InName";
  33557. } else if (this._list.length) this._state = "IgnoreName";else
  33558. this._state = "Ignore1";
  33559. }
  33560. };
  33561. CssTokenizer.prototype.InContent = function (c) {
  33562. if (c == '}') {
  33563. this._content = this._buffer.substring(this._sectionStart, this._index);var _iterator2 = _createForOfIteratorHelper(
  33564. this._list),_step2;try {for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {var item = _step2.value;
  33565. this.res[item] = (this.res[item] || '') + ";" + this._content;}} catch (err) {_iterator2.e(err);} finally {_iterator2.f();}
  33566. this._list = [];
  33567. this._comma = false;
  33568. this._state = "SPACE";
  33569. }
  33570. };
  33571. CssTokenizer.prototype.IgnoreName = function (c) {
  33572. if (c == ',') {
  33573. this._sectionStart = this._index + 1;
  33574. this._state = "InName";
  33575. } else if (c == '{') {
  33576. this._sectionStart = this._index + 1;
  33577. this._state = "InContent";
  33578. }
  33579. };
  33580. CssTokenizer.prototype.Ignore1 = function (c) {
  33581. if (c == ';') {
  33582. this._state = "SPACE";
  33583. this._sectionStart = this._index + 1;
  33584. } else if (c == '{') this._state = "Ignore2";
  33585. };
  33586. CssTokenizer.prototype.Ignore2 = function (c) {
  33587. if (c == '}') {
  33588. this._state = "SPACE";
  33589. this._sectionStart = this._index + 1;
  33590. } else if (c == '{') this._state = "Ignore3";
  33591. };
  33592. CssTokenizer.prototype.Ignore3 = function (c) {
  33593. if (c == '}') this._state = "Ignore2";
  33594. };
  33595. CssTokenizer.prototype.parse = function () {
  33596. for (; this._index < this._buffer.length; this._index++) {
  33597. this[this._state](this._buffer[this._index]);}
  33598. return this.res;
  33599. };
  33600. module.exports = CssHandler;
  33601. /***/ }),
  33602. /* 592 */
  33603. /*!*************************************************************************!*\
  33604. !*** D:/zheng_dev2021/caimei-applets-hehe/components/jyf-Parser/api.js ***!
  33605. \*************************************************************************/
  33606. /*! no static exports found */
  33607. /***/ (function(module, exports, __webpack_require__) {
  33608. /* WEBPACK VAR INJECTION */(function(uni) {String.prototype.splice = function () {var start = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;var deleteCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;var addStr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  33609. if (start < 0) start = this.length + start;
  33610. if (deleteCount < 0) deleteCount = 0;
  33611. return this.substring(0, start) + addStr + this.substring(start + deleteCount);
  33612. };
  33613. var SDKVersion = uni.getSystemInfoSync().SDKVersion;
  33614. module.exports = {
  33615. versionHigherThan: function versionHigherThan() {var version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  33616. var v1 = SDKVersion.split('.');
  33617. var v2 = version.split('.');
  33618. var len = Math.max(v1.length, v2.length);
  33619. while (v1.length < len) {
  33620. v1.push('0');
  33621. }
  33622. while (v2.length < len) {
  33623. v2.push('0');
  33624. }
  33625. for (var i = 0; i < len; i++) {
  33626. var num1 = parseInt(v1[i]);
  33627. var num2 = parseInt(v2[i]);
  33628. if (num1 > num2) {
  33629. return true;
  33630. } else if (num1 < num2) {
  33631. return false;
  33632. }
  33633. }
  33634. return true;
  33635. },
  33636. html2nodes: function html2nodes(html, tagStyle) {
  33637. var Parser = __webpack_require__(/*! ./Parser.js */ 588);
  33638. return Parser(html, tagStyle);
  33639. },
  33640. css2object: function css2object(style, tagStyle) {
  33641. var CssHandler = __webpack_require__(/*! ./CssHandler.js */ 591);
  33642. return new CssHandler(style, tagStyle)._style;
  33643. } };
  33644. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  33645. /***/ }),
  33646. /* 593 */,
  33647. /* 594 */,
  33648. /* 595 */,
  33649. /* 596 */,
  33650. /* 597 */,
  33651. /* 598 */,
  33652. /* 599 */,
  33653. /* 600 */,
  33654. /* 601 */,
  33655. /* 602 */,
  33656. /* 603 */,
  33657. /* 604 */,
  33658. /* 605 */,
  33659. /* 606 */,
  33660. /* 607 */,
  33661. /* 608 */,
  33662. /* 609 */,
  33663. /* 610 */,
  33664. /* 611 */,
  33665. /* 612 */,
  33666. /* 613 */,
  33667. /* 614 */,
  33668. /* 615 */,
  33669. /* 616 */,
  33670. /* 617 */,
  33671. /* 618 */,
  33672. /* 619 */,
  33673. /* 620 */,
  33674. /* 621 */,
  33675. /* 622 */,
  33676. /* 623 */,
  33677. /* 624 */,
  33678. /* 625 */,
  33679. /* 626 */,
  33680. /* 627 */,
  33681. /* 628 */
  33682. /*!******************************************************************!*\
  33683. !*** D:/zheng_dev2021/caimei-applets-hehe/common/addressdata.js ***!
  33684. \******************************************************************/
  33685. /*! no static exports found */
  33686. /***/ (function(module, exports, __webpack_require__) {
  33687. "use strict";
  33688. var _ajaxService = _interopRequireDefault(__webpack_require__(/*! @/services/ajax.service.js */ 20));
  33689. var _public = _interopRequireDefault(__webpack_require__(/*! @/services/public.service */ 30));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} /*
  33690. *请求获取省市区
  33691. *已提供给地区选择picker组件使用
  33692. */var _PublicService = new _public.default(_ajaxService.default);
  33693. var provinceData = [];
  33694. var cityData = [];
  33695. var areaData = [];
  33696. _PublicService.GetAllAddressData().then(function (res) {
  33697. var list = res.data;
  33698. list.forEach(function (item) {
  33699. var xxx = handleCitys(item);
  33700. provinceData.push(item);
  33701. cityData.push(xxx.e);
  33702. areaData.push(xxx.f);
  33703. var list = res.data;
  33704. list.forEach(function (item) {
  33705. var xxx = handleCitys(item);
  33706. provinceData.push(item);
  33707. cityData.push(xxx.e);
  33708. areaData.push(xxx.f);
  33709. });
  33710. });
  33711. //获取市后继续处理
  33712. function handleCitys(data) {
  33713. var x = [];
  33714. var s = [];
  33715. if (data.cityList.length) {
  33716. data.cityList.forEach(function (item) {
  33717. var xxx = handleTowns(item);
  33718. s.push(xxx);
  33719. x.push(item);
  33720. });
  33721. } else {
  33722. s.push([{
  33723. name: '' }]);
  33724. x.push([{
  33725. name: '' }]);
  33726. }
  33727. return {
  33728. e: x,
  33729. f: s };
  33730. }
  33731. //获取区后继续处理
  33732. function handleTowns(data) {
  33733. var x = [];
  33734. data.townList.forEach(function (item) {
  33735. x.push(item);
  33736. });
  33737. return x;
  33738. }
  33739. function handleData3(data) {
  33740. var xxx = [];
  33741. data.forEach(function (item) {
  33742. var ooo = [];
  33743. item.forEach(function (opt) {
  33744. opt.forEach(function (z) {
  33745. ooo.push(z);
  33746. });
  33747. });
  33748. xxx.push(ooo);
  33749. });
  33750. return xxx;
  33751. }
  33752. });
  33753. module.exports = {
  33754. provinceData: provinceData,
  33755. cityData: cityData,
  33756. areaData: areaData };
  33757. /***/ }),
  33758. /* 629 */,
  33759. /* 630 */,
  33760. /* 631 */,
  33761. /* 632 */,
  33762. /* 633 */,
  33763. /* 634 */,
  33764. /* 635 */,
  33765. /* 636 */,
  33766. /* 637 */,
  33767. /* 638 */,
  33768. /* 639 */,
  33769. /* 640 */,
  33770. /* 641 */,
  33771. /* 642 */,
  33772. /* 643 */,
  33773. /* 644 */,
  33774. /* 645 */,
  33775. /* 646 */,
  33776. /* 647 */,
  33777. /* 648 */,
  33778. /* 649 */,
  33779. /* 650 */,
  33780. /* 651 */,
  33781. /* 652 */,
  33782. /* 653 */,
  33783. /* 654 */,
  33784. /* 655 */,
  33785. /* 656 */,
  33786. /* 657 */,
  33787. /* 658 */,
  33788. /* 659 */,
  33789. /* 660 */,
  33790. /* 661 */,
  33791. /* 662 */,
  33792. /* 663 */,
  33793. /* 664 */,
  33794. /* 665 */,
  33795. /* 666 */,
  33796. /* 667 */,
  33797. /* 668 */,
  33798. /* 669 */,
  33799. /* 670 */,
  33800. /* 671 */,
  33801. /* 672 */,
  33802. /* 673 */,
  33803. /* 674 */,
  33804. /* 675 */,
  33805. /* 676 */,
  33806. /* 677 */,
  33807. /* 678 */,
  33808. /* 679 */,
  33809. /* 680 */,
  33810. /* 681 */,
  33811. /* 682 */,
  33812. /* 683 */,
  33813. /* 684 */,
  33814. /* 685 */,
  33815. /* 686 */,
  33816. /* 687 */,
  33817. /* 688 */,
  33818. /* 689 */,
  33819. /* 690 */,
  33820. /* 691 */,
  33821. /* 692 */,
  33822. /* 693 */,
  33823. /* 694 */,
  33824. /* 695 */,
  33825. /* 696 */,
  33826. /* 697 */,
  33827. /* 698 */,
  33828. /* 699 */,
  33829. /* 700 */,
  33830. /* 701 */,
  33831. /* 702 */,
  33832. /* 703 */,
  33833. /* 704 */,
  33834. /* 705 */,
  33835. /* 706 */,
  33836. /* 707 */,
  33837. /* 708 */,
  33838. /* 709 */,
  33839. /* 710 */,
  33840. /* 711 */,
  33841. /* 712 */,
  33842. /* 713 */,
  33843. /* 714 */,
  33844. /* 715 */,
  33845. /* 716 */,
  33846. /* 717 */,
  33847. /* 718 */,
  33848. /* 719 */,
  33849. /* 720 */,
  33850. /* 721 */,
  33851. /* 722 */,
  33852. /* 723 */,
  33853. /* 724 */,
  33854. /* 725 */,
  33855. /* 726 */,
  33856. /* 727 */,
  33857. /* 728 */,
  33858. /* 729 */,
  33859. /* 730 */,
  33860. /* 731 */,
  33861. /* 732 */,
  33862. /* 733 */,
  33863. /* 734 */,
  33864. /* 735 */,
  33865. /* 736 */,
  33866. /* 737 */,
  33867. /* 738 */,
  33868. /* 739 */,
  33869. /* 740 */,
  33870. /* 741 */,
  33871. /* 742 */,
  33872. /* 743 */,
  33873. /* 744 */,
  33874. /* 745 */,
  33875. /* 746 */,
  33876. /* 747 */,
  33877. /* 748 */,
  33878. /* 749 */,
  33879. /* 750 */,
  33880. /* 751 */,
  33881. /* 752 */,
  33882. /* 753 */,
  33883. /* 754 */,
  33884. /* 755 */
  33885. /*!********************************************************************************************************!*\
  33886. !*** D:/zheng_dev2021/caimei-applets-hehe/components/uni-components/uni-transition/createAnimation.js ***!
  33887. \********************************************************************************************************/
  33888. /*! no static exports found */
  33889. /***/ (function(module, exports, __webpack_require__) {
  33890. "use strict";
  33891. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.createAnimation = createAnimation;function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;} // const defaultOption = {
  33892. // duration: 300,
  33893. // timingFunction: 'linear',
  33894. // delay: 0,
  33895. // transformOrigin: '50% 50% 0'
  33896. // }
  33897. var
  33898. MPAnimation = /*#__PURE__*/function () {
  33899. function MPAnimation(options, _this) {_classCallCheck(this, MPAnimation);
  33900. this.options = options;
  33901. this.animation = uni.createAnimation(options);
  33902. this.currentStepAnimates = {};
  33903. this.next = 0;
  33904. this.$ = _this;
  33905. }_createClass(MPAnimation, [{ key: "_nvuePushAnimates", value: function _nvuePushAnimates(
  33906. type, args) {
  33907. var aniObj = this.currentStepAnimates[this.next];
  33908. var styles = {};
  33909. if (!aniObj) {
  33910. styles = {
  33911. styles: {},
  33912. config: {} };
  33913. } else {
  33914. styles = aniObj;
  33915. }
  33916. if (animateTypes1.includes(type)) {
  33917. if (!styles.styles.transform) {
  33918. styles.styles.transform = '';
  33919. }
  33920. var unit = '';
  33921. if (type === 'rotate') {
  33922. unit = 'deg';
  33923. }
  33924. styles.styles.transform += "".concat(type, "(").concat(args + unit, ") ");
  33925. } else {
  33926. styles.styles[type] = "".concat(args);
  33927. }
  33928. this.currentStepAnimates[this.next] = styles;
  33929. } }, { key: "_animateRun", value: function _animateRun()
  33930. {var styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  33931. var ref = this.$.$refs['ani'].ref;
  33932. if (!ref) return;
  33933. return new Promise(function (resolve, reject) {
  33934. nvueAnimation.transition(ref, _objectSpread({
  33935. styles: styles },
  33936. config),
  33937. function (res) {
  33938. resolve();
  33939. });
  33940. });
  33941. } }, { key: "_nvueNextAnimate", value: function _nvueNextAnimate(
  33942. animates) {var _this2 = this;var step = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;var fn = arguments.length > 2 ? arguments[2] : undefined;
  33943. var obj = animates[step];
  33944. if (obj) {var
  33945. styles =
  33946. obj.styles,config = obj.config;
  33947. this._animateRun(styles, config).then(function () {
  33948. step += 1;
  33949. _this2._nvueNextAnimate(animates, step, fn);
  33950. });
  33951. } else {
  33952. this.currentStepAnimates = {};
  33953. typeof fn === 'function' && fn();
  33954. this.isEnd = true;
  33955. }
  33956. } }, { key: "step", value: function step()
  33957. {var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  33958. this.animation.step(config);
  33959. return this;
  33960. } }, { key: "run", value: function run(
  33961. fn) {
  33962. this.$.animationData = this.animation.export();
  33963. this.$.timer = setTimeout(function () {
  33964. typeof fn === 'function' && fn();
  33965. }, this.$.durationTime);
  33966. } }]);return MPAnimation;}();
  33967. var animateTypes1 = ['matrix', 'matrix3d', 'rotate', 'rotate3d', 'rotateX', 'rotateY', 'rotateZ', 'scale', 'scale3d',
  33968. 'scaleX', 'scaleY', 'scaleZ', 'skew', 'skewX', 'skewY', 'translate', 'translate3d', 'translateX', 'translateY',
  33969. 'translateZ'];
  33970. var animateTypes2 = ['opacity', 'backgroundColor'];
  33971. var animateTypes3 = ['width', 'height', 'left', 'right', 'top', 'bottom'];
  33972. animateTypes1.concat(animateTypes2, animateTypes3).forEach(function (type) {
  33973. MPAnimation.prototype[type] = function () {var _this$animation;
  33974. (_this$animation = this.animation)[type].apply(_this$animation, arguments);
  33975. return this;
  33976. };
  33977. });
  33978. function createAnimation(option, _this) {
  33979. if (!_this) return;
  33980. clearTimeout(_this.timer);
  33981. return new MPAnimation(option, _this);
  33982. }
  33983. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  33984. /***/ }),
  33985. /* 756 */,
  33986. /* 757 */,
  33987. /* 758 */,
  33988. /* 759 */,
  33989. /* 760 */,
  33990. /* 761 */,
  33991. /* 762 */,
  33992. /* 763 */,
  33993. /* 764 */,
  33994. /* 765 */,
  33995. /* 766 */,
  33996. /* 767 */,
  33997. /* 768 */,
  33998. /* 769 */,
  33999. /* 770 */,
  34000. /* 771 */,
  34001. /* 772 */,
  34002. /* 773 */,
  34003. /* 774 */,
  34004. /* 775 */,
  34005. /* 776 */,
  34006. /* 777 */,
  34007. /* 778 */,
  34008. /* 779 */,
  34009. /* 780 */,
  34010. /* 781 */,
  34011. /* 782 */,
  34012. /* 783 */,
  34013. /* 784 */,
  34014. /* 785 */,
  34015. /* 786 */,
  34016. /* 787 */,
  34017. /* 788 */,
  34018. /* 789 */,
  34019. /* 790 */,
  34020. /* 791 */,
  34021. /* 792 */,
  34022. /* 793 */,
  34023. /* 794 */,
  34024. /* 795 */,
  34025. /* 796 */
  34026. /*!**************************************************************************************************!*\
  34027. !*** D:/zheng_dev2021/caimei-applets-hehe/components/uni-components/uni-goods-nav/i18n/index.js ***!
  34028. \**************************************************************************************************/
  34029. /*! no static exports found */
  34030. /***/ (function(module, exports, __webpack_require__) {
  34031. "use strict";
  34032. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 797));
  34033. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 798));
  34034. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 799));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}var _default =
  34035. {
  34036. en: _en.default,
  34037. 'zh-Hans': _zhHans.default,
  34038. 'zh-Hant': _zhHant.default };exports.default = _default;
  34039. /***/ }),
  34040. /* 797 */
  34041. /*!*************************************************************************************************!*\
  34042. !*** D:/zheng_dev2021/caimei-applets-hehe/components/uni-components/uni-goods-nav/i18n/en.json ***!
  34043. \*************************************************************************************************/
  34044. /*! exports provided: uni-goods-nav.options.shop, uni-goods-nav.options.cart, uni-goods-nav.buttonGroup.addToCart, uni-goods-nav.buttonGroup.buyNow, default */
  34045. /***/ (function(module) {
  34046. module.exports = JSON.parse("{\"uni-goods-nav.options.shop\":\"shop\",\"uni-goods-nav.options.cart\":\"cart\",\"uni-goods-nav.buttonGroup.addToCart\":\"add to cart\",\"uni-goods-nav.buttonGroup.buyNow\":\"buy now\"}");
  34047. /***/ }),
  34048. /* 798 */
  34049. /*!******************************************************************************************************!*\
  34050. !*** D:/zheng_dev2021/caimei-applets-hehe/components/uni-components/uni-goods-nav/i18n/zh-Hans.json ***!
  34051. \******************************************************************************************************/
  34052. /*! exports provided: uni-goods-nav.options.shop, uni-goods-nav.options.cart, uni-goods-nav.buttonGroup.addToCart, uni-goods-nav.buttonGroup.buyNow, default */
  34053. /***/ (function(module) {
  34054. module.exports = JSON.parse("{\"uni-goods-nav.options.shop\":\"店铺\",\"uni-goods-nav.options.cart\":\"购物车\",\"uni-goods-nav.buttonGroup.addToCart\":\"加入购物车\",\"uni-goods-nav.buttonGroup.buyNow\":\"立即购买\"}");
  34055. /***/ }),
  34056. /* 799 */
  34057. /*!******************************************************************************************************!*\
  34058. !*** D:/zheng_dev2021/caimei-applets-hehe/components/uni-components/uni-goods-nav/i18n/zh-Hant.json ***!
  34059. \******************************************************************************************************/
  34060. /*! exports provided: uni-goods-nav.options.shop, uni-goods-nav.options.cart, uni-goods-nav.buttonGroup.addToCart, uni-goods-nav.buttonGroup.buyNow, default */
  34061. /***/ (function(module) {
  34062. module.exports = JSON.parse("{\"uni-goods-nav.options.shop\":\"店鋪\",\"uni-goods-nav.options.cart\":\"購物車\",\"uni-goods-nav.buttonGroup.addToCart\":\"加入購物車\",\"uni-goods-nav.buttonGroup.buyNow\":\"立即購買\"}");
  34063. /***/ }),
  34064. /* 800 */,
  34065. /* 801 */,
  34066. /* 802 */,
  34067. /* 803 */,
  34068. /* 804 */,
  34069. /* 805 */,
  34070. /* 806 */,
  34071. /* 807 */,
  34072. /* 808 */,
  34073. /* 809 */,
  34074. /* 810 */,
  34075. /* 811 */,
  34076. /* 812 */,
  34077. /* 813 */,
  34078. /* 814 */,
  34079. /* 815 */,
  34080. /* 816 */,
  34081. /* 817 */,
  34082. /* 818 */,
  34083. /* 819 */,
  34084. /* 820 */,
  34085. /* 821 */,
  34086. /* 822 */,
  34087. /* 823 */
  34088. /*!*****************************************************************************************!*\
  34089. !*** D:/zheng_dev2021/caimei-applets-hehe/components/uni-components/uni-icons/icons.js ***!
  34090. \*****************************************************************************************/
  34091. /*! no static exports found */
  34092. /***/ (function(module, exports, __webpack_require__) {
  34093. "use strict";
  34094. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  34095. "pulldown": "\uE588",
  34096. "refreshempty": "\uE461",
  34097. "back": "\uE471",
  34098. "forward": "\uE470",
  34099. "more": "\uE507",
  34100. "more-filled": "\uE537",
  34101. "scan": "\uE612",
  34102. "qq": "\uE264",
  34103. "weibo": "\uE260",
  34104. "weixin": "\uE261",
  34105. "pengyouquan": "\uE262",
  34106. "loop": "\uE565",
  34107. "refresh": "\uE407",
  34108. "refresh-filled": "\uE437",
  34109. "arrowthindown": "\uE585",
  34110. "arrowthinleft": "\uE586",
  34111. "arrowthinright": "\uE587",
  34112. "arrowthinup": "\uE584",
  34113. "undo-filled": "\uE7D6",
  34114. "undo": "\uE406",
  34115. "redo": "\uE405",
  34116. "redo-filled": "\uE7D9",
  34117. "bars": "\uE563",
  34118. "chatboxes": "\uE203",
  34119. "camera": "\uE301",
  34120. "chatboxes-filled": "\uE233",
  34121. "camera-filled": "\uE7EF",
  34122. "cart-filled": "\uE7F4",
  34123. "cart": "\uE7F5",
  34124. "checkbox-filled": "\uE442",
  34125. "checkbox": "\uE7FA",
  34126. "arrowleft": "\uE582",
  34127. "arrowdown": "\uE581",
  34128. "arrowright": "\uE583",
  34129. "smallcircle-filled": "\uE801",
  34130. "arrowup": "\uE580",
  34131. "circle": "\uE411",
  34132. "eye-filled": "\uE568",
  34133. "eye-slash-filled": "\uE822",
  34134. "eye-slash": "\uE823",
  34135. "eye": "\uE824",
  34136. "flag-filled": "\uE825",
  34137. "flag": "\uE508",
  34138. "gear-filled": "\uE532",
  34139. "reload": "\uE462",
  34140. "gear": "\uE502",
  34141. "hand-thumbsdown-filled": "\uE83B",
  34142. "hand-thumbsdown": "\uE83C",
  34143. "hand-thumbsup-filled": "\uE83D",
  34144. "heart-filled": "\uE83E",
  34145. "hand-thumbsup": "\uE83F",
  34146. "heart": "\uE840",
  34147. "home": "\uE500",
  34148. "info": "\uE504",
  34149. "home-filled": "\uE530",
  34150. "info-filled": "\uE534",
  34151. "circle-filled": "\uE441",
  34152. "chat-filled": "\uE847",
  34153. "chat": "\uE263",
  34154. "mail-open-filled": "\uE84D",
  34155. "email-filled": "\uE231",
  34156. "mail-open": "\uE84E",
  34157. "email": "\uE201",
  34158. "checkmarkempty": "\uE472",
  34159. "list": "\uE562",
  34160. "locked-filled": "\uE856",
  34161. "locked": "\uE506",
  34162. "map-filled": "\uE85C",
  34163. "map-pin": "\uE85E",
  34164. "map-pin-ellipse": "\uE864",
  34165. "map": "\uE364",
  34166. "minus-filled": "\uE440",
  34167. "mic-filled": "\uE332",
  34168. "minus": "\uE410",
  34169. "micoff": "\uE360",
  34170. "mic": "\uE302",
  34171. "clear": "\uE434",
  34172. "smallcircle": "\uE868",
  34173. "close": "\uE404",
  34174. "closeempty": "\uE460",
  34175. "paperclip": "\uE567",
  34176. "paperplane": "\uE503",
  34177. "paperplane-filled": "\uE86E",
  34178. "person-filled": "\uE131",
  34179. "contact-filled": "\uE130",
  34180. "person": "\uE101",
  34181. "contact": "\uE100",
  34182. "images-filled": "\uE87A",
  34183. "phone": "\uE200",
  34184. "images": "\uE87B",
  34185. "image": "\uE363",
  34186. "image-filled": "\uE877",
  34187. "location-filled": "\uE333",
  34188. "location": "\uE303",
  34189. "plus-filled": "\uE439",
  34190. "plus": "\uE409",
  34191. "plusempty": "\uE468",
  34192. "help-filled": "\uE535",
  34193. "help": "\uE505",
  34194. "navigate-filled": "\uE884",
  34195. "navigate": "\uE501",
  34196. "mic-slash-filled": "\uE892",
  34197. "search": "\uE466",
  34198. "settings": "\uE560",
  34199. "sound": "\uE590",
  34200. "sound-filled": "\uE8A1",
  34201. "spinner-cycle": "\uE465",
  34202. "download-filled": "\uE8A4",
  34203. "personadd-filled": "\uE132",
  34204. "videocam-filled": "\uE8AF",
  34205. "personadd": "\uE102",
  34206. "upload": "\uE402",
  34207. "upload-filled": "\uE8B1",
  34208. "starhalf": "\uE463",
  34209. "star-filled": "\uE438",
  34210. "star": "\uE408",
  34211. "trash": "\uE401",
  34212. "phone-filled": "\uE230",
  34213. "compose": "\uE400",
  34214. "videocam": "\uE300",
  34215. "trash-filled": "\uE8DC",
  34216. "download": "\uE403",
  34217. "chatbubble-filled": "\uE232",
  34218. "chatbubble": "\uE202",
  34219. "cloud-download": "\uE8E4",
  34220. "cloud-upload-filled": "\uE8E5",
  34221. "cloud-upload": "\uE8E6",
  34222. "cloud-download-filled": "\uE8E9",
  34223. "headphones": "\uE8BF",
  34224. "shop": "\uE609" };exports.default = _default;
  34225. /***/ })
  34226. ]]);
  34227. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map