vendor.js 1.3 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612406134061440615406164061740618406194062040621406224062340624406254062640627406284062940630406314063240633406344063540636406374063840639406404064140642406434064440645406464064740648406494065040651406524065340654406554065640657406584065940660406614066240663406644066540666406674066840669406704067140672406734067440675406764067740678406794068040681406824068340684406854068640687406884068940690406914069240693406944069540696406974069840699407004070140702407034070440705407064070740708407094071040711407124071340714407154071640717407184071940720407214072240723407244072540726407274072840729407304073140732407334073440735407364073740738407394074040741407424074340744407454074640747407484074940750407514075240753407544075540756407574075840759407604076140762407634076440765407664076740768407694077040771407724077340774407754077640777407784077940780407814078240783407844078540786407874078840789407904079140792407934079440795407964079740798407994080040801408024080340804408054080640807408084080940810408114081240813408144081540816408174081840819408204082140822408234082440825408264082740828408294083040831408324083340834408354083640837408384083940840408414084240843408444084540846408474084840849408504085140852408534085440855408564085740858408594086040861408624086340864408654086640867408684086940870408714087240873408744087540876408774087840879408804088140882408834088440885408864088740888408894089040891408924089340894408954089640897408984089940900409014090240903409044090540906409074090840909409104091140912409134091440915409164091740918409194092040921409224092340924409254092640927409284092940930409314093240933409344093540936409374093840939409404094140942409434094440945409464094740948409494095040951409524095340954409554095640957409584095940960409614096240963409644096540966409674096840969409704097140972409734097440975409764097740978409794098040981409824098340984409854098640987409884098940990409914099240993409944099540996409974099840999410004100141002410034100441005410064100741008410094101041011410124101341014
  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 _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 3);
  11. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 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. function sortObject(obj) {
  108. var sortObj = {};
  109. if (isPlainObject(obj)) {
  110. Object.keys(obj).sort().forEach(function (key) {
  111. sortObj[key] = obj[key];
  112. });
  113. }
  114. return !Object.keys(sortObj) ? obj : sortObj;
  115. }
  116. var HOOKS = [
  117. 'invoke',
  118. 'success',
  119. 'fail',
  120. 'complete',
  121. 'returnValue'];
  122. var globalInterceptors = {};
  123. var scopedInterceptors = {};
  124. function mergeHook(parentVal, childVal) {
  125. var res = childVal ?
  126. parentVal ?
  127. parentVal.concat(childVal) :
  128. Array.isArray(childVal) ?
  129. childVal : [childVal] :
  130. parentVal;
  131. return res ?
  132. dedupeHooks(res) :
  133. res;
  134. }
  135. function dedupeHooks(hooks) {
  136. var res = [];
  137. for (var i = 0; i < hooks.length; i++) {
  138. if (res.indexOf(hooks[i]) === -1) {
  139. res.push(hooks[i]);
  140. }
  141. }
  142. return res;
  143. }
  144. function removeHook(hooks, hook) {
  145. var index = hooks.indexOf(hook);
  146. if (index !== -1) {
  147. hooks.splice(index, 1);
  148. }
  149. }
  150. function mergeInterceptorHook(interceptor, option) {
  151. Object.keys(option).forEach(function (hook) {
  152. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  153. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  154. }
  155. });
  156. }
  157. function removeInterceptorHook(interceptor, option) {
  158. if (!interceptor || !option) {
  159. return;
  160. }
  161. Object.keys(option).forEach(function (hook) {
  162. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  163. removeHook(interceptor[hook], option[hook]);
  164. }
  165. });
  166. }
  167. function addInterceptor(method, option) {
  168. if (typeof method === 'string' && isPlainObject(option)) {
  169. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  170. } else if (isPlainObject(method)) {
  171. mergeInterceptorHook(globalInterceptors, method);
  172. }
  173. }
  174. function removeInterceptor(method, option) {
  175. if (typeof method === 'string') {
  176. if (isPlainObject(option)) {
  177. removeInterceptorHook(scopedInterceptors[method], option);
  178. } else {
  179. delete scopedInterceptors[method];
  180. }
  181. } else if (isPlainObject(method)) {
  182. removeInterceptorHook(globalInterceptors, method);
  183. }
  184. }
  185. function wrapperHook(hook) {
  186. return function (data) {
  187. return hook(data) || data;
  188. };
  189. }
  190. function isPromise(obj) {
  191. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  192. }
  193. function queue(hooks, data) {
  194. var promise = false;
  195. for (var i = 0; i < hooks.length; i++) {
  196. var hook = hooks[i];
  197. if (promise) {
  198. promise = Promise.resolve(wrapperHook(hook));
  199. } else {
  200. var res = hook(data);
  201. if (isPromise(res)) {
  202. promise = Promise.resolve(res);
  203. }
  204. if (res === false) {
  205. return {
  206. then: function then() {} };
  207. }
  208. }
  209. }
  210. return promise || {
  211. then: function then(callback) {
  212. return callback(data);
  213. } };
  214. }
  215. function wrapperOptions(interceptor) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  216. ['success', 'fail', 'complete'].forEach(function (name) {
  217. if (Array.isArray(interceptor[name])) {
  218. var oldCallback = options[name];
  219. options[name] = function callbackInterceptor(res) {
  220. queue(interceptor[name], res).then(function (res) {
  221. /* eslint-disable no-mixed-operators */
  222. return isFn(oldCallback) && oldCallback(res) || res;
  223. });
  224. };
  225. }
  226. });
  227. return options;
  228. }
  229. function wrapperReturnValue(method, returnValue) {
  230. var returnValueHooks = [];
  231. if (Array.isArray(globalInterceptors.returnValue)) {
  232. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(globalInterceptors.returnValue));
  233. }
  234. var interceptor = scopedInterceptors[method];
  235. if (interceptor && Array.isArray(interceptor.returnValue)) {
  236. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(interceptor.returnValue));
  237. }
  238. returnValueHooks.forEach(function (hook) {
  239. returnValue = hook(returnValue) || returnValue;
  240. });
  241. return returnValue;
  242. }
  243. function getApiInterceptorHooks(method) {
  244. var interceptor = Object.create(null);
  245. Object.keys(globalInterceptors).forEach(function (hook) {
  246. if (hook !== 'returnValue') {
  247. interceptor[hook] = globalInterceptors[hook].slice();
  248. }
  249. });
  250. var scopedInterceptor = scopedInterceptors[method];
  251. if (scopedInterceptor) {
  252. Object.keys(scopedInterceptor).forEach(function (hook) {
  253. if (hook !== 'returnValue') {
  254. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  255. }
  256. });
  257. }
  258. return interceptor;
  259. }
  260. 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];}
  261. var interceptor = getApiInterceptorHooks(method);
  262. if (interceptor && Object.keys(interceptor).length) {
  263. if (Array.isArray(interceptor.invoke)) {
  264. var res = queue(interceptor.invoke, options);
  265. return res.then(function (options) {
  266. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  267. });
  268. } else {
  269. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  270. }
  271. }
  272. return api.apply(void 0, [options].concat(params));
  273. }
  274. var promiseInterceptor = {
  275. returnValue: function returnValue(res) {
  276. if (!isPromise(res)) {
  277. return res;
  278. }
  279. return new Promise(function (resolve, reject) {
  280. res.then(function (res) {
  281. if (res[0]) {
  282. reject(res[0]);
  283. } else {
  284. resolve(res[1]);
  285. }
  286. });
  287. });
  288. } };
  289. var SYNC_API_RE =
  290. /^\$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback|getWindowInfo|getDeviceInfo|getAppBaseInfo/;
  291. var CONTEXT_API_RE = /^create|Manager$/;
  292. // Context例外情况
  293. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  294. // 同步例外情况
  295. var ASYNC_API = ['createBLEConnection'];
  296. var CALLBACK_API_RE = /^on|^off/;
  297. function isContextApi(name) {
  298. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  299. }
  300. function isSyncApi(name) {
  301. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  302. }
  303. function isCallbackApi(name) {
  304. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  305. }
  306. function handlePromise(promise) {
  307. return promise.then(function (data) {
  308. return [null, data];
  309. }).
  310. catch(function (err) {return [err];});
  311. }
  312. function shouldPromise(name) {
  313. if (
  314. isContextApi(name) ||
  315. isSyncApi(name) ||
  316. isCallbackApi(name))
  317. {
  318. return false;
  319. }
  320. return true;
  321. }
  322. /* eslint-disable no-extend-native */
  323. if (!Promise.prototype.finally) {
  324. Promise.prototype.finally = function (callback) {
  325. var promise = this.constructor;
  326. return this.then(
  327. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  328. function (reason) {return promise.resolve(callback()).then(function () {
  329. throw reason;
  330. });});
  331. };
  332. }
  333. function promisify(name, api) {
  334. if (!shouldPromise(name)) {
  335. return api;
  336. }
  337. 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];}
  338. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  339. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  340. }
  341. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  342. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  343. success: resolve,
  344. fail: reject })].concat(
  345. params));
  346. })));
  347. };
  348. }
  349. var EPS = 1e-4;
  350. var BASE_DEVICE_WIDTH = 750;
  351. var isIOS = false;
  352. var deviceWidth = 0;
  353. var deviceDPR = 0;
  354. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  355. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  356. deviceWidth = windowWidth;
  357. deviceDPR = pixelRatio;
  358. isIOS = platform === 'ios';
  359. }
  360. function upx2px(number, newDeviceWidth) {
  361. if (deviceWidth === 0) {
  362. checkDeviceWidth();
  363. }
  364. number = Number(number);
  365. if (number === 0) {
  366. return 0;
  367. }
  368. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  369. if (result < 0) {
  370. result = -result;
  371. }
  372. result = Math.floor(result + EPS);
  373. if (result === 0) {
  374. if (deviceDPR === 1 || !isIOS) {
  375. result = 1;
  376. } else {
  377. result = 0.5;
  378. }
  379. }
  380. return number < 0 ? -result : result;
  381. }
  382. var LOCALE_ZH_HANS = 'zh-Hans';
  383. var LOCALE_ZH_HANT = 'zh-Hant';
  384. var LOCALE_EN = 'en';
  385. var LOCALE_FR = 'fr';
  386. var LOCALE_ES = 'es';
  387. var messages = {};
  388. var locale;
  389. {
  390. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  391. }
  392. function initI18nMessages() {
  393. if (!isEnableLocale()) {
  394. return;
  395. }
  396. var localeKeys = Object.keys(__uniConfig.locales);
  397. if (localeKeys.length) {
  398. localeKeys.forEach(function (locale) {
  399. var curMessages = messages[locale];
  400. var userMessages = __uniConfig.locales[locale];
  401. if (curMessages) {
  402. Object.assign(curMessages, userMessages);
  403. } else {
  404. messages[locale] = userMessages;
  405. }
  406. });
  407. }
  408. }
  409. initI18nMessages();
  410. var i18n = (0, _uniI18n.initVueI18n)(
  411. locale,
  412. {});
  413. var t = i18n.t;
  414. var i18nMixin = i18n.mixin = {
  415. beforeCreate: function beforeCreate() {var _this = this;
  416. var unwatch = i18n.i18n.watchLocale(function () {
  417. _this.$forceUpdate();
  418. });
  419. this.$once('hook:beforeDestroy', function () {
  420. unwatch();
  421. });
  422. },
  423. methods: {
  424. $$t: function $$t(key, values) {
  425. return t(key, values);
  426. } } };
  427. var setLocale = i18n.setLocale;
  428. var getLocale = i18n.getLocale;
  429. function initAppLocale(Vue, appVm, locale) {
  430. var state = Vue.observable({
  431. locale: locale || i18n.getLocale() });
  432. var localeWatchers = [];
  433. appVm.$watchLocale = function (fn) {
  434. localeWatchers.push(fn);
  435. };
  436. Object.defineProperty(appVm, '$locale', {
  437. get: function get() {
  438. return state.locale;
  439. },
  440. set: function set(v) {
  441. state.locale = v;
  442. localeWatchers.forEach(function (watch) {return watch(v);});
  443. } });
  444. }
  445. function isEnableLocale() {
  446. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  447. }
  448. function include(str, parts) {
  449. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  450. }
  451. function startsWith(str, parts) {
  452. return parts.find(function (part) {return str.indexOf(part) === 0;});
  453. }
  454. function normalizeLocale(locale, messages) {
  455. if (!locale) {
  456. return;
  457. }
  458. locale = locale.trim().replace(/_/g, '-');
  459. if (messages && messages[locale]) {
  460. return locale;
  461. }
  462. locale = locale.toLowerCase();
  463. if (locale === 'chinese') {
  464. // 支付宝
  465. return LOCALE_ZH_HANS;
  466. }
  467. if (locale.indexOf('zh') === 0) {
  468. if (locale.indexOf('-hans') > -1) {
  469. return LOCALE_ZH_HANS;
  470. }
  471. if (locale.indexOf('-hant') > -1) {
  472. return LOCALE_ZH_HANT;
  473. }
  474. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  475. return LOCALE_ZH_HANT;
  476. }
  477. return LOCALE_ZH_HANS;
  478. }
  479. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  480. if (lang) {
  481. return lang;
  482. }
  483. }
  484. // export function initI18n() {
  485. // const localeKeys = Object.keys(__uniConfig.locales || {})
  486. // if (localeKeys.length) {
  487. // localeKeys.forEach((locale) =>
  488. // i18n.add(locale, __uniConfig.locales[locale])
  489. // )
  490. // }
  491. // }
  492. function getLocale$1() {
  493. // 优先使用 $locale
  494. var app = getApp({
  495. allowDefault: true });
  496. if (app && app.$vm) {
  497. return app.$vm.$locale;
  498. }
  499. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  500. }
  501. function setLocale$1(locale) {
  502. var app = getApp();
  503. if (!app) {
  504. return false;
  505. }
  506. var oldLocale = app.$vm.$locale;
  507. if (oldLocale !== locale) {
  508. app.$vm.$locale = locale;
  509. onLocaleChangeCallbacks.forEach(function (fn) {return fn({
  510. locale: locale });});
  511. return true;
  512. }
  513. return false;
  514. }
  515. var onLocaleChangeCallbacks = [];
  516. function onLocaleChange(fn) {
  517. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  518. onLocaleChangeCallbacks.push(fn);
  519. }
  520. }
  521. if (typeof global !== 'undefined') {
  522. global.getLocale = getLocale$1;
  523. }
  524. var interceptors = {
  525. promiseInterceptor: promiseInterceptor };
  526. var baseApi = /*#__PURE__*/Object.freeze({
  527. __proto__: null,
  528. upx2px: upx2px,
  529. getLocale: getLocale$1,
  530. setLocale: setLocale$1,
  531. onLocaleChange: onLocaleChange,
  532. addInterceptor: addInterceptor,
  533. removeInterceptor: removeInterceptor,
  534. interceptors: interceptors });
  535. function findExistsPageIndex(url) {
  536. var pages = getCurrentPages();
  537. var len = pages.length;
  538. while (len--) {
  539. var page = pages[len];
  540. if (page.$page && page.$page.fullPath === url) {
  541. return len;
  542. }
  543. }
  544. return -1;
  545. }
  546. var redirectTo = {
  547. name: function name(fromArgs) {
  548. if (fromArgs.exists === 'back' && fromArgs.delta) {
  549. return 'navigateBack';
  550. }
  551. return 'redirectTo';
  552. },
  553. args: function args(fromArgs) {
  554. if (fromArgs.exists === 'back' && fromArgs.url) {
  555. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  556. if (existsPageIndex !== -1) {
  557. var delta = getCurrentPages().length - 1 - existsPageIndex;
  558. if (delta > 0) {
  559. fromArgs.delta = delta;
  560. }
  561. }
  562. }
  563. } };
  564. var previewImage = {
  565. args: function args(fromArgs) {
  566. var currentIndex = parseInt(fromArgs.current);
  567. if (isNaN(currentIndex)) {
  568. return;
  569. }
  570. var urls = fromArgs.urls;
  571. if (!Array.isArray(urls)) {
  572. return;
  573. }
  574. var len = urls.length;
  575. if (!len) {
  576. return;
  577. }
  578. if (currentIndex < 0) {
  579. currentIndex = 0;
  580. } else if (currentIndex >= len) {
  581. currentIndex = len - 1;
  582. }
  583. if (currentIndex > 0) {
  584. fromArgs.current = urls[currentIndex];
  585. fromArgs.urls = urls.filter(
  586. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  587. } else {
  588. fromArgs.current = urls[0];
  589. }
  590. return {
  591. indicator: false,
  592. loop: false };
  593. } };
  594. var UUID_KEY = '__DC_STAT_UUID';
  595. var deviceId;
  596. function useDeviceId(result) {
  597. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  598. if (!deviceId) {
  599. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  600. wx.setStorage({
  601. key: UUID_KEY,
  602. data: deviceId });
  603. }
  604. result.deviceId = deviceId;
  605. }
  606. function addSafeAreaInsets(result) {
  607. if (result.safeArea) {
  608. var safeArea = result.safeArea;
  609. result.safeAreaInsets = {
  610. top: safeArea.top,
  611. left: safeArea.left,
  612. right: result.windowWidth - safeArea.right,
  613. bottom: result.screenHeight - safeArea.bottom };
  614. }
  615. }
  616. function populateParameters(result) {var _result$brand =
  617. result.brand,brand = _result$brand === void 0 ? '' : _result$brand,_result$model = result.model,model = _result$model === void 0 ? '' : _result$model,_result$system = result.system,system = _result$system === void 0 ? '' : _result$system,_result$language = result.language,language = _result$language === void 0 ? '' : _result$language,theme = result.theme,version = result.version,platform = result.platform,fontSizeSetting = result.fontSizeSetting,SDKVersion = result.SDKVersion,pixelRatio = result.pixelRatio,deviceOrientation = result.deviceOrientation;
  618. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  619. // osName osVersion
  620. var osName = '';
  621. var osVersion = '';
  622. {
  623. osName = system.split(' ')[0] || '';
  624. osVersion = system.split(' ')[1] || '';
  625. }
  626. var hostVersion = version;
  627. // deviceType
  628. var deviceType = getGetDeviceType(result, model);
  629. // deviceModel
  630. var deviceBrand = getDeviceBrand(brand);
  631. // hostName
  632. var _hostName = getHostName(result);
  633. // deviceOrientation
  634. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  635. // devicePixelRatio
  636. var _devicePixelRatio = pixelRatio;
  637. // SDKVersion
  638. var _SDKVersion = SDKVersion;
  639. // hostLanguage
  640. var hostLanguage = language.replace(/_/g, '-');
  641. // wx.getAccountInfoSync
  642. var parameters = {
  643. appId: "__UNI__524F1F7",
  644. appName: "broke_news_wx",
  645. appVersion: "1.0.0",
  646. appVersionCode: "100",
  647. appLanguage: getAppLanguage(hostLanguage),
  648. uniCompileVersion: "3.4.18",
  649. uniRuntimeVersion: "3.4.18",
  650. uniPlatform: undefined || "mp-weixin",
  651. deviceBrand: deviceBrand,
  652. deviceModel: model,
  653. deviceType: deviceType,
  654. devicePixelRatio: _devicePixelRatio,
  655. deviceOrientation: _deviceOrientation,
  656. osName: osName.toLocaleLowerCase(),
  657. osVersion: osVersion,
  658. hostTheme: theme,
  659. hostVersion: hostVersion,
  660. hostLanguage: hostLanguage,
  661. hostName: _hostName,
  662. hostSDKVersion: _SDKVersion,
  663. hostFontSizeSetting: fontSizeSetting,
  664. windowTop: 0,
  665. windowBottom: 0,
  666. // TODO
  667. osLanguage: undefined,
  668. osTheme: undefined,
  669. ua: undefined,
  670. hostPackageName: undefined,
  671. browserName: undefined,
  672. browserVersion: undefined };
  673. Object.assign(result, parameters);
  674. }
  675. function getGetDeviceType(result, model) {
  676. var deviceType = result.deviceType || 'phone';
  677. {
  678. var deviceTypeMaps = {
  679. ipad: 'pad',
  680. windows: 'pc',
  681. mac: 'pc' };
  682. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  683. var _model = model.toLocaleLowerCase();
  684. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  685. var _m = deviceTypeMapsKeys[index];
  686. if (_model.indexOf(_m) !== -1) {
  687. deviceType = deviceTypeMaps[_m];
  688. break;
  689. }
  690. }
  691. }
  692. return deviceType;
  693. }
  694. function getDeviceBrand(brand) {
  695. var deviceBrand = brand;
  696. if (deviceBrand) {
  697. deviceBrand = brand.toLocaleLowerCase();
  698. }
  699. return deviceBrand;
  700. }
  701. function getAppLanguage(defaultLanguage) {
  702. return getLocale$1 ?
  703. getLocale$1() :
  704. defaultLanguage;
  705. }
  706. function getHostName(result) {
  707. var _platform = 'WeChat';
  708. var _hostName = result.hostName || _platform; // mp-jd
  709. {
  710. if (result.environment) {
  711. _hostName = result.environment;
  712. } else if (result.host && result.host.env) {
  713. _hostName = result.host.env;
  714. }
  715. }
  716. return _hostName;
  717. }
  718. var getSystemInfo = {
  719. returnValue: function returnValue(result) {
  720. useDeviceId(result);
  721. addSafeAreaInsets(result);
  722. populateParameters(result);
  723. } };
  724. var showActionSheet = {
  725. args: function args(fromArgs) {
  726. if (typeof fromArgs === 'object') {
  727. fromArgs.alertText = fromArgs.title;
  728. }
  729. } };
  730. var getAppBaseInfo = {
  731. returnValue: function returnValue(result) {var _result =
  732. result,version = _result.version,language = _result.language,SDKVersion = _result.SDKVersion,theme = _result.theme;
  733. var _hostName = getHostName(result);
  734. var hostLanguage = language.replace('_', '-');
  735. result = sortObject(Object.assign(result, {
  736. appId: "__UNI__524F1F7",
  737. appName: "broke_news_wx",
  738. appVersion: "1.0.0",
  739. appVersionCode: "100",
  740. appLanguage: getAppLanguage(hostLanguage),
  741. hostVersion: version,
  742. hostLanguage: hostLanguage,
  743. hostName: _hostName,
  744. hostSDKVersion: SDKVersion,
  745. hostTheme: theme }));
  746. } };
  747. var getDeviceInfo = {
  748. returnValue: function returnValue(result) {var _result2 =
  749. result,brand = _result2.brand,model = _result2.model;
  750. var deviceType = getGetDeviceType(result, model);
  751. var deviceBrand = getDeviceBrand(brand);
  752. useDeviceId(result);
  753. result = sortObject(Object.assign(result, {
  754. deviceType: deviceType,
  755. deviceBrand: deviceBrand,
  756. deviceModel: model }));
  757. } };
  758. var getWindowInfo = {
  759. returnValue: function returnValue(result) {
  760. addSafeAreaInsets(result);
  761. result = sortObject(Object.assign(result, {
  762. windowTop: 0,
  763. windowBottom: 0 }));
  764. } };
  765. // import navigateTo from 'uni-helpers/navigate-to'
  766. var protocols = {
  767. redirectTo: redirectTo,
  768. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  769. previewImage: previewImage,
  770. getSystemInfo: getSystemInfo,
  771. getSystemInfoSync: getSystemInfo,
  772. showActionSheet: showActionSheet,
  773. getAppBaseInfo: getAppBaseInfo,
  774. getDeviceInfo: getDeviceInfo,
  775. getWindowInfo: getWindowInfo };
  776. var todos = [
  777. 'vibrate',
  778. 'preloadPage',
  779. 'unPreloadPage',
  780. 'loadSubPackage'];
  781. var canIUses = [];
  782. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  783. function processCallback(methodName, method, returnValue) {
  784. return function (res) {
  785. return method(processReturnValue(methodName, res, returnValue));
  786. };
  787. }
  788. 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;
  789. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  790. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  791. if (isFn(argsOption)) {
  792. argsOption = argsOption(fromArgs, toArgs) || {};
  793. }
  794. for (var key in fromArgs) {
  795. if (hasOwn(argsOption, key)) {
  796. var keyOption = argsOption[key];
  797. if (isFn(keyOption)) {
  798. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  799. }
  800. if (!keyOption) {// 不支持的参数
  801. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  802. } else if (isStr(keyOption)) {// 重写参数 key
  803. toArgs[keyOption] = fromArgs[key];
  804. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  805. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  806. }
  807. } else if (CALLBACKS.indexOf(key) !== -1) {
  808. if (isFn(fromArgs[key])) {
  809. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  810. }
  811. } else {
  812. if (!keepFromArgs) {
  813. toArgs[key] = fromArgs[key];
  814. }
  815. }
  816. }
  817. return toArgs;
  818. } else if (isFn(fromArgs)) {
  819. fromArgs = processCallback(methodName, fromArgs, returnValue);
  820. }
  821. return fromArgs;
  822. }
  823. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  824. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  825. res = protocols.returnValue(methodName, res);
  826. }
  827. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  828. }
  829. function wrapper(methodName, method) {
  830. if (hasOwn(protocols, methodName)) {
  831. var protocol = protocols[methodName];
  832. if (!protocol) {// 暂不支持的 api
  833. return function () {
  834. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  835. };
  836. }
  837. return function (arg1, arg2) {// 目前 api 最多两个参数
  838. var options = protocol;
  839. if (isFn(protocol)) {
  840. options = protocol(arg1);
  841. }
  842. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  843. var args = [arg1];
  844. if (typeof arg2 !== 'undefined') {
  845. args.push(arg2);
  846. }
  847. if (isFn(options.name)) {
  848. methodName = options.name(arg1);
  849. } else if (isStr(options.name)) {
  850. methodName = options.name;
  851. }
  852. var returnValue = wx[methodName].apply(wx, args);
  853. if (isSyncApi(methodName)) {// 同步 api
  854. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  855. }
  856. return returnValue;
  857. };
  858. }
  859. return method;
  860. }
  861. var todoApis = Object.create(null);
  862. var TODOS = [
  863. 'onTabBarMidButtonTap',
  864. 'subscribePush',
  865. 'unsubscribePush',
  866. 'onPush',
  867. 'offPush',
  868. 'share'];
  869. function createTodoApi(name) {
  870. return function todoApi(_ref)
  871. {var fail = _ref.fail,complete = _ref.complete;
  872. var res = {
  873. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported") };
  874. isFn(fail) && fail(res);
  875. isFn(complete) && complete(res);
  876. };
  877. }
  878. TODOS.forEach(function (name) {
  879. todoApis[name] = createTodoApi(name);
  880. });
  881. var providers = {
  882. oauth: ['weixin'],
  883. share: ['weixin'],
  884. payment: ['wxpay'],
  885. push: ['weixin'] };
  886. function getProvider(_ref2)
  887. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  888. var res = false;
  889. if (providers[service]) {
  890. res = {
  891. errMsg: 'getProvider:ok',
  892. service: service,
  893. provider: providers[service] };
  894. isFn(success) && success(res);
  895. } else {
  896. res = {
  897. errMsg: 'getProvider:fail service not found' };
  898. isFn(fail) && fail(res);
  899. }
  900. isFn(complete) && complete(res);
  901. }
  902. var extraApi = /*#__PURE__*/Object.freeze({
  903. __proto__: null,
  904. getProvider: getProvider });
  905. var getEmitter = function () {
  906. var Emitter;
  907. return function getUniEmitter() {
  908. if (!Emitter) {
  909. Emitter = new _vue.default();
  910. }
  911. return Emitter;
  912. };
  913. }();
  914. function apply(ctx, method, args) {
  915. return ctx[method].apply(ctx, args);
  916. }
  917. function $on() {
  918. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  919. }
  920. function $off() {
  921. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  922. }
  923. function $once() {
  924. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  925. }
  926. function $emit() {
  927. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  928. }
  929. var eventApi = /*#__PURE__*/Object.freeze({
  930. __proto__: null,
  931. $on: $on,
  932. $off: $off,
  933. $once: $once,
  934. $emit: $emit });
  935. /**
  936. * 框架内 try-catch
  937. */
  938. /**
  939. * 开发者 try-catch
  940. */
  941. function tryCatch(fn) {
  942. return function () {
  943. try {
  944. return fn.apply(fn, arguments);
  945. } catch (e) {
  946. // TODO
  947. console.error(e);
  948. }
  949. };
  950. }
  951. function getApiCallbacks(params) {
  952. var apiCallbacks = {};
  953. for (var name in params) {
  954. var param = params[name];
  955. if (isFn(param)) {
  956. apiCallbacks[name] = tryCatch(param);
  957. delete params[name];
  958. }
  959. }
  960. return apiCallbacks;
  961. }
  962. var cid;
  963. var cidErrMsg;
  964. function normalizePushMessage(message) {
  965. try {
  966. return JSON.parse(message);
  967. } catch (e) {}
  968. return message;
  969. }
  970. function invokePushCallback(
  971. args)
  972. {
  973. if (args.type === 'clientId') {
  974. cid = args.cid;
  975. cidErrMsg = args.errMsg;
  976. invokeGetPushCidCallbacks(cid, args.errMsg);
  977. } else if (args.type === 'pushMsg') {
  978. onPushMessageCallbacks.forEach(function (callback) {
  979. callback({
  980. type: 'receive',
  981. data: normalizePushMessage(args.message) });
  982. });
  983. } else if (args.type === 'click') {
  984. onPushMessageCallbacks.forEach(function (callback) {
  985. callback({
  986. type: 'click',
  987. data: normalizePushMessage(args.message) });
  988. });
  989. }
  990. }
  991. var getPushCidCallbacks = [];
  992. function invokeGetPushCidCallbacks(cid, errMsg) {
  993. getPushCidCallbacks.forEach(function (callback) {
  994. callback(cid, errMsg);
  995. });
  996. getPushCidCallbacks.length = 0;
  997. }
  998. function getPushClientid(args) {
  999. if (!isPlainObject(args)) {
  1000. args = {};
  1001. }var _getApiCallbacks =
  1002. getApiCallbacks(args),success = _getApiCallbacks.success,fail = _getApiCallbacks.fail,complete = _getApiCallbacks.complete;
  1003. var hasSuccess = isFn(success);
  1004. var hasFail = isFn(fail);
  1005. var hasComplete = isFn(complete);
  1006. getPushCidCallbacks.push(function (cid, errMsg) {
  1007. var res;
  1008. if (cid) {
  1009. res = {
  1010. errMsg: 'getPushClientid:ok',
  1011. cid: cid };
  1012. hasSuccess && success(res);
  1013. } else {
  1014. res = {
  1015. errMsg: 'getPushClientid:fail' + (errMsg ? ' ' + errMsg : '') };
  1016. hasFail && fail(res);
  1017. }
  1018. hasComplete && complete(res);
  1019. });
  1020. if (typeof cid !== 'undefined') {
  1021. Promise.resolve().then(function () {return invokeGetPushCidCallbacks(cid, cidErrMsg);});
  1022. }
  1023. }
  1024. var onPushMessageCallbacks = [];
  1025. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  1026. var onPushMessage = function onPushMessage(fn) {
  1027. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  1028. onPushMessageCallbacks.push(fn);
  1029. }
  1030. };
  1031. var offPushMessage = function offPushMessage(fn) {
  1032. if (!fn) {
  1033. onPushMessageCallbacks.length = 0;
  1034. } else {
  1035. var index = onPushMessageCallbacks.indexOf(fn);
  1036. if (index > -1) {
  1037. onPushMessageCallbacks.splice(index, 1);
  1038. }
  1039. }
  1040. };
  1041. var api = /*#__PURE__*/Object.freeze({
  1042. __proto__: null,
  1043. getPushClientid: getPushClientid,
  1044. onPushMessage: onPushMessage,
  1045. offPushMessage: offPushMessage,
  1046. invokePushCallback: invokePushCallback });
  1047. var MPPage = Page;
  1048. var MPComponent = Component;
  1049. var customizeRE = /:/g;
  1050. var customize = cached(function (str) {
  1051. return camelize(str.replace(customizeRE, '-'));
  1052. });
  1053. function initTriggerEvent(mpInstance) {
  1054. var oldTriggerEvent = mpInstance.triggerEvent;
  1055. var newTriggerEvent = function newTriggerEvent(event) {for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {args[_key3 - 1] = arguments[_key3];}
  1056. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  1057. };
  1058. try {
  1059. // 京东小程序 triggerEvent 为只读
  1060. mpInstance.triggerEvent = newTriggerEvent;
  1061. } catch (error) {
  1062. mpInstance._triggerEvent = newTriggerEvent;
  1063. }
  1064. }
  1065. function initHook(name, options, isComponent) {
  1066. var oldHook = options[name];
  1067. if (!oldHook) {
  1068. options[name] = function () {
  1069. initTriggerEvent(this);
  1070. };
  1071. } else {
  1072. options[name] = function () {
  1073. initTriggerEvent(this);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}
  1074. return oldHook.apply(this, args);
  1075. };
  1076. }
  1077. }
  1078. if (!MPPage.__$wrappered) {
  1079. MPPage.__$wrappered = true;
  1080. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1081. initHook('onLoad', options);
  1082. return MPPage(options);
  1083. };
  1084. Page.after = MPPage.after;
  1085. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1086. initHook('created', options);
  1087. return MPComponent(options);
  1088. };
  1089. }
  1090. var PAGE_EVENT_HOOKS = [
  1091. 'onPullDownRefresh',
  1092. 'onReachBottom',
  1093. 'onAddToFavorites',
  1094. 'onShareTimeline',
  1095. 'onShareAppMessage',
  1096. 'onPageScroll',
  1097. 'onResize',
  1098. 'onTabItemTap'];
  1099. function initMocks(vm, mocks) {
  1100. var mpInstance = vm.$mp[vm.mpType];
  1101. mocks.forEach(function (mock) {
  1102. if (hasOwn(mpInstance, mock)) {
  1103. vm[mock] = mpInstance[mock];
  1104. }
  1105. });
  1106. }
  1107. function hasHook(hook, vueOptions) {
  1108. if (!vueOptions) {
  1109. return true;
  1110. }
  1111. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  1112. return true;
  1113. }
  1114. vueOptions = vueOptions.default || vueOptions;
  1115. if (isFn(vueOptions)) {
  1116. if (isFn(vueOptions.extendOptions[hook])) {
  1117. return true;
  1118. }
  1119. if (vueOptions.super &&
  1120. vueOptions.super.options &&
  1121. Array.isArray(vueOptions.super.options[hook])) {
  1122. return true;
  1123. }
  1124. return false;
  1125. }
  1126. if (isFn(vueOptions[hook])) {
  1127. return true;
  1128. }
  1129. var mixins = vueOptions.mixins;
  1130. if (Array.isArray(mixins)) {
  1131. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  1132. }
  1133. }
  1134. function initHooks(mpOptions, hooks, vueOptions) {
  1135. hooks.forEach(function (hook) {
  1136. if (hasHook(hook, vueOptions)) {
  1137. mpOptions[hook] = function (args) {
  1138. return this.$vm && this.$vm.__call_hook(hook, args);
  1139. };
  1140. }
  1141. });
  1142. }
  1143. function initVueComponent(Vue, vueOptions) {
  1144. vueOptions = vueOptions.default || vueOptions;
  1145. var VueComponent;
  1146. if (isFn(vueOptions)) {
  1147. VueComponent = vueOptions;
  1148. } else {
  1149. VueComponent = Vue.extend(vueOptions);
  1150. }
  1151. vueOptions = VueComponent.options;
  1152. return [VueComponent, vueOptions];
  1153. }
  1154. function initSlots(vm, vueSlots) {
  1155. if (Array.isArray(vueSlots) && vueSlots.length) {
  1156. var $slots = Object.create(null);
  1157. vueSlots.forEach(function (slotName) {
  1158. $slots[slotName] = true;
  1159. });
  1160. vm.$scopedSlots = vm.$slots = $slots;
  1161. }
  1162. }
  1163. function initVueIds(vueIds, mpInstance) {
  1164. vueIds = (vueIds || '').split(',');
  1165. var len = vueIds.length;
  1166. if (len === 1) {
  1167. mpInstance._$vueId = vueIds[0];
  1168. } else if (len === 2) {
  1169. mpInstance._$vueId = vueIds[0];
  1170. mpInstance._$vuePid = vueIds[1];
  1171. }
  1172. }
  1173. function initData(vueOptions, context) {
  1174. var data = vueOptions.data || {};
  1175. var methods = vueOptions.methods || {};
  1176. if (typeof data === 'function') {
  1177. try {
  1178. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  1179. } catch (e) {
  1180. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"broke_news_wx","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  1181. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  1182. }
  1183. }
  1184. } else {
  1185. try {
  1186. // 对 data 格式化
  1187. data = JSON.parse(JSON.stringify(data));
  1188. } catch (e) {}
  1189. }
  1190. if (!isPlainObject(data)) {
  1191. data = {};
  1192. }
  1193. Object.keys(methods).forEach(function (methodName) {
  1194. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  1195. data[methodName] = methods[methodName];
  1196. }
  1197. });
  1198. return data;
  1199. }
  1200. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  1201. function createObserver(name) {
  1202. return function observer(newVal, oldVal) {
  1203. if (this.$vm) {
  1204. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  1205. }
  1206. };
  1207. }
  1208. function initBehaviors(vueOptions, initBehavior) {
  1209. var vueBehaviors = vueOptions.behaviors;
  1210. var vueExtends = vueOptions.extends;
  1211. var vueMixins = vueOptions.mixins;
  1212. var vueProps = vueOptions.props;
  1213. if (!vueProps) {
  1214. vueOptions.props = vueProps = [];
  1215. }
  1216. var behaviors = [];
  1217. if (Array.isArray(vueBehaviors)) {
  1218. vueBehaviors.forEach(function (behavior) {
  1219. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  1220. if (behavior === 'uni://form-field') {
  1221. if (Array.isArray(vueProps)) {
  1222. vueProps.push('name');
  1223. vueProps.push('value');
  1224. } else {
  1225. vueProps.name = {
  1226. type: String,
  1227. default: '' };
  1228. vueProps.value = {
  1229. type: [String, Number, Boolean, Array, Object, Date],
  1230. default: '' };
  1231. }
  1232. }
  1233. });
  1234. }
  1235. if (isPlainObject(vueExtends) && vueExtends.props) {
  1236. behaviors.push(
  1237. initBehavior({
  1238. properties: initProperties(vueExtends.props, true) }));
  1239. }
  1240. if (Array.isArray(vueMixins)) {
  1241. vueMixins.forEach(function (vueMixin) {
  1242. if (isPlainObject(vueMixin) && vueMixin.props) {
  1243. behaviors.push(
  1244. initBehavior({
  1245. properties: initProperties(vueMixin.props, true) }));
  1246. }
  1247. });
  1248. }
  1249. return behaviors;
  1250. }
  1251. function parsePropType(key, type, defaultValue, file) {
  1252. // [String]=>String
  1253. if (Array.isArray(type) && type.length === 1) {
  1254. return type[0];
  1255. }
  1256. return type;
  1257. }
  1258. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  1259. var properties = {};
  1260. if (!isBehavior) {
  1261. properties.vueId = {
  1262. type: String,
  1263. value: '' };
  1264. // 用于字节跳动小程序模拟抽象节点
  1265. properties.generic = {
  1266. type: Object,
  1267. value: null };
  1268. // scopedSlotsCompiler auto
  1269. properties.scopedSlotsCompiler = {
  1270. type: String,
  1271. value: '' };
  1272. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  1273. type: null,
  1274. value: [],
  1275. observer: function observer(newVal, oldVal) {
  1276. var $slots = Object.create(null);
  1277. newVal.forEach(function (slotName) {
  1278. $slots[slotName] = true;
  1279. });
  1280. this.setData({
  1281. $slots: $slots });
  1282. } };
  1283. }
  1284. if (Array.isArray(props)) {// ['title']
  1285. props.forEach(function (key) {
  1286. properties[key] = {
  1287. type: null,
  1288. observer: createObserver(key) };
  1289. });
  1290. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  1291. Object.keys(props).forEach(function (key) {
  1292. var opts = props[key];
  1293. if (isPlainObject(opts)) {// title:{type:String,default:''}
  1294. var value = opts.default;
  1295. if (isFn(value)) {
  1296. value = value();
  1297. }
  1298. opts.type = parsePropType(key, opts.type);
  1299. properties[key] = {
  1300. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  1301. value: value,
  1302. observer: createObserver(key) };
  1303. } else {// content:String
  1304. var type = parsePropType(key, opts);
  1305. properties[key] = {
  1306. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  1307. observer: createObserver(key) };
  1308. }
  1309. });
  1310. }
  1311. return properties;
  1312. }
  1313. function wrapper$1(event) {
  1314. // TODO 又得兼容 mpvue 的 mp 对象
  1315. try {
  1316. event.mp = JSON.parse(JSON.stringify(event));
  1317. } catch (e) {}
  1318. event.stopPropagation = noop;
  1319. event.preventDefault = noop;
  1320. event.target = event.target || {};
  1321. if (!hasOwn(event, 'detail')) {
  1322. event.detail = {};
  1323. }
  1324. if (hasOwn(event, 'markerId')) {
  1325. event.detail = typeof event.detail === 'object' ? event.detail : {};
  1326. event.detail.markerId = event.markerId;
  1327. }
  1328. if (isPlainObject(event.detail)) {
  1329. event.target = Object.assign({}, event.target, event.detail);
  1330. }
  1331. return event;
  1332. }
  1333. function getExtraValue(vm, dataPathsArray) {
  1334. var context = vm;
  1335. dataPathsArray.forEach(function (dataPathArray) {
  1336. var dataPath = dataPathArray[0];
  1337. var value = dataPathArray[2];
  1338. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  1339. var propPath = dataPathArray[1];
  1340. var valuePath = dataPathArray[3];
  1341. var vFor;
  1342. if (Number.isInteger(dataPath)) {
  1343. vFor = dataPath;
  1344. } else if (!dataPath) {
  1345. vFor = context;
  1346. } else if (typeof dataPath === 'string' && dataPath) {
  1347. if (dataPath.indexOf('#s#') === 0) {
  1348. vFor = dataPath.substr(3);
  1349. } else {
  1350. vFor = vm.__get_value(dataPath, context);
  1351. }
  1352. }
  1353. if (Number.isInteger(vFor)) {
  1354. context = value;
  1355. } else if (!propPath) {
  1356. context = vFor[value];
  1357. } else {
  1358. if (Array.isArray(vFor)) {
  1359. context = vFor.find(function (vForItem) {
  1360. return vm.__get_value(propPath, vForItem) === value;
  1361. });
  1362. } else if (isPlainObject(vFor)) {
  1363. context = Object.keys(vFor).find(function (vForKey) {
  1364. return vm.__get_value(propPath, vFor[vForKey]) === value;
  1365. });
  1366. } else {
  1367. console.error('v-for 暂不支持循环数据:', vFor);
  1368. }
  1369. }
  1370. if (valuePath) {
  1371. context = vm.__get_value(valuePath, context);
  1372. }
  1373. }
  1374. });
  1375. return context;
  1376. }
  1377. function processEventExtra(vm, extra, event) {
  1378. var extraObj = {};
  1379. if (Array.isArray(extra) && extra.length) {
  1380. /**
  1381. *[
  1382. * ['data.items', 'data.id', item.data.id],
  1383. * ['metas', 'id', meta.id]
  1384. *],
  1385. *[
  1386. * ['data.items', 'data.id', item.data.id],
  1387. * ['metas', 'id', meta.id]
  1388. *],
  1389. *'test'
  1390. */
  1391. extra.forEach(function (dataPath, index) {
  1392. if (typeof dataPath === 'string') {
  1393. if (!dataPath) {// model,prop.sync
  1394. extraObj['$' + index] = vm;
  1395. } else {
  1396. if (dataPath === '$event') {// $event
  1397. extraObj['$' + index] = event;
  1398. } else if (dataPath === 'arguments') {
  1399. if (event.detail && event.detail.__args__) {
  1400. extraObj['$' + index] = event.detail.__args__;
  1401. } else {
  1402. extraObj['$' + index] = [event];
  1403. }
  1404. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  1405. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  1406. } else {
  1407. extraObj['$' + index] = vm.__get_value(dataPath);
  1408. }
  1409. }
  1410. } else {
  1411. extraObj['$' + index] = getExtraValue(vm, dataPath);
  1412. }
  1413. });
  1414. }
  1415. return extraObj;
  1416. }
  1417. function getObjByArray(arr) {
  1418. var obj = {};
  1419. for (var i = 1; i < arr.length; i++) {
  1420. var element = arr[i];
  1421. obj[element[0]] = element[1];
  1422. }
  1423. return obj;
  1424. }
  1425. 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;
  1426. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1427. if (isCustom) {// 自定义事件
  1428. isCustomMPEvent = event.currentTarget &&
  1429. event.currentTarget.dataset &&
  1430. event.currentTarget.dataset.comType === 'wx';
  1431. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  1432. if (isCustomMPEvent) {
  1433. return [event];
  1434. }
  1435. return event.detail.__args__ || event.detail;
  1436. }
  1437. }
  1438. var extraObj = processEventExtra(vm, extra, event);
  1439. var ret = [];
  1440. args.forEach(function (arg) {
  1441. if (arg === '$event') {
  1442. if (methodName === '__set_model' && !isCustom) {// input v-model value
  1443. ret.push(event.target.value);
  1444. } else {
  1445. if (isCustom && !isCustomMPEvent) {
  1446. ret.push(event.detail.__args__[0]);
  1447. } else {// wxcomponent 组件或内置组件
  1448. ret.push(event);
  1449. }
  1450. }
  1451. } else {
  1452. if (Array.isArray(arg) && arg[0] === 'o') {
  1453. ret.push(getObjByArray(arg));
  1454. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1455. ret.push(extraObj[arg]);
  1456. } else {
  1457. ret.push(arg);
  1458. }
  1459. }
  1460. });
  1461. return ret;
  1462. }
  1463. var ONCE = '~';
  1464. var CUSTOM = '^';
  1465. function isMatchEventType(eventType, optType) {
  1466. return eventType === optType ||
  1467. optType === 'regionchange' && (
  1468. eventType === 'begin' ||
  1469. eventType === 'end');
  1470. }
  1471. function getContextVm(vm) {
  1472. var $parent = vm.$parent;
  1473. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1474. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1475. $parent = $parent.$parent;
  1476. }
  1477. return $parent && $parent.$parent;
  1478. }
  1479. function handleEvent(event) {var _this2 = this;
  1480. event = wrapper$1(event);
  1481. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1482. var dataset = (event.currentTarget || event.target).dataset;
  1483. if (!dataset) {
  1484. return console.warn('事件信息不存在');
  1485. }
  1486. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1487. if (!eventOpts) {
  1488. return console.warn('事件信息不存在');
  1489. }
  1490. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1491. var eventType = event.type;
  1492. var ret = [];
  1493. eventOpts.forEach(function (eventOpt) {
  1494. var type = eventOpt[0];
  1495. var eventsArray = eventOpt[1];
  1496. var isCustom = type.charAt(0) === CUSTOM;
  1497. type = isCustom ? type.slice(1) : type;
  1498. var isOnce = type.charAt(0) === ONCE;
  1499. type = isOnce ? type.slice(1) : type;
  1500. if (eventsArray && isMatchEventType(eventType, type)) {
  1501. eventsArray.forEach(function (eventArray) {
  1502. var methodName = eventArray[0];
  1503. if (methodName) {
  1504. var handlerCtx = _this2.$vm;
  1505. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1506. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1507. }
  1508. if (methodName === '$emit') {
  1509. handlerCtx.$emit.apply(handlerCtx,
  1510. processEventArgs(
  1511. _this2.$vm,
  1512. event,
  1513. eventArray[1],
  1514. eventArray[2],
  1515. isCustom,
  1516. methodName));
  1517. return;
  1518. }
  1519. var handler = handlerCtx[methodName];
  1520. if (!isFn(handler)) {
  1521. throw new Error(" _vm.".concat(methodName, " is not a function"));
  1522. }
  1523. if (isOnce) {
  1524. if (handler.once) {
  1525. return;
  1526. }
  1527. handler.once = true;
  1528. }
  1529. var params = processEventArgs(
  1530. _this2.$vm,
  1531. event,
  1532. eventArray[1],
  1533. eventArray[2],
  1534. isCustom,
  1535. methodName);
  1536. params = Array.isArray(params) ? params : [];
  1537. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1538. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1539. // eslint-disable-next-line no-sparse-arrays
  1540. params = params.concat([,,,,,,,,,, event]);
  1541. }
  1542. ret.push(handler.apply(handlerCtx, params));
  1543. }
  1544. });
  1545. }
  1546. });
  1547. if (
  1548. eventType === 'input' &&
  1549. ret.length === 1 &&
  1550. typeof ret[0] !== 'undefined')
  1551. {
  1552. return ret[0];
  1553. }
  1554. }
  1555. var eventChannels = {};
  1556. var eventChannelStack = [];
  1557. function getEventChannel(id) {
  1558. if (id) {
  1559. var eventChannel = eventChannels[id];
  1560. delete eventChannels[id];
  1561. return eventChannel;
  1562. }
  1563. return eventChannelStack.shift();
  1564. }
  1565. var hooks = [
  1566. 'onShow',
  1567. 'onHide',
  1568. 'onError',
  1569. 'onPageNotFound',
  1570. 'onThemeChange',
  1571. 'onUnhandledRejection'];
  1572. function initEventChannel() {
  1573. _vue.default.prototype.getOpenerEventChannel = function () {
  1574. // 微信小程序使用自身getOpenerEventChannel
  1575. {
  1576. return this.$scope.getOpenerEventChannel();
  1577. }
  1578. };
  1579. var callHook = _vue.default.prototype.__call_hook;
  1580. _vue.default.prototype.__call_hook = function (hook, args) {
  1581. if (hook === 'onLoad' && args && args.__id__) {
  1582. this.__eventChannel__ = getEventChannel(args.__id__);
  1583. delete args.__id__;
  1584. }
  1585. return callHook.call(this, hook, args);
  1586. };
  1587. }
  1588. function initScopedSlotsParams() {
  1589. var center = {};
  1590. var parents = {};
  1591. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1592. var has = center[vueId];
  1593. if (!has) {
  1594. parents[vueId] = this;
  1595. this.$on('hook:destroyed', function () {
  1596. delete parents[vueId];
  1597. });
  1598. }
  1599. return has;
  1600. };
  1601. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1602. var data = center[vueId];
  1603. if (data) {
  1604. var object = data[name] || {};
  1605. return key ? object[key] : object;
  1606. } else {
  1607. parents[vueId] = this;
  1608. this.$on('hook:destroyed', function () {
  1609. delete parents[vueId];
  1610. });
  1611. }
  1612. };
  1613. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1614. var vueIds = this.$options.propsData.vueId;
  1615. if (vueIds) {
  1616. var vueId = vueIds.split(',')[0];
  1617. var object = center[vueId] = center[vueId] || {};
  1618. object[name] = value;
  1619. if (parents[vueId]) {
  1620. parents[vueId].$forceUpdate();
  1621. }
  1622. }
  1623. };
  1624. _vue.default.mixin({
  1625. destroyed: function destroyed() {
  1626. var propsData = this.$options.propsData;
  1627. var vueId = propsData && propsData.vueId;
  1628. if (vueId) {
  1629. delete center[vueId];
  1630. delete parents[vueId];
  1631. }
  1632. } });
  1633. }
  1634. function parseBaseApp(vm, _ref3)
  1635. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1636. initEventChannel();
  1637. {
  1638. initScopedSlotsParams();
  1639. }
  1640. if (vm.$options.store) {
  1641. _vue.default.prototype.$store = vm.$options.store;
  1642. }
  1643. uniIdMixin(_vue.default);
  1644. _vue.default.prototype.mpHost = "mp-weixin";
  1645. _vue.default.mixin({
  1646. beforeCreate: function beforeCreate() {
  1647. if (!this.$options.mpType) {
  1648. return;
  1649. }
  1650. this.mpType = this.$options.mpType;
  1651. this.$mp = _defineProperty({
  1652. data: {} },
  1653. this.mpType, this.$options.mpInstance);
  1654. this.$scope = this.$options.mpInstance;
  1655. delete this.$options.mpType;
  1656. delete this.$options.mpInstance;
  1657. if (this.mpType === 'page' && typeof getApp === 'function') {// hack vue-i18n
  1658. var app = getApp();
  1659. if (app.$vm && app.$vm.$i18n) {
  1660. this._i18n = app.$vm.$i18n;
  1661. }
  1662. }
  1663. if (this.mpType !== 'app') {
  1664. initRefs(this);
  1665. initMocks(this, mocks);
  1666. }
  1667. } });
  1668. var appOptions = {
  1669. onLaunch: function onLaunch(args) {
  1670. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1671. return;
  1672. }
  1673. {
  1674. if (wx.canIUse && !wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1675. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1676. }
  1677. }
  1678. this.$vm = vm;
  1679. this.$vm.$mp = {
  1680. app: this };
  1681. this.$vm.$scope = this;
  1682. // vm 上也挂载 globalData
  1683. this.$vm.globalData = this.globalData;
  1684. this.$vm._isMounted = true;
  1685. this.$vm.__call_hook('mounted', args);
  1686. this.$vm.__call_hook('onLaunch', args);
  1687. } };
  1688. // 兼容旧版本 globalData
  1689. appOptions.globalData = vm.$options.globalData || {};
  1690. // 将 methods 中的方法挂在 getApp() 中
  1691. var methods = vm.$options.methods;
  1692. if (methods) {
  1693. Object.keys(methods).forEach(function (name) {
  1694. appOptions[name] = methods[name];
  1695. });
  1696. }
  1697. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  1698. initHooks(appOptions, hooks);
  1699. return appOptions;
  1700. }
  1701. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1702. function findVmByVueId(vm, vuePid) {
  1703. var $children = vm.$children;
  1704. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1705. for (var i = $children.length - 1; i >= 0; i--) {
  1706. var childVm = $children[i];
  1707. if (childVm.$scope._$vueId === vuePid) {
  1708. return childVm;
  1709. }
  1710. }
  1711. // 反向递归查找
  1712. var parentVm;
  1713. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1714. parentVm = findVmByVueId($children[_i], vuePid);
  1715. if (parentVm) {
  1716. return parentVm;
  1717. }
  1718. }
  1719. }
  1720. function initBehavior(options) {
  1721. return Behavior(options);
  1722. }
  1723. function isPage() {
  1724. return !!this.route;
  1725. }
  1726. function initRelation(detail) {
  1727. this.triggerEvent('__l', detail);
  1728. }
  1729. function selectAllComponents(mpInstance, selector, $refs) {
  1730. var components = mpInstance.selectAllComponents(selector);
  1731. components.forEach(function (component) {
  1732. var ref = component.dataset.ref;
  1733. $refs[ref] = component.$vm || component;
  1734. {
  1735. if (component.dataset.vueGeneric === 'scoped') {
  1736. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1737. selectAllComponents(scopedComponent, selector, $refs);
  1738. });
  1739. }
  1740. }
  1741. });
  1742. }
  1743. function initRefs(vm) {
  1744. var mpInstance = vm.$scope;
  1745. Object.defineProperty(vm, '$refs', {
  1746. get: function get() {
  1747. var $refs = {};
  1748. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1749. // TODO 暂不考虑 for 中的 scoped
  1750. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1751. forComponents.forEach(function (component) {
  1752. var ref = component.dataset.ref;
  1753. if (!$refs[ref]) {
  1754. $refs[ref] = [];
  1755. }
  1756. $refs[ref].push(component.$vm || component);
  1757. });
  1758. return $refs;
  1759. } });
  1760. }
  1761. function handleLink(event) {var _ref4 =
  1762. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1763. var parentVm;
  1764. if (vuePid) {
  1765. parentVm = findVmByVueId(this.$vm, vuePid);
  1766. }
  1767. if (!parentVm) {
  1768. parentVm = this.$vm;
  1769. }
  1770. vueOptions.parent = parentVm;
  1771. }
  1772. function parseApp(vm) {
  1773. return parseBaseApp(vm, {
  1774. mocks: mocks,
  1775. initRefs: initRefs });
  1776. }
  1777. function createApp(vm) {
  1778. App(parseApp(vm));
  1779. return vm;
  1780. }
  1781. var encodeReserveRE = /[!'()*]/g;
  1782. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  1783. var commaRE = /%2C/g;
  1784. // fixed encodeURIComponent which is more conformant to RFC3986:
  1785. // - escapes [!'()*]
  1786. // - preserve commas
  1787. var encode = function encode(str) {return encodeURIComponent(str).
  1788. replace(encodeReserveRE, encodeReserveReplacer).
  1789. replace(commaRE, ',');};
  1790. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  1791. var res = obj ? Object.keys(obj).map(function (key) {
  1792. var val = obj[key];
  1793. if (val === undefined) {
  1794. return '';
  1795. }
  1796. if (val === null) {
  1797. return encodeStr(key);
  1798. }
  1799. if (Array.isArray(val)) {
  1800. var result = [];
  1801. val.forEach(function (val2) {
  1802. if (val2 === undefined) {
  1803. return;
  1804. }
  1805. if (val2 === null) {
  1806. result.push(encodeStr(key));
  1807. } else {
  1808. result.push(encodeStr(key) + '=' + encodeStr(val2));
  1809. }
  1810. });
  1811. return result.join('&');
  1812. }
  1813. return encodeStr(key) + '=' + encodeStr(val);
  1814. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  1815. return res ? "?".concat(res) : '';
  1816. }
  1817. function parseBaseComponent(vueComponentOptions)
  1818. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1819. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1820. var options = _objectSpread({
  1821. multipleSlots: true,
  1822. addGlobalClass: true },
  1823. vueOptions.options || {});
  1824. {
  1825. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1826. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1827. Object.assign(options, vueOptions['mp-weixin'].options);
  1828. }
  1829. }
  1830. var componentOptions = {
  1831. options: options,
  1832. data: initData(vueOptions, _vue.default.prototype),
  1833. behaviors: initBehaviors(vueOptions, initBehavior),
  1834. properties: initProperties(vueOptions.props, false, vueOptions.__file),
  1835. lifetimes: {
  1836. attached: function attached() {
  1837. var properties = this.properties;
  1838. var options = {
  1839. mpType: isPage.call(this) ? 'page' : 'component',
  1840. mpInstance: this,
  1841. propsData: properties };
  1842. initVueIds(properties.vueId, this);
  1843. // 处理父子关系
  1844. initRelation.call(this, {
  1845. vuePid: this._$vuePid,
  1846. vueOptions: options });
  1847. // 初始化 vue 实例
  1848. this.$vm = new VueComponent(options);
  1849. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1850. initSlots(this.$vm, properties.vueSlots);
  1851. // 触发首次 setData
  1852. this.$vm.$mount();
  1853. },
  1854. ready: function ready() {
  1855. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1856. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1857. if (this.$vm) {
  1858. this.$vm._isMounted = true;
  1859. this.$vm.__call_hook('mounted');
  1860. this.$vm.__call_hook('onReady');
  1861. }
  1862. },
  1863. detached: function detached() {
  1864. this.$vm && this.$vm.$destroy();
  1865. } },
  1866. pageLifetimes: {
  1867. show: function show(args) {
  1868. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1869. },
  1870. hide: function hide() {
  1871. this.$vm && this.$vm.__call_hook('onPageHide');
  1872. },
  1873. resize: function resize(size) {
  1874. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1875. } },
  1876. methods: {
  1877. __l: handleLink,
  1878. __e: handleEvent } };
  1879. // externalClasses
  1880. if (vueOptions.externalClasses) {
  1881. componentOptions.externalClasses = vueOptions.externalClasses;
  1882. }
  1883. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1884. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1885. componentOptions.methods[callMethod] = function (args) {
  1886. return this.$vm[callMethod](args);
  1887. };
  1888. });
  1889. }
  1890. if (isPage) {
  1891. return componentOptions;
  1892. }
  1893. return [componentOptions, VueComponent];
  1894. }
  1895. function parseComponent(vueComponentOptions) {
  1896. return parseBaseComponent(vueComponentOptions, {
  1897. isPage: isPage,
  1898. initRelation: initRelation });
  1899. }
  1900. var hooks$1 = [
  1901. 'onShow',
  1902. 'onHide',
  1903. 'onUnload'];
  1904. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1905. function parseBasePage(vuePageOptions, _ref6)
  1906. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1907. var pageOptions = parseComponent(vuePageOptions);
  1908. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1909. pageOptions.methods.onLoad = function (query) {
  1910. this.options = query;
  1911. var copyQuery = Object.assign({}, query);
  1912. delete copyQuery.__id__;
  1913. this.$page = {
  1914. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery) };
  1915. this.$vm.$mp.query = query; // 兼容 mpvue
  1916. this.$vm.__call_hook('onLoad', query);
  1917. };
  1918. return pageOptions;
  1919. }
  1920. function parsePage(vuePageOptions) {
  1921. return parseBasePage(vuePageOptions, {
  1922. isPage: isPage,
  1923. initRelation: initRelation });
  1924. }
  1925. function createPage(vuePageOptions) {
  1926. {
  1927. return Component(parsePage(vuePageOptions));
  1928. }
  1929. }
  1930. function createComponent(vueOptions) {
  1931. {
  1932. return Component(parseComponent(vueOptions));
  1933. }
  1934. }
  1935. function createSubpackageApp(vm) {
  1936. var appOptions = parseApp(vm);
  1937. var app = getApp({
  1938. allowDefault: true });
  1939. vm.$scope = app;
  1940. var globalData = app.globalData;
  1941. if (globalData) {
  1942. Object.keys(appOptions.globalData).forEach(function (name) {
  1943. if (!hasOwn(globalData, name)) {
  1944. globalData[name] = appOptions.globalData[name];
  1945. }
  1946. });
  1947. }
  1948. Object.keys(appOptions).forEach(function (name) {
  1949. if (!hasOwn(app, name)) {
  1950. app[name] = appOptions[name];
  1951. }
  1952. });
  1953. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1954. wx.onAppShow(function () {for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  1955. vm.__call_hook('onShow', args);
  1956. });
  1957. }
  1958. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1959. wx.onAppHide(function () {for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {args[_key6] = arguments[_key6];}
  1960. vm.__call_hook('onHide', args);
  1961. });
  1962. }
  1963. if (isFn(appOptions.onLaunch)) {
  1964. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1965. vm.__call_hook('onLaunch', args);
  1966. }
  1967. return vm;
  1968. }
  1969. function createPlugin(vm) {
  1970. var appOptions = parseApp(vm);
  1971. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1972. wx.onAppShow(function () {for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {args[_key7] = arguments[_key7];}
  1973. vm.__call_hook('onShow', args);
  1974. });
  1975. }
  1976. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1977. wx.onAppHide(function () {for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {args[_key8] = arguments[_key8];}
  1978. vm.__call_hook('onHide', args);
  1979. });
  1980. }
  1981. if (isFn(appOptions.onLaunch)) {
  1982. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1983. vm.__call_hook('onLaunch', args);
  1984. }
  1985. return vm;
  1986. }
  1987. todos.forEach(function (todoApi) {
  1988. protocols[todoApi] = false;
  1989. });
  1990. canIUses.forEach(function (canIUseApi) {
  1991. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  1992. canIUseApi;
  1993. if (!wx.canIUse(apiName)) {
  1994. protocols[canIUseApi] = false;
  1995. }
  1996. });
  1997. var uni = {};
  1998. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  1999. uni = new Proxy({}, {
  2000. get: function get(target, name) {
  2001. if (hasOwn(target, name)) {
  2002. return target[name];
  2003. }
  2004. if (baseApi[name]) {
  2005. return baseApi[name];
  2006. }
  2007. if (api[name]) {
  2008. return promisify(name, api[name]);
  2009. }
  2010. {
  2011. if (extraApi[name]) {
  2012. return promisify(name, extraApi[name]);
  2013. }
  2014. if (todoApis[name]) {
  2015. return promisify(name, todoApis[name]);
  2016. }
  2017. }
  2018. if (eventApi[name]) {
  2019. return eventApi[name];
  2020. }
  2021. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  2022. return;
  2023. }
  2024. return promisify(name, wrapper(name, wx[name]));
  2025. },
  2026. set: function set(target, name, value) {
  2027. target[name] = value;
  2028. return true;
  2029. } });
  2030. } else {
  2031. Object.keys(baseApi).forEach(function (name) {
  2032. uni[name] = baseApi[name];
  2033. });
  2034. {
  2035. Object.keys(todoApis).forEach(function (name) {
  2036. uni[name] = promisify(name, todoApis[name]);
  2037. });
  2038. Object.keys(extraApi).forEach(function (name) {
  2039. uni[name] = promisify(name, todoApis[name]);
  2040. });
  2041. }
  2042. Object.keys(eventApi).forEach(function (name) {
  2043. uni[name] = eventApi[name];
  2044. });
  2045. Object.keys(api).forEach(function (name) {
  2046. uni[name] = promisify(name, api[name]);
  2047. });
  2048. Object.keys(wx).forEach(function (name) {
  2049. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  2050. uni[name] = promisify(name, wrapper(name, wx[name]));
  2051. }
  2052. });
  2053. }
  2054. wx.createApp = createApp;
  2055. wx.createPage = createPage;
  2056. wx.createComponent = createComponent;
  2057. wx.createSubpackageApp = createSubpackageApp;
  2058. wx.createPlugin = createPlugin;
  2059. var uni$1 = uni;var _default =
  2060. uni$1;exports.default = _default;
  2061. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  2062. /***/ }),
  2063. /* 2 */
  2064. /*!***********************************!*\
  2065. !*** (webpack)/buildin/global.js ***!
  2066. \***********************************/
  2067. /*! no static exports found */
  2068. /***/ (function(module, exports) {
  2069. var g;
  2070. // This works in non-strict mode
  2071. g = (function() {
  2072. return this;
  2073. })();
  2074. try {
  2075. // This works if eval is allowed (see CSP)
  2076. g = g || new Function("return this")();
  2077. } catch (e) {
  2078. // This works if the window reference is available
  2079. if (typeof window === "object") g = window;
  2080. }
  2081. // g can still be undefined, but nothing to do about it...
  2082. // We return undefined, instead of nothing here, so it's
  2083. // easier to handle this case. if(!global) { ...}
  2084. module.exports = g;
  2085. /***/ }),
  2086. /* 3 */
  2087. /*!*************************************************************!*\
  2088. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  2089. \*************************************************************/
  2090. /*! no static exports found */
  2091. /***/ (function(module, exports, __webpack_require__) {
  2092. "use strict";
  2093. /* 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;
  2094. var isObject = function isObject(val) {return val !== null && typeof val === 'object';};
  2095. var defaultDelimiters = ['{', '}'];var
  2096. BaseFormatter = /*#__PURE__*/function () {
  2097. function BaseFormatter() {_classCallCheck(this, BaseFormatter);
  2098. this._caches = Object.create(null);
  2099. }_createClass(BaseFormatter, [{ key: "interpolate", value: function interpolate(
  2100. message, values) {var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  2101. if (!values) {
  2102. return [message];
  2103. }
  2104. var tokens = this._caches[message];
  2105. if (!tokens) {
  2106. tokens = parse(message, delimiters);
  2107. this._caches[message] = tokens;
  2108. }
  2109. return compile(tokens, values);
  2110. } }]);return BaseFormatter;}();exports.Formatter = BaseFormatter;
  2111. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  2112. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  2113. function parse(format, _ref) {var _ref2 = _slicedToArray(_ref, 2),startDelimiter = _ref2[0],endDelimiter = _ref2[1];
  2114. var tokens = [];
  2115. var position = 0;
  2116. var text = '';
  2117. while (position < format.length) {
  2118. var char = format[position++];
  2119. if (char === startDelimiter) {
  2120. if (text) {
  2121. tokens.push({ type: 'text', value: text });
  2122. }
  2123. text = '';
  2124. var sub = '';
  2125. char = format[position++];
  2126. while (char !== undefined && char !== endDelimiter) {
  2127. sub += char;
  2128. char = format[position++];
  2129. }
  2130. var isClosed = char === endDelimiter;
  2131. var type = RE_TOKEN_LIST_VALUE.test(sub) ?
  2132. 'list' :
  2133. isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ?
  2134. 'named' :
  2135. 'unknown';
  2136. tokens.push({ value: sub, type: type });
  2137. }
  2138. // else if (char === '%') {
  2139. // // when found rails i18n syntax, skip text capture
  2140. // if (format[position] !== '{') {
  2141. // text += char
  2142. // }
  2143. // }
  2144. else {
  2145. text += char;
  2146. }
  2147. }
  2148. text && tokens.push({ type: 'text', value: text });
  2149. return tokens;
  2150. }
  2151. function compile(tokens, values) {
  2152. var compiled = [];
  2153. var index = 0;
  2154. var mode = isArray(values) ?
  2155. 'list' :
  2156. isObject(values) ?
  2157. 'named' :
  2158. 'unknown';
  2159. if (mode === 'unknown') {
  2160. return compiled;
  2161. }
  2162. while (index < tokens.length) {
  2163. var token = tokens[index];
  2164. switch (token.type) {
  2165. case 'text':
  2166. compiled.push(token.value);
  2167. break;
  2168. case 'list':
  2169. compiled.push(values[parseInt(token.value, 10)]);
  2170. break;
  2171. case 'named':
  2172. if (mode === 'named') {
  2173. compiled.push(values[token.value]);
  2174. } else
  2175. {
  2176. if (true) {
  2177. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  2178. }
  2179. }
  2180. break;
  2181. case 'unknown':
  2182. if (true) {
  2183. console.warn("Detect 'unknown' type of token!");
  2184. }
  2185. break;}
  2186. index++;
  2187. }
  2188. return compiled;
  2189. }
  2190. var LOCALE_ZH_HANS = 'zh-Hans';exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  2191. var LOCALE_ZH_HANT = 'zh-Hant';exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  2192. var LOCALE_EN = 'en';exports.LOCALE_EN = LOCALE_EN;
  2193. var LOCALE_FR = 'fr';exports.LOCALE_FR = LOCALE_FR;
  2194. var LOCALE_ES = 'es';exports.LOCALE_ES = LOCALE_ES;
  2195. var hasOwnProperty = Object.prototype.hasOwnProperty;
  2196. var hasOwn = function hasOwn(val, key) {return hasOwnProperty.call(val, key);};
  2197. var defaultFormatter = new BaseFormatter();
  2198. function include(str, parts) {
  2199. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  2200. }
  2201. function startsWith(str, parts) {
  2202. return parts.find(function (part) {return str.indexOf(part) === 0;});
  2203. }
  2204. function normalizeLocale(locale, messages) {
  2205. if (!locale) {
  2206. return;
  2207. }
  2208. locale = locale.trim().replace(/_/g, '-');
  2209. if (messages && messages[locale]) {
  2210. return locale;
  2211. }
  2212. locale = locale.toLowerCase();
  2213. if (locale.indexOf('zh') === 0) {
  2214. if (locale.indexOf('-hans') > -1) {
  2215. return LOCALE_ZH_HANS;
  2216. }
  2217. if (locale.indexOf('-hant') > -1) {
  2218. return LOCALE_ZH_HANT;
  2219. }
  2220. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  2221. return LOCALE_ZH_HANT;
  2222. }
  2223. return LOCALE_ZH_HANS;
  2224. }
  2225. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  2226. if (lang) {
  2227. return lang;
  2228. }
  2229. }var
  2230. I18n = /*#__PURE__*/function () {
  2231. function I18n(_ref3) {var locale = _ref3.locale,fallbackLocale = _ref3.fallbackLocale,messages = _ref3.messages,watcher = _ref3.watcher,formater = _ref3.formater;_classCallCheck(this, I18n);
  2232. this.locale = LOCALE_EN;
  2233. this.fallbackLocale = LOCALE_EN;
  2234. this.message = {};
  2235. this.messages = {};
  2236. this.watchers = [];
  2237. if (fallbackLocale) {
  2238. this.fallbackLocale = fallbackLocale;
  2239. }
  2240. this.formater = formater || defaultFormatter;
  2241. this.messages = messages || {};
  2242. this.setLocale(locale || LOCALE_EN);
  2243. if (watcher) {
  2244. this.watchLocale(watcher);
  2245. }
  2246. }_createClass(I18n, [{ key: "setLocale", value: function setLocale(
  2247. locale) {var _this = this;
  2248. var oldLocale = this.locale;
  2249. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  2250. if (!this.messages[this.locale]) {
  2251. // 可能初始化时不存在
  2252. this.messages[this.locale] = {};
  2253. }
  2254. this.message = this.messages[this.locale];
  2255. // 仅发生变化时,通知
  2256. if (oldLocale !== this.locale) {
  2257. this.watchers.forEach(function (watcher) {
  2258. watcher(_this.locale, oldLocale);
  2259. });
  2260. }
  2261. } }, { key: "getLocale", value: function getLocale()
  2262. {
  2263. return this.locale;
  2264. } }, { key: "watchLocale", value: function watchLocale(
  2265. fn) {var _this2 = this;
  2266. var index = this.watchers.push(fn) - 1;
  2267. return function () {
  2268. _this2.watchers.splice(index, 1);
  2269. };
  2270. } }, { key: "add", value: function add(
  2271. locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  2272. var curMessages = this.messages[locale];
  2273. if (curMessages) {
  2274. if (override) {
  2275. Object.assign(curMessages, message);
  2276. } else
  2277. {
  2278. Object.keys(message).forEach(function (key) {
  2279. if (!hasOwn(curMessages, key)) {
  2280. curMessages[key] = message[key];
  2281. }
  2282. });
  2283. }
  2284. } else
  2285. {
  2286. this.messages[locale] = message;
  2287. }
  2288. } }, { key: "f", value: function f(
  2289. message, values, delimiters) {
  2290. return this.formater.interpolate(message, values, delimiters).join('');
  2291. } }, { key: "t", value: function t(
  2292. key, locale, values) {
  2293. var message = this.message;
  2294. if (typeof locale === 'string') {
  2295. locale = normalizeLocale(locale, this.messages);
  2296. locale && (message = this.messages[locale]);
  2297. } else
  2298. {
  2299. values = locale;
  2300. }
  2301. if (!hasOwn(message, key)) {
  2302. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  2303. return key;
  2304. }
  2305. return this.formater.interpolate(message[key], values).join('');
  2306. } }]);return I18n;}();exports.I18n = I18n;
  2307. function watchAppLocale(appVm, i18n) {
  2308. // 需要保证 watch 的触发在组件渲染之前
  2309. if (appVm.$watchLocale) {
  2310. // vue2
  2311. appVm.$watchLocale(function (newLocale) {
  2312. i18n.setLocale(newLocale);
  2313. });
  2314. } else
  2315. {
  2316. appVm.$watch(function () {return appVm.$locale;}, function (newLocale) {
  2317. i18n.setLocale(newLocale);
  2318. });
  2319. }
  2320. }
  2321. function getDefaultLocale() {
  2322. if (typeof uni !== 'undefined' && uni.getLocale) {
  2323. return uni.getLocale();
  2324. }
  2325. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  2326. if (typeof global !== 'undefined' && global.getLocale) {
  2327. return global.getLocale();
  2328. }
  2329. return LOCALE_EN;
  2330. }
  2331. 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;
  2332. // 兼容旧版本入参
  2333. if (typeof locale !== 'string') {var _ref4 =
  2334. [
  2335. messages,
  2336. locale];locale = _ref4[0];messages = _ref4[1];
  2337. }
  2338. if (typeof locale !== 'string') {
  2339. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  2340. locale = getDefaultLocale();
  2341. }
  2342. if (typeof fallbackLocale !== 'string') {
  2343. fallbackLocale =
  2344. typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale ||
  2345. LOCALE_EN;
  2346. }
  2347. var i18n = new I18n({
  2348. locale: locale,
  2349. fallbackLocale: fallbackLocale,
  2350. messages: messages,
  2351. watcher: watcher });
  2352. var _t = function t(key, values) {
  2353. if (typeof getApp !== 'function') {
  2354. // app view
  2355. /* eslint-disable no-func-assign */
  2356. _t = function t(key, values) {
  2357. return i18n.t(key, values);
  2358. };
  2359. } else
  2360. {
  2361. var isWatchedAppLocale = false;
  2362. _t = function t(key, values) {
  2363. var appVm = getApp().$vm;
  2364. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  2365. // options: {
  2366. // type: Array,
  2367. // default () {
  2368. // return [{
  2369. // icon: 'shop',
  2370. // text: t("uni-goods-nav.options.shop"),
  2371. // }, {
  2372. // icon: 'cart',
  2373. // text: t("uni-goods-nav.options.cart")
  2374. // }]
  2375. // }
  2376. // },
  2377. if (appVm) {
  2378. // 触发响应式
  2379. appVm.$locale;
  2380. if (!isWatchedAppLocale) {
  2381. isWatchedAppLocale = true;
  2382. watchAppLocale(appVm, i18n);
  2383. }
  2384. }
  2385. return i18n.t(key, values);
  2386. };
  2387. }
  2388. return _t(key, values);
  2389. };
  2390. return {
  2391. i18n: i18n,
  2392. f: function f(message, values, delimiters) {
  2393. return i18n.f(message, values, delimiters);
  2394. },
  2395. t: function t(key, values) {
  2396. return _t(key, values);
  2397. },
  2398. add: function add(locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  2399. return i18n.add(locale, message, override);
  2400. },
  2401. watch: function watch(fn) {
  2402. return i18n.watchLocale(fn);
  2403. },
  2404. getLocale: function getLocale() {
  2405. return i18n.getLocale();
  2406. },
  2407. setLocale: function setLocale(newLocale) {
  2408. return i18n.setLocale(newLocale);
  2409. } };
  2410. }
  2411. var isString = function isString(val) {return typeof val === 'string';};exports.isString = isString;
  2412. var formater;
  2413. function hasI18nJson(jsonObj, delimiters) {
  2414. if (!formater) {
  2415. formater = new BaseFormatter();
  2416. }
  2417. return walkJsonObj(jsonObj, function (jsonObj, key) {
  2418. var value = jsonObj[key];
  2419. if (isString(value)) {
  2420. if (isI18nStr(value, delimiters)) {
  2421. return true;
  2422. }
  2423. } else
  2424. {
  2425. return hasI18nJson(value, delimiters);
  2426. }
  2427. });
  2428. }
  2429. function parseI18nJson(jsonObj, values, delimiters) {
  2430. if (!formater) {
  2431. formater = new BaseFormatter();
  2432. }
  2433. walkJsonObj(jsonObj, function (jsonObj, key) {
  2434. var value = jsonObj[key];
  2435. if (isString(value)) {
  2436. if (isI18nStr(value, delimiters)) {
  2437. jsonObj[key] = compileStr(value, values, delimiters);
  2438. }
  2439. } else
  2440. {
  2441. parseI18nJson(value, values, delimiters);
  2442. }
  2443. });
  2444. return jsonObj;
  2445. }
  2446. function compileI18nJsonStr(jsonStr, _ref5) {var locale = _ref5.locale,locales = _ref5.locales,delimiters = _ref5.delimiters;
  2447. if (!isI18nStr(jsonStr, delimiters)) {
  2448. return jsonStr;
  2449. }
  2450. if (!formater) {
  2451. formater = new BaseFormatter();
  2452. }
  2453. var localeValues = [];
  2454. Object.keys(locales).forEach(function (name) {
  2455. if (name !== locale) {
  2456. localeValues.push({
  2457. locale: name,
  2458. values: locales[name] });
  2459. }
  2460. });
  2461. localeValues.unshift({ locale: locale, values: locales[locale] });
  2462. try {
  2463. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  2464. }
  2465. catch (e) {}
  2466. return jsonStr;
  2467. }
  2468. function isI18nStr(value, delimiters) {
  2469. return value.indexOf(delimiters[0]) > -1;
  2470. }
  2471. function compileStr(value, values, delimiters) {
  2472. return formater.interpolate(value, values, delimiters).join('');
  2473. }
  2474. function compileValue(jsonObj, key, localeValues, delimiters) {
  2475. var value = jsonObj[key];
  2476. if (isString(value)) {
  2477. // 存在国际化
  2478. if (isI18nStr(value, delimiters)) {
  2479. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  2480. if (localeValues.length > 1) {
  2481. // 格式化国际化语言
  2482. var valueLocales = jsonObj[key + 'Locales'] = {};
  2483. localeValues.forEach(function (localValue) {
  2484. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  2485. });
  2486. }
  2487. }
  2488. } else
  2489. {
  2490. compileJsonObj(value, localeValues, delimiters);
  2491. }
  2492. }
  2493. function compileJsonObj(jsonObj, localeValues, delimiters) {
  2494. walkJsonObj(jsonObj, function (jsonObj, key) {
  2495. compileValue(jsonObj, key, localeValues, delimiters);
  2496. });
  2497. return jsonObj;
  2498. }
  2499. function walkJsonObj(jsonObj, walk) {
  2500. if (isArray(jsonObj)) {
  2501. for (var i = 0; i < jsonObj.length; i++) {
  2502. if (walk(jsonObj, i)) {
  2503. return true;
  2504. }
  2505. }
  2506. } else
  2507. if (isObject(jsonObj)) {
  2508. for (var key in jsonObj) {
  2509. if (walk(jsonObj, key)) {
  2510. return true;
  2511. }
  2512. }
  2513. }
  2514. return false;
  2515. }
  2516. function resolveLocale(locales) {
  2517. return function (locale) {
  2518. if (!locale) {
  2519. return locale;
  2520. }
  2521. locale = normalizeLocale(locale) || locale;
  2522. return resolveLocaleChain(locale).find(function (locale) {return locales.indexOf(locale) > -1;});
  2523. };
  2524. }
  2525. function resolveLocaleChain(locale) {
  2526. var chain = [];
  2527. var tokens = locale.split('-');
  2528. while (tokens.length) {
  2529. chain.push(tokens.join('-'));
  2530. tokens.pop();
  2531. }
  2532. return chain;
  2533. }
  2534. /* 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)))
  2535. /***/ }),
  2536. /* 4 */
  2537. /*!******************************************************************************************!*\
  2538. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  2539. \******************************************************************************************/
  2540. /*! exports provided: default */
  2541. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2542. "use strict";
  2543. __webpack_require__.r(__webpack_exports__);
  2544. /* WEBPACK VAR INJECTION */(function(global) {/*!
  2545. * Vue.js v2.6.11
  2546. * (c) 2014-2022 Evan You
  2547. * Released under the MIT License.
  2548. */
  2549. /* */
  2550. var emptyObject = Object.freeze({});
  2551. // These helpers produce better VM code in JS engines due to their
  2552. // explicitness and function inlining.
  2553. function isUndef (v) {
  2554. return v === undefined || v === null
  2555. }
  2556. function isDef (v) {
  2557. return v !== undefined && v !== null
  2558. }
  2559. function isTrue (v) {
  2560. return v === true
  2561. }
  2562. function isFalse (v) {
  2563. return v === false
  2564. }
  2565. /**
  2566. * Check if value is primitive.
  2567. */
  2568. function isPrimitive (value) {
  2569. return (
  2570. typeof value === 'string' ||
  2571. typeof value === 'number' ||
  2572. // $flow-disable-line
  2573. typeof value === 'symbol' ||
  2574. typeof value === 'boolean'
  2575. )
  2576. }
  2577. /**
  2578. * Quick object check - this is primarily used to tell
  2579. * Objects from primitive values when we know the value
  2580. * is a JSON-compliant type.
  2581. */
  2582. function isObject (obj) {
  2583. return obj !== null && typeof obj === 'object'
  2584. }
  2585. /**
  2586. * Get the raw type string of a value, e.g., [object Object].
  2587. */
  2588. var _toString = Object.prototype.toString;
  2589. function toRawType (value) {
  2590. return _toString.call(value).slice(8, -1)
  2591. }
  2592. /**
  2593. * Strict object type check. Only returns true
  2594. * for plain JavaScript objects.
  2595. */
  2596. function isPlainObject (obj) {
  2597. return _toString.call(obj) === '[object Object]'
  2598. }
  2599. function isRegExp (v) {
  2600. return _toString.call(v) === '[object RegExp]'
  2601. }
  2602. /**
  2603. * Check if val is a valid array index.
  2604. */
  2605. function isValidArrayIndex (val) {
  2606. var n = parseFloat(String(val));
  2607. return n >= 0 && Math.floor(n) === n && isFinite(val)
  2608. }
  2609. function isPromise (val) {
  2610. return (
  2611. isDef(val) &&
  2612. typeof val.then === 'function' &&
  2613. typeof val.catch === 'function'
  2614. )
  2615. }
  2616. /**
  2617. * Convert a value to a string that is actually rendered.
  2618. */
  2619. function toString (val) {
  2620. return val == null
  2621. ? ''
  2622. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  2623. ? JSON.stringify(val, null, 2)
  2624. : String(val)
  2625. }
  2626. /**
  2627. * Convert an input value to a number for persistence.
  2628. * If the conversion fails, return original string.
  2629. */
  2630. function toNumber (val) {
  2631. var n = parseFloat(val);
  2632. return isNaN(n) ? val : n
  2633. }
  2634. /**
  2635. * Make a map and return a function for checking if a key
  2636. * is in that map.
  2637. */
  2638. function makeMap (
  2639. str,
  2640. expectsLowerCase
  2641. ) {
  2642. var map = Object.create(null);
  2643. var list = str.split(',');
  2644. for (var i = 0; i < list.length; i++) {
  2645. map[list[i]] = true;
  2646. }
  2647. return expectsLowerCase
  2648. ? function (val) { return map[val.toLowerCase()]; }
  2649. : function (val) { return map[val]; }
  2650. }
  2651. /**
  2652. * Check if a tag is a built-in tag.
  2653. */
  2654. var isBuiltInTag = makeMap('slot,component', true);
  2655. /**
  2656. * Check if an attribute is a reserved attribute.
  2657. */
  2658. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  2659. /**
  2660. * Remove an item from an array.
  2661. */
  2662. function remove (arr, item) {
  2663. if (arr.length) {
  2664. var index = arr.indexOf(item);
  2665. if (index > -1) {
  2666. return arr.splice(index, 1)
  2667. }
  2668. }
  2669. }
  2670. /**
  2671. * Check whether an object has the property.
  2672. */
  2673. var hasOwnProperty = Object.prototype.hasOwnProperty;
  2674. function hasOwn (obj, key) {
  2675. return hasOwnProperty.call(obj, key)
  2676. }
  2677. /**
  2678. * Create a cached version of a pure function.
  2679. */
  2680. function cached (fn) {
  2681. var cache = Object.create(null);
  2682. return (function cachedFn (str) {
  2683. var hit = cache[str];
  2684. return hit || (cache[str] = fn(str))
  2685. })
  2686. }
  2687. /**
  2688. * Camelize a hyphen-delimited string.
  2689. */
  2690. var camelizeRE = /-(\w)/g;
  2691. var camelize = cached(function (str) {
  2692. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  2693. });
  2694. /**
  2695. * Capitalize a string.
  2696. */
  2697. var capitalize = cached(function (str) {
  2698. return str.charAt(0).toUpperCase() + str.slice(1)
  2699. });
  2700. /**
  2701. * Hyphenate a camelCase string.
  2702. */
  2703. var hyphenateRE = /\B([A-Z])/g;
  2704. var hyphenate = cached(function (str) {
  2705. return str.replace(hyphenateRE, '-$1').toLowerCase()
  2706. });
  2707. /**
  2708. * Simple bind polyfill for environments that do not support it,
  2709. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  2710. * since native bind is now performant enough in most browsers.
  2711. * But removing it would mean breaking code that was able to run in
  2712. * PhantomJS 1.x, so this must be kept for backward compatibility.
  2713. */
  2714. /* istanbul ignore next */
  2715. function polyfillBind (fn, ctx) {
  2716. function boundFn (a) {
  2717. var l = arguments.length;
  2718. return l
  2719. ? l > 1
  2720. ? fn.apply(ctx, arguments)
  2721. : fn.call(ctx, a)
  2722. : fn.call(ctx)
  2723. }
  2724. boundFn._length = fn.length;
  2725. return boundFn
  2726. }
  2727. function nativeBind (fn, ctx) {
  2728. return fn.bind(ctx)
  2729. }
  2730. var bind = Function.prototype.bind
  2731. ? nativeBind
  2732. : polyfillBind;
  2733. /**
  2734. * Convert an Array-like object to a real Array.
  2735. */
  2736. function toArray (list, start) {
  2737. start = start || 0;
  2738. var i = list.length - start;
  2739. var ret = new Array(i);
  2740. while (i--) {
  2741. ret[i] = list[i + start];
  2742. }
  2743. return ret
  2744. }
  2745. /**
  2746. * Mix properties into target object.
  2747. */
  2748. function extend (to, _from) {
  2749. for (var key in _from) {
  2750. to[key] = _from[key];
  2751. }
  2752. return to
  2753. }
  2754. /**
  2755. * Merge an Array of Objects into a single Object.
  2756. */
  2757. function toObject (arr) {
  2758. var res = {};
  2759. for (var i = 0; i < arr.length; i++) {
  2760. if (arr[i]) {
  2761. extend(res, arr[i]);
  2762. }
  2763. }
  2764. return res
  2765. }
  2766. /* eslint-disable no-unused-vars */
  2767. /**
  2768. * Perform no operation.
  2769. * Stubbing args to make Flow happy without leaving useless transpiled code
  2770. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  2771. */
  2772. function noop (a, b, c) {}
  2773. /**
  2774. * Always return false.
  2775. */
  2776. var no = function (a, b, c) { return false; };
  2777. /* eslint-enable no-unused-vars */
  2778. /**
  2779. * Return the same value.
  2780. */
  2781. var identity = function (_) { return _; };
  2782. /**
  2783. * Check if two values are loosely equal - that is,
  2784. * if they are plain objects, do they have the same shape?
  2785. */
  2786. function looseEqual (a, b) {
  2787. if (a === b) { return true }
  2788. var isObjectA = isObject(a);
  2789. var isObjectB = isObject(b);
  2790. if (isObjectA && isObjectB) {
  2791. try {
  2792. var isArrayA = Array.isArray(a);
  2793. var isArrayB = Array.isArray(b);
  2794. if (isArrayA && isArrayB) {
  2795. return a.length === b.length && a.every(function (e, i) {
  2796. return looseEqual(e, b[i])
  2797. })
  2798. } else if (a instanceof Date && b instanceof Date) {
  2799. return a.getTime() === b.getTime()
  2800. } else if (!isArrayA && !isArrayB) {
  2801. var keysA = Object.keys(a);
  2802. var keysB = Object.keys(b);
  2803. return keysA.length === keysB.length && keysA.every(function (key) {
  2804. return looseEqual(a[key], b[key])
  2805. })
  2806. } else {
  2807. /* istanbul ignore next */
  2808. return false
  2809. }
  2810. } catch (e) {
  2811. /* istanbul ignore next */
  2812. return false
  2813. }
  2814. } else if (!isObjectA && !isObjectB) {
  2815. return String(a) === String(b)
  2816. } else {
  2817. return false
  2818. }
  2819. }
  2820. /**
  2821. * Return the first index at which a loosely equal value can be
  2822. * found in the array (if value is a plain object, the array must
  2823. * contain an object of the same shape), or -1 if it is not present.
  2824. */
  2825. function looseIndexOf (arr, val) {
  2826. for (var i = 0; i < arr.length; i++) {
  2827. if (looseEqual(arr[i], val)) { return i }
  2828. }
  2829. return -1
  2830. }
  2831. /**
  2832. * Ensure a function is called only once.
  2833. */
  2834. function once (fn) {
  2835. var called = false;
  2836. return function () {
  2837. if (!called) {
  2838. called = true;
  2839. fn.apply(this, arguments);
  2840. }
  2841. }
  2842. }
  2843. var ASSET_TYPES = [
  2844. 'component',
  2845. 'directive',
  2846. 'filter'
  2847. ];
  2848. var LIFECYCLE_HOOKS = [
  2849. 'beforeCreate',
  2850. 'created',
  2851. 'beforeMount',
  2852. 'mounted',
  2853. 'beforeUpdate',
  2854. 'updated',
  2855. 'beforeDestroy',
  2856. 'destroyed',
  2857. 'activated',
  2858. 'deactivated',
  2859. 'errorCaptured',
  2860. 'serverPrefetch'
  2861. ];
  2862. /* */
  2863. var config = ({
  2864. /**
  2865. * Option merge strategies (used in core/util/options)
  2866. */
  2867. // $flow-disable-line
  2868. optionMergeStrategies: Object.create(null),
  2869. /**
  2870. * Whether to suppress warnings.
  2871. */
  2872. silent: false,
  2873. /**
  2874. * Show production mode tip message on boot?
  2875. */
  2876. productionTip: "development" !== 'production',
  2877. /**
  2878. * Whether to enable devtools
  2879. */
  2880. devtools: "development" !== 'production',
  2881. /**
  2882. * Whether to record perf
  2883. */
  2884. performance: false,
  2885. /**
  2886. * Error handler for watcher errors
  2887. */
  2888. errorHandler: null,
  2889. /**
  2890. * Warn handler for watcher warns
  2891. */
  2892. warnHandler: null,
  2893. /**
  2894. * Ignore certain custom elements
  2895. */
  2896. ignoredElements: [],
  2897. /**
  2898. * Custom user key aliases for v-on
  2899. */
  2900. // $flow-disable-line
  2901. keyCodes: Object.create(null),
  2902. /**
  2903. * Check if a tag is reserved so that it cannot be registered as a
  2904. * component. This is platform-dependent and may be overwritten.
  2905. */
  2906. isReservedTag: no,
  2907. /**
  2908. * Check if an attribute is reserved so that it cannot be used as a component
  2909. * prop. This is platform-dependent and may be overwritten.
  2910. */
  2911. isReservedAttr: no,
  2912. /**
  2913. * Check if a tag is an unknown element.
  2914. * Platform-dependent.
  2915. */
  2916. isUnknownElement: no,
  2917. /**
  2918. * Get the namespace of an element
  2919. */
  2920. getTagNamespace: noop,
  2921. /**
  2922. * Parse the real tag name for the specific platform.
  2923. */
  2924. parsePlatformTagName: identity,
  2925. /**
  2926. * Check if an attribute must be bound using property, e.g. value
  2927. * Platform-dependent.
  2928. */
  2929. mustUseProp: no,
  2930. /**
  2931. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  2932. * This will significantly reduce performance if set to false.
  2933. */
  2934. async: true,
  2935. /**
  2936. * Exposed for legacy reasons
  2937. */
  2938. _lifecycleHooks: LIFECYCLE_HOOKS
  2939. });
  2940. /* */
  2941. /**
  2942. * unicode letters used for parsing html tags, component names and property paths.
  2943. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  2944. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  2945. */
  2946. 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/;
  2947. /**
  2948. * Check if a string starts with $ or _
  2949. */
  2950. function isReserved (str) {
  2951. var c = (str + '').charCodeAt(0);
  2952. return c === 0x24 || c === 0x5F
  2953. }
  2954. /**
  2955. * Define a property.
  2956. */
  2957. function def (obj, key, val, enumerable) {
  2958. Object.defineProperty(obj, key, {
  2959. value: val,
  2960. enumerable: !!enumerable,
  2961. writable: true,
  2962. configurable: true
  2963. });
  2964. }
  2965. /**
  2966. * Parse simple path.
  2967. */
  2968. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  2969. function parsePath (path) {
  2970. if (bailRE.test(path)) {
  2971. return
  2972. }
  2973. var segments = path.split('.');
  2974. return function (obj) {
  2975. for (var i = 0; i < segments.length; i++) {
  2976. if (!obj) { return }
  2977. obj = obj[segments[i]];
  2978. }
  2979. return obj
  2980. }
  2981. }
  2982. /* */
  2983. // can we use __proto__?
  2984. var hasProto = '__proto__' in {};
  2985. // Browser environment sniffing
  2986. var inBrowser = typeof window !== 'undefined';
  2987. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  2988. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  2989. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  2990. var isIE = UA && /msie|trident/.test(UA);
  2991. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  2992. var isEdge = UA && UA.indexOf('edge/') > 0;
  2993. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  2994. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  2995. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  2996. var isPhantomJS = UA && /phantomjs/.test(UA);
  2997. var isFF = UA && UA.match(/firefox\/(\d+)/);
  2998. // Firefox has a "watch" function on Object.prototype...
  2999. var nativeWatch = ({}).watch;
  3000. if (inBrowser) {
  3001. try {
  3002. var opts = {};
  3003. Object.defineProperty(opts, 'passive', ({
  3004. get: function get () {
  3005. }
  3006. })); // https://github.com/facebook/flow/issues/285
  3007. window.addEventListener('test-passive', null, opts);
  3008. } catch (e) {}
  3009. }
  3010. // this needs to be lazy-evaled because vue may be required before
  3011. // vue-server-renderer can set VUE_ENV
  3012. var _isServer;
  3013. var isServerRendering = function () {
  3014. if (_isServer === undefined) {
  3015. /* istanbul ignore if */
  3016. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  3017. // detect presence of vue-server-renderer and avoid
  3018. // Webpack shimming the process
  3019. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  3020. } else {
  3021. _isServer = false;
  3022. }
  3023. }
  3024. return _isServer
  3025. };
  3026. // detect devtools
  3027. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  3028. /* istanbul ignore next */
  3029. function isNative (Ctor) {
  3030. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  3031. }
  3032. var hasSymbol =
  3033. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  3034. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  3035. var _Set;
  3036. /* istanbul ignore if */ // $flow-disable-line
  3037. if (typeof Set !== 'undefined' && isNative(Set)) {
  3038. // use native Set when available.
  3039. _Set = Set;
  3040. } else {
  3041. // a non-standard Set polyfill that only works with primitive keys.
  3042. _Set = /*@__PURE__*/(function () {
  3043. function Set () {
  3044. this.set = Object.create(null);
  3045. }
  3046. Set.prototype.has = function has (key) {
  3047. return this.set[key] === true
  3048. };
  3049. Set.prototype.add = function add (key) {
  3050. this.set[key] = true;
  3051. };
  3052. Set.prototype.clear = function clear () {
  3053. this.set = Object.create(null);
  3054. };
  3055. return Set;
  3056. }());
  3057. }
  3058. /* */
  3059. var warn = noop;
  3060. var tip = noop;
  3061. var generateComponentTrace = (noop); // work around flow check
  3062. var formatComponentName = (noop);
  3063. if (true) {
  3064. var hasConsole = typeof console !== 'undefined';
  3065. var classifyRE = /(?:^|[-_])(\w)/g;
  3066. var classify = function (str) { return str
  3067. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  3068. .replace(/[-_]/g, ''); };
  3069. warn = function (msg, vm) {
  3070. var trace = vm ? generateComponentTrace(vm) : '';
  3071. if (config.warnHandler) {
  3072. config.warnHandler.call(null, msg, vm, trace);
  3073. } else if (hasConsole && (!config.silent)) {
  3074. console.error(("[Vue warn]: " + msg + trace));
  3075. }
  3076. };
  3077. tip = function (msg, vm) {
  3078. if (hasConsole && (!config.silent)) {
  3079. console.warn("[Vue tip]: " + msg + (
  3080. vm ? generateComponentTrace(vm) : ''
  3081. ));
  3082. }
  3083. };
  3084. formatComponentName = function (vm, includeFile) {
  3085. if (vm.$root === vm) {
  3086. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  3087. return ('') + vm.$options.__file
  3088. }
  3089. return '<Root>'
  3090. }
  3091. var options = typeof vm === 'function' && vm.cid != null
  3092. ? vm.options
  3093. : vm._isVue
  3094. ? vm.$options || vm.constructor.options
  3095. : vm;
  3096. var name = options.name || options._componentTag;
  3097. var file = options.__file;
  3098. if (!name && file) {
  3099. var match = file.match(/([^/\\]+)\.vue$/);
  3100. name = match && match[1];
  3101. }
  3102. return (
  3103. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  3104. (file && includeFile !== false ? (" at " + file) : '')
  3105. )
  3106. };
  3107. var repeat = function (str, n) {
  3108. var res = '';
  3109. while (n) {
  3110. if (n % 2 === 1) { res += str; }
  3111. if (n > 1) { str += str; }
  3112. n >>= 1;
  3113. }
  3114. return res
  3115. };
  3116. generateComponentTrace = function (vm) {
  3117. if (vm._isVue && vm.$parent) {
  3118. var tree = [];
  3119. var currentRecursiveSequence = 0;
  3120. while (vm && vm.$options.name !== 'PageBody') {
  3121. if (tree.length > 0) {
  3122. var last = tree[tree.length - 1];
  3123. if (last.constructor === vm.constructor) {
  3124. currentRecursiveSequence++;
  3125. vm = vm.$parent;
  3126. continue
  3127. } else if (currentRecursiveSequence > 0) {
  3128. tree[tree.length - 1] = [last, currentRecursiveSequence];
  3129. currentRecursiveSequence = 0;
  3130. }
  3131. }
  3132. !vm.$options.isReserved && tree.push(vm);
  3133. vm = vm.$parent;
  3134. }
  3135. return '\n\nfound in\n\n' + tree
  3136. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  3137. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  3138. : formatComponentName(vm))); })
  3139. .join('\n')
  3140. } else {
  3141. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  3142. }
  3143. };
  3144. }
  3145. /* */
  3146. var uid = 0;
  3147. /**
  3148. * A dep is an observable that can have multiple
  3149. * directives subscribing to it.
  3150. */
  3151. var Dep = function Dep () {
  3152. this.id = uid++;
  3153. this.subs = [];
  3154. };
  3155. Dep.prototype.addSub = function addSub (sub) {
  3156. this.subs.push(sub);
  3157. };
  3158. Dep.prototype.removeSub = function removeSub (sub) {
  3159. remove(this.subs, sub);
  3160. };
  3161. Dep.prototype.depend = function depend () {
  3162. if (Dep.SharedObject.target) {
  3163. Dep.SharedObject.target.addDep(this);
  3164. }
  3165. };
  3166. Dep.prototype.notify = function notify () {
  3167. // stabilize the subscriber list first
  3168. var subs = this.subs.slice();
  3169. if ( true && !config.async) {
  3170. // subs aren't sorted in scheduler if not running async
  3171. // we need to sort them now to make sure they fire in correct
  3172. // order
  3173. subs.sort(function (a, b) { return a.id - b.id; });
  3174. }
  3175. for (var i = 0, l = subs.length; i < l; i++) {
  3176. subs[i].update();
  3177. }
  3178. };
  3179. // The current target watcher being evaluated.
  3180. // This is globally unique because only one watcher
  3181. // can be evaluated at a time.
  3182. // fixed by xxxxxx (nvue shared vuex)
  3183. /* eslint-disable no-undef */
  3184. Dep.SharedObject = {};
  3185. Dep.SharedObject.target = null;
  3186. Dep.SharedObject.targetStack = [];
  3187. function pushTarget (target) {
  3188. Dep.SharedObject.targetStack.push(target);
  3189. Dep.SharedObject.target = target;
  3190. Dep.target = target;
  3191. }
  3192. function popTarget () {
  3193. Dep.SharedObject.targetStack.pop();
  3194. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  3195. Dep.target = Dep.SharedObject.target;
  3196. }
  3197. /* */
  3198. var VNode = function VNode (
  3199. tag,
  3200. data,
  3201. children,
  3202. text,
  3203. elm,
  3204. context,
  3205. componentOptions,
  3206. asyncFactory
  3207. ) {
  3208. this.tag = tag;
  3209. this.data = data;
  3210. this.children = children;
  3211. this.text = text;
  3212. this.elm = elm;
  3213. this.ns = undefined;
  3214. this.context = context;
  3215. this.fnContext = undefined;
  3216. this.fnOptions = undefined;
  3217. this.fnScopeId = undefined;
  3218. this.key = data && data.key;
  3219. this.componentOptions = componentOptions;
  3220. this.componentInstance = undefined;
  3221. this.parent = undefined;
  3222. this.raw = false;
  3223. this.isStatic = false;
  3224. this.isRootInsert = true;
  3225. this.isComment = false;
  3226. this.isCloned = false;
  3227. this.isOnce = false;
  3228. this.asyncFactory = asyncFactory;
  3229. this.asyncMeta = undefined;
  3230. this.isAsyncPlaceholder = false;
  3231. };
  3232. var prototypeAccessors = { child: { configurable: true } };
  3233. // DEPRECATED: alias for componentInstance for backwards compat.
  3234. /* istanbul ignore next */
  3235. prototypeAccessors.child.get = function () {
  3236. return this.componentInstance
  3237. };
  3238. Object.defineProperties( VNode.prototype, prototypeAccessors );
  3239. var createEmptyVNode = function (text) {
  3240. if ( text === void 0 ) text = '';
  3241. var node = new VNode();
  3242. node.text = text;
  3243. node.isComment = true;
  3244. return node
  3245. };
  3246. function createTextVNode (val) {
  3247. return new VNode(undefined, undefined, undefined, String(val))
  3248. }
  3249. // optimized shallow clone
  3250. // used for static nodes and slot nodes because they may be reused across
  3251. // multiple renders, cloning them avoids errors when DOM manipulations rely
  3252. // on their elm reference.
  3253. function cloneVNode (vnode) {
  3254. var cloned = new VNode(
  3255. vnode.tag,
  3256. vnode.data,
  3257. // #7975
  3258. // clone children array to avoid mutating original in case of cloning
  3259. // a child.
  3260. vnode.children && vnode.children.slice(),
  3261. vnode.text,
  3262. vnode.elm,
  3263. vnode.context,
  3264. vnode.componentOptions,
  3265. vnode.asyncFactory
  3266. );
  3267. cloned.ns = vnode.ns;
  3268. cloned.isStatic = vnode.isStatic;
  3269. cloned.key = vnode.key;
  3270. cloned.isComment = vnode.isComment;
  3271. cloned.fnContext = vnode.fnContext;
  3272. cloned.fnOptions = vnode.fnOptions;
  3273. cloned.fnScopeId = vnode.fnScopeId;
  3274. cloned.asyncMeta = vnode.asyncMeta;
  3275. cloned.isCloned = true;
  3276. return cloned
  3277. }
  3278. /*
  3279. * not type checking this file because flow doesn't play well with
  3280. * dynamically accessing methods on Array prototype
  3281. */
  3282. var arrayProto = Array.prototype;
  3283. var arrayMethods = Object.create(arrayProto);
  3284. var methodsToPatch = [
  3285. 'push',
  3286. 'pop',
  3287. 'shift',
  3288. 'unshift',
  3289. 'splice',
  3290. 'sort',
  3291. 'reverse'
  3292. ];
  3293. /**
  3294. * Intercept mutating methods and emit events
  3295. */
  3296. methodsToPatch.forEach(function (method) {
  3297. // cache original method
  3298. var original = arrayProto[method];
  3299. def(arrayMethods, method, function mutator () {
  3300. var args = [], len = arguments.length;
  3301. while ( len-- ) args[ len ] = arguments[ len ];
  3302. var result = original.apply(this, args);
  3303. var ob = this.__ob__;
  3304. var inserted;
  3305. switch (method) {
  3306. case 'push':
  3307. case 'unshift':
  3308. inserted = args;
  3309. break
  3310. case 'splice':
  3311. inserted = args.slice(2);
  3312. break
  3313. }
  3314. if (inserted) { ob.observeArray(inserted); }
  3315. // notify change
  3316. ob.dep.notify();
  3317. return result
  3318. });
  3319. });
  3320. /* */
  3321. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  3322. /**
  3323. * In some cases we may want to disable observation inside a component's
  3324. * update computation.
  3325. */
  3326. var shouldObserve = true;
  3327. function toggleObserving (value) {
  3328. shouldObserve = value;
  3329. }
  3330. /**
  3331. * Observer class that is attached to each observed
  3332. * object. Once attached, the observer converts the target
  3333. * object's property keys into getter/setters that
  3334. * collect dependencies and dispatch updates.
  3335. */
  3336. var Observer = function Observer (value) {
  3337. this.value = value;
  3338. this.dep = new Dep();
  3339. this.vmCount = 0;
  3340. def(value, '__ob__', this);
  3341. if (Array.isArray(value)) {
  3342. if (hasProto) {
  3343. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  3344. if(value.push !== value.__proto__.push){
  3345. copyAugment(value, arrayMethods, arrayKeys);
  3346. } else {
  3347. protoAugment(value, arrayMethods);
  3348. }
  3349. }
  3350. } else {
  3351. copyAugment(value, arrayMethods, arrayKeys);
  3352. }
  3353. this.observeArray(value);
  3354. } else {
  3355. this.walk(value);
  3356. }
  3357. };
  3358. /**
  3359. * Walk through all properties and convert them into
  3360. * getter/setters. This method should only be called when
  3361. * value type is Object.
  3362. */
  3363. Observer.prototype.walk = function walk (obj) {
  3364. var keys = Object.keys(obj);
  3365. for (var i = 0; i < keys.length; i++) {
  3366. defineReactive$$1(obj, keys[i]);
  3367. }
  3368. };
  3369. /**
  3370. * Observe a list of Array items.
  3371. */
  3372. Observer.prototype.observeArray = function observeArray (items) {
  3373. for (var i = 0, l = items.length; i < l; i++) {
  3374. observe(items[i]);
  3375. }
  3376. };
  3377. // helpers
  3378. /**
  3379. * Augment a target Object or Array by intercepting
  3380. * the prototype chain using __proto__
  3381. */
  3382. function protoAugment (target, src) {
  3383. /* eslint-disable no-proto */
  3384. target.__proto__ = src;
  3385. /* eslint-enable no-proto */
  3386. }
  3387. /**
  3388. * Augment a target Object or Array by defining
  3389. * hidden properties.
  3390. */
  3391. /* istanbul ignore next */
  3392. function copyAugment (target, src, keys) {
  3393. for (var i = 0, l = keys.length; i < l; i++) {
  3394. var key = keys[i];
  3395. def(target, key, src[key]);
  3396. }
  3397. }
  3398. /**
  3399. * Attempt to create an observer instance for a value,
  3400. * returns the new observer if successfully observed,
  3401. * or the existing observer if the value already has one.
  3402. */
  3403. function observe (value, asRootData) {
  3404. if (!isObject(value) || value instanceof VNode) {
  3405. return
  3406. }
  3407. var ob;
  3408. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  3409. ob = value.__ob__;
  3410. } else if (
  3411. shouldObserve &&
  3412. !isServerRendering() &&
  3413. (Array.isArray(value) || isPlainObject(value)) &&
  3414. Object.isExtensible(value) &&
  3415. !value._isVue
  3416. ) {
  3417. ob = new Observer(value);
  3418. }
  3419. if (asRootData && ob) {
  3420. ob.vmCount++;
  3421. }
  3422. return ob
  3423. }
  3424. /**
  3425. * Define a reactive property on an Object.
  3426. */
  3427. function defineReactive$$1 (
  3428. obj,
  3429. key,
  3430. val,
  3431. customSetter,
  3432. shallow
  3433. ) {
  3434. var dep = new Dep();
  3435. var property = Object.getOwnPropertyDescriptor(obj, key);
  3436. if (property && property.configurable === false) {
  3437. return
  3438. }
  3439. // cater for pre-defined getter/setters
  3440. var getter = property && property.get;
  3441. var setter = property && property.set;
  3442. if ((!getter || setter) && arguments.length === 2) {
  3443. val = obj[key];
  3444. }
  3445. var childOb = !shallow && observe(val);
  3446. Object.defineProperty(obj, key, {
  3447. enumerable: true,
  3448. configurable: true,
  3449. get: function reactiveGetter () {
  3450. var value = getter ? getter.call(obj) : val;
  3451. if (Dep.SharedObject.target) { // fixed by xxxxxx
  3452. dep.depend();
  3453. if (childOb) {
  3454. childOb.dep.depend();
  3455. if (Array.isArray(value)) {
  3456. dependArray(value);
  3457. }
  3458. }
  3459. }
  3460. return value
  3461. },
  3462. set: function reactiveSetter (newVal) {
  3463. var value = getter ? getter.call(obj) : val;
  3464. /* eslint-disable no-self-compare */
  3465. if (newVal === value || (newVal !== newVal && value !== value)) {
  3466. return
  3467. }
  3468. /* eslint-enable no-self-compare */
  3469. if ( true && customSetter) {
  3470. customSetter();
  3471. }
  3472. // #7981: for accessor properties without setter
  3473. if (getter && !setter) { return }
  3474. if (setter) {
  3475. setter.call(obj, newVal);
  3476. } else {
  3477. val = newVal;
  3478. }
  3479. childOb = !shallow && observe(newVal);
  3480. dep.notify();
  3481. }
  3482. });
  3483. }
  3484. /**
  3485. * Set a property on an object. Adds the new property and
  3486. * triggers change notification if the property doesn't
  3487. * already exist.
  3488. */
  3489. function set (target, key, val) {
  3490. if ( true &&
  3491. (isUndef(target) || isPrimitive(target))
  3492. ) {
  3493. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  3494. }
  3495. if (Array.isArray(target) && isValidArrayIndex(key)) {
  3496. target.length = Math.max(target.length, key);
  3497. target.splice(key, 1, val);
  3498. return val
  3499. }
  3500. if (key in target && !(key in Object.prototype)) {
  3501. target[key] = val;
  3502. return val
  3503. }
  3504. var ob = (target).__ob__;
  3505. if (target._isVue || (ob && ob.vmCount)) {
  3506. true && warn(
  3507. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  3508. 'at runtime - declare it upfront in the data option.'
  3509. );
  3510. return val
  3511. }
  3512. if (!ob) {
  3513. target[key] = val;
  3514. return val
  3515. }
  3516. defineReactive$$1(ob.value, key, val);
  3517. ob.dep.notify();
  3518. return val
  3519. }
  3520. /**
  3521. * Delete a property and trigger change if necessary.
  3522. */
  3523. function del (target, key) {
  3524. if ( true &&
  3525. (isUndef(target) || isPrimitive(target))
  3526. ) {
  3527. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  3528. }
  3529. if (Array.isArray(target) && isValidArrayIndex(key)) {
  3530. target.splice(key, 1);
  3531. return
  3532. }
  3533. var ob = (target).__ob__;
  3534. if (target._isVue || (ob && ob.vmCount)) {
  3535. true && warn(
  3536. 'Avoid deleting properties on a Vue instance or its root $data ' +
  3537. '- just set it to null.'
  3538. );
  3539. return
  3540. }
  3541. if (!hasOwn(target, key)) {
  3542. return
  3543. }
  3544. delete target[key];
  3545. if (!ob) {
  3546. return
  3547. }
  3548. ob.dep.notify();
  3549. }
  3550. /**
  3551. * Collect dependencies on array elements when the array is touched, since
  3552. * we cannot intercept array element access like property getters.
  3553. */
  3554. function dependArray (value) {
  3555. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  3556. e = value[i];
  3557. e && e.__ob__ && e.__ob__.dep.depend();
  3558. if (Array.isArray(e)) {
  3559. dependArray(e);
  3560. }
  3561. }
  3562. }
  3563. /* */
  3564. /**
  3565. * Option overwriting strategies are functions that handle
  3566. * how to merge a parent option value and a child option
  3567. * value into the final value.
  3568. */
  3569. var strats = config.optionMergeStrategies;
  3570. /**
  3571. * Options with restrictions
  3572. */
  3573. if (true) {
  3574. strats.el = strats.propsData = function (parent, child, vm, key) {
  3575. if (!vm) {
  3576. warn(
  3577. "option \"" + key + "\" can only be used during instance " +
  3578. 'creation with the `new` keyword.'
  3579. );
  3580. }
  3581. return defaultStrat(parent, child)
  3582. };
  3583. }
  3584. /**
  3585. * Helper that recursively merges two data objects together.
  3586. */
  3587. function mergeData (to, from) {
  3588. if (!from) { return to }
  3589. var key, toVal, fromVal;
  3590. var keys = hasSymbol
  3591. ? Reflect.ownKeys(from)
  3592. : Object.keys(from);
  3593. for (var i = 0; i < keys.length; i++) {
  3594. key = keys[i];
  3595. // in case the object is already observed...
  3596. if (key === '__ob__') { continue }
  3597. toVal = to[key];
  3598. fromVal = from[key];
  3599. if (!hasOwn(to, key)) {
  3600. set(to, key, fromVal);
  3601. } else if (
  3602. toVal !== fromVal &&
  3603. isPlainObject(toVal) &&
  3604. isPlainObject(fromVal)
  3605. ) {
  3606. mergeData(toVal, fromVal);
  3607. }
  3608. }
  3609. return to
  3610. }
  3611. /**
  3612. * Data
  3613. */
  3614. function mergeDataOrFn (
  3615. parentVal,
  3616. childVal,
  3617. vm
  3618. ) {
  3619. if (!vm) {
  3620. // in a Vue.extend merge, both should be functions
  3621. if (!childVal) {
  3622. return parentVal
  3623. }
  3624. if (!parentVal) {
  3625. return childVal
  3626. }
  3627. // when parentVal & childVal are both present,
  3628. // we need to return a function that returns the
  3629. // merged result of both functions... no need to
  3630. // check if parentVal is a function here because
  3631. // it has to be a function to pass previous merges.
  3632. return function mergedDataFn () {
  3633. return mergeData(
  3634. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  3635. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  3636. )
  3637. }
  3638. } else {
  3639. return function mergedInstanceDataFn () {
  3640. // instance merge
  3641. var instanceData = typeof childVal === 'function'
  3642. ? childVal.call(vm, vm)
  3643. : childVal;
  3644. var defaultData = typeof parentVal === 'function'
  3645. ? parentVal.call(vm, vm)
  3646. : parentVal;
  3647. if (instanceData) {
  3648. return mergeData(instanceData, defaultData)
  3649. } else {
  3650. return defaultData
  3651. }
  3652. }
  3653. }
  3654. }
  3655. strats.data = function (
  3656. parentVal,
  3657. childVal,
  3658. vm
  3659. ) {
  3660. if (!vm) {
  3661. if (childVal && typeof childVal !== 'function') {
  3662. true && warn(
  3663. 'The "data" option should be a function ' +
  3664. 'that returns a per-instance value in component ' +
  3665. 'definitions.',
  3666. vm
  3667. );
  3668. return parentVal
  3669. }
  3670. return mergeDataOrFn(parentVal, childVal)
  3671. }
  3672. return mergeDataOrFn(parentVal, childVal, vm)
  3673. };
  3674. /**
  3675. * Hooks and props are merged as arrays.
  3676. */
  3677. function mergeHook (
  3678. parentVal,
  3679. childVal
  3680. ) {
  3681. var res = childVal
  3682. ? parentVal
  3683. ? parentVal.concat(childVal)
  3684. : Array.isArray(childVal)
  3685. ? childVal
  3686. : [childVal]
  3687. : parentVal;
  3688. return res
  3689. ? dedupeHooks(res)
  3690. : res
  3691. }
  3692. function dedupeHooks (hooks) {
  3693. var res = [];
  3694. for (var i = 0; i < hooks.length; i++) {
  3695. if (res.indexOf(hooks[i]) === -1) {
  3696. res.push(hooks[i]);
  3697. }
  3698. }
  3699. return res
  3700. }
  3701. LIFECYCLE_HOOKS.forEach(function (hook) {
  3702. strats[hook] = mergeHook;
  3703. });
  3704. /**
  3705. * Assets
  3706. *
  3707. * When a vm is present (instance creation), we need to do
  3708. * a three-way merge between constructor options, instance
  3709. * options and parent options.
  3710. */
  3711. function mergeAssets (
  3712. parentVal,
  3713. childVal,
  3714. vm,
  3715. key
  3716. ) {
  3717. var res = Object.create(parentVal || null);
  3718. if (childVal) {
  3719. true && assertObjectType(key, childVal, vm);
  3720. return extend(res, childVal)
  3721. } else {
  3722. return res
  3723. }
  3724. }
  3725. ASSET_TYPES.forEach(function (type) {
  3726. strats[type + 's'] = mergeAssets;
  3727. });
  3728. /**
  3729. * Watchers.
  3730. *
  3731. * Watchers hashes should not overwrite one
  3732. * another, so we merge them as arrays.
  3733. */
  3734. strats.watch = function (
  3735. parentVal,
  3736. childVal,
  3737. vm,
  3738. key
  3739. ) {
  3740. // work around Firefox's Object.prototype.watch...
  3741. if (parentVal === nativeWatch) { parentVal = undefined; }
  3742. if (childVal === nativeWatch) { childVal = undefined; }
  3743. /* istanbul ignore if */
  3744. if (!childVal) { return Object.create(parentVal || null) }
  3745. if (true) {
  3746. assertObjectType(key, childVal, vm);
  3747. }
  3748. if (!parentVal) { return childVal }
  3749. var ret = {};
  3750. extend(ret, parentVal);
  3751. for (var key$1 in childVal) {
  3752. var parent = ret[key$1];
  3753. var child = childVal[key$1];
  3754. if (parent && !Array.isArray(parent)) {
  3755. parent = [parent];
  3756. }
  3757. ret[key$1] = parent
  3758. ? parent.concat(child)
  3759. : Array.isArray(child) ? child : [child];
  3760. }
  3761. return ret
  3762. };
  3763. /**
  3764. * Other object hashes.
  3765. */
  3766. strats.props =
  3767. strats.methods =
  3768. strats.inject =
  3769. strats.computed = function (
  3770. parentVal,
  3771. childVal,
  3772. vm,
  3773. key
  3774. ) {
  3775. if (childVal && "development" !== 'production') {
  3776. assertObjectType(key, childVal, vm);
  3777. }
  3778. if (!parentVal) { return childVal }
  3779. var ret = Object.create(null);
  3780. extend(ret, parentVal);
  3781. if (childVal) { extend(ret, childVal); }
  3782. return ret
  3783. };
  3784. strats.provide = mergeDataOrFn;
  3785. /**
  3786. * Default strategy.
  3787. */
  3788. var defaultStrat = function (parentVal, childVal) {
  3789. return childVal === undefined
  3790. ? parentVal
  3791. : childVal
  3792. };
  3793. /**
  3794. * Validate component names
  3795. */
  3796. function checkComponents (options) {
  3797. for (var key in options.components) {
  3798. validateComponentName(key);
  3799. }
  3800. }
  3801. function validateComponentName (name) {
  3802. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  3803. warn(
  3804. 'Invalid component name: "' + name + '". Component names ' +
  3805. 'should conform to valid custom element name in html5 specification.'
  3806. );
  3807. }
  3808. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  3809. warn(
  3810. 'Do not use built-in or reserved HTML elements as component ' +
  3811. 'id: ' + name
  3812. );
  3813. }
  3814. }
  3815. /**
  3816. * Ensure all props option syntax are normalized into the
  3817. * Object-based format.
  3818. */
  3819. function normalizeProps (options, vm) {
  3820. var props = options.props;
  3821. if (!props) { return }
  3822. var res = {};
  3823. var i, val, name;
  3824. if (Array.isArray(props)) {
  3825. i = props.length;
  3826. while (i--) {
  3827. val = props[i];
  3828. if (typeof val === 'string') {
  3829. name = camelize(val);
  3830. res[name] = { type: null };
  3831. } else if (true) {
  3832. warn('props must be strings when using array syntax.');
  3833. }
  3834. }
  3835. } else if (isPlainObject(props)) {
  3836. for (var key in props) {
  3837. val = props[key];
  3838. name = camelize(key);
  3839. res[name] = isPlainObject(val)
  3840. ? val
  3841. : { type: val };
  3842. }
  3843. } else if (true) {
  3844. warn(
  3845. "Invalid value for option \"props\": expected an Array or an Object, " +
  3846. "but got " + (toRawType(props)) + ".",
  3847. vm
  3848. );
  3849. }
  3850. options.props = res;
  3851. }
  3852. /**
  3853. * Normalize all injections into Object-based format
  3854. */
  3855. function normalizeInject (options, vm) {
  3856. var inject = options.inject;
  3857. if (!inject) { return }
  3858. var normalized = options.inject = {};
  3859. if (Array.isArray(inject)) {
  3860. for (var i = 0; i < inject.length; i++) {
  3861. normalized[inject[i]] = { from: inject[i] };
  3862. }
  3863. } else if (isPlainObject(inject)) {
  3864. for (var key in inject) {
  3865. var val = inject[key];
  3866. normalized[key] = isPlainObject(val)
  3867. ? extend({ from: key }, val)
  3868. : { from: val };
  3869. }
  3870. } else if (true) {
  3871. warn(
  3872. "Invalid value for option \"inject\": expected an Array or an Object, " +
  3873. "but got " + (toRawType(inject)) + ".",
  3874. vm
  3875. );
  3876. }
  3877. }
  3878. /**
  3879. * Normalize raw function directives into object format.
  3880. */
  3881. function normalizeDirectives (options) {
  3882. var dirs = options.directives;
  3883. if (dirs) {
  3884. for (var key in dirs) {
  3885. var def$$1 = dirs[key];
  3886. if (typeof def$$1 === 'function') {
  3887. dirs[key] = { bind: def$$1, update: def$$1 };
  3888. }
  3889. }
  3890. }
  3891. }
  3892. function assertObjectType (name, value, vm) {
  3893. if (!isPlainObject(value)) {
  3894. warn(
  3895. "Invalid value for option \"" + name + "\": expected an Object, " +
  3896. "but got " + (toRawType(value)) + ".",
  3897. vm
  3898. );
  3899. }
  3900. }
  3901. /**
  3902. * Merge two option objects into a new one.
  3903. * Core utility used in both instantiation and inheritance.
  3904. */
  3905. function mergeOptions (
  3906. parent,
  3907. child,
  3908. vm
  3909. ) {
  3910. if (true) {
  3911. checkComponents(child);
  3912. }
  3913. if (typeof child === 'function') {
  3914. child = child.options;
  3915. }
  3916. normalizeProps(child, vm);
  3917. normalizeInject(child, vm);
  3918. normalizeDirectives(child);
  3919. // Apply extends and mixins on the child options,
  3920. // but only if it is a raw options object that isn't
  3921. // the result of another mergeOptions call.
  3922. // Only merged options has the _base property.
  3923. if (!child._base) {
  3924. if (child.extends) {
  3925. parent = mergeOptions(parent, child.extends, vm);
  3926. }
  3927. if (child.mixins) {
  3928. for (var i = 0, l = child.mixins.length; i < l; i++) {
  3929. parent = mergeOptions(parent, child.mixins[i], vm);
  3930. }
  3931. }
  3932. }
  3933. var options = {};
  3934. var key;
  3935. for (key in parent) {
  3936. mergeField(key);
  3937. }
  3938. for (key in child) {
  3939. if (!hasOwn(parent, key)) {
  3940. mergeField(key);
  3941. }
  3942. }
  3943. function mergeField (key) {
  3944. var strat = strats[key] || defaultStrat;
  3945. options[key] = strat(parent[key], child[key], vm, key);
  3946. }
  3947. return options
  3948. }
  3949. /**
  3950. * Resolve an asset.
  3951. * This function is used because child instances need access
  3952. * to assets defined in its ancestor chain.
  3953. */
  3954. function resolveAsset (
  3955. options,
  3956. type,
  3957. id,
  3958. warnMissing
  3959. ) {
  3960. /* istanbul ignore if */
  3961. if (typeof id !== 'string') {
  3962. return
  3963. }
  3964. var assets = options[type];
  3965. // check local registration variations first
  3966. if (hasOwn(assets, id)) { return assets[id] }
  3967. var camelizedId = camelize(id);
  3968. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  3969. var PascalCaseId = capitalize(camelizedId);
  3970. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  3971. // fallback to prototype chain
  3972. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  3973. if ( true && warnMissing && !res) {
  3974. warn(
  3975. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  3976. options
  3977. );
  3978. }
  3979. return res
  3980. }
  3981. /* */
  3982. function validateProp (
  3983. key,
  3984. propOptions,
  3985. propsData,
  3986. vm
  3987. ) {
  3988. var prop = propOptions[key];
  3989. var absent = !hasOwn(propsData, key);
  3990. var value = propsData[key];
  3991. // boolean casting
  3992. var booleanIndex = getTypeIndex(Boolean, prop.type);
  3993. if (booleanIndex > -1) {
  3994. if (absent && !hasOwn(prop, 'default')) {
  3995. value = false;
  3996. } else if (value === '' || value === hyphenate(key)) {
  3997. // only cast empty string / same name to boolean if
  3998. // boolean has higher priority
  3999. var stringIndex = getTypeIndex(String, prop.type);
  4000. if (stringIndex < 0 || booleanIndex < stringIndex) {
  4001. value = true;
  4002. }
  4003. }
  4004. }
  4005. // check default value
  4006. if (value === undefined) {
  4007. value = getPropDefaultValue(vm, prop, key);
  4008. // since the default value is a fresh copy,
  4009. // make sure to observe it.
  4010. var prevShouldObserve = shouldObserve;
  4011. toggleObserving(true);
  4012. observe(value);
  4013. toggleObserving(prevShouldObserve);
  4014. }
  4015. if (
  4016. true
  4017. ) {
  4018. assertProp(prop, key, value, vm, absent);
  4019. }
  4020. return value
  4021. }
  4022. /**
  4023. * Get the default value of a prop.
  4024. */
  4025. function getPropDefaultValue (vm, prop, key) {
  4026. // no default, return undefined
  4027. if (!hasOwn(prop, 'default')) {
  4028. return undefined
  4029. }
  4030. var def = prop.default;
  4031. // warn against non-factory defaults for Object & Array
  4032. if ( true && isObject(def)) {
  4033. warn(
  4034. 'Invalid default value for prop "' + key + '": ' +
  4035. 'Props with type Object/Array must use a factory function ' +
  4036. 'to return the default value.',
  4037. vm
  4038. );
  4039. }
  4040. // the raw prop value was also undefined from previous render,
  4041. // return previous default value to avoid unnecessary watcher trigger
  4042. if (vm && vm.$options.propsData &&
  4043. vm.$options.propsData[key] === undefined &&
  4044. vm._props[key] !== undefined
  4045. ) {
  4046. return vm._props[key]
  4047. }
  4048. // call factory function for non-Function types
  4049. // a value is Function if its prototype is function even across different execution context
  4050. return typeof def === 'function' && getType(prop.type) !== 'Function'
  4051. ? def.call(vm)
  4052. : def
  4053. }
  4054. /**
  4055. * Assert whether a prop is valid.
  4056. */
  4057. function assertProp (
  4058. prop,
  4059. name,
  4060. value,
  4061. vm,
  4062. absent
  4063. ) {
  4064. if (prop.required && absent) {
  4065. warn(
  4066. 'Missing required prop: "' + name + '"',
  4067. vm
  4068. );
  4069. return
  4070. }
  4071. if (value == null && !prop.required) {
  4072. return
  4073. }
  4074. var type = prop.type;
  4075. var valid = !type || type === true;
  4076. var expectedTypes = [];
  4077. if (type) {
  4078. if (!Array.isArray(type)) {
  4079. type = [type];
  4080. }
  4081. for (var i = 0; i < type.length && !valid; i++) {
  4082. var assertedType = assertType(value, type[i]);
  4083. expectedTypes.push(assertedType.expectedType || '');
  4084. valid = assertedType.valid;
  4085. }
  4086. }
  4087. if (!valid) {
  4088. warn(
  4089. getInvalidTypeMessage(name, value, expectedTypes),
  4090. vm
  4091. );
  4092. return
  4093. }
  4094. var validator = prop.validator;
  4095. if (validator) {
  4096. if (!validator(value)) {
  4097. warn(
  4098. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  4099. vm
  4100. );
  4101. }
  4102. }
  4103. }
  4104. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  4105. function assertType (value, type) {
  4106. var valid;
  4107. var expectedType = getType(type);
  4108. if (simpleCheckRE.test(expectedType)) {
  4109. var t = typeof value;
  4110. valid = t === expectedType.toLowerCase();
  4111. // for primitive wrapper objects
  4112. if (!valid && t === 'object') {
  4113. valid = value instanceof type;
  4114. }
  4115. } else if (expectedType === 'Object') {
  4116. valid = isPlainObject(value);
  4117. } else if (expectedType === 'Array') {
  4118. valid = Array.isArray(value);
  4119. } else {
  4120. valid = value instanceof type;
  4121. }
  4122. return {
  4123. valid: valid,
  4124. expectedType: expectedType
  4125. }
  4126. }
  4127. /**
  4128. * Use function string name to check built-in types,
  4129. * because a simple equality check will fail when running
  4130. * across different vms / iframes.
  4131. */
  4132. function getType (fn) {
  4133. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  4134. return match ? match[1] : ''
  4135. }
  4136. function isSameType (a, b) {
  4137. return getType(a) === getType(b)
  4138. }
  4139. function getTypeIndex (type, expectedTypes) {
  4140. if (!Array.isArray(expectedTypes)) {
  4141. return isSameType(expectedTypes, type) ? 0 : -1
  4142. }
  4143. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  4144. if (isSameType(expectedTypes[i], type)) {
  4145. return i
  4146. }
  4147. }
  4148. return -1
  4149. }
  4150. function getInvalidTypeMessage (name, value, expectedTypes) {
  4151. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  4152. " Expected " + (expectedTypes.map(capitalize).join(', '));
  4153. var expectedType = expectedTypes[0];
  4154. var receivedType = toRawType(value);
  4155. var expectedValue = styleValue(value, expectedType);
  4156. var receivedValue = styleValue(value, receivedType);
  4157. // check if we need to specify expected value
  4158. if (expectedTypes.length === 1 &&
  4159. isExplicable(expectedType) &&
  4160. !isBoolean(expectedType, receivedType)) {
  4161. message += " with value " + expectedValue;
  4162. }
  4163. message += ", got " + receivedType + " ";
  4164. // check if we need to specify received value
  4165. if (isExplicable(receivedType)) {
  4166. message += "with value " + receivedValue + ".";
  4167. }
  4168. return message
  4169. }
  4170. function styleValue (value, type) {
  4171. if (type === 'String') {
  4172. return ("\"" + value + "\"")
  4173. } else if (type === 'Number') {
  4174. return ("" + (Number(value)))
  4175. } else {
  4176. return ("" + value)
  4177. }
  4178. }
  4179. function isExplicable (value) {
  4180. var explicitTypes = ['string', 'number', 'boolean'];
  4181. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  4182. }
  4183. function isBoolean () {
  4184. var args = [], len = arguments.length;
  4185. while ( len-- ) args[ len ] = arguments[ len ];
  4186. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  4187. }
  4188. /* */
  4189. function handleError (err, vm, info) {
  4190. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  4191. // See: https://github.com/vuejs/vuex/issues/1505
  4192. pushTarget();
  4193. try {
  4194. if (vm) {
  4195. var cur = vm;
  4196. while ((cur = cur.$parent)) {
  4197. var hooks = cur.$options.errorCaptured;
  4198. if (hooks) {
  4199. for (var i = 0; i < hooks.length; i++) {
  4200. try {
  4201. var capture = hooks[i].call(cur, err, vm, info) === false;
  4202. if (capture) { return }
  4203. } catch (e) {
  4204. globalHandleError(e, cur, 'errorCaptured hook');
  4205. }
  4206. }
  4207. }
  4208. }
  4209. }
  4210. globalHandleError(err, vm, info);
  4211. } finally {
  4212. popTarget();
  4213. }
  4214. }
  4215. function invokeWithErrorHandling (
  4216. handler,
  4217. context,
  4218. args,
  4219. vm,
  4220. info
  4221. ) {
  4222. var res;
  4223. try {
  4224. res = args ? handler.apply(context, args) : handler.call(context);
  4225. if (res && !res._isVue && isPromise(res) && !res._handled) {
  4226. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  4227. // issue #9511
  4228. // avoid catch triggering multiple times when nested calls
  4229. res._handled = true;
  4230. }
  4231. } catch (e) {
  4232. handleError(e, vm, info);
  4233. }
  4234. return res
  4235. }
  4236. function globalHandleError (err, vm, info) {
  4237. if (config.errorHandler) {
  4238. try {
  4239. return config.errorHandler.call(null, err, vm, info)
  4240. } catch (e) {
  4241. // if the user intentionally throws the original error in the handler,
  4242. // do not log it twice
  4243. if (e !== err) {
  4244. logError(e, null, 'config.errorHandler');
  4245. }
  4246. }
  4247. }
  4248. logError(err, vm, info);
  4249. }
  4250. function logError (err, vm, info) {
  4251. if (true) {
  4252. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  4253. }
  4254. /* istanbul ignore else */
  4255. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  4256. console.error(err);
  4257. } else {
  4258. throw err
  4259. }
  4260. }
  4261. /* */
  4262. var callbacks = [];
  4263. var pending = false;
  4264. function flushCallbacks () {
  4265. pending = false;
  4266. var copies = callbacks.slice(0);
  4267. callbacks.length = 0;
  4268. for (var i = 0; i < copies.length; i++) {
  4269. copies[i]();
  4270. }
  4271. }
  4272. // Here we have async deferring wrappers using microtasks.
  4273. // In 2.5 we used (macro) tasks (in combination with microtasks).
  4274. // However, it has subtle problems when state is changed right before repaint
  4275. // (e.g. #6813, out-in transitions).
  4276. // Also, using (macro) tasks in event handler would cause some weird behaviors
  4277. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  4278. // So we now use microtasks everywhere, again.
  4279. // A major drawback of this tradeoff is that there are some scenarios
  4280. // where microtasks have too high a priority and fire in between supposedly
  4281. // sequential events (e.g. #4521, #6690, which have workarounds)
  4282. // or even between bubbling of the same event (#6566).
  4283. var timerFunc;
  4284. // The nextTick behavior leverages the microtask queue, which can be accessed
  4285. // via either native Promise.then or MutationObserver.
  4286. // MutationObserver has wider support, however it is seriously bugged in
  4287. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  4288. // completely stops working after triggering a few times... so, if native
  4289. // Promise is available, we will use it:
  4290. /* istanbul ignore next, $flow-disable-line */
  4291. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  4292. var p = Promise.resolve();
  4293. timerFunc = function () {
  4294. p.then(flushCallbacks);
  4295. // In problematic UIWebViews, Promise.then doesn't completely break, but
  4296. // it can get stuck in a weird state where callbacks are pushed into the
  4297. // microtask queue but the queue isn't being flushed, until the browser
  4298. // needs to do some other work, e.g. handle a timer. Therefore we can
  4299. // "force" the microtask queue to be flushed by adding an empty timer.
  4300. if (isIOS) { setTimeout(noop); }
  4301. };
  4302. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  4303. isNative(MutationObserver) ||
  4304. // PhantomJS and iOS 7.x
  4305. MutationObserver.toString() === '[object MutationObserverConstructor]'
  4306. )) {
  4307. // Use MutationObserver where native Promise is not available,
  4308. // e.g. PhantomJS, iOS7, Android 4.4
  4309. // (#6466 MutationObserver is unreliable in IE11)
  4310. var counter = 1;
  4311. var observer = new MutationObserver(flushCallbacks);
  4312. var textNode = document.createTextNode(String(counter));
  4313. observer.observe(textNode, {
  4314. characterData: true
  4315. });
  4316. timerFunc = function () {
  4317. counter = (counter + 1) % 2;
  4318. textNode.data = String(counter);
  4319. };
  4320. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  4321. // Fallback to setImmediate.
  4322. // Technically it leverages the (macro) task queue,
  4323. // but it is still a better choice than setTimeout.
  4324. timerFunc = function () {
  4325. setImmediate(flushCallbacks);
  4326. };
  4327. } else {
  4328. // Fallback to setTimeout.
  4329. timerFunc = function () {
  4330. setTimeout(flushCallbacks, 0);
  4331. };
  4332. }
  4333. function nextTick (cb, ctx) {
  4334. var _resolve;
  4335. callbacks.push(function () {
  4336. if (cb) {
  4337. try {
  4338. cb.call(ctx);
  4339. } catch (e) {
  4340. handleError(e, ctx, 'nextTick');
  4341. }
  4342. } else if (_resolve) {
  4343. _resolve(ctx);
  4344. }
  4345. });
  4346. if (!pending) {
  4347. pending = true;
  4348. timerFunc();
  4349. }
  4350. // $flow-disable-line
  4351. if (!cb && typeof Promise !== 'undefined') {
  4352. return new Promise(function (resolve) {
  4353. _resolve = resolve;
  4354. })
  4355. }
  4356. }
  4357. /* */
  4358. /* not type checking this file because flow doesn't play well with Proxy */
  4359. var initProxy;
  4360. if (true) {
  4361. var allowedGlobals = makeMap(
  4362. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  4363. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  4364. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  4365. 'require' // for Webpack/Browserify
  4366. );
  4367. var warnNonPresent = function (target, key) {
  4368. warn(
  4369. "Property or method \"" + key + "\" is not defined on the instance but " +
  4370. 'referenced during render. Make sure that this property is reactive, ' +
  4371. 'either in the data option, or for class-based components, by ' +
  4372. 'initializing the property. ' +
  4373. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  4374. target
  4375. );
  4376. };
  4377. var warnReservedPrefix = function (target, key) {
  4378. warn(
  4379. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  4380. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  4381. 'prevent conflicts with Vue internals. ' +
  4382. 'See: https://vuejs.org/v2/api/#data',
  4383. target
  4384. );
  4385. };
  4386. var hasProxy =
  4387. typeof Proxy !== 'undefined' && isNative(Proxy);
  4388. if (hasProxy) {
  4389. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  4390. config.keyCodes = new Proxy(config.keyCodes, {
  4391. set: function set (target, key, value) {
  4392. if (isBuiltInModifier(key)) {
  4393. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  4394. return false
  4395. } else {
  4396. target[key] = value;
  4397. return true
  4398. }
  4399. }
  4400. });
  4401. }
  4402. var hasHandler = {
  4403. has: function has (target, key) {
  4404. var has = key in target;
  4405. var isAllowed = allowedGlobals(key) ||
  4406. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  4407. if (!has && !isAllowed) {
  4408. if (key in target.$data) { warnReservedPrefix(target, key); }
  4409. else { warnNonPresent(target, key); }
  4410. }
  4411. return has || !isAllowed
  4412. }
  4413. };
  4414. var getHandler = {
  4415. get: function get (target, key) {
  4416. if (typeof key === 'string' && !(key in target)) {
  4417. if (key in target.$data) { warnReservedPrefix(target, key); }
  4418. else { warnNonPresent(target, key); }
  4419. }
  4420. return target[key]
  4421. }
  4422. };
  4423. initProxy = function initProxy (vm) {
  4424. if (hasProxy) {
  4425. // determine which proxy handler to use
  4426. var options = vm.$options;
  4427. var handlers = options.render && options.render._withStripped
  4428. ? getHandler
  4429. : hasHandler;
  4430. vm._renderProxy = new Proxy(vm, handlers);
  4431. } else {
  4432. vm._renderProxy = vm;
  4433. }
  4434. };
  4435. }
  4436. /* */
  4437. var seenObjects = new _Set();
  4438. /**
  4439. * Recursively traverse an object to evoke all converted
  4440. * getters, so that every nested property inside the object
  4441. * is collected as a "deep" dependency.
  4442. */
  4443. function traverse (val) {
  4444. _traverse(val, seenObjects);
  4445. seenObjects.clear();
  4446. }
  4447. function _traverse (val, seen) {
  4448. var i, keys;
  4449. var isA = Array.isArray(val);
  4450. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  4451. return
  4452. }
  4453. if (val.__ob__) {
  4454. var depId = val.__ob__.dep.id;
  4455. if (seen.has(depId)) {
  4456. return
  4457. }
  4458. seen.add(depId);
  4459. }
  4460. if (isA) {
  4461. i = val.length;
  4462. while (i--) { _traverse(val[i], seen); }
  4463. } else {
  4464. keys = Object.keys(val);
  4465. i = keys.length;
  4466. while (i--) { _traverse(val[keys[i]], seen); }
  4467. }
  4468. }
  4469. var mark;
  4470. var measure;
  4471. if (true) {
  4472. var perf = inBrowser && window.performance;
  4473. /* istanbul ignore if */
  4474. if (
  4475. perf &&
  4476. perf.mark &&
  4477. perf.measure &&
  4478. perf.clearMarks &&
  4479. perf.clearMeasures
  4480. ) {
  4481. mark = function (tag) { return perf.mark(tag); };
  4482. measure = function (name, startTag, endTag) {
  4483. perf.measure(name, startTag, endTag);
  4484. perf.clearMarks(startTag);
  4485. perf.clearMarks(endTag);
  4486. // perf.clearMeasures(name)
  4487. };
  4488. }
  4489. }
  4490. /* */
  4491. var normalizeEvent = cached(function (name) {
  4492. var passive = name.charAt(0) === '&';
  4493. name = passive ? name.slice(1) : name;
  4494. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  4495. name = once$$1 ? name.slice(1) : name;
  4496. var capture = name.charAt(0) === '!';
  4497. name = capture ? name.slice(1) : name;
  4498. return {
  4499. name: name,
  4500. once: once$$1,
  4501. capture: capture,
  4502. passive: passive
  4503. }
  4504. });
  4505. function createFnInvoker (fns, vm) {
  4506. function invoker () {
  4507. var arguments$1 = arguments;
  4508. var fns = invoker.fns;
  4509. if (Array.isArray(fns)) {
  4510. var cloned = fns.slice();
  4511. for (var i = 0; i < cloned.length; i++) {
  4512. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  4513. }
  4514. } else {
  4515. // return handler return value for single handlers
  4516. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  4517. }
  4518. }
  4519. invoker.fns = fns;
  4520. return invoker
  4521. }
  4522. function updateListeners (
  4523. on,
  4524. oldOn,
  4525. add,
  4526. remove$$1,
  4527. createOnceHandler,
  4528. vm
  4529. ) {
  4530. var name, def$$1, cur, old, event;
  4531. for (name in on) {
  4532. def$$1 = cur = on[name];
  4533. old = oldOn[name];
  4534. event = normalizeEvent(name);
  4535. if (isUndef(cur)) {
  4536. true && warn(
  4537. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  4538. vm
  4539. );
  4540. } else if (isUndef(old)) {
  4541. if (isUndef(cur.fns)) {
  4542. cur = on[name] = createFnInvoker(cur, vm);
  4543. }
  4544. if (isTrue(event.once)) {
  4545. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  4546. }
  4547. add(event.name, cur, event.capture, event.passive, event.params);
  4548. } else if (cur !== old) {
  4549. old.fns = cur;
  4550. on[name] = old;
  4551. }
  4552. }
  4553. for (name in oldOn) {
  4554. if (isUndef(on[name])) {
  4555. event = normalizeEvent(name);
  4556. remove$$1(event.name, oldOn[name], event.capture);
  4557. }
  4558. }
  4559. }
  4560. /* */
  4561. /* */
  4562. // fixed by xxxxxx (mp properties)
  4563. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  4564. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  4565. if (isUndef(propOptions)) {
  4566. return res
  4567. }
  4568. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  4569. var attrs = data.attrs;
  4570. var props = data.props;
  4571. if (isDef(attrs) || isDef(props)) {
  4572. for (var key in propOptions) {
  4573. var altKey = hyphenate(key);
  4574. var result = checkProp(res, props, key, altKey, true) ||
  4575. checkProp(res, attrs, key, altKey, false);
  4576. // externalClass
  4577. if (
  4578. result &&
  4579. res[key] &&
  4580. externalClasses.indexOf(altKey) !== -1 &&
  4581. context[camelize(res[key])]
  4582. ) {
  4583. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  4584. res[key] = context[camelize(res[key])];
  4585. }
  4586. }
  4587. }
  4588. return res
  4589. }
  4590. function extractPropsFromVNodeData (
  4591. data,
  4592. Ctor,
  4593. tag,
  4594. context// fixed by xxxxxx
  4595. ) {
  4596. // we are only extracting raw values here.
  4597. // validation and default values are handled in the child
  4598. // component itself.
  4599. var propOptions = Ctor.options.props;
  4600. if (isUndef(propOptions)) {
  4601. // fixed by xxxxxx
  4602. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  4603. }
  4604. var res = {};
  4605. var attrs = data.attrs;
  4606. var props = data.props;
  4607. if (isDef(attrs) || isDef(props)) {
  4608. for (var key in propOptions) {
  4609. var altKey = hyphenate(key);
  4610. if (true) {
  4611. var keyInLowerCase = key.toLowerCase();
  4612. if (
  4613. key !== keyInLowerCase &&
  4614. attrs && hasOwn(attrs, keyInLowerCase)
  4615. ) {
  4616. tip(
  4617. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  4618. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  4619. " \"" + key + "\". " +
  4620. "Note that HTML attributes are case-insensitive and camelCased " +
  4621. "props need to use their kebab-case equivalents when using in-DOM " +
  4622. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  4623. );
  4624. }
  4625. }
  4626. checkProp(res, props, key, altKey, true) ||
  4627. checkProp(res, attrs, key, altKey, false);
  4628. }
  4629. }
  4630. // fixed by xxxxxx
  4631. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  4632. }
  4633. function checkProp (
  4634. res,
  4635. hash,
  4636. key,
  4637. altKey,
  4638. preserve
  4639. ) {
  4640. if (isDef(hash)) {
  4641. if (hasOwn(hash, key)) {
  4642. res[key] = hash[key];
  4643. if (!preserve) {
  4644. delete hash[key];
  4645. }
  4646. return true
  4647. } else if (hasOwn(hash, altKey)) {
  4648. res[key] = hash[altKey];
  4649. if (!preserve) {
  4650. delete hash[altKey];
  4651. }
  4652. return true
  4653. }
  4654. }
  4655. return false
  4656. }
  4657. /* */
  4658. // The template compiler attempts to minimize the need for normalization by
  4659. // statically analyzing the template at compile time.
  4660. //
  4661. // For plain HTML markup, normalization can be completely skipped because the
  4662. // generated render function is guaranteed to return Array<VNode>. There are
  4663. // two cases where extra normalization is needed:
  4664. // 1. When the children contains components - because a functional component
  4665. // may return an Array instead of a single root. In this case, just a simple
  4666. // normalization is needed - if any child is an Array, we flatten the whole
  4667. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  4668. // because functional components already normalize their own children.
  4669. function simpleNormalizeChildren (children) {
  4670. for (var i = 0; i < children.length; i++) {
  4671. if (Array.isArray(children[i])) {
  4672. return Array.prototype.concat.apply([], children)
  4673. }
  4674. }
  4675. return children
  4676. }
  4677. // 2. When the children contains constructs that always generated nested Arrays,
  4678. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  4679. // with hand-written render functions / JSX. In such cases a full normalization
  4680. // is needed to cater to all possible types of children values.
  4681. function normalizeChildren (children) {
  4682. return isPrimitive(children)
  4683. ? [createTextVNode(children)]
  4684. : Array.isArray(children)
  4685. ? normalizeArrayChildren(children)
  4686. : undefined
  4687. }
  4688. function isTextNode (node) {
  4689. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  4690. }
  4691. function normalizeArrayChildren (children, nestedIndex) {
  4692. var res = [];
  4693. var i, c, lastIndex, last;
  4694. for (i = 0; i < children.length; i++) {
  4695. c = children[i];
  4696. if (isUndef(c) || typeof c === 'boolean') { continue }
  4697. lastIndex = res.length - 1;
  4698. last = res[lastIndex];
  4699. // nested
  4700. if (Array.isArray(c)) {
  4701. if (c.length > 0) {
  4702. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  4703. // merge adjacent text nodes
  4704. if (isTextNode(c[0]) && isTextNode(last)) {
  4705. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  4706. c.shift();
  4707. }
  4708. res.push.apply(res, c);
  4709. }
  4710. } else if (isPrimitive(c)) {
  4711. if (isTextNode(last)) {
  4712. // merge adjacent text nodes
  4713. // this is necessary for SSR hydration because text nodes are
  4714. // essentially merged when rendered to HTML strings
  4715. res[lastIndex] = createTextVNode(last.text + c);
  4716. } else if (c !== '') {
  4717. // convert primitive to vnode
  4718. res.push(createTextVNode(c));
  4719. }
  4720. } else {
  4721. if (isTextNode(c) && isTextNode(last)) {
  4722. // merge adjacent text nodes
  4723. res[lastIndex] = createTextVNode(last.text + c.text);
  4724. } else {
  4725. // default key for nested array children (likely generated by v-for)
  4726. if (isTrue(children._isVList) &&
  4727. isDef(c.tag) &&
  4728. isUndef(c.key) &&
  4729. isDef(nestedIndex)) {
  4730. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  4731. }
  4732. res.push(c);
  4733. }
  4734. }
  4735. }
  4736. return res
  4737. }
  4738. /* */
  4739. function initProvide (vm) {
  4740. var provide = vm.$options.provide;
  4741. if (provide) {
  4742. vm._provided = typeof provide === 'function'
  4743. ? provide.call(vm)
  4744. : provide;
  4745. }
  4746. }
  4747. function initInjections (vm) {
  4748. var result = resolveInject(vm.$options.inject, vm);
  4749. if (result) {
  4750. toggleObserving(false);
  4751. Object.keys(result).forEach(function (key) {
  4752. /* istanbul ignore else */
  4753. if (true) {
  4754. defineReactive$$1(vm, key, result[key], function () {
  4755. warn(
  4756. "Avoid mutating an injected value directly since the changes will be " +
  4757. "overwritten whenever the provided component re-renders. " +
  4758. "injection being mutated: \"" + key + "\"",
  4759. vm
  4760. );
  4761. });
  4762. } else {}
  4763. });
  4764. toggleObserving(true);
  4765. }
  4766. }
  4767. function resolveInject (inject, vm) {
  4768. if (inject) {
  4769. // inject is :any because flow is not smart enough to figure out cached
  4770. var result = Object.create(null);
  4771. var keys = hasSymbol
  4772. ? Reflect.ownKeys(inject)
  4773. : Object.keys(inject);
  4774. for (var i = 0; i < keys.length; i++) {
  4775. var key = keys[i];
  4776. // #6574 in case the inject object is observed...
  4777. if (key === '__ob__') { continue }
  4778. var provideKey = inject[key].from;
  4779. var source = vm;
  4780. while (source) {
  4781. if (source._provided && hasOwn(source._provided, provideKey)) {
  4782. result[key] = source._provided[provideKey];
  4783. break
  4784. }
  4785. source = source.$parent;
  4786. }
  4787. if (!source) {
  4788. if ('default' in inject[key]) {
  4789. var provideDefault = inject[key].default;
  4790. result[key] = typeof provideDefault === 'function'
  4791. ? provideDefault.call(vm)
  4792. : provideDefault;
  4793. } else if (true) {
  4794. warn(("Injection \"" + key + "\" not found"), vm);
  4795. }
  4796. }
  4797. }
  4798. return result
  4799. }
  4800. }
  4801. /* */
  4802. /**
  4803. * Runtime helper for resolving raw children VNodes into a slot object.
  4804. */
  4805. function resolveSlots (
  4806. children,
  4807. context
  4808. ) {
  4809. if (!children || !children.length) {
  4810. return {}
  4811. }
  4812. var slots = {};
  4813. for (var i = 0, l = children.length; i < l; i++) {
  4814. var child = children[i];
  4815. var data = child.data;
  4816. // remove slot attribute if the node is resolved as a Vue slot node
  4817. if (data && data.attrs && data.attrs.slot) {
  4818. delete data.attrs.slot;
  4819. }
  4820. // named slots should only be respected if the vnode was rendered in the
  4821. // same context.
  4822. if ((child.context === context || child.fnContext === context) &&
  4823. data && data.slot != null
  4824. ) {
  4825. var name = data.slot;
  4826. var slot = (slots[name] || (slots[name] = []));
  4827. if (child.tag === 'template') {
  4828. slot.push.apply(slot, child.children || []);
  4829. } else {
  4830. slot.push(child);
  4831. }
  4832. } else {
  4833. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  4834. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  4835. (slots['page'] || (slots['page'] = [])).push(child);
  4836. }else{
  4837. (slots.default || (slots.default = [])).push(child);
  4838. }
  4839. }
  4840. }
  4841. // ignore slots that contains only whitespace
  4842. for (var name$1 in slots) {
  4843. if (slots[name$1].every(isWhitespace)) {
  4844. delete slots[name$1];
  4845. }
  4846. }
  4847. return slots
  4848. }
  4849. function isWhitespace (node) {
  4850. return (node.isComment && !node.asyncFactory) || node.text === ' '
  4851. }
  4852. /* */
  4853. function normalizeScopedSlots (
  4854. slots,
  4855. normalSlots,
  4856. prevSlots
  4857. ) {
  4858. var res;
  4859. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  4860. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  4861. var key = slots && slots.$key;
  4862. if (!slots) {
  4863. res = {};
  4864. } else if (slots._normalized) {
  4865. // fast path 1: child component re-render only, parent did not change
  4866. return slots._normalized
  4867. } else if (
  4868. isStable &&
  4869. prevSlots &&
  4870. prevSlots !== emptyObject &&
  4871. key === prevSlots.$key &&
  4872. !hasNormalSlots &&
  4873. !prevSlots.$hasNormal
  4874. ) {
  4875. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  4876. // only need to normalize once
  4877. return prevSlots
  4878. } else {
  4879. res = {};
  4880. for (var key$1 in slots) {
  4881. if (slots[key$1] && key$1[0] !== '$') {
  4882. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  4883. }
  4884. }
  4885. }
  4886. // expose normal slots on scopedSlots
  4887. for (var key$2 in normalSlots) {
  4888. if (!(key$2 in res)) {
  4889. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  4890. }
  4891. }
  4892. // avoriaz seems to mock a non-extensible $scopedSlots object
  4893. // and when that is passed down this would cause an error
  4894. if (slots && Object.isExtensible(slots)) {
  4895. (slots)._normalized = res;
  4896. }
  4897. def(res, '$stable', isStable);
  4898. def(res, '$key', key);
  4899. def(res, '$hasNormal', hasNormalSlots);
  4900. return res
  4901. }
  4902. function normalizeScopedSlot(normalSlots, key, fn) {
  4903. var normalized = function () {
  4904. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  4905. res = res && typeof res === 'object' && !Array.isArray(res)
  4906. ? [res] // single vnode
  4907. : normalizeChildren(res);
  4908. return res && (
  4909. res.length === 0 ||
  4910. (res.length === 1 && res[0].isComment) // #9658
  4911. ) ? undefined
  4912. : res
  4913. };
  4914. // this is a slot using the new v-slot syntax without scope. although it is
  4915. // compiled as a scoped slot, render fn users would expect it to be present
  4916. // on this.$slots because the usage is semantically a normal slot.
  4917. if (fn.proxy) {
  4918. Object.defineProperty(normalSlots, key, {
  4919. get: normalized,
  4920. enumerable: true,
  4921. configurable: true
  4922. });
  4923. }
  4924. return normalized
  4925. }
  4926. function proxyNormalSlot(slots, key) {
  4927. return function () { return slots[key]; }
  4928. }
  4929. /* */
  4930. /**
  4931. * Runtime helper for rendering v-for lists.
  4932. */
  4933. function renderList (
  4934. val,
  4935. render
  4936. ) {
  4937. var ret, i, l, keys, key;
  4938. if (Array.isArray(val) || typeof val === 'string') {
  4939. ret = new Array(val.length);
  4940. for (i = 0, l = val.length; i < l; i++) {
  4941. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  4942. }
  4943. } else if (typeof val === 'number') {
  4944. ret = new Array(val);
  4945. for (i = 0; i < val; i++) {
  4946. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  4947. }
  4948. } else if (isObject(val)) {
  4949. if (hasSymbol && val[Symbol.iterator]) {
  4950. ret = [];
  4951. var iterator = val[Symbol.iterator]();
  4952. var result = iterator.next();
  4953. while (!result.done) {
  4954. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  4955. result = iterator.next();
  4956. }
  4957. } else {
  4958. keys = Object.keys(val);
  4959. ret = new Array(keys.length);
  4960. for (i = 0, l = keys.length; i < l; i++) {
  4961. key = keys[i];
  4962. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  4963. }
  4964. }
  4965. }
  4966. if (!isDef(ret)) {
  4967. ret = [];
  4968. }
  4969. (ret)._isVList = true;
  4970. return ret
  4971. }
  4972. /* */
  4973. /**
  4974. * Runtime helper for rendering <slot>
  4975. */
  4976. function renderSlot (
  4977. name,
  4978. fallback,
  4979. props,
  4980. bindObject
  4981. ) {
  4982. var scopedSlotFn = this.$scopedSlots[name];
  4983. var nodes;
  4984. if (scopedSlotFn) { // scoped slot
  4985. props = props || {};
  4986. if (bindObject) {
  4987. if ( true && !isObject(bindObject)) {
  4988. warn(
  4989. 'slot v-bind without argument expects an Object',
  4990. this
  4991. );
  4992. }
  4993. props = extend(extend({}, bindObject), props);
  4994. }
  4995. // fixed by xxxxxx app-plus scopedSlot
  4996. nodes = scopedSlotFn(props, this, props._i) || fallback;
  4997. } else {
  4998. nodes = this.$slots[name] || fallback;
  4999. }
  5000. var target = props && props.slot;
  5001. if (target) {
  5002. return this.$createElement('template', { slot: target }, nodes)
  5003. } else {
  5004. return nodes
  5005. }
  5006. }
  5007. /* */
  5008. /**
  5009. * Runtime helper for resolving filters
  5010. */
  5011. function resolveFilter (id) {
  5012. return resolveAsset(this.$options, 'filters', id, true) || identity
  5013. }
  5014. /* */
  5015. function isKeyNotMatch (expect, actual) {
  5016. if (Array.isArray(expect)) {
  5017. return expect.indexOf(actual) === -1
  5018. } else {
  5019. return expect !== actual
  5020. }
  5021. }
  5022. /**
  5023. * Runtime helper for checking keyCodes from config.
  5024. * exposed as Vue.prototype._k
  5025. * passing in eventKeyName as last argument separately for backwards compat
  5026. */
  5027. function checkKeyCodes (
  5028. eventKeyCode,
  5029. key,
  5030. builtInKeyCode,
  5031. eventKeyName,
  5032. builtInKeyName
  5033. ) {
  5034. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  5035. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  5036. return isKeyNotMatch(builtInKeyName, eventKeyName)
  5037. } else if (mappedKeyCode) {
  5038. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  5039. } else if (eventKeyName) {
  5040. return hyphenate(eventKeyName) !== key
  5041. }
  5042. }
  5043. /* */
  5044. /**
  5045. * Runtime helper for merging v-bind="object" into a VNode's data.
  5046. */
  5047. function bindObjectProps (
  5048. data,
  5049. tag,
  5050. value,
  5051. asProp,
  5052. isSync
  5053. ) {
  5054. if (value) {
  5055. if (!isObject(value)) {
  5056. true && warn(
  5057. 'v-bind without argument expects an Object or Array value',
  5058. this
  5059. );
  5060. } else {
  5061. if (Array.isArray(value)) {
  5062. value = toObject(value);
  5063. }
  5064. var hash;
  5065. var loop = function ( key ) {
  5066. if (
  5067. key === 'class' ||
  5068. key === 'style' ||
  5069. isReservedAttribute(key)
  5070. ) {
  5071. hash = data;
  5072. } else {
  5073. var type = data.attrs && data.attrs.type;
  5074. hash = asProp || config.mustUseProp(tag, type, key)
  5075. ? data.domProps || (data.domProps = {})
  5076. : data.attrs || (data.attrs = {});
  5077. }
  5078. var camelizedKey = camelize(key);
  5079. var hyphenatedKey = hyphenate(key);
  5080. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  5081. hash[key] = value[key];
  5082. if (isSync) {
  5083. var on = data.on || (data.on = {});
  5084. on[("update:" + key)] = function ($event) {
  5085. value[key] = $event;
  5086. };
  5087. }
  5088. }
  5089. };
  5090. for (var key in value) loop( key );
  5091. }
  5092. }
  5093. return data
  5094. }
  5095. /* */
  5096. /**
  5097. * Runtime helper for rendering static trees.
  5098. */
  5099. function renderStatic (
  5100. index,
  5101. isInFor
  5102. ) {
  5103. var cached = this._staticTrees || (this._staticTrees = []);
  5104. var tree = cached[index];
  5105. // if has already-rendered static tree and not inside v-for,
  5106. // we can reuse the same tree.
  5107. if (tree && !isInFor) {
  5108. return tree
  5109. }
  5110. // otherwise, render a fresh tree.
  5111. tree = cached[index] = this.$options.staticRenderFns[index].call(
  5112. this._renderProxy,
  5113. null,
  5114. this // for render fns generated for functional component templates
  5115. );
  5116. markStatic(tree, ("__static__" + index), false);
  5117. return tree
  5118. }
  5119. /**
  5120. * Runtime helper for v-once.
  5121. * Effectively it means marking the node as static with a unique key.
  5122. */
  5123. function markOnce (
  5124. tree,
  5125. index,
  5126. key
  5127. ) {
  5128. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  5129. return tree
  5130. }
  5131. function markStatic (
  5132. tree,
  5133. key,
  5134. isOnce
  5135. ) {
  5136. if (Array.isArray(tree)) {
  5137. for (var i = 0; i < tree.length; i++) {
  5138. if (tree[i] && typeof tree[i] !== 'string') {
  5139. markStaticNode(tree[i], (key + "_" + i), isOnce);
  5140. }
  5141. }
  5142. } else {
  5143. markStaticNode(tree, key, isOnce);
  5144. }
  5145. }
  5146. function markStaticNode (node, key, isOnce) {
  5147. node.isStatic = true;
  5148. node.key = key;
  5149. node.isOnce = isOnce;
  5150. }
  5151. /* */
  5152. function bindObjectListeners (data, value) {
  5153. if (value) {
  5154. if (!isPlainObject(value)) {
  5155. true && warn(
  5156. 'v-on without argument expects an Object value',
  5157. this
  5158. );
  5159. } else {
  5160. var on = data.on = data.on ? extend({}, data.on) : {};
  5161. for (var key in value) {
  5162. var existing = on[key];
  5163. var ours = value[key];
  5164. on[key] = existing ? [].concat(existing, ours) : ours;
  5165. }
  5166. }
  5167. }
  5168. return data
  5169. }
  5170. /* */
  5171. function resolveScopedSlots (
  5172. fns, // see flow/vnode
  5173. res,
  5174. // the following are added in 2.6
  5175. hasDynamicKeys,
  5176. contentHashKey
  5177. ) {
  5178. res = res || { $stable: !hasDynamicKeys };
  5179. for (var i = 0; i < fns.length; i++) {
  5180. var slot = fns[i];
  5181. if (Array.isArray(slot)) {
  5182. resolveScopedSlots(slot, res, hasDynamicKeys);
  5183. } else if (slot) {
  5184. // marker for reverse proxying v-slot without scope on this.$slots
  5185. if (slot.proxy) {
  5186. slot.fn.proxy = true;
  5187. }
  5188. res[slot.key] = slot.fn;
  5189. }
  5190. }
  5191. if (contentHashKey) {
  5192. (res).$key = contentHashKey;
  5193. }
  5194. return res
  5195. }
  5196. /* */
  5197. function bindDynamicKeys (baseObj, values) {
  5198. for (var i = 0; i < values.length; i += 2) {
  5199. var key = values[i];
  5200. if (typeof key === 'string' && key) {
  5201. baseObj[values[i]] = values[i + 1];
  5202. } else if ( true && key !== '' && key !== null) {
  5203. // null is a special value for explicitly removing a binding
  5204. warn(
  5205. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  5206. this
  5207. );
  5208. }
  5209. }
  5210. return baseObj
  5211. }
  5212. // helper to dynamically append modifier runtime markers to event names.
  5213. // ensure only append when value is already string, otherwise it will be cast
  5214. // to string and cause the type check to miss.
  5215. function prependModifier (value, symbol) {
  5216. return typeof value === 'string' ? symbol + value : value
  5217. }
  5218. /* */
  5219. function installRenderHelpers (target) {
  5220. target._o = markOnce;
  5221. target._n = toNumber;
  5222. target._s = toString;
  5223. target._l = renderList;
  5224. target._t = renderSlot;
  5225. target._q = looseEqual;
  5226. target._i = looseIndexOf;
  5227. target._m = renderStatic;
  5228. target._f = resolveFilter;
  5229. target._k = checkKeyCodes;
  5230. target._b = bindObjectProps;
  5231. target._v = createTextVNode;
  5232. target._e = createEmptyVNode;
  5233. target._u = resolveScopedSlots;
  5234. target._g = bindObjectListeners;
  5235. target._d = bindDynamicKeys;
  5236. target._p = prependModifier;
  5237. }
  5238. /* */
  5239. function FunctionalRenderContext (
  5240. data,
  5241. props,
  5242. children,
  5243. parent,
  5244. Ctor
  5245. ) {
  5246. var this$1 = this;
  5247. var options = Ctor.options;
  5248. // ensure the createElement function in functional components
  5249. // gets a unique context - this is necessary for correct named slot check
  5250. var contextVm;
  5251. if (hasOwn(parent, '_uid')) {
  5252. contextVm = Object.create(parent);
  5253. // $flow-disable-line
  5254. contextVm._original = parent;
  5255. } else {
  5256. // the context vm passed in is a functional context as well.
  5257. // in this case we want to make sure we are able to get a hold to the
  5258. // real context instance.
  5259. contextVm = parent;
  5260. // $flow-disable-line
  5261. parent = parent._original;
  5262. }
  5263. var isCompiled = isTrue(options._compiled);
  5264. var needNormalization = !isCompiled;
  5265. this.data = data;
  5266. this.props = props;
  5267. this.children = children;
  5268. this.parent = parent;
  5269. this.listeners = data.on || emptyObject;
  5270. this.injections = resolveInject(options.inject, parent);
  5271. this.slots = function () {
  5272. if (!this$1.$slots) {
  5273. normalizeScopedSlots(
  5274. data.scopedSlots,
  5275. this$1.$slots = resolveSlots(children, parent)
  5276. );
  5277. }
  5278. return this$1.$slots
  5279. };
  5280. Object.defineProperty(this, 'scopedSlots', ({
  5281. enumerable: true,
  5282. get: function get () {
  5283. return normalizeScopedSlots(data.scopedSlots, this.slots())
  5284. }
  5285. }));
  5286. // support for compiled functional template
  5287. if (isCompiled) {
  5288. // exposing $options for renderStatic()
  5289. this.$options = options;
  5290. // pre-resolve slots for renderSlot()
  5291. this.$slots = this.slots();
  5292. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  5293. }
  5294. if (options._scopeId) {
  5295. this._c = function (a, b, c, d) {
  5296. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  5297. if (vnode && !Array.isArray(vnode)) {
  5298. vnode.fnScopeId = options._scopeId;
  5299. vnode.fnContext = parent;
  5300. }
  5301. return vnode
  5302. };
  5303. } else {
  5304. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  5305. }
  5306. }
  5307. installRenderHelpers(FunctionalRenderContext.prototype);
  5308. function createFunctionalComponent (
  5309. Ctor,
  5310. propsData,
  5311. data,
  5312. contextVm,
  5313. children
  5314. ) {
  5315. var options = Ctor.options;
  5316. var props = {};
  5317. var propOptions = options.props;
  5318. if (isDef(propOptions)) {
  5319. for (var key in propOptions) {
  5320. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  5321. }
  5322. } else {
  5323. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  5324. if (isDef(data.props)) { mergeProps(props, data.props); }
  5325. }
  5326. var renderContext = new FunctionalRenderContext(
  5327. data,
  5328. props,
  5329. children,
  5330. contextVm,
  5331. Ctor
  5332. );
  5333. var vnode = options.render.call(null, renderContext._c, renderContext);
  5334. if (vnode instanceof VNode) {
  5335. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  5336. } else if (Array.isArray(vnode)) {
  5337. var vnodes = normalizeChildren(vnode) || [];
  5338. var res = new Array(vnodes.length);
  5339. for (var i = 0; i < vnodes.length; i++) {
  5340. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  5341. }
  5342. return res
  5343. }
  5344. }
  5345. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  5346. // #7817 clone node before setting fnContext, otherwise if the node is reused
  5347. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  5348. // that should not be matched to match.
  5349. var clone = cloneVNode(vnode);
  5350. clone.fnContext = contextVm;
  5351. clone.fnOptions = options;
  5352. if (true) {
  5353. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  5354. }
  5355. if (data.slot) {
  5356. (clone.data || (clone.data = {})).slot = data.slot;
  5357. }
  5358. return clone
  5359. }
  5360. function mergeProps (to, from) {
  5361. for (var key in from) {
  5362. to[camelize(key)] = from[key];
  5363. }
  5364. }
  5365. /* */
  5366. /* */
  5367. /* */
  5368. /* */
  5369. // inline hooks to be invoked on component VNodes during patch
  5370. var componentVNodeHooks = {
  5371. init: function init (vnode, hydrating) {
  5372. if (
  5373. vnode.componentInstance &&
  5374. !vnode.componentInstance._isDestroyed &&
  5375. vnode.data.keepAlive
  5376. ) {
  5377. // kept-alive components, treat as a patch
  5378. var mountedNode = vnode; // work around flow
  5379. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  5380. } else {
  5381. var child = vnode.componentInstance = createComponentInstanceForVnode(
  5382. vnode,
  5383. activeInstance
  5384. );
  5385. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  5386. }
  5387. },
  5388. prepatch: function prepatch (oldVnode, vnode) {
  5389. var options = vnode.componentOptions;
  5390. var child = vnode.componentInstance = oldVnode.componentInstance;
  5391. updateChildComponent(
  5392. child,
  5393. options.propsData, // updated props
  5394. options.listeners, // updated listeners
  5395. vnode, // new parent vnode
  5396. options.children // new children
  5397. );
  5398. },
  5399. insert: function insert (vnode) {
  5400. var context = vnode.context;
  5401. var componentInstance = vnode.componentInstance;
  5402. if (!componentInstance._isMounted) {
  5403. callHook(componentInstance, 'onServiceCreated');
  5404. callHook(componentInstance, 'onServiceAttached');
  5405. componentInstance._isMounted = true;
  5406. callHook(componentInstance, 'mounted');
  5407. }
  5408. if (vnode.data.keepAlive) {
  5409. if (context._isMounted) {
  5410. // vue-router#1212
  5411. // During updates, a kept-alive component's child components may
  5412. // change, so directly walking the tree here may call activated hooks
  5413. // on incorrect children. Instead we push them into a queue which will
  5414. // be processed after the whole patch process ended.
  5415. queueActivatedComponent(componentInstance);
  5416. } else {
  5417. activateChildComponent(componentInstance, true /* direct */);
  5418. }
  5419. }
  5420. },
  5421. destroy: function destroy (vnode) {
  5422. var componentInstance = vnode.componentInstance;
  5423. if (!componentInstance._isDestroyed) {
  5424. if (!vnode.data.keepAlive) {
  5425. componentInstance.$destroy();
  5426. } else {
  5427. deactivateChildComponent(componentInstance, true /* direct */);
  5428. }
  5429. }
  5430. }
  5431. };
  5432. var hooksToMerge = Object.keys(componentVNodeHooks);
  5433. function createComponent (
  5434. Ctor,
  5435. data,
  5436. context,
  5437. children,
  5438. tag
  5439. ) {
  5440. if (isUndef(Ctor)) {
  5441. return
  5442. }
  5443. var baseCtor = context.$options._base;
  5444. // plain options object: turn it into a constructor
  5445. if (isObject(Ctor)) {
  5446. Ctor = baseCtor.extend(Ctor);
  5447. }
  5448. // if at this stage it's not a constructor or an async component factory,
  5449. // reject.
  5450. if (typeof Ctor !== 'function') {
  5451. if (true) {
  5452. warn(("Invalid Component definition: " + (String(Ctor))), context);
  5453. }
  5454. return
  5455. }
  5456. // async component
  5457. var asyncFactory;
  5458. if (isUndef(Ctor.cid)) {
  5459. asyncFactory = Ctor;
  5460. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  5461. if (Ctor === undefined) {
  5462. // return a placeholder node for async component, which is rendered
  5463. // as a comment node but preserves all the raw information for the node.
  5464. // the information will be used for async server-rendering and hydration.
  5465. return createAsyncPlaceholder(
  5466. asyncFactory,
  5467. data,
  5468. context,
  5469. children,
  5470. tag
  5471. )
  5472. }
  5473. }
  5474. data = data || {};
  5475. // resolve constructor options in case global mixins are applied after
  5476. // component constructor creation
  5477. resolveConstructorOptions(Ctor);
  5478. // transform component v-model data into props & events
  5479. if (isDef(data.model)) {
  5480. transformModel(Ctor.options, data);
  5481. }
  5482. // extract props
  5483. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  5484. // functional component
  5485. if (isTrue(Ctor.options.functional)) {
  5486. return createFunctionalComponent(Ctor, propsData, data, context, children)
  5487. }
  5488. // extract listeners, since these needs to be treated as
  5489. // child component listeners instead of DOM listeners
  5490. var listeners = data.on;
  5491. // replace with listeners with .native modifier
  5492. // so it gets processed during parent component patch.
  5493. data.on = data.nativeOn;
  5494. if (isTrue(Ctor.options.abstract)) {
  5495. // abstract components do not keep anything
  5496. // other than props & listeners & slot
  5497. // work around flow
  5498. var slot = data.slot;
  5499. data = {};
  5500. if (slot) {
  5501. data.slot = slot;
  5502. }
  5503. }
  5504. // install component management hooks onto the placeholder node
  5505. installComponentHooks(data);
  5506. // return a placeholder vnode
  5507. var name = Ctor.options.name || tag;
  5508. var vnode = new VNode(
  5509. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  5510. data, undefined, undefined, undefined, context,
  5511. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  5512. asyncFactory
  5513. );
  5514. return vnode
  5515. }
  5516. function createComponentInstanceForVnode (
  5517. vnode, // we know it's MountedComponentVNode but flow doesn't
  5518. parent // activeInstance in lifecycle state
  5519. ) {
  5520. var options = {
  5521. _isComponent: true,
  5522. _parentVnode: vnode,
  5523. parent: parent
  5524. };
  5525. // check inline-template render functions
  5526. var inlineTemplate = vnode.data.inlineTemplate;
  5527. if (isDef(inlineTemplate)) {
  5528. options.render = inlineTemplate.render;
  5529. options.staticRenderFns = inlineTemplate.staticRenderFns;
  5530. }
  5531. return new vnode.componentOptions.Ctor(options)
  5532. }
  5533. function installComponentHooks (data) {
  5534. var hooks = data.hook || (data.hook = {});
  5535. for (var i = 0; i < hooksToMerge.length; i++) {
  5536. var key = hooksToMerge[i];
  5537. var existing = hooks[key];
  5538. var toMerge = componentVNodeHooks[key];
  5539. if (existing !== toMerge && !(existing && existing._merged)) {
  5540. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  5541. }
  5542. }
  5543. }
  5544. function mergeHook$1 (f1, f2) {
  5545. var merged = function (a, b) {
  5546. // flow complains about extra args which is why we use any
  5547. f1(a, b);
  5548. f2(a, b);
  5549. };
  5550. merged._merged = true;
  5551. return merged
  5552. }
  5553. // transform component v-model info (value and callback) into
  5554. // prop and event handler respectively.
  5555. function transformModel (options, data) {
  5556. var prop = (options.model && options.model.prop) || 'value';
  5557. var event = (options.model && options.model.event) || 'input'
  5558. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  5559. var on = data.on || (data.on = {});
  5560. var existing = on[event];
  5561. var callback = data.model.callback;
  5562. if (isDef(existing)) {
  5563. if (
  5564. Array.isArray(existing)
  5565. ? existing.indexOf(callback) === -1
  5566. : existing !== callback
  5567. ) {
  5568. on[event] = [callback].concat(existing);
  5569. }
  5570. } else {
  5571. on[event] = callback;
  5572. }
  5573. }
  5574. /* */
  5575. var SIMPLE_NORMALIZE = 1;
  5576. var ALWAYS_NORMALIZE = 2;
  5577. // wrapper function for providing a more flexible interface
  5578. // without getting yelled at by flow
  5579. function createElement (
  5580. context,
  5581. tag,
  5582. data,
  5583. children,
  5584. normalizationType,
  5585. alwaysNormalize
  5586. ) {
  5587. if (Array.isArray(data) || isPrimitive(data)) {
  5588. normalizationType = children;
  5589. children = data;
  5590. data = undefined;
  5591. }
  5592. if (isTrue(alwaysNormalize)) {
  5593. normalizationType = ALWAYS_NORMALIZE;
  5594. }
  5595. return _createElement(context, tag, data, children, normalizationType)
  5596. }
  5597. function _createElement (
  5598. context,
  5599. tag,
  5600. data,
  5601. children,
  5602. normalizationType
  5603. ) {
  5604. if (isDef(data) && isDef((data).__ob__)) {
  5605. true && warn(
  5606. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  5607. 'Always create fresh vnode data objects in each render!',
  5608. context
  5609. );
  5610. return createEmptyVNode()
  5611. }
  5612. // object syntax in v-bind
  5613. if (isDef(data) && isDef(data.is)) {
  5614. tag = data.is;
  5615. }
  5616. if (!tag) {
  5617. // in case of component :is set to falsy value
  5618. return createEmptyVNode()
  5619. }
  5620. // warn against non-primitive key
  5621. if ( true &&
  5622. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  5623. ) {
  5624. {
  5625. warn(
  5626. 'Avoid using non-primitive value as key, ' +
  5627. 'use string/number value instead.',
  5628. context
  5629. );
  5630. }
  5631. }
  5632. // support single function children as default scoped slot
  5633. if (Array.isArray(children) &&
  5634. typeof children[0] === 'function'
  5635. ) {
  5636. data = data || {};
  5637. data.scopedSlots = { default: children[0] };
  5638. children.length = 0;
  5639. }
  5640. if (normalizationType === ALWAYS_NORMALIZE) {
  5641. children = normalizeChildren(children);
  5642. } else if (normalizationType === SIMPLE_NORMALIZE) {
  5643. children = simpleNormalizeChildren(children);
  5644. }
  5645. var vnode, ns;
  5646. if (typeof tag === 'string') {
  5647. var Ctor;
  5648. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  5649. if (config.isReservedTag(tag)) {
  5650. // platform built-in elements
  5651. if ( true && isDef(data) && isDef(data.nativeOn)) {
  5652. warn(
  5653. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  5654. context
  5655. );
  5656. }
  5657. vnode = new VNode(
  5658. config.parsePlatformTagName(tag), data, children,
  5659. undefined, undefined, context
  5660. );
  5661. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  5662. // component
  5663. vnode = createComponent(Ctor, data, context, children, tag);
  5664. } else {
  5665. // unknown or unlisted namespaced elements
  5666. // check at runtime because it may get assigned a namespace when its
  5667. // parent normalizes children
  5668. vnode = new VNode(
  5669. tag, data, children,
  5670. undefined, undefined, context
  5671. );
  5672. }
  5673. } else {
  5674. // direct component options / constructor
  5675. vnode = createComponent(tag, data, context, children);
  5676. }
  5677. if (Array.isArray(vnode)) {
  5678. return vnode
  5679. } else if (isDef(vnode)) {
  5680. if (isDef(ns)) { applyNS(vnode, ns); }
  5681. if (isDef(data)) { registerDeepBindings(data); }
  5682. return vnode
  5683. } else {
  5684. return createEmptyVNode()
  5685. }
  5686. }
  5687. function applyNS (vnode, ns, force) {
  5688. vnode.ns = ns;
  5689. if (vnode.tag === 'foreignObject') {
  5690. // use default namespace inside foreignObject
  5691. ns = undefined;
  5692. force = true;
  5693. }
  5694. if (isDef(vnode.children)) {
  5695. for (var i = 0, l = vnode.children.length; i < l; i++) {
  5696. var child = vnode.children[i];
  5697. if (isDef(child.tag) && (
  5698. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  5699. applyNS(child, ns, force);
  5700. }
  5701. }
  5702. }
  5703. }
  5704. // ref #5318
  5705. // necessary to ensure parent re-render when deep bindings like :style and
  5706. // :class are used on slot nodes
  5707. function registerDeepBindings (data) {
  5708. if (isObject(data.style)) {
  5709. traverse(data.style);
  5710. }
  5711. if (isObject(data.class)) {
  5712. traverse(data.class);
  5713. }
  5714. }
  5715. /* */
  5716. function initRender (vm) {
  5717. vm._vnode = null; // the root of the child tree
  5718. vm._staticTrees = null; // v-once cached trees
  5719. var options = vm.$options;
  5720. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  5721. var renderContext = parentVnode && parentVnode.context;
  5722. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  5723. vm.$scopedSlots = emptyObject;
  5724. // bind the createElement fn to this instance
  5725. // so that we get proper render context inside it.
  5726. // args order: tag, data, children, normalizationType, alwaysNormalize
  5727. // internal version is used by render functions compiled from templates
  5728. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  5729. // normalization is always applied for the public version, used in
  5730. // user-written render functions.
  5731. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  5732. // $attrs & $listeners are exposed for easier HOC creation.
  5733. // they need to be reactive so that HOCs using them are always updated
  5734. var parentData = parentVnode && parentVnode.data;
  5735. /* istanbul ignore else */
  5736. if (true) {
  5737. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  5738. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  5739. }, true);
  5740. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  5741. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  5742. }, true);
  5743. } else {}
  5744. }
  5745. var currentRenderingInstance = null;
  5746. function renderMixin (Vue) {
  5747. // install runtime convenience helpers
  5748. installRenderHelpers(Vue.prototype);
  5749. Vue.prototype.$nextTick = function (fn) {
  5750. return nextTick(fn, this)
  5751. };
  5752. Vue.prototype._render = function () {
  5753. var vm = this;
  5754. var ref = vm.$options;
  5755. var render = ref.render;
  5756. var _parentVnode = ref._parentVnode;
  5757. if (_parentVnode) {
  5758. vm.$scopedSlots = normalizeScopedSlots(
  5759. _parentVnode.data.scopedSlots,
  5760. vm.$slots,
  5761. vm.$scopedSlots
  5762. );
  5763. }
  5764. // set parent vnode. this allows render functions to have access
  5765. // to the data on the placeholder node.
  5766. vm.$vnode = _parentVnode;
  5767. // render self
  5768. var vnode;
  5769. try {
  5770. // There's no need to maintain a stack because all render fns are called
  5771. // separately from one another. Nested component's render fns are called
  5772. // when parent component is patched.
  5773. currentRenderingInstance = vm;
  5774. vnode = render.call(vm._renderProxy, vm.$createElement);
  5775. } catch (e) {
  5776. handleError(e, vm, "render");
  5777. // return error render result,
  5778. // or previous vnode to prevent render error causing blank component
  5779. /* istanbul ignore else */
  5780. if ( true && vm.$options.renderError) {
  5781. try {
  5782. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  5783. } catch (e) {
  5784. handleError(e, vm, "renderError");
  5785. vnode = vm._vnode;
  5786. }
  5787. } else {
  5788. vnode = vm._vnode;
  5789. }
  5790. } finally {
  5791. currentRenderingInstance = null;
  5792. }
  5793. // if the returned array contains only a single node, allow it
  5794. if (Array.isArray(vnode) && vnode.length === 1) {
  5795. vnode = vnode[0];
  5796. }
  5797. // return empty vnode in case the render function errored out
  5798. if (!(vnode instanceof VNode)) {
  5799. if ( true && Array.isArray(vnode)) {
  5800. warn(
  5801. 'Multiple root nodes returned from render function. Render function ' +
  5802. 'should return a single root node.',
  5803. vm
  5804. );
  5805. }
  5806. vnode = createEmptyVNode();
  5807. }
  5808. // set parent
  5809. vnode.parent = _parentVnode;
  5810. return vnode
  5811. };
  5812. }
  5813. /* */
  5814. function ensureCtor (comp, base) {
  5815. if (
  5816. comp.__esModule ||
  5817. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  5818. ) {
  5819. comp = comp.default;
  5820. }
  5821. return isObject(comp)
  5822. ? base.extend(comp)
  5823. : comp
  5824. }
  5825. function createAsyncPlaceholder (
  5826. factory,
  5827. data,
  5828. context,
  5829. children,
  5830. tag
  5831. ) {
  5832. var node = createEmptyVNode();
  5833. node.asyncFactory = factory;
  5834. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  5835. return node
  5836. }
  5837. function resolveAsyncComponent (
  5838. factory,
  5839. baseCtor
  5840. ) {
  5841. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  5842. return factory.errorComp
  5843. }
  5844. if (isDef(factory.resolved)) {
  5845. return factory.resolved
  5846. }
  5847. var owner = currentRenderingInstance;
  5848. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  5849. // already pending
  5850. factory.owners.push(owner);
  5851. }
  5852. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  5853. return factory.loadingComp
  5854. }
  5855. if (owner && !isDef(factory.owners)) {
  5856. var owners = factory.owners = [owner];
  5857. var sync = true;
  5858. var timerLoading = null;
  5859. var timerTimeout = null
  5860. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  5861. var forceRender = function (renderCompleted) {
  5862. for (var i = 0, l = owners.length; i < l; i++) {
  5863. (owners[i]).$forceUpdate();
  5864. }
  5865. if (renderCompleted) {
  5866. owners.length = 0;
  5867. if (timerLoading !== null) {
  5868. clearTimeout(timerLoading);
  5869. timerLoading = null;
  5870. }
  5871. if (timerTimeout !== null) {
  5872. clearTimeout(timerTimeout);
  5873. timerTimeout = null;
  5874. }
  5875. }
  5876. };
  5877. var resolve = once(function (res) {
  5878. // cache resolved
  5879. factory.resolved = ensureCtor(res, baseCtor);
  5880. // invoke callbacks only if this is not a synchronous resolve
  5881. // (async resolves are shimmed as synchronous during SSR)
  5882. if (!sync) {
  5883. forceRender(true);
  5884. } else {
  5885. owners.length = 0;
  5886. }
  5887. });
  5888. var reject = once(function (reason) {
  5889. true && warn(
  5890. "Failed to resolve async component: " + (String(factory)) +
  5891. (reason ? ("\nReason: " + reason) : '')
  5892. );
  5893. if (isDef(factory.errorComp)) {
  5894. factory.error = true;
  5895. forceRender(true);
  5896. }
  5897. });
  5898. var res = factory(resolve, reject);
  5899. if (isObject(res)) {
  5900. if (isPromise(res)) {
  5901. // () => Promise
  5902. if (isUndef(factory.resolved)) {
  5903. res.then(resolve, reject);
  5904. }
  5905. } else if (isPromise(res.component)) {
  5906. res.component.then(resolve, reject);
  5907. if (isDef(res.error)) {
  5908. factory.errorComp = ensureCtor(res.error, baseCtor);
  5909. }
  5910. if (isDef(res.loading)) {
  5911. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  5912. if (res.delay === 0) {
  5913. factory.loading = true;
  5914. } else {
  5915. timerLoading = setTimeout(function () {
  5916. timerLoading = null;
  5917. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  5918. factory.loading = true;
  5919. forceRender(false);
  5920. }
  5921. }, res.delay || 200);
  5922. }
  5923. }
  5924. if (isDef(res.timeout)) {
  5925. timerTimeout = setTimeout(function () {
  5926. timerTimeout = null;
  5927. if (isUndef(factory.resolved)) {
  5928. reject(
  5929. true
  5930. ? ("timeout (" + (res.timeout) + "ms)")
  5931. : undefined
  5932. );
  5933. }
  5934. }, res.timeout);
  5935. }
  5936. }
  5937. }
  5938. sync = false;
  5939. // return in case resolved synchronously
  5940. return factory.loading
  5941. ? factory.loadingComp
  5942. : factory.resolved
  5943. }
  5944. }
  5945. /* */
  5946. function isAsyncPlaceholder (node) {
  5947. return node.isComment && node.asyncFactory
  5948. }
  5949. /* */
  5950. function getFirstComponentChild (children) {
  5951. if (Array.isArray(children)) {
  5952. for (var i = 0; i < children.length; i++) {
  5953. var c = children[i];
  5954. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  5955. return c
  5956. }
  5957. }
  5958. }
  5959. }
  5960. /* */
  5961. /* */
  5962. function initEvents (vm) {
  5963. vm._events = Object.create(null);
  5964. vm._hasHookEvent = false;
  5965. // init parent attached events
  5966. var listeners = vm.$options._parentListeners;
  5967. if (listeners) {
  5968. updateComponentListeners(vm, listeners);
  5969. }
  5970. }
  5971. var target;
  5972. function add (event, fn) {
  5973. target.$on(event, fn);
  5974. }
  5975. function remove$1 (event, fn) {
  5976. target.$off(event, fn);
  5977. }
  5978. function createOnceHandler (event, fn) {
  5979. var _target = target;
  5980. return function onceHandler () {
  5981. var res = fn.apply(null, arguments);
  5982. if (res !== null) {
  5983. _target.$off(event, onceHandler);
  5984. }
  5985. }
  5986. }
  5987. function updateComponentListeners (
  5988. vm,
  5989. listeners,
  5990. oldListeners
  5991. ) {
  5992. target = vm;
  5993. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  5994. target = undefined;
  5995. }
  5996. function eventsMixin (Vue) {
  5997. var hookRE = /^hook:/;
  5998. Vue.prototype.$on = function (event, fn) {
  5999. var vm = this;
  6000. if (Array.isArray(event)) {
  6001. for (var i = 0, l = event.length; i < l; i++) {
  6002. vm.$on(event[i], fn);
  6003. }
  6004. } else {
  6005. (vm._events[event] || (vm._events[event] = [])).push(fn);
  6006. // optimize hook:event cost by using a boolean flag marked at registration
  6007. // instead of a hash lookup
  6008. if (hookRE.test(event)) {
  6009. vm._hasHookEvent = true;
  6010. }
  6011. }
  6012. return vm
  6013. };
  6014. Vue.prototype.$once = function (event, fn) {
  6015. var vm = this;
  6016. function on () {
  6017. vm.$off(event, on);
  6018. fn.apply(vm, arguments);
  6019. }
  6020. on.fn = fn;
  6021. vm.$on(event, on);
  6022. return vm
  6023. };
  6024. Vue.prototype.$off = function (event, fn) {
  6025. var vm = this;
  6026. // all
  6027. if (!arguments.length) {
  6028. vm._events = Object.create(null);
  6029. return vm
  6030. }
  6031. // array of events
  6032. if (Array.isArray(event)) {
  6033. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  6034. vm.$off(event[i$1], fn);
  6035. }
  6036. return vm
  6037. }
  6038. // specific event
  6039. var cbs = vm._events[event];
  6040. if (!cbs) {
  6041. return vm
  6042. }
  6043. if (!fn) {
  6044. vm._events[event] = null;
  6045. return vm
  6046. }
  6047. // specific handler
  6048. var cb;
  6049. var i = cbs.length;
  6050. while (i--) {
  6051. cb = cbs[i];
  6052. if (cb === fn || cb.fn === fn) {
  6053. cbs.splice(i, 1);
  6054. break
  6055. }
  6056. }
  6057. return vm
  6058. };
  6059. Vue.prototype.$emit = function (event) {
  6060. var vm = this;
  6061. if (true) {
  6062. var lowerCaseEvent = event.toLowerCase();
  6063. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  6064. tip(
  6065. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  6066. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  6067. "Note that HTML attributes are case-insensitive and you cannot use " +
  6068. "v-on to listen to camelCase events when using in-DOM templates. " +
  6069. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  6070. );
  6071. }
  6072. }
  6073. var cbs = vm._events[event];
  6074. if (cbs) {
  6075. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  6076. var args = toArray(arguments, 1);
  6077. var info = "event handler for \"" + event + "\"";
  6078. for (var i = 0, l = cbs.length; i < l; i++) {
  6079. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  6080. }
  6081. }
  6082. return vm
  6083. };
  6084. }
  6085. /* */
  6086. var activeInstance = null;
  6087. var isUpdatingChildComponent = false;
  6088. function setActiveInstance(vm) {
  6089. var prevActiveInstance = activeInstance;
  6090. activeInstance = vm;
  6091. return function () {
  6092. activeInstance = prevActiveInstance;
  6093. }
  6094. }
  6095. function initLifecycle (vm) {
  6096. var options = vm.$options;
  6097. // locate first non-abstract parent
  6098. var parent = options.parent;
  6099. if (parent && !options.abstract) {
  6100. while (parent.$options.abstract && parent.$parent) {
  6101. parent = parent.$parent;
  6102. }
  6103. parent.$children.push(vm);
  6104. }
  6105. vm.$parent = parent;
  6106. vm.$root = parent ? parent.$root : vm;
  6107. vm.$children = [];
  6108. vm.$refs = {};
  6109. vm._watcher = null;
  6110. vm._inactive = null;
  6111. vm._directInactive = false;
  6112. vm._isMounted = false;
  6113. vm._isDestroyed = false;
  6114. vm._isBeingDestroyed = false;
  6115. }
  6116. function lifecycleMixin (Vue) {
  6117. Vue.prototype._update = function (vnode, hydrating) {
  6118. var vm = this;
  6119. var prevEl = vm.$el;
  6120. var prevVnode = vm._vnode;
  6121. var restoreActiveInstance = setActiveInstance(vm);
  6122. vm._vnode = vnode;
  6123. // Vue.prototype.__patch__ is injected in entry points
  6124. // based on the rendering backend used.
  6125. if (!prevVnode) {
  6126. // initial render
  6127. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  6128. } else {
  6129. // updates
  6130. vm.$el = vm.__patch__(prevVnode, vnode);
  6131. }
  6132. restoreActiveInstance();
  6133. // update __vue__ reference
  6134. if (prevEl) {
  6135. prevEl.__vue__ = null;
  6136. }
  6137. if (vm.$el) {
  6138. vm.$el.__vue__ = vm;
  6139. }
  6140. // if parent is an HOC, update its $el as well
  6141. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  6142. vm.$parent.$el = vm.$el;
  6143. }
  6144. // updated hook is called by the scheduler to ensure that children are
  6145. // updated in a parent's updated hook.
  6146. };
  6147. Vue.prototype.$forceUpdate = function () {
  6148. var vm = this;
  6149. if (vm._watcher) {
  6150. vm._watcher.update();
  6151. }
  6152. };
  6153. Vue.prototype.$destroy = function () {
  6154. var vm = this;
  6155. if (vm._isBeingDestroyed) {
  6156. return
  6157. }
  6158. callHook(vm, 'beforeDestroy');
  6159. vm._isBeingDestroyed = true;
  6160. // remove self from parent
  6161. var parent = vm.$parent;
  6162. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  6163. remove(parent.$children, vm);
  6164. }
  6165. // teardown watchers
  6166. if (vm._watcher) {
  6167. vm._watcher.teardown();
  6168. }
  6169. var i = vm._watchers.length;
  6170. while (i--) {
  6171. vm._watchers[i].teardown();
  6172. }
  6173. // remove reference from data ob
  6174. // frozen object may not have observer.
  6175. if (vm._data.__ob__) {
  6176. vm._data.__ob__.vmCount--;
  6177. }
  6178. // call the last hook...
  6179. vm._isDestroyed = true;
  6180. // invoke destroy hooks on current rendered tree
  6181. vm.__patch__(vm._vnode, null);
  6182. // fire destroyed hook
  6183. callHook(vm, 'destroyed');
  6184. // turn off all instance listeners.
  6185. vm.$off();
  6186. // remove __vue__ reference
  6187. if (vm.$el) {
  6188. vm.$el.__vue__ = null;
  6189. }
  6190. // release circular reference (#6759)
  6191. if (vm.$vnode) {
  6192. vm.$vnode.parent = null;
  6193. }
  6194. };
  6195. }
  6196. function updateChildComponent (
  6197. vm,
  6198. propsData,
  6199. listeners,
  6200. parentVnode,
  6201. renderChildren
  6202. ) {
  6203. if (true) {
  6204. isUpdatingChildComponent = true;
  6205. }
  6206. // determine whether component has slot children
  6207. // we need to do this before overwriting $options._renderChildren.
  6208. // check if there are dynamic scopedSlots (hand-written or compiled but with
  6209. // dynamic slot names). Static scoped slots compiled from template has the
  6210. // "$stable" marker.
  6211. var newScopedSlots = parentVnode.data.scopedSlots;
  6212. var oldScopedSlots = vm.$scopedSlots;
  6213. var hasDynamicScopedSlot = !!(
  6214. (newScopedSlots && !newScopedSlots.$stable) ||
  6215. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  6216. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  6217. );
  6218. // Any static slot children from the parent may have changed during parent's
  6219. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  6220. // update is necessary to ensure correctness.
  6221. var needsForceUpdate = !!(
  6222. renderChildren || // has new static slots
  6223. vm.$options._renderChildren || // has old static slots
  6224. hasDynamicScopedSlot
  6225. );
  6226. vm.$options._parentVnode = parentVnode;
  6227. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  6228. if (vm._vnode) { // update child tree's parent
  6229. vm._vnode.parent = parentVnode;
  6230. }
  6231. vm.$options._renderChildren = renderChildren;
  6232. // update $attrs and $listeners hash
  6233. // these are also reactive so they may trigger child update if the child
  6234. // used them during render
  6235. vm.$attrs = parentVnode.data.attrs || emptyObject;
  6236. vm.$listeners = listeners || emptyObject;
  6237. // update props
  6238. if (propsData && vm.$options.props) {
  6239. toggleObserving(false);
  6240. var props = vm._props;
  6241. var propKeys = vm.$options._propKeys || [];
  6242. for (var i = 0; i < propKeys.length; i++) {
  6243. var key = propKeys[i];
  6244. var propOptions = vm.$options.props; // wtf flow?
  6245. props[key] = validateProp(key, propOptions, propsData, vm);
  6246. }
  6247. toggleObserving(true);
  6248. // keep a copy of raw propsData
  6249. vm.$options.propsData = propsData;
  6250. }
  6251. // fixed by xxxxxx update properties(mp runtime)
  6252. vm._$updateProperties && vm._$updateProperties(vm);
  6253. // update listeners
  6254. listeners = listeners || emptyObject;
  6255. var oldListeners = vm.$options._parentListeners;
  6256. vm.$options._parentListeners = listeners;
  6257. updateComponentListeners(vm, listeners, oldListeners);
  6258. // resolve slots + force update if has children
  6259. if (needsForceUpdate) {
  6260. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  6261. vm.$forceUpdate();
  6262. }
  6263. if (true) {
  6264. isUpdatingChildComponent = false;
  6265. }
  6266. }
  6267. function isInInactiveTree (vm) {
  6268. while (vm && (vm = vm.$parent)) {
  6269. if (vm._inactive) { return true }
  6270. }
  6271. return false
  6272. }
  6273. function activateChildComponent (vm, direct) {
  6274. if (direct) {
  6275. vm._directInactive = false;
  6276. if (isInInactiveTree(vm)) {
  6277. return
  6278. }
  6279. } else if (vm._directInactive) {
  6280. return
  6281. }
  6282. if (vm._inactive || vm._inactive === null) {
  6283. vm._inactive = false;
  6284. for (var i = 0; i < vm.$children.length; i++) {
  6285. activateChildComponent(vm.$children[i]);
  6286. }
  6287. callHook(vm, 'activated');
  6288. }
  6289. }
  6290. function deactivateChildComponent (vm, direct) {
  6291. if (direct) {
  6292. vm._directInactive = true;
  6293. if (isInInactiveTree(vm)) {
  6294. return
  6295. }
  6296. }
  6297. if (!vm._inactive) {
  6298. vm._inactive = true;
  6299. for (var i = 0; i < vm.$children.length; i++) {
  6300. deactivateChildComponent(vm.$children[i]);
  6301. }
  6302. callHook(vm, 'deactivated');
  6303. }
  6304. }
  6305. function callHook (vm, hook) {
  6306. // #7573 disable dep collection when invoking lifecycle hooks
  6307. pushTarget();
  6308. var handlers = vm.$options[hook];
  6309. var info = hook + " hook";
  6310. if (handlers) {
  6311. for (var i = 0, j = handlers.length; i < j; i++) {
  6312. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  6313. }
  6314. }
  6315. if (vm._hasHookEvent) {
  6316. vm.$emit('hook:' + hook);
  6317. }
  6318. popTarget();
  6319. }
  6320. /* */
  6321. var MAX_UPDATE_COUNT = 100;
  6322. var queue = [];
  6323. var activatedChildren = [];
  6324. var has = {};
  6325. var circular = {};
  6326. var waiting = false;
  6327. var flushing = false;
  6328. var index = 0;
  6329. /**
  6330. * Reset the scheduler's state.
  6331. */
  6332. function resetSchedulerState () {
  6333. index = queue.length = activatedChildren.length = 0;
  6334. has = {};
  6335. if (true) {
  6336. circular = {};
  6337. }
  6338. waiting = flushing = false;
  6339. }
  6340. // Async edge case #6566 requires saving the timestamp when event listeners are
  6341. // attached. However, calling performance.now() has a perf overhead especially
  6342. // if the page has thousands of event listeners. Instead, we take a timestamp
  6343. // every time the scheduler flushes and use that for all event listeners
  6344. // attached during that flush.
  6345. var currentFlushTimestamp = 0;
  6346. // Async edge case fix requires storing an event listener's attach timestamp.
  6347. var getNow = Date.now;
  6348. // Determine what event timestamp the browser is using. Annoyingly, the
  6349. // timestamp can either be hi-res (relative to page load) or low-res
  6350. // (relative to UNIX epoch), so in order to compare time we have to use the
  6351. // same timestamp type when saving the flush timestamp.
  6352. // All IE versions use low-res event timestamps, and have problematic clock
  6353. // implementations (#9632)
  6354. if (inBrowser && !isIE) {
  6355. var performance = window.performance;
  6356. if (
  6357. performance &&
  6358. typeof performance.now === 'function' &&
  6359. getNow() > document.createEvent('Event').timeStamp
  6360. ) {
  6361. // if the event timestamp, although evaluated AFTER the Date.now(), is
  6362. // smaller than it, it means the event is using a hi-res timestamp,
  6363. // and we need to use the hi-res version for event listener timestamps as
  6364. // well.
  6365. getNow = function () { return performance.now(); };
  6366. }
  6367. }
  6368. /**
  6369. * Flush both queues and run the watchers.
  6370. */
  6371. function flushSchedulerQueue () {
  6372. currentFlushTimestamp = getNow();
  6373. flushing = true;
  6374. var watcher, id;
  6375. // Sort queue before flush.
  6376. // This ensures that:
  6377. // 1. Components are updated from parent to child. (because parent is always
  6378. // created before the child)
  6379. // 2. A component's user watchers are run before its render watcher (because
  6380. // user watchers are created before the render watcher)
  6381. // 3. If a component is destroyed during a parent component's watcher run,
  6382. // its watchers can be skipped.
  6383. queue.sort(function (a, b) { return a.id - b.id; });
  6384. // do not cache length because more watchers might be pushed
  6385. // as we run existing watchers
  6386. for (index = 0; index < queue.length; index++) {
  6387. watcher = queue[index];
  6388. if (watcher.before) {
  6389. watcher.before();
  6390. }
  6391. id = watcher.id;
  6392. has[id] = null;
  6393. watcher.run();
  6394. // in dev build, check and stop circular updates.
  6395. if ( true && has[id] != null) {
  6396. circular[id] = (circular[id] || 0) + 1;
  6397. if (circular[id] > MAX_UPDATE_COUNT) {
  6398. warn(
  6399. 'You may have an infinite update loop ' + (
  6400. watcher.user
  6401. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  6402. : "in a component render function."
  6403. ),
  6404. watcher.vm
  6405. );
  6406. break
  6407. }
  6408. }
  6409. }
  6410. // keep copies of post queues before resetting state
  6411. var activatedQueue = activatedChildren.slice();
  6412. var updatedQueue = queue.slice();
  6413. resetSchedulerState();
  6414. // call component updated and activated hooks
  6415. callActivatedHooks(activatedQueue);
  6416. callUpdatedHooks(updatedQueue);
  6417. // devtool hook
  6418. /* istanbul ignore if */
  6419. if (devtools && config.devtools) {
  6420. devtools.emit('flush');
  6421. }
  6422. }
  6423. function callUpdatedHooks (queue) {
  6424. var i = queue.length;
  6425. while (i--) {
  6426. var watcher = queue[i];
  6427. var vm = watcher.vm;
  6428. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  6429. callHook(vm, 'updated');
  6430. }
  6431. }
  6432. }
  6433. /**
  6434. * Queue a kept-alive component that was activated during patch.
  6435. * The queue will be processed after the entire tree has been patched.
  6436. */
  6437. function queueActivatedComponent (vm) {
  6438. // setting _inactive to false here so that a render function can
  6439. // rely on checking whether it's in an inactive tree (e.g. router-view)
  6440. vm._inactive = false;
  6441. activatedChildren.push(vm);
  6442. }
  6443. function callActivatedHooks (queue) {
  6444. for (var i = 0; i < queue.length; i++) {
  6445. queue[i]._inactive = true;
  6446. activateChildComponent(queue[i], true /* true */);
  6447. }
  6448. }
  6449. /**
  6450. * Push a watcher into the watcher queue.
  6451. * Jobs with duplicate IDs will be skipped unless it's
  6452. * pushed when the queue is being flushed.
  6453. */
  6454. function queueWatcher (watcher) {
  6455. var id = watcher.id;
  6456. if (has[id] == null) {
  6457. has[id] = true;
  6458. if (!flushing) {
  6459. queue.push(watcher);
  6460. } else {
  6461. // if already flushing, splice the watcher based on its id
  6462. // if already past its id, it will be run next immediately.
  6463. var i = queue.length - 1;
  6464. while (i > index && queue[i].id > watcher.id) {
  6465. i--;
  6466. }
  6467. queue.splice(i + 1, 0, watcher);
  6468. }
  6469. // queue the flush
  6470. if (!waiting) {
  6471. waiting = true;
  6472. if ( true && !config.async) {
  6473. flushSchedulerQueue();
  6474. return
  6475. }
  6476. nextTick(flushSchedulerQueue);
  6477. }
  6478. }
  6479. }
  6480. /* */
  6481. var uid$2 = 0;
  6482. /**
  6483. * A watcher parses an expression, collects dependencies,
  6484. * and fires callback when the expression value changes.
  6485. * This is used for both the $watch() api and directives.
  6486. */
  6487. var Watcher = function Watcher (
  6488. vm,
  6489. expOrFn,
  6490. cb,
  6491. options,
  6492. isRenderWatcher
  6493. ) {
  6494. this.vm = vm;
  6495. if (isRenderWatcher) {
  6496. vm._watcher = this;
  6497. }
  6498. vm._watchers.push(this);
  6499. // options
  6500. if (options) {
  6501. this.deep = !!options.deep;
  6502. this.user = !!options.user;
  6503. this.lazy = !!options.lazy;
  6504. this.sync = !!options.sync;
  6505. this.before = options.before;
  6506. } else {
  6507. this.deep = this.user = this.lazy = this.sync = false;
  6508. }
  6509. this.cb = cb;
  6510. this.id = ++uid$2; // uid for batching
  6511. this.active = true;
  6512. this.dirty = this.lazy; // for lazy watchers
  6513. this.deps = [];
  6514. this.newDeps = [];
  6515. this.depIds = new _Set();
  6516. this.newDepIds = new _Set();
  6517. this.expression = true
  6518. ? expOrFn.toString()
  6519. : undefined;
  6520. // parse expression for getter
  6521. if (typeof expOrFn === 'function') {
  6522. this.getter = expOrFn;
  6523. } else {
  6524. this.getter = parsePath(expOrFn);
  6525. if (!this.getter) {
  6526. this.getter = noop;
  6527. true && warn(
  6528. "Failed watching path: \"" + expOrFn + "\" " +
  6529. 'Watcher only accepts simple dot-delimited paths. ' +
  6530. 'For full control, use a function instead.',
  6531. vm
  6532. );
  6533. }
  6534. }
  6535. this.value = this.lazy
  6536. ? undefined
  6537. : this.get();
  6538. };
  6539. /**
  6540. * Evaluate the getter, and re-collect dependencies.
  6541. */
  6542. Watcher.prototype.get = function get () {
  6543. pushTarget(this);
  6544. var value;
  6545. var vm = this.vm;
  6546. try {
  6547. value = this.getter.call(vm, vm);
  6548. } catch (e) {
  6549. if (this.user) {
  6550. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  6551. } else {
  6552. throw e
  6553. }
  6554. } finally {
  6555. // "touch" every property so they are all tracked as
  6556. // dependencies for deep watching
  6557. if (this.deep) {
  6558. traverse(value);
  6559. }
  6560. popTarget();
  6561. this.cleanupDeps();
  6562. }
  6563. return value
  6564. };
  6565. /**
  6566. * Add a dependency to this directive.
  6567. */
  6568. Watcher.prototype.addDep = function addDep (dep) {
  6569. var id = dep.id;
  6570. if (!this.newDepIds.has(id)) {
  6571. this.newDepIds.add(id);
  6572. this.newDeps.push(dep);
  6573. if (!this.depIds.has(id)) {
  6574. dep.addSub(this);
  6575. }
  6576. }
  6577. };
  6578. /**
  6579. * Clean up for dependency collection.
  6580. */
  6581. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  6582. var i = this.deps.length;
  6583. while (i--) {
  6584. var dep = this.deps[i];
  6585. if (!this.newDepIds.has(dep.id)) {
  6586. dep.removeSub(this);
  6587. }
  6588. }
  6589. var tmp = this.depIds;
  6590. this.depIds = this.newDepIds;
  6591. this.newDepIds = tmp;
  6592. this.newDepIds.clear();
  6593. tmp = this.deps;
  6594. this.deps = this.newDeps;
  6595. this.newDeps = tmp;
  6596. this.newDeps.length = 0;
  6597. };
  6598. /**
  6599. * Subscriber interface.
  6600. * Will be called when a dependency changes.
  6601. */
  6602. Watcher.prototype.update = function update () {
  6603. /* istanbul ignore else */
  6604. if (this.lazy) {
  6605. this.dirty = true;
  6606. } else if (this.sync) {
  6607. this.run();
  6608. } else {
  6609. queueWatcher(this);
  6610. }
  6611. };
  6612. /**
  6613. * Scheduler job interface.
  6614. * Will be called by the scheduler.
  6615. */
  6616. Watcher.prototype.run = function run () {
  6617. if (this.active) {
  6618. var value = this.get();
  6619. if (
  6620. value !== this.value ||
  6621. // Deep watchers and watchers on Object/Arrays should fire even
  6622. // when the value is the same, because the value may
  6623. // have mutated.
  6624. isObject(value) ||
  6625. this.deep
  6626. ) {
  6627. // set new value
  6628. var oldValue = this.value;
  6629. this.value = value;
  6630. if (this.user) {
  6631. try {
  6632. this.cb.call(this.vm, value, oldValue);
  6633. } catch (e) {
  6634. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  6635. }
  6636. } else {
  6637. this.cb.call(this.vm, value, oldValue);
  6638. }
  6639. }
  6640. }
  6641. };
  6642. /**
  6643. * Evaluate the value of the watcher.
  6644. * This only gets called for lazy watchers.
  6645. */
  6646. Watcher.prototype.evaluate = function evaluate () {
  6647. this.value = this.get();
  6648. this.dirty = false;
  6649. };
  6650. /**
  6651. * Depend on all deps collected by this watcher.
  6652. */
  6653. Watcher.prototype.depend = function depend () {
  6654. var i = this.deps.length;
  6655. while (i--) {
  6656. this.deps[i].depend();
  6657. }
  6658. };
  6659. /**
  6660. * Remove self from all dependencies' subscriber list.
  6661. */
  6662. Watcher.prototype.teardown = function teardown () {
  6663. if (this.active) {
  6664. // remove self from vm's watcher list
  6665. // this is a somewhat expensive operation so we skip it
  6666. // if the vm is being destroyed.
  6667. if (!this.vm._isBeingDestroyed) {
  6668. remove(this.vm._watchers, this);
  6669. }
  6670. var i = this.deps.length;
  6671. while (i--) {
  6672. this.deps[i].removeSub(this);
  6673. }
  6674. this.active = false;
  6675. }
  6676. };
  6677. /* */
  6678. var sharedPropertyDefinition = {
  6679. enumerable: true,
  6680. configurable: true,
  6681. get: noop,
  6682. set: noop
  6683. };
  6684. function proxy (target, sourceKey, key) {
  6685. sharedPropertyDefinition.get = function proxyGetter () {
  6686. return this[sourceKey][key]
  6687. };
  6688. sharedPropertyDefinition.set = function proxySetter (val) {
  6689. this[sourceKey][key] = val;
  6690. };
  6691. Object.defineProperty(target, key, sharedPropertyDefinition);
  6692. }
  6693. function initState (vm) {
  6694. vm._watchers = [];
  6695. var opts = vm.$options;
  6696. if (opts.props) { initProps(vm, opts.props); }
  6697. if (opts.methods) { initMethods(vm, opts.methods); }
  6698. if (opts.data) {
  6699. initData(vm);
  6700. } else {
  6701. observe(vm._data = {}, true /* asRootData */);
  6702. }
  6703. if (opts.computed) { initComputed(vm, opts.computed); }
  6704. if (opts.watch && opts.watch !== nativeWatch) {
  6705. initWatch(vm, opts.watch);
  6706. }
  6707. }
  6708. function initProps (vm, propsOptions) {
  6709. var propsData = vm.$options.propsData || {};
  6710. var props = vm._props = {};
  6711. // cache prop keys so that future props updates can iterate using Array
  6712. // instead of dynamic object key enumeration.
  6713. var keys = vm.$options._propKeys = [];
  6714. var isRoot = !vm.$parent;
  6715. // root instance props should be converted
  6716. if (!isRoot) {
  6717. toggleObserving(false);
  6718. }
  6719. var loop = function ( key ) {
  6720. keys.push(key);
  6721. var value = validateProp(key, propsOptions, propsData, vm);
  6722. /* istanbul ignore else */
  6723. if (true) {
  6724. var hyphenatedKey = hyphenate(key);
  6725. if (isReservedAttribute(hyphenatedKey) ||
  6726. config.isReservedAttr(hyphenatedKey)) {
  6727. warn(
  6728. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  6729. vm
  6730. );
  6731. }
  6732. defineReactive$$1(props, key, value, function () {
  6733. if (!isRoot && !isUpdatingChildComponent) {
  6734. {
  6735. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  6736. return
  6737. }
  6738. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  6739. if(
  6740. key === 'value' &&
  6741. Array.isArray(vm.$options.behaviors) &&
  6742. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  6743. ){
  6744. return
  6745. }
  6746. if(vm._getFormData){
  6747. return
  6748. }
  6749. var $parent = vm.$parent;
  6750. while($parent){
  6751. if($parent.__next_tick_pending){
  6752. return
  6753. }
  6754. $parent = $parent.$parent;
  6755. }
  6756. }
  6757. warn(
  6758. "Avoid mutating a prop directly since the value will be " +
  6759. "overwritten whenever the parent component re-renders. " +
  6760. "Instead, use a data or computed property based on the prop's " +
  6761. "value. Prop being mutated: \"" + key + "\"",
  6762. vm
  6763. );
  6764. }
  6765. });
  6766. } else {}
  6767. // static props are already proxied on the component's prototype
  6768. // during Vue.extend(). We only need to proxy props defined at
  6769. // instantiation here.
  6770. if (!(key in vm)) {
  6771. proxy(vm, "_props", key);
  6772. }
  6773. };
  6774. for (var key in propsOptions) loop( key );
  6775. toggleObserving(true);
  6776. }
  6777. function initData (vm) {
  6778. var data = vm.$options.data;
  6779. data = vm._data = typeof data === 'function'
  6780. ? getData(data, vm)
  6781. : data || {};
  6782. if (!isPlainObject(data)) {
  6783. data = {};
  6784. true && warn(
  6785. 'data functions should return an object:\n' +
  6786. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  6787. vm
  6788. );
  6789. }
  6790. // proxy data on instance
  6791. var keys = Object.keys(data);
  6792. var props = vm.$options.props;
  6793. var methods = vm.$options.methods;
  6794. var i = keys.length;
  6795. while (i--) {
  6796. var key = keys[i];
  6797. if (true) {
  6798. if (methods && hasOwn(methods, key)) {
  6799. warn(
  6800. ("Method \"" + key + "\" has already been defined as a data property."),
  6801. vm
  6802. );
  6803. }
  6804. }
  6805. if (props && hasOwn(props, key)) {
  6806. true && warn(
  6807. "The data property \"" + key + "\" is already declared as a prop. " +
  6808. "Use prop default value instead.",
  6809. vm
  6810. );
  6811. } else if (!isReserved(key)) {
  6812. proxy(vm, "_data", key);
  6813. }
  6814. }
  6815. // observe data
  6816. observe(data, true /* asRootData */);
  6817. }
  6818. function getData (data, vm) {
  6819. // #7573 disable dep collection when invoking data getters
  6820. pushTarget();
  6821. try {
  6822. return data.call(vm, vm)
  6823. } catch (e) {
  6824. handleError(e, vm, "data()");
  6825. return {}
  6826. } finally {
  6827. popTarget();
  6828. }
  6829. }
  6830. var computedWatcherOptions = { lazy: true };
  6831. function initComputed (vm, computed) {
  6832. // $flow-disable-line
  6833. var watchers = vm._computedWatchers = Object.create(null);
  6834. // computed properties are just getters during SSR
  6835. var isSSR = isServerRendering();
  6836. for (var key in computed) {
  6837. var userDef = computed[key];
  6838. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  6839. if ( true && getter == null) {
  6840. warn(
  6841. ("Getter is missing for computed property \"" + key + "\"."),
  6842. vm
  6843. );
  6844. }
  6845. if (!isSSR) {
  6846. // create internal watcher for the computed property.
  6847. watchers[key] = new Watcher(
  6848. vm,
  6849. getter || noop,
  6850. noop,
  6851. computedWatcherOptions
  6852. );
  6853. }
  6854. // component-defined computed properties are already defined on the
  6855. // component prototype. We only need to define computed properties defined
  6856. // at instantiation here.
  6857. if (!(key in vm)) {
  6858. defineComputed(vm, key, userDef);
  6859. } else if (true) {
  6860. if (key in vm.$data) {
  6861. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  6862. } else if (vm.$options.props && key in vm.$options.props) {
  6863. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  6864. }
  6865. }
  6866. }
  6867. }
  6868. function defineComputed (
  6869. target,
  6870. key,
  6871. userDef
  6872. ) {
  6873. var shouldCache = !isServerRendering();
  6874. if (typeof userDef === 'function') {
  6875. sharedPropertyDefinition.get = shouldCache
  6876. ? createComputedGetter(key)
  6877. : createGetterInvoker(userDef);
  6878. sharedPropertyDefinition.set = noop;
  6879. } else {
  6880. sharedPropertyDefinition.get = userDef.get
  6881. ? shouldCache && userDef.cache !== false
  6882. ? createComputedGetter(key)
  6883. : createGetterInvoker(userDef.get)
  6884. : noop;
  6885. sharedPropertyDefinition.set = userDef.set || noop;
  6886. }
  6887. if ( true &&
  6888. sharedPropertyDefinition.set === noop) {
  6889. sharedPropertyDefinition.set = function () {
  6890. warn(
  6891. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  6892. this
  6893. );
  6894. };
  6895. }
  6896. Object.defineProperty(target, key, sharedPropertyDefinition);
  6897. }
  6898. function createComputedGetter (key) {
  6899. return function computedGetter () {
  6900. var watcher = this._computedWatchers && this._computedWatchers[key];
  6901. if (watcher) {
  6902. if (watcher.dirty) {
  6903. watcher.evaluate();
  6904. }
  6905. if (Dep.SharedObject.target) {// fixed by xxxxxx
  6906. watcher.depend();
  6907. }
  6908. return watcher.value
  6909. }
  6910. }
  6911. }
  6912. function createGetterInvoker(fn) {
  6913. return function computedGetter () {
  6914. return fn.call(this, this)
  6915. }
  6916. }
  6917. function initMethods (vm, methods) {
  6918. var props = vm.$options.props;
  6919. for (var key in methods) {
  6920. if (true) {
  6921. if (typeof methods[key] !== 'function') {
  6922. warn(
  6923. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  6924. "Did you reference the function correctly?",
  6925. vm
  6926. );
  6927. }
  6928. if (props && hasOwn(props, key)) {
  6929. warn(
  6930. ("Method \"" + key + "\" has already been defined as a prop."),
  6931. vm
  6932. );
  6933. }
  6934. if ((key in vm) && isReserved(key)) {
  6935. warn(
  6936. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  6937. "Avoid defining component methods that start with _ or $."
  6938. );
  6939. }
  6940. }
  6941. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  6942. }
  6943. }
  6944. function initWatch (vm, watch) {
  6945. for (var key in watch) {
  6946. var handler = watch[key];
  6947. if (Array.isArray(handler)) {
  6948. for (var i = 0; i < handler.length; i++) {
  6949. createWatcher(vm, key, handler[i]);
  6950. }
  6951. } else {
  6952. createWatcher(vm, key, handler);
  6953. }
  6954. }
  6955. }
  6956. function createWatcher (
  6957. vm,
  6958. expOrFn,
  6959. handler,
  6960. options
  6961. ) {
  6962. if (isPlainObject(handler)) {
  6963. options = handler;
  6964. handler = handler.handler;
  6965. }
  6966. if (typeof handler === 'string') {
  6967. handler = vm[handler];
  6968. }
  6969. return vm.$watch(expOrFn, handler, options)
  6970. }
  6971. function stateMixin (Vue) {
  6972. // flow somehow has problems with directly declared definition object
  6973. // when using Object.defineProperty, so we have to procedurally build up
  6974. // the object here.
  6975. var dataDef = {};
  6976. dataDef.get = function () { return this._data };
  6977. var propsDef = {};
  6978. propsDef.get = function () { return this._props };
  6979. if (true) {
  6980. dataDef.set = function () {
  6981. warn(
  6982. 'Avoid replacing instance root $data. ' +
  6983. 'Use nested data properties instead.',
  6984. this
  6985. );
  6986. };
  6987. propsDef.set = function () {
  6988. warn("$props is readonly.", this);
  6989. };
  6990. }
  6991. Object.defineProperty(Vue.prototype, '$data', dataDef);
  6992. Object.defineProperty(Vue.prototype, '$props', propsDef);
  6993. Vue.prototype.$set = set;
  6994. Vue.prototype.$delete = del;
  6995. Vue.prototype.$watch = function (
  6996. expOrFn,
  6997. cb,
  6998. options
  6999. ) {
  7000. var vm = this;
  7001. if (isPlainObject(cb)) {
  7002. return createWatcher(vm, expOrFn, cb, options)
  7003. }
  7004. options = options || {};
  7005. options.user = true;
  7006. var watcher = new Watcher(vm, expOrFn, cb, options);
  7007. if (options.immediate) {
  7008. try {
  7009. cb.call(vm, watcher.value);
  7010. } catch (error) {
  7011. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  7012. }
  7013. }
  7014. return function unwatchFn () {
  7015. watcher.teardown();
  7016. }
  7017. };
  7018. }
  7019. /* */
  7020. var uid$3 = 0;
  7021. function initMixin (Vue) {
  7022. Vue.prototype._init = function (options) {
  7023. var vm = this;
  7024. // a uid
  7025. vm._uid = uid$3++;
  7026. var startTag, endTag;
  7027. /* istanbul ignore if */
  7028. if ( true && config.performance && mark) {
  7029. startTag = "vue-perf-start:" + (vm._uid);
  7030. endTag = "vue-perf-end:" + (vm._uid);
  7031. mark(startTag);
  7032. }
  7033. // a flag to avoid this being observed
  7034. vm._isVue = true;
  7035. // merge options
  7036. if (options && options._isComponent) {
  7037. // optimize internal component instantiation
  7038. // since dynamic options merging is pretty slow, and none of the
  7039. // internal component options needs special treatment.
  7040. initInternalComponent(vm, options);
  7041. } else {
  7042. vm.$options = mergeOptions(
  7043. resolveConstructorOptions(vm.constructor),
  7044. options || {},
  7045. vm
  7046. );
  7047. }
  7048. /* istanbul ignore else */
  7049. if (true) {
  7050. initProxy(vm);
  7051. } else {}
  7052. // expose real self
  7053. vm._self = vm;
  7054. initLifecycle(vm);
  7055. initEvents(vm);
  7056. initRender(vm);
  7057. callHook(vm, 'beforeCreate');
  7058. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  7059. initState(vm);
  7060. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  7061. !vm._$fallback && callHook(vm, 'created');
  7062. /* istanbul ignore if */
  7063. if ( true && config.performance && mark) {
  7064. vm._name = formatComponentName(vm, false);
  7065. mark(endTag);
  7066. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  7067. }
  7068. if (vm.$options.el) {
  7069. vm.$mount(vm.$options.el);
  7070. }
  7071. };
  7072. }
  7073. function initInternalComponent (vm, options) {
  7074. var opts = vm.$options = Object.create(vm.constructor.options);
  7075. // doing this because it's faster than dynamic enumeration.
  7076. var parentVnode = options._parentVnode;
  7077. opts.parent = options.parent;
  7078. opts._parentVnode = parentVnode;
  7079. var vnodeComponentOptions = parentVnode.componentOptions;
  7080. opts.propsData = vnodeComponentOptions.propsData;
  7081. opts._parentListeners = vnodeComponentOptions.listeners;
  7082. opts._renderChildren = vnodeComponentOptions.children;
  7083. opts._componentTag = vnodeComponentOptions.tag;
  7084. if (options.render) {
  7085. opts.render = options.render;
  7086. opts.staticRenderFns = options.staticRenderFns;
  7087. }
  7088. }
  7089. function resolveConstructorOptions (Ctor) {
  7090. var options = Ctor.options;
  7091. if (Ctor.super) {
  7092. var superOptions = resolveConstructorOptions(Ctor.super);
  7093. var cachedSuperOptions = Ctor.superOptions;
  7094. if (superOptions !== cachedSuperOptions) {
  7095. // super option changed,
  7096. // need to resolve new options.
  7097. Ctor.superOptions = superOptions;
  7098. // check if there are any late-modified/attached options (#4976)
  7099. var modifiedOptions = resolveModifiedOptions(Ctor);
  7100. // update base extend options
  7101. if (modifiedOptions) {
  7102. extend(Ctor.extendOptions, modifiedOptions);
  7103. }
  7104. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  7105. if (options.name) {
  7106. options.components[options.name] = Ctor;
  7107. }
  7108. }
  7109. }
  7110. return options
  7111. }
  7112. function resolveModifiedOptions (Ctor) {
  7113. var modified;
  7114. var latest = Ctor.options;
  7115. var sealed = Ctor.sealedOptions;
  7116. for (var key in latest) {
  7117. if (latest[key] !== sealed[key]) {
  7118. if (!modified) { modified = {}; }
  7119. modified[key] = latest[key];
  7120. }
  7121. }
  7122. return modified
  7123. }
  7124. function Vue (options) {
  7125. if ( true &&
  7126. !(this instanceof Vue)
  7127. ) {
  7128. warn('Vue is a constructor and should be called with the `new` keyword');
  7129. }
  7130. this._init(options);
  7131. }
  7132. initMixin(Vue);
  7133. stateMixin(Vue);
  7134. eventsMixin(Vue);
  7135. lifecycleMixin(Vue);
  7136. renderMixin(Vue);
  7137. /* */
  7138. function initUse (Vue) {
  7139. Vue.use = function (plugin) {
  7140. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  7141. if (installedPlugins.indexOf(plugin) > -1) {
  7142. return this
  7143. }
  7144. // additional parameters
  7145. var args = toArray(arguments, 1);
  7146. args.unshift(this);
  7147. if (typeof plugin.install === 'function') {
  7148. plugin.install.apply(plugin, args);
  7149. } else if (typeof plugin === 'function') {
  7150. plugin.apply(null, args);
  7151. }
  7152. installedPlugins.push(plugin);
  7153. return this
  7154. };
  7155. }
  7156. /* */
  7157. function initMixin$1 (Vue) {
  7158. Vue.mixin = function (mixin) {
  7159. this.options = mergeOptions(this.options, mixin);
  7160. return this
  7161. };
  7162. }
  7163. /* */
  7164. function initExtend (Vue) {
  7165. /**
  7166. * Each instance constructor, including Vue, has a unique
  7167. * cid. This enables us to create wrapped "child
  7168. * constructors" for prototypal inheritance and cache them.
  7169. */
  7170. Vue.cid = 0;
  7171. var cid = 1;
  7172. /**
  7173. * Class inheritance
  7174. */
  7175. Vue.extend = function (extendOptions) {
  7176. extendOptions = extendOptions || {};
  7177. var Super = this;
  7178. var SuperId = Super.cid;
  7179. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  7180. if (cachedCtors[SuperId]) {
  7181. return cachedCtors[SuperId]
  7182. }
  7183. var name = extendOptions.name || Super.options.name;
  7184. if ( true && name) {
  7185. validateComponentName(name);
  7186. }
  7187. var Sub = function VueComponent (options) {
  7188. this._init(options);
  7189. };
  7190. Sub.prototype = Object.create(Super.prototype);
  7191. Sub.prototype.constructor = Sub;
  7192. Sub.cid = cid++;
  7193. Sub.options = mergeOptions(
  7194. Super.options,
  7195. extendOptions
  7196. );
  7197. Sub['super'] = Super;
  7198. // For props and computed properties, we define the proxy getters on
  7199. // the Vue instances at extension time, on the extended prototype. This
  7200. // avoids Object.defineProperty calls for each instance created.
  7201. if (Sub.options.props) {
  7202. initProps$1(Sub);
  7203. }
  7204. if (Sub.options.computed) {
  7205. initComputed$1(Sub);
  7206. }
  7207. // allow further extension/mixin/plugin usage
  7208. Sub.extend = Super.extend;
  7209. Sub.mixin = Super.mixin;
  7210. Sub.use = Super.use;
  7211. // create asset registers, so extended classes
  7212. // can have their private assets too.
  7213. ASSET_TYPES.forEach(function (type) {
  7214. Sub[type] = Super[type];
  7215. });
  7216. // enable recursive self-lookup
  7217. if (name) {
  7218. Sub.options.components[name] = Sub;
  7219. }
  7220. // keep a reference to the super options at extension time.
  7221. // later at instantiation we can check if Super's options have
  7222. // been updated.
  7223. Sub.superOptions = Super.options;
  7224. Sub.extendOptions = extendOptions;
  7225. Sub.sealedOptions = extend({}, Sub.options);
  7226. // cache constructor
  7227. cachedCtors[SuperId] = Sub;
  7228. return Sub
  7229. };
  7230. }
  7231. function initProps$1 (Comp) {
  7232. var props = Comp.options.props;
  7233. for (var key in props) {
  7234. proxy(Comp.prototype, "_props", key);
  7235. }
  7236. }
  7237. function initComputed$1 (Comp) {
  7238. var computed = Comp.options.computed;
  7239. for (var key in computed) {
  7240. defineComputed(Comp.prototype, key, computed[key]);
  7241. }
  7242. }
  7243. /* */
  7244. function initAssetRegisters (Vue) {
  7245. /**
  7246. * Create asset registration methods.
  7247. */
  7248. ASSET_TYPES.forEach(function (type) {
  7249. Vue[type] = function (
  7250. id,
  7251. definition
  7252. ) {
  7253. if (!definition) {
  7254. return this.options[type + 's'][id]
  7255. } else {
  7256. /* istanbul ignore if */
  7257. if ( true && type === 'component') {
  7258. validateComponentName(id);
  7259. }
  7260. if (type === 'component' && isPlainObject(definition)) {
  7261. definition.name = definition.name || id;
  7262. definition = this.options._base.extend(definition);
  7263. }
  7264. if (type === 'directive' && typeof definition === 'function') {
  7265. definition = { bind: definition, update: definition };
  7266. }
  7267. this.options[type + 's'][id] = definition;
  7268. return definition
  7269. }
  7270. };
  7271. });
  7272. }
  7273. /* */
  7274. function getComponentName (opts) {
  7275. return opts && (opts.Ctor.options.name || opts.tag)
  7276. }
  7277. function matches (pattern, name) {
  7278. if (Array.isArray(pattern)) {
  7279. return pattern.indexOf(name) > -1
  7280. } else if (typeof pattern === 'string') {
  7281. return pattern.split(',').indexOf(name) > -1
  7282. } else if (isRegExp(pattern)) {
  7283. return pattern.test(name)
  7284. }
  7285. /* istanbul ignore next */
  7286. return false
  7287. }
  7288. function pruneCache (keepAliveInstance, filter) {
  7289. var cache = keepAliveInstance.cache;
  7290. var keys = keepAliveInstance.keys;
  7291. var _vnode = keepAliveInstance._vnode;
  7292. for (var key in cache) {
  7293. var cachedNode = cache[key];
  7294. if (cachedNode) {
  7295. var name = getComponentName(cachedNode.componentOptions);
  7296. if (name && !filter(name)) {
  7297. pruneCacheEntry(cache, key, keys, _vnode);
  7298. }
  7299. }
  7300. }
  7301. }
  7302. function pruneCacheEntry (
  7303. cache,
  7304. key,
  7305. keys,
  7306. current
  7307. ) {
  7308. var cached$$1 = cache[key];
  7309. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  7310. cached$$1.componentInstance.$destroy();
  7311. }
  7312. cache[key] = null;
  7313. remove(keys, key);
  7314. }
  7315. var patternTypes = [String, RegExp, Array];
  7316. var KeepAlive = {
  7317. name: 'keep-alive',
  7318. abstract: true,
  7319. props: {
  7320. include: patternTypes,
  7321. exclude: patternTypes,
  7322. max: [String, Number]
  7323. },
  7324. created: function created () {
  7325. this.cache = Object.create(null);
  7326. this.keys = [];
  7327. },
  7328. destroyed: function destroyed () {
  7329. for (var key in this.cache) {
  7330. pruneCacheEntry(this.cache, key, this.keys);
  7331. }
  7332. },
  7333. mounted: function mounted () {
  7334. var this$1 = this;
  7335. this.$watch('include', function (val) {
  7336. pruneCache(this$1, function (name) { return matches(val, name); });
  7337. });
  7338. this.$watch('exclude', function (val) {
  7339. pruneCache(this$1, function (name) { return !matches(val, name); });
  7340. });
  7341. },
  7342. render: function render () {
  7343. var slot = this.$slots.default;
  7344. var vnode = getFirstComponentChild(slot);
  7345. var componentOptions = vnode && vnode.componentOptions;
  7346. if (componentOptions) {
  7347. // check pattern
  7348. var name = getComponentName(componentOptions);
  7349. var ref = this;
  7350. var include = ref.include;
  7351. var exclude = ref.exclude;
  7352. if (
  7353. // not included
  7354. (include && (!name || !matches(include, name))) ||
  7355. // excluded
  7356. (exclude && name && matches(exclude, name))
  7357. ) {
  7358. return vnode
  7359. }
  7360. var ref$1 = this;
  7361. var cache = ref$1.cache;
  7362. var keys = ref$1.keys;
  7363. var key = vnode.key == null
  7364. // same constructor may get registered as different local components
  7365. // so cid alone is not enough (#3269)
  7366. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  7367. : vnode.key;
  7368. if (cache[key]) {
  7369. vnode.componentInstance = cache[key].componentInstance;
  7370. // make current key freshest
  7371. remove(keys, key);
  7372. keys.push(key);
  7373. } else {
  7374. cache[key] = vnode;
  7375. keys.push(key);
  7376. // prune oldest entry
  7377. if (this.max && keys.length > parseInt(this.max)) {
  7378. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  7379. }
  7380. }
  7381. vnode.data.keepAlive = true;
  7382. }
  7383. return vnode || (slot && slot[0])
  7384. }
  7385. };
  7386. var builtInComponents = {
  7387. KeepAlive: KeepAlive
  7388. };
  7389. /* */
  7390. function initGlobalAPI (Vue) {
  7391. // config
  7392. var configDef = {};
  7393. configDef.get = function () { return config; };
  7394. if (true) {
  7395. configDef.set = function () {
  7396. warn(
  7397. 'Do not replace the Vue.config object, set individual fields instead.'
  7398. );
  7399. };
  7400. }
  7401. Object.defineProperty(Vue, 'config', configDef);
  7402. // exposed util methods.
  7403. // NOTE: these are not considered part of the public API - avoid relying on
  7404. // them unless you are aware of the risk.
  7405. Vue.util = {
  7406. warn: warn,
  7407. extend: extend,
  7408. mergeOptions: mergeOptions,
  7409. defineReactive: defineReactive$$1
  7410. };
  7411. Vue.set = set;
  7412. Vue.delete = del;
  7413. Vue.nextTick = nextTick;
  7414. // 2.6 explicit observable API
  7415. Vue.observable = function (obj) {
  7416. observe(obj);
  7417. return obj
  7418. };
  7419. Vue.options = Object.create(null);
  7420. ASSET_TYPES.forEach(function (type) {
  7421. Vue.options[type + 's'] = Object.create(null);
  7422. });
  7423. // this is used to identify the "base" constructor to extend all plain-object
  7424. // components with in Weex's multi-instance scenarios.
  7425. Vue.options._base = Vue;
  7426. extend(Vue.options.components, builtInComponents);
  7427. initUse(Vue);
  7428. initMixin$1(Vue);
  7429. initExtend(Vue);
  7430. initAssetRegisters(Vue);
  7431. }
  7432. initGlobalAPI(Vue);
  7433. Object.defineProperty(Vue.prototype, '$isServer', {
  7434. get: isServerRendering
  7435. });
  7436. Object.defineProperty(Vue.prototype, '$ssrContext', {
  7437. get: function get () {
  7438. /* istanbul ignore next */
  7439. return this.$vnode && this.$vnode.ssrContext
  7440. }
  7441. });
  7442. // expose FunctionalRenderContext for ssr runtime helper installation
  7443. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  7444. value: FunctionalRenderContext
  7445. });
  7446. Vue.version = '2.6.11';
  7447. /**
  7448. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  7449. */
  7450. var ARRAYTYPE = '[object Array]';
  7451. var OBJECTTYPE = '[object Object]';
  7452. // const FUNCTIONTYPE = '[object Function]'
  7453. function diff(current, pre) {
  7454. var result = {};
  7455. syncKeys(current, pre);
  7456. _diff(current, pre, '', result);
  7457. return result
  7458. }
  7459. function syncKeys(current, pre) {
  7460. if (current === pre) { return }
  7461. var rootCurrentType = type(current);
  7462. var rootPreType = type(pre);
  7463. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  7464. if(Object.keys(current).length >= Object.keys(pre).length){
  7465. for (var key in pre) {
  7466. var currentValue = current[key];
  7467. if (currentValue === undefined) {
  7468. current[key] = null;
  7469. } else {
  7470. syncKeys(currentValue, pre[key]);
  7471. }
  7472. }
  7473. }
  7474. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  7475. if (current.length >= pre.length) {
  7476. pre.forEach(function (item, index) {
  7477. syncKeys(current[index], item);
  7478. });
  7479. }
  7480. }
  7481. }
  7482. function _diff(current, pre, path, result) {
  7483. if (current === pre) { return }
  7484. var rootCurrentType = type(current);
  7485. var rootPreType = type(pre);
  7486. if (rootCurrentType == OBJECTTYPE) {
  7487. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  7488. setResult(result, path, current);
  7489. } else {
  7490. var loop = function ( key ) {
  7491. var currentValue = current[key];
  7492. var preValue = pre[key];
  7493. var currentType = type(currentValue);
  7494. var preType = type(preValue);
  7495. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  7496. if (currentValue !== pre[key]) {
  7497. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  7498. }
  7499. } else if (currentType == ARRAYTYPE) {
  7500. if (preType != ARRAYTYPE) {
  7501. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  7502. } else {
  7503. if (currentValue.length < preValue.length) {
  7504. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  7505. } else {
  7506. currentValue.forEach(function (item, index) {
  7507. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  7508. });
  7509. }
  7510. }
  7511. } else if (currentType == OBJECTTYPE) {
  7512. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  7513. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  7514. } else {
  7515. for (var subKey in currentValue) {
  7516. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  7517. }
  7518. }
  7519. }
  7520. };
  7521. for (var key in current) loop( key );
  7522. }
  7523. } else if (rootCurrentType == ARRAYTYPE) {
  7524. if (rootPreType != ARRAYTYPE) {
  7525. setResult(result, path, current);
  7526. } else {
  7527. if (current.length < pre.length) {
  7528. setResult(result, path, current);
  7529. } else {
  7530. current.forEach(function (item, index) {
  7531. _diff(item, pre[index], path + '[' + index + ']', result);
  7532. });
  7533. }
  7534. }
  7535. } else {
  7536. setResult(result, path, current);
  7537. }
  7538. }
  7539. function setResult(result, k, v) {
  7540. // if (type(v) != FUNCTIONTYPE) {
  7541. result[k] = v;
  7542. // }
  7543. }
  7544. function type(obj) {
  7545. return Object.prototype.toString.call(obj)
  7546. }
  7547. /* */
  7548. function flushCallbacks$1(vm) {
  7549. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  7550. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"broke_news_wx","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  7551. var mpInstance = vm.$scope;
  7552. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  7553. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  7554. }
  7555. var copies = vm.__next_tick_callbacks.slice(0);
  7556. vm.__next_tick_callbacks.length = 0;
  7557. for (var i = 0; i < copies.length; i++) {
  7558. copies[i]();
  7559. }
  7560. }
  7561. }
  7562. function hasRenderWatcher(vm) {
  7563. return queue.find(function (watcher) { return vm._watcher === watcher; })
  7564. }
  7565. function nextTick$1(vm, cb) {
  7566. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  7567. //2.nextTick 之前存在 render watcher
  7568. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  7569. if(Object({"NODE_ENV":"development","VUE_APP_NAME":"broke_news_wx","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  7570. var mpInstance = vm.$scope;
  7571. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  7572. ']:nextVueTick');
  7573. }
  7574. return nextTick(cb, vm)
  7575. }else{
  7576. if(Object({"NODE_ENV":"development","VUE_APP_NAME":"broke_news_wx","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  7577. var mpInstance$1 = vm.$scope;
  7578. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  7579. ']:nextMPTick');
  7580. }
  7581. }
  7582. var _resolve;
  7583. if (!vm.__next_tick_callbacks) {
  7584. vm.__next_tick_callbacks = [];
  7585. }
  7586. vm.__next_tick_callbacks.push(function () {
  7587. if (cb) {
  7588. try {
  7589. cb.call(vm);
  7590. } catch (e) {
  7591. handleError(e, vm, 'nextTick');
  7592. }
  7593. } else if (_resolve) {
  7594. _resolve(vm);
  7595. }
  7596. });
  7597. // $flow-disable-line
  7598. if (!cb && typeof Promise !== 'undefined') {
  7599. return new Promise(function (resolve) {
  7600. _resolve = resolve;
  7601. })
  7602. }
  7603. }
  7604. /* */
  7605. function cloneWithData(vm) {
  7606. // 确保当前 vm 所有数据被同步
  7607. var ret = Object.create(null);
  7608. var dataKeys = [].concat(
  7609. Object.keys(vm._data || {}),
  7610. Object.keys(vm._computedWatchers || {}));
  7611. dataKeys.reduce(function(ret, key) {
  7612. ret[key] = vm[key];
  7613. return ret
  7614. }, ret);
  7615. // vue-composition-api
  7616. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  7617. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  7618. if (rawBindings) {
  7619. Object.keys(rawBindings).forEach(function (key) {
  7620. ret[key] = vm[key];
  7621. });
  7622. }
  7623. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  7624. Object.assign(ret, vm.$mp.data || {});
  7625. if (
  7626. Array.isArray(vm.$options.behaviors) &&
  7627. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  7628. ) { //form-field
  7629. ret['name'] = vm.name;
  7630. ret['value'] = vm.value;
  7631. }
  7632. return JSON.parse(JSON.stringify(ret))
  7633. }
  7634. var patch = function(oldVnode, vnode) {
  7635. var this$1 = this;
  7636. if (vnode === null) { //destroy
  7637. return
  7638. }
  7639. if (this.mpType === 'page' || this.mpType === 'component') {
  7640. var mpInstance = this.$scope;
  7641. var data = Object.create(null);
  7642. try {
  7643. data = cloneWithData(this);
  7644. } catch (err) {
  7645. console.error(err);
  7646. }
  7647. data.__webviewId__ = mpInstance.data.__webviewId__;
  7648. var mpData = Object.create(null);
  7649. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  7650. mpData[key] = mpInstance.data[key];
  7651. });
  7652. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  7653. if (Object.keys(diffData).length) {
  7654. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"broke_news_wx","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  7655. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  7656. ']差量更新',
  7657. JSON.stringify(diffData));
  7658. }
  7659. this.__next_tick_pending = true;
  7660. mpInstance.setData(diffData, function () {
  7661. this$1.__next_tick_pending = false;
  7662. flushCallbacks$1(this$1);
  7663. });
  7664. } else {
  7665. flushCallbacks$1(this);
  7666. }
  7667. }
  7668. };
  7669. /* */
  7670. function createEmptyRender() {
  7671. }
  7672. function mountComponent$1(
  7673. vm,
  7674. el,
  7675. hydrating
  7676. ) {
  7677. if (!vm.mpType) {//main.js 中的 new Vue
  7678. return vm
  7679. }
  7680. if (vm.mpType === 'app') {
  7681. vm.$options.render = createEmptyRender;
  7682. }
  7683. if (!vm.$options.render) {
  7684. vm.$options.render = createEmptyRender;
  7685. if (true) {
  7686. /* istanbul ignore if */
  7687. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  7688. vm.$options.el || el) {
  7689. warn(
  7690. 'You are using the runtime-only build of Vue where the template ' +
  7691. 'compiler is not available. Either pre-compile the templates into ' +
  7692. 'render functions, or use the compiler-included build.',
  7693. vm
  7694. );
  7695. } else {
  7696. warn(
  7697. 'Failed to mount component: template or render function not defined.',
  7698. vm
  7699. );
  7700. }
  7701. }
  7702. }
  7703. !vm._$fallback && callHook(vm, 'beforeMount');
  7704. var updateComponent = function () {
  7705. vm._update(vm._render(), hydrating);
  7706. };
  7707. // we set this to vm._watcher inside the watcher's constructor
  7708. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  7709. // component's mounted hook), which relies on vm._watcher being already defined
  7710. new Watcher(vm, updateComponent, noop, {
  7711. before: function before() {
  7712. if (vm._isMounted && !vm._isDestroyed) {
  7713. callHook(vm, 'beforeUpdate');
  7714. }
  7715. }
  7716. }, true /* isRenderWatcher */);
  7717. hydrating = false;
  7718. return vm
  7719. }
  7720. /* */
  7721. function renderClass (
  7722. staticClass,
  7723. dynamicClass
  7724. ) {
  7725. if (isDef(staticClass) || isDef(dynamicClass)) {
  7726. return concat(staticClass, stringifyClass(dynamicClass))
  7727. }
  7728. /* istanbul ignore next */
  7729. return ''
  7730. }
  7731. function concat (a, b) {
  7732. return a ? b ? (a + ' ' + b) : a : (b || '')
  7733. }
  7734. function stringifyClass (value) {
  7735. if (Array.isArray(value)) {
  7736. return stringifyArray(value)
  7737. }
  7738. if (isObject(value)) {
  7739. return stringifyObject(value)
  7740. }
  7741. if (typeof value === 'string') {
  7742. return value
  7743. }
  7744. /* istanbul ignore next */
  7745. return ''
  7746. }
  7747. function stringifyArray (value) {
  7748. var res = '';
  7749. var stringified;
  7750. for (var i = 0, l = value.length; i < l; i++) {
  7751. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  7752. if (res) { res += ' '; }
  7753. res += stringified;
  7754. }
  7755. }
  7756. return res
  7757. }
  7758. function stringifyObject (value) {
  7759. var res = '';
  7760. for (var key in value) {
  7761. if (value[key]) {
  7762. if (res) { res += ' '; }
  7763. res += key;
  7764. }
  7765. }
  7766. return res
  7767. }
  7768. /* */
  7769. var parseStyleText = cached(function (cssText) {
  7770. var res = {};
  7771. var listDelimiter = /;(?![^(]*\))/g;
  7772. var propertyDelimiter = /:(.+)/;
  7773. cssText.split(listDelimiter).forEach(function (item) {
  7774. if (item) {
  7775. var tmp = item.split(propertyDelimiter);
  7776. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  7777. }
  7778. });
  7779. return res
  7780. });
  7781. // normalize possible array / string values into Object
  7782. function normalizeStyleBinding (bindingStyle) {
  7783. if (Array.isArray(bindingStyle)) {
  7784. return toObject(bindingStyle)
  7785. }
  7786. if (typeof bindingStyle === 'string') {
  7787. return parseStyleText(bindingStyle)
  7788. }
  7789. return bindingStyle
  7790. }
  7791. /* */
  7792. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  7793. function getTarget(obj, path) {
  7794. var parts = path.split('.');
  7795. var key = parts[0];
  7796. if (key.indexOf('__$n') === 0) { //number index
  7797. key = parseInt(key.replace('__$n', ''));
  7798. }
  7799. if (parts.length === 1) {
  7800. return obj[key]
  7801. }
  7802. return getTarget(obj[key], parts.slice(1).join('.'))
  7803. }
  7804. function internalMixin(Vue) {
  7805. Vue.config.errorHandler = function(err, vm, info) {
  7806. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  7807. console.error(err);
  7808. /* eslint-disable no-undef */
  7809. var app = typeof getApp === 'function' && getApp();
  7810. if (app && app.onError) {
  7811. app.onError(err);
  7812. }
  7813. };
  7814. var oldEmit = Vue.prototype.$emit;
  7815. Vue.prototype.$emit = function(event) {
  7816. if (this.$scope && event) {
  7817. (this.$scope['_triggerEvent'] || this.$scope['triggerEvent']).call(this.$scope, event, {
  7818. __args__: toArray(arguments, 1)
  7819. });
  7820. }
  7821. return oldEmit.apply(this, arguments)
  7822. };
  7823. Vue.prototype.$nextTick = function(fn) {
  7824. return nextTick$1(this, fn)
  7825. };
  7826. MP_METHODS.forEach(function (method) {
  7827. Vue.prototype[method] = function(args) {
  7828. if (this.$scope && this.$scope[method]) {
  7829. return this.$scope[method](args)
  7830. }
  7831. // mp-alipay
  7832. if (typeof my === 'undefined') {
  7833. return
  7834. }
  7835. if (method === 'createSelectorQuery') {
  7836. /* eslint-disable no-undef */
  7837. return my.createSelectorQuery(args)
  7838. } else if (method === 'createIntersectionObserver') {
  7839. /* eslint-disable no-undef */
  7840. return my.createIntersectionObserver(args)
  7841. }
  7842. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  7843. };
  7844. });
  7845. Vue.prototype.__init_provide = initProvide;
  7846. Vue.prototype.__init_injections = initInjections;
  7847. Vue.prototype.__call_hook = function(hook, args) {
  7848. var vm = this;
  7849. // #7573 disable dep collection when invoking lifecycle hooks
  7850. pushTarget();
  7851. var handlers = vm.$options[hook];
  7852. var info = hook + " hook";
  7853. var ret;
  7854. if (handlers) {
  7855. for (var i = 0, j = handlers.length; i < j; i++) {
  7856. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  7857. }
  7858. }
  7859. if (vm._hasHookEvent) {
  7860. vm.$emit('hook:' + hook, args);
  7861. }
  7862. popTarget();
  7863. return ret
  7864. };
  7865. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  7866. if (Array.isArray(modifiers)) {
  7867. if (modifiers.indexOf('trim') !== -1) {
  7868. value = value.trim();
  7869. }
  7870. if (modifiers.indexOf('number') !== -1) {
  7871. value = this._n(value);
  7872. }
  7873. }
  7874. if (!target) {
  7875. target = this;
  7876. }
  7877. // 解决动态属性添加
  7878. Vue.set(target, key, value);
  7879. };
  7880. Vue.prototype.__set_sync = function(target, key, value) {
  7881. if (!target) {
  7882. target = this;
  7883. }
  7884. // 解决动态属性添加
  7885. Vue.set(target, key, value);
  7886. };
  7887. Vue.prototype.__get_orig = function(item) {
  7888. if (isPlainObject(item)) {
  7889. return item['$orig'] || item
  7890. }
  7891. return item
  7892. };
  7893. Vue.prototype.__get_value = function(dataPath, target) {
  7894. return getTarget(target || this, dataPath)
  7895. };
  7896. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  7897. return renderClass(staticClass, dynamicClass)
  7898. };
  7899. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  7900. if (!dynamicStyle && !staticStyle) {
  7901. return ''
  7902. }
  7903. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  7904. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  7905. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  7906. };
  7907. Vue.prototype.__map = function(val, iteratee) {
  7908. //TODO 暂不考虑 string
  7909. var ret, i, l, keys, key;
  7910. if (Array.isArray(val)) {
  7911. ret = new Array(val.length);
  7912. for (i = 0, l = val.length; i < l; i++) {
  7913. ret[i] = iteratee(val[i], i);
  7914. }
  7915. return ret
  7916. } else if (isObject(val)) {
  7917. keys = Object.keys(val);
  7918. ret = Object.create(null);
  7919. for (i = 0, l = keys.length; i < l; i++) {
  7920. key = keys[i];
  7921. ret[key] = iteratee(val[key], key, i);
  7922. }
  7923. return ret
  7924. } else if (typeof val === 'number') {
  7925. ret = new Array(val);
  7926. for (i = 0, l = val; i < l; i++) {
  7927. // 第一个参数暂时仍和小程序一致
  7928. ret[i] = iteratee(i, i);
  7929. }
  7930. return ret
  7931. }
  7932. return []
  7933. };
  7934. }
  7935. /* */
  7936. var LIFECYCLE_HOOKS$1 = [
  7937. //App
  7938. 'onLaunch',
  7939. 'onShow',
  7940. 'onHide',
  7941. 'onUniNViewMessage',
  7942. 'onPageNotFound',
  7943. 'onThemeChange',
  7944. 'onError',
  7945. 'onUnhandledRejection',
  7946. //Page
  7947. 'onInit',
  7948. 'onLoad',
  7949. // 'onShow',
  7950. 'onReady',
  7951. // 'onHide',
  7952. 'onUnload',
  7953. 'onPullDownRefresh',
  7954. 'onReachBottom',
  7955. 'onTabItemTap',
  7956. 'onAddToFavorites',
  7957. 'onShareTimeline',
  7958. 'onShareAppMessage',
  7959. 'onResize',
  7960. 'onPageScroll',
  7961. 'onNavigationBarButtonTap',
  7962. 'onBackPress',
  7963. 'onNavigationBarSearchInputChanged',
  7964. 'onNavigationBarSearchInputConfirmed',
  7965. 'onNavigationBarSearchInputClicked',
  7966. //Component
  7967. // 'onReady', // 兼容旧版本,应该移除该事件
  7968. 'onPageShow',
  7969. 'onPageHide',
  7970. 'onPageResize'
  7971. ];
  7972. function lifecycleMixin$1(Vue) {
  7973. //fixed vue-class-component
  7974. var oldExtend = Vue.extend;
  7975. Vue.extend = function(extendOptions) {
  7976. extendOptions = extendOptions || {};
  7977. var methods = extendOptions.methods;
  7978. if (methods) {
  7979. Object.keys(methods).forEach(function (methodName) {
  7980. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  7981. extendOptions[methodName] = methods[methodName];
  7982. delete methods[methodName];
  7983. }
  7984. });
  7985. }
  7986. return oldExtend.call(this, extendOptions)
  7987. };
  7988. var strategies = Vue.config.optionMergeStrategies;
  7989. var mergeHook = strategies.created;
  7990. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  7991. strategies[hook] = mergeHook;
  7992. });
  7993. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  7994. }
  7995. /* */
  7996. // install platform patch function
  7997. Vue.prototype.__patch__ = patch;
  7998. // public mount method
  7999. Vue.prototype.$mount = function(
  8000. el ,
  8001. hydrating
  8002. ) {
  8003. return mountComponent$1(this, el, hydrating)
  8004. };
  8005. lifecycleMixin$1(Vue);
  8006. internalMixin(Vue);
  8007. /* */
  8008. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  8009. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2)))
  8010. /***/ }),
  8011. /* 5 */
  8012. /*!*********************************************!*\
  8013. !*** D:/code/work/broke_news_wx/pages.json ***!
  8014. \*********************************************/
  8015. /*! no static exports found */
  8016. /***/ (function(module, exports) {
  8017. /***/ }),
  8018. /* 6 */,
  8019. /* 7 */,
  8020. /* 8 */,
  8021. /* 9 */,
  8022. /* 10 */,
  8023. /* 11 */
  8024. /*!**********************************************************************************************************!*\
  8025. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  8026. \**********************************************************************************************************/
  8027. /*! exports provided: default */
  8028. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8029. "use strict";
  8030. __webpack_require__.r(__webpack_exports__);
  8031. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  8032. /* globals __VUE_SSR_CONTEXT__ */
  8033. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  8034. // This module is a runtime utility for cleaner component module output and will
  8035. // be included in the final webpack user bundle.
  8036. function normalizeComponent (
  8037. scriptExports,
  8038. render,
  8039. staticRenderFns,
  8040. functionalTemplate,
  8041. injectStyles,
  8042. scopeId,
  8043. moduleIdentifier, /* server only */
  8044. shadowMode, /* vue-cli only */
  8045. components, // fixed by xxxxxx auto components
  8046. renderjs // fixed by xxxxxx renderjs
  8047. ) {
  8048. // Vue.extend constructor export interop
  8049. var options = typeof scriptExports === 'function'
  8050. ? scriptExports.options
  8051. : scriptExports
  8052. // fixed by xxxxxx auto components
  8053. if (components) {
  8054. if (!options.components) {
  8055. options.components = {}
  8056. }
  8057. var hasOwn = Object.prototype.hasOwnProperty
  8058. for (var name in components) {
  8059. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  8060. options.components[name] = components[name]
  8061. }
  8062. }
  8063. }
  8064. // fixed by xxxxxx renderjs
  8065. if (renderjs) {
  8066. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  8067. this[renderjs.__module] = this
  8068. });
  8069. (options.mixins || (options.mixins = [])).push(renderjs)
  8070. }
  8071. // render functions
  8072. if (render) {
  8073. options.render = render
  8074. options.staticRenderFns = staticRenderFns
  8075. options._compiled = true
  8076. }
  8077. // functional template
  8078. if (functionalTemplate) {
  8079. options.functional = true
  8080. }
  8081. // scopedId
  8082. if (scopeId) {
  8083. options._scopeId = 'data-v-' + scopeId
  8084. }
  8085. var hook
  8086. if (moduleIdentifier) { // server build
  8087. hook = function (context) {
  8088. // 2.3 injection
  8089. context =
  8090. context || // cached call
  8091. (this.$vnode && this.$vnode.ssrContext) || // stateful
  8092. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  8093. // 2.2 with runInNewContext: true
  8094. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  8095. context = __VUE_SSR_CONTEXT__
  8096. }
  8097. // inject component styles
  8098. if (injectStyles) {
  8099. injectStyles.call(this, context)
  8100. }
  8101. // register component module identifier for async chunk inferrence
  8102. if (context && context._registeredComponents) {
  8103. context._registeredComponents.add(moduleIdentifier)
  8104. }
  8105. }
  8106. // used by ssr in case component is cached and beforeCreate
  8107. // never gets called
  8108. options._ssrRegister = hook
  8109. } else if (injectStyles) {
  8110. hook = shadowMode
  8111. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  8112. : injectStyles
  8113. }
  8114. if (hook) {
  8115. if (options.functional) {
  8116. // for template-only hot-reload because in that case the render fn doesn't
  8117. // go through the normalizer
  8118. options._injectStyles = hook
  8119. // register for functioal component in vue file
  8120. var originalRender = options.render
  8121. options.render = function renderWithStyleInjection (h, context) {
  8122. hook.call(context)
  8123. return originalRender(h, context)
  8124. }
  8125. } else {
  8126. // inject component registration as beforeCreate hook
  8127. var existing = options.beforeCreate
  8128. options.beforeCreate = existing
  8129. ? [].concat(existing, hook)
  8130. : [hook]
  8131. }
  8132. }
  8133. return {
  8134. exports: scriptExports,
  8135. options: options
  8136. }
  8137. }
  8138. /***/ }),
  8139. /* 12 */
  8140. /*!*************************************************!*\
  8141. !*** D:/code/work/broke_news_wx/store/index.js ***!
  8142. \*************************************************/
  8143. /*! no static exports found */
  8144. /***/ (function(module, exports, __webpack_require__) {
  8145. "use strict";
  8146. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 4));
  8147. var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 13));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  8148. _vue.default.use(_vuex.default);
  8149. var files = __webpack_require__(14);
  8150. var modules = {
  8151. state: {},
  8152. mutations: {},
  8153. actions: {} };
  8154. files.keys().forEach(function (key) {
  8155. Object.assign(modules.state, files(key)["state"]);
  8156. Object.assign(modules.mutations, files(key)["mutations"]);
  8157. Object.assign(modules.actions, files(key)["actions"]);
  8158. });
  8159. var store = new _vuex.default.Store(modules);var _default =
  8160. store;exports.default = _default;
  8161. /***/ }),
  8162. /* 13 */
  8163. /*!**************************************************************************************!*\
  8164. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vuex3/dist/vuex.common.js ***!
  8165. \**************************************************************************************/
  8166. /*! no static exports found */
  8167. /***/ (function(module, exports, __webpack_require__) {
  8168. "use strict";
  8169. /* WEBPACK VAR INJECTION */(function(global) {/*!
  8170. * vuex v3.6.2
  8171. * (c) 2021 Evan You
  8172. * @license MIT
  8173. */
  8174. function applyMixin (Vue) {
  8175. var version = Number(Vue.version.split('.')[0]);
  8176. if (version >= 2) {
  8177. Vue.mixin({ beforeCreate: vuexInit });
  8178. } else {
  8179. // override init and inject vuex init procedure
  8180. // for 1.x backwards compatibility.
  8181. var _init = Vue.prototype._init;
  8182. Vue.prototype._init = function (options) {
  8183. if ( options === void 0 ) options = {};
  8184. options.init = options.init
  8185. ? [vuexInit].concat(options.init)
  8186. : vuexInit;
  8187. _init.call(this, options);
  8188. };
  8189. }
  8190. /**
  8191. * Vuex init hook, injected into each instances init hooks list.
  8192. */
  8193. function vuexInit () {
  8194. var options = this.$options;
  8195. // store injection
  8196. if (options.store) {
  8197. this.$store = typeof options.store === 'function'
  8198. ? options.store()
  8199. : options.store;
  8200. } else if (options.parent && options.parent.$store) {
  8201. this.$store = options.parent.$store;
  8202. }
  8203. }
  8204. }
  8205. var target = typeof window !== 'undefined'
  8206. ? window
  8207. : typeof global !== 'undefined'
  8208. ? global
  8209. : {};
  8210. var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  8211. function devtoolPlugin (store) {
  8212. if (!devtoolHook) { return }
  8213. store._devtoolHook = devtoolHook;
  8214. devtoolHook.emit('vuex:init', store);
  8215. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  8216. store.replaceState(targetState);
  8217. });
  8218. store.subscribe(function (mutation, state) {
  8219. devtoolHook.emit('vuex:mutation', mutation, state);
  8220. }, { prepend: true });
  8221. store.subscribeAction(function (action, state) {
  8222. devtoolHook.emit('vuex:action', action, state);
  8223. }, { prepend: true });
  8224. }
  8225. /**
  8226. * Get the first item that pass the test
  8227. * by second argument function
  8228. *
  8229. * @param {Array} list
  8230. * @param {Function} f
  8231. * @return {*}
  8232. */
  8233. function find (list, f) {
  8234. return list.filter(f)[0]
  8235. }
  8236. /**
  8237. * Deep copy the given object considering circular structure.
  8238. * This function caches all nested objects and its copies.
  8239. * If it detects circular structure, use cached copy to avoid infinite loop.
  8240. *
  8241. * @param {*} obj
  8242. * @param {Array<Object>} cache
  8243. * @return {*}
  8244. */
  8245. function deepCopy (obj, cache) {
  8246. if ( cache === void 0 ) cache = [];
  8247. // just return if obj is immutable value
  8248. if (obj === null || typeof obj !== 'object') {
  8249. return obj
  8250. }
  8251. // if obj is hit, it is in circular structure
  8252. var hit = find(cache, function (c) { return c.original === obj; });
  8253. if (hit) {
  8254. return hit.copy
  8255. }
  8256. var copy = Array.isArray(obj) ? [] : {};
  8257. // put the copy into cache at first
  8258. // because we want to refer it in recursive deepCopy
  8259. cache.push({
  8260. original: obj,
  8261. copy: copy
  8262. });
  8263. Object.keys(obj).forEach(function (key) {
  8264. copy[key] = deepCopy(obj[key], cache);
  8265. });
  8266. return copy
  8267. }
  8268. /**
  8269. * forEach for object
  8270. */
  8271. function forEachValue (obj, fn) {
  8272. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  8273. }
  8274. function isObject (obj) {
  8275. return obj !== null && typeof obj === 'object'
  8276. }
  8277. function isPromise (val) {
  8278. return val && typeof val.then === 'function'
  8279. }
  8280. function assert (condition, msg) {
  8281. if (!condition) { throw new Error(("[vuex] " + msg)) }
  8282. }
  8283. function partial (fn, arg) {
  8284. return function () {
  8285. return fn(arg)
  8286. }
  8287. }
  8288. // Base data struct for store's module, package with some attribute and method
  8289. var Module = function Module (rawModule, runtime) {
  8290. this.runtime = runtime;
  8291. // Store some children item
  8292. this._children = Object.create(null);
  8293. // Store the origin module object which passed by programmer
  8294. this._rawModule = rawModule;
  8295. var rawState = rawModule.state;
  8296. // Store the origin module's state
  8297. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  8298. };
  8299. var prototypeAccessors = { namespaced: { configurable: true } };
  8300. prototypeAccessors.namespaced.get = function () {
  8301. return !!this._rawModule.namespaced
  8302. };
  8303. Module.prototype.addChild = function addChild (key, module) {
  8304. this._children[key] = module;
  8305. };
  8306. Module.prototype.removeChild = function removeChild (key) {
  8307. delete this._children[key];
  8308. };
  8309. Module.prototype.getChild = function getChild (key) {
  8310. return this._children[key]
  8311. };
  8312. Module.prototype.hasChild = function hasChild (key) {
  8313. return key in this._children
  8314. };
  8315. Module.prototype.update = function update (rawModule) {
  8316. this._rawModule.namespaced = rawModule.namespaced;
  8317. if (rawModule.actions) {
  8318. this._rawModule.actions = rawModule.actions;
  8319. }
  8320. if (rawModule.mutations) {
  8321. this._rawModule.mutations = rawModule.mutations;
  8322. }
  8323. if (rawModule.getters) {
  8324. this._rawModule.getters = rawModule.getters;
  8325. }
  8326. };
  8327. Module.prototype.forEachChild = function forEachChild (fn) {
  8328. forEachValue(this._children, fn);
  8329. };
  8330. Module.prototype.forEachGetter = function forEachGetter (fn) {
  8331. if (this._rawModule.getters) {
  8332. forEachValue(this._rawModule.getters, fn);
  8333. }
  8334. };
  8335. Module.prototype.forEachAction = function forEachAction (fn) {
  8336. if (this._rawModule.actions) {
  8337. forEachValue(this._rawModule.actions, fn);
  8338. }
  8339. };
  8340. Module.prototype.forEachMutation = function forEachMutation (fn) {
  8341. if (this._rawModule.mutations) {
  8342. forEachValue(this._rawModule.mutations, fn);
  8343. }
  8344. };
  8345. Object.defineProperties( Module.prototype, prototypeAccessors );
  8346. var ModuleCollection = function ModuleCollection (rawRootModule) {
  8347. // register root module (Vuex.Store options)
  8348. this.register([], rawRootModule, false);
  8349. };
  8350. ModuleCollection.prototype.get = function get (path) {
  8351. return path.reduce(function (module, key) {
  8352. return module.getChild(key)
  8353. }, this.root)
  8354. };
  8355. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  8356. var module = this.root;
  8357. return path.reduce(function (namespace, key) {
  8358. module = module.getChild(key);
  8359. return namespace + (module.namespaced ? key + '/' : '')
  8360. }, '')
  8361. };
  8362. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  8363. update([], this.root, rawRootModule);
  8364. };
  8365. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  8366. var this$1 = this;
  8367. if ( runtime === void 0 ) runtime = true;
  8368. if ((true)) {
  8369. assertRawModule(path, rawModule);
  8370. }
  8371. var newModule = new Module(rawModule, runtime);
  8372. if (path.length === 0) {
  8373. this.root = newModule;
  8374. } else {
  8375. var parent = this.get(path.slice(0, -1));
  8376. parent.addChild(path[path.length - 1], newModule);
  8377. }
  8378. // register nested modules
  8379. if (rawModule.modules) {
  8380. forEachValue(rawModule.modules, function (rawChildModule, key) {
  8381. this$1.register(path.concat(key), rawChildModule, runtime);
  8382. });
  8383. }
  8384. };
  8385. ModuleCollection.prototype.unregister = function unregister (path) {
  8386. var parent = this.get(path.slice(0, -1));
  8387. var key = path[path.length - 1];
  8388. var child = parent.getChild(key);
  8389. if (!child) {
  8390. if ((true)) {
  8391. console.warn(
  8392. "[vuex] trying to unregister module '" + key + "', which is " +
  8393. "not registered"
  8394. );
  8395. }
  8396. return
  8397. }
  8398. if (!child.runtime) {
  8399. return
  8400. }
  8401. parent.removeChild(key);
  8402. };
  8403. ModuleCollection.prototype.isRegistered = function isRegistered (path) {
  8404. var parent = this.get(path.slice(0, -1));
  8405. var key = path[path.length - 1];
  8406. if (parent) {
  8407. return parent.hasChild(key)
  8408. }
  8409. return false
  8410. };
  8411. function update (path, targetModule, newModule) {
  8412. if ((true)) {
  8413. assertRawModule(path, newModule);
  8414. }
  8415. // update target module
  8416. targetModule.update(newModule);
  8417. // update nested modules
  8418. if (newModule.modules) {
  8419. for (var key in newModule.modules) {
  8420. if (!targetModule.getChild(key)) {
  8421. if ((true)) {
  8422. console.warn(
  8423. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  8424. 'manual reload is needed'
  8425. );
  8426. }
  8427. return
  8428. }
  8429. update(
  8430. path.concat(key),
  8431. targetModule.getChild(key),
  8432. newModule.modules[key]
  8433. );
  8434. }
  8435. }
  8436. }
  8437. var functionAssert = {
  8438. assert: function (value) { return typeof value === 'function'; },
  8439. expected: 'function'
  8440. };
  8441. var objectAssert = {
  8442. assert: function (value) { return typeof value === 'function' ||
  8443. (typeof value === 'object' && typeof value.handler === 'function'); },
  8444. expected: 'function or object with "handler" function'
  8445. };
  8446. var assertTypes = {
  8447. getters: functionAssert,
  8448. mutations: functionAssert,
  8449. actions: objectAssert
  8450. };
  8451. function assertRawModule (path, rawModule) {
  8452. Object.keys(assertTypes).forEach(function (key) {
  8453. if (!rawModule[key]) { return }
  8454. var assertOptions = assertTypes[key];
  8455. forEachValue(rawModule[key], function (value, type) {
  8456. assert(
  8457. assertOptions.assert(value),
  8458. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  8459. );
  8460. });
  8461. });
  8462. }
  8463. function makeAssertionMessage (path, key, type, value, expected) {
  8464. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  8465. if (path.length > 0) {
  8466. buf += " in module \"" + (path.join('.')) + "\"";
  8467. }
  8468. buf += " is " + (JSON.stringify(value)) + ".";
  8469. return buf
  8470. }
  8471. var Vue; // bind on install
  8472. var Store = function Store (options) {
  8473. var this$1 = this;
  8474. if ( options === void 0 ) options = {};
  8475. // Auto install if it is not done yet and `window` has `Vue`.
  8476. // To allow users to avoid auto-installation in some cases,
  8477. // this code should be placed here. See #731
  8478. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  8479. install(window.Vue);
  8480. }
  8481. if ((true)) {
  8482. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  8483. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  8484. assert(this instanceof Store, "store must be called with the new operator.");
  8485. }
  8486. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  8487. var strict = options.strict; if ( strict === void 0 ) strict = false;
  8488. // store internal state
  8489. this._committing = false;
  8490. this._actions = Object.create(null);
  8491. this._actionSubscribers = [];
  8492. this._mutations = Object.create(null);
  8493. this._wrappedGetters = Object.create(null);
  8494. this._modules = new ModuleCollection(options);
  8495. this._modulesNamespaceMap = Object.create(null);
  8496. this._subscribers = [];
  8497. this._watcherVM = new Vue();
  8498. this._makeLocalGettersCache = Object.create(null);
  8499. // bind commit and dispatch to self
  8500. var store = this;
  8501. var ref = this;
  8502. var dispatch = ref.dispatch;
  8503. var commit = ref.commit;
  8504. this.dispatch = function boundDispatch (type, payload) {
  8505. return dispatch.call(store, type, payload)
  8506. };
  8507. this.commit = function boundCommit (type, payload, options) {
  8508. return commit.call(store, type, payload, options)
  8509. };
  8510. // strict mode
  8511. this.strict = strict;
  8512. var state = this._modules.root.state;
  8513. // init root module.
  8514. // this also recursively registers all sub-modules
  8515. // and collects all module getters inside this._wrappedGetters
  8516. installModule(this, state, [], this._modules.root);
  8517. // initialize the store vm, which is responsible for the reactivity
  8518. // (also registers _wrappedGetters as computed properties)
  8519. resetStoreVM(this, state);
  8520. // apply plugins
  8521. plugins.forEach(function (plugin) { return plugin(this$1); });
  8522. var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
  8523. if (useDevtools) {
  8524. devtoolPlugin(this);
  8525. }
  8526. };
  8527. var prototypeAccessors$1 = { state: { configurable: true } };
  8528. prototypeAccessors$1.state.get = function () {
  8529. return this._vm._data.$$state
  8530. };
  8531. prototypeAccessors$1.state.set = function (v) {
  8532. if ((true)) {
  8533. assert(false, "use store.replaceState() to explicit replace store state.");
  8534. }
  8535. };
  8536. Store.prototype.commit = function commit (_type, _payload, _options) {
  8537. var this$1 = this;
  8538. // check object-style commit
  8539. var ref = unifyObjectStyle(_type, _payload, _options);
  8540. var type = ref.type;
  8541. var payload = ref.payload;
  8542. var options = ref.options;
  8543. var mutation = { type: type, payload: payload };
  8544. var entry = this._mutations[type];
  8545. if (!entry) {
  8546. if ((true)) {
  8547. console.error(("[vuex] unknown mutation type: " + type));
  8548. }
  8549. return
  8550. }
  8551. this._withCommit(function () {
  8552. entry.forEach(function commitIterator (handler) {
  8553. handler(payload);
  8554. });
  8555. });
  8556. this._subscribers
  8557. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  8558. .forEach(function (sub) { return sub(mutation, this$1.state); });
  8559. if (
  8560. ( true) &&
  8561. options && options.silent
  8562. ) {
  8563. console.warn(
  8564. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  8565. 'Use the filter functionality in the vue-devtools'
  8566. );
  8567. }
  8568. };
  8569. Store.prototype.dispatch = function dispatch (_type, _payload) {
  8570. var this$1 = this;
  8571. // check object-style dispatch
  8572. var ref = unifyObjectStyle(_type, _payload);
  8573. var type = ref.type;
  8574. var payload = ref.payload;
  8575. var action = { type: type, payload: payload };
  8576. var entry = this._actions[type];
  8577. if (!entry) {
  8578. if ((true)) {
  8579. console.error(("[vuex] unknown action type: " + type));
  8580. }
  8581. return
  8582. }
  8583. try {
  8584. this._actionSubscribers
  8585. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  8586. .filter(function (sub) { return sub.before; })
  8587. .forEach(function (sub) { return sub.before(action, this$1.state); });
  8588. } catch (e) {
  8589. if ((true)) {
  8590. console.warn("[vuex] error in before action subscribers: ");
  8591. console.error(e);
  8592. }
  8593. }
  8594. var result = entry.length > 1
  8595. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  8596. : entry[0](payload);
  8597. return new Promise(function (resolve, reject) {
  8598. result.then(function (res) {
  8599. try {
  8600. this$1._actionSubscribers
  8601. .filter(function (sub) { return sub.after; })
  8602. .forEach(function (sub) { return sub.after(action, this$1.state); });
  8603. } catch (e) {
  8604. if ((true)) {
  8605. console.warn("[vuex] error in after action subscribers: ");
  8606. console.error(e);
  8607. }
  8608. }
  8609. resolve(res);
  8610. }, function (error) {
  8611. try {
  8612. this$1._actionSubscribers
  8613. .filter(function (sub) { return sub.error; })
  8614. .forEach(function (sub) { return sub.error(action, this$1.state, error); });
  8615. } catch (e) {
  8616. if ((true)) {
  8617. console.warn("[vuex] error in error action subscribers: ");
  8618. console.error(e);
  8619. }
  8620. }
  8621. reject(error);
  8622. });
  8623. })
  8624. };
  8625. Store.prototype.subscribe = function subscribe (fn, options) {
  8626. return genericSubscribe(fn, this._subscribers, options)
  8627. };
  8628. Store.prototype.subscribeAction = function subscribeAction (fn, options) {
  8629. var subs = typeof fn === 'function' ? { before: fn } : fn;
  8630. return genericSubscribe(subs, this._actionSubscribers, options)
  8631. };
  8632. Store.prototype.watch = function watch (getter, cb, options) {
  8633. var this$1 = this;
  8634. if ((true)) {
  8635. assert(typeof getter === 'function', "store.watch only accepts a function.");
  8636. }
  8637. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  8638. };
  8639. Store.prototype.replaceState = function replaceState (state) {
  8640. var this$1 = this;
  8641. this._withCommit(function () {
  8642. this$1._vm._data.$$state = state;
  8643. });
  8644. };
  8645. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  8646. if ( options === void 0 ) options = {};
  8647. if (typeof path === 'string') { path = [path]; }
  8648. if ((true)) {
  8649. assert(Array.isArray(path), "module path must be a string or an Array.");
  8650. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  8651. }
  8652. this._modules.register(path, rawModule);
  8653. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  8654. // reset store to update getters...
  8655. resetStoreVM(this, this.state);
  8656. };
  8657. Store.prototype.unregisterModule = function unregisterModule (path) {
  8658. var this$1 = this;
  8659. if (typeof path === 'string') { path = [path]; }
  8660. if ((true)) {
  8661. assert(Array.isArray(path), "module path must be a string or an Array.");
  8662. }
  8663. this._modules.unregister(path);
  8664. this._withCommit(function () {
  8665. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  8666. Vue.delete(parentState, path[path.length - 1]);
  8667. });
  8668. resetStore(this);
  8669. };
  8670. Store.prototype.hasModule = function hasModule (path) {
  8671. if (typeof path === 'string') { path = [path]; }
  8672. if ((true)) {
  8673. assert(Array.isArray(path), "module path must be a string or an Array.");
  8674. }
  8675. return this._modules.isRegistered(path)
  8676. };
  8677. Store.prototype[[104,111,116,85,112,100,97,116,101].map(function (item) {return String.fromCharCode(item)}).join('')] = function (newOptions) {
  8678. this._modules.update(newOptions);
  8679. resetStore(this, true);
  8680. };
  8681. Store.prototype._withCommit = function _withCommit (fn) {
  8682. var committing = this._committing;
  8683. this._committing = true;
  8684. fn();
  8685. this._committing = committing;
  8686. };
  8687. Object.defineProperties( Store.prototype, prototypeAccessors$1 );
  8688. function genericSubscribe (fn, subs, options) {
  8689. if (subs.indexOf(fn) < 0) {
  8690. options && options.prepend
  8691. ? subs.unshift(fn)
  8692. : subs.push(fn);
  8693. }
  8694. return function () {
  8695. var i = subs.indexOf(fn);
  8696. if (i > -1) {
  8697. subs.splice(i, 1);
  8698. }
  8699. }
  8700. }
  8701. function resetStore (store, hot) {
  8702. store._actions = Object.create(null);
  8703. store._mutations = Object.create(null);
  8704. store._wrappedGetters = Object.create(null);
  8705. store._modulesNamespaceMap = Object.create(null);
  8706. var state = store.state;
  8707. // init all modules
  8708. installModule(store, state, [], store._modules.root, true);
  8709. // reset vm
  8710. resetStoreVM(store, state, hot);
  8711. }
  8712. function resetStoreVM (store, state, hot) {
  8713. var oldVm = store._vm;
  8714. // bind store public getters
  8715. store.getters = {};
  8716. // reset local getters cache
  8717. store._makeLocalGettersCache = Object.create(null);
  8718. var wrappedGetters = store._wrappedGetters;
  8719. var computed = {};
  8720. forEachValue(wrappedGetters, function (fn, key) {
  8721. // use computed to leverage its lazy-caching mechanism
  8722. // direct inline function use will lead to closure preserving oldVm.
  8723. // using partial to return function with only arguments preserved in closure environment.
  8724. computed[key] = partial(fn, store);
  8725. Object.defineProperty(store.getters, key, {
  8726. get: function () { return store._vm[key]; },
  8727. enumerable: true // for local getters
  8728. });
  8729. });
  8730. // use a Vue instance to store the state tree
  8731. // suppress warnings just in case the user has added
  8732. // some funky global mixins
  8733. var silent = Vue.config.silent;
  8734. Vue.config.silent = true;
  8735. store._vm = new Vue({
  8736. data: {
  8737. $$state: state
  8738. },
  8739. computed: computed
  8740. });
  8741. Vue.config.silent = silent;
  8742. // enable strict mode for new vm
  8743. if (store.strict) {
  8744. enableStrictMode(store);
  8745. }
  8746. if (oldVm) {
  8747. if (hot) {
  8748. // dispatch changes in all subscribed watchers
  8749. // to force getter re-evaluation for hot reloading.
  8750. store._withCommit(function () {
  8751. oldVm._data.$$state = null;
  8752. });
  8753. }
  8754. Vue.nextTick(function () { return oldVm.$destroy(); });
  8755. }
  8756. }
  8757. function installModule (store, rootState, path, module, hot) {
  8758. var isRoot = !path.length;
  8759. var namespace = store._modules.getNamespace(path);
  8760. // register in namespace map
  8761. if (module.namespaced) {
  8762. if (store._modulesNamespaceMap[namespace] && ("development" !== 'production')) {
  8763. console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));
  8764. }
  8765. store._modulesNamespaceMap[namespace] = module;
  8766. }
  8767. // set state
  8768. if (!isRoot && !hot) {
  8769. var parentState = getNestedState(rootState, path.slice(0, -1));
  8770. var moduleName = path[path.length - 1];
  8771. store._withCommit(function () {
  8772. if ((true)) {
  8773. if (moduleName in parentState) {
  8774. console.warn(
  8775. ("[vuex] state field \"" + moduleName + "\" was overridden by a module with the same name at \"" + (path.join('.')) + "\"")
  8776. );
  8777. }
  8778. }
  8779. Vue.set(parentState, moduleName, module.state);
  8780. });
  8781. }
  8782. var local = module.context = makeLocalContext(store, namespace, path);
  8783. module.forEachMutation(function (mutation, key) {
  8784. var namespacedType = namespace + key;
  8785. registerMutation(store, namespacedType, mutation, local);
  8786. });
  8787. module.forEachAction(function (action, key) {
  8788. var type = action.root ? key : namespace + key;
  8789. var handler = action.handler || action;
  8790. registerAction(store, type, handler, local);
  8791. });
  8792. module.forEachGetter(function (getter, key) {
  8793. var namespacedType = namespace + key;
  8794. registerGetter(store, namespacedType, getter, local);
  8795. });
  8796. module.forEachChild(function (child, key) {
  8797. installModule(store, rootState, path.concat(key), child, hot);
  8798. });
  8799. }
  8800. /**
  8801. * make localized dispatch, commit, getters and state
  8802. * if there is no namespace, just use root ones
  8803. */
  8804. function makeLocalContext (store, namespace, path) {
  8805. var noNamespace = namespace === '';
  8806. var local = {
  8807. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  8808. var args = unifyObjectStyle(_type, _payload, _options);
  8809. var payload = args.payload;
  8810. var options = args.options;
  8811. var type = args.type;
  8812. if (!options || !options.root) {
  8813. type = namespace + type;
  8814. if (( true) && !store._actions[type]) {
  8815. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  8816. return
  8817. }
  8818. }
  8819. return store.dispatch(type, payload)
  8820. },
  8821. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  8822. var args = unifyObjectStyle(_type, _payload, _options);
  8823. var payload = args.payload;
  8824. var options = args.options;
  8825. var type = args.type;
  8826. if (!options || !options.root) {
  8827. type = namespace + type;
  8828. if (( true) && !store._mutations[type]) {
  8829. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  8830. return
  8831. }
  8832. }
  8833. store.commit(type, payload, options);
  8834. }
  8835. };
  8836. // getters and state object must be gotten lazily
  8837. // because they will be changed by vm update
  8838. Object.defineProperties(local, {
  8839. getters: {
  8840. get: noNamespace
  8841. ? function () { return store.getters; }
  8842. : function () { return makeLocalGetters(store, namespace); }
  8843. },
  8844. state: {
  8845. get: function () { return getNestedState(store.state, path); }
  8846. }
  8847. });
  8848. return local
  8849. }
  8850. function makeLocalGetters (store, namespace) {
  8851. if (!store._makeLocalGettersCache[namespace]) {
  8852. var gettersProxy = {};
  8853. var splitPos = namespace.length;
  8854. Object.keys(store.getters).forEach(function (type) {
  8855. // skip if the target getter is not match this namespace
  8856. if (type.slice(0, splitPos) !== namespace) { return }
  8857. // extract local getter type
  8858. var localType = type.slice(splitPos);
  8859. // Add a port to the getters proxy.
  8860. // Define as getter property because
  8861. // we do not want to evaluate the getters in this time.
  8862. Object.defineProperty(gettersProxy, localType, {
  8863. get: function () { return store.getters[type]; },
  8864. enumerable: true
  8865. });
  8866. });
  8867. store._makeLocalGettersCache[namespace] = gettersProxy;
  8868. }
  8869. return store._makeLocalGettersCache[namespace]
  8870. }
  8871. function registerMutation (store, type, handler, local) {
  8872. var entry = store._mutations[type] || (store._mutations[type] = []);
  8873. entry.push(function wrappedMutationHandler (payload) {
  8874. handler.call(store, local.state, payload);
  8875. });
  8876. }
  8877. function registerAction (store, type, handler, local) {
  8878. var entry = store._actions[type] || (store._actions[type] = []);
  8879. entry.push(function wrappedActionHandler (payload) {
  8880. var res = handler.call(store, {
  8881. dispatch: local.dispatch,
  8882. commit: local.commit,
  8883. getters: local.getters,
  8884. state: local.state,
  8885. rootGetters: store.getters,
  8886. rootState: store.state
  8887. }, payload);
  8888. if (!isPromise(res)) {
  8889. res = Promise.resolve(res);
  8890. }
  8891. if (store._devtoolHook) {
  8892. return res.catch(function (err) {
  8893. store._devtoolHook.emit('vuex:error', err);
  8894. throw err
  8895. })
  8896. } else {
  8897. return res
  8898. }
  8899. });
  8900. }
  8901. function registerGetter (store, type, rawGetter, local) {
  8902. if (store._wrappedGetters[type]) {
  8903. if ((true)) {
  8904. console.error(("[vuex] duplicate getter key: " + type));
  8905. }
  8906. return
  8907. }
  8908. store._wrappedGetters[type] = function wrappedGetter (store) {
  8909. return rawGetter(
  8910. local.state, // local state
  8911. local.getters, // local getters
  8912. store.state, // root state
  8913. store.getters // root getters
  8914. )
  8915. };
  8916. }
  8917. function enableStrictMode (store) {
  8918. store._vm.$watch(function () { return this._data.$$state }, function () {
  8919. if ((true)) {
  8920. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  8921. }
  8922. }, { deep: true, sync: true });
  8923. }
  8924. function getNestedState (state, path) {
  8925. return path.reduce(function (state, key) { return state[key]; }, state)
  8926. }
  8927. function unifyObjectStyle (type, payload, options) {
  8928. if (isObject(type) && type.type) {
  8929. options = payload;
  8930. payload = type;
  8931. type = type.type;
  8932. }
  8933. if ((true)) {
  8934. assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
  8935. }
  8936. return { type: type, payload: payload, options: options }
  8937. }
  8938. function install (_Vue) {
  8939. if (Vue && _Vue === Vue) {
  8940. if ((true)) {
  8941. console.error(
  8942. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  8943. );
  8944. }
  8945. return
  8946. }
  8947. Vue = _Vue;
  8948. applyMixin(Vue);
  8949. }
  8950. /**
  8951. * Reduce the code which written in Vue.js for getting the state.
  8952. * @param {String} [namespace] - Module's namespace
  8953. * @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.
  8954. * @param {Object}
  8955. */
  8956. var mapState = normalizeNamespace(function (namespace, states) {
  8957. var res = {};
  8958. if (( true) && !isValidMap(states)) {
  8959. console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');
  8960. }
  8961. normalizeMap(states).forEach(function (ref) {
  8962. var key = ref.key;
  8963. var val = ref.val;
  8964. res[key] = function mappedState () {
  8965. var state = this.$store.state;
  8966. var getters = this.$store.getters;
  8967. if (namespace) {
  8968. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  8969. if (!module) {
  8970. return
  8971. }
  8972. state = module.context.state;
  8973. getters = module.context.getters;
  8974. }
  8975. return typeof val === 'function'
  8976. ? val.call(this, state, getters)
  8977. : state[val]
  8978. };
  8979. // mark vuex getter for devtools
  8980. res[key].vuex = true;
  8981. });
  8982. return res
  8983. });
  8984. /**
  8985. * Reduce the code which written in Vue.js for committing the mutation
  8986. * @param {String} [namespace] - Module's namespace
  8987. * @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.
  8988. * @return {Object}
  8989. */
  8990. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  8991. var res = {};
  8992. if (( true) && !isValidMap(mutations)) {
  8993. console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
  8994. }
  8995. normalizeMap(mutations).forEach(function (ref) {
  8996. var key = ref.key;
  8997. var val = ref.val;
  8998. res[key] = function mappedMutation () {
  8999. var args = [], len = arguments.length;
  9000. while ( len-- ) args[ len ] = arguments[ len ];
  9001. // Get the commit method from store
  9002. var commit = this.$store.commit;
  9003. if (namespace) {
  9004. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  9005. if (!module) {
  9006. return
  9007. }
  9008. commit = module.context.commit;
  9009. }
  9010. return typeof val === 'function'
  9011. ? val.apply(this, [commit].concat(args))
  9012. : commit.apply(this.$store, [val].concat(args))
  9013. };
  9014. });
  9015. return res
  9016. });
  9017. /**
  9018. * Reduce the code which written in Vue.js for getting the getters
  9019. * @param {String} [namespace] - Module's namespace
  9020. * @param {Object|Array} getters
  9021. * @return {Object}
  9022. */
  9023. var mapGetters = normalizeNamespace(function (namespace, getters) {
  9024. var res = {};
  9025. if (( true) && !isValidMap(getters)) {
  9026. console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');
  9027. }
  9028. normalizeMap(getters).forEach(function (ref) {
  9029. var key = ref.key;
  9030. var val = ref.val;
  9031. // The namespace has been mutated by normalizeNamespace
  9032. val = namespace + val;
  9033. res[key] = function mappedGetter () {
  9034. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  9035. return
  9036. }
  9037. if (( true) && !(val in this.$store.getters)) {
  9038. console.error(("[vuex] unknown getter: " + val));
  9039. return
  9040. }
  9041. return this.$store.getters[val]
  9042. };
  9043. // mark vuex getter for devtools
  9044. res[key].vuex = true;
  9045. });
  9046. return res
  9047. });
  9048. /**
  9049. * Reduce the code which written in Vue.js for dispatch the action
  9050. * @param {String} [namespace] - Module's namespace
  9051. * @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.
  9052. * @return {Object}
  9053. */
  9054. var mapActions = normalizeNamespace(function (namespace, actions) {
  9055. var res = {};
  9056. if (( true) && !isValidMap(actions)) {
  9057. console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
  9058. }
  9059. normalizeMap(actions).forEach(function (ref) {
  9060. var key = ref.key;
  9061. var val = ref.val;
  9062. res[key] = function mappedAction () {
  9063. var args = [], len = arguments.length;
  9064. while ( len-- ) args[ len ] = arguments[ len ];
  9065. // get dispatch function from store
  9066. var dispatch = this.$store.dispatch;
  9067. if (namespace) {
  9068. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  9069. if (!module) {
  9070. return
  9071. }
  9072. dispatch = module.context.dispatch;
  9073. }
  9074. return typeof val === 'function'
  9075. ? val.apply(this, [dispatch].concat(args))
  9076. : dispatch.apply(this.$store, [val].concat(args))
  9077. };
  9078. });
  9079. return res
  9080. });
  9081. /**
  9082. * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
  9083. * @param {String} namespace
  9084. * @return {Object}
  9085. */
  9086. var createNamespacedHelpers = function (namespace) { return ({
  9087. mapState: mapState.bind(null, namespace),
  9088. mapGetters: mapGetters.bind(null, namespace),
  9089. mapMutations: mapMutations.bind(null, namespace),
  9090. mapActions: mapActions.bind(null, namespace)
  9091. }); };
  9092. /**
  9093. * Normalize the map
  9094. * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
  9095. * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
  9096. * @param {Array|Object} map
  9097. * @return {Object}
  9098. */
  9099. function normalizeMap (map) {
  9100. if (!isValidMap(map)) {
  9101. return []
  9102. }
  9103. return Array.isArray(map)
  9104. ? map.map(function (key) { return ({ key: key, val: key }); })
  9105. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  9106. }
  9107. /**
  9108. * Validate whether given map is valid or not
  9109. * @param {*} map
  9110. * @return {Boolean}
  9111. */
  9112. function isValidMap (map) {
  9113. return Array.isArray(map) || isObject(map)
  9114. }
  9115. /**
  9116. * 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.
  9117. * @param {Function} fn
  9118. * @return {Function}
  9119. */
  9120. function normalizeNamespace (fn) {
  9121. return function (namespace, map) {
  9122. if (typeof namespace !== 'string') {
  9123. map = namespace;
  9124. namespace = '';
  9125. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  9126. namespace += '/';
  9127. }
  9128. return fn(namespace, map)
  9129. }
  9130. }
  9131. /**
  9132. * Search a special module from store by namespace. if module not exist, print error message.
  9133. * @param {Object} store
  9134. * @param {String} helper
  9135. * @param {String} namespace
  9136. * @return {Object}
  9137. */
  9138. function getModuleByNamespace (store, helper, namespace) {
  9139. var module = store._modulesNamespaceMap[namespace];
  9140. if (( true) && !module) {
  9141. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  9142. }
  9143. return module
  9144. }
  9145. // Credits: borrowed code from fcomb/redux-logger
  9146. function createLogger (ref) {
  9147. if ( ref === void 0 ) ref = {};
  9148. var collapsed = ref.collapsed; if ( collapsed === void 0 ) collapsed = true;
  9149. var filter = ref.filter; if ( filter === void 0 ) filter = function (mutation, stateBefore, stateAfter) { return true; };
  9150. var transformer = ref.transformer; if ( transformer === void 0 ) transformer = function (state) { return state; };
  9151. var mutationTransformer = ref.mutationTransformer; if ( mutationTransformer === void 0 ) mutationTransformer = function (mut) { return mut; };
  9152. var actionFilter = ref.actionFilter; if ( actionFilter === void 0 ) actionFilter = function (action, state) { return true; };
  9153. var actionTransformer = ref.actionTransformer; if ( actionTransformer === void 0 ) actionTransformer = function (act) { return act; };
  9154. var logMutations = ref.logMutations; if ( logMutations === void 0 ) logMutations = true;
  9155. var logActions = ref.logActions; if ( logActions === void 0 ) logActions = true;
  9156. var logger = ref.logger; if ( logger === void 0 ) logger = console;
  9157. return function (store) {
  9158. var prevState = deepCopy(store.state);
  9159. if (typeof logger === 'undefined') {
  9160. return
  9161. }
  9162. if (logMutations) {
  9163. store.subscribe(function (mutation, state) {
  9164. var nextState = deepCopy(state);
  9165. if (filter(mutation, prevState, nextState)) {
  9166. var formattedTime = getFormattedTime();
  9167. var formattedMutation = mutationTransformer(mutation);
  9168. var message = "mutation " + (mutation.type) + formattedTime;
  9169. startMessage(logger, message, collapsed);
  9170. logger.log('%c prev state', 'color: #9E9E9E; font-weight: bold', transformer(prevState));
  9171. logger.log('%c mutation', 'color: #03A9F4; font-weight: bold', formattedMutation);
  9172. logger.log('%c next state', 'color: #4CAF50; font-weight: bold', transformer(nextState));
  9173. endMessage(logger);
  9174. }
  9175. prevState = nextState;
  9176. });
  9177. }
  9178. if (logActions) {
  9179. store.subscribeAction(function (action, state) {
  9180. if (actionFilter(action, state)) {
  9181. var formattedTime = getFormattedTime();
  9182. var formattedAction = actionTransformer(action);
  9183. var message = "action " + (action.type) + formattedTime;
  9184. startMessage(logger, message, collapsed);
  9185. logger.log('%c action', 'color: #03A9F4; font-weight: bold', formattedAction);
  9186. endMessage(logger);
  9187. }
  9188. });
  9189. }
  9190. }
  9191. }
  9192. function startMessage (logger, message, collapsed) {
  9193. var startMessage = collapsed
  9194. ? logger.groupCollapsed
  9195. : logger.group;
  9196. // render
  9197. try {
  9198. startMessage.call(logger, message);
  9199. } catch (e) {
  9200. logger.log(message);
  9201. }
  9202. }
  9203. function endMessage (logger) {
  9204. try {
  9205. logger.groupEnd();
  9206. } catch (e) {
  9207. logger.log('—— log end ——');
  9208. }
  9209. }
  9210. function getFormattedTime () {
  9211. var time = new Date();
  9212. return (" @ " + (pad(time.getHours(), 2)) + ":" + (pad(time.getMinutes(), 2)) + ":" + (pad(time.getSeconds(), 2)) + "." + (pad(time.getMilliseconds(), 3)))
  9213. }
  9214. function repeat (str, times) {
  9215. return (new Array(times + 1)).join(str)
  9216. }
  9217. function pad (num, maxLength) {
  9218. return repeat('0', maxLength - num.toString().length) + num
  9219. }
  9220. var index_cjs = {
  9221. Store: Store,
  9222. install: install,
  9223. version: '3.6.2',
  9224. mapState: mapState,
  9225. mapMutations: mapMutations,
  9226. mapGetters: mapGetters,
  9227. mapActions: mapActions,
  9228. createNamespacedHelpers: createNamespacedHelpers,
  9229. createLogger: createLogger
  9230. };
  9231. module.exports = index_cjs;
  9232. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2)))
  9233. /***/ }),
  9234. /* 14 */
  9235. /*!************************************************************************!*\
  9236. !*** D:/code/work/broke_news_wx/store/modules sync nonrecursive \.js$ ***!
  9237. \************************************************************************/
  9238. /*! no static exports found */
  9239. /***/ (function(module, exports, __webpack_require__) {
  9240. var map = {
  9241. "./user.js": 15
  9242. };
  9243. function webpackContext(req) {
  9244. var id = webpackContextResolve(req);
  9245. return __webpack_require__(id);
  9246. }
  9247. function webpackContextResolve(req) {
  9248. if(!__webpack_require__.o(map, req)) {
  9249. var e = new Error("Cannot find module '" + req + "'");
  9250. e.code = 'MODULE_NOT_FOUND';
  9251. throw e;
  9252. }
  9253. return map[req];
  9254. }
  9255. webpackContext.keys = function webpackContextKeys() {
  9256. return Object.keys(map);
  9257. };
  9258. webpackContext.resolve = webpackContextResolve;
  9259. module.exports = webpackContext;
  9260. webpackContext.id = 14;
  9261. /***/ }),
  9262. /* 15 */
  9263. /*!********************************************************!*\
  9264. !*** D:/code/work/broke_news_wx/store/modules/user.js ***!
  9265. \********************************************************/
  9266. /*! no static exports found */
  9267. /***/ (function(module, exports, __webpack_require__) {
  9268. "use strict";
  9269. Object.defineProperty(exports, "__esModule", { value: true });exports.actions = exports.mutations = exports.state = void 0;var state = {
  9270. //用户数据
  9271. userInfo: {
  9272. phone: '',
  9273. name: '' } };exports.state = state;
  9274. var mutations = {
  9275. //储存用户信息
  9276. setUserInfo: function setUserInfo(state, data) {
  9277. if (data) {
  9278. state.userInfo = Object.assign({}, state.userInfo, data);
  9279. }
  9280. },
  9281. emptyUserInfo: function emptyUserInfo(state) {
  9282. state.userInfo = {};
  9283. }
  9284. // 退出A
  9285. };exports.mutations = mutations;
  9286. var actions = {};exports.actions = actions;
  9287. /***/ }),
  9288. /* 16 */,
  9289. /* 17 */,
  9290. /* 18 */,
  9291. /* 19 */,
  9292. /* 20 */,
  9293. /* 21 */,
  9294. /* 22 */
  9295. /*!**********************************************************!*\
  9296. !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
  9297. \**********************************************************/
  9298. /*! no static exports found */
  9299. /***/ (function(module, exports, __webpack_require__) {
  9300. module.exports = __webpack_require__(/*! regenerator-runtime */ 23);
  9301. /***/ }),
  9302. /* 23 */
  9303. /*!************************************************************!*\
  9304. !*** ./node_modules/regenerator-runtime/runtime-module.js ***!
  9305. \************************************************************/
  9306. /*! no static exports found */
  9307. /***/ (function(module, exports, __webpack_require__) {
  9308. /**
  9309. * Copyright (c) 2014-present, Facebook, Inc.
  9310. *
  9311. * This source code is licensed under the MIT license found in the
  9312. * LICENSE file in the root directory of this source tree.
  9313. */
  9314. // This method of obtaining a reference to the global object needs to be
  9315. // kept identical to the way it is obtained in runtime.js
  9316. var g = (function() {
  9317. return this || (typeof self === "object" && self);
  9318. })() || Function("return this")();
  9319. // Use `getOwnPropertyNames` because not all browsers support calling
  9320. // `hasOwnProperty` on the global `self` object in a worker. See #183.
  9321. var hadRuntime = g.regeneratorRuntime &&
  9322. Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
  9323. // Save the old regeneratorRuntime in case it needs to be restored later.
  9324. var oldRuntime = hadRuntime && g.regeneratorRuntime;
  9325. // Force reevalutation of runtime.js.
  9326. g.regeneratorRuntime = undefined;
  9327. module.exports = __webpack_require__(/*! ./runtime */ 24);
  9328. if (hadRuntime) {
  9329. // Restore the original runtime.
  9330. g.regeneratorRuntime = oldRuntime;
  9331. } else {
  9332. // Remove the global property added by runtime.js.
  9333. try {
  9334. delete g.regeneratorRuntime;
  9335. } catch(e) {
  9336. g.regeneratorRuntime = undefined;
  9337. }
  9338. }
  9339. /***/ }),
  9340. /* 24 */
  9341. /*!*****************************************************!*\
  9342. !*** ./node_modules/regenerator-runtime/runtime.js ***!
  9343. \*****************************************************/
  9344. /*! no static exports found */
  9345. /***/ (function(module, exports) {
  9346. /**
  9347. * Copyright (c) 2014-present, Facebook, Inc.
  9348. *
  9349. * This source code is licensed under the MIT license found in the
  9350. * LICENSE file in the root directory of this source tree.
  9351. */
  9352. !(function(global) {
  9353. "use strict";
  9354. var Op = Object.prototype;
  9355. var hasOwn = Op.hasOwnProperty;
  9356. var undefined; // More compressible than void 0.
  9357. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  9358. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  9359. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  9360. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  9361. var inModule = typeof module === "object";
  9362. var runtime = global.regeneratorRuntime;
  9363. if (runtime) {
  9364. if (inModule) {
  9365. // If regeneratorRuntime is defined globally and we're in a module,
  9366. // make the exports object identical to regeneratorRuntime.
  9367. module.exports = runtime;
  9368. }
  9369. // Don't bother evaluating the rest of this file if the runtime was
  9370. // already defined globally.
  9371. return;
  9372. }
  9373. // Define the runtime globally (as expected by generated code) as either
  9374. // module.exports (if we're in a module) or a new, empty object.
  9375. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  9376. function wrap(innerFn, outerFn, self, tryLocsList) {
  9377. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  9378. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  9379. var generator = Object.create(protoGenerator.prototype);
  9380. var context = new Context(tryLocsList || []);
  9381. // The ._invoke method unifies the implementations of the .next,
  9382. // .throw, and .return methods.
  9383. generator._invoke = makeInvokeMethod(innerFn, self, context);
  9384. return generator;
  9385. }
  9386. runtime.wrap = wrap;
  9387. // Try/catch helper to minimize deoptimizations. Returns a completion
  9388. // record like context.tryEntries[i].completion. This interface could
  9389. // have been (and was previously) designed to take a closure to be
  9390. // invoked without arguments, but in all the cases we care about we
  9391. // already have an existing method we want to call, so there's no need
  9392. // to create a new function object. We can even get away with assuming
  9393. // the method takes exactly one argument, since that happens to be true
  9394. // in every case, so we don't have to touch the arguments object. The
  9395. // only additional allocation required is the completion record, which
  9396. // has a stable shape and so hopefully should be cheap to allocate.
  9397. function tryCatch(fn, obj, arg) {
  9398. try {
  9399. return { type: "normal", arg: fn.call(obj, arg) };
  9400. } catch (err) {
  9401. return { type: "throw", arg: err };
  9402. }
  9403. }
  9404. var GenStateSuspendedStart = "suspendedStart";
  9405. var GenStateSuspendedYield = "suspendedYield";
  9406. var GenStateExecuting = "executing";
  9407. var GenStateCompleted = "completed";
  9408. // Returning this object from the innerFn has the same effect as
  9409. // breaking out of the dispatch switch statement.
  9410. var ContinueSentinel = {};
  9411. // Dummy constructor functions that we use as the .constructor and
  9412. // .constructor.prototype properties for functions that return Generator
  9413. // objects. For full spec compliance, you may wish to configure your
  9414. // minifier not to mangle the names of these two functions.
  9415. function Generator() {}
  9416. function GeneratorFunction() {}
  9417. function GeneratorFunctionPrototype() {}
  9418. // This is a polyfill for %IteratorPrototype% for environments that
  9419. // don't natively support it.
  9420. var IteratorPrototype = {};
  9421. IteratorPrototype[iteratorSymbol] = function () {
  9422. return this;
  9423. };
  9424. var getProto = Object.getPrototypeOf;
  9425. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  9426. if (NativeIteratorPrototype &&
  9427. NativeIteratorPrototype !== Op &&
  9428. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  9429. // This environment has a native %IteratorPrototype%; use it instead
  9430. // of the polyfill.
  9431. IteratorPrototype = NativeIteratorPrototype;
  9432. }
  9433. var Gp = GeneratorFunctionPrototype.prototype =
  9434. Generator.prototype = Object.create(IteratorPrototype);
  9435. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  9436. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  9437. GeneratorFunctionPrototype[toStringTagSymbol] =
  9438. GeneratorFunction.displayName = "GeneratorFunction";
  9439. // Helper for defining the .next, .throw, and .return methods of the
  9440. // Iterator interface in terms of a single ._invoke method.
  9441. function defineIteratorMethods(prototype) {
  9442. ["next", "throw", "return"].forEach(function(method) {
  9443. prototype[method] = function(arg) {
  9444. return this._invoke(method, arg);
  9445. };
  9446. });
  9447. }
  9448. runtime.isGeneratorFunction = function(genFun) {
  9449. var ctor = typeof genFun === "function" && genFun.constructor;
  9450. return ctor
  9451. ? ctor === GeneratorFunction ||
  9452. // For the native GeneratorFunction constructor, the best we can
  9453. // do is to check its .name property.
  9454. (ctor.displayName || ctor.name) === "GeneratorFunction"
  9455. : false;
  9456. };
  9457. runtime.mark = function(genFun) {
  9458. if (Object.setPrototypeOf) {
  9459. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  9460. } else {
  9461. genFun.__proto__ = GeneratorFunctionPrototype;
  9462. if (!(toStringTagSymbol in genFun)) {
  9463. genFun[toStringTagSymbol] = "GeneratorFunction";
  9464. }
  9465. }
  9466. genFun.prototype = Object.create(Gp);
  9467. return genFun;
  9468. };
  9469. // Within the body of any async function, `await x` is transformed to
  9470. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  9471. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  9472. // meant to be awaited.
  9473. runtime.awrap = function(arg) {
  9474. return { __await: arg };
  9475. };
  9476. function AsyncIterator(generator) {
  9477. function invoke(method, arg, resolve, reject) {
  9478. var record = tryCatch(generator[method], generator, arg);
  9479. if (record.type === "throw") {
  9480. reject(record.arg);
  9481. } else {
  9482. var result = record.arg;
  9483. var value = result.value;
  9484. if (value &&
  9485. typeof value === "object" &&
  9486. hasOwn.call(value, "__await")) {
  9487. return Promise.resolve(value.__await).then(function(value) {
  9488. invoke("next", value, resolve, reject);
  9489. }, function(err) {
  9490. invoke("throw", err, resolve, reject);
  9491. });
  9492. }
  9493. return Promise.resolve(value).then(function(unwrapped) {
  9494. // When a yielded Promise is resolved, its final value becomes
  9495. // the .value of the Promise<{value,done}> result for the
  9496. // current iteration.
  9497. result.value = unwrapped;
  9498. resolve(result);
  9499. }, function(error) {
  9500. // If a rejected Promise was yielded, throw the rejection back
  9501. // into the async generator function so it can be handled there.
  9502. return invoke("throw", error, resolve, reject);
  9503. });
  9504. }
  9505. }
  9506. var previousPromise;
  9507. function enqueue(method, arg) {
  9508. function callInvokeWithMethodAndArg() {
  9509. return new Promise(function(resolve, reject) {
  9510. invoke(method, arg, resolve, reject);
  9511. });
  9512. }
  9513. return previousPromise =
  9514. // If enqueue has been called before, then we want to wait until
  9515. // all previous Promises have been resolved before calling invoke,
  9516. // so that results are always delivered in the correct order. If
  9517. // enqueue has not been called before, then it is important to
  9518. // call invoke immediately, without waiting on a callback to fire,
  9519. // so that the async generator function has the opportunity to do
  9520. // any necessary setup in a predictable way. This predictability
  9521. // is why the Promise constructor synchronously invokes its
  9522. // executor callback, and why async functions synchronously
  9523. // execute code before the first await. Since we implement simple
  9524. // async functions in terms of async generators, it is especially
  9525. // important to get this right, even though it requires care.
  9526. previousPromise ? previousPromise.then(
  9527. callInvokeWithMethodAndArg,
  9528. // Avoid propagating failures to Promises returned by later
  9529. // invocations of the iterator.
  9530. callInvokeWithMethodAndArg
  9531. ) : callInvokeWithMethodAndArg();
  9532. }
  9533. // Define the unified helper method that is used to implement .next,
  9534. // .throw, and .return (see defineIteratorMethods).
  9535. this._invoke = enqueue;
  9536. }
  9537. defineIteratorMethods(AsyncIterator.prototype);
  9538. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  9539. return this;
  9540. };
  9541. runtime.AsyncIterator = AsyncIterator;
  9542. // Note that simple async functions are implemented on top of
  9543. // AsyncIterator objects; they just return a Promise for the value of
  9544. // the final result produced by the iterator.
  9545. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  9546. var iter = new AsyncIterator(
  9547. wrap(innerFn, outerFn, self, tryLocsList)
  9548. );
  9549. return runtime.isGeneratorFunction(outerFn)
  9550. ? iter // If outerFn is a generator, return the full iterator.
  9551. : iter.next().then(function(result) {
  9552. return result.done ? result.value : iter.next();
  9553. });
  9554. };
  9555. function makeInvokeMethod(innerFn, self, context) {
  9556. var state = GenStateSuspendedStart;
  9557. return function invoke(method, arg) {
  9558. if (state === GenStateExecuting) {
  9559. throw new Error("Generator is already running");
  9560. }
  9561. if (state === GenStateCompleted) {
  9562. if (method === "throw") {
  9563. throw arg;
  9564. }
  9565. // Be forgiving, per 25.3.3.3.3 of the spec:
  9566. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  9567. return doneResult();
  9568. }
  9569. context.method = method;
  9570. context.arg = arg;
  9571. while (true) {
  9572. var delegate = context.delegate;
  9573. if (delegate) {
  9574. var delegateResult = maybeInvokeDelegate(delegate, context);
  9575. if (delegateResult) {
  9576. if (delegateResult === ContinueSentinel) continue;
  9577. return delegateResult;
  9578. }
  9579. }
  9580. if (context.method === "next") {
  9581. // Setting context._sent for legacy support of Babel's
  9582. // function.sent implementation.
  9583. context.sent = context._sent = context.arg;
  9584. } else if (context.method === "throw") {
  9585. if (state === GenStateSuspendedStart) {
  9586. state = GenStateCompleted;
  9587. throw context.arg;
  9588. }
  9589. context.dispatchException(context.arg);
  9590. } else if (context.method === "return") {
  9591. context.abrupt("return", context.arg);
  9592. }
  9593. state = GenStateExecuting;
  9594. var record = tryCatch(innerFn, self, context);
  9595. if (record.type === "normal") {
  9596. // If an exception is thrown from innerFn, we leave state ===
  9597. // GenStateExecuting and loop back for another invocation.
  9598. state = context.done
  9599. ? GenStateCompleted
  9600. : GenStateSuspendedYield;
  9601. if (record.arg === ContinueSentinel) {
  9602. continue;
  9603. }
  9604. return {
  9605. value: record.arg,
  9606. done: context.done
  9607. };
  9608. } else if (record.type === "throw") {
  9609. state = GenStateCompleted;
  9610. // Dispatch the exception by looping back around to the
  9611. // context.dispatchException(context.arg) call above.
  9612. context.method = "throw";
  9613. context.arg = record.arg;
  9614. }
  9615. }
  9616. };
  9617. }
  9618. // Call delegate.iterator[context.method](context.arg) and handle the
  9619. // result, either by returning a { value, done } result from the
  9620. // delegate iterator, or by modifying context.method and context.arg,
  9621. // setting context.delegate to null, and returning the ContinueSentinel.
  9622. function maybeInvokeDelegate(delegate, context) {
  9623. var method = delegate.iterator[context.method];
  9624. if (method === undefined) {
  9625. // A .throw or .return when the delegate iterator has no .throw
  9626. // method always terminates the yield* loop.
  9627. context.delegate = null;
  9628. if (context.method === "throw") {
  9629. if (delegate.iterator.return) {
  9630. // If the delegate iterator has a return method, give it a
  9631. // chance to clean up.
  9632. context.method = "return";
  9633. context.arg = undefined;
  9634. maybeInvokeDelegate(delegate, context);
  9635. if (context.method === "throw") {
  9636. // If maybeInvokeDelegate(context) changed context.method from
  9637. // "return" to "throw", let that override the TypeError below.
  9638. return ContinueSentinel;
  9639. }
  9640. }
  9641. context.method = "throw";
  9642. context.arg = new TypeError(
  9643. "The iterator does not provide a 'throw' method");
  9644. }
  9645. return ContinueSentinel;
  9646. }
  9647. var record = tryCatch(method, delegate.iterator, context.arg);
  9648. if (record.type === "throw") {
  9649. context.method = "throw";
  9650. context.arg = record.arg;
  9651. context.delegate = null;
  9652. return ContinueSentinel;
  9653. }
  9654. var info = record.arg;
  9655. if (! info) {
  9656. context.method = "throw";
  9657. context.arg = new TypeError("iterator result is not an object");
  9658. context.delegate = null;
  9659. return ContinueSentinel;
  9660. }
  9661. if (info.done) {
  9662. // Assign the result of the finished delegate to the temporary
  9663. // variable specified by delegate.resultName (see delegateYield).
  9664. context[delegate.resultName] = info.value;
  9665. // Resume execution at the desired location (see delegateYield).
  9666. context.next = delegate.nextLoc;
  9667. // If context.method was "throw" but the delegate handled the
  9668. // exception, let the outer generator proceed normally. If
  9669. // context.method was "next", forget context.arg since it has been
  9670. // "consumed" by the delegate iterator. If context.method was
  9671. // "return", allow the original .return call to continue in the
  9672. // outer generator.
  9673. if (context.method !== "return") {
  9674. context.method = "next";
  9675. context.arg = undefined;
  9676. }
  9677. } else {
  9678. // Re-yield the result returned by the delegate method.
  9679. return info;
  9680. }
  9681. // The delegate iterator is finished, so forget it and continue with
  9682. // the outer generator.
  9683. context.delegate = null;
  9684. return ContinueSentinel;
  9685. }
  9686. // Define Generator.prototype.{next,throw,return} in terms of the
  9687. // unified ._invoke helper method.
  9688. defineIteratorMethods(Gp);
  9689. Gp[toStringTagSymbol] = "Generator";
  9690. // A Generator should always return itself as the iterator object when the
  9691. // @@iterator function is called on it. Some browsers' implementations of the
  9692. // iterator prototype chain incorrectly implement this, causing the Generator
  9693. // object to not be returned from this call. This ensures that doesn't happen.
  9694. // See https://github.com/facebook/regenerator/issues/274 for more details.
  9695. Gp[iteratorSymbol] = function() {
  9696. return this;
  9697. };
  9698. Gp.toString = function() {
  9699. return "[object Generator]";
  9700. };
  9701. function pushTryEntry(locs) {
  9702. var entry = { tryLoc: locs[0] };
  9703. if (1 in locs) {
  9704. entry.catchLoc = locs[1];
  9705. }
  9706. if (2 in locs) {
  9707. entry.finallyLoc = locs[2];
  9708. entry.afterLoc = locs[3];
  9709. }
  9710. this.tryEntries.push(entry);
  9711. }
  9712. function resetTryEntry(entry) {
  9713. var record = entry.completion || {};
  9714. record.type = "normal";
  9715. delete record.arg;
  9716. entry.completion = record;
  9717. }
  9718. function Context(tryLocsList) {
  9719. // The root entry object (effectively a try statement without a catch
  9720. // or a finally block) gives us a place to store values thrown from
  9721. // locations where there is no enclosing try statement.
  9722. this.tryEntries = [{ tryLoc: "root" }];
  9723. tryLocsList.forEach(pushTryEntry, this);
  9724. this.reset(true);
  9725. }
  9726. runtime.keys = function(object) {
  9727. var keys = [];
  9728. for (var key in object) {
  9729. keys.push(key);
  9730. }
  9731. keys.reverse();
  9732. // Rather than returning an object with a next method, we keep
  9733. // things simple and return the next function itself.
  9734. return function next() {
  9735. while (keys.length) {
  9736. var key = keys.pop();
  9737. if (key in object) {
  9738. next.value = key;
  9739. next.done = false;
  9740. return next;
  9741. }
  9742. }
  9743. // To avoid creating an additional object, we just hang the .value
  9744. // and .done properties off the next function object itself. This
  9745. // also ensures that the minifier will not anonymize the function.
  9746. next.done = true;
  9747. return next;
  9748. };
  9749. };
  9750. function values(iterable) {
  9751. if (iterable) {
  9752. var iteratorMethod = iterable[iteratorSymbol];
  9753. if (iteratorMethod) {
  9754. return iteratorMethod.call(iterable);
  9755. }
  9756. if (typeof iterable.next === "function") {
  9757. return iterable;
  9758. }
  9759. if (!isNaN(iterable.length)) {
  9760. var i = -1, next = function next() {
  9761. while (++i < iterable.length) {
  9762. if (hasOwn.call(iterable, i)) {
  9763. next.value = iterable[i];
  9764. next.done = false;
  9765. return next;
  9766. }
  9767. }
  9768. next.value = undefined;
  9769. next.done = true;
  9770. return next;
  9771. };
  9772. return next.next = next;
  9773. }
  9774. }
  9775. // Return an iterator with no values.
  9776. return { next: doneResult };
  9777. }
  9778. runtime.values = values;
  9779. function doneResult() {
  9780. return { value: undefined, done: true };
  9781. }
  9782. Context.prototype = {
  9783. constructor: Context,
  9784. reset: function(skipTempReset) {
  9785. this.prev = 0;
  9786. this.next = 0;
  9787. // Resetting context._sent for legacy support of Babel's
  9788. // function.sent implementation.
  9789. this.sent = this._sent = undefined;
  9790. this.done = false;
  9791. this.delegate = null;
  9792. this.method = "next";
  9793. this.arg = undefined;
  9794. this.tryEntries.forEach(resetTryEntry);
  9795. if (!skipTempReset) {
  9796. for (var name in this) {
  9797. // Not sure about the optimal order of these conditions:
  9798. if (name.charAt(0) === "t" &&
  9799. hasOwn.call(this, name) &&
  9800. !isNaN(+name.slice(1))) {
  9801. this[name] = undefined;
  9802. }
  9803. }
  9804. }
  9805. },
  9806. stop: function() {
  9807. this.done = true;
  9808. var rootEntry = this.tryEntries[0];
  9809. var rootRecord = rootEntry.completion;
  9810. if (rootRecord.type === "throw") {
  9811. throw rootRecord.arg;
  9812. }
  9813. return this.rval;
  9814. },
  9815. dispatchException: function(exception) {
  9816. if (this.done) {
  9817. throw exception;
  9818. }
  9819. var context = this;
  9820. function handle(loc, caught) {
  9821. record.type = "throw";
  9822. record.arg = exception;
  9823. context.next = loc;
  9824. if (caught) {
  9825. // If the dispatched exception was caught by a catch block,
  9826. // then let that catch block handle the exception normally.
  9827. context.method = "next";
  9828. context.arg = undefined;
  9829. }
  9830. return !! caught;
  9831. }
  9832. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9833. var entry = this.tryEntries[i];
  9834. var record = entry.completion;
  9835. if (entry.tryLoc === "root") {
  9836. // Exception thrown outside of any try block that could handle
  9837. // it, so set the completion value of the entire function to
  9838. // throw the exception.
  9839. return handle("end");
  9840. }
  9841. if (entry.tryLoc <= this.prev) {
  9842. var hasCatch = hasOwn.call(entry, "catchLoc");
  9843. var hasFinally = hasOwn.call(entry, "finallyLoc");
  9844. if (hasCatch && hasFinally) {
  9845. if (this.prev < entry.catchLoc) {
  9846. return handle(entry.catchLoc, true);
  9847. } else if (this.prev < entry.finallyLoc) {
  9848. return handle(entry.finallyLoc);
  9849. }
  9850. } else if (hasCatch) {
  9851. if (this.prev < entry.catchLoc) {
  9852. return handle(entry.catchLoc, true);
  9853. }
  9854. } else if (hasFinally) {
  9855. if (this.prev < entry.finallyLoc) {
  9856. return handle(entry.finallyLoc);
  9857. }
  9858. } else {
  9859. throw new Error("try statement without catch or finally");
  9860. }
  9861. }
  9862. }
  9863. },
  9864. abrupt: function(type, arg) {
  9865. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9866. var entry = this.tryEntries[i];
  9867. if (entry.tryLoc <= this.prev &&
  9868. hasOwn.call(entry, "finallyLoc") &&
  9869. this.prev < entry.finallyLoc) {
  9870. var finallyEntry = entry;
  9871. break;
  9872. }
  9873. }
  9874. if (finallyEntry &&
  9875. (type === "break" ||
  9876. type === "continue") &&
  9877. finallyEntry.tryLoc <= arg &&
  9878. arg <= finallyEntry.finallyLoc) {
  9879. // Ignore the finally entry if control is not jumping to a
  9880. // location outside the try/catch block.
  9881. finallyEntry = null;
  9882. }
  9883. var record = finallyEntry ? finallyEntry.completion : {};
  9884. record.type = type;
  9885. record.arg = arg;
  9886. if (finallyEntry) {
  9887. this.method = "next";
  9888. this.next = finallyEntry.finallyLoc;
  9889. return ContinueSentinel;
  9890. }
  9891. return this.complete(record);
  9892. },
  9893. complete: function(record, afterLoc) {
  9894. if (record.type === "throw") {
  9895. throw record.arg;
  9896. }
  9897. if (record.type === "break" ||
  9898. record.type === "continue") {
  9899. this.next = record.arg;
  9900. } else if (record.type === "return") {
  9901. this.rval = this.arg = record.arg;
  9902. this.method = "return";
  9903. this.next = "end";
  9904. } else if (record.type === "normal" && afterLoc) {
  9905. this.next = afterLoc;
  9906. }
  9907. return ContinueSentinel;
  9908. },
  9909. finish: function(finallyLoc) {
  9910. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9911. var entry = this.tryEntries[i];
  9912. if (entry.finallyLoc === finallyLoc) {
  9913. this.complete(entry.completion, entry.afterLoc);
  9914. resetTryEntry(entry);
  9915. return ContinueSentinel;
  9916. }
  9917. }
  9918. },
  9919. "catch": function(tryLoc) {
  9920. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9921. var entry = this.tryEntries[i];
  9922. if (entry.tryLoc === tryLoc) {
  9923. var record = entry.completion;
  9924. if (record.type === "throw") {
  9925. var thrown = record.arg;
  9926. resetTryEntry(entry);
  9927. }
  9928. return thrown;
  9929. }
  9930. }
  9931. // The context.catch method must only be called with a location
  9932. // argument that corresponds to a known catch block.
  9933. throw new Error("illegal catch attempt");
  9934. },
  9935. delegateYield: function(iterable, resultName, nextLoc) {
  9936. this.delegate = {
  9937. iterator: values(iterable),
  9938. resultName: resultName,
  9939. nextLoc: nextLoc
  9940. };
  9941. if (this.method === "next") {
  9942. // Deliberately forget the last sent value so that we don't
  9943. // accidentally pass it on to the delegate.
  9944. this.arg = undefined;
  9945. }
  9946. return ContinueSentinel;
  9947. }
  9948. };
  9949. })(
  9950. // In sloppy mode, unbound `this` refers to the global object, fallback to
  9951. // Function constructor if we're in global strict mode. That is sadly a form
  9952. // of indirect eval which violates Content Security Policy.
  9953. (function() {
  9954. return this || (typeof self === "object" && self);
  9955. })() || Function("return this")()
  9956. );
  9957. /***/ }),
  9958. /* 25 */
  9959. /*!*************************************************!*\
  9960. !*** D:/code/work/broke_news_wx/network/api.js ***!
  9961. \*************************************************/
  9962. /*! no static exports found */
  9963. /***/ (function(module, exports, __webpack_require__) {
  9964. "use strict";
  9965. Object.defineProperty(exports, "__esModule", { value: true });exports.findUserAuth = exports.getMobile = exports.getClueById = exports.findPage = exports.saveClue = exports.uploadMediaFile = void 0;var _http = __webpack_require__(/*! ./http.js */ 26);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;}
  9966. //上传素材
  9967. var uploadMediaFile = function uploadMediaFile(data) {
  9968. return (0, _http.uploadFile)(_objectSpread({
  9969. url: '/cmsback/api/clue/uploadMediaFile' },
  9970. data));
  9971. };
  9972. //发布报料
  9973. exports.uploadMediaFile = uploadMediaFile;var saveClue = function saveClue(data) {
  9974. return (0, _http.myRequest)({
  9975. url: '/cmsback/api/clue/save',
  9976. method: 'POST',
  9977. data: data });
  9978. };
  9979. //报料广场
  9980. exports.saveClue = saveClue;var findPage = function findPage(data) {
  9981. return (0, _http.myRequest)({
  9982. url: '/cmsback/api/clue/findPage',
  9983. method: 'POST',
  9984. data: data });
  9985. };
  9986. //查看线索详情
  9987. exports.findPage = findPage;var getClueById = function getClueById(id) {
  9988. return (0, _http.myRequest)({
  9989. url: "/cmsback/api/clue/getClueById/".concat(id),
  9990. method: 'GET' });
  9991. };
  9992. //获取手机号码
  9993. exports.getClueById = getClueById;var getMobile = function getMobile(data) {
  9994. return (0, _http.myRequest)({
  9995. url: '/cmsback/api/clue/findMobile',
  9996. method: "POST",
  9997. data: data });
  9998. };
  9999. //获取用户权限
  10000. exports.getMobile = getMobile;var findUserAuth = function findUserAuth(data) {
  10001. return (0, _http.myRequest)({
  10002. url: '/cmsback/api/clue/checkAuth',
  10003. method: 'GET',
  10004. data: data });
  10005. };exports.findUserAuth = findUserAuth;
  10006. /***/ }),
  10007. /* 26 */
  10008. /*!**************************************************!*\
  10009. !*** D:/code/work/broke_news_wx/network/http.js ***!
  10010. \**************************************************/
  10011. /*! no static exports found */
  10012. /***/ (function(module, exports, __webpack_require__) {
  10013. "use strict";
  10014. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.uploadFile = exports.myRequest = void 0;
  10015. var _config = __webpack_require__(/*! ../utils/config.js */ 27);var baseURL = 'https://console.sxtvs.com.cn';
  10016. var myRequest = function myRequest(options) {
  10017. uni.showLoading({
  10018. title: '加载中...' });
  10019. return new Promise(function (resolve, reject) {
  10020. uni.request({
  10021. url: "".concat(baseURL).concat(options.url), //接口地址:前缀+方法中传入的地址
  10022. method: options.method || 'GET', //请求方法:传入的方法或者默认是“GET”
  10023. data: options.data || {}, //传递参数:传入的参数或者默认传递空集合
  10024. header: {
  10025. 'tenantId': _config.config.tenantId },
  10026. success: function success(res) {
  10027. //返回的数据(不固定,看后端接口,这里是做了一个判断,如果不为true,用uni.showToast方法提示获取数据失败)
  10028. // if (res.data.success != true) {
  10029. // return uni.showToast({
  10030. // title: '获取数据失败',
  10031. // icon: 'none'
  10032. // })
  10033. // }
  10034. // 如果不满足上述判断就输出数据
  10035. uni.hideLoading();
  10036. resolve(res);
  10037. },
  10038. // 这里的接口请求,如果出现问题就输出接口请求失败
  10039. fail: function fail(err) {
  10040. uni.hideLoading();
  10041. console.log(err);
  10042. reject(err);
  10043. } });
  10044. });
  10045. };
  10046. //上传文件
  10047. exports.myRequest = myRequest;var uploadFile = function uploadFile(options) {
  10048. uni.showLoading({
  10049. title: '加载中...' });
  10050. return new Promise(function (resolve, reject) {
  10051. console.log(options);
  10052. uni.uploadFile({
  10053. url: "".concat(baseURL).concat(options.url),
  10054. name: 'file',
  10055. fileType: options.fileType,
  10056. filePath: options.filePath, // 文件
  10057. formData: options.formData, // 除文件外其他所有数据,传对象,会默认转换为 FormData
  10058. header: {
  10059. 'tenantId': _config.config.tenantId },
  10060. success: function success(res) {
  10061. uni.hideLoading();
  10062. resolve(JSON.parse(res.data));
  10063. },
  10064. // 这里的接口请求,如果出现问题就输出接口请求失败
  10065. fail: function fail(err) {
  10066. uni.hideLoading();
  10067. console.log(err);
  10068. reject(err);
  10069. } });
  10070. });
  10071. };exports.uploadFile = uploadFile;
  10072. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  10073. /***/ }),
  10074. /* 27 */
  10075. /*!**************************************************!*\
  10076. !*** D:/code/work/broke_news_wx/utils/config.js ***!
  10077. \**************************************************/
  10078. /*! no static exports found */
  10079. /***/ (function(module, exports, __webpack_require__) {
  10080. "use strict";
  10081. Object.defineProperty(exports, "__esModule", { value: true });exports.config = void 0;var config = {
  10082. cmc_group_url: "",
  10083. public_key: "-----BEGIN PUBLIC KEY-----MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+1/AVZ8ngWzh+lF6O2niL594SI0G0ac++a7ZfaUl6Qn4CiaY5Wk4T2ljqt4zaBVecWEP/HD1gaIzh/Swjc6SmbxGddElTtrmU5UwXYwlys+oU5husvzA+Um6vFWU5umE1tvnt2S4CBijBrY+iM0/67oZNDnR/1CKMRpZwtDNR5QIDAQAB-----END PUBLIC KEY-----",
  10084. geetest_js_url: "/gt.js",
  10085. vaptcha_js_url: "/v3.js",
  10086. oauth_login_url: "/lr/login/oauth-login",
  10087. local_login_url: "/lr/login/local-login",
  10088. local_logout_url: "/lr/login/login-out",
  10089. local_reg_url: "/lr/reg/local-reguser",
  10090. reset_user_pwd_url: "/gu/user/reset-user-pwd",
  10091. send_mobile_code_message_url: "/vcode-server/send-mobile-vcode",
  10092. first_login_url: '/lr/login/first-login',
  10093. login_duration: 3 * 24 * 60 * 60,
  10094. session_storage_key: "cmc_login_session_storage",
  10095. agreement_url: "/agreement.html",
  10096. ip_location_url: "/ip/api/index?ip=&type=0",
  10097. multiTenantLogin: true,
  10098. multi_tenant_login_url: "/lr/login/multi-tenant-login",
  10099. broke_enws_baoliao_righi: { All_List: "33628ed877bf589f50806fd7f8235d08", AuditedList: "088fdda97c1779587e135978c012611f", Reply: "db9c6764be89713ee823d51ff741e391", Audit: "ca00f0116a153e249861505386170e6f" },
  10100. tenantId: 'dcfc7ff84dd717c9713049d205f113be',
  10101. BMapKey: 'tIRoQn8nup0e5zCKgcy4MGditGy9xu3K' };
  10102. // window.configs = config
  10103. exports.config = config;
  10104. /***/ }),
  10105. /* 28 */,
  10106. /* 29 */,
  10107. /* 30 */,
  10108. /* 31 */,
  10109. /* 32 */,
  10110. /* 33 */,
  10111. /* 34 */,
  10112. /* 35 */,
  10113. /* 36 */,
  10114. /* 37 */,
  10115. /* 38 */,
  10116. /* 39 */,
  10117. /* 40 */,
  10118. /* 41 */,
  10119. /* 42 */,
  10120. /* 43 */,
  10121. /* 44 */,
  10122. /* 45 */,
  10123. /* 46 */,
  10124. /* 47 */,
  10125. /* 48 */,
  10126. /* 49 */,
  10127. /* 50 */,
  10128. /* 51 */,
  10129. /* 52 */,
  10130. /* 53 */,
  10131. /* 54 */,
  10132. /* 55 */,
  10133. /* 56 */,
  10134. /* 57 */,
  10135. /* 58 */,
  10136. /* 59 */,
  10137. /* 60 */,
  10138. /* 61 */,
  10139. /* 62 */,
  10140. /* 63 */,
  10141. /* 64 */,
  10142. /* 65 */,
  10143. /* 66 */,
  10144. /* 67 */,
  10145. /* 68 */,
  10146. /* 69 */,
  10147. /* 70 */
  10148. /*!***********************************************!*\
  10149. !*** D:/code/work/broke_news_wx/utils/rsa.js ***!
  10150. \***********************************************/
  10151. /*! no static exports found */
  10152. /***/ (function(module, exports, __webpack_require__) {
  10153. "use strict";
  10154. Object.defineProperty(exports, "__esModule", { value: true });exports.rsaEncrypt = rsaEncrypt;var _jsencrypt = _interopRequireDefault(__webpack_require__(/*! @/js_sdk/jsencrypt-Rsa/jsencrypt/jsencrypt.vue */ 71));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  10155. // import JSEncrypt from './jsencrypt.js';
  10156. // 加密公钥
  10157. var key = "\n\t-----BEGIN PUBLIC KEY-----\n\tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDvUWs2UiUj8quRyePoTXZLlK+Q\n\tvWnyPLgsvYdZedfwQIK4DYdkYwqMHvuPAc1xYjtMqegGpF8cmMpnz3w32zB1ESWx\n\tPXWYZETytDmRp4BUyA4usmVLA0Z9SwDEURDyjrJSdBuKqeid3fMk6C+3YmI/kxvP\n\t/rj9Oj+LX9YaMUKgqwIDAQAB\n\t-----END PUBLIC KEY-----\n";
  10158. // 加密
  10159. // 此加密公钥不能含有 '_' '-'字符串 参考:https://www.codenong.com/jsc71374f48fb3/
  10160. function rsaEncrypt(msg) {
  10161. var encryptMsg = _jsencrypt.default.setEncrypt(key, msg);
  10162. return encryptMsg;
  10163. }
  10164. //超长字符加密 支持汉字加密
  10165. // var ArrayData=jsencrypt.setLongEncrypt(key,"超长字符加密支持汉字加密");
  10166. /***/ }),
  10167. /* 71 */,
  10168. /* 72 */,
  10169. /* 73 */,
  10170. /* 74 */,
  10171. /* 75 */,
  10172. /* 76 */
  10173. /*!**********************************************************************************!*\
  10174. !*** D:/code/work/broke_news_wx/js_sdk/jsencrypt-Rsa/jsencrypt/jsencrypt.min.js ***!
  10175. \**********************************************************************************/
  10176. /*! no static exports found */
  10177. /***/ (function(module, exports, __webpack_require__) {
  10178. /* WEBPACK VAR INJECTION */(function(global) {var CryptoJS = CryptoJS || function (a, b) {var c, e, f, g, h, i, j, k, l, m, n, o, q;if (!c && "undefined" != typeof global && global.crypto && (c = global.crypto), !c && "function" == "function") try {c = __webpack_require__(/*! crypto */ 77);} catch (d) {}return e = function e() {if (c) {if ("function" == typeof c.getRandomValues) try {return c.getRandomValues(new Uint32Array(1))[0];} catch (a) {}if ("function" == typeof c.randomBytes) try {return c.randomBytes(4).readInt32LE();} catch (a) {}}throw new Error("Native crypto module could not be used to get secure random number.");}, f = Object.create || function () {function a() {}return function (b) {var c;return a.prototype = b, c = new a(), a.prototype = null, c;};}(), g = {}, h = g.lib = {}, i = h.Base = function () {return { extend: function extend(a) {var b = f(this);return a && b.mixIn(a), b.hasOwnProperty("init") && this.init !== b.init || (b.init = function () {b.$super.init.apply(this, arguments);}), b.init.prototype = b, b.$super = this, b;}, create: function create() {var a = this.extend();return a.init.apply(a, arguments), a;}, init: function init() {}, mixIn: function mixIn(a) {for (var b in a) {a.hasOwnProperty(b) && (this[b] = a[b]);}a.hasOwnProperty("toString") && (this.toString = a.toString);}, clone: function clone() {return this.init.prototype.extend(this);} };}(), j = h.WordArray = i.extend({ init: function init(a, c) {a = this.words = a || [], this.sigBytes = c != b ? c : 4 * a.length;}, toString: function toString(a) {return (a || l).stringify(this);}, concat: function concat(a) {var f,g,b = this.words,c = a.words,d = this.sigBytes,e = a.sigBytes;if (this.clamp(), d % 4) for (f = 0; e > f; f++) {g = 255 & c[f >>> 2] >>> 24 - 8 * (f % 4), b[d + f >>> 2] |= g << 24 - 8 * ((d + f) % 4);} else for (f = 0; e > f; f += 4) {b[d + f >>> 2] = c[f >>> 2];}return this.sigBytes += e, this;}, clamp: function clamp() {var b = this.words,c = this.sigBytes;b[c >>> 2] &= 4294967295 << 32 - 8 * (c % 4), b.length = a.ceil(c / 4);}, clone: function clone() {var a = i.clone.call(this);return a.words = this.words.slice(0), a;}, random: function random(a) {var c,b = [];for (c = 0; a > c; c += 4) {b.push(e());}return new j.init(b, a);} }), k = g.enc = {}, l = k.Hex = { stringify: function stringify(a) {var e,f,b = a.words,c = a.sigBytes,d = [];for (e = 0; c > e; e++) {f = 255 & b[e >>> 2] >>> 24 - 8 * (e % 4), d.push((f >>> 4).toString(16)), d.push((15 & f).toString(16));}return d.join("");}, parse: function parse(a) {var d,b = a.length,c = [];for (d = 0; b > d; d += 2) {c[d >>> 3] |= parseInt(a.substr(d, 2), 16) << 24 - 4 * (d % 8);}return new j.init(c, b / 2);} }, m = k.Latin1 = { stringify: function stringify(a) {var e,f,b = a.words,c = a.sigBytes,d = [];for (e = 0; c > e; e++) {f = 255 & b[e >>> 2] >>> 24 - 8 * (e % 4), d.push(String.fromCharCode(f));}return d.join("");}, parse: function parse(a) {var d,b = a.length,c = [];for (d = 0; b > d; d++) {c[d >>> 2] |= (255 & a.charCodeAt(d)) << 24 - 8 * (d % 4);}return new j.init(c, b);} }, n = k.Utf8 = { stringify: function stringify(a) {try {return decodeURIComponent(escape(m.stringify(a)));} catch (b) {throw new Error("Malformed UTF-8 data");}}, parse: function parse(a) {return m.parse(unescape(encodeURIComponent(a)));} }, o = h.BufferedBlockAlgorithm = i.extend({ reset: function reset() {this._data = new j.init(), this._nDataBytes = 0;}, _append: function _append(a) {"string" == typeof a && (a = n.parse(a)), this._data.concat(a), this._nDataBytes += a.sigBytes;}, _process: function _process(b) {var c,k,l,m,d = this._data,e = d.words,f = d.sigBytes,g = this.blockSize,h = 4 * g,i = f / h;if (i = b ? a.ceil(i) : a.max((0 | i) - this._minBufferSize, 0), k = i * g, l = a.min(4 * k, f), k) {for (m = 0; k > m; m += g) {this._doProcessBlock(e, m);}c = e.splice(0, k), d.sigBytes -= l;}return new j.init(c, l);}, clone: function clone() {var a = i.clone.call(this);return a._data = this._data.clone(), a;}, _minBufferSize: 0 }), h.Hasher = o.extend({ cfg: i.extend(), init: function init(a) {this.cfg = this.cfg.extend(a), this.reset();}, reset: function reset() {o.reset.call(this), this._doReset();}, update: function update(a) {return this._append(a), this._process(), this;}, finalize: function finalize(a) {a && this._append(a);var b = this._doFinalize();return b;}, blockSize: 16, _createHelper: function _createHelper(a) {return function (b, c) {return new a.init(c).finalize(b);};}, _createHmacHelper: function _createHmacHelper(a) {return function (b, c) {return new q.HMAC.init(a, c).finalize(b);};} }), q = g.algo = {}, g;}(Math);!function () {function f(a, b, d) {var g,h,i,j,e = [],f = 0;for (g = 0; b > g; g++) {g % 4 && (h = d[a.charCodeAt(g - 1)] << 2 * (g % 4), i = d[a.charCodeAt(g)] >>> 6 - 2 * (g % 4), j = h | i, e[f >>> 2] |= j << 24 - 8 * (f % 4), f++);}return c.create(e, f);}var a = CryptoJS,b = a.lib,c = b.WordArray,d = a.enc;d.Base64 = { stringify: function stringify(a) {var e,f,g,h,i,j,k,l,b = a.words,c = a.sigBytes,d = this._map;for (a.clamp(), e = [], f = 0; c > f; f += 3) {for (g = 255 & b[f >>> 2] >>> 24 - 8 * (f % 4), h = 255 & b[f + 1 >>> 2] >>> 24 - 8 * ((f + 1) % 4), i = 255 & b[f + 2 >>> 2] >>> 24 - 8 * ((f + 2) % 4), j = g << 16 | h << 8 | i, k = 0; 4 > k && c > f + .75 * k; k++) {e.push(d.charAt(63 & j >>> 6 * (3 - k)));}}if (l = d.charAt(64)) for (; e.length % 4;) {e.push(l);}return e.join("");}, parse: function parse(a) {var e,g,h,b = a.length,c = this._map,d = this._reverseMap;if (!d) for (d = this._reverseMap = [], e = 0; e < c.length; e++) {d[c.charCodeAt(e)] = e;}return g = c.charAt(64), g && (h = a.indexOf(g), -1 !== h && (b = h)), f(a, b, d);}, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" };}(), function (a) {function i(a, b, c, d, e, f, g) {var h = a + (b & c | ~b & d) + e + g;return (h << f | h >>> 32 - f) + b;}function j(a, b, c, d, e, f, g) {var h = a + (b & d | c & ~d) + e + g;return (h << f | h >>> 32 - f) + b;}function k(a, b, c, d, e, f, g) {var h = a + (b ^ c ^ d) + e + g;return (h << f | h >>> 32 - f) + b;}function l(a, b, c, d, e, f, g) {var h = a + (c ^ (b | ~d)) + e + g;return (h << f | h >>> 32 - f) + b;}var h,b = CryptoJS,c = b.lib,d = c.WordArray,e = c.Hasher,f = b.algo,g = [];!function () {for (var b = 0; 64 > b; b++) {g[b] = 0 | 4294967296 * a.abs(a.sin(b + 1));}}(), h = f.MD5 = e.extend({ _doReset: function _doReset() {this._hash = new d.init([1732584193, 4023233417, 2562383102, 271733878]);}, _doProcessBlock: function _doProcessBlock(a, b) {var c, d, e, f, h, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E;for (c = 0; 16 > c; c++) {d = b + c, e = a[d], a[d] = 16711935 & (e << 8 | e >>> 24) | 4278255360 & (e << 24 | e >>> 8);}f = this._hash.words, h = a[b + 0], m = a[b + 1], n = a[b + 2], o = a[b + 3], p = a[b + 4], q = a[b + 5], r = a[b + 6], s = a[b + 7], t = a[b + 8], u = a[b + 9], v = a[b + 10], w = a[b + 11], x = a[b + 12], y = a[b + 13], z = a[b + 14], A = a[b + 15], B = f[0], C = f[1], D = f[2], E = f[3], B = i(B, C, D, E, h, 7, g[0]), E = i(E, B, C, D, m, 12, g[1]), D = i(D, E, B, C, n, 17, g[2]), C = i(C, D, E, B, o, 22, g[3]), B = i(B, C, D, E, p, 7, g[4]), E = i(E, B, C, D, q, 12, g[5]), D = i(D, E, B, C, r, 17, g[6]), C = i(C, D, E, B, s, 22, g[7]), B = i(B, C, D, E, t, 7, g[8]), E = i(E, B, C, D, u, 12, g[9]), D = i(D, E, B, C, v, 17, g[10]), C = i(C, D, E, B, w, 22, g[11]), B = i(B, C, D, E, x, 7, g[12]), E = i(E, B, C, D, y, 12, g[13]), D = i(D, E, B, C, z, 17, g[14]), C = i(C, D, E, B, A, 22, g[15]), B = j(B, C, D, E, m, 5, g[16]), E = j(E, B, C, D, r, 9, g[17]), D = j(D, E, B, C, w, 14, g[18]), C = j(C, D, E, B, h, 20, g[19]), B = j(B, C, D, E, q, 5, g[20]), E = j(E, B, C, D, v, 9, g[21]), D = j(D, E, B, C, A, 14, g[22]), C = j(C, D, E, B, p, 20, g[23]), B = j(B, C, D, E, u, 5, g[24]), E = j(E, B, C, D, z, 9, g[25]), D = j(D, E, B, C, o, 14, g[26]), C = j(C, D, E, B, t, 20, g[27]), B = j(B, C, D, E, y, 5, g[28]), E = j(E, B, C, D, n, 9, g[29]), D = j(D, E, B, C, s, 14, g[30]), C = j(C, D, E, B, x, 20, g[31]), B = k(B, C, D, E, q, 4, g[32]), E = k(E, B, C, D, t, 11, g[33]), D = k(D, E, B, C, w, 16, g[34]), C = k(C, D, E, B, z, 23, g[35]), B = k(B, C, D, E, m, 4, g[36]), E = k(E, B, C, D, p, 11, g[37]), D = k(D, E, B, C, s, 16, g[38]), C = k(C, D, E, B, v, 23, g[39]), B = k(B, C, D, E, y, 4, g[40]), E = k(E, B, C, D, h, 11, g[41]), D = k(D, E, B, C, o, 16, g[42]), C = k(C, D, E, B, r, 23, g[43]), B = k(B, C, D, E, u, 4, g[44]), E = k(E, B, C, D, x, 11, g[45]), D = k(D, E, B, C, A, 16, g[46]), C = k(C, D, E, B, n, 23, g[47]), B = l(B, C, D, E, h, 6, g[48]), E = l(E, B, C, D, s, 10, g[49]), D = l(D, E, B, C, z, 15, g[50]), C = l(C, D, E, B, q, 21, g[51]), B = l(B, C, D, E, x, 6, g[52]), E = l(E, B, C, D, o, 10, g[53]), D = l(D, E, B, C, v, 15, g[54]), C = l(C, D, E, B, m, 21, g[55]), B = l(B, C, D, E, t, 6, g[56]), E = l(E, B, C, D, A, 10, g[57]), D = l(D, E, B, C, r, 15, g[58]), C = l(C, D, E, B, y, 21, g[59]), B = l(B, C, D, E, p, 6, g[60]), E = l(E, B, C, D, w, 10, g[61]), D = l(D, E, B, C, n, 15, g[62]), C = l(C, D, E, B, u, 21, g[63]), f[0] = 0 | f[0] + B, f[1] = 0 | f[1] + C, f[2] = 0 | f[2] + D, f[3] = 0 | f[3] + E;}, _doFinalize: function _doFinalize() {var f,g,h,i,j,k,b = this._data,c = b.words,d = 8 * this._nDataBytes,e = 8 * b.sigBytes;for (c[e >>> 5] |= 128 << 24 - e % 32, f = a.floor(d / 4294967296), g = d, c[(e + 64 >>> 9 << 4) + 15] = 16711935 & (f << 8 | f >>> 24) | 4278255360 & (f << 24 | f >>> 8), c[(e + 64 >>> 9 << 4) + 14] = 16711935 & (g << 8 | g >>> 24) | 4278255360 & (g << 24 | g >>> 8), b.sigBytes = 4 * (c.length + 1), this._process(), h = this._hash, i = h.words, j = 0; 4 > j; j++) {k = i[j], i[j] = 16711935 & (k << 8 | k >>> 24) | 4278255360 & (k << 24 | k >>> 8);}return h;}, clone: function clone() {var a = e.clone.call(this);return a._hash = this._hash.clone(), a;} }), b.MD5 = e._createHelper(h), b.HmacMD5 = e._createHmacHelper(h);}(Math), function () {var a = CryptoJS,b = a.lib,c = b.WordArray,d = b.Hasher,e = a.algo,f = [],g = e.SHA1 = d.extend({ _doReset: function _doReset() {this._hash = new c.init([1732584193, 4023233417, 2562383102, 271733878, 3285377520]);}, _doProcessBlock: function _doProcessBlock(a, b) {var j,k,l,c = this._hash.words,d = c[0],e = c[1],g = c[2],h = c[3],i = c[4];for (j = 0; 80 > j; j++) {16 > j ? f[j] = 0 | a[b + j] : (k = f[j - 3] ^ f[j - 8] ^ f[j - 14] ^ f[j - 16], f[j] = k << 1 | k >>> 31), l = (d << 5 | d >>> 27) + i + f[j], l += 20 > j ? (e & g | ~e & h) + 1518500249 : 40 > j ? (e ^ g ^ h) + 1859775393 : 60 > j ? (e & g | e & h | g & h) - 1894007588 : (e ^ g ^ h) - 899497514, i = h, h = g, g = e << 30 | e >>> 2, e = d, d = l;}c[0] = 0 | c[0] + d, c[1] = 0 | c[1] + e, c[2] = 0 | c[2] + g, c[3] = 0 | c[3] + h, c[4] = 0 | c[4] + i;}, _doFinalize: function _doFinalize() {var a = this._data,b = a.words,c = 8 * this._nDataBytes,d = 8 * a.sigBytes;return b[d >>> 5] |= 128 << 24 - d % 32, b[(d + 64 >>> 9 << 4) + 14] = Math.floor(c / 4294967296), b[(d + 64 >>> 9 << 4) + 15] = c, a.sigBytes = 4 * b.length, this._process(), this._hash;}, clone: function clone() {var a = d.clone.call(this);return a._hash = this._hash.clone(), a;} });a.SHA1 = d._createHelper(g), a.HmacSHA1 = d._createHmacHelper(g);}(), function (a) {var i,j,b = CryptoJS,c = b.lib,d = c.WordArray,e = c.Hasher,f = b.algo,g = [],h = [];!function () {function b(b) {var d,c = a.sqrt(b);for (d = 2; c >= d; d++) {if (!(b % d)) return !1;}return !0;}function c(a) {return 0 | 4294967296 * (a - (0 | a));}for (var d = 2, e = 0; 64 > e;) {b(d) && (8 > e && (g[e] = c(a.pow(d, .5))), h[e] = c(a.pow(d, 1 / 3)), e++), d++;}}(), i = [], j = f.SHA256 = e.extend({ _doReset: function _doReset() {this._hash = new d.init(g.slice(0));}, _doProcessBlock: function _doProcessBlock(a, b) {var n,o,p,q,r,s,t,u,v,w,x,c = this._hash.words,d = c[0],e = c[1],f = c[2],g = c[3],j = c[4],k = c[5],l = c[6],m = c[7];for (n = 0; 64 > n; n++) {16 > n ? i[n] = 0 | a[b + n] : (o = i[n - 15], p = (o << 25 | o >>> 7) ^ (o << 14 | o >>> 18) ^ o >>> 3, q = i[n - 2], r = (q << 15 | q >>> 17) ^ (q << 13 | q >>> 19) ^ q >>> 10, i[n] = p + i[n - 7] + r + i[n - 16]), s = j & k ^ ~j & l, t = d & e ^ d & f ^ e & f, u = (d << 30 | d >>> 2) ^ (d << 19 | d >>> 13) ^ (d << 10 | d >>> 22), v = (j << 26 | j >>> 6) ^ (j << 21 | j >>> 11) ^ (j << 7 | j >>> 25), w = m + v + s + h[n] + i[n], x = u + t, m = l, l = k, k = j, j = 0 | g + w, g = f, f = e, e = d, d = 0 | w + x;}c[0] = 0 | c[0] + d, c[1] = 0 | c[1] + e, c[2] = 0 | c[2] + f, c[3] = 0 | c[3] + g, c[4] = 0 | c[4] + j, c[5] = 0 | c[5] + k, c[6] = 0 | c[6] + l, c[7] = 0 | c[7] + m;}, _doFinalize: function _doFinalize() {var b = this._data,c = b.words,d = 8 * this._nDataBytes,e = 8 * b.sigBytes;return c[e >>> 5] |= 128 << 24 - e % 32, c[(e + 64 >>> 9 << 4) + 14] = a.floor(d / 4294967296), c[(e + 64 >>> 9 << 4) + 15] = d, b.sigBytes = 4 * c.length, this._process(), this._hash;}, clone: function clone() {var a = e.clone.call(this);return a._hash = this._hash.clone(), a;} }), b.SHA256 = e._createHelper(j), b.HmacSHA256 = e._createHmacHelper(j);}(Math), function () {function f(a) {return 4278255360 & a << 8 | 16711935 & a >>> 8;}var a = CryptoJS,b = a.lib,c = b.WordArray,d = a.enc;d.Utf16 = d.Utf16BE = { stringify: function stringify(a) {var e,f,b = a.words,c = a.sigBytes,d = [];for (e = 0; c > e; e += 2) {f = 65535 & b[e >>> 2] >>> 16 - 8 * (e % 4), d.push(String.fromCharCode(f));}return d.join("");}, parse: function parse(a) {var e,b = a.length,d = [];for (e = 0; b > e; e++) {d[e >>> 1] |= a.charCodeAt(e) << 16 - 16 * (e % 2);}return c.create(d, 2 * b);} }, d.Utf16LE = { stringify: function stringify(a) {var e,g,b = a.words,c = a.sigBytes,d = [];for (e = 0; c > e; e += 2) {g = f(65535 & b[e >>> 2] >>> 16 - 8 * (e % 4)), d.push(String.fromCharCode(g));}return d.join("");}, parse: function parse(a) {var e,b = a.length,d = [];for (e = 0; b > e; e++) {d[e >>> 1] |= f(a.charCodeAt(e) << 16 - 16 * (e % 2));}return c.create(d, 2 * b);} };}(), function () {var a, b, c, d, e;"function" == typeof ArrayBuffer && (a = CryptoJS, b = a.lib, c = b.WordArray, d = c.init, e = c.init = function (a) {var b, c, e;if (a instanceof ArrayBuffer && (a = new Uint8Array(a)), (a instanceof Int8Array || "undefined" != typeof Uint8ClampedArray && a instanceof Uint8ClampedArray || a instanceof Int16Array || a instanceof Uint16Array || a instanceof Int32Array || a instanceof Uint32Array || a instanceof Float32Array || a instanceof Float64Array) && (a = new Uint8Array(a.buffer, a.byteOffset, a.byteLength)), a instanceof Uint8Array) {for (b = a.byteLength, c = [], e = 0; b > e; e++) {c[e >>> 2] |= a[e] << 24 - 8 * (e % 4);}d.call(this, c, b);} else d.apply(this, arguments);}, e.prototype = c);}(), function () {function n(a, b, c) {return a ^ b ^ c;}function o(a, b, c) {return a & b | ~a & c;}function p(a, b, c) {return (a | ~b) ^ c;}function q(a, b, c) {return a & c | b & ~c;}function r(a, b, c) {return a ^ (b | ~c);}function s(a, b) {return a << b | a >>> 32 - b;}var b = CryptoJS,c = b.lib,d = c.WordArray,e = c.Hasher,f = b.algo,g = d.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]),h = d.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]),i = d.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]),j = d.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]),k = d.create([0, 1518500249, 1859775393, 2400959708, 2840853838]),l = d.create([1352829926, 1548603684, 1836072691, 2053994217, 0]),m = f.RIPEMD160 = e.extend({ _doReset: function _doReset() {this._hash = d.create([1732584193, 4023233417, 2562383102, 271733878, 3285377520]);}, _doProcessBlock: function _doProcessBlock(a, b) {var c, d, e, f, m, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I;for (c = 0; 16 > c; c++) {d = b + c, e = a[d], a[d] = 16711935 & (e << 8 | e >>> 24) | 4278255360 & (e << 24 | e >>> 8);}for (f = this._hash.words, m = k.words, t = l.words, u = g.words, v = h.words, w = i.words, x = j.words, D = y = f[0], E = z = f[1], F = A = f[2], G = B = f[3], H = C = f[4], c = 0; 80 > c; c += 1) {I = 0 | y + a[b + u[c]], I += 16 > c ? n(z, A, B) + m[0] : 32 > c ? o(z, A, B) + m[1] : 48 > c ? p(z, A, B) + m[2] : 64 > c ? q(z, A, B) + m[3] : r(z, A, B) + m[4], I = 0 | I, I = s(I, w[c]), I = 0 | I + C, y = C, C = B, B = s(A, 10), A = z, z = I, I = 0 | D + a[b + v[c]], I += 16 > c ? r(E, F, G) + t[0] : 32 > c ? q(E, F, G) + t[1] : 48 > c ? p(E, F, G) + t[2] : 64 > c ? o(E, F, G) + t[3] : n(E, F, G) + t[4], I = 0 | I, I = s(I, x[c]), I = 0 | I + H, D = H, H = G, G = s(F, 10), F = E, E = I;}I = 0 | f[1] + A + G, f[1] = 0 | f[2] + B + H, f[2] = 0 | f[3] + C + D, f[3] = 0 | f[4] + y + E, f[4] = 0 | f[0] + z + F, f[0] = I;}, _doFinalize: function _doFinalize() {var e,f,g,h,a = this._data,b = a.words,c = 8 * this._nDataBytes,d = 8 * a.sigBytes;for (b[d >>> 5] |= 128 << 24 - d % 32, b[(d + 64 >>> 9 << 4) + 14] = 16711935 & (c << 8 | c >>> 24) | 4278255360 & (c << 24 | c >>> 8), a.sigBytes = 4 * (b.length + 1), this._process(), e = this._hash, f = e.words, g = 0; 5 > g; g++) {h = f[g], f[g] = 16711935 & (h << 8 | h >>> 24) | 4278255360 & (h << 24 | h >>> 8);}return e;}, clone: function clone() {var a = e.clone.call(this);return a._hash = this._hash.clone(), a;} });b.RIPEMD160 = e._createHelper(m), b.HmacRIPEMD160 = e._createHmacHelper(m);}(Math), function () {var a = CryptoJS,b = a.lib,c = b.Base,d = a.enc,e = d.Utf8,f = a.algo;f.HMAC = c.extend({ init: function init(a, b) {var c, d, f, g, h, i, j;for (a = this._hasher = new a.init(), "string" == typeof b && (b = e.parse(b)), c = a.blockSize, d = 4 * c, b.sigBytes > d && (b = a.finalize(b)), b.clamp(), f = this._oKey = b.clone(), g = this._iKey = b.clone(), h = f.words, i = g.words, j = 0; c > j; j++) {h[j] ^= 1549556828, i[j] ^= 909522486;}f.sigBytes = g.sigBytes = d, this.reset();}, reset: function reset() {var a = this._hasher;a.reset(), a.update(this._iKey);}, update: function update(a) {return this._hasher.update(a), this;}, finalize: function finalize(a) {var d,b = this._hasher,c = b.finalize(a);return b.reset(), d = b.finalize(this._oKey.clone().concat(c));} });}(), function () {var a = CryptoJS,b = a.lib,c = b.Base,d = b.WordArray,e = a.algo,f = e.SHA1,g = e.HMAC,h = e.PBKDF2 = c.extend({ cfg: c.extend({ keySize: 4, hasher: f, iterations: 1 }), init: function init(a) {this.cfg = this.cfg.extend(a);}, compute: function compute(a, b) {for (var m, n, o, p, q, r, s, c = this.cfg, e = g.create(c.hasher, a), f = d.create(), h = d.create([1]), i = f.words, j = h.words, k = c.keySize, l = c.iterations; i.length < k;) {for (m = e.update(b).finalize(h), e.reset(), n = m.words, o = n.length, p = m, q = 1; l > q; q++) {for (p = e.finalize(p), e.reset(), r = p.words, s = 0; o > s; s++) {n[s] ^= r[s];}}f.concat(m), j[0]++;}return f.sigBytes = 4 * k, f;} });a.PBKDF2 = function (a, b, c) {return h.create(c).compute(a, b);};}(), function () {var a = CryptoJS,b = a.lib,c = b.Base,d = b.WordArray,e = a.algo,f = e.MD5,g = e.EvpKDF = c.extend({ cfg: c.extend({ keySize: 4, hasher: f, iterations: 1 }), init: function init(a) {this.cfg = this.cfg.extend(a);}, compute: function compute(a, b) {for (var c, k, e = this.cfg, f = e.hasher.create(), g = d.create(), h = g.words, i = e.keySize, j = e.iterations; h.length < i;) {for (c && f.update(c), c = f.update(a).finalize(b), f.reset(), k = 1; j > k; k++) {c = f.finalize(c), f.reset();}g.concat(c);}return g.sigBytes = 4 * i, g;} });a.EvpKDF = function (a, b, c) {return g.create(c).compute(a, b);};}(), function () {var a = CryptoJS,b = a.lib,c = b.WordArray,d = a.algo,e = d.SHA256,f = d.SHA224 = e.extend({ _doReset: function _doReset() {this._hash = new c.init([3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428]);}, _doFinalize: function _doFinalize() {var a = e._doFinalize.call(this);return a.sigBytes -= 4, a;} });a.SHA224 = e._createHelper(f), a.HmacSHA224 = e._createHmacHelper(f);}(), function (a) {var b = CryptoJS,c = b.lib,d = c.Base,e = c.WordArray,f = b.x64 = {};f.Word = d.extend({ init: function init(a, b) {this.high = a, this.low = b;} }), f.WordArray = d.extend({ init: function init(b, c) {b = this.words = b || [], this.sigBytes = c != a ? c : 8 * b.length;}, toX32: function toX32() {var d,f,a = this.words,b = a.length,c = [];for (d = 0; b > d; d++) {f = a[d], c.push(f.high), c.push(f.low);}return e.create(c, this.sigBytes);}, clone: function clone() {var e,a = d.clone.call(this),b = a.words = this.words.slice(0),c = b.length;for (e = 0; c > e; e++) {b[e] = b[e].clone();}return a;} });}(), function (a) {var l,m,b = CryptoJS,c = b.lib,d = c.WordArray,e = c.Hasher,f = b.x64,g = f.Word,h = b.algo,i = [],j = [],k = [];!function () {var c,d,e,f,h,l,m,n,o,a = 1,b = 0;for (c = 0; 24 > c; c++) {i[a + 5 * b] = (c + 1) * (c + 2) / 2 % 64, d = b % 5, e = (2 * a + 3 * b) % 5, a = d, b = e;}for (a = 0; 5 > a; a++) {for (b = 0; 5 > b; b++) {j[a + 5 * b] = b + 5 * ((2 * a + 3 * b) % 5);}}for (f = 1, h = 0; 24 > h; h++) {for (l = 0, m = 0, n = 0; 7 > n; n++) {1 & f && (o = (1 << n) - 1, 32 > o ? m ^= 1 << o : l ^= 1 << o - 32), 128 & f ? f = 113 ^ f << 1 : f <<= 1;}k[h] = g.create(l, m);}}(), l = [], function () {for (var a = 0; 25 > a; a++) {l[a] = g.create();}}(), m = h.SHA3 = e.extend({ cfg: e.cfg.extend({ outputLength: 512 }), _doReset: function _doReset() {var b,a = this._state = [];for (b = 0; 25 > b; b++) {a[b] = new g.init();}this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32;}, _doProcessBlock: function _doProcessBlock(a, b) {var e,f,g,h,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,c = this._state,d = this.blockSize / 2;for (e = 0; d > e; e++) {f = a[b + 2 * e], g = a[b + 2 * e + 1], f = 16711935 & (f << 8 | f >>> 24) | 4278255360 & (f << 24 | f >>> 8), g = 16711935 & (g << 8 | g >>> 24) | 4278255360 & (g << 24 | g >>> 8), h = c[e], h.high ^= g, h.low ^= f;}for (m = 0; 24 > m; m++) {for (n = 0; 5 > n; n++) {for (o = 0, p = 0, q = 0; 5 > q; q++) {h = c[n + 5 * q], o ^= h.high, p ^= h.low;}r = l[n], r.high = o, r.low = p;}for (n = 0; 5 > n; n++) {for (s = l[(n + 4) % 5], t = l[(n + 1) % 5], u = t.high, v = t.low, o = s.high ^ (u << 1 | v >>> 31), p = s.low ^ (v << 1 | u >>> 31), q = 0; 5 > q; q++) {h = c[n + 5 * q], h.high ^= o, h.low ^= p;}}for (w = 1; 25 > w; w++) {h = c[w], x = h.high, y = h.low, z = i[w], 32 > z ? (o = x << z | y >>> 32 - z, p = y << z | x >>> 32 - z) : (o = y << z - 32 | x >>> 64 - z, p = x << z - 32 | y >>> 64 - z), A = l[j[w]], A.high = o, A.low = p;}for (B = l[0], C = c[0], B.high = C.high, B.low = C.low, n = 0; 5 > n; n++) {for (q = 0; 5 > q; q++) {w = n + 5 * q, h = c[w], D = l[w], E = l[(n + 1) % 5 + 5 * q], F = l[(n + 2) % 5 + 5 * q], h.high = D.high ^ ~E.high & F.high, h.low = D.low ^ ~E.low & F.low;}}h = c[0], G = k[m], h.high ^= G.high, h.low ^= G.low;}}, _doFinalize: function _doFinalize() {var f,g,h,i,j,k,l,m,n,o,b = this._data,c = b.words;for (8 * this._nDataBytes, f = 8 * b.sigBytes, g = 32 * this.blockSize, c[f >>> 5] |= 1 << 24 - f % 32, c[(a.ceil((f + 1) / g) * g >>> 5) - 1] |= 128, b.sigBytes = 4 * c.length, this._process(), h = this._state, i = this.cfg.outputLength / 8, j = i / 8, k = [], l = 0; j > l; l++) {m = h[l], n = m.high, o = m.low, n = 16711935 & (n << 8 | n >>> 24) | 4278255360 & (n << 24 | n >>> 8), o = 16711935 & (o << 8 | o >>> 24) | 4278255360 & (o << 24 | o >>> 8), k.push(o), k.push(n);}return new d.init(k, i);}, clone: function clone() {var c,a = e.clone.call(this),b = a._state = this._state.slice(0);for (c = 0; 25 > c; c++) {b[c] = b[c].clone();}return a;} }), b.SHA3 = e._createHelper(m), b.HmacSHA3 = e._createHmacHelper(m);}(Math), function () {function h() {return e.create.apply(e, arguments);}var k,a = CryptoJS,b = a.lib,c = b.Hasher,d = a.x64,e = d.Word,f = d.WordArray,g = a.algo,i = [h(1116352408, 3609767458), h(1899447441, 602891725), h(3049323471, 3964484399), h(3921009573, 2173295548), h(961987163, 4081628472), h(1508970993, 3053834265), h(2453635748, 2937671579), h(2870763221, 3664609560), h(3624381080, 2734883394), h(310598401, 1164996542), h(607225278, 1323610764), h(1426881987, 3590304994), h(1925078388, 4068182383), h(2162078206, 991336113), h(2614888103, 633803317), h(3248222580, 3479774868), h(3835390401, 2666613458), h(4022224774, 944711139), h(264347078, 2341262773), h(604807628, 2007800933), h(770255983, 1495990901), h(1249150122, 1856431235), h(1555081692, 3175218132), h(1996064986, 2198950837), h(2554220882, 3999719339), h(2821834349, 766784016), h(2952996808, 2566594879), h(3210313671, 3203337956), h(3336571891, 1034457026), h(3584528711, 2466948901), h(113926993, 3758326383), h(338241895, 168717936), h(666307205, 1188179964), h(773529912, 1546045734), h(1294757372, 1522805485), h(1396182291, 2643833823), h(1695183700, 2343527390), h(1986661051, 1014477480), h(2177026350, 1206759142), h(2456956037, 344077627), h(2730485921, 1290863460), h(2820302411, 3158454273), h(3259730800, 3505952657), h(3345764771, 106217008), h(3516065817, 3606008344), h(3600352804, 1432725776), h(4094571909, 1467031594), h(275423344, 851169720), h(430227734, 3100823752), h(506948616, 1363258195), h(659060556, 3750685593), h(883997877, 3785050280), h(958139571, 3318307427), h(1322822218, 3812723403), h(1537002063, 2003034995), h(1747873779, 3602036899), h(1955562222, 1575990012), h(2024104815, 1125592928), h(2227730452, 2716904306), h(2361852424, 442776044), h(2428436474, 593698344), h(2756734187, 3733110249), h(3204031479, 2999351573), h(3329325298, 3815920427), h(3391569614, 3928383900), h(3515267271, 566280711), h(3940187606, 3454069534), h(4118630271, 4000239992), h(116418474, 1914138554), h(174292421, 2731055270), h(289380356, 3203993006), h(460393269, 320620315), h(685471733, 587496836), h(852142971, 1086792851), h(1017036298, 365543100), h(1126000580, 2618297676), h(1288033470, 3409855158), h(1501505948, 4234509866), h(1607167915, 987167468), h(1816402316, 1246189591)],j = [];!function () {for (var a = 0; 80 > a; a++) {j[a] = h();}}(), k = g.SHA512 = c.extend({ _doReset: function _doReset() {this._hash = new f.init([new e.init(1779033703, 4089235720), new e.init(3144134277, 2227873595), new e.init(1013904242, 4271175723), new e.init(2773480762, 1595750129), new e.init(1359893119, 2917565137), new e.init(2600822924, 725511199), new e.init(528734635, 4215389547), new e.init(1541459225, 327033209)]);}, _doProcessBlock: function _doProcessBlock(a, b) {var T,U,V,W,X,Y,Z,$,_,ab,bb,cb,db,eb,fb,gb,hb,ib,jb,kb,lb,mb,nb,ob,pb,qb,rb,sb,tb,ub,vb,wb,xb,yb,zb,c = this._hash.words,d = c[0],e = c[1],f = c[2],g = c[3],h = c[4],k = c[5],l = c[6],m = c[7],n = d.high,o = d.low,p = e.high,q = e.low,r = f.high,s = f.low,t = g.high,u = g.low,v = h.high,w = h.low,x = k.high,y = k.low,z = l.high,A = l.low,B = m.high,C = m.low,D = n,E = o,F = p,G = q,H = r,I = s,J = t,K = u,L = v,M = w,N = x,O = y,P = z,Q = A,R = B,S = C;for (T = 0; 80 > T; T++) {W = j[T], 16 > T ? (V = W.high = 0 | a[b + 2 * T], U = W.low = 0 | a[b + 2 * T + 1]) : (X = j[T - 15], Y = X.high, Z = X.low, $ = (Y >>> 1 | Z << 31) ^ (Y >>> 8 | Z << 24) ^ Y >>> 7, _ = (Z >>> 1 | Y << 31) ^ (Z >>> 8 | Y << 24) ^ (Z >>> 7 | Y << 25), ab = j[T - 2], bb = ab.high, cb = ab.low, db = (bb >>> 19 | cb << 13) ^ (bb << 3 | cb >>> 29) ^ bb >>> 6, eb = (cb >>> 19 | bb << 13) ^ (cb << 3 | bb >>> 29) ^ (cb >>> 6 | bb << 26), fb = j[T - 7], gb = fb.high, hb = fb.low, ib = j[T - 16], jb = ib.high, kb = ib.low, U = _ + hb, V = $ + gb + (_ >>> 0 > U >>> 0 ? 1 : 0), U += eb, V = V + db + (eb >>> 0 > U >>> 0 ? 1 : 0), U += kb, V = V + jb + (kb >>> 0 > U >>> 0 ? 1 : 0), W.high = V, W.low = U), lb = L & N ^ ~L & P, mb = M & O ^ ~M & Q, nb = D & F ^ D & H ^ F & H, ob = E & G ^ E & I ^ G & I, pb = (D >>> 28 | E << 4) ^ (D << 30 | E >>> 2) ^ (D << 25 | E >>> 7), qb = (E >>> 28 | D << 4) ^ (E << 30 | D >>> 2) ^ (E << 25 | D >>> 7), rb = (L >>> 14 | M << 18) ^ (L >>> 18 | M << 14) ^ (L << 23 | M >>> 9), sb = (M >>> 14 | L << 18) ^ (M >>> 18 | L << 14) ^ (M << 23 | L >>> 9), tb = i[T], ub = tb.high, vb = tb.low, wb = S + sb, xb = R + rb + (S >>> 0 > wb >>> 0 ? 1 : 0), wb += mb, xb = xb + lb + (mb >>> 0 > wb >>> 0 ? 1 : 0), wb += vb, xb = xb + ub + (vb >>> 0 > wb >>> 0 ? 1 : 0), wb += U, xb = xb + V + (U >>> 0 > wb >>> 0 ? 1 : 0), yb = qb + ob, zb = pb + nb + (qb >>> 0 > yb >>> 0 ? 1 : 0), R = P, S = Q, P = N, Q = O, N = L, O = M, M = 0 | K + wb, L = 0 | J + xb + (K >>> 0 > M >>> 0 ? 1 : 0), J = H, K = I, H = F, I = G, F = D, G = E, E = 0 | wb + yb, D = 0 | xb + zb + (wb >>> 0 > E >>> 0 ? 1 : 0);}o = d.low = o + E, d.high = n + D + (E >>> 0 > o >>> 0 ? 1 : 0), q = e.low = q + G, e.high = p + F + (G >>> 0 > q >>> 0 ? 1 : 0), s = f.low = s + I, f.high = r + H + (I >>> 0 > s >>> 0 ? 1 : 0), u = g.low = u + K, g.high = t + J + (K >>> 0 > u >>> 0 ? 1 : 0), w = h.low = w + M, h.high = v + L + (M >>> 0 > w >>> 0 ? 1 : 0), y = k.low = y + O, k.high = x + N + (O >>> 0 > y >>> 0 ? 1 : 0), A = l.low = A + Q, l.high = z + P + (Q >>> 0 > A >>> 0 ? 1 : 0), C = m.low = C + S, m.high = B + R + (S >>> 0 > C >>> 0 ? 1 : 0);}, _doFinalize: function _doFinalize() {var e,a = this._data,b = a.words,c = 8 * this._nDataBytes,d = 8 * a.sigBytes;return b[d >>> 5] |= 128 << 24 - d % 32, b[(d + 128 >>> 10 << 5) + 30] = Math.floor(c / 4294967296), b[(d + 128 >>> 10 << 5) + 31] = c, a.sigBytes = 4 * b.length, this._process(), e = this._hash.toX32();}, clone: function clone() {var a = c.clone.call(this);return a._hash = this._hash.clone(), a;}, blockSize: 32 }), a.SHA512 = c._createHelper(k), a.HmacSHA512 = c._createHmacHelper(k);}(), function () {var a = CryptoJS,b = a.x64,c = b.Word,d = b.WordArray,e = a.algo,f = e.SHA512,g = e.SHA384 = f.extend({ _doReset: function _doReset() {this._hash = new d.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 a = f._doFinalize.call(this);return a.sigBytes -= 16, a;} });a.SHA384 = f._createHelper(g), a.HmacSHA384 = f._createHmacHelper(g);}(), CryptoJS.lib.Cipher || function (a) {var i,j,k,l,n,o,p,q,r,t,u,v,w,x,y,z,b = CryptoJS,c = b.lib,d = c.Base,e = c.WordArray,f = c.BufferedBlockAlgorithm,g = b.enc;g.Utf8, i = g.Base64, j = b.algo, k = j.EvpKDF, l = c.Cipher = f.extend({ cfg: d.extend(), createEncryptor: function createEncryptor(a, b) {return this.create(this._ENC_XFORM_MODE, a, b);}, createDecryptor: function createDecryptor(a, b) {return this.create(this._DEC_XFORM_MODE, a, b);}, init: function init(a, b, c) {this.cfg = this.cfg.extend(c), this._xformMode = a, this._key = b, this.reset();}, reset: function reset() {f.reset.call(this), this._doReset();}, process: function process(a) {return this._append(a), this._process();}, finalize: function finalize(a) {a && this._append(a);var b = this._doFinalize();return b;}, keySize: 4, ivSize: 4, _ENC_XFORM_MODE: 1, _DEC_XFORM_MODE: 2, _createHelper: function () {function a(a) {return "string" == typeof a ? z : w;}return function (b) {return { encrypt: function encrypt(c, d, e) {return a(d).encrypt(b, c, d, e);}, decrypt: function decrypt(c, d, e) {return a(d).decrypt(b, c, d, e);} };};}() }), c.StreamCipher = l.extend({ _doFinalize: function _doFinalize() {var a = this._process(!0);return a;}, blockSize: 1 }), n = b.mode = {}, o = c.BlockCipherMode = d.extend({ createEncryptor: function createEncryptor(a, b) {return this.Encryptor.create(a, b);}, createDecryptor: function createDecryptor(a, b) {return this.Decryptor.create(a, b);}, init: function init(a, b) {this._cipher = a, this._iv = b;} }), p = n.CBC = function () {function c(b, c, d) {var e,g,f = this._iv;for (f ? (e = f, this._iv = a) : e = this._prevBlock, g = 0; d > g; g++) {b[c + g] ^= e[g];}}var b = o.extend();return b.Encryptor = b.extend({ processBlock: function processBlock(a, b) {var d = this._cipher,e = d.blockSize;c.call(this, a, b, e), d.encryptBlock(a, b), this._prevBlock = a.slice(b, b + e);} }), b.Decryptor = b.extend({ processBlock: function processBlock(a, b) {var d = this._cipher,e = d.blockSize,f = a.slice(b, b + e);d.decryptBlock(a, b), c.call(this, a, b, e), this._prevBlock = f;} }), b;}(), q = b.pad = {}, r = q.Pkcs7 = { pad: function pad(a, b) {var h,i,c = 4 * b,d = c - a.sigBytes % c,f = d << 24 | d << 16 | d << 8 | d,g = [];for (h = 0; d > h; h += 4) {g.push(f);}i = e.create(g, d), a.concat(i);}, unpad: function unpad(a) {var b = 255 & a.words[a.sigBytes - 1 >>> 2];a.sigBytes -= b;} }, c.BlockCipher = l.extend({ cfg: l.cfg.extend({ mode: p, padding: r }), reset: function reset() {var a, b, c, d;l.reset.call(this), b = this.cfg, c = b.iv, d = b.mode, this._xformMode == this._ENC_XFORM_MODE ? a = d.createEncryptor : (a = d.createDecryptor, this._minBufferSize = 1), this._mode && this._mode.__creator == a ? this._mode.init(this, c && c.words) : (this._mode = a.call(d, this, c && c.words), this._mode.__creator = a);}, _doProcessBlock: function _doProcessBlock(a, b) {this._mode.processBlock(a, b);}, _doFinalize: function _doFinalize() {var a,b = this.cfg.padding;return this._xformMode == this._ENC_XFORM_MODE ? (b.pad(this._data, this.blockSize), a = this._process(!0)) : (a = this._process(!0), b.unpad(a)), a;}, blockSize: 4 }), t = c.CipherParams = d.extend({ init: function init(a) {this.mixIn(a);}, toString: function toString(a) {return (a || this.formatter).stringify(this);} }), u = b.format = {}, v = u.OpenSSL = { stringify: function stringify(a) {var b,c = a.ciphertext,d = a.salt;return b = d ? e.create([1398893684, 1701076831]).concat(d).concat(c) : c, b.toString(i);}, parse: function parse(a) {var b,c = i.parse(a),d = c.words;return 1398893684 == d[0] && 1701076831 == d[1] && (b = e.create(d.slice(2, 4)), d.splice(0, 4), c.sigBytes -= 16), t.create({ ciphertext: c, salt: b });} }, w = c.SerializableCipher = d.extend({ cfg: d.extend({ format: v }), encrypt: function encrypt(a, b, c, d) {var e, f, g;return d = this.cfg.extend(d), e = a.createEncryptor(c, d), f = e.finalize(b), g = e.cfg, t.create({ ciphertext: f, key: c, iv: g.iv, algorithm: a, mode: g.mode, padding: g.padding, blockSize: a.blockSize, formatter: d.format });}, decrypt: function decrypt(a, b, c, d) {d = this.cfg.extend(d), b = this._parse(b, d.format);var e = a.createDecryptor(c, d).finalize(b.ciphertext);return e;}, _parse: function _parse(a, b) {return "string" == typeof a ? b.parse(a, this) : a;} }), x = b.kdf = {}, y = x.OpenSSL = { execute: function execute(a, b, c, d) {var f, g;return d || (d = e.random(8)), f = k.create({ keySize: b + c }).compute(a, d), g = e.create(f.words.slice(b), 4 * c), f.sigBytes = 4 * b, t.create({ key: f, iv: g, salt: d });} }, z = c.PasswordBasedCipher = w.extend({ cfg: w.cfg.extend({ kdf: y }), encrypt: function encrypt(a, b, c, d) {var e, f;return d = this.cfg.extend(d), e = d.kdf.execute(c, a.keySize, a.ivSize), d.iv = e.iv, f = w.encrypt.call(this, a, b, e.key, d), f.mixIn(e), f;}, decrypt: function decrypt(a, b, c, d) {var e, f;return d = this.cfg.extend(d), b = this._parse(b, d.format), e = d.kdf.execute(c, a.keySize, a.ivSize, b.salt), d.iv = e.iv, f = w.decrypt.call(this, a, b, e.key, d);} });}(), CryptoJS.mode.CFB = function () {function b(a, b, c, d) {var e,g,f = this._iv;for (f ? (e = f.slice(0), this._iv = void 0) : e = this._prevBlock, d.encryptBlock(e, 0), g = 0; c > g; g++) {a[b + g] ^= e[g];}}var a = CryptoJS.lib.BlockCipherMode.extend();return a.Encryptor = a.extend({ processBlock: function processBlock(a, c) {var d = this._cipher,e = d.blockSize;b.call(this, a, c, e, d), this._prevBlock = a.slice(c, c + e);} }), a.Decryptor = a.extend({ processBlock: function processBlock(a, c) {var d = this._cipher,e = d.blockSize,f = a.slice(c, c + e);b.call(this, a, c, e, d), this._prevBlock = f;} }), a;}(), CryptoJS.mode.ECB = function () {var a = CryptoJS.lib.BlockCipherMode.extend();return a.Encryptor = a.extend({ processBlock: function processBlock(a, b) {this._cipher.encryptBlock(a, b);} }), a.Decryptor = a.extend({ processBlock: function processBlock(a, b) {this._cipher.decryptBlock(a, b);} }), a;}(), CryptoJS.pad.AnsiX923 = { pad: function pad(a, b) {var c = a.sigBytes,d = 4 * b,e = d - c % d,f = c + e - 1;a.clamp(), a.words[f >>> 2] |= e << 24 - 8 * (f % 4), a.sigBytes += e;}, unpad: function unpad(a) {var b = 255 & a.words[a.sigBytes - 1 >>> 2];a.sigBytes -= b;} }, CryptoJS.pad.Iso10126 = { pad: function pad(a, b) {var c = 4 * b,d = c - a.sigBytes % c;a.concat(CryptoJS.lib.WordArray.random(d - 1)).concat(CryptoJS.lib.WordArray.create([d << 24], 1));}, unpad: function unpad(a) {var b = 255 & a.words[a.sigBytes - 1 >>> 2];a.sigBytes -= b;} }, CryptoJS.pad.Iso97971 = { pad: function pad(a, b) {a.concat(CryptoJS.lib.WordArray.create([2147483648], 1)), CryptoJS.pad.ZeroPadding.pad(a, b);}, unpad: function unpad(a) {CryptoJS.pad.ZeroPadding.unpad(a), a.sigBytes--;} }, CryptoJS.mode.OFB = function () {var a = CryptoJS.lib.BlockCipherMode.extend(),b = a.Encryptor = a.extend({ processBlock: function processBlock(a, b) {var g,c = this._cipher,d = c.blockSize,e = this._iv,f = this._keystream;for (e && (f = this._keystream = e.slice(0), this._iv = void 0), c.encryptBlock(f, 0), g = 0; d > g; g++) {a[b + g] ^= f[g];}} });return a.Decryptor = b, a;}(), CryptoJS.pad.NoPadding = { pad: function pad() {}, unpad: function unpad() {} }, function () {var b = CryptoJS,c = b.lib,d = c.CipherParams,e = b.enc,f = e.Hex,g = b.format;g.Hex = { stringify: function stringify(a) {return a.ciphertext.toString(f);}, parse: function parse(a) {var b = f.parse(a);return d.create({ ciphertext: b });} };}(), function () {var o,p,a = CryptoJS,b = a.lib,c = b.BlockCipher,d = a.algo,e = [],f = [],g = [],h = [],i = [],j = [],k = [],l = [],m = [],n = [];!function () {var b,c,d,o,p,q,r,s,a = [];for (b = 0; 256 > b; b++) {a[b] = 128 > b ? b << 1 : 283 ^ b << 1;}for (c = 0, d = 0, b = 0; 256 > b; b++) {o = d ^ d << 1 ^ d << 2 ^ d << 3 ^ d << 4, o = 99 ^ (o >>> 8 ^ 255 & o), e[c] = o, f[o] = c, p = a[c], q = a[p], r = a[q], s = 257 * a[o] ^ 16843008 * o, g[c] = s << 24 | s >>> 8, h[c] = s << 16 | s >>> 16, i[c] = s << 8 | s >>> 24, j[c] = s, s = 16843009 * r ^ 65537 * q ^ 257 * p ^ 16843008 * c, k[o] = s << 24 | s >>> 8, l[o] = s << 16 | s >>> 16, m[o] = s << 8 | s >>> 24, n[o] = s, c ? (c = p ^ a[a[a[r ^ p]]], d ^= a[a[d]]) : c = d = 1;}}(), o = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54], p = d.AES = c.extend({ _doReset: function _doReset() {var a, b, c, d, f, g, h, i, j, p;if (!this._nRounds || this._keyPriorReset !== this._key) {for (b = this._keyPriorReset = this._key, c = b.words, d = b.sigBytes / 4, f = this._nRounds = d + 6, g = 4 * (f + 1), h = this._keySchedule = [], i = 0; g > i; i++) {d > i ? h[i] = c[i] : (a = h[i - 1], i % d ? d > 6 && 4 == i % d && (a = e[a >>> 24] << 24 | e[255 & a >>> 16] << 16 | e[255 & a >>> 8] << 8 | e[255 & a]) : (a = a << 8 | a >>> 24, a = e[a >>> 24] << 24 | e[255 & a >>> 16] << 16 | e[255 & a >>> 8] << 8 | e[255 & a], a ^= o[0 | i / d] << 24), h[i] = h[i - d] ^ a);}for (j = this._invKeySchedule = [], p = 0; g > p; p++) {i = g - p, a = p % 4 ? h[i] : h[i - 4], j[p] = 4 > p || 4 >= i ? a : k[e[a >>> 24]] ^ l[e[255 & a >>> 16]] ^ m[e[255 & a >>> 8]] ^ n[e[255 & a]];}}}, encryptBlock: function encryptBlock(a, b) {this._doCryptBlock(a, b, this._keySchedule, g, h, i, j, e);}, decryptBlock: function decryptBlock(a, b) {var c = a[b + 1];a[b + 1] = a[b + 3], a[b + 3] = c, this._doCryptBlock(a, b, this._invKeySchedule, k, l, m, n, f), c = a[b + 1], a[b + 1] = a[b + 3], a[b + 3] = c;}, _doCryptBlock: function _doCryptBlock(a, b, c, d, e, f, g, h) {var o,p,q,r,s,i = this._nRounds,j = a[b] ^ c[0],k = a[b + 1] ^ c[1],l = a[b + 2] ^ c[2],m = a[b + 3] ^ c[3],n = 4;for (o = 1; i > o; o++) {p = d[j >>> 24] ^ e[255 & k >>> 16] ^ f[255 & l >>> 8] ^ g[255 & m] ^ c[n++], q = d[k >>> 24] ^ e[255 & l >>> 16] ^ f[255 & m >>> 8] ^ g[255 & j] ^ c[n++], r = d[l >>> 24] ^ e[255 & m >>> 16] ^ f[255 & j >>> 8] ^ g[255 & k] ^ c[n++], s = d[m >>> 24] ^ e[255 & j >>> 16] ^ f[255 & k >>> 8] ^ g[255 & l] ^ c[n++], j = p, k = q, l = r, m = s;}p = (h[j >>> 24] << 24 | h[255 & k >>> 16] << 16 | h[255 & l >>> 8] << 8 | h[255 & m]) ^ c[n++], q = (h[k >>> 24] << 24 | h[255 & l >>> 16] << 16 | h[255 & m >>> 8] << 8 | h[255 & j]) ^ c[n++], r = (h[l >>> 24] << 24 | h[255 & m >>> 16] << 16 | h[255 & j >>> 8] << 8 | h[255 & k]) ^ c[n++], s = (h[m >>> 24] << 24 | h[255 & j >>> 16] << 16 | h[255 & k >>> 8] << 8 | h[255 & l]) ^ c[n++], a[b] = p, a[b + 1] = q, a[b + 2] = r, a[b + 3] = s;
  10179. }, keySize: 8 }), a.AES = c._createHelper(p);}(), function () {function l(a, b) {var c = (this._lBlock >>> a ^ this._rBlock) & b;this._rBlock ^= c, this._lBlock ^= c << a;}function m(a, b) {var c = (this._rBlock >>> a ^ this._lBlock) & b;this._lBlock ^= c, this._rBlock ^= c << a;}var n,a = CryptoJS,b = a.lib,c = b.WordArray,d = b.BlockCipher,e = a.algo,f = [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],g = [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],h = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28],i = [{ 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 }],j = [4160749569, 528482304, 33030144, 2064384, 129024, 8064, 504, 2147483679],k = e.DES = d.extend({ _doReset: function _doReset() {var d,e,i,j,k,l,m,a = this._key,b = a.words,c = [];for (d = 0; 56 > d; d++) {e = f[d] - 1, c[d] = 1 & b[e >>> 5] >>> 31 - e % 32;}for (i = this._subKeys = [], j = 0; 16 > j; j++) {for (k = i[j] = [], l = h[j], d = 0; 24 > d; d++) {k[0 | d / 6] |= c[(g[d] - 1 + l) % 28] << 31 - d % 6, k[4 + (0 | d / 6)] |= c[28 + (g[d + 24] - 1 + l) % 28] << 31 - d % 6;}for (k[0] = k[0] << 1 | k[0] >>> 31, d = 1; 7 > d; d++) {k[d] = k[d] >>> 4 * (d - 1) + 3;}k[7] = k[7] << 5 | k[7] >>> 27;}for (m = this._invSubKeys = [], d = 0; 16 > d; d++) {m[d] = i[15 - d];}}, encryptBlock: function encryptBlock(a, b) {this._doCryptBlock(a, b, this._subKeys);}, decryptBlock: function decryptBlock(a, b) {this._doCryptBlock(a, b, this._invSubKeys);}, _doCryptBlock: function _doCryptBlock(a, b, c) {var d, e, f, g, h, k, n;for (this._lBlock = a[b], this._rBlock = a[b + 1], l.call(this, 4, 252645135), l.call(this, 16, 65535), m.call(this, 2, 858993459), m.call(this, 8, 16711935), l.call(this, 1, 1431655765), d = 0; 16 > d; d++) {for (e = c[d], f = this._lBlock, g = this._rBlock, h = 0, k = 0; 8 > k; k++) {h |= i[k][((g ^ e[k]) & j[k]) >>> 0];}this._lBlock = g, this._rBlock = f ^ h;}n = this._lBlock, this._lBlock = this._rBlock, this._rBlock = n, l.call(this, 1, 1431655765), m.call(this, 8, 16711935), m.call(this, 2, 858993459), l.call(this, 16, 65535), l.call(this, 4, 252645135), a[b] = this._lBlock, a[b + 1] = this._rBlock;}, keySize: 2, ivSize: 2, blockSize: 2 });a.DES = d._createHelper(k), n = e.TripleDES = d.extend({ _doReset: function _doReset() {var d,e,f,a = this._key,b = a.words;if (2 !== b.length && 4 !== b.length && b.length < 6) throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");d = b.slice(0, 2), e = b.length < 4 ? b.slice(0, 2) : b.slice(2, 4), f = b.length < 6 ? b.slice(0, 2) : b.slice(4, 6), this._des1 = k.createEncryptor(c.create(d)), this._des2 = k.createEncryptor(c.create(e)), this._des3 = k.createEncryptor(c.create(f));}, encryptBlock: function encryptBlock(a, b) {this._des1.encryptBlock(a, b), this._des2.decryptBlock(a, b), this._des3.encryptBlock(a, b);}, decryptBlock: function decryptBlock(a, b) {this._des3.decryptBlock(a, b), this._des2.encryptBlock(a, b), this._des1.decryptBlock(a, b);}, keySize: 6, ivSize: 2, blockSize: 2 }), a.TripleDES = d._createHelper(n);}(), function () {function f() {var e,f,a = this._S,b = this._i,c = this._j,d = 0;for (e = 0; 4 > e; e++) {b = (b + 1) % 256, c = (c + a[b]) % 256, f = a[b], a[b] = a[c], a[c] = f, d |= a[(a[b] + a[c]) % 256] << 24 - 8 * e;}return this._i = b, this._j = c, d;}var g,a = CryptoJS,b = a.lib,c = b.StreamCipher,d = a.algo,e = d.RC4 = c.extend({ _doReset: function _doReset() {var e,f,g,h,i,a = this._key,b = a.words,c = a.sigBytes,d = this._S = [];for (e = 0; 256 > e; e++) {d[e] = e;}for (e = 0, f = 0; 256 > e; e++) {g = e % c, h = 255 & b[g >>> 2] >>> 24 - 8 * (g % 4), f = (f + d[e] + h) % 256, i = d[e], d[e] = d[f], d[f] = i;}this._i = this._j = 0;}, _doProcessBlock: function _doProcessBlock(a, b) {a[b] ^= f.call(this);}, keySize: 8, ivSize: 0 });a.RC4 = c._createHelper(e), g = d.RC4Drop = e.extend({ cfg: e.cfg.extend({ drop: 192 }), _doReset: function _doReset() {e._doReset.call(this);for (var a = this.cfg.drop; a > 0; a--) {f.call(this);}} }), a.RC4Drop = c._createHelper(g);}(), CryptoJS.mode.CTRGladman = function () {function b(a) {var b, c, d;return 255 === (255 & a >> 24) ? (b = 255 & a >> 16, c = 255 & a >> 8, d = 255 & a, 255 === b ? (b = 0, 255 === c ? (c = 0, 255 === d ? d = 0 : ++d) : ++c) : ++b, a = 0, a += b << 16, a += c << 8, a += d) : a += 1 << 24, a;}function c(a) {return 0 === (a[0] = b(a[0])) && (a[1] = b(a[1])), a;}var a = CryptoJS.lib.BlockCipherMode.extend(),d = a.Encryptor = a.extend({ processBlock: function processBlock(a, b) {var h,i,d = this._cipher,e = d.blockSize,f = this._iv,g = this._counter;for (f && (g = this._counter = f.slice(0), this._iv = void 0), c(g), h = g.slice(0), d.encryptBlock(h, 0), i = 0; e > i; i++) {a[b + i] ^= h[i];}} });return a.Decryptor = d, a;}(), function () {function i() {var c,d,e,h,i,j,a = this._X,b = this._C;for (c = 0; 8 > c; c++) {f[c] = b[c];}for (b[0] = 0 | b[0] + 1295307597 + this._b, b[1] = 0 | b[1] + 3545052371 + (b[0] >>> 0 < f[0] >>> 0 ? 1 : 0), b[2] = 0 | b[2] + 886263092 + (b[1] >>> 0 < f[1] >>> 0 ? 1 : 0), b[3] = 0 | b[3] + 1295307597 + (b[2] >>> 0 < f[2] >>> 0 ? 1 : 0), b[4] = 0 | b[4] + 3545052371 + (b[3] >>> 0 < f[3] >>> 0 ? 1 : 0), b[5] = 0 | b[5] + 886263092 + (b[4] >>> 0 < f[4] >>> 0 ? 1 : 0), b[6] = 0 | b[6] + 1295307597 + (b[5] >>> 0 < f[5] >>> 0 ? 1 : 0), b[7] = 0 | b[7] + 3545052371 + (b[6] >>> 0 < f[6] >>> 0 ? 1 : 0), this._b = b[7] >>> 0 < f[7] >>> 0 ? 1 : 0, c = 0; 8 > c; c++) {d = a[c] + b[c], e = 65535 & d, h = d >>> 16, i = ((e * e >>> 17) + e * h >>> 15) + h * h, j = (0 | (4294901760 & d) * d) + (0 | (65535 & d) * d), g[c] = i ^ j;}a[0] = 0 | g[0] + (g[7] << 16 | g[7] >>> 16) + (g[6] << 16 | g[6] >>> 16), a[1] = 0 | g[1] + (g[0] << 8 | g[0] >>> 24) + g[7], a[2] = 0 | g[2] + (g[1] << 16 | g[1] >>> 16) + (g[0] << 16 | g[0] >>> 16), a[3] = 0 | g[3] + (g[2] << 8 | g[2] >>> 24) + g[1], a[4] = 0 | g[4] + (g[3] << 16 | g[3] >>> 16) + (g[2] << 16 | g[2] >>> 16), a[5] = 0 | g[5] + (g[4] << 8 | g[4] >>> 24) + g[3], a[6] = 0 | g[6] + (g[5] << 16 | g[5] >>> 16) + (g[4] << 16 | g[4] >>> 16), a[7] = 0 | g[7] + (g[6] << 8 | g[6] >>> 24) + g[5];}var a = CryptoJS,b = a.lib,c = b.StreamCipher,d = a.algo,e = [],f = [],g = [],h = d.Rabbit = c.extend({ _doReset: function _doReset() {var c,d,e,f,g,h,j,k,l,m,a = this._key.words,b = this.cfg.iv;for (c = 0; 4 > c; c++) {a[c] = 16711935 & (a[c] << 8 | a[c] >>> 24) | 4278255360 & (a[c] << 24 | a[c] >>> 8);}for (d = this._X = [a[0], a[3] << 16 | a[2] >>> 16, a[1], a[0] << 16 | a[3] >>> 16, a[2], a[1] << 16 | a[0] >>> 16, a[3], a[2] << 16 | a[1] >>> 16], e = this._C = [a[2] << 16 | a[2] >>> 16, 4294901760 & a[0] | 65535 & a[1], a[3] << 16 | a[3] >>> 16, 4294901760 & a[1] | 65535 & a[2], a[0] << 16 | a[0] >>> 16, 4294901760 & a[2] | 65535 & a[3], a[1] << 16 | a[1] >>> 16, 4294901760 & a[3] | 65535 & a[0]], this._b = 0, c = 0; 4 > c; c++) {i.call(this);}for (c = 0; 8 > c; c++) {e[c] ^= d[7 & c + 4];}if (b) for (f = b.words, g = f[0], h = f[1], j = 16711935 & (g << 8 | g >>> 24) | 4278255360 & (g << 24 | g >>> 8), k = 16711935 & (h << 8 | h >>> 24) | 4278255360 & (h << 24 | h >>> 8), l = j >>> 16 | 4294901760 & k, m = k << 16 | 65535 & j, e[0] ^= j, e[1] ^= l, e[2] ^= k, e[3] ^= m, e[4] ^= j, e[5] ^= l, e[6] ^= k, e[7] ^= m, c = 0; 4 > c; c++) {i.call(this);}}, _doProcessBlock: function _doProcessBlock(a, b) {var d,c = this._X;for (i.call(this), e[0] = c[0] ^ c[5] >>> 16 ^ c[3] << 16, e[1] = c[2] ^ c[7] >>> 16 ^ c[5] << 16, e[2] = c[4] ^ c[1] >>> 16 ^ c[7] << 16, e[3] = c[6] ^ c[3] >>> 16 ^ c[1] << 16, d = 0; 4 > d; d++) {e[d] = 16711935 & (e[d] << 8 | e[d] >>> 24) | 4278255360 & (e[d] << 24 | e[d] >>> 8), a[b + d] ^= e[d];}}, blockSize: 4, ivSize: 2 });a.Rabbit = c._createHelper(h);}(), CryptoJS.mode.CTR = function () {var a = CryptoJS.lib.BlockCipherMode.extend(),b = a.Encryptor = a.extend({ processBlock: function processBlock(a, b) {var g,h,c = this._cipher,d = c.blockSize,e = this._iv,f = this._counter;for (e && (f = this._counter = e.slice(0), this._iv = void 0), g = f.slice(0), c.encryptBlock(g, 0), f[d - 1] = 0 | f[d - 1] + 1, h = 0; d > h; h++) {a[b + h] ^= g[h];}} });return a.Decryptor = b, a;}(), function () {function i() {var c,d,e,h,i,j,a = this._X,b = this._C;for (c = 0; 8 > c; c++) {f[c] = b[c];}for (b[0] = 0 | b[0] + 1295307597 + this._b, b[1] = 0 | b[1] + 3545052371 + (b[0] >>> 0 < f[0] >>> 0 ? 1 : 0), b[2] = 0 | b[2] + 886263092 + (b[1] >>> 0 < f[1] >>> 0 ? 1 : 0), b[3] = 0 | b[3] + 1295307597 + (b[2] >>> 0 < f[2] >>> 0 ? 1 : 0), b[4] = 0 | b[4] + 3545052371 + (b[3] >>> 0 < f[3] >>> 0 ? 1 : 0), b[5] = 0 | b[5] + 886263092 + (b[4] >>> 0 < f[4] >>> 0 ? 1 : 0), b[6] = 0 | b[6] + 1295307597 + (b[5] >>> 0 < f[5] >>> 0 ? 1 : 0), b[7] = 0 | b[7] + 3545052371 + (b[6] >>> 0 < f[6] >>> 0 ? 1 : 0), this._b = b[7] >>> 0 < f[7] >>> 0 ? 1 : 0, c = 0; 8 > c; c++) {d = a[c] + b[c], e = 65535 & d, h = d >>> 16, i = ((e * e >>> 17) + e * h >>> 15) + h * h, j = (0 | (4294901760 & d) * d) + (0 | (65535 & d) * d), g[c] = i ^ j;}a[0] = 0 | g[0] + (g[7] << 16 | g[7] >>> 16) + (g[6] << 16 | g[6] >>> 16), a[1] = 0 | g[1] + (g[0] << 8 | g[0] >>> 24) + g[7], a[2] = 0 | g[2] + (g[1] << 16 | g[1] >>> 16) + (g[0] << 16 | g[0] >>> 16), a[3] = 0 | g[3] + (g[2] << 8 | g[2] >>> 24) + g[1], a[4] = 0 | g[4] + (g[3] << 16 | g[3] >>> 16) + (g[2] << 16 | g[2] >>> 16), a[5] = 0 | g[5] + (g[4] << 8 | g[4] >>> 24) + g[3], a[6] = 0 | g[6] + (g[5] << 16 | g[5] >>> 16) + (g[4] << 16 | g[4] >>> 16), a[7] = 0 | g[7] + (g[6] << 8 | g[6] >>> 24) + g[5];}var a = CryptoJS,b = a.lib,c = b.StreamCipher,d = a.algo,e = [],f = [],g = [],h = d.RabbitLegacy = c.extend({ _doReset: function _doReset() {var e,f,g,h,j,k,l,m,a = this._key.words,b = this.cfg.iv,c = this._X = [a[0], a[3] << 16 | a[2] >>> 16, a[1], a[0] << 16 | a[3] >>> 16, a[2], a[1] << 16 | a[0] >>> 16, a[3], a[2] << 16 | a[1] >>> 16],d = this._C = [a[2] << 16 | a[2] >>> 16, 4294901760 & a[0] | 65535 & a[1], a[3] << 16 | a[3] >>> 16, 4294901760 & a[1] | 65535 & a[2], a[0] << 16 | a[0] >>> 16, 4294901760 & a[2] | 65535 & a[3], a[1] << 16 | a[1] >>> 16, 4294901760 & a[3] | 65535 & a[0]];for (this._b = 0, e = 0; 4 > e; e++) {i.call(this);}for (e = 0; 8 > e; e++) {d[e] ^= c[7 & e + 4];}if (b) for (f = b.words, g = f[0], h = f[1], j = 16711935 & (g << 8 | g >>> 24) | 4278255360 & (g << 24 | g >>> 8), k = 16711935 & (h << 8 | h >>> 24) | 4278255360 & (h << 24 | h >>> 8), l = j >>> 16 | 4294901760 & k, m = k << 16 | 65535 & j, d[0] ^= j, d[1] ^= l, d[2] ^= k, d[3] ^= m, d[4] ^= j, d[5] ^= l, d[6] ^= k, d[7] ^= m, e = 0; 4 > e; e++) {i.call(this);}}, _doProcessBlock: function _doProcessBlock(a, b) {var d,c = this._X;for (i.call(this), e[0] = c[0] ^ c[5] >>> 16 ^ c[3] << 16, e[1] = c[2] ^ c[7] >>> 16 ^ c[5] << 16, e[2] = c[4] ^ c[1] >>> 16 ^ c[7] << 16, e[3] = c[6] ^ c[3] >>> 16 ^ c[1] << 16, d = 0; 4 > d; d++) {e[d] = 16711935 & (e[d] << 8 | e[d] >>> 24) | 4278255360 & (e[d] << 24 | e[d] >>> 8), a[b + d] ^= e[d];}}, blockSize: 4, ivSize: 2 });a.RabbitLegacy = c._createHelper(h);}(), CryptoJS.pad.ZeroPadding = { pad: function pad(a, b) {var c = 4 * b;a.clamp(), a.sigBytes += c - (a.sigBytes % c || c);}, unpad: function unpad(a) {var b = a.words,c = a.sigBytes - 1;for (c = a.sigBytes - 1; c >= 0; c--) {if (255 & b[c >>> 2] >>> 24 - 8 * (c % 4)) {a.sigBytes = c + 1;break;}}} };try {} catch (e) {}!function (a, b) { true ? b(exports) : undefined;}(this, function (a) {"use strict";function c(a) {return b.charAt(a);}function d(a, b) {return a & b;}function e(a, b) {return a | b;}function f(a, b) {return a ^ b;}function g(a, b) {return a & ~b;}function h(a) {if (0 == a) return -1;var b = 0;return 0 == (65535 & a) && (a >>= 16, b += 16), 0 == (255 & a) && (a >>= 8, b += 8), 0 == (15 & a) && (a >>= 4, b += 4), 0 == (3 & a) && (a >>= 2, b += 2), 0 == (1 & a) && ++b, b;}function i(a) {for (var b = 0; 0 != a;) {a &= a - 1, ++b;}return b;}function l(a) {var b,c,d = "";for (b = 0; b + 3 <= a.length; b += 3) {c = parseInt(a.substring(b, b + 3), 16), d += j.charAt(c >> 6) + j.charAt(63 & c);}for (b + 1 == a.length ? (c = parseInt(a.substring(b, b + 1), 16), d += j.charAt(c << 2)) : b + 2 == a.length && (c = parseInt(a.substring(b, b + 2), 16), d += j.charAt(c >> 2) + j.charAt((3 & c) << 4)); (3 & d.length) > 0;) {d += k;}return d;}function m(a) {var d,g,b = "",e = 0,f = 0;for (d = 0; d < a.length && a.charAt(d) != k; ++d) {g = j.indexOf(a.charAt(d)), 0 > g || (0 == e ? (b += c(g >> 2), f = 3 & g, e = 1) : 1 == e ? (b += c(f << 2 | g >> 4), f = 15 & g, e = 2) : 2 == e ? (b += c(f), b += c(g >> 2), f = 3 & g, e = 3) : (b += c(f << 2 | g >> 4), b += c(15 & g), e = 0));}return 1 == e && (b += c(f << 2)), b;}function o(a, b) {function c() {this.constructor = a;}_n(a, b), a.prototype = null === b ? Object.create(b) : (c.prototype = b.prototype, new c());}function y(a, b) {return a.length > b && (a = a.substring(0, b) + v), a;}function M() {return new H(null);}function N(a, b) {return new H(a, b);}function Q(a, b, c, d, e, f) {for (var i, j, k, g = 16383 & b, h = b >> 14; --f >= 0;) {i = 16383 & this[a], j = this[a++] >> 14, k = h * i + j * g, i = g * i + ((16383 & k) << 14) + c[d] + e, e = (i >> 28) + (k >> 14) + h * j, c[d++] = 268435455 & i;}return e;}function V(a, b) {var c = S[a.charCodeAt(b)];return null == c ? -1 : c;}function W(a) {var b = M();return b.fromInt(a), b;}function X(a) {var c,b = 1;return 0 != (c = a >>> 16) && (a = c, b += 16), 0 != (c = a >> 8) && (a = c, b += 8), 0 != (c = a >> 4) && (a = c, b += 4), 0 != (c = a >> 2) && (a = c, b += 2), 0 != (c = a >> 1) && (a = c, b += 1), b;}function Z() {return new Y();}function fb() {if (null == _) {for (_ = Z(); $ > bb;) {var a = Math.floor(65536 * Math.random());ab[bb++] = 255 & a;}for (_.init(ab), bb = 0; bb < ab.length; ++bb) {ab[bb] = 0;}bb = 0;}return _.next();}function hb(a, b) {var c, d, e, f;if (b < a.length + 22) return console.error("Message too long for RSA"), null;for (c = b - a.length - 6, d = "", e = 0; c > e; e += 2) {d += "ff";}return f = "0001" + d + "00" + a, N(f, 16);}function ib(a, b) {var c, d, e, f, g;if (b < a.length + 11) return console.error("Message too long for RSA"), null;for (c = [], d = a.length - 1; d >= 0 && b > 0;) {e = a.charCodeAt(d--), 128 > e ? c[--b] = e : e > 127 && 2048 > e ? (c[--b] = 128 | 63 & e, c[--b] = 192 | e >> 6) : (c[--b] = 128 | 63 & e, c[--b] = 128 | 63 & e >> 6, c[--b] = 224 | e >> 12);}for (c[--b] = 0, f = new gb(), g = []; b > 2;) {for (g[0] = 0; 0 == g[0];) {f.nextBytes(g);}c[--b] = g[0];}return c[--b] = 2, c[--b] = 0, new H(c);}function kb(a, b) {for (var e, f, c = a.toByteArray(), d = 0; d < c.length && 0 == c[d];) {++d;}if (c.length - d != b - 1 || 2 != c[d]) return null;for (++d; 0 != c[d];) {if (++d >= c.length) return null;}for (e = ""; ++d < c.length;) {f = 255 & c[d], 128 > f ? e += String.fromCharCode(f) : f > 191 && 224 > f ? (e += String.fromCharCode((31 & f) << 6 | 63 & c[d + 1]), ++d) : (e += String.fromCharCode((15 & f) << 12 | (63 & c[d + 1]) << 6 | 63 & c[d + 2]), d += 2);}return e;}function mb(a) {return lb[a] || "";}function nb(a) {var b, c, d;for (b in lb) {if (lb.hasOwnProperty(b) && (c = lb[b], d = c.length, a.substr(0, d) == c)) return a.substr(d);}return a;}var p,r,C,R,S,T,U,Y,$,_,ab,bb,cb,db,gb,jb,lb,ob,pb,qb,rb,b = "0123456789abcdefghijklmnopqrstuvwxyz",j = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",k = "=",_n = function n(a, b) {return _n = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (a, b) {a.__proto__ = b;} || function (a, b) {for (var c in b) {b.hasOwnProperty(c) && (a[c] = b[c]);}}, _n(a, b);},q = { decode: function decode(a) {var b, c, d, e, f, g, h;if (void 0 === p) {for (c = "0123456789ABCDEF", d = " \f\n\r\t\xA0\u2028\u2029", p = {}, b = 0; 16 > b; ++b) {p[c.charAt(b)] = b;}for (c = c.toLowerCase(), b = 10; 16 > b; ++b) {p[c.charAt(b)] = b;}for (b = 0; b < d.length; ++b) {p[d.charAt(b)] = -1;}}for (e = [], f = 0, g = 0, b = 0; b < a.length && (h = a.charAt(b), "=" != h); ++b) {if (h = p[h], -1 != h) {if (void 0 === h) throw new Error("Illegal character at offset " + b);f |= h, ++g >= 2 ? (e[e.length] = f, f = 0, g = 0) : f <<= 4;}}if (g) throw new Error("Hex encoding incomplete: 4 bits missing");return e;} },s = { decode: function decode(a) {var b, c, d, e, f, g, h;if (void 0 === r) {for (c = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", d = "= \f\n\r\t\xA0\u2028\u2029", r = Object.create(null), b = 0; 64 > b; ++b) {r[c.charAt(b)] = b;}for (b = 0; b < d.length; ++b) {r[d.charAt(b)] = -1;}}for (e = [], f = 0, g = 0, b = 0; b < a.length && (h = a.charAt(b), "=" != h); ++b) {if (h = r[h], -1 != h) {if (void 0 === h) throw new Error("Illegal character at offset " + b);f |= h, ++g >= 4 ? (e[e.length] = f >> 16, e[e.length] = 255 & f >> 8, e[e.length] = 255 & f, f = 0, g = 0) : f <<= 6;}}switch (g) {case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:e[e.length] = f >> 10;break;case 3:e[e.length] = f >> 16, e[e.length] = 255 & f >> 8;}return e;}, re: /-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/, unarmor: function unarmor(a) {var b = s.re.exec(a);if (b) if (b[1]) a = b[1];else {if (!b[2]) throw new Error("RegExp out of sync");a = b[2];}return s.decode(a);} },t = 1e13,u = function () {function a(a) {this.buf = [+a || 0];}return a.prototype.mulAdd = function (a, b) {var e,f,c = this.buf,d = c.length;for (e = 0; d > e; ++e) {f = c[e] * a + b, t > f ? b = 0 : (b = 0 | f / t, f -= b * t), c[e] = f;}b > 0 && (c[e] = b);}, a.prototype.sub = function (a) {var d,e,b = this.buf,c = b.length;for (d = 0; c > d; ++d) {e = b[d] - a, 0 > e ? (e += t, a = 1) : a = 0, b[d] = e;}for (; 0 === b[b.length - 1];) {b.pop();}}, a.prototype.toString = function (a) {var b, c, d;if (10 != (a || 10)) throw new Error("only base 10 is supported");for (b = this.buf, c = b[b.length - 1].toString(), d = b.length - 2; d >= 0; --d) {c += (t + b[d]).toString().substring(1);}return c;}, a.prototype.valueOf = function () {var c,a = this.buf,b = 0;for (c = a.length - 1; c >= 0; --c) {b = b * t + a[c];}return b;}, a.prototype.simplify = function () {var a = this.buf;return 1 == a.length ? a[0] : this;}, a;}(),v = "…",w = /^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,x = /^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,z = function () {function a(b, c) {this.hexDigits = "0123456789ABCDEF", b instanceof a ? (this.enc = b.enc, this.pos = b.pos) : (this.enc = b, this.pos = c);}return a.prototype.get = function (a) {if (void 0 === a && (a = this.pos++), a >= this.enc.length) throw new Error("Requesting byte offset " + a + " on a stream of length " + this.enc.length);return "string" == typeof this.enc ? this.enc.charCodeAt(a) : this.enc[a];}, a.prototype.hexByte = function (a) {return this.hexDigits.charAt(15 & a >> 4) + this.hexDigits.charAt(15 & a);}, a.prototype.hexDump = function (a, b, c) {var e,d = "";for (e = a; b > e; ++e) {if (d += this.hexByte(this.get(e)), c !== !0) switch (15 & e) {case 7:d += " ";break;case 15:d += "\n";break;default:d += " ";}}return d;}, a.prototype.isASCII = function (a, b) {var c, d;for (c = a; b > c; ++c) {if (d = this.get(c), 32 > d || d > 176) return !1;}return !0;}, a.prototype.parseStringISO = function (a, b) {var d,c = "";for (d = a; b > d; ++d) {c += String.fromCharCode(this.get(d));}return c;}, a.prototype.parseStringUTF = function (a, b) {var d,e,c = "";for (d = a; b > d;) {e = this.get(d++), c += 128 > e ? String.fromCharCode(e) : e > 191 && 224 > e ? String.fromCharCode((31 & e) << 6 | 63 & this.get(d++)) : String.fromCharCode((15 & e) << 12 | (63 & this.get(d++)) << 6 | 63 & this.get(d++));}return c;}, a.prototype.parseStringBMP = function (a, b) {var d,e,f,c = "";for (f = a; b > f;) {d = this.get(f++), e = this.get(f++), c += String.fromCharCode(d << 8 | e);}return c;}, a.prototype.parseTime = function (a, b, c) {var d = this.parseStringISO(a, b),e = (c ? w : x).exec(d);return e ? (c && (e[1] = +e[1], e[1] += +e[1] < 70 ? 2e3 : 1900), d = e[1] + "-" + e[2] + "-" + e[3] + " " + e[4], e[5] && (d += ":" + e[5], e[6] && (d += ":" + e[6], e[7] && (d += "." + e[7]))), e[8] && (d += " UTC", "Z" != e[8] && (d += e[8], e[9] && (d += ":" + e[9]))), d) : "Unrecognized time: " + d;}, a.prototype.parseInteger = function (a, b) {for (var f, h, i, c = this.get(a), d = c > 127, e = d ? 255 : 0, g = ""; c == e && ++a < b;) {c = this.get(a);}if (f = b - a, 0 === f) return d ? -1 : 0;if (f > 4) {for (g = c, f <<= 3; 0 == (128 & (+g ^ e));) {g = +g << 1, --f;}g = "(" + f + " bit)\n";}for (d && (c -= 256), h = new u(c), i = a + 1; b > i; ++i) {h.mulAdd(256, this.get(i));}return g + h.toString();}, a.prototype.parseBitString = function (a, b, c) {var h,i,j,k,d = this.get(a),e = (b - a - 1 << 3) - d,f = "(" + e + " bit)\n",g = "";for (h = a + 1; b > h; ++h) {for (i = this.get(h), j = h == b - 1 ? d : 0, k = 7; k >= j; --k) {g += 1 & i >> k ? "1" : "0";}if (g.length > c) return f + y(g, c);}return f + g;}, a.prototype.parseOctetString = function (a, b, c) {var d, e, f;if (this.isASCII(a, b)) return y(this.parseStringISO(a, b), c);for (d = b - a, e = "(" + d + " byte)\n", c /= 2, d > c && (b = a + c), f = a; b > f; ++f) {e += this.hexByte(this.get(f));}return d > c && (e += v), e;}, a.prototype.parseOID = function (a, b, c) {var g,h,i,d = "",e = new u(),f = 0;for (g = a; b > g; ++g) {if (h = this.get(g), e.mulAdd(128, 127 & h), f += 7, !(128 & h)) {if ("" === d ? (e = e.simplify(), e instanceof u ? (e.sub(80), d = "2." + e.toString()) : (i = 80 > e ? 40 > e ? 0 : 1 : 2, d = i + "." + (e - 40 * i))) : d += "." + e.toString(), d.length > c) return y(d, c);e = new u(), f = 0;}}return f > 0 && (d += ".incomplete"), d;}, a;}(),A = function () {function a(a, b, c, d, e) {if (!(d instanceof B)) throw new Error("Invalid tag value.");this.stream = a, this.header = b, this.length = c, this.tag = d, this.sub = e;}return a.prototype.typeName = function () {switch (this.tag.tagClass) {case 0:switch (this.tag.tagNumber) {case 0:return "EOC";case 1:return "BOOLEAN";case 2:return "INTEGER";case 3:return "BIT_STRING";case 4:return "OCTET_STRING";case 5:return "NULL";case 6:return "OBJECT_IDENTIFIER";case 7:return "ObjectDescriptor";case 8:return "EXTERNAL";case 9:return "REAL";case 10:return "ENUMERATED";case 11:return "EMBEDDED_PDV";case 12:return "UTF8String";case 16:return "SEQUENCE";case 17:return "SET";case 18:return "NumericString";case 19:return "PrintableString";case 20:return "TeletexString";case 21:return "VideotexString";case 22:return "IA5String";case 23:return "UTCTime";case 24:return "GeneralizedTime";case 25:return "GraphicString";case 26:return "VisibleString";case 27:return "GeneralString";case 28:return "UniversalString";case 30:return "BMPString";}return "Universal_" + this.tag.tagNumber.toString();case 1:return "Application_" + this.tag.tagNumber.toString();case 2:return "[" + this.tag.tagNumber.toString() + "]";case 3:return "Private_" + this.tag.tagNumber.toString();}}, a.prototype.content = function (a) {var b, c;if (void 0 === this.tag) return null;if (void 0 === a && (a = 1 / 0), b = this.posContent(), c = Math.abs(this.length), !this.tag.isUniversal()) return null !== this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseOctetString(b, b + c, a);switch (this.tag.tagNumber) {case 1:return 0 === this.stream.get(b) ? "false" : "true";case 2:return this.stream.parseInteger(b, b + c);case 3:return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseBitString(b, b + c, a);case 4:return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseOctetString(b, b + c, a);case 6:return this.stream.parseOID(b, b + c, a);case 16:case 17:return null !== this.sub ? "(" + this.sub.length + " elem)" : "(no elem)";case 12:return y(this.stream.parseStringUTF(b, b + c), a);case 18:case 19:case 20:case 21:case 22:case 26:return y(this.stream.parseStringISO(b, b + c), a);case 30:return y(this.stream.parseStringBMP(b, b + c), a);case 23:case 24:return this.stream.parseTime(b, b + c, 23 == this.tag.tagNumber);}return null;}, a.prototype.toString = function () {return this.typeName() + "@" + this.stream.pos + "[header:" + this.header + ",length:" + this.length + ",sub:" + (null === this.sub ? "null" : this.sub.length) + "]";}, a.prototype.toPrettyString = function (a) {var b, c, d;if (void 0 === a && (a = ""), b = a + this.typeName() + " @" + this.stream.pos, this.length >= 0 && (b += "+"), b += this.length, this.tag.tagConstructed ? b += " (constructed)" : !this.tag.isUniversal() || 3 != this.tag.tagNumber && 4 != this.tag.tagNumber || null === this.sub || (b += " (encapsulates)"), b += "\n", null !== this.sub) for (a += " ", c = 0, d = this.sub.length; d > c; ++c) {b += this.sub[c].toPrettyString(a);}return b;}, a.prototype.posStart = function () {return this.stream.pos;}, a.prototype.posContent = function () {return this.stream.pos + this.header;}, a.prototype.posEnd = function () {return this.stream.pos + this.header + Math.abs(this.length);}, a.prototype.toHexString = function () {return this.stream.hexDump(this.posStart(), this.posEnd(), !0);}, a.decodeLength = function (a) {var d,b = a.get(),c = 127 & b;if (c == b) return c;if (c > 6) throw new Error("Length over 48 bits not supported at position " + (a.pos - 1));if (0 === c) return null;for (b = 0, d = 0; c > d; ++d) {b = 256 * b + a.get();}return b;}, a.prototype.getHexStringValue = function () {var a = this.toHexString(),b = 2 * this.header,c = 2 * this.length;return a.substr(b, c);}, a.decode = function (b) {var c, d, e, f, g, h, i, j, k;if (c = b instanceof z ? b : new z(b, 0), d = new z(c), e = new B(c), f = a.decodeLength(c), g = c.pos, h = g - d.pos, i = null, j = function j() {var d,e,b = [];if (null !== f) {for (d = g + f; c.pos < d;) {b[b.length] = a.decode(c);}if (c.pos != d) throw new Error("Content size is not correct for container starting at offset " + g);} else try {for (; e = a.decode(c), !e.tag.isEOC();) {b[b.length] = e;}f = g - c.pos;} catch (h) {throw new Error("Exception while decoding undefined length content: " + h);}return b;}, e.tagConstructed) i = j();else if (e.isUniversal() && (3 == e.tagNumber || 4 == e.tagNumber)) try {if (3 == e.tagNumber && 0 != c.get()) throw new Error("BIT STRINGs with unused bits cannot encapsulate.");for (i = j(), k = 0; k < i.length; ++k) {if (i[k].tag.isEOC()) throw new Error("EOC is not supposed to be actual content.");}} catch (l) {i = null;}if (null === i) {if (null === f) throw new Error("We can't skip over an invalid tag with undefined length at offset " + g);c.pos = g + Math.abs(f);}return new a(d, h, f, e, i);}, a;}(),B = function () {function a(a) {var c,b = a.get();if (this.tagClass = b >> 6, this.tagConstructed = 0 !== (32 & b), this.tagNumber = 31 & b, 31 == this.tagNumber) {c = new u();do {b = a.get(), c.mulAdd(128, 127 & b);} while (128 & b);this.tagNumber = c.simplify();}}return a.prototype.isUniversal = function () {return 0 === this.tagClass;}, a.prototype.isEOC = function () {return 0 === this.tagClass && 0 === this.tagNumber;}, a;}(),F = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997],G = (1 << 26) / F[F.length - 1],H = function () {function a(a, b, c) {null != a && ("number" == typeof a ? this.fromNumber(a, b, c) : null == b && "string" != typeof a ? this.fromString(a, 256) : this.fromString(a, b));}return a.prototype.toString = function (a) {var b, d, e, f, g, h, i;if (this.s < 0) return "-" + this.negate().toString(a);if (16 == a) b = 4;else if (8 == a) b = 3;else if (2 == a) b = 1;else if (32 == a) b = 5;else {if (4 != a) return this.toRadix(a);b = 2;}if (d = (1 << b) - 1, f = !1, g = "", h = this.t, i = this.DB - h * this.DB % b, h-- > 0) for (i < this.DB && (e = this[h] >> i) > 0 && (f = !0, g = c(e)); h >= 0;) {b > i ? (e = (this[h] & (1 << i) - 1) << b - i, e |= this[--h] >> (i += this.DB - b)) : (e = this[h] >> (i -= b) & d, 0 >= i && (i += this.DB, --h)), e > 0 && (f = !0), f && (g += c(e));}return f ? g : "0";}, a.prototype.negate = function () {var b = M();return a.ZERO.subTo(this, b), b;}, a.prototype.abs = function () {return this.s < 0 ? this.negate() : this;}, a.prototype.compareTo = function (a) {var c,b = this.s - a.s;if (0 != b) return b;if (c = this.t, b = c - a.t, 0 != b) return this.s < 0 ? -b : b;for (; --c >= 0;) {if (0 != (b = this[c] - a[c])) return b;}return 0;}, a.prototype.bitLength = function () {return this.t <= 0 ? 0 : this.DB * (this.t - 1) + X(this[this.t - 1] ^ this.s & this.DM);}, a.prototype.mod = function (b) {var c = M();return this.abs().divRemTo(b, null, c), this.s < 0 && c.compareTo(a.ZERO) > 0 && b.subTo(c, c), c;}, a.prototype.modPowInt = function (a, b) {var c;return c = 256 > a || b.isEven() ? new J(b) : new K(b), this.exp(a, c);}, a.prototype.clone = function () {var a = M();return this.copyTo(a), a;}, a.prototype.intValue = function () {if (this.s < 0) {if (1 == this.t) return this[0] - this.DV;if (0 == this.t) return -1;} else {if (1 == this.t) return this[0];if (0 == this.t) return 0;}return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0];}, a.prototype.byteValue = function () {return 0 == this.t ? this.s : this[0] << 24 >> 24;
  10180. }, a.prototype.shortValue = function () {return 0 == this.t ? this.s : this[0] << 16 >> 16;}, a.prototype.signum = function () {return this.s < 0 ? -1 : this.t <= 0 || 1 == this.t && this[0] <= 0 ? 0 : 1;}, a.prototype.toByteArray = function () {var c,d,e,a = this.t,b = [];if (b[0] = this.s, c = this.DB - a * this.DB % 8, e = 0, a-- > 0) for (c < this.DB && (d = this[a] >> c) != (this.s & this.DM) >> c && (b[e++] = d | this.s << this.DB - c); a >= 0;) {8 > c ? (d = (this[a] & (1 << c) - 1) << 8 - c, d |= this[--a] >> (c += this.DB - 8)) : (d = 255 & this[a] >> (c -= 8), 0 >= c && (c += this.DB, --a)), 0 != (128 & d) && (d |= -256), 0 == e && (128 & this.s) != (128 & d) && ++e, (e > 0 || d != this.s) && (b[e++] = d);}return b;}, a.prototype.equals = function (a) {return 0 == this.compareTo(a);}, a.prototype.min = function (a) {return this.compareTo(a) < 0 ? this : a;}, a.prototype.max = function (a) {return this.compareTo(a) > 0 ? this : a;}, a.prototype.and = function (a) {var b = M();return this.bitwiseTo(a, d, b), b;}, a.prototype.or = function (a) {var b = M();return this.bitwiseTo(a, e, b), b;}, a.prototype.xor = function (a) {var b = M();return this.bitwiseTo(a, f, b), b;}, a.prototype.andNot = function (a) {var b = M();return this.bitwiseTo(a, g, b), b;}, a.prototype.not = function () {var b,a = M();for (b = 0; b < this.t; ++b) {a[b] = this.DM & ~this[b];}return a.t = this.t, a.s = ~this.s, a;}, a.prototype.shiftLeft = function (a) {var b = M();return 0 > a ? this.rShiftTo(-a, b) : this.lShiftTo(a, b), b;}, a.prototype.shiftRight = function (a) {var b = M();return 0 > a ? this.lShiftTo(-a, b) : this.rShiftTo(a, b), b;}, a.prototype.getLowestSetBit = function () {for (var a = 0; a < this.t; ++a) {if (0 != this[a]) return a * this.DB + h(this[a]);}return this.s < 0 ? this.t * this.DB : -1;}, a.prototype.bitCount = function () {var c,a = 0,b = this.s & this.DM;for (c = 0; c < this.t; ++c) {a += i(this[c] ^ b);}return a;}, a.prototype.testBit = function (a) {var b = Math.floor(a / this.DB);return b >= this.t ? 0 != this.s : 0 != (this[b] & 1 << a % this.DB);}, a.prototype.setBit = function (a) {return this.changeBit(a, e);}, a.prototype.clearBit = function (a) {return this.changeBit(a, g);}, a.prototype.flipBit = function (a) {return this.changeBit(a, f);}, a.prototype.add = function (a) {var b = M();return this.addTo(a, b), b;}, a.prototype.subtract = function (a) {var b = M();return this.subTo(a, b), b;}, a.prototype.multiply = function (a) {var b = M();return this.multiplyTo(a, b), b;}, a.prototype.divide = function (a) {var b = M();return this.divRemTo(a, b, null), b;}, a.prototype.remainder = function (a) {var b = M();return this.divRemTo(a, null, b), b;}, a.prototype.divideAndRemainder = function (a) {var b = M(),c = M();return this.divRemTo(a, b, c), [b, c];}, a.prototype.modPow = function (a, b) {var d,f,g,h,i,j,k,l,m,n,o,p,c = a.bitLength(),e = W(1);if (0 >= c) return e;if (d = 18 > c ? 1 : 48 > c ? 3 : 144 > c ? 4 : 768 > c ? 5 : 6, f = 8 > c ? new J(b) : b.isEven() ? new L(b) : new K(b), g = [], h = 3, i = d - 1, j = (1 << d) - 1, g[1] = f.convert(this), d > 1) for (k = M(), f.sqrTo(g[1], k); j >= h;) {g[h] = M(), f.mulTo(k, g[h - 2], g[h]), h += 2;}for (l = a.t - 1, n = !0, o = M(), c = X(a[l]) - 1; l >= 0;) {for (c >= i ? m = a[l] >> c - i & j : (m = (a[l] & (1 << c + 1) - 1) << i - c, l > 0 && (m |= a[l - 1] >> this.DB + c - i)), h = d; 0 == (1 & m);) {m >>= 1, --h;}if ((c -= h) < 0 && (c += this.DB, --l), n) g[m].copyTo(e), n = !1;else {for (; h > 1;) {f.sqrTo(e, o), f.sqrTo(o, e), h -= 2;}h > 0 ? f.sqrTo(e, o) : (p = e, e = o, o = p), f.mulTo(o, g[m], e);}for (; l >= 0 && 0 == (a[l] & 1 << c);) {f.sqrTo(e, o), p = e, e = o, o = p, --c < 0 && (c = this.DB - 1, --l);}}return f.revert(e);}, a.prototype.modInverse = function (b) {var d,e,f,g,h,i,c = b.isEven();if (this.isEven() && c || 0 == b.signum()) return a.ZERO;for (d = b.clone(), e = this.clone(), f = W(1), g = W(0), h = W(0), i = W(1); 0 != d.signum();) {for (; d.isEven();) {d.rShiftTo(1, d), c ? (f.isEven() && g.isEven() || (f.addTo(this, f), g.subTo(b, g)), f.rShiftTo(1, f)) : g.isEven() || g.subTo(b, g), g.rShiftTo(1, g);}for (; e.isEven();) {e.rShiftTo(1, e), c ? (h.isEven() && i.isEven() || (h.addTo(this, h), i.subTo(b, i)), h.rShiftTo(1, h)) : i.isEven() || i.subTo(b, i), i.rShiftTo(1, i);}d.compareTo(e) >= 0 ? (d.subTo(e, d), c && f.subTo(h, f), g.subTo(i, g)) : (e.subTo(d, e), c && h.subTo(f, h), i.subTo(g, i));}return 0 != e.compareTo(a.ONE) ? a.ZERO : i.compareTo(b) >= 0 ? i.subtract(b) : i.signum() < 0 ? (i.addTo(b, i), i.signum() < 0 ? i.add(b) : i) : i;}, a.prototype.pow = function (a) {return this.exp(a, new I());}, a.prototype.gcd = function (a) {var d,e,f,b = this.s < 0 ? this.negate() : this.clone(),c = a.s < 0 ? a.negate() : a.clone();if (b.compareTo(c) < 0 && (d = b, b = c, c = d), e = b.getLowestSetBit(), f = c.getLowestSetBit(), 0 > f) return b;for (f > e && (f = e), f > 0 && (b.rShiftTo(f, b), c.rShiftTo(f, c)); b.signum() > 0;) {(e = b.getLowestSetBit()) > 0 && b.rShiftTo(e, b), (e = c.getLowestSetBit()) > 0 && c.rShiftTo(e, c), b.compareTo(c) >= 0 ? (b.subTo(c, b), b.rShiftTo(1, b)) : (c.subTo(b, c), c.rShiftTo(1, c));}return f > 0 && c.lShiftTo(f, c), c;}, a.prototype.isProbablePrime = function (a) {var b,d,e,c = this.abs();if (1 == c.t && c[0] <= F[F.length - 1]) {for (b = 0; b < F.length; ++b) {if (c[0] == F[b]) return !0;}return !1;}if (c.isEven()) return !1;for (b = 1; b < F.length;) {for (d = F[b], e = b + 1; e < F.length && G > d;) {d *= F[e++];}for (d = c.modInt(d); e > b;) {if (0 == d % F[b++]) return !1;}}return c.millerRabin(a);}, a.prototype.copyTo = function (a) {for (var b = this.t - 1; b >= 0; --b) {a[b] = this[b];}a.t = this.t, a.s = this.s;}, a.prototype.fromInt = function (a) {this.t = 1, this.s = 0 > a ? -1 : 0, a > 0 ? this[0] = a : -1 > a ? this[0] = a + this.DV : this.t = 0;}, a.prototype.fromString = function (b, c) {var d, e, f, g, h;if (16 == c) d = 4;else if (8 == c) d = 3;else if (256 == c) d = 8;else if (2 == c) d = 1;else if (32 == c) d = 5;else {if (4 != c) return this.fromRadix(b, c), void 0;d = 2;}for (this.t = 0, this.s = 0, e = b.length, f = !1, g = 0; --e >= 0;) {h = 8 == d ? 255 & +b[e] : V(b, e), 0 > h ? "-" == b.charAt(e) && (f = !0) : (f = !1, 0 == g ? this[this.t++] = h : g + d > this.DB ? (this[this.t - 1] |= (h & (1 << this.DB - g) - 1) << g, this[this.t++] = h >> this.DB - g) : this[this.t - 1] |= h << g, g += d, g >= this.DB && (g -= this.DB));}8 == d && 0 != (128 & +b[0]) && (this.s = -1, g > 0 && (this[this.t - 1] |= (1 << this.DB - g) - 1 << g)), this.clamp(), f && a.ZERO.subTo(this, this);}, a.prototype.clamp = function () {for (var a = this.s & this.DM; this.t > 0 && this[this.t - 1] == a;) {--this.t;}}, a.prototype.dlShiftTo = function (a, b) {var c;for (c = this.t - 1; c >= 0; --c) {b[c + a] = this[c];}for (c = a - 1; c >= 0; --c) {b[c] = 0;}b.t = this.t + a, b.s = this.s;}, a.prototype.drShiftTo = function (a, b) {for (var c = a; c < this.t; ++c) {b[c - a] = this[c];}b.t = Math.max(this.t - a, 0), b.s = this.s;}, a.prototype.lShiftTo = function (a, b) {var h,c = a % this.DB,d = this.DB - c,e = (1 << d) - 1,f = Math.floor(a / this.DB),g = this.s << c & this.DM;for (h = this.t - 1; h >= 0; --h) {b[h + f + 1] = this[h] >> d | g, g = (this[h] & e) << c;}for (h = f - 1; h >= 0; --h) {b[h] = 0;}b[f] = g, b.t = this.t + f + 1, b.s = this.s, b.clamp();}, a.prototype.rShiftTo = function (a, b) {var c, d, e, f, g;if (b.s = this.s, c = Math.floor(a / this.DB), c >= this.t) return b.t = 0, void 0;for (d = a % this.DB, e = this.DB - d, f = (1 << d) - 1, b[0] = this[c] >> d, g = c + 1; g < this.t; ++g) {b[g - c - 1] |= (this[g] & f) << e, b[g - c] = this[g] >> d;}d > 0 && (b[this.t - c - 1] |= (this.s & f) << e), b.t = this.t - c, b.clamp();}, a.prototype.subTo = function (a, b) {for (var c = 0, d = 0, e = Math.min(a.t, this.t); e > c;) {d += this[c] - a[c], b[c++] = d & this.DM, d >>= this.DB;}if (a.t < this.t) {for (d -= a.s; c < this.t;) {d += this[c], b[c++] = d & this.DM, d >>= this.DB;}d += this.s;} else {for (d += this.s; c < a.t;) {d -= a[c], b[c++] = d & this.DM, d >>= this.DB;}d -= a.s;}b.s = 0 > d ? -1 : 0, -1 > d ? b[c++] = this.DV + d : d > 0 && (b[c++] = d), b.t = c, b.clamp();}, a.prototype.multiplyTo = function (b, c) {var d = this.abs(),e = b.abs(),f = d.t;for (c.t = f + e.t; --f >= 0;) {c[f] = 0;}for (f = 0; f < e.t; ++f) {c[f + d.t] = d.am(0, e[f], c, f, 0, d.t);}c.s = 0, c.clamp(), this.s != b.s && a.ZERO.subTo(c, c);}, a.prototype.squareTo = function (a) {for (var d, b = this.abs(), c = a.t = 2 * b.t; --c >= 0;) {a[c] = 0;}for (c = 0; c < b.t - 1; ++c) {d = b.am(c, b[c], a, 2 * c, 0, 1), (a[c + b.t] += b.am(c + 1, 2 * b[c], a, 2 * c + 1, d, b.t - c - 1)) >= b.DV && (a[c + b.t] -= b.DV, a[c + b.t + 1] = 1);}a.t > 0 && (a[a.t - 1] += b.am(c, b[c], a, 2 * c, 0, 1)), a.s = 0, a.clamp();}, a.prototype.divRemTo = function (b, c, d) {var f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,e = b.abs();if (!(e.t <= 0)) {if (f = this.abs(), f.t < e.t) return null != c && c.fromInt(0), null != d && this.copyTo(d), void 0;if (null == d && (d = M()), g = M(), h = this.s, i = b.s, j = this.DB - X(e[e.t - 1]), j > 0 ? (e.lShiftTo(j, g), f.lShiftTo(j, d)) : (e.copyTo(g), f.copyTo(d)), k = g.t, l = g[k - 1], 0 != l) {for (m = l * (1 << this.F1) + (k > 1 ? g[k - 2] >> this.F2 : 0), n = this.FV / m, o = (1 << this.F1) / m, p = 1 << this.F2, q = d.t, r = q - k, s = null == c ? M() : c, g.dlShiftTo(r, s), d.compareTo(s) >= 0 && (d[d.t++] = 1, d.subTo(s, d)), a.ONE.dlShiftTo(k, s), s.subTo(g, g); g.t < k;) {g[g.t++] = 0;}for (; --r >= 0;) {if (t = d[--q] == l ? this.DM : Math.floor(d[q] * n + (d[q - 1] + p) * o), (d[q] += g.am(0, t, d, r, 0, k)) < t) for (g.dlShiftTo(r, s), d.subTo(s, d); d[q] < --t;) {d.subTo(s, d);}}null != c && (d.drShiftTo(k, c), h != i && a.ZERO.subTo(c, c)), d.t = k, d.clamp(), j > 0 && d.rShiftTo(j, d), 0 > h && a.ZERO.subTo(d, d);}}}, a.prototype.invDigit = function () {var a, b;return this.t < 1 ? 0 : (a = this[0], 0 == (1 & a) ? 0 : (b = 3 & a, b = 15 & b * (2 - (15 & a) * b), b = 255 & b * (2 - (255 & a) * b), b = 65535 & b * (2 - (65535 & (65535 & a) * b)), b = b * (2 - a * b % this.DV) % this.DV, b > 0 ? this.DV - b : -b));}, a.prototype.isEven = function () {return 0 == (this.t > 0 ? 1 & this[0] : this.s);}, a.prototype.exp = function (b, c) {var d, e, f, g, h;if (b > 4294967295 || 1 > b) return a.ONE;for (d = M(), e = M(), f = c.convert(this), g = X(b) - 1, f.copyTo(d); --g >= 0;) {c.sqrTo(d, e), (b & 1 << g) > 0 ? c.mulTo(e, f, d) : (h = d, d = e, e = h);}return c.revert(d);}, a.prototype.chunkSize = function (a) {return Math.floor(Math.LN2 * this.DB / Math.log(a));}, a.prototype.toRadix = function (a) {var b, c, d, e, f, g;if (null == a && (a = 10), 0 == this.signum() || 2 > a || a > 36) return "0";for (b = this.chunkSize(a), c = Math.pow(a, b), d = W(c), e = M(), f = M(), g = "", this.divRemTo(d, e, f); e.signum() > 0;) {g = (c + f.intValue()).toString(a).substr(1) + g, e.divRemTo(d, e, f);}return f.intValue().toString(a) + g;}, a.prototype.fromRadix = function (b, c) {var d, e, f, g, h, i, j;for (this.fromInt(0), null == c && (c = 10), d = this.chunkSize(c), e = Math.pow(c, d), f = !1, g = 0, h = 0, i = 0; i < b.length; ++i) {j = V(b, i), 0 > j ? "-" == b.charAt(i) && 0 == this.signum() && (f = !0) : (h = c * h + j, ++g >= d && (this.dMultiply(e), this.dAddOffset(h, 0), g = 0, h = 0));}g > 0 && (this.dMultiply(Math.pow(c, g)), this.dAddOffset(h, 0)), f && a.ZERO.subTo(this, this);}, a.prototype.fromNumber = function (b, c, d) {var f, g;if ("number" == typeof c) {if (2 > b) this.fromInt(1);else for (this.fromNumber(b, d), this.testBit(b - 1) || this.bitwiseTo(a.ONE.shiftLeft(b - 1), e, this), this.isEven() && this.dAddOffset(1, 0); !this.isProbablePrime(c);) {this.dAddOffset(2, 0), this.bitLength() > b && this.subTo(a.ONE.shiftLeft(b - 1), this);}} else f = [], g = 7 & b, f.length = (b >> 3) + 1, c.nextBytes(f), g > 0 ? f[0] &= (1 << g) - 1 : f[0] = 0, this.fromString(f, 256);}, a.prototype.bitwiseTo = function (a, b, c) {var d,e,f = Math.min(a.t, this.t);for (d = 0; f > d; ++d) {c[d] = b(this[d], a[d]);}if (a.t < this.t) {for (e = a.s & this.DM, d = f; d < this.t; ++d) {c[d] = b(this[d], e);}c.t = this.t;} else {for (e = this.s & this.DM, d = f; d < a.t; ++d) {c[d] = b(e, a[d]);}c.t = a.t;}c.s = b(this.s, a.s), c.clamp();}, a.prototype.changeBit = function (b, c) {var d = a.ONE.shiftLeft(b);return this.bitwiseTo(d, c, d), d;}, a.prototype.addTo = function (a, b) {for (var c = 0, d = 0, e = Math.min(a.t, this.t); e > c;) {d += this[c] + a[c], b[c++] = d & this.DM, d >>= this.DB;}if (a.t < this.t) {for (d += a.s; c < this.t;) {d += this[c], b[c++] = d & this.DM, d >>= this.DB;}d += this.s;} else {for (d += this.s; c < a.t;) {d += a[c], b[c++] = d & this.DM, d >>= this.DB;}d += a.s;}b.s = 0 > d ? -1 : 0, d > 0 ? b[c++] = d : -1 > d && (b[c++] = this.DV + d), b.t = c, b.clamp();}, a.prototype.dMultiply = function (a) {this[this.t] = this.am(0, a - 1, this, 0, 0, this.t), ++this.t, this.clamp();}, a.prototype.dAddOffset = function (a, b) {if (0 != a) {for (; this.t <= b;) {this[this.t++] = 0;}for (this[b] += a; this[b] >= this.DV;) {this[b] -= this.DV, ++b >= this.t && (this[this.t++] = 0), ++this[b];}}}, a.prototype.multiplyLowerTo = function (a, b, c) {var e,d = Math.min(this.t + a.t, b);for (c.s = 0, c.t = d; d > 0;) {c[--d] = 0;}for (e = c.t - this.t; e > d; ++d) {c[d + this.t] = this.am(0, a[d], c, d, 0, this.t);}for (e = Math.min(a.t, b); e > d; ++d) {this.am(0, a[d], c, d, 0, b - d);}c.clamp();}, a.prototype.multiplyUpperTo = function (a, b, c) {--b;var d = c.t = this.t + a.t - b;for (c.s = 0; --d >= 0;) {c[d] = 0;}for (d = Math.max(b - this.t, 0); d < a.t; ++d) {c[this.t + d - b] = this.am(b - d, a[d], c, 0, 0, this.t + d - b);}c.clamp(), c.drShiftTo(1, c);}, a.prototype.modInt = function (a) {var b, c, d;if (0 >= a) return 0;if (b = this.DV % a, c = this.s < 0 ? a - 1 : 0, this.t > 0) if (0 == b) c = this[0] % a;else for (d = this.t - 1; d >= 0; --d) {c = (b * c + this[d]) % a;}return c;}, a.prototype.millerRabin = function (b) {var e,f,g,h,i,c = this.subtract(a.ONE),d = c.getLowestSetBit();if (0 >= d) return !1;for (e = c.shiftRight(d), b = b + 1 >> 1, b > F.length && (b = F.length), f = M(), g = 0; b > g; ++g) {if (f.fromInt(F[Math.floor(Math.random() * F.length)]), h = f.modPow(e, this), 0 != h.compareTo(a.ONE) && 0 != h.compareTo(c)) {for (i = 1; i++ < d && 0 != h.compareTo(c);) {if (h = h.modPowInt(2, this), 0 == h.compareTo(a.ONE)) return !1;}if (0 != h.compareTo(c)) return !1;}}return !0;}, a.prototype.square = function () {var a = M();return this.squareTo(a), a;}, a.prototype.gcda = function (a, b) {var e,f,g,_h,c = this.s < 0 ? this.negate() : this.clone(),d = a.s < 0 ? a.negate() : a.clone();return c.compareTo(d) < 0 && (e = c, c = d, d = e), f = c.getLowestSetBit(), g = d.getLowestSetBit(), 0 > g ? (b(c), void 0) : (g > f && (g = f), g > 0 && (c.rShiftTo(g, c), d.rShiftTo(g, d)), _h = function h() {(f = c.getLowestSetBit()) > 0 && c.rShiftTo(f, c), (f = d.getLowestSetBit()) > 0 && d.rShiftTo(f, d), c.compareTo(d) >= 0 ? (c.subTo(d, c), c.rShiftTo(1, c)) : (d.subTo(c, d), d.rShiftTo(1, d)), c.signum() > 0 ? setTimeout(_h, 0) : (g > 0 && d.lShiftTo(g, d), setTimeout(function () {b(d);}, 0));}, setTimeout(_h, 10), void 0);}, a.prototype.fromNumberAsync = function (b, c, d, f) {var g, _h2, i, j;"number" == typeof c ? 2 > b ? this.fromInt(1) : (this.fromNumber(b, d), this.testBit(b - 1) || this.bitwiseTo(a.ONE.shiftLeft(b - 1), e, this), this.isEven() && this.dAddOffset(1, 0), g = this, _h2 = function h() {g.dAddOffset(2, 0), g.bitLength() > b && g.subTo(a.ONE.shiftLeft(b - 1), g), g.isProbablePrime(c) ? setTimeout(function () {f();}, 0) : setTimeout(_h2, 0);}, setTimeout(_h2, 0)) : (i = [], j = 7 & b, i.length = (b >> 3) + 1, c.nextBytes(i), j > 0 ? i[0] &= (1 << j) - 1 : i[0] = 0, this.fromString(i, 256));}, a;}(),I = function () {function a() {}return a.prototype.convert = function (a) {return a;}, a.prototype.revert = function (a) {return a;}, a.prototype.mulTo = function (a, b, c) {a.multiplyTo(b, c);}, a.prototype.sqrTo = function (a, b) {a.squareTo(b);}, a;}(),J = function () {function a(a) {this.m = a;}return a.prototype.convert = function (a) {return a.s < 0 || a.compareTo(this.m) >= 0 ? a.mod(this.m) : a;}, a.prototype.revert = function (a) {return a;}, a.prototype.reduce = function (a) {a.divRemTo(this.m, null, a);}, a.prototype.mulTo = function (a, b, c) {a.multiplyTo(b, c), this.reduce(c);}, a.prototype.sqrTo = function (a, b) {a.squareTo(b), this.reduce(b);}, a;}(),K = function () {function a(a) {this.m = a, this.mp = a.invDigit(), this.mpl = 32767 & this.mp, this.mph = this.mp >> 15, this.um = (1 << a.DB - 15) - 1, this.mt2 = 2 * a.t;}return a.prototype.convert = function (a) {var b = M();return a.abs().dlShiftTo(this.m.t, b), b.divRemTo(this.m, null, b), a.s < 0 && b.compareTo(H.ZERO) > 0 && this.m.subTo(b, b), b;}, a.prototype.revert = function (a) {var b = M();return a.copyTo(b), this.reduce(b), b;}, a.prototype.reduce = function (a) {for (var b, c, d; a.t <= this.mt2;) {a[a.t++] = 0;}for (b = 0; b < this.m.t; ++b) {for (c = 32767 & a[b], d = c * this.mpl + ((c * this.mph + (a[b] >> 15) * this.mpl & this.um) << 15) & a.DM, c = b + this.m.t, a[c] += this.m.am(0, d, a, b, 0, this.m.t); a[c] >= a.DV;) {a[c] -= a.DV, a[++c]++;}}a.clamp(), a.drShiftTo(this.m.t, a), a.compareTo(this.m) >= 0 && a.subTo(this.m, a);}, a.prototype.mulTo = function (a, b, c) {a.multiplyTo(b, c), this.reduce(c);}, a.prototype.sqrTo = function (a, b) {a.squareTo(b), this.reduce(b);}, a;}(),L = function () {function a(a) {this.m = a, this.r2 = M(), this.q3 = M(), H.ONE.dlShiftTo(2 * a.t, this.r2), this.mu = this.r2.divide(a);}return a.prototype.convert = function (a) {if (a.s < 0 || a.t > 2 * this.m.t) return a.mod(this.m);if (a.compareTo(this.m) < 0) return a;var b = M();return a.copyTo(b), this.reduce(b), b;}, a.prototype.revert = function (a) {return a;}, a.prototype.reduce = function (a) {for (a.drShiftTo(this.m.t - 1, this.r2), a.t > this.m.t + 1 && (a.t = this.m.t + 1, a.clamp()), this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3), this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); a.compareTo(this.r2) < 0;) {a.dAddOffset(1, this.m.t + 1);}for (a.subTo(this.r2, a); a.compareTo(this.m) >= 0;) {a.subTo(this.m, a);}}, a.prototype.mulTo = function (a, b, c) {a.multiplyTo(b, c), this.reduce(c);}, a.prototype.sqrTo = function (a, b) {a.squareTo(b), this.reduce(b);}, a;}();for (H.prototype.am = Q, C = 28, H.prototype.DB = C, H.prototype.DM = (1 << C) - 1, H.prototype.DV = 1 << C, R = 52, H.prototype.FV = Math.pow(2, R), H.prototype.F1 = R - C, H.prototype.F2 = 2 * C - R, S = [], T = "0".charCodeAt(0), U = 0; 9 >= U; ++U) {S[T++] = U;}for (T = "a".charCodeAt(0), U = 10; 36 > U; ++U) {S[T++] = U;}for (T = "A".charCodeAt(0), U = 10; 36 > U; ++U) {S[T++] = U;}if (H.ZERO = W(0), H.ONE = W(1), Y = function () {function a() {this.i = 0, this.j = 0, this.S = [];}return a.prototype.init = function (a) {var b, c, d;for (b = 0; 256 > b; ++b) {this.S[b] = b;}for (c = 0, b = 0; 256 > b; ++b) {c = 255 & c + this.S[b] + a[b % a.length], d = this.S[b], this.S[b] = this.S[c], this.S[c] = d;}this.i = 0, this.j = 0;}, a.prototype.next = function () {var a;return this.i = 255 & this.i + 1, this.j = 255 & this.j + this.S[this.i], a = this.S[this.i], this.S[this.i] = this.S[this.j], this.S[this.j] = a, this.S[255 & a + this.S[this.i]];}, a;}(), $ = 256, ab = null, null == ab && (ab = [], bb = 0, cb = void 0, CryptoJS && CryptoJS.getRandomValues)) for (db = new Uint32Array(256), CryptoJS.getRandomValues(db), cb = 0; cb < db.length; ++cb) {ab[bb++] = 255 & db[cb];}gb = function () {function a() {}return a.prototype.nextBytes = function (a) {for (var b = 0; b < a.length; ++b) {a[b] = fb();}}, a;}(), jb = function () {function a() {this.n = null, this.e = 0, this.d = null, this.p = null, this.q = null, this.dmp1 = null, this.dmq1 = null, this.coeff = null;}return a.prototype.doPublic = function (a) {return a.modPowInt(this.e, this.n);}, a.prototype.doPrivate = function (a) {var b, c;if (null == this.p || null == this.q) return a.modPow(this.d, this.n);for (b = a.mod(this.p).modPow(this.dmp1, this.p), c = a.mod(this.q).modPow(this.dmq1, this.q); b.compareTo(c) < 0;) {b = b.add(this.p);}return b.subtract(c).multiply(this.coeff).mod(this.p).multiply(this.q).add(c);}, a.prototype.setPublic = function (a, b) {null != a && null != b && a.length > 0 && b.length > 0 ? (this.n = N(a, 16), this.e = parseInt(b, 16)) : console.error("Invalid RSA public key");}, a.prototype.encrypt = function (a) {var c,d,b = ib(a, this.n.bitLength() + 7 >> 3);return null == b ? null : (c = this.doPublic(b), null == c ? null : (d = c.toString(16), 0 == (1 & d.length) ? d : "0" + d));}, a.prototype.setPrivate = function (a, b, c) {null != a && null != b && a.length > 0 && b.length > 0 ? (this.n = N(a, 16), this.e = parseInt(b, 16), this.d = N(c, 16)) : console.error("Invalid RSA private key");}, a.prototype.setPrivateEx = function (a, b, c, d, e, f, g, h) {null != a && null != b && a.length > 0 && b.length > 0 ? (this.n = N(a, 16), this.e = parseInt(b, 16), this.d = N(c, 16), this.p = N(d, 16), this.q = N(e, 16), this.dmp1 = N(f, 16), this.dmq1 = N(g, 16), this.coeff = N(h, 16)) : console.error("Invalid RSA private key");}, a.prototype.generate = function (a, b) {var e,f,g,h,i,c = new gb(),d = a >> 1;for (this.e = parseInt(b, 16), e = new H(b, 16);;) {for (; this.p = new H(a - d, 1, c), 0 != this.p.subtract(H.ONE).gcd(e).compareTo(H.ONE) || !this.p.isProbablePrime(10);) {;}for (; this.q = new H(d, 1, c), 0 != this.q.subtract(H.ONE).gcd(e).compareTo(H.ONE) || !this.q.isProbablePrime(10);) {;}if (this.p.compareTo(this.q) <= 0 && (f = this.p, this.p = this.q, this.q = f), g = this.p.subtract(H.ONE), h = this.q.subtract(H.ONE), i = g.multiply(h), 0 == i.gcd(e).compareTo(H.ONE)) {this.n = this.p.multiply(this.q), this.d = e.modInverse(i), this.dmp1 = this.d.mod(g), this.dmq1 = this.d.mod(h), this.coeff = this.q.modInverse(this.p);break;}}}, a.prototype.decrypt = function (a) {var b = N(a, 16),c = this.doPrivate(b);return null == c ? null : kb(c, this.n.bitLength() + 7 >> 3);}, a.prototype.generateAsync = function (a, b, c) {var f,g,_h3,d = new gb(),e = a >> 1;this.e = parseInt(b, 16), f = new H(b, 16), g = this, _h3 = function h() {var b = function b() {var a, b, d, e;g.p.compareTo(g.q) <= 0 && (a = g.p, g.p = g.q, g.q = a), b = g.p.subtract(H.ONE), d = g.q.subtract(H.ONE), e = b.multiply(d), 0 == e.gcd(f).compareTo(H.ONE) ? (g.n = g.p.multiply(g.q), g.d = f.modInverse(e), g.dmp1 = g.d.mod(b), g.dmq1 = g.d.mod(d), g.coeff = g.q.modInverse(g.p), setTimeout(function () {c();}, 0)) : setTimeout(_h3, 0);},i = function i() {g.q = M(), g.q.fromNumberAsync(e, 1, d, function () {g.q.subtract(H.ONE).gcda(f, function (a) {0 == a.compareTo(H.ONE) && g.q.isProbablePrime(10) ? setTimeout(b, 0) : setTimeout(i, 0);});});},j = function j() {g.p = M(), g.p.fromNumberAsync(a - e, 1, d, function () {g.p.subtract(H.ONE).gcda(f, function (a) {0 == a.compareTo(H.ONE) && g.p.isProbablePrime(10) ? setTimeout(i, 0) : setTimeout(j, 0);});});};setTimeout(j, 0);}, setTimeout(_h3, 0);}, a.prototype.sign = function (a, b, c) {var g,h,d = mb(c),e = d + b(a).toString(),f = hb(e, this.n.bitLength() / 4);return null == f ? null : (g = this.doPrivate(f), null == g ? null : (h = g.toString(16), 0 == (1 & h.length) ? h : "0" + h));}, a.prototype.verify = function (a, b, c) {var f,g,d = N(b, 16),e = this.doPublic(d);return null == e ? null : (f = e.toString(16).replace(/^1f+00/, ""), g = nb(f), g == c(a).toString());}, a;}(), lb = { md2: "3020300c06082a864886f70d020205000410", md5: "3020300c06082a864886f70d020505000410", sha1: "3021300906052b0e03021a05000414", sha224: "302d300d06096086480165030402040500041c", sha256: "3031300d060960864801650304020105000420", sha384: "3041300d060960864801650304020205000430", sha512: "3051300d060960864801650304020305000440", ripemd160: "3021300906052b2403020105000414" }, ob = {}, ob.lang = { extend: function extend(a, b, c) {var d, e, f, g;if (!b || !a) throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");if (d = function d() {}, d.prototype = b.prototype, a.prototype = new d(), a.prototype.constructor = a, a.superclass = b.prototype, b.prototype.constructor == Object.prototype.constructor && (b.prototype.constructor = b), c) {for (e in c) {a.prototype[e] = c[e];}f = function f() {}, g = ["toString", "valueOf"];try {/MSIE/.test(navigator.userAgent) && (f = function f(a, b) {for (e = 0; e < g.length; e += 1) {var c = g[e],d = b[c];"function" == typeof d && d != Object.prototype[c] && (a[c] = d);}});} catch (h) {}f(a.prototype, c);}} }, pb = {}, "undefined" != typeof pb.asn1 && pb.asn1 || (pb.asn1 = {}), pb.asn1.ASN1Util = new function () {this.integerToByteHex = function (a) {var b = a.toString(16);return 1 == b.length % 2 && (b = "0" + b), b;}, this.bigIntToMinTwosComplementsHex = function (a) {var c,d,e,f,g,h,b = a.toString(16);if ("-" != b.substr(0, 1)) 1 == b.length % 2 ? b = "0" + b : b.match(/^[0-7]/) || (b = "00" + b);else {for (c = b.substr(1), d = c.length, 1 == d % 2 ? d += 1 : b.match(/^[0-7]/) || (d += 2), e = "", f = 0; d > f; f++) {e += "f";}g = new H(e, 16), h = g.xor(a).add(H.ONE), b = h.toString(16).replace(/^-/, "");}return b;}, this.getPEMStringFromHex = function (a, b) {return hextopem(a, b);}, this.newObject = function (a) {var w,x,y,z,A,B,C,D,b = pb,c = b.asn1,d = c.DERBoolean,e = c.DERInteger,f = c.DERBitString,g = c.DEROctetString,h = c.DERNull,i = c.DERObjectIdentifier,j = c.DEREnumerated,k = c.DERUTF8String,l = c.DERNumericString,m = c.DERPrintableString,n = c.DERTeletexString,o = c.DERIA5String,p = c.DERUTCTime,q = c.DERGeneralizedTime,r = c.DERSequence,s = c.DERSet,t = c.DERTaggedObject,u = c.ASN1Util.newObject,v = Object.keys(a);if (1 != v.length) throw "key of param shall be only one.";if (w = v[0], -1 == ":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":" + w + ":")) throw "undefined key: " + w;if ("bool" == w) return new d(a[w]);if ("int" == w) return new e(a[w]);if ("bitstr" == w) return new f(a[w]);if ("octstr" == w) return new g(a[w]);if ("null" == w) return new h(a[w]);if ("oid" == w) return new i(a[w]);if ("enum" == w) return new j(a[w]);if ("utf8str" == w) return new k(a[w]);if ("numstr" == w) return new l(a[w]);if ("prnstr" == w) return new m(a[w]);if ("telstr" == w) return new n(a[w]);if ("ia5str" == w) return new o(a[w]);if ("utctime" == w) return new p(a[w]);if ("gentime" == w) return new q(a[w]);if ("seq" == w) {for (x = a[w], y = [], z = 0; z < x.length; z++) {A = u(x[z]), y.push(A);}return new r({ array: y });}if ("set" == w) {for (x = a[w], y = [], z = 0; z < x.length; z++) {A = u(x[z]), y.push(A);}return new s({ array: y });}if ("tag" == w) {if (B = a[w], "[object Array]" === Object.prototype.toString.call(B) && 3 == B.length) return C = u(B[2]), new t({ tag: B[0], explicit: B[1], obj: C });if (D = {}, void 0 !== B.explicit && (D.explicit = B.explicit), void 0 !== B.tag && (D.tag = B.tag), void 0 === B.obj) throw "obj shall be specified for 'tag'.";return D.obj = u(B.obj), new t(D);}}, this.jsonToASN1HEX = function (a) {var b = this.newObject(a);return b.getEncodedHex();};}(), pb.asn1.ASN1Util.oidHexToInt = function (a) {var f,g,h,i,j,b = "",c = parseInt(a.substr(0, 2), 16),d = Math.floor(c / 40),e = c % 40;for (b = d + "." + e, f = "", g = 2; g < a.length; g += 2) {h = parseInt(a.substr(g, 2), 16), i = ("00000000" + h.toString(2)).slice(-8), f += i.substr(1, 7), "0" == i.substr(0, 1) && (j = new H(f, 2), b = b + "." + j.toString(10), f = "");}return b;}, pb.asn1.ASN1Util.oidIntToHex = function (a) {var d,e,f,g,b = function b(a) {var b = a.toString(16);return 1 == b.length && (b = "0" + b), b;},c = function c(a) {var g,h,i,c = "",d = new H(a, 10),e = d.toString(2),f = 7 - e.length % 7;for (7 == f && (f = 0), g = "", h = 0; f > h; h++) {g += "0";}for (e = g + e, h = 0; h < e.length - 1; h += 7) {i = e.substr(h, 7), h != e.length - 7 && (i = "1" + i), c += b(parseInt(i, 2));}return c;};if (!a.match(/^[0-9.]+$/)) throw "malformed oid string: " + a;for (d = "", e = a.split("."), f = 40 * parseInt(e[0]) + parseInt(e[1]), d += b(f), e.splice(0, 2), g = 0; g < e.length; g++) {d += c(e[g]);}return d;}, pb.asn1.ASN1Object = function () {var a = "";this.getLengthHexFromValue = function () {var b, c, d, e;if ("undefined" == typeof this.hV || null == this.hV) throw "this.hV is null or undefined.";if (1 == this.hV.length % 2) throw "value hex must be even length: n=" + a.length + ",v=" + this.hV;if (b = this.hV.length / 2, c = b.toString(16), 1 == c.length % 2 && (c = "0" + c), 128 > b) return c;if (d = c.length / 2, d > 15) throw "ASN.1 length too long to represent by 8x: n = " + b.toString(16);return e = 128 + d, e.toString(16) + c;}, this.getEncodedHex = function () {return (null == this.hTLV || this.isModified) && (this.hV = this.getFreshValueHex(), this.hL = this.getLengthHexFromValue(), this.hTLV = this.hT + this.hL + this.hV, this.isModified = !1), this.hTLV;}, this.getValueHex = function () {return this.getEncodedHex(), this.hV;}, this.getFreshValueHex = function () {return "";};}, pb.asn1.DERAbstractString = function (a) {pb.asn1.DERAbstractString.superclass.constructor.call(this), this.getString = function () {return this.s;}, this.setString = function (a) {this.hTLV = null, this.isModified = !0, this.s = a, this.hV = stohex(this.s);}, this.setStringHex = function (a) {this.hTLV = null, this.isModified = !0, this.s = null, this.hV = a;}, this.getFreshValueHex = function () {return this.hV;}, "undefined" != typeof a && ("string" == typeof a ? this.setString(a) : "undefined" != typeof a["str"] ? this.setString(a["str"]) : "undefined" != typeof a["hex"] && this.setStringHex(a["hex"]));}, ob.lang.extend(pb.asn1.DERAbstractString, pb.asn1.ASN1Object), pb.asn1.DERAbstractTime = function () {pb.asn1.DERAbstractTime.superclass.constructor.call(this), this.localDateToUTC = function (a) {utc = a.getTime() + 6e4 * a.getTimezoneOffset();var b = new Date(utc);return b;}, this.formatDate = function (a, b, c) {var g,h,i,j,k,l,m,n,d = this.zeroPadding,e = this.localDateToUTC(a),f = String(e.getFullYear());return "utc" == b && (f = f.substr(2, 2)), g = d(String(e.getMonth() + 1), 2), h = d(String(e.getDate()), 2), i = d(String(e.getHours()), 2), j = d(String(e.getMinutes()), 2), k = d(String(e.getSeconds()), 2), l = f + g + h + i + j + k, c === !0 && (m = e.getMilliseconds(), 0 != m && (n = d(String(m), 3), n = n.replace(/[0]+$/, ""), l = l + "." + n)), l + "Z";}, this.zeroPadding = function (a, b) {return a.length >= b ? a : new Array(b - a.length + 1).join("0") + a;}, this.getString = function () {return this.s;}, this.setString = function (a) {this.hTLV = null, this.isModified = !0, this.s = a, this.hV = stohex(a);}, this.setByDateValue = function (a, b, c, d, e, f) {var g = new Date(Date.UTC(a, b - 1, c, d, e, f, 0));this.setByDate(g);}, this.getFreshValueHex = function () {return this.hV;};}, ob.lang.extend(pb.asn1.DERAbstractTime, pb.asn1.ASN1Object), pb.asn1.DERAbstractStructured = function (a) {pb.asn1.DERAbstractString.superclass.constructor.call(this), this.setByASN1ObjectArray = function (a) {this.hTLV = null, this.isModified = !0, this.asn1Array = a;}, this.appendASN1Object = function (a) {this.hTLV = null, this.isModified = !0, this.asn1Array.push(a);}, this.asn1Array = new Array(), "undefined" != typeof a && "undefined" != typeof a["array"] && (this.asn1Array = a["array"]);}, ob.lang.extend(pb.asn1.DERAbstractStructured, pb.asn1.ASN1Object), pb.asn1.DERBoolean = function () {pb.asn1.DERBoolean.superclass.constructor.call(this), this.hT = "01", this.hTLV = "0101ff";}, ob.lang.extend(pb.asn1.DERBoolean, pb.asn1.ASN1Object), pb.asn1.DERInteger = function (a) {pb.asn1.DERInteger.superclass.constructor.call(this), this.hT = "02", this.setByBigInteger = function (a) {this.hTLV = null, this.isModified = !0, this.hV = pb.asn1.ASN1Util.bigIntToMinTwosComplementsHex(a);}, this.setByInteger = function (a) {var b = new H(String(a), 10);this.setByBigInteger(b);}, this.setValueHex = function (a) {this.hV = a;}, this.getFreshValueHex = function () {return this.hV;}, "undefined" != typeof a && ("undefined" != typeof a["bigint"] ? this.setByBigInteger(a["bigint"]) : "undefined" != typeof a["int"] ? this.setByInteger(a["int"]) : "number" == typeof a ? this.setByInteger(a) : "undefined" != typeof a["hex"] && this.setValueHex(a["hex"]));}, ob.lang.extend(pb.asn1.DERInteger, pb.asn1.ASN1Object), pb.asn1.DERBitString = function (a) {if (void 0 !== a && "undefined" != typeof a.obj) {var b = pb.asn1.ASN1Util.newObject(a.obj);a.hex = "00" + b.getEncodedHex();}pb.asn1.DERBitString.superclass.constructor.call(this), this.hT = "03", this.setHexValueIncludingUnusedBits = function (a) {this.hTLV = null, this.isModified = !0, this.hV = a;}, this.setUnusedBitsAndHexValue = function (a, b) {if (0 > a || a > 7) throw "unused bits shall be from 0 to 7: u = " + a;var c = "0" + a;this.hTLV = null, this.isModified = !0, this.hV = c + b;}, this.setByBinaryString = function (a) {var b, c, d, e, f;for (a = a.replace(/0+$/, ""), b = 8 - a.length % 8, 8 == b && (b = 0), c = 0; b >= c; c++) {a += "0";}for (d = "", c = 0; c < a.length - 1; c += 8) {e = a.substr(c, 8), f = parseInt(e, 2).toString(16), 1 == f.length && (f = "0" + f), d += f;}this.hTLV = null, this.isModified = !0, this.hV = "0" + b + d;}, this.setByBooleanArray = function (a) {var c,b = "";for (c = 0; c < a.length; c++) {b += 1 == a[c] ? "1" : "0";}this.setByBinaryString(b);}, this.newFalseArray = function (a) {var c,b = new Array(a);for (c = 0; a > c; c++) {b[c] = !1;}return b;}, this.getFreshValueHex = function () {return this.hV;}, "undefined" != typeof a && ("string" == typeof a && a.toLowerCase().match(/^[0-9a-f]+$/) ? this.setHexValueIncludingUnusedBits(a) : "undefined" != typeof a["hex"] ? this.setHexValueIncludingUnusedBits(a["hex"]) : "undefined" != typeof a["bin"] ? this.setByBinaryString(a["bin"]) : "undefined" != typeof a["array"] && this.setByBooleanArray(a["array"]));}, ob.lang.extend(pb.asn1.DERBitString, pb.asn1.ASN1Object), pb.asn1.DEROctetString = function (a) {if (void 0 !== a && "undefined" != typeof a.obj) {var b = pb.asn1.ASN1Util.newObject(a.obj);a.hex = b.getEncodedHex();}pb.asn1.DEROctetString.superclass.constructor.call(this, a), this.hT = "04";}, ob.lang.extend(pb.asn1.DEROctetString, pb.asn1.DERAbstractString), pb.asn1.DERNull = function () {pb.asn1.DERNull.superclass.constructor.call(this), this.hT = "05", this.hTLV = "0500";}, ob.lang.extend(pb.asn1.DERNull, pb.asn1.ASN1Object), pb.asn1.DERObjectIdentifier = function (a) {var b = function b(a) {var b = a.toString(16);return 1 == b.length && (b = "0" + b), b;},c = function c(a) {var g,h,i,c = "",d = new H(a, 10),e = d.toString(2),f = 7 - e.length % 7;for (7 == f && (f = 0), g = "", h = 0; f > h; h++) {g += "0";}for (e = g + e, h = 0; h < e.length - 1; h += 7) {i = e.substr(h, 7), h != e.length - 7 && (i = "1" + i), c += b(parseInt(i, 2));}return c;};pb.asn1.DERObjectIdentifier.superclass.constructor.call(this), this.hT = "06", this.setValueHex = function (a) {this.hTLV = null, this.isModified = !0, this.s = null, this.hV = a;}, this.setValueOidString = function (a) {var d, e, f, g;if (!a.match(/^[0-9.]+$/)) throw "malformed oid string: " + a;for (d = "", e = a.split("."), f = 40 * parseInt(e[0]) + parseInt(e[1]), d += b(f), e.splice(0, 2), g = 0; g < e.length; g++) {d += c(e[g]);}this.hTLV = null, this.isModified = !0, this.s = null, this.hV = d;}, this.setValueName = function (a) {var b = pb.asn1.x509.OID.name2oid(a);if ("" === b) throw "DERObjectIdentifier oidName undefined: " + a;this.setValueOidString(b);}, this.getFreshValueHex = function () {return this.hV;}, void 0 !== a && ("string" == typeof a ? a.match(/^[0-2].[0-9.]+$/) ? this.setValueOidString(a) : this.setValueName(a) : void 0 !== a.oid ? this.setValueOidString(a.oid) : void 0 !== a.hex ? this.setValueHex(a.hex) : void 0 !== a.name && this.setValueName(a.name));}, ob.lang.extend(pb.asn1.DERObjectIdentifier, pb.asn1.ASN1Object), pb.asn1.DEREnumerated = function (a) {pb.asn1.DEREnumerated.superclass.constructor.call(this), this.hT = "0a", this.setByBigInteger = function (a) {this.hTLV = null, this.isModified = !0, this.hV = pb.asn1.ASN1Util.bigIntToMinTwosComplementsHex(a);}, this.setByInteger = function (a) {var b = new H(String(a), 10);this.setByBigInteger(b);}, this.setValueHex = function (a) {this.hV = a;}, this.getFreshValueHex = function () {return this.hV;}, "undefined" != typeof a && ("undefined" != typeof a["int"] ? this.setByInteger(a["int"]) : "number" == typeof a ? this.setByInteger(a) : "undefined" != typeof a["hex"] && this.setValueHex(a["hex"]));}, ob.lang.extend(pb.asn1.DEREnumerated, pb.asn1.ASN1Object), pb.asn1.DERUTF8String = function (a) {pb.asn1.DERUTF8String.superclass.constructor.call(this, a), this.hT = "0c";}, ob.lang.extend(pb.asn1.DERUTF8String, pb.asn1.DERAbstractString), pb.asn1.DERNumericString = function (a) {pb.asn1.DERNumericString.superclass.constructor.call(this, a), this.hT = "12";}, ob.lang.extend(pb.asn1.DERNumericString, pb.asn1.DERAbstractString), pb.asn1.DERPrintableString = function (a) {pb.asn1.DERPrintableString.superclass.constructor.call(this, a), this.hT = "13";}, ob.lang.extend(pb.asn1.DERPrintableString, pb.asn1.DERAbstractString), pb.asn1.DERTeletexString = function (a) {pb.asn1.DERTeletexString.superclass.constructor.call(this, a), this.hT = "14";}, ob.lang.extend(pb.asn1.DERTeletexString, pb.asn1.DERAbstractString), pb.asn1.DERIA5String = function (a) {pb.asn1.DERIA5String.superclass.constructor.call(this, a), this.hT = "16";}, ob.lang.extend(pb.asn1.DERIA5String, pb.asn1.DERAbstractString), pb.asn1.DERUTCTime = function (a) {pb.asn1.DERUTCTime.superclass.constructor.call(this, a), this.hT = "17", this.setByDate = function (a) {this.hTLV = null, this.isModified = !0, this.date = a, this.s = this.formatDate(this.date, "utc"), this.hV = stohex(this.s);}, this.getFreshValueHex = function () {return "undefined" == typeof this.date && "undefined" == typeof this.s && (this.date = new Date(), this.s = this.formatDate(this.date, "utc"), this.hV = stohex(this.s)), this.hV;}, void 0 !== a && (void 0 !== a.str ? this.setString(a.str) : "string" == typeof a && a.match(/^[0-9]{12}Z$/) ? this.setString(a) : void 0 !== a.hex ? this.setStringHex(a.hex) : void 0 !== a.date && this.setByDate(a.date));
  10181. }, ob.lang.extend(pb.asn1.DERUTCTime, pb.asn1.DERAbstractTime), pb.asn1.DERGeneralizedTime = function (a) {pb.asn1.DERGeneralizedTime.superclass.constructor.call(this, a), this.hT = "18", this.withMillis = !1, this.setByDate = function (a) {this.hTLV = null, this.isModified = !0, this.date = a, this.s = this.formatDate(this.date, "gen", this.withMillis), this.hV = stohex(this.s);}, this.getFreshValueHex = function () {return void 0 === this.date && void 0 === this.s && (this.date = new Date(), this.s = this.formatDate(this.date, "gen", this.withMillis), this.hV = stohex(this.s)), this.hV;}, void 0 !== a && (void 0 !== a.str ? this.setString(a.str) : "string" == typeof a && a.match(/^[0-9]{14}Z$/) ? this.setString(a) : void 0 !== a.hex ? this.setStringHex(a.hex) : void 0 !== a.date && this.setByDate(a.date), a.millis === !0 && (this.withMillis = !0));}, ob.lang.extend(pb.asn1.DERGeneralizedTime, pb.asn1.DERAbstractTime), pb.asn1.DERSequence = function (a) {pb.asn1.DERSequence.superclass.constructor.call(this, a), this.hT = "30", this.getFreshValueHex = function () {var b,c,a = "";for (b = 0; b < this.asn1Array.length; b++) {c = this.asn1Array[b], a += c.getEncodedHex();}return this.hV = a, this.hV;};}, ob.lang.extend(pb.asn1.DERSequence, pb.asn1.DERAbstractStructured), pb.asn1.DERSet = function (a) {pb.asn1.DERSet.superclass.constructor.call(this, a), this.hT = "31", this.sortFlag = !0, this.getFreshValueHex = function () {var b,c,a = new Array();for (b = 0; b < this.asn1Array.length; b++) {c = this.asn1Array[b], a.push(c.getEncodedHex());}return 1 == this.sortFlag && a.sort(), this.hV = a.join(""), this.hV;}, "undefined" != typeof a && "undefined" != typeof a.sortflag && 0 == a.sortflag && (this.sortFlag = !1);}, ob.lang.extend(pb.asn1.DERSet, pb.asn1.DERAbstractStructured), pb.asn1.DERTaggedObject = function (a) {pb.asn1.DERTaggedObject.superclass.constructor.call(this), this.hT = "a0", this.hV = "", this.isExplicit = !0, this.asn1Object = null, this.setASN1Object = function (a, b, c) {this.hT = b, this.isExplicit = a, this.asn1Object = c, this.isExplicit ? (this.hV = this.asn1Object.getEncodedHex(), this.hTLV = null, this.isModified = !0) : (this.hV = null, this.hTLV = c.getEncodedHex(), this.hTLV = this.hTLV.replace(/^../, b), this.isModified = !1);}, this.getFreshValueHex = function () {return this.hV;}, "undefined" != typeof a && ("undefined" != typeof a["tag"] && (this.hT = a["tag"]), "undefined" != typeof a["explicit"] && (this.isExplicit = a["explicit"]), "undefined" != typeof a["obj"] && (this.asn1Object = a["obj"], this.setASN1Object(this.isExplicit, this.hT, this.asn1Object)));}, ob.lang.extend(pb.asn1.DERTaggedObject, pb.asn1.ASN1Object), qb = function (a) {function b(c) {var d = a.call(this) || this;return c && ("string" == typeof c ? d.parseKey(c) : (b.hasPrivateKeyProperty(c) || b.hasPublicKeyProperty(c)) && d.parsePropertiesFrom(c)), d;}return o(b, a), b.prototype.parseKey = function (a) {var b, c, d, e, f, g, h, i, j, k, l, m, n;try {if (b = 0, c = 0, d = /^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/, e = d.test(a) ? q.decode(a) : s.unarmor(a), f = A.decode(e), 3 === f.sub.length && (f = f.sub[2].sub[0]), 9 === f.sub.length) b = f.sub[1].getHexStringValue(), this.n = N(b, 16), c = f.sub[2].getHexStringValue(), this.e = parseInt(c, 16), g = f.sub[3].getHexStringValue(), this.d = N(g, 16), h = f.sub[4].getHexStringValue(), this.p = N(h, 16), i = f.sub[5].getHexStringValue(), this.q = N(i, 16), j = f.sub[6].getHexStringValue(), this.dmp1 = N(j, 16), k = f.sub[7].getHexStringValue(), this.dmq1 = N(k, 16), l = f.sub[8].getHexStringValue(), this.coeff = N(l, 16);else {if (2 !== f.sub.length) return !1;m = f.sub[1], n = m.sub[0], b = n.sub[0].getHexStringValue(), this.n = N(b, 16), c = n.sub[1].getHexStringValue(), this.e = parseInt(c, 16);}return !0;} catch (o) {return !1;}}, b.prototype.getPrivateBaseKey = function () {var a = { array: [new pb.asn1.DERInteger({ "int": 0 }), new pb.asn1.DERInteger({ bigint: this.n }), new pb.asn1.DERInteger({ "int": this.e }), new pb.asn1.DERInteger({ bigint: this.d }), new pb.asn1.DERInteger({ bigint: this.p }), new pb.asn1.DERInteger({ bigint: this.q }), new pb.asn1.DERInteger({ bigint: this.dmp1 }), new pb.asn1.DERInteger({ bigint: this.dmq1 }), new pb.asn1.DERInteger({ bigint: this.coeff })] },b = new pb.asn1.DERSequence(a);return b.getEncodedHex();}, b.prototype.getPrivateBaseKeyB64 = function () {return l(this.getPrivateBaseKey());}, b.prototype.getPublicBaseKey = function () {var a = new pb.asn1.DERSequence({ array: [new pb.asn1.DERObjectIdentifier({ oid: "1.2.840.113549.1.1.1" }), new pb.asn1.DERNull()] }),b = new pb.asn1.DERSequence({ array: [new pb.asn1.DERInteger({ bigint: this.n }), new pb.asn1.DERInteger({ "int": this.e })] }),c = new pb.asn1.DERBitString({ hex: "00" + b.getEncodedHex() }),d = new pb.asn1.DERSequence({ array: [a, c] });return d.getEncodedHex();}, b.prototype.getPublicBaseKeyB64 = function () {return l(this.getPublicBaseKey());}, b.wordwrap = function (a, b) {if (b = b || 64, !a) return a;var c = "(.{1," + b + "})( +|$\n?)|(.{1," + b + "})";return a.match(RegExp(c, "g")).join("\n");}, b.prototype.getPrivateKey = function () {var a = "-----BEGIN RSA PRIVATE KEY-----\n";return a += b.wordwrap(this.getPrivateBaseKeyB64()) + "\n", a += "-----END RSA PRIVATE KEY-----";}, b.prototype.getPublicKey = function () {var a = "-----BEGIN PUBLIC KEY-----\n";return a += b.wordwrap(this.getPublicBaseKeyB64()) + "\n", a += "-----END PUBLIC KEY-----";}, b.hasPublicKeyProperty = function (a) {return a = a || {}, a.hasOwnProperty("n") && a.hasOwnProperty("e");}, b.hasPrivateKeyProperty = function (a) {return a = a || {}, a.hasOwnProperty("n") && a.hasOwnProperty("e") && a.hasOwnProperty("d") && a.hasOwnProperty("p") && a.hasOwnProperty("q") && a.hasOwnProperty("dmp1") && a.hasOwnProperty("dmq1") && a.hasOwnProperty("coeff");}, b.prototype.parsePropertiesFrom = function (a) {this.n = a.n, this.e = a.e, a.hasOwnProperty("d") && (this.d = a.d, this.p = a.p, this.q = a.q, this.dmp1 = a.dmp1, this.dmq1 = a.dmq1, this.coeff = a.coeff);}, b;}(jb), rb = function () {function a(a) {a = a || {}, this.default_key_size = parseInt(a.default_key_size, 10) || 1024, this.default_public_exponent = a.default_public_exponent || "010001", this.log = a.log || !1, this.key = null;}return a.prototype.setKey = function (a) {this.log && this.key && console.warn("A key was already set, overriding existing."), this.key = new qb(a);}, a.prototype.setPrivateKey = function (a) {this.setKey(a);}, a.prototype.setPublicKey = function (a) {this.setKey(a);}, a.prototype.decrypt = function (a) {try {return this.getKey().decrypt(m(a));} catch (b) {return !1;}}, a.prototype.encrypt = function (a) {try {return l(this.getKey().encrypt(a));} catch (b) {return !1;}}, a.prototype.sign = function (a, b, c) {try {return l(this.getKey().sign(a, b, c));} catch (d) {return !1;}}, a.prototype.verify = function (a, b, c) {try {return this.getKey().verify(a, m(b), c);} catch (d) {return !1;}}, a.prototype.getKey = function (a) {if (!this.key) {if (this.key = new qb(), a && "[object Function]" === {}.toString.call(a)) return this.key.generateAsync(this.default_key_size, this.default_public_exponent, a), void 0;this.key.generate(this.default_key_size, this.default_public_exponent);}return this.key;}, a.prototype.getPrivateKey = function () {return this.getKey().getPrivateKey();}, a.prototype.getPrivateKeyB64 = function () {return this.getKey().getPrivateBaseKeyB64();}, a.prototype.getPublicKey = function () {return this.getKey().getPublicKey();}, a.prototype.getPublicKeyB64 = function () {return this.getKey().getPublicBaseKeyB64();}, a.version = "3.0.0-rc.1", a;}(), a.JSEncrypt = rb, a.default = rb, Object.defineProperty(a, "__esModule", { value: !0 });});
  10182. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/webpack/buildin/global.js */ 2)))
  10183. /***/ }),
  10184. /* 77 */
  10185. /*!*************************************************!*\
  10186. !*** ./node_modules/crypto-browserify/index.js ***!
  10187. \*************************************************/
  10188. /*! no static exports found */
  10189. /***/ (function(module, exports, __webpack_require__) {
  10190. "use strict";
  10191. exports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = __webpack_require__(/*! randombytes */ 78)
  10192. exports.createHash = exports.Hash = __webpack_require__(/*! create-hash */ 86)
  10193. exports.createHmac = exports.Hmac = __webpack_require__(/*! create-hmac */ 121)
  10194. var algos = __webpack_require__(/*! browserify-sign/algos */ 124)
  10195. var algoKeys = Object.keys(algos)
  10196. var hashes = ['sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'md5', 'rmd160'].concat(algoKeys)
  10197. exports.getHashes = function () {
  10198. return hashes
  10199. }
  10200. var p = __webpack_require__(/*! pbkdf2 */ 126)
  10201. exports.pbkdf2 = p.pbkdf2
  10202. exports.pbkdf2Sync = p.pbkdf2Sync
  10203. var aes = __webpack_require__(/*! browserify-cipher */ 132)
  10204. exports.Cipher = aes.Cipher
  10205. exports.createCipher = aes.createCipher
  10206. exports.Cipheriv = aes.Cipheriv
  10207. exports.createCipheriv = aes.createCipheriv
  10208. exports.Decipher = aes.Decipher
  10209. exports.createDecipher = aes.createDecipher
  10210. exports.Decipheriv = aes.Decipheriv
  10211. exports.createDecipheriv = aes.createDecipheriv
  10212. exports.getCiphers = aes.getCiphers
  10213. exports.listCiphers = aes.listCiphers
  10214. var dh = __webpack_require__(/*! diffie-hellman */ 161)
  10215. exports.DiffieHellmanGroup = dh.DiffieHellmanGroup
  10216. exports.createDiffieHellmanGroup = dh.createDiffieHellmanGroup
  10217. exports.getDiffieHellman = dh.getDiffieHellman
  10218. exports.createDiffieHellman = dh.createDiffieHellman
  10219. exports.DiffieHellman = dh.DiffieHellman
  10220. var sign = __webpack_require__(/*! browserify-sign */ 171)
  10221. exports.createSign = sign.createSign
  10222. exports.Sign = sign.Sign
  10223. exports.createVerify = sign.createVerify
  10224. exports.Verify = sign.Verify
  10225. exports.createECDH = __webpack_require__(/*! create-ecdh */ 226)
  10226. var publicEncrypt = __webpack_require__(/*! public-encrypt */ 227)
  10227. exports.publicEncrypt = publicEncrypt.publicEncrypt
  10228. exports.privateEncrypt = publicEncrypt.privateEncrypt
  10229. exports.publicDecrypt = publicEncrypt.publicDecrypt
  10230. exports.privateDecrypt = publicEncrypt.privateDecrypt
  10231. // the least I can do is make error messages for the rest of the node.js/crypto api.
  10232. // ;[
  10233. // 'createCredentials'
  10234. // ].forEach(function (name) {
  10235. // exports[name] = function () {
  10236. // throw new Error([
  10237. // 'sorry, ' + name + ' is not implemented yet',
  10238. // 'we accept pull requests',
  10239. // 'https://github.com/crypto-browserify/crypto-browserify'
  10240. // ].join('\n'))
  10241. // }
  10242. // })
  10243. var rf = __webpack_require__(/*! randomfill */ 233)
  10244. exports.randomFill = rf.randomFill
  10245. exports.randomFillSync = rf.randomFillSync
  10246. exports.createCredentials = function () {
  10247. throw new Error([
  10248. 'sorry, createCredentials is not implemented yet',
  10249. 'we accept pull requests',
  10250. 'https://github.com/crypto-browserify/crypto-browserify'
  10251. ].join('\n'))
  10252. }
  10253. exports.constants = {
  10254. 'DH_CHECK_P_NOT_SAFE_PRIME': 2,
  10255. 'DH_CHECK_P_NOT_PRIME': 1,
  10256. 'DH_UNABLE_TO_CHECK_GENERATOR': 4,
  10257. 'DH_NOT_SUITABLE_GENERATOR': 8,
  10258. 'NPN_ENABLED': 1,
  10259. 'ALPN_ENABLED': 1,
  10260. 'RSA_PKCS1_PADDING': 1,
  10261. 'RSA_SSLV23_PADDING': 2,
  10262. 'RSA_NO_PADDING': 3,
  10263. 'RSA_PKCS1_OAEP_PADDING': 4,
  10264. 'RSA_X931_PADDING': 5,
  10265. 'RSA_PKCS1_PSS_PADDING': 6,
  10266. 'POINT_CONVERSION_COMPRESSED': 2,
  10267. 'POINT_CONVERSION_UNCOMPRESSED': 4,
  10268. 'POINT_CONVERSION_HYBRID': 6
  10269. }
  10270. /***/ }),
  10271. /* 78 */
  10272. /*!*********************************************!*\
  10273. !*** ./node_modules/randombytes/browser.js ***!
  10274. \*********************************************/
  10275. /*! no static exports found */
  10276. /***/ (function(module, exports, __webpack_require__) {
  10277. "use strict";
  10278. /* WEBPACK VAR INJECTION */(function(global, process) {
  10279. // limit of Crypto.getRandomValues()
  10280. // https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues
  10281. var MAX_BYTES = 65536
  10282. // Node supports requesting up to this number of bytes
  10283. // https://github.com/nodejs/node/blob/master/lib/internal/crypto/random.js#L48
  10284. var MAX_UINT32 = 4294967295
  10285. function oldBrowser () {
  10286. throw new Error('Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11')
  10287. }
  10288. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  10289. var crypto = global.crypto || global.msCrypto
  10290. if (crypto && crypto.getRandomValues) {
  10291. module.exports = randomBytes
  10292. } else {
  10293. module.exports = oldBrowser
  10294. }
  10295. function randomBytes (size, cb) {
  10296. // phantomjs needs to throw
  10297. if (size > MAX_UINT32) throw new RangeError('requested too many random bytes')
  10298. var bytes = Buffer.allocUnsafe(size)
  10299. if (size > 0) { // getRandomValues fails on IE if size == 0
  10300. if (size > MAX_BYTES) { // this is the max bytes crypto.getRandomValues
  10301. // can do at once see https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues
  10302. for (var generated = 0; generated < size; generated += MAX_BYTES) {
  10303. // buffer.slice automatically checks if the end is past the end of
  10304. // the buffer so we don't have to here
  10305. crypto.getRandomValues(bytes.slice(generated, generated + MAX_BYTES))
  10306. }
  10307. } else {
  10308. crypto.getRandomValues(bytes)
  10309. }
  10310. }
  10311. if (typeof cb === 'function') {
  10312. return process.nextTick(function () {
  10313. cb(null, bytes)
  10314. })
  10315. }
  10316. return bytes
  10317. }
  10318. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ 2), __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 79)))
  10319. /***/ }),
  10320. /* 79 */
  10321. /*!********************************************************!*\
  10322. !*** ./node_modules/node-libs-browser/mock/process.js ***!
  10323. \********************************************************/
  10324. /*! no static exports found */
  10325. /***/ (function(module, exports, __webpack_require__) {
  10326. exports.nextTick = function nextTick(fn) {
  10327. var args = Array.prototype.slice.call(arguments);
  10328. args.shift();
  10329. setTimeout(function () {
  10330. fn.apply(null, args);
  10331. }, 0);
  10332. };
  10333. exports.platform = exports.arch =
  10334. exports.execPath = exports.title = 'browser';
  10335. exports.pid = 1;
  10336. exports.browser = true;
  10337. exports.env = {};
  10338. exports.argv = [];
  10339. exports.binding = function (name) {
  10340. throw new Error('No such module. (Possibly not yet loaded)')
  10341. };
  10342. (function () {
  10343. var cwd = '/';
  10344. var path;
  10345. exports.cwd = function () { return cwd };
  10346. exports.chdir = function (dir) {
  10347. if (!path) path = __webpack_require__(/*! path */ 80);
  10348. cwd = path.resolve(dir, cwd);
  10349. };
  10350. })();
  10351. exports.exit = exports.kill =
  10352. exports.umask = exports.dlopen =
  10353. exports.uptime = exports.memoryUsage =
  10354. exports.uvCounters = function() {};
  10355. exports.features = {};
  10356. /***/ }),
  10357. /* 80 */
  10358. /*!***********************************************!*\
  10359. !*** ./node_modules/path-browserify/index.js ***!
  10360. \***********************************************/
  10361. /*! no static exports found */
  10362. /***/ (function(module, exports, __webpack_require__) {
  10363. /* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,
  10364. // backported and transplited with Babel, with backwards-compat fixes
  10365. // Copyright Joyent, Inc. and other Node contributors.
  10366. //
  10367. // Permission is hereby granted, free of charge, to any person obtaining a
  10368. // copy of this software and associated documentation files (the
  10369. // "Software"), to deal in the Software without restriction, including
  10370. // without limitation the rights to use, copy, modify, merge, publish,
  10371. // distribute, sublicense, and/or sell copies of the Software, and to permit
  10372. // persons to whom the Software is furnished to do so, subject to the
  10373. // following conditions:
  10374. //
  10375. // The above copyright notice and this permission notice shall be included
  10376. // in all copies or substantial portions of the Software.
  10377. //
  10378. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  10379. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  10380. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  10381. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  10382. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  10383. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  10384. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  10385. // resolves . and .. elements in a path array with directory names there
  10386. // must be no slashes, empty elements, or device names (c:\) in the array
  10387. // (so also no leading and trailing slashes - it does not distinguish
  10388. // relative and absolute paths)
  10389. function normalizeArray(parts, allowAboveRoot) {
  10390. // if the path tries to go above the root, `up` ends up > 0
  10391. var up = 0;
  10392. for (var i = parts.length - 1; i >= 0; i--) {
  10393. var last = parts[i];
  10394. if (last === '.') {
  10395. parts.splice(i, 1);
  10396. } else if (last === '..') {
  10397. parts.splice(i, 1);
  10398. up++;
  10399. } else if (up) {
  10400. parts.splice(i, 1);
  10401. up--;
  10402. }
  10403. }
  10404. // if the path is allowed to go above the root, restore leading ..s
  10405. if (allowAboveRoot) {
  10406. for (; up--; up) {
  10407. parts.unshift('..');
  10408. }
  10409. }
  10410. return parts;
  10411. }
  10412. // path.resolve([from ...], to)
  10413. // posix version
  10414. exports.resolve = function() {
  10415. var resolvedPath = '',
  10416. resolvedAbsolute = false;
  10417. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  10418. var path = (i >= 0) ? arguments[i] : process.cwd();
  10419. // Skip empty and invalid entries
  10420. if (typeof path !== 'string') {
  10421. throw new TypeError('Arguments to path.resolve must be strings');
  10422. } else if (!path) {
  10423. continue;
  10424. }
  10425. resolvedPath = path + '/' + resolvedPath;
  10426. resolvedAbsolute = path.charAt(0) === '/';
  10427. }
  10428. // At this point the path should be resolved to a full absolute path, but
  10429. // handle relative paths to be safe (might happen when process.cwd() fails)
  10430. // Normalize the path
  10431. resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
  10432. return !!p;
  10433. }), !resolvedAbsolute).join('/');
  10434. return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
  10435. };
  10436. // path.normalize(path)
  10437. // posix version
  10438. exports.normalize = function(path) {
  10439. var isAbsolute = exports.isAbsolute(path),
  10440. trailingSlash = substr(path, -1) === '/';
  10441. // Normalize the path
  10442. path = normalizeArray(filter(path.split('/'), function(p) {
  10443. return !!p;
  10444. }), !isAbsolute).join('/');
  10445. if (!path && !isAbsolute) {
  10446. path = '.';
  10447. }
  10448. if (path && trailingSlash) {
  10449. path += '/';
  10450. }
  10451. return (isAbsolute ? '/' : '') + path;
  10452. };
  10453. // posix version
  10454. exports.isAbsolute = function(path) {
  10455. return path.charAt(0) === '/';
  10456. };
  10457. // posix version
  10458. exports.join = function() {
  10459. var paths = Array.prototype.slice.call(arguments, 0);
  10460. return exports.normalize(filter(paths, function(p, index) {
  10461. if (typeof p !== 'string') {
  10462. throw new TypeError('Arguments to path.join must be strings');
  10463. }
  10464. return p;
  10465. }).join('/'));
  10466. };
  10467. // path.relative(from, to)
  10468. // posix version
  10469. exports.relative = function(from, to) {
  10470. from = exports.resolve(from).substr(1);
  10471. to = exports.resolve(to).substr(1);
  10472. function trim(arr) {
  10473. var start = 0;
  10474. for (; start < arr.length; start++) {
  10475. if (arr[start] !== '') break;
  10476. }
  10477. var end = arr.length - 1;
  10478. for (; end >= 0; end--) {
  10479. if (arr[end] !== '') break;
  10480. }
  10481. if (start > end) return [];
  10482. return arr.slice(start, end - start + 1);
  10483. }
  10484. var fromParts = trim(from.split('/'));
  10485. var toParts = trim(to.split('/'));
  10486. var length = Math.min(fromParts.length, toParts.length);
  10487. var samePartsLength = length;
  10488. for (var i = 0; i < length; i++) {
  10489. if (fromParts[i] !== toParts[i]) {
  10490. samePartsLength = i;
  10491. break;
  10492. }
  10493. }
  10494. var outputParts = [];
  10495. for (var i = samePartsLength; i < fromParts.length; i++) {
  10496. outputParts.push('..');
  10497. }
  10498. outputParts = outputParts.concat(toParts.slice(samePartsLength));
  10499. return outputParts.join('/');
  10500. };
  10501. exports.sep = '/';
  10502. exports.delimiter = ':';
  10503. exports.dirname = function (path) {
  10504. if (typeof path !== 'string') path = path + '';
  10505. if (path.length === 0) return '.';
  10506. var code = path.charCodeAt(0);
  10507. var hasRoot = code === 47 /*/*/;
  10508. var end = -1;
  10509. var matchedSlash = true;
  10510. for (var i = path.length - 1; i >= 1; --i) {
  10511. code = path.charCodeAt(i);
  10512. if (code === 47 /*/*/) {
  10513. if (!matchedSlash) {
  10514. end = i;
  10515. break;
  10516. }
  10517. } else {
  10518. // We saw the first non-path separator
  10519. matchedSlash = false;
  10520. }
  10521. }
  10522. if (end === -1) return hasRoot ? '/' : '.';
  10523. if (hasRoot && end === 1) {
  10524. // return '//';
  10525. // Backwards-compat fix:
  10526. return '/';
  10527. }
  10528. return path.slice(0, end);
  10529. };
  10530. function basename(path) {
  10531. if (typeof path !== 'string') path = path + '';
  10532. var start = 0;
  10533. var end = -1;
  10534. var matchedSlash = true;
  10535. var i;
  10536. for (i = path.length - 1; i >= 0; --i) {
  10537. if (path.charCodeAt(i) === 47 /*/*/) {
  10538. // If we reached a path separator that was not part of a set of path
  10539. // separators at the end of the string, stop now
  10540. if (!matchedSlash) {
  10541. start = i + 1;
  10542. break;
  10543. }
  10544. } else if (end === -1) {
  10545. // We saw the first non-path separator, mark this as the end of our
  10546. // path component
  10547. matchedSlash = false;
  10548. end = i + 1;
  10549. }
  10550. }
  10551. if (end === -1) return '';
  10552. return path.slice(start, end);
  10553. }
  10554. // Uses a mixed approach for backwards-compatibility, as ext behavior changed
  10555. // in new Node.js versions, so only basename() above is backported here
  10556. exports.basename = function (path, ext) {
  10557. var f = basename(path);
  10558. if (ext && f.substr(-1 * ext.length) === ext) {
  10559. f = f.substr(0, f.length - ext.length);
  10560. }
  10561. return f;
  10562. };
  10563. exports.extname = function (path) {
  10564. if (typeof path !== 'string') path = path + '';
  10565. var startDot = -1;
  10566. var startPart = 0;
  10567. var end = -1;
  10568. var matchedSlash = true;
  10569. // Track the state of characters (if any) we see before our first dot and
  10570. // after any path separator we find
  10571. var preDotState = 0;
  10572. for (var i = path.length - 1; i >= 0; --i) {
  10573. var code = path.charCodeAt(i);
  10574. if (code === 47 /*/*/) {
  10575. // If we reached a path separator that was not part of a set of path
  10576. // separators at the end of the string, stop now
  10577. if (!matchedSlash) {
  10578. startPart = i + 1;
  10579. break;
  10580. }
  10581. continue;
  10582. }
  10583. if (end === -1) {
  10584. // We saw the first non-path separator, mark this as the end of our
  10585. // extension
  10586. matchedSlash = false;
  10587. end = i + 1;
  10588. }
  10589. if (code === 46 /*.*/) {
  10590. // If this is our first dot, mark it as the start of our extension
  10591. if (startDot === -1)
  10592. startDot = i;
  10593. else if (preDotState !== 1)
  10594. preDotState = 1;
  10595. } else if (startDot !== -1) {
  10596. // We saw a non-dot and non-path separator before our dot, so we should
  10597. // have a good chance at having a non-empty extension
  10598. preDotState = -1;
  10599. }
  10600. }
  10601. if (startDot === -1 || end === -1 ||
  10602. // We saw a non-dot character immediately before the dot
  10603. preDotState === 0 ||
  10604. // The (right-most) trimmed path component is exactly '..'
  10605. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  10606. return '';
  10607. }
  10608. return path.slice(startDot, end);
  10609. };
  10610. function filter (xs, f) {
  10611. if (xs.filter) return xs.filter(f);
  10612. var res = [];
  10613. for (var i = 0; i < xs.length; i++) {
  10614. if (f(xs[i], i, xs)) res.push(xs[i]);
  10615. }
  10616. return res;
  10617. }
  10618. // String.prototype.substr - negative index don't work in IE8
  10619. var substr = 'ab'.substr(-1) === 'b'
  10620. ? function (str, start, len) { return str.substr(start, len) }
  10621. : function (str, start, len) {
  10622. if (start < 0) start = str.length + start;
  10623. return str.substr(start, len);
  10624. }
  10625. ;
  10626. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 79)))
  10627. /***/ }),
  10628. /* 81 */
  10629. /*!*******************************************!*\
  10630. !*** ./node_modules/safe-buffer/index.js ***!
  10631. \*******************************************/
  10632. /*! no static exports found */
  10633. /***/ (function(module, exports, __webpack_require__) {
  10634. /* eslint-disable node/no-deprecated-api */
  10635. var buffer = __webpack_require__(/*! buffer */ 82)
  10636. var Buffer = buffer.Buffer
  10637. // alternative to using Object.keys for old browsers
  10638. function copyProps (src, dst) {
  10639. for (var key in src) {
  10640. dst[key] = src[key]
  10641. }
  10642. }
  10643. if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
  10644. module.exports = buffer
  10645. } else {
  10646. // Copy properties from require('buffer')
  10647. copyProps(buffer, exports)
  10648. exports.Buffer = SafeBuffer
  10649. }
  10650. function SafeBuffer (arg, encodingOrOffset, length) {
  10651. return Buffer(arg, encodingOrOffset, length)
  10652. }
  10653. // Copy static methods from Buffer
  10654. copyProps(Buffer, SafeBuffer)
  10655. SafeBuffer.from = function (arg, encodingOrOffset, length) {
  10656. if (typeof arg === 'number') {
  10657. throw new TypeError('Argument must not be a number')
  10658. }
  10659. return Buffer(arg, encodingOrOffset, length)
  10660. }
  10661. SafeBuffer.alloc = function (size, fill, encoding) {
  10662. if (typeof size !== 'number') {
  10663. throw new TypeError('Argument must be a number')
  10664. }
  10665. var buf = Buffer(size)
  10666. if (fill !== undefined) {
  10667. if (typeof encoding === 'string') {
  10668. buf.fill(fill, encoding)
  10669. } else {
  10670. buf.fill(fill)
  10671. }
  10672. } else {
  10673. buf.fill(0)
  10674. }
  10675. return buf
  10676. }
  10677. SafeBuffer.allocUnsafe = function (size) {
  10678. if (typeof size !== 'number') {
  10679. throw new TypeError('Argument must be a number')
  10680. }
  10681. return Buffer(size)
  10682. }
  10683. SafeBuffer.allocUnsafeSlow = function (size) {
  10684. if (typeof size !== 'number') {
  10685. throw new TypeError('Argument must be a number')
  10686. }
  10687. return buffer.SlowBuffer(size)
  10688. }
  10689. /***/ }),
  10690. /* 82 */
  10691. /*!**************************************!*\
  10692. !*** ./node_modules/buffer/index.js ***!
  10693. \**************************************/
  10694. /*! no static exports found */
  10695. /***/ (function(module, exports, __webpack_require__) {
  10696. "use strict";
  10697. /* WEBPACK VAR INJECTION */(function(global) {/*!
  10698. * The buffer module from node.js, for the browser.
  10699. *
  10700. * @author Feross Aboukhadijeh <http://feross.org>
  10701. * @license MIT
  10702. */
  10703. /* eslint-disable no-proto */
  10704. var base64 = __webpack_require__(/*! base64-js */ 83)
  10705. var ieee754 = __webpack_require__(/*! ieee754 */ 84)
  10706. var isArray = __webpack_require__(/*! isarray */ 85)
  10707. exports.Buffer = Buffer
  10708. exports.SlowBuffer = SlowBuffer
  10709. exports.INSPECT_MAX_BYTES = 50
  10710. /**
  10711. * If `Buffer.TYPED_ARRAY_SUPPORT`:
  10712. * === true Use Uint8Array implementation (fastest)
  10713. * === false Use Object implementation (most compatible, even IE6)
  10714. *
  10715. * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
  10716. * Opera 11.6+, iOS 4.2+.
  10717. *
  10718. * Due to various browser bugs, sometimes the Object implementation will be used even
  10719. * when the browser supports typed arrays.
  10720. *
  10721. * Note:
  10722. *
  10723. * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
  10724. * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
  10725. *
  10726. * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
  10727. *
  10728. * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
  10729. * incorrect length in some situations.
  10730. * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
  10731. * get the Object implementation, which is slower but behaves correctly.
  10732. */
  10733. Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
  10734. ? global.TYPED_ARRAY_SUPPORT
  10735. : typedArraySupport()
  10736. /*
  10737. * Export kMaxLength after typed array support is determined.
  10738. */
  10739. exports.kMaxLength = kMaxLength()
  10740. function typedArraySupport () {
  10741. try {
  10742. var arr = new Uint8Array(1)
  10743. arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
  10744. return arr.foo() === 42 && // typed array instances can be augmented
  10745. typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
  10746. arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
  10747. } catch (e) {
  10748. return false
  10749. }
  10750. }
  10751. function kMaxLength () {
  10752. return Buffer.TYPED_ARRAY_SUPPORT
  10753. ? 0x7fffffff
  10754. : 0x3fffffff
  10755. }
  10756. function createBuffer (that, length) {
  10757. if (kMaxLength() < length) {
  10758. throw new RangeError('Invalid typed array length')
  10759. }
  10760. if (Buffer.TYPED_ARRAY_SUPPORT) {
  10761. // Return an augmented `Uint8Array` instance, for best performance
  10762. that = new Uint8Array(length)
  10763. that.__proto__ = Buffer.prototype
  10764. } else {
  10765. // Fallback: Return an object instance of the Buffer class
  10766. if (that === null) {
  10767. that = new Buffer(length)
  10768. }
  10769. that.length = length
  10770. }
  10771. return that
  10772. }
  10773. /**
  10774. * The Buffer constructor returns instances of `Uint8Array` that have their
  10775. * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
  10776. * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
  10777. * and the `Uint8Array` methods. Square bracket notation works as expected -- it
  10778. * returns a single octet.
  10779. *
  10780. * The `Uint8Array` prototype remains unmodified.
  10781. */
  10782. function Buffer (arg, encodingOrOffset, length) {
  10783. if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
  10784. return new Buffer(arg, encodingOrOffset, length)
  10785. }
  10786. // Common case.
  10787. if (typeof arg === 'number') {
  10788. if (typeof encodingOrOffset === 'string') {
  10789. throw new Error(
  10790. 'If encoding is specified then the first argument must be a string'
  10791. )
  10792. }
  10793. return allocUnsafe(this, arg)
  10794. }
  10795. return from(this, arg, encodingOrOffset, length)
  10796. }
  10797. Buffer.poolSize = 8192 // not used by this implementation
  10798. // TODO: Legacy, not needed anymore. Remove in next major version.
  10799. Buffer._augment = function (arr) {
  10800. arr.__proto__ = Buffer.prototype
  10801. return arr
  10802. }
  10803. function from (that, value, encodingOrOffset, length) {
  10804. if (typeof value === 'number') {
  10805. throw new TypeError('"value" argument must not be a number')
  10806. }
  10807. if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
  10808. return fromArrayBuffer(that, value, encodingOrOffset, length)
  10809. }
  10810. if (typeof value === 'string') {
  10811. return fromString(that, value, encodingOrOffset)
  10812. }
  10813. return fromObject(that, value)
  10814. }
  10815. /**
  10816. * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
  10817. * if value is a number.
  10818. * Buffer.from(str[, encoding])
  10819. * Buffer.from(array)
  10820. * Buffer.from(buffer)
  10821. * Buffer.from(arrayBuffer[, byteOffset[, length]])
  10822. **/
  10823. Buffer.from = function (value, encodingOrOffset, length) {
  10824. return from(null, value, encodingOrOffset, length)
  10825. }
  10826. if (Buffer.TYPED_ARRAY_SUPPORT) {
  10827. Buffer.prototype.__proto__ = Uint8Array.prototype
  10828. Buffer.__proto__ = Uint8Array
  10829. if (typeof Symbol !== 'undefined' && Symbol.species &&
  10830. Buffer[Symbol.species] === Buffer) {
  10831. // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
  10832. Object.defineProperty(Buffer, Symbol.species, {
  10833. value: null,
  10834. configurable: true
  10835. })
  10836. }
  10837. }
  10838. function assertSize (size) {
  10839. if (typeof size !== 'number') {
  10840. throw new TypeError('"size" argument must be a number')
  10841. } else if (size < 0) {
  10842. throw new RangeError('"size" argument must not be negative')
  10843. }
  10844. }
  10845. function alloc (that, size, fill, encoding) {
  10846. assertSize(size)
  10847. if (size <= 0) {
  10848. return createBuffer(that, size)
  10849. }
  10850. if (fill !== undefined) {
  10851. // Only pay attention to encoding if it's a string. This
  10852. // prevents accidentally sending in a number that would
  10853. // be interpretted as a start offset.
  10854. return typeof encoding === 'string'
  10855. ? createBuffer(that, size).fill(fill, encoding)
  10856. : createBuffer(that, size).fill(fill)
  10857. }
  10858. return createBuffer(that, size)
  10859. }
  10860. /**
  10861. * Creates a new filled Buffer instance.
  10862. * alloc(size[, fill[, encoding]])
  10863. **/
  10864. Buffer.alloc = function (size, fill, encoding) {
  10865. return alloc(null, size, fill, encoding)
  10866. }
  10867. function allocUnsafe (that, size) {
  10868. assertSize(size)
  10869. that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
  10870. if (!Buffer.TYPED_ARRAY_SUPPORT) {
  10871. for (var i = 0; i < size; ++i) {
  10872. that[i] = 0
  10873. }
  10874. }
  10875. return that
  10876. }
  10877. /**
  10878. * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
  10879. * */
  10880. Buffer.allocUnsafe = function (size) {
  10881. return allocUnsafe(null, size)
  10882. }
  10883. /**
  10884. * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
  10885. */
  10886. Buffer.allocUnsafeSlow = function (size) {
  10887. return allocUnsafe(null, size)
  10888. }
  10889. function fromString (that, string, encoding) {
  10890. if (typeof encoding !== 'string' || encoding === '') {
  10891. encoding = 'utf8'
  10892. }
  10893. if (!Buffer.isEncoding(encoding)) {
  10894. throw new TypeError('"encoding" must be a valid string encoding')
  10895. }
  10896. var length = byteLength(string, encoding) | 0
  10897. that = createBuffer(that, length)
  10898. var actual = that.write(string, encoding)
  10899. if (actual !== length) {
  10900. // Writing a hex string, for example, that contains invalid characters will
  10901. // cause everything after the first invalid character to be ignored. (e.g.
  10902. // 'abxxcd' will be treated as 'ab')
  10903. that = that.slice(0, actual)
  10904. }
  10905. return that
  10906. }
  10907. function fromArrayLike (that, array) {
  10908. var length = array.length < 0 ? 0 : checked(array.length) | 0
  10909. that = createBuffer(that, length)
  10910. for (var i = 0; i < length; i += 1) {
  10911. that[i] = array[i] & 255
  10912. }
  10913. return that
  10914. }
  10915. function fromArrayBuffer (that, array, byteOffset, length) {
  10916. array.byteLength // this throws if `array` is not a valid ArrayBuffer
  10917. if (byteOffset < 0 || array.byteLength < byteOffset) {
  10918. throw new RangeError('\'offset\' is out of bounds')
  10919. }
  10920. if (array.byteLength < byteOffset + (length || 0)) {
  10921. throw new RangeError('\'length\' is out of bounds')
  10922. }
  10923. if (byteOffset === undefined && length === undefined) {
  10924. array = new Uint8Array(array)
  10925. } else if (length === undefined) {
  10926. array = new Uint8Array(array, byteOffset)
  10927. } else {
  10928. array = new Uint8Array(array, byteOffset, length)
  10929. }
  10930. if (Buffer.TYPED_ARRAY_SUPPORT) {
  10931. // Return an augmented `Uint8Array` instance, for best performance
  10932. that = array
  10933. that.__proto__ = Buffer.prototype
  10934. } else {
  10935. // Fallback: Return an object instance of the Buffer class
  10936. that = fromArrayLike(that, array)
  10937. }
  10938. return that
  10939. }
  10940. function fromObject (that, obj) {
  10941. if (Buffer.isBuffer(obj)) {
  10942. var len = checked(obj.length) | 0
  10943. that = createBuffer(that, len)
  10944. if (that.length === 0) {
  10945. return that
  10946. }
  10947. obj.copy(that, 0, 0, len)
  10948. return that
  10949. }
  10950. if (obj) {
  10951. if ((typeof ArrayBuffer !== 'undefined' &&
  10952. obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
  10953. if (typeof obj.length !== 'number' || isnan(obj.length)) {
  10954. return createBuffer(that, 0)
  10955. }
  10956. return fromArrayLike(that, obj)
  10957. }
  10958. if (obj.type === 'Buffer' && isArray(obj.data)) {
  10959. return fromArrayLike(that, obj.data)
  10960. }
  10961. }
  10962. throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
  10963. }
  10964. function checked (length) {
  10965. // Note: cannot use `length < kMaxLength()` here because that fails when
  10966. // length is NaN (which is otherwise coerced to zero.)
  10967. if (length >= kMaxLength()) {
  10968. throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
  10969. 'size: 0x' + kMaxLength().toString(16) + ' bytes')
  10970. }
  10971. return length | 0
  10972. }
  10973. function SlowBuffer (length) {
  10974. if (+length != length) { // eslint-disable-line eqeqeq
  10975. length = 0
  10976. }
  10977. return Buffer.alloc(+length)
  10978. }
  10979. Buffer.isBuffer = function isBuffer (b) {
  10980. return !!(b != null && b._isBuffer)
  10981. }
  10982. Buffer.compare = function compare (a, b) {
  10983. if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
  10984. throw new TypeError('Arguments must be Buffers')
  10985. }
  10986. if (a === b) return 0
  10987. var x = a.length
  10988. var y = b.length
  10989. for (var i = 0, len = Math.min(x, y); i < len; ++i) {
  10990. if (a[i] !== b[i]) {
  10991. x = a[i]
  10992. y = b[i]
  10993. break
  10994. }
  10995. }
  10996. if (x < y) return -1
  10997. if (y < x) return 1
  10998. return 0
  10999. }
  11000. Buffer.isEncoding = function isEncoding (encoding) {
  11001. switch (String(encoding).toLowerCase()) {
  11002. case 'hex':
  11003. case 'utf8':
  11004. case 'utf-8':
  11005. case 'ascii':
  11006. case 'latin1':
  11007. case 'binary':
  11008. case 'base64':
  11009. case 'ucs2':
  11010. case 'ucs-2':
  11011. case 'utf16le':
  11012. case 'utf-16le':
  11013. return true
  11014. default:
  11015. return false
  11016. }
  11017. }
  11018. Buffer.concat = function concat (list, length) {
  11019. if (!isArray(list)) {
  11020. throw new TypeError('"list" argument must be an Array of Buffers')
  11021. }
  11022. if (list.length === 0) {
  11023. return Buffer.alloc(0)
  11024. }
  11025. var i
  11026. if (length === undefined) {
  11027. length = 0
  11028. for (i = 0; i < list.length; ++i) {
  11029. length += list[i].length
  11030. }
  11031. }
  11032. var buffer = Buffer.allocUnsafe(length)
  11033. var pos = 0
  11034. for (i = 0; i < list.length; ++i) {
  11035. var buf = list[i]
  11036. if (!Buffer.isBuffer(buf)) {
  11037. throw new TypeError('"list" argument must be an Array of Buffers')
  11038. }
  11039. buf.copy(buffer, pos)
  11040. pos += buf.length
  11041. }
  11042. return buffer
  11043. }
  11044. function byteLength (string, encoding) {
  11045. if (Buffer.isBuffer(string)) {
  11046. return string.length
  11047. }
  11048. if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
  11049. (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
  11050. return string.byteLength
  11051. }
  11052. if (typeof string !== 'string') {
  11053. string = '' + string
  11054. }
  11055. var len = string.length
  11056. if (len === 0) return 0
  11057. // Use a for loop to avoid recursion
  11058. var loweredCase = false
  11059. for (;;) {
  11060. switch (encoding) {
  11061. case 'ascii':
  11062. case 'latin1':
  11063. case 'binary':
  11064. return len
  11065. case 'utf8':
  11066. case 'utf-8':
  11067. case undefined:
  11068. return utf8ToBytes(string).length
  11069. case 'ucs2':
  11070. case 'ucs-2':
  11071. case 'utf16le':
  11072. case 'utf-16le':
  11073. return len * 2
  11074. case 'hex':
  11075. return len >>> 1
  11076. case 'base64':
  11077. return base64ToBytes(string).length
  11078. default:
  11079. if (loweredCase) return utf8ToBytes(string).length // assume utf8
  11080. encoding = ('' + encoding).toLowerCase()
  11081. loweredCase = true
  11082. }
  11083. }
  11084. }
  11085. Buffer.byteLength = byteLength
  11086. function slowToString (encoding, start, end) {
  11087. var loweredCase = false
  11088. // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
  11089. // property of a typed array.
  11090. // This behaves neither like String nor Uint8Array in that we set start/end
  11091. // to their upper/lower bounds if the value passed is out of range.
  11092. // undefined is handled specially as per ECMA-262 6th Edition,
  11093. // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
  11094. if (start === undefined || start < 0) {
  11095. start = 0
  11096. }
  11097. // Return early if start > this.length. Done here to prevent potential uint32
  11098. // coercion fail below.
  11099. if (start > this.length) {
  11100. return ''
  11101. }
  11102. if (end === undefined || end > this.length) {
  11103. end = this.length
  11104. }
  11105. if (end <= 0) {
  11106. return ''
  11107. }
  11108. // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
  11109. end >>>= 0
  11110. start >>>= 0
  11111. if (end <= start) {
  11112. return ''
  11113. }
  11114. if (!encoding) encoding = 'utf8'
  11115. while (true) {
  11116. switch (encoding) {
  11117. case 'hex':
  11118. return hexSlice(this, start, end)
  11119. case 'utf8':
  11120. case 'utf-8':
  11121. return utf8Slice(this, start, end)
  11122. case 'ascii':
  11123. return asciiSlice(this, start, end)
  11124. case 'latin1':
  11125. case 'binary':
  11126. return latin1Slice(this, start, end)
  11127. case 'base64':
  11128. return base64Slice(this, start, end)
  11129. case 'ucs2':
  11130. case 'ucs-2':
  11131. case 'utf16le':
  11132. case 'utf-16le':
  11133. return utf16leSlice(this, start, end)
  11134. default:
  11135. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  11136. encoding = (encoding + '').toLowerCase()
  11137. loweredCase = true
  11138. }
  11139. }
  11140. }
  11141. // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
  11142. // Buffer instances.
  11143. Buffer.prototype._isBuffer = true
  11144. function swap (b, n, m) {
  11145. var i = b[n]
  11146. b[n] = b[m]
  11147. b[m] = i
  11148. }
  11149. Buffer.prototype.swap16 = function swap16 () {
  11150. var len = this.length
  11151. if (len % 2 !== 0) {
  11152. throw new RangeError('Buffer size must be a multiple of 16-bits')
  11153. }
  11154. for (var i = 0; i < len; i += 2) {
  11155. swap(this, i, i + 1)
  11156. }
  11157. return this
  11158. }
  11159. Buffer.prototype.swap32 = function swap32 () {
  11160. var len = this.length
  11161. if (len % 4 !== 0) {
  11162. throw new RangeError('Buffer size must be a multiple of 32-bits')
  11163. }
  11164. for (var i = 0; i < len; i += 4) {
  11165. swap(this, i, i + 3)
  11166. swap(this, i + 1, i + 2)
  11167. }
  11168. return this
  11169. }
  11170. Buffer.prototype.swap64 = function swap64 () {
  11171. var len = this.length
  11172. if (len % 8 !== 0) {
  11173. throw new RangeError('Buffer size must be a multiple of 64-bits')
  11174. }
  11175. for (var i = 0; i < len; i += 8) {
  11176. swap(this, i, i + 7)
  11177. swap(this, i + 1, i + 6)
  11178. swap(this, i + 2, i + 5)
  11179. swap(this, i + 3, i + 4)
  11180. }
  11181. return this
  11182. }
  11183. Buffer.prototype.toString = function toString () {
  11184. var length = this.length | 0
  11185. if (length === 0) return ''
  11186. if (arguments.length === 0) return utf8Slice(this, 0, length)
  11187. return slowToString.apply(this, arguments)
  11188. }
  11189. Buffer.prototype.equals = function equals (b) {
  11190. if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
  11191. if (this === b) return true
  11192. return Buffer.compare(this, b) === 0
  11193. }
  11194. Buffer.prototype.inspect = function inspect () {
  11195. var str = ''
  11196. var max = exports.INSPECT_MAX_BYTES
  11197. if (this.length > 0) {
  11198. str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
  11199. if (this.length > max) str += ' ... '
  11200. }
  11201. return '<Buffer ' + str + '>'
  11202. }
  11203. Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
  11204. if (!Buffer.isBuffer(target)) {
  11205. throw new TypeError('Argument must be a Buffer')
  11206. }
  11207. if (start === undefined) {
  11208. start = 0
  11209. }
  11210. if (end === undefined) {
  11211. end = target ? target.length : 0
  11212. }
  11213. if (thisStart === undefined) {
  11214. thisStart = 0
  11215. }
  11216. if (thisEnd === undefined) {
  11217. thisEnd = this.length
  11218. }
  11219. if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
  11220. throw new RangeError('out of range index')
  11221. }
  11222. if (thisStart >= thisEnd && start >= end) {
  11223. return 0
  11224. }
  11225. if (thisStart >= thisEnd) {
  11226. return -1
  11227. }
  11228. if (start >= end) {
  11229. return 1
  11230. }
  11231. start >>>= 0
  11232. end >>>= 0
  11233. thisStart >>>= 0
  11234. thisEnd >>>= 0
  11235. if (this === target) return 0
  11236. var x = thisEnd - thisStart
  11237. var y = end - start
  11238. var len = Math.min(x, y)
  11239. var thisCopy = this.slice(thisStart, thisEnd)
  11240. var targetCopy = target.slice(start, end)
  11241. for (var i = 0; i < len; ++i) {
  11242. if (thisCopy[i] !== targetCopy[i]) {
  11243. x = thisCopy[i]
  11244. y = targetCopy[i]
  11245. break
  11246. }
  11247. }
  11248. if (x < y) return -1
  11249. if (y < x) return 1
  11250. return 0
  11251. }
  11252. // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
  11253. // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
  11254. //
  11255. // Arguments:
  11256. // - buffer - a Buffer to search
  11257. // - val - a string, Buffer, or number
  11258. // - byteOffset - an index into `buffer`; will be clamped to an int32
  11259. // - encoding - an optional encoding, relevant is val is a string
  11260. // - dir - true for indexOf, false for lastIndexOf
  11261. function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
  11262. // Empty buffer means no match
  11263. if (buffer.length === 0) return -1
  11264. // Normalize byteOffset
  11265. if (typeof byteOffset === 'string') {
  11266. encoding = byteOffset
  11267. byteOffset = 0
  11268. } else if (byteOffset > 0x7fffffff) {
  11269. byteOffset = 0x7fffffff
  11270. } else if (byteOffset < -0x80000000) {
  11271. byteOffset = -0x80000000
  11272. }
  11273. byteOffset = +byteOffset // Coerce to Number.
  11274. if (isNaN(byteOffset)) {
  11275. // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
  11276. byteOffset = dir ? 0 : (buffer.length - 1)
  11277. }
  11278. // Normalize byteOffset: negative offsets start from the end of the buffer
  11279. if (byteOffset < 0) byteOffset = buffer.length + byteOffset
  11280. if (byteOffset >= buffer.length) {
  11281. if (dir) return -1
  11282. else byteOffset = buffer.length - 1
  11283. } else if (byteOffset < 0) {
  11284. if (dir) byteOffset = 0
  11285. else return -1
  11286. }
  11287. // Normalize val
  11288. if (typeof val === 'string') {
  11289. val = Buffer.from(val, encoding)
  11290. }
  11291. // Finally, search either indexOf (if dir is true) or lastIndexOf
  11292. if (Buffer.isBuffer(val)) {
  11293. // Special case: looking for empty string/buffer always fails
  11294. if (val.length === 0) {
  11295. return -1
  11296. }
  11297. return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
  11298. } else if (typeof val === 'number') {
  11299. val = val & 0xFF // Search for a byte value [0-255]
  11300. if (Buffer.TYPED_ARRAY_SUPPORT &&
  11301. typeof Uint8Array.prototype.indexOf === 'function') {
  11302. if (dir) {
  11303. return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
  11304. } else {
  11305. return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
  11306. }
  11307. }
  11308. return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
  11309. }
  11310. throw new TypeError('val must be string, number or Buffer')
  11311. }
  11312. function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
  11313. var indexSize = 1
  11314. var arrLength = arr.length
  11315. var valLength = val.length
  11316. if (encoding !== undefined) {
  11317. encoding = String(encoding).toLowerCase()
  11318. if (encoding === 'ucs2' || encoding === 'ucs-2' ||
  11319. encoding === 'utf16le' || encoding === 'utf-16le') {
  11320. if (arr.length < 2 || val.length < 2) {
  11321. return -1
  11322. }
  11323. indexSize = 2
  11324. arrLength /= 2
  11325. valLength /= 2
  11326. byteOffset /= 2
  11327. }
  11328. }
  11329. function read (buf, i) {
  11330. if (indexSize === 1) {
  11331. return buf[i]
  11332. } else {
  11333. return buf.readUInt16BE(i * indexSize)
  11334. }
  11335. }
  11336. var i
  11337. if (dir) {
  11338. var foundIndex = -1
  11339. for (i = byteOffset; i < arrLength; i++) {
  11340. if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
  11341. if (foundIndex === -1) foundIndex = i
  11342. if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
  11343. } else {
  11344. if (foundIndex !== -1) i -= i - foundIndex
  11345. foundIndex = -1
  11346. }
  11347. }
  11348. } else {
  11349. if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
  11350. for (i = byteOffset; i >= 0; i--) {
  11351. var found = true
  11352. for (var j = 0; j < valLength; j++) {
  11353. if (read(arr, i + j) !== read(val, j)) {
  11354. found = false
  11355. break
  11356. }
  11357. }
  11358. if (found) return i
  11359. }
  11360. }
  11361. return -1
  11362. }
  11363. Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
  11364. return this.indexOf(val, byteOffset, encoding) !== -1
  11365. }
  11366. Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
  11367. return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
  11368. }
  11369. Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
  11370. return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
  11371. }
  11372. function hexWrite (buf, string, offset, length) {
  11373. offset = Number(offset) || 0
  11374. var remaining = buf.length - offset
  11375. if (!length) {
  11376. length = remaining
  11377. } else {
  11378. length = Number(length)
  11379. if (length > remaining) {
  11380. length = remaining
  11381. }
  11382. }
  11383. // must be an even number of digits
  11384. var strLen = string.length
  11385. if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
  11386. if (length > strLen / 2) {
  11387. length = strLen / 2
  11388. }
  11389. for (var i = 0; i < length; ++i) {
  11390. var parsed = parseInt(string.substr(i * 2, 2), 16)
  11391. if (isNaN(parsed)) return i
  11392. buf[offset + i] = parsed
  11393. }
  11394. return i
  11395. }
  11396. function utf8Write (buf, string, offset, length) {
  11397. return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
  11398. }
  11399. function asciiWrite (buf, string, offset, length) {
  11400. return blitBuffer(asciiToBytes(string), buf, offset, length)
  11401. }
  11402. function latin1Write (buf, string, offset, length) {
  11403. return asciiWrite(buf, string, offset, length)
  11404. }
  11405. function base64Write (buf, string, offset, length) {
  11406. return blitBuffer(base64ToBytes(string), buf, offset, length)
  11407. }
  11408. function ucs2Write (buf, string, offset, length) {
  11409. return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
  11410. }
  11411. Buffer.prototype.write = function write (string, offset, length, encoding) {
  11412. // Buffer#write(string)
  11413. if (offset === undefined) {
  11414. encoding = 'utf8'
  11415. length = this.length
  11416. offset = 0
  11417. // Buffer#write(string, encoding)
  11418. } else if (length === undefined && typeof offset === 'string') {
  11419. encoding = offset
  11420. length = this.length
  11421. offset = 0
  11422. // Buffer#write(string, offset[, length][, encoding])
  11423. } else if (isFinite(offset)) {
  11424. offset = offset | 0
  11425. if (isFinite(length)) {
  11426. length = length | 0
  11427. if (encoding === undefined) encoding = 'utf8'
  11428. } else {
  11429. encoding = length
  11430. length = undefined
  11431. }
  11432. // legacy write(string, encoding, offset, length) - remove in v0.13
  11433. } else {
  11434. throw new Error(
  11435. 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
  11436. )
  11437. }
  11438. var remaining = this.length - offset
  11439. if (length === undefined || length > remaining) length = remaining
  11440. if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
  11441. throw new RangeError('Attempt to write outside buffer bounds')
  11442. }
  11443. if (!encoding) encoding = 'utf8'
  11444. var loweredCase = false
  11445. for (;;) {
  11446. switch (encoding) {
  11447. case 'hex':
  11448. return hexWrite(this, string, offset, length)
  11449. case 'utf8':
  11450. case 'utf-8':
  11451. return utf8Write(this, string, offset, length)
  11452. case 'ascii':
  11453. return asciiWrite(this, string, offset, length)
  11454. case 'latin1':
  11455. case 'binary':
  11456. return latin1Write(this, string, offset, length)
  11457. case 'base64':
  11458. // Warning: maxLength not taken into account in base64Write
  11459. return base64Write(this, string, offset, length)
  11460. case 'ucs2':
  11461. case 'ucs-2':
  11462. case 'utf16le':
  11463. case 'utf-16le':
  11464. return ucs2Write(this, string, offset, length)
  11465. default:
  11466. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  11467. encoding = ('' + encoding).toLowerCase()
  11468. loweredCase = true
  11469. }
  11470. }
  11471. }
  11472. Buffer.prototype.toJSON = function toJSON () {
  11473. return {
  11474. type: 'Buffer',
  11475. data: Array.prototype.slice.call(this._arr || this, 0)
  11476. }
  11477. }
  11478. function base64Slice (buf, start, end) {
  11479. if (start === 0 && end === buf.length) {
  11480. return base64.fromByteArray(buf)
  11481. } else {
  11482. return base64.fromByteArray(buf.slice(start, end))
  11483. }
  11484. }
  11485. function utf8Slice (buf, start, end) {
  11486. end = Math.min(buf.length, end)
  11487. var res = []
  11488. var i = start
  11489. while (i < end) {
  11490. var firstByte = buf[i]
  11491. var codePoint = null
  11492. var bytesPerSequence = (firstByte > 0xEF) ? 4
  11493. : (firstByte > 0xDF) ? 3
  11494. : (firstByte > 0xBF) ? 2
  11495. : 1
  11496. if (i + bytesPerSequence <= end) {
  11497. var secondByte, thirdByte, fourthByte, tempCodePoint
  11498. switch (bytesPerSequence) {
  11499. case 1:
  11500. if (firstByte < 0x80) {
  11501. codePoint = firstByte
  11502. }
  11503. break
  11504. case 2:
  11505. secondByte = buf[i + 1]
  11506. if ((secondByte & 0xC0) === 0x80) {
  11507. tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
  11508. if (tempCodePoint > 0x7F) {
  11509. codePoint = tempCodePoint
  11510. }
  11511. }
  11512. break
  11513. case 3:
  11514. secondByte = buf[i + 1]
  11515. thirdByte = buf[i + 2]
  11516. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
  11517. tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
  11518. if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
  11519. codePoint = tempCodePoint
  11520. }
  11521. }
  11522. break
  11523. case 4:
  11524. secondByte = buf[i + 1]
  11525. thirdByte = buf[i + 2]
  11526. fourthByte = buf[i + 3]
  11527. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
  11528. tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
  11529. if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
  11530. codePoint = tempCodePoint
  11531. }
  11532. }
  11533. }
  11534. }
  11535. if (codePoint === null) {
  11536. // we did not generate a valid codePoint so insert a
  11537. // replacement char (U+FFFD) and advance only 1 byte
  11538. codePoint = 0xFFFD
  11539. bytesPerSequence = 1
  11540. } else if (codePoint > 0xFFFF) {
  11541. // encode to utf16 (surrogate pair dance)
  11542. codePoint -= 0x10000
  11543. res.push(codePoint >>> 10 & 0x3FF | 0xD800)
  11544. codePoint = 0xDC00 | codePoint & 0x3FF
  11545. }
  11546. res.push(codePoint)
  11547. i += bytesPerSequence
  11548. }
  11549. return decodeCodePointsArray(res)
  11550. }
  11551. // Based on http://stackoverflow.com/a/22747272/680742, the browser with
  11552. // the lowest limit is Chrome, with 0x10000 args.
  11553. // We go 1 magnitude less, for safety
  11554. var MAX_ARGUMENTS_LENGTH = 0x1000
  11555. function decodeCodePointsArray (codePoints) {
  11556. var len = codePoints.length
  11557. if (len <= MAX_ARGUMENTS_LENGTH) {
  11558. return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
  11559. }
  11560. // Decode in chunks to avoid "call stack size exceeded".
  11561. var res = ''
  11562. var i = 0
  11563. while (i < len) {
  11564. res += String.fromCharCode.apply(
  11565. String,
  11566. codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
  11567. )
  11568. }
  11569. return res
  11570. }
  11571. function asciiSlice (buf, start, end) {
  11572. var ret = ''
  11573. end = Math.min(buf.length, end)
  11574. for (var i = start; i < end; ++i) {
  11575. ret += String.fromCharCode(buf[i] & 0x7F)
  11576. }
  11577. return ret
  11578. }
  11579. function latin1Slice (buf, start, end) {
  11580. var ret = ''
  11581. end = Math.min(buf.length, end)
  11582. for (var i = start; i < end; ++i) {
  11583. ret += String.fromCharCode(buf[i])
  11584. }
  11585. return ret
  11586. }
  11587. function hexSlice (buf, start, end) {
  11588. var len = buf.length
  11589. if (!start || start < 0) start = 0
  11590. if (!end || end < 0 || end > len) end = len
  11591. var out = ''
  11592. for (var i = start; i < end; ++i) {
  11593. out += toHex(buf[i])
  11594. }
  11595. return out
  11596. }
  11597. function utf16leSlice (buf, start, end) {
  11598. var bytes = buf.slice(start, end)
  11599. var res = ''
  11600. for (var i = 0; i < bytes.length; i += 2) {
  11601. res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
  11602. }
  11603. return res
  11604. }
  11605. Buffer.prototype.slice = function slice (start, end) {
  11606. var len = this.length
  11607. start = ~~start
  11608. end = end === undefined ? len : ~~end
  11609. if (start < 0) {
  11610. start += len
  11611. if (start < 0) start = 0
  11612. } else if (start > len) {
  11613. start = len
  11614. }
  11615. if (end < 0) {
  11616. end += len
  11617. if (end < 0) end = 0
  11618. } else if (end > len) {
  11619. end = len
  11620. }
  11621. if (end < start) end = start
  11622. var newBuf
  11623. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11624. newBuf = this.subarray(start, end)
  11625. newBuf.__proto__ = Buffer.prototype
  11626. } else {
  11627. var sliceLen = end - start
  11628. newBuf = new Buffer(sliceLen, undefined)
  11629. for (var i = 0; i < sliceLen; ++i) {
  11630. newBuf[i] = this[i + start]
  11631. }
  11632. }
  11633. return newBuf
  11634. }
  11635. /*
  11636. * Need to make sure that buffer isn't trying to write out of bounds.
  11637. */
  11638. function checkOffset (offset, ext, length) {
  11639. if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
  11640. if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
  11641. }
  11642. Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
  11643. offset = offset | 0
  11644. byteLength = byteLength | 0
  11645. if (!noAssert) checkOffset(offset, byteLength, this.length)
  11646. var val = this[offset]
  11647. var mul = 1
  11648. var i = 0
  11649. while (++i < byteLength && (mul *= 0x100)) {
  11650. val += this[offset + i] * mul
  11651. }
  11652. return val
  11653. }
  11654. Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
  11655. offset = offset | 0
  11656. byteLength = byteLength | 0
  11657. if (!noAssert) {
  11658. checkOffset(offset, byteLength, this.length)
  11659. }
  11660. var val = this[offset + --byteLength]
  11661. var mul = 1
  11662. while (byteLength > 0 && (mul *= 0x100)) {
  11663. val += this[offset + --byteLength] * mul
  11664. }
  11665. return val
  11666. }
  11667. Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
  11668. if (!noAssert) checkOffset(offset, 1, this.length)
  11669. return this[offset]
  11670. }
  11671. Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
  11672. if (!noAssert) checkOffset(offset, 2, this.length)
  11673. return this[offset] | (this[offset + 1] << 8)
  11674. }
  11675. Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
  11676. if (!noAssert) checkOffset(offset, 2, this.length)
  11677. return (this[offset] << 8) | this[offset + 1]
  11678. }
  11679. Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
  11680. if (!noAssert) checkOffset(offset, 4, this.length)
  11681. return ((this[offset]) |
  11682. (this[offset + 1] << 8) |
  11683. (this[offset + 2] << 16)) +
  11684. (this[offset + 3] * 0x1000000)
  11685. }
  11686. Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
  11687. if (!noAssert) checkOffset(offset, 4, this.length)
  11688. return (this[offset] * 0x1000000) +
  11689. ((this[offset + 1] << 16) |
  11690. (this[offset + 2] << 8) |
  11691. this[offset + 3])
  11692. }
  11693. Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
  11694. offset = offset | 0
  11695. byteLength = byteLength | 0
  11696. if (!noAssert) checkOffset(offset, byteLength, this.length)
  11697. var val = this[offset]
  11698. var mul = 1
  11699. var i = 0
  11700. while (++i < byteLength && (mul *= 0x100)) {
  11701. val += this[offset + i] * mul
  11702. }
  11703. mul *= 0x80
  11704. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  11705. return val
  11706. }
  11707. Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
  11708. offset = offset | 0
  11709. byteLength = byteLength | 0
  11710. if (!noAssert) checkOffset(offset, byteLength, this.length)
  11711. var i = byteLength
  11712. var mul = 1
  11713. var val = this[offset + --i]
  11714. while (i > 0 && (mul *= 0x100)) {
  11715. val += this[offset + --i] * mul
  11716. }
  11717. mul *= 0x80
  11718. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  11719. return val
  11720. }
  11721. Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
  11722. if (!noAssert) checkOffset(offset, 1, this.length)
  11723. if (!(this[offset] & 0x80)) return (this[offset])
  11724. return ((0xff - this[offset] + 1) * -1)
  11725. }
  11726. Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
  11727. if (!noAssert) checkOffset(offset, 2, this.length)
  11728. var val = this[offset] | (this[offset + 1] << 8)
  11729. return (val & 0x8000) ? val | 0xFFFF0000 : val
  11730. }
  11731. Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
  11732. if (!noAssert) checkOffset(offset, 2, this.length)
  11733. var val = this[offset + 1] | (this[offset] << 8)
  11734. return (val & 0x8000) ? val | 0xFFFF0000 : val
  11735. }
  11736. Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
  11737. if (!noAssert) checkOffset(offset, 4, this.length)
  11738. return (this[offset]) |
  11739. (this[offset + 1] << 8) |
  11740. (this[offset + 2] << 16) |
  11741. (this[offset + 3] << 24)
  11742. }
  11743. Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
  11744. if (!noAssert) checkOffset(offset, 4, this.length)
  11745. return (this[offset] << 24) |
  11746. (this[offset + 1] << 16) |
  11747. (this[offset + 2] << 8) |
  11748. (this[offset + 3])
  11749. }
  11750. Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
  11751. if (!noAssert) checkOffset(offset, 4, this.length)
  11752. return ieee754.read(this, offset, true, 23, 4)
  11753. }
  11754. Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
  11755. if (!noAssert) checkOffset(offset, 4, this.length)
  11756. return ieee754.read(this, offset, false, 23, 4)
  11757. }
  11758. Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
  11759. if (!noAssert) checkOffset(offset, 8, this.length)
  11760. return ieee754.read(this, offset, true, 52, 8)
  11761. }
  11762. Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
  11763. if (!noAssert) checkOffset(offset, 8, this.length)
  11764. return ieee754.read(this, offset, false, 52, 8)
  11765. }
  11766. function checkInt (buf, value, offset, ext, max, min) {
  11767. if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
  11768. if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
  11769. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  11770. }
  11771. Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
  11772. value = +value
  11773. offset = offset | 0
  11774. byteLength = byteLength | 0
  11775. if (!noAssert) {
  11776. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  11777. checkInt(this, value, offset, byteLength, maxBytes, 0)
  11778. }
  11779. var mul = 1
  11780. var i = 0
  11781. this[offset] = value & 0xFF
  11782. while (++i < byteLength && (mul *= 0x100)) {
  11783. this[offset + i] = (value / mul) & 0xFF
  11784. }
  11785. return offset + byteLength
  11786. }
  11787. Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
  11788. value = +value
  11789. offset = offset | 0
  11790. byteLength = byteLength | 0
  11791. if (!noAssert) {
  11792. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  11793. checkInt(this, value, offset, byteLength, maxBytes, 0)
  11794. }
  11795. var i = byteLength - 1
  11796. var mul = 1
  11797. this[offset + i] = value & 0xFF
  11798. while (--i >= 0 && (mul *= 0x100)) {
  11799. this[offset + i] = (value / mul) & 0xFF
  11800. }
  11801. return offset + byteLength
  11802. }
  11803. Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
  11804. value = +value
  11805. offset = offset | 0
  11806. if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
  11807. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  11808. this[offset] = (value & 0xff)
  11809. return offset + 1
  11810. }
  11811. function objectWriteUInt16 (buf, value, offset, littleEndian) {
  11812. if (value < 0) value = 0xffff + value + 1
  11813. for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
  11814. buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
  11815. (littleEndian ? i : 1 - i) * 8
  11816. }
  11817. }
  11818. Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
  11819. value = +value
  11820. offset = offset | 0
  11821. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  11822. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11823. this[offset] = (value & 0xff)
  11824. this[offset + 1] = (value >>> 8)
  11825. } else {
  11826. objectWriteUInt16(this, value, offset, true)
  11827. }
  11828. return offset + 2
  11829. }
  11830. Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
  11831. value = +value
  11832. offset = offset | 0
  11833. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  11834. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11835. this[offset] = (value >>> 8)
  11836. this[offset + 1] = (value & 0xff)
  11837. } else {
  11838. objectWriteUInt16(this, value, offset, false)
  11839. }
  11840. return offset + 2
  11841. }
  11842. function objectWriteUInt32 (buf, value, offset, littleEndian) {
  11843. if (value < 0) value = 0xffffffff + value + 1
  11844. for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
  11845. buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
  11846. }
  11847. }
  11848. Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
  11849. value = +value
  11850. offset = offset | 0
  11851. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  11852. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11853. this[offset + 3] = (value >>> 24)
  11854. this[offset + 2] = (value >>> 16)
  11855. this[offset + 1] = (value >>> 8)
  11856. this[offset] = (value & 0xff)
  11857. } else {
  11858. objectWriteUInt32(this, value, offset, true)
  11859. }
  11860. return offset + 4
  11861. }
  11862. Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
  11863. value = +value
  11864. offset = offset | 0
  11865. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  11866. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11867. this[offset] = (value >>> 24)
  11868. this[offset + 1] = (value >>> 16)
  11869. this[offset + 2] = (value >>> 8)
  11870. this[offset + 3] = (value & 0xff)
  11871. } else {
  11872. objectWriteUInt32(this, value, offset, false)
  11873. }
  11874. return offset + 4
  11875. }
  11876. Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
  11877. value = +value
  11878. offset = offset | 0
  11879. if (!noAssert) {
  11880. var limit = Math.pow(2, 8 * byteLength - 1)
  11881. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  11882. }
  11883. var i = 0
  11884. var mul = 1
  11885. var sub = 0
  11886. this[offset] = value & 0xFF
  11887. while (++i < byteLength && (mul *= 0x100)) {
  11888. if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
  11889. sub = 1
  11890. }
  11891. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  11892. }
  11893. return offset + byteLength
  11894. }
  11895. Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
  11896. value = +value
  11897. offset = offset | 0
  11898. if (!noAssert) {
  11899. var limit = Math.pow(2, 8 * byteLength - 1)
  11900. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  11901. }
  11902. var i = byteLength - 1
  11903. var mul = 1
  11904. var sub = 0
  11905. this[offset + i] = value & 0xFF
  11906. while (--i >= 0 && (mul *= 0x100)) {
  11907. if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
  11908. sub = 1
  11909. }
  11910. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  11911. }
  11912. return offset + byteLength
  11913. }
  11914. Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
  11915. value = +value
  11916. offset = offset | 0
  11917. if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
  11918. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  11919. if (value < 0) value = 0xff + value + 1
  11920. this[offset] = (value & 0xff)
  11921. return offset + 1
  11922. }
  11923. Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
  11924. value = +value
  11925. offset = offset | 0
  11926. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  11927. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11928. this[offset] = (value & 0xff)
  11929. this[offset + 1] = (value >>> 8)
  11930. } else {
  11931. objectWriteUInt16(this, value, offset, true)
  11932. }
  11933. return offset + 2
  11934. }
  11935. Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
  11936. value = +value
  11937. offset = offset | 0
  11938. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  11939. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11940. this[offset] = (value >>> 8)
  11941. this[offset + 1] = (value & 0xff)
  11942. } else {
  11943. objectWriteUInt16(this, value, offset, false)
  11944. }
  11945. return offset + 2
  11946. }
  11947. Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
  11948. value = +value
  11949. offset = offset | 0
  11950. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  11951. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11952. this[offset] = (value & 0xff)
  11953. this[offset + 1] = (value >>> 8)
  11954. this[offset + 2] = (value >>> 16)
  11955. this[offset + 3] = (value >>> 24)
  11956. } else {
  11957. objectWriteUInt32(this, value, offset, true)
  11958. }
  11959. return offset + 4
  11960. }
  11961. Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
  11962. value = +value
  11963. offset = offset | 0
  11964. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  11965. if (value < 0) value = 0xffffffff + value + 1
  11966. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11967. this[offset] = (value >>> 24)
  11968. this[offset + 1] = (value >>> 16)
  11969. this[offset + 2] = (value >>> 8)
  11970. this[offset + 3] = (value & 0xff)
  11971. } else {
  11972. objectWriteUInt32(this, value, offset, false)
  11973. }
  11974. return offset + 4
  11975. }
  11976. function checkIEEE754 (buf, value, offset, ext, max, min) {
  11977. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  11978. if (offset < 0) throw new RangeError('Index out of range')
  11979. }
  11980. function writeFloat (buf, value, offset, littleEndian, noAssert) {
  11981. if (!noAssert) {
  11982. checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
  11983. }
  11984. ieee754.write(buf, value, offset, littleEndian, 23, 4)
  11985. return offset + 4
  11986. }
  11987. Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
  11988. return writeFloat(this, value, offset, true, noAssert)
  11989. }
  11990. Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
  11991. return writeFloat(this, value, offset, false, noAssert)
  11992. }
  11993. function writeDouble (buf, value, offset, littleEndian, noAssert) {
  11994. if (!noAssert) {
  11995. checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
  11996. }
  11997. ieee754.write(buf, value, offset, littleEndian, 52, 8)
  11998. return offset + 8
  11999. }
  12000. Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
  12001. return writeDouble(this, value, offset, true, noAssert)
  12002. }
  12003. Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
  12004. return writeDouble(this, value, offset, false, noAssert)
  12005. }
  12006. // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
  12007. Buffer.prototype.copy = function copy (target, targetStart, start, end) {
  12008. if (!start) start = 0
  12009. if (!end && end !== 0) end = this.length
  12010. if (targetStart >= target.length) targetStart = target.length
  12011. if (!targetStart) targetStart = 0
  12012. if (end > 0 && end < start) end = start
  12013. // Copy 0 bytes; we're done
  12014. if (end === start) return 0
  12015. if (target.length === 0 || this.length === 0) return 0
  12016. // Fatal error conditions
  12017. if (targetStart < 0) {
  12018. throw new RangeError('targetStart out of bounds')
  12019. }
  12020. if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
  12021. if (end < 0) throw new RangeError('sourceEnd out of bounds')
  12022. // Are we oob?
  12023. if (end > this.length) end = this.length
  12024. if (target.length - targetStart < end - start) {
  12025. end = target.length - targetStart + start
  12026. }
  12027. var len = end - start
  12028. var i
  12029. if (this === target && start < targetStart && targetStart < end) {
  12030. // descending copy from end
  12031. for (i = len - 1; i >= 0; --i) {
  12032. target[i + targetStart] = this[i + start]
  12033. }
  12034. } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
  12035. // ascending copy from start
  12036. for (i = 0; i < len; ++i) {
  12037. target[i + targetStart] = this[i + start]
  12038. }
  12039. } else {
  12040. Uint8Array.prototype.set.call(
  12041. target,
  12042. this.subarray(start, start + len),
  12043. targetStart
  12044. )
  12045. }
  12046. return len
  12047. }
  12048. // Usage:
  12049. // buffer.fill(number[, offset[, end]])
  12050. // buffer.fill(buffer[, offset[, end]])
  12051. // buffer.fill(string[, offset[, end]][, encoding])
  12052. Buffer.prototype.fill = function fill (val, start, end, encoding) {
  12053. // Handle string cases:
  12054. if (typeof val === 'string') {
  12055. if (typeof start === 'string') {
  12056. encoding = start
  12057. start = 0
  12058. end = this.length
  12059. } else if (typeof end === 'string') {
  12060. encoding = end
  12061. end = this.length
  12062. }
  12063. if (val.length === 1) {
  12064. var code = val.charCodeAt(0)
  12065. if (code < 256) {
  12066. val = code
  12067. }
  12068. }
  12069. if (encoding !== undefined && typeof encoding !== 'string') {
  12070. throw new TypeError('encoding must be a string')
  12071. }
  12072. if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
  12073. throw new TypeError('Unknown encoding: ' + encoding)
  12074. }
  12075. } else if (typeof val === 'number') {
  12076. val = val & 255
  12077. }
  12078. // Invalid ranges are not set to a default, so can range check early.
  12079. if (start < 0 || this.length < start || this.length < end) {
  12080. throw new RangeError('Out of range index')
  12081. }
  12082. if (end <= start) {
  12083. return this
  12084. }
  12085. start = start >>> 0
  12086. end = end === undefined ? this.length : end >>> 0
  12087. if (!val) val = 0
  12088. var i
  12089. if (typeof val === 'number') {
  12090. for (i = start; i < end; ++i) {
  12091. this[i] = val
  12092. }
  12093. } else {
  12094. var bytes = Buffer.isBuffer(val)
  12095. ? val
  12096. : utf8ToBytes(new Buffer(val, encoding).toString())
  12097. var len = bytes.length
  12098. for (i = 0; i < end - start; ++i) {
  12099. this[i + start] = bytes[i % len]
  12100. }
  12101. }
  12102. return this
  12103. }
  12104. // HELPER FUNCTIONS
  12105. // ================
  12106. var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
  12107. function base64clean (str) {
  12108. // Node strips out invalid characters like \n and \t from the string, base64-js does not
  12109. str = stringtrim(str).replace(INVALID_BASE64_RE, '')
  12110. // Node converts strings with length < 2 to ''
  12111. if (str.length < 2) return ''
  12112. // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
  12113. while (str.length % 4 !== 0) {
  12114. str = str + '='
  12115. }
  12116. return str
  12117. }
  12118. function stringtrim (str) {
  12119. if (str.trim) return str.trim()
  12120. return str.replace(/^\s+|\s+$/g, '')
  12121. }
  12122. function toHex (n) {
  12123. if (n < 16) return '0' + n.toString(16)
  12124. return n.toString(16)
  12125. }
  12126. function utf8ToBytes (string, units) {
  12127. units = units || Infinity
  12128. var codePoint
  12129. var length = string.length
  12130. var leadSurrogate = null
  12131. var bytes = []
  12132. for (var i = 0; i < length; ++i) {
  12133. codePoint = string.charCodeAt(i)
  12134. // is surrogate component
  12135. if (codePoint > 0xD7FF && codePoint < 0xE000) {
  12136. // last char was a lead
  12137. if (!leadSurrogate) {
  12138. // no lead yet
  12139. if (codePoint > 0xDBFF) {
  12140. // unexpected trail
  12141. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  12142. continue
  12143. } else if (i + 1 === length) {
  12144. // unpaired lead
  12145. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  12146. continue
  12147. }
  12148. // valid lead
  12149. leadSurrogate = codePoint
  12150. continue
  12151. }
  12152. // 2 leads in a row
  12153. if (codePoint < 0xDC00) {
  12154. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  12155. leadSurrogate = codePoint
  12156. continue
  12157. }
  12158. // valid surrogate pair
  12159. codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
  12160. } else if (leadSurrogate) {
  12161. // valid bmp char, but last char was a lead
  12162. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  12163. }
  12164. leadSurrogate = null
  12165. // encode utf8
  12166. if (codePoint < 0x80) {
  12167. if ((units -= 1) < 0) break
  12168. bytes.push(codePoint)
  12169. } else if (codePoint < 0x800) {
  12170. if ((units -= 2) < 0) break
  12171. bytes.push(
  12172. codePoint >> 0x6 | 0xC0,
  12173. codePoint & 0x3F | 0x80
  12174. )
  12175. } else if (codePoint < 0x10000) {
  12176. if ((units -= 3) < 0) break
  12177. bytes.push(
  12178. codePoint >> 0xC | 0xE0,
  12179. codePoint >> 0x6 & 0x3F | 0x80,
  12180. codePoint & 0x3F | 0x80
  12181. )
  12182. } else if (codePoint < 0x110000) {
  12183. if ((units -= 4) < 0) break
  12184. bytes.push(
  12185. codePoint >> 0x12 | 0xF0,
  12186. codePoint >> 0xC & 0x3F | 0x80,
  12187. codePoint >> 0x6 & 0x3F | 0x80,
  12188. codePoint & 0x3F | 0x80
  12189. )
  12190. } else {
  12191. throw new Error('Invalid code point')
  12192. }
  12193. }
  12194. return bytes
  12195. }
  12196. function asciiToBytes (str) {
  12197. var byteArray = []
  12198. for (var i = 0; i < str.length; ++i) {
  12199. // Node's code seems to be doing this and not & 0x7F..
  12200. byteArray.push(str.charCodeAt(i) & 0xFF)
  12201. }
  12202. return byteArray
  12203. }
  12204. function utf16leToBytes (str, units) {
  12205. var c, hi, lo
  12206. var byteArray = []
  12207. for (var i = 0; i < str.length; ++i) {
  12208. if ((units -= 2) < 0) break
  12209. c = str.charCodeAt(i)
  12210. hi = c >> 8
  12211. lo = c % 256
  12212. byteArray.push(lo)
  12213. byteArray.push(hi)
  12214. }
  12215. return byteArray
  12216. }
  12217. function base64ToBytes (str) {
  12218. return base64.toByteArray(base64clean(str))
  12219. }
  12220. function blitBuffer (src, dst, offset, length) {
  12221. for (var i = 0; i < length; ++i) {
  12222. if ((i + offset >= dst.length) || (i >= src.length)) break
  12223. dst[i + offset] = src[i]
  12224. }
  12225. return i
  12226. }
  12227. function isnan (val) {
  12228. return val !== val // eslint-disable-line no-self-compare
  12229. }
  12230. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ 2)))
  12231. /***/ }),
  12232. /* 83 */
  12233. /*!*****************************************!*\
  12234. !*** ./node_modules/base64-js/index.js ***!
  12235. \*****************************************/
  12236. /*! no static exports found */
  12237. /***/ (function(module, exports, __webpack_require__) {
  12238. "use strict";
  12239. exports.byteLength = byteLength
  12240. exports.toByteArray = toByteArray
  12241. exports.fromByteArray = fromByteArray
  12242. var lookup = []
  12243. var revLookup = []
  12244. var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
  12245. var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
  12246. for (var i = 0, len = code.length; i < len; ++i) {
  12247. lookup[i] = code[i]
  12248. revLookup[code.charCodeAt(i)] = i
  12249. }
  12250. // Support decoding URL-safe base64 strings, as Node.js does.
  12251. // See: https://en.wikipedia.org/wiki/Base64#URL_applications
  12252. revLookup['-'.charCodeAt(0)] = 62
  12253. revLookup['_'.charCodeAt(0)] = 63
  12254. function getLens (b64) {
  12255. var len = b64.length
  12256. if (len % 4 > 0) {
  12257. throw new Error('Invalid string. Length must be a multiple of 4')
  12258. }
  12259. // Trim off extra bytes after placeholder bytes are found
  12260. // See: https://github.com/beatgammit/base64-js/issues/42
  12261. var validLen = b64.indexOf('=')
  12262. if (validLen === -1) validLen = len
  12263. var placeHoldersLen = validLen === len
  12264. ? 0
  12265. : 4 - (validLen % 4)
  12266. return [validLen, placeHoldersLen]
  12267. }
  12268. // base64 is 4/3 + up to two characters of the original data
  12269. function byteLength (b64) {
  12270. var lens = getLens(b64)
  12271. var validLen = lens[0]
  12272. var placeHoldersLen = lens[1]
  12273. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  12274. }
  12275. function _byteLength (b64, validLen, placeHoldersLen) {
  12276. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  12277. }
  12278. function toByteArray (b64) {
  12279. var tmp
  12280. var lens = getLens(b64)
  12281. var validLen = lens[0]
  12282. var placeHoldersLen = lens[1]
  12283. var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
  12284. var curByte = 0
  12285. // if there are placeholders, only get up to the last complete 4 chars
  12286. var len = placeHoldersLen > 0
  12287. ? validLen - 4
  12288. : validLen
  12289. var i
  12290. for (i = 0; i < len; i += 4) {
  12291. tmp =
  12292. (revLookup[b64.charCodeAt(i)] << 18) |
  12293. (revLookup[b64.charCodeAt(i + 1)] << 12) |
  12294. (revLookup[b64.charCodeAt(i + 2)] << 6) |
  12295. revLookup[b64.charCodeAt(i + 3)]
  12296. arr[curByte++] = (tmp >> 16) & 0xFF
  12297. arr[curByte++] = (tmp >> 8) & 0xFF
  12298. arr[curByte++] = tmp & 0xFF
  12299. }
  12300. if (placeHoldersLen === 2) {
  12301. tmp =
  12302. (revLookup[b64.charCodeAt(i)] << 2) |
  12303. (revLookup[b64.charCodeAt(i + 1)] >> 4)
  12304. arr[curByte++] = tmp & 0xFF
  12305. }
  12306. if (placeHoldersLen === 1) {
  12307. tmp =
  12308. (revLookup[b64.charCodeAt(i)] << 10) |
  12309. (revLookup[b64.charCodeAt(i + 1)] << 4) |
  12310. (revLookup[b64.charCodeAt(i + 2)] >> 2)
  12311. arr[curByte++] = (tmp >> 8) & 0xFF
  12312. arr[curByte++] = tmp & 0xFF
  12313. }
  12314. return arr
  12315. }
  12316. function tripletToBase64 (num) {
  12317. return lookup[num >> 18 & 0x3F] +
  12318. lookup[num >> 12 & 0x3F] +
  12319. lookup[num >> 6 & 0x3F] +
  12320. lookup[num & 0x3F]
  12321. }
  12322. function encodeChunk (uint8, start, end) {
  12323. var tmp
  12324. var output = []
  12325. for (var i = start; i < end; i += 3) {
  12326. tmp =
  12327. ((uint8[i] << 16) & 0xFF0000) +
  12328. ((uint8[i + 1] << 8) & 0xFF00) +
  12329. (uint8[i + 2] & 0xFF)
  12330. output.push(tripletToBase64(tmp))
  12331. }
  12332. return output.join('')
  12333. }
  12334. function fromByteArray (uint8) {
  12335. var tmp
  12336. var len = uint8.length
  12337. var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
  12338. var parts = []
  12339. var maxChunkLength = 16383 // must be multiple of 3
  12340. // go through the array every three bytes, we'll deal with trailing stuff later
  12341. for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
  12342. parts.push(encodeChunk(
  12343. uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)
  12344. ))
  12345. }
  12346. // pad the end with zeros, but make sure to not forget the extra bytes
  12347. if (extraBytes === 1) {
  12348. tmp = uint8[len - 1]
  12349. parts.push(
  12350. lookup[tmp >> 2] +
  12351. lookup[(tmp << 4) & 0x3F] +
  12352. '=='
  12353. )
  12354. } else if (extraBytes === 2) {
  12355. tmp = (uint8[len - 2] << 8) + uint8[len - 1]
  12356. parts.push(
  12357. lookup[tmp >> 10] +
  12358. lookup[(tmp >> 4) & 0x3F] +
  12359. lookup[(tmp << 2) & 0x3F] +
  12360. '='
  12361. )
  12362. }
  12363. return parts.join('')
  12364. }
  12365. /***/ }),
  12366. /* 84 */
  12367. /*!***************************************!*\
  12368. !*** ./node_modules/ieee754/index.js ***!
  12369. \***************************************/
  12370. /*! no static exports found */
  12371. /***/ (function(module, exports) {
  12372. exports.read = function (buffer, offset, isLE, mLen, nBytes) {
  12373. var e, m
  12374. var eLen = (nBytes * 8) - mLen - 1
  12375. var eMax = (1 << eLen) - 1
  12376. var eBias = eMax >> 1
  12377. var nBits = -7
  12378. var i = isLE ? (nBytes - 1) : 0
  12379. var d = isLE ? -1 : 1
  12380. var s = buffer[offset + i]
  12381. i += d
  12382. e = s & ((1 << (-nBits)) - 1)
  12383. s >>= (-nBits)
  12384. nBits += eLen
  12385. for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  12386. m = e & ((1 << (-nBits)) - 1)
  12387. e >>= (-nBits)
  12388. nBits += mLen
  12389. for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  12390. if (e === 0) {
  12391. e = 1 - eBias
  12392. } else if (e === eMax) {
  12393. return m ? NaN : ((s ? -1 : 1) * Infinity)
  12394. } else {
  12395. m = m + Math.pow(2, mLen)
  12396. e = e - eBias
  12397. }
  12398. return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
  12399. }
  12400. exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
  12401. var e, m, c
  12402. var eLen = (nBytes * 8) - mLen - 1
  12403. var eMax = (1 << eLen) - 1
  12404. var eBias = eMax >> 1
  12405. var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
  12406. var i = isLE ? 0 : (nBytes - 1)
  12407. var d = isLE ? 1 : -1
  12408. var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
  12409. value = Math.abs(value)
  12410. if (isNaN(value) || value === Infinity) {
  12411. m = isNaN(value) ? 1 : 0
  12412. e = eMax
  12413. } else {
  12414. e = Math.floor(Math.log(value) / Math.LN2)
  12415. if (value * (c = Math.pow(2, -e)) < 1) {
  12416. e--
  12417. c *= 2
  12418. }
  12419. if (e + eBias >= 1) {
  12420. value += rt / c
  12421. } else {
  12422. value += rt * Math.pow(2, 1 - eBias)
  12423. }
  12424. if (value * c >= 2) {
  12425. e++
  12426. c /= 2
  12427. }
  12428. if (e + eBias >= eMax) {
  12429. m = 0
  12430. e = eMax
  12431. } else if (e + eBias >= 1) {
  12432. m = ((value * c) - 1) * Math.pow(2, mLen)
  12433. e = e + eBias
  12434. } else {
  12435. m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
  12436. e = 0
  12437. }
  12438. }
  12439. for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
  12440. e = (e << mLen) | m
  12441. eLen += mLen
  12442. for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
  12443. buffer[offset + i - d] |= s * 128
  12444. }
  12445. /***/ }),
  12446. /* 85 */
  12447. /*!***************************************!*\
  12448. !*** ./node_modules/isarray/index.js ***!
  12449. \***************************************/
  12450. /*! no static exports found */
  12451. /***/ (function(module, exports) {
  12452. var toString = {}.toString;
  12453. module.exports = Array.isArray || function (arr) {
  12454. return toString.call(arr) == '[object Array]';
  12455. };
  12456. /***/ }),
  12457. /* 86 */
  12458. /*!*********************************************!*\
  12459. !*** ./node_modules/create-hash/browser.js ***!
  12460. \*********************************************/
  12461. /*! no static exports found */
  12462. /***/ (function(module, exports, __webpack_require__) {
  12463. "use strict";
  12464. var inherits = __webpack_require__(/*! inherits */ 87)
  12465. var MD5 = __webpack_require__(/*! md5.js */ 88)
  12466. var RIPEMD160 = __webpack_require__(/*! ripemd160 */ 106)
  12467. var sha = __webpack_require__(/*! sha.js */ 107)
  12468. var Base = __webpack_require__(/*! cipher-base */ 115)
  12469. function Hash (hash) {
  12470. Base.call(this, 'digest')
  12471. this._hash = hash
  12472. }
  12473. inherits(Hash, Base)
  12474. Hash.prototype._update = function (data) {
  12475. this._hash.update(data)
  12476. }
  12477. Hash.prototype._final = function () {
  12478. return this._hash.digest()
  12479. }
  12480. module.exports = function createHash (alg) {
  12481. alg = alg.toLowerCase()
  12482. if (alg === 'md5') return new MD5()
  12483. if (alg === 'rmd160' || alg === 'ripemd160') return new RIPEMD160()
  12484. return new Hash(sha(alg))
  12485. }
  12486. /***/ }),
  12487. /* 87 */
  12488. /*!***************************************************!*\
  12489. !*** ./node_modules/inherits/inherits_browser.js ***!
  12490. \***************************************************/
  12491. /*! no static exports found */
  12492. /***/ (function(module, exports) {
  12493. if (typeof Object.create === 'function') {
  12494. // implementation from standard node.js 'util' module
  12495. module.exports = function inherits(ctor, superCtor) {
  12496. if (superCtor) {
  12497. ctor.super_ = superCtor
  12498. ctor.prototype = Object.create(superCtor.prototype, {
  12499. constructor: {
  12500. value: ctor,
  12501. enumerable: false,
  12502. writable: true,
  12503. configurable: true
  12504. }
  12505. })
  12506. }
  12507. };
  12508. } else {
  12509. // old school shim for old browsers
  12510. module.exports = function inherits(ctor, superCtor) {
  12511. if (superCtor) {
  12512. ctor.super_ = superCtor
  12513. var TempCtor = function () {}
  12514. TempCtor.prototype = superCtor.prototype
  12515. ctor.prototype = new TempCtor()
  12516. ctor.prototype.constructor = ctor
  12517. }
  12518. }
  12519. }
  12520. /***/ }),
  12521. /* 88 */
  12522. /*!**************************************!*\
  12523. !*** ./node_modules/md5.js/index.js ***!
  12524. \**************************************/
  12525. /*! no static exports found */
  12526. /***/ (function(module, exports, __webpack_require__) {
  12527. "use strict";
  12528. var inherits = __webpack_require__(/*! inherits */ 87)
  12529. var HashBase = __webpack_require__(/*! hash-base */ 89)
  12530. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  12531. var ARRAY16 = new Array(16)
  12532. function MD5 () {
  12533. HashBase.call(this, 64)
  12534. // state
  12535. this._a = 0x67452301
  12536. this._b = 0xefcdab89
  12537. this._c = 0x98badcfe
  12538. this._d = 0x10325476
  12539. }
  12540. inherits(MD5, HashBase)
  12541. MD5.prototype._update = function () {
  12542. var M = ARRAY16
  12543. for (var i = 0; i < 16; ++i) M[i] = this._block.readInt32LE(i * 4)
  12544. var a = this._a
  12545. var b = this._b
  12546. var c = this._c
  12547. var d = this._d
  12548. a = fnF(a, b, c, d, M[0], 0xd76aa478, 7)
  12549. d = fnF(d, a, b, c, M[1], 0xe8c7b756, 12)
  12550. c = fnF(c, d, a, b, M[2], 0x242070db, 17)
  12551. b = fnF(b, c, d, a, M[3], 0xc1bdceee, 22)
  12552. a = fnF(a, b, c, d, M[4], 0xf57c0faf, 7)
  12553. d = fnF(d, a, b, c, M[5], 0x4787c62a, 12)
  12554. c = fnF(c, d, a, b, M[6], 0xa8304613, 17)
  12555. b = fnF(b, c, d, a, M[7], 0xfd469501, 22)
  12556. a = fnF(a, b, c, d, M[8], 0x698098d8, 7)
  12557. d = fnF(d, a, b, c, M[9], 0x8b44f7af, 12)
  12558. c = fnF(c, d, a, b, M[10], 0xffff5bb1, 17)
  12559. b = fnF(b, c, d, a, M[11], 0x895cd7be, 22)
  12560. a = fnF(a, b, c, d, M[12], 0x6b901122, 7)
  12561. d = fnF(d, a, b, c, M[13], 0xfd987193, 12)
  12562. c = fnF(c, d, a, b, M[14], 0xa679438e, 17)
  12563. b = fnF(b, c, d, a, M[15], 0x49b40821, 22)
  12564. a = fnG(a, b, c, d, M[1], 0xf61e2562, 5)
  12565. d = fnG(d, a, b, c, M[6], 0xc040b340, 9)
  12566. c = fnG(c, d, a, b, M[11], 0x265e5a51, 14)
  12567. b = fnG(b, c, d, a, M[0], 0xe9b6c7aa, 20)
  12568. a = fnG(a, b, c, d, M[5], 0xd62f105d, 5)
  12569. d = fnG(d, a, b, c, M[10], 0x02441453, 9)
  12570. c = fnG(c, d, a, b, M[15], 0xd8a1e681, 14)
  12571. b = fnG(b, c, d, a, M[4], 0xe7d3fbc8, 20)
  12572. a = fnG(a, b, c, d, M[9], 0x21e1cde6, 5)
  12573. d = fnG(d, a, b, c, M[14], 0xc33707d6, 9)
  12574. c = fnG(c, d, a, b, M[3], 0xf4d50d87, 14)
  12575. b = fnG(b, c, d, a, M[8], 0x455a14ed, 20)
  12576. a = fnG(a, b, c, d, M[13], 0xa9e3e905, 5)
  12577. d = fnG(d, a, b, c, M[2], 0xfcefa3f8, 9)
  12578. c = fnG(c, d, a, b, M[7], 0x676f02d9, 14)
  12579. b = fnG(b, c, d, a, M[12], 0x8d2a4c8a, 20)
  12580. a = fnH(a, b, c, d, M[5], 0xfffa3942, 4)
  12581. d = fnH(d, a, b, c, M[8], 0x8771f681, 11)
  12582. c = fnH(c, d, a, b, M[11], 0x6d9d6122, 16)
  12583. b = fnH(b, c, d, a, M[14], 0xfde5380c, 23)
  12584. a = fnH(a, b, c, d, M[1], 0xa4beea44, 4)
  12585. d = fnH(d, a, b, c, M[4], 0x4bdecfa9, 11)
  12586. c = fnH(c, d, a, b, M[7], 0xf6bb4b60, 16)
  12587. b = fnH(b, c, d, a, M[10], 0xbebfbc70, 23)
  12588. a = fnH(a, b, c, d, M[13], 0x289b7ec6, 4)
  12589. d = fnH(d, a, b, c, M[0], 0xeaa127fa, 11)
  12590. c = fnH(c, d, a, b, M[3], 0xd4ef3085, 16)
  12591. b = fnH(b, c, d, a, M[6], 0x04881d05, 23)
  12592. a = fnH(a, b, c, d, M[9], 0xd9d4d039, 4)
  12593. d = fnH(d, a, b, c, M[12], 0xe6db99e5, 11)
  12594. c = fnH(c, d, a, b, M[15], 0x1fa27cf8, 16)
  12595. b = fnH(b, c, d, a, M[2], 0xc4ac5665, 23)
  12596. a = fnI(a, b, c, d, M[0], 0xf4292244, 6)
  12597. d = fnI(d, a, b, c, M[7], 0x432aff97, 10)
  12598. c = fnI(c, d, a, b, M[14], 0xab9423a7, 15)
  12599. b = fnI(b, c, d, a, M[5], 0xfc93a039, 21)
  12600. a = fnI(a, b, c, d, M[12], 0x655b59c3, 6)
  12601. d = fnI(d, a, b, c, M[3], 0x8f0ccc92, 10)
  12602. c = fnI(c, d, a, b, M[10], 0xffeff47d, 15)
  12603. b = fnI(b, c, d, a, M[1], 0x85845dd1, 21)
  12604. a = fnI(a, b, c, d, M[8], 0x6fa87e4f, 6)
  12605. d = fnI(d, a, b, c, M[15], 0xfe2ce6e0, 10)
  12606. c = fnI(c, d, a, b, M[6], 0xa3014314, 15)
  12607. b = fnI(b, c, d, a, M[13], 0x4e0811a1, 21)
  12608. a = fnI(a, b, c, d, M[4], 0xf7537e82, 6)
  12609. d = fnI(d, a, b, c, M[11], 0xbd3af235, 10)
  12610. c = fnI(c, d, a, b, M[2], 0x2ad7d2bb, 15)
  12611. b = fnI(b, c, d, a, M[9], 0xeb86d391, 21)
  12612. this._a = (this._a + a) | 0
  12613. this._b = (this._b + b) | 0
  12614. this._c = (this._c + c) | 0
  12615. this._d = (this._d + d) | 0
  12616. }
  12617. MD5.prototype._digest = function () {
  12618. // create padding and handle blocks
  12619. this._block[this._blockOffset++] = 0x80
  12620. if (this._blockOffset > 56) {
  12621. this._block.fill(0, this._blockOffset, 64)
  12622. this._update()
  12623. this._blockOffset = 0
  12624. }
  12625. this._block.fill(0, this._blockOffset, 56)
  12626. this._block.writeUInt32LE(this._length[0], 56)
  12627. this._block.writeUInt32LE(this._length[1], 60)
  12628. this._update()
  12629. // produce result
  12630. var buffer = Buffer.allocUnsafe(16)
  12631. buffer.writeInt32LE(this._a, 0)
  12632. buffer.writeInt32LE(this._b, 4)
  12633. buffer.writeInt32LE(this._c, 8)
  12634. buffer.writeInt32LE(this._d, 12)
  12635. return buffer
  12636. }
  12637. function rotl (x, n) {
  12638. return (x << n) | (x >>> (32 - n))
  12639. }
  12640. function fnF (a, b, c, d, m, k, s) {
  12641. return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + b) | 0
  12642. }
  12643. function fnG (a, b, c, d, m, k, s) {
  12644. return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + b) | 0
  12645. }
  12646. function fnH (a, b, c, d, m, k, s) {
  12647. return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + b) | 0
  12648. }
  12649. function fnI (a, b, c, d, m, k, s) {
  12650. return (rotl((a + ((c ^ (b | (~d)))) + m + k) | 0, s) + b) | 0
  12651. }
  12652. module.exports = MD5
  12653. /***/ }),
  12654. /* 89 */
  12655. /*!*****************************************!*\
  12656. !*** ./node_modules/hash-base/index.js ***!
  12657. \*****************************************/
  12658. /*! no static exports found */
  12659. /***/ (function(module, exports, __webpack_require__) {
  12660. "use strict";
  12661. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  12662. var Transform = __webpack_require__(/*! readable-stream */ 90).Transform
  12663. var inherits = __webpack_require__(/*! inherits */ 87)
  12664. function throwIfNotStringOrBuffer (val, prefix) {
  12665. if (!Buffer.isBuffer(val) && typeof val !== 'string') {
  12666. throw new TypeError(prefix + ' must be a string or a buffer')
  12667. }
  12668. }
  12669. function HashBase (blockSize) {
  12670. Transform.call(this)
  12671. this._block = Buffer.allocUnsafe(blockSize)
  12672. this._blockSize = blockSize
  12673. this._blockOffset = 0
  12674. this._length = [0, 0, 0, 0]
  12675. this._finalized = false
  12676. }
  12677. inherits(HashBase, Transform)
  12678. HashBase.prototype._transform = function (chunk, encoding, callback) {
  12679. var error = null
  12680. try {
  12681. this.update(chunk, encoding)
  12682. } catch (err) {
  12683. error = err
  12684. }
  12685. callback(error)
  12686. }
  12687. HashBase.prototype._flush = function (callback) {
  12688. var error = null
  12689. try {
  12690. this.push(this.digest())
  12691. } catch (err) {
  12692. error = err
  12693. }
  12694. callback(error)
  12695. }
  12696. HashBase.prototype.update = function (data, encoding) {
  12697. throwIfNotStringOrBuffer(data, 'Data')
  12698. if (this._finalized) throw new Error('Digest already called')
  12699. if (!Buffer.isBuffer(data)) data = Buffer.from(data, encoding)
  12700. // consume data
  12701. var block = this._block
  12702. var offset = 0
  12703. while (this._blockOffset + data.length - offset >= this._blockSize) {
  12704. for (var i = this._blockOffset; i < this._blockSize;) block[i++] = data[offset++]
  12705. this._update()
  12706. this._blockOffset = 0
  12707. }
  12708. while (offset < data.length) block[this._blockOffset++] = data[offset++]
  12709. // update length
  12710. for (var j = 0, carry = data.length * 8; carry > 0; ++j) {
  12711. this._length[j] += carry
  12712. carry = (this._length[j] / 0x0100000000) | 0
  12713. if (carry > 0) this._length[j] -= 0x0100000000 * carry
  12714. }
  12715. return this
  12716. }
  12717. HashBase.prototype._update = function () {
  12718. throw new Error('_update is not implemented')
  12719. }
  12720. HashBase.prototype.digest = function (encoding) {
  12721. if (this._finalized) throw new Error('Digest already called')
  12722. this._finalized = true
  12723. var digest = this._digest()
  12724. if (encoding !== undefined) digest = digest.toString(encoding)
  12725. // reset state
  12726. this._block.fill(0)
  12727. this._blockOffset = 0
  12728. for (var i = 0; i < 4; ++i) this._length[i] = 0
  12729. return digest
  12730. }
  12731. HashBase.prototype._digest = function () {
  12732. throw new Error('_digest is not implemented')
  12733. }
  12734. module.exports = HashBase
  12735. /***/ }),
  12736. /* 90 */
  12737. /*!**********************************************************!*\
  12738. !*** ./node_modules/readable-stream/readable-browser.js ***!
  12739. \**********************************************************/
  12740. /*! no static exports found */
  12741. /***/ (function(module, exports, __webpack_require__) {
  12742. exports = module.exports = __webpack_require__(/*! ./lib/_stream_readable.js */ 91);
  12743. exports.Stream = exports;
  12744. exports.Readable = exports;
  12745. exports.Writable = __webpack_require__(/*! ./lib/_stream_writable.js */ 101);
  12746. exports.Duplex = __webpack_require__(/*! ./lib/_stream_duplex.js */ 100);
  12747. exports.Transform = __webpack_require__(/*! ./lib/_stream_transform.js */ 104);
  12748. exports.PassThrough = __webpack_require__(/*! ./lib/_stream_passthrough.js */ 105);
  12749. /***/ }),
  12750. /* 91 */
  12751. /*!**************************************************************!*\
  12752. !*** ./node_modules/readable-stream/lib/_stream_readable.js ***!
  12753. \**************************************************************/
  12754. /*! no static exports found */
  12755. /***/ (function(module, exports, __webpack_require__) {
  12756. "use strict";
  12757. /* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.
  12758. //
  12759. // Permission is hereby granted, free of charge, to any person obtaining a
  12760. // copy of this software and associated documentation files (the
  12761. // "Software"), to deal in the Software without restriction, including
  12762. // without limitation the rights to use, copy, modify, merge, publish,
  12763. // distribute, sublicense, and/or sell copies of the Software, and to permit
  12764. // persons to whom the Software is furnished to do so, subject to the
  12765. // following conditions:
  12766. //
  12767. // The above copyright notice and this permission notice shall be included
  12768. // in all copies or substantial portions of the Software.
  12769. //
  12770. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  12771. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  12772. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  12773. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  12774. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  12775. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  12776. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  12777. /*<replacement>*/
  12778. var pna = __webpack_require__(/*! process-nextick-args */ 92);
  12779. /*</replacement>*/
  12780. module.exports = Readable;
  12781. /*<replacement>*/
  12782. var isArray = __webpack_require__(/*! isarray */ 85);
  12783. /*</replacement>*/
  12784. /*<replacement>*/
  12785. var Duplex;
  12786. /*</replacement>*/
  12787. Readable.ReadableState = ReadableState;
  12788. /*<replacement>*/
  12789. var EE = __webpack_require__(/*! events */ 93).EventEmitter;
  12790. var EElistenerCount = function (emitter, type) {
  12791. return emitter.listeners(type).length;
  12792. };
  12793. /*</replacement>*/
  12794. /*<replacement>*/
  12795. var Stream = __webpack_require__(/*! ./internal/streams/stream */ 94);
  12796. /*</replacement>*/
  12797. /*<replacement>*/
  12798. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer;
  12799. var OurUint8Array = global.Uint8Array || function () {};
  12800. function _uint8ArrayToBuffer(chunk) {
  12801. return Buffer.from(chunk);
  12802. }
  12803. function _isUint8Array(obj) {
  12804. return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
  12805. }
  12806. /*</replacement>*/
  12807. /*<replacement>*/
  12808. var util = Object.create(__webpack_require__(/*! core-util-is */ 95));
  12809. util.inherits = __webpack_require__(/*! inherits */ 87);
  12810. /*</replacement>*/
  12811. /*<replacement>*/
  12812. var debugUtil = __webpack_require__(/*! util */ 96);
  12813. var debug = void 0;
  12814. if (debugUtil && debugUtil.debuglog) {
  12815. debug = debugUtil.debuglog('stream');
  12816. } else {
  12817. debug = function () {};
  12818. }
  12819. /*</replacement>*/
  12820. var BufferList = __webpack_require__(/*! ./internal/streams/BufferList */ 97);
  12821. var destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ 99);
  12822. var StringDecoder;
  12823. util.inherits(Readable, Stream);
  12824. var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
  12825. function prependListener(emitter, event, fn) {
  12826. // Sadly this is not cacheable as some libraries bundle their own
  12827. // event emitter implementation with them.
  12828. if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);
  12829. // This is a hack to make sure that our error handler is attached before any
  12830. // userland ones. NEVER DO THIS. This is here only because this code needs
  12831. // to continue to work with older versions of Node.js that do not include
  12832. // the prependListener() method. The goal is to eventually remove this hack.
  12833. 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]];
  12834. }
  12835. function ReadableState(options, stream) {
  12836. Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ 100);
  12837. options = options || {};
  12838. // Duplex streams are both readable and writable, but share
  12839. // the same options object.
  12840. // However, some cases require setting options to different
  12841. // values for the readable and the writable sides of the duplex stream.
  12842. // These options can be provided separately as readableXXX and writableXXX.
  12843. var isDuplex = stream instanceof Duplex;
  12844. // object stream flag. Used to make read(n) ignore n and to
  12845. // make all the buffer merging and length checks go away
  12846. this.objectMode = !!options.objectMode;
  12847. if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
  12848. // the point at which it stops calling _read() to fill the buffer
  12849. // Note: 0 is a valid value, means "don't call _read preemptively ever"
  12850. var hwm = options.highWaterMark;
  12851. var readableHwm = options.readableHighWaterMark;
  12852. var defaultHwm = this.objectMode ? 16 : 16 * 1024;
  12853. if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;
  12854. // cast to ints.
  12855. this.highWaterMark = Math.floor(this.highWaterMark);
  12856. // A linked list is used to store data chunks instead of an array because the
  12857. // linked list can remove elements from the beginning faster than
  12858. // array.shift()
  12859. this.buffer = new BufferList();
  12860. this.length = 0;
  12861. this.pipes = null;
  12862. this.pipesCount = 0;
  12863. this.flowing = null;
  12864. this.ended = false;
  12865. this.endEmitted = false;
  12866. this.reading = false;
  12867. // a flag to be able to tell if the event 'readable'/'data' is emitted
  12868. // immediately, or on a later tick. We set this to true at first, because
  12869. // any actions that shouldn't happen until "later" should generally also
  12870. // not happen before the first read call.
  12871. this.sync = true;
  12872. // whenever we return null, then we set a flag to say
  12873. // that we're awaiting a 'readable' event emission.
  12874. this.needReadable = false;
  12875. this.emittedReadable = false;
  12876. this.readableListening = false;
  12877. this.resumeScheduled = false;
  12878. // has it been destroyed
  12879. this.destroyed = false;
  12880. // Crypto is kind of old and crusty. Historically, its default string
  12881. // encoding is 'binary' so we have to make this configurable.
  12882. // Everything else in the universe uses 'utf8', though.
  12883. this.defaultEncoding = options.defaultEncoding || 'utf8';
  12884. // the number of writers that are awaiting a drain event in .pipe()s
  12885. this.awaitDrain = 0;
  12886. // if true, a maybeReadMore has been scheduled
  12887. this.readingMore = false;
  12888. this.decoder = null;
  12889. this.encoding = null;
  12890. if (options.encoding) {
  12891. if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ 103).StringDecoder;
  12892. this.decoder = new StringDecoder(options.encoding);
  12893. this.encoding = options.encoding;
  12894. }
  12895. }
  12896. function Readable(options) {
  12897. Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ 100);
  12898. if (!(this instanceof Readable)) return new Readable(options);
  12899. this._readableState = new ReadableState(options, this);
  12900. // legacy
  12901. this.readable = true;
  12902. if (options) {
  12903. if (typeof options.read === 'function') this._read = options.read;
  12904. if (typeof options.destroy === 'function') this._destroy = options.destroy;
  12905. }
  12906. Stream.call(this);
  12907. }
  12908. Object.defineProperty(Readable.prototype, 'destroyed', {
  12909. get: function () {
  12910. if (this._readableState === undefined) {
  12911. return false;
  12912. }
  12913. return this._readableState.destroyed;
  12914. },
  12915. set: function (value) {
  12916. // we ignore the value if the stream
  12917. // has not been initialized yet
  12918. if (!this._readableState) {
  12919. return;
  12920. }
  12921. // backward compatibility, the user is explicitly
  12922. // managing destroyed
  12923. this._readableState.destroyed = value;
  12924. }
  12925. });
  12926. Readable.prototype.destroy = destroyImpl.destroy;
  12927. Readable.prototype._undestroy = destroyImpl.undestroy;
  12928. Readable.prototype._destroy = function (err, cb) {
  12929. this.push(null);
  12930. cb(err);
  12931. };
  12932. // Manually shove something into the read() buffer.
  12933. // This returns true if the highWaterMark has not been hit yet,
  12934. // similar to how Writable.write() returns true if you should
  12935. // write() some more.
  12936. Readable.prototype.push = function (chunk, encoding) {
  12937. var state = this._readableState;
  12938. var skipChunkCheck;
  12939. if (!state.objectMode) {
  12940. if (typeof chunk === 'string') {
  12941. encoding = encoding || state.defaultEncoding;
  12942. if (encoding !== state.encoding) {
  12943. chunk = Buffer.from(chunk, encoding);
  12944. encoding = '';
  12945. }
  12946. skipChunkCheck = true;
  12947. }
  12948. } else {
  12949. skipChunkCheck = true;
  12950. }
  12951. return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
  12952. };
  12953. // Unshift should *always* be something directly out of read()
  12954. Readable.prototype.unshift = function (chunk) {
  12955. return readableAddChunk(this, chunk, null, true, false);
  12956. };
  12957. function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
  12958. var state = stream._readableState;
  12959. if (chunk === null) {
  12960. state.reading = false;
  12961. onEofChunk(stream, state);
  12962. } else {
  12963. var er;
  12964. if (!skipChunkCheck) er = chunkInvalid(state, chunk);
  12965. if (er) {
  12966. stream.emit('error', er);
  12967. } else if (state.objectMode || chunk && chunk.length > 0) {
  12968. if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
  12969. chunk = _uint8ArrayToBuffer(chunk);
  12970. }
  12971. if (addToFront) {
  12972. if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);
  12973. } else if (state.ended) {
  12974. stream.emit('error', new Error('stream.push() after EOF'));
  12975. } else {
  12976. state.reading = false;
  12977. if (state.decoder && !encoding) {
  12978. chunk = state.decoder.write(chunk);
  12979. if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
  12980. } else {
  12981. addChunk(stream, state, chunk, false);
  12982. }
  12983. }
  12984. } else if (!addToFront) {
  12985. state.reading = false;
  12986. }
  12987. }
  12988. return needMoreData(state);
  12989. }
  12990. function addChunk(stream, state, chunk, addToFront) {
  12991. if (state.flowing && state.length === 0 && !state.sync) {
  12992. stream.emit('data', chunk);
  12993. stream.read(0);
  12994. } else {
  12995. // update the buffer info.
  12996. state.length += state.objectMode ? 1 : chunk.length;
  12997. if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
  12998. if (state.needReadable) emitReadable(stream);
  12999. }
  13000. maybeReadMore(stream, state);
  13001. }
  13002. function chunkInvalid(state, chunk) {
  13003. var er;
  13004. if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
  13005. er = new TypeError('Invalid non-string/buffer chunk');
  13006. }
  13007. return er;
  13008. }
  13009. // if it's past the high water mark, we can push in some more.
  13010. // Also, if we have no data yet, we can stand some
  13011. // more bytes. This is to work around cases where hwm=0,
  13012. // such as the repl. Also, if the push() triggered a
  13013. // readable event, and the user called read(largeNumber) such that
  13014. // needReadable was set, then we ought to push more, so that another
  13015. // 'readable' event will be triggered.
  13016. function needMoreData(state) {
  13017. return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
  13018. }
  13019. Readable.prototype.isPaused = function () {
  13020. return this._readableState.flowing === false;
  13021. };
  13022. // backwards compatibility.
  13023. Readable.prototype.setEncoding = function (enc) {
  13024. if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ 103).StringDecoder;
  13025. this._readableState.decoder = new StringDecoder(enc);
  13026. this._readableState.encoding = enc;
  13027. return this;
  13028. };
  13029. // Don't raise the hwm > 8MB
  13030. var MAX_HWM = 0x800000;
  13031. function computeNewHighWaterMark(n) {
  13032. if (n >= MAX_HWM) {
  13033. n = MAX_HWM;
  13034. } else {
  13035. // Get the next highest power of 2 to prevent increasing hwm excessively in
  13036. // tiny amounts
  13037. n--;
  13038. n |= n >>> 1;
  13039. n |= n >>> 2;
  13040. n |= n >>> 4;
  13041. n |= n >>> 8;
  13042. n |= n >>> 16;
  13043. n++;
  13044. }
  13045. return n;
  13046. }
  13047. // This function is designed to be inlinable, so please take care when making
  13048. // changes to the function body.
  13049. function howMuchToRead(n, state) {
  13050. if (n <= 0 || state.length === 0 && state.ended) return 0;
  13051. if (state.objectMode) return 1;
  13052. if (n !== n) {
  13053. // Only flow one buffer at a time
  13054. if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
  13055. }
  13056. // If we're asking for more than the current hwm, then raise the hwm.
  13057. if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
  13058. if (n <= state.length) return n;
  13059. // Don't have enough
  13060. if (!state.ended) {
  13061. state.needReadable = true;
  13062. return 0;
  13063. }
  13064. return state.length;
  13065. }
  13066. // you can override either this method, or the async _read(n) below.
  13067. Readable.prototype.read = function (n) {
  13068. debug('read', n);
  13069. n = parseInt(n, 10);
  13070. var state = this._readableState;
  13071. var nOrig = n;
  13072. if (n !== 0) state.emittedReadable = false;
  13073. // if we're doing read(0) to trigger a readable event, but we
  13074. // already have a bunch of data in the buffer, then just trigger
  13075. // the 'readable' event and move on.
  13076. if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
  13077. debug('read: emitReadable', state.length, state.ended);
  13078. if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
  13079. return null;
  13080. }
  13081. n = howMuchToRead(n, state);
  13082. // if we've ended, and we're now clear, then finish it up.
  13083. if (n === 0 && state.ended) {
  13084. if (state.length === 0) endReadable(this);
  13085. return null;
  13086. }
  13087. // All the actual chunk generation logic needs to be
  13088. // *below* the call to _read. The reason is that in certain
  13089. // synthetic stream cases, such as passthrough streams, _read
  13090. // may be a completely synchronous operation which may change
  13091. // the state of the read buffer, providing enough data when
  13092. // before there was *not* enough.
  13093. //
  13094. // So, the steps are:
  13095. // 1. Figure out what the state of things will be after we do
  13096. // a read from the buffer.
  13097. //
  13098. // 2. If that resulting state will trigger a _read, then call _read.
  13099. // Note that this may be asynchronous, or synchronous. Yes, it is
  13100. // deeply ugly to write APIs this way, but that still doesn't mean
  13101. // that the Readable class should behave improperly, as streams are
  13102. // designed to be sync/async agnostic.
  13103. // Take note if the _read call is sync or async (ie, if the read call
  13104. // has returned yet), so that we know whether or not it's safe to emit
  13105. // 'readable' etc.
  13106. //
  13107. // 3. Actually pull the requested chunks out of the buffer and return.
  13108. // if we need a readable event, then we need to do some reading.
  13109. var doRead = state.needReadable;
  13110. debug('need readable', doRead);
  13111. // if we currently have less than the highWaterMark, then also read some
  13112. if (state.length === 0 || state.length - n < state.highWaterMark) {
  13113. doRead = true;
  13114. debug('length less than watermark', doRead);
  13115. }
  13116. // however, if we've ended, then there's no point, and if we're already
  13117. // reading, then it's unnecessary.
  13118. if (state.ended || state.reading) {
  13119. doRead = false;
  13120. debug('reading or ended', doRead);
  13121. } else if (doRead) {
  13122. debug('do read');
  13123. state.reading = true;
  13124. state.sync = true;
  13125. // if the length is currently zero, then we *need* a readable event.
  13126. if (state.length === 0) state.needReadable = true;
  13127. // call internal read method
  13128. this._read(state.highWaterMark);
  13129. state.sync = false;
  13130. // If _read pushed data synchronously, then `reading` will be false,
  13131. // and we need to re-evaluate how much data we can return to the user.
  13132. if (!state.reading) n = howMuchToRead(nOrig, state);
  13133. }
  13134. var ret;
  13135. if (n > 0) ret = fromList(n, state);else ret = null;
  13136. if (ret === null) {
  13137. state.needReadable = true;
  13138. n = 0;
  13139. } else {
  13140. state.length -= n;
  13141. }
  13142. if (state.length === 0) {
  13143. // If we have nothing in the buffer, then we want to know
  13144. // as soon as we *do* get something into the buffer.
  13145. if (!state.ended) state.needReadable = true;
  13146. // If we tried to read() past the EOF, then emit end on the next tick.
  13147. if (nOrig !== n && state.ended) endReadable(this);
  13148. }
  13149. if (ret !== null) this.emit('data', ret);
  13150. return ret;
  13151. };
  13152. function onEofChunk(stream, state) {
  13153. if (state.ended) return;
  13154. if (state.decoder) {
  13155. var chunk = state.decoder.end();
  13156. if (chunk && chunk.length) {
  13157. state.buffer.push(chunk);
  13158. state.length += state.objectMode ? 1 : chunk.length;
  13159. }
  13160. }
  13161. state.ended = true;
  13162. // emit 'readable' now to make sure it gets picked up.
  13163. emitReadable(stream);
  13164. }
  13165. // Don't emit readable right away in sync mode, because this can trigger
  13166. // another read() call => stack overflow. This way, it might trigger
  13167. // a nextTick recursion warning, but that's not so bad.
  13168. function emitReadable(stream) {
  13169. var state = stream._readableState;
  13170. state.needReadable = false;
  13171. if (!state.emittedReadable) {
  13172. debug('emitReadable', state.flowing);
  13173. state.emittedReadable = true;
  13174. if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);
  13175. }
  13176. }
  13177. function emitReadable_(stream) {
  13178. debug('emit readable');
  13179. stream.emit('readable');
  13180. flow(stream);
  13181. }
  13182. // at this point, the user has presumably seen the 'readable' event,
  13183. // and called read() to consume some data. that may have triggered
  13184. // in turn another _read(n) call, in which case reading = true if
  13185. // it's in progress.
  13186. // However, if we're not ended, or reading, and the length < hwm,
  13187. // then go ahead and try to read some more preemptively.
  13188. function maybeReadMore(stream, state) {
  13189. if (!state.readingMore) {
  13190. state.readingMore = true;
  13191. pna.nextTick(maybeReadMore_, stream, state);
  13192. }
  13193. }
  13194. function maybeReadMore_(stream, state) {
  13195. var len = state.length;
  13196. while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
  13197. debug('maybeReadMore read 0');
  13198. stream.read(0);
  13199. if (len === state.length)
  13200. // didn't get any data, stop spinning.
  13201. break;else len = state.length;
  13202. }
  13203. state.readingMore = false;
  13204. }
  13205. // abstract method. to be overridden in specific implementation classes.
  13206. // call cb(er, data) where data is <= n in length.
  13207. // for virtual (non-string, non-buffer) streams, "length" is somewhat
  13208. // arbitrary, and perhaps not very meaningful.
  13209. Readable.prototype._read = function (n) {
  13210. this.emit('error', new Error('_read() is not implemented'));
  13211. };
  13212. Readable.prototype.pipe = function (dest, pipeOpts) {
  13213. var src = this;
  13214. var state = this._readableState;
  13215. switch (state.pipesCount) {
  13216. case 0:
  13217. state.pipes = dest;
  13218. break;
  13219. case 1:
  13220. state.pipes = [state.pipes, dest];
  13221. break;
  13222. default:
  13223. state.pipes.push(dest);
  13224. break;
  13225. }
  13226. state.pipesCount += 1;
  13227. debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
  13228. var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
  13229. var endFn = doEnd ? onend : unpipe;
  13230. if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);
  13231. dest.on('unpipe', onunpipe);
  13232. function onunpipe(readable, unpipeInfo) {
  13233. debug('onunpipe');
  13234. if (readable === src) {
  13235. if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
  13236. unpipeInfo.hasUnpiped = true;
  13237. cleanup();
  13238. }
  13239. }
  13240. }
  13241. function onend() {
  13242. debug('onend');
  13243. dest.end();
  13244. }
  13245. // when the dest drains, it reduces the awaitDrain counter
  13246. // on the source. This would be more elegant with a .once()
  13247. // handler in flow(), but adding and removing repeatedly is
  13248. // too slow.
  13249. var ondrain = pipeOnDrain(src);
  13250. dest.on('drain', ondrain);
  13251. var cleanedUp = false;
  13252. function cleanup() {
  13253. debug('cleanup');
  13254. // cleanup event handlers once the pipe is broken
  13255. dest.removeListener('close', onclose);
  13256. dest.removeListener('finish', onfinish);
  13257. dest.removeListener('drain', ondrain);
  13258. dest.removeListener('error', onerror);
  13259. dest.removeListener('unpipe', onunpipe);
  13260. src.removeListener('end', onend);
  13261. src.removeListener('end', unpipe);
  13262. src.removeListener('data', ondata);
  13263. cleanedUp = true;
  13264. // if the reader is waiting for a drain event from this
  13265. // specific writer, then it would cause it to never start
  13266. // flowing again.
  13267. // So, if this is awaiting a drain, then we just call it now.
  13268. // If we don't know, then assume that we are waiting for one.
  13269. if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
  13270. }
  13271. // If the user pushes more data while we're writing to dest then we'll end up
  13272. // in ondata again. However, we only want to increase awaitDrain once because
  13273. // dest will only emit one 'drain' event for the multiple writes.
  13274. // => Introduce a guard on increasing awaitDrain.
  13275. var increasedAwaitDrain = false;
  13276. src.on('data', ondata);
  13277. function ondata(chunk) {
  13278. debug('ondata');
  13279. increasedAwaitDrain = false;
  13280. var ret = dest.write(chunk);
  13281. if (false === ret && !increasedAwaitDrain) {
  13282. // If the user unpiped during `dest.write()`, it is possible
  13283. // to get stuck in a permanently paused state if that write
  13284. // also returned false.
  13285. // => Check whether `dest` is still a piping destination.
  13286. if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
  13287. debug('false write response, pause', src._readableState.awaitDrain);
  13288. src._readableState.awaitDrain++;
  13289. increasedAwaitDrain = true;
  13290. }
  13291. src.pause();
  13292. }
  13293. }
  13294. // if the dest has an error, then stop piping into it.
  13295. // however, don't suppress the throwing behavior for this.
  13296. function onerror(er) {
  13297. debug('onerror', er);
  13298. unpipe();
  13299. dest.removeListener('error', onerror);
  13300. if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
  13301. }
  13302. // Make sure our error handler is attached before userland ones.
  13303. prependListener(dest, 'error', onerror);
  13304. // Both close and finish should trigger unpipe, but only once.
  13305. function onclose() {
  13306. dest.removeListener('finish', onfinish);
  13307. unpipe();
  13308. }
  13309. dest.once('close', onclose);
  13310. function onfinish() {
  13311. debug('onfinish');
  13312. dest.removeListener('close', onclose);
  13313. unpipe();
  13314. }
  13315. dest.once('finish', onfinish);
  13316. function unpipe() {
  13317. debug('unpipe');
  13318. src.unpipe(dest);
  13319. }
  13320. // tell the dest that it's being piped to
  13321. dest.emit('pipe', src);
  13322. // start the flow if it hasn't been started already.
  13323. if (!state.flowing) {
  13324. debug('pipe resume');
  13325. src.resume();
  13326. }
  13327. return dest;
  13328. };
  13329. function pipeOnDrain(src) {
  13330. return function () {
  13331. var state = src._readableState;
  13332. debug('pipeOnDrain', state.awaitDrain);
  13333. if (state.awaitDrain) state.awaitDrain--;
  13334. if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
  13335. state.flowing = true;
  13336. flow(src);
  13337. }
  13338. };
  13339. }
  13340. Readable.prototype.unpipe = function (dest) {
  13341. var state = this._readableState;
  13342. var unpipeInfo = { hasUnpiped: false };
  13343. // if we're not piping anywhere, then do nothing.
  13344. if (state.pipesCount === 0) return this;
  13345. // just one destination. most common case.
  13346. if (state.pipesCount === 1) {
  13347. // passed in one, but it's not the right one.
  13348. if (dest && dest !== state.pipes) return this;
  13349. if (!dest) dest = state.pipes;
  13350. // got a match.
  13351. state.pipes = null;
  13352. state.pipesCount = 0;
  13353. state.flowing = false;
  13354. if (dest) dest.emit('unpipe', this, unpipeInfo);
  13355. return this;
  13356. }
  13357. // slow case. multiple pipe destinations.
  13358. if (!dest) {
  13359. // remove all.
  13360. var dests = state.pipes;
  13361. var len = state.pipesCount;
  13362. state.pipes = null;
  13363. state.pipesCount = 0;
  13364. state.flowing = false;
  13365. for (var i = 0; i < len; i++) {
  13366. dests[i].emit('unpipe', this, unpipeInfo);
  13367. }return this;
  13368. }
  13369. // try to find the right one.
  13370. var index = indexOf(state.pipes, dest);
  13371. if (index === -1) return this;
  13372. state.pipes.splice(index, 1);
  13373. state.pipesCount -= 1;
  13374. if (state.pipesCount === 1) state.pipes = state.pipes[0];
  13375. dest.emit('unpipe', this, unpipeInfo);
  13376. return this;
  13377. };
  13378. // set up data events if they are asked for
  13379. // Ensure readable listeners eventually get something
  13380. Readable.prototype.on = function (ev, fn) {
  13381. var res = Stream.prototype.on.call(this, ev, fn);
  13382. if (ev === 'data') {
  13383. // Start flowing on next tick if stream isn't explicitly paused
  13384. if (this._readableState.flowing !== false) this.resume();
  13385. } else if (ev === 'readable') {
  13386. var state = this._readableState;
  13387. if (!state.endEmitted && !state.readableListening) {
  13388. state.readableListening = state.needReadable = true;
  13389. state.emittedReadable = false;
  13390. if (!state.reading) {
  13391. pna.nextTick(nReadingNextTick, this);
  13392. } else if (state.length) {
  13393. emitReadable(this);
  13394. }
  13395. }
  13396. }
  13397. return res;
  13398. };
  13399. Readable.prototype.addListener = Readable.prototype.on;
  13400. function nReadingNextTick(self) {
  13401. debug('readable nexttick read 0');
  13402. self.read(0);
  13403. }
  13404. // pause() and resume() are remnants of the legacy readable stream API
  13405. // If the user uses them, then switch into old mode.
  13406. Readable.prototype.resume = function () {
  13407. var state = this._readableState;
  13408. if (!state.flowing) {
  13409. debug('resume');
  13410. state.flowing = true;
  13411. resume(this, state);
  13412. }
  13413. return this;
  13414. };
  13415. function resume(stream, state) {
  13416. if (!state.resumeScheduled) {
  13417. state.resumeScheduled = true;
  13418. pna.nextTick(resume_, stream, state);
  13419. }
  13420. }
  13421. function resume_(stream, state) {
  13422. if (!state.reading) {
  13423. debug('resume read 0');
  13424. stream.read(0);
  13425. }
  13426. state.resumeScheduled = false;
  13427. state.awaitDrain = 0;
  13428. stream.emit('resume');
  13429. flow(stream);
  13430. if (state.flowing && !state.reading) stream.read(0);
  13431. }
  13432. Readable.prototype.pause = function () {
  13433. debug('call pause flowing=%j', this._readableState.flowing);
  13434. if (false !== this._readableState.flowing) {
  13435. debug('pause');
  13436. this._readableState.flowing = false;
  13437. this.emit('pause');
  13438. }
  13439. return this;
  13440. };
  13441. function flow(stream) {
  13442. var state = stream._readableState;
  13443. debug('flow', state.flowing);
  13444. while (state.flowing && stream.read() !== null) {}
  13445. }
  13446. // wrap an old-style stream as the async data source.
  13447. // This is *not* part of the readable stream interface.
  13448. // It is an ugly unfortunate mess of history.
  13449. Readable.prototype.wrap = function (stream) {
  13450. var _this = this;
  13451. var state = this._readableState;
  13452. var paused = false;
  13453. stream.on('end', function () {
  13454. debug('wrapped end');
  13455. if (state.decoder && !state.ended) {
  13456. var chunk = state.decoder.end();
  13457. if (chunk && chunk.length) _this.push(chunk);
  13458. }
  13459. _this.push(null);
  13460. });
  13461. stream.on('data', function (chunk) {
  13462. debug('wrapped data');
  13463. if (state.decoder) chunk = state.decoder.write(chunk);
  13464. // don't skip over falsy values in objectMode
  13465. if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
  13466. var ret = _this.push(chunk);
  13467. if (!ret) {
  13468. paused = true;
  13469. stream.pause();
  13470. }
  13471. });
  13472. // proxy all the other methods.
  13473. // important when wrapping filters and duplexes.
  13474. for (var i in stream) {
  13475. if (this[i] === undefined && typeof stream[i] === 'function') {
  13476. this[i] = function (method) {
  13477. return function () {
  13478. return stream[method].apply(stream, arguments);
  13479. };
  13480. }(i);
  13481. }
  13482. }
  13483. // proxy certain important events.
  13484. for (var n = 0; n < kProxyEvents.length; n++) {
  13485. stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
  13486. }
  13487. // when we try to consume some more bytes, simply unpause the
  13488. // underlying stream.
  13489. this._read = function (n) {
  13490. debug('wrapped _read', n);
  13491. if (paused) {
  13492. paused = false;
  13493. stream.resume();
  13494. }
  13495. };
  13496. return this;
  13497. };
  13498. Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
  13499. // making it explicit this property is not enumerable
  13500. // because otherwise some prototype manipulation in
  13501. // userland will fail
  13502. enumerable: false,
  13503. get: function () {
  13504. return this._readableState.highWaterMark;
  13505. }
  13506. });
  13507. // exposed for testing purposes only.
  13508. Readable._fromList = fromList;
  13509. // Pluck off n bytes from an array of buffers.
  13510. // Length is the combined lengths of all the buffers in the list.
  13511. // This function is designed to be inlinable, so please take care when making
  13512. // changes to the function body.
  13513. function fromList(n, state) {
  13514. // nothing buffered
  13515. if (state.length === 0) return null;
  13516. var ret;
  13517. if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
  13518. // read it all, truncate the list
  13519. 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);
  13520. state.buffer.clear();
  13521. } else {
  13522. // read part of list
  13523. ret = fromListPartial(n, state.buffer, state.decoder);
  13524. }
  13525. return ret;
  13526. }
  13527. // Extracts only enough buffered data to satisfy the amount requested.
  13528. // This function is designed to be inlinable, so please take care when making
  13529. // changes to the function body.
  13530. function fromListPartial(n, list, hasStrings) {
  13531. var ret;
  13532. if (n < list.head.data.length) {
  13533. // slice is the same for buffers and strings
  13534. ret = list.head.data.slice(0, n);
  13535. list.head.data = list.head.data.slice(n);
  13536. } else if (n === list.head.data.length) {
  13537. // first chunk is a perfect match
  13538. ret = list.shift();
  13539. } else {
  13540. // result spans more than one buffer
  13541. ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
  13542. }
  13543. return ret;
  13544. }
  13545. // Copies a specified amount of characters from the list of buffered data
  13546. // chunks.
  13547. // This function is designed to be inlinable, so please take care when making
  13548. // changes to the function body.
  13549. function copyFromBufferString(n, list) {
  13550. var p = list.head;
  13551. var c = 1;
  13552. var ret = p.data;
  13553. n -= ret.length;
  13554. while (p = p.next) {
  13555. var str = p.data;
  13556. var nb = n > str.length ? str.length : n;
  13557. if (nb === str.length) ret += str;else ret += str.slice(0, n);
  13558. n -= nb;
  13559. if (n === 0) {
  13560. if (nb === str.length) {
  13561. ++c;
  13562. if (p.next) list.head = p.next;else list.head = list.tail = null;
  13563. } else {
  13564. list.head = p;
  13565. p.data = str.slice(nb);
  13566. }
  13567. break;
  13568. }
  13569. ++c;
  13570. }
  13571. list.length -= c;
  13572. return ret;
  13573. }
  13574. // Copies a specified amount of bytes from the list of buffered data chunks.
  13575. // This function is designed to be inlinable, so please take care when making
  13576. // changes to the function body.
  13577. function copyFromBuffer(n, list) {
  13578. var ret = Buffer.allocUnsafe(n);
  13579. var p = list.head;
  13580. var c = 1;
  13581. p.data.copy(ret);
  13582. n -= p.data.length;
  13583. while (p = p.next) {
  13584. var buf = p.data;
  13585. var nb = n > buf.length ? buf.length : n;
  13586. buf.copy(ret, ret.length - n, 0, nb);
  13587. n -= nb;
  13588. if (n === 0) {
  13589. if (nb === buf.length) {
  13590. ++c;
  13591. if (p.next) list.head = p.next;else list.head = list.tail = null;
  13592. } else {
  13593. list.head = p;
  13594. p.data = buf.slice(nb);
  13595. }
  13596. break;
  13597. }
  13598. ++c;
  13599. }
  13600. list.length -= c;
  13601. return ret;
  13602. }
  13603. function endReadable(stream) {
  13604. var state = stream._readableState;
  13605. // If we get here before consuming all the bytes, then that is a
  13606. // bug in node. Should never happen.
  13607. if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
  13608. if (!state.endEmitted) {
  13609. state.ended = true;
  13610. pna.nextTick(endReadableNT, state, stream);
  13611. }
  13612. }
  13613. function endReadableNT(state, stream) {
  13614. // Check that we didn't get one last unshift.
  13615. if (!state.endEmitted && state.length === 0) {
  13616. state.endEmitted = true;
  13617. stream.readable = false;
  13618. stream.emit('end');
  13619. }
  13620. }
  13621. function indexOf(xs, x) {
  13622. for (var i = 0, l = xs.length; i < l; i++) {
  13623. if (xs[i] === x) return i;
  13624. }
  13625. return -1;
  13626. }
  13627. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ 2), __webpack_require__(/*! ./../../node-libs-browser/mock/process.js */ 79)))
  13628. /***/ }),
  13629. /* 92 */
  13630. /*!****************************************************!*\
  13631. !*** ./node_modules/process-nextick-args/index.js ***!
  13632. \****************************************************/
  13633. /*! no static exports found */
  13634. /***/ (function(module, exports, __webpack_require__) {
  13635. "use strict";
  13636. /* WEBPACK VAR INJECTION */(function(process) {
  13637. if (typeof process === 'undefined' ||
  13638. !process.version ||
  13639. process.version.indexOf('v0.') === 0 ||
  13640. process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
  13641. module.exports = { nextTick: nextTick };
  13642. } else {
  13643. module.exports = process
  13644. }
  13645. function nextTick(fn, arg1, arg2, arg3) {
  13646. if (typeof fn !== 'function') {
  13647. throw new TypeError('"callback" argument must be a function');
  13648. }
  13649. var len = arguments.length;
  13650. var args, i;
  13651. switch (len) {
  13652. case 0:
  13653. case 1:
  13654. return process.nextTick(fn);
  13655. case 2:
  13656. return process.nextTick(function afterTickOne() {
  13657. fn.call(null, arg1);
  13658. });
  13659. case 3:
  13660. return process.nextTick(function afterTickTwo() {
  13661. fn.call(null, arg1, arg2);
  13662. });
  13663. case 4:
  13664. return process.nextTick(function afterTickThree() {
  13665. fn.call(null, arg1, arg2, arg3);
  13666. });
  13667. default:
  13668. args = new Array(len - 1);
  13669. i = 0;
  13670. while (i < args.length) {
  13671. args[i++] = arguments[i];
  13672. }
  13673. return process.nextTick(function afterTick() {
  13674. fn.apply(null, args);
  13675. });
  13676. }
  13677. }
  13678. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 79)))
  13679. /***/ }),
  13680. /* 93 */
  13681. /*!***************************************!*\
  13682. !*** ./node_modules/events/events.js ***!
  13683. \***************************************/
  13684. /*! no static exports found */
  13685. /***/ (function(module, exports, __webpack_require__) {
  13686. "use strict";
  13687. // Copyright Joyent, Inc. and other Node contributors.
  13688. //
  13689. // Permission is hereby granted, free of charge, to any person obtaining a
  13690. // copy of this software and associated documentation files (the
  13691. // "Software"), to deal in the Software without restriction, including
  13692. // without limitation the rights to use, copy, modify, merge, publish,
  13693. // distribute, sublicense, and/or sell copies of the Software, and to permit
  13694. // persons to whom the Software is furnished to do so, subject to the
  13695. // following conditions:
  13696. //
  13697. // The above copyright notice and this permission notice shall be included
  13698. // in all copies or substantial portions of the Software.
  13699. //
  13700. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  13701. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  13702. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  13703. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  13704. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  13705. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  13706. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  13707. var R = typeof Reflect === 'object' ? Reflect : null
  13708. var ReflectApply = R && typeof R.apply === 'function'
  13709. ? R.apply
  13710. : function ReflectApply(target, receiver, args) {
  13711. return Function.prototype.apply.call(target, receiver, args);
  13712. }
  13713. var ReflectOwnKeys
  13714. if (R && typeof R.ownKeys === 'function') {
  13715. ReflectOwnKeys = R.ownKeys
  13716. } else if (Object.getOwnPropertySymbols) {
  13717. ReflectOwnKeys = function ReflectOwnKeys(target) {
  13718. return Object.getOwnPropertyNames(target)
  13719. .concat(Object.getOwnPropertySymbols(target));
  13720. };
  13721. } else {
  13722. ReflectOwnKeys = function ReflectOwnKeys(target) {
  13723. return Object.getOwnPropertyNames(target);
  13724. };
  13725. }
  13726. function ProcessEmitWarning(warning) {
  13727. if (console && console.warn) console.warn(warning);
  13728. }
  13729. var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
  13730. return value !== value;
  13731. }
  13732. function EventEmitter() {
  13733. EventEmitter.init.call(this);
  13734. }
  13735. module.exports = EventEmitter;
  13736. // Backwards-compat with node 0.10.x
  13737. EventEmitter.EventEmitter = EventEmitter;
  13738. EventEmitter.prototype._events = undefined;
  13739. EventEmitter.prototype._eventsCount = 0;
  13740. EventEmitter.prototype._maxListeners = undefined;
  13741. // By default EventEmitters will print a warning if more than 10 listeners are
  13742. // added to it. This is a useful default which helps finding memory leaks.
  13743. var defaultMaxListeners = 10;
  13744. function checkListener(listener) {
  13745. if (typeof listener !== 'function') {
  13746. throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
  13747. }
  13748. }
  13749. Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
  13750. enumerable: true,
  13751. get: function() {
  13752. return defaultMaxListeners;
  13753. },
  13754. set: function(arg) {
  13755. if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
  13756. throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
  13757. }
  13758. defaultMaxListeners = arg;
  13759. }
  13760. });
  13761. EventEmitter.init = function() {
  13762. if (this._events === undefined ||
  13763. this._events === Object.getPrototypeOf(this)._events) {
  13764. this._events = Object.create(null);
  13765. this._eventsCount = 0;
  13766. }
  13767. this._maxListeners = this._maxListeners || undefined;
  13768. };
  13769. // Obviously not all Emitters should be limited to 10. This function allows
  13770. // that to be increased. Set to zero for unlimited.
  13771. EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
  13772. if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
  13773. throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
  13774. }
  13775. this._maxListeners = n;
  13776. return this;
  13777. };
  13778. function _getMaxListeners(that) {
  13779. if (that._maxListeners === undefined)
  13780. return EventEmitter.defaultMaxListeners;
  13781. return that._maxListeners;
  13782. }
  13783. EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
  13784. return _getMaxListeners(this);
  13785. };
  13786. EventEmitter.prototype.emit = function emit(type) {
  13787. var args = [];
  13788. for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
  13789. var doError = (type === 'error');
  13790. var events = this._events;
  13791. if (events !== undefined)
  13792. doError = (doError && events.error === undefined);
  13793. else if (!doError)
  13794. return false;
  13795. // If there is no 'error' event listener then throw.
  13796. if (doError) {
  13797. var er;
  13798. if (args.length > 0)
  13799. er = args[0];
  13800. if (er instanceof Error) {
  13801. // Note: The comments on the `throw` lines are intentional, they show
  13802. // up in Node's output if this results in an unhandled exception.
  13803. throw er; // Unhandled 'error' event
  13804. }
  13805. // At least give some kind of context to the user
  13806. var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
  13807. err.context = er;
  13808. throw err; // Unhandled 'error' event
  13809. }
  13810. var handler = events[type];
  13811. if (handler === undefined)
  13812. return false;
  13813. if (typeof handler === 'function') {
  13814. ReflectApply(handler, this, args);
  13815. } else {
  13816. var len = handler.length;
  13817. var listeners = arrayClone(handler, len);
  13818. for (var i = 0; i < len; ++i)
  13819. ReflectApply(listeners[i], this, args);
  13820. }
  13821. return true;
  13822. };
  13823. function _addListener(target, type, listener, prepend) {
  13824. var m;
  13825. var events;
  13826. var existing;
  13827. checkListener(listener);
  13828. events = target._events;
  13829. if (events === undefined) {
  13830. events = target._events = Object.create(null);
  13831. target._eventsCount = 0;
  13832. } else {
  13833. // To avoid recursion in the case that type === "newListener"! Before
  13834. // adding it to the listeners, first emit "newListener".
  13835. if (events.newListener !== undefined) {
  13836. target.emit('newListener', type,
  13837. listener.listener ? listener.listener : listener);
  13838. // Re-assign `events` because a newListener handler could have caused the
  13839. // this._events to be assigned to a new object
  13840. events = target._events;
  13841. }
  13842. existing = events[type];
  13843. }
  13844. if (existing === undefined) {
  13845. // Optimize the case of one listener. Don't need the extra array object.
  13846. existing = events[type] = listener;
  13847. ++target._eventsCount;
  13848. } else {
  13849. if (typeof existing === 'function') {
  13850. // Adding the second element, need to change to array.
  13851. existing = events[type] =
  13852. prepend ? [listener, existing] : [existing, listener];
  13853. // If we've already got an array, just append.
  13854. } else if (prepend) {
  13855. existing.unshift(listener);
  13856. } else {
  13857. existing.push(listener);
  13858. }
  13859. // Check for listener leak
  13860. m = _getMaxListeners(target);
  13861. if (m > 0 && existing.length > m && !existing.warned) {
  13862. existing.warned = true;
  13863. // No error code for this since it is a Warning
  13864. // eslint-disable-next-line no-restricted-syntax
  13865. var w = new Error('Possible EventEmitter memory leak detected. ' +
  13866. existing.length + ' ' + String(type) + ' listeners ' +
  13867. 'added. Use emitter.setMaxListeners() to ' +
  13868. 'increase limit');
  13869. w.name = 'MaxListenersExceededWarning';
  13870. w.emitter = target;
  13871. w.type = type;
  13872. w.count = existing.length;
  13873. ProcessEmitWarning(w);
  13874. }
  13875. }
  13876. return target;
  13877. }
  13878. EventEmitter.prototype.addListener = function addListener(type, listener) {
  13879. return _addListener(this, type, listener, false);
  13880. };
  13881. EventEmitter.prototype.on = EventEmitter.prototype.addListener;
  13882. EventEmitter.prototype.prependListener =
  13883. function prependListener(type, listener) {
  13884. return _addListener(this, type, listener, true);
  13885. };
  13886. function onceWrapper() {
  13887. if (!this.fired) {
  13888. this.target.removeListener(this.type, this.wrapFn);
  13889. this.fired = true;
  13890. if (arguments.length === 0)
  13891. return this.listener.call(this.target);
  13892. return this.listener.apply(this.target, arguments);
  13893. }
  13894. }
  13895. function _onceWrap(target, type, listener) {
  13896. var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
  13897. var wrapped = onceWrapper.bind(state);
  13898. wrapped.listener = listener;
  13899. state.wrapFn = wrapped;
  13900. return wrapped;
  13901. }
  13902. EventEmitter.prototype.once = function once(type, listener) {
  13903. checkListener(listener);
  13904. this.on(type, _onceWrap(this, type, listener));
  13905. return this;
  13906. };
  13907. EventEmitter.prototype.prependOnceListener =
  13908. function prependOnceListener(type, listener) {
  13909. checkListener(listener);
  13910. this.prependListener(type, _onceWrap(this, type, listener));
  13911. return this;
  13912. };
  13913. // Emits a 'removeListener' event if and only if the listener was removed.
  13914. EventEmitter.prototype.removeListener =
  13915. function removeListener(type, listener) {
  13916. var list, events, position, i, originalListener;
  13917. checkListener(listener);
  13918. events = this._events;
  13919. if (events === undefined)
  13920. return this;
  13921. list = events[type];
  13922. if (list === undefined)
  13923. return this;
  13924. if (list === listener || list.listener === listener) {
  13925. if (--this._eventsCount === 0)
  13926. this._events = Object.create(null);
  13927. else {
  13928. delete events[type];
  13929. if (events.removeListener)
  13930. this.emit('removeListener', type, list.listener || listener);
  13931. }
  13932. } else if (typeof list !== 'function') {
  13933. position = -1;
  13934. for (i = list.length - 1; i >= 0; i--) {
  13935. if (list[i] === listener || list[i].listener === listener) {
  13936. originalListener = list[i].listener;
  13937. position = i;
  13938. break;
  13939. }
  13940. }
  13941. if (position < 0)
  13942. return this;
  13943. if (position === 0)
  13944. list.shift();
  13945. else {
  13946. spliceOne(list, position);
  13947. }
  13948. if (list.length === 1)
  13949. events[type] = list[0];
  13950. if (events.removeListener !== undefined)
  13951. this.emit('removeListener', type, originalListener || listener);
  13952. }
  13953. return this;
  13954. };
  13955. EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
  13956. EventEmitter.prototype.removeAllListeners =
  13957. function removeAllListeners(type) {
  13958. var listeners, events, i;
  13959. events = this._events;
  13960. if (events === undefined)
  13961. return this;
  13962. // not listening for removeListener, no need to emit
  13963. if (events.removeListener === undefined) {
  13964. if (arguments.length === 0) {
  13965. this._events = Object.create(null);
  13966. this._eventsCount = 0;
  13967. } else if (events[type] !== undefined) {
  13968. if (--this._eventsCount === 0)
  13969. this._events = Object.create(null);
  13970. else
  13971. delete events[type];
  13972. }
  13973. return this;
  13974. }
  13975. // emit removeListener for all listeners on all events
  13976. if (arguments.length === 0) {
  13977. var keys = Object.keys(events);
  13978. var key;
  13979. for (i = 0; i < keys.length; ++i) {
  13980. key = keys[i];
  13981. if (key === 'removeListener') continue;
  13982. this.removeAllListeners(key);
  13983. }
  13984. this.removeAllListeners('removeListener');
  13985. this._events = Object.create(null);
  13986. this._eventsCount = 0;
  13987. return this;
  13988. }
  13989. listeners = events[type];
  13990. if (typeof listeners === 'function') {
  13991. this.removeListener(type, listeners);
  13992. } else if (listeners !== undefined) {
  13993. // LIFO order
  13994. for (i = listeners.length - 1; i >= 0; i--) {
  13995. this.removeListener(type, listeners[i]);
  13996. }
  13997. }
  13998. return this;
  13999. };
  14000. function _listeners(target, type, unwrap) {
  14001. var events = target._events;
  14002. if (events === undefined)
  14003. return [];
  14004. var evlistener = events[type];
  14005. if (evlistener === undefined)
  14006. return [];
  14007. if (typeof evlistener === 'function')
  14008. return unwrap ? [evlistener.listener || evlistener] : [evlistener];
  14009. return unwrap ?
  14010. unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
  14011. }
  14012. EventEmitter.prototype.listeners = function listeners(type) {
  14013. return _listeners(this, type, true);
  14014. };
  14015. EventEmitter.prototype.rawListeners = function rawListeners(type) {
  14016. return _listeners(this, type, false);
  14017. };
  14018. EventEmitter.listenerCount = function(emitter, type) {
  14019. if (typeof emitter.listenerCount === 'function') {
  14020. return emitter.listenerCount(type);
  14021. } else {
  14022. return listenerCount.call(emitter, type);
  14023. }
  14024. };
  14025. EventEmitter.prototype.listenerCount = listenerCount;
  14026. function listenerCount(type) {
  14027. var events = this._events;
  14028. if (events !== undefined) {
  14029. var evlistener = events[type];
  14030. if (typeof evlistener === 'function') {
  14031. return 1;
  14032. } else if (evlistener !== undefined) {
  14033. return evlistener.length;
  14034. }
  14035. }
  14036. return 0;
  14037. }
  14038. EventEmitter.prototype.eventNames = function eventNames() {
  14039. return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
  14040. };
  14041. function arrayClone(arr, n) {
  14042. var copy = new Array(n);
  14043. for (var i = 0; i < n; ++i)
  14044. copy[i] = arr[i];
  14045. return copy;
  14046. }
  14047. function spliceOne(list, index) {
  14048. for (; index + 1 < list.length; index++)
  14049. list[index] = list[index + 1];
  14050. list.pop();
  14051. }
  14052. function unwrapListeners(arr) {
  14053. var ret = new Array(arr.length);
  14054. for (var i = 0; i < ret.length; ++i) {
  14055. ret[i] = arr[i].listener || arr[i];
  14056. }
  14057. return ret;
  14058. }
  14059. /***/ }),
  14060. /* 94 */
  14061. /*!*****************************************************************************!*\
  14062. !*** ./node_modules/readable-stream/lib/internal/streams/stream-browser.js ***!
  14063. \*****************************************************************************/
  14064. /*! no static exports found */
  14065. /***/ (function(module, exports, __webpack_require__) {
  14066. module.exports = __webpack_require__(/*! events */ 93).EventEmitter;
  14067. /***/ }),
  14068. /* 95 */
  14069. /*!***********************************************!*\
  14070. !*** ./node_modules/core-util-is/lib/util.js ***!
  14071. \***********************************************/
  14072. /*! no static exports found */
  14073. /***/ (function(module, exports, __webpack_require__) {
  14074. /* WEBPACK VAR INJECTION */(function(Buffer) {// Copyright Joyent, Inc. and other Node contributors.
  14075. //
  14076. // Permission is hereby granted, free of charge, to any person obtaining a
  14077. // copy of this software and associated documentation files (the
  14078. // "Software"), to deal in the Software without restriction, including
  14079. // without limitation the rights to use, copy, modify, merge, publish,
  14080. // distribute, sublicense, and/or sell copies of the Software, and to permit
  14081. // persons to whom the Software is furnished to do so, subject to the
  14082. // following conditions:
  14083. //
  14084. // The above copyright notice and this permission notice shall be included
  14085. // in all copies or substantial portions of the Software.
  14086. //
  14087. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  14088. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  14089. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  14090. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  14091. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  14092. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  14093. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  14094. // NOTE: These type checking functions intentionally don't use `instanceof`
  14095. // because it is fragile and can be easily faked with `Object.create()`.
  14096. function isArray(arg) {
  14097. if (Array.isArray) {
  14098. return Array.isArray(arg);
  14099. }
  14100. return objectToString(arg) === '[object Array]';
  14101. }
  14102. exports.isArray = isArray;
  14103. function isBoolean(arg) {
  14104. return typeof arg === 'boolean';
  14105. }
  14106. exports.isBoolean = isBoolean;
  14107. function isNull(arg) {
  14108. return arg === null;
  14109. }
  14110. exports.isNull = isNull;
  14111. function isNullOrUndefined(arg) {
  14112. return arg == null;
  14113. }
  14114. exports.isNullOrUndefined = isNullOrUndefined;
  14115. function isNumber(arg) {
  14116. return typeof arg === 'number';
  14117. }
  14118. exports.isNumber = isNumber;
  14119. function isString(arg) {
  14120. return typeof arg === 'string';
  14121. }
  14122. exports.isString = isString;
  14123. function isSymbol(arg) {
  14124. return typeof arg === 'symbol';
  14125. }
  14126. exports.isSymbol = isSymbol;
  14127. function isUndefined(arg) {
  14128. return arg === void 0;
  14129. }
  14130. exports.isUndefined = isUndefined;
  14131. function isRegExp(re) {
  14132. return objectToString(re) === '[object RegExp]';
  14133. }
  14134. exports.isRegExp = isRegExp;
  14135. function isObject(arg) {
  14136. return typeof arg === 'object' && arg !== null;
  14137. }
  14138. exports.isObject = isObject;
  14139. function isDate(d) {
  14140. return objectToString(d) === '[object Date]';
  14141. }
  14142. exports.isDate = isDate;
  14143. function isError(e) {
  14144. return (objectToString(e) === '[object Error]' || e instanceof Error);
  14145. }
  14146. exports.isError = isError;
  14147. function isFunction(arg) {
  14148. return typeof arg === 'function';
  14149. }
  14150. exports.isFunction = isFunction;
  14151. function isPrimitive(arg) {
  14152. return arg === null ||
  14153. typeof arg === 'boolean' ||
  14154. typeof arg === 'number' ||
  14155. typeof arg === 'string' ||
  14156. typeof arg === 'symbol' || // ES6 symbol
  14157. typeof arg === 'undefined';
  14158. }
  14159. exports.isPrimitive = isPrimitive;
  14160. exports.isBuffer = Buffer.isBuffer;
  14161. function objectToString(o) {
  14162. return Object.prototype.toString.call(o);
  14163. }
  14164. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../buffer/index.js */ 82).Buffer))
  14165. /***/ }),
  14166. /* 96 */
  14167. /*!**********************!*\
  14168. !*** util (ignored) ***!
  14169. \**********************/
  14170. /*! no static exports found */
  14171. /***/ (function(module, exports) {
  14172. /* (ignored) */
  14173. /***/ }),
  14174. /* 97 */
  14175. /*!*************************************************************************!*\
  14176. !*** ./node_modules/readable-stream/lib/internal/streams/BufferList.js ***!
  14177. \*************************************************************************/
  14178. /*! no static exports found */
  14179. /***/ (function(module, exports, __webpack_require__) {
  14180. "use strict";
  14181. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14182. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer;
  14183. var util = __webpack_require__(/*! util */ 98);
  14184. function copyBuffer(src, target, offset) {
  14185. src.copy(target, offset);
  14186. }
  14187. module.exports = function () {
  14188. function BufferList() {
  14189. _classCallCheck(this, BufferList);
  14190. this.head = null;
  14191. this.tail = null;
  14192. this.length = 0;
  14193. }
  14194. BufferList.prototype.push = function push(v) {
  14195. var entry = { data: v, next: null };
  14196. if (this.length > 0) this.tail.next = entry;else this.head = entry;
  14197. this.tail = entry;
  14198. ++this.length;
  14199. };
  14200. BufferList.prototype.unshift = function unshift(v) {
  14201. var entry = { data: v, next: this.head };
  14202. if (this.length === 0) this.tail = entry;
  14203. this.head = entry;
  14204. ++this.length;
  14205. };
  14206. BufferList.prototype.shift = function shift() {
  14207. if (this.length === 0) return;
  14208. var ret = this.head.data;
  14209. if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
  14210. --this.length;
  14211. return ret;
  14212. };
  14213. BufferList.prototype.clear = function clear() {
  14214. this.head = this.tail = null;
  14215. this.length = 0;
  14216. };
  14217. BufferList.prototype.join = function join(s) {
  14218. if (this.length === 0) return '';
  14219. var p = this.head;
  14220. var ret = '' + p.data;
  14221. while (p = p.next) {
  14222. ret += s + p.data;
  14223. }return ret;
  14224. };
  14225. BufferList.prototype.concat = function concat(n) {
  14226. if (this.length === 0) return Buffer.alloc(0);
  14227. if (this.length === 1) return this.head.data;
  14228. var ret = Buffer.allocUnsafe(n >>> 0);
  14229. var p = this.head;
  14230. var i = 0;
  14231. while (p) {
  14232. copyBuffer(p.data, ret, i);
  14233. i += p.data.length;
  14234. p = p.next;
  14235. }
  14236. return ret;
  14237. };
  14238. return BufferList;
  14239. }();
  14240. if (util && util.inspect && util.inspect.custom) {
  14241. module.exports.prototype[util.inspect.custom] = function () {
  14242. var obj = util.inspect({ length: this.length });
  14243. return this.constructor.name + ' ' + obj;
  14244. };
  14245. }
  14246. /***/ }),
  14247. /* 98 */
  14248. /*!**********************!*\
  14249. !*** util (ignored) ***!
  14250. \**********************/
  14251. /*! no static exports found */
  14252. /***/ (function(module, exports) {
  14253. /* (ignored) */
  14254. /***/ }),
  14255. /* 99 */
  14256. /*!**********************************************************************!*\
  14257. !*** ./node_modules/readable-stream/lib/internal/streams/destroy.js ***!
  14258. \**********************************************************************/
  14259. /*! no static exports found */
  14260. /***/ (function(module, exports, __webpack_require__) {
  14261. "use strict";
  14262. /*<replacement>*/
  14263. var pna = __webpack_require__(/*! process-nextick-args */ 92);
  14264. /*</replacement>*/
  14265. // undocumented cb() API, needed for core, not for public API
  14266. function destroy(err, cb) {
  14267. var _this = this;
  14268. var readableDestroyed = this._readableState && this._readableState.destroyed;
  14269. var writableDestroyed = this._writableState && this._writableState.destroyed;
  14270. if (readableDestroyed || writableDestroyed) {
  14271. if (cb) {
  14272. cb(err);
  14273. } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {
  14274. pna.nextTick(emitErrorNT, this, err);
  14275. }
  14276. return this;
  14277. }
  14278. // we set destroyed to true before firing error callbacks in order
  14279. // to make it re-entrance safe in case destroy() is called within callbacks
  14280. if (this._readableState) {
  14281. this._readableState.destroyed = true;
  14282. }
  14283. // if this is a duplex stream mark the writable part as destroyed as well
  14284. if (this._writableState) {
  14285. this._writableState.destroyed = true;
  14286. }
  14287. this._destroy(err || null, function (err) {
  14288. if (!cb && err) {
  14289. pna.nextTick(emitErrorNT, _this, err);
  14290. if (_this._writableState) {
  14291. _this._writableState.errorEmitted = true;
  14292. }
  14293. } else if (cb) {
  14294. cb(err);
  14295. }
  14296. });
  14297. return this;
  14298. }
  14299. function undestroy() {
  14300. if (this._readableState) {
  14301. this._readableState.destroyed = false;
  14302. this._readableState.reading = false;
  14303. this._readableState.ended = false;
  14304. this._readableState.endEmitted = false;
  14305. }
  14306. if (this._writableState) {
  14307. this._writableState.destroyed = false;
  14308. this._writableState.ended = false;
  14309. this._writableState.ending = false;
  14310. this._writableState.finished = false;
  14311. this._writableState.errorEmitted = false;
  14312. }
  14313. }
  14314. function emitErrorNT(self, err) {
  14315. self.emit('error', err);
  14316. }
  14317. module.exports = {
  14318. destroy: destroy,
  14319. undestroy: undestroy
  14320. };
  14321. /***/ }),
  14322. /* 100 */
  14323. /*!************************************************************!*\
  14324. !*** ./node_modules/readable-stream/lib/_stream_duplex.js ***!
  14325. \************************************************************/
  14326. /*! no static exports found */
  14327. /***/ (function(module, exports, __webpack_require__) {
  14328. "use strict";
  14329. // Copyright Joyent, Inc. and other Node contributors.
  14330. //
  14331. // Permission is hereby granted, free of charge, to any person obtaining a
  14332. // copy of this software and associated documentation files (the
  14333. // "Software"), to deal in the Software without restriction, including
  14334. // without limitation the rights to use, copy, modify, merge, publish,
  14335. // distribute, sublicense, and/or sell copies of the Software, and to permit
  14336. // persons to whom the Software is furnished to do so, subject to the
  14337. // following conditions:
  14338. //
  14339. // The above copyright notice and this permission notice shall be included
  14340. // in all copies or substantial portions of the Software.
  14341. //
  14342. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  14343. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  14344. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  14345. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  14346. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  14347. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  14348. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  14349. // a duplex stream is just a stream that is both readable and writable.
  14350. // Since JS doesn't have multiple prototypal inheritance, this class
  14351. // prototypally inherits from Readable, and then parasitically from
  14352. // Writable.
  14353. /*<replacement>*/
  14354. var pna = __webpack_require__(/*! process-nextick-args */ 92);
  14355. /*</replacement>*/
  14356. /*<replacement>*/
  14357. var objectKeys = Object.keys || function (obj) {
  14358. var keys = [];
  14359. for (var key in obj) {
  14360. keys.push(key);
  14361. }return keys;
  14362. };
  14363. /*</replacement>*/
  14364. module.exports = Duplex;
  14365. /*<replacement>*/
  14366. var util = Object.create(__webpack_require__(/*! core-util-is */ 95));
  14367. util.inherits = __webpack_require__(/*! inherits */ 87);
  14368. /*</replacement>*/
  14369. var Readable = __webpack_require__(/*! ./_stream_readable */ 91);
  14370. var Writable = __webpack_require__(/*! ./_stream_writable */ 101);
  14371. util.inherits(Duplex, Readable);
  14372. {
  14373. // avoid scope creep, the keys array can then be collected
  14374. var keys = objectKeys(Writable.prototype);
  14375. for (var v = 0; v < keys.length; v++) {
  14376. var method = keys[v];
  14377. if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
  14378. }
  14379. }
  14380. function Duplex(options) {
  14381. if (!(this instanceof Duplex)) return new Duplex(options);
  14382. Readable.call(this, options);
  14383. Writable.call(this, options);
  14384. if (options && options.readable === false) this.readable = false;
  14385. if (options && options.writable === false) this.writable = false;
  14386. this.allowHalfOpen = true;
  14387. if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
  14388. this.once('end', onend);
  14389. }
  14390. Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
  14391. // making it explicit this property is not enumerable
  14392. // because otherwise some prototype manipulation in
  14393. // userland will fail
  14394. enumerable: false,
  14395. get: function () {
  14396. return this._writableState.highWaterMark;
  14397. }
  14398. });
  14399. // the no-half-open enforcer
  14400. function onend() {
  14401. // if we allow half-open state, or if the writable side ended,
  14402. // then we're ok.
  14403. if (this.allowHalfOpen || this._writableState.ended) return;
  14404. // no more data can be written.
  14405. // But allow more writes to happen in this tick.
  14406. pna.nextTick(onEndNT, this);
  14407. }
  14408. function onEndNT(self) {
  14409. self.end();
  14410. }
  14411. Object.defineProperty(Duplex.prototype, 'destroyed', {
  14412. get: function () {
  14413. if (this._readableState === undefined || this._writableState === undefined) {
  14414. return false;
  14415. }
  14416. return this._readableState.destroyed && this._writableState.destroyed;
  14417. },
  14418. set: function (value) {
  14419. // we ignore the value if the stream
  14420. // has not been initialized yet
  14421. if (this._readableState === undefined || this._writableState === undefined) {
  14422. return;
  14423. }
  14424. // backward compatibility, the user is explicitly
  14425. // managing destroyed
  14426. this._readableState.destroyed = value;
  14427. this._writableState.destroyed = value;
  14428. }
  14429. });
  14430. Duplex.prototype._destroy = function (err, cb) {
  14431. this.push(null);
  14432. this.end();
  14433. pna.nextTick(cb, err);
  14434. };
  14435. /***/ }),
  14436. /* 101 */
  14437. /*!**************************************************************!*\
  14438. !*** ./node_modules/readable-stream/lib/_stream_writable.js ***!
  14439. \**************************************************************/
  14440. /*! no static exports found */
  14441. /***/ (function(module, exports, __webpack_require__) {
  14442. "use strict";
  14443. /* WEBPACK VAR INJECTION */(function(process, global) {// Copyright Joyent, Inc. and other Node contributors.
  14444. //
  14445. // Permission is hereby granted, free of charge, to any person obtaining a
  14446. // copy of this software and associated documentation files (the
  14447. // "Software"), to deal in the Software without restriction, including
  14448. // without limitation the rights to use, copy, modify, merge, publish,
  14449. // distribute, sublicense, and/or sell copies of the Software, and to permit
  14450. // persons to whom the Software is furnished to do so, subject to the
  14451. // following conditions:
  14452. //
  14453. // The above copyright notice and this permission notice shall be included
  14454. // in all copies or substantial portions of the Software.
  14455. //
  14456. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  14457. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  14458. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  14459. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  14460. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  14461. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  14462. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  14463. // A bit simpler than readable streams.
  14464. // Implement an async ._write(chunk, encoding, cb), and it'll handle all
  14465. // the drain event emission and buffering.
  14466. /*<replacement>*/
  14467. var pna = __webpack_require__(/*! process-nextick-args */ 92);
  14468. /*</replacement>*/
  14469. module.exports = Writable;
  14470. /* <replacement> */
  14471. function WriteReq(chunk, encoding, cb) {
  14472. this.chunk = chunk;
  14473. this.encoding = encoding;
  14474. this.callback = cb;
  14475. this.next = null;
  14476. }
  14477. // It seems a linked list but it is not
  14478. // there will be only 2 of these for each stream
  14479. function CorkedRequest(state) {
  14480. var _this = this;
  14481. this.next = null;
  14482. this.entry = null;
  14483. this.finish = function () {
  14484. onCorkedFinish(_this, state);
  14485. };
  14486. }
  14487. /* </replacement> */
  14488. /*<replacement>*/
  14489. var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
  14490. /*</replacement>*/
  14491. /*<replacement>*/
  14492. var Duplex;
  14493. /*</replacement>*/
  14494. Writable.WritableState = WritableState;
  14495. /*<replacement>*/
  14496. var util = Object.create(__webpack_require__(/*! core-util-is */ 95));
  14497. util.inherits = __webpack_require__(/*! inherits */ 87);
  14498. /*</replacement>*/
  14499. /*<replacement>*/
  14500. var internalUtil = {
  14501. deprecate: __webpack_require__(/*! util-deprecate */ 102)
  14502. };
  14503. /*</replacement>*/
  14504. /*<replacement>*/
  14505. var Stream = __webpack_require__(/*! ./internal/streams/stream */ 94);
  14506. /*</replacement>*/
  14507. /*<replacement>*/
  14508. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer;
  14509. var OurUint8Array = global.Uint8Array || function () {};
  14510. function _uint8ArrayToBuffer(chunk) {
  14511. return Buffer.from(chunk);
  14512. }
  14513. function _isUint8Array(obj) {
  14514. return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
  14515. }
  14516. /*</replacement>*/
  14517. var destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ 99);
  14518. util.inherits(Writable, Stream);
  14519. function nop() {}
  14520. function WritableState(options, stream) {
  14521. Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ 100);
  14522. options = options || {};
  14523. // Duplex streams are both readable and writable, but share
  14524. // the same options object.
  14525. // However, some cases require setting options to different
  14526. // values for the readable and the writable sides of the duplex stream.
  14527. // These options can be provided separately as readableXXX and writableXXX.
  14528. var isDuplex = stream instanceof Duplex;
  14529. // object stream flag to indicate whether or not this stream
  14530. // contains buffers or objects.
  14531. this.objectMode = !!options.objectMode;
  14532. if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
  14533. // the point at which write() starts returning false
  14534. // Note: 0 is a valid value, means that we always return false if
  14535. // the entire buffer is not flushed immediately on write()
  14536. var hwm = options.highWaterMark;
  14537. var writableHwm = options.writableHighWaterMark;
  14538. var defaultHwm = this.objectMode ? 16 : 16 * 1024;
  14539. if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;
  14540. // cast to ints.
  14541. this.highWaterMark = Math.floor(this.highWaterMark);
  14542. // if _final has been called
  14543. this.finalCalled = false;
  14544. // drain event flag.
  14545. this.needDrain = false;
  14546. // at the start of calling end()
  14547. this.ending = false;
  14548. // when end() has been called, and returned
  14549. this.ended = false;
  14550. // when 'finish' is emitted
  14551. this.finished = false;
  14552. // has it been destroyed
  14553. this.destroyed = false;
  14554. // should we decode strings into buffers before passing to _write?
  14555. // this is here so that some node-core streams can optimize string
  14556. // handling at a lower level.
  14557. var noDecode = options.decodeStrings === false;
  14558. this.decodeStrings = !noDecode;
  14559. // Crypto is kind of old and crusty. Historically, its default string
  14560. // encoding is 'binary' so we have to make this configurable.
  14561. // Everything else in the universe uses 'utf8', though.
  14562. this.defaultEncoding = options.defaultEncoding || 'utf8';
  14563. // not an actual buffer we keep track of, but a measurement
  14564. // of how much we're waiting to get pushed to some underlying
  14565. // socket or file.
  14566. this.length = 0;
  14567. // a flag to see when we're in the middle of a write.
  14568. this.writing = false;
  14569. // when true all writes will be buffered until .uncork() call
  14570. this.corked = 0;
  14571. // a flag to be able to tell if the onwrite cb is called immediately,
  14572. // or on a later tick. We set this to true at first, because any
  14573. // actions that shouldn't happen until "later" should generally also
  14574. // not happen before the first write call.
  14575. this.sync = true;
  14576. // a flag to know if we're processing previously buffered items, which
  14577. // may call the _write() callback in the same tick, so that we don't
  14578. // end up in an overlapped onwrite situation.
  14579. this.bufferProcessing = false;
  14580. // the callback that's passed to _write(chunk,cb)
  14581. this.onwrite = function (er) {
  14582. onwrite(stream, er);
  14583. };
  14584. // the callback that the user supplies to write(chunk,encoding,cb)
  14585. this.writecb = null;
  14586. // the amount that is being written when _write is called.
  14587. this.writelen = 0;
  14588. this.bufferedRequest = null;
  14589. this.lastBufferedRequest = null;
  14590. // number of pending user-supplied write callbacks
  14591. // this must be 0 before 'finish' can be emitted
  14592. this.pendingcb = 0;
  14593. // emit prefinish if the only thing we're waiting for is _write cbs
  14594. // This is relevant for synchronous Transform streams
  14595. this.prefinished = false;
  14596. // True if the error was already emitted and should not be thrown again
  14597. this.errorEmitted = false;
  14598. // count buffered requests
  14599. this.bufferedRequestCount = 0;
  14600. // allocate the first CorkedRequest, there is always
  14601. // one allocated and free to use, and we maintain at most two
  14602. this.corkedRequestsFree = new CorkedRequest(this);
  14603. }
  14604. WritableState.prototype.getBuffer = function getBuffer() {
  14605. var current = this.bufferedRequest;
  14606. var out = [];
  14607. while (current) {
  14608. out.push(current);
  14609. current = current.next;
  14610. }
  14611. return out;
  14612. };
  14613. (function () {
  14614. try {
  14615. Object.defineProperty(WritableState.prototype, 'buffer', {
  14616. get: internalUtil.deprecate(function () {
  14617. return this.getBuffer();
  14618. }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
  14619. });
  14620. } catch (_) {}
  14621. })();
  14622. // Test _writableState for inheritance to account for Duplex streams,
  14623. // whose prototype chain only points to Readable.
  14624. var realHasInstance;
  14625. if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
  14626. realHasInstance = Function.prototype[Symbol.hasInstance];
  14627. Object.defineProperty(Writable, Symbol.hasInstance, {
  14628. value: function (object) {
  14629. if (realHasInstance.call(this, object)) return true;
  14630. if (this !== Writable) return false;
  14631. return object && object._writableState instanceof WritableState;
  14632. }
  14633. });
  14634. } else {
  14635. realHasInstance = function (object) {
  14636. return object instanceof this;
  14637. };
  14638. }
  14639. function Writable(options) {
  14640. Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ 100);
  14641. // Writable ctor is applied to Duplexes, too.
  14642. // `realHasInstance` is necessary because using plain `instanceof`
  14643. // would return false, as no `_writableState` property is attached.
  14644. // Trying to use the custom `instanceof` for Writable here will also break the
  14645. // Node.js LazyTransform implementation, which has a non-trivial getter for
  14646. // `_writableState` that would lead to infinite recursion.
  14647. if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
  14648. return new Writable(options);
  14649. }
  14650. this._writableState = new WritableState(options, this);
  14651. // legacy.
  14652. this.writable = true;
  14653. if (options) {
  14654. if (typeof options.write === 'function') this._write = options.write;
  14655. if (typeof options.writev === 'function') this._writev = options.writev;
  14656. if (typeof options.destroy === 'function') this._destroy = options.destroy;
  14657. if (typeof options.final === 'function') this._final = options.final;
  14658. }
  14659. Stream.call(this);
  14660. }
  14661. // Otherwise people can pipe Writable streams, which is just wrong.
  14662. Writable.prototype.pipe = function () {
  14663. this.emit('error', new Error('Cannot pipe, not readable'));
  14664. };
  14665. function writeAfterEnd(stream, cb) {
  14666. var er = new Error('write after end');
  14667. // TODO: defer error events consistently everywhere, not just the cb
  14668. stream.emit('error', er);
  14669. pna.nextTick(cb, er);
  14670. }
  14671. // Checks that a user-supplied chunk is valid, especially for the particular
  14672. // mode the stream is in. Currently this means that `null` is never accepted
  14673. // and undefined/non-string values are only allowed in object mode.
  14674. function validChunk(stream, state, chunk, cb) {
  14675. var valid = true;
  14676. var er = false;
  14677. if (chunk === null) {
  14678. er = new TypeError('May not write null values to stream');
  14679. } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
  14680. er = new TypeError('Invalid non-string/buffer chunk');
  14681. }
  14682. if (er) {
  14683. stream.emit('error', er);
  14684. pna.nextTick(cb, er);
  14685. valid = false;
  14686. }
  14687. return valid;
  14688. }
  14689. Writable.prototype.write = function (chunk, encoding, cb) {
  14690. var state = this._writableState;
  14691. var ret = false;
  14692. var isBuf = !state.objectMode && _isUint8Array(chunk);
  14693. if (isBuf && !Buffer.isBuffer(chunk)) {
  14694. chunk = _uint8ArrayToBuffer(chunk);
  14695. }
  14696. if (typeof encoding === 'function') {
  14697. cb = encoding;
  14698. encoding = null;
  14699. }
  14700. if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
  14701. if (typeof cb !== 'function') cb = nop;
  14702. if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
  14703. state.pendingcb++;
  14704. ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
  14705. }
  14706. return ret;
  14707. };
  14708. Writable.prototype.cork = function () {
  14709. var state = this._writableState;
  14710. state.corked++;
  14711. };
  14712. Writable.prototype.uncork = function () {
  14713. var state = this._writableState;
  14714. if (state.corked) {
  14715. state.corked--;
  14716. if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
  14717. }
  14718. };
  14719. Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
  14720. // node::ParseEncoding() requires lower case.
  14721. if (typeof encoding === 'string') encoding = encoding.toLowerCase();
  14722. 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);
  14723. this._writableState.defaultEncoding = encoding;
  14724. return this;
  14725. };
  14726. function decodeChunk(state, chunk, encoding) {
  14727. if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
  14728. chunk = Buffer.from(chunk, encoding);
  14729. }
  14730. return chunk;
  14731. }
  14732. Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
  14733. // making it explicit this property is not enumerable
  14734. // because otherwise some prototype manipulation in
  14735. // userland will fail
  14736. enumerable: false,
  14737. get: function () {
  14738. return this._writableState.highWaterMark;
  14739. }
  14740. });
  14741. // if we're already writing something, then just put this
  14742. // in the queue, and wait our turn. Otherwise, call _write
  14743. // If we return false, then we need a drain event, so set that flag.
  14744. function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
  14745. if (!isBuf) {
  14746. var newChunk = decodeChunk(state, chunk, encoding);
  14747. if (chunk !== newChunk) {
  14748. isBuf = true;
  14749. encoding = 'buffer';
  14750. chunk = newChunk;
  14751. }
  14752. }
  14753. var len = state.objectMode ? 1 : chunk.length;
  14754. state.length += len;
  14755. var ret = state.length < state.highWaterMark;
  14756. // we must ensure that previous needDrain will not be reset to false.
  14757. if (!ret) state.needDrain = true;
  14758. if (state.writing || state.corked) {
  14759. var last = state.lastBufferedRequest;
  14760. state.lastBufferedRequest = {
  14761. chunk: chunk,
  14762. encoding: encoding,
  14763. isBuf: isBuf,
  14764. callback: cb,
  14765. next: null
  14766. };
  14767. if (last) {
  14768. last.next = state.lastBufferedRequest;
  14769. } else {
  14770. state.bufferedRequest = state.lastBufferedRequest;
  14771. }
  14772. state.bufferedRequestCount += 1;
  14773. } else {
  14774. doWrite(stream, state, false, len, chunk, encoding, cb);
  14775. }
  14776. return ret;
  14777. }
  14778. function doWrite(stream, state, writev, len, chunk, encoding, cb) {
  14779. state.writelen = len;
  14780. state.writecb = cb;
  14781. state.writing = true;
  14782. state.sync = true;
  14783. if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
  14784. state.sync = false;
  14785. }
  14786. function onwriteError(stream, state, sync, er, cb) {
  14787. --state.pendingcb;
  14788. if (sync) {
  14789. // defer the callback if we are being called synchronously
  14790. // to avoid piling up things on the stack
  14791. pna.nextTick(cb, er);
  14792. // this can emit finish, and it will always happen
  14793. // after error
  14794. pna.nextTick(finishMaybe, stream, state);
  14795. stream._writableState.errorEmitted = true;
  14796. stream.emit('error', er);
  14797. } else {
  14798. // the caller expect this to happen before if
  14799. // it is async
  14800. cb(er);
  14801. stream._writableState.errorEmitted = true;
  14802. stream.emit('error', er);
  14803. // this can emit finish, but finish must
  14804. // always follow error
  14805. finishMaybe(stream, state);
  14806. }
  14807. }
  14808. function onwriteStateUpdate(state) {
  14809. state.writing = false;
  14810. state.writecb = null;
  14811. state.length -= state.writelen;
  14812. state.writelen = 0;
  14813. }
  14814. function onwrite(stream, er) {
  14815. var state = stream._writableState;
  14816. var sync = state.sync;
  14817. var cb = state.writecb;
  14818. onwriteStateUpdate(state);
  14819. if (er) onwriteError(stream, state, sync, er, cb);else {
  14820. // Check if we're actually ready to finish, but don't emit yet
  14821. var finished = needFinish(state);
  14822. if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
  14823. clearBuffer(stream, state);
  14824. }
  14825. if (sync) {
  14826. /*<replacement>*/
  14827. asyncWrite(afterWrite, stream, state, finished, cb);
  14828. /*</replacement>*/
  14829. } else {
  14830. afterWrite(stream, state, finished, cb);
  14831. }
  14832. }
  14833. }
  14834. function afterWrite(stream, state, finished, cb) {
  14835. if (!finished) onwriteDrain(stream, state);
  14836. state.pendingcb--;
  14837. cb();
  14838. finishMaybe(stream, state);
  14839. }
  14840. // Must force callback to be called on nextTick, so that we don't
  14841. // emit 'drain' before the write() consumer gets the 'false' return
  14842. // value, and has a chance to attach a 'drain' listener.
  14843. function onwriteDrain(stream, state) {
  14844. if (state.length === 0 && state.needDrain) {
  14845. state.needDrain = false;
  14846. stream.emit('drain');
  14847. }
  14848. }
  14849. // if there's something in the buffer waiting, then process it
  14850. function clearBuffer(stream, state) {
  14851. state.bufferProcessing = true;
  14852. var entry = state.bufferedRequest;
  14853. if (stream._writev && entry && entry.next) {
  14854. // Fast case, write everything using _writev()
  14855. var l = state.bufferedRequestCount;
  14856. var buffer = new Array(l);
  14857. var holder = state.corkedRequestsFree;
  14858. holder.entry = entry;
  14859. var count = 0;
  14860. var allBuffers = true;
  14861. while (entry) {
  14862. buffer[count] = entry;
  14863. if (!entry.isBuf) allBuffers = false;
  14864. entry = entry.next;
  14865. count += 1;
  14866. }
  14867. buffer.allBuffers = allBuffers;
  14868. doWrite(stream, state, true, state.length, buffer, '', holder.finish);
  14869. // doWrite is almost always async, defer these to save a bit of time
  14870. // as the hot path ends with doWrite
  14871. state.pendingcb++;
  14872. state.lastBufferedRequest = null;
  14873. if (holder.next) {
  14874. state.corkedRequestsFree = holder.next;
  14875. holder.next = null;
  14876. } else {
  14877. state.corkedRequestsFree = new CorkedRequest(state);
  14878. }
  14879. state.bufferedRequestCount = 0;
  14880. } else {
  14881. // Slow case, write chunks one-by-one
  14882. while (entry) {
  14883. var chunk = entry.chunk;
  14884. var encoding = entry.encoding;
  14885. var cb = entry.callback;
  14886. var len = state.objectMode ? 1 : chunk.length;
  14887. doWrite(stream, state, false, len, chunk, encoding, cb);
  14888. entry = entry.next;
  14889. state.bufferedRequestCount--;
  14890. // if we didn't call the onwrite immediately, then
  14891. // it means that we need to wait until it does.
  14892. // also, that means that the chunk and cb are currently
  14893. // being processed, so move the buffer counter past them.
  14894. if (state.writing) {
  14895. break;
  14896. }
  14897. }
  14898. if (entry === null) state.lastBufferedRequest = null;
  14899. }
  14900. state.bufferedRequest = entry;
  14901. state.bufferProcessing = false;
  14902. }
  14903. Writable.prototype._write = function (chunk, encoding, cb) {
  14904. cb(new Error('_write() is not implemented'));
  14905. };
  14906. Writable.prototype._writev = null;
  14907. Writable.prototype.end = function (chunk, encoding, cb) {
  14908. var state = this._writableState;
  14909. if (typeof chunk === 'function') {
  14910. cb = chunk;
  14911. chunk = null;
  14912. encoding = null;
  14913. } else if (typeof encoding === 'function') {
  14914. cb = encoding;
  14915. encoding = null;
  14916. }
  14917. if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
  14918. // .end() fully uncorks
  14919. if (state.corked) {
  14920. state.corked = 1;
  14921. this.uncork();
  14922. }
  14923. // ignore unnecessary end() calls.
  14924. if (!state.ending && !state.finished) endWritable(this, state, cb);
  14925. };
  14926. function needFinish(state) {
  14927. return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
  14928. }
  14929. function callFinal(stream, state) {
  14930. stream._final(function (err) {
  14931. state.pendingcb--;
  14932. if (err) {
  14933. stream.emit('error', err);
  14934. }
  14935. state.prefinished = true;
  14936. stream.emit('prefinish');
  14937. finishMaybe(stream, state);
  14938. });
  14939. }
  14940. function prefinish(stream, state) {
  14941. if (!state.prefinished && !state.finalCalled) {
  14942. if (typeof stream._final === 'function') {
  14943. state.pendingcb++;
  14944. state.finalCalled = true;
  14945. pna.nextTick(callFinal, stream, state);
  14946. } else {
  14947. state.prefinished = true;
  14948. stream.emit('prefinish');
  14949. }
  14950. }
  14951. }
  14952. function finishMaybe(stream, state) {
  14953. var need = needFinish(state);
  14954. if (need) {
  14955. prefinish(stream, state);
  14956. if (state.pendingcb === 0) {
  14957. state.finished = true;
  14958. stream.emit('finish');
  14959. }
  14960. }
  14961. return need;
  14962. }
  14963. function endWritable(stream, state, cb) {
  14964. state.ending = true;
  14965. finishMaybe(stream, state);
  14966. if (cb) {
  14967. if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);
  14968. }
  14969. state.ended = true;
  14970. stream.writable = false;
  14971. }
  14972. function onCorkedFinish(corkReq, state, err) {
  14973. var entry = corkReq.entry;
  14974. corkReq.entry = null;
  14975. while (entry) {
  14976. var cb = entry.callback;
  14977. state.pendingcb--;
  14978. cb(err);
  14979. entry = entry.next;
  14980. }
  14981. if (state.corkedRequestsFree) {
  14982. state.corkedRequestsFree.next = corkReq;
  14983. } else {
  14984. state.corkedRequestsFree = corkReq;
  14985. }
  14986. }
  14987. Object.defineProperty(Writable.prototype, 'destroyed', {
  14988. get: function () {
  14989. if (this._writableState === undefined) {
  14990. return false;
  14991. }
  14992. return this._writableState.destroyed;
  14993. },
  14994. set: function (value) {
  14995. // we ignore the value if the stream
  14996. // has not been initialized yet
  14997. if (!this._writableState) {
  14998. return;
  14999. }
  15000. // backward compatibility, the user is explicitly
  15001. // managing destroyed
  15002. this._writableState.destroyed = value;
  15003. }
  15004. });
  15005. Writable.prototype.destroy = destroyImpl.destroy;
  15006. Writable.prototype._undestroy = destroyImpl.undestroy;
  15007. Writable.prototype._destroy = function (err, cb) {
  15008. this.end();
  15009. cb(err);
  15010. };
  15011. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/mock/process.js */ 79), __webpack_require__(/*! ./../../webpack/buildin/global.js */ 2)))
  15012. /***/ }),
  15013. /* 102 */
  15014. /*!************************************************!*\
  15015. !*** ./node_modules/util-deprecate/browser.js ***!
  15016. \************************************************/
  15017. /*! no static exports found */
  15018. /***/ (function(module, exports, __webpack_require__) {
  15019. /* WEBPACK VAR INJECTION */(function(global) {
  15020. /**
  15021. * Module exports.
  15022. */
  15023. module.exports = deprecate;
  15024. /**
  15025. * Mark that a method should not be used.
  15026. * Returns a modified function which warns once by default.
  15027. *
  15028. * If `localStorage.noDeprecation = true` is set, then it is a no-op.
  15029. *
  15030. * If `localStorage.throwDeprecation = true` is set, then deprecated functions
  15031. * will throw an Error when invoked.
  15032. *
  15033. * If `localStorage.traceDeprecation = true` is set, then deprecated functions
  15034. * will invoke `console.trace()` instead of `console.error()`.
  15035. *
  15036. * @param {Function} fn - the function to deprecate
  15037. * @param {String} msg - the string to print to the console when `fn` is invoked
  15038. * @returns {Function} a new "deprecated" version of `fn`
  15039. * @api public
  15040. */
  15041. function deprecate (fn, msg) {
  15042. if (config('noDeprecation')) {
  15043. return fn;
  15044. }
  15045. var warned = false;
  15046. function deprecated() {
  15047. if (!warned) {
  15048. if (config('throwDeprecation')) {
  15049. throw new Error(msg);
  15050. } else if (config('traceDeprecation')) {
  15051. console.trace(msg);
  15052. } else {
  15053. console.warn(msg);
  15054. }
  15055. warned = true;
  15056. }
  15057. return fn.apply(this, arguments);
  15058. }
  15059. return deprecated;
  15060. }
  15061. /**
  15062. * Checks `localStorage` for boolean values for the given `name`.
  15063. *
  15064. * @param {String} name
  15065. * @returns {Boolean}
  15066. * @api private
  15067. */
  15068. function config (name) {
  15069. // accessing global.localStorage can trigger a DOMException in sandboxed iframes
  15070. try {
  15071. if (!global.localStorage) return false;
  15072. } catch (_) {
  15073. return false;
  15074. }
  15075. var val = global.localStorage[name];
  15076. if (null == val) return false;
  15077. return String(val).toLowerCase() === 'true';
  15078. }
  15079. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ 2)))
  15080. /***/ }),
  15081. /* 103 */
  15082. /*!***********************************************************!*\
  15083. !*** ./node_modules/string_decoder/lib/string_decoder.js ***!
  15084. \***********************************************************/
  15085. /*! no static exports found */
  15086. /***/ (function(module, exports, __webpack_require__) {
  15087. "use strict";
  15088. // Copyright Joyent, Inc. and other Node contributors.
  15089. //
  15090. // Permission is hereby granted, free of charge, to any person obtaining a
  15091. // copy of this software and associated documentation files (the
  15092. // "Software"), to deal in the Software without restriction, including
  15093. // without limitation the rights to use, copy, modify, merge, publish,
  15094. // distribute, sublicense, and/or sell copies of the Software, and to permit
  15095. // persons to whom the Software is furnished to do so, subject to the
  15096. // following conditions:
  15097. //
  15098. // The above copyright notice and this permission notice shall be included
  15099. // in all copies or substantial portions of the Software.
  15100. //
  15101. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  15102. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  15103. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  15104. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  15105. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  15106. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  15107. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  15108. /*<replacement>*/
  15109. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer;
  15110. /*</replacement>*/
  15111. var isEncoding = Buffer.isEncoding || function (encoding) {
  15112. encoding = '' + encoding;
  15113. switch (encoding && encoding.toLowerCase()) {
  15114. 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':
  15115. return true;
  15116. default:
  15117. return false;
  15118. }
  15119. };
  15120. function _normalizeEncoding(enc) {
  15121. if (!enc) return 'utf8';
  15122. var retried;
  15123. while (true) {
  15124. switch (enc) {
  15125. case 'utf8':
  15126. case 'utf-8':
  15127. return 'utf8';
  15128. case 'ucs2':
  15129. case 'ucs-2':
  15130. case 'utf16le':
  15131. case 'utf-16le':
  15132. return 'utf16le';
  15133. case 'latin1':
  15134. case 'binary':
  15135. return 'latin1';
  15136. case 'base64':
  15137. case 'ascii':
  15138. case 'hex':
  15139. return enc;
  15140. default:
  15141. if (retried) return; // undefined
  15142. enc = ('' + enc).toLowerCase();
  15143. retried = true;
  15144. }
  15145. }
  15146. };
  15147. // Do not cache `Buffer.isEncoding` when checking encoding names as some
  15148. // modules monkey-patch it to support additional encodings
  15149. function normalizeEncoding(enc) {
  15150. var nenc = _normalizeEncoding(enc);
  15151. if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
  15152. return nenc || enc;
  15153. }
  15154. // StringDecoder provides an interface for efficiently splitting a series of
  15155. // buffers into a series of JS strings without breaking apart multi-byte
  15156. // characters.
  15157. exports.StringDecoder = StringDecoder;
  15158. function StringDecoder(encoding) {
  15159. this.encoding = normalizeEncoding(encoding);
  15160. var nb;
  15161. switch (this.encoding) {
  15162. case 'utf16le':
  15163. this.text = utf16Text;
  15164. this.end = utf16End;
  15165. nb = 4;
  15166. break;
  15167. case 'utf8':
  15168. this.fillLast = utf8FillLast;
  15169. nb = 4;
  15170. break;
  15171. case 'base64':
  15172. this.text = base64Text;
  15173. this.end = base64End;
  15174. nb = 3;
  15175. break;
  15176. default:
  15177. this.write = simpleWrite;
  15178. this.end = simpleEnd;
  15179. return;
  15180. }
  15181. this.lastNeed = 0;
  15182. this.lastTotal = 0;
  15183. this.lastChar = Buffer.allocUnsafe(nb);
  15184. }
  15185. StringDecoder.prototype.write = function (buf) {
  15186. if (buf.length === 0) return '';
  15187. var r;
  15188. var i;
  15189. if (this.lastNeed) {
  15190. r = this.fillLast(buf);
  15191. if (r === undefined) return '';
  15192. i = this.lastNeed;
  15193. this.lastNeed = 0;
  15194. } else {
  15195. i = 0;
  15196. }
  15197. if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
  15198. return r || '';
  15199. };
  15200. StringDecoder.prototype.end = utf8End;
  15201. // Returns only complete characters in a Buffer
  15202. StringDecoder.prototype.text = utf8Text;
  15203. // Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
  15204. StringDecoder.prototype.fillLast = function (buf) {
  15205. if (this.lastNeed <= buf.length) {
  15206. buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
  15207. return this.lastChar.toString(this.encoding, 0, this.lastTotal);
  15208. }
  15209. buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
  15210. this.lastNeed -= buf.length;
  15211. };
  15212. // Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
  15213. // continuation byte. If an invalid byte is detected, -2 is returned.
  15214. function utf8CheckByte(byte) {
  15215. 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;
  15216. return byte >> 6 === 0x02 ? -1 : -2;
  15217. }
  15218. // Checks at most 3 bytes at the end of a Buffer in order to detect an
  15219. // incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
  15220. // needed to complete the UTF-8 character (if applicable) are returned.
  15221. function utf8CheckIncomplete(self, buf, i) {
  15222. var j = buf.length - 1;
  15223. if (j < i) return 0;
  15224. var nb = utf8CheckByte(buf[j]);
  15225. if (nb >= 0) {
  15226. if (nb > 0) self.lastNeed = nb - 1;
  15227. return nb;
  15228. }
  15229. if (--j < i || nb === -2) return 0;
  15230. nb = utf8CheckByte(buf[j]);
  15231. if (nb >= 0) {
  15232. if (nb > 0) self.lastNeed = nb - 2;
  15233. return nb;
  15234. }
  15235. if (--j < i || nb === -2) return 0;
  15236. nb = utf8CheckByte(buf[j]);
  15237. if (nb >= 0) {
  15238. if (nb > 0) {
  15239. if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
  15240. }
  15241. return nb;
  15242. }
  15243. return 0;
  15244. }
  15245. // Validates as many continuation bytes for a multi-byte UTF-8 character as
  15246. // needed or are available. If we see a non-continuation byte where we expect
  15247. // one, we "replace" the validated continuation bytes we've seen so far with
  15248. // a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
  15249. // behavior. The continuation byte check is included three times in the case
  15250. // where all of the continuation bytes for a character exist in the same buffer.
  15251. // It is also done this way as a slight performance increase instead of using a
  15252. // loop.
  15253. function utf8CheckExtraBytes(self, buf, p) {
  15254. if ((buf[0] & 0xC0) !== 0x80) {
  15255. self.lastNeed = 0;
  15256. return '\ufffd';
  15257. }
  15258. if (self.lastNeed > 1 && buf.length > 1) {
  15259. if ((buf[1] & 0xC0) !== 0x80) {
  15260. self.lastNeed = 1;
  15261. return '\ufffd';
  15262. }
  15263. if (self.lastNeed > 2 && buf.length > 2) {
  15264. if ((buf[2] & 0xC0) !== 0x80) {
  15265. self.lastNeed = 2;
  15266. return '\ufffd';
  15267. }
  15268. }
  15269. }
  15270. }
  15271. // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
  15272. function utf8FillLast(buf) {
  15273. var p = this.lastTotal - this.lastNeed;
  15274. var r = utf8CheckExtraBytes(this, buf, p);
  15275. if (r !== undefined) return r;
  15276. if (this.lastNeed <= buf.length) {
  15277. buf.copy(this.lastChar, p, 0, this.lastNeed);
  15278. return this.lastChar.toString(this.encoding, 0, this.lastTotal);
  15279. }
  15280. buf.copy(this.lastChar, p, 0, buf.length);
  15281. this.lastNeed -= buf.length;
  15282. }
  15283. // Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
  15284. // partial character, the character's bytes are buffered until the required
  15285. // number of bytes are available.
  15286. function utf8Text(buf, i) {
  15287. var total = utf8CheckIncomplete(this, buf, i);
  15288. if (!this.lastNeed) return buf.toString('utf8', i);
  15289. this.lastTotal = total;
  15290. var end = buf.length - (total - this.lastNeed);
  15291. buf.copy(this.lastChar, 0, end);
  15292. return buf.toString('utf8', i, end);
  15293. }
  15294. // For UTF-8, a replacement character is added when ending on a partial
  15295. // character.
  15296. function utf8End(buf) {
  15297. var r = buf && buf.length ? this.write(buf) : '';
  15298. if (this.lastNeed) return r + '\ufffd';
  15299. return r;
  15300. }
  15301. // UTF-16LE typically needs two bytes per character, but even if we have an even
  15302. // number of bytes available, we need to check if we end on a leading/high
  15303. // surrogate. In that case, we need to wait for the next two bytes in order to
  15304. // decode the last character properly.
  15305. function utf16Text(buf, i) {
  15306. if ((buf.length - i) % 2 === 0) {
  15307. var r = buf.toString('utf16le', i);
  15308. if (r) {
  15309. var c = r.charCodeAt(r.length - 1);
  15310. if (c >= 0xD800 && c <= 0xDBFF) {
  15311. this.lastNeed = 2;
  15312. this.lastTotal = 4;
  15313. this.lastChar[0] = buf[buf.length - 2];
  15314. this.lastChar[1] = buf[buf.length - 1];
  15315. return r.slice(0, -1);
  15316. }
  15317. }
  15318. return r;
  15319. }
  15320. this.lastNeed = 1;
  15321. this.lastTotal = 2;
  15322. this.lastChar[0] = buf[buf.length - 1];
  15323. return buf.toString('utf16le', i, buf.length - 1);
  15324. }
  15325. // For UTF-16LE we do not explicitly append special replacement characters if we
  15326. // end on a partial character, we simply let v8 handle that.
  15327. function utf16End(buf) {
  15328. var r = buf && buf.length ? this.write(buf) : '';
  15329. if (this.lastNeed) {
  15330. var end = this.lastTotal - this.lastNeed;
  15331. return r + this.lastChar.toString('utf16le', 0, end);
  15332. }
  15333. return r;
  15334. }
  15335. function base64Text(buf, i) {
  15336. var n = (buf.length - i) % 3;
  15337. if (n === 0) return buf.toString('base64', i);
  15338. this.lastNeed = 3 - n;
  15339. this.lastTotal = 3;
  15340. if (n === 1) {
  15341. this.lastChar[0] = buf[buf.length - 1];
  15342. } else {
  15343. this.lastChar[0] = buf[buf.length - 2];
  15344. this.lastChar[1] = buf[buf.length - 1];
  15345. }
  15346. return buf.toString('base64', i, buf.length - n);
  15347. }
  15348. function base64End(buf) {
  15349. var r = buf && buf.length ? this.write(buf) : '';
  15350. if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
  15351. return r;
  15352. }
  15353. // Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
  15354. function simpleWrite(buf) {
  15355. return buf.toString(this.encoding);
  15356. }
  15357. function simpleEnd(buf) {
  15358. return buf && buf.length ? this.write(buf) : '';
  15359. }
  15360. /***/ }),
  15361. /* 104 */
  15362. /*!***************************************************************!*\
  15363. !*** ./node_modules/readable-stream/lib/_stream_transform.js ***!
  15364. \***************************************************************/
  15365. /*! no static exports found */
  15366. /***/ (function(module, exports, __webpack_require__) {
  15367. "use strict";
  15368. // Copyright Joyent, Inc. and other Node contributors.
  15369. //
  15370. // Permission is hereby granted, free of charge, to any person obtaining a
  15371. // copy of this software and associated documentation files (the
  15372. // "Software"), to deal in the Software without restriction, including
  15373. // without limitation the rights to use, copy, modify, merge, publish,
  15374. // distribute, sublicense, and/or sell copies of the Software, and to permit
  15375. // persons to whom the Software is furnished to do so, subject to the
  15376. // following conditions:
  15377. //
  15378. // The above copyright notice and this permission notice shall be included
  15379. // in all copies or substantial portions of the Software.
  15380. //
  15381. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  15382. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  15383. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  15384. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  15385. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  15386. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  15387. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  15388. // a transform stream is a readable/writable stream where you do
  15389. // something with the data. Sometimes it's called a "filter",
  15390. // but that's not a great name for it, since that implies a thing where
  15391. // some bits pass through, and others are simply ignored. (That would
  15392. // be a valid example of a transform, of course.)
  15393. //
  15394. // While the output is causally related to the input, it's not a
  15395. // necessarily symmetric or synchronous transformation. For example,
  15396. // a zlib stream might take multiple plain-text writes(), and then
  15397. // emit a single compressed chunk some time in the future.
  15398. //
  15399. // Here's how this works:
  15400. //
  15401. // The Transform stream has all the aspects of the readable and writable
  15402. // stream classes. When you write(chunk), that calls _write(chunk,cb)
  15403. // internally, and returns false if there's a lot of pending writes
  15404. // buffered up. When you call read(), that calls _read(n) until
  15405. // there's enough pending readable data buffered up.
  15406. //
  15407. // In a transform stream, the written data is placed in a buffer. When
  15408. // _read(n) is called, it transforms the queued up data, calling the
  15409. // buffered _write cb's as it consumes chunks. If consuming a single
  15410. // written chunk would result in multiple output chunks, then the first
  15411. // outputted bit calls the readcb, and subsequent chunks just go into
  15412. // the read buffer, and will cause it to emit 'readable' if necessary.
  15413. //
  15414. // This way, back-pressure is actually determined by the reading side,
  15415. // since _read has to be called to start processing a new chunk. However,
  15416. // a pathological inflate type of transform can cause excessive buffering
  15417. // here. For example, imagine a stream where every byte of input is
  15418. // interpreted as an integer from 0-255, and then results in that many
  15419. // bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
  15420. // 1kb of data being output. In this case, you could write a very small
  15421. // amount of input, and end up with a very large amount of output. In
  15422. // such a pathological inflating mechanism, there'd be no way to tell
  15423. // the system to stop doing the transform. A single 4MB write could
  15424. // cause the system to run out of memory.
  15425. //
  15426. // However, even in such a pathological case, only a single written chunk
  15427. // would be consumed, and then the rest would wait (un-transformed) until
  15428. // the results of the previous transformed chunk were consumed.
  15429. module.exports = Transform;
  15430. var Duplex = __webpack_require__(/*! ./_stream_duplex */ 100);
  15431. /*<replacement>*/
  15432. var util = Object.create(__webpack_require__(/*! core-util-is */ 95));
  15433. util.inherits = __webpack_require__(/*! inherits */ 87);
  15434. /*</replacement>*/
  15435. util.inherits(Transform, Duplex);
  15436. function afterTransform(er, data) {
  15437. var ts = this._transformState;
  15438. ts.transforming = false;
  15439. var cb = ts.writecb;
  15440. if (!cb) {
  15441. return this.emit('error', new Error('write callback called multiple times'));
  15442. }
  15443. ts.writechunk = null;
  15444. ts.writecb = null;
  15445. if (data != null) // single equals check for both `null` and `undefined`
  15446. this.push(data);
  15447. cb(er);
  15448. var rs = this._readableState;
  15449. rs.reading = false;
  15450. if (rs.needReadable || rs.length < rs.highWaterMark) {
  15451. this._read(rs.highWaterMark);
  15452. }
  15453. }
  15454. function Transform(options) {
  15455. if (!(this instanceof Transform)) return new Transform(options);
  15456. Duplex.call(this, options);
  15457. this._transformState = {
  15458. afterTransform: afterTransform.bind(this),
  15459. needTransform: false,
  15460. transforming: false,
  15461. writecb: null,
  15462. writechunk: null,
  15463. writeencoding: null
  15464. };
  15465. // start out asking for a readable event once data is transformed.
  15466. this._readableState.needReadable = true;
  15467. // we have implemented the _read method, and done the other things
  15468. // that Readable wants before the first _read call, so unset the
  15469. // sync guard flag.
  15470. this._readableState.sync = false;
  15471. if (options) {
  15472. if (typeof options.transform === 'function') this._transform = options.transform;
  15473. if (typeof options.flush === 'function') this._flush = options.flush;
  15474. }
  15475. // When the writable side finishes, then flush out anything remaining.
  15476. this.on('prefinish', prefinish);
  15477. }
  15478. function prefinish() {
  15479. var _this = this;
  15480. if (typeof this._flush === 'function') {
  15481. this._flush(function (er, data) {
  15482. done(_this, er, data);
  15483. });
  15484. } else {
  15485. done(this, null, null);
  15486. }
  15487. }
  15488. Transform.prototype.push = function (chunk, encoding) {
  15489. this._transformState.needTransform = false;
  15490. return Duplex.prototype.push.call(this, chunk, encoding);
  15491. };
  15492. // This is the part where you do stuff!
  15493. // override this function in implementation classes.
  15494. // 'chunk' is an input chunk.
  15495. //
  15496. // Call `push(newChunk)` to pass along transformed output
  15497. // to the readable side. You may call 'push' zero or more times.
  15498. //
  15499. // Call `cb(err)` when you are done with this chunk. If you pass
  15500. // an error, then that'll put the hurt on the whole operation. If you
  15501. // never call cb(), then you'll never get another chunk.
  15502. Transform.prototype._transform = function (chunk, encoding, cb) {
  15503. throw new Error('_transform() is not implemented');
  15504. };
  15505. Transform.prototype._write = function (chunk, encoding, cb) {
  15506. var ts = this._transformState;
  15507. ts.writecb = cb;
  15508. ts.writechunk = chunk;
  15509. ts.writeencoding = encoding;
  15510. if (!ts.transforming) {
  15511. var rs = this._readableState;
  15512. if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
  15513. }
  15514. };
  15515. // Doesn't matter what the args are here.
  15516. // _transform does all the work.
  15517. // That we got here means that the readable side wants more data.
  15518. Transform.prototype._read = function (n) {
  15519. var ts = this._transformState;
  15520. if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
  15521. ts.transforming = true;
  15522. this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
  15523. } else {
  15524. // mark that we need a transform, so that any data that comes in
  15525. // will get processed, now that we've asked for it.
  15526. ts.needTransform = true;
  15527. }
  15528. };
  15529. Transform.prototype._destroy = function (err, cb) {
  15530. var _this2 = this;
  15531. Duplex.prototype._destroy.call(this, err, function (err2) {
  15532. cb(err2);
  15533. _this2.emit('close');
  15534. });
  15535. };
  15536. function done(stream, er, data) {
  15537. if (er) return stream.emit('error', er);
  15538. if (data != null) // single equals check for both `null` and `undefined`
  15539. stream.push(data);
  15540. // if there's nothing in the write buffer, then that means
  15541. // that nothing more will ever be provided
  15542. if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');
  15543. if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');
  15544. return stream.push(null);
  15545. }
  15546. /***/ }),
  15547. /* 105 */
  15548. /*!*****************************************************************!*\
  15549. !*** ./node_modules/readable-stream/lib/_stream_passthrough.js ***!
  15550. \*****************************************************************/
  15551. /*! no static exports found */
  15552. /***/ (function(module, exports, __webpack_require__) {
  15553. "use strict";
  15554. // Copyright Joyent, Inc. and other Node contributors.
  15555. //
  15556. // Permission is hereby granted, free of charge, to any person obtaining a
  15557. // copy of this software and associated documentation files (the
  15558. // "Software"), to deal in the Software without restriction, including
  15559. // without limitation the rights to use, copy, modify, merge, publish,
  15560. // distribute, sublicense, and/or sell copies of the Software, and to permit
  15561. // persons to whom the Software is furnished to do so, subject to the
  15562. // following conditions:
  15563. //
  15564. // The above copyright notice and this permission notice shall be included
  15565. // in all copies or substantial portions of the Software.
  15566. //
  15567. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  15568. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  15569. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  15570. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  15571. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  15572. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  15573. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  15574. // a passthrough stream.
  15575. // basically just the most minimal sort of Transform stream.
  15576. // Every written chunk gets output as-is.
  15577. module.exports = PassThrough;
  15578. var Transform = __webpack_require__(/*! ./_stream_transform */ 104);
  15579. /*<replacement>*/
  15580. var util = Object.create(__webpack_require__(/*! core-util-is */ 95));
  15581. util.inherits = __webpack_require__(/*! inherits */ 87);
  15582. /*</replacement>*/
  15583. util.inherits(PassThrough, Transform);
  15584. function PassThrough(options) {
  15585. if (!(this instanceof PassThrough)) return new PassThrough(options);
  15586. Transform.call(this, options);
  15587. }
  15588. PassThrough.prototype._transform = function (chunk, encoding, cb) {
  15589. cb(null, chunk);
  15590. };
  15591. /***/ }),
  15592. /* 106 */
  15593. /*!*****************************************!*\
  15594. !*** ./node_modules/ripemd160/index.js ***!
  15595. \*****************************************/
  15596. /*! no static exports found */
  15597. /***/ (function(module, exports, __webpack_require__) {
  15598. "use strict";
  15599. var Buffer = __webpack_require__(/*! buffer */ 82).Buffer
  15600. var inherits = __webpack_require__(/*! inherits */ 87)
  15601. var HashBase = __webpack_require__(/*! hash-base */ 89)
  15602. var ARRAY16 = new Array(16)
  15603. var zl = [
  15604. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  15605. 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
  15606. 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
  15607. 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
  15608. 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13
  15609. ]
  15610. var zr = [
  15611. 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
  15612. 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
  15613. 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
  15614. 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
  15615. 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11
  15616. ]
  15617. var sl = [
  15618. 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
  15619. 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
  15620. 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
  15621. 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
  15622. 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6
  15623. ]
  15624. var sr = [
  15625. 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
  15626. 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
  15627. 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
  15628. 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
  15629. 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11
  15630. ]
  15631. var hl = [0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e]
  15632. var hr = [0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000]
  15633. function RIPEMD160 () {
  15634. HashBase.call(this, 64)
  15635. // state
  15636. this._a = 0x67452301
  15637. this._b = 0xefcdab89
  15638. this._c = 0x98badcfe
  15639. this._d = 0x10325476
  15640. this._e = 0xc3d2e1f0
  15641. }
  15642. inherits(RIPEMD160, HashBase)
  15643. RIPEMD160.prototype._update = function () {
  15644. var words = ARRAY16
  15645. for (var j = 0; j < 16; ++j) words[j] = this._block.readInt32LE(j * 4)
  15646. var al = this._a | 0
  15647. var bl = this._b | 0
  15648. var cl = this._c | 0
  15649. var dl = this._d | 0
  15650. var el = this._e | 0
  15651. var ar = this._a | 0
  15652. var br = this._b | 0
  15653. var cr = this._c | 0
  15654. var dr = this._d | 0
  15655. var er = this._e | 0
  15656. // computation
  15657. for (var i = 0; i < 80; i += 1) {
  15658. var tl
  15659. var tr
  15660. if (i < 16) {
  15661. tl = fn1(al, bl, cl, dl, el, words[zl[i]], hl[0], sl[i])
  15662. tr = fn5(ar, br, cr, dr, er, words[zr[i]], hr[0], sr[i])
  15663. } else if (i < 32) {
  15664. tl = fn2(al, bl, cl, dl, el, words[zl[i]], hl[1], sl[i])
  15665. tr = fn4(ar, br, cr, dr, er, words[zr[i]], hr[1], sr[i])
  15666. } else if (i < 48) {
  15667. tl = fn3(al, bl, cl, dl, el, words[zl[i]], hl[2], sl[i])
  15668. tr = fn3(ar, br, cr, dr, er, words[zr[i]], hr[2], sr[i])
  15669. } else if (i < 64) {
  15670. tl = fn4(al, bl, cl, dl, el, words[zl[i]], hl[3], sl[i])
  15671. tr = fn2(ar, br, cr, dr, er, words[zr[i]], hr[3], sr[i])
  15672. } else { // if (i<80) {
  15673. tl = fn5(al, bl, cl, dl, el, words[zl[i]], hl[4], sl[i])
  15674. tr = fn1(ar, br, cr, dr, er, words[zr[i]], hr[4], sr[i])
  15675. }
  15676. al = el
  15677. el = dl
  15678. dl = rotl(cl, 10)
  15679. cl = bl
  15680. bl = tl
  15681. ar = er
  15682. er = dr
  15683. dr = rotl(cr, 10)
  15684. cr = br
  15685. br = tr
  15686. }
  15687. // update state
  15688. var t = (this._b + cl + dr) | 0
  15689. this._b = (this._c + dl + er) | 0
  15690. this._c = (this._d + el + ar) | 0
  15691. this._d = (this._e + al + br) | 0
  15692. this._e = (this._a + bl + cr) | 0
  15693. this._a = t
  15694. }
  15695. RIPEMD160.prototype._digest = function () {
  15696. // create padding and handle blocks
  15697. this._block[this._blockOffset++] = 0x80
  15698. if (this._blockOffset > 56) {
  15699. this._block.fill(0, this._blockOffset, 64)
  15700. this._update()
  15701. this._blockOffset = 0
  15702. }
  15703. this._block.fill(0, this._blockOffset, 56)
  15704. this._block.writeUInt32LE(this._length[0], 56)
  15705. this._block.writeUInt32LE(this._length[1], 60)
  15706. this._update()
  15707. // produce result
  15708. var buffer = Buffer.alloc ? Buffer.alloc(20) : new Buffer(20)
  15709. buffer.writeInt32LE(this._a, 0)
  15710. buffer.writeInt32LE(this._b, 4)
  15711. buffer.writeInt32LE(this._c, 8)
  15712. buffer.writeInt32LE(this._d, 12)
  15713. buffer.writeInt32LE(this._e, 16)
  15714. return buffer
  15715. }
  15716. function rotl (x, n) {
  15717. return (x << n) | (x >>> (32 - n))
  15718. }
  15719. function fn1 (a, b, c, d, e, m, k, s) {
  15720. return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + e) | 0
  15721. }
  15722. function fn2 (a, b, c, d, e, m, k, s) {
  15723. return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + e) | 0
  15724. }
  15725. function fn3 (a, b, c, d, e, m, k, s) {
  15726. return (rotl((a + ((b | (~c)) ^ d) + m + k) | 0, s) + e) | 0
  15727. }
  15728. function fn4 (a, b, c, d, e, m, k, s) {
  15729. return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + e) | 0
  15730. }
  15731. function fn5 (a, b, c, d, e, m, k, s) {
  15732. return (rotl((a + (b ^ (c | (~d))) + m + k) | 0, s) + e) | 0
  15733. }
  15734. module.exports = RIPEMD160
  15735. /***/ }),
  15736. /* 107 */
  15737. /*!**************************************!*\
  15738. !*** ./node_modules/sha.js/index.js ***!
  15739. \**************************************/
  15740. /*! no static exports found */
  15741. /***/ (function(module, exports, __webpack_require__) {
  15742. var exports = module.exports = function SHA (algorithm) {
  15743. algorithm = algorithm.toLowerCase()
  15744. var Algorithm = exports[algorithm]
  15745. if (!Algorithm) throw new Error(algorithm + ' is not supported (we accept pull requests)')
  15746. return new Algorithm()
  15747. }
  15748. exports.sha = __webpack_require__(/*! ./sha */ 108)
  15749. exports.sha1 = __webpack_require__(/*! ./sha1 */ 110)
  15750. exports.sha224 = __webpack_require__(/*! ./sha224 */ 111)
  15751. exports.sha256 = __webpack_require__(/*! ./sha256 */ 112)
  15752. exports.sha384 = __webpack_require__(/*! ./sha384 */ 113)
  15753. exports.sha512 = __webpack_require__(/*! ./sha512 */ 114)
  15754. /***/ }),
  15755. /* 108 */
  15756. /*!************************************!*\
  15757. !*** ./node_modules/sha.js/sha.js ***!
  15758. \************************************/
  15759. /*! no static exports found */
  15760. /***/ (function(module, exports, __webpack_require__) {
  15761. /*
  15762. * A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined
  15763. * in FIPS PUB 180-1
  15764. * This source code is derived from sha1.js of the same repository.
  15765. * The difference between SHA-0 and SHA-1 is just a bitwise rotate left
  15766. * operation was added.
  15767. */
  15768. var inherits = __webpack_require__(/*! inherits */ 87)
  15769. var Hash = __webpack_require__(/*! ./hash */ 109)
  15770. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  15771. var K = [
  15772. 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0
  15773. ]
  15774. var W = new Array(80)
  15775. function Sha () {
  15776. this.init()
  15777. this._w = W
  15778. Hash.call(this, 64, 56)
  15779. }
  15780. inherits(Sha, Hash)
  15781. Sha.prototype.init = function () {
  15782. this._a = 0x67452301
  15783. this._b = 0xefcdab89
  15784. this._c = 0x98badcfe
  15785. this._d = 0x10325476
  15786. this._e = 0xc3d2e1f0
  15787. return this
  15788. }
  15789. function rotl5 (num) {
  15790. return (num << 5) | (num >>> 27)
  15791. }
  15792. function rotl30 (num) {
  15793. return (num << 30) | (num >>> 2)
  15794. }
  15795. function ft (s, b, c, d) {
  15796. if (s === 0) return (b & c) | ((~b) & d)
  15797. if (s === 2) return (b & c) | (b & d) | (c & d)
  15798. return b ^ c ^ d
  15799. }
  15800. Sha.prototype._update = function (M) {
  15801. var W = this._w
  15802. var a = this._a | 0
  15803. var b = this._b | 0
  15804. var c = this._c | 0
  15805. var d = this._d | 0
  15806. var e = this._e | 0
  15807. for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
  15808. for (; i < 80; ++i) W[i] = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]
  15809. for (var j = 0; j < 80; ++j) {
  15810. var s = ~~(j / 20)
  15811. var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0
  15812. e = d
  15813. d = c
  15814. c = rotl30(b)
  15815. b = a
  15816. a = t
  15817. }
  15818. this._a = (a + this._a) | 0
  15819. this._b = (b + this._b) | 0
  15820. this._c = (c + this._c) | 0
  15821. this._d = (d + this._d) | 0
  15822. this._e = (e + this._e) | 0
  15823. }
  15824. Sha.prototype._hash = function () {
  15825. var H = Buffer.allocUnsafe(20)
  15826. H.writeInt32BE(this._a | 0, 0)
  15827. H.writeInt32BE(this._b | 0, 4)
  15828. H.writeInt32BE(this._c | 0, 8)
  15829. H.writeInt32BE(this._d | 0, 12)
  15830. H.writeInt32BE(this._e | 0, 16)
  15831. return H
  15832. }
  15833. module.exports = Sha
  15834. /***/ }),
  15835. /* 109 */
  15836. /*!*************************************!*\
  15837. !*** ./node_modules/sha.js/hash.js ***!
  15838. \*************************************/
  15839. /*! no static exports found */
  15840. /***/ (function(module, exports, __webpack_require__) {
  15841. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  15842. // prototype class for hash functions
  15843. function Hash (blockSize, finalSize) {
  15844. this._block = Buffer.alloc(blockSize)
  15845. this._finalSize = finalSize
  15846. this._blockSize = blockSize
  15847. this._len = 0
  15848. }
  15849. Hash.prototype.update = function (data, enc) {
  15850. if (typeof data === 'string') {
  15851. enc = enc || 'utf8'
  15852. data = Buffer.from(data, enc)
  15853. }
  15854. var block = this._block
  15855. var blockSize = this._blockSize
  15856. var length = data.length
  15857. var accum = this._len
  15858. for (var offset = 0; offset < length;) {
  15859. var assigned = accum % blockSize
  15860. var remainder = Math.min(length - offset, blockSize - assigned)
  15861. for (var i = 0; i < remainder; i++) {
  15862. block[assigned + i] = data[offset + i]
  15863. }
  15864. accum += remainder
  15865. offset += remainder
  15866. if ((accum % blockSize) === 0) {
  15867. this._update(block)
  15868. }
  15869. }
  15870. this._len += length
  15871. return this
  15872. }
  15873. Hash.prototype.digest = function (enc) {
  15874. var rem = this._len % this._blockSize
  15875. this._block[rem] = 0x80
  15876. // zero (rem + 1) trailing bits, where (rem + 1) is the smallest
  15877. // non-negative solution to the equation (length + 1 + (rem + 1)) === finalSize mod blockSize
  15878. this._block.fill(0, rem + 1)
  15879. if (rem >= this._finalSize) {
  15880. this._update(this._block)
  15881. this._block.fill(0)
  15882. }
  15883. var bits = this._len * 8
  15884. // uint32
  15885. if (bits <= 0xffffffff) {
  15886. this._block.writeUInt32BE(bits, this._blockSize - 4)
  15887. // uint64
  15888. } else {
  15889. var lowBits = (bits & 0xffffffff) >>> 0
  15890. var highBits = (bits - lowBits) / 0x100000000
  15891. this._block.writeUInt32BE(highBits, this._blockSize - 8)
  15892. this._block.writeUInt32BE(lowBits, this._blockSize - 4)
  15893. }
  15894. this._update(this._block)
  15895. var hash = this._hash()
  15896. return enc ? hash.toString(enc) : hash
  15897. }
  15898. Hash.prototype._update = function () {
  15899. throw new Error('_update must be implemented by subclass')
  15900. }
  15901. module.exports = Hash
  15902. /***/ }),
  15903. /* 110 */
  15904. /*!*************************************!*\
  15905. !*** ./node_modules/sha.js/sha1.js ***!
  15906. \*************************************/
  15907. /*! no static exports found */
  15908. /***/ (function(module, exports, __webpack_require__) {
  15909. /*
  15910. * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
  15911. * in FIPS PUB 180-1
  15912. * Version 2.1a Copyright Paul Johnston 2000 - 2002.
  15913. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
  15914. * Distributed under the BSD License
  15915. * See http://pajhome.org.uk/crypt/md5 for details.
  15916. */
  15917. var inherits = __webpack_require__(/*! inherits */ 87)
  15918. var Hash = __webpack_require__(/*! ./hash */ 109)
  15919. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  15920. var K = [
  15921. 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0
  15922. ]
  15923. var W = new Array(80)
  15924. function Sha1 () {
  15925. this.init()
  15926. this._w = W
  15927. Hash.call(this, 64, 56)
  15928. }
  15929. inherits(Sha1, Hash)
  15930. Sha1.prototype.init = function () {
  15931. this._a = 0x67452301
  15932. this._b = 0xefcdab89
  15933. this._c = 0x98badcfe
  15934. this._d = 0x10325476
  15935. this._e = 0xc3d2e1f0
  15936. return this
  15937. }
  15938. function rotl1 (num) {
  15939. return (num << 1) | (num >>> 31)
  15940. }
  15941. function rotl5 (num) {
  15942. return (num << 5) | (num >>> 27)
  15943. }
  15944. function rotl30 (num) {
  15945. return (num << 30) | (num >>> 2)
  15946. }
  15947. function ft (s, b, c, d) {
  15948. if (s === 0) return (b & c) | ((~b) & d)
  15949. if (s === 2) return (b & c) | (b & d) | (c & d)
  15950. return b ^ c ^ d
  15951. }
  15952. Sha1.prototype._update = function (M) {
  15953. var W = this._w
  15954. var a = this._a | 0
  15955. var b = this._b | 0
  15956. var c = this._c | 0
  15957. var d = this._d | 0
  15958. var e = this._e | 0
  15959. for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
  15960. for (; i < 80; ++i) W[i] = rotl1(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16])
  15961. for (var j = 0; j < 80; ++j) {
  15962. var s = ~~(j / 20)
  15963. var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0
  15964. e = d
  15965. d = c
  15966. c = rotl30(b)
  15967. b = a
  15968. a = t
  15969. }
  15970. this._a = (a + this._a) | 0
  15971. this._b = (b + this._b) | 0
  15972. this._c = (c + this._c) | 0
  15973. this._d = (d + this._d) | 0
  15974. this._e = (e + this._e) | 0
  15975. }
  15976. Sha1.prototype._hash = function () {
  15977. var H = Buffer.allocUnsafe(20)
  15978. H.writeInt32BE(this._a | 0, 0)
  15979. H.writeInt32BE(this._b | 0, 4)
  15980. H.writeInt32BE(this._c | 0, 8)
  15981. H.writeInt32BE(this._d | 0, 12)
  15982. H.writeInt32BE(this._e | 0, 16)
  15983. return H
  15984. }
  15985. module.exports = Sha1
  15986. /***/ }),
  15987. /* 111 */
  15988. /*!***************************************!*\
  15989. !*** ./node_modules/sha.js/sha224.js ***!
  15990. \***************************************/
  15991. /*! no static exports found */
  15992. /***/ (function(module, exports, __webpack_require__) {
  15993. /**
  15994. * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
  15995. * in FIPS 180-2
  15996. * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
  15997. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
  15998. *
  15999. */
  16000. var inherits = __webpack_require__(/*! inherits */ 87)
  16001. var Sha256 = __webpack_require__(/*! ./sha256 */ 112)
  16002. var Hash = __webpack_require__(/*! ./hash */ 109)
  16003. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  16004. var W = new Array(64)
  16005. function Sha224 () {
  16006. this.init()
  16007. this._w = W // new Array(64)
  16008. Hash.call(this, 64, 56)
  16009. }
  16010. inherits(Sha224, Sha256)
  16011. Sha224.prototype.init = function () {
  16012. this._a = 0xc1059ed8
  16013. this._b = 0x367cd507
  16014. this._c = 0x3070dd17
  16015. this._d = 0xf70e5939
  16016. this._e = 0xffc00b31
  16017. this._f = 0x68581511
  16018. this._g = 0x64f98fa7
  16019. this._h = 0xbefa4fa4
  16020. return this
  16021. }
  16022. Sha224.prototype._hash = function () {
  16023. var H = Buffer.allocUnsafe(28)
  16024. H.writeInt32BE(this._a, 0)
  16025. H.writeInt32BE(this._b, 4)
  16026. H.writeInt32BE(this._c, 8)
  16027. H.writeInt32BE(this._d, 12)
  16028. H.writeInt32BE(this._e, 16)
  16029. H.writeInt32BE(this._f, 20)
  16030. H.writeInt32BE(this._g, 24)
  16031. return H
  16032. }
  16033. module.exports = Sha224
  16034. /***/ }),
  16035. /* 112 */
  16036. /*!***************************************!*\
  16037. !*** ./node_modules/sha.js/sha256.js ***!
  16038. \***************************************/
  16039. /*! no static exports found */
  16040. /***/ (function(module, exports, __webpack_require__) {
  16041. /**
  16042. * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
  16043. * in FIPS 180-2
  16044. * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
  16045. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
  16046. *
  16047. */
  16048. var inherits = __webpack_require__(/*! inherits */ 87)
  16049. var Hash = __webpack_require__(/*! ./hash */ 109)
  16050. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  16051. var K = [
  16052. 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,
  16053. 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,
  16054. 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,
  16055. 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,
  16056. 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,
  16057. 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,
  16058. 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,
  16059. 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,
  16060. 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,
  16061. 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,
  16062. 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,
  16063. 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,
  16064. 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,
  16065. 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,
  16066. 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,
  16067. 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2
  16068. ]
  16069. var W = new Array(64)
  16070. function Sha256 () {
  16071. this.init()
  16072. this._w = W // new Array(64)
  16073. Hash.call(this, 64, 56)
  16074. }
  16075. inherits(Sha256, Hash)
  16076. Sha256.prototype.init = function () {
  16077. this._a = 0x6a09e667
  16078. this._b = 0xbb67ae85
  16079. this._c = 0x3c6ef372
  16080. this._d = 0xa54ff53a
  16081. this._e = 0x510e527f
  16082. this._f = 0x9b05688c
  16083. this._g = 0x1f83d9ab
  16084. this._h = 0x5be0cd19
  16085. return this
  16086. }
  16087. function ch (x, y, z) {
  16088. return z ^ (x & (y ^ z))
  16089. }
  16090. function maj (x, y, z) {
  16091. return (x & y) | (z & (x | y))
  16092. }
  16093. function sigma0 (x) {
  16094. return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10)
  16095. }
  16096. function sigma1 (x) {
  16097. return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7)
  16098. }
  16099. function gamma0 (x) {
  16100. return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3)
  16101. }
  16102. function gamma1 (x) {
  16103. return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10)
  16104. }
  16105. Sha256.prototype._update = function (M) {
  16106. var W = this._w
  16107. var a = this._a | 0
  16108. var b = this._b | 0
  16109. var c = this._c | 0
  16110. var d = this._d | 0
  16111. var e = this._e | 0
  16112. var f = this._f | 0
  16113. var g = this._g | 0
  16114. var h = this._h | 0
  16115. for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
  16116. for (; i < 64; ++i) W[i] = (gamma1(W[i - 2]) + W[i - 7] + gamma0(W[i - 15]) + W[i - 16]) | 0
  16117. for (var j = 0; j < 64; ++j) {
  16118. var T1 = (h + sigma1(e) + ch(e, f, g) + K[j] + W[j]) | 0
  16119. var T2 = (sigma0(a) + maj(a, b, c)) | 0
  16120. h = g
  16121. g = f
  16122. f = e
  16123. e = (d + T1) | 0
  16124. d = c
  16125. c = b
  16126. b = a
  16127. a = (T1 + T2) | 0
  16128. }
  16129. this._a = (a + this._a) | 0
  16130. this._b = (b + this._b) | 0
  16131. this._c = (c + this._c) | 0
  16132. this._d = (d + this._d) | 0
  16133. this._e = (e + this._e) | 0
  16134. this._f = (f + this._f) | 0
  16135. this._g = (g + this._g) | 0
  16136. this._h = (h + this._h) | 0
  16137. }
  16138. Sha256.prototype._hash = function () {
  16139. var H = Buffer.allocUnsafe(32)
  16140. H.writeInt32BE(this._a, 0)
  16141. H.writeInt32BE(this._b, 4)
  16142. H.writeInt32BE(this._c, 8)
  16143. H.writeInt32BE(this._d, 12)
  16144. H.writeInt32BE(this._e, 16)
  16145. H.writeInt32BE(this._f, 20)
  16146. H.writeInt32BE(this._g, 24)
  16147. H.writeInt32BE(this._h, 28)
  16148. return H
  16149. }
  16150. module.exports = Sha256
  16151. /***/ }),
  16152. /* 113 */
  16153. /*!***************************************!*\
  16154. !*** ./node_modules/sha.js/sha384.js ***!
  16155. \***************************************/
  16156. /*! no static exports found */
  16157. /***/ (function(module, exports, __webpack_require__) {
  16158. var inherits = __webpack_require__(/*! inherits */ 87)
  16159. var SHA512 = __webpack_require__(/*! ./sha512 */ 114)
  16160. var Hash = __webpack_require__(/*! ./hash */ 109)
  16161. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  16162. var W = new Array(160)
  16163. function Sha384 () {
  16164. this.init()
  16165. this._w = W
  16166. Hash.call(this, 128, 112)
  16167. }
  16168. inherits(Sha384, SHA512)
  16169. Sha384.prototype.init = function () {
  16170. this._ah = 0xcbbb9d5d
  16171. this._bh = 0x629a292a
  16172. this._ch = 0x9159015a
  16173. this._dh = 0x152fecd8
  16174. this._eh = 0x67332667
  16175. this._fh = 0x8eb44a87
  16176. this._gh = 0xdb0c2e0d
  16177. this._hh = 0x47b5481d
  16178. this._al = 0xc1059ed8
  16179. this._bl = 0x367cd507
  16180. this._cl = 0x3070dd17
  16181. this._dl = 0xf70e5939
  16182. this._el = 0xffc00b31
  16183. this._fl = 0x68581511
  16184. this._gl = 0x64f98fa7
  16185. this._hl = 0xbefa4fa4
  16186. return this
  16187. }
  16188. Sha384.prototype._hash = function () {
  16189. var H = Buffer.allocUnsafe(48)
  16190. function writeInt64BE (h, l, offset) {
  16191. H.writeInt32BE(h, offset)
  16192. H.writeInt32BE(l, offset + 4)
  16193. }
  16194. writeInt64BE(this._ah, this._al, 0)
  16195. writeInt64BE(this._bh, this._bl, 8)
  16196. writeInt64BE(this._ch, this._cl, 16)
  16197. writeInt64BE(this._dh, this._dl, 24)
  16198. writeInt64BE(this._eh, this._el, 32)
  16199. writeInt64BE(this._fh, this._fl, 40)
  16200. return H
  16201. }
  16202. module.exports = Sha384
  16203. /***/ }),
  16204. /* 114 */
  16205. /*!***************************************!*\
  16206. !*** ./node_modules/sha.js/sha512.js ***!
  16207. \***************************************/
  16208. /*! no static exports found */
  16209. /***/ (function(module, exports, __webpack_require__) {
  16210. var inherits = __webpack_require__(/*! inherits */ 87)
  16211. var Hash = __webpack_require__(/*! ./hash */ 109)
  16212. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  16213. var K = [
  16214. 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,
  16215. 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
  16216. 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,
  16217. 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
  16218. 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,
  16219. 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
  16220. 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,
  16221. 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
  16222. 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,
  16223. 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
  16224. 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,
  16225. 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
  16226. 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,
  16227. 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
  16228. 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,
  16229. 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
  16230. 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,
  16231. 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
  16232. 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,
  16233. 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
  16234. 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,
  16235. 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
  16236. 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,
  16237. 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
  16238. 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,
  16239. 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
  16240. 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,
  16241. 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
  16242. 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,
  16243. 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
  16244. 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,
  16245. 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
  16246. 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,
  16247. 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
  16248. 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,
  16249. 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
  16250. 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,
  16251. 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
  16252. 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,
  16253. 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817
  16254. ]
  16255. var W = new Array(160)
  16256. function Sha512 () {
  16257. this.init()
  16258. this._w = W
  16259. Hash.call(this, 128, 112)
  16260. }
  16261. inherits(Sha512, Hash)
  16262. Sha512.prototype.init = function () {
  16263. this._ah = 0x6a09e667
  16264. this._bh = 0xbb67ae85
  16265. this._ch = 0x3c6ef372
  16266. this._dh = 0xa54ff53a
  16267. this._eh = 0x510e527f
  16268. this._fh = 0x9b05688c
  16269. this._gh = 0x1f83d9ab
  16270. this._hh = 0x5be0cd19
  16271. this._al = 0xf3bcc908
  16272. this._bl = 0x84caa73b
  16273. this._cl = 0xfe94f82b
  16274. this._dl = 0x5f1d36f1
  16275. this._el = 0xade682d1
  16276. this._fl = 0x2b3e6c1f
  16277. this._gl = 0xfb41bd6b
  16278. this._hl = 0x137e2179
  16279. return this
  16280. }
  16281. function Ch (x, y, z) {
  16282. return z ^ (x & (y ^ z))
  16283. }
  16284. function maj (x, y, z) {
  16285. return (x & y) | (z & (x | y))
  16286. }
  16287. function sigma0 (x, xl) {
  16288. return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25)
  16289. }
  16290. function sigma1 (x, xl) {
  16291. return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23)
  16292. }
  16293. function Gamma0 (x, xl) {
  16294. return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7)
  16295. }
  16296. function Gamma0l (x, xl) {
  16297. return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25)
  16298. }
  16299. function Gamma1 (x, xl) {
  16300. return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6)
  16301. }
  16302. function Gamma1l (x, xl) {
  16303. return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26)
  16304. }
  16305. function getCarry (a, b) {
  16306. return (a >>> 0) < (b >>> 0) ? 1 : 0
  16307. }
  16308. Sha512.prototype._update = function (M) {
  16309. var W = this._w
  16310. var ah = this._ah | 0
  16311. var bh = this._bh | 0
  16312. var ch = this._ch | 0
  16313. var dh = this._dh | 0
  16314. var eh = this._eh | 0
  16315. var fh = this._fh | 0
  16316. var gh = this._gh | 0
  16317. var hh = this._hh | 0
  16318. var al = this._al | 0
  16319. var bl = this._bl | 0
  16320. var cl = this._cl | 0
  16321. var dl = this._dl | 0
  16322. var el = this._el | 0
  16323. var fl = this._fl | 0
  16324. var gl = this._gl | 0
  16325. var hl = this._hl | 0
  16326. for (var i = 0; i < 32; i += 2) {
  16327. W[i] = M.readInt32BE(i * 4)
  16328. W[i + 1] = M.readInt32BE(i * 4 + 4)
  16329. }
  16330. for (; i < 160; i += 2) {
  16331. var xh = W[i - 15 * 2]
  16332. var xl = W[i - 15 * 2 + 1]
  16333. var gamma0 = Gamma0(xh, xl)
  16334. var gamma0l = Gamma0l(xl, xh)
  16335. xh = W[i - 2 * 2]
  16336. xl = W[i - 2 * 2 + 1]
  16337. var gamma1 = Gamma1(xh, xl)
  16338. var gamma1l = Gamma1l(xl, xh)
  16339. // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]
  16340. var Wi7h = W[i - 7 * 2]
  16341. var Wi7l = W[i - 7 * 2 + 1]
  16342. var Wi16h = W[i - 16 * 2]
  16343. var Wi16l = W[i - 16 * 2 + 1]
  16344. var Wil = (gamma0l + Wi7l) | 0
  16345. var Wih = (gamma0 + Wi7h + getCarry(Wil, gamma0l)) | 0
  16346. Wil = (Wil + gamma1l) | 0
  16347. Wih = (Wih + gamma1 + getCarry(Wil, gamma1l)) | 0
  16348. Wil = (Wil + Wi16l) | 0
  16349. Wih = (Wih + Wi16h + getCarry(Wil, Wi16l)) | 0
  16350. W[i] = Wih
  16351. W[i + 1] = Wil
  16352. }
  16353. for (var j = 0; j < 160; j += 2) {
  16354. Wih = W[j]
  16355. Wil = W[j + 1]
  16356. var majh = maj(ah, bh, ch)
  16357. var majl = maj(al, bl, cl)
  16358. var sigma0h = sigma0(ah, al)
  16359. var sigma0l = sigma0(al, ah)
  16360. var sigma1h = sigma1(eh, el)
  16361. var sigma1l = sigma1(el, eh)
  16362. // t1 = h + sigma1 + ch + K[j] + W[j]
  16363. var Kih = K[j]
  16364. var Kil = K[j + 1]
  16365. var chh = Ch(eh, fh, gh)
  16366. var chl = Ch(el, fl, gl)
  16367. var t1l = (hl + sigma1l) | 0
  16368. var t1h = (hh + sigma1h + getCarry(t1l, hl)) | 0
  16369. t1l = (t1l + chl) | 0
  16370. t1h = (t1h + chh + getCarry(t1l, chl)) | 0
  16371. t1l = (t1l + Kil) | 0
  16372. t1h = (t1h + Kih + getCarry(t1l, Kil)) | 0
  16373. t1l = (t1l + Wil) | 0
  16374. t1h = (t1h + Wih + getCarry(t1l, Wil)) | 0
  16375. // t2 = sigma0 + maj
  16376. var t2l = (sigma0l + majl) | 0
  16377. var t2h = (sigma0h + majh + getCarry(t2l, sigma0l)) | 0
  16378. hh = gh
  16379. hl = gl
  16380. gh = fh
  16381. gl = fl
  16382. fh = eh
  16383. fl = el
  16384. el = (dl + t1l) | 0
  16385. eh = (dh + t1h + getCarry(el, dl)) | 0
  16386. dh = ch
  16387. dl = cl
  16388. ch = bh
  16389. cl = bl
  16390. bh = ah
  16391. bl = al
  16392. al = (t1l + t2l) | 0
  16393. ah = (t1h + t2h + getCarry(al, t1l)) | 0
  16394. }
  16395. this._al = (this._al + al) | 0
  16396. this._bl = (this._bl + bl) | 0
  16397. this._cl = (this._cl + cl) | 0
  16398. this._dl = (this._dl + dl) | 0
  16399. this._el = (this._el + el) | 0
  16400. this._fl = (this._fl + fl) | 0
  16401. this._gl = (this._gl + gl) | 0
  16402. this._hl = (this._hl + hl) | 0
  16403. this._ah = (this._ah + ah + getCarry(this._al, al)) | 0
  16404. this._bh = (this._bh + bh + getCarry(this._bl, bl)) | 0
  16405. this._ch = (this._ch + ch + getCarry(this._cl, cl)) | 0
  16406. this._dh = (this._dh + dh + getCarry(this._dl, dl)) | 0
  16407. this._eh = (this._eh + eh + getCarry(this._el, el)) | 0
  16408. this._fh = (this._fh + fh + getCarry(this._fl, fl)) | 0
  16409. this._gh = (this._gh + gh + getCarry(this._gl, gl)) | 0
  16410. this._hh = (this._hh + hh + getCarry(this._hl, hl)) | 0
  16411. }
  16412. Sha512.prototype._hash = function () {
  16413. var H = Buffer.allocUnsafe(64)
  16414. function writeInt64BE (h, l, offset) {
  16415. H.writeInt32BE(h, offset)
  16416. H.writeInt32BE(l, offset + 4)
  16417. }
  16418. writeInt64BE(this._ah, this._al, 0)
  16419. writeInt64BE(this._bh, this._bl, 8)
  16420. writeInt64BE(this._ch, this._cl, 16)
  16421. writeInt64BE(this._dh, this._dl, 24)
  16422. writeInt64BE(this._eh, this._el, 32)
  16423. writeInt64BE(this._fh, this._fl, 40)
  16424. writeInt64BE(this._gh, this._gl, 48)
  16425. writeInt64BE(this._hh, this._hl, 56)
  16426. return H
  16427. }
  16428. module.exports = Sha512
  16429. /***/ }),
  16430. /* 115 */
  16431. /*!*******************************************!*\
  16432. !*** ./node_modules/cipher-base/index.js ***!
  16433. \*******************************************/
  16434. /*! no static exports found */
  16435. /***/ (function(module, exports, __webpack_require__) {
  16436. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  16437. var Transform = __webpack_require__(/*! stream */ 116).Transform
  16438. var StringDecoder = __webpack_require__(/*! string_decoder */ 103).StringDecoder
  16439. var inherits = __webpack_require__(/*! inherits */ 87)
  16440. function CipherBase (hashMode) {
  16441. Transform.call(this)
  16442. this.hashMode = typeof hashMode === 'string'
  16443. if (this.hashMode) {
  16444. this[hashMode] = this._finalOrDigest
  16445. } else {
  16446. this.final = this._finalOrDigest
  16447. }
  16448. if (this._final) {
  16449. this.__final = this._final
  16450. this._final = null
  16451. }
  16452. this._decoder = null
  16453. this._encoding = null
  16454. }
  16455. inherits(CipherBase, Transform)
  16456. CipherBase.prototype.update = function (data, inputEnc, outputEnc) {
  16457. if (typeof data === 'string') {
  16458. data = Buffer.from(data, inputEnc)
  16459. }
  16460. var outData = this._update(data)
  16461. if (this.hashMode) return this
  16462. if (outputEnc) {
  16463. outData = this._toString(outData, outputEnc)
  16464. }
  16465. return outData
  16466. }
  16467. CipherBase.prototype.setAutoPadding = function () {}
  16468. CipherBase.prototype.getAuthTag = function () {
  16469. throw new Error('trying to get auth tag in unsupported state')
  16470. }
  16471. CipherBase.prototype.setAuthTag = function () {
  16472. throw new Error('trying to set auth tag in unsupported state')
  16473. }
  16474. CipherBase.prototype.setAAD = function () {
  16475. throw new Error('trying to set aad in unsupported state')
  16476. }
  16477. CipherBase.prototype._transform = function (data, _, next) {
  16478. var err
  16479. try {
  16480. if (this.hashMode) {
  16481. this._update(data)
  16482. } else {
  16483. this.push(this._update(data))
  16484. }
  16485. } catch (e) {
  16486. err = e
  16487. } finally {
  16488. next(err)
  16489. }
  16490. }
  16491. CipherBase.prototype._flush = function (done) {
  16492. var err
  16493. try {
  16494. this.push(this.__final())
  16495. } catch (e) {
  16496. err = e
  16497. }
  16498. done(err)
  16499. }
  16500. CipherBase.prototype._finalOrDigest = function (outputEnc) {
  16501. var outData = this.__final() || Buffer.alloc(0)
  16502. if (outputEnc) {
  16503. outData = this._toString(outData, outputEnc, true)
  16504. }
  16505. return outData
  16506. }
  16507. CipherBase.prototype._toString = function (value, enc, fin) {
  16508. if (!this._decoder) {
  16509. this._decoder = new StringDecoder(enc)
  16510. this._encoding = enc
  16511. }
  16512. if (this._encoding !== enc) throw new Error('can\'t switch encodings')
  16513. var out = this._decoder.write(value)
  16514. if (fin) {
  16515. out += this._decoder.end()
  16516. }
  16517. return out
  16518. }
  16519. module.exports = CipherBase
  16520. /***/ }),
  16521. /* 116 */
  16522. /*!*************************************************!*\
  16523. !*** ./node_modules/stream-browserify/index.js ***!
  16524. \*************************************************/
  16525. /*! no static exports found */
  16526. /***/ (function(module, exports, __webpack_require__) {
  16527. // Copyright Joyent, Inc. and other Node contributors.
  16528. //
  16529. // Permission is hereby granted, free of charge, to any person obtaining a
  16530. // copy of this software and associated documentation files (the
  16531. // "Software"), to deal in the Software without restriction, including
  16532. // without limitation the rights to use, copy, modify, merge, publish,
  16533. // distribute, sublicense, and/or sell copies of the Software, and to permit
  16534. // persons to whom the Software is furnished to do so, subject to the
  16535. // following conditions:
  16536. //
  16537. // The above copyright notice and this permission notice shall be included
  16538. // in all copies or substantial portions of the Software.
  16539. //
  16540. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  16541. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  16542. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  16543. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  16544. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  16545. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  16546. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  16547. module.exports = Stream;
  16548. var EE = __webpack_require__(/*! events */ 93).EventEmitter;
  16549. var inherits = __webpack_require__(/*! inherits */ 87);
  16550. inherits(Stream, EE);
  16551. Stream.Readable = __webpack_require__(/*! readable-stream/readable.js */ 90);
  16552. Stream.Writable = __webpack_require__(/*! readable-stream/writable.js */ 117);
  16553. Stream.Duplex = __webpack_require__(/*! readable-stream/duplex.js */ 118);
  16554. Stream.Transform = __webpack_require__(/*! readable-stream/transform.js */ 119);
  16555. Stream.PassThrough = __webpack_require__(/*! readable-stream/passthrough.js */ 120);
  16556. // Backwards-compat with node 0.4.x
  16557. Stream.Stream = Stream;
  16558. // old-style streams. Note that the pipe method (the only relevant
  16559. // part of this class) is overridden in the Readable class.
  16560. function Stream() {
  16561. EE.call(this);
  16562. }
  16563. Stream.prototype.pipe = function(dest, options) {
  16564. var source = this;
  16565. function ondata(chunk) {
  16566. if (dest.writable) {
  16567. if (false === dest.write(chunk) && source.pause) {
  16568. source.pause();
  16569. }
  16570. }
  16571. }
  16572. source.on('data', ondata);
  16573. function ondrain() {
  16574. if (source.readable && source.resume) {
  16575. source.resume();
  16576. }
  16577. }
  16578. dest.on('drain', ondrain);
  16579. // If the 'end' option is not supplied, dest.end() will be called when
  16580. // source gets the 'end' or 'close' events. Only dest.end() once.
  16581. if (!dest._isStdio && (!options || options.end !== false)) {
  16582. source.on('end', onend);
  16583. source.on('close', onclose);
  16584. }
  16585. var didOnEnd = false;
  16586. function onend() {
  16587. if (didOnEnd) return;
  16588. didOnEnd = true;
  16589. dest.end();
  16590. }
  16591. function onclose() {
  16592. if (didOnEnd) return;
  16593. didOnEnd = true;
  16594. if (typeof dest.destroy === 'function') dest.destroy();
  16595. }
  16596. // don't leave dangling pipes when there are errors.
  16597. function onerror(er) {
  16598. cleanup();
  16599. if (EE.listenerCount(this, 'error') === 0) {
  16600. throw er; // Unhandled stream error in pipe.
  16601. }
  16602. }
  16603. source.on('error', onerror);
  16604. dest.on('error', onerror);
  16605. // remove all the event listeners that were added.
  16606. function cleanup() {
  16607. source.removeListener('data', ondata);
  16608. dest.removeListener('drain', ondrain);
  16609. source.removeListener('end', onend);
  16610. source.removeListener('close', onclose);
  16611. source.removeListener('error', onerror);
  16612. dest.removeListener('error', onerror);
  16613. source.removeListener('end', cleanup);
  16614. source.removeListener('close', cleanup);
  16615. dest.removeListener('close', cleanup);
  16616. }
  16617. source.on('end', cleanup);
  16618. source.on('close', cleanup);
  16619. dest.on('close', cleanup);
  16620. dest.emit('pipe', source);
  16621. // Allow for unix-like usage: A.pipe(B).pipe(C)
  16622. return dest;
  16623. };
  16624. /***/ }),
  16625. /* 117 */
  16626. /*!**********************************************************!*\
  16627. !*** ./node_modules/readable-stream/writable-browser.js ***!
  16628. \**********************************************************/
  16629. /*! no static exports found */
  16630. /***/ (function(module, exports, __webpack_require__) {
  16631. module.exports = __webpack_require__(/*! ./lib/_stream_writable.js */ 101);
  16632. /***/ }),
  16633. /* 118 */
  16634. /*!********************************************************!*\
  16635. !*** ./node_modules/readable-stream/duplex-browser.js ***!
  16636. \********************************************************/
  16637. /*! no static exports found */
  16638. /***/ (function(module, exports, __webpack_require__) {
  16639. module.exports = __webpack_require__(/*! ./lib/_stream_duplex.js */ 100);
  16640. /***/ }),
  16641. /* 119 */
  16642. /*!***************************************************!*\
  16643. !*** ./node_modules/readable-stream/transform.js ***!
  16644. \***************************************************/
  16645. /*! no static exports found */
  16646. /***/ (function(module, exports, __webpack_require__) {
  16647. module.exports = __webpack_require__(/*! ./readable */ 90).Transform
  16648. /***/ }),
  16649. /* 120 */
  16650. /*!*****************************************************!*\
  16651. !*** ./node_modules/readable-stream/passthrough.js ***!
  16652. \*****************************************************/
  16653. /*! no static exports found */
  16654. /***/ (function(module, exports, __webpack_require__) {
  16655. module.exports = __webpack_require__(/*! ./readable */ 90).PassThrough
  16656. /***/ }),
  16657. /* 121 */
  16658. /*!*********************************************!*\
  16659. !*** ./node_modules/create-hmac/browser.js ***!
  16660. \*********************************************/
  16661. /*! no static exports found */
  16662. /***/ (function(module, exports, __webpack_require__) {
  16663. "use strict";
  16664. var inherits = __webpack_require__(/*! inherits */ 87)
  16665. var Legacy = __webpack_require__(/*! ./legacy */ 122)
  16666. var Base = __webpack_require__(/*! cipher-base */ 115)
  16667. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  16668. var md5 = __webpack_require__(/*! create-hash/md5 */ 123)
  16669. var RIPEMD160 = __webpack_require__(/*! ripemd160 */ 106)
  16670. var sha = __webpack_require__(/*! sha.js */ 107)
  16671. var ZEROS = Buffer.alloc(128)
  16672. function Hmac (alg, key) {
  16673. Base.call(this, 'digest')
  16674. if (typeof key === 'string') {
  16675. key = Buffer.from(key)
  16676. }
  16677. var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64
  16678. this._alg = alg
  16679. this._key = key
  16680. if (key.length > blocksize) {
  16681. var hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg)
  16682. key = hash.update(key).digest()
  16683. } else if (key.length < blocksize) {
  16684. key = Buffer.concat([key, ZEROS], blocksize)
  16685. }
  16686. var ipad = this._ipad = Buffer.allocUnsafe(blocksize)
  16687. var opad = this._opad = Buffer.allocUnsafe(blocksize)
  16688. for (var i = 0; i < blocksize; i++) {
  16689. ipad[i] = key[i] ^ 0x36
  16690. opad[i] = key[i] ^ 0x5C
  16691. }
  16692. this._hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg)
  16693. this._hash.update(ipad)
  16694. }
  16695. inherits(Hmac, Base)
  16696. Hmac.prototype._update = function (data) {
  16697. this._hash.update(data)
  16698. }
  16699. Hmac.prototype._final = function () {
  16700. var h = this._hash.digest()
  16701. var hash = this._alg === 'rmd160' ? new RIPEMD160() : sha(this._alg)
  16702. return hash.update(this._opad).update(h).digest()
  16703. }
  16704. module.exports = function createHmac (alg, key) {
  16705. alg = alg.toLowerCase()
  16706. if (alg === 'rmd160' || alg === 'ripemd160') {
  16707. return new Hmac('rmd160', key)
  16708. }
  16709. if (alg === 'md5') {
  16710. return new Legacy(md5, key)
  16711. }
  16712. return new Hmac(alg, key)
  16713. }
  16714. /***/ }),
  16715. /* 122 */
  16716. /*!********************************************!*\
  16717. !*** ./node_modules/create-hmac/legacy.js ***!
  16718. \********************************************/
  16719. /*! no static exports found */
  16720. /***/ (function(module, exports, __webpack_require__) {
  16721. "use strict";
  16722. var inherits = __webpack_require__(/*! inherits */ 87)
  16723. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  16724. var Base = __webpack_require__(/*! cipher-base */ 115)
  16725. var ZEROS = Buffer.alloc(128)
  16726. var blocksize = 64
  16727. function Hmac (alg, key) {
  16728. Base.call(this, 'digest')
  16729. if (typeof key === 'string') {
  16730. key = Buffer.from(key)
  16731. }
  16732. this._alg = alg
  16733. this._key = key
  16734. if (key.length > blocksize) {
  16735. key = alg(key)
  16736. } else if (key.length < blocksize) {
  16737. key = Buffer.concat([key, ZEROS], blocksize)
  16738. }
  16739. var ipad = this._ipad = Buffer.allocUnsafe(blocksize)
  16740. var opad = this._opad = Buffer.allocUnsafe(blocksize)
  16741. for (var i = 0; i < blocksize; i++) {
  16742. ipad[i] = key[i] ^ 0x36
  16743. opad[i] = key[i] ^ 0x5C
  16744. }
  16745. this._hash = [ipad]
  16746. }
  16747. inherits(Hmac, Base)
  16748. Hmac.prototype._update = function (data) {
  16749. this._hash.push(data)
  16750. }
  16751. Hmac.prototype._final = function () {
  16752. var h = this._alg(Buffer.concat(this._hash))
  16753. return this._alg(Buffer.concat([this._opad, h]))
  16754. }
  16755. module.exports = Hmac
  16756. /***/ }),
  16757. /* 123 */
  16758. /*!*****************************************!*\
  16759. !*** ./node_modules/create-hash/md5.js ***!
  16760. \*****************************************/
  16761. /*! no static exports found */
  16762. /***/ (function(module, exports, __webpack_require__) {
  16763. var MD5 = __webpack_require__(/*! md5.js */ 88)
  16764. module.exports = function (buffer) {
  16765. return new MD5().update(buffer).digest()
  16766. }
  16767. /***/ }),
  16768. /* 124 */
  16769. /*!***********************************************!*\
  16770. !*** ./node_modules/browserify-sign/algos.js ***!
  16771. \***********************************************/
  16772. /*! no static exports found */
  16773. /***/ (function(module, exports, __webpack_require__) {
  16774. module.exports = __webpack_require__(/*! ./browser/algorithms.json */ 125)
  16775. /***/ }),
  16776. /* 125 */
  16777. /*!**************************************************************!*\
  16778. !*** ./node_modules/browserify-sign/browser/algorithms.json ***!
  16779. \**************************************************************/
  16780. /*! 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 */
  16781. /***/ (function(module) {
  16782. 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\"}}");
  16783. /***/ }),
  16784. /* 126 */
  16785. /*!****************************************!*\
  16786. !*** ./node_modules/pbkdf2/browser.js ***!
  16787. \****************************************/
  16788. /*! no static exports found */
  16789. /***/ (function(module, exports, __webpack_require__) {
  16790. exports.pbkdf2 = __webpack_require__(/*! ./lib/async */ 127)
  16791. exports.pbkdf2Sync = __webpack_require__(/*! ./lib/sync */ 130)
  16792. /***/ }),
  16793. /* 127 */
  16794. /*!******************************************!*\
  16795. !*** ./node_modules/pbkdf2/lib/async.js ***!
  16796. \******************************************/
  16797. /*! no static exports found */
  16798. /***/ (function(module, exports, __webpack_require__) {
  16799. /* WEBPACK VAR INJECTION */(function(global, process) {var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  16800. var checkParameters = __webpack_require__(/*! ./precondition */ 128)
  16801. var defaultEncoding = __webpack_require__(/*! ./default-encoding */ 129)
  16802. var sync = __webpack_require__(/*! ./sync */ 130)
  16803. var toBuffer = __webpack_require__(/*! ./to-buffer */ 131)
  16804. var ZERO_BUF
  16805. var subtle = global.crypto && global.crypto.subtle
  16806. var toBrowser = {
  16807. sha: 'SHA-1',
  16808. 'sha-1': 'SHA-1',
  16809. sha1: 'SHA-1',
  16810. sha256: 'SHA-256',
  16811. 'sha-256': 'SHA-256',
  16812. sha384: 'SHA-384',
  16813. 'sha-384': 'SHA-384',
  16814. 'sha-512': 'SHA-512',
  16815. sha512: 'SHA-512'
  16816. }
  16817. var checks = []
  16818. function checkNative (algo) {
  16819. if (global.process && !global.process.browser) {
  16820. return Promise.resolve(false)
  16821. }
  16822. if (!subtle || !subtle.importKey || !subtle.deriveBits) {
  16823. return Promise.resolve(false)
  16824. }
  16825. if (checks[algo] !== undefined) {
  16826. return checks[algo]
  16827. }
  16828. ZERO_BUF = ZERO_BUF || Buffer.alloc(8)
  16829. var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo)
  16830. .then(function () {
  16831. return true
  16832. }).catch(function () {
  16833. return false
  16834. })
  16835. checks[algo] = prom
  16836. return prom
  16837. }
  16838. function browserPbkdf2 (password, salt, iterations, length, algo) {
  16839. return subtle.importKey(
  16840. 'raw', password, { name: 'PBKDF2' }, false, ['deriveBits']
  16841. ).then(function (key) {
  16842. return subtle.deriveBits({
  16843. name: 'PBKDF2',
  16844. salt: salt,
  16845. iterations: iterations,
  16846. hash: {
  16847. name: algo
  16848. }
  16849. }, key, length << 3)
  16850. }).then(function (res) {
  16851. return Buffer.from(res)
  16852. })
  16853. }
  16854. function resolvePromise (promise, callback) {
  16855. promise.then(function (out) {
  16856. process.nextTick(function () {
  16857. callback(null, out)
  16858. })
  16859. }, function (e) {
  16860. process.nextTick(function () {
  16861. callback(e)
  16862. })
  16863. })
  16864. }
  16865. module.exports = function (password, salt, iterations, keylen, digest, callback) {
  16866. if (typeof digest === 'function') {
  16867. callback = digest
  16868. digest = undefined
  16869. }
  16870. digest = digest || 'sha1'
  16871. var algo = toBrowser[digest.toLowerCase()]
  16872. if (!algo || typeof global.Promise !== 'function') {
  16873. return process.nextTick(function () {
  16874. var out
  16875. try {
  16876. out = sync(password, salt, iterations, keylen, digest)
  16877. } catch (e) {
  16878. return callback(e)
  16879. }
  16880. callback(null, out)
  16881. })
  16882. }
  16883. checkParameters(iterations, keylen)
  16884. password = toBuffer(password, defaultEncoding, 'Password')
  16885. salt = toBuffer(salt, defaultEncoding, 'Salt')
  16886. if (typeof callback !== 'function') throw new Error('No callback provided to pbkdf2')
  16887. resolvePromise(checkNative(algo).then(function (resp) {
  16888. if (resp) return browserPbkdf2(password, salt, iterations, keylen, algo)
  16889. return sync(password, salt, iterations, keylen, digest)
  16890. }), callback)
  16891. }
  16892. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ 2), __webpack_require__(/*! ./../../node-libs-browser/mock/process.js */ 79)))
  16893. /***/ }),
  16894. /* 128 */
  16895. /*!*************************************************!*\
  16896. !*** ./node_modules/pbkdf2/lib/precondition.js ***!
  16897. \*************************************************/
  16898. /*! no static exports found */
  16899. /***/ (function(module, exports) {
  16900. var MAX_ALLOC = Math.pow(2, 30) - 1 // default in iojs
  16901. module.exports = function (iterations, keylen) {
  16902. if (typeof iterations !== 'number') {
  16903. throw new TypeError('Iterations not a number')
  16904. }
  16905. if (iterations < 0) {
  16906. throw new TypeError('Bad iterations')
  16907. }
  16908. if (typeof keylen !== 'number') {
  16909. throw new TypeError('Key length not a number')
  16910. }
  16911. if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen) { /* eslint no-self-compare: 0 */
  16912. throw new TypeError('Bad key length')
  16913. }
  16914. }
  16915. /***/ }),
  16916. /* 129 */
  16917. /*!*****************************************************!*\
  16918. !*** ./node_modules/pbkdf2/lib/default-encoding.js ***!
  16919. \*****************************************************/
  16920. /*! no static exports found */
  16921. /***/ (function(module, exports, __webpack_require__) {
  16922. /* WEBPACK VAR INJECTION */(function(process) {var defaultEncoding
  16923. /* istanbul ignore next */
  16924. if (process.browser) {
  16925. defaultEncoding = 'utf-8'
  16926. } else if (process.version) {
  16927. var pVersionMajor = parseInt(process.version.split('.')[0].slice(1), 10)
  16928. defaultEncoding = pVersionMajor >= 6 ? 'utf-8' : 'binary'
  16929. } else {
  16930. defaultEncoding = 'utf-8'
  16931. }
  16932. module.exports = defaultEncoding
  16933. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/mock/process.js */ 79)))
  16934. /***/ }),
  16935. /* 130 */
  16936. /*!*************************************************!*\
  16937. !*** ./node_modules/pbkdf2/lib/sync-browser.js ***!
  16938. \*************************************************/
  16939. /*! no static exports found */
  16940. /***/ (function(module, exports, __webpack_require__) {
  16941. var md5 = __webpack_require__(/*! create-hash/md5 */ 123)
  16942. var RIPEMD160 = __webpack_require__(/*! ripemd160 */ 106)
  16943. var sha = __webpack_require__(/*! sha.js */ 107)
  16944. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  16945. var checkParameters = __webpack_require__(/*! ./precondition */ 128)
  16946. var defaultEncoding = __webpack_require__(/*! ./default-encoding */ 129)
  16947. var toBuffer = __webpack_require__(/*! ./to-buffer */ 131)
  16948. var ZEROS = Buffer.alloc(128)
  16949. var sizes = {
  16950. md5: 16,
  16951. sha1: 20,
  16952. sha224: 28,
  16953. sha256: 32,
  16954. sha384: 48,
  16955. sha512: 64,
  16956. rmd160: 20,
  16957. ripemd160: 20
  16958. }
  16959. function Hmac (alg, key, saltLen) {
  16960. var hash = getDigest(alg)
  16961. var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64
  16962. if (key.length > blocksize) {
  16963. key = hash(key)
  16964. } else if (key.length < blocksize) {
  16965. key = Buffer.concat([key, ZEROS], blocksize)
  16966. }
  16967. var ipad = Buffer.allocUnsafe(blocksize + sizes[alg])
  16968. var opad = Buffer.allocUnsafe(blocksize + sizes[alg])
  16969. for (var i = 0; i < blocksize; i++) {
  16970. ipad[i] = key[i] ^ 0x36
  16971. opad[i] = key[i] ^ 0x5C
  16972. }
  16973. var ipad1 = Buffer.allocUnsafe(blocksize + saltLen + 4)
  16974. ipad.copy(ipad1, 0, 0, blocksize)
  16975. this.ipad1 = ipad1
  16976. this.ipad2 = ipad
  16977. this.opad = opad
  16978. this.alg = alg
  16979. this.blocksize = blocksize
  16980. this.hash = hash
  16981. this.size = sizes[alg]
  16982. }
  16983. Hmac.prototype.run = function (data, ipad) {
  16984. data.copy(ipad, this.blocksize)
  16985. var h = this.hash(ipad)
  16986. h.copy(this.opad, this.blocksize)
  16987. return this.hash(this.opad)
  16988. }
  16989. function getDigest (alg) {
  16990. function shaFunc (data) {
  16991. return sha(alg).update(data).digest()
  16992. }
  16993. function rmd160Func (data) {
  16994. return new RIPEMD160().update(data).digest()
  16995. }
  16996. if (alg === 'rmd160' || alg === 'ripemd160') return rmd160Func
  16997. if (alg === 'md5') return md5
  16998. return shaFunc
  16999. }
  17000. function pbkdf2 (password, salt, iterations, keylen, digest) {
  17001. checkParameters(iterations, keylen)
  17002. password = toBuffer(password, defaultEncoding, 'Password')
  17003. salt = toBuffer(salt, defaultEncoding, 'Salt')
  17004. digest = digest || 'sha1'
  17005. var hmac = new Hmac(digest, password, salt.length)
  17006. var DK = Buffer.allocUnsafe(keylen)
  17007. var block1 = Buffer.allocUnsafe(salt.length + 4)
  17008. salt.copy(block1, 0, 0, salt.length)
  17009. var destPos = 0
  17010. var hLen = sizes[digest]
  17011. var l = Math.ceil(keylen / hLen)
  17012. for (var i = 1; i <= l; i++) {
  17013. block1.writeUInt32BE(i, salt.length)
  17014. var T = hmac.run(block1, hmac.ipad1)
  17015. var U = T
  17016. for (var j = 1; j < iterations; j++) {
  17017. U = hmac.run(U, hmac.ipad2)
  17018. for (var k = 0; k < hLen; k++) T[k] ^= U[k]
  17019. }
  17020. T.copy(DK, destPos)
  17021. destPos += hLen
  17022. }
  17023. return DK
  17024. }
  17025. module.exports = pbkdf2
  17026. /***/ }),
  17027. /* 131 */
  17028. /*!**********************************************!*\
  17029. !*** ./node_modules/pbkdf2/lib/to-buffer.js ***!
  17030. \**********************************************/
  17031. /*! no static exports found */
  17032. /***/ (function(module, exports, __webpack_require__) {
  17033. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  17034. module.exports = function (thing, encoding, name) {
  17035. if (Buffer.isBuffer(thing)) {
  17036. return thing
  17037. } else if (typeof thing === 'string') {
  17038. return Buffer.from(thing, encoding)
  17039. } else if (ArrayBuffer.isView(thing)) {
  17040. return Buffer.from(thing.buffer)
  17041. } else {
  17042. throw new TypeError(name + ' must be a string, a Buffer, a typed array or a DataView')
  17043. }
  17044. }
  17045. /***/ }),
  17046. /* 132 */
  17047. /*!***************************************************!*\
  17048. !*** ./node_modules/browserify-cipher/browser.js ***!
  17049. \***************************************************/
  17050. /*! no static exports found */
  17051. /***/ (function(module, exports, __webpack_require__) {
  17052. var DES = __webpack_require__(/*! browserify-des */ 133)
  17053. var aes = __webpack_require__(/*! browserify-aes/browser */ 141)
  17054. var aesModes = __webpack_require__(/*! browserify-aes/modes */ 143)
  17055. var desModes = __webpack_require__(/*! browserify-des/modes */ 160)
  17056. var ebtk = __webpack_require__(/*! evp_bytestokey */ 158)
  17057. function createCipher (suite, password) {
  17058. suite = suite.toLowerCase()
  17059. var keyLen, ivLen
  17060. if (aesModes[suite]) {
  17061. keyLen = aesModes[suite].key
  17062. ivLen = aesModes[suite].iv
  17063. } else if (desModes[suite]) {
  17064. keyLen = desModes[suite].key * 8
  17065. ivLen = desModes[suite].iv
  17066. } else {
  17067. throw new TypeError('invalid suite type')
  17068. }
  17069. var keys = ebtk(password, false, keyLen, ivLen)
  17070. return createCipheriv(suite, keys.key, keys.iv)
  17071. }
  17072. function createDecipher (suite, password) {
  17073. suite = suite.toLowerCase()
  17074. var keyLen, ivLen
  17075. if (aesModes[suite]) {
  17076. keyLen = aesModes[suite].key
  17077. ivLen = aesModes[suite].iv
  17078. } else if (desModes[suite]) {
  17079. keyLen = desModes[suite].key * 8
  17080. ivLen = desModes[suite].iv
  17081. } else {
  17082. throw new TypeError('invalid suite type')
  17083. }
  17084. var keys = ebtk(password, false, keyLen, ivLen)
  17085. return createDecipheriv(suite, keys.key, keys.iv)
  17086. }
  17087. function createCipheriv (suite, key, iv) {
  17088. suite = suite.toLowerCase()
  17089. if (aesModes[suite]) return aes.createCipheriv(suite, key, iv)
  17090. if (desModes[suite]) return new DES({ key: key, iv: iv, mode: suite })
  17091. throw new TypeError('invalid suite type')
  17092. }
  17093. function createDecipheriv (suite, key, iv) {
  17094. suite = suite.toLowerCase()
  17095. if (aesModes[suite]) return aes.createDecipheriv(suite, key, iv)
  17096. if (desModes[suite]) return new DES({ key: key, iv: iv, mode: suite, decrypt: true })
  17097. throw new TypeError('invalid suite type')
  17098. }
  17099. function getCiphers () {
  17100. return Object.keys(desModes).concat(aes.getCiphers())
  17101. }
  17102. exports.createCipher = exports.Cipher = createCipher
  17103. exports.createCipheriv = exports.Cipheriv = createCipheriv
  17104. exports.createDecipher = exports.Decipher = createDecipher
  17105. exports.createDecipheriv = exports.Decipheriv = createDecipheriv
  17106. exports.listCiphers = exports.getCiphers = getCiphers
  17107. /***/ }),
  17108. /* 133 */
  17109. /*!**********************************************!*\
  17110. !*** ./node_modules/browserify-des/index.js ***!
  17111. \**********************************************/
  17112. /*! no static exports found */
  17113. /***/ (function(module, exports, __webpack_require__) {
  17114. var CipherBase = __webpack_require__(/*! cipher-base */ 115)
  17115. var des = __webpack_require__(/*! des.js */ 134)
  17116. var inherits = __webpack_require__(/*! inherits */ 87)
  17117. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  17118. var modes = {
  17119. 'des-ede3-cbc': des.CBC.instantiate(des.EDE),
  17120. 'des-ede3': des.EDE,
  17121. 'des-ede-cbc': des.CBC.instantiate(des.EDE),
  17122. 'des-ede': des.EDE,
  17123. 'des-cbc': des.CBC.instantiate(des.DES),
  17124. 'des-ecb': des.DES
  17125. }
  17126. modes.des = modes['des-cbc']
  17127. modes.des3 = modes['des-ede3-cbc']
  17128. module.exports = DES
  17129. inherits(DES, CipherBase)
  17130. function DES (opts) {
  17131. CipherBase.call(this)
  17132. var modeName = opts.mode.toLowerCase()
  17133. var mode = modes[modeName]
  17134. var type
  17135. if (opts.decrypt) {
  17136. type = 'decrypt'
  17137. } else {
  17138. type = 'encrypt'
  17139. }
  17140. var key = opts.key
  17141. if (!Buffer.isBuffer(key)) {
  17142. key = Buffer.from(key)
  17143. }
  17144. if (modeName === 'des-ede' || modeName === 'des-ede-cbc') {
  17145. key = Buffer.concat([key, key.slice(0, 8)])
  17146. }
  17147. var iv = opts.iv
  17148. if (!Buffer.isBuffer(iv)) {
  17149. iv = Buffer.from(iv)
  17150. }
  17151. this._des = mode.create({
  17152. key: key,
  17153. iv: iv,
  17154. type: type
  17155. })
  17156. }
  17157. DES.prototype._update = function (data) {
  17158. return Buffer.from(this._des.update(data))
  17159. }
  17160. DES.prototype._final = function () {
  17161. return Buffer.from(this._des.final())
  17162. }
  17163. /***/ }),
  17164. /* 134 */
  17165. /*!****************************************!*\
  17166. !*** ./node_modules/des.js/lib/des.js ***!
  17167. \****************************************/
  17168. /*! no static exports found */
  17169. /***/ (function(module, exports, __webpack_require__) {
  17170. "use strict";
  17171. exports.utils = __webpack_require__(/*! ./des/utils */ 135);
  17172. exports.Cipher = __webpack_require__(/*! ./des/cipher */ 136);
  17173. exports.DES = __webpack_require__(/*! ./des/des */ 138);
  17174. exports.CBC = __webpack_require__(/*! ./des/cbc */ 139);
  17175. exports.EDE = __webpack_require__(/*! ./des/ede */ 140);
  17176. /***/ }),
  17177. /* 135 */
  17178. /*!**********************************************!*\
  17179. !*** ./node_modules/des.js/lib/des/utils.js ***!
  17180. \**********************************************/
  17181. /*! no static exports found */
  17182. /***/ (function(module, exports, __webpack_require__) {
  17183. "use strict";
  17184. exports.readUInt32BE = function readUInt32BE(bytes, off) {
  17185. var res = (bytes[0 + off] << 24) |
  17186. (bytes[1 + off] << 16) |
  17187. (bytes[2 + off] << 8) |
  17188. bytes[3 + off];
  17189. return res >>> 0;
  17190. };
  17191. exports.writeUInt32BE = function writeUInt32BE(bytes, value, off) {
  17192. bytes[0 + off] = value >>> 24;
  17193. bytes[1 + off] = (value >>> 16) & 0xff;
  17194. bytes[2 + off] = (value >>> 8) & 0xff;
  17195. bytes[3 + off] = value & 0xff;
  17196. };
  17197. exports.ip = function ip(inL, inR, out, off) {
  17198. var outL = 0;
  17199. var outR = 0;
  17200. for (var i = 6; i >= 0; i -= 2) {
  17201. for (var j = 0; j <= 24; j += 8) {
  17202. outL <<= 1;
  17203. outL |= (inR >>> (j + i)) & 1;
  17204. }
  17205. for (var j = 0; j <= 24; j += 8) {
  17206. outL <<= 1;
  17207. outL |= (inL >>> (j + i)) & 1;
  17208. }
  17209. }
  17210. for (var i = 6; i >= 0; i -= 2) {
  17211. for (var j = 1; j <= 25; j += 8) {
  17212. outR <<= 1;
  17213. outR |= (inR >>> (j + i)) & 1;
  17214. }
  17215. for (var j = 1; j <= 25; j += 8) {
  17216. outR <<= 1;
  17217. outR |= (inL >>> (j + i)) & 1;
  17218. }
  17219. }
  17220. out[off + 0] = outL >>> 0;
  17221. out[off + 1] = outR >>> 0;
  17222. };
  17223. exports.rip = function rip(inL, inR, out, off) {
  17224. var outL = 0;
  17225. var outR = 0;
  17226. for (var i = 0; i < 4; i++) {
  17227. for (var j = 24; j >= 0; j -= 8) {
  17228. outL <<= 1;
  17229. outL |= (inR >>> (j + i)) & 1;
  17230. outL <<= 1;
  17231. outL |= (inL >>> (j + i)) & 1;
  17232. }
  17233. }
  17234. for (var i = 4; i < 8; i++) {
  17235. for (var j = 24; j >= 0; j -= 8) {
  17236. outR <<= 1;
  17237. outR |= (inR >>> (j + i)) & 1;
  17238. outR <<= 1;
  17239. outR |= (inL >>> (j + i)) & 1;
  17240. }
  17241. }
  17242. out[off + 0] = outL >>> 0;
  17243. out[off + 1] = outR >>> 0;
  17244. };
  17245. exports.pc1 = function pc1(inL, inR, out, off) {
  17246. var outL = 0;
  17247. var outR = 0;
  17248. // 7, 15, 23, 31, 39, 47, 55, 63
  17249. // 6, 14, 22, 30, 39, 47, 55, 63
  17250. // 5, 13, 21, 29, 39, 47, 55, 63
  17251. // 4, 12, 20, 28
  17252. for (var i = 7; i >= 5; i--) {
  17253. for (var j = 0; j <= 24; j += 8) {
  17254. outL <<= 1;
  17255. outL |= (inR >> (j + i)) & 1;
  17256. }
  17257. for (var j = 0; j <= 24; j += 8) {
  17258. outL <<= 1;
  17259. outL |= (inL >> (j + i)) & 1;
  17260. }
  17261. }
  17262. for (var j = 0; j <= 24; j += 8) {
  17263. outL <<= 1;
  17264. outL |= (inR >> (j + i)) & 1;
  17265. }
  17266. // 1, 9, 17, 25, 33, 41, 49, 57
  17267. // 2, 10, 18, 26, 34, 42, 50, 58
  17268. // 3, 11, 19, 27, 35, 43, 51, 59
  17269. // 36, 44, 52, 60
  17270. for (var i = 1; i <= 3; i++) {
  17271. for (var j = 0; j <= 24; j += 8) {
  17272. outR <<= 1;
  17273. outR |= (inR >> (j + i)) & 1;
  17274. }
  17275. for (var j = 0; j <= 24; j += 8) {
  17276. outR <<= 1;
  17277. outR |= (inL >> (j + i)) & 1;
  17278. }
  17279. }
  17280. for (var j = 0; j <= 24; j += 8) {
  17281. outR <<= 1;
  17282. outR |= (inL >> (j + i)) & 1;
  17283. }
  17284. out[off + 0] = outL >>> 0;
  17285. out[off + 1] = outR >>> 0;
  17286. };
  17287. exports.r28shl = function r28shl(num, shift) {
  17288. return ((num << shift) & 0xfffffff) | (num >>> (28 - shift));
  17289. };
  17290. var pc2table = [
  17291. // inL => outL
  17292. 14, 11, 17, 4, 27, 23, 25, 0,
  17293. 13, 22, 7, 18, 5, 9, 16, 24,
  17294. 2, 20, 12, 21, 1, 8, 15, 26,
  17295. // inR => outR
  17296. 15, 4, 25, 19, 9, 1, 26, 16,
  17297. 5, 11, 23, 8, 12, 7, 17, 0,
  17298. 22, 3, 10, 14, 6, 20, 27, 24
  17299. ];
  17300. exports.pc2 = function pc2(inL, inR, out, off) {
  17301. var outL = 0;
  17302. var outR = 0;
  17303. var len = pc2table.length >>> 1;
  17304. for (var i = 0; i < len; i++) {
  17305. outL <<= 1;
  17306. outL |= (inL >>> pc2table[i]) & 0x1;
  17307. }
  17308. for (var i = len; i < pc2table.length; i++) {
  17309. outR <<= 1;
  17310. outR |= (inR >>> pc2table[i]) & 0x1;
  17311. }
  17312. out[off + 0] = outL >>> 0;
  17313. out[off + 1] = outR >>> 0;
  17314. };
  17315. exports.expand = function expand(r, out, off) {
  17316. var outL = 0;
  17317. var outR = 0;
  17318. outL = ((r & 1) << 5) | (r >>> 27);
  17319. for (var i = 23; i >= 15; i -= 4) {
  17320. outL <<= 6;
  17321. outL |= (r >>> i) & 0x3f;
  17322. }
  17323. for (var i = 11; i >= 3; i -= 4) {
  17324. outR |= (r >>> i) & 0x3f;
  17325. outR <<= 6;
  17326. }
  17327. outR |= ((r & 0x1f) << 1) | (r >>> 31);
  17328. out[off + 0] = outL >>> 0;
  17329. out[off + 1] = outR >>> 0;
  17330. };
  17331. var sTable = [
  17332. 14, 0, 4, 15, 13, 7, 1, 4, 2, 14, 15, 2, 11, 13, 8, 1,
  17333. 3, 10, 10, 6, 6, 12, 12, 11, 5, 9, 9, 5, 0, 3, 7, 8,
  17334. 4, 15, 1, 12, 14, 8, 8, 2, 13, 4, 6, 9, 2, 1, 11, 7,
  17335. 15, 5, 12, 11, 9, 3, 7, 14, 3, 10, 10, 0, 5, 6, 0, 13,
  17336. 15, 3, 1, 13, 8, 4, 14, 7, 6, 15, 11, 2, 3, 8, 4, 14,
  17337. 9, 12, 7, 0, 2, 1, 13, 10, 12, 6, 0, 9, 5, 11, 10, 5,
  17338. 0, 13, 14, 8, 7, 10, 11, 1, 10, 3, 4, 15, 13, 4, 1, 2,
  17339. 5, 11, 8, 6, 12, 7, 6, 12, 9, 0, 3, 5, 2, 14, 15, 9,
  17340. 10, 13, 0, 7, 9, 0, 14, 9, 6, 3, 3, 4, 15, 6, 5, 10,
  17341. 1, 2, 13, 8, 12, 5, 7, 14, 11, 12, 4, 11, 2, 15, 8, 1,
  17342. 13, 1, 6, 10, 4, 13, 9, 0, 8, 6, 15, 9, 3, 8, 0, 7,
  17343. 11, 4, 1, 15, 2, 14, 12, 3, 5, 11, 10, 5, 14, 2, 7, 12,
  17344. 7, 13, 13, 8, 14, 11, 3, 5, 0, 6, 6, 15, 9, 0, 10, 3,
  17345. 1, 4, 2, 7, 8, 2, 5, 12, 11, 1, 12, 10, 4, 14, 15, 9,
  17346. 10, 3, 6, 15, 9, 0, 0, 6, 12, 10, 11, 1, 7, 13, 13, 8,
  17347. 15, 9, 1, 4, 3, 5, 14, 11, 5, 12, 2, 7, 8, 2, 4, 14,
  17348. 2, 14, 12, 11, 4, 2, 1, 12, 7, 4, 10, 7, 11, 13, 6, 1,
  17349. 8, 5, 5, 0, 3, 15, 15, 10, 13, 3, 0, 9, 14, 8, 9, 6,
  17350. 4, 11, 2, 8, 1, 12, 11, 7, 10, 1, 13, 14, 7, 2, 8, 13,
  17351. 15, 6, 9, 15, 12, 0, 5, 9, 6, 10, 3, 4, 0, 5, 14, 3,
  17352. 12, 10, 1, 15, 10, 4, 15, 2, 9, 7, 2, 12, 6, 9, 8, 5,
  17353. 0, 6, 13, 1, 3, 13, 4, 14, 14, 0, 7, 11, 5, 3, 11, 8,
  17354. 9, 4, 14, 3, 15, 2, 5, 12, 2, 9, 8, 5, 12, 15, 3, 10,
  17355. 7, 11, 0, 14, 4, 1, 10, 7, 1, 6, 13, 0, 11, 8, 6, 13,
  17356. 4, 13, 11, 0, 2, 11, 14, 7, 15, 4, 0, 9, 8, 1, 13, 10,
  17357. 3, 14, 12, 3, 9, 5, 7, 12, 5, 2, 10, 15, 6, 8, 1, 6,
  17358. 1, 6, 4, 11, 11, 13, 13, 8, 12, 1, 3, 4, 7, 10, 14, 7,
  17359. 10, 9, 15, 5, 6, 0, 8, 15, 0, 14, 5, 2, 9, 3, 2, 12,
  17360. 13, 1, 2, 15, 8, 13, 4, 8, 6, 10, 15, 3, 11, 7, 1, 4,
  17361. 10, 12, 9, 5, 3, 6, 14, 11, 5, 0, 0, 14, 12, 9, 7, 2,
  17362. 7, 2, 11, 1, 4, 14, 1, 7, 9, 4, 12, 10, 14, 8, 2, 13,
  17363. 0, 15, 6, 12, 10, 9, 13, 0, 15, 3, 3, 5, 5, 6, 8, 11
  17364. ];
  17365. exports.substitute = function substitute(inL, inR) {
  17366. var out = 0;
  17367. for (var i = 0; i < 4; i++) {
  17368. var b = (inL >>> (18 - i * 6)) & 0x3f;
  17369. var sb = sTable[i * 0x40 + b];
  17370. out <<= 4;
  17371. out |= sb;
  17372. }
  17373. for (var i = 0; i < 4; i++) {
  17374. var b = (inR >>> (18 - i * 6)) & 0x3f;
  17375. var sb = sTable[4 * 0x40 + i * 0x40 + b];
  17376. out <<= 4;
  17377. out |= sb;
  17378. }
  17379. return out >>> 0;
  17380. };
  17381. var permuteTable = [
  17382. 16, 25, 12, 11, 3, 20, 4, 15, 31, 17, 9, 6, 27, 14, 1, 22,
  17383. 30, 24, 8, 18, 0, 5, 29, 23, 13, 19, 2, 26, 10, 21, 28, 7
  17384. ];
  17385. exports.permute = function permute(num) {
  17386. var out = 0;
  17387. for (var i = 0; i < permuteTable.length; i++) {
  17388. out <<= 1;
  17389. out |= (num >>> permuteTable[i]) & 0x1;
  17390. }
  17391. return out >>> 0;
  17392. };
  17393. exports.padSplit = function padSplit(num, size, group) {
  17394. var str = num.toString(2);
  17395. while (str.length < size)
  17396. str = '0' + str;
  17397. var out = [];
  17398. for (var i = 0; i < size; i += group)
  17399. out.push(str.slice(i, i + group));
  17400. return out.join(' ');
  17401. };
  17402. /***/ }),
  17403. /* 136 */
  17404. /*!***********************************************!*\
  17405. !*** ./node_modules/des.js/lib/des/cipher.js ***!
  17406. \***********************************************/
  17407. /*! no static exports found */
  17408. /***/ (function(module, exports, __webpack_require__) {
  17409. "use strict";
  17410. var assert = __webpack_require__(/*! minimalistic-assert */ 137);
  17411. function Cipher(options) {
  17412. this.options = options;
  17413. this.type = this.options.type;
  17414. this.blockSize = 8;
  17415. this._init();
  17416. this.buffer = new Array(this.blockSize);
  17417. this.bufferOff = 0;
  17418. }
  17419. module.exports = Cipher;
  17420. Cipher.prototype._init = function _init() {
  17421. // Might be overrided
  17422. };
  17423. Cipher.prototype.update = function update(data) {
  17424. if (data.length === 0)
  17425. return [];
  17426. if (this.type === 'decrypt')
  17427. return this._updateDecrypt(data);
  17428. else
  17429. return this._updateEncrypt(data);
  17430. };
  17431. Cipher.prototype._buffer = function _buffer(data, off) {
  17432. // Append data to buffer
  17433. var min = Math.min(this.buffer.length - this.bufferOff, data.length - off);
  17434. for (var i = 0; i < min; i++)
  17435. this.buffer[this.bufferOff + i] = data[off + i];
  17436. this.bufferOff += min;
  17437. // Shift next
  17438. return min;
  17439. };
  17440. Cipher.prototype._flushBuffer = function _flushBuffer(out, off) {
  17441. this._update(this.buffer, 0, out, off);
  17442. this.bufferOff = 0;
  17443. return this.blockSize;
  17444. };
  17445. Cipher.prototype._updateEncrypt = function _updateEncrypt(data) {
  17446. var inputOff = 0;
  17447. var outputOff = 0;
  17448. var count = ((this.bufferOff + data.length) / this.blockSize) | 0;
  17449. var out = new Array(count * this.blockSize);
  17450. if (this.bufferOff !== 0) {
  17451. inputOff += this._buffer(data, inputOff);
  17452. if (this.bufferOff === this.buffer.length)
  17453. outputOff += this._flushBuffer(out, outputOff);
  17454. }
  17455. // Write blocks
  17456. var max = data.length - ((data.length - inputOff) % this.blockSize);
  17457. for (; inputOff < max; inputOff += this.blockSize) {
  17458. this._update(data, inputOff, out, outputOff);
  17459. outputOff += this.blockSize;
  17460. }
  17461. // Queue rest
  17462. for (; inputOff < data.length; inputOff++, this.bufferOff++)
  17463. this.buffer[this.bufferOff] = data[inputOff];
  17464. return out;
  17465. };
  17466. Cipher.prototype._updateDecrypt = function _updateDecrypt(data) {
  17467. var inputOff = 0;
  17468. var outputOff = 0;
  17469. var count = Math.ceil((this.bufferOff + data.length) / this.blockSize) - 1;
  17470. var out = new Array(count * this.blockSize);
  17471. // TODO(indutny): optimize it, this is far from optimal
  17472. for (; count > 0; count--) {
  17473. inputOff += this._buffer(data, inputOff);
  17474. outputOff += this._flushBuffer(out, outputOff);
  17475. }
  17476. // Buffer rest of the input
  17477. inputOff += this._buffer(data, inputOff);
  17478. return out;
  17479. };
  17480. Cipher.prototype.final = function final(buffer) {
  17481. var first;
  17482. if (buffer)
  17483. first = this.update(buffer);
  17484. var last;
  17485. if (this.type === 'encrypt')
  17486. last = this._finalEncrypt();
  17487. else
  17488. last = this._finalDecrypt();
  17489. if (first)
  17490. return first.concat(last);
  17491. else
  17492. return last;
  17493. };
  17494. Cipher.prototype._pad = function _pad(buffer, off) {
  17495. if (off === 0)
  17496. return false;
  17497. while (off < buffer.length)
  17498. buffer[off++] = 0;
  17499. return true;
  17500. };
  17501. Cipher.prototype._finalEncrypt = function _finalEncrypt() {
  17502. if (!this._pad(this.buffer, this.bufferOff))
  17503. return [];
  17504. var out = new Array(this.blockSize);
  17505. this._update(this.buffer, 0, out, 0);
  17506. return out;
  17507. };
  17508. Cipher.prototype._unpad = function _unpad(buffer) {
  17509. return buffer;
  17510. };
  17511. Cipher.prototype._finalDecrypt = function _finalDecrypt() {
  17512. assert.equal(this.bufferOff, this.blockSize, 'Not enough data to decrypt');
  17513. var out = new Array(this.blockSize);
  17514. this._flushBuffer(out, 0);
  17515. return this._unpad(out);
  17516. };
  17517. /***/ }),
  17518. /* 137 */
  17519. /*!***************************************************!*\
  17520. !*** ./node_modules/minimalistic-assert/index.js ***!
  17521. \***************************************************/
  17522. /*! no static exports found */
  17523. /***/ (function(module, exports) {
  17524. module.exports = assert;
  17525. function assert(val, msg) {
  17526. if (!val)
  17527. throw new Error(msg || 'Assertion failed');
  17528. }
  17529. assert.equal = function assertEqual(l, r, msg) {
  17530. if (l != r)
  17531. throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r));
  17532. };
  17533. /***/ }),
  17534. /* 138 */
  17535. /*!********************************************!*\
  17536. !*** ./node_modules/des.js/lib/des/des.js ***!
  17537. \********************************************/
  17538. /*! no static exports found */
  17539. /***/ (function(module, exports, __webpack_require__) {
  17540. "use strict";
  17541. var assert = __webpack_require__(/*! minimalistic-assert */ 137);
  17542. var inherits = __webpack_require__(/*! inherits */ 87);
  17543. var utils = __webpack_require__(/*! ./utils */ 135);
  17544. var Cipher = __webpack_require__(/*! ./cipher */ 136);
  17545. function DESState() {
  17546. this.tmp = new Array(2);
  17547. this.keys = null;
  17548. }
  17549. function DES(options) {
  17550. Cipher.call(this, options);
  17551. var state = new DESState();
  17552. this._desState = state;
  17553. this.deriveKeys(state, options.key);
  17554. }
  17555. inherits(DES, Cipher);
  17556. module.exports = DES;
  17557. DES.create = function create(options) {
  17558. return new DES(options);
  17559. };
  17560. var shiftTable = [
  17561. 1, 1, 2, 2, 2, 2, 2, 2,
  17562. 1, 2, 2, 2, 2, 2, 2, 1
  17563. ];
  17564. DES.prototype.deriveKeys = function deriveKeys(state, key) {
  17565. state.keys = new Array(16 * 2);
  17566. assert.equal(key.length, this.blockSize, 'Invalid key length');
  17567. var kL = utils.readUInt32BE(key, 0);
  17568. var kR = utils.readUInt32BE(key, 4);
  17569. utils.pc1(kL, kR, state.tmp, 0);
  17570. kL = state.tmp[0];
  17571. kR = state.tmp[1];
  17572. for (var i = 0; i < state.keys.length; i += 2) {
  17573. var shift = shiftTable[i >>> 1];
  17574. kL = utils.r28shl(kL, shift);
  17575. kR = utils.r28shl(kR, shift);
  17576. utils.pc2(kL, kR, state.keys, i);
  17577. }
  17578. };
  17579. DES.prototype._update = function _update(inp, inOff, out, outOff) {
  17580. var state = this._desState;
  17581. var l = utils.readUInt32BE(inp, inOff);
  17582. var r = utils.readUInt32BE(inp, inOff + 4);
  17583. // Initial Permutation
  17584. utils.ip(l, r, state.tmp, 0);
  17585. l = state.tmp[0];
  17586. r = state.tmp[1];
  17587. if (this.type === 'encrypt')
  17588. this._encrypt(state, l, r, state.tmp, 0);
  17589. else
  17590. this._decrypt(state, l, r, state.tmp, 0);
  17591. l = state.tmp[0];
  17592. r = state.tmp[1];
  17593. utils.writeUInt32BE(out, l, outOff);
  17594. utils.writeUInt32BE(out, r, outOff + 4);
  17595. };
  17596. DES.prototype._pad = function _pad(buffer, off) {
  17597. var value = buffer.length - off;
  17598. for (var i = off; i < buffer.length; i++)
  17599. buffer[i] = value;
  17600. return true;
  17601. };
  17602. DES.prototype._unpad = function _unpad(buffer) {
  17603. var pad = buffer[buffer.length - 1];
  17604. for (var i = buffer.length - pad; i < buffer.length; i++)
  17605. assert.equal(buffer[i], pad);
  17606. return buffer.slice(0, buffer.length - pad);
  17607. };
  17608. DES.prototype._encrypt = function _encrypt(state, lStart, rStart, out, off) {
  17609. var l = lStart;
  17610. var r = rStart;
  17611. // Apply f() x16 times
  17612. for (var i = 0; i < state.keys.length; i += 2) {
  17613. var keyL = state.keys[i];
  17614. var keyR = state.keys[i + 1];
  17615. // f(r, k)
  17616. utils.expand(r, state.tmp, 0);
  17617. keyL ^= state.tmp[0];
  17618. keyR ^= state.tmp[1];
  17619. var s = utils.substitute(keyL, keyR);
  17620. var f = utils.permute(s);
  17621. var t = r;
  17622. r = (l ^ f) >>> 0;
  17623. l = t;
  17624. }
  17625. // Reverse Initial Permutation
  17626. utils.rip(r, l, out, off);
  17627. };
  17628. DES.prototype._decrypt = function _decrypt(state, lStart, rStart, out, off) {
  17629. var l = rStart;
  17630. var r = lStart;
  17631. // Apply f() x16 times
  17632. for (var i = state.keys.length - 2; i >= 0; i -= 2) {
  17633. var keyL = state.keys[i];
  17634. var keyR = state.keys[i + 1];
  17635. // f(r, k)
  17636. utils.expand(l, state.tmp, 0);
  17637. keyL ^= state.tmp[0];
  17638. keyR ^= state.tmp[1];
  17639. var s = utils.substitute(keyL, keyR);
  17640. var f = utils.permute(s);
  17641. var t = l;
  17642. l = (r ^ f) >>> 0;
  17643. r = t;
  17644. }
  17645. // Reverse Initial Permutation
  17646. utils.rip(l, r, out, off);
  17647. };
  17648. /***/ }),
  17649. /* 139 */
  17650. /*!********************************************!*\
  17651. !*** ./node_modules/des.js/lib/des/cbc.js ***!
  17652. \********************************************/
  17653. /*! no static exports found */
  17654. /***/ (function(module, exports, __webpack_require__) {
  17655. "use strict";
  17656. var assert = __webpack_require__(/*! minimalistic-assert */ 137);
  17657. var inherits = __webpack_require__(/*! inherits */ 87);
  17658. var proto = {};
  17659. function CBCState(iv) {
  17660. assert.equal(iv.length, 8, 'Invalid IV length');
  17661. this.iv = new Array(8);
  17662. for (var i = 0; i < this.iv.length; i++)
  17663. this.iv[i] = iv[i];
  17664. }
  17665. function instantiate(Base) {
  17666. function CBC(options) {
  17667. Base.call(this, options);
  17668. this._cbcInit();
  17669. }
  17670. inherits(CBC, Base);
  17671. var keys = Object.keys(proto);
  17672. for (var i = 0; i < keys.length; i++) {
  17673. var key = keys[i];
  17674. CBC.prototype[key] = proto[key];
  17675. }
  17676. CBC.create = function create(options) {
  17677. return new CBC(options);
  17678. };
  17679. return CBC;
  17680. }
  17681. exports.instantiate = instantiate;
  17682. proto._cbcInit = function _cbcInit() {
  17683. var state = new CBCState(this.options.iv);
  17684. this._cbcState = state;
  17685. };
  17686. proto._update = function _update(inp, inOff, out, outOff) {
  17687. var state = this._cbcState;
  17688. var superProto = this.constructor.super_.prototype;
  17689. var iv = state.iv;
  17690. if (this.type === 'encrypt') {
  17691. for (var i = 0; i < this.blockSize; i++)
  17692. iv[i] ^= inp[inOff + i];
  17693. superProto._update.call(this, iv, 0, out, outOff);
  17694. for (var i = 0; i < this.blockSize; i++)
  17695. iv[i] = out[outOff + i];
  17696. } else {
  17697. superProto._update.call(this, inp, inOff, out, outOff);
  17698. for (var i = 0; i < this.blockSize; i++)
  17699. out[outOff + i] ^= iv[i];
  17700. for (var i = 0; i < this.blockSize; i++)
  17701. iv[i] = inp[inOff + i];
  17702. }
  17703. };
  17704. /***/ }),
  17705. /* 140 */
  17706. /*!********************************************!*\
  17707. !*** ./node_modules/des.js/lib/des/ede.js ***!
  17708. \********************************************/
  17709. /*! no static exports found */
  17710. /***/ (function(module, exports, __webpack_require__) {
  17711. "use strict";
  17712. var assert = __webpack_require__(/*! minimalistic-assert */ 137);
  17713. var inherits = __webpack_require__(/*! inherits */ 87);
  17714. var Cipher = __webpack_require__(/*! ./cipher */ 136);
  17715. var DES = __webpack_require__(/*! ./des */ 138);
  17716. function EDEState(type, key) {
  17717. assert.equal(key.length, 24, 'Invalid key length');
  17718. var k1 = key.slice(0, 8);
  17719. var k2 = key.slice(8, 16);
  17720. var k3 = key.slice(16, 24);
  17721. if (type === 'encrypt') {
  17722. this.ciphers = [
  17723. DES.create({ type: 'encrypt', key: k1 }),
  17724. DES.create({ type: 'decrypt', key: k2 }),
  17725. DES.create({ type: 'encrypt', key: k3 })
  17726. ];
  17727. } else {
  17728. this.ciphers = [
  17729. DES.create({ type: 'decrypt', key: k3 }),
  17730. DES.create({ type: 'encrypt', key: k2 }),
  17731. DES.create({ type: 'decrypt', key: k1 })
  17732. ];
  17733. }
  17734. }
  17735. function EDE(options) {
  17736. Cipher.call(this, options);
  17737. var state = new EDEState(this.type, this.options.key);
  17738. this._edeState = state;
  17739. }
  17740. inherits(EDE, Cipher);
  17741. module.exports = EDE;
  17742. EDE.create = function create(options) {
  17743. return new EDE(options);
  17744. };
  17745. EDE.prototype._update = function _update(inp, inOff, out, outOff) {
  17746. var state = this._edeState;
  17747. state.ciphers[0]._update(inp, inOff, out, outOff);
  17748. state.ciphers[1]._update(out, outOff, out, outOff);
  17749. state.ciphers[2]._update(out, outOff, out, outOff);
  17750. };
  17751. EDE.prototype._pad = DES.prototype._pad;
  17752. EDE.prototype._unpad = DES.prototype._unpad;
  17753. /***/ }),
  17754. /* 141 */
  17755. /*!************************************************!*\
  17756. !*** ./node_modules/browserify-aes/browser.js ***!
  17757. \************************************************/
  17758. /*! no static exports found */
  17759. /***/ (function(module, exports, __webpack_require__) {
  17760. var ciphers = __webpack_require__(/*! ./encrypter */ 142)
  17761. var deciphers = __webpack_require__(/*! ./decrypter */ 159)
  17762. var modes = __webpack_require__(/*! ./modes/list.json */ 153)
  17763. function getCiphers () {
  17764. return Object.keys(modes)
  17765. }
  17766. exports.createCipher = exports.Cipher = ciphers.createCipher
  17767. exports.createCipheriv = exports.Cipheriv = ciphers.createCipheriv
  17768. exports.createDecipher = exports.Decipher = deciphers.createDecipher
  17769. exports.createDecipheriv = exports.Decipheriv = deciphers.createDecipheriv
  17770. exports.listCiphers = exports.getCiphers = getCiphers
  17771. /***/ }),
  17772. /* 142 */
  17773. /*!**************************************************!*\
  17774. !*** ./node_modules/browserify-aes/encrypter.js ***!
  17775. \**************************************************/
  17776. /*! no static exports found */
  17777. /***/ (function(module, exports, __webpack_require__) {
  17778. var MODES = __webpack_require__(/*! ./modes */ 143)
  17779. var AuthCipher = __webpack_require__(/*! ./authCipher */ 154)
  17780. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  17781. var StreamCipher = __webpack_require__(/*! ./streamCipher */ 157)
  17782. var Transform = __webpack_require__(/*! cipher-base */ 115)
  17783. var aes = __webpack_require__(/*! ./aes */ 155)
  17784. var ebtk = __webpack_require__(/*! evp_bytestokey */ 158)
  17785. var inherits = __webpack_require__(/*! inherits */ 87)
  17786. function Cipher (mode, key, iv) {
  17787. Transform.call(this)
  17788. this._cache = new Splitter()
  17789. this._cipher = new aes.AES(key)
  17790. this._prev = Buffer.from(iv)
  17791. this._mode = mode
  17792. this._autopadding = true
  17793. }
  17794. inherits(Cipher, Transform)
  17795. Cipher.prototype._update = function (data) {
  17796. this._cache.add(data)
  17797. var chunk
  17798. var thing
  17799. var out = []
  17800. while ((chunk = this._cache.get())) {
  17801. thing = this._mode.encrypt(this, chunk)
  17802. out.push(thing)
  17803. }
  17804. return Buffer.concat(out)
  17805. }
  17806. var PADDING = Buffer.alloc(16, 0x10)
  17807. Cipher.prototype._final = function () {
  17808. var chunk = this._cache.flush()
  17809. if (this._autopadding) {
  17810. chunk = this._mode.encrypt(this, chunk)
  17811. this._cipher.scrub()
  17812. return chunk
  17813. }
  17814. if (!chunk.equals(PADDING)) {
  17815. this._cipher.scrub()
  17816. throw new Error('data not multiple of block length')
  17817. }
  17818. }
  17819. Cipher.prototype.setAutoPadding = function (setTo) {
  17820. this._autopadding = !!setTo
  17821. return this
  17822. }
  17823. function Splitter () {
  17824. this.cache = Buffer.allocUnsafe(0)
  17825. }
  17826. Splitter.prototype.add = function (data) {
  17827. this.cache = Buffer.concat([this.cache, data])
  17828. }
  17829. Splitter.prototype.get = function () {
  17830. if (this.cache.length > 15) {
  17831. var out = this.cache.slice(0, 16)
  17832. this.cache = this.cache.slice(16)
  17833. return out
  17834. }
  17835. return null
  17836. }
  17837. Splitter.prototype.flush = function () {
  17838. var len = 16 - this.cache.length
  17839. var padBuff = Buffer.allocUnsafe(len)
  17840. var i = -1
  17841. while (++i < len) {
  17842. padBuff.writeUInt8(len, i)
  17843. }
  17844. return Buffer.concat([this.cache, padBuff])
  17845. }
  17846. function createCipheriv (suite, password, iv) {
  17847. var config = MODES[suite.toLowerCase()]
  17848. if (!config) throw new TypeError('invalid suite type')
  17849. if (typeof password === 'string') password = Buffer.from(password)
  17850. if (password.length !== config.key / 8) throw new TypeError('invalid key length ' + password.length)
  17851. if (typeof iv === 'string') iv = Buffer.from(iv)
  17852. if (config.mode !== 'GCM' && iv.length !== config.iv) throw new TypeError('invalid iv length ' + iv.length)
  17853. if (config.type === 'stream') {
  17854. return new StreamCipher(config.module, password, iv)
  17855. } else if (config.type === 'auth') {
  17856. return new AuthCipher(config.module, password, iv)
  17857. }
  17858. return new Cipher(config.module, password, iv)
  17859. }
  17860. function createCipher (suite, password) {
  17861. var config = MODES[suite.toLowerCase()]
  17862. if (!config) throw new TypeError('invalid suite type')
  17863. var keys = ebtk(password, false, config.key, config.iv)
  17864. return createCipheriv(suite, keys.key, keys.iv)
  17865. }
  17866. exports.createCipheriv = createCipheriv
  17867. exports.createCipher = createCipher
  17868. /***/ }),
  17869. /* 143 */
  17870. /*!****************************************************!*\
  17871. !*** ./node_modules/browserify-aes/modes/index.js ***!
  17872. \****************************************************/
  17873. /*! no static exports found */
  17874. /***/ (function(module, exports, __webpack_require__) {
  17875. var modeModules = {
  17876. ECB: __webpack_require__(/*! ./ecb */ 144),
  17877. CBC: __webpack_require__(/*! ./cbc */ 145),
  17878. CFB: __webpack_require__(/*! ./cfb */ 147),
  17879. CFB8: __webpack_require__(/*! ./cfb8 */ 148),
  17880. CFB1: __webpack_require__(/*! ./cfb1 */ 149),
  17881. OFB: __webpack_require__(/*! ./ofb */ 150),
  17882. CTR: __webpack_require__(/*! ./ctr */ 151),
  17883. GCM: __webpack_require__(/*! ./ctr */ 151)
  17884. }
  17885. var modes = __webpack_require__(/*! ./list.json */ 153)
  17886. for (var key in modes) {
  17887. modes[key].module = modeModules[modes[key].mode]
  17888. }
  17889. module.exports = modes
  17890. /***/ }),
  17891. /* 144 */
  17892. /*!**************************************************!*\
  17893. !*** ./node_modules/browserify-aes/modes/ecb.js ***!
  17894. \**************************************************/
  17895. /*! no static exports found */
  17896. /***/ (function(module, exports) {
  17897. exports.encrypt = function (self, block) {
  17898. return self._cipher.encryptBlock(block)
  17899. }
  17900. exports.decrypt = function (self, block) {
  17901. return self._cipher.decryptBlock(block)
  17902. }
  17903. /***/ }),
  17904. /* 145 */
  17905. /*!**************************************************!*\
  17906. !*** ./node_modules/browserify-aes/modes/cbc.js ***!
  17907. \**************************************************/
  17908. /*! no static exports found */
  17909. /***/ (function(module, exports, __webpack_require__) {
  17910. var xor = __webpack_require__(/*! buffer-xor */ 146)
  17911. exports.encrypt = function (self, block) {
  17912. var data = xor(block, self._prev)
  17913. self._prev = self._cipher.encryptBlock(data)
  17914. return self._prev
  17915. }
  17916. exports.decrypt = function (self, block) {
  17917. var pad = self._prev
  17918. self._prev = block
  17919. var out = self._cipher.decryptBlock(block)
  17920. return xor(out, pad)
  17921. }
  17922. /***/ }),
  17923. /* 146 */
  17924. /*!******************************************!*\
  17925. !*** ./node_modules/buffer-xor/index.js ***!
  17926. \******************************************/
  17927. /*! no static exports found */
  17928. /***/ (function(module, exports, __webpack_require__) {
  17929. /* WEBPACK VAR INJECTION */(function(Buffer) {module.exports = function xor (a, b) {
  17930. var length = Math.min(a.length, b.length)
  17931. var buffer = new Buffer(length)
  17932. for (var i = 0; i < length; ++i) {
  17933. buffer[i] = a[i] ^ b[i]
  17934. }
  17935. return buffer
  17936. }
  17937. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ 82).Buffer))
  17938. /***/ }),
  17939. /* 147 */
  17940. /*!**************************************************!*\
  17941. !*** ./node_modules/browserify-aes/modes/cfb.js ***!
  17942. \**************************************************/
  17943. /*! no static exports found */
  17944. /***/ (function(module, exports, __webpack_require__) {
  17945. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  17946. var xor = __webpack_require__(/*! buffer-xor */ 146)
  17947. function encryptStart (self, data, decrypt) {
  17948. var len = data.length
  17949. var out = xor(data, self._cache)
  17950. self._cache = self._cache.slice(len)
  17951. self._prev = Buffer.concat([self._prev, decrypt ? data : out])
  17952. return out
  17953. }
  17954. exports.encrypt = function (self, data, decrypt) {
  17955. var out = Buffer.allocUnsafe(0)
  17956. var len
  17957. while (data.length) {
  17958. if (self._cache.length === 0) {
  17959. self._cache = self._cipher.encryptBlock(self._prev)
  17960. self._prev = Buffer.allocUnsafe(0)
  17961. }
  17962. if (self._cache.length <= data.length) {
  17963. len = self._cache.length
  17964. out = Buffer.concat([out, encryptStart(self, data.slice(0, len), decrypt)])
  17965. data = data.slice(len)
  17966. } else {
  17967. out = Buffer.concat([out, encryptStart(self, data, decrypt)])
  17968. break
  17969. }
  17970. }
  17971. return out
  17972. }
  17973. /***/ }),
  17974. /* 148 */
  17975. /*!***************************************************!*\
  17976. !*** ./node_modules/browserify-aes/modes/cfb8.js ***!
  17977. \***************************************************/
  17978. /*! no static exports found */
  17979. /***/ (function(module, exports, __webpack_require__) {
  17980. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  17981. function encryptByte (self, byteParam, decrypt) {
  17982. var pad = self._cipher.encryptBlock(self._prev)
  17983. var out = pad[0] ^ byteParam
  17984. self._prev = Buffer.concat([
  17985. self._prev.slice(1),
  17986. Buffer.from([decrypt ? byteParam : out])
  17987. ])
  17988. return out
  17989. }
  17990. exports.encrypt = function (self, chunk, decrypt) {
  17991. var len = chunk.length
  17992. var out = Buffer.allocUnsafe(len)
  17993. var i = -1
  17994. while (++i < len) {
  17995. out[i] = encryptByte(self, chunk[i], decrypt)
  17996. }
  17997. return out
  17998. }
  17999. /***/ }),
  18000. /* 149 */
  18001. /*!***************************************************!*\
  18002. !*** ./node_modules/browserify-aes/modes/cfb1.js ***!
  18003. \***************************************************/
  18004. /*! no static exports found */
  18005. /***/ (function(module, exports, __webpack_require__) {
  18006. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  18007. function encryptByte (self, byteParam, decrypt) {
  18008. var pad
  18009. var i = -1
  18010. var len = 8
  18011. var out = 0
  18012. var bit, value
  18013. while (++i < len) {
  18014. pad = self._cipher.encryptBlock(self._prev)
  18015. bit = (byteParam & (1 << (7 - i))) ? 0x80 : 0
  18016. value = pad[0] ^ bit
  18017. out += ((value & 0x80) >> (i % 8))
  18018. self._prev = shiftIn(self._prev, decrypt ? bit : value)
  18019. }
  18020. return out
  18021. }
  18022. function shiftIn (buffer, value) {
  18023. var len = buffer.length
  18024. var i = -1
  18025. var out = Buffer.allocUnsafe(buffer.length)
  18026. buffer = Buffer.concat([buffer, Buffer.from([value])])
  18027. while (++i < len) {
  18028. out[i] = buffer[i] << 1 | buffer[i + 1] >> (7)
  18029. }
  18030. return out
  18031. }
  18032. exports.encrypt = function (self, chunk, decrypt) {
  18033. var len = chunk.length
  18034. var out = Buffer.allocUnsafe(len)
  18035. var i = -1
  18036. while (++i < len) {
  18037. out[i] = encryptByte(self, chunk[i], decrypt)
  18038. }
  18039. return out
  18040. }
  18041. /***/ }),
  18042. /* 150 */
  18043. /*!**************************************************!*\
  18044. !*** ./node_modules/browserify-aes/modes/ofb.js ***!
  18045. \**************************************************/
  18046. /*! no static exports found */
  18047. /***/ (function(module, exports, __webpack_require__) {
  18048. /* WEBPACK VAR INJECTION */(function(Buffer) {var xor = __webpack_require__(/*! buffer-xor */ 146)
  18049. function getBlock (self) {
  18050. self._prev = self._cipher.encryptBlock(self._prev)
  18051. return self._prev
  18052. }
  18053. exports.encrypt = function (self, chunk) {
  18054. while (self._cache.length < chunk.length) {
  18055. self._cache = Buffer.concat([self._cache, getBlock(self)])
  18056. }
  18057. var pad = self._cache.slice(0, chunk.length)
  18058. self._cache = self._cache.slice(chunk.length)
  18059. return xor(chunk, pad)
  18060. }
  18061. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../buffer/index.js */ 82).Buffer))
  18062. /***/ }),
  18063. /* 151 */
  18064. /*!**************************************************!*\
  18065. !*** ./node_modules/browserify-aes/modes/ctr.js ***!
  18066. \**************************************************/
  18067. /*! no static exports found */
  18068. /***/ (function(module, exports, __webpack_require__) {
  18069. var xor = __webpack_require__(/*! buffer-xor */ 146)
  18070. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  18071. var incr32 = __webpack_require__(/*! ../incr32 */ 152)
  18072. function getBlock (self) {
  18073. var out = self._cipher.encryptBlockRaw(self._prev)
  18074. incr32(self._prev)
  18075. return out
  18076. }
  18077. var blockSize = 16
  18078. exports.encrypt = function (self, chunk) {
  18079. var chunkNum = Math.ceil(chunk.length / blockSize)
  18080. var start = self._cache.length
  18081. self._cache = Buffer.concat([
  18082. self._cache,
  18083. Buffer.allocUnsafe(chunkNum * blockSize)
  18084. ])
  18085. for (var i = 0; i < chunkNum; i++) {
  18086. var out = getBlock(self)
  18087. var offset = start + i * blockSize
  18088. self._cache.writeUInt32BE(out[0], offset + 0)
  18089. self._cache.writeUInt32BE(out[1], offset + 4)
  18090. self._cache.writeUInt32BE(out[2], offset + 8)
  18091. self._cache.writeUInt32BE(out[3], offset + 12)
  18092. }
  18093. var pad = self._cache.slice(0, chunk.length)
  18094. self._cache = self._cache.slice(chunk.length)
  18095. return xor(chunk, pad)
  18096. }
  18097. /***/ }),
  18098. /* 152 */
  18099. /*!***********************************************!*\
  18100. !*** ./node_modules/browserify-aes/incr32.js ***!
  18101. \***********************************************/
  18102. /*! no static exports found */
  18103. /***/ (function(module, exports) {
  18104. function incr32 (iv) {
  18105. var len = iv.length
  18106. var item
  18107. while (len--) {
  18108. item = iv.readUInt8(len)
  18109. if (item === 255) {
  18110. iv.writeUInt8(0, len)
  18111. } else {
  18112. item++
  18113. iv.writeUInt8(item, len)
  18114. break
  18115. }
  18116. }
  18117. }
  18118. module.exports = incr32
  18119. /***/ }),
  18120. /* 153 */
  18121. /*!*****************************************************!*\
  18122. !*** ./node_modules/browserify-aes/modes/list.json ***!
  18123. \*****************************************************/
  18124. /*! 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 */
  18125. /***/ (function(module) {
  18126. 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\"}}");
  18127. /***/ }),
  18128. /* 154 */
  18129. /*!***************************************************!*\
  18130. !*** ./node_modules/browserify-aes/authCipher.js ***!
  18131. \***************************************************/
  18132. /*! no static exports found */
  18133. /***/ (function(module, exports, __webpack_require__) {
  18134. var aes = __webpack_require__(/*! ./aes */ 155)
  18135. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  18136. var Transform = __webpack_require__(/*! cipher-base */ 115)
  18137. var inherits = __webpack_require__(/*! inherits */ 87)
  18138. var GHASH = __webpack_require__(/*! ./ghash */ 156)
  18139. var xor = __webpack_require__(/*! buffer-xor */ 146)
  18140. var incr32 = __webpack_require__(/*! ./incr32 */ 152)
  18141. function xorTest (a, b) {
  18142. var out = 0
  18143. if (a.length !== b.length) out++
  18144. var len = Math.min(a.length, b.length)
  18145. for (var i = 0; i < len; ++i) {
  18146. out += (a[i] ^ b[i])
  18147. }
  18148. return out
  18149. }
  18150. function calcIv (self, iv, ck) {
  18151. if (iv.length === 12) {
  18152. self._finID = Buffer.concat([iv, Buffer.from([0, 0, 0, 1])])
  18153. return Buffer.concat([iv, Buffer.from([0, 0, 0, 2])])
  18154. }
  18155. var ghash = new GHASH(ck)
  18156. var len = iv.length
  18157. var toPad = len % 16
  18158. ghash.update(iv)
  18159. if (toPad) {
  18160. toPad = 16 - toPad
  18161. ghash.update(Buffer.alloc(toPad, 0))
  18162. }
  18163. ghash.update(Buffer.alloc(8, 0))
  18164. var ivBits = len * 8
  18165. var tail = Buffer.alloc(8)
  18166. tail.writeUIntBE(ivBits, 0, 8)
  18167. ghash.update(tail)
  18168. self._finID = ghash.state
  18169. var out = Buffer.from(self._finID)
  18170. incr32(out)
  18171. return out
  18172. }
  18173. function StreamCipher (mode, key, iv, decrypt) {
  18174. Transform.call(this)
  18175. var h = Buffer.alloc(4, 0)
  18176. this._cipher = new aes.AES(key)
  18177. var ck = this._cipher.encryptBlock(h)
  18178. this._ghash = new GHASH(ck)
  18179. iv = calcIv(this, iv, ck)
  18180. this._prev = Buffer.from(iv)
  18181. this._cache = Buffer.allocUnsafe(0)
  18182. this._secCache = Buffer.allocUnsafe(0)
  18183. this._decrypt = decrypt
  18184. this._alen = 0
  18185. this._len = 0
  18186. this._mode = mode
  18187. this._authTag = null
  18188. this._called = false
  18189. }
  18190. inherits(StreamCipher, Transform)
  18191. StreamCipher.prototype._update = function (chunk) {
  18192. if (!this._called && this._alen) {
  18193. var rump = 16 - (this._alen % 16)
  18194. if (rump < 16) {
  18195. rump = Buffer.alloc(rump, 0)
  18196. this._ghash.update(rump)
  18197. }
  18198. }
  18199. this._called = true
  18200. var out = this._mode.encrypt(this, chunk)
  18201. if (this._decrypt) {
  18202. this._ghash.update(chunk)
  18203. } else {
  18204. this._ghash.update(out)
  18205. }
  18206. this._len += chunk.length
  18207. return out
  18208. }
  18209. StreamCipher.prototype._final = function () {
  18210. if (this._decrypt && !this._authTag) throw new Error('Unsupported state or unable to authenticate data')
  18211. var tag = xor(this._ghash.final(this._alen * 8, this._len * 8), this._cipher.encryptBlock(this._finID))
  18212. if (this._decrypt && xorTest(tag, this._authTag)) throw new Error('Unsupported state or unable to authenticate data')
  18213. this._authTag = tag
  18214. this._cipher.scrub()
  18215. }
  18216. StreamCipher.prototype.getAuthTag = function getAuthTag () {
  18217. if (this._decrypt || !Buffer.isBuffer(this._authTag)) throw new Error('Attempting to get auth tag in unsupported state')
  18218. return this._authTag
  18219. }
  18220. StreamCipher.prototype.setAuthTag = function setAuthTag (tag) {
  18221. if (!this._decrypt) throw new Error('Attempting to set auth tag in unsupported state')
  18222. this._authTag = tag
  18223. }
  18224. StreamCipher.prototype.setAAD = function setAAD (buf) {
  18225. if (this._called) throw new Error('Attempting to set AAD in unsupported state')
  18226. this._ghash.update(buf)
  18227. this._alen += buf.length
  18228. }
  18229. module.exports = StreamCipher
  18230. /***/ }),
  18231. /* 155 */
  18232. /*!********************************************!*\
  18233. !*** ./node_modules/browserify-aes/aes.js ***!
  18234. \********************************************/
  18235. /*! no static exports found */
  18236. /***/ (function(module, exports, __webpack_require__) {
  18237. // based on the aes implimentation in triple sec
  18238. // https://github.com/keybase/triplesec
  18239. // which is in turn based on the one from crypto-js
  18240. // https://code.google.com/p/crypto-js/
  18241. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  18242. function asUInt32Array (buf) {
  18243. if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)
  18244. var len = (buf.length / 4) | 0
  18245. var out = new Array(len)
  18246. for (var i = 0; i < len; i++) {
  18247. out[i] = buf.readUInt32BE(i * 4)
  18248. }
  18249. return out
  18250. }
  18251. function scrubVec (v) {
  18252. for (var i = 0; i < v.length; v++) {
  18253. v[i] = 0
  18254. }
  18255. }
  18256. function cryptBlock (M, keySchedule, SUB_MIX, SBOX, nRounds) {
  18257. var SUB_MIX0 = SUB_MIX[0]
  18258. var SUB_MIX1 = SUB_MIX[1]
  18259. var SUB_MIX2 = SUB_MIX[2]
  18260. var SUB_MIX3 = SUB_MIX[3]
  18261. var s0 = M[0] ^ keySchedule[0]
  18262. var s1 = M[1] ^ keySchedule[1]
  18263. var s2 = M[2] ^ keySchedule[2]
  18264. var s3 = M[3] ^ keySchedule[3]
  18265. var t0, t1, t2, t3
  18266. var ksRow = 4
  18267. for (var round = 1; round < nRounds; round++) {
  18268. t0 = SUB_MIX0[s0 >>> 24] ^ SUB_MIX1[(s1 >>> 16) & 0xff] ^ SUB_MIX2[(s2 >>> 8) & 0xff] ^ SUB_MIX3[s3 & 0xff] ^ keySchedule[ksRow++]
  18269. t1 = SUB_MIX0[s1 >>> 24] ^ SUB_MIX1[(s2 >>> 16) & 0xff] ^ SUB_MIX2[(s3 >>> 8) & 0xff] ^ SUB_MIX3[s0 & 0xff] ^ keySchedule[ksRow++]
  18270. t2 = SUB_MIX0[s2 >>> 24] ^ SUB_MIX1[(s3 >>> 16) & 0xff] ^ SUB_MIX2[(s0 >>> 8) & 0xff] ^ SUB_MIX3[s1 & 0xff] ^ keySchedule[ksRow++]
  18271. t3 = SUB_MIX0[s3 >>> 24] ^ SUB_MIX1[(s0 >>> 16) & 0xff] ^ SUB_MIX2[(s1 >>> 8) & 0xff] ^ SUB_MIX3[s2 & 0xff] ^ keySchedule[ksRow++]
  18272. s0 = t0
  18273. s1 = t1
  18274. s2 = t2
  18275. s3 = t3
  18276. }
  18277. t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++]
  18278. t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++]
  18279. t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++]
  18280. t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++]
  18281. t0 = t0 >>> 0
  18282. t1 = t1 >>> 0
  18283. t2 = t2 >>> 0
  18284. t3 = t3 >>> 0
  18285. return [t0, t1, t2, t3]
  18286. }
  18287. // AES constants
  18288. var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36]
  18289. var G = (function () {
  18290. // Compute double table
  18291. var d = new Array(256)
  18292. for (var j = 0; j < 256; j++) {
  18293. if (j < 128) {
  18294. d[j] = j << 1
  18295. } else {
  18296. d[j] = (j << 1) ^ 0x11b
  18297. }
  18298. }
  18299. var SBOX = []
  18300. var INV_SBOX = []
  18301. var SUB_MIX = [[], [], [], []]
  18302. var INV_SUB_MIX = [[], [], [], []]
  18303. // Walk GF(2^8)
  18304. var x = 0
  18305. var xi = 0
  18306. for (var i = 0; i < 256; ++i) {
  18307. // Compute sbox
  18308. var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4)
  18309. sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63
  18310. SBOX[x] = sx
  18311. INV_SBOX[sx] = x
  18312. // Compute multiplication
  18313. var x2 = d[x]
  18314. var x4 = d[x2]
  18315. var x8 = d[x4]
  18316. // Compute sub bytes, mix columns tables
  18317. var t = (d[sx] * 0x101) ^ (sx * 0x1010100)
  18318. SUB_MIX[0][x] = (t << 24) | (t >>> 8)
  18319. SUB_MIX[1][x] = (t << 16) | (t >>> 16)
  18320. SUB_MIX[2][x] = (t << 8) | (t >>> 24)
  18321. SUB_MIX[3][x] = t
  18322. // Compute inv sub bytes, inv mix columns tables
  18323. t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100)
  18324. INV_SUB_MIX[0][sx] = (t << 24) | (t >>> 8)
  18325. INV_SUB_MIX[1][sx] = (t << 16) | (t >>> 16)
  18326. INV_SUB_MIX[2][sx] = (t << 8) | (t >>> 24)
  18327. INV_SUB_MIX[3][sx] = t
  18328. if (x === 0) {
  18329. x = xi = 1
  18330. } else {
  18331. x = x2 ^ d[d[d[x8 ^ x2]]]
  18332. xi ^= d[d[xi]]
  18333. }
  18334. }
  18335. return {
  18336. SBOX: SBOX,
  18337. INV_SBOX: INV_SBOX,
  18338. SUB_MIX: SUB_MIX,
  18339. INV_SUB_MIX: INV_SUB_MIX
  18340. }
  18341. })()
  18342. function AES (key) {
  18343. this._key = asUInt32Array(key)
  18344. this._reset()
  18345. }
  18346. AES.blockSize = 4 * 4
  18347. AES.keySize = 256 / 8
  18348. AES.prototype.blockSize = AES.blockSize
  18349. AES.prototype.keySize = AES.keySize
  18350. AES.prototype._reset = function () {
  18351. var keyWords = this._key
  18352. var keySize = keyWords.length
  18353. var nRounds = keySize + 6
  18354. var ksRows = (nRounds + 1) * 4
  18355. var keySchedule = []
  18356. for (var k = 0; k < keySize; k++) {
  18357. keySchedule[k] = keyWords[k]
  18358. }
  18359. for (k = keySize; k < ksRows; k++) {
  18360. var t = keySchedule[k - 1]
  18361. if (k % keySize === 0) {
  18362. t = (t << 8) | (t >>> 24)
  18363. t =
  18364. (G.SBOX[t >>> 24] << 24) |
  18365. (G.SBOX[(t >>> 16) & 0xff] << 16) |
  18366. (G.SBOX[(t >>> 8) & 0xff] << 8) |
  18367. (G.SBOX[t & 0xff])
  18368. t ^= RCON[(k / keySize) | 0] << 24
  18369. } else if (keySize > 6 && k % keySize === 4) {
  18370. t =
  18371. (G.SBOX[t >>> 24] << 24) |
  18372. (G.SBOX[(t >>> 16) & 0xff] << 16) |
  18373. (G.SBOX[(t >>> 8) & 0xff] << 8) |
  18374. (G.SBOX[t & 0xff])
  18375. }
  18376. keySchedule[k] = keySchedule[k - keySize] ^ t
  18377. }
  18378. var invKeySchedule = []
  18379. for (var ik = 0; ik < ksRows; ik++) {
  18380. var ksR = ksRows - ik
  18381. var tt = keySchedule[ksR - (ik % 4 ? 0 : 4)]
  18382. if (ik < 4 || ksR <= 4) {
  18383. invKeySchedule[ik] = tt
  18384. } else {
  18385. invKeySchedule[ik] =
  18386. G.INV_SUB_MIX[0][G.SBOX[tt >>> 24]] ^
  18387. G.INV_SUB_MIX[1][G.SBOX[(tt >>> 16) & 0xff]] ^
  18388. G.INV_SUB_MIX[2][G.SBOX[(tt >>> 8) & 0xff]] ^
  18389. G.INV_SUB_MIX[3][G.SBOX[tt & 0xff]]
  18390. }
  18391. }
  18392. this._nRounds = nRounds
  18393. this._keySchedule = keySchedule
  18394. this._invKeySchedule = invKeySchedule
  18395. }
  18396. AES.prototype.encryptBlockRaw = function (M) {
  18397. M = asUInt32Array(M)
  18398. return cryptBlock(M, this._keySchedule, G.SUB_MIX, G.SBOX, this._nRounds)
  18399. }
  18400. AES.prototype.encryptBlock = function (M) {
  18401. var out = this.encryptBlockRaw(M)
  18402. var buf = Buffer.allocUnsafe(16)
  18403. buf.writeUInt32BE(out[0], 0)
  18404. buf.writeUInt32BE(out[1], 4)
  18405. buf.writeUInt32BE(out[2], 8)
  18406. buf.writeUInt32BE(out[3], 12)
  18407. return buf
  18408. }
  18409. AES.prototype.decryptBlock = function (M) {
  18410. M = asUInt32Array(M)
  18411. // swap
  18412. var m1 = M[1]
  18413. M[1] = M[3]
  18414. M[3] = m1
  18415. var out = cryptBlock(M, this._invKeySchedule, G.INV_SUB_MIX, G.INV_SBOX, this._nRounds)
  18416. var buf = Buffer.allocUnsafe(16)
  18417. buf.writeUInt32BE(out[0], 0)
  18418. buf.writeUInt32BE(out[3], 4)
  18419. buf.writeUInt32BE(out[2], 8)
  18420. buf.writeUInt32BE(out[1], 12)
  18421. return buf
  18422. }
  18423. AES.prototype.scrub = function () {
  18424. scrubVec(this._keySchedule)
  18425. scrubVec(this._invKeySchedule)
  18426. scrubVec(this._key)
  18427. }
  18428. module.exports.AES = AES
  18429. /***/ }),
  18430. /* 156 */
  18431. /*!**********************************************!*\
  18432. !*** ./node_modules/browserify-aes/ghash.js ***!
  18433. \**********************************************/
  18434. /*! no static exports found */
  18435. /***/ (function(module, exports, __webpack_require__) {
  18436. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  18437. var ZEROES = Buffer.alloc(16, 0)
  18438. function toArray (buf) {
  18439. return [
  18440. buf.readUInt32BE(0),
  18441. buf.readUInt32BE(4),
  18442. buf.readUInt32BE(8),
  18443. buf.readUInt32BE(12)
  18444. ]
  18445. }
  18446. function fromArray (out) {
  18447. var buf = Buffer.allocUnsafe(16)
  18448. buf.writeUInt32BE(out[0] >>> 0, 0)
  18449. buf.writeUInt32BE(out[1] >>> 0, 4)
  18450. buf.writeUInt32BE(out[2] >>> 0, 8)
  18451. buf.writeUInt32BE(out[3] >>> 0, 12)
  18452. return buf
  18453. }
  18454. function GHASH (key) {
  18455. this.h = key
  18456. this.state = Buffer.alloc(16, 0)
  18457. this.cache = Buffer.allocUnsafe(0)
  18458. }
  18459. // from http://bitwiseshiftleft.github.io/sjcl/doc/symbols/src/core_gcm.js.html
  18460. // by Juho Vähä-Herttua
  18461. GHASH.prototype.ghash = function (block) {
  18462. var i = -1
  18463. while (++i < block.length) {
  18464. this.state[i] ^= block[i]
  18465. }
  18466. this._multiply()
  18467. }
  18468. GHASH.prototype._multiply = function () {
  18469. var Vi = toArray(this.h)
  18470. var Zi = [0, 0, 0, 0]
  18471. var j, xi, lsbVi
  18472. var i = -1
  18473. while (++i < 128) {
  18474. xi = (this.state[~~(i / 8)] & (1 << (7 - (i % 8)))) !== 0
  18475. if (xi) {
  18476. // Z_i+1 = Z_i ^ V_i
  18477. Zi[0] ^= Vi[0]
  18478. Zi[1] ^= Vi[1]
  18479. Zi[2] ^= Vi[2]
  18480. Zi[3] ^= Vi[3]
  18481. }
  18482. // Store the value of LSB(V_i)
  18483. lsbVi = (Vi[3] & 1) !== 0
  18484. // V_i+1 = V_i >> 1
  18485. for (j = 3; j > 0; j--) {
  18486. Vi[j] = (Vi[j] >>> 1) | ((Vi[j - 1] & 1) << 31)
  18487. }
  18488. Vi[0] = Vi[0] >>> 1
  18489. // If LSB(V_i) is 1, V_i+1 = (V_i >> 1) ^ R
  18490. if (lsbVi) {
  18491. Vi[0] = Vi[0] ^ (0xe1 << 24)
  18492. }
  18493. }
  18494. this.state = fromArray(Zi)
  18495. }
  18496. GHASH.prototype.update = function (buf) {
  18497. this.cache = Buffer.concat([this.cache, buf])
  18498. var chunk
  18499. while (this.cache.length >= 16) {
  18500. chunk = this.cache.slice(0, 16)
  18501. this.cache = this.cache.slice(16)
  18502. this.ghash(chunk)
  18503. }
  18504. }
  18505. GHASH.prototype.final = function (abl, bl) {
  18506. if (this.cache.length) {
  18507. this.ghash(Buffer.concat([this.cache, ZEROES], 16))
  18508. }
  18509. this.ghash(fromArray([0, abl, 0, bl]))
  18510. return this.state
  18511. }
  18512. module.exports = GHASH
  18513. /***/ }),
  18514. /* 157 */
  18515. /*!*****************************************************!*\
  18516. !*** ./node_modules/browserify-aes/streamCipher.js ***!
  18517. \*****************************************************/
  18518. /*! no static exports found */
  18519. /***/ (function(module, exports, __webpack_require__) {
  18520. var aes = __webpack_require__(/*! ./aes */ 155)
  18521. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  18522. var Transform = __webpack_require__(/*! cipher-base */ 115)
  18523. var inherits = __webpack_require__(/*! inherits */ 87)
  18524. function StreamCipher (mode, key, iv, decrypt) {
  18525. Transform.call(this)
  18526. this._cipher = new aes.AES(key)
  18527. this._prev = Buffer.from(iv)
  18528. this._cache = Buffer.allocUnsafe(0)
  18529. this._secCache = Buffer.allocUnsafe(0)
  18530. this._decrypt = decrypt
  18531. this._mode = mode
  18532. }
  18533. inherits(StreamCipher, Transform)
  18534. StreamCipher.prototype._update = function (chunk) {
  18535. return this._mode.encrypt(this, chunk, this._decrypt)
  18536. }
  18537. StreamCipher.prototype._final = function () {
  18538. this._cipher.scrub()
  18539. }
  18540. module.exports = StreamCipher
  18541. /***/ }),
  18542. /* 158 */
  18543. /*!**********************************************!*\
  18544. !*** ./node_modules/evp_bytestokey/index.js ***!
  18545. \**********************************************/
  18546. /*! no static exports found */
  18547. /***/ (function(module, exports, __webpack_require__) {
  18548. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  18549. var MD5 = __webpack_require__(/*! md5.js */ 88)
  18550. /* eslint-disable camelcase */
  18551. function EVP_BytesToKey (password, salt, keyBits, ivLen) {
  18552. if (!Buffer.isBuffer(password)) password = Buffer.from(password, 'binary')
  18553. if (salt) {
  18554. if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, 'binary')
  18555. if (salt.length !== 8) throw new RangeError('salt should be Buffer with 8 byte length')
  18556. }
  18557. var keyLen = keyBits / 8
  18558. var key = Buffer.alloc(keyLen)
  18559. var iv = Buffer.alloc(ivLen || 0)
  18560. var tmp = Buffer.alloc(0)
  18561. while (keyLen > 0 || ivLen > 0) {
  18562. var hash = new MD5()
  18563. hash.update(tmp)
  18564. hash.update(password)
  18565. if (salt) hash.update(salt)
  18566. tmp = hash.digest()
  18567. var used = 0
  18568. if (keyLen > 0) {
  18569. var keyStart = key.length - keyLen
  18570. used = Math.min(keyLen, tmp.length)
  18571. tmp.copy(key, keyStart, 0, used)
  18572. keyLen -= used
  18573. }
  18574. if (used < tmp.length && ivLen > 0) {
  18575. var ivStart = iv.length - ivLen
  18576. var length = Math.min(ivLen, tmp.length - used)
  18577. tmp.copy(iv, ivStart, used, used + length)
  18578. ivLen -= length
  18579. }
  18580. }
  18581. tmp.fill(0)
  18582. return { key: key, iv: iv }
  18583. }
  18584. module.exports = EVP_BytesToKey
  18585. /***/ }),
  18586. /* 159 */
  18587. /*!**************************************************!*\
  18588. !*** ./node_modules/browserify-aes/decrypter.js ***!
  18589. \**************************************************/
  18590. /*! no static exports found */
  18591. /***/ (function(module, exports, __webpack_require__) {
  18592. var AuthCipher = __webpack_require__(/*! ./authCipher */ 154)
  18593. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  18594. var MODES = __webpack_require__(/*! ./modes */ 143)
  18595. var StreamCipher = __webpack_require__(/*! ./streamCipher */ 157)
  18596. var Transform = __webpack_require__(/*! cipher-base */ 115)
  18597. var aes = __webpack_require__(/*! ./aes */ 155)
  18598. var ebtk = __webpack_require__(/*! evp_bytestokey */ 158)
  18599. var inherits = __webpack_require__(/*! inherits */ 87)
  18600. function Decipher (mode, key, iv) {
  18601. Transform.call(this)
  18602. this._cache = new Splitter()
  18603. this._last = void 0
  18604. this._cipher = new aes.AES(key)
  18605. this._prev = Buffer.from(iv)
  18606. this._mode = mode
  18607. this._autopadding = true
  18608. }
  18609. inherits(Decipher, Transform)
  18610. Decipher.prototype._update = function (data) {
  18611. this._cache.add(data)
  18612. var chunk
  18613. var thing
  18614. var out = []
  18615. while ((chunk = this._cache.get(this._autopadding))) {
  18616. thing = this._mode.decrypt(this, chunk)
  18617. out.push(thing)
  18618. }
  18619. return Buffer.concat(out)
  18620. }
  18621. Decipher.prototype._final = function () {
  18622. var chunk = this._cache.flush()
  18623. if (this._autopadding) {
  18624. return unpad(this._mode.decrypt(this, chunk))
  18625. } else if (chunk) {
  18626. throw new Error('data not multiple of block length')
  18627. }
  18628. }
  18629. Decipher.prototype.setAutoPadding = function (setTo) {
  18630. this._autopadding = !!setTo
  18631. return this
  18632. }
  18633. function Splitter () {
  18634. this.cache = Buffer.allocUnsafe(0)
  18635. }
  18636. Splitter.prototype.add = function (data) {
  18637. this.cache = Buffer.concat([this.cache, data])
  18638. }
  18639. Splitter.prototype.get = function (autoPadding) {
  18640. var out
  18641. if (autoPadding) {
  18642. if (this.cache.length > 16) {
  18643. out = this.cache.slice(0, 16)
  18644. this.cache = this.cache.slice(16)
  18645. return out
  18646. }
  18647. } else {
  18648. if (this.cache.length >= 16) {
  18649. out = this.cache.slice(0, 16)
  18650. this.cache = this.cache.slice(16)
  18651. return out
  18652. }
  18653. }
  18654. return null
  18655. }
  18656. Splitter.prototype.flush = function () {
  18657. if (this.cache.length) return this.cache
  18658. }
  18659. function unpad (last) {
  18660. var padded = last[15]
  18661. if (padded < 1 || padded > 16) {
  18662. throw new Error('unable to decrypt data')
  18663. }
  18664. var i = -1
  18665. while (++i < padded) {
  18666. if (last[(i + (16 - padded))] !== padded) {
  18667. throw new Error('unable to decrypt data')
  18668. }
  18669. }
  18670. if (padded === 16) return
  18671. return last.slice(0, 16 - padded)
  18672. }
  18673. function createDecipheriv (suite, password, iv) {
  18674. var config = MODES[suite.toLowerCase()]
  18675. if (!config) throw new TypeError('invalid suite type')
  18676. if (typeof iv === 'string') iv = Buffer.from(iv)
  18677. if (config.mode !== 'GCM' && iv.length !== config.iv) throw new TypeError('invalid iv length ' + iv.length)
  18678. if (typeof password === 'string') password = Buffer.from(password)
  18679. if (password.length !== config.key / 8) throw new TypeError('invalid key length ' + password.length)
  18680. if (config.type === 'stream') {
  18681. return new StreamCipher(config.module, password, iv, true)
  18682. } else if (config.type === 'auth') {
  18683. return new AuthCipher(config.module, password, iv, true)
  18684. }
  18685. return new Decipher(config.module, password, iv)
  18686. }
  18687. function createDecipher (suite, password) {
  18688. var config = MODES[suite.toLowerCase()]
  18689. if (!config) throw new TypeError('invalid suite type')
  18690. var keys = ebtk(password, false, config.key, config.iv)
  18691. return createDecipheriv(suite, keys.key, keys.iv)
  18692. }
  18693. exports.createDecipher = createDecipher
  18694. exports.createDecipheriv = createDecipheriv
  18695. /***/ }),
  18696. /* 160 */
  18697. /*!**********************************************!*\
  18698. !*** ./node_modules/browserify-des/modes.js ***!
  18699. \**********************************************/
  18700. /*! no static exports found */
  18701. /***/ (function(module, exports) {
  18702. exports['des-ecb'] = {
  18703. key: 8,
  18704. iv: 0
  18705. }
  18706. exports['des-cbc'] = exports.des = {
  18707. key: 8,
  18708. iv: 8
  18709. }
  18710. exports['des-ede3-cbc'] = exports.des3 = {
  18711. key: 24,
  18712. iv: 8
  18713. }
  18714. exports['des-ede3'] = {
  18715. key: 24,
  18716. iv: 0
  18717. }
  18718. exports['des-ede-cbc'] = {
  18719. key: 16,
  18720. iv: 8
  18721. }
  18722. exports['des-ede'] = {
  18723. key: 16,
  18724. iv: 0
  18725. }
  18726. /***/ }),
  18727. /* 161 */
  18728. /*!************************************************!*\
  18729. !*** ./node_modules/diffie-hellman/browser.js ***!
  18730. \************************************************/
  18731. /*! no static exports found */
  18732. /***/ (function(module, exports, __webpack_require__) {
  18733. /* WEBPACK VAR INJECTION */(function(Buffer) {var generatePrime = __webpack_require__(/*! ./lib/generatePrime */ 162)
  18734. var primes = __webpack_require__(/*! ./lib/primes.json */ 169)
  18735. var DH = __webpack_require__(/*! ./lib/dh */ 170)
  18736. function getDiffieHellman (mod) {
  18737. var prime = new Buffer(primes[mod].prime, 'hex')
  18738. var gen = new Buffer(primes[mod].gen, 'hex')
  18739. return new DH(prime, gen)
  18740. }
  18741. var ENCODINGS = {
  18742. 'binary': true, 'hex': true, 'base64': true
  18743. }
  18744. function createDiffieHellman (prime, enc, generator, genc) {
  18745. if (Buffer.isBuffer(enc) || ENCODINGS[enc] === undefined) {
  18746. return createDiffieHellman(prime, 'binary', enc, generator)
  18747. }
  18748. enc = enc || 'binary'
  18749. genc = genc || 'binary'
  18750. generator = generator || new Buffer([2])
  18751. if (!Buffer.isBuffer(generator)) {
  18752. generator = new Buffer(generator, genc)
  18753. }
  18754. if (typeof prime === 'number') {
  18755. return new DH(generatePrime(prime, generator), generator, true)
  18756. }
  18757. if (!Buffer.isBuffer(prime)) {
  18758. prime = new Buffer(prime, enc)
  18759. }
  18760. return new DH(prime, generator, true)
  18761. }
  18762. exports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffieHellman = getDiffieHellman
  18763. exports.createDiffieHellman = exports.DiffieHellman = createDiffieHellman
  18764. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ 82).Buffer))
  18765. /***/ }),
  18766. /* 162 */
  18767. /*!**********************************************************!*\
  18768. !*** ./node_modules/diffie-hellman/lib/generatePrime.js ***!
  18769. \**********************************************************/
  18770. /*! no static exports found */
  18771. /***/ (function(module, exports, __webpack_require__) {
  18772. var randomBytes = __webpack_require__(/*! randombytes */ 78);
  18773. module.exports = findPrime;
  18774. findPrime.simpleSieve = simpleSieve;
  18775. findPrime.fermatTest = fermatTest;
  18776. var BN = __webpack_require__(/*! bn.js */ 163);
  18777. var TWENTYFOUR = new BN(24);
  18778. var MillerRabin = __webpack_require__(/*! miller-rabin */ 166);
  18779. var millerRabin = new MillerRabin();
  18780. var ONE = new BN(1);
  18781. var TWO = new BN(2);
  18782. var FIVE = new BN(5);
  18783. var SIXTEEN = new BN(16);
  18784. var EIGHT = new BN(8);
  18785. var TEN = new BN(10);
  18786. var THREE = new BN(3);
  18787. var SEVEN = new BN(7);
  18788. var ELEVEN = new BN(11);
  18789. var FOUR = new BN(4);
  18790. var TWELVE = new BN(12);
  18791. var primes = null;
  18792. function _getPrimes() {
  18793. if (primes !== null)
  18794. return primes;
  18795. var limit = 0x100000;
  18796. var res = [];
  18797. res[0] = 2;
  18798. for (var i = 1, k = 3; k < limit; k += 2) {
  18799. var sqrt = Math.ceil(Math.sqrt(k));
  18800. for (var j = 0; j < i && res[j] <= sqrt; j++)
  18801. if (k % res[j] === 0)
  18802. break;
  18803. if (i !== j && res[j] <= sqrt)
  18804. continue;
  18805. res[i++] = k;
  18806. }
  18807. primes = res;
  18808. return res;
  18809. }
  18810. function simpleSieve(p) {
  18811. var primes = _getPrimes();
  18812. for (var i = 0; i < primes.length; i++)
  18813. if (p.modn(primes[i]) === 0) {
  18814. if (p.cmpn(primes[i]) === 0) {
  18815. return true;
  18816. } else {
  18817. return false;
  18818. }
  18819. }
  18820. return true;
  18821. }
  18822. function fermatTest(p) {
  18823. var red = BN.mont(p);
  18824. return TWO.toRed(red).redPow(p.subn(1)).fromRed().cmpn(1) === 0;
  18825. }
  18826. function findPrime(bits, gen) {
  18827. if (bits < 16) {
  18828. // this is what openssl does
  18829. if (gen === 2 || gen === 5) {
  18830. return new BN([0x8c, 0x7b]);
  18831. } else {
  18832. return new BN([0x8c, 0x27]);
  18833. }
  18834. }
  18835. gen = new BN(gen);
  18836. var num, n2;
  18837. while (true) {
  18838. num = new BN(randomBytes(Math.ceil(bits / 8)));
  18839. while (num.bitLength() > bits) {
  18840. num.ishrn(1);
  18841. }
  18842. if (num.isEven()) {
  18843. num.iadd(ONE);
  18844. }
  18845. if (!num.testn(1)) {
  18846. num.iadd(TWO);
  18847. }
  18848. if (!gen.cmp(TWO)) {
  18849. while (num.mod(TWENTYFOUR).cmp(ELEVEN)) {
  18850. num.iadd(FOUR);
  18851. }
  18852. } else if (!gen.cmp(FIVE)) {
  18853. while (num.mod(TEN).cmp(THREE)) {
  18854. num.iadd(FOUR);
  18855. }
  18856. }
  18857. n2 = num.shrn(1);
  18858. if (simpleSieve(n2) && simpleSieve(num) &&
  18859. fermatTest(n2) && fermatTest(num) &&
  18860. millerRabin.test(n2) && millerRabin.test(num)) {
  18861. return num;
  18862. }
  18863. }
  18864. }
  18865. /***/ }),
  18866. /* 163 */
  18867. /*!**************************************!*\
  18868. !*** ./node_modules/bn.js/lib/bn.js ***!
  18869. \**************************************/
  18870. /*! no static exports found */
  18871. /***/ (function(module, exports, __webpack_require__) {
  18872. /* WEBPACK VAR INJECTION */(function(module) {(function (module, exports) {
  18873. 'use strict';
  18874. // Utils
  18875. function assert (val, msg) {
  18876. if (!val) throw new Error(msg || 'Assertion failed');
  18877. }
  18878. // Could use `inherits` module, but don't want to move from single file
  18879. // architecture yet.
  18880. function inherits (ctor, superCtor) {
  18881. ctor.super_ = superCtor;
  18882. var TempCtor = function () {};
  18883. TempCtor.prototype = superCtor.prototype;
  18884. ctor.prototype = new TempCtor();
  18885. ctor.prototype.constructor = ctor;
  18886. }
  18887. // BN
  18888. function BN (number, base, endian) {
  18889. if (BN.isBN(number)) {
  18890. return number;
  18891. }
  18892. this.negative = 0;
  18893. this.words = null;
  18894. this.length = 0;
  18895. // Reduction context
  18896. this.red = null;
  18897. if (number !== null) {
  18898. if (base === 'le' || base === 'be') {
  18899. endian = base;
  18900. base = 10;
  18901. }
  18902. this._init(number || 0, base || 10, endian || 'be');
  18903. }
  18904. }
  18905. if (typeof module === 'object') {
  18906. module.exports = BN;
  18907. } else {
  18908. exports.BN = BN;
  18909. }
  18910. BN.BN = BN;
  18911. BN.wordSize = 26;
  18912. var Buffer;
  18913. try {
  18914. Buffer = __webpack_require__(/*! buffer */ 165).Buffer;
  18915. } catch (e) {
  18916. }
  18917. BN.isBN = function isBN (num) {
  18918. if (num instanceof BN) {
  18919. return true;
  18920. }
  18921. return num !== null && typeof num === 'object' &&
  18922. num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);
  18923. };
  18924. BN.max = function max (left, right) {
  18925. if (left.cmp(right) > 0) return left;
  18926. return right;
  18927. };
  18928. BN.min = function min (left, right) {
  18929. if (left.cmp(right) < 0) return left;
  18930. return right;
  18931. };
  18932. BN.prototype._init = function init (number, base, endian) {
  18933. if (typeof number === 'number') {
  18934. return this._initNumber(number, base, endian);
  18935. }
  18936. if (typeof number === 'object') {
  18937. return this._initArray(number, base, endian);
  18938. }
  18939. if (base === 'hex') {
  18940. base = 16;
  18941. }
  18942. assert(base === (base | 0) && base >= 2 && base <= 36);
  18943. number = number.toString().replace(/\s+/g, '');
  18944. var start = 0;
  18945. if (number[0] === '-') {
  18946. start++;
  18947. }
  18948. if (base === 16) {
  18949. this._parseHex(number, start);
  18950. } else {
  18951. this._parseBase(number, base, start);
  18952. }
  18953. if (number[0] === '-') {
  18954. this.negative = 1;
  18955. }
  18956. this._strip();
  18957. if (endian !== 'le') return;
  18958. this._initArray(this.toArray(), base, endian);
  18959. };
  18960. BN.prototype._initNumber = function _initNumber (number, base, endian) {
  18961. if (number < 0) {
  18962. this.negative = 1;
  18963. number = -number;
  18964. }
  18965. if (number < 0x4000000) {
  18966. this.words = [number & 0x3ffffff];
  18967. this.length = 1;
  18968. } else if (number < 0x10000000000000) {
  18969. this.words = [
  18970. number & 0x3ffffff,
  18971. (number / 0x4000000) & 0x3ffffff
  18972. ];
  18973. this.length = 2;
  18974. } else {
  18975. assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)
  18976. this.words = [
  18977. number & 0x3ffffff,
  18978. (number / 0x4000000) & 0x3ffffff,
  18979. 1
  18980. ];
  18981. this.length = 3;
  18982. }
  18983. if (endian !== 'le') return;
  18984. // Reverse the bytes
  18985. this._initArray(this.toArray(), base, endian);
  18986. };
  18987. BN.prototype._initArray = function _initArray (number, base, endian) {
  18988. // Perhaps a Uint8Array
  18989. assert(typeof number.length === 'number');
  18990. if (number.length <= 0) {
  18991. this.words = [0];
  18992. this.length = 1;
  18993. return this;
  18994. }
  18995. this.length = Math.ceil(number.length / 3);
  18996. this.words = new Array(this.length);
  18997. for (var i = 0; i < this.length; i++) {
  18998. this.words[i] = 0;
  18999. }
  19000. var j, w;
  19001. var off = 0;
  19002. if (endian === 'be') {
  19003. for (i = number.length - 1, j = 0; i >= 0; i -= 3) {
  19004. w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);
  19005. this.words[j] |= (w << off) & 0x3ffffff;
  19006. this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;
  19007. off += 24;
  19008. if (off >= 26) {
  19009. off -= 26;
  19010. j++;
  19011. }
  19012. }
  19013. } else if (endian === 'le') {
  19014. for (i = 0, j = 0; i < number.length; i += 3) {
  19015. w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);
  19016. this.words[j] |= (w << off) & 0x3ffffff;
  19017. this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;
  19018. off += 24;
  19019. if (off >= 26) {
  19020. off -= 26;
  19021. j++;
  19022. }
  19023. }
  19024. }
  19025. return this._strip();
  19026. };
  19027. function parseHex (str, start, end) {
  19028. var r = 0;
  19029. var len = Math.min(str.length, end);
  19030. var z = 0;
  19031. for (var i = start; i < len; i++) {
  19032. var c = str.charCodeAt(i) - 48;
  19033. r <<= 4;
  19034. var b;
  19035. // 'a' - 'f'
  19036. if (c >= 49 && c <= 54) {
  19037. b = c - 49 + 0xa;
  19038. // 'A' - 'F'
  19039. } else if (c >= 17 && c <= 22) {
  19040. b = c - 17 + 0xa;
  19041. // '0' - '9'
  19042. } else {
  19043. b = c;
  19044. }
  19045. r |= b;
  19046. z |= b;
  19047. }
  19048. assert(!(z & 0xf0), 'Invalid character in ' + str);
  19049. return r;
  19050. }
  19051. BN.prototype._parseHex = function _parseHex (number, start) {
  19052. // Create possibly bigger array to ensure that it fits the number
  19053. this.length = Math.ceil((number.length - start) / 6);
  19054. this.words = new Array(this.length);
  19055. for (var i = 0; i < this.length; i++) {
  19056. this.words[i] = 0;
  19057. }
  19058. var j, w;
  19059. // Scan 24-bit chunks and add them to the number
  19060. var off = 0;
  19061. for (i = number.length - 6, j = 0; i >= start; i -= 6) {
  19062. w = parseHex(number, i, i + 6);
  19063. this.words[j] |= (w << off) & 0x3ffffff;
  19064. // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb
  19065. this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;
  19066. off += 24;
  19067. if (off >= 26) {
  19068. off -= 26;
  19069. j++;
  19070. }
  19071. }
  19072. if (i + 6 !== start) {
  19073. w = parseHex(number, start, i + 6);
  19074. this.words[j] |= (w << off) & 0x3ffffff;
  19075. this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;
  19076. }
  19077. this._strip();
  19078. };
  19079. function parseBase (str, start, end, mul) {
  19080. var r = 0;
  19081. var b = 0;
  19082. var len = Math.min(str.length, end);
  19083. for (var i = start; i < len; i++) {
  19084. var c = str.charCodeAt(i) - 48;
  19085. r *= mul;
  19086. // 'a'
  19087. if (c >= 49) {
  19088. b = c - 49 + 0xa;
  19089. // 'A'
  19090. } else if (c >= 17) {
  19091. b = c - 17 + 0xa;
  19092. // '0' - '9'
  19093. } else {
  19094. b = c;
  19095. }
  19096. assert(c >= 0 && b < mul, 'Invalid character');
  19097. r += b;
  19098. }
  19099. return r;
  19100. }
  19101. BN.prototype._parseBase = function _parseBase (number, base, start) {
  19102. // Initialize as zero
  19103. this.words = [0];
  19104. this.length = 1;
  19105. // Find length of limb in base
  19106. for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {
  19107. limbLen++;
  19108. }
  19109. limbLen--;
  19110. limbPow = (limbPow / base) | 0;
  19111. var total = number.length - start;
  19112. var mod = total % limbLen;
  19113. var end = Math.min(total, total - mod) + start;
  19114. var word = 0;
  19115. for (var i = start; i < end; i += limbLen) {
  19116. word = parseBase(number, i, i + limbLen, base);
  19117. this.imuln(limbPow);
  19118. if (this.words[0] + word < 0x4000000) {
  19119. this.words[0] += word;
  19120. } else {
  19121. this._iaddn(word);
  19122. }
  19123. }
  19124. if (mod !== 0) {
  19125. var pow = 1;
  19126. word = parseBase(number, i, number.length, base);
  19127. for (i = 0; i < mod; i++) {
  19128. pow *= base;
  19129. }
  19130. this.imuln(pow);
  19131. if (this.words[0] + word < 0x4000000) {
  19132. this.words[0] += word;
  19133. } else {
  19134. this._iaddn(word);
  19135. }
  19136. }
  19137. };
  19138. BN.prototype.copy = function copy (dest) {
  19139. dest.words = new Array(this.length);
  19140. for (var i = 0; i < this.length; i++) {
  19141. dest.words[i] = this.words[i];
  19142. }
  19143. dest.length = this.length;
  19144. dest.negative = this.negative;
  19145. dest.red = this.red;
  19146. };
  19147. function move (dest, src) {
  19148. dest.words = src.words;
  19149. dest.length = src.length;
  19150. dest.negative = src.negative;
  19151. dest.red = src.red;
  19152. }
  19153. BN.prototype._move = function _move (dest) {
  19154. move(dest, this);
  19155. };
  19156. BN.prototype.clone = function clone () {
  19157. var r = new BN(null);
  19158. this.copy(r);
  19159. return r;
  19160. };
  19161. BN.prototype._expand = function _expand (size) {
  19162. while (this.length < size) {
  19163. this.words[this.length++] = 0;
  19164. }
  19165. return this;
  19166. };
  19167. // Remove leading `0` from `this`
  19168. BN.prototype._strip = function strip () {
  19169. while (this.length > 1 && this.words[this.length - 1] === 0) {
  19170. this.length--;
  19171. }
  19172. return this._normSign();
  19173. };
  19174. BN.prototype._normSign = function _normSign () {
  19175. // -0 = 0
  19176. if (this.length === 1 && this.words[0] === 0) {
  19177. this.negative = 0;
  19178. }
  19179. return this;
  19180. };
  19181. // Check Symbol.for because not everywhere where Symbol defined
  19182. // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#Browser_compatibility
  19183. if (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function') {
  19184. BN.prototype[Symbol.for('nodejs.util.inspect.custom')] = inspect;
  19185. } else {
  19186. BN.prototype.inspect = inspect;
  19187. }
  19188. function inspect () {
  19189. return (this.red ? '<BN-R: ' : '<BN: ') + this.toString(16) + '>';
  19190. }
  19191. /*
  19192. var zeros = [];
  19193. var groupSizes = [];
  19194. var groupBases = [];
  19195. var s = '';
  19196. var i = -1;
  19197. while (++i < BN.wordSize) {
  19198. zeros[i] = s;
  19199. s += '0';
  19200. }
  19201. groupSizes[0] = 0;
  19202. groupSizes[1] = 0;
  19203. groupBases[0] = 0;
  19204. groupBases[1] = 0;
  19205. var base = 2 - 1;
  19206. while (++base < 36 + 1) {
  19207. var groupSize = 0;
  19208. var groupBase = 1;
  19209. while (groupBase < (1 << BN.wordSize) / base) {
  19210. groupBase *= base;
  19211. groupSize += 1;
  19212. }
  19213. groupSizes[base] = groupSize;
  19214. groupBases[base] = groupBase;
  19215. }
  19216. */
  19217. var zeros = [
  19218. '',
  19219. '0',
  19220. '00',
  19221. '000',
  19222. '0000',
  19223. '00000',
  19224. '000000',
  19225. '0000000',
  19226. '00000000',
  19227. '000000000',
  19228. '0000000000',
  19229. '00000000000',
  19230. '000000000000',
  19231. '0000000000000',
  19232. '00000000000000',
  19233. '000000000000000',
  19234. '0000000000000000',
  19235. '00000000000000000',
  19236. '000000000000000000',
  19237. '0000000000000000000',
  19238. '00000000000000000000',
  19239. '000000000000000000000',
  19240. '0000000000000000000000',
  19241. '00000000000000000000000',
  19242. '000000000000000000000000',
  19243. '0000000000000000000000000'
  19244. ];
  19245. var groupSizes = [
  19246. 0, 0,
  19247. 25, 16, 12, 11, 10, 9, 8,
  19248. 8, 7, 7, 7, 7, 6, 6,
  19249. 6, 6, 6, 6, 6, 5, 5,
  19250. 5, 5, 5, 5, 5, 5, 5,
  19251. 5, 5, 5, 5, 5, 5, 5
  19252. ];
  19253. var groupBases = [
  19254. 0, 0,
  19255. 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,
  19256. 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,
  19257. 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,
  19258. 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,
  19259. 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176
  19260. ];
  19261. BN.prototype.toString = function toString (base, padding) {
  19262. base = base || 10;
  19263. padding = padding | 0 || 1;
  19264. var out;
  19265. if (base === 16 || base === 'hex') {
  19266. out = '';
  19267. var off = 0;
  19268. var carry = 0;
  19269. for (var i = 0; i < this.length; i++) {
  19270. var w = this.words[i];
  19271. var word = (((w << off) | carry) & 0xffffff).toString(16);
  19272. carry = (w >>> (24 - off)) & 0xffffff;
  19273. if (carry !== 0 || i !== this.length - 1) {
  19274. out = zeros[6 - word.length] + word + out;
  19275. } else {
  19276. out = word + out;
  19277. }
  19278. off += 2;
  19279. if (off >= 26) {
  19280. off -= 26;
  19281. i--;
  19282. }
  19283. }
  19284. if (carry !== 0) {
  19285. out = carry.toString(16) + out;
  19286. }
  19287. while (out.length % padding !== 0) {
  19288. out = '0' + out;
  19289. }
  19290. if (this.negative !== 0) {
  19291. out = '-' + out;
  19292. }
  19293. return out;
  19294. }
  19295. if (base === (base | 0) && base >= 2 && base <= 36) {
  19296. // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));
  19297. var groupSize = groupSizes[base];
  19298. // var groupBase = Math.pow(base, groupSize);
  19299. var groupBase = groupBases[base];
  19300. out = '';
  19301. var c = this.clone();
  19302. c.negative = 0;
  19303. while (!c.isZero()) {
  19304. var r = c.modrn(groupBase).toString(base);
  19305. c = c.idivn(groupBase);
  19306. if (!c.isZero()) {
  19307. out = zeros[groupSize - r.length] + r + out;
  19308. } else {
  19309. out = r + out;
  19310. }
  19311. }
  19312. if (this.isZero()) {
  19313. out = '0' + out;
  19314. }
  19315. while (out.length % padding !== 0) {
  19316. out = '0' + out;
  19317. }
  19318. if (this.negative !== 0) {
  19319. out = '-' + out;
  19320. }
  19321. return out;
  19322. }
  19323. assert(false, 'Base should be between 2 and 36');
  19324. };
  19325. BN.prototype.toNumber = function toNumber () {
  19326. var ret = this.words[0];
  19327. if (this.length === 2) {
  19328. ret += this.words[1] * 0x4000000;
  19329. } else if (this.length === 3 && this.words[2] === 0x01) {
  19330. // NOTE: at this stage it is known that the top bit is set
  19331. ret += 0x10000000000000 + (this.words[1] * 0x4000000);
  19332. } else if (this.length > 2) {
  19333. assert(false, 'Number can only safely store up to 53 bits');
  19334. }
  19335. return (this.negative !== 0) ? -ret : ret;
  19336. };
  19337. BN.prototype.toJSON = function toJSON () {
  19338. return this.toString(16, 2);
  19339. };
  19340. if (Buffer) {
  19341. BN.prototype.toBuffer = function toBuffer (endian, length) {
  19342. return this.toArrayLike(Buffer, endian, length);
  19343. };
  19344. }
  19345. BN.prototype.toArray = function toArray (endian, length) {
  19346. return this.toArrayLike(Array, endian, length);
  19347. };
  19348. var allocate = function allocate (ArrayType, size) {
  19349. if (ArrayType.allocUnsafe) {
  19350. return ArrayType.allocUnsafe(size);
  19351. }
  19352. return new ArrayType(size);
  19353. };
  19354. BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {
  19355. this._strip();
  19356. var byteLength = this.byteLength();
  19357. var reqLength = length || Math.max(1, byteLength);
  19358. assert(byteLength <= reqLength, 'byte array longer than desired length');
  19359. assert(reqLength > 0, 'Requested array length <= 0');
  19360. var res = allocate(ArrayType, reqLength);
  19361. var postfix = endian === 'le' ? 'LE' : 'BE';
  19362. this['_toArrayLike' + postfix](res, byteLength);
  19363. return res;
  19364. };
  19365. BN.prototype._toArrayLikeLE = function _toArrayLikeLE (res, byteLength) {
  19366. var position = 0;
  19367. var carry = 0;
  19368. for (var i = 0, shift = 0; i < this.length; i++) {
  19369. var word = (this.words[i] << shift) | carry;
  19370. res[position++] = word & 0xff;
  19371. if (position < res.length) {
  19372. res[position++] = (word >> 8) & 0xff;
  19373. }
  19374. if (position < res.length) {
  19375. res[position++] = (word >> 16) & 0xff;
  19376. }
  19377. if (shift === 6) {
  19378. if (position < res.length) {
  19379. res[position++] = (word >> 24) & 0xff;
  19380. }
  19381. carry = 0;
  19382. shift = 0;
  19383. } else {
  19384. carry = word >>> 24;
  19385. shift += 2;
  19386. }
  19387. }
  19388. if (position < res.length) {
  19389. res[position++] = carry;
  19390. while (position < res.length) {
  19391. res[position++] = 0;
  19392. }
  19393. }
  19394. };
  19395. BN.prototype._toArrayLikeBE = function _toArrayLikeBE (res, byteLength) {
  19396. var position = res.length - 1;
  19397. var carry = 0;
  19398. for (var i = 0, shift = 0; i < this.length; i++) {
  19399. var word = (this.words[i] << shift) | carry;
  19400. res[position--] = word & 0xff;
  19401. if (position >= 0) {
  19402. res[position--] = (word >> 8) & 0xff;
  19403. }
  19404. if (position >= 0) {
  19405. res[position--] = (word >> 16) & 0xff;
  19406. }
  19407. if (shift === 6) {
  19408. if (position >= 0) {
  19409. res[position--] = (word >> 24) & 0xff;
  19410. }
  19411. carry = 0;
  19412. shift = 0;
  19413. } else {
  19414. carry = word >>> 24;
  19415. shift += 2;
  19416. }
  19417. }
  19418. if (position >= 0) {
  19419. res[position--] = carry;
  19420. while (position >= 0) {
  19421. res[position--] = 0;
  19422. }
  19423. }
  19424. };
  19425. if (Math.clz32) {
  19426. BN.prototype._countBits = function _countBits (w) {
  19427. return 32 - Math.clz32(w);
  19428. };
  19429. } else {
  19430. BN.prototype._countBits = function _countBits (w) {
  19431. var t = w;
  19432. var r = 0;
  19433. if (t >= 0x1000) {
  19434. r += 13;
  19435. t >>>= 13;
  19436. }
  19437. if (t >= 0x40) {
  19438. r += 7;
  19439. t >>>= 7;
  19440. }
  19441. if (t >= 0x8) {
  19442. r += 4;
  19443. t >>>= 4;
  19444. }
  19445. if (t >= 0x02) {
  19446. r += 2;
  19447. t >>>= 2;
  19448. }
  19449. return r + t;
  19450. };
  19451. }
  19452. BN.prototype._zeroBits = function _zeroBits (w) {
  19453. // Short-cut
  19454. if (w === 0) return 26;
  19455. var t = w;
  19456. var r = 0;
  19457. if ((t & 0x1fff) === 0) {
  19458. r += 13;
  19459. t >>>= 13;
  19460. }
  19461. if ((t & 0x7f) === 0) {
  19462. r += 7;
  19463. t >>>= 7;
  19464. }
  19465. if ((t & 0xf) === 0) {
  19466. r += 4;
  19467. t >>>= 4;
  19468. }
  19469. if ((t & 0x3) === 0) {
  19470. r += 2;
  19471. t >>>= 2;
  19472. }
  19473. if ((t & 0x1) === 0) {
  19474. r++;
  19475. }
  19476. return r;
  19477. };
  19478. // Return number of used bits in a BN
  19479. BN.prototype.bitLength = function bitLength () {
  19480. var w = this.words[this.length - 1];
  19481. var hi = this._countBits(w);
  19482. return (this.length - 1) * 26 + hi;
  19483. };
  19484. function toBitArray (num) {
  19485. var w = new Array(num.bitLength());
  19486. for (var bit = 0; bit < w.length; bit++) {
  19487. var off = (bit / 26) | 0;
  19488. var wbit = bit % 26;
  19489. w[bit] = (num.words[off] >>> wbit) & 0x01;
  19490. }
  19491. return w;
  19492. }
  19493. // Number of trailing zero bits
  19494. BN.prototype.zeroBits = function zeroBits () {
  19495. if (this.isZero()) return 0;
  19496. var r = 0;
  19497. for (var i = 0; i < this.length; i++) {
  19498. var b = this._zeroBits(this.words[i]);
  19499. r += b;
  19500. if (b !== 26) break;
  19501. }
  19502. return r;
  19503. };
  19504. BN.prototype.byteLength = function byteLength () {
  19505. return Math.ceil(this.bitLength() / 8);
  19506. };
  19507. BN.prototype.toTwos = function toTwos (width) {
  19508. if (this.negative !== 0) {
  19509. return this.abs().inotn(width).iaddn(1);
  19510. }
  19511. return this.clone();
  19512. };
  19513. BN.prototype.fromTwos = function fromTwos (width) {
  19514. if (this.testn(width - 1)) {
  19515. return this.notn(width).iaddn(1).ineg();
  19516. }
  19517. return this.clone();
  19518. };
  19519. BN.prototype.isNeg = function isNeg () {
  19520. return this.negative !== 0;
  19521. };
  19522. // Return negative clone of `this`
  19523. BN.prototype.neg = function neg () {
  19524. return this.clone().ineg();
  19525. };
  19526. BN.prototype.ineg = function ineg () {
  19527. if (!this.isZero()) {
  19528. this.negative ^= 1;
  19529. }
  19530. return this;
  19531. };
  19532. // Or `num` with `this` in-place
  19533. BN.prototype.iuor = function iuor (num) {
  19534. while (this.length < num.length) {
  19535. this.words[this.length++] = 0;
  19536. }
  19537. for (var i = 0; i < num.length; i++) {
  19538. this.words[i] = this.words[i] | num.words[i];
  19539. }
  19540. return this._strip();
  19541. };
  19542. BN.prototype.ior = function ior (num) {
  19543. assert((this.negative | num.negative) === 0);
  19544. return this.iuor(num);
  19545. };
  19546. // Or `num` with `this`
  19547. BN.prototype.or = function or (num) {
  19548. if (this.length > num.length) return this.clone().ior(num);
  19549. return num.clone().ior(this);
  19550. };
  19551. BN.prototype.uor = function uor (num) {
  19552. if (this.length > num.length) return this.clone().iuor(num);
  19553. return num.clone().iuor(this);
  19554. };
  19555. // And `num` with `this` in-place
  19556. BN.prototype.iuand = function iuand (num) {
  19557. // b = min-length(num, this)
  19558. var b;
  19559. if (this.length > num.length) {
  19560. b = num;
  19561. } else {
  19562. b = this;
  19563. }
  19564. for (var i = 0; i < b.length; i++) {
  19565. this.words[i] = this.words[i] & num.words[i];
  19566. }
  19567. this.length = b.length;
  19568. return this._strip();
  19569. };
  19570. BN.prototype.iand = function iand (num) {
  19571. assert((this.negative | num.negative) === 0);
  19572. return this.iuand(num);
  19573. };
  19574. // And `num` with `this`
  19575. BN.prototype.and = function and (num) {
  19576. if (this.length > num.length) return this.clone().iand(num);
  19577. return num.clone().iand(this);
  19578. };
  19579. BN.prototype.uand = function uand (num) {
  19580. if (this.length > num.length) return this.clone().iuand(num);
  19581. return num.clone().iuand(this);
  19582. };
  19583. // Xor `num` with `this` in-place
  19584. BN.prototype.iuxor = function iuxor (num) {
  19585. // a.length > b.length
  19586. var a;
  19587. var b;
  19588. if (this.length > num.length) {
  19589. a = this;
  19590. b = num;
  19591. } else {
  19592. a = num;
  19593. b = this;
  19594. }
  19595. for (var i = 0; i < b.length; i++) {
  19596. this.words[i] = a.words[i] ^ b.words[i];
  19597. }
  19598. if (this !== a) {
  19599. for (; i < a.length; i++) {
  19600. this.words[i] = a.words[i];
  19601. }
  19602. }
  19603. this.length = a.length;
  19604. return this._strip();
  19605. };
  19606. BN.prototype.ixor = function ixor (num) {
  19607. assert((this.negative | num.negative) === 0);
  19608. return this.iuxor(num);
  19609. };
  19610. // Xor `num` with `this`
  19611. BN.prototype.xor = function xor (num) {
  19612. if (this.length > num.length) return this.clone().ixor(num);
  19613. return num.clone().ixor(this);
  19614. };
  19615. BN.prototype.uxor = function uxor (num) {
  19616. if (this.length > num.length) return this.clone().iuxor(num);
  19617. return num.clone().iuxor(this);
  19618. };
  19619. // Not ``this`` with ``width`` bitwidth
  19620. BN.prototype.inotn = function inotn (width) {
  19621. assert(typeof width === 'number' && width >= 0);
  19622. var bytesNeeded = Math.ceil(width / 26) | 0;
  19623. var bitsLeft = width % 26;
  19624. // Extend the buffer with leading zeroes
  19625. this._expand(bytesNeeded);
  19626. if (bitsLeft > 0) {
  19627. bytesNeeded--;
  19628. }
  19629. // Handle complete words
  19630. for (var i = 0; i < bytesNeeded; i++) {
  19631. this.words[i] = ~this.words[i] & 0x3ffffff;
  19632. }
  19633. // Handle the residue
  19634. if (bitsLeft > 0) {
  19635. this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));
  19636. }
  19637. // And remove leading zeroes
  19638. return this._strip();
  19639. };
  19640. BN.prototype.notn = function notn (width) {
  19641. return this.clone().inotn(width);
  19642. };
  19643. // Set `bit` of `this`
  19644. BN.prototype.setn = function setn (bit, val) {
  19645. assert(typeof bit === 'number' && bit >= 0);
  19646. var off = (bit / 26) | 0;
  19647. var wbit = bit % 26;
  19648. this._expand(off + 1);
  19649. if (val) {
  19650. this.words[off] = this.words[off] | (1 << wbit);
  19651. } else {
  19652. this.words[off] = this.words[off] & ~(1 << wbit);
  19653. }
  19654. return this._strip();
  19655. };
  19656. // Add `num` to `this` in-place
  19657. BN.prototype.iadd = function iadd (num) {
  19658. var r;
  19659. // negative + positive
  19660. if (this.negative !== 0 && num.negative === 0) {
  19661. this.negative = 0;
  19662. r = this.isub(num);
  19663. this.negative ^= 1;
  19664. return this._normSign();
  19665. // positive + negative
  19666. } else if (this.negative === 0 && num.negative !== 0) {
  19667. num.negative = 0;
  19668. r = this.isub(num);
  19669. num.negative = 1;
  19670. return r._normSign();
  19671. }
  19672. // a.length > b.length
  19673. var a, b;
  19674. if (this.length > num.length) {
  19675. a = this;
  19676. b = num;
  19677. } else {
  19678. a = num;
  19679. b = this;
  19680. }
  19681. var carry = 0;
  19682. for (var i = 0; i < b.length; i++) {
  19683. r = (a.words[i] | 0) + (b.words[i] | 0) + carry;
  19684. this.words[i] = r & 0x3ffffff;
  19685. carry = r >>> 26;
  19686. }
  19687. for (; carry !== 0 && i < a.length; i++) {
  19688. r = (a.words[i] | 0) + carry;
  19689. this.words[i] = r & 0x3ffffff;
  19690. carry = r >>> 26;
  19691. }
  19692. this.length = a.length;
  19693. if (carry !== 0) {
  19694. this.words[this.length] = carry;
  19695. this.length++;
  19696. // Copy the rest of the words
  19697. } else if (a !== this) {
  19698. for (; i < a.length; i++) {
  19699. this.words[i] = a.words[i];
  19700. }
  19701. }
  19702. return this;
  19703. };
  19704. // Add `num` to `this`
  19705. BN.prototype.add = function add (num) {
  19706. var res;
  19707. if (num.negative !== 0 && this.negative === 0) {
  19708. num.negative = 0;
  19709. res = this.sub(num);
  19710. num.negative ^= 1;
  19711. return res;
  19712. } else if (num.negative === 0 && this.negative !== 0) {
  19713. this.negative = 0;
  19714. res = num.sub(this);
  19715. this.negative = 1;
  19716. return res;
  19717. }
  19718. if (this.length > num.length) return this.clone().iadd(num);
  19719. return num.clone().iadd(this);
  19720. };
  19721. // Subtract `num` from `this` in-place
  19722. BN.prototype.isub = function isub (num) {
  19723. // this - (-num) = this + num
  19724. if (num.negative !== 0) {
  19725. num.negative = 0;
  19726. var r = this.iadd(num);
  19727. num.negative = 1;
  19728. return r._normSign();
  19729. // -this - num = -(this + num)
  19730. } else if (this.negative !== 0) {
  19731. this.negative = 0;
  19732. this.iadd(num);
  19733. this.negative = 1;
  19734. return this._normSign();
  19735. }
  19736. // At this point both numbers are positive
  19737. var cmp = this.cmp(num);
  19738. // Optimization - zeroify
  19739. if (cmp === 0) {
  19740. this.negative = 0;
  19741. this.length = 1;
  19742. this.words[0] = 0;
  19743. return this;
  19744. }
  19745. // a > b
  19746. var a, b;
  19747. if (cmp > 0) {
  19748. a = this;
  19749. b = num;
  19750. } else {
  19751. a = num;
  19752. b = this;
  19753. }
  19754. var carry = 0;
  19755. for (var i = 0; i < b.length; i++) {
  19756. r = (a.words[i] | 0) - (b.words[i] | 0) + carry;
  19757. carry = r >> 26;
  19758. this.words[i] = r & 0x3ffffff;
  19759. }
  19760. for (; carry !== 0 && i < a.length; i++) {
  19761. r = (a.words[i] | 0) + carry;
  19762. carry = r >> 26;
  19763. this.words[i] = r & 0x3ffffff;
  19764. }
  19765. // Copy rest of the words
  19766. if (carry === 0 && i < a.length && a !== this) {
  19767. for (; i < a.length; i++) {
  19768. this.words[i] = a.words[i];
  19769. }
  19770. }
  19771. this.length = Math.max(this.length, i);
  19772. if (a !== this) {
  19773. this.negative = 1;
  19774. }
  19775. return this._strip();
  19776. };
  19777. // Subtract `num` from `this`
  19778. BN.prototype.sub = function sub (num) {
  19779. return this.clone().isub(num);
  19780. };
  19781. function smallMulTo (self, num, out) {
  19782. out.negative = num.negative ^ self.negative;
  19783. var len = (self.length + num.length) | 0;
  19784. out.length = len;
  19785. len = (len - 1) | 0;
  19786. // Peel one iteration (compiler can't do it, because of code complexity)
  19787. var a = self.words[0] | 0;
  19788. var b = num.words[0] | 0;
  19789. var r = a * b;
  19790. var lo = r & 0x3ffffff;
  19791. var carry = (r / 0x4000000) | 0;
  19792. out.words[0] = lo;
  19793. for (var k = 1; k < len; k++) {
  19794. // Sum all words with the same `i + j = k` and accumulate `ncarry`,
  19795. // note that ncarry could be >= 0x3ffffff
  19796. var ncarry = carry >>> 26;
  19797. var rword = carry & 0x3ffffff;
  19798. var maxJ = Math.min(k, num.length - 1);
  19799. for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
  19800. var i = (k - j) | 0;
  19801. a = self.words[i] | 0;
  19802. b = num.words[j] | 0;
  19803. r = a * b + rword;
  19804. ncarry += (r / 0x4000000) | 0;
  19805. rword = r & 0x3ffffff;
  19806. }
  19807. out.words[k] = rword | 0;
  19808. carry = ncarry | 0;
  19809. }
  19810. if (carry !== 0) {
  19811. out.words[k] = carry | 0;
  19812. } else {
  19813. out.length--;
  19814. }
  19815. return out._strip();
  19816. }
  19817. // TODO(indutny): it may be reasonable to omit it for users who don't need
  19818. // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit
  19819. // multiplication (like elliptic secp256k1).
  19820. var comb10MulTo = function comb10MulTo (self, num, out) {
  19821. var a = self.words;
  19822. var b = num.words;
  19823. var o = out.words;
  19824. var c = 0;
  19825. var lo;
  19826. var mid;
  19827. var hi;
  19828. var a0 = a[0] | 0;
  19829. var al0 = a0 & 0x1fff;
  19830. var ah0 = a0 >>> 13;
  19831. var a1 = a[1] | 0;
  19832. var al1 = a1 & 0x1fff;
  19833. var ah1 = a1 >>> 13;
  19834. var a2 = a[2] | 0;
  19835. var al2 = a2 & 0x1fff;
  19836. var ah2 = a2 >>> 13;
  19837. var a3 = a[3] | 0;
  19838. var al3 = a3 & 0x1fff;
  19839. var ah3 = a3 >>> 13;
  19840. var a4 = a[4] | 0;
  19841. var al4 = a4 & 0x1fff;
  19842. var ah4 = a4 >>> 13;
  19843. var a5 = a[5] | 0;
  19844. var al5 = a5 & 0x1fff;
  19845. var ah5 = a5 >>> 13;
  19846. var a6 = a[6] | 0;
  19847. var al6 = a6 & 0x1fff;
  19848. var ah6 = a6 >>> 13;
  19849. var a7 = a[7] | 0;
  19850. var al7 = a7 & 0x1fff;
  19851. var ah7 = a7 >>> 13;
  19852. var a8 = a[8] | 0;
  19853. var al8 = a8 & 0x1fff;
  19854. var ah8 = a8 >>> 13;
  19855. var a9 = a[9] | 0;
  19856. var al9 = a9 & 0x1fff;
  19857. var ah9 = a9 >>> 13;
  19858. var b0 = b[0] | 0;
  19859. var bl0 = b0 & 0x1fff;
  19860. var bh0 = b0 >>> 13;
  19861. var b1 = b[1] | 0;
  19862. var bl1 = b1 & 0x1fff;
  19863. var bh1 = b1 >>> 13;
  19864. var b2 = b[2] | 0;
  19865. var bl2 = b2 & 0x1fff;
  19866. var bh2 = b2 >>> 13;
  19867. var b3 = b[3] | 0;
  19868. var bl3 = b3 & 0x1fff;
  19869. var bh3 = b3 >>> 13;
  19870. var b4 = b[4] | 0;
  19871. var bl4 = b4 & 0x1fff;
  19872. var bh4 = b4 >>> 13;
  19873. var b5 = b[5] | 0;
  19874. var bl5 = b5 & 0x1fff;
  19875. var bh5 = b5 >>> 13;
  19876. var b6 = b[6] | 0;
  19877. var bl6 = b6 & 0x1fff;
  19878. var bh6 = b6 >>> 13;
  19879. var b7 = b[7] | 0;
  19880. var bl7 = b7 & 0x1fff;
  19881. var bh7 = b7 >>> 13;
  19882. var b8 = b[8] | 0;
  19883. var bl8 = b8 & 0x1fff;
  19884. var bh8 = b8 >>> 13;
  19885. var b9 = b[9] | 0;
  19886. var bl9 = b9 & 0x1fff;
  19887. var bh9 = b9 >>> 13;
  19888. out.negative = self.negative ^ num.negative;
  19889. out.length = 19;
  19890. /* k = 0 */
  19891. lo = Math.imul(al0, bl0);
  19892. mid = Math.imul(al0, bh0);
  19893. mid = (mid + Math.imul(ah0, bl0)) | 0;
  19894. hi = Math.imul(ah0, bh0);
  19895. var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  19896. c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;
  19897. w0 &= 0x3ffffff;
  19898. /* k = 1 */
  19899. lo = Math.imul(al1, bl0);
  19900. mid = Math.imul(al1, bh0);
  19901. mid = (mid + Math.imul(ah1, bl0)) | 0;
  19902. hi = Math.imul(ah1, bh0);
  19903. lo = (lo + Math.imul(al0, bl1)) | 0;
  19904. mid = (mid + Math.imul(al0, bh1)) | 0;
  19905. mid = (mid + Math.imul(ah0, bl1)) | 0;
  19906. hi = (hi + Math.imul(ah0, bh1)) | 0;
  19907. var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  19908. c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;
  19909. w1 &= 0x3ffffff;
  19910. /* k = 2 */
  19911. lo = Math.imul(al2, bl0);
  19912. mid = Math.imul(al2, bh0);
  19913. mid = (mid + Math.imul(ah2, bl0)) | 0;
  19914. hi = Math.imul(ah2, bh0);
  19915. lo = (lo + Math.imul(al1, bl1)) | 0;
  19916. mid = (mid + Math.imul(al1, bh1)) | 0;
  19917. mid = (mid + Math.imul(ah1, bl1)) | 0;
  19918. hi = (hi + Math.imul(ah1, bh1)) | 0;
  19919. lo = (lo + Math.imul(al0, bl2)) | 0;
  19920. mid = (mid + Math.imul(al0, bh2)) | 0;
  19921. mid = (mid + Math.imul(ah0, bl2)) | 0;
  19922. hi = (hi + Math.imul(ah0, bh2)) | 0;
  19923. var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  19924. c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;
  19925. w2 &= 0x3ffffff;
  19926. /* k = 3 */
  19927. lo = Math.imul(al3, bl0);
  19928. mid = Math.imul(al3, bh0);
  19929. mid = (mid + Math.imul(ah3, bl0)) | 0;
  19930. hi = Math.imul(ah3, bh0);
  19931. lo = (lo + Math.imul(al2, bl1)) | 0;
  19932. mid = (mid + Math.imul(al2, bh1)) | 0;
  19933. mid = (mid + Math.imul(ah2, bl1)) | 0;
  19934. hi = (hi + Math.imul(ah2, bh1)) | 0;
  19935. lo = (lo + Math.imul(al1, bl2)) | 0;
  19936. mid = (mid + Math.imul(al1, bh2)) | 0;
  19937. mid = (mid + Math.imul(ah1, bl2)) | 0;
  19938. hi = (hi + Math.imul(ah1, bh2)) | 0;
  19939. lo = (lo + Math.imul(al0, bl3)) | 0;
  19940. mid = (mid + Math.imul(al0, bh3)) | 0;
  19941. mid = (mid + Math.imul(ah0, bl3)) | 0;
  19942. hi = (hi + Math.imul(ah0, bh3)) | 0;
  19943. var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  19944. c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;
  19945. w3 &= 0x3ffffff;
  19946. /* k = 4 */
  19947. lo = Math.imul(al4, bl0);
  19948. mid = Math.imul(al4, bh0);
  19949. mid = (mid + Math.imul(ah4, bl0)) | 0;
  19950. hi = Math.imul(ah4, bh0);
  19951. lo = (lo + Math.imul(al3, bl1)) | 0;
  19952. mid = (mid + Math.imul(al3, bh1)) | 0;
  19953. mid = (mid + Math.imul(ah3, bl1)) | 0;
  19954. hi = (hi + Math.imul(ah3, bh1)) | 0;
  19955. lo = (lo + Math.imul(al2, bl2)) | 0;
  19956. mid = (mid + Math.imul(al2, bh2)) | 0;
  19957. mid = (mid + Math.imul(ah2, bl2)) | 0;
  19958. hi = (hi + Math.imul(ah2, bh2)) | 0;
  19959. lo = (lo + Math.imul(al1, bl3)) | 0;
  19960. mid = (mid + Math.imul(al1, bh3)) | 0;
  19961. mid = (mid + Math.imul(ah1, bl3)) | 0;
  19962. hi = (hi + Math.imul(ah1, bh3)) | 0;
  19963. lo = (lo + Math.imul(al0, bl4)) | 0;
  19964. mid = (mid + Math.imul(al0, bh4)) | 0;
  19965. mid = (mid + Math.imul(ah0, bl4)) | 0;
  19966. hi = (hi + Math.imul(ah0, bh4)) | 0;
  19967. var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  19968. c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;
  19969. w4 &= 0x3ffffff;
  19970. /* k = 5 */
  19971. lo = Math.imul(al5, bl0);
  19972. mid = Math.imul(al5, bh0);
  19973. mid = (mid + Math.imul(ah5, bl0)) | 0;
  19974. hi = Math.imul(ah5, bh0);
  19975. lo = (lo + Math.imul(al4, bl1)) | 0;
  19976. mid = (mid + Math.imul(al4, bh1)) | 0;
  19977. mid = (mid + Math.imul(ah4, bl1)) | 0;
  19978. hi = (hi + Math.imul(ah4, bh1)) | 0;
  19979. lo = (lo + Math.imul(al3, bl2)) | 0;
  19980. mid = (mid + Math.imul(al3, bh2)) | 0;
  19981. mid = (mid + Math.imul(ah3, bl2)) | 0;
  19982. hi = (hi + Math.imul(ah3, bh2)) | 0;
  19983. lo = (lo + Math.imul(al2, bl3)) | 0;
  19984. mid = (mid + Math.imul(al2, bh3)) | 0;
  19985. mid = (mid + Math.imul(ah2, bl3)) | 0;
  19986. hi = (hi + Math.imul(ah2, bh3)) | 0;
  19987. lo = (lo + Math.imul(al1, bl4)) | 0;
  19988. mid = (mid + Math.imul(al1, bh4)) | 0;
  19989. mid = (mid + Math.imul(ah1, bl4)) | 0;
  19990. hi = (hi + Math.imul(ah1, bh4)) | 0;
  19991. lo = (lo + Math.imul(al0, bl5)) | 0;
  19992. mid = (mid + Math.imul(al0, bh5)) | 0;
  19993. mid = (mid + Math.imul(ah0, bl5)) | 0;
  19994. hi = (hi + Math.imul(ah0, bh5)) | 0;
  19995. var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  19996. c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;
  19997. w5 &= 0x3ffffff;
  19998. /* k = 6 */
  19999. lo = Math.imul(al6, bl0);
  20000. mid = Math.imul(al6, bh0);
  20001. mid = (mid + Math.imul(ah6, bl0)) | 0;
  20002. hi = Math.imul(ah6, bh0);
  20003. lo = (lo + Math.imul(al5, bl1)) | 0;
  20004. mid = (mid + Math.imul(al5, bh1)) | 0;
  20005. mid = (mid + Math.imul(ah5, bl1)) | 0;
  20006. hi = (hi + Math.imul(ah5, bh1)) | 0;
  20007. lo = (lo + Math.imul(al4, bl2)) | 0;
  20008. mid = (mid + Math.imul(al4, bh2)) | 0;
  20009. mid = (mid + Math.imul(ah4, bl2)) | 0;
  20010. hi = (hi + Math.imul(ah4, bh2)) | 0;
  20011. lo = (lo + Math.imul(al3, bl3)) | 0;
  20012. mid = (mid + Math.imul(al3, bh3)) | 0;
  20013. mid = (mid + Math.imul(ah3, bl3)) | 0;
  20014. hi = (hi + Math.imul(ah3, bh3)) | 0;
  20015. lo = (lo + Math.imul(al2, bl4)) | 0;
  20016. mid = (mid + Math.imul(al2, bh4)) | 0;
  20017. mid = (mid + Math.imul(ah2, bl4)) | 0;
  20018. hi = (hi + Math.imul(ah2, bh4)) | 0;
  20019. lo = (lo + Math.imul(al1, bl5)) | 0;
  20020. mid = (mid + Math.imul(al1, bh5)) | 0;
  20021. mid = (mid + Math.imul(ah1, bl5)) | 0;
  20022. hi = (hi + Math.imul(ah1, bh5)) | 0;
  20023. lo = (lo + Math.imul(al0, bl6)) | 0;
  20024. mid = (mid + Math.imul(al0, bh6)) | 0;
  20025. mid = (mid + Math.imul(ah0, bl6)) | 0;
  20026. hi = (hi + Math.imul(ah0, bh6)) | 0;
  20027. var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20028. c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;
  20029. w6 &= 0x3ffffff;
  20030. /* k = 7 */
  20031. lo = Math.imul(al7, bl0);
  20032. mid = Math.imul(al7, bh0);
  20033. mid = (mid + Math.imul(ah7, bl0)) | 0;
  20034. hi = Math.imul(ah7, bh0);
  20035. lo = (lo + Math.imul(al6, bl1)) | 0;
  20036. mid = (mid + Math.imul(al6, bh1)) | 0;
  20037. mid = (mid + Math.imul(ah6, bl1)) | 0;
  20038. hi = (hi + Math.imul(ah6, bh1)) | 0;
  20039. lo = (lo + Math.imul(al5, bl2)) | 0;
  20040. mid = (mid + Math.imul(al5, bh2)) | 0;
  20041. mid = (mid + Math.imul(ah5, bl2)) | 0;
  20042. hi = (hi + Math.imul(ah5, bh2)) | 0;
  20043. lo = (lo + Math.imul(al4, bl3)) | 0;
  20044. mid = (mid + Math.imul(al4, bh3)) | 0;
  20045. mid = (mid + Math.imul(ah4, bl3)) | 0;
  20046. hi = (hi + Math.imul(ah4, bh3)) | 0;
  20047. lo = (lo + Math.imul(al3, bl4)) | 0;
  20048. mid = (mid + Math.imul(al3, bh4)) | 0;
  20049. mid = (mid + Math.imul(ah3, bl4)) | 0;
  20050. hi = (hi + Math.imul(ah3, bh4)) | 0;
  20051. lo = (lo + Math.imul(al2, bl5)) | 0;
  20052. mid = (mid + Math.imul(al2, bh5)) | 0;
  20053. mid = (mid + Math.imul(ah2, bl5)) | 0;
  20054. hi = (hi + Math.imul(ah2, bh5)) | 0;
  20055. lo = (lo + Math.imul(al1, bl6)) | 0;
  20056. mid = (mid + Math.imul(al1, bh6)) | 0;
  20057. mid = (mid + Math.imul(ah1, bl6)) | 0;
  20058. hi = (hi + Math.imul(ah1, bh6)) | 0;
  20059. lo = (lo + Math.imul(al0, bl7)) | 0;
  20060. mid = (mid + Math.imul(al0, bh7)) | 0;
  20061. mid = (mid + Math.imul(ah0, bl7)) | 0;
  20062. hi = (hi + Math.imul(ah0, bh7)) | 0;
  20063. var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20064. c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;
  20065. w7 &= 0x3ffffff;
  20066. /* k = 8 */
  20067. lo = Math.imul(al8, bl0);
  20068. mid = Math.imul(al8, bh0);
  20069. mid = (mid + Math.imul(ah8, bl0)) | 0;
  20070. hi = Math.imul(ah8, bh0);
  20071. lo = (lo + Math.imul(al7, bl1)) | 0;
  20072. mid = (mid + Math.imul(al7, bh1)) | 0;
  20073. mid = (mid + Math.imul(ah7, bl1)) | 0;
  20074. hi = (hi + Math.imul(ah7, bh1)) | 0;
  20075. lo = (lo + Math.imul(al6, bl2)) | 0;
  20076. mid = (mid + Math.imul(al6, bh2)) | 0;
  20077. mid = (mid + Math.imul(ah6, bl2)) | 0;
  20078. hi = (hi + Math.imul(ah6, bh2)) | 0;
  20079. lo = (lo + Math.imul(al5, bl3)) | 0;
  20080. mid = (mid + Math.imul(al5, bh3)) | 0;
  20081. mid = (mid + Math.imul(ah5, bl3)) | 0;
  20082. hi = (hi + Math.imul(ah5, bh3)) | 0;
  20083. lo = (lo + Math.imul(al4, bl4)) | 0;
  20084. mid = (mid + Math.imul(al4, bh4)) | 0;
  20085. mid = (mid + Math.imul(ah4, bl4)) | 0;
  20086. hi = (hi + Math.imul(ah4, bh4)) | 0;
  20087. lo = (lo + Math.imul(al3, bl5)) | 0;
  20088. mid = (mid + Math.imul(al3, bh5)) | 0;
  20089. mid = (mid + Math.imul(ah3, bl5)) | 0;
  20090. hi = (hi + Math.imul(ah3, bh5)) | 0;
  20091. lo = (lo + Math.imul(al2, bl6)) | 0;
  20092. mid = (mid + Math.imul(al2, bh6)) | 0;
  20093. mid = (mid + Math.imul(ah2, bl6)) | 0;
  20094. hi = (hi + Math.imul(ah2, bh6)) | 0;
  20095. lo = (lo + Math.imul(al1, bl7)) | 0;
  20096. mid = (mid + Math.imul(al1, bh7)) | 0;
  20097. mid = (mid + Math.imul(ah1, bl7)) | 0;
  20098. hi = (hi + Math.imul(ah1, bh7)) | 0;
  20099. lo = (lo + Math.imul(al0, bl8)) | 0;
  20100. mid = (mid + Math.imul(al0, bh8)) | 0;
  20101. mid = (mid + Math.imul(ah0, bl8)) | 0;
  20102. hi = (hi + Math.imul(ah0, bh8)) | 0;
  20103. var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20104. c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;
  20105. w8 &= 0x3ffffff;
  20106. /* k = 9 */
  20107. lo = Math.imul(al9, bl0);
  20108. mid = Math.imul(al9, bh0);
  20109. mid = (mid + Math.imul(ah9, bl0)) | 0;
  20110. hi = Math.imul(ah9, bh0);
  20111. lo = (lo + Math.imul(al8, bl1)) | 0;
  20112. mid = (mid + Math.imul(al8, bh1)) | 0;
  20113. mid = (mid + Math.imul(ah8, bl1)) | 0;
  20114. hi = (hi + Math.imul(ah8, bh1)) | 0;
  20115. lo = (lo + Math.imul(al7, bl2)) | 0;
  20116. mid = (mid + Math.imul(al7, bh2)) | 0;
  20117. mid = (mid + Math.imul(ah7, bl2)) | 0;
  20118. hi = (hi + Math.imul(ah7, bh2)) | 0;
  20119. lo = (lo + Math.imul(al6, bl3)) | 0;
  20120. mid = (mid + Math.imul(al6, bh3)) | 0;
  20121. mid = (mid + Math.imul(ah6, bl3)) | 0;
  20122. hi = (hi + Math.imul(ah6, bh3)) | 0;
  20123. lo = (lo + Math.imul(al5, bl4)) | 0;
  20124. mid = (mid + Math.imul(al5, bh4)) | 0;
  20125. mid = (mid + Math.imul(ah5, bl4)) | 0;
  20126. hi = (hi + Math.imul(ah5, bh4)) | 0;
  20127. lo = (lo + Math.imul(al4, bl5)) | 0;
  20128. mid = (mid + Math.imul(al4, bh5)) | 0;
  20129. mid = (mid + Math.imul(ah4, bl5)) | 0;
  20130. hi = (hi + Math.imul(ah4, bh5)) | 0;
  20131. lo = (lo + Math.imul(al3, bl6)) | 0;
  20132. mid = (mid + Math.imul(al3, bh6)) | 0;
  20133. mid = (mid + Math.imul(ah3, bl6)) | 0;
  20134. hi = (hi + Math.imul(ah3, bh6)) | 0;
  20135. lo = (lo + Math.imul(al2, bl7)) | 0;
  20136. mid = (mid + Math.imul(al2, bh7)) | 0;
  20137. mid = (mid + Math.imul(ah2, bl7)) | 0;
  20138. hi = (hi + Math.imul(ah2, bh7)) | 0;
  20139. lo = (lo + Math.imul(al1, bl8)) | 0;
  20140. mid = (mid + Math.imul(al1, bh8)) | 0;
  20141. mid = (mid + Math.imul(ah1, bl8)) | 0;
  20142. hi = (hi + Math.imul(ah1, bh8)) | 0;
  20143. lo = (lo + Math.imul(al0, bl9)) | 0;
  20144. mid = (mid + Math.imul(al0, bh9)) | 0;
  20145. mid = (mid + Math.imul(ah0, bl9)) | 0;
  20146. hi = (hi + Math.imul(ah0, bh9)) | 0;
  20147. var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20148. c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;
  20149. w9 &= 0x3ffffff;
  20150. /* k = 10 */
  20151. lo = Math.imul(al9, bl1);
  20152. mid = Math.imul(al9, bh1);
  20153. mid = (mid + Math.imul(ah9, bl1)) | 0;
  20154. hi = Math.imul(ah9, bh1);
  20155. lo = (lo + Math.imul(al8, bl2)) | 0;
  20156. mid = (mid + Math.imul(al8, bh2)) | 0;
  20157. mid = (mid + Math.imul(ah8, bl2)) | 0;
  20158. hi = (hi + Math.imul(ah8, bh2)) | 0;
  20159. lo = (lo + Math.imul(al7, bl3)) | 0;
  20160. mid = (mid + Math.imul(al7, bh3)) | 0;
  20161. mid = (mid + Math.imul(ah7, bl3)) | 0;
  20162. hi = (hi + Math.imul(ah7, bh3)) | 0;
  20163. lo = (lo + Math.imul(al6, bl4)) | 0;
  20164. mid = (mid + Math.imul(al6, bh4)) | 0;
  20165. mid = (mid + Math.imul(ah6, bl4)) | 0;
  20166. hi = (hi + Math.imul(ah6, bh4)) | 0;
  20167. lo = (lo + Math.imul(al5, bl5)) | 0;
  20168. mid = (mid + Math.imul(al5, bh5)) | 0;
  20169. mid = (mid + Math.imul(ah5, bl5)) | 0;
  20170. hi = (hi + Math.imul(ah5, bh5)) | 0;
  20171. lo = (lo + Math.imul(al4, bl6)) | 0;
  20172. mid = (mid + Math.imul(al4, bh6)) | 0;
  20173. mid = (mid + Math.imul(ah4, bl6)) | 0;
  20174. hi = (hi + Math.imul(ah4, bh6)) | 0;
  20175. lo = (lo + Math.imul(al3, bl7)) | 0;
  20176. mid = (mid + Math.imul(al3, bh7)) | 0;
  20177. mid = (mid + Math.imul(ah3, bl7)) | 0;
  20178. hi = (hi + Math.imul(ah3, bh7)) | 0;
  20179. lo = (lo + Math.imul(al2, bl8)) | 0;
  20180. mid = (mid + Math.imul(al2, bh8)) | 0;
  20181. mid = (mid + Math.imul(ah2, bl8)) | 0;
  20182. hi = (hi + Math.imul(ah2, bh8)) | 0;
  20183. lo = (lo + Math.imul(al1, bl9)) | 0;
  20184. mid = (mid + Math.imul(al1, bh9)) | 0;
  20185. mid = (mid + Math.imul(ah1, bl9)) | 0;
  20186. hi = (hi + Math.imul(ah1, bh9)) | 0;
  20187. var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20188. c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;
  20189. w10 &= 0x3ffffff;
  20190. /* k = 11 */
  20191. lo = Math.imul(al9, bl2);
  20192. mid = Math.imul(al9, bh2);
  20193. mid = (mid + Math.imul(ah9, bl2)) | 0;
  20194. hi = Math.imul(ah9, bh2);
  20195. lo = (lo + Math.imul(al8, bl3)) | 0;
  20196. mid = (mid + Math.imul(al8, bh3)) | 0;
  20197. mid = (mid + Math.imul(ah8, bl3)) | 0;
  20198. hi = (hi + Math.imul(ah8, bh3)) | 0;
  20199. lo = (lo + Math.imul(al7, bl4)) | 0;
  20200. mid = (mid + Math.imul(al7, bh4)) | 0;
  20201. mid = (mid + Math.imul(ah7, bl4)) | 0;
  20202. hi = (hi + Math.imul(ah7, bh4)) | 0;
  20203. lo = (lo + Math.imul(al6, bl5)) | 0;
  20204. mid = (mid + Math.imul(al6, bh5)) | 0;
  20205. mid = (mid + Math.imul(ah6, bl5)) | 0;
  20206. hi = (hi + Math.imul(ah6, bh5)) | 0;
  20207. lo = (lo + Math.imul(al5, bl6)) | 0;
  20208. mid = (mid + Math.imul(al5, bh6)) | 0;
  20209. mid = (mid + Math.imul(ah5, bl6)) | 0;
  20210. hi = (hi + Math.imul(ah5, bh6)) | 0;
  20211. lo = (lo + Math.imul(al4, bl7)) | 0;
  20212. mid = (mid + Math.imul(al4, bh7)) | 0;
  20213. mid = (mid + Math.imul(ah4, bl7)) | 0;
  20214. hi = (hi + Math.imul(ah4, bh7)) | 0;
  20215. lo = (lo + Math.imul(al3, bl8)) | 0;
  20216. mid = (mid + Math.imul(al3, bh8)) | 0;
  20217. mid = (mid + Math.imul(ah3, bl8)) | 0;
  20218. hi = (hi + Math.imul(ah3, bh8)) | 0;
  20219. lo = (lo + Math.imul(al2, bl9)) | 0;
  20220. mid = (mid + Math.imul(al2, bh9)) | 0;
  20221. mid = (mid + Math.imul(ah2, bl9)) | 0;
  20222. hi = (hi + Math.imul(ah2, bh9)) | 0;
  20223. var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20224. c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;
  20225. w11 &= 0x3ffffff;
  20226. /* k = 12 */
  20227. lo = Math.imul(al9, bl3);
  20228. mid = Math.imul(al9, bh3);
  20229. mid = (mid + Math.imul(ah9, bl3)) | 0;
  20230. hi = Math.imul(ah9, bh3);
  20231. lo = (lo + Math.imul(al8, bl4)) | 0;
  20232. mid = (mid + Math.imul(al8, bh4)) | 0;
  20233. mid = (mid + Math.imul(ah8, bl4)) | 0;
  20234. hi = (hi + Math.imul(ah8, bh4)) | 0;
  20235. lo = (lo + Math.imul(al7, bl5)) | 0;
  20236. mid = (mid + Math.imul(al7, bh5)) | 0;
  20237. mid = (mid + Math.imul(ah7, bl5)) | 0;
  20238. hi = (hi + Math.imul(ah7, bh5)) | 0;
  20239. lo = (lo + Math.imul(al6, bl6)) | 0;
  20240. mid = (mid + Math.imul(al6, bh6)) | 0;
  20241. mid = (mid + Math.imul(ah6, bl6)) | 0;
  20242. hi = (hi + Math.imul(ah6, bh6)) | 0;
  20243. lo = (lo + Math.imul(al5, bl7)) | 0;
  20244. mid = (mid + Math.imul(al5, bh7)) | 0;
  20245. mid = (mid + Math.imul(ah5, bl7)) | 0;
  20246. hi = (hi + Math.imul(ah5, bh7)) | 0;
  20247. lo = (lo + Math.imul(al4, bl8)) | 0;
  20248. mid = (mid + Math.imul(al4, bh8)) | 0;
  20249. mid = (mid + Math.imul(ah4, bl8)) | 0;
  20250. hi = (hi + Math.imul(ah4, bh8)) | 0;
  20251. lo = (lo + Math.imul(al3, bl9)) | 0;
  20252. mid = (mid + Math.imul(al3, bh9)) | 0;
  20253. mid = (mid + Math.imul(ah3, bl9)) | 0;
  20254. hi = (hi + Math.imul(ah3, bh9)) | 0;
  20255. var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20256. c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;
  20257. w12 &= 0x3ffffff;
  20258. /* k = 13 */
  20259. lo = Math.imul(al9, bl4);
  20260. mid = Math.imul(al9, bh4);
  20261. mid = (mid + Math.imul(ah9, bl4)) | 0;
  20262. hi = Math.imul(ah9, bh4);
  20263. lo = (lo + Math.imul(al8, bl5)) | 0;
  20264. mid = (mid + Math.imul(al8, bh5)) | 0;
  20265. mid = (mid + Math.imul(ah8, bl5)) | 0;
  20266. hi = (hi + Math.imul(ah8, bh5)) | 0;
  20267. lo = (lo + Math.imul(al7, bl6)) | 0;
  20268. mid = (mid + Math.imul(al7, bh6)) | 0;
  20269. mid = (mid + Math.imul(ah7, bl6)) | 0;
  20270. hi = (hi + Math.imul(ah7, bh6)) | 0;
  20271. lo = (lo + Math.imul(al6, bl7)) | 0;
  20272. mid = (mid + Math.imul(al6, bh7)) | 0;
  20273. mid = (mid + Math.imul(ah6, bl7)) | 0;
  20274. hi = (hi + Math.imul(ah6, bh7)) | 0;
  20275. lo = (lo + Math.imul(al5, bl8)) | 0;
  20276. mid = (mid + Math.imul(al5, bh8)) | 0;
  20277. mid = (mid + Math.imul(ah5, bl8)) | 0;
  20278. hi = (hi + Math.imul(ah5, bh8)) | 0;
  20279. lo = (lo + Math.imul(al4, bl9)) | 0;
  20280. mid = (mid + Math.imul(al4, bh9)) | 0;
  20281. mid = (mid + Math.imul(ah4, bl9)) | 0;
  20282. hi = (hi + Math.imul(ah4, bh9)) | 0;
  20283. var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20284. c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;
  20285. w13 &= 0x3ffffff;
  20286. /* k = 14 */
  20287. lo = Math.imul(al9, bl5);
  20288. mid = Math.imul(al9, bh5);
  20289. mid = (mid + Math.imul(ah9, bl5)) | 0;
  20290. hi = Math.imul(ah9, bh5);
  20291. lo = (lo + Math.imul(al8, bl6)) | 0;
  20292. mid = (mid + Math.imul(al8, bh6)) | 0;
  20293. mid = (mid + Math.imul(ah8, bl6)) | 0;
  20294. hi = (hi + Math.imul(ah8, bh6)) | 0;
  20295. lo = (lo + Math.imul(al7, bl7)) | 0;
  20296. mid = (mid + Math.imul(al7, bh7)) | 0;
  20297. mid = (mid + Math.imul(ah7, bl7)) | 0;
  20298. hi = (hi + Math.imul(ah7, bh7)) | 0;
  20299. lo = (lo + Math.imul(al6, bl8)) | 0;
  20300. mid = (mid + Math.imul(al6, bh8)) | 0;
  20301. mid = (mid + Math.imul(ah6, bl8)) | 0;
  20302. hi = (hi + Math.imul(ah6, bh8)) | 0;
  20303. lo = (lo + Math.imul(al5, bl9)) | 0;
  20304. mid = (mid + Math.imul(al5, bh9)) | 0;
  20305. mid = (mid + Math.imul(ah5, bl9)) | 0;
  20306. hi = (hi + Math.imul(ah5, bh9)) | 0;
  20307. var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20308. c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;
  20309. w14 &= 0x3ffffff;
  20310. /* k = 15 */
  20311. lo = Math.imul(al9, bl6);
  20312. mid = Math.imul(al9, bh6);
  20313. mid = (mid + Math.imul(ah9, bl6)) | 0;
  20314. hi = Math.imul(ah9, bh6);
  20315. lo = (lo + Math.imul(al8, bl7)) | 0;
  20316. mid = (mid + Math.imul(al8, bh7)) | 0;
  20317. mid = (mid + Math.imul(ah8, bl7)) | 0;
  20318. hi = (hi + Math.imul(ah8, bh7)) | 0;
  20319. lo = (lo + Math.imul(al7, bl8)) | 0;
  20320. mid = (mid + Math.imul(al7, bh8)) | 0;
  20321. mid = (mid + Math.imul(ah7, bl8)) | 0;
  20322. hi = (hi + Math.imul(ah7, bh8)) | 0;
  20323. lo = (lo + Math.imul(al6, bl9)) | 0;
  20324. mid = (mid + Math.imul(al6, bh9)) | 0;
  20325. mid = (mid + Math.imul(ah6, bl9)) | 0;
  20326. hi = (hi + Math.imul(ah6, bh9)) | 0;
  20327. var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20328. c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;
  20329. w15 &= 0x3ffffff;
  20330. /* k = 16 */
  20331. lo = Math.imul(al9, bl7);
  20332. mid = Math.imul(al9, bh7);
  20333. mid = (mid + Math.imul(ah9, bl7)) | 0;
  20334. hi = Math.imul(ah9, bh7);
  20335. lo = (lo + Math.imul(al8, bl8)) | 0;
  20336. mid = (mid + Math.imul(al8, bh8)) | 0;
  20337. mid = (mid + Math.imul(ah8, bl8)) | 0;
  20338. hi = (hi + Math.imul(ah8, bh8)) | 0;
  20339. lo = (lo + Math.imul(al7, bl9)) | 0;
  20340. mid = (mid + Math.imul(al7, bh9)) | 0;
  20341. mid = (mid + Math.imul(ah7, bl9)) | 0;
  20342. hi = (hi + Math.imul(ah7, bh9)) | 0;
  20343. var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20344. c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;
  20345. w16 &= 0x3ffffff;
  20346. /* k = 17 */
  20347. lo = Math.imul(al9, bl8);
  20348. mid = Math.imul(al9, bh8);
  20349. mid = (mid + Math.imul(ah9, bl8)) | 0;
  20350. hi = Math.imul(ah9, bh8);
  20351. lo = (lo + Math.imul(al8, bl9)) | 0;
  20352. mid = (mid + Math.imul(al8, bh9)) | 0;
  20353. mid = (mid + Math.imul(ah8, bl9)) | 0;
  20354. hi = (hi + Math.imul(ah8, bh9)) | 0;
  20355. var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20356. c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;
  20357. w17 &= 0x3ffffff;
  20358. /* k = 18 */
  20359. lo = Math.imul(al9, bl9);
  20360. mid = Math.imul(al9, bh9);
  20361. mid = (mid + Math.imul(ah9, bl9)) | 0;
  20362. hi = Math.imul(ah9, bh9);
  20363. var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20364. c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;
  20365. w18 &= 0x3ffffff;
  20366. o[0] = w0;
  20367. o[1] = w1;
  20368. o[2] = w2;
  20369. o[3] = w3;
  20370. o[4] = w4;
  20371. o[5] = w5;
  20372. o[6] = w6;
  20373. o[7] = w7;
  20374. o[8] = w8;
  20375. o[9] = w9;
  20376. o[10] = w10;
  20377. o[11] = w11;
  20378. o[12] = w12;
  20379. o[13] = w13;
  20380. o[14] = w14;
  20381. o[15] = w15;
  20382. o[16] = w16;
  20383. o[17] = w17;
  20384. o[18] = w18;
  20385. if (c !== 0) {
  20386. o[19] = c;
  20387. out.length++;
  20388. }
  20389. return out;
  20390. };
  20391. // Polyfill comb
  20392. if (!Math.imul) {
  20393. comb10MulTo = smallMulTo;
  20394. }
  20395. function bigMulTo (self, num, out) {
  20396. out.negative = num.negative ^ self.negative;
  20397. out.length = self.length + num.length;
  20398. var carry = 0;
  20399. var hncarry = 0;
  20400. for (var k = 0; k < out.length - 1; k++) {
  20401. // Sum all words with the same `i + j = k` and accumulate `ncarry`,
  20402. // note that ncarry could be >= 0x3ffffff
  20403. var ncarry = hncarry;
  20404. hncarry = 0;
  20405. var rword = carry & 0x3ffffff;
  20406. var maxJ = Math.min(k, num.length - 1);
  20407. for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
  20408. var i = k - j;
  20409. var a = self.words[i] | 0;
  20410. var b = num.words[j] | 0;
  20411. var r = a * b;
  20412. var lo = r & 0x3ffffff;
  20413. ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;
  20414. lo = (lo + rword) | 0;
  20415. rword = lo & 0x3ffffff;
  20416. ncarry = (ncarry + (lo >>> 26)) | 0;
  20417. hncarry += ncarry >>> 26;
  20418. ncarry &= 0x3ffffff;
  20419. }
  20420. out.words[k] = rword;
  20421. carry = ncarry;
  20422. ncarry = hncarry;
  20423. }
  20424. if (carry !== 0) {
  20425. out.words[k] = carry;
  20426. } else {
  20427. out.length--;
  20428. }
  20429. return out._strip();
  20430. }
  20431. function jumboMulTo (self, num, out) {
  20432. // Temporary disable, see https://github.com/indutny/bn.js/issues/211
  20433. // var fftm = new FFTM();
  20434. // return fftm.mulp(self, num, out);
  20435. return bigMulTo(self, num, out);
  20436. }
  20437. BN.prototype.mulTo = function mulTo (num, out) {
  20438. var res;
  20439. var len = this.length + num.length;
  20440. if (this.length === 10 && num.length === 10) {
  20441. res = comb10MulTo(this, num, out);
  20442. } else if (len < 63) {
  20443. res = smallMulTo(this, num, out);
  20444. } else if (len < 1024) {
  20445. res = bigMulTo(this, num, out);
  20446. } else {
  20447. res = jumboMulTo(this, num, out);
  20448. }
  20449. return res;
  20450. };
  20451. // Cooley-Tukey algorithm for FFT
  20452. // slightly revisited to rely on looping instead of recursion
  20453. function FFTM (x, y) {
  20454. this.x = x;
  20455. this.y = y;
  20456. }
  20457. FFTM.prototype.makeRBT = function makeRBT (N) {
  20458. var t = new Array(N);
  20459. var l = BN.prototype._countBits(N) - 1;
  20460. for (var i = 0; i < N; i++) {
  20461. t[i] = this.revBin(i, l, N);
  20462. }
  20463. return t;
  20464. };
  20465. // Returns binary-reversed representation of `x`
  20466. FFTM.prototype.revBin = function revBin (x, l, N) {
  20467. if (x === 0 || x === N - 1) return x;
  20468. var rb = 0;
  20469. for (var i = 0; i < l; i++) {
  20470. rb |= (x & 1) << (l - i - 1);
  20471. x >>= 1;
  20472. }
  20473. return rb;
  20474. };
  20475. // Performs "tweedling" phase, therefore 'emulating'
  20476. // behaviour of the recursive algorithm
  20477. FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {
  20478. for (var i = 0; i < N; i++) {
  20479. rtws[i] = rws[rbt[i]];
  20480. itws[i] = iws[rbt[i]];
  20481. }
  20482. };
  20483. FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {
  20484. this.permute(rbt, rws, iws, rtws, itws, N);
  20485. for (var s = 1; s < N; s <<= 1) {
  20486. var l = s << 1;
  20487. var rtwdf = Math.cos(2 * Math.PI / l);
  20488. var itwdf = Math.sin(2 * Math.PI / l);
  20489. for (var p = 0; p < N; p += l) {
  20490. var rtwdf_ = rtwdf;
  20491. var itwdf_ = itwdf;
  20492. for (var j = 0; j < s; j++) {
  20493. var re = rtws[p + j];
  20494. var ie = itws[p + j];
  20495. var ro = rtws[p + j + s];
  20496. var io = itws[p + j + s];
  20497. var rx = rtwdf_ * ro - itwdf_ * io;
  20498. io = rtwdf_ * io + itwdf_ * ro;
  20499. ro = rx;
  20500. rtws[p + j] = re + ro;
  20501. itws[p + j] = ie + io;
  20502. rtws[p + j + s] = re - ro;
  20503. itws[p + j + s] = ie - io;
  20504. /* jshint maxdepth : false */
  20505. if (j !== l) {
  20506. rx = rtwdf * rtwdf_ - itwdf * itwdf_;
  20507. itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;
  20508. rtwdf_ = rx;
  20509. }
  20510. }
  20511. }
  20512. }
  20513. };
  20514. FFTM.prototype.guessLen13b = function guessLen13b (n, m) {
  20515. var N = Math.max(m, n) | 1;
  20516. var odd = N & 1;
  20517. var i = 0;
  20518. for (N = N / 2 | 0; N; N = N >>> 1) {
  20519. i++;
  20520. }
  20521. return 1 << i + 1 + odd;
  20522. };
  20523. FFTM.prototype.conjugate = function conjugate (rws, iws, N) {
  20524. if (N <= 1) return;
  20525. for (var i = 0; i < N / 2; i++) {
  20526. var t = rws[i];
  20527. rws[i] = rws[N - i - 1];
  20528. rws[N - i - 1] = t;
  20529. t = iws[i];
  20530. iws[i] = -iws[N - i - 1];
  20531. iws[N - i - 1] = -t;
  20532. }
  20533. };
  20534. FFTM.prototype.normalize13b = function normalize13b (ws, N) {
  20535. var carry = 0;
  20536. for (var i = 0; i < N / 2; i++) {
  20537. var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +
  20538. Math.round(ws[2 * i] / N) +
  20539. carry;
  20540. ws[i] = w & 0x3ffffff;
  20541. if (w < 0x4000000) {
  20542. carry = 0;
  20543. } else {
  20544. carry = w / 0x4000000 | 0;
  20545. }
  20546. }
  20547. return ws;
  20548. };
  20549. FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {
  20550. var carry = 0;
  20551. for (var i = 0; i < len; i++) {
  20552. carry = carry + (ws[i] | 0);
  20553. rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;
  20554. rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;
  20555. }
  20556. // Pad with zeroes
  20557. for (i = 2 * len; i < N; ++i) {
  20558. rws[i] = 0;
  20559. }
  20560. assert(carry === 0);
  20561. assert((carry & ~0x1fff) === 0);
  20562. };
  20563. FFTM.prototype.stub = function stub (N) {
  20564. var ph = new Array(N);
  20565. for (var i = 0; i < N; i++) {
  20566. ph[i] = 0;
  20567. }
  20568. return ph;
  20569. };
  20570. FFTM.prototype.mulp = function mulp (x, y, out) {
  20571. var N = 2 * this.guessLen13b(x.length, y.length);
  20572. var rbt = this.makeRBT(N);
  20573. var _ = this.stub(N);
  20574. var rws = new Array(N);
  20575. var rwst = new Array(N);
  20576. var iwst = new Array(N);
  20577. var nrws = new Array(N);
  20578. var nrwst = new Array(N);
  20579. var niwst = new Array(N);
  20580. var rmws = out.words;
  20581. rmws.length = N;
  20582. this.convert13b(x.words, x.length, rws, N);
  20583. this.convert13b(y.words, y.length, nrws, N);
  20584. this.transform(rws, _, rwst, iwst, N, rbt);
  20585. this.transform(nrws, _, nrwst, niwst, N, rbt);
  20586. for (var i = 0; i < N; i++) {
  20587. var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];
  20588. iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];
  20589. rwst[i] = rx;
  20590. }
  20591. this.conjugate(rwst, iwst, N);
  20592. this.transform(rwst, iwst, rmws, _, N, rbt);
  20593. this.conjugate(rmws, _, N);
  20594. this.normalize13b(rmws, N);
  20595. out.negative = x.negative ^ y.negative;
  20596. out.length = x.length + y.length;
  20597. return out._strip();
  20598. };
  20599. // Multiply `this` by `num`
  20600. BN.prototype.mul = function mul (num) {
  20601. var out = new BN(null);
  20602. out.words = new Array(this.length + num.length);
  20603. return this.mulTo(num, out);
  20604. };
  20605. // Multiply employing FFT
  20606. BN.prototype.mulf = function mulf (num) {
  20607. var out = new BN(null);
  20608. out.words = new Array(this.length + num.length);
  20609. return jumboMulTo(this, num, out);
  20610. };
  20611. // In-place Multiplication
  20612. BN.prototype.imul = function imul (num) {
  20613. return this.clone().mulTo(num, this);
  20614. };
  20615. BN.prototype.imuln = function imuln (num) {
  20616. var isNegNum = num < 0;
  20617. if (isNegNum) num = -num;
  20618. assert(typeof num === 'number');
  20619. assert(num < 0x4000000);
  20620. // Carry
  20621. var carry = 0;
  20622. for (var i = 0; i < this.length; i++) {
  20623. var w = (this.words[i] | 0) * num;
  20624. var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);
  20625. carry >>= 26;
  20626. carry += (w / 0x4000000) | 0;
  20627. // NOTE: lo is 27bit maximum
  20628. carry += lo >>> 26;
  20629. this.words[i] = lo & 0x3ffffff;
  20630. }
  20631. if (carry !== 0) {
  20632. this.words[i] = carry;
  20633. this.length++;
  20634. }
  20635. return isNegNum ? this.ineg() : this;
  20636. };
  20637. BN.prototype.muln = function muln (num) {
  20638. return this.clone().imuln(num);
  20639. };
  20640. // `this` * `this`
  20641. BN.prototype.sqr = function sqr () {
  20642. return this.mul(this);
  20643. };
  20644. // `this` * `this` in-place
  20645. BN.prototype.isqr = function isqr () {
  20646. return this.imul(this.clone());
  20647. };
  20648. // Math.pow(`this`, `num`)
  20649. BN.prototype.pow = function pow (num) {
  20650. var w = toBitArray(num);
  20651. if (w.length === 0) return new BN(1);
  20652. // Skip leading zeroes
  20653. var res = this;
  20654. for (var i = 0; i < w.length; i++, res = res.sqr()) {
  20655. if (w[i] !== 0) break;
  20656. }
  20657. if (++i < w.length) {
  20658. for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {
  20659. if (w[i] === 0) continue;
  20660. res = res.mul(q);
  20661. }
  20662. }
  20663. return res;
  20664. };
  20665. // Shift-left in-place
  20666. BN.prototype.iushln = function iushln (bits) {
  20667. assert(typeof bits === 'number' && bits >= 0);
  20668. var r = bits % 26;
  20669. var s = (bits - r) / 26;
  20670. var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);
  20671. var i;
  20672. if (r !== 0) {
  20673. var carry = 0;
  20674. for (i = 0; i < this.length; i++) {
  20675. var newCarry = this.words[i] & carryMask;
  20676. var c = ((this.words[i] | 0) - newCarry) << r;
  20677. this.words[i] = c | carry;
  20678. carry = newCarry >>> (26 - r);
  20679. }
  20680. if (carry) {
  20681. this.words[i] = carry;
  20682. this.length++;
  20683. }
  20684. }
  20685. if (s !== 0) {
  20686. for (i = this.length - 1; i >= 0; i--) {
  20687. this.words[i + s] = this.words[i];
  20688. }
  20689. for (i = 0; i < s; i++) {
  20690. this.words[i] = 0;
  20691. }
  20692. this.length += s;
  20693. }
  20694. return this._strip();
  20695. };
  20696. BN.prototype.ishln = function ishln (bits) {
  20697. // TODO(indutny): implement me
  20698. assert(this.negative === 0);
  20699. return this.iushln(bits);
  20700. };
  20701. // Shift-right in-place
  20702. // NOTE: `hint` is a lowest bit before trailing zeroes
  20703. // NOTE: if `extended` is present - it will be filled with destroyed bits
  20704. BN.prototype.iushrn = function iushrn (bits, hint, extended) {
  20705. assert(typeof bits === 'number' && bits >= 0);
  20706. var h;
  20707. if (hint) {
  20708. h = (hint - (hint % 26)) / 26;
  20709. } else {
  20710. h = 0;
  20711. }
  20712. var r = bits % 26;
  20713. var s = Math.min((bits - r) / 26, this.length);
  20714. var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);
  20715. var maskedWords = extended;
  20716. h -= s;
  20717. h = Math.max(0, h);
  20718. // Extended mode, copy masked part
  20719. if (maskedWords) {
  20720. for (var i = 0; i < s; i++) {
  20721. maskedWords.words[i] = this.words[i];
  20722. }
  20723. maskedWords.length = s;
  20724. }
  20725. if (s === 0) {
  20726. // No-op, we should not move anything at all
  20727. } else if (this.length > s) {
  20728. this.length -= s;
  20729. for (i = 0; i < this.length; i++) {
  20730. this.words[i] = this.words[i + s];
  20731. }
  20732. } else {
  20733. this.words[0] = 0;
  20734. this.length = 1;
  20735. }
  20736. var carry = 0;
  20737. for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {
  20738. var word = this.words[i] | 0;
  20739. this.words[i] = (carry << (26 - r)) | (word >>> r);
  20740. carry = word & mask;
  20741. }
  20742. // Push carried bits as a mask
  20743. if (maskedWords && carry !== 0) {
  20744. maskedWords.words[maskedWords.length++] = carry;
  20745. }
  20746. if (this.length === 0) {
  20747. this.words[0] = 0;
  20748. this.length = 1;
  20749. }
  20750. return this._strip();
  20751. };
  20752. BN.prototype.ishrn = function ishrn (bits, hint, extended) {
  20753. // TODO(indutny): implement me
  20754. assert(this.negative === 0);
  20755. return this.iushrn(bits, hint, extended);
  20756. };
  20757. // Shift-left
  20758. BN.prototype.shln = function shln (bits) {
  20759. return this.clone().ishln(bits);
  20760. };
  20761. BN.prototype.ushln = function ushln (bits) {
  20762. return this.clone().iushln(bits);
  20763. };
  20764. // Shift-right
  20765. BN.prototype.shrn = function shrn (bits) {
  20766. return this.clone().ishrn(bits);
  20767. };
  20768. BN.prototype.ushrn = function ushrn (bits) {
  20769. return this.clone().iushrn(bits);
  20770. };
  20771. // Test if n bit is set
  20772. BN.prototype.testn = function testn (bit) {
  20773. assert(typeof bit === 'number' && bit >= 0);
  20774. var r = bit % 26;
  20775. var s = (bit - r) / 26;
  20776. var q = 1 << r;
  20777. // Fast case: bit is much higher than all existing words
  20778. if (this.length <= s) return false;
  20779. // Check bit and return
  20780. var w = this.words[s];
  20781. return !!(w & q);
  20782. };
  20783. // Return only lowers bits of number (in-place)
  20784. BN.prototype.imaskn = function imaskn (bits) {
  20785. assert(typeof bits === 'number' && bits >= 0);
  20786. var r = bits % 26;
  20787. var s = (bits - r) / 26;
  20788. assert(this.negative === 0, 'imaskn works only with positive numbers');
  20789. if (this.length <= s) {
  20790. return this;
  20791. }
  20792. if (r !== 0) {
  20793. s++;
  20794. }
  20795. this.length = Math.min(s, this.length);
  20796. if (r !== 0) {
  20797. var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);
  20798. this.words[this.length - 1] &= mask;
  20799. }
  20800. return this._strip();
  20801. };
  20802. // Return only lowers bits of number
  20803. BN.prototype.maskn = function maskn (bits) {
  20804. return this.clone().imaskn(bits);
  20805. };
  20806. // Add plain number `num` to `this`
  20807. BN.prototype.iaddn = function iaddn (num) {
  20808. assert(typeof num === 'number');
  20809. assert(num < 0x4000000);
  20810. if (num < 0) return this.isubn(-num);
  20811. // Possible sign change
  20812. if (this.negative !== 0) {
  20813. if (this.length === 1 && (this.words[0] | 0) <= num) {
  20814. this.words[0] = num - (this.words[0] | 0);
  20815. this.negative = 0;
  20816. return this;
  20817. }
  20818. this.negative = 0;
  20819. this.isubn(num);
  20820. this.negative = 1;
  20821. return this;
  20822. }
  20823. // Add without checks
  20824. return this._iaddn(num);
  20825. };
  20826. BN.prototype._iaddn = function _iaddn (num) {
  20827. this.words[0] += num;
  20828. // Carry
  20829. for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {
  20830. this.words[i] -= 0x4000000;
  20831. if (i === this.length - 1) {
  20832. this.words[i + 1] = 1;
  20833. } else {
  20834. this.words[i + 1]++;
  20835. }
  20836. }
  20837. this.length = Math.max(this.length, i + 1);
  20838. return this;
  20839. };
  20840. // Subtract plain number `num` from `this`
  20841. BN.prototype.isubn = function isubn (num) {
  20842. assert(typeof num === 'number');
  20843. assert(num < 0x4000000);
  20844. if (num < 0) return this.iaddn(-num);
  20845. if (this.negative !== 0) {
  20846. this.negative = 0;
  20847. this.iaddn(num);
  20848. this.negative = 1;
  20849. return this;
  20850. }
  20851. this.words[0] -= num;
  20852. if (this.length === 1 && this.words[0] < 0) {
  20853. this.words[0] = -this.words[0];
  20854. this.negative = 1;
  20855. } else {
  20856. // Carry
  20857. for (var i = 0; i < this.length && this.words[i] < 0; i++) {
  20858. this.words[i] += 0x4000000;
  20859. this.words[i + 1] -= 1;
  20860. }
  20861. }
  20862. return this._strip();
  20863. };
  20864. BN.prototype.addn = function addn (num) {
  20865. return this.clone().iaddn(num);
  20866. };
  20867. BN.prototype.subn = function subn (num) {
  20868. return this.clone().isubn(num);
  20869. };
  20870. BN.prototype.iabs = function iabs () {
  20871. this.negative = 0;
  20872. return this;
  20873. };
  20874. BN.prototype.abs = function abs () {
  20875. return this.clone().iabs();
  20876. };
  20877. BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {
  20878. var len = num.length + shift;
  20879. var i;
  20880. this._expand(len);
  20881. var w;
  20882. var carry = 0;
  20883. for (i = 0; i < num.length; i++) {
  20884. w = (this.words[i + shift] | 0) + carry;
  20885. var right = (num.words[i] | 0) * mul;
  20886. w -= right & 0x3ffffff;
  20887. carry = (w >> 26) - ((right / 0x4000000) | 0);
  20888. this.words[i + shift] = w & 0x3ffffff;
  20889. }
  20890. for (; i < this.length - shift; i++) {
  20891. w = (this.words[i + shift] | 0) + carry;
  20892. carry = w >> 26;
  20893. this.words[i + shift] = w & 0x3ffffff;
  20894. }
  20895. if (carry === 0) return this._strip();
  20896. // Subtraction overflow
  20897. assert(carry === -1);
  20898. carry = 0;
  20899. for (i = 0; i < this.length; i++) {
  20900. w = -(this.words[i] | 0) + carry;
  20901. carry = w >> 26;
  20902. this.words[i] = w & 0x3ffffff;
  20903. }
  20904. this.negative = 1;
  20905. return this._strip();
  20906. };
  20907. BN.prototype._wordDiv = function _wordDiv (num, mode) {
  20908. var shift = this.length - num.length;
  20909. var a = this.clone();
  20910. var b = num;
  20911. // Normalize
  20912. var bhi = b.words[b.length - 1] | 0;
  20913. var bhiBits = this._countBits(bhi);
  20914. shift = 26 - bhiBits;
  20915. if (shift !== 0) {
  20916. b = b.ushln(shift);
  20917. a.iushln(shift);
  20918. bhi = b.words[b.length - 1] | 0;
  20919. }
  20920. // Initialize quotient
  20921. var m = a.length - b.length;
  20922. var q;
  20923. if (mode !== 'mod') {
  20924. q = new BN(null);
  20925. q.length = m + 1;
  20926. q.words = new Array(q.length);
  20927. for (var i = 0; i < q.length; i++) {
  20928. q.words[i] = 0;
  20929. }
  20930. }
  20931. var diff = a.clone()._ishlnsubmul(b, 1, m);
  20932. if (diff.negative === 0) {
  20933. a = diff;
  20934. if (q) {
  20935. q.words[m] = 1;
  20936. }
  20937. }
  20938. for (var j = m - 1; j >= 0; j--) {
  20939. var qj = (a.words[b.length + j] | 0) * 0x4000000 +
  20940. (a.words[b.length + j - 1] | 0);
  20941. // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max
  20942. // (0x7ffffff)
  20943. qj = Math.min((qj / bhi) | 0, 0x3ffffff);
  20944. a._ishlnsubmul(b, qj, j);
  20945. while (a.negative !== 0) {
  20946. qj--;
  20947. a.negative = 0;
  20948. a._ishlnsubmul(b, 1, j);
  20949. if (!a.isZero()) {
  20950. a.negative ^= 1;
  20951. }
  20952. }
  20953. if (q) {
  20954. q.words[j] = qj;
  20955. }
  20956. }
  20957. if (q) {
  20958. q._strip();
  20959. }
  20960. a._strip();
  20961. // Denormalize
  20962. if (mode !== 'div' && shift !== 0) {
  20963. a.iushrn(shift);
  20964. }
  20965. return {
  20966. div: q || null,
  20967. mod: a
  20968. };
  20969. };
  20970. // NOTE: 1) `mode` can be set to `mod` to request mod only,
  20971. // to `div` to request div only, or be absent to
  20972. // request both div & mod
  20973. // 2) `positive` is true if unsigned mod is requested
  20974. BN.prototype.divmod = function divmod (num, mode, positive) {
  20975. assert(!num.isZero());
  20976. if (this.isZero()) {
  20977. return {
  20978. div: new BN(0),
  20979. mod: new BN(0)
  20980. };
  20981. }
  20982. var div, mod, res;
  20983. if (this.negative !== 0 && num.negative === 0) {
  20984. res = this.neg().divmod(num, mode);
  20985. if (mode !== 'mod') {
  20986. div = res.div.neg();
  20987. }
  20988. if (mode !== 'div') {
  20989. mod = res.mod.neg();
  20990. if (positive && mod.negative !== 0) {
  20991. mod.iadd(num);
  20992. }
  20993. }
  20994. return {
  20995. div: div,
  20996. mod: mod
  20997. };
  20998. }
  20999. if (this.negative === 0 && num.negative !== 0) {
  21000. res = this.divmod(num.neg(), mode);
  21001. if (mode !== 'mod') {
  21002. div = res.div.neg();
  21003. }
  21004. return {
  21005. div: div,
  21006. mod: res.mod
  21007. };
  21008. }
  21009. if ((this.negative & num.negative) !== 0) {
  21010. res = this.neg().divmod(num.neg(), mode);
  21011. if (mode !== 'div') {
  21012. mod = res.mod.neg();
  21013. if (positive && mod.negative !== 0) {
  21014. mod.isub(num);
  21015. }
  21016. }
  21017. return {
  21018. div: res.div,
  21019. mod: mod
  21020. };
  21021. }
  21022. // Both numbers are positive at this point
  21023. // Strip both numbers to approximate shift value
  21024. if (num.length > this.length || this.cmp(num) < 0) {
  21025. return {
  21026. div: new BN(0),
  21027. mod: this
  21028. };
  21029. }
  21030. // Very short reduction
  21031. if (num.length === 1) {
  21032. if (mode === 'div') {
  21033. return {
  21034. div: this.divn(num.words[0]),
  21035. mod: null
  21036. };
  21037. }
  21038. if (mode === 'mod') {
  21039. return {
  21040. div: null,
  21041. mod: new BN(this.modrn(num.words[0]))
  21042. };
  21043. }
  21044. return {
  21045. div: this.divn(num.words[0]),
  21046. mod: new BN(this.modrn(num.words[0]))
  21047. };
  21048. }
  21049. return this._wordDiv(num, mode);
  21050. };
  21051. // Find `this` / `num`
  21052. BN.prototype.div = function div (num) {
  21053. return this.divmod(num, 'div', false).div;
  21054. };
  21055. // Find `this` % `num`
  21056. BN.prototype.mod = function mod (num) {
  21057. return this.divmod(num, 'mod', false).mod;
  21058. };
  21059. BN.prototype.umod = function umod (num) {
  21060. return this.divmod(num, 'mod', true).mod;
  21061. };
  21062. // Find Round(`this` / `num`)
  21063. BN.prototype.divRound = function divRound (num) {
  21064. var dm = this.divmod(num);
  21065. // Fast case - exact division
  21066. if (dm.mod.isZero()) return dm.div;
  21067. var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;
  21068. var half = num.ushrn(1);
  21069. var r2 = num.andln(1);
  21070. var cmp = mod.cmp(half);
  21071. // Round down
  21072. if (cmp < 0 || (r2 === 1 && cmp === 0)) return dm.div;
  21073. // Round up
  21074. return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);
  21075. };
  21076. BN.prototype.modrn = function modrn (num) {
  21077. var isNegNum = num < 0;
  21078. if (isNegNum) num = -num;
  21079. assert(num <= 0x3ffffff);
  21080. var p = (1 << 26) % num;
  21081. var acc = 0;
  21082. for (var i = this.length - 1; i >= 0; i--) {
  21083. acc = (p * acc + (this.words[i] | 0)) % num;
  21084. }
  21085. return isNegNum ? -acc : acc;
  21086. };
  21087. // WARNING: DEPRECATED
  21088. BN.prototype.modn = function modn (num) {
  21089. return this.modrn(num);
  21090. };
  21091. // In-place division by number
  21092. BN.prototype.idivn = function idivn (num) {
  21093. var isNegNum = num < 0;
  21094. if (isNegNum) num = -num;
  21095. assert(num <= 0x3ffffff);
  21096. var carry = 0;
  21097. for (var i = this.length - 1; i >= 0; i--) {
  21098. var w = (this.words[i] | 0) + carry * 0x4000000;
  21099. this.words[i] = (w / num) | 0;
  21100. carry = w % num;
  21101. }
  21102. this._strip();
  21103. return isNegNum ? this.ineg() : this;
  21104. };
  21105. BN.prototype.divn = function divn (num) {
  21106. return this.clone().idivn(num);
  21107. };
  21108. BN.prototype.egcd = function egcd (p) {
  21109. assert(p.negative === 0);
  21110. assert(!p.isZero());
  21111. var x = this;
  21112. var y = p.clone();
  21113. if (x.negative !== 0) {
  21114. x = x.umod(p);
  21115. } else {
  21116. x = x.clone();
  21117. }
  21118. // A * x + B * y = x
  21119. var A = new BN(1);
  21120. var B = new BN(0);
  21121. // C * x + D * y = y
  21122. var C = new BN(0);
  21123. var D = new BN(1);
  21124. var g = 0;
  21125. while (x.isEven() && y.isEven()) {
  21126. x.iushrn(1);
  21127. y.iushrn(1);
  21128. ++g;
  21129. }
  21130. var yp = y.clone();
  21131. var xp = x.clone();
  21132. while (!x.isZero()) {
  21133. for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);
  21134. if (i > 0) {
  21135. x.iushrn(i);
  21136. while (i-- > 0) {
  21137. if (A.isOdd() || B.isOdd()) {
  21138. A.iadd(yp);
  21139. B.isub(xp);
  21140. }
  21141. A.iushrn(1);
  21142. B.iushrn(1);
  21143. }
  21144. }
  21145. for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);
  21146. if (j > 0) {
  21147. y.iushrn(j);
  21148. while (j-- > 0) {
  21149. if (C.isOdd() || D.isOdd()) {
  21150. C.iadd(yp);
  21151. D.isub(xp);
  21152. }
  21153. C.iushrn(1);
  21154. D.iushrn(1);
  21155. }
  21156. }
  21157. if (x.cmp(y) >= 0) {
  21158. x.isub(y);
  21159. A.isub(C);
  21160. B.isub(D);
  21161. } else {
  21162. y.isub(x);
  21163. C.isub(A);
  21164. D.isub(B);
  21165. }
  21166. }
  21167. return {
  21168. a: C,
  21169. b: D,
  21170. gcd: y.iushln(g)
  21171. };
  21172. };
  21173. // This is reduced incarnation of the binary EEA
  21174. // above, designated to invert members of the
  21175. // _prime_ fields F(p) at a maximal speed
  21176. BN.prototype._invmp = function _invmp (p) {
  21177. assert(p.negative === 0);
  21178. assert(!p.isZero());
  21179. var a = this;
  21180. var b = p.clone();
  21181. if (a.negative !== 0) {
  21182. a = a.umod(p);
  21183. } else {
  21184. a = a.clone();
  21185. }
  21186. var x1 = new BN(1);
  21187. var x2 = new BN(0);
  21188. var delta = b.clone();
  21189. while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {
  21190. for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);
  21191. if (i > 0) {
  21192. a.iushrn(i);
  21193. while (i-- > 0) {
  21194. if (x1.isOdd()) {
  21195. x1.iadd(delta);
  21196. }
  21197. x1.iushrn(1);
  21198. }
  21199. }
  21200. for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);
  21201. if (j > 0) {
  21202. b.iushrn(j);
  21203. while (j-- > 0) {
  21204. if (x2.isOdd()) {
  21205. x2.iadd(delta);
  21206. }
  21207. x2.iushrn(1);
  21208. }
  21209. }
  21210. if (a.cmp(b) >= 0) {
  21211. a.isub(b);
  21212. x1.isub(x2);
  21213. } else {
  21214. b.isub(a);
  21215. x2.isub(x1);
  21216. }
  21217. }
  21218. var res;
  21219. if (a.cmpn(1) === 0) {
  21220. res = x1;
  21221. } else {
  21222. res = x2;
  21223. }
  21224. if (res.cmpn(0) < 0) {
  21225. res.iadd(p);
  21226. }
  21227. return res;
  21228. };
  21229. BN.prototype.gcd = function gcd (num) {
  21230. if (this.isZero()) return num.abs();
  21231. if (num.isZero()) return this.abs();
  21232. var a = this.clone();
  21233. var b = num.clone();
  21234. a.negative = 0;
  21235. b.negative = 0;
  21236. // Remove common factor of two
  21237. for (var shift = 0; a.isEven() && b.isEven(); shift++) {
  21238. a.iushrn(1);
  21239. b.iushrn(1);
  21240. }
  21241. do {
  21242. while (a.isEven()) {
  21243. a.iushrn(1);
  21244. }
  21245. while (b.isEven()) {
  21246. b.iushrn(1);
  21247. }
  21248. var r = a.cmp(b);
  21249. if (r < 0) {
  21250. // Swap `a` and `b` to make `a` always bigger than `b`
  21251. var t = a;
  21252. a = b;
  21253. b = t;
  21254. } else if (r === 0 || b.cmpn(1) === 0) {
  21255. break;
  21256. }
  21257. a.isub(b);
  21258. } while (true);
  21259. return b.iushln(shift);
  21260. };
  21261. // Invert number in the field F(num)
  21262. BN.prototype.invm = function invm (num) {
  21263. return this.egcd(num).a.umod(num);
  21264. };
  21265. BN.prototype.isEven = function isEven () {
  21266. return (this.words[0] & 1) === 0;
  21267. };
  21268. BN.prototype.isOdd = function isOdd () {
  21269. return (this.words[0] & 1) === 1;
  21270. };
  21271. // And first word and num
  21272. BN.prototype.andln = function andln (num) {
  21273. return this.words[0] & num;
  21274. };
  21275. // Increment at the bit position in-line
  21276. BN.prototype.bincn = function bincn (bit) {
  21277. assert(typeof bit === 'number');
  21278. var r = bit % 26;
  21279. var s = (bit - r) / 26;
  21280. var q = 1 << r;
  21281. // Fast case: bit is much higher than all existing words
  21282. if (this.length <= s) {
  21283. this._expand(s + 1);
  21284. this.words[s] |= q;
  21285. return this;
  21286. }
  21287. // Add bit and propagate, if needed
  21288. var carry = q;
  21289. for (var i = s; carry !== 0 && i < this.length; i++) {
  21290. var w = this.words[i] | 0;
  21291. w += carry;
  21292. carry = w >>> 26;
  21293. w &= 0x3ffffff;
  21294. this.words[i] = w;
  21295. }
  21296. if (carry !== 0) {
  21297. this.words[i] = carry;
  21298. this.length++;
  21299. }
  21300. return this;
  21301. };
  21302. BN.prototype.isZero = function isZero () {
  21303. return this.length === 1 && this.words[0] === 0;
  21304. };
  21305. BN.prototype.cmpn = function cmpn (num) {
  21306. var negative = num < 0;
  21307. if (this.negative !== 0 && !negative) return -1;
  21308. if (this.negative === 0 && negative) return 1;
  21309. this._strip();
  21310. var res;
  21311. if (this.length > 1) {
  21312. res = 1;
  21313. } else {
  21314. if (negative) {
  21315. num = -num;
  21316. }
  21317. assert(num <= 0x3ffffff, 'Number is too big');
  21318. var w = this.words[0] | 0;
  21319. res = w === num ? 0 : w < num ? -1 : 1;
  21320. }
  21321. if (this.negative !== 0) return -res | 0;
  21322. return res;
  21323. };
  21324. // Compare two numbers and return:
  21325. // 1 - if `this` > `num`
  21326. // 0 - if `this` == `num`
  21327. // -1 - if `this` < `num`
  21328. BN.prototype.cmp = function cmp (num) {
  21329. if (this.negative !== 0 && num.negative === 0) return -1;
  21330. if (this.negative === 0 && num.negative !== 0) return 1;
  21331. var res = this.ucmp(num);
  21332. if (this.negative !== 0) return -res | 0;
  21333. return res;
  21334. };
  21335. // Unsigned comparison
  21336. BN.prototype.ucmp = function ucmp (num) {
  21337. // At this point both numbers have the same sign
  21338. if (this.length > num.length) return 1;
  21339. if (this.length < num.length) return -1;
  21340. var res = 0;
  21341. for (var i = this.length - 1; i >= 0; i--) {
  21342. var a = this.words[i] | 0;
  21343. var b = num.words[i] | 0;
  21344. if (a === b) continue;
  21345. if (a < b) {
  21346. res = -1;
  21347. } else if (a > b) {
  21348. res = 1;
  21349. }
  21350. break;
  21351. }
  21352. return res;
  21353. };
  21354. BN.prototype.gtn = function gtn (num) {
  21355. return this.cmpn(num) === 1;
  21356. };
  21357. BN.prototype.gt = function gt (num) {
  21358. return this.cmp(num) === 1;
  21359. };
  21360. BN.prototype.gten = function gten (num) {
  21361. return this.cmpn(num) >= 0;
  21362. };
  21363. BN.prototype.gte = function gte (num) {
  21364. return this.cmp(num) >= 0;
  21365. };
  21366. BN.prototype.ltn = function ltn (num) {
  21367. return this.cmpn(num) === -1;
  21368. };
  21369. BN.prototype.lt = function lt (num) {
  21370. return this.cmp(num) === -1;
  21371. };
  21372. BN.prototype.lten = function lten (num) {
  21373. return this.cmpn(num) <= 0;
  21374. };
  21375. BN.prototype.lte = function lte (num) {
  21376. return this.cmp(num) <= 0;
  21377. };
  21378. BN.prototype.eqn = function eqn (num) {
  21379. return this.cmpn(num) === 0;
  21380. };
  21381. BN.prototype.eq = function eq (num) {
  21382. return this.cmp(num) === 0;
  21383. };
  21384. //
  21385. // A reduce context, could be using montgomery or something better, depending
  21386. // on the `m` itself.
  21387. //
  21388. BN.red = function red (num) {
  21389. return new Red(num);
  21390. };
  21391. BN.prototype.toRed = function toRed (ctx) {
  21392. assert(!this.red, 'Already a number in reduction context');
  21393. assert(this.negative === 0, 'red works only with positives');
  21394. return ctx.convertTo(this)._forceRed(ctx);
  21395. };
  21396. BN.prototype.fromRed = function fromRed () {
  21397. assert(this.red, 'fromRed works only with numbers in reduction context');
  21398. return this.red.convertFrom(this);
  21399. };
  21400. BN.prototype._forceRed = function _forceRed (ctx) {
  21401. this.red = ctx;
  21402. return this;
  21403. };
  21404. BN.prototype.forceRed = function forceRed (ctx) {
  21405. assert(!this.red, 'Already a number in reduction context');
  21406. return this._forceRed(ctx);
  21407. };
  21408. BN.prototype.redAdd = function redAdd (num) {
  21409. assert(this.red, 'redAdd works only with red numbers');
  21410. return this.red.add(this, num);
  21411. };
  21412. BN.prototype.redIAdd = function redIAdd (num) {
  21413. assert(this.red, 'redIAdd works only with red numbers');
  21414. return this.red.iadd(this, num);
  21415. };
  21416. BN.prototype.redSub = function redSub (num) {
  21417. assert(this.red, 'redSub works only with red numbers');
  21418. return this.red.sub(this, num);
  21419. };
  21420. BN.prototype.redISub = function redISub (num) {
  21421. assert(this.red, 'redISub works only with red numbers');
  21422. return this.red.isub(this, num);
  21423. };
  21424. BN.prototype.redShl = function redShl (num) {
  21425. assert(this.red, 'redShl works only with red numbers');
  21426. return this.red.shl(this, num);
  21427. };
  21428. BN.prototype.redMul = function redMul (num) {
  21429. assert(this.red, 'redMul works only with red numbers');
  21430. this.red._verify2(this, num);
  21431. return this.red.mul(this, num);
  21432. };
  21433. BN.prototype.redIMul = function redIMul (num) {
  21434. assert(this.red, 'redMul works only with red numbers');
  21435. this.red._verify2(this, num);
  21436. return this.red.imul(this, num);
  21437. };
  21438. BN.prototype.redSqr = function redSqr () {
  21439. assert(this.red, 'redSqr works only with red numbers');
  21440. this.red._verify1(this);
  21441. return this.red.sqr(this);
  21442. };
  21443. BN.prototype.redISqr = function redISqr () {
  21444. assert(this.red, 'redISqr works only with red numbers');
  21445. this.red._verify1(this);
  21446. return this.red.isqr(this);
  21447. };
  21448. // Square root over p
  21449. BN.prototype.redSqrt = function redSqrt () {
  21450. assert(this.red, 'redSqrt works only with red numbers');
  21451. this.red._verify1(this);
  21452. return this.red.sqrt(this);
  21453. };
  21454. BN.prototype.redInvm = function redInvm () {
  21455. assert(this.red, 'redInvm works only with red numbers');
  21456. this.red._verify1(this);
  21457. return this.red.invm(this);
  21458. };
  21459. // Return negative clone of `this` % `red modulo`
  21460. BN.prototype.redNeg = function redNeg () {
  21461. assert(this.red, 'redNeg works only with red numbers');
  21462. this.red._verify1(this);
  21463. return this.red.neg(this);
  21464. };
  21465. BN.prototype.redPow = function redPow (num) {
  21466. assert(this.red && !num.red, 'redPow(normalNum)');
  21467. this.red._verify1(this);
  21468. return this.red.pow(this, num);
  21469. };
  21470. // Prime numbers with efficient reduction
  21471. var primes = {
  21472. k256: null,
  21473. p224: null,
  21474. p192: null,
  21475. p25519: null
  21476. };
  21477. // Pseudo-Mersenne prime
  21478. function MPrime (name, p) {
  21479. // P = 2 ^ N - K
  21480. this.name = name;
  21481. this.p = new BN(p, 16);
  21482. this.n = this.p.bitLength();
  21483. this.k = new BN(1).iushln(this.n).isub(this.p);
  21484. this.tmp = this._tmp();
  21485. }
  21486. MPrime.prototype._tmp = function _tmp () {
  21487. var tmp = new BN(null);
  21488. tmp.words = new Array(Math.ceil(this.n / 13));
  21489. return tmp;
  21490. };
  21491. MPrime.prototype.ireduce = function ireduce (num) {
  21492. // Assumes that `num` is less than `P^2`
  21493. // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)
  21494. var r = num;
  21495. var rlen;
  21496. do {
  21497. this.split(r, this.tmp);
  21498. r = this.imulK(r);
  21499. r = r.iadd(this.tmp);
  21500. rlen = r.bitLength();
  21501. } while (rlen > this.n);
  21502. var cmp = rlen < this.n ? -1 : r.ucmp(this.p);
  21503. if (cmp === 0) {
  21504. r.words[0] = 0;
  21505. r.length = 1;
  21506. } else if (cmp > 0) {
  21507. r.isub(this.p);
  21508. } else {
  21509. if (r.strip !== undefined) {
  21510. // r is a BN v4 instance
  21511. r.strip();
  21512. } else {
  21513. // r is a BN v5 instance
  21514. r._strip();
  21515. }
  21516. }
  21517. return r;
  21518. };
  21519. MPrime.prototype.split = function split (input, out) {
  21520. input.iushrn(this.n, 0, out);
  21521. };
  21522. MPrime.prototype.imulK = function imulK (num) {
  21523. return num.imul(this.k);
  21524. };
  21525. function K256 () {
  21526. MPrime.call(
  21527. this,
  21528. 'k256',
  21529. 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');
  21530. }
  21531. inherits(K256, MPrime);
  21532. K256.prototype.split = function split (input, output) {
  21533. // 256 = 9 * 26 + 22
  21534. var mask = 0x3fffff;
  21535. var outLen = Math.min(input.length, 9);
  21536. for (var i = 0; i < outLen; i++) {
  21537. output.words[i] = input.words[i];
  21538. }
  21539. output.length = outLen;
  21540. if (input.length <= 9) {
  21541. input.words[0] = 0;
  21542. input.length = 1;
  21543. return;
  21544. }
  21545. // Shift by 9 limbs
  21546. var prev = input.words[9];
  21547. output.words[output.length++] = prev & mask;
  21548. for (i = 10; i < input.length; i++) {
  21549. var next = input.words[i] | 0;
  21550. input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);
  21551. prev = next;
  21552. }
  21553. prev >>>= 22;
  21554. input.words[i - 10] = prev;
  21555. if (prev === 0 && input.length > 10) {
  21556. input.length -= 10;
  21557. } else {
  21558. input.length -= 9;
  21559. }
  21560. };
  21561. K256.prototype.imulK = function imulK (num) {
  21562. // K = 0x1000003d1 = [ 0x40, 0x3d1 ]
  21563. num.words[num.length] = 0;
  21564. num.words[num.length + 1] = 0;
  21565. num.length += 2;
  21566. // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390
  21567. var lo = 0;
  21568. for (var i = 0; i < num.length; i++) {
  21569. var w = num.words[i] | 0;
  21570. lo += w * 0x3d1;
  21571. num.words[i] = lo & 0x3ffffff;
  21572. lo = w * 0x40 + ((lo / 0x4000000) | 0);
  21573. }
  21574. // Fast length reduction
  21575. if (num.words[num.length - 1] === 0) {
  21576. num.length--;
  21577. if (num.words[num.length - 1] === 0) {
  21578. num.length--;
  21579. }
  21580. }
  21581. return num;
  21582. };
  21583. function P224 () {
  21584. MPrime.call(
  21585. this,
  21586. 'p224',
  21587. 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');
  21588. }
  21589. inherits(P224, MPrime);
  21590. function P192 () {
  21591. MPrime.call(
  21592. this,
  21593. 'p192',
  21594. 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');
  21595. }
  21596. inherits(P192, MPrime);
  21597. function P25519 () {
  21598. // 2 ^ 255 - 19
  21599. MPrime.call(
  21600. this,
  21601. '25519',
  21602. '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');
  21603. }
  21604. inherits(P25519, MPrime);
  21605. P25519.prototype.imulK = function imulK (num) {
  21606. // K = 0x13
  21607. var carry = 0;
  21608. for (var i = 0; i < num.length; i++) {
  21609. var hi = (num.words[i] | 0) * 0x13 + carry;
  21610. var lo = hi & 0x3ffffff;
  21611. hi >>>= 26;
  21612. num.words[i] = lo;
  21613. carry = hi;
  21614. }
  21615. if (carry !== 0) {
  21616. num.words[num.length++] = carry;
  21617. }
  21618. return num;
  21619. };
  21620. // Exported mostly for testing purposes, use plain name instead
  21621. BN._prime = function prime (name) {
  21622. // Cached version of prime
  21623. if (primes[name]) return primes[name];
  21624. var prime;
  21625. if (name === 'k256') {
  21626. prime = new K256();
  21627. } else if (name === 'p224') {
  21628. prime = new P224();
  21629. } else if (name === 'p192') {
  21630. prime = new P192();
  21631. } else if (name === 'p25519') {
  21632. prime = new P25519();
  21633. } else {
  21634. throw new Error('Unknown prime ' + name);
  21635. }
  21636. primes[name] = prime;
  21637. return prime;
  21638. };
  21639. //
  21640. // Base reduction engine
  21641. //
  21642. function Red (m) {
  21643. if (typeof m === 'string') {
  21644. var prime = BN._prime(m);
  21645. this.m = prime.p;
  21646. this.prime = prime;
  21647. } else {
  21648. assert(m.gtn(1), 'modulus must be greater than 1');
  21649. this.m = m;
  21650. this.prime = null;
  21651. }
  21652. }
  21653. Red.prototype._verify1 = function _verify1 (a) {
  21654. assert(a.negative === 0, 'red works only with positives');
  21655. assert(a.red, 'red works only with red numbers');
  21656. };
  21657. Red.prototype._verify2 = function _verify2 (a, b) {
  21658. assert((a.negative | b.negative) === 0, 'red works only with positives');
  21659. assert(a.red && a.red === b.red,
  21660. 'red works only with red numbers');
  21661. };
  21662. Red.prototype.imod = function imod (a) {
  21663. if (this.prime) return this.prime.ireduce(a)._forceRed(this);
  21664. move(a, a.umod(this.m)._forceRed(this));
  21665. return a;
  21666. };
  21667. Red.prototype.neg = function neg (a) {
  21668. if (a.isZero()) {
  21669. return a.clone();
  21670. }
  21671. return this.m.sub(a)._forceRed(this);
  21672. };
  21673. Red.prototype.add = function add (a, b) {
  21674. this._verify2(a, b);
  21675. var res = a.add(b);
  21676. if (res.cmp(this.m) >= 0) {
  21677. res.isub(this.m);
  21678. }
  21679. return res._forceRed(this);
  21680. };
  21681. Red.prototype.iadd = function iadd (a, b) {
  21682. this._verify2(a, b);
  21683. var res = a.iadd(b);
  21684. if (res.cmp(this.m) >= 0) {
  21685. res.isub(this.m);
  21686. }
  21687. return res;
  21688. };
  21689. Red.prototype.sub = function sub (a, b) {
  21690. this._verify2(a, b);
  21691. var res = a.sub(b);
  21692. if (res.cmpn(0) < 0) {
  21693. res.iadd(this.m);
  21694. }
  21695. return res._forceRed(this);
  21696. };
  21697. Red.prototype.isub = function isub (a, b) {
  21698. this._verify2(a, b);
  21699. var res = a.isub(b);
  21700. if (res.cmpn(0) < 0) {
  21701. res.iadd(this.m);
  21702. }
  21703. return res;
  21704. };
  21705. Red.prototype.shl = function shl (a, num) {
  21706. this._verify1(a);
  21707. return this.imod(a.ushln(num));
  21708. };
  21709. Red.prototype.imul = function imul (a, b) {
  21710. this._verify2(a, b);
  21711. return this.imod(a.imul(b));
  21712. };
  21713. Red.prototype.mul = function mul (a, b) {
  21714. this._verify2(a, b);
  21715. return this.imod(a.mul(b));
  21716. };
  21717. Red.prototype.isqr = function isqr (a) {
  21718. return this.imul(a, a.clone());
  21719. };
  21720. Red.prototype.sqr = function sqr (a) {
  21721. return this.mul(a, a);
  21722. };
  21723. Red.prototype.sqrt = function sqrt (a) {
  21724. if (a.isZero()) return a.clone();
  21725. var mod3 = this.m.andln(3);
  21726. assert(mod3 % 2 === 1);
  21727. // Fast case
  21728. if (mod3 === 3) {
  21729. var pow = this.m.add(new BN(1)).iushrn(2);
  21730. return this.pow(a, pow);
  21731. }
  21732. // Tonelli-Shanks algorithm (Totally unoptimized and slow)
  21733. //
  21734. // Find Q and S, that Q * 2 ^ S = (P - 1)
  21735. var q = this.m.subn(1);
  21736. var s = 0;
  21737. while (!q.isZero() && q.andln(1) === 0) {
  21738. s++;
  21739. q.iushrn(1);
  21740. }
  21741. assert(!q.isZero());
  21742. var one = new BN(1).toRed(this);
  21743. var nOne = one.redNeg();
  21744. // Find quadratic non-residue
  21745. // NOTE: Max is such because of generalized Riemann hypothesis.
  21746. var lpow = this.m.subn(1).iushrn(1);
  21747. var z = this.m.bitLength();
  21748. z = new BN(2 * z * z).toRed(this);
  21749. while (this.pow(z, lpow).cmp(nOne) !== 0) {
  21750. z.redIAdd(nOne);
  21751. }
  21752. var c = this.pow(z, q);
  21753. var r = this.pow(a, q.addn(1).iushrn(1));
  21754. var t = this.pow(a, q);
  21755. var m = s;
  21756. while (t.cmp(one) !== 0) {
  21757. var tmp = t;
  21758. for (var i = 0; tmp.cmp(one) !== 0; i++) {
  21759. tmp = tmp.redSqr();
  21760. }
  21761. assert(i < m);
  21762. var b = this.pow(c, new BN(1).iushln(m - i - 1));
  21763. r = r.redMul(b);
  21764. c = b.redSqr();
  21765. t = t.redMul(c);
  21766. m = i;
  21767. }
  21768. return r;
  21769. };
  21770. Red.prototype.invm = function invm (a) {
  21771. var inv = a._invmp(this.m);
  21772. if (inv.negative !== 0) {
  21773. inv.negative = 0;
  21774. return this.imod(inv).redNeg();
  21775. } else {
  21776. return this.imod(inv);
  21777. }
  21778. };
  21779. Red.prototype.pow = function pow (a, num) {
  21780. if (num.isZero()) return new BN(1).toRed(this);
  21781. if (num.cmpn(1) === 0) return a.clone();
  21782. var windowSize = 4;
  21783. var wnd = new Array(1 << windowSize);
  21784. wnd[0] = new BN(1).toRed(this);
  21785. wnd[1] = a;
  21786. for (var i = 2; i < wnd.length; i++) {
  21787. wnd[i] = this.mul(wnd[i - 1], a);
  21788. }
  21789. var res = wnd[0];
  21790. var current = 0;
  21791. var currentLen = 0;
  21792. var start = num.bitLength() % 26;
  21793. if (start === 0) {
  21794. start = 26;
  21795. }
  21796. for (i = num.length - 1; i >= 0; i--) {
  21797. var word = num.words[i];
  21798. for (var j = start - 1; j >= 0; j--) {
  21799. var bit = (word >> j) & 1;
  21800. if (res !== wnd[0]) {
  21801. res = this.sqr(res);
  21802. }
  21803. if (bit === 0 && current === 0) {
  21804. currentLen = 0;
  21805. continue;
  21806. }
  21807. current <<= 1;
  21808. current |= bit;
  21809. currentLen++;
  21810. if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;
  21811. res = this.mul(res, wnd[current]);
  21812. currentLen = 0;
  21813. current = 0;
  21814. }
  21815. start = 26;
  21816. }
  21817. return res;
  21818. };
  21819. Red.prototype.convertTo = function convertTo (num) {
  21820. var r = num.umod(this.m);
  21821. return r === num ? r.clone() : r;
  21822. };
  21823. Red.prototype.convertFrom = function convertFrom (num) {
  21824. var res = num.clone();
  21825. res.red = null;
  21826. return res;
  21827. };
  21828. //
  21829. // Montgomery method engine
  21830. //
  21831. BN.mont = function mont (num) {
  21832. return new Mont(num);
  21833. };
  21834. function Mont (m) {
  21835. Red.call(this, m);
  21836. this.shift = this.m.bitLength();
  21837. if (this.shift % 26 !== 0) {
  21838. this.shift += 26 - (this.shift % 26);
  21839. }
  21840. this.r = new BN(1).iushln(this.shift);
  21841. this.r2 = this.imod(this.r.sqr());
  21842. this.rinv = this.r._invmp(this.m);
  21843. this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);
  21844. this.minv = this.minv.umod(this.r);
  21845. this.minv = this.r.sub(this.minv);
  21846. }
  21847. inherits(Mont, Red);
  21848. Mont.prototype.convertTo = function convertTo (num) {
  21849. return this.imod(num.ushln(this.shift));
  21850. };
  21851. Mont.prototype.convertFrom = function convertFrom (num) {
  21852. var r = this.imod(num.mul(this.rinv));
  21853. r.red = null;
  21854. return r;
  21855. };
  21856. Mont.prototype.imul = function imul (a, b) {
  21857. if (a.isZero() || b.isZero()) {
  21858. a.words[0] = 0;
  21859. a.length = 1;
  21860. return a;
  21861. }
  21862. var t = a.imul(b);
  21863. var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
  21864. var u = t.isub(c).iushrn(this.shift);
  21865. var res = u;
  21866. if (u.cmp(this.m) >= 0) {
  21867. res = u.isub(this.m);
  21868. } else if (u.cmpn(0) < 0) {
  21869. res = u.iadd(this.m);
  21870. }
  21871. return res._forceRed(this);
  21872. };
  21873. Mont.prototype.mul = function mul (a, b) {
  21874. if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);
  21875. var t = a.mul(b);
  21876. var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
  21877. var u = t.isub(c).iushrn(this.shift);
  21878. var res = u;
  21879. if (u.cmp(this.m) >= 0) {
  21880. res = u.isub(this.m);
  21881. } else if (u.cmpn(0) < 0) {
  21882. res = u.iadd(this.m);
  21883. }
  21884. return res._forceRed(this);
  21885. };
  21886. Mont.prototype.invm = function invm (a) {
  21887. // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R
  21888. var res = this.imod(a._invmp(this.m).mul(this.r2));
  21889. return res._forceRed(this);
  21890. };
  21891. })( false || module, this);
  21892. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/module.js */ 164)(module)))
  21893. /***/ }),
  21894. /* 164 */
  21895. /*!***********************************!*\
  21896. !*** (webpack)/buildin/module.js ***!
  21897. \***********************************/
  21898. /*! no static exports found */
  21899. /***/ (function(module, exports) {
  21900. module.exports = function(module) {
  21901. if (!module.webpackPolyfill) {
  21902. module.deprecate = function() {};
  21903. module.paths = [];
  21904. // module.parent = undefined by default
  21905. if (!module.children) module.children = [];
  21906. Object.defineProperty(module, "loaded", {
  21907. enumerable: true,
  21908. get: function() {
  21909. return module.l;
  21910. }
  21911. });
  21912. Object.defineProperty(module, "id", {
  21913. enumerable: true,
  21914. get: function() {
  21915. return module.i;
  21916. }
  21917. });
  21918. module.webpackPolyfill = 1;
  21919. }
  21920. return module;
  21921. };
  21922. /***/ }),
  21923. /* 165 */
  21924. /*!************************!*\
  21925. !*** buffer (ignored) ***!
  21926. \************************/
  21927. /*! no static exports found */
  21928. /***/ (function(module, exports) {
  21929. /* (ignored) */
  21930. /***/ }),
  21931. /* 166 */
  21932. /*!*********************************************!*\
  21933. !*** ./node_modules/miller-rabin/lib/mr.js ***!
  21934. \*********************************************/
  21935. /*! no static exports found */
  21936. /***/ (function(module, exports, __webpack_require__) {
  21937. var bn = __webpack_require__(/*! bn.js */ 163);
  21938. var brorand = __webpack_require__(/*! brorand */ 167);
  21939. function MillerRabin(rand) {
  21940. this.rand = rand || new brorand.Rand();
  21941. }
  21942. module.exports = MillerRabin;
  21943. MillerRabin.create = function create(rand) {
  21944. return new MillerRabin(rand);
  21945. };
  21946. MillerRabin.prototype._randbelow = function _randbelow(n) {
  21947. var len = n.bitLength();
  21948. var min_bytes = Math.ceil(len / 8);
  21949. // Generage random bytes until a number less than n is found.
  21950. // This ensures that 0..n-1 have an equal probability of being selected.
  21951. do
  21952. var a = new bn(this.rand.generate(min_bytes));
  21953. while (a.cmp(n) >= 0);
  21954. return a;
  21955. };
  21956. MillerRabin.prototype._randrange = function _randrange(start, stop) {
  21957. // Generate a random number greater than or equal to start and less than stop.
  21958. var size = stop.sub(start);
  21959. return start.add(this._randbelow(size));
  21960. };
  21961. MillerRabin.prototype.test = function test(n, k, cb) {
  21962. var len = n.bitLength();
  21963. var red = bn.mont(n);
  21964. var rone = new bn(1).toRed(red);
  21965. if (!k)
  21966. k = Math.max(1, (len / 48) | 0);
  21967. // Find d and s, (n - 1) = (2 ^ s) * d;
  21968. var n1 = n.subn(1);
  21969. for (var s = 0; !n1.testn(s); s++) {}
  21970. var d = n.shrn(s);
  21971. var rn1 = n1.toRed(red);
  21972. var prime = true;
  21973. for (; k > 0; k--) {
  21974. var a = this._randrange(new bn(2), n1);
  21975. if (cb)
  21976. cb(a);
  21977. var x = a.toRed(red).redPow(d);
  21978. if (x.cmp(rone) === 0 || x.cmp(rn1) === 0)
  21979. continue;
  21980. for (var i = 1; i < s; i++) {
  21981. x = x.redSqr();
  21982. if (x.cmp(rone) === 0)
  21983. return false;
  21984. if (x.cmp(rn1) === 0)
  21985. break;
  21986. }
  21987. if (i === s)
  21988. return false;
  21989. }
  21990. return prime;
  21991. };
  21992. MillerRabin.prototype.getDivisor = function getDivisor(n, k) {
  21993. var len = n.bitLength();
  21994. var red = bn.mont(n);
  21995. var rone = new bn(1).toRed(red);
  21996. if (!k)
  21997. k = Math.max(1, (len / 48) | 0);
  21998. // Find d and s, (n - 1) = (2 ^ s) * d;
  21999. var n1 = n.subn(1);
  22000. for (var s = 0; !n1.testn(s); s++) {}
  22001. var d = n.shrn(s);
  22002. var rn1 = n1.toRed(red);
  22003. for (; k > 0; k--) {
  22004. var a = this._randrange(new bn(2), n1);
  22005. var g = n.gcd(a);
  22006. if (g.cmpn(1) !== 0)
  22007. return g;
  22008. var x = a.toRed(red).redPow(d);
  22009. if (x.cmp(rone) === 0 || x.cmp(rn1) === 0)
  22010. continue;
  22011. for (var i = 1; i < s; i++) {
  22012. x = x.redSqr();
  22013. if (x.cmp(rone) === 0)
  22014. return x.fromRed().subn(1).gcd(n);
  22015. if (x.cmp(rn1) === 0)
  22016. break;
  22017. }
  22018. if (i === s) {
  22019. x = x.redSqr();
  22020. return x.fromRed().subn(1).gcd(n);
  22021. }
  22022. }
  22023. return false;
  22024. };
  22025. /***/ }),
  22026. /* 167 */
  22027. /*!***************************************!*\
  22028. !*** ./node_modules/brorand/index.js ***!
  22029. \***************************************/
  22030. /*! no static exports found */
  22031. /***/ (function(module, exports, __webpack_require__) {
  22032. var r;
  22033. module.exports = function rand(len) {
  22034. if (!r)
  22035. r = new Rand(null);
  22036. return r.generate(len);
  22037. };
  22038. function Rand(rand) {
  22039. this.rand = rand;
  22040. }
  22041. module.exports.Rand = Rand;
  22042. Rand.prototype.generate = function generate(len) {
  22043. return this._rand(len);
  22044. };
  22045. // Emulate crypto API using randy
  22046. Rand.prototype._rand = function _rand(n) {
  22047. if (this.rand.getBytes)
  22048. return this.rand.getBytes(n);
  22049. var res = new Uint8Array(n);
  22050. for (var i = 0; i < res.length; i++)
  22051. res[i] = this.rand.getByte();
  22052. return res;
  22053. };
  22054. if (typeof self === 'object') {
  22055. if (self.crypto && self.crypto.getRandomValues) {
  22056. // Modern browsers
  22057. Rand.prototype._rand = function _rand(n) {
  22058. var arr = new Uint8Array(n);
  22059. self.crypto.getRandomValues(arr);
  22060. return arr;
  22061. };
  22062. } else if (self.msCrypto && self.msCrypto.getRandomValues) {
  22063. // IE
  22064. Rand.prototype._rand = function _rand(n) {
  22065. var arr = new Uint8Array(n);
  22066. self.msCrypto.getRandomValues(arr);
  22067. return arr;
  22068. };
  22069. // Safari's WebWorkers do not have `crypto`
  22070. } else if (typeof window === 'object') {
  22071. // Old junk
  22072. Rand.prototype._rand = function() {
  22073. throw new Error('Not implemented yet');
  22074. };
  22075. }
  22076. } else {
  22077. // Node.js or Web worker with no crypto support
  22078. try {
  22079. var crypto = __webpack_require__(/*! crypto */ 168);
  22080. if (typeof crypto.randomBytes !== 'function')
  22081. throw new Error('Not supported');
  22082. Rand.prototype._rand = function _rand(n) {
  22083. return crypto.randomBytes(n);
  22084. };
  22085. } catch (e) {
  22086. }
  22087. }
  22088. /***/ }),
  22089. /* 168 */
  22090. /*!************************!*\
  22091. !*** crypto (ignored) ***!
  22092. \************************/
  22093. /*! no static exports found */
  22094. /***/ (function(module, exports) {
  22095. /* (ignored) */
  22096. /***/ }),
  22097. /* 169 */
  22098. /*!*****************************************************!*\
  22099. !*** ./node_modules/diffie-hellman/lib/primes.json ***!
  22100. \*****************************************************/
  22101. /*! exports provided: modp1, modp2, modp5, modp14, modp15, modp16, modp17, modp18, default */
  22102. /***/ (function(module) {
  22103. 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\"}}");
  22104. /***/ }),
  22105. /* 170 */
  22106. /*!***********************************************!*\
  22107. !*** ./node_modules/diffie-hellman/lib/dh.js ***!
  22108. \***********************************************/
  22109. /*! no static exports found */
  22110. /***/ (function(module, exports, __webpack_require__) {
  22111. /* WEBPACK VAR INJECTION */(function(Buffer) {var BN = __webpack_require__(/*! bn.js */ 163);
  22112. var MillerRabin = __webpack_require__(/*! miller-rabin */ 166);
  22113. var millerRabin = new MillerRabin();
  22114. var TWENTYFOUR = new BN(24);
  22115. var ELEVEN = new BN(11);
  22116. var TEN = new BN(10);
  22117. var THREE = new BN(3);
  22118. var SEVEN = new BN(7);
  22119. var primes = __webpack_require__(/*! ./generatePrime */ 162);
  22120. var randomBytes = __webpack_require__(/*! randombytes */ 78);
  22121. module.exports = DH;
  22122. function setPublicKey(pub, enc) {
  22123. enc = enc || 'utf8';
  22124. if (!Buffer.isBuffer(pub)) {
  22125. pub = new Buffer(pub, enc);
  22126. }
  22127. this._pub = new BN(pub);
  22128. return this;
  22129. }
  22130. function setPrivateKey(priv, enc) {
  22131. enc = enc || 'utf8';
  22132. if (!Buffer.isBuffer(priv)) {
  22133. priv = new Buffer(priv, enc);
  22134. }
  22135. this._priv = new BN(priv);
  22136. return this;
  22137. }
  22138. var primeCache = {};
  22139. function checkPrime(prime, generator) {
  22140. var gen = generator.toString('hex');
  22141. var hex = [gen, prime.toString(16)].join('_');
  22142. if (hex in primeCache) {
  22143. return primeCache[hex];
  22144. }
  22145. var error = 0;
  22146. if (prime.isEven() ||
  22147. !primes.simpleSieve ||
  22148. !primes.fermatTest(prime) ||
  22149. !millerRabin.test(prime)) {
  22150. //not a prime so +1
  22151. error += 1;
  22152. if (gen === '02' || gen === '05') {
  22153. // we'd be able to check the generator
  22154. // it would fail so +8
  22155. error += 8;
  22156. } else {
  22157. //we wouldn't be able to test the generator
  22158. // so +4
  22159. error += 4;
  22160. }
  22161. primeCache[hex] = error;
  22162. return error;
  22163. }
  22164. if (!millerRabin.test(prime.shrn(1))) {
  22165. //not a safe prime
  22166. error += 2;
  22167. }
  22168. var rem;
  22169. switch (gen) {
  22170. case '02':
  22171. if (prime.mod(TWENTYFOUR).cmp(ELEVEN)) {
  22172. // unsuidable generator
  22173. error += 8;
  22174. }
  22175. break;
  22176. case '05':
  22177. rem = prime.mod(TEN);
  22178. if (rem.cmp(THREE) && rem.cmp(SEVEN)) {
  22179. // prime mod 10 needs to equal 3 or 7
  22180. error += 8;
  22181. }
  22182. break;
  22183. default:
  22184. error += 4;
  22185. }
  22186. primeCache[hex] = error;
  22187. return error;
  22188. }
  22189. function DH(prime, generator, malleable) {
  22190. this.setGenerator(generator);
  22191. this.__prime = new BN(prime);
  22192. this._prime = BN.mont(this.__prime);
  22193. this._primeLen = prime.length;
  22194. this._pub = undefined;
  22195. this._priv = undefined;
  22196. this._primeCode = undefined;
  22197. if (malleable) {
  22198. this.setPublicKey = setPublicKey;
  22199. this.setPrivateKey = setPrivateKey;
  22200. } else {
  22201. this._primeCode = 8;
  22202. }
  22203. }
  22204. Object.defineProperty(DH.prototype, 'verifyError', {
  22205. enumerable: true,
  22206. get: function () {
  22207. if (typeof this._primeCode !== 'number') {
  22208. this._primeCode = checkPrime(this.__prime, this.__gen);
  22209. }
  22210. return this._primeCode;
  22211. }
  22212. });
  22213. DH.prototype.generateKeys = function () {
  22214. if (!this._priv) {
  22215. this._priv = new BN(randomBytes(this._primeLen));
  22216. }
  22217. this._pub = this._gen.toRed(this._prime).redPow(this._priv).fromRed();
  22218. return this.getPublicKey();
  22219. };
  22220. DH.prototype.computeSecret = function (other) {
  22221. other = new BN(other);
  22222. other = other.toRed(this._prime);
  22223. var secret = other.redPow(this._priv).fromRed();
  22224. var out = new Buffer(secret.toArray());
  22225. var prime = this.getPrime();
  22226. if (out.length < prime.length) {
  22227. var front = new Buffer(prime.length - out.length);
  22228. front.fill(0);
  22229. out = Buffer.concat([front, out]);
  22230. }
  22231. return out;
  22232. };
  22233. DH.prototype.getPublicKey = function getPublicKey(enc) {
  22234. return formatReturnValue(this._pub, enc);
  22235. };
  22236. DH.prototype.getPrivateKey = function getPrivateKey(enc) {
  22237. return formatReturnValue(this._priv, enc);
  22238. };
  22239. DH.prototype.getPrime = function (enc) {
  22240. return formatReturnValue(this.__prime, enc);
  22241. };
  22242. DH.prototype.getGenerator = function (enc) {
  22243. return formatReturnValue(this._gen, enc);
  22244. };
  22245. DH.prototype.setGenerator = function (gen, enc) {
  22246. enc = enc || 'utf8';
  22247. if (!Buffer.isBuffer(gen)) {
  22248. gen = new Buffer(gen, enc);
  22249. }
  22250. this.__gen = gen;
  22251. this._gen = new BN(gen);
  22252. return this;
  22253. };
  22254. function formatReturnValue(bn, enc) {
  22255. var buf = new Buffer(bn.toArray());
  22256. if (!enc) {
  22257. return buf;
  22258. } else {
  22259. return buf.toString(enc);
  22260. }
  22261. }
  22262. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../buffer/index.js */ 82).Buffer))
  22263. /***/ }),
  22264. /* 171 */
  22265. /*!*******************************************************!*\
  22266. !*** ./node_modules/browserify-sign/browser/index.js ***!
  22267. \*******************************************************/
  22268. /*! no static exports found */
  22269. /***/ (function(module, exports, __webpack_require__) {
  22270. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  22271. var createHash = __webpack_require__(/*! create-hash */ 86)
  22272. var stream = __webpack_require__(/*! readable-stream */ 90)
  22273. var inherits = __webpack_require__(/*! inherits */ 87)
  22274. var sign = __webpack_require__(/*! ./sign */ 172)
  22275. var verify = __webpack_require__(/*! ./verify */ 225)
  22276. var algorithms = __webpack_require__(/*! ./algorithms.json */ 125)
  22277. Object.keys(algorithms).forEach(function (key) {
  22278. algorithms[key].id = Buffer.from(algorithms[key].id, 'hex')
  22279. algorithms[key.toLowerCase()] = algorithms[key]
  22280. })
  22281. function Sign (algorithm) {
  22282. stream.Writable.call(this)
  22283. var data = algorithms[algorithm]
  22284. if (!data) throw new Error('Unknown message digest')
  22285. this._hashType = data.hash
  22286. this._hash = createHash(data.hash)
  22287. this._tag = data.id
  22288. this._signType = data.sign
  22289. }
  22290. inherits(Sign, stream.Writable)
  22291. Sign.prototype._write = function _write (data, _, done) {
  22292. this._hash.update(data)
  22293. done()
  22294. }
  22295. Sign.prototype.update = function update (data, enc) {
  22296. if (typeof data === 'string') data = Buffer.from(data, enc)
  22297. this._hash.update(data)
  22298. return this
  22299. }
  22300. Sign.prototype.sign = function signMethod (key, enc) {
  22301. this.end()
  22302. var hash = this._hash.digest()
  22303. var sig = sign(hash, key, this._hashType, this._signType, this._tag)
  22304. return enc ? sig.toString(enc) : sig
  22305. }
  22306. function Verify (algorithm) {
  22307. stream.Writable.call(this)
  22308. var data = algorithms[algorithm]
  22309. if (!data) throw new Error('Unknown message digest')
  22310. this._hash = createHash(data.hash)
  22311. this._tag = data.id
  22312. this._signType = data.sign
  22313. }
  22314. inherits(Verify, stream.Writable)
  22315. Verify.prototype._write = function _write (data, _, done) {
  22316. this._hash.update(data)
  22317. done()
  22318. }
  22319. Verify.prototype.update = function update (data, enc) {
  22320. if (typeof data === 'string') data = Buffer.from(data, enc)
  22321. this._hash.update(data)
  22322. return this
  22323. }
  22324. Verify.prototype.verify = function verifyMethod (key, sig, enc) {
  22325. if (typeof sig === 'string') sig = Buffer.from(sig, enc)
  22326. this.end()
  22327. var hash = this._hash.digest()
  22328. return verify(sig, hash, key, this._signType, this._tag)
  22329. }
  22330. function createSign (algorithm) {
  22331. return new Sign(algorithm)
  22332. }
  22333. function createVerify (algorithm) {
  22334. return new Verify(algorithm)
  22335. }
  22336. module.exports = {
  22337. Sign: createSign,
  22338. Verify: createVerify,
  22339. createSign: createSign,
  22340. createVerify: createVerify
  22341. }
  22342. /***/ }),
  22343. /* 172 */
  22344. /*!******************************************************!*\
  22345. !*** ./node_modules/browserify-sign/browser/sign.js ***!
  22346. \******************************************************/
  22347. /*! no static exports found */
  22348. /***/ (function(module, exports, __webpack_require__) {
  22349. // much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js
  22350. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  22351. var createHmac = __webpack_require__(/*! create-hmac */ 121)
  22352. var crt = __webpack_require__(/*! browserify-rsa */ 173)
  22353. var EC = __webpack_require__(/*! elliptic */ 174).ec
  22354. var BN = __webpack_require__(/*! bn.js */ 163)
  22355. var parseKeys = __webpack_require__(/*! parse-asn1 */ 204)
  22356. var curves = __webpack_require__(/*! ./curves.json */ 224)
  22357. function sign (hash, key, hashType, signType, tag) {
  22358. var priv = parseKeys(key)
  22359. if (priv.curve) {
  22360. // rsa keys can be interpreted as ecdsa ones in openssl
  22361. if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') throw new Error('wrong private key type')
  22362. return ecSign(hash, priv)
  22363. } else if (priv.type === 'dsa') {
  22364. if (signType !== 'dsa') throw new Error('wrong private key type')
  22365. return dsaSign(hash, priv, hashType)
  22366. } else {
  22367. if (signType !== 'rsa' && signType !== 'ecdsa/rsa') throw new Error('wrong private key type')
  22368. }
  22369. hash = Buffer.concat([tag, hash])
  22370. var len = priv.modulus.byteLength()
  22371. var pad = [0, 1]
  22372. while (hash.length + pad.length + 1 < len) pad.push(0xff)
  22373. pad.push(0x00)
  22374. var i = -1
  22375. while (++i < hash.length) pad.push(hash[i])
  22376. var out = crt(pad, priv)
  22377. return out
  22378. }
  22379. function ecSign (hash, priv) {
  22380. var curveId = curves[priv.curve.join('.')]
  22381. if (!curveId) throw new Error('unknown curve ' + priv.curve.join('.'))
  22382. var curve = new EC(curveId)
  22383. var key = curve.keyFromPrivate(priv.privateKey)
  22384. var out = key.sign(hash)
  22385. return Buffer.from(out.toDER())
  22386. }
  22387. function dsaSign (hash, priv, algo) {
  22388. var x = priv.params.priv_key
  22389. var p = priv.params.p
  22390. var q = priv.params.q
  22391. var g = priv.params.g
  22392. var r = new BN(0)
  22393. var k
  22394. var H = bits2int(hash, q).mod(q)
  22395. var s = false
  22396. var kv = getKey(x, q, hash, algo)
  22397. while (s === false) {
  22398. k = makeKey(q, kv, algo)
  22399. r = makeR(g, k, p, q)
  22400. s = k.invm(q).imul(H.add(x.mul(r))).mod(q)
  22401. if (s.cmpn(0) === 0) {
  22402. s = false
  22403. r = new BN(0)
  22404. }
  22405. }
  22406. return toDER(r, s)
  22407. }
  22408. function toDER (r, s) {
  22409. r = r.toArray()
  22410. s = s.toArray()
  22411. // Pad values
  22412. if (r[0] & 0x80) r = [0].concat(r)
  22413. if (s[0] & 0x80) s = [0].concat(s)
  22414. var total = r.length + s.length + 4
  22415. var res = [0x30, total, 0x02, r.length]
  22416. res = res.concat(r, [0x02, s.length], s)
  22417. return Buffer.from(res)
  22418. }
  22419. function getKey (x, q, hash, algo) {
  22420. x = Buffer.from(x.toArray())
  22421. if (x.length < q.byteLength()) {
  22422. var zeros = Buffer.alloc(q.byteLength() - x.length)
  22423. x = Buffer.concat([zeros, x])
  22424. }
  22425. var hlen = hash.length
  22426. var hbits = bits2octets(hash, q)
  22427. var v = Buffer.alloc(hlen)
  22428. v.fill(1)
  22429. var k = Buffer.alloc(hlen)
  22430. k = createHmac(algo, k).update(v).update(Buffer.from([0])).update(x).update(hbits).digest()
  22431. v = createHmac(algo, k).update(v).digest()
  22432. k = createHmac(algo, k).update(v).update(Buffer.from([1])).update(x).update(hbits).digest()
  22433. v = createHmac(algo, k).update(v).digest()
  22434. return { k: k, v: v }
  22435. }
  22436. function bits2int (obits, q) {
  22437. var bits = new BN(obits)
  22438. var shift = (obits.length << 3) - q.bitLength()
  22439. if (shift > 0) bits.ishrn(shift)
  22440. return bits
  22441. }
  22442. function bits2octets (bits, q) {
  22443. bits = bits2int(bits, q)
  22444. bits = bits.mod(q)
  22445. var out = Buffer.from(bits.toArray())
  22446. if (out.length < q.byteLength()) {
  22447. var zeros = Buffer.alloc(q.byteLength() - out.length)
  22448. out = Buffer.concat([zeros, out])
  22449. }
  22450. return out
  22451. }
  22452. function makeKey (q, kv, algo) {
  22453. var t
  22454. var k
  22455. do {
  22456. t = Buffer.alloc(0)
  22457. while (t.length * 8 < q.bitLength()) {
  22458. kv.v = createHmac(algo, kv.k).update(kv.v).digest()
  22459. t = Buffer.concat([t, kv.v])
  22460. }
  22461. k = bits2int(t, q)
  22462. kv.k = createHmac(algo, kv.k).update(kv.v).update(Buffer.from([0])).digest()
  22463. kv.v = createHmac(algo, kv.k).update(kv.v).digest()
  22464. } while (k.cmp(q) !== -1)
  22465. return k
  22466. }
  22467. function makeR (g, k, p, q) {
  22468. return g.toRed(BN.mont(p)).redPow(k).fromRed().mod(q)
  22469. }
  22470. module.exports = sign
  22471. module.exports.getKey = getKey
  22472. module.exports.makeKey = makeKey
  22473. /***/ }),
  22474. /* 173 */
  22475. /*!**********************************************!*\
  22476. !*** ./node_modules/browserify-rsa/index.js ***!
  22477. \**********************************************/
  22478. /*! no static exports found */
  22479. /***/ (function(module, exports, __webpack_require__) {
  22480. /* WEBPACK VAR INJECTION */(function(Buffer) {var bn = __webpack_require__(/*! bn.js */ 163);
  22481. var randomBytes = __webpack_require__(/*! randombytes */ 78);
  22482. module.exports = crt;
  22483. function blind(priv) {
  22484. var r = getr(priv);
  22485. var blinder = r.toRed(bn.mont(priv.modulus))
  22486. .redPow(new bn(priv.publicExponent)).fromRed();
  22487. return {
  22488. blinder: blinder,
  22489. unblinder:r.invm(priv.modulus)
  22490. };
  22491. }
  22492. function crt(msg, priv) {
  22493. var blinds = blind(priv);
  22494. var len = priv.modulus.byteLength();
  22495. var mod = bn.mont(priv.modulus);
  22496. var blinded = new bn(msg).mul(blinds.blinder).umod(priv.modulus);
  22497. var c1 = blinded.toRed(bn.mont(priv.prime1));
  22498. var c2 = blinded.toRed(bn.mont(priv.prime2));
  22499. var qinv = priv.coefficient;
  22500. var p = priv.prime1;
  22501. var q = priv.prime2;
  22502. var m1 = c1.redPow(priv.exponent1);
  22503. var m2 = c2.redPow(priv.exponent2);
  22504. m1 = m1.fromRed();
  22505. m2 = m2.fromRed();
  22506. var h = m1.isub(m2).imul(qinv).umod(p);
  22507. h.imul(q);
  22508. m2.iadd(h);
  22509. return new Buffer(m2.imul(blinds.unblinder).umod(priv.modulus).toArray(false, len));
  22510. }
  22511. crt.getr = getr;
  22512. function getr(priv) {
  22513. var len = priv.modulus.byteLength();
  22514. var r = new bn(randomBytes(len));
  22515. while (r.cmp(priv.modulus) >= 0 || !r.umod(priv.prime1) || !r.umod(priv.prime2)) {
  22516. r = new bn(randomBytes(len));
  22517. }
  22518. return r;
  22519. }
  22520. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ 82).Buffer))
  22521. /***/ }),
  22522. /* 174 */
  22523. /*!***********************************************!*\
  22524. !*** ./node_modules/elliptic/lib/elliptic.js ***!
  22525. \***********************************************/
  22526. /*! no static exports found */
  22527. /***/ (function(module, exports, __webpack_require__) {
  22528. "use strict";
  22529. var elliptic = exports;
  22530. elliptic.version = __webpack_require__(/*! ../package.json */ 175).version;
  22531. elliptic.utils = __webpack_require__(/*! ./elliptic/utils */ 176);
  22532. elliptic.rand = __webpack_require__(/*! brorand */ 167);
  22533. elliptic.curve = __webpack_require__(/*! ./elliptic/curve */ 178);
  22534. elliptic.curves = __webpack_require__(/*! ./elliptic/curves */ 183);
  22535. // Protocols
  22536. elliptic.ec = __webpack_require__(/*! ./elliptic/ec */ 197);
  22537. elliptic.eddsa = __webpack_require__(/*! ./elliptic/eddsa */ 201);
  22538. /***/ }),
  22539. /* 175 */
  22540. /*!********************************************!*\
  22541. !*** ./node_modules/elliptic/package.json ***!
  22542. \********************************************/
  22543. /*! exports provided: _args, _from, _id, _inBundle, _integrity, _location, _phantomChildren, _requested, _requiredBy, _resolved, _spec, _where, author, bugs, dependencies, description, devDependencies, files, homepage, keywords, license, main, name, repository, scripts, version, default */
  22544. /***/ (function(module) {
  22545. module.exports = JSON.parse("{\"_args\":[[\"elliptic@6.5.2\",\"/Users/guoshengqiang/Documents/hbx-plugins/uniapp-cli\"]],\"_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\":\"version\",\"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\",\"_spec\":\"6.5.2\",\"_where\":\"/Users/guoshengqiang/Documents/hbx-plugins/uniapp-cli\",\"author\":{\"name\":\"Fedor Indutny\",\"email\":\"fedor@indutny.com\"},\"bugs\":{\"url\":\"https://github.com/indutny/elliptic/issues\"},\"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\"},\"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\"}");
  22546. /***/ }),
  22547. /* 176 */
  22548. /*!*****************************************************!*\
  22549. !*** ./node_modules/elliptic/lib/elliptic/utils.js ***!
  22550. \*****************************************************/
  22551. /*! no static exports found */
  22552. /***/ (function(module, exports, __webpack_require__) {
  22553. "use strict";
  22554. var utils = exports;
  22555. var BN = __webpack_require__(/*! bn.js */ 163);
  22556. var minAssert = __webpack_require__(/*! minimalistic-assert */ 137);
  22557. var minUtils = __webpack_require__(/*! minimalistic-crypto-utils */ 177);
  22558. utils.assert = minAssert;
  22559. utils.toArray = minUtils.toArray;
  22560. utils.zero2 = minUtils.zero2;
  22561. utils.toHex = minUtils.toHex;
  22562. utils.encode = minUtils.encode;
  22563. // Represent num in a w-NAF form
  22564. function getNAF(num, w, bits) {
  22565. var naf = new Array(Math.max(num.bitLength(), bits) + 1);
  22566. naf.fill(0);
  22567. var ws = 1 << (w + 1);
  22568. var k = num.clone();
  22569. for (var i = 0; i < naf.length; i++) {
  22570. var z;
  22571. var mod = k.andln(ws - 1);
  22572. if (k.isOdd()) {
  22573. if (mod > (ws >> 1) - 1)
  22574. z = (ws >> 1) - mod;
  22575. else
  22576. z = mod;
  22577. k.isubn(z);
  22578. } else {
  22579. z = 0;
  22580. }
  22581. naf[i] = z;
  22582. k.iushrn(1);
  22583. }
  22584. return naf;
  22585. }
  22586. utils.getNAF = getNAF;
  22587. // Represent k1, k2 in a Joint Sparse Form
  22588. function getJSF(k1, k2) {
  22589. var jsf = [
  22590. [],
  22591. []
  22592. ];
  22593. k1 = k1.clone();
  22594. k2 = k2.clone();
  22595. var d1 = 0;
  22596. var d2 = 0;
  22597. while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) {
  22598. // First phase
  22599. var m14 = (k1.andln(3) + d1) & 3;
  22600. var m24 = (k2.andln(3) + d2) & 3;
  22601. if (m14 === 3)
  22602. m14 = -1;
  22603. if (m24 === 3)
  22604. m24 = -1;
  22605. var u1;
  22606. if ((m14 & 1) === 0) {
  22607. u1 = 0;
  22608. } else {
  22609. var m8 = (k1.andln(7) + d1) & 7;
  22610. if ((m8 === 3 || m8 === 5) && m24 === 2)
  22611. u1 = -m14;
  22612. else
  22613. u1 = m14;
  22614. }
  22615. jsf[0].push(u1);
  22616. var u2;
  22617. if ((m24 & 1) === 0) {
  22618. u2 = 0;
  22619. } else {
  22620. var m8 = (k2.andln(7) + d2) & 7;
  22621. if ((m8 === 3 || m8 === 5) && m14 === 2)
  22622. u2 = -m24;
  22623. else
  22624. u2 = m24;
  22625. }
  22626. jsf[1].push(u2);
  22627. // Second phase
  22628. if (2 * d1 === u1 + 1)
  22629. d1 = 1 - d1;
  22630. if (2 * d2 === u2 + 1)
  22631. d2 = 1 - d2;
  22632. k1.iushrn(1);
  22633. k2.iushrn(1);
  22634. }
  22635. return jsf;
  22636. }
  22637. utils.getJSF = getJSF;
  22638. function cachedProperty(obj, name, computer) {
  22639. var key = '_' + name;
  22640. obj.prototype[name] = function cachedProperty() {
  22641. return this[key] !== undefined ? this[key] :
  22642. this[key] = computer.call(this);
  22643. };
  22644. }
  22645. utils.cachedProperty = cachedProperty;
  22646. function parseBytes(bytes) {
  22647. return typeof bytes === 'string' ? utils.toArray(bytes, 'hex') :
  22648. bytes;
  22649. }
  22650. utils.parseBytes = parseBytes;
  22651. function intFromLE(bytes) {
  22652. return new BN(bytes, 'hex', 'le');
  22653. }
  22654. utils.intFromLE = intFromLE;
  22655. /***/ }),
  22656. /* 177 */
  22657. /*!*************************************************************!*\
  22658. !*** ./node_modules/minimalistic-crypto-utils/lib/utils.js ***!
  22659. \*************************************************************/
  22660. /*! no static exports found */
  22661. /***/ (function(module, exports, __webpack_require__) {
  22662. "use strict";
  22663. var utils = exports;
  22664. function toArray(msg, enc) {
  22665. if (Array.isArray(msg))
  22666. return msg.slice();
  22667. if (!msg)
  22668. return [];
  22669. var res = [];
  22670. if (typeof msg !== 'string') {
  22671. for (var i = 0; i < msg.length; i++)
  22672. res[i] = msg[i] | 0;
  22673. return res;
  22674. }
  22675. if (enc === 'hex') {
  22676. msg = msg.replace(/[^a-z0-9]+/ig, '');
  22677. if (msg.length % 2 !== 0)
  22678. msg = '0' + msg;
  22679. for (var i = 0; i < msg.length; i += 2)
  22680. res.push(parseInt(msg[i] + msg[i + 1], 16));
  22681. } else {
  22682. for (var i = 0; i < msg.length; i++) {
  22683. var c = msg.charCodeAt(i);
  22684. var hi = c >> 8;
  22685. var lo = c & 0xff;
  22686. if (hi)
  22687. res.push(hi, lo);
  22688. else
  22689. res.push(lo);
  22690. }
  22691. }
  22692. return res;
  22693. }
  22694. utils.toArray = toArray;
  22695. function zero2(word) {
  22696. if (word.length === 1)
  22697. return '0' + word;
  22698. else
  22699. return word;
  22700. }
  22701. utils.zero2 = zero2;
  22702. function toHex(msg) {
  22703. var res = '';
  22704. for (var i = 0; i < msg.length; i++)
  22705. res += zero2(msg[i].toString(16));
  22706. return res;
  22707. }
  22708. utils.toHex = toHex;
  22709. utils.encode = function encode(arr, enc) {
  22710. if (enc === 'hex')
  22711. return toHex(arr);
  22712. else
  22713. return arr;
  22714. };
  22715. /***/ }),
  22716. /* 178 */
  22717. /*!***********************************************************!*\
  22718. !*** ./node_modules/elliptic/lib/elliptic/curve/index.js ***!
  22719. \***********************************************************/
  22720. /*! no static exports found */
  22721. /***/ (function(module, exports, __webpack_require__) {
  22722. "use strict";
  22723. var curve = exports;
  22724. curve.base = __webpack_require__(/*! ./base */ 179);
  22725. curve.short = __webpack_require__(/*! ./short */ 180);
  22726. curve.mont = __webpack_require__(/*! ./mont */ 181);
  22727. curve.edwards = __webpack_require__(/*! ./edwards */ 182);
  22728. /***/ }),
  22729. /* 179 */
  22730. /*!**********************************************************!*\
  22731. !*** ./node_modules/elliptic/lib/elliptic/curve/base.js ***!
  22732. \**********************************************************/
  22733. /*! no static exports found */
  22734. /***/ (function(module, exports, __webpack_require__) {
  22735. "use strict";
  22736. var BN = __webpack_require__(/*! bn.js */ 163);
  22737. var utils = __webpack_require__(/*! ../utils */ 176);
  22738. var getNAF = utils.getNAF;
  22739. var getJSF = utils.getJSF;
  22740. var assert = utils.assert;
  22741. function BaseCurve(type, conf) {
  22742. this.type = type;
  22743. this.p = new BN(conf.p, 16);
  22744. // Use Montgomery, when there is no fast reduction for the prime
  22745. this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p);
  22746. // Useful for many curves
  22747. this.zero = new BN(0).toRed(this.red);
  22748. this.one = new BN(1).toRed(this.red);
  22749. this.two = new BN(2).toRed(this.red);
  22750. // Curve configuration, optional
  22751. this.n = conf.n && new BN(conf.n, 16);
  22752. this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed);
  22753. // Temporary arrays
  22754. this._wnafT1 = new Array(4);
  22755. this._wnafT2 = new Array(4);
  22756. this._wnafT3 = new Array(4);
  22757. this._wnafT4 = new Array(4);
  22758. this._bitLength = this.n ? this.n.bitLength() : 0;
  22759. // Generalized Greg Maxwell's trick
  22760. var adjustCount = this.n && this.p.div(this.n);
  22761. if (!adjustCount || adjustCount.cmpn(100) > 0) {
  22762. this.redN = null;
  22763. } else {
  22764. this._maxwellTrick = true;
  22765. this.redN = this.n.toRed(this.red);
  22766. }
  22767. }
  22768. module.exports = BaseCurve;
  22769. BaseCurve.prototype.point = function point() {
  22770. throw new Error('Not implemented');
  22771. };
  22772. BaseCurve.prototype.validate = function validate() {
  22773. throw new Error('Not implemented');
  22774. };
  22775. BaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) {
  22776. assert(p.precomputed);
  22777. var doubles = p._getDoubles();
  22778. var naf = getNAF(k, 1, this._bitLength);
  22779. var I = (1 << (doubles.step + 1)) - (doubles.step % 2 === 0 ? 2 : 1);
  22780. I /= 3;
  22781. // Translate into more windowed form
  22782. var repr = [];
  22783. for (var j = 0; j < naf.length; j += doubles.step) {
  22784. var nafW = 0;
  22785. for (var k = j + doubles.step - 1; k >= j; k--)
  22786. nafW = (nafW << 1) + naf[k];
  22787. repr.push(nafW);
  22788. }
  22789. var a = this.jpoint(null, null, null);
  22790. var b = this.jpoint(null, null, null);
  22791. for (var i = I; i > 0; i--) {
  22792. for (var j = 0; j < repr.length; j++) {
  22793. var nafW = repr[j];
  22794. if (nafW === i)
  22795. b = b.mixedAdd(doubles.points[j]);
  22796. else if (nafW === -i)
  22797. b = b.mixedAdd(doubles.points[j].neg());
  22798. }
  22799. a = a.add(b);
  22800. }
  22801. return a.toP();
  22802. };
  22803. BaseCurve.prototype._wnafMul = function _wnafMul(p, k) {
  22804. var w = 4;
  22805. // Precompute window
  22806. var nafPoints = p._getNAFPoints(w);
  22807. w = nafPoints.wnd;
  22808. var wnd = nafPoints.points;
  22809. // Get NAF form
  22810. var naf = getNAF(k, w, this._bitLength);
  22811. // Add `this`*(N+1) for every w-NAF index
  22812. var acc = this.jpoint(null, null, null);
  22813. for (var i = naf.length - 1; i >= 0; i--) {
  22814. // Count zeroes
  22815. for (var k = 0; i >= 0 && naf[i] === 0; i--)
  22816. k++;
  22817. if (i >= 0)
  22818. k++;
  22819. acc = acc.dblp(k);
  22820. if (i < 0)
  22821. break;
  22822. var z = naf[i];
  22823. assert(z !== 0);
  22824. if (p.type === 'affine') {
  22825. // J +- P
  22826. if (z > 0)
  22827. acc = acc.mixedAdd(wnd[(z - 1) >> 1]);
  22828. else
  22829. acc = acc.mixedAdd(wnd[(-z - 1) >> 1].neg());
  22830. } else {
  22831. // J +- J
  22832. if (z > 0)
  22833. acc = acc.add(wnd[(z - 1) >> 1]);
  22834. else
  22835. acc = acc.add(wnd[(-z - 1) >> 1].neg());
  22836. }
  22837. }
  22838. return p.type === 'affine' ? acc.toP() : acc;
  22839. };
  22840. BaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW,
  22841. points,
  22842. coeffs,
  22843. len,
  22844. jacobianResult) {
  22845. var wndWidth = this._wnafT1;
  22846. var wnd = this._wnafT2;
  22847. var naf = this._wnafT3;
  22848. // Fill all arrays
  22849. var max = 0;
  22850. for (var i = 0; i < len; i++) {
  22851. var p = points[i];
  22852. var nafPoints = p._getNAFPoints(defW);
  22853. wndWidth[i] = nafPoints.wnd;
  22854. wnd[i] = nafPoints.points;
  22855. }
  22856. // Comb small window NAFs
  22857. for (var i = len - 1; i >= 1; i -= 2) {
  22858. var a = i - 1;
  22859. var b = i;
  22860. if (wndWidth[a] !== 1 || wndWidth[b] !== 1) {
  22861. naf[a] = getNAF(coeffs[a], wndWidth[a], this._bitLength);
  22862. naf[b] = getNAF(coeffs[b], wndWidth[b], this._bitLength);
  22863. max = Math.max(naf[a].length, max);
  22864. max = Math.max(naf[b].length, max);
  22865. continue;
  22866. }
  22867. var comb = [
  22868. points[a], /* 1 */
  22869. null, /* 3 */
  22870. null, /* 5 */
  22871. points[b] /* 7 */
  22872. ];
  22873. // Try to avoid Projective points, if possible
  22874. if (points[a].y.cmp(points[b].y) === 0) {
  22875. comb[1] = points[a].add(points[b]);
  22876. comb[2] = points[a].toJ().mixedAdd(points[b].neg());
  22877. } else if (points[a].y.cmp(points[b].y.redNeg()) === 0) {
  22878. comb[1] = points[a].toJ().mixedAdd(points[b]);
  22879. comb[2] = points[a].add(points[b].neg());
  22880. } else {
  22881. comb[1] = points[a].toJ().mixedAdd(points[b]);
  22882. comb[2] = points[a].toJ().mixedAdd(points[b].neg());
  22883. }
  22884. var index = [
  22885. -3, /* -1 -1 */
  22886. -1, /* -1 0 */
  22887. -5, /* -1 1 */
  22888. -7, /* 0 -1 */
  22889. 0, /* 0 0 */
  22890. 7, /* 0 1 */
  22891. 5, /* 1 -1 */
  22892. 1, /* 1 0 */
  22893. 3 /* 1 1 */
  22894. ];
  22895. var jsf = getJSF(coeffs[a], coeffs[b]);
  22896. max = Math.max(jsf[0].length, max);
  22897. naf[a] = new Array(max);
  22898. naf[b] = new Array(max);
  22899. for (var j = 0; j < max; j++) {
  22900. var ja = jsf[0][j] | 0;
  22901. var jb = jsf[1][j] | 0;
  22902. naf[a][j] = index[(ja + 1) * 3 + (jb + 1)];
  22903. naf[b][j] = 0;
  22904. wnd[a] = comb;
  22905. }
  22906. }
  22907. var acc = this.jpoint(null, null, null);
  22908. var tmp = this._wnafT4;
  22909. for (var i = max; i >= 0; i--) {
  22910. var k = 0;
  22911. while (i >= 0) {
  22912. var zero = true;
  22913. for (var j = 0; j < len; j++) {
  22914. tmp[j] = naf[j][i] | 0;
  22915. if (tmp[j] !== 0)
  22916. zero = false;
  22917. }
  22918. if (!zero)
  22919. break;
  22920. k++;
  22921. i--;
  22922. }
  22923. if (i >= 0)
  22924. k++;
  22925. acc = acc.dblp(k);
  22926. if (i < 0)
  22927. break;
  22928. for (var j = 0; j < len; j++) {
  22929. var z = tmp[j];
  22930. var p;
  22931. if (z === 0)
  22932. continue;
  22933. else if (z > 0)
  22934. p = wnd[j][(z - 1) >> 1];
  22935. else if (z < 0)
  22936. p = wnd[j][(-z - 1) >> 1].neg();
  22937. if (p.type === 'affine')
  22938. acc = acc.mixedAdd(p);
  22939. else
  22940. acc = acc.add(p);
  22941. }
  22942. }
  22943. // Zeroify references
  22944. for (var i = 0; i < len; i++)
  22945. wnd[i] = null;
  22946. if (jacobianResult)
  22947. return acc;
  22948. else
  22949. return acc.toP();
  22950. };
  22951. function BasePoint(curve, type) {
  22952. this.curve = curve;
  22953. this.type = type;
  22954. this.precomputed = null;
  22955. }
  22956. BaseCurve.BasePoint = BasePoint;
  22957. BasePoint.prototype.eq = function eq(/*other*/) {
  22958. throw new Error('Not implemented');
  22959. };
  22960. BasePoint.prototype.validate = function validate() {
  22961. return this.curve.validate(this);
  22962. };
  22963. BaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) {
  22964. bytes = utils.toArray(bytes, enc);
  22965. var len = this.p.byteLength();
  22966. // uncompressed, hybrid-odd, hybrid-even
  22967. if ((bytes[0] === 0x04 || bytes[0] === 0x06 || bytes[0] === 0x07) &&
  22968. bytes.length - 1 === 2 * len) {
  22969. if (bytes[0] === 0x06)
  22970. assert(bytes[bytes.length - 1] % 2 === 0);
  22971. else if (bytes[0] === 0x07)
  22972. assert(bytes[bytes.length - 1] % 2 === 1);
  22973. var res = this.point(bytes.slice(1, 1 + len),
  22974. bytes.slice(1 + len, 1 + 2 * len));
  22975. return res;
  22976. } else if ((bytes[0] === 0x02 || bytes[0] === 0x03) &&
  22977. bytes.length - 1 === len) {
  22978. return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 0x03);
  22979. }
  22980. throw new Error('Unknown point format');
  22981. };
  22982. BasePoint.prototype.encodeCompressed = function encodeCompressed(enc) {
  22983. return this.encode(enc, true);
  22984. };
  22985. BasePoint.prototype._encode = function _encode(compact) {
  22986. var len = this.curve.p.byteLength();
  22987. var x = this.getX().toArray('be', len);
  22988. if (compact)
  22989. return [ this.getY().isEven() ? 0x02 : 0x03 ].concat(x);
  22990. return [ 0x04 ].concat(x, this.getY().toArray('be', len)) ;
  22991. };
  22992. BasePoint.prototype.encode = function encode(enc, compact) {
  22993. return utils.encode(this._encode(compact), enc);
  22994. };
  22995. BasePoint.prototype.precompute = function precompute(power) {
  22996. if (this.precomputed)
  22997. return this;
  22998. var precomputed = {
  22999. doubles: null,
  23000. naf: null,
  23001. beta: null
  23002. };
  23003. precomputed.naf = this._getNAFPoints(8);
  23004. precomputed.doubles = this._getDoubles(4, power);
  23005. precomputed.beta = this._getBeta();
  23006. this.precomputed = precomputed;
  23007. return this;
  23008. };
  23009. BasePoint.prototype._hasDoubles = function _hasDoubles(k) {
  23010. if (!this.precomputed)
  23011. return false;
  23012. var doubles = this.precomputed.doubles;
  23013. if (!doubles)
  23014. return false;
  23015. return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step);
  23016. };
  23017. BasePoint.prototype._getDoubles = function _getDoubles(step, power) {
  23018. if (this.precomputed && this.precomputed.doubles)
  23019. return this.precomputed.doubles;
  23020. var doubles = [ this ];
  23021. var acc = this;
  23022. for (var i = 0; i < power; i += step) {
  23023. for (var j = 0; j < step; j++)
  23024. acc = acc.dbl();
  23025. doubles.push(acc);
  23026. }
  23027. return {
  23028. step: step,
  23029. points: doubles
  23030. };
  23031. };
  23032. BasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) {
  23033. if (this.precomputed && this.precomputed.naf)
  23034. return this.precomputed.naf;
  23035. var res = [ this ];
  23036. var max = (1 << wnd) - 1;
  23037. var dbl = max === 1 ? null : this.dbl();
  23038. for (var i = 1; i < max; i++)
  23039. res[i] = res[i - 1].add(dbl);
  23040. return {
  23041. wnd: wnd,
  23042. points: res
  23043. };
  23044. };
  23045. BasePoint.prototype._getBeta = function _getBeta() {
  23046. return null;
  23047. };
  23048. BasePoint.prototype.dblp = function dblp(k) {
  23049. var r = this;
  23050. for (var i = 0; i < k; i++)
  23051. r = r.dbl();
  23052. return r;
  23053. };
  23054. /***/ }),
  23055. /* 180 */
  23056. /*!***********************************************************!*\
  23057. !*** ./node_modules/elliptic/lib/elliptic/curve/short.js ***!
  23058. \***********************************************************/
  23059. /*! no static exports found */
  23060. /***/ (function(module, exports, __webpack_require__) {
  23061. "use strict";
  23062. var utils = __webpack_require__(/*! ../utils */ 176);
  23063. var BN = __webpack_require__(/*! bn.js */ 163);
  23064. var inherits = __webpack_require__(/*! inherits */ 87);
  23065. var Base = __webpack_require__(/*! ./base */ 179);
  23066. var assert = utils.assert;
  23067. function ShortCurve(conf) {
  23068. Base.call(this, 'short', conf);
  23069. this.a = new BN(conf.a, 16).toRed(this.red);
  23070. this.b = new BN(conf.b, 16).toRed(this.red);
  23071. this.tinv = this.two.redInvm();
  23072. this.zeroA = this.a.fromRed().cmpn(0) === 0;
  23073. this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0;
  23074. // If the curve is endomorphic, precalculate beta and lambda
  23075. this.endo = this._getEndomorphism(conf);
  23076. this._endoWnafT1 = new Array(4);
  23077. this._endoWnafT2 = new Array(4);
  23078. }
  23079. inherits(ShortCurve, Base);
  23080. module.exports = ShortCurve;
  23081. ShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) {
  23082. // No efficient endomorphism
  23083. if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1)
  23084. return;
  23085. // Compute beta and lambda, that lambda * P = (beta * Px; Py)
  23086. var beta;
  23087. var lambda;
  23088. if (conf.beta) {
  23089. beta = new BN(conf.beta, 16).toRed(this.red);
  23090. } else {
  23091. var betas = this._getEndoRoots(this.p);
  23092. // Choose the smallest beta
  23093. beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1];
  23094. beta = beta.toRed(this.red);
  23095. }
  23096. if (conf.lambda) {
  23097. lambda = new BN(conf.lambda, 16);
  23098. } else {
  23099. // Choose the lambda that is matching selected beta
  23100. var lambdas = this._getEndoRoots(this.n);
  23101. if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) {
  23102. lambda = lambdas[0];
  23103. } else {
  23104. lambda = lambdas[1];
  23105. assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0);
  23106. }
  23107. }
  23108. // Get basis vectors, used for balanced length-two representation
  23109. var basis;
  23110. if (conf.basis) {
  23111. basis = conf.basis.map(function(vec) {
  23112. return {
  23113. a: new BN(vec.a, 16),
  23114. b: new BN(vec.b, 16)
  23115. };
  23116. });
  23117. } else {
  23118. basis = this._getEndoBasis(lambda);
  23119. }
  23120. return {
  23121. beta: beta,
  23122. lambda: lambda,
  23123. basis: basis
  23124. };
  23125. };
  23126. ShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) {
  23127. // Find roots of for x^2 + x + 1 in F
  23128. // Root = (-1 +- Sqrt(-3)) / 2
  23129. //
  23130. var red = num === this.p ? this.red : BN.mont(num);
  23131. var tinv = new BN(2).toRed(red).redInvm();
  23132. var ntinv = tinv.redNeg();
  23133. var s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv);
  23134. var l1 = ntinv.redAdd(s).fromRed();
  23135. var l2 = ntinv.redSub(s).fromRed();
  23136. return [ l1, l2 ];
  23137. };
  23138. ShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) {
  23139. // aprxSqrt >= sqrt(this.n)
  23140. var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2));
  23141. // 3.74
  23142. // Run EGCD, until r(L + 1) < aprxSqrt
  23143. var u = lambda;
  23144. var v = this.n.clone();
  23145. var x1 = new BN(1);
  23146. var y1 = new BN(0);
  23147. var x2 = new BN(0);
  23148. var y2 = new BN(1);
  23149. // NOTE: all vectors are roots of: a + b * lambda = 0 (mod n)
  23150. var a0;
  23151. var b0;
  23152. // First vector
  23153. var a1;
  23154. var b1;
  23155. // Second vector
  23156. var a2;
  23157. var b2;
  23158. var prevR;
  23159. var i = 0;
  23160. var r;
  23161. var x;
  23162. while (u.cmpn(0) !== 0) {
  23163. var q = v.div(u);
  23164. r = v.sub(q.mul(u));
  23165. x = x2.sub(q.mul(x1));
  23166. var y = y2.sub(q.mul(y1));
  23167. if (!a1 && r.cmp(aprxSqrt) < 0) {
  23168. a0 = prevR.neg();
  23169. b0 = x1;
  23170. a1 = r.neg();
  23171. b1 = x;
  23172. } else if (a1 && ++i === 2) {
  23173. break;
  23174. }
  23175. prevR = r;
  23176. v = u;
  23177. u = r;
  23178. x2 = x1;
  23179. x1 = x;
  23180. y2 = y1;
  23181. y1 = y;
  23182. }
  23183. a2 = r.neg();
  23184. b2 = x;
  23185. var len1 = a1.sqr().add(b1.sqr());
  23186. var len2 = a2.sqr().add(b2.sqr());
  23187. if (len2.cmp(len1) >= 0) {
  23188. a2 = a0;
  23189. b2 = b0;
  23190. }
  23191. // Normalize signs
  23192. if (a1.negative) {
  23193. a1 = a1.neg();
  23194. b1 = b1.neg();
  23195. }
  23196. if (a2.negative) {
  23197. a2 = a2.neg();
  23198. b2 = b2.neg();
  23199. }
  23200. return [
  23201. { a: a1, b: b1 },
  23202. { a: a2, b: b2 }
  23203. ];
  23204. };
  23205. ShortCurve.prototype._endoSplit = function _endoSplit(k) {
  23206. var basis = this.endo.basis;
  23207. var v1 = basis[0];
  23208. var v2 = basis[1];
  23209. var c1 = v2.b.mul(k).divRound(this.n);
  23210. var c2 = v1.b.neg().mul(k).divRound(this.n);
  23211. var p1 = c1.mul(v1.a);
  23212. var p2 = c2.mul(v2.a);
  23213. var q1 = c1.mul(v1.b);
  23214. var q2 = c2.mul(v2.b);
  23215. // Calculate answer
  23216. var k1 = k.sub(p1).sub(p2);
  23217. var k2 = q1.add(q2).neg();
  23218. return { k1: k1, k2: k2 };
  23219. };
  23220. ShortCurve.prototype.pointFromX = function pointFromX(x, odd) {
  23221. x = new BN(x, 16);
  23222. if (!x.red)
  23223. x = x.toRed(this.red);
  23224. var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b);
  23225. var y = y2.redSqrt();
  23226. if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)
  23227. throw new Error('invalid point');
  23228. // XXX Is there any way to tell if the number is odd without converting it
  23229. // to non-red form?
  23230. var isOdd = y.fromRed().isOdd();
  23231. if (odd && !isOdd || !odd && isOdd)
  23232. y = y.redNeg();
  23233. return this.point(x, y);
  23234. };
  23235. ShortCurve.prototype.validate = function validate(point) {
  23236. if (point.inf)
  23237. return true;
  23238. var x = point.x;
  23239. var y = point.y;
  23240. var ax = this.a.redMul(x);
  23241. var rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);
  23242. return y.redSqr().redISub(rhs).cmpn(0) === 0;
  23243. };
  23244. ShortCurve.prototype._endoWnafMulAdd =
  23245. function _endoWnafMulAdd(points, coeffs, jacobianResult) {
  23246. var npoints = this._endoWnafT1;
  23247. var ncoeffs = this._endoWnafT2;
  23248. for (var i = 0; i < points.length; i++) {
  23249. var split = this._endoSplit(coeffs[i]);
  23250. var p = points[i];
  23251. var beta = p._getBeta();
  23252. if (split.k1.negative) {
  23253. split.k1.ineg();
  23254. p = p.neg(true);
  23255. }
  23256. if (split.k2.negative) {
  23257. split.k2.ineg();
  23258. beta = beta.neg(true);
  23259. }
  23260. npoints[i * 2] = p;
  23261. npoints[i * 2 + 1] = beta;
  23262. ncoeffs[i * 2] = split.k1;
  23263. ncoeffs[i * 2 + 1] = split.k2;
  23264. }
  23265. var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult);
  23266. // Clean-up references to points and coefficients
  23267. for (var j = 0; j < i * 2; j++) {
  23268. npoints[j] = null;
  23269. ncoeffs[j] = null;
  23270. }
  23271. return res;
  23272. };
  23273. function Point(curve, x, y, isRed) {
  23274. Base.BasePoint.call(this, curve, 'affine');
  23275. if (x === null && y === null) {
  23276. this.x = null;
  23277. this.y = null;
  23278. this.inf = true;
  23279. } else {
  23280. this.x = new BN(x, 16);
  23281. this.y = new BN(y, 16);
  23282. // Force redgomery representation when loading from JSON
  23283. if (isRed) {
  23284. this.x.forceRed(this.curve.red);
  23285. this.y.forceRed(this.curve.red);
  23286. }
  23287. if (!this.x.red)
  23288. this.x = this.x.toRed(this.curve.red);
  23289. if (!this.y.red)
  23290. this.y = this.y.toRed(this.curve.red);
  23291. this.inf = false;
  23292. }
  23293. }
  23294. inherits(Point, Base.BasePoint);
  23295. ShortCurve.prototype.point = function point(x, y, isRed) {
  23296. return new Point(this, x, y, isRed);
  23297. };
  23298. ShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) {
  23299. return Point.fromJSON(this, obj, red);
  23300. };
  23301. Point.prototype._getBeta = function _getBeta() {
  23302. if (!this.curve.endo)
  23303. return;
  23304. var pre = this.precomputed;
  23305. if (pre && pre.beta)
  23306. return pre.beta;
  23307. var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y);
  23308. if (pre) {
  23309. var curve = this.curve;
  23310. var endoMul = function(p) {
  23311. return curve.point(p.x.redMul(curve.endo.beta), p.y);
  23312. };
  23313. pre.beta = beta;
  23314. beta.precomputed = {
  23315. beta: null,
  23316. naf: pre.naf && {
  23317. wnd: pre.naf.wnd,
  23318. points: pre.naf.points.map(endoMul)
  23319. },
  23320. doubles: pre.doubles && {
  23321. step: pre.doubles.step,
  23322. points: pre.doubles.points.map(endoMul)
  23323. }
  23324. };
  23325. }
  23326. return beta;
  23327. };
  23328. Point.prototype.toJSON = function toJSON() {
  23329. if (!this.precomputed)
  23330. return [ this.x, this.y ];
  23331. return [ this.x, this.y, this.precomputed && {
  23332. doubles: this.precomputed.doubles && {
  23333. step: this.precomputed.doubles.step,
  23334. points: this.precomputed.doubles.points.slice(1)
  23335. },
  23336. naf: this.precomputed.naf && {
  23337. wnd: this.precomputed.naf.wnd,
  23338. points: this.precomputed.naf.points.slice(1)
  23339. }
  23340. } ];
  23341. };
  23342. Point.fromJSON = function fromJSON(curve, obj, red) {
  23343. if (typeof obj === 'string')
  23344. obj = JSON.parse(obj);
  23345. var res = curve.point(obj[0], obj[1], red);
  23346. if (!obj[2])
  23347. return res;
  23348. function obj2point(obj) {
  23349. return curve.point(obj[0], obj[1], red);
  23350. }
  23351. var pre = obj[2];
  23352. res.precomputed = {
  23353. beta: null,
  23354. doubles: pre.doubles && {
  23355. step: pre.doubles.step,
  23356. points: [ res ].concat(pre.doubles.points.map(obj2point))
  23357. },
  23358. naf: pre.naf && {
  23359. wnd: pre.naf.wnd,
  23360. points: [ res ].concat(pre.naf.points.map(obj2point))
  23361. }
  23362. };
  23363. return res;
  23364. };
  23365. Point.prototype.inspect = function inspect() {
  23366. if (this.isInfinity())
  23367. return '<EC Point Infinity>';
  23368. return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +
  23369. ' y: ' + this.y.fromRed().toString(16, 2) + '>';
  23370. };
  23371. Point.prototype.isInfinity = function isInfinity() {
  23372. return this.inf;
  23373. };
  23374. Point.prototype.add = function add(p) {
  23375. // O + P = P
  23376. if (this.inf)
  23377. return p;
  23378. // P + O = P
  23379. if (p.inf)
  23380. return this;
  23381. // P + P = 2P
  23382. if (this.eq(p))
  23383. return this.dbl();
  23384. // P + (-P) = O
  23385. if (this.neg().eq(p))
  23386. return this.curve.point(null, null);
  23387. // P + Q = O
  23388. if (this.x.cmp(p.x) === 0)
  23389. return this.curve.point(null, null);
  23390. var c = this.y.redSub(p.y);
  23391. if (c.cmpn(0) !== 0)
  23392. c = c.redMul(this.x.redSub(p.x).redInvm());
  23393. var nx = c.redSqr().redISub(this.x).redISub(p.x);
  23394. var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);
  23395. return this.curve.point(nx, ny);
  23396. };
  23397. Point.prototype.dbl = function dbl() {
  23398. if (this.inf)
  23399. return this;
  23400. // 2P = O
  23401. var ys1 = this.y.redAdd(this.y);
  23402. if (ys1.cmpn(0) === 0)
  23403. return this.curve.point(null, null);
  23404. var a = this.curve.a;
  23405. var x2 = this.x.redSqr();
  23406. var dyinv = ys1.redInvm();
  23407. var c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv);
  23408. var nx = c.redSqr().redISub(this.x.redAdd(this.x));
  23409. var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);
  23410. return this.curve.point(nx, ny);
  23411. };
  23412. Point.prototype.getX = function getX() {
  23413. return this.x.fromRed();
  23414. };
  23415. Point.prototype.getY = function getY() {
  23416. return this.y.fromRed();
  23417. };
  23418. Point.prototype.mul = function mul(k) {
  23419. k = new BN(k, 16);
  23420. if (this.isInfinity())
  23421. return this;
  23422. else if (this._hasDoubles(k))
  23423. return this.curve._fixedNafMul(this, k);
  23424. else if (this.curve.endo)
  23425. return this.curve._endoWnafMulAdd([ this ], [ k ]);
  23426. else
  23427. return this.curve._wnafMul(this, k);
  23428. };
  23429. Point.prototype.mulAdd = function mulAdd(k1, p2, k2) {
  23430. var points = [ this, p2 ];
  23431. var coeffs = [ k1, k2 ];
  23432. if (this.curve.endo)
  23433. return this.curve._endoWnafMulAdd(points, coeffs);
  23434. else
  23435. return this.curve._wnafMulAdd(1, points, coeffs, 2);
  23436. };
  23437. Point.prototype.jmulAdd = function jmulAdd(k1, p2, k2) {
  23438. var points = [ this, p2 ];
  23439. var coeffs = [ k1, k2 ];
  23440. if (this.curve.endo)
  23441. return this.curve._endoWnafMulAdd(points, coeffs, true);
  23442. else
  23443. return this.curve._wnafMulAdd(1, points, coeffs, 2, true);
  23444. };
  23445. Point.prototype.eq = function eq(p) {
  23446. return this === p ||
  23447. this.inf === p.inf &&
  23448. (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0);
  23449. };
  23450. Point.prototype.neg = function neg(_precompute) {
  23451. if (this.inf)
  23452. return this;
  23453. var res = this.curve.point(this.x, this.y.redNeg());
  23454. if (_precompute && this.precomputed) {
  23455. var pre = this.precomputed;
  23456. var negate = function(p) {
  23457. return p.neg();
  23458. };
  23459. res.precomputed = {
  23460. naf: pre.naf && {
  23461. wnd: pre.naf.wnd,
  23462. points: pre.naf.points.map(negate)
  23463. },
  23464. doubles: pre.doubles && {
  23465. step: pre.doubles.step,
  23466. points: pre.doubles.points.map(negate)
  23467. }
  23468. };
  23469. }
  23470. return res;
  23471. };
  23472. Point.prototype.toJ = function toJ() {
  23473. if (this.inf)
  23474. return this.curve.jpoint(null, null, null);
  23475. var res = this.curve.jpoint(this.x, this.y, this.curve.one);
  23476. return res;
  23477. };
  23478. function JPoint(curve, x, y, z) {
  23479. Base.BasePoint.call(this, curve, 'jacobian');
  23480. if (x === null && y === null && z === null) {
  23481. this.x = this.curve.one;
  23482. this.y = this.curve.one;
  23483. this.z = new BN(0);
  23484. } else {
  23485. this.x = new BN(x, 16);
  23486. this.y = new BN(y, 16);
  23487. this.z = new BN(z, 16);
  23488. }
  23489. if (!this.x.red)
  23490. this.x = this.x.toRed(this.curve.red);
  23491. if (!this.y.red)
  23492. this.y = this.y.toRed(this.curve.red);
  23493. if (!this.z.red)
  23494. this.z = this.z.toRed(this.curve.red);
  23495. this.zOne = this.z === this.curve.one;
  23496. }
  23497. inherits(JPoint, Base.BasePoint);
  23498. ShortCurve.prototype.jpoint = function jpoint(x, y, z) {
  23499. return new JPoint(this, x, y, z);
  23500. };
  23501. JPoint.prototype.toP = function toP() {
  23502. if (this.isInfinity())
  23503. return this.curve.point(null, null);
  23504. var zinv = this.z.redInvm();
  23505. var zinv2 = zinv.redSqr();
  23506. var ax = this.x.redMul(zinv2);
  23507. var ay = this.y.redMul(zinv2).redMul(zinv);
  23508. return this.curve.point(ax, ay);
  23509. };
  23510. JPoint.prototype.neg = function neg() {
  23511. return this.curve.jpoint(this.x, this.y.redNeg(), this.z);
  23512. };
  23513. JPoint.prototype.add = function add(p) {
  23514. // O + P = P
  23515. if (this.isInfinity())
  23516. return p;
  23517. // P + O = P
  23518. if (p.isInfinity())
  23519. return this;
  23520. // 12M + 4S + 7A
  23521. var pz2 = p.z.redSqr();
  23522. var z2 = this.z.redSqr();
  23523. var u1 = this.x.redMul(pz2);
  23524. var u2 = p.x.redMul(z2);
  23525. var s1 = this.y.redMul(pz2.redMul(p.z));
  23526. var s2 = p.y.redMul(z2.redMul(this.z));
  23527. var h = u1.redSub(u2);
  23528. var r = s1.redSub(s2);
  23529. if (h.cmpn(0) === 0) {
  23530. if (r.cmpn(0) !== 0)
  23531. return this.curve.jpoint(null, null, null);
  23532. else
  23533. return this.dbl();
  23534. }
  23535. var h2 = h.redSqr();
  23536. var h3 = h2.redMul(h);
  23537. var v = u1.redMul(h2);
  23538. var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);
  23539. var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));
  23540. var nz = this.z.redMul(p.z).redMul(h);
  23541. return this.curve.jpoint(nx, ny, nz);
  23542. };
  23543. JPoint.prototype.mixedAdd = function mixedAdd(p) {
  23544. // O + P = P
  23545. if (this.isInfinity())
  23546. return p.toJ();
  23547. // P + O = P
  23548. if (p.isInfinity())
  23549. return this;
  23550. // 8M + 3S + 7A
  23551. var z2 = this.z.redSqr();
  23552. var u1 = this.x;
  23553. var u2 = p.x.redMul(z2);
  23554. var s1 = this.y;
  23555. var s2 = p.y.redMul(z2).redMul(this.z);
  23556. var h = u1.redSub(u2);
  23557. var r = s1.redSub(s2);
  23558. if (h.cmpn(0) === 0) {
  23559. if (r.cmpn(0) !== 0)
  23560. return this.curve.jpoint(null, null, null);
  23561. else
  23562. return this.dbl();
  23563. }
  23564. var h2 = h.redSqr();
  23565. var h3 = h2.redMul(h);
  23566. var v = u1.redMul(h2);
  23567. var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);
  23568. var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));
  23569. var nz = this.z.redMul(h);
  23570. return this.curve.jpoint(nx, ny, nz);
  23571. };
  23572. JPoint.prototype.dblp = function dblp(pow) {
  23573. if (pow === 0)
  23574. return this;
  23575. if (this.isInfinity())
  23576. return this;
  23577. if (!pow)
  23578. return this.dbl();
  23579. if (this.curve.zeroA || this.curve.threeA) {
  23580. var r = this;
  23581. for (var i = 0; i < pow; i++)
  23582. r = r.dbl();
  23583. return r;
  23584. }
  23585. // 1M + 2S + 1A + N * (4S + 5M + 8A)
  23586. // N = 1 => 6M + 6S + 9A
  23587. var a = this.curve.a;
  23588. var tinv = this.curve.tinv;
  23589. var jx = this.x;
  23590. var jy = this.y;
  23591. var jz = this.z;
  23592. var jz4 = jz.redSqr().redSqr();
  23593. // Reuse results
  23594. var jyd = jy.redAdd(jy);
  23595. for (var i = 0; i < pow; i++) {
  23596. var jx2 = jx.redSqr();
  23597. var jyd2 = jyd.redSqr();
  23598. var jyd4 = jyd2.redSqr();
  23599. var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));
  23600. var t1 = jx.redMul(jyd2);
  23601. var nx = c.redSqr().redISub(t1.redAdd(t1));
  23602. var t2 = t1.redISub(nx);
  23603. var dny = c.redMul(t2);
  23604. dny = dny.redIAdd(dny).redISub(jyd4);
  23605. var nz = jyd.redMul(jz);
  23606. if (i + 1 < pow)
  23607. jz4 = jz4.redMul(jyd4);
  23608. jx = nx;
  23609. jz = nz;
  23610. jyd = dny;
  23611. }
  23612. return this.curve.jpoint(jx, jyd.redMul(tinv), jz);
  23613. };
  23614. JPoint.prototype.dbl = function dbl() {
  23615. if (this.isInfinity())
  23616. return this;
  23617. if (this.curve.zeroA)
  23618. return this._zeroDbl();
  23619. else if (this.curve.threeA)
  23620. return this._threeDbl();
  23621. else
  23622. return this._dbl();
  23623. };
  23624. JPoint.prototype._zeroDbl = function _zeroDbl() {
  23625. var nx;
  23626. var ny;
  23627. var nz;
  23628. // Z = 1
  23629. if (this.zOne) {
  23630. // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html
  23631. // #doubling-mdbl-2007-bl
  23632. // 1M + 5S + 14A
  23633. // XX = X1^2
  23634. var xx = this.x.redSqr();
  23635. // YY = Y1^2
  23636. var yy = this.y.redSqr();
  23637. // YYYY = YY^2
  23638. var yyyy = yy.redSqr();
  23639. // S = 2 * ((X1 + YY)^2 - XX - YYYY)
  23640. var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);
  23641. s = s.redIAdd(s);
  23642. // M = 3 * XX + a; a = 0
  23643. var m = xx.redAdd(xx).redIAdd(xx);
  23644. // T = M ^ 2 - 2*S
  23645. var t = m.redSqr().redISub(s).redISub(s);
  23646. // 8 * YYYY
  23647. var yyyy8 = yyyy.redIAdd(yyyy);
  23648. yyyy8 = yyyy8.redIAdd(yyyy8);
  23649. yyyy8 = yyyy8.redIAdd(yyyy8);
  23650. // X3 = T
  23651. nx = t;
  23652. // Y3 = M * (S - T) - 8 * YYYY
  23653. ny = m.redMul(s.redISub(t)).redISub(yyyy8);
  23654. // Z3 = 2*Y1
  23655. nz = this.y.redAdd(this.y);
  23656. } else {
  23657. // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html
  23658. // #doubling-dbl-2009-l
  23659. // 2M + 5S + 13A
  23660. // A = X1^2
  23661. var a = this.x.redSqr();
  23662. // B = Y1^2
  23663. var b = this.y.redSqr();
  23664. // C = B^2
  23665. var c = b.redSqr();
  23666. // D = 2 * ((X1 + B)^2 - A - C)
  23667. var d = this.x.redAdd(b).redSqr().redISub(a).redISub(c);
  23668. d = d.redIAdd(d);
  23669. // E = 3 * A
  23670. var e = a.redAdd(a).redIAdd(a);
  23671. // F = E^2
  23672. var f = e.redSqr();
  23673. // 8 * C
  23674. var c8 = c.redIAdd(c);
  23675. c8 = c8.redIAdd(c8);
  23676. c8 = c8.redIAdd(c8);
  23677. // X3 = F - 2 * D
  23678. nx = f.redISub(d).redISub(d);
  23679. // Y3 = E * (D - X3) - 8 * C
  23680. ny = e.redMul(d.redISub(nx)).redISub(c8);
  23681. // Z3 = 2 * Y1 * Z1
  23682. nz = this.y.redMul(this.z);
  23683. nz = nz.redIAdd(nz);
  23684. }
  23685. return this.curve.jpoint(nx, ny, nz);
  23686. };
  23687. JPoint.prototype._threeDbl = function _threeDbl() {
  23688. var nx;
  23689. var ny;
  23690. var nz;
  23691. // Z = 1
  23692. if (this.zOne) {
  23693. // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html
  23694. // #doubling-mdbl-2007-bl
  23695. // 1M + 5S + 15A
  23696. // XX = X1^2
  23697. var xx = this.x.redSqr();
  23698. // YY = Y1^2
  23699. var yy = this.y.redSqr();
  23700. // YYYY = YY^2
  23701. var yyyy = yy.redSqr();
  23702. // S = 2 * ((X1 + YY)^2 - XX - YYYY)
  23703. var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);
  23704. s = s.redIAdd(s);
  23705. // M = 3 * XX + a
  23706. var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a);
  23707. // T = M^2 - 2 * S
  23708. var t = m.redSqr().redISub(s).redISub(s);
  23709. // X3 = T
  23710. nx = t;
  23711. // Y3 = M * (S - T) - 8 * YYYY
  23712. var yyyy8 = yyyy.redIAdd(yyyy);
  23713. yyyy8 = yyyy8.redIAdd(yyyy8);
  23714. yyyy8 = yyyy8.redIAdd(yyyy8);
  23715. ny = m.redMul(s.redISub(t)).redISub(yyyy8);
  23716. // Z3 = 2 * Y1
  23717. nz = this.y.redAdd(this.y);
  23718. } else {
  23719. // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b
  23720. // 3M + 5S
  23721. // delta = Z1^2
  23722. var delta = this.z.redSqr();
  23723. // gamma = Y1^2
  23724. var gamma = this.y.redSqr();
  23725. // beta = X1 * gamma
  23726. var beta = this.x.redMul(gamma);
  23727. // alpha = 3 * (X1 - delta) * (X1 + delta)
  23728. var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta));
  23729. alpha = alpha.redAdd(alpha).redIAdd(alpha);
  23730. // X3 = alpha^2 - 8 * beta
  23731. var beta4 = beta.redIAdd(beta);
  23732. beta4 = beta4.redIAdd(beta4);
  23733. var beta8 = beta4.redAdd(beta4);
  23734. nx = alpha.redSqr().redISub(beta8);
  23735. // Z3 = (Y1 + Z1)^2 - gamma - delta
  23736. nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);
  23737. // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2
  23738. var ggamma8 = gamma.redSqr();
  23739. ggamma8 = ggamma8.redIAdd(ggamma8);
  23740. ggamma8 = ggamma8.redIAdd(ggamma8);
  23741. ggamma8 = ggamma8.redIAdd(ggamma8);
  23742. ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8);
  23743. }
  23744. return this.curve.jpoint(nx, ny, nz);
  23745. };
  23746. JPoint.prototype._dbl = function _dbl() {
  23747. var a = this.curve.a;
  23748. // 4M + 6S + 10A
  23749. var jx = this.x;
  23750. var jy = this.y;
  23751. var jz = this.z;
  23752. var jz4 = jz.redSqr().redSqr();
  23753. var jx2 = jx.redSqr();
  23754. var jy2 = jy.redSqr();
  23755. var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));
  23756. var jxd4 = jx.redAdd(jx);
  23757. jxd4 = jxd4.redIAdd(jxd4);
  23758. var t1 = jxd4.redMul(jy2);
  23759. var nx = c.redSqr().redISub(t1.redAdd(t1));
  23760. var t2 = t1.redISub(nx);
  23761. var jyd8 = jy2.redSqr();
  23762. jyd8 = jyd8.redIAdd(jyd8);
  23763. jyd8 = jyd8.redIAdd(jyd8);
  23764. jyd8 = jyd8.redIAdd(jyd8);
  23765. var ny = c.redMul(t2).redISub(jyd8);
  23766. var nz = jy.redAdd(jy).redMul(jz);
  23767. return this.curve.jpoint(nx, ny, nz);
  23768. };
  23769. JPoint.prototype.trpl = function trpl() {
  23770. if (!this.curve.zeroA)
  23771. return this.dbl().add(this);
  23772. // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#tripling-tpl-2007-bl
  23773. // 5M + 10S + ...
  23774. // XX = X1^2
  23775. var xx = this.x.redSqr();
  23776. // YY = Y1^2
  23777. var yy = this.y.redSqr();
  23778. // ZZ = Z1^2
  23779. var zz = this.z.redSqr();
  23780. // YYYY = YY^2
  23781. var yyyy = yy.redSqr();
  23782. // M = 3 * XX + a * ZZ2; a = 0
  23783. var m = xx.redAdd(xx).redIAdd(xx);
  23784. // MM = M^2
  23785. var mm = m.redSqr();
  23786. // E = 6 * ((X1 + YY)^2 - XX - YYYY) - MM
  23787. var e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);
  23788. e = e.redIAdd(e);
  23789. e = e.redAdd(e).redIAdd(e);
  23790. e = e.redISub(mm);
  23791. // EE = E^2
  23792. var ee = e.redSqr();
  23793. // T = 16*YYYY
  23794. var t = yyyy.redIAdd(yyyy);
  23795. t = t.redIAdd(t);
  23796. t = t.redIAdd(t);
  23797. t = t.redIAdd(t);
  23798. // U = (M + E)^2 - MM - EE - T
  23799. var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t);
  23800. // X3 = 4 * (X1 * EE - 4 * YY * U)
  23801. var yyu4 = yy.redMul(u);
  23802. yyu4 = yyu4.redIAdd(yyu4);
  23803. yyu4 = yyu4.redIAdd(yyu4);
  23804. var nx = this.x.redMul(ee).redISub(yyu4);
  23805. nx = nx.redIAdd(nx);
  23806. nx = nx.redIAdd(nx);
  23807. // Y3 = 8 * Y1 * (U * (T - U) - E * EE)
  23808. var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee)));
  23809. ny = ny.redIAdd(ny);
  23810. ny = ny.redIAdd(ny);
  23811. ny = ny.redIAdd(ny);
  23812. // Z3 = (Z1 + E)^2 - ZZ - EE
  23813. var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee);
  23814. return this.curve.jpoint(nx, ny, nz);
  23815. };
  23816. JPoint.prototype.mul = function mul(k, kbase) {
  23817. k = new BN(k, kbase);
  23818. return this.curve._wnafMul(this, k);
  23819. };
  23820. JPoint.prototype.eq = function eq(p) {
  23821. if (p.type === 'affine')
  23822. return this.eq(p.toJ());
  23823. if (this === p)
  23824. return true;
  23825. // x1 * z2^2 == x2 * z1^2
  23826. var z2 = this.z.redSqr();
  23827. var pz2 = p.z.redSqr();
  23828. if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0)
  23829. return false;
  23830. // y1 * z2^3 == y2 * z1^3
  23831. var z3 = z2.redMul(this.z);
  23832. var pz3 = pz2.redMul(p.z);
  23833. return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0;
  23834. };
  23835. JPoint.prototype.eqXToP = function eqXToP(x) {
  23836. var zs = this.z.redSqr();
  23837. var rx = x.toRed(this.curve.red).redMul(zs);
  23838. if (this.x.cmp(rx) === 0)
  23839. return true;
  23840. var xc = x.clone();
  23841. var t = this.curve.redN.redMul(zs);
  23842. for (;;) {
  23843. xc.iadd(this.curve.n);
  23844. if (xc.cmp(this.curve.p) >= 0)
  23845. return false;
  23846. rx.redIAdd(t);
  23847. if (this.x.cmp(rx) === 0)
  23848. return true;
  23849. }
  23850. };
  23851. JPoint.prototype.inspect = function inspect() {
  23852. if (this.isInfinity())
  23853. return '<EC JPoint Infinity>';
  23854. return '<EC JPoint x: ' + this.x.toString(16, 2) +
  23855. ' y: ' + this.y.toString(16, 2) +
  23856. ' z: ' + this.z.toString(16, 2) + '>';
  23857. };
  23858. JPoint.prototype.isInfinity = function isInfinity() {
  23859. // XXX This code assumes that zero is always zero in red
  23860. return this.z.cmpn(0) === 0;
  23861. };
  23862. /***/ }),
  23863. /* 181 */
  23864. /*!**********************************************************!*\
  23865. !*** ./node_modules/elliptic/lib/elliptic/curve/mont.js ***!
  23866. \**********************************************************/
  23867. /*! no static exports found */
  23868. /***/ (function(module, exports, __webpack_require__) {
  23869. "use strict";
  23870. var BN = __webpack_require__(/*! bn.js */ 163);
  23871. var inherits = __webpack_require__(/*! inherits */ 87);
  23872. var Base = __webpack_require__(/*! ./base */ 179);
  23873. var utils = __webpack_require__(/*! ../utils */ 176);
  23874. function MontCurve(conf) {
  23875. Base.call(this, 'mont', conf);
  23876. this.a = new BN(conf.a, 16).toRed(this.red);
  23877. this.b = new BN(conf.b, 16).toRed(this.red);
  23878. this.i4 = new BN(4).toRed(this.red).redInvm();
  23879. this.two = new BN(2).toRed(this.red);
  23880. this.a24 = this.i4.redMul(this.a.redAdd(this.two));
  23881. }
  23882. inherits(MontCurve, Base);
  23883. module.exports = MontCurve;
  23884. MontCurve.prototype.validate = function validate(point) {
  23885. var x = point.normalize().x;
  23886. var x2 = x.redSqr();
  23887. var rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x);
  23888. var y = rhs.redSqrt();
  23889. return y.redSqr().cmp(rhs) === 0;
  23890. };
  23891. function Point(curve, x, z) {
  23892. Base.BasePoint.call(this, curve, 'projective');
  23893. if (x === null && z === null) {
  23894. this.x = this.curve.one;
  23895. this.z = this.curve.zero;
  23896. } else {
  23897. this.x = new BN(x, 16);
  23898. this.z = new BN(z, 16);
  23899. if (!this.x.red)
  23900. this.x = this.x.toRed(this.curve.red);
  23901. if (!this.z.red)
  23902. this.z = this.z.toRed(this.curve.red);
  23903. }
  23904. }
  23905. inherits(Point, Base.BasePoint);
  23906. MontCurve.prototype.decodePoint = function decodePoint(bytes, enc) {
  23907. return this.point(utils.toArray(bytes, enc), 1);
  23908. };
  23909. MontCurve.prototype.point = function point(x, z) {
  23910. return new Point(this, x, z);
  23911. };
  23912. MontCurve.prototype.pointFromJSON = function pointFromJSON(obj) {
  23913. return Point.fromJSON(this, obj);
  23914. };
  23915. Point.prototype.precompute = function precompute() {
  23916. // No-op
  23917. };
  23918. Point.prototype._encode = function _encode() {
  23919. return this.getX().toArray('be', this.curve.p.byteLength());
  23920. };
  23921. Point.fromJSON = function fromJSON(curve, obj) {
  23922. return new Point(curve, obj[0], obj[1] || curve.one);
  23923. };
  23924. Point.prototype.inspect = function inspect() {
  23925. if (this.isInfinity())
  23926. return '<EC Point Infinity>';
  23927. return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +
  23928. ' z: ' + this.z.fromRed().toString(16, 2) + '>';
  23929. };
  23930. Point.prototype.isInfinity = function isInfinity() {
  23931. // XXX This code assumes that zero is always zero in red
  23932. return this.z.cmpn(0) === 0;
  23933. };
  23934. Point.prototype.dbl = function dbl() {
  23935. // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#doubling-dbl-1987-m-3
  23936. // 2M + 2S + 4A
  23937. // A = X1 + Z1
  23938. var a = this.x.redAdd(this.z);
  23939. // AA = A^2
  23940. var aa = a.redSqr();
  23941. // B = X1 - Z1
  23942. var b = this.x.redSub(this.z);
  23943. // BB = B^2
  23944. var bb = b.redSqr();
  23945. // C = AA - BB
  23946. var c = aa.redSub(bb);
  23947. // X3 = AA * BB
  23948. var nx = aa.redMul(bb);
  23949. // Z3 = C * (BB + A24 * C)
  23950. var nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c)));
  23951. return this.curve.point(nx, nz);
  23952. };
  23953. Point.prototype.add = function add() {
  23954. throw new Error('Not supported on Montgomery curve');
  23955. };
  23956. Point.prototype.diffAdd = function diffAdd(p, diff) {
  23957. // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#diffadd-dadd-1987-m-3
  23958. // 4M + 2S + 6A
  23959. // A = X2 + Z2
  23960. var a = this.x.redAdd(this.z);
  23961. // B = X2 - Z2
  23962. var b = this.x.redSub(this.z);
  23963. // C = X3 + Z3
  23964. var c = p.x.redAdd(p.z);
  23965. // D = X3 - Z3
  23966. var d = p.x.redSub(p.z);
  23967. // DA = D * A
  23968. var da = d.redMul(a);
  23969. // CB = C * B
  23970. var cb = c.redMul(b);
  23971. // X5 = Z1 * (DA + CB)^2
  23972. var nx = diff.z.redMul(da.redAdd(cb).redSqr());
  23973. // Z5 = X1 * (DA - CB)^2
  23974. var nz = diff.x.redMul(da.redISub(cb).redSqr());
  23975. return this.curve.point(nx, nz);
  23976. };
  23977. Point.prototype.mul = function mul(k) {
  23978. var t = k.clone();
  23979. var a = this; // (N / 2) * Q + Q
  23980. var b = this.curve.point(null, null); // (N / 2) * Q
  23981. var c = this; // Q
  23982. for (var bits = []; t.cmpn(0) !== 0; t.iushrn(1))
  23983. bits.push(t.andln(1));
  23984. for (var i = bits.length - 1; i >= 0; i--) {
  23985. if (bits[i] === 0) {
  23986. // N * Q + Q = ((N / 2) * Q + Q)) + (N / 2) * Q
  23987. a = a.diffAdd(b, c);
  23988. // N * Q = 2 * ((N / 2) * Q + Q))
  23989. b = b.dbl();
  23990. } else {
  23991. // N * Q = ((N / 2) * Q + Q) + ((N / 2) * Q)
  23992. b = a.diffAdd(b, c);
  23993. // N * Q + Q = 2 * ((N / 2) * Q + Q)
  23994. a = a.dbl();
  23995. }
  23996. }
  23997. return b;
  23998. };
  23999. Point.prototype.mulAdd = function mulAdd() {
  24000. throw new Error('Not supported on Montgomery curve');
  24001. };
  24002. Point.prototype.jumlAdd = function jumlAdd() {
  24003. throw new Error('Not supported on Montgomery curve');
  24004. };
  24005. Point.prototype.eq = function eq(other) {
  24006. return this.getX().cmp(other.getX()) === 0;
  24007. };
  24008. Point.prototype.normalize = function normalize() {
  24009. this.x = this.x.redMul(this.z.redInvm());
  24010. this.z = this.curve.one;
  24011. return this;
  24012. };
  24013. Point.prototype.getX = function getX() {
  24014. // Normalize coordinates
  24015. this.normalize();
  24016. return this.x.fromRed();
  24017. };
  24018. /***/ }),
  24019. /* 182 */
  24020. /*!*************************************************************!*\
  24021. !*** ./node_modules/elliptic/lib/elliptic/curve/edwards.js ***!
  24022. \*************************************************************/
  24023. /*! no static exports found */
  24024. /***/ (function(module, exports, __webpack_require__) {
  24025. "use strict";
  24026. var utils = __webpack_require__(/*! ../utils */ 176);
  24027. var BN = __webpack_require__(/*! bn.js */ 163);
  24028. var inherits = __webpack_require__(/*! inherits */ 87);
  24029. var Base = __webpack_require__(/*! ./base */ 179);
  24030. var assert = utils.assert;
  24031. function EdwardsCurve(conf) {
  24032. // NOTE: Important as we are creating point in Base.call()
  24033. this.twisted = (conf.a | 0) !== 1;
  24034. this.mOneA = this.twisted && (conf.a | 0) === -1;
  24035. this.extended = this.mOneA;
  24036. Base.call(this, 'edwards', conf);
  24037. this.a = new BN(conf.a, 16).umod(this.red.m);
  24038. this.a = this.a.toRed(this.red);
  24039. this.c = new BN(conf.c, 16).toRed(this.red);
  24040. this.c2 = this.c.redSqr();
  24041. this.d = new BN(conf.d, 16).toRed(this.red);
  24042. this.dd = this.d.redAdd(this.d);
  24043. assert(!this.twisted || this.c.fromRed().cmpn(1) === 0);
  24044. this.oneC = (conf.c | 0) === 1;
  24045. }
  24046. inherits(EdwardsCurve, Base);
  24047. module.exports = EdwardsCurve;
  24048. EdwardsCurve.prototype._mulA = function _mulA(num) {
  24049. if (this.mOneA)
  24050. return num.redNeg();
  24051. else
  24052. return this.a.redMul(num);
  24053. };
  24054. EdwardsCurve.prototype._mulC = function _mulC(num) {
  24055. if (this.oneC)
  24056. return num;
  24057. else
  24058. return this.c.redMul(num);
  24059. };
  24060. // Just for compatibility with Short curve
  24061. EdwardsCurve.prototype.jpoint = function jpoint(x, y, z, t) {
  24062. return this.point(x, y, z, t);
  24063. };
  24064. EdwardsCurve.prototype.pointFromX = function pointFromX(x, odd) {
  24065. x = new BN(x, 16);
  24066. if (!x.red)
  24067. x = x.toRed(this.red);
  24068. var x2 = x.redSqr();
  24069. var rhs = this.c2.redSub(this.a.redMul(x2));
  24070. var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2));
  24071. var y2 = rhs.redMul(lhs.redInvm());
  24072. var y = y2.redSqrt();
  24073. if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)
  24074. throw new Error('invalid point');
  24075. var isOdd = y.fromRed().isOdd();
  24076. if (odd && !isOdd || !odd && isOdd)
  24077. y = y.redNeg();
  24078. return this.point(x, y);
  24079. };
  24080. EdwardsCurve.prototype.pointFromY = function pointFromY(y, odd) {
  24081. y = new BN(y, 16);
  24082. if (!y.red)
  24083. y = y.toRed(this.red);
  24084. // x^2 = (y^2 - c^2) / (c^2 d y^2 - a)
  24085. var y2 = y.redSqr();
  24086. var lhs = y2.redSub(this.c2);
  24087. var rhs = y2.redMul(this.d).redMul(this.c2).redSub(this.a);
  24088. var x2 = lhs.redMul(rhs.redInvm());
  24089. if (x2.cmp(this.zero) === 0) {
  24090. if (odd)
  24091. throw new Error('invalid point');
  24092. else
  24093. return this.point(this.zero, y);
  24094. }
  24095. var x = x2.redSqrt();
  24096. if (x.redSqr().redSub(x2).cmp(this.zero) !== 0)
  24097. throw new Error('invalid point');
  24098. if (x.fromRed().isOdd() !== odd)
  24099. x = x.redNeg();
  24100. return this.point(x, y);
  24101. };
  24102. EdwardsCurve.prototype.validate = function validate(point) {
  24103. if (point.isInfinity())
  24104. return true;
  24105. // Curve: A * X^2 + Y^2 = C^2 * (1 + D * X^2 * Y^2)
  24106. point.normalize();
  24107. var x2 = point.x.redSqr();
  24108. var y2 = point.y.redSqr();
  24109. var lhs = x2.redMul(this.a).redAdd(y2);
  24110. var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2)));
  24111. return lhs.cmp(rhs) === 0;
  24112. };
  24113. function Point(curve, x, y, z, t) {
  24114. Base.BasePoint.call(this, curve, 'projective');
  24115. if (x === null && y === null && z === null) {
  24116. this.x = this.curve.zero;
  24117. this.y = this.curve.one;
  24118. this.z = this.curve.one;
  24119. this.t = this.curve.zero;
  24120. this.zOne = true;
  24121. } else {
  24122. this.x = new BN(x, 16);
  24123. this.y = new BN(y, 16);
  24124. this.z = z ? new BN(z, 16) : this.curve.one;
  24125. this.t = t && new BN(t, 16);
  24126. if (!this.x.red)
  24127. this.x = this.x.toRed(this.curve.red);
  24128. if (!this.y.red)
  24129. this.y = this.y.toRed(this.curve.red);
  24130. if (!this.z.red)
  24131. this.z = this.z.toRed(this.curve.red);
  24132. if (this.t && !this.t.red)
  24133. this.t = this.t.toRed(this.curve.red);
  24134. this.zOne = this.z === this.curve.one;
  24135. // Use extended coordinates
  24136. if (this.curve.extended && !this.t) {
  24137. this.t = this.x.redMul(this.y);
  24138. if (!this.zOne)
  24139. this.t = this.t.redMul(this.z.redInvm());
  24140. }
  24141. }
  24142. }
  24143. inherits(Point, Base.BasePoint);
  24144. EdwardsCurve.prototype.pointFromJSON = function pointFromJSON(obj) {
  24145. return Point.fromJSON(this, obj);
  24146. };
  24147. EdwardsCurve.prototype.point = function point(x, y, z, t) {
  24148. return new Point(this, x, y, z, t);
  24149. };
  24150. Point.fromJSON = function fromJSON(curve, obj) {
  24151. return new Point(curve, obj[0], obj[1], obj[2]);
  24152. };
  24153. Point.prototype.inspect = function inspect() {
  24154. if (this.isInfinity())
  24155. return '<EC Point Infinity>';
  24156. return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +
  24157. ' y: ' + this.y.fromRed().toString(16, 2) +
  24158. ' z: ' + this.z.fromRed().toString(16, 2) + '>';
  24159. };
  24160. Point.prototype.isInfinity = function isInfinity() {
  24161. // XXX This code assumes that zero is always zero in red
  24162. return this.x.cmpn(0) === 0 &&
  24163. (this.y.cmp(this.z) === 0 ||
  24164. (this.zOne && this.y.cmp(this.curve.c) === 0));
  24165. };
  24166. Point.prototype._extDbl = function _extDbl() {
  24167. // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html
  24168. // #doubling-dbl-2008-hwcd
  24169. // 4M + 4S
  24170. // A = X1^2
  24171. var a = this.x.redSqr();
  24172. // B = Y1^2
  24173. var b = this.y.redSqr();
  24174. // C = 2 * Z1^2
  24175. var c = this.z.redSqr();
  24176. c = c.redIAdd(c);
  24177. // D = a * A
  24178. var d = this.curve._mulA(a);
  24179. // E = (X1 + Y1)^2 - A - B
  24180. var e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b);
  24181. // G = D + B
  24182. var g = d.redAdd(b);
  24183. // F = G - C
  24184. var f = g.redSub(c);
  24185. // H = D - B
  24186. var h = d.redSub(b);
  24187. // X3 = E * F
  24188. var nx = e.redMul(f);
  24189. // Y3 = G * H
  24190. var ny = g.redMul(h);
  24191. // T3 = E * H
  24192. var nt = e.redMul(h);
  24193. // Z3 = F * G
  24194. var nz = f.redMul(g);
  24195. return this.curve.point(nx, ny, nz, nt);
  24196. };
  24197. Point.prototype._projDbl = function _projDbl() {
  24198. // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html
  24199. // #doubling-dbl-2008-bbjlp
  24200. // #doubling-dbl-2007-bl
  24201. // and others
  24202. // Generally 3M + 4S or 2M + 4S
  24203. // B = (X1 + Y1)^2
  24204. var b = this.x.redAdd(this.y).redSqr();
  24205. // C = X1^2
  24206. var c = this.x.redSqr();
  24207. // D = Y1^2
  24208. var d = this.y.redSqr();
  24209. var nx;
  24210. var ny;
  24211. var nz;
  24212. if (this.curve.twisted) {
  24213. // E = a * C
  24214. var e = this.curve._mulA(c);
  24215. // F = E + D
  24216. var f = e.redAdd(d);
  24217. if (this.zOne) {
  24218. // X3 = (B - C - D) * (F - 2)
  24219. nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two));
  24220. // Y3 = F * (E - D)
  24221. ny = f.redMul(e.redSub(d));
  24222. // Z3 = F^2 - 2 * F
  24223. nz = f.redSqr().redSub(f).redSub(f);
  24224. } else {
  24225. // H = Z1^2
  24226. var h = this.z.redSqr();
  24227. // J = F - 2 * H
  24228. var j = f.redSub(h).redISub(h);
  24229. // X3 = (B-C-D)*J
  24230. nx = b.redSub(c).redISub(d).redMul(j);
  24231. // Y3 = F * (E - D)
  24232. ny = f.redMul(e.redSub(d));
  24233. // Z3 = F * J
  24234. nz = f.redMul(j);
  24235. }
  24236. } else {
  24237. // E = C + D
  24238. var e = c.redAdd(d);
  24239. // H = (c * Z1)^2
  24240. var h = this.curve._mulC(this.z).redSqr();
  24241. // J = E - 2 * H
  24242. var j = e.redSub(h).redSub(h);
  24243. // X3 = c * (B - E) * J
  24244. nx = this.curve._mulC(b.redISub(e)).redMul(j);
  24245. // Y3 = c * E * (C - D)
  24246. ny = this.curve._mulC(e).redMul(c.redISub(d));
  24247. // Z3 = E * J
  24248. nz = e.redMul(j);
  24249. }
  24250. return this.curve.point(nx, ny, nz);
  24251. };
  24252. Point.prototype.dbl = function dbl() {
  24253. if (this.isInfinity())
  24254. return this;
  24255. // Double in extended coordinates
  24256. if (this.curve.extended)
  24257. return this._extDbl();
  24258. else
  24259. return this._projDbl();
  24260. };
  24261. Point.prototype._extAdd = function _extAdd(p) {
  24262. // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html
  24263. // #addition-add-2008-hwcd-3
  24264. // 8M
  24265. // A = (Y1 - X1) * (Y2 - X2)
  24266. var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x));
  24267. // B = (Y1 + X1) * (Y2 + X2)
  24268. var b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x));
  24269. // C = T1 * k * T2
  24270. var c = this.t.redMul(this.curve.dd).redMul(p.t);
  24271. // D = Z1 * 2 * Z2
  24272. var d = this.z.redMul(p.z.redAdd(p.z));
  24273. // E = B - A
  24274. var e = b.redSub(a);
  24275. // F = D - C
  24276. var f = d.redSub(c);
  24277. // G = D + C
  24278. var g = d.redAdd(c);
  24279. // H = B + A
  24280. var h = b.redAdd(a);
  24281. // X3 = E * F
  24282. var nx = e.redMul(f);
  24283. // Y3 = G * H
  24284. var ny = g.redMul(h);
  24285. // T3 = E * H
  24286. var nt = e.redMul(h);
  24287. // Z3 = F * G
  24288. var nz = f.redMul(g);
  24289. return this.curve.point(nx, ny, nz, nt);
  24290. };
  24291. Point.prototype._projAdd = function _projAdd(p) {
  24292. // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html
  24293. // #addition-add-2008-bbjlp
  24294. // #addition-add-2007-bl
  24295. // 10M + 1S
  24296. // A = Z1 * Z2
  24297. var a = this.z.redMul(p.z);
  24298. // B = A^2
  24299. var b = a.redSqr();
  24300. // C = X1 * X2
  24301. var c = this.x.redMul(p.x);
  24302. // D = Y1 * Y2
  24303. var d = this.y.redMul(p.y);
  24304. // E = d * C * D
  24305. var e = this.curve.d.redMul(c).redMul(d);
  24306. // F = B - E
  24307. var f = b.redSub(e);
  24308. // G = B + E
  24309. var g = b.redAdd(e);
  24310. // X3 = A * F * ((X1 + Y1) * (X2 + Y2) - C - D)
  24311. var tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d);
  24312. var nx = a.redMul(f).redMul(tmp);
  24313. var ny;
  24314. var nz;
  24315. if (this.curve.twisted) {
  24316. // Y3 = A * G * (D - a * C)
  24317. ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c)));
  24318. // Z3 = F * G
  24319. nz = f.redMul(g);
  24320. } else {
  24321. // Y3 = A * G * (D - C)
  24322. ny = a.redMul(g).redMul(d.redSub(c));
  24323. // Z3 = c * F * G
  24324. nz = this.curve._mulC(f).redMul(g);
  24325. }
  24326. return this.curve.point(nx, ny, nz);
  24327. };
  24328. Point.prototype.add = function add(p) {
  24329. if (this.isInfinity())
  24330. return p;
  24331. if (p.isInfinity())
  24332. return this;
  24333. if (this.curve.extended)
  24334. return this._extAdd(p);
  24335. else
  24336. return this._projAdd(p);
  24337. };
  24338. Point.prototype.mul = function mul(k) {
  24339. if (this._hasDoubles(k))
  24340. return this.curve._fixedNafMul(this, k);
  24341. else
  24342. return this.curve._wnafMul(this, k);
  24343. };
  24344. Point.prototype.mulAdd = function mulAdd(k1, p, k2) {
  24345. return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, false);
  24346. };
  24347. Point.prototype.jmulAdd = function jmulAdd(k1, p, k2) {
  24348. return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, true);
  24349. };
  24350. Point.prototype.normalize = function normalize() {
  24351. if (this.zOne)
  24352. return this;
  24353. // Normalize coordinates
  24354. var zi = this.z.redInvm();
  24355. this.x = this.x.redMul(zi);
  24356. this.y = this.y.redMul(zi);
  24357. if (this.t)
  24358. this.t = this.t.redMul(zi);
  24359. this.z = this.curve.one;
  24360. this.zOne = true;
  24361. return this;
  24362. };
  24363. Point.prototype.neg = function neg() {
  24364. return this.curve.point(this.x.redNeg(),
  24365. this.y,
  24366. this.z,
  24367. this.t && this.t.redNeg());
  24368. };
  24369. Point.prototype.getX = function getX() {
  24370. this.normalize();
  24371. return this.x.fromRed();
  24372. };
  24373. Point.prototype.getY = function getY() {
  24374. this.normalize();
  24375. return this.y.fromRed();
  24376. };
  24377. Point.prototype.eq = function eq(other) {
  24378. return this === other ||
  24379. this.getX().cmp(other.getX()) === 0 &&
  24380. this.getY().cmp(other.getY()) === 0;
  24381. };
  24382. Point.prototype.eqXToP = function eqXToP(x) {
  24383. var rx = x.toRed(this.curve.red).redMul(this.z);
  24384. if (this.x.cmp(rx) === 0)
  24385. return true;
  24386. var xc = x.clone();
  24387. var t = this.curve.redN.redMul(this.z);
  24388. for (;;) {
  24389. xc.iadd(this.curve.n);
  24390. if (xc.cmp(this.curve.p) >= 0)
  24391. return false;
  24392. rx.redIAdd(t);
  24393. if (this.x.cmp(rx) === 0)
  24394. return true;
  24395. }
  24396. };
  24397. // Compatibility with BaseCurve
  24398. Point.prototype.toP = Point.prototype.normalize;
  24399. Point.prototype.mixedAdd = Point.prototype.add;
  24400. /***/ }),
  24401. /* 183 */
  24402. /*!******************************************************!*\
  24403. !*** ./node_modules/elliptic/lib/elliptic/curves.js ***!
  24404. \******************************************************/
  24405. /*! no static exports found */
  24406. /***/ (function(module, exports, __webpack_require__) {
  24407. "use strict";
  24408. var curves = exports;
  24409. var hash = __webpack_require__(/*! hash.js */ 184);
  24410. var curve = __webpack_require__(/*! ./curve */ 178);
  24411. var utils = __webpack_require__(/*! ./utils */ 176);
  24412. var assert = utils.assert;
  24413. function PresetCurve(options) {
  24414. if (options.type === 'short')
  24415. this.curve = new curve.short(options);
  24416. else if (options.type === 'edwards')
  24417. this.curve = new curve.edwards(options);
  24418. else
  24419. this.curve = new curve.mont(options);
  24420. this.g = this.curve.g;
  24421. this.n = this.curve.n;
  24422. this.hash = options.hash;
  24423. assert(this.g.validate(), 'Invalid curve');
  24424. assert(this.g.mul(this.n).isInfinity(), 'Invalid curve, G*N != O');
  24425. }
  24426. curves.PresetCurve = PresetCurve;
  24427. function defineCurve(name, options) {
  24428. Object.defineProperty(curves, name, {
  24429. configurable: true,
  24430. enumerable: true,
  24431. get: function() {
  24432. var curve = new PresetCurve(options);
  24433. Object.defineProperty(curves, name, {
  24434. configurable: true,
  24435. enumerable: true,
  24436. value: curve
  24437. });
  24438. return curve;
  24439. }
  24440. });
  24441. }
  24442. defineCurve('p192', {
  24443. type: 'short',
  24444. prime: 'p192',
  24445. p: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff',
  24446. a: 'ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc',
  24447. b: '64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1',
  24448. n: 'ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831',
  24449. hash: hash.sha256,
  24450. gRed: false,
  24451. g: [
  24452. '188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012',
  24453. '07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811'
  24454. ]
  24455. });
  24456. defineCurve('p224', {
  24457. type: 'short',
  24458. prime: 'p224',
  24459. p: 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001',
  24460. a: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe',
  24461. b: 'b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4',
  24462. n: 'ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d',
  24463. hash: hash.sha256,
  24464. gRed: false,
  24465. g: [
  24466. 'b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21',
  24467. 'bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34'
  24468. ]
  24469. });
  24470. defineCurve('p256', {
  24471. type: 'short',
  24472. prime: null,
  24473. p: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff',
  24474. a: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc',
  24475. b: '5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b',
  24476. n: 'ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551',
  24477. hash: hash.sha256,
  24478. gRed: false,
  24479. g: [
  24480. '6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296',
  24481. '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5'
  24482. ]
  24483. });
  24484. defineCurve('p384', {
  24485. type: 'short',
  24486. prime: null,
  24487. p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  24488. 'fffffffe ffffffff 00000000 00000000 ffffffff',
  24489. a: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  24490. 'fffffffe ffffffff 00000000 00000000 fffffffc',
  24491. b: 'b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f ' +
  24492. '5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef',
  24493. n: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 ' +
  24494. 'f4372ddf 581a0db2 48b0a77a ecec196a ccc52973',
  24495. hash: hash.sha384,
  24496. gRed: false,
  24497. g: [
  24498. 'aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 ' +
  24499. '5502f25d bf55296c 3a545e38 72760ab7',
  24500. '3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 ' +
  24501. '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f'
  24502. ]
  24503. });
  24504. defineCurve('p521', {
  24505. type: 'short',
  24506. prime: null,
  24507. p: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  24508. 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  24509. 'ffffffff ffffffff ffffffff ffffffff ffffffff',
  24510. a: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  24511. 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  24512. 'ffffffff ffffffff ffffffff ffffffff fffffffc',
  24513. b: '00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b ' +
  24514. '99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd ' +
  24515. '3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00',
  24516. n: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  24517. 'ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 ' +
  24518. 'f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409',
  24519. hash: hash.sha512,
  24520. gRed: false,
  24521. g: [
  24522. '000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 ' +
  24523. '053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 ' +
  24524. 'a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66',
  24525. '00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 ' +
  24526. '579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 ' +
  24527. '3fad0761 353c7086 a272c240 88be9476 9fd16650'
  24528. ]
  24529. });
  24530. defineCurve('curve25519', {
  24531. type: 'mont',
  24532. prime: 'p25519',
  24533. p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',
  24534. a: '76d06',
  24535. b: '1',
  24536. n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',
  24537. hash: hash.sha256,
  24538. gRed: false,
  24539. g: [
  24540. '9'
  24541. ]
  24542. });
  24543. defineCurve('ed25519', {
  24544. type: 'edwards',
  24545. prime: 'p25519',
  24546. p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',
  24547. a: '-1',
  24548. c: '1',
  24549. // -121665 * (121666^(-1)) (mod P)
  24550. d: '52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3',
  24551. n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',
  24552. hash: hash.sha256,
  24553. gRed: false,
  24554. g: [
  24555. '216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a',
  24556. // 4/5
  24557. '6666666666666666666666666666666666666666666666666666666666666658'
  24558. ]
  24559. });
  24560. var pre;
  24561. try {
  24562. pre = __webpack_require__(/*! ./precomputed/secp256k1 */ 196);
  24563. } catch (e) {
  24564. pre = undefined;
  24565. }
  24566. defineCurve('secp256k1', {
  24567. type: 'short',
  24568. prime: 'k256',
  24569. p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f',
  24570. a: '0',
  24571. b: '7',
  24572. n: 'ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141',
  24573. h: '1',
  24574. hash: hash.sha256,
  24575. // Precomputed endomorphism
  24576. beta: '7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee',
  24577. lambda: '5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72',
  24578. basis: [
  24579. {
  24580. a: '3086d221a7d46bcde86c90e49284eb15',
  24581. b: '-e4437ed6010e88286f547fa90abfe4c3'
  24582. },
  24583. {
  24584. a: '114ca50f7a8e2f3f657c1108d9d44cfd8',
  24585. b: '3086d221a7d46bcde86c90e49284eb15'
  24586. }
  24587. ],
  24588. gRed: false,
  24589. g: [
  24590. '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798',
  24591. '483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8',
  24592. pre
  24593. ]
  24594. });
  24595. /***/ }),
  24596. /* 184 */
  24597. /*!******************************************!*\
  24598. !*** ./node_modules/hash.js/lib/hash.js ***!
  24599. \******************************************/
  24600. /*! no static exports found */
  24601. /***/ (function(module, exports, __webpack_require__) {
  24602. var hash = exports;
  24603. hash.utils = __webpack_require__(/*! ./hash/utils */ 185);
  24604. hash.common = __webpack_require__(/*! ./hash/common */ 186);
  24605. hash.sha = __webpack_require__(/*! ./hash/sha */ 187);
  24606. hash.ripemd = __webpack_require__(/*! ./hash/ripemd */ 194);
  24607. hash.hmac = __webpack_require__(/*! ./hash/hmac */ 195);
  24608. // Proxy hash functions to the main object
  24609. hash.sha1 = hash.sha.sha1;
  24610. hash.sha256 = hash.sha.sha256;
  24611. hash.sha224 = hash.sha.sha224;
  24612. hash.sha384 = hash.sha.sha384;
  24613. hash.sha512 = hash.sha.sha512;
  24614. hash.ripemd160 = hash.ripemd.ripemd160;
  24615. /***/ }),
  24616. /* 185 */
  24617. /*!************************************************!*\
  24618. !*** ./node_modules/hash.js/lib/hash/utils.js ***!
  24619. \************************************************/
  24620. /*! no static exports found */
  24621. /***/ (function(module, exports, __webpack_require__) {
  24622. "use strict";
  24623. var assert = __webpack_require__(/*! minimalistic-assert */ 137);
  24624. var inherits = __webpack_require__(/*! inherits */ 87);
  24625. exports.inherits = inherits;
  24626. function isSurrogatePair(msg, i) {
  24627. if ((msg.charCodeAt(i) & 0xFC00) !== 0xD800) {
  24628. return false;
  24629. }
  24630. if (i < 0 || i + 1 >= msg.length) {
  24631. return false;
  24632. }
  24633. return (msg.charCodeAt(i + 1) & 0xFC00) === 0xDC00;
  24634. }
  24635. function toArray(msg, enc) {
  24636. if (Array.isArray(msg))
  24637. return msg.slice();
  24638. if (!msg)
  24639. return [];
  24640. var res = [];
  24641. if (typeof msg === 'string') {
  24642. if (!enc) {
  24643. // Inspired by stringToUtf8ByteArray() in closure-library by Google
  24644. // https://github.com/google/closure-library/blob/8598d87242af59aac233270742c8984e2b2bdbe0/closure/goog/crypt/crypt.js#L117-L143
  24645. // Apache License 2.0
  24646. // https://github.com/google/closure-library/blob/master/LICENSE
  24647. var p = 0;
  24648. for (var i = 0; i < msg.length; i++) {
  24649. var c = msg.charCodeAt(i);
  24650. if (c < 128) {
  24651. res[p++] = c;
  24652. } else if (c < 2048) {
  24653. res[p++] = (c >> 6) | 192;
  24654. res[p++] = (c & 63) | 128;
  24655. } else if (isSurrogatePair(msg, i)) {
  24656. c = 0x10000 + ((c & 0x03FF) << 10) + (msg.charCodeAt(++i) & 0x03FF);
  24657. res[p++] = (c >> 18) | 240;
  24658. res[p++] = ((c >> 12) & 63) | 128;
  24659. res[p++] = ((c >> 6) & 63) | 128;
  24660. res[p++] = (c & 63) | 128;
  24661. } else {
  24662. res[p++] = (c >> 12) | 224;
  24663. res[p++] = ((c >> 6) & 63) | 128;
  24664. res[p++] = (c & 63) | 128;
  24665. }
  24666. }
  24667. } else if (enc === 'hex') {
  24668. msg = msg.replace(/[^a-z0-9]+/ig, '');
  24669. if (msg.length % 2 !== 0)
  24670. msg = '0' + msg;
  24671. for (i = 0; i < msg.length; i += 2)
  24672. res.push(parseInt(msg[i] + msg[i + 1], 16));
  24673. }
  24674. } else {
  24675. for (i = 0; i < msg.length; i++)
  24676. res[i] = msg[i] | 0;
  24677. }
  24678. return res;
  24679. }
  24680. exports.toArray = toArray;
  24681. function toHex(msg) {
  24682. var res = '';
  24683. for (var i = 0; i < msg.length; i++)
  24684. res += zero2(msg[i].toString(16));
  24685. return res;
  24686. }
  24687. exports.toHex = toHex;
  24688. function htonl(w) {
  24689. var res = (w >>> 24) |
  24690. ((w >>> 8) & 0xff00) |
  24691. ((w << 8) & 0xff0000) |
  24692. ((w & 0xff) << 24);
  24693. return res >>> 0;
  24694. }
  24695. exports.htonl = htonl;
  24696. function toHex32(msg, endian) {
  24697. var res = '';
  24698. for (var i = 0; i < msg.length; i++) {
  24699. var w = msg[i];
  24700. if (endian === 'little')
  24701. w = htonl(w);
  24702. res += zero8(w.toString(16));
  24703. }
  24704. return res;
  24705. }
  24706. exports.toHex32 = toHex32;
  24707. function zero2(word) {
  24708. if (word.length === 1)
  24709. return '0' + word;
  24710. else
  24711. return word;
  24712. }
  24713. exports.zero2 = zero2;
  24714. function zero8(word) {
  24715. if (word.length === 7)
  24716. return '0' + word;
  24717. else if (word.length === 6)
  24718. return '00' + word;
  24719. else if (word.length === 5)
  24720. return '000' + word;
  24721. else if (word.length === 4)
  24722. return '0000' + word;
  24723. else if (word.length === 3)
  24724. return '00000' + word;
  24725. else if (word.length === 2)
  24726. return '000000' + word;
  24727. else if (word.length === 1)
  24728. return '0000000' + word;
  24729. else
  24730. return word;
  24731. }
  24732. exports.zero8 = zero8;
  24733. function join32(msg, start, end, endian) {
  24734. var len = end - start;
  24735. assert(len % 4 === 0);
  24736. var res = new Array(len / 4);
  24737. for (var i = 0, k = start; i < res.length; i++, k += 4) {
  24738. var w;
  24739. if (endian === 'big')
  24740. w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3];
  24741. else
  24742. w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k];
  24743. res[i] = w >>> 0;
  24744. }
  24745. return res;
  24746. }
  24747. exports.join32 = join32;
  24748. function split32(msg, endian) {
  24749. var res = new Array(msg.length * 4);
  24750. for (var i = 0, k = 0; i < msg.length; i++, k += 4) {
  24751. var m = msg[i];
  24752. if (endian === 'big') {
  24753. res[k] = m >>> 24;
  24754. res[k + 1] = (m >>> 16) & 0xff;
  24755. res[k + 2] = (m >>> 8) & 0xff;
  24756. res[k + 3] = m & 0xff;
  24757. } else {
  24758. res[k + 3] = m >>> 24;
  24759. res[k + 2] = (m >>> 16) & 0xff;
  24760. res[k + 1] = (m >>> 8) & 0xff;
  24761. res[k] = m & 0xff;
  24762. }
  24763. }
  24764. return res;
  24765. }
  24766. exports.split32 = split32;
  24767. function rotr32(w, b) {
  24768. return (w >>> b) | (w << (32 - b));
  24769. }
  24770. exports.rotr32 = rotr32;
  24771. function rotl32(w, b) {
  24772. return (w << b) | (w >>> (32 - b));
  24773. }
  24774. exports.rotl32 = rotl32;
  24775. function sum32(a, b) {
  24776. return (a + b) >>> 0;
  24777. }
  24778. exports.sum32 = sum32;
  24779. function sum32_3(a, b, c) {
  24780. return (a + b + c) >>> 0;
  24781. }
  24782. exports.sum32_3 = sum32_3;
  24783. function sum32_4(a, b, c, d) {
  24784. return (a + b + c + d) >>> 0;
  24785. }
  24786. exports.sum32_4 = sum32_4;
  24787. function sum32_5(a, b, c, d, e) {
  24788. return (a + b + c + d + e) >>> 0;
  24789. }
  24790. exports.sum32_5 = sum32_5;
  24791. function sum64(buf, pos, ah, al) {
  24792. var bh = buf[pos];
  24793. var bl = buf[pos + 1];
  24794. var lo = (al + bl) >>> 0;
  24795. var hi = (lo < al ? 1 : 0) + ah + bh;
  24796. buf[pos] = hi >>> 0;
  24797. buf[pos + 1] = lo;
  24798. }
  24799. exports.sum64 = sum64;
  24800. function sum64_hi(ah, al, bh, bl) {
  24801. var lo = (al + bl) >>> 0;
  24802. var hi = (lo < al ? 1 : 0) + ah + bh;
  24803. return hi >>> 0;
  24804. }
  24805. exports.sum64_hi = sum64_hi;
  24806. function sum64_lo(ah, al, bh, bl) {
  24807. var lo = al + bl;
  24808. return lo >>> 0;
  24809. }
  24810. exports.sum64_lo = sum64_lo;
  24811. function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {
  24812. var carry = 0;
  24813. var lo = al;
  24814. lo = (lo + bl) >>> 0;
  24815. carry += lo < al ? 1 : 0;
  24816. lo = (lo + cl) >>> 0;
  24817. carry += lo < cl ? 1 : 0;
  24818. lo = (lo + dl) >>> 0;
  24819. carry += lo < dl ? 1 : 0;
  24820. var hi = ah + bh + ch + dh + carry;
  24821. return hi >>> 0;
  24822. }
  24823. exports.sum64_4_hi = sum64_4_hi;
  24824. function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {
  24825. var lo = al + bl + cl + dl;
  24826. return lo >>> 0;
  24827. }
  24828. exports.sum64_4_lo = sum64_4_lo;
  24829. function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
  24830. var carry = 0;
  24831. var lo = al;
  24832. lo = (lo + bl) >>> 0;
  24833. carry += lo < al ? 1 : 0;
  24834. lo = (lo + cl) >>> 0;
  24835. carry += lo < cl ? 1 : 0;
  24836. lo = (lo + dl) >>> 0;
  24837. carry += lo < dl ? 1 : 0;
  24838. lo = (lo + el) >>> 0;
  24839. carry += lo < el ? 1 : 0;
  24840. var hi = ah + bh + ch + dh + eh + carry;
  24841. return hi >>> 0;
  24842. }
  24843. exports.sum64_5_hi = sum64_5_hi;
  24844. function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
  24845. var lo = al + bl + cl + dl + el;
  24846. return lo >>> 0;
  24847. }
  24848. exports.sum64_5_lo = sum64_5_lo;
  24849. function rotr64_hi(ah, al, num) {
  24850. var r = (al << (32 - num)) | (ah >>> num);
  24851. return r >>> 0;
  24852. }
  24853. exports.rotr64_hi = rotr64_hi;
  24854. function rotr64_lo(ah, al, num) {
  24855. var r = (ah << (32 - num)) | (al >>> num);
  24856. return r >>> 0;
  24857. }
  24858. exports.rotr64_lo = rotr64_lo;
  24859. function shr64_hi(ah, al, num) {
  24860. return ah >>> num;
  24861. }
  24862. exports.shr64_hi = shr64_hi;
  24863. function shr64_lo(ah, al, num) {
  24864. var r = (ah << (32 - num)) | (al >>> num);
  24865. return r >>> 0;
  24866. }
  24867. exports.shr64_lo = shr64_lo;
  24868. /***/ }),
  24869. /* 186 */
  24870. /*!*************************************************!*\
  24871. !*** ./node_modules/hash.js/lib/hash/common.js ***!
  24872. \*************************************************/
  24873. /*! no static exports found */
  24874. /***/ (function(module, exports, __webpack_require__) {
  24875. "use strict";
  24876. var utils = __webpack_require__(/*! ./utils */ 185);
  24877. var assert = __webpack_require__(/*! minimalistic-assert */ 137);
  24878. function BlockHash() {
  24879. this.pending = null;
  24880. this.pendingTotal = 0;
  24881. this.blockSize = this.constructor.blockSize;
  24882. this.outSize = this.constructor.outSize;
  24883. this.hmacStrength = this.constructor.hmacStrength;
  24884. this.padLength = this.constructor.padLength / 8;
  24885. this.endian = 'big';
  24886. this._delta8 = this.blockSize / 8;
  24887. this._delta32 = this.blockSize / 32;
  24888. }
  24889. exports.BlockHash = BlockHash;
  24890. BlockHash.prototype.update = function update(msg, enc) {
  24891. // Convert message to array, pad it, and join into 32bit blocks
  24892. msg = utils.toArray(msg, enc);
  24893. if (!this.pending)
  24894. this.pending = msg;
  24895. else
  24896. this.pending = this.pending.concat(msg);
  24897. this.pendingTotal += msg.length;
  24898. // Enough data, try updating
  24899. if (this.pending.length >= this._delta8) {
  24900. msg = this.pending;
  24901. // Process pending data in blocks
  24902. var r = msg.length % this._delta8;
  24903. this.pending = msg.slice(msg.length - r, msg.length);
  24904. if (this.pending.length === 0)
  24905. this.pending = null;
  24906. msg = utils.join32(msg, 0, msg.length - r, this.endian);
  24907. for (var i = 0; i < msg.length; i += this._delta32)
  24908. this._update(msg, i, i + this._delta32);
  24909. }
  24910. return this;
  24911. };
  24912. BlockHash.prototype.digest = function digest(enc) {
  24913. this.update(this._pad());
  24914. assert(this.pending === null);
  24915. return this._digest(enc);
  24916. };
  24917. BlockHash.prototype._pad = function pad() {
  24918. var len = this.pendingTotal;
  24919. var bytes = this._delta8;
  24920. var k = bytes - ((len + this.padLength) % bytes);
  24921. var res = new Array(k + this.padLength);
  24922. res[0] = 0x80;
  24923. for (var i = 1; i < k; i++)
  24924. res[i] = 0;
  24925. // Append length
  24926. len <<= 3;
  24927. if (this.endian === 'big') {
  24928. for (var t = 8; t < this.padLength; t++)
  24929. res[i++] = 0;
  24930. res[i++] = 0;
  24931. res[i++] = 0;
  24932. res[i++] = 0;
  24933. res[i++] = 0;
  24934. res[i++] = (len >>> 24) & 0xff;
  24935. res[i++] = (len >>> 16) & 0xff;
  24936. res[i++] = (len >>> 8) & 0xff;
  24937. res[i++] = len & 0xff;
  24938. } else {
  24939. res[i++] = len & 0xff;
  24940. res[i++] = (len >>> 8) & 0xff;
  24941. res[i++] = (len >>> 16) & 0xff;
  24942. res[i++] = (len >>> 24) & 0xff;
  24943. res[i++] = 0;
  24944. res[i++] = 0;
  24945. res[i++] = 0;
  24946. res[i++] = 0;
  24947. for (t = 8; t < this.padLength; t++)
  24948. res[i++] = 0;
  24949. }
  24950. return res;
  24951. };
  24952. /***/ }),
  24953. /* 187 */
  24954. /*!**********************************************!*\
  24955. !*** ./node_modules/hash.js/lib/hash/sha.js ***!
  24956. \**********************************************/
  24957. /*! no static exports found */
  24958. /***/ (function(module, exports, __webpack_require__) {
  24959. "use strict";
  24960. exports.sha1 = __webpack_require__(/*! ./sha/1 */ 188);
  24961. exports.sha224 = __webpack_require__(/*! ./sha/224 */ 190);
  24962. exports.sha256 = __webpack_require__(/*! ./sha/256 */ 191);
  24963. exports.sha384 = __webpack_require__(/*! ./sha/384 */ 192);
  24964. exports.sha512 = __webpack_require__(/*! ./sha/512 */ 193);
  24965. /***/ }),
  24966. /* 188 */
  24967. /*!************************************************!*\
  24968. !*** ./node_modules/hash.js/lib/hash/sha/1.js ***!
  24969. \************************************************/
  24970. /*! no static exports found */
  24971. /***/ (function(module, exports, __webpack_require__) {
  24972. "use strict";
  24973. var utils = __webpack_require__(/*! ../utils */ 185);
  24974. var common = __webpack_require__(/*! ../common */ 186);
  24975. var shaCommon = __webpack_require__(/*! ./common */ 189);
  24976. var rotl32 = utils.rotl32;
  24977. var sum32 = utils.sum32;
  24978. var sum32_5 = utils.sum32_5;
  24979. var ft_1 = shaCommon.ft_1;
  24980. var BlockHash = common.BlockHash;
  24981. var sha1_K = [
  24982. 0x5A827999, 0x6ED9EBA1,
  24983. 0x8F1BBCDC, 0xCA62C1D6
  24984. ];
  24985. function SHA1() {
  24986. if (!(this instanceof SHA1))
  24987. return new SHA1();
  24988. BlockHash.call(this);
  24989. this.h = [
  24990. 0x67452301, 0xefcdab89, 0x98badcfe,
  24991. 0x10325476, 0xc3d2e1f0 ];
  24992. this.W = new Array(80);
  24993. }
  24994. utils.inherits(SHA1, BlockHash);
  24995. module.exports = SHA1;
  24996. SHA1.blockSize = 512;
  24997. SHA1.outSize = 160;
  24998. SHA1.hmacStrength = 80;
  24999. SHA1.padLength = 64;
  25000. SHA1.prototype._update = function _update(msg, start) {
  25001. var W = this.W;
  25002. for (var i = 0; i < 16; i++)
  25003. W[i] = msg[start + i];
  25004. for(; i < W.length; i++)
  25005. W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);
  25006. var a = this.h[0];
  25007. var b = this.h[1];
  25008. var c = this.h[2];
  25009. var d = this.h[3];
  25010. var e = this.h[4];
  25011. for (i = 0; i < W.length; i++) {
  25012. var s = ~~(i / 20);
  25013. var t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]);
  25014. e = d;
  25015. d = c;
  25016. c = rotl32(b, 30);
  25017. b = a;
  25018. a = t;
  25019. }
  25020. this.h[0] = sum32(this.h[0], a);
  25021. this.h[1] = sum32(this.h[1], b);
  25022. this.h[2] = sum32(this.h[2], c);
  25023. this.h[3] = sum32(this.h[3], d);
  25024. this.h[4] = sum32(this.h[4], e);
  25025. };
  25026. SHA1.prototype._digest = function digest(enc) {
  25027. if (enc === 'hex')
  25028. return utils.toHex32(this.h, 'big');
  25029. else
  25030. return utils.split32(this.h, 'big');
  25031. };
  25032. /***/ }),
  25033. /* 189 */
  25034. /*!*****************************************************!*\
  25035. !*** ./node_modules/hash.js/lib/hash/sha/common.js ***!
  25036. \*****************************************************/
  25037. /*! no static exports found */
  25038. /***/ (function(module, exports, __webpack_require__) {
  25039. "use strict";
  25040. var utils = __webpack_require__(/*! ../utils */ 185);
  25041. var rotr32 = utils.rotr32;
  25042. function ft_1(s, x, y, z) {
  25043. if (s === 0)
  25044. return ch32(x, y, z);
  25045. if (s === 1 || s === 3)
  25046. return p32(x, y, z);
  25047. if (s === 2)
  25048. return maj32(x, y, z);
  25049. }
  25050. exports.ft_1 = ft_1;
  25051. function ch32(x, y, z) {
  25052. return (x & y) ^ ((~x) & z);
  25053. }
  25054. exports.ch32 = ch32;
  25055. function maj32(x, y, z) {
  25056. return (x & y) ^ (x & z) ^ (y & z);
  25057. }
  25058. exports.maj32 = maj32;
  25059. function p32(x, y, z) {
  25060. return x ^ y ^ z;
  25061. }
  25062. exports.p32 = p32;
  25063. function s0_256(x) {
  25064. return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);
  25065. }
  25066. exports.s0_256 = s0_256;
  25067. function s1_256(x) {
  25068. return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);
  25069. }
  25070. exports.s1_256 = s1_256;
  25071. function g0_256(x) {
  25072. return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3);
  25073. }
  25074. exports.g0_256 = g0_256;
  25075. function g1_256(x) {
  25076. return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10);
  25077. }
  25078. exports.g1_256 = g1_256;
  25079. /***/ }),
  25080. /* 190 */
  25081. /*!**************************************************!*\
  25082. !*** ./node_modules/hash.js/lib/hash/sha/224.js ***!
  25083. \**************************************************/
  25084. /*! no static exports found */
  25085. /***/ (function(module, exports, __webpack_require__) {
  25086. "use strict";
  25087. var utils = __webpack_require__(/*! ../utils */ 185);
  25088. var SHA256 = __webpack_require__(/*! ./256 */ 191);
  25089. function SHA224() {
  25090. if (!(this instanceof SHA224))
  25091. return new SHA224();
  25092. SHA256.call(this);
  25093. this.h = [
  25094. 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,
  25095. 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ];
  25096. }
  25097. utils.inherits(SHA224, SHA256);
  25098. module.exports = SHA224;
  25099. SHA224.blockSize = 512;
  25100. SHA224.outSize = 224;
  25101. SHA224.hmacStrength = 192;
  25102. SHA224.padLength = 64;
  25103. SHA224.prototype._digest = function digest(enc) {
  25104. // Just truncate output
  25105. if (enc === 'hex')
  25106. return utils.toHex32(this.h.slice(0, 7), 'big');
  25107. else
  25108. return utils.split32(this.h.slice(0, 7), 'big');
  25109. };
  25110. /***/ }),
  25111. /* 191 */
  25112. /*!**************************************************!*\
  25113. !*** ./node_modules/hash.js/lib/hash/sha/256.js ***!
  25114. \**************************************************/
  25115. /*! no static exports found */
  25116. /***/ (function(module, exports, __webpack_require__) {
  25117. "use strict";
  25118. var utils = __webpack_require__(/*! ../utils */ 185);
  25119. var common = __webpack_require__(/*! ../common */ 186);
  25120. var shaCommon = __webpack_require__(/*! ./common */ 189);
  25121. var assert = __webpack_require__(/*! minimalistic-assert */ 137);
  25122. var sum32 = utils.sum32;
  25123. var sum32_4 = utils.sum32_4;
  25124. var sum32_5 = utils.sum32_5;
  25125. var ch32 = shaCommon.ch32;
  25126. var maj32 = shaCommon.maj32;
  25127. var s0_256 = shaCommon.s0_256;
  25128. var s1_256 = shaCommon.s1_256;
  25129. var g0_256 = shaCommon.g0_256;
  25130. var g1_256 = shaCommon.g1_256;
  25131. var BlockHash = common.BlockHash;
  25132. var sha256_K = [
  25133. 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
  25134. 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
  25135. 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
  25136. 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
  25137. 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
  25138. 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
  25139. 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,
  25140. 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
  25141. 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
  25142. 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
  25143. 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,
  25144. 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
  25145. 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,
  25146. 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
  25147. 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
  25148. 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
  25149. ];
  25150. function SHA256() {
  25151. if (!(this instanceof SHA256))
  25152. return new SHA256();
  25153. BlockHash.call(this);
  25154. this.h = [
  25155. 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
  25156. 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19
  25157. ];
  25158. this.k = sha256_K;
  25159. this.W = new Array(64);
  25160. }
  25161. utils.inherits(SHA256, BlockHash);
  25162. module.exports = SHA256;
  25163. SHA256.blockSize = 512;
  25164. SHA256.outSize = 256;
  25165. SHA256.hmacStrength = 192;
  25166. SHA256.padLength = 64;
  25167. SHA256.prototype._update = function _update(msg, start) {
  25168. var W = this.W;
  25169. for (var i = 0; i < 16; i++)
  25170. W[i] = msg[start + i];
  25171. for (; i < W.length; i++)
  25172. W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);
  25173. var a = this.h[0];
  25174. var b = this.h[1];
  25175. var c = this.h[2];
  25176. var d = this.h[3];
  25177. var e = this.h[4];
  25178. var f = this.h[5];
  25179. var g = this.h[6];
  25180. var h = this.h[7];
  25181. assert(this.k.length === W.length);
  25182. for (i = 0; i < W.length; i++) {
  25183. var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]);
  25184. var T2 = sum32(s0_256(a), maj32(a, b, c));
  25185. h = g;
  25186. g = f;
  25187. f = e;
  25188. e = sum32(d, T1);
  25189. d = c;
  25190. c = b;
  25191. b = a;
  25192. a = sum32(T1, T2);
  25193. }
  25194. this.h[0] = sum32(this.h[0], a);
  25195. this.h[1] = sum32(this.h[1], b);
  25196. this.h[2] = sum32(this.h[2], c);
  25197. this.h[3] = sum32(this.h[3], d);
  25198. this.h[4] = sum32(this.h[4], e);
  25199. this.h[5] = sum32(this.h[5], f);
  25200. this.h[6] = sum32(this.h[6], g);
  25201. this.h[7] = sum32(this.h[7], h);
  25202. };
  25203. SHA256.prototype._digest = function digest(enc) {
  25204. if (enc === 'hex')
  25205. return utils.toHex32(this.h, 'big');
  25206. else
  25207. return utils.split32(this.h, 'big');
  25208. };
  25209. /***/ }),
  25210. /* 192 */
  25211. /*!**************************************************!*\
  25212. !*** ./node_modules/hash.js/lib/hash/sha/384.js ***!
  25213. \**************************************************/
  25214. /*! no static exports found */
  25215. /***/ (function(module, exports, __webpack_require__) {
  25216. "use strict";
  25217. var utils = __webpack_require__(/*! ../utils */ 185);
  25218. var SHA512 = __webpack_require__(/*! ./512 */ 193);
  25219. function SHA384() {
  25220. if (!(this instanceof SHA384))
  25221. return new SHA384();
  25222. SHA512.call(this);
  25223. this.h = [
  25224. 0xcbbb9d5d, 0xc1059ed8,
  25225. 0x629a292a, 0x367cd507,
  25226. 0x9159015a, 0x3070dd17,
  25227. 0x152fecd8, 0xf70e5939,
  25228. 0x67332667, 0xffc00b31,
  25229. 0x8eb44a87, 0x68581511,
  25230. 0xdb0c2e0d, 0x64f98fa7,
  25231. 0x47b5481d, 0xbefa4fa4 ];
  25232. }
  25233. utils.inherits(SHA384, SHA512);
  25234. module.exports = SHA384;
  25235. SHA384.blockSize = 1024;
  25236. SHA384.outSize = 384;
  25237. SHA384.hmacStrength = 192;
  25238. SHA384.padLength = 128;
  25239. SHA384.prototype._digest = function digest(enc) {
  25240. if (enc === 'hex')
  25241. return utils.toHex32(this.h.slice(0, 12), 'big');
  25242. else
  25243. return utils.split32(this.h.slice(0, 12), 'big');
  25244. };
  25245. /***/ }),
  25246. /* 193 */
  25247. /*!**************************************************!*\
  25248. !*** ./node_modules/hash.js/lib/hash/sha/512.js ***!
  25249. \**************************************************/
  25250. /*! no static exports found */
  25251. /***/ (function(module, exports, __webpack_require__) {
  25252. "use strict";
  25253. var utils = __webpack_require__(/*! ../utils */ 185);
  25254. var common = __webpack_require__(/*! ../common */ 186);
  25255. var assert = __webpack_require__(/*! minimalistic-assert */ 137);
  25256. var rotr64_hi = utils.rotr64_hi;
  25257. var rotr64_lo = utils.rotr64_lo;
  25258. var shr64_hi = utils.shr64_hi;
  25259. var shr64_lo = utils.shr64_lo;
  25260. var sum64 = utils.sum64;
  25261. var sum64_hi = utils.sum64_hi;
  25262. var sum64_lo = utils.sum64_lo;
  25263. var sum64_4_hi = utils.sum64_4_hi;
  25264. var sum64_4_lo = utils.sum64_4_lo;
  25265. var sum64_5_hi = utils.sum64_5_hi;
  25266. var sum64_5_lo = utils.sum64_5_lo;
  25267. var BlockHash = common.BlockHash;
  25268. var sha512_K = [
  25269. 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,
  25270. 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
  25271. 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,
  25272. 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
  25273. 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,
  25274. 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
  25275. 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,
  25276. 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
  25277. 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,
  25278. 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
  25279. 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,
  25280. 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
  25281. 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,
  25282. 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
  25283. 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,
  25284. 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
  25285. 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,
  25286. 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
  25287. 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,
  25288. 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
  25289. 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,
  25290. 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
  25291. 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,
  25292. 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
  25293. 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,
  25294. 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
  25295. 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,
  25296. 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
  25297. 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,
  25298. 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
  25299. 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,
  25300. 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
  25301. 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,
  25302. 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
  25303. 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,
  25304. 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
  25305. 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,
  25306. 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
  25307. 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,
  25308. 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817
  25309. ];
  25310. function SHA512() {
  25311. if (!(this instanceof SHA512))
  25312. return new SHA512();
  25313. BlockHash.call(this);
  25314. this.h = [
  25315. 0x6a09e667, 0xf3bcc908,
  25316. 0xbb67ae85, 0x84caa73b,
  25317. 0x3c6ef372, 0xfe94f82b,
  25318. 0xa54ff53a, 0x5f1d36f1,
  25319. 0x510e527f, 0xade682d1,
  25320. 0x9b05688c, 0x2b3e6c1f,
  25321. 0x1f83d9ab, 0xfb41bd6b,
  25322. 0x5be0cd19, 0x137e2179 ];
  25323. this.k = sha512_K;
  25324. this.W = new Array(160);
  25325. }
  25326. utils.inherits(SHA512, BlockHash);
  25327. module.exports = SHA512;
  25328. SHA512.blockSize = 1024;
  25329. SHA512.outSize = 512;
  25330. SHA512.hmacStrength = 192;
  25331. SHA512.padLength = 128;
  25332. SHA512.prototype._prepareBlock = function _prepareBlock(msg, start) {
  25333. var W = this.W;
  25334. // 32 x 32bit words
  25335. for (var i = 0; i < 32; i++)
  25336. W[i] = msg[start + i];
  25337. for (; i < W.length; i += 2) {
  25338. var c0_hi = g1_512_hi(W[i - 4], W[i - 3]); // i - 2
  25339. var c0_lo = g1_512_lo(W[i - 4], W[i - 3]);
  25340. var c1_hi = W[i - 14]; // i - 7
  25341. var c1_lo = W[i - 13];
  25342. var c2_hi = g0_512_hi(W[i - 30], W[i - 29]); // i - 15
  25343. var c2_lo = g0_512_lo(W[i - 30], W[i - 29]);
  25344. var c3_hi = W[i - 32]; // i - 16
  25345. var c3_lo = W[i - 31];
  25346. W[i] = sum64_4_hi(
  25347. c0_hi, c0_lo,
  25348. c1_hi, c1_lo,
  25349. c2_hi, c2_lo,
  25350. c3_hi, c3_lo);
  25351. W[i + 1] = sum64_4_lo(
  25352. c0_hi, c0_lo,
  25353. c1_hi, c1_lo,
  25354. c2_hi, c2_lo,
  25355. c3_hi, c3_lo);
  25356. }
  25357. };
  25358. SHA512.prototype._update = function _update(msg, start) {
  25359. this._prepareBlock(msg, start);
  25360. var W = this.W;
  25361. var ah = this.h[0];
  25362. var al = this.h[1];
  25363. var bh = this.h[2];
  25364. var bl = this.h[3];
  25365. var ch = this.h[4];
  25366. var cl = this.h[5];
  25367. var dh = this.h[6];
  25368. var dl = this.h[7];
  25369. var eh = this.h[8];
  25370. var el = this.h[9];
  25371. var fh = this.h[10];
  25372. var fl = this.h[11];
  25373. var gh = this.h[12];
  25374. var gl = this.h[13];
  25375. var hh = this.h[14];
  25376. var hl = this.h[15];
  25377. assert(this.k.length === W.length);
  25378. for (var i = 0; i < W.length; i += 2) {
  25379. var c0_hi = hh;
  25380. var c0_lo = hl;
  25381. var c1_hi = s1_512_hi(eh, el);
  25382. var c1_lo = s1_512_lo(eh, el);
  25383. var c2_hi = ch64_hi(eh, el, fh, fl, gh, gl);
  25384. var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl);
  25385. var c3_hi = this.k[i];
  25386. var c3_lo = this.k[i + 1];
  25387. var c4_hi = W[i];
  25388. var c4_lo = W[i + 1];
  25389. var T1_hi = sum64_5_hi(
  25390. c0_hi, c0_lo,
  25391. c1_hi, c1_lo,
  25392. c2_hi, c2_lo,
  25393. c3_hi, c3_lo,
  25394. c4_hi, c4_lo);
  25395. var T1_lo = sum64_5_lo(
  25396. c0_hi, c0_lo,
  25397. c1_hi, c1_lo,
  25398. c2_hi, c2_lo,
  25399. c3_hi, c3_lo,
  25400. c4_hi, c4_lo);
  25401. c0_hi = s0_512_hi(ah, al);
  25402. c0_lo = s0_512_lo(ah, al);
  25403. c1_hi = maj64_hi(ah, al, bh, bl, ch, cl);
  25404. c1_lo = maj64_lo(ah, al, bh, bl, ch, cl);
  25405. var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo);
  25406. var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo);
  25407. hh = gh;
  25408. hl = gl;
  25409. gh = fh;
  25410. gl = fl;
  25411. fh = eh;
  25412. fl = el;
  25413. eh = sum64_hi(dh, dl, T1_hi, T1_lo);
  25414. el = sum64_lo(dl, dl, T1_hi, T1_lo);
  25415. dh = ch;
  25416. dl = cl;
  25417. ch = bh;
  25418. cl = bl;
  25419. bh = ah;
  25420. bl = al;
  25421. ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo);
  25422. al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo);
  25423. }
  25424. sum64(this.h, 0, ah, al);
  25425. sum64(this.h, 2, bh, bl);
  25426. sum64(this.h, 4, ch, cl);
  25427. sum64(this.h, 6, dh, dl);
  25428. sum64(this.h, 8, eh, el);
  25429. sum64(this.h, 10, fh, fl);
  25430. sum64(this.h, 12, gh, gl);
  25431. sum64(this.h, 14, hh, hl);
  25432. };
  25433. SHA512.prototype._digest = function digest(enc) {
  25434. if (enc === 'hex')
  25435. return utils.toHex32(this.h, 'big');
  25436. else
  25437. return utils.split32(this.h, 'big');
  25438. };
  25439. function ch64_hi(xh, xl, yh, yl, zh) {
  25440. var r = (xh & yh) ^ ((~xh) & zh);
  25441. if (r < 0)
  25442. r += 0x100000000;
  25443. return r;
  25444. }
  25445. function ch64_lo(xh, xl, yh, yl, zh, zl) {
  25446. var r = (xl & yl) ^ ((~xl) & zl);
  25447. if (r < 0)
  25448. r += 0x100000000;
  25449. return r;
  25450. }
  25451. function maj64_hi(xh, xl, yh, yl, zh) {
  25452. var r = (xh & yh) ^ (xh & zh) ^ (yh & zh);
  25453. if (r < 0)
  25454. r += 0x100000000;
  25455. return r;
  25456. }
  25457. function maj64_lo(xh, xl, yh, yl, zh, zl) {
  25458. var r = (xl & yl) ^ (xl & zl) ^ (yl & zl);
  25459. if (r < 0)
  25460. r += 0x100000000;
  25461. return r;
  25462. }
  25463. function s0_512_hi(xh, xl) {
  25464. var c0_hi = rotr64_hi(xh, xl, 28);
  25465. var c1_hi = rotr64_hi(xl, xh, 2); // 34
  25466. var c2_hi = rotr64_hi(xl, xh, 7); // 39
  25467. var r = c0_hi ^ c1_hi ^ c2_hi;
  25468. if (r < 0)
  25469. r += 0x100000000;
  25470. return r;
  25471. }
  25472. function s0_512_lo(xh, xl) {
  25473. var c0_lo = rotr64_lo(xh, xl, 28);
  25474. var c1_lo = rotr64_lo(xl, xh, 2); // 34
  25475. var c2_lo = rotr64_lo(xl, xh, 7); // 39
  25476. var r = c0_lo ^ c1_lo ^ c2_lo;
  25477. if (r < 0)
  25478. r += 0x100000000;
  25479. return r;
  25480. }
  25481. function s1_512_hi(xh, xl) {
  25482. var c0_hi = rotr64_hi(xh, xl, 14);
  25483. var c1_hi = rotr64_hi(xh, xl, 18);
  25484. var c2_hi = rotr64_hi(xl, xh, 9); // 41
  25485. var r = c0_hi ^ c1_hi ^ c2_hi;
  25486. if (r < 0)
  25487. r += 0x100000000;
  25488. return r;
  25489. }
  25490. function s1_512_lo(xh, xl) {
  25491. var c0_lo = rotr64_lo(xh, xl, 14);
  25492. var c1_lo = rotr64_lo(xh, xl, 18);
  25493. var c2_lo = rotr64_lo(xl, xh, 9); // 41
  25494. var r = c0_lo ^ c1_lo ^ c2_lo;
  25495. if (r < 0)
  25496. r += 0x100000000;
  25497. return r;
  25498. }
  25499. function g0_512_hi(xh, xl) {
  25500. var c0_hi = rotr64_hi(xh, xl, 1);
  25501. var c1_hi = rotr64_hi(xh, xl, 8);
  25502. var c2_hi = shr64_hi(xh, xl, 7);
  25503. var r = c0_hi ^ c1_hi ^ c2_hi;
  25504. if (r < 0)
  25505. r += 0x100000000;
  25506. return r;
  25507. }
  25508. function g0_512_lo(xh, xl) {
  25509. var c0_lo = rotr64_lo(xh, xl, 1);
  25510. var c1_lo = rotr64_lo(xh, xl, 8);
  25511. var c2_lo = shr64_lo(xh, xl, 7);
  25512. var r = c0_lo ^ c1_lo ^ c2_lo;
  25513. if (r < 0)
  25514. r += 0x100000000;
  25515. return r;
  25516. }
  25517. function g1_512_hi(xh, xl) {
  25518. var c0_hi = rotr64_hi(xh, xl, 19);
  25519. var c1_hi = rotr64_hi(xl, xh, 29); // 61
  25520. var c2_hi = shr64_hi(xh, xl, 6);
  25521. var r = c0_hi ^ c1_hi ^ c2_hi;
  25522. if (r < 0)
  25523. r += 0x100000000;
  25524. return r;
  25525. }
  25526. function g1_512_lo(xh, xl) {
  25527. var c0_lo = rotr64_lo(xh, xl, 19);
  25528. var c1_lo = rotr64_lo(xl, xh, 29); // 61
  25529. var c2_lo = shr64_lo(xh, xl, 6);
  25530. var r = c0_lo ^ c1_lo ^ c2_lo;
  25531. if (r < 0)
  25532. r += 0x100000000;
  25533. return r;
  25534. }
  25535. /***/ }),
  25536. /* 194 */
  25537. /*!*************************************************!*\
  25538. !*** ./node_modules/hash.js/lib/hash/ripemd.js ***!
  25539. \*************************************************/
  25540. /*! no static exports found */
  25541. /***/ (function(module, exports, __webpack_require__) {
  25542. "use strict";
  25543. var utils = __webpack_require__(/*! ./utils */ 185);
  25544. var common = __webpack_require__(/*! ./common */ 186);
  25545. var rotl32 = utils.rotl32;
  25546. var sum32 = utils.sum32;
  25547. var sum32_3 = utils.sum32_3;
  25548. var sum32_4 = utils.sum32_4;
  25549. var BlockHash = common.BlockHash;
  25550. function RIPEMD160() {
  25551. if (!(this instanceof RIPEMD160))
  25552. return new RIPEMD160();
  25553. BlockHash.call(this);
  25554. this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ];
  25555. this.endian = 'little';
  25556. }
  25557. utils.inherits(RIPEMD160, BlockHash);
  25558. exports.ripemd160 = RIPEMD160;
  25559. RIPEMD160.blockSize = 512;
  25560. RIPEMD160.outSize = 160;
  25561. RIPEMD160.hmacStrength = 192;
  25562. RIPEMD160.padLength = 64;
  25563. RIPEMD160.prototype._update = function update(msg, start) {
  25564. var A = this.h[0];
  25565. var B = this.h[1];
  25566. var C = this.h[2];
  25567. var D = this.h[3];
  25568. var E = this.h[4];
  25569. var Ah = A;
  25570. var Bh = B;
  25571. var Ch = C;
  25572. var Dh = D;
  25573. var Eh = E;
  25574. for (var j = 0; j < 80; j++) {
  25575. var T = sum32(
  25576. rotl32(
  25577. sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)),
  25578. s[j]),
  25579. E);
  25580. A = E;
  25581. E = D;
  25582. D = rotl32(C, 10);
  25583. C = B;
  25584. B = T;
  25585. T = sum32(
  25586. rotl32(
  25587. sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)),
  25588. sh[j]),
  25589. Eh);
  25590. Ah = Eh;
  25591. Eh = Dh;
  25592. Dh = rotl32(Ch, 10);
  25593. Ch = Bh;
  25594. Bh = T;
  25595. }
  25596. T = sum32_3(this.h[1], C, Dh);
  25597. this.h[1] = sum32_3(this.h[2], D, Eh);
  25598. this.h[2] = sum32_3(this.h[3], E, Ah);
  25599. this.h[3] = sum32_3(this.h[4], A, Bh);
  25600. this.h[4] = sum32_3(this.h[0], B, Ch);
  25601. this.h[0] = T;
  25602. };
  25603. RIPEMD160.prototype._digest = function digest(enc) {
  25604. if (enc === 'hex')
  25605. return utils.toHex32(this.h, 'little');
  25606. else
  25607. return utils.split32(this.h, 'little');
  25608. };
  25609. function f(j, x, y, z) {
  25610. if (j <= 15)
  25611. return x ^ y ^ z;
  25612. else if (j <= 31)
  25613. return (x & y) | ((~x) & z);
  25614. else if (j <= 47)
  25615. return (x | (~y)) ^ z;
  25616. else if (j <= 63)
  25617. return (x & z) | (y & (~z));
  25618. else
  25619. return x ^ (y | (~z));
  25620. }
  25621. function K(j) {
  25622. if (j <= 15)
  25623. return 0x00000000;
  25624. else if (j <= 31)
  25625. return 0x5a827999;
  25626. else if (j <= 47)
  25627. return 0x6ed9eba1;
  25628. else if (j <= 63)
  25629. return 0x8f1bbcdc;
  25630. else
  25631. return 0xa953fd4e;
  25632. }
  25633. function Kh(j) {
  25634. if (j <= 15)
  25635. return 0x50a28be6;
  25636. else if (j <= 31)
  25637. return 0x5c4dd124;
  25638. else if (j <= 47)
  25639. return 0x6d703ef3;
  25640. else if (j <= 63)
  25641. return 0x7a6d76e9;
  25642. else
  25643. return 0x00000000;
  25644. }
  25645. var r = [
  25646. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  25647. 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
  25648. 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
  25649. 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
  25650. 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13
  25651. ];
  25652. var rh = [
  25653. 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
  25654. 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
  25655. 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
  25656. 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
  25657. 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11
  25658. ];
  25659. var s = [
  25660. 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
  25661. 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
  25662. 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
  25663. 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
  25664. 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6
  25665. ];
  25666. var sh = [
  25667. 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
  25668. 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
  25669. 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
  25670. 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
  25671. 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11
  25672. ];
  25673. /***/ }),
  25674. /* 195 */
  25675. /*!***********************************************!*\
  25676. !*** ./node_modules/hash.js/lib/hash/hmac.js ***!
  25677. \***********************************************/
  25678. /*! no static exports found */
  25679. /***/ (function(module, exports, __webpack_require__) {
  25680. "use strict";
  25681. var utils = __webpack_require__(/*! ./utils */ 185);
  25682. var assert = __webpack_require__(/*! minimalistic-assert */ 137);
  25683. function Hmac(hash, key, enc) {
  25684. if (!(this instanceof Hmac))
  25685. return new Hmac(hash, key, enc);
  25686. this.Hash = hash;
  25687. this.blockSize = hash.blockSize / 8;
  25688. this.outSize = hash.outSize / 8;
  25689. this.inner = null;
  25690. this.outer = null;
  25691. this._init(utils.toArray(key, enc));
  25692. }
  25693. module.exports = Hmac;
  25694. Hmac.prototype._init = function init(key) {
  25695. // Shorten key, if needed
  25696. if (key.length > this.blockSize)
  25697. key = new this.Hash().update(key).digest();
  25698. assert(key.length <= this.blockSize);
  25699. // Add padding to key
  25700. for (var i = key.length; i < this.blockSize; i++)
  25701. key.push(0);
  25702. for (i = 0; i < key.length; i++)
  25703. key[i] ^= 0x36;
  25704. this.inner = new this.Hash().update(key);
  25705. // 0x36 ^ 0x5c = 0x6a
  25706. for (i = 0; i < key.length; i++)
  25707. key[i] ^= 0x6a;
  25708. this.outer = new this.Hash().update(key);
  25709. };
  25710. Hmac.prototype.update = function update(msg, enc) {
  25711. this.inner.update(msg, enc);
  25712. return this;
  25713. };
  25714. Hmac.prototype.digest = function digest(enc) {
  25715. this.outer.update(this.inner.digest());
  25716. return this.outer.digest(enc);
  25717. };
  25718. /***/ }),
  25719. /* 196 */
  25720. /*!*********************************************************************!*\
  25721. !*** ./node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js ***!
  25722. \*********************************************************************/
  25723. /*! no static exports found */
  25724. /***/ (function(module, exports) {
  25725. module.exports = {
  25726. doubles: {
  25727. step: 4,
  25728. points: [
  25729. [
  25730. 'e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a',
  25731. 'f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821'
  25732. ],
  25733. [
  25734. '8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508',
  25735. '11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf'
  25736. ],
  25737. [
  25738. '175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739',
  25739. 'd3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695'
  25740. ],
  25741. [
  25742. '363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640',
  25743. '4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9'
  25744. ],
  25745. [
  25746. '8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c',
  25747. '4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36'
  25748. ],
  25749. [
  25750. '723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda',
  25751. '96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f'
  25752. ],
  25753. [
  25754. 'eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa',
  25755. '5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999'
  25756. ],
  25757. [
  25758. '100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0',
  25759. 'cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09'
  25760. ],
  25761. [
  25762. 'e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d',
  25763. '9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d'
  25764. ],
  25765. [
  25766. 'feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d',
  25767. 'e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088'
  25768. ],
  25769. [
  25770. 'da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1',
  25771. '9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d'
  25772. ],
  25773. [
  25774. '53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0',
  25775. '5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8'
  25776. ],
  25777. [
  25778. '8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047',
  25779. '10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a'
  25780. ],
  25781. [
  25782. '385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862',
  25783. '283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453'
  25784. ],
  25785. [
  25786. '6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7',
  25787. '7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160'
  25788. ],
  25789. [
  25790. '3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd',
  25791. '56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0'
  25792. ],
  25793. [
  25794. '85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83',
  25795. '7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6'
  25796. ],
  25797. [
  25798. '948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a',
  25799. '53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589'
  25800. ],
  25801. [
  25802. '6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8',
  25803. 'bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17'
  25804. ],
  25805. [
  25806. 'e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d',
  25807. '4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda'
  25808. ],
  25809. [
  25810. 'e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725',
  25811. '7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd'
  25812. ],
  25813. [
  25814. '213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754',
  25815. '4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2'
  25816. ],
  25817. [
  25818. '4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c',
  25819. '17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6'
  25820. ],
  25821. [
  25822. 'fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6',
  25823. '6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f'
  25824. ],
  25825. [
  25826. '76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39',
  25827. 'c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01'
  25828. ],
  25829. [
  25830. 'c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891',
  25831. '893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3'
  25832. ],
  25833. [
  25834. 'd895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b',
  25835. 'febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f'
  25836. ],
  25837. [
  25838. 'b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03',
  25839. '2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7'
  25840. ],
  25841. [
  25842. 'e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d',
  25843. 'eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78'
  25844. ],
  25845. [
  25846. 'a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070',
  25847. '7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1'
  25848. ],
  25849. [
  25850. '90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4',
  25851. 'e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150'
  25852. ],
  25853. [
  25854. '8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da',
  25855. '662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82'
  25856. ],
  25857. [
  25858. 'e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11',
  25859. '1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc'
  25860. ],
  25861. [
  25862. '8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e',
  25863. 'efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b'
  25864. ],
  25865. [
  25866. 'e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41',
  25867. '2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51'
  25868. ],
  25869. [
  25870. 'b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef',
  25871. '67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45'
  25872. ],
  25873. [
  25874. 'd68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8',
  25875. 'db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120'
  25876. ],
  25877. [
  25878. '324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d',
  25879. '648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84'
  25880. ],
  25881. [
  25882. '4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96',
  25883. '35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d'
  25884. ],
  25885. [
  25886. '9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd',
  25887. 'ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d'
  25888. ],
  25889. [
  25890. '6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5',
  25891. '9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8'
  25892. ],
  25893. [
  25894. 'a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266',
  25895. '40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8'
  25896. ],
  25897. [
  25898. '7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71',
  25899. '34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac'
  25900. ],
  25901. [
  25902. '928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac',
  25903. 'c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f'
  25904. ],
  25905. [
  25906. '85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751',
  25907. '1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962'
  25908. ],
  25909. [
  25910. 'ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e',
  25911. '493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907'
  25912. ],
  25913. [
  25914. '827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241',
  25915. 'c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec'
  25916. ],
  25917. [
  25918. 'eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3',
  25919. 'be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d'
  25920. ],
  25921. [
  25922. 'e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f',
  25923. '4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414'
  25924. ],
  25925. [
  25926. '1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19',
  25927. 'aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd'
  25928. ],
  25929. [
  25930. '146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be',
  25931. 'b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0'
  25932. ],
  25933. [
  25934. 'fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9',
  25935. '6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811'
  25936. ],
  25937. [
  25938. 'da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2',
  25939. '8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1'
  25940. ],
  25941. [
  25942. 'a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13',
  25943. '7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c'
  25944. ],
  25945. [
  25946. '174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c',
  25947. 'ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73'
  25948. ],
  25949. [
  25950. '959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba',
  25951. '2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd'
  25952. ],
  25953. [
  25954. 'd2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151',
  25955. 'e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405'
  25956. ],
  25957. [
  25958. '64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073',
  25959. 'd99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589'
  25960. ],
  25961. [
  25962. '8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458',
  25963. '38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e'
  25964. ],
  25965. [
  25966. '13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b',
  25967. '69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27'
  25968. ],
  25969. [
  25970. 'bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366',
  25971. 'd3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1'
  25972. ],
  25973. [
  25974. '8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa',
  25975. '40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482'
  25976. ],
  25977. [
  25978. '8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0',
  25979. '620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945'
  25980. ],
  25981. [
  25982. 'dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787',
  25983. '7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573'
  25984. ],
  25985. [
  25986. 'f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e',
  25987. 'ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82'
  25988. ]
  25989. ]
  25990. },
  25991. naf: {
  25992. wnd: 7,
  25993. points: [
  25994. [
  25995. 'f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9',
  25996. '388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672'
  25997. ],
  25998. [
  25999. '2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4',
  26000. 'd8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6'
  26001. ],
  26002. [
  26003. '5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc',
  26004. '6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da'
  26005. ],
  26006. [
  26007. 'acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe',
  26008. 'cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37'
  26009. ],
  26010. [
  26011. '774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb',
  26012. 'd984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b'
  26013. ],
  26014. [
  26015. 'f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8',
  26016. 'ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81'
  26017. ],
  26018. [
  26019. 'd7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e',
  26020. '581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58'
  26021. ],
  26022. [
  26023. 'defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34',
  26024. '4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77'
  26025. ],
  26026. [
  26027. '2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c',
  26028. '85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a'
  26029. ],
  26030. [
  26031. '352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5',
  26032. '321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c'
  26033. ],
  26034. [
  26035. '2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f',
  26036. '2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67'
  26037. ],
  26038. [
  26039. '9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714',
  26040. '73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402'
  26041. ],
  26042. [
  26043. 'daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729',
  26044. 'a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55'
  26045. ],
  26046. [
  26047. 'c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db',
  26048. '2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482'
  26049. ],
  26050. [
  26051. '6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4',
  26052. 'e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82'
  26053. ],
  26054. [
  26055. '1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5',
  26056. 'b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396'
  26057. ],
  26058. [
  26059. '605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479',
  26060. '2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49'
  26061. ],
  26062. [
  26063. '62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d',
  26064. '80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf'
  26065. ],
  26066. [
  26067. '80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f',
  26068. '1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a'
  26069. ],
  26070. [
  26071. '7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb',
  26072. 'd0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7'
  26073. ],
  26074. [
  26075. 'd528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9',
  26076. 'eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933'
  26077. ],
  26078. [
  26079. '49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963',
  26080. '758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a'
  26081. ],
  26082. [
  26083. '77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74',
  26084. '958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6'
  26085. ],
  26086. [
  26087. 'f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530',
  26088. 'e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37'
  26089. ],
  26090. [
  26091. '463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b',
  26092. '5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e'
  26093. ],
  26094. [
  26095. 'f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247',
  26096. 'cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6'
  26097. ],
  26098. [
  26099. 'caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1',
  26100. 'cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476'
  26101. ],
  26102. [
  26103. '2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120',
  26104. '4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40'
  26105. ],
  26106. [
  26107. '7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435',
  26108. '91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61'
  26109. ],
  26110. [
  26111. '754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18',
  26112. '673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683'
  26113. ],
  26114. [
  26115. 'e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8',
  26116. '59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5'
  26117. ],
  26118. [
  26119. '186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb',
  26120. '3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b'
  26121. ],
  26122. [
  26123. 'df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f',
  26124. '55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417'
  26125. ],
  26126. [
  26127. '5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143',
  26128. 'efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868'
  26129. ],
  26130. [
  26131. '290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba',
  26132. 'e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a'
  26133. ],
  26134. [
  26135. 'af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45',
  26136. 'f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6'
  26137. ],
  26138. [
  26139. '766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a',
  26140. '744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996'
  26141. ],
  26142. [
  26143. '59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e',
  26144. 'c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e'
  26145. ],
  26146. [
  26147. 'f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8',
  26148. 'e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d'
  26149. ],
  26150. [
  26151. '7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c',
  26152. '30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2'
  26153. ],
  26154. [
  26155. '948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519',
  26156. 'e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e'
  26157. ],
  26158. [
  26159. '7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab',
  26160. '100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437'
  26161. ],
  26162. [
  26163. '3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca',
  26164. 'ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311'
  26165. ],
  26166. [
  26167. 'd3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf',
  26168. '8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4'
  26169. ],
  26170. [
  26171. '1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610',
  26172. '68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575'
  26173. ],
  26174. [
  26175. '733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4',
  26176. 'f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d'
  26177. ],
  26178. [
  26179. '15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c',
  26180. 'd56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d'
  26181. ],
  26182. [
  26183. 'a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940',
  26184. 'edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629'
  26185. ],
  26186. [
  26187. 'e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980',
  26188. 'a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06'
  26189. ],
  26190. [
  26191. '311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3',
  26192. '66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374'
  26193. ],
  26194. [
  26195. '34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf',
  26196. '9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee'
  26197. ],
  26198. [
  26199. 'f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63',
  26200. '4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1'
  26201. ],
  26202. [
  26203. 'd7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448',
  26204. 'fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b'
  26205. ],
  26206. [
  26207. '32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf',
  26208. '5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661'
  26209. ],
  26210. [
  26211. '7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5',
  26212. '8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6'
  26213. ],
  26214. [
  26215. 'ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6',
  26216. '8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e'
  26217. ],
  26218. [
  26219. '16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5',
  26220. '5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d'
  26221. ],
  26222. [
  26223. 'eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99',
  26224. 'f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc'
  26225. ],
  26226. [
  26227. '78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51',
  26228. 'f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4'
  26229. ],
  26230. [
  26231. '494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5',
  26232. '42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c'
  26233. ],
  26234. [
  26235. 'a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5',
  26236. '204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b'
  26237. ],
  26238. [
  26239. 'c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997',
  26240. '4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913'
  26241. ],
  26242. [
  26243. '841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881',
  26244. '73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154'
  26245. ],
  26246. [
  26247. '5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5',
  26248. '39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865'
  26249. ],
  26250. [
  26251. '36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66',
  26252. 'd2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc'
  26253. ],
  26254. [
  26255. '336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726',
  26256. 'ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224'
  26257. ],
  26258. [
  26259. '8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede',
  26260. '6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e'
  26261. ],
  26262. [
  26263. '1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94',
  26264. '60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6'
  26265. ],
  26266. [
  26267. '85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31',
  26268. '3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511'
  26269. ],
  26270. [
  26271. '29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51',
  26272. 'b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b'
  26273. ],
  26274. [
  26275. 'a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252',
  26276. 'ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2'
  26277. ],
  26278. [
  26279. '4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5',
  26280. 'cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c'
  26281. ],
  26282. [
  26283. 'd24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b',
  26284. '6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3'
  26285. ],
  26286. [
  26287. 'ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4',
  26288. '322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d'
  26289. ],
  26290. [
  26291. 'af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f',
  26292. '6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700'
  26293. ],
  26294. [
  26295. 'e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889',
  26296. '2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4'
  26297. ],
  26298. [
  26299. '591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246',
  26300. 'b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196'
  26301. ],
  26302. [
  26303. '11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984',
  26304. '998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4'
  26305. ],
  26306. [
  26307. '3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a',
  26308. 'b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257'
  26309. ],
  26310. [
  26311. 'cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030',
  26312. 'bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13'
  26313. ],
  26314. [
  26315. 'c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197',
  26316. '6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096'
  26317. ],
  26318. [
  26319. 'c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593',
  26320. 'c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38'
  26321. ],
  26322. [
  26323. 'a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef',
  26324. '21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f'
  26325. ],
  26326. [
  26327. '347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38',
  26328. '60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448'
  26329. ],
  26330. [
  26331. 'da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a',
  26332. '49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a'
  26333. ],
  26334. [
  26335. 'c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111',
  26336. '5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4'
  26337. ],
  26338. [
  26339. '4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502',
  26340. '7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437'
  26341. ],
  26342. [
  26343. '3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea',
  26344. 'be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7'
  26345. ],
  26346. [
  26347. 'cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26',
  26348. '8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d'
  26349. ],
  26350. [
  26351. 'b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986',
  26352. '39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a'
  26353. ],
  26354. [
  26355. 'd4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e',
  26356. '62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54'
  26357. ],
  26358. [
  26359. '48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4',
  26360. '25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77'
  26361. ],
  26362. [
  26363. 'dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda',
  26364. 'ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517'
  26365. ],
  26366. [
  26367. '6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859',
  26368. 'cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10'
  26369. ],
  26370. [
  26371. 'e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f',
  26372. 'f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125'
  26373. ],
  26374. [
  26375. 'eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c',
  26376. '6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e'
  26377. ],
  26378. [
  26379. '13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942',
  26380. 'fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1'
  26381. ],
  26382. [
  26383. 'ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a',
  26384. '1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2'
  26385. ],
  26386. [
  26387. 'b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80',
  26388. '5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423'
  26389. ],
  26390. [
  26391. 'ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d',
  26392. '438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8'
  26393. ],
  26394. [
  26395. '8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1',
  26396. 'cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758'
  26397. ],
  26398. [
  26399. '52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63',
  26400. 'c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375'
  26401. ],
  26402. [
  26403. 'e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352',
  26404. '6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d'
  26405. ],
  26406. [
  26407. '7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193',
  26408. 'ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec'
  26409. ],
  26410. [
  26411. '5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00',
  26412. '9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0'
  26413. ],
  26414. [
  26415. '32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58',
  26416. 'ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c'
  26417. ],
  26418. [
  26419. 'e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7',
  26420. 'd3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4'
  26421. ],
  26422. [
  26423. '8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8',
  26424. 'c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f'
  26425. ],
  26426. [
  26427. '4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e',
  26428. '67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649'
  26429. ],
  26430. [
  26431. '3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d',
  26432. 'cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826'
  26433. ],
  26434. [
  26435. '674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b',
  26436. '299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5'
  26437. ],
  26438. [
  26439. 'd32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f',
  26440. 'f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87'
  26441. ],
  26442. [
  26443. '30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6',
  26444. '462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b'
  26445. ],
  26446. [
  26447. 'be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297',
  26448. '62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc'
  26449. ],
  26450. [
  26451. '93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a',
  26452. '7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c'
  26453. ],
  26454. [
  26455. 'b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c',
  26456. 'ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f'
  26457. ],
  26458. [
  26459. 'd5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52',
  26460. '4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a'
  26461. ],
  26462. [
  26463. 'd3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb',
  26464. 'bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46'
  26465. ],
  26466. [
  26467. '463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065',
  26468. 'bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f'
  26469. ],
  26470. [
  26471. '7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917',
  26472. '603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03'
  26473. ],
  26474. [
  26475. '74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9',
  26476. 'cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08'
  26477. ],
  26478. [
  26479. '30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3',
  26480. '553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8'
  26481. ],
  26482. [
  26483. '9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57',
  26484. '712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373'
  26485. ],
  26486. [
  26487. '176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66',
  26488. 'ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3'
  26489. ],
  26490. [
  26491. '75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8',
  26492. '9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8'
  26493. ],
  26494. [
  26495. '809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721',
  26496. '9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1'
  26497. ],
  26498. [
  26499. '1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180',
  26500. '4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9'
  26501. ]
  26502. ]
  26503. }
  26504. };
  26505. /***/ }),
  26506. /* 197 */
  26507. /*!********************************************************!*\
  26508. !*** ./node_modules/elliptic/lib/elliptic/ec/index.js ***!
  26509. \********************************************************/
  26510. /*! no static exports found */
  26511. /***/ (function(module, exports, __webpack_require__) {
  26512. "use strict";
  26513. var BN = __webpack_require__(/*! bn.js */ 163);
  26514. var HmacDRBG = __webpack_require__(/*! hmac-drbg */ 198);
  26515. var utils = __webpack_require__(/*! ../utils */ 176);
  26516. var curves = __webpack_require__(/*! ../curves */ 183);
  26517. var rand = __webpack_require__(/*! brorand */ 167);
  26518. var assert = utils.assert;
  26519. var KeyPair = __webpack_require__(/*! ./key */ 199);
  26520. var Signature = __webpack_require__(/*! ./signature */ 200);
  26521. function EC(options) {
  26522. if (!(this instanceof EC))
  26523. return new EC(options);
  26524. // Shortcut `elliptic.ec(curve-name)`
  26525. if (typeof options === 'string') {
  26526. assert(curves.hasOwnProperty(options), 'Unknown curve ' + options);
  26527. options = curves[options];
  26528. }
  26529. // Shortcut for `elliptic.ec(elliptic.curves.curveName)`
  26530. if (options instanceof curves.PresetCurve)
  26531. options = { curve: options };
  26532. this.curve = options.curve.curve;
  26533. this.n = this.curve.n;
  26534. this.nh = this.n.ushrn(1);
  26535. this.g = this.curve.g;
  26536. // Point on curve
  26537. this.g = options.curve.g;
  26538. this.g.precompute(options.curve.n.bitLength() + 1);
  26539. // Hash for function for DRBG
  26540. this.hash = options.hash || options.curve.hash;
  26541. }
  26542. module.exports = EC;
  26543. EC.prototype.keyPair = function keyPair(options) {
  26544. return new KeyPair(this, options);
  26545. };
  26546. EC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) {
  26547. return KeyPair.fromPrivate(this, priv, enc);
  26548. };
  26549. EC.prototype.keyFromPublic = function keyFromPublic(pub, enc) {
  26550. return KeyPair.fromPublic(this, pub, enc);
  26551. };
  26552. EC.prototype.genKeyPair = function genKeyPair(options) {
  26553. if (!options)
  26554. options = {};
  26555. // Instantiate Hmac_DRBG
  26556. var drbg = new HmacDRBG({
  26557. hash: this.hash,
  26558. pers: options.pers,
  26559. persEnc: options.persEnc || 'utf8',
  26560. entropy: options.entropy || rand(this.hash.hmacStrength),
  26561. entropyEnc: options.entropy && options.entropyEnc || 'utf8',
  26562. nonce: this.n.toArray()
  26563. });
  26564. var bytes = this.n.byteLength();
  26565. var ns2 = this.n.sub(new BN(2));
  26566. do {
  26567. var priv = new BN(drbg.generate(bytes));
  26568. if (priv.cmp(ns2) > 0)
  26569. continue;
  26570. priv.iaddn(1);
  26571. return this.keyFromPrivate(priv);
  26572. } while (true);
  26573. };
  26574. EC.prototype._truncateToN = function truncateToN(msg, truncOnly) {
  26575. var delta = msg.byteLength() * 8 - this.n.bitLength();
  26576. if (delta > 0)
  26577. msg = msg.ushrn(delta);
  26578. if (!truncOnly && msg.cmp(this.n) >= 0)
  26579. return msg.sub(this.n);
  26580. else
  26581. return msg;
  26582. };
  26583. EC.prototype.sign = function sign(msg, key, enc, options) {
  26584. if (typeof enc === 'object') {
  26585. options = enc;
  26586. enc = null;
  26587. }
  26588. if (!options)
  26589. options = {};
  26590. key = this.keyFromPrivate(key, enc);
  26591. msg = this._truncateToN(new BN(msg, 16));
  26592. // Zero-extend key to provide enough entropy
  26593. var bytes = this.n.byteLength();
  26594. var bkey = key.getPrivate().toArray('be', bytes);
  26595. // Zero-extend nonce to have the same byte size as N
  26596. var nonce = msg.toArray('be', bytes);
  26597. // Instantiate Hmac_DRBG
  26598. var drbg = new HmacDRBG({
  26599. hash: this.hash,
  26600. entropy: bkey,
  26601. nonce: nonce,
  26602. pers: options.pers,
  26603. persEnc: options.persEnc || 'utf8'
  26604. });
  26605. // Number of bytes to generate
  26606. var ns1 = this.n.sub(new BN(1));
  26607. for (var iter = 0; true; iter++) {
  26608. var k = options.k ?
  26609. options.k(iter) :
  26610. new BN(drbg.generate(this.n.byteLength()));
  26611. k = this._truncateToN(k, true);
  26612. if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0)
  26613. continue;
  26614. var kp = this.g.mul(k);
  26615. if (kp.isInfinity())
  26616. continue;
  26617. var kpX = kp.getX();
  26618. var r = kpX.umod(this.n);
  26619. if (r.cmpn(0) === 0)
  26620. continue;
  26621. var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg));
  26622. s = s.umod(this.n);
  26623. if (s.cmpn(0) === 0)
  26624. continue;
  26625. var recoveryParam = (kp.getY().isOdd() ? 1 : 0) |
  26626. (kpX.cmp(r) !== 0 ? 2 : 0);
  26627. // Use complement of `s`, if it is > `n / 2`
  26628. if (options.canonical && s.cmp(this.nh) > 0) {
  26629. s = this.n.sub(s);
  26630. recoveryParam ^= 1;
  26631. }
  26632. return new Signature({ r: r, s: s, recoveryParam: recoveryParam });
  26633. }
  26634. };
  26635. EC.prototype.verify = function verify(msg, signature, key, enc) {
  26636. msg = this._truncateToN(new BN(msg, 16));
  26637. key = this.keyFromPublic(key, enc);
  26638. signature = new Signature(signature, 'hex');
  26639. // Perform primitive values validation
  26640. var r = signature.r;
  26641. var s = signature.s;
  26642. if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0)
  26643. return false;
  26644. if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0)
  26645. return false;
  26646. // Validate signature
  26647. var sinv = s.invm(this.n);
  26648. var u1 = sinv.mul(msg).umod(this.n);
  26649. var u2 = sinv.mul(r).umod(this.n);
  26650. if (!this.curve._maxwellTrick) {
  26651. var p = this.g.mulAdd(u1, key.getPublic(), u2);
  26652. if (p.isInfinity())
  26653. return false;
  26654. return p.getX().umod(this.n).cmp(r) === 0;
  26655. }
  26656. // NOTE: Greg Maxwell's trick, inspired by:
  26657. // https://git.io/vad3K
  26658. var p = this.g.jmulAdd(u1, key.getPublic(), u2);
  26659. if (p.isInfinity())
  26660. return false;
  26661. // Compare `p.x` of Jacobian point with `r`,
  26662. // this will do `p.x == r * p.z^2` instead of multiplying `p.x` by the
  26663. // inverse of `p.z^2`
  26664. return p.eqXToP(r);
  26665. };
  26666. EC.prototype.recoverPubKey = function(msg, signature, j, enc) {
  26667. assert((3 & j) === j, 'The recovery param is more than two bits');
  26668. signature = new Signature(signature, enc);
  26669. var n = this.n;
  26670. var e = new BN(msg);
  26671. var r = signature.r;
  26672. var s = signature.s;
  26673. // A set LSB signifies that the y-coordinate is odd
  26674. var isYOdd = j & 1;
  26675. var isSecondKey = j >> 1;
  26676. if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey)
  26677. throw new Error('Unable to find sencond key candinate');
  26678. // 1.1. Let x = r + jn.
  26679. if (isSecondKey)
  26680. r = this.curve.pointFromX(r.add(this.curve.n), isYOdd);
  26681. else
  26682. r = this.curve.pointFromX(r, isYOdd);
  26683. var rInv = signature.r.invm(n);
  26684. var s1 = n.sub(e).mul(rInv).umod(n);
  26685. var s2 = s.mul(rInv).umod(n);
  26686. // 1.6.1 Compute Q = r^-1 (sR - eG)
  26687. // Q = r^-1 (sR + -eG)
  26688. return this.g.mulAdd(s1, r, s2);
  26689. };
  26690. EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) {
  26691. signature = new Signature(signature, enc);
  26692. if (signature.recoveryParam !== null)
  26693. return signature.recoveryParam;
  26694. for (var i = 0; i < 4; i++) {
  26695. var Qprime;
  26696. try {
  26697. Qprime = this.recoverPubKey(e, signature, i);
  26698. } catch (e) {
  26699. continue;
  26700. }
  26701. if (Qprime.eq(Q))
  26702. return i;
  26703. }
  26704. throw new Error('Unable to find valid recovery factor');
  26705. };
  26706. /***/ }),
  26707. /* 198 */
  26708. /*!*************************************************!*\
  26709. !*** ./node_modules/hmac-drbg/lib/hmac-drbg.js ***!
  26710. \*************************************************/
  26711. /*! no static exports found */
  26712. /***/ (function(module, exports, __webpack_require__) {
  26713. "use strict";
  26714. var hash = __webpack_require__(/*! hash.js */ 184);
  26715. var utils = __webpack_require__(/*! minimalistic-crypto-utils */ 177);
  26716. var assert = __webpack_require__(/*! minimalistic-assert */ 137);
  26717. function HmacDRBG(options) {
  26718. if (!(this instanceof HmacDRBG))
  26719. return new HmacDRBG(options);
  26720. this.hash = options.hash;
  26721. this.predResist = !!options.predResist;
  26722. this.outLen = this.hash.outSize;
  26723. this.minEntropy = options.minEntropy || this.hash.hmacStrength;
  26724. this._reseed = null;
  26725. this.reseedInterval = null;
  26726. this.K = null;
  26727. this.V = null;
  26728. var entropy = utils.toArray(options.entropy, options.entropyEnc || 'hex');
  26729. var nonce = utils.toArray(options.nonce, options.nonceEnc || 'hex');
  26730. var pers = utils.toArray(options.pers, options.persEnc || 'hex');
  26731. assert(entropy.length >= (this.minEntropy / 8),
  26732. 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');
  26733. this._init(entropy, nonce, pers);
  26734. }
  26735. module.exports = HmacDRBG;
  26736. HmacDRBG.prototype._init = function init(entropy, nonce, pers) {
  26737. var seed = entropy.concat(nonce).concat(pers);
  26738. this.K = new Array(this.outLen / 8);
  26739. this.V = new Array(this.outLen / 8);
  26740. for (var i = 0; i < this.V.length; i++) {
  26741. this.K[i] = 0x00;
  26742. this.V[i] = 0x01;
  26743. }
  26744. this._update(seed);
  26745. this._reseed = 1;
  26746. this.reseedInterval = 0x1000000000000; // 2^48
  26747. };
  26748. HmacDRBG.prototype._hmac = function hmac() {
  26749. return new hash.hmac(this.hash, this.K);
  26750. };
  26751. HmacDRBG.prototype._update = function update(seed) {
  26752. var kmac = this._hmac()
  26753. .update(this.V)
  26754. .update([ 0x00 ]);
  26755. if (seed)
  26756. kmac = kmac.update(seed);
  26757. this.K = kmac.digest();
  26758. this.V = this._hmac().update(this.V).digest();
  26759. if (!seed)
  26760. return;
  26761. this.K = this._hmac()
  26762. .update(this.V)
  26763. .update([ 0x01 ])
  26764. .update(seed)
  26765. .digest();
  26766. this.V = this._hmac().update(this.V).digest();
  26767. };
  26768. HmacDRBG.prototype.reseed = function reseed(entropy, entropyEnc, add, addEnc) {
  26769. // Optional entropy enc
  26770. if (typeof entropyEnc !== 'string') {
  26771. addEnc = add;
  26772. add = entropyEnc;
  26773. entropyEnc = null;
  26774. }
  26775. entropy = utils.toArray(entropy, entropyEnc);
  26776. add = utils.toArray(add, addEnc);
  26777. assert(entropy.length >= (this.minEntropy / 8),
  26778. 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');
  26779. this._update(entropy.concat(add || []));
  26780. this._reseed = 1;
  26781. };
  26782. HmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) {
  26783. if (this._reseed > this.reseedInterval)
  26784. throw new Error('Reseed is required');
  26785. // Optional encoding
  26786. if (typeof enc !== 'string') {
  26787. addEnc = add;
  26788. add = enc;
  26789. enc = null;
  26790. }
  26791. // Optional additional data
  26792. if (add) {
  26793. add = utils.toArray(add, addEnc || 'hex');
  26794. this._update(add);
  26795. }
  26796. var temp = [];
  26797. while (temp.length < len) {
  26798. this.V = this._hmac().update(this.V).digest();
  26799. temp = temp.concat(this.V);
  26800. }
  26801. var res = temp.slice(0, len);
  26802. this._update(add);
  26803. this._reseed++;
  26804. return utils.encode(res, enc);
  26805. };
  26806. /***/ }),
  26807. /* 199 */
  26808. /*!******************************************************!*\
  26809. !*** ./node_modules/elliptic/lib/elliptic/ec/key.js ***!
  26810. \******************************************************/
  26811. /*! no static exports found */
  26812. /***/ (function(module, exports, __webpack_require__) {
  26813. "use strict";
  26814. var BN = __webpack_require__(/*! bn.js */ 163);
  26815. var utils = __webpack_require__(/*! ../utils */ 176);
  26816. var assert = utils.assert;
  26817. function KeyPair(ec, options) {
  26818. this.ec = ec;
  26819. this.priv = null;
  26820. this.pub = null;
  26821. // KeyPair(ec, { priv: ..., pub: ... })
  26822. if (options.priv)
  26823. this._importPrivate(options.priv, options.privEnc);
  26824. if (options.pub)
  26825. this._importPublic(options.pub, options.pubEnc);
  26826. }
  26827. module.exports = KeyPair;
  26828. KeyPair.fromPublic = function fromPublic(ec, pub, enc) {
  26829. if (pub instanceof KeyPair)
  26830. return pub;
  26831. return new KeyPair(ec, {
  26832. pub: pub,
  26833. pubEnc: enc
  26834. });
  26835. };
  26836. KeyPair.fromPrivate = function fromPrivate(ec, priv, enc) {
  26837. if (priv instanceof KeyPair)
  26838. return priv;
  26839. return new KeyPair(ec, {
  26840. priv: priv,
  26841. privEnc: enc
  26842. });
  26843. };
  26844. KeyPair.prototype.validate = function validate() {
  26845. var pub = this.getPublic();
  26846. if (pub.isInfinity())
  26847. return { result: false, reason: 'Invalid public key' };
  26848. if (!pub.validate())
  26849. return { result: false, reason: 'Public key is not a point' };
  26850. if (!pub.mul(this.ec.curve.n).isInfinity())
  26851. return { result: false, reason: 'Public key * N != O' };
  26852. return { result: true, reason: null };
  26853. };
  26854. KeyPair.prototype.getPublic = function getPublic(compact, enc) {
  26855. // compact is optional argument
  26856. if (typeof compact === 'string') {
  26857. enc = compact;
  26858. compact = null;
  26859. }
  26860. if (!this.pub)
  26861. this.pub = this.ec.g.mul(this.priv);
  26862. if (!enc)
  26863. return this.pub;
  26864. return this.pub.encode(enc, compact);
  26865. };
  26866. KeyPair.prototype.getPrivate = function getPrivate(enc) {
  26867. if (enc === 'hex')
  26868. return this.priv.toString(16, 2);
  26869. else
  26870. return this.priv;
  26871. };
  26872. KeyPair.prototype._importPrivate = function _importPrivate(key, enc) {
  26873. this.priv = new BN(key, enc || 16);
  26874. // Ensure that the priv won't be bigger than n, otherwise we may fail
  26875. // in fixed multiplication method
  26876. this.priv = this.priv.umod(this.ec.curve.n);
  26877. };
  26878. KeyPair.prototype._importPublic = function _importPublic(key, enc) {
  26879. if (key.x || key.y) {
  26880. // Montgomery points only have an `x` coordinate.
  26881. // Weierstrass/Edwards points on the other hand have both `x` and
  26882. // `y` coordinates.
  26883. if (this.ec.curve.type === 'mont') {
  26884. assert(key.x, 'Need x coordinate');
  26885. } else if (this.ec.curve.type === 'short' ||
  26886. this.ec.curve.type === 'edwards') {
  26887. assert(key.x && key.y, 'Need both x and y coordinate');
  26888. }
  26889. this.pub = this.ec.curve.point(key.x, key.y);
  26890. return;
  26891. }
  26892. this.pub = this.ec.curve.decodePoint(key, enc);
  26893. };
  26894. // ECDH
  26895. KeyPair.prototype.derive = function derive(pub) {
  26896. return pub.mul(this.priv).getX();
  26897. };
  26898. // ECDSA
  26899. KeyPair.prototype.sign = function sign(msg, enc, options) {
  26900. return this.ec.sign(msg, this, enc, options);
  26901. };
  26902. KeyPair.prototype.verify = function verify(msg, signature) {
  26903. return this.ec.verify(msg, signature, this);
  26904. };
  26905. KeyPair.prototype.inspect = function inspect() {
  26906. return '<Key priv: ' + (this.priv && this.priv.toString(16, 2)) +
  26907. ' pub: ' + (this.pub && this.pub.inspect()) + ' >';
  26908. };
  26909. /***/ }),
  26910. /* 200 */
  26911. /*!************************************************************!*\
  26912. !*** ./node_modules/elliptic/lib/elliptic/ec/signature.js ***!
  26913. \************************************************************/
  26914. /*! no static exports found */
  26915. /***/ (function(module, exports, __webpack_require__) {
  26916. "use strict";
  26917. var BN = __webpack_require__(/*! bn.js */ 163);
  26918. var utils = __webpack_require__(/*! ../utils */ 176);
  26919. var assert = utils.assert;
  26920. function Signature(options, enc) {
  26921. if (options instanceof Signature)
  26922. return options;
  26923. if (this._importDER(options, enc))
  26924. return;
  26925. assert(options.r && options.s, 'Signature without r or s');
  26926. this.r = new BN(options.r, 16);
  26927. this.s = new BN(options.s, 16);
  26928. if (options.recoveryParam === undefined)
  26929. this.recoveryParam = null;
  26930. else
  26931. this.recoveryParam = options.recoveryParam;
  26932. }
  26933. module.exports = Signature;
  26934. function Position() {
  26935. this.place = 0;
  26936. }
  26937. function getLength(buf, p) {
  26938. var initial = buf[p.place++];
  26939. if (!(initial & 0x80)) {
  26940. return initial;
  26941. }
  26942. var octetLen = initial & 0xf;
  26943. var val = 0;
  26944. for (var i = 0, off = p.place; i < octetLen; i++, off++) {
  26945. val <<= 8;
  26946. val |= buf[off];
  26947. }
  26948. p.place = off;
  26949. return val;
  26950. }
  26951. function rmPadding(buf) {
  26952. var i = 0;
  26953. var len = buf.length - 1;
  26954. while (!buf[i] && !(buf[i + 1] & 0x80) && i < len) {
  26955. i++;
  26956. }
  26957. if (i === 0) {
  26958. return buf;
  26959. }
  26960. return buf.slice(i);
  26961. }
  26962. Signature.prototype._importDER = function _importDER(data, enc) {
  26963. data = utils.toArray(data, enc);
  26964. var p = new Position();
  26965. if (data[p.place++] !== 0x30) {
  26966. return false;
  26967. }
  26968. var len = getLength(data, p);
  26969. if ((len + p.place) !== data.length) {
  26970. return false;
  26971. }
  26972. if (data[p.place++] !== 0x02) {
  26973. return false;
  26974. }
  26975. var rlen = getLength(data, p);
  26976. var r = data.slice(p.place, rlen + p.place);
  26977. p.place += rlen;
  26978. if (data[p.place++] !== 0x02) {
  26979. return false;
  26980. }
  26981. var slen = getLength(data, p);
  26982. if (data.length !== slen + p.place) {
  26983. return false;
  26984. }
  26985. var s = data.slice(p.place, slen + p.place);
  26986. if (r[0] === 0 && (r[1] & 0x80)) {
  26987. r = r.slice(1);
  26988. }
  26989. if (s[0] === 0 && (s[1] & 0x80)) {
  26990. s = s.slice(1);
  26991. }
  26992. this.r = new BN(r);
  26993. this.s = new BN(s);
  26994. this.recoveryParam = null;
  26995. return true;
  26996. };
  26997. function constructLength(arr, len) {
  26998. if (len < 0x80) {
  26999. arr.push(len);
  27000. return;
  27001. }
  27002. var octets = 1 + (Math.log(len) / Math.LN2 >>> 3);
  27003. arr.push(octets | 0x80);
  27004. while (--octets) {
  27005. arr.push((len >>> (octets << 3)) & 0xff);
  27006. }
  27007. arr.push(len);
  27008. }
  27009. Signature.prototype.toDER = function toDER(enc) {
  27010. var r = this.r.toArray();
  27011. var s = this.s.toArray();
  27012. // Pad values
  27013. if (r[0] & 0x80)
  27014. r = [ 0 ].concat(r);
  27015. // Pad values
  27016. if (s[0] & 0x80)
  27017. s = [ 0 ].concat(s);
  27018. r = rmPadding(r);
  27019. s = rmPadding(s);
  27020. while (!s[0] && !(s[1] & 0x80)) {
  27021. s = s.slice(1);
  27022. }
  27023. var arr = [ 0x02 ];
  27024. constructLength(arr, r.length);
  27025. arr = arr.concat(r);
  27026. arr.push(0x02);
  27027. constructLength(arr, s.length);
  27028. var backHalf = arr.concat(s);
  27029. var res = [ 0x30 ];
  27030. constructLength(res, backHalf.length);
  27031. res = res.concat(backHalf);
  27032. return utils.encode(res, enc);
  27033. };
  27034. /***/ }),
  27035. /* 201 */
  27036. /*!***********************************************************!*\
  27037. !*** ./node_modules/elliptic/lib/elliptic/eddsa/index.js ***!
  27038. \***********************************************************/
  27039. /*! no static exports found */
  27040. /***/ (function(module, exports, __webpack_require__) {
  27041. "use strict";
  27042. var hash = __webpack_require__(/*! hash.js */ 184);
  27043. var curves = __webpack_require__(/*! ../curves */ 183);
  27044. var utils = __webpack_require__(/*! ../utils */ 176);
  27045. var assert = utils.assert;
  27046. var parseBytes = utils.parseBytes;
  27047. var KeyPair = __webpack_require__(/*! ./key */ 202);
  27048. var Signature = __webpack_require__(/*! ./signature */ 203);
  27049. function EDDSA(curve) {
  27050. assert(curve === 'ed25519', 'only tested with ed25519 so far');
  27051. if (!(this instanceof EDDSA))
  27052. return new EDDSA(curve);
  27053. var curve = curves[curve].curve;
  27054. this.curve = curve;
  27055. this.g = curve.g;
  27056. this.g.precompute(curve.n.bitLength() + 1);
  27057. this.pointClass = curve.point().constructor;
  27058. this.encodingLength = Math.ceil(curve.n.bitLength() / 8);
  27059. this.hash = hash.sha512;
  27060. }
  27061. module.exports = EDDSA;
  27062. /**
  27063. * @param {Array|String} message - message bytes
  27064. * @param {Array|String|KeyPair} secret - secret bytes or a keypair
  27065. * @returns {Signature} - signature
  27066. */
  27067. EDDSA.prototype.sign = function sign(message, secret) {
  27068. message = parseBytes(message);
  27069. var key = this.keyFromSecret(secret);
  27070. var r = this.hashInt(key.messagePrefix(), message);
  27071. var R = this.g.mul(r);
  27072. var Rencoded = this.encodePoint(R);
  27073. var s_ = this.hashInt(Rencoded, key.pubBytes(), message)
  27074. .mul(key.priv());
  27075. var S = r.add(s_).umod(this.curve.n);
  27076. return this.makeSignature({ R: R, S: S, Rencoded: Rencoded });
  27077. };
  27078. /**
  27079. * @param {Array} message - message bytes
  27080. * @param {Array|String|Signature} sig - sig bytes
  27081. * @param {Array|String|Point|KeyPair} pub - public key
  27082. * @returns {Boolean} - true if public key matches sig of message
  27083. */
  27084. EDDSA.prototype.verify = function verify(message, sig, pub) {
  27085. message = parseBytes(message);
  27086. sig = this.makeSignature(sig);
  27087. var key = this.keyFromPublic(pub);
  27088. var h = this.hashInt(sig.Rencoded(), key.pubBytes(), message);
  27089. var SG = this.g.mul(sig.S());
  27090. var RplusAh = sig.R().add(key.pub().mul(h));
  27091. return RplusAh.eq(SG);
  27092. };
  27093. EDDSA.prototype.hashInt = function hashInt() {
  27094. var hash = this.hash();
  27095. for (var i = 0; i < arguments.length; i++)
  27096. hash.update(arguments[i]);
  27097. return utils.intFromLE(hash.digest()).umod(this.curve.n);
  27098. };
  27099. EDDSA.prototype.keyFromPublic = function keyFromPublic(pub) {
  27100. return KeyPair.fromPublic(this, pub);
  27101. };
  27102. EDDSA.prototype.keyFromSecret = function keyFromSecret(secret) {
  27103. return KeyPair.fromSecret(this, secret);
  27104. };
  27105. EDDSA.prototype.makeSignature = function makeSignature(sig) {
  27106. if (sig instanceof Signature)
  27107. return sig;
  27108. return new Signature(this, sig);
  27109. };
  27110. /**
  27111. * * https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-03#section-5.2
  27112. *
  27113. * EDDSA defines methods for encoding and decoding points and integers. These are
  27114. * helper convenience methods, that pass along to utility functions implied
  27115. * parameters.
  27116. *
  27117. */
  27118. EDDSA.prototype.encodePoint = function encodePoint(point) {
  27119. var enc = point.getY().toArray('le', this.encodingLength);
  27120. enc[this.encodingLength - 1] |= point.getX().isOdd() ? 0x80 : 0;
  27121. return enc;
  27122. };
  27123. EDDSA.prototype.decodePoint = function decodePoint(bytes) {
  27124. bytes = utils.parseBytes(bytes);
  27125. var lastIx = bytes.length - 1;
  27126. var normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & ~0x80);
  27127. var xIsOdd = (bytes[lastIx] & 0x80) !== 0;
  27128. var y = utils.intFromLE(normed);
  27129. return this.curve.pointFromY(y, xIsOdd);
  27130. };
  27131. EDDSA.prototype.encodeInt = function encodeInt(num) {
  27132. return num.toArray('le', this.encodingLength);
  27133. };
  27134. EDDSA.prototype.decodeInt = function decodeInt(bytes) {
  27135. return utils.intFromLE(bytes);
  27136. };
  27137. EDDSA.prototype.isPoint = function isPoint(val) {
  27138. return val instanceof this.pointClass;
  27139. };
  27140. /***/ }),
  27141. /* 202 */
  27142. /*!*********************************************************!*\
  27143. !*** ./node_modules/elliptic/lib/elliptic/eddsa/key.js ***!
  27144. \*********************************************************/
  27145. /*! no static exports found */
  27146. /***/ (function(module, exports, __webpack_require__) {
  27147. "use strict";
  27148. var utils = __webpack_require__(/*! ../utils */ 176);
  27149. var assert = utils.assert;
  27150. var parseBytes = utils.parseBytes;
  27151. var cachedProperty = utils.cachedProperty;
  27152. /**
  27153. * @param {EDDSA} eddsa - instance
  27154. * @param {Object} params - public/private key parameters
  27155. *
  27156. * @param {Array<Byte>} [params.secret] - secret seed bytes
  27157. * @param {Point} [params.pub] - public key point (aka `A` in eddsa terms)
  27158. * @param {Array<Byte>} [params.pub] - public key point encoded as bytes
  27159. *
  27160. */
  27161. function KeyPair(eddsa, params) {
  27162. this.eddsa = eddsa;
  27163. this._secret = parseBytes(params.secret);
  27164. if (eddsa.isPoint(params.pub))
  27165. this._pub = params.pub;
  27166. else
  27167. this._pubBytes = parseBytes(params.pub);
  27168. }
  27169. KeyPair.fromPublic = function fromPublic(eddsa, pub) {
  27170. if (pub instanceof KeyPair)
  27171. return pub;
  27172. return new KeyPair(eddsa, { pub: pub });
  27173. };
  27174. KeyPair.fromSecret = function fromSecret(eddsa, secret) {
  27175. if (secret instanceof KeyPair)
  27176. return secret;
  27177. return new KeyPair(eddsa, { secret: secret });
  27178. };
  27179. KeyPair.prototype.secret = function secret() {
  27180. return this._secret;
  27181. };
  27182. cachedProperty(KeyPair, 'pubBytes', function pubBytes() {
  27183. return this.eddsa.encodePoint(this.pub());
  27184. });
  27185. cachedProperty(KeyPair, 'pub', function pub() {
  27186. if (this._pubBytes)
  27187. return this.eddsa.decodePoint(this._pubBytes);
  27188. return this.eddsa.g.mul(this.priv());
  27189. });
  27190. cachedProperty(KeyPair, 'privBytes', function privBytes() {
  27191. var eddsa = this.eddsa;
  27192. var hash = this.hash();
  27193. var lastIx = eddsa.encodingLength - 1;
  27194. var a = hash.slice(0, eddsa.encodingLength);
  27195. a[0] &= 248;
  27196. a[lastIx] &= 127;
  27197. a[lastIx] |= 64;
  27198. return a;
  27199. });
  27200. cachedProperty(KeyPair, 'priv', function priv() {
  27201. return this.eddsa.decodeInt(this.privBytes());
  27202. });
  27203. cachedProperty(KeyPair, 'hash', function hash() {
  27204. return this.eddsa.hash().update(this.secret()).digest();
  27205. });
  27206. cachedProperty(KeyPair, 'messagePrefix', function messagePrefix() {
  27207. return this.hash().slice(this.eddsa.encodingLength);
  27208. });
  27209. KeyPair.prototype.sign = function sign(message) {
  27210. assert(this._secret, 'KeyPair can only verify');
  27211. return this.eddsa.sign(message, this);
  27212. };
  27213. KeyPair.prototype.verify = function verify(message, sig) {
  27214. return this.eddsa.verify(message, sig, this);
  27215. };
  27216. KeyPair.prototype.getSecret = function getSecret(enc) {
  27217. assert(this._secret, 'KeyPair is public only');
  27218. return utils.encode(this.secret(), enc);
  27219. };
  27220. KeyPair.prototype.getPublic = function getPublic(enc) {
  27221. return utils.encode(this.pubBytes(), enc);
  27222. };
  27223. module.exports = KeyPair;
  27224. /***/ }),
  27225. /* 203 */
  27226. /*!***************************************************************!*\
  27227. !*** ./node_modules/elliptic/lib/elliptic/eddsa/signature.js ***!
  27228. \***************************************************************/
  27229. /*! no static exports found */
  27230. /***/ (function(module, exports, __webpack_require__) {
  27231. "use strict";
  27232. var BN = __webpack_require__(/*! bn.js */ 163);
  27233. var utils = __webpack_require__(/*! ../utils */ 176);
  27234. var assert = utils.assert;
  27235. var cachedProperty = utils.cachedProperty;
  27236. var parseBytes = utils.parseBytes;
  27237. /**
  27238. * @param {EDDSA} eddsa - eddsa instance
  27239. * @param {Array<Bytes>|Object} sig -
  27240. * @param {Array<Bytes>|Point} [sig.R] - R point as Point or bytes
  27241. * @param {Array<Bytes>|bn} [sig.S] - S scalar as bn or bytes
  27242. * @param {Array<Bytes>} [sig.Rencoded] - R point encoded
  27243. * @param {Array<Bytes>} [sig.Sencoded] - S scalar encoded
  27244. */
  27245. function Signature(eddsa, sig) {
  27246. this.eddsa = eddsa;
  27247. if (typeof sig !== 'object')
  27248. sig = parseBytes(sig);
  27249. if (Array.isArray(sig)) {
  27250. sig = {
  27251. R: sig.slice(0, eddsa.encodingLength),
  27252. S: sig.slice(eddsa.encodingLength)
  27253. };
  27254. }
  27255. assert(sig.R && sig.S, 'Signature without R or S');
  27256. if (eddsa.isPoint(sig.R))
  27257. this._R = sig.R;
  27258. if (sig.S instanceof BN)
  27259. this._S = sig.S;
  27260. this._Rencoded = Array.isArray(sig.R) ? sig.R : sig.Rencoded;
  27261. this._Sencoded = Array.isArray(sig.S) ? sig.S : sig.Sencoded;
  27262. }
  27263. cachedProperty(Signature, 'S', function S() {
  27264. return this.eddsa.decodeInt(this.Sencoded());
  27265. });
  27266. cachedProperty(Signature, 'R', function R() {
  27267. return this.eddsa.decodePoint(this.Rencoded());
  27268. });
  27269. cachedProperty(Signature, 'Rencoded', function Rencoded() {
  27270. return this.eddsa.encodePoint(this.R());
  27271. });
  27272. cachedProperty(Signature, 'Sencoded', function Sencoded() {
  27273. return this.eddsa.encodeInt(this.S());
  27274. });
  27275. Signature.prototype.toBytes = function toBytes() {
  27276. return this.Rencoded().concat(this.Sencoded());
  27277. };
  27278. Signature.prototype.toHex = function toHex() {
  27279. return utils.encode(this.toBytes(), 'hex').toUpperCase();
  27280. };
  27281. module.exports = Signature;
  27282. /***/ }),
  27283. /* 204 */
  27284. /*!******************************************!*\
  27285. !*** ./node_modules/parse-asn1/index.js ***!
  27286. \******************************************/
  27287. /*! no static exports found */
  27288. /***/ (function(module, exports, __webpack_require__) {
  27289. var asn1 = __webpack_require__(/*! ./asn1 */ 205)
  27290. var aesid = __webpack_require__(/*! ./aesid.json */ 222)
  27291. var fixProc = __webpack_require__(/*! ./fixProc */ 223)
  27292. var ciphers = __webpack_require__(/*! browserify-aes */ 141)
  27293. var compat = __webpack_require__(/*! pbkdf2 */ 126)
  27294. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  27295. module.exports = parseKeys
  27296. function parseKeys (buffer) {
  27297. var password
  27298. if (typeof buffer === 'object' && !Buffer.isBuffer(buffer)) {
  27299. password = buffer.passphrase
  27300. buffer = buffer.key
  27301. }
  27302. if (typeof buffer === 'string') {
  27303. buffer = Buffer.from(buffer)
  27304. }
  27305. var stripped = fixProc(buffer, password)
  27306. var type = stripped.tag
  27307. var data = stripped.data
  27308. var subtype, ndata
  27309. switch (type) {
  27310. case 'CERTIFICATE':
  27311. ndata = asn1.certificate.decode(data, 'der').tbsCertificate.subjectPublicKeyInfo
  27312. // falls through
  27313. case 'PUBLIC KEY':
  27314. if (!ndata) {
  27315. ndata = asn1.PublicKey.decode(data, 'der')
  27316. }
  27317. subtype = ndata.algorithm.algorithm.join('.')
  27318. switch (subtype) {
  27319. case '1.2.840.113549.1.1.1':
  27320. return asn1.RSAPublicKey.decode(ndata.subjectPublicKey.data, 'der')
  27321. case '1.2.840.10045.2.1':
  27322. ndata.subjectPrivateKey = ndata.subjectPublicKey
  27323. return {
  27324. type: 'ec',
  27325. data: ndata
  27326. }
  27327. case '1.2.840.10040.4.1':
  27328. ndata.algorithm.params.pub_key = asn1.DSAparam.decode(ndata.subjectPublicKey.data, 'der')
  27329. return {
  27330. type: 'dsa',
  27331. data: ndata.algorithm.params
  27332. }
  27333. default: throw new Error('unknown key id ' + subtype)
  27334. }
  27335. throw new Error('unknown key type ' + type)
  27336. case 'ENCRYPTED PRIVATE KEY':
  27337. data = asn1.EncryptedPrivateKey.decode(data, 'der')
  27338. data = decrypt(data, password)
  27339. // falls through
  27340. case 'PRIVATE KEY':
  27341. ndata = asn1.PrivateKey.decode(data, 'der')
  27342. subtype = ndata.algorithm.algorithm.join('.')
  27343. switch (subtype) {
  27344. case '1.2.840.113549.1.1.1':
  27345. return asn1.RSAPrivateKey.decode(ndata.subjectPrivateKey, 'der')
  27346. case '1.2.840.10045.2.1':
  27347. return {
  27348. curve: ndata.algorithm.curve,
  27349. privateKey: asn1.ECPrivateKey.decode(ndata.subjectPrivateKey, 'der').privateKey
  27350. }
  27351. case '1.2.840.10040.4.1':
  27352. ndata.algorithm.params.priv_key = asn1.DSAparam.decode(ndata.subjectPrivateKey, 'der')
  27353. return {
  27354. type: 'dsa',
  27355. params: ndata.algorithm.params
  27356. }
  27357. default: throw new Error('unknown key id ' + subtype)
  27358. }
  27359. throw new Error('unknown key type ' + type)
  27360. case 'RSA PUBLIC KEY':
  27361. return asn1.RSAPublicKey.decode(data, 'der')
  27362. case 'RSA PRIVATE KEY':
  27363. return asn1.RSAPrivateKey.decode(data, 'der')
  27364. case 'DSA PRIVATE KEY':
  27365. return {
  27366. type: 'dsa',
  27367. params: asn1.DSAPrivateKey.decode(data, 'der')
  27368. }
  27369. case 'EC PRIVATE KEY':
  27370. data = asn1.ECPrivateKey.decode(data, 'der')
  27371. return {
  27372. curve: data.parameters.value,
  27373. privateKey: data.privateKey
  27374. }
  27375. default: throw new Error('unknown key type ' + type)
  27376. }
  27377. }
  27378. parseKeys.signature = asn1.signature
  27379. function decrypt (data, password) {
  27380. var salt = data.algorithm.decrypt.kde.kdeparams.salt
  27381. var iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10)
  27382. var algo = aesid[data.algorithm.decrypt.cipher.algo.join('.')]
  27383. var iv = data.algorithm.decrypt.cipher.iv
  27384. var cipherText = data.subjectPrivateKey
  27385. var keylen = parseInt(algo.split('-')[1], 10) / 8
  27386. var key = compat.pbkdf2Sync(password, salt, iters, keylen, 'sha1')
  27387. var cipher = ciphers.createDecipheriv(algo, key, iv)
  27388. var out = []
  27389. out.push(cipher.update(cipherText))
  27390. out.push(cipher.final())
  27391. return Buffer.concat(out)
  27392. }
  27393. /***/ }),
  27394. /* 205 */
  27395. /*!*****************************************!*\
  27396. !*** ./node_modules/parse-asn1/asn1.js ***!
  27397. \*****************************************/
  27398. /*! no static exports found */
  27399. /***/ (function(module, exports, __webpack_require__) {
  27400. "use strict";
  27401. // from https://github.com/indutny/self-signed/blob/gh-pages/lib/asn1.js
  27402. // Fedor, you are amazing.
  27403. var asn1 = __webpack_require__(/*! asn1.js */ 206)
  27404. exports.certificate = __webpack_require__(/*! ./certificate */ 221)
  27405. var RSAPrivateKey = asn1.define('RSAPrivateKey', function () {
  27406. this.seq().obj(
  27407. this.key('version').int(),
  27408. this.key('modulus').int(),
  27409. this.key('publicExponent').int(),
  27410. this.key('privateExponent').int(),
  27411. this.key('prime1').int(),
  27412. this.key('prime2').int(),
  27413. this.key('exponent1').int(),
  27414. this.key('exponent2').int(),
  27415. this.key('coefficient').int()
  27416. )
  27417. })
  27418. exports.RSAPrivateKey = RSAPrivateKey
  27419. var RSAPublicKey = asn1.define('RSAPublicKey', function () {
  27420. this.seq().obj(
  27421. this.key('modulus').int(),
  27422. this.key('publicExponent').int()
  27423. )
  27424. })
  27425. exports.RSAPublicKey = RSAPublicKey
  27426. var PublicKey = asn1.define('SubjectPublicKeyInfo', function () {
  27427. this.seq().obj(
  27428. this.key('algorithm').use(AlgorithmIdentifier),
  27429. this.key('subjectPublicKey').bitstr()
  27430. )
  27431. })
  27432. exports.PublicKey = PublicKey
  27433. var AlgorithmIdentifier = asn1.define('AlgorithmIdentifier', function () {
  27434. this.seq().obj(
  27435. this.key('algorithm').objid(),
  27436. this.key('none').null_().optional(),
  27437. this.key('curve').objid().optional(),
  27438. this.key('params').seq().obj(
  27439. this.key('p').int(),
  27440. this.key('q').int(),
  27441. this.key('g').int()
  27442. ).optional()
  27443. )
  27444. })
  27445. var PrivateKeyInfo = asn1.define('PrivateKeyInfo', function () {
  27446. this.seq().obj(
  27447. this.key('version').int(),
  27448. this.key('algorithm').use(AlgorithmIdentifier),
  27449. this.key('subjectPrivateKey').octstr()
  27450. )
  27451. })
  27452. exports.PrivateKey = PrivateKeyInfo
  27453. var EncryptedPrivateKeyInfo = asn1.define('EncryptedPrivateKeyInfo', function () {
  27454. this.seq().obj(
  27455. this.key('algorithm').seq().obj(
  27456. this.key('id').objid(),
  27457. this.key('decrypt').seq().obj(
  27458. this.key('kde').seq().obj(
  27459. this.key('id').objid(),
  27460. this.key('kdeparams').seq().obj(
  27461. this.key('salt').octstr(),
  27462. this.key('iters').int()
  27463. )
  27464. ),
  27465. this.key('cipher').seq().obj(
  27466. this.key('algo').objid(),
  27467. this.key('iv').octstr()
  27468. )
  27469. )
  27470. ),
  27471. this.key('subjectPrivateKey').octstr()
  27472. )
  27473. })
  27474. exports.EncryptedPrivateKey = EncryptedPrivateKeyInfo
  27475. var DSAPrivateKey = asn1.define('DSAPrivateKey', function () {
  27476. this.seq().obj(
  27477. this.key('version').int(),
  27478. this.key('p').int(),
  27479. this.key('q').int(),
  27480. this.key('g').int(),
  27481. this.key('pub_key').int(),
  27482. this.key('priv_key').int()
  27483. )
  27484. })
  27485. exports.DSAPrivateKey = DSAPrivateKey
  27486. exports.DSAparam = asn1.define('DSAparam', function () {
  27487. this.int()
  27488. })
  27489. var ECPrivateKey = asn1.define('ECPrivateKey', function () {
  27490. this.seq().obj(
  27491. this.key('version').int(),
  27492. this.key('privateKey').octstr(),
  27493. this.key('parameters').optional().explicit(0).use(ECParameters),
  27494. this.key('publicKey').optional().explicit(1).bitstr()
  27495. )
  27496. })
  27497. exports.ECPrivateKey = ECPrivateKey
  27498. var ECParameters = asn1.define('ECParameters', function () {
  27499. this.choice({
  27500. namedCurve: this.objid()
  27501. })
  27502. })
  27503. exports.signature = asn1.define('signature', function () {
  27504. this.seq().obj(
  27505. this.key('r').int(),
  27506. this.key('s').int()
  27507. )
  27508. })
  27509. /***/ }),
  27510. /* 206 */
  27511. /*!******************************************!*\
  27512. !*** ./node_modules/asn1.js/lib/asn1.js ***!
  27513. \******************************************/
  27514. /*! no static exports found */
  27515. /***/ (function(module, exports, __webpack_require__) {
  27516. var asn1 = exports;
  27517. asn1.bignum = __webpack_require__(/*! bn.js */ 163);
  27518. asn1.define = __webpack_require__(/*! ./asn1/api */ 207).define;
  27519. asn1.base = __webpack_require__(/*! ./asn1/base */ 209);
  27520. asn1.constants = __webpack_require__(/*! ./asn1/constants */ 213);
  27521. asn1.decoders = __webpack_require__(/*! ./asn1/decoders */ 215);
  27522. asn1.encoders = __webpack_require__(/*! ./asn1/encoders */ 218);
  27523. /***/ }),
  27524. /* 207 */
  27525. /*!**********************************************!*\
  27526. !*** ./node_modules/asn1.js/lib/asn1/api.js ***!
  27527. \**********************************************/
  27528. /*! no static exports found */
  27529. /***/ (function(module, exports, __webpack_require__) {
  27530. var asn1 = __webpack_require__(/*! ../asn1 */ 206);
  27531. var inherits = __webpack_require__(/*! inherits */ 87);
  27532. var api = exports;
  27533. api.define = function define(name, body) {
  27534. return new Entity(name, body);
  27535. };
  27536. function Entity(name, body) {
  27537. this.name = name;
  27538. this.body = body;
  27539. this.decoders = {};
  27540. this.encoders = {};
  27541. };
  27542. Entity.prototype._createNamed = function createNamed(base) {
  27543. var named;
  27544. try {
  27545. named = __webpack_require__(/*! vm */ 208).runInThisContext(
  27546. '(function ' + this.name + '(entity) {\n' +
  27547. ' this._initNamed(entity);\n' +
  27548. '})'
  27549. );
  27550. } catch (e) {
  27551. named = function (entity) {
  27552. this._initNamed(entity);
  27553. };
  27554. }
  27555. inherits(named, base);
  27556. named.prototype._initNamed = function initnamed(entity) {
  27557. base.call(this, entity);
  27558. };
  27559. return new named(this);
  27560. };
  27561. Entity.prototype._getDecoder = function _getDecoder(enc) {
  27562. enc = enc || 'der';
  27563. // Lazily create decoder
  27564. if (!this.decoders.hasOwnProperty(enc))
  27565. this.decoders[enc] = this._createNamed(asn1.decoders[enc]);
  27566. return this.decoders[enc];
  27567. };
  27568. Entity.prototype.decode = function decode(data, enc, options) {
  27569. return this._getDecoder(enc).decode(data, options);
  27570. };
  27571. Entity.prototype._getEncoder = function _getEncoder(enc) {
  27572. enc = enc || 'der';
  27573. // Lazily create encoder
  27574. if (!this.encoders.hasOwnProperty(enc))
  27575. this.encoders[enc] = this._createNamed(asn1.encoders[enc]);
  27576. return this.encoders[enc];
  27577. };
  27578. Entity.prototype.encode = function encode(data, enc, /* internal */ reporter) {
  27579. return this._getEncoder(enc).encode(data, reporter);
  27580. };
  27581. /***/ }),
  27582. /* 208 */
  27583. /*!*********************************************!*\
  27584. !*** ./node_modules/vm-browserify/index.js ***!
  27585. \*********************************************/
  27586. /*! no static exports found */
  27587. /***/ (function(module, exports) {
  27588. var indexOf = function (xs, item) {
  27589. if (xs.indexOf) return xs.indexOf(item);
  27590. else for (var i = 0; i < xs.length; i++) {
  27591. if (xs[i] === item) return i;
  27592. }
  27593. return -1;
  27594. };
  27595. var Object_keys = function (obj) {
  27596. if (Object.keys) return Object.keys(obj)
  27597. else {
  27598. var res = [];
  27599. for (var key in obj) res.push(key)
  27600. return res;
  27601. }
  27602. };
  27603. var forEach = function (xs, fn) {
  27604. if (xs.forEach) return xs.forEach(fn)
  27605. else for (var i = 0; i < xs.length; i++) {
  27606. fn(xs[i], i, xs);
  27607. }
  27608. };
  27609. var defineProp = (function() {
  27610. try {
  27611. Object.defineProperty({}, '_', {});
  27612. return function(obj, name, value) {
  27613. Object.defineProperty(obj, name, {
  27614. writable: true,
  27615. enumerable: false,
  27616. configurable: true,
  27617. value: value
  27618. })
  27619. };
  27620. } catch(e) {
  27621. return function(obj, name, value) {
  27622. obj[name] = value;
  27623. };
  27624. }
  27625. }());
  27626. var globals = ['Array', 'Boolean', 'Date', 'Error', 'EvalError', 'Function',
  27627. 'Infinity', 'JSON', 'Math', 'NaN', 'Number', 'Object', 'RangeError',
  27628. 'ReferenceError', 'RegExp', 'String', 'SyntaxError', 'TypeError', 'URIError',
  27629. 'decodeURI', 'decodeURIComponent', 'encodeURI', 'encodeURIComponent', 'escape',
  27630. 'eval', 'isFinite', 'isNaN', 'parseFloat', 'parseInt', 'undefined', 'unescape'];
  27631. function Context() {}
  27632. Context.prototype = {};
  27633. var Script = exports.Script = function NodeScript (code) {
  27634. if (!(this instanceof Script)) return new Script(code);
  27635. this.code = code;
  27636. };
  27637. Script.prototype.runInContext = function (context) {
  27638. if (!(context instanceof Context)) {
  27639. throw new TypeError("needs a 'context' argument.");
  27640. }
  27641. var iframe = document.createElement('iframe');
  27642. if (!iframe.style) iframe.style = {};
  27643. iframe.style.display = 'none';
  27644. document.body.appendChild(iframe);
  27645. var win = iframe.contentWindow;
  27646. var wEval = win.eval, wExecScript = win.execScript;
  27647. if (!wEval && wExecScript) {
  27648. // win.eval() magically appears when this is called in IE:
  27649. wExecScript.call(win, 'null');
  27650. wEval = win.eval;
  27651. }
  27652. forEach(Object_keys(context), function (key) {
  27653. win[key] = context[key];
  27654. });
  27655. forEach(globals, function (key) {
  27656. if (context[key]) {
  27657. win[key] = context[key];
  27658. }
  27659. });
  27660. var winKeys = Object_keys(win);
  27661. var res = wEval.call(win, this.code);
  27662. forEach(Object_keys(win), function (key) {
  27663. // Avoid copying circular objects like `top` and `window` by only
  27664. // updating existing context properties or new properties in the `win`
  27665. // that was only introduced after the eval.
  27666. if (key in context || indexOf(winKeys, key) === -1) {
  27667. context[key] = win[key];
  27668. }
  27669. });
  27670. forEach(globals, function (key) {
  27671. if (!(key in context)) {
  27672. defineProp(context, key, win[key]);
  27673. }
  27674. });
  27675. document.body.removeChild(iframe);
  27676. return res;
  27677. };
  27678. Script.prototype.runInThisContext = function () {
  27679. return eval(this.code); // maybe...
  27680. };
  27681. Script.prototype.runInNewContext = function (context) {
  27682. var ctx = Script.createContext(context);
  27683. var res = this.runInContext(ctx);
  27684. if (context) {
  27685. forEach(Object_keys(ctx), function (key) {
  27686. context[key] = ctx[key];
  27687. });
  27688. }
  27689. return res;
  27690. };
  27691. forEach(Object_keys(Script.prototype), function (name) {
  27692. exports[name] = Script[name] = function (code) {
  27693. var s = Script(code);
  27694. return s[name].apply(s, [].slice.call(arguments, 1));
  27695. };
  27696. });
  27697. exports.isContext = function (context) {
  27698. return context instanceof Context;
  27699. };
  27700. exports.createScript = function (code) {
  27701. return exports.Script(code);
  27702. };
  27703. exports.createContext = Script.createContext = function (context) {
  27704. var copy = new Context();
  27705. if(typeof context === 'object') {
  27706. forEach(Object_keys(context), function (key) {
  27707. copy[key] = context[key];
  27708. });
  27709. }
  27710. return copy;
  27711. };
  27712. /***/ }),
  27713. /* 209 */
  27714. /*!*****************************************************!*\
  27715. !*** ./node_modules/asn1.js/lib/asn1/base/index.js ***!
  27716. \*****************************************************/
  27717. /*! no static exports found */
  27718. /***/ (function(module, exports, __webpack_require__) {
  27719. var base = exports;
  27720. base.Reporter = __webpack_require__(/*! ./reporter */ 210).Reporter;
  27721. base.DecoderBuffer = __webpack_require__(/*! ./buffer */ 211).DecoderBuffer;
  27722. base.EncoderBuffer = __webpack_require__(/*! ./buffer */ 211).EncoderBuffer;
  27723. base.Node = __webpack_require__(/*! ./node */ 212);
  27724. /***/ }),
  27725. /* 210 */
  27726. /*!********************************************************!*\
  27727. !*** ./node_modules/asn1.js/lib/asn1/base/reporter.js ***!
  27728. \********************************************************/
  27729. /*! no static exports found */
  27730. /***/ (function(module, exports, __webpack_require__) {
  27731. var inherits = __webpack_require__(/*! inherits */ 87);
  27732. function Reporter(options) {
  27733. this._reporterState = {
  27734. obj: null,
  27735. path: [],
  27736. options: options || {},
  27737. errors: []
  27738. };
  27739. }
  27740. exports.Reporter = Reporter;
  27741. Reporter.prototype.isError = function isError(obj) {
  27742. return obj instanceof ReporterError;
  27743. };
  27744. Reporter.prototype.save = function save() {
  27745. var state = this._reporterState;
  27746. return { obj: state.obj, pathLen: state.path.length };
  27747. };
  27748. Reporter.prototype.restore = function restore(data) {
  27749. var state = this._reporterState;
  27750. state.obj = data.obj;
  27751. state.path = state.path.slice(0, data.pathLen);
  27752. };
  27753. Reporter.prototype.enterKey = function enterKey(key) {
  27754. return this._reporterState.path.push(key);
  27755. };
  27756. Reporter.prototype.exitKey = function exitKey(index) {
  27757. var state = this._reporterState;
  27758. state.path = state.path.slice(0, index - 1);
  27759. };
  27760. Reporter.prototype.leaveKey = function leaveKey(index, key, value) {
  27761. var state = this._reporterState;
  27762. this.exitKey(index);
  27763. if (state.obj !== null)
  27764. state.obj[key] = value;
  27765. };
  27766. Reporter.prototype.path = function path() {
  27767. return this._reporterState.path.join('/');
  27768. };
  27769. Reporter.prototype.enterObject = function enterObject() {
  27770. var state = this._reporterState;
  27771. var prev = state.obj;
  27772. state.obj = {};
  27773. return prev;
  27774. };
  27775. Reporter.prototype.leaveObject = function leaveObject(prev) {
  27776. var state = this._reporterState;
  27777. var now = state.obj;
  27778. state.obj = prev;
  27779. return now;
  27780. };
  27781. Reporter.prototype.error = function error(msg) {
  27782. var err;
  27783. var state = this._reporterState;
  27784. var inherited = msg instanceof ReporterError;
  27785. if (inherited) {
  27786. err = msg;
  27787. } else {
  27788. err = new ReporterError(state.path.map(function(elem) {
  27789. return '[' + JSON.stringify(elem) + ']';
  27790. }).join(''), msg.message || msg, msg.stack);
  27791. }
  27792. if (!state.options.partial)
  27793. throw err;
  27794. if (!inherited)
  27795. state.errors.push(err);
  27796. return err;
  27797. };
  27798. Reporter.prototype.wrapResult = function wrapResult(result) {
  27799. var state = this._reporterState;
  27800. if (!state.options.partial)
  27801. return result;
  27802. return {
  27803. result: this.isError(result) ? null : result,
  27804. errors: state.errors
  27805. };
  27806. };
  27807. function ReporterError(path, msg) {
  27808. this.path = path;
  27809. this.rethrow(msg);
  27810. };
  27811. inherits(ReporterError, Error);
  27812. ReporterError.prototype.rethrow = function rethrow(msg) {
  27813. this.message = msg + ' at: ' + (this.path || '(shallow)');
  27814. if (Error.captureStackTrace)
  27815. Error.captureStackTrace(this, ReporterError);
  27816. if (!this.stack) {
  27817. try {
  27818. // IE only adds stack when thrown
  27819. throw new Error(this.message);
  27820. } catch (e) {
  27821. this.stack = e.stack;
  27822. }
  27823. }
  27824. return this;
  27825. };
  27826. /***/ }),
  27827. /* 211 */
  27828. /*!******************************************************!*\
  27829. !*** ./node_modules/asn1.js/lib/asn1/base/buffer.js ***!
  27830. \******************************************************/
  27831. /*! no static exports found */
  27832. /***/ (function(module, exports, __webpack_require__) {
  27833. var inherits = __webpack_require__(/*! inherits */ 87);
  27834. var Reporter = __webpack_require__(/*! ../base */ 209).Reporter;
  27835. var Buffer = __webpack_require__(/*! buffer */ 82).Buffer;
  27836. function DecoderBuffer(base, options) {
  27837. Reporter.call(this, options);
  27838. if (!Buffer.isBuffer(base)) {
  27839. this.error('Input not Buffer');
  27840. return;
  27841. }
  27842. this.base = base;
  27843. this.offset = 0;
  27844. this.length = base.length;
  27845. }
  27846. inherits(DecoderBuffer, Reporter);
  27847. exports.DecoderBuffer = DecoderBuffer;
  27848. DecoderBuffer.prototype.save = function save() {
  27849. return { offset: this.offset, reporter: Reporter.prototype.save.call(this) };
  27850. };
  27851. DecoderBuffer.prototype.restore = function restore(save) {
  27852. // Return skipped data
  27853. var res = new DecoderBuffer(this.base);
  27854. res.offset = save.offset;
  27855. res.length = this.offset;
  27856. this.offset = save.offset;
  27857. Reporter.prototype.restore.call(this, save.reporter);
  27858. return res;
  27859. };
  27860. DecoderBuffer.prototype.isEmpty = function isEmpty() {
  27861. return this.offset === this.length;
  27862. };
  27863. DecoderBuffer.prototype.readUInt8 = function readUInt8(fail) {
  27864. if (this.offset + 1 <= this.length)
  27865. return this.base.readUInt8(this.offset++, true);
  27866. else
  27867. return this.error(fail || 'DecoderBuffer overrun');
  27868. }
  27869. DecoderBuffer.prototype.skip = function skip(bytes, fail) {
  27870. if (!(this.offset + bytes <= this.length))
  27871. return this.error(fail || 'DecoderBuffer overrun');
  27872. var res = new DecoderBuffer(this.base);
  27873. // Share reporter state
  27874. res._reporterState = this._reporterState;
  27875. res.offset = this.offset;
  27876. res.length = this.offset + bytes;
  27877. this.offset += bytes;
  27878. return res;
  27879. }
  27880. DecoderBuffer.prototype.raw = function raw(save) {
  27881. return this.base.slice(save ? save.offset : this.offset, this.length);
  27882. }
  27883. function EncoderBuffer(value, reporter) {
  27884. if (Array.isArray(value)) {
  27885. this.length = 0;
  27886. this.value = value.map(function(item) {
  27887. if (!(item instanceof EncoderBuffer))
  27888. item = new EncoderBuffer(item, reporter);
  27889. this.length += item.length;
  27890. return item;
  27891. }, this);
  27892. } else if (typeof value === 'number') {
  27893. if (!(0 <= value && value <= 0xff))
  27894. return reporter.error('non-byte EncoderBuffer value');
  27895. this.value = value;
  27896. this.length = 1;
  27897. } else if (typeof value === 'string') {
  27898. this.value = value;
  27899. this.length = Buffer.byteLength(value);
  27900. } else if (Buffer.isBuffer(value)) {
  27901. this.value = value;
  27902. this.length = value.length;
  27903. } else {
  27904. return reporter.error('Unsupported type: ' + typeof value);
  27905. }
  27906. }
  27907. exports.EncoderBuffer = EncoderBuffer;
  27908. EncoderBuffer.prototype.join = function join(out, offset) {
  27909. if (!out)
  27910. out = new Buffer(this.length);
  27911. if (!offset)
  27912. offset = 0;
  27913. if (this.length === 0)
  27914. return out;
  27915. if (Array.isArray(this.value)) {
  27916. this.value.forEach(function(item) {
  27917. item.join(out, offset);
  27918. offset += item.length;
  27919. });
  27920. } else {
  27921. if (typeof this.value === 'number')
  27922. out[offset] = this.value;
  27923. else if (typeof this.value === 'string')
  27924. out.write(this.value, offset);
  27925. else if (Buffer.isBuffer(this.value))
  27926. this.value.copy(out, offset);
  27927. offset += this.length;
  27928. }
  27929. return out;
  27930. };
  27931. /***/ }),
  27932. /* 212 */
  27933. /*!****************************************************!*\
  27934. !*** ./node_modules/asn1.js/lib/asn1/base/node.js ***!
  27935. \****************************************************/
  27936. /*! no static exports found */
  27937. /***/ (function(module, exports, __webpack_require__) {
  27938. var Reporter = __webpack_require__(/*! ../base */ 209).Reporter;
  27939. var EncoderBuffer = __webpack_require__(/*! ../base */ 209).EncoderBuffer;
  27940. var DecoderBuffer = __webpack_require__(/*! ../base */ 209).DecoderBuffer;
  27941. var assert = __webpack_require__(/*! minimalistic-assert */ 137);
  27942. // Supported tags
  27943. var tags = [
  27944. 'seq', 'seqof', 'set', 'setof', 'objid', 'bool',
  27945. 'gentime', 'utctime', 'null_', 'enum', 'int', 'objDesc',
  27946. 'bitstr', 'bmpstr', 'charstr', 'genstr', 'graphstr', 'ia5str', 'iso646str',
  27947. 'numstr', 'octstr', 'printstr', 't61str', 'unistr', 'utf8str', 'videostr'
  27948. ];
  27949. // Public methods list
  27950. var methods = [
  27951. 'key', 'obj', 'use', 'optional', 'explicit', 'implicit', 'def', 'choice',
  27952. 'any', 'contains'
  27953. ].concat(tags);
  27954. // Overrided methods list
  27955. var overrided = [
  27956. '_peekTag', '_decodeTag', '_use',
  27957. '_decodeStr', '_decodeObjid', '_decodeTime',
  27958. '_decodeNull', '_decodeInt', '_decodeBool', '_decodeList',
  27959. '_encodeComposite', '_encodeStr', '_encodeObjid', '_encodeTime',
  27960. '_encodeNull', '_encodeInt', '_encodeBool'
  27961. ];
  27962. function Node(enc, parent) {
  27963. var state = {};
  27964. this._baseState = state;
  27965. state.enc = enc;
  27966. state.parent = parent || null;
  27967. state.children = null;
  27968. // State
  27969. state.tag = null;
  27970. state.args = null;
  27971. state.reverseArgs = null;
  27972. state.choice = null;
  27973. state.optional = false;
  27974. state.any = false;
  27975. state.obj = false;
  27976. state.use = null;
  27977. state.useDecoder = null;
  27978. state.key = null;
  27979. state['default'] = null;
  27980. state.explicit = null;
  27981. state.implicit = null;
  27982. state.contains = null;
  27983. // Should create new instance on each method
  27984. if (!state.parent) {
  27985. state.children = [];
  27986. this._wrap();
  27987. }
  27988. }
  27989. module.exports = Node;
  27990. var stateProps = [
  27991. 'enc', 'parent', 'children', 'tag', 'args', 'reverseArgs', 'choice',
  27992. 'optional', 'any', 'obj', 'use', 'alteredUse', 'key', 'default', 'explicit',
  27993. 'implicit', 'contains'
  27994. ];
  27995. Node.prototype.clone = function clone() {
  27996. var state = this._baseState;
  27997. var cstate = {};
  27998. stateProps.forEach(function(prop) {
  27999. cstate[prop] = state[prop];
  28000. });
  28001. var res = new this.constructor(cstate.parent);
  28002. res._baseState = cstate;
  28003. return res;
  28004. };
  28005. Node.prototype._wrap = function wrap() {
  28006. var state = this._baseState;
  28007. methods.forEach(function(method) {
  28008. this[method] = function _wrappedMethod() {
  28009. var clone = new this.constructor(this);
  28010. state.children.push(clone);
  28011. return clone[method].apply(clone, arguments);
  28012. };
  28013. }, this);
  28014. };
  28015. Node.prototype._init = function init(body) {
  28016. var state = this._baseState;
  28017. assert(state.parent === null);
  28018. body.call(this);
  28019. // Filter children
  28020. state.children = state.children.filter(function(child) {
  28021. return child._baseState.parent === this;
  28022. }, this);
  28023. assert.equal(state.children.length, 1, 'Root node can have only one child');
  28024. };
  28025. Node.prototype._useArgs = function useArgs(args) {
  28026. var state = this._baseState;
  28027. // Filter children and args
  28028. var children = args.filter(function(arg) {
  28029. return arg instanceof this.constructor;
  28030. }, this);
  28031. args = args.filter(function(arg) {
  28032. return !(arg instanceof this.constructor);
  28033. }, this);
  28034. if (children.length !== 0) {
  28035. assert(state.children === null);
  28036. state.children = children;
  28037. // Replace parent to maintain backward link
  28038. children.forEach(function(child) {
  28039. child._baseState.parent = this;
  28040. }, this);
  28041. }
  28042. if (args.length !== 0) {
  28043. assert(state.args === null);
  28044. state.args = args;
  28045. state.reverseArgs = args.map(function(arg) {
  28046. if (typeof arg !== 'object' || arg.constructor !== Object)
  28047. return arg;
  28048. var res = {};
  28049. Object.keys(arg).forEach(function(key) {
  28050. if (key == (key | 0))
  28051. key |= 0;
  28052. var value = arg[key];
  28053. res[value] = key;
  28054. });
  28055. return res;
  28056. });
  28057. }
  28058. };
  28059. //
  28060. // Overrided methods
  28061. //
  28062. overrided.forEach(function(method) {
  28063. Node.prototype[method] = function _overrided() {
  28064. var state = this._baseState;
  28065. throw new Error(method + ' not implemented for encoding: ' + state.enc);
  28066. };
  28067. });
  28068. //
  28069. // Public methods
  28070. //
  28071. tags.forEach(function(tag) {
  28072. Node.prototype[tag] = function _tagMethod() {
  28073. var state = this._baseState;
  28074. var args = Array.prototype.slice.call(arguments);
  28075. assert(state.tag === null);
  28076. state.tag = tag;
  28077. this._useArgs(args);
  28078. return this;
  28079. };
  28080. });
  28081. Node.prototype.use = function use(item) {
  28082. assert(item);
  28083. var state = this._baseState;
  28084. assert(state.use === null);
  28085. state.use = item;
  28086. return this;
  28087. };
  28088. Node.prototype.optional = function optional() {
  28089. var state = this._baseState;
  28090. state.optional = true;
  28091. return this;
  28092. };
  28093. Node.prototype.def = function def(val) {
  28094. var state = this._baseState;
  28095. assert(state['default'] === null);
  28096. state['default'] = val;
  28097. state.optional = true;
  28098. return this;
  28099. };
  28100. Node.prototype.explicit = function explicit(num) {
  28101. var state = this._baseState;
  28102. assert(state.explicit === null && state.implicit === null);
  28103. state.explicit = num;
  28104. return this;
  28105. };
  28106. Node.prototype.implicit = function implicit(num) {
  28107. var state = this._baseState;
  28108. assert(state.explicit === null && state.implicit === null);
  28109. state.implicit = num;
  28110. return this;
  28111. };
  28112. Node.prototype.obj = function obj() {
  28113. var state = this._baseState;
  28114. var args = Array.prototype.slice.call(arguments);
  28115. state.obj = true;
  28116. if (args.length !== 0)
  28117. this._useArgs(args);
  28118. return this;
  28119. };
  28120. Node.prototype.key = function key(newKey) {
  28121. var state = this._baseState;
  28122. assert(state.key === null);
  28123. state.key = newKey;
  28124. return this;
  28125. };
  28126. Node.prototype.any = function any() {
  28127. var state = this._baseState;
  28128. state.any = true;
  28129. return this;
  28130. };
  28131. Node.prototype.choice = function choice(obj) {
  28132. var state = this._baseState;
  28133. assert(state.choice === null);
  28134. state.choice = obj;
  28135. this._useArgs(Object.keys(obj).map(function(key) {
  28136. return obj[key];
  28137. }));
  28138. return this;
  28139. };
  28140. Node.prototype.contains = function contains(item) {
  28141. var state = this._baseState;
  28142. assert(state.use === null);
  28143. state.contains = item;
  28144. return this;
  28145. };
  28146. //
  28147. // Decoding
  28148. //
  28149. Node.prototype._decode = function decode(input, options) {
  28150. var state = this._baseState;
  28151. // Decode root node
  28152. if (state.parent === null)
  28153. return input.wrapResult(state.children[0]._decode(input, options));
  28154. var result = state['default'];
  28155. var present = true;
  28156. var prevKey = null;
  28157. if (state.key !== null)
  28158. prevKey = input.enterKey(state.key);
  28159. // Check if tag is there
  28160. if (state.optional) {
  28161. var tag = null;
  28162. if (state.explicit !== null)
  28163. tag = state.explicit;
  28164. else if (state.implicit !== null)
  28165. tag = state.implicit;
  28166. else if (state.tag !== null)
  28167. tag = state.tag;
  28168. if (tag === null && !state.any) {
  28169. // Trial and Error
  28170. var save = input.save();
  28171. try {
  28172. if (state.choice === null)
  28173. this._decodeGeneric(state.tag, input, options);
  28174. else
  28175. this._decodeChoice(input, options);
  28176. present = true;
  28177. } catch (e) {
  28178. present = false;
  28179. }
  28180. input.restore(save);
  28181. } else {
  28182. present = this._peekTag(input, tag, state.any);
  28183. if (input.isError(present))
  28184. return present;
  28185. }
  28186. }
  28187. // Push object on stack
  28188. var prevObj;
  28189. if (state.obj && present)
  28190. prevObj = input.enterObject();
  28191. if (present) {
  28192. // Unwrap explicit values
  28193. if (state.explicit !== null) {
  28194. var explicit = this._decodeTag(input, state.explicit);
  28195. if (input.isError(explicit))
  28196. return explicit;
  28197. input = explicit;
  28198. }
  28199. var start = input.offset;
  28200. // Unwrap implicit and normal values
  28201. if (state.use === null && state.choice === null) {
  28202. if (state.any)
  28203. var save = input.save();
  28204. var body = this._decodeTag(
  28205. input,
  28206. state.implicit !== null ? state.implicit : state.tag,
  28207. state.any
  28208. );
  28209. if (input.isError(body))
  28210. return body;
  28211. if (state.any)
  28212. result = input.raw(save);
  28213. else
  28214. input = body;
  28215. }
  28216. if (options && options.track && state.tag !== null)
  28217. options.track(input.path(), start, input.length, 'tagged');
  28218. if (options && options.track && state.tag !== null)
  28219. options.track(input.path(), input.offset, input.length, 'content');
  28220. // Select proper method for tag
  28221. if (state.any)
  28222. result = result;
  28223. else if (state.choice === null)
  28224. result = this._decodeGeneric(state.tag, input, options);
  28225. else
  28226. result = this._decodeChoice(input, options);
  28227. if (input.isError(result))
  28228. return result;
  28229. // Decode children
  28230. if (!state.any && state.choice === null && state.children !== null) {
  28231. state.children.forEach(function decodeChildren(child) {
  28232. // NOTE: We are ignoring errors here, to let parser continue with other
  28233. // parts of encoded data
  28234. child._decode(input, options);
  28235. });
  28236. }
  28237. // Decode contained/encoded by schema, only in bit or octet strings
  28238. if (state.contains && (state.tag === 'octstr' || state.tag === 'bitstr')) {
  28239. var data = new DecoderBuffer(result);
  28240. result = this._getUse(state.contains, input._reporterState.obj)
  28241. ._decode(data, options);
  28242. }
  28243. }
  28244. // Pop object
  28245. if (state.obj && present)
  28246. result = input.leaveObject(prevObj);
  28247. // Set key
  28248. if (state.key !== null && (result !== null || present === true))
  28249. input.leaveKey(prevKey, state.key, result);
  28250. else if (prevKey !== null)
  28251. input.exitKey(prevKey);
  28252. return result;
  28253. };
  28254. Node.prototype._decodeGeneric = function decodeGeneric(tag, input, options) {
  28255. var state = this._baseState;
  28256. if (tag === 'seq' || tag === 'set')
  28257. return null;
  28258. if (tag === 'seqof' || tag === 'setof')
  28259. return this._decodeList(input, tag, state.args[0], options);
  28260. else if (/str$/.test(tag))
  28261. return this._decodeStr(input, tag, options);
  28262. else if (tag === 'objid' && state.args)
  28263. return this._decodeObjid(input, state.args[0], state.args[1], options);
  28264. else if (tag === 'objid')
  28265. return this._decodeObjid(input, null, null, options);
  28266. else if (tag === 'gentime' || tag === 'utctime')
  28267. return this._decodeTime(input, tag, options);
  28268. else if (tag === 'null_')
  28269. return this._decodeNull(input, options);
  28270. else if (tag === 'bool')
  28271. return this._decodeBool(input, options);
  28272. else if (tag === 'objDesc')
  28273. return this._decodeStr(input, tag, options);
  28274. else if (tag === 'int' || tag === 'enum')
  28275. return this._decodeInt(input, state.args && state.args[0], options);
  28276. if (state.use !== null) {
  28277. return this._getUse(state.use, input._reporterState.obj)
  28278. ._decode(input, options);
  28279. } else {
  28280. return input.error('unknown tag: ' + tag);
  28281. }
  28282. };
  28283. Node.prototype._getUse = function _getUse(entity, obj) {
  28284. var state = this._baseState;
  28285. // Create altered use decoder if implicit is set
  28286. state.useDecoder = this._use(entity, obj);
  28287. assert(state.useDecoder._baseState.parent === null);
  28288. state.useDecoder = state.useDecoder._baseState.children[0];
  28289. if (state.implicit !== state.useDecoder._baseState.implicit) {
  28290. state.useDecoder = state.useDecoder.clone();
  28291. state.useDecoder._baseState.implicit = state.implicit;
  28292. }
  28293. return state.useDecoder;
  28294. };
  28295. Node.prototype._decodeChoice = function decodeChoice(input, options) {
  28296. var state = this._baseState;
  28297. var result = null;
  28298. var match = false;
  28299. Object.keys(state.choice).some(function(key) {
  28300. var save = input.save();
  28301. var node = state.choice[key];
  28302. try {
  28303. var value = node._decode(input, options);
  28304. if (input.isError(value))
  28305. return false;
  28306. result = { type: key, value: value };
  28307. match = true;
  28308. } catch (e) {
  28309. input.restore(save);
  28310. return false;
  28311. }
  28312. return true;
  28313. }, this);
  28314. if (!match)
  28315. return input.error('Choice not matched');
  28316. return result;
  28317. };
  28318. //
  28319. // Encoding
  28320. //
  28321. Node.prototype._createEncoderBuffer = function createEncoderBuffer(data) {
  28322. return new EncoderBuffer(data, this.reporter);
  28323. };
  28324. Node.prototype._encode = function encode(data, reporter, parent) {
  28325. var state = this._baseState;
  28326. if (state['default'] !== null && state['default'] === data)
  28327. return;
  28328. var result = this._encodeValue(data, reporter, parent);
  28329. if (result === undefined)
  28330. return;
  28331. if (this._skipDefault(result, reporter, parent))
  28332. return;
  28333. return result;
  28334. };
  28335. Node.prototype._encodeValue = function encode(data, reporter, parent) {
  28336. var state = this._baseState;
  28337. // Decode root node
  28338. if (state.parent === null)
  28339. return state.children[0]._encode(data, reporter || new Reporter());
  28340. var result = null;
  28341. // Set reporter to share it with a child class
  28342. this.reporter = reporter;
  28343. // Check if data is there
  28344. if (state.optional && data === undefined) {
  28345. if (state['default'] !== null)
  28346. data = state['default']
  28347. else
  28348. return;
  28349. }
  28350. // Encode children first
  28351. var content = null;
  28352. var primitive = false;
  28353. if (state.any) {
  28354. // Anything that was given is translated to buffer
  28355. result = this._createEncoderBuffer(data);
  28356. } else if (state.choice) {
  28357. result = this._encodeChoice(data, reporter);
  28358. } else if (state.contains) {
  28359. content = this._getUse(state.contains, parent)._encode(data, reporter);
  28360. primitive = true;
  28361. } else if (state.children) {
  28362. content = state.children.map(function(child) {
  28363. if (child._baseState.tag === 'null_')
  28364. return child._encode(null, reporter, data);
  28365. if (child._baseState.key === null)
  28366. return reporter.error('Child should have a key');
  28367. var prevKey = reporter.enterKey(child._baseState.key);
  28368. if (typeof data !== 'object')
  28369. return reporter.error('Child expected, but input is not object');
  28370. var res = child._encode(data[child._baseState.key], reporter, data);
  28371. reporter.leaveKey(prevKey);
  28372. return res;
  28373. }, this).filter(function(child) {
  28374. return child;
  28375. });
  28376. content = this._createEncoderBuffer(content);
  28377. } else {
  28378. if (state.tag === 'seqof' || state.tag === 'setof') {
  28379. // TODO(indutny): this should be thrown on DSL level
  28380. if (!(state.args && state.args.length === 1))
  28381. return reporter.error('Too many args for : ' + state.tag);
  28382. if (!Array.isArray(data))
  28383. return reporter.error('seqof/setof, but data is not Array');
  28384. var child = this.clone();
  28385. child._baseState.implicit = null;
  28386. content = this._createEncoderBuffer(data.map(function(item) {
  28387. var state = this._baseState;
  28388. return this._getUse(state.args[0], data)._encode(item, reporter);
  28389. }, child));
  28390. } else if (state.use !== null) {
  28391. result = this._getUse(state.use, parent)._encode(data, reporter);
  28392. } else {
  28393. content = this._encodePrimitive(state.tag, data);
  28394. primitive = true;
  28395. }
  28396. }
  28397. // Encode data itself
  28398. var result;
  28399. if (!state.any && state.choice === null) {
  28400. var tag = state.implicit !== null ? state.implicit : state.tag;
  28401. var cls = state.implicit === null ? 'universal' : 'context';
  28402. if (tag === null) {
  28403. if (state.use === null)
  28404. reporter.error('Tag could be omitted only for .use()');
  28405. } else {
  28406. if (state.use === null)
  28407. result = this._encodeComposite(tag, primitive, cls, content);
  28408. }
  28409. }
  28410. // Wrap in explicit
  28411. if (state.explicit !== null)
  28412. result = this._encodeComposite(state.explicit, false, 'context', result);
  28413. return result;
  28414. };
  28415. Node.prototype._encodeChoice = function encodeChoice(data, reporter) {
  28416. var state = this._baseState;
  28417. var node = state.choice[data.type];
  28418. if (!node) {
  28419. assert(
  28420. false,
  28421. data.type + ' not found in ' +
  28422. JSON.stringify(Object.keys(state.choice)));
  28423. }
  28424. return node._encode(data.value, reporter);
  28425. };
  28426. Node.prototype._encodePrimitive = function encodePrimitive(tag, data) {
  28427. var state = this._baseState;
  28428. if (/str$/.test(tag))
  28429. return this._encodeStr(data, tag);
  28430. else if (tag === 'objid' && state.args)
  28431. return this._encodeObjid(data, state.reverseArgs[0], state.args[1]);
  28432. else if (tag === 'objid')
  28433. return this._encodeObjid(data, null, null);
  28434. else if (tag === 'gentime' || tag === 'utctime')
  28435. return this._encodeTime(data, tag);
  28436. else if (tag === 'null_')
  28437. return this._encodeNull();
  28438. else if (tag === 'int' || tag === 'enum')
  28439. return this._encodeInt(data, state.args && state.reverseArgs[0]);
  28440. else if (tag === 'bool')
  28441. return this._encodeBool(data);
  28442. else if (tag === 'objDesc')
  28443. return this._encodeStr(data, tag);
  28444. else
  28445. throw new Error('Unsupported tag: ' + tag);
  28446. };
  28447. Node.prototype._isNumstr = function isNumstr(str) {
  28448. return /^[0-9 ]*$/.test(str);
  28449. };
  28450. Node.prototype._isPrintstr = function isPrintstr(str) {
  28451. return /^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(str);
  28452. };
  28453. /***/ }),
  28454. /* 213 */
  28455. /*!**********************************************************!*\
  28456. !*** ./node_modules/asn1.js/lib/asn1/constants/index.js ***!
  28457. \**********************************************************/
  28458. /*! no static exports found */
  28459. /***/ (function(module, exports, __webpack_require__) {
  28460. var constants = exports;
  28461. // Helper
  28462. constants._reverse = function reverse(map) {
  28463. var res = {};
  28464. Object.keys(map).forEach(function(key) {
  28465. // Convert key to integer if it is stringified
  28466. if ((key | 0) == key)
  28467. key = key | 0;
  28468. var value = map[key];
  28469. res[value] = key;
  28470. });
  28471. return res;
  28472. };
  28473. constants.der = __webpack_require__(/*! ./der */ 214);
  28474. /***/ }),
  28475. /* 214 */
  28476. /*!********************************************************!*\
  28477. !*** ./node_modules/asn1.js/lib/asn1/constants/der.js ***!
  28478. \********************************************************/
  28479. /*! no static exports found */
  28480. /***/ (function(module, exports, __webpack_require__) {
  28481. var constants = __webpack_require__(/*! ../constants */ 213);
  28482. exports.tagClass = {
  28483. 0: 'universal',
  28484. 1: 'application',
  28485. 2: 'context',
  28486. 3: 'private'
  28487. };
  28488. exports.tagClassByName = constants._reverse(exports.tagClass);
  28489. exports.tag = {
  28490. 0x00: 'end',
  28491. 0x01: 'bool',
  28492. 0x02: 'int',
  28493. 0x03: 'bitstr',
  28494. 0x04: 'octstr',
  28495. 0x05: 'null_',
  28496. 0x06: 'objid',
  28497. 0x07: 'objDesc',
  28498. 0x08: 'external',
  28499. 0x09: 'real',
  28500. 0x0a: 'enum',
  28501. 0x0b: 'embed',
  28502. 0x0c: 'utf8str',
  28503. 0x0d: 'relativeOid',
  28504. 0x10: 'seq',
  28505. 0x11: 'set',
  28506. 0x12: 'numstr',
  28507. 0x13: 'printstr',
  28508. 0x14: 't61str',
  28509. 0x15: 'videostr',
  28510. 0x16: 'ia5str',
  28511. 0x17: 'utctime',
  28512. 0x18: 'gentime',
  28513. 0x19: 'graphstr',
  28514. 0x1a: 'iso646str',
  28515. 0x1b: 'genstr',
  28516. 0x1c: 'unistr',
  28517. 0x1d: 'charstr',
  28518. 0x1e: 'bmpstr'
  28519. };
  28520. exports.tagByName = constants._reverse(exports.tag);
  28521. /***/ }),
  28522. /* 215 */
  28523. /*!*********************************************************!*\
  28524. !*** ./node_modules/asn1.js/lib/asn1/decoders/index.js ***!
  28525. \*********************************************************/
  28526. /*! no static exports found */
  28527. /***/ (function(module, exports, __webpack_require__) {
  28528. var decoders = exports;
  28529. decoders.der = __webpack_require__(/*! ./der */ 216);
  28530. decoders.pem = __webpack_require__(/*! ./pem */ 217);
  28531. /***/ }),
  28532. /* 216 */
  28533. /*!*******************************************************!*\
  28534. !*** ./node_modules/asn1.js/lib/asn1/decoders/der.js ***!
  28535. \*******************************************************/
  28536. /*! no static exports found */
  28537. /***/ (function(module, exports, __webpack_require__) {
  28538. var inherits = __webpack_require__(/*! inherits */ 87);
  28539. var asn1 = __webpack_require__(/*! ../../asn1 */ 206);
  28540. var base = asn1.base;
  28541. var bignum = asn1.bignum;
  28542. // Import DER constants
  28543. var der = asn1.constants.der;
  28544. function DERDecoder(entity) {
  28545. this.enc = 'der';
  28546. this.name = entity.name;
  28547. this.entity = entity;
  28548. // Construct base tree
  28549. this.tree = new DERNode();
  28550. this.tree._init(entity.body);
  28551. };
  28552. module.exports = DERDecoder;
  28553. DERDecoder.prototype.decode = function decode(data, options) {
  28554. if (!(data instanceof base.DecoderBuffer))
  28555. data = new base.DecoderBuffer(data, options);
  28556. return this.tree._decode(data, options);
  28557. };
  28558. // Tree methods
  28559. function DERNode(parent) {
  28560. base.Node.call(this, 'der', parent);
  28561. }
  28562. inherits(DERNode, base.Node);
  28563. DERNode.prototype._peekTag = function peekTag(buffer, tag, any) {
  28564. if (buffer.isEmpty())
  28565. return false;
  28566. var state = buffer.save();
  28567. var decodedTag = derDecodeTag(buffer, 'Failed to peek tag: "' + tag + '"');
  28568. if (buffer.isError(decodedTag))
  28569. return decodedTag;
  28570. buffer.restore(state);
  28571. return decodedTag.tag === tag || decodedTag.tagStr === tag ||
  28572. (decodedTag.tagStr + 'of') === tag || any;
  28573. };
  28574. DERNode.prototype._decodeTag = function decodeTag(buffer, tag, any) {
  28575. var decodedTag = derDecodeTag(buffer,
  28576. 'Failed to decode tag of "' + tag + '"');
  28577. if (buffer.isError(decodedTag))
  28578. return decodedTag;
  28579. var len = derDecodeLen(buffer,
  28580. decodedTag.primitive,
  28581. 'Failed to get length of "' + tag + '"');
  28582. // Failure
  28583. if (buffer.isError(len))
  28584. return len;
  28585. if (!any &&
  28586. decodedTag.tag !== tag &&
  28587. decodedTag.tagStr !== tag &&
  28588. decodedTag.tagStr + 'of' !== tag) {
  28589. return buffer.error('Failed to match tag: "' + tag + '"');
  28590. }
  28591. if (decodedTag.primitive || len !== null)
  28592. return buffer.skip(len, 'Failed to match body of: "' + tag + '"');
  28593. // Indefinite length... find END tag
  28594. var state = buffer.save();
  28595. var res = this._skipUntilEnd(
  28596. buffer,
  28597. 'Failed to skip indefinite length body: "' + this.tag + '"');
  28598. if (buffer.isError(res))
  28599. return res;
  28600. len = buffer.offset - state.offset;
  28601. buffer.restore(state);
  28602. return buffer.skip(len, 'Failed to match body of: "' + tag + '"');
  28603. };
  28604. DERNode.prototype._skipUntilEnd = function skipUntilEnd(buffer, fail) {
  28605. while (true) {
  28606. var tag = derDecodeTag(buffer, fail);
  28607. if (buffer.isError(tag))
  28608. return tag;
  28609. var len = derDecodeLen(buffer, tag.primitive, fail);
  28610. if (buffer.isError(len))
  28611. return len;
  28612. var res;
  28613. if (tag.primitive || len !== null)
  28614. res = buffer.skip(len)
  28615. else
  28616. res = this._skipUntilEnd(buffer, fail);
  28617. // Failure
  28618. if (buffer.isError(res))
  28619. return res;
  28620. if (tag.tagStr === 'end')
  28621. break;
  28622. }
  28623. };
  28624. DERNode.prototype._decodeList = function decodeList(buffer, tag, decoder,
  28625. options) {
  28626. var result = [];
  28627. while (!buffer.isEmpty()) {
  28628. var possibleEnd = this._peekTag(buffer, 'end');
  28629. if (buffer.isError(possibleEnd))
  28630. return possibleEnd;
  28631. var res = decoder.decode(buffer, 'der', options);
  28632. if (buffer.isError(res) && possibleEnd)
  28633. break;
  28634. result.push(res);
  28635. }
  28636. return result;
  28637. };
  28638. DERNode.prototype._decodeStr = function decodeStr(buffer, tag) {
  28639. if (tag === 'bitstr') {
  28640. var unused = buffer.readUInt8();
  28641. if (buffer.isError(unused))
  28642. return unused;
  28643. return { unused: unused, data: buffer.raw() };
  28644. } else if (tag === 'bmpstr') {
  28645. var raw = buffer.raw();
  28646. if (raw.length % 2 === 1)
  28647. return buffer.error('Decoding of string type: bmpstr length mismatch');
  28648. var str = '';
  28649. for (var i = 0; i < raw.length / 2; i++) {
  28650. str += String.fromCharCode(raw.readUInt16BE(i * 2));
  28651. }
  28652. return str;
  28653. } else if (tag === 'numstr') {
  28654. var numstr = buffer.raw().toString('ascii');
  28655. if (!this._isNumstr(numstr)) {
  28656. return buffer.error('Decoding of string type: ' +
  28657. 'numstr unsupported characters');
  28658. }
  28659. return numstr;
  28660. } else if (tag === 'octstr') {
  28661. return buffer.raw();
  28662. } else if (tag === 'objDesc') {
  28663. return buffer.raw();
  28664. } else if (tag === 'printstr') {
  28665. var printstr = buffer.raw().toString('ascii');
  28666. if (!this._isPrintstr(printstr)) {
  28667. return buffer.error('Decoding of string type: ' +
  28668. 'printstr unsupported characters');
  28669. }
  28670. return printstr;
  28671. } else if (/str$/.test(tag)) {
  28672. return buffer.raw().toString();
  28673. } else {
  28674. return buffer.error('Decoding of string type: ' + tag + ' unsupported');
  28675. }
  28676. };
  28677. DERNode.prototype._decodeObjid = function decodeObjid(buffer, values, relative) {
  28678. var result;
  28679. var identifiers = [];
  28680. var ident = 0;
  28681. while (!buffer.isEmpty()) {
  28682. var subident = buffer.readUInt8();
  28683. ident <<= 7;
  28684. ident |= subident & 0x7f;
  28685. if ((subident & 0x80) === 0) {
  28686. identifiers.push(ident);
  28687. ident = 0;
  28688. }
  28689. }
  28690. if (subident & 0x80)
  28691. identifiers.push(ident);
  28692. var first = (identifiers[0] / 40) | 0;
  28693. var second = identifiers[0] % 40;
  28694. if (relative)
  28695. result = identifiers;
  28696. else
  28697. result = [first, second].concat(identifiers.slice(1));
  28698. if (values) {
  28699. var tmp = values[result.join(' ')];
  28700. if (tmp === undefined)
  28701. tmp = values[result.join('.')];
  28702. if (tmp !== undefined)
  28703. result = tmp;
  28704. }
  28705. return result;
  28706. };
  28707. DERNode.prototype._decodeTime = function decodeTime(buffer, tag) {
  28708. var str = buffer.raw().toString();
  28709. if (tag === 'gentime') {
  28710. var year = str.slice(0, 4) | 0;
  28711. var mon = str.slice(4, 6) | 0;
  28712. var day = str.slice(6, 8) | 0;
  28713. var hour = str.slice(8, 10) | 0;
  28714. var min = str.slice(10, 12) | 0;
  28715. var sec = str.slice(12, 14) | 0;
  28716. } else if (tag === 'utctime') {
  28717. var year = str.slice(0, 2) | 0;
  28718. var mon = str.slice(2, 4) | 0;
  28719. var day = str.slice(4, 6) | 0;
  28720. var hour = str.slice(6, 8) | 0;
  28721. var min = str.slice(8, 10) | 0;
  28722. var sec = str.slice(10, 12) | 0;
  28723. if (year < 70)
  28724. year = 2000 + year;
  28725. else
  28726. year = 1900 + year;
  28727. } else {
  28728. return buffer.error('Decoding ' + tag + ' time is not supported yet');
  28729. }
  28730. return Date.UTC(year, mon - 1, day, hour, min, sec, 0);
  28731. };
  28732. DERNode.prototype._decodeNull = function decodeNull(buffer) {
  28733. return null;
  28734. };
  28735. DERNode.prototype._decodeBool = function decodeBool(buffer) {
  28736. var res = buffer.readUInt8();
  28737. if (buffer.isError(res))
  28738. return res;
  28739. else
  28740. return res !== 0;
  28741. };
  28742. DERNode.prototype._decodeInt = function decodeInt(buffer, values) {
  28743. // Bigint, return as it is (assume big endian)
  28744. var raw = buffer.raw();
  28745. var res = new bignum(raw);
  28746. if (values)
  28747. res = values[res.toString(10)] || res;
  28748. return res;
  28749. };
  28750. DERNode.prototype._use = function use(entity, obj) {
  28751. if (typeof entity === 'function')
  28752. entity = entity(obj);
  28753. return entity._getDecoder('der').tree;
  28754. };
  28755. // Utility methods
  28756. function derDecodeTag(buf, fail) {
  28757. var tag = buf.readUInt8(fail);
  28758. if (buf.isError(tag))
  28759. return tag;
  28760. var cls = der.tagClass[tag >> 6];
  28761. var primitive = (tag & 0x20) === 0;
  28762. // Multi-octet tag - load
  28763. if ((tag & 0x1f) === 0x1f) {
  28764. var oct = tag;
  28765. tag = 0;
  28766. while ((oct & 0x80) === 0x80) {
  28767. oct = buf.readUInt8(fail);
  28768. if (buf.isError(oct))
  28769. return oct;
  28770. tag <<= 7;
  28771. tag |= oct & 0x7f;
  28772. }
  28773. } else {
  28774. tag &= 0x1f;
  28775. }
  28776. var tagStr = der.tag[tag];
  28777. return {
  28778. cls: cls,
  28779. primitive: primitive,
  28780. tag: tag,
  28781. tagStr: tagStr
  28782. };
  28783. }
  28784. function derDecodeLen(buf, primitive, fail) {
  28785. var len = buf.readUInt8(fail);
  28786. if (buf.isError(len))
  28787. return len;
  28788. // Indefinite form
  28789. if (!primitive && len === 0x80)
  28790. return null;
  28791. // Definite form
  28792. if ((len & 0x80) === 0) {
  28793. // Short form
  28794. return len;
  28795. }
  28796. // Long form
  28797. var num = len & 0x7f;
  28798. if (num > 4)
  28799. return buf.error('length octect is too long');
  28800. len = 0;
  28801. for (var i = 0; i < num; i++) {
  28802. len <<= 8;
  28803. var j = buf.readUInt8(fail);
  28804. if (buf.isError(j))
  28805. return j;
  28806. len |= j;
  28807. }
  28808. return len;
  28809. }
  28810. /***/ }),
  28811. /* 217 */
  28812. /*!*******************************************************!*\
  28813. !*** ./node_modules/asn1.js/lib/asn1/decoders/pem.js ***!
  28814. \*******************************************************/
  28815. /*! no static exports found */
  28816. /***/ (function(module, exports, __webpack_require__) {
  28817. var inherits = __webpack_require__(/*! inherits */ 87);
  28818. var Buffer = __webpack_require__(/*! buffer */ 82).Buffer;
  28819. var DERDecoder = __webpack_require__(/*! ./der */ 216);
  28820. function PEMDecoder(entity) {
  28821. DERDecoder.call(this, entity);
  28822. this.enc = 'pem';
  28823. };
  28824. inherits(PEMDecoder, DERDecoder);
  28825. module.exports = PEMDecoder;
  28826. PEMDecoder.prototype.decode = function decode(data, options) {
  28827. var lines = data.toString().split(/[\r\n]+/g);
  28828. var label = options.label.toUpperCase();
  28829. var re = /^-----(BEGIN|END) ([^-]+)-----$/;
  28830. var start = -1;
  28831. var end = -1;
  28832. for (var i = 0; i < lines.length; i++) {
  28833. var match = lines[i].match(re);
  28834. if (match === null)
  28835. continue;
  28836. if (match[2] !== label)
  28837. continue;
  28838. if (start === -1) {
  28839. if (match[1] !== 'BEGIN')
  28840. break;
  28841. start = i;
  28842. } else {
  28843. if (match[1] !== 'END')
  28844. break;
  28845. end = i;
  28846. break;
  28847. }
  28848. }
  28849. if (start === -1 || end === -1)
  28850. throw new Error('PEM section not found for: ' + label);
  28851. var base64 = lines.slice(start + 1, end).join('');
  28852. // Remove excessive symbols
  28853. base64.replace(/[^a-z0-9\+\/=]+/gi, '');
  28854. var input = new Buffer(base64, 'base64');
  28855. return DERDecoder.prototype.decode.call(this, input, options);
  28856. };
  28857. /***/ }),
  28858. /* 218 */
  28859. /*!*********************************************************!*\
  28860. !*** ./node_modules/asn1.js/lib/asn1/encoders/index.js ***!
  28861. \*********************************************************/
  28862. /*! no static exports found */
  28863. /***/ (function(module, exports, __webpack_require__) {
  28864. var encoders = exports;
  28865. encoders.der = __webpack_require__(/*! ./der */ 219);
  28866. encoders.pem = __webpack_require__(/*! ./pem */ 220);
  28867. /***/ }),
  28868. /* 219 */
  28869. /*!*******************************************************!*\
  28870. !*** ./node_modules/asn1.js/lib/asn1/encoders/der.js ***!
  28871. \*******************************************************/
  28872. /*! no static exports found */
  28873. /***/ (function(module, exports, __webpack_require__) {
  28874. var inherits = __webpack_require__(/*! inherits */ 87);
  28875. var Buffer = __webpack_require__(/*! buffer */ 82).Buffer;
  28876. var asn1 = __webpack_require__(/*! ../../asn1 */ 206);
  28877. var base = asn1.base;
  28878. // Import DER constants
  28879. var der = asn1.constants.der;
  28880. function DEREncoder(entity) {
  28881. this.enc = 'der';
  28882. this.name = entity.name;
  28883. this.entity = entity;
  28884. // Construct base tree
  28885. this.tree = new DERNode();
  28886. this.tree._init(entity.body);
  28887. };
  28888. module.exports = DEREncoder;
  28889. DEREncoder.prototype.encode = function encode(data, reporter) {
  28890. return this.tree._encode(data, reporter).join();
  28891. };
  28892. // Tree methods
  28893. function DERNode(parent) {
  28894. base.Node.call(this, 'der', parent);
  28895. }
  28896. inherits(DERNode, base.Node);
  28897. DERNode.prototype._encodeComposite = function encodeComposite(tag,
  28898. primitive,
  28899. cls,
  28900. content) {
  28901. var encodedTag = encodeTag(tag, primitive, cls, this.reporter);
  28902. // Short form
  28903. if (content.length < 0x80) {
  28904. var header = new Buffer(2);
  28905. header[0] = encodedTag;
  28906. header[1] = content.length;
  28907. return this._createEncoderBuffer([ header, content ]);
  28908. }
  28909. // Long form
  28910. // Count octets required to store length
  28911. var lenOctets = 1;
  28912. for (var i = content.length; i >= 0x100; i >>= 8)
  28913. lenOctets++;
  28914. var header = new Buffer(1 + 1 + lenOctets);
  28915. header[0] = encodedTag;
  28916. header[1] = 0x80 | lenOctets;
  28917. for (var i = 1 + lenOctets, j = content.length; j > 0; i--, j >>= 8)
  28918. header[i] = j & 0xff;
  28919. return this._createEncoderBuffer([ header, content ]);
  28920. };
  28921. DERNode.prototype._encodeStr = function encodeStr(str, tag) {
  28922. if (tag === 'bitstr') {
  28923. return this._createEncoderBuffer([ str.unused | 0, str.data ]);
  28924. } else if (tag === 'bmpstr') {
  28925. var buf = new Buffer(str.length * 2);
  28926. for (var i = 0; i < str.length; i++) {
  28927. buf.writeUInt16BE(str.charCodeAt(i), i * 2);
  28928. }
  28929. return this._createEncoderBuffer(buf);
  28930. } else if (tag === 'numstr') {
  28931. if (!this._isNumstr(str)) {
  28932. return this.reporter.error('Encoding of string type: numstr supports ' +
  28933. 'only digits and space');
  28934. }
  28935. return this._createEncoderBuffer(str);
  28936. } else if (tag === 'printstr') {
  28937. if (!this._isPrintstr(str)) {
  28938. return this.reporter.error('Encoding of string type: printstr supports ' +
  28939. 'only latin upper and lower case letters, ' +
  28940. 'digits, space, apostrophe, left and rigth ' +
  28941. 'parenthesis, plus sign, comma, hyphen, ' +
  28942. 'dot, slash, colon, equal sign, ' +
  28943. 'question mark');
  28944. }
  28945. return this._createEncoderBuffer(str);
  28946. } else if (/str$/.test(tag)) {
  28947. return this._createEncoderBuffer(str);
  28948. } else if (tag === 'objDesc') {
  28949. return this._createEncoderBuffer(str);
  28950. } else {
  28951. return this.reporter.error('Encoding of string type: ' + tag +
  28952. ' unsupported');
  28953. }
  28954. };
  28955. DERNode.prototype._encodeObjid = function encodeObjid(id, values, relative) {
  28956. if (typeof id === 'string') {
  28957. if (!values)
  28958. return this.reporter.error('string objid given, but no values map found');
  28959. if (!values.hasOwnProperty(id))
  28960. return this.reporter.error('objid not found in values map');
  28961. id = values[id].split(/[\s\.]+/g);
  28962. for (var i = 0; i < id.length; i++)
  28963. id[i] |= 0;
  28964. } else if (Array.isArray(id)) {
  28965. id = id.slice();
  28966. for (var i = 0; i < id.length; i++)
  28967. id[i] |= 0;
  28968. }
  28969. if (!Array.isArray(id)) {
  28970. return this.reporter.error('objid() should be either array or string, ' +
  28971. 'got: ' + JSON.stringify(id));
  28972. }
  28973. if (!relative) {
  28974. if (id[1] >= 40)
  28975. return this.reporter.error('Second objid identifier OOB');
  28976. id.splice(0, 2, id[0] * 40 + id[1]);
  28977. }
  28978. // Count number of octets
  28979. var size = 0;
  28980. for (var i = 0; i < id.length; i++) {
  28981. var ident = id[i];
  28982. for (size++; ident >= 0x80; ident >>= 7)
  28983. size++;
  28984. }
  28985. var objid = new Buffer(size);
  28986. var offset = objid.length - 1;
  28987. for (var i = id.length - 1; i >= 0; i--) {
  28988. var ident = id[i];
  28989. objid[offset--] = ident & 0x7f;
  28990. while ((ident >>= 7) > 0)
  28991. objid[offset--] = 0x80 | (ident & 0x7f);
  28992. }
  28993. return this._createEncoderBuffer(objid);
  28994. };
  28995. function two(num) {
  28996. if (num < 10)
  28997. return '0' + num;
  28998. else
  28999. return num;
  29000. }
  29001. DERNode.prototype._encodeTime = function encodeTime(time, tag) {
  29002. var str;
  29003. var date = new Date(time);
  29004. if (tag === 'gentime') {
  29005. str = [
  29006. two(date.getFullYear()),
  29007. two(date.getUTCMonth() + 1),
  29008. two(date.getUTCDate()),
  29009. two(date.getUTCHours()),
  29010. two(date.getUTCMinutes()),
  29011. two(date.getUTCSeconds()),
  29012. 'Z'
  29013. ].join('');
  29014. } else if (tag === 'utctime') {
  29015. str = [
  29016. two(date.getFullYear() % 100),
  29017. two(date.getUTCMonth() + 1),
  29018. two(date.getUTCDate()),
  29019. two(date.getUTCHours()),
  29020. two(date.getUTCMinutes()),
  29021. two(date.getUTCSeconds()),
  29022. 'Z'
  29023. ].join('');
  29024. } else {
  29025. this.reporter.error('Encoding ' + tag + ' time is not supported yet');
  29026. }
  29027. return this._encodeStr(str, 'octstr');
  29028. };
  29029. DERNode.prototype._encodeNull = function encodeNull() {
  29030. return this._createEncoderBuffer('');
  29031. };
  29032. DERNode.prototype._encodeInt = function encodeInt(num, values) {
  29033. if (typeof num === 'string') {
  29034. if (!values)
  29035. return this.reporter.error('String int or enum given, but no values map');
  29036. if (!values.hasOwnProperty(num)) {
  29037. return this.reporter.error('Values map doesn\'t contain: ' +
  29038. JSON.stringify(num));
  29039. }
  29040. num = values[num];
  29041. }
  29042. // Bignum, assume big endian
  29043. if (typeof num !== 'number' && !Buffer.isBuffer(num)) {
  29044. var numArray = num.toArray();
  29045. if (!num.sign && numArray[0] & 0x80) {
  29046. numArray.unshift(0);
  29047. }
  29048. num = new Buffer(numArray);
  29049. }
  29050. if (Buffer.isBuffer(num)) {
  29051. var size = num.length;
  29052. if (num.length === 0)
  29053. size++;
  29054. var out = new Buffer(size);
  29055. num.copy(out);
  29056. if (num.length === 0)
  29057. out[0] = 0
  29058. return this._createEncoderBuffer(out);
  29059. }
  29060. if (num < 0x80)
  29061. return this._createEncoderBuffer(num);
  29062. if (num < 0x100)
  29063. return this._createEncoderBuffer([0, num]);
  29064. var size = 1;
  29065. for (var i = num; i >= 0x100; i >>= 8)
  29066. size++;
  29067. var out = new Array(size);
  29068. for (var i = out.length - 1; i >= 0; i--) {
  29069. out[i] = num & 0xff;
  29070. num >>= 8;
  29071. }
  29072. if(out[0] & 0x80) {
  29073. out.unshift(0);
  29074. }
  29075. return this._createEncoderBuffer(new Buffer(out));
  29076. };
  29077. DERNode.prototype._encodeBool = function encodeBool(value) {
  29078. return this._createEncoderBuffer(value ? 0xff : 0);
  29079. };
  29080. DERNode.prototype._use = function use(entity, obj) {
  29081. if (typeof entity === 'function')
  29082. entity = entity(obj);
  29083. return entity._getEncoder('der').tree;
  29084. };
  29085. DERNode.prototype._skipDefault = function skipDefault(dataBuffer, reporter, parent) {
  29086. var state = this._baseState;
  29087. var i;
  29088. if (state['default'] === null)
  29089. return false;
  29090. var data = dataBuffer.join();
  29091. if (state.defaultBuffer === undefined)
  29092. state.defaultBuffer = this._encodeValue(state['default'], reporter, parent).join();
  29093. if (data.length !== state.defaultBuffer.length)
  29094. return false;
  29095. for (i=0; i < data.length; i++)
  29096. if (data[i] !== state.defaultBuffer[i])
  29097. return false;
  29098. return true;
  29099. };
  29100. // Utility methods
  29101. function encodeTag(tag, primitive, cls, reporter) {
  29102. var res;
  29103. if (tag === 'seqof')
  29104. tag = 'seq';
  29105. else if (tag === 'setof')
  29106. tag = 'set';
  29107. if (der.tagByName.hasOwnProperty(tag))
  29108. res = der.tagByName[tag];
  29109. else if (typeof tag === 'number' && (tag | 0) === tag)
  29110. res = tag;
  29111. else
  29112. return reporter.error('Unknown tag: ' + tag);
  29113. if (res >= 0x1f)
  29114. return reporter.error('Multi-octet tag encoding unsupported');
  29115. if (!primitive)
  29116. res |= 0x20;
  29117. res |= (der.tagClassByName[cls || 'universal'] << 6);
  29118. return res;
  29119. }
  29120. /***/ }),
  29121. /* 220 */
  29122. /*!*******************************************************!*\
  29123. !*** ./node_modules/asn1.js/lib/asn1/encoders/pem.js ***!
  29124. \*******************************************************/
  29125. /*! no static exports found */
  29126. /***/ (function(module, exports, __webpack_require__) {
  29127. var inherits = __webpack_require__(/*! inherits */ 87);
  29128. var DEREncoder = __webpack_require__(/*! ./der */ 219);
  29129. function PEMEncoder(entity) {
  29130. DEREncoder.call(this, entity);
  29131. this.enc = 'pem';
  29132. };
  29133. inherits(PEMEncoder, DEREncoder);
  29134. module.exports = PEMEncoder;
  29135. PEMEncoder.prototype.encode = function encode(data, options) {
  29136. var buf = DEREncoder.prototype.encode.call(this, data);
  29137. var p = buf.toString('base64');
  29138. var out = [ '-----BEGIN ' + options.label + '-----' ];
  29139. for (var i = 0; i < p.length; i += 64)
  29140. out.push(p.slice(i, i + 64));
  29141. out.push('-----END ' + options.label + '-----');
  29142. return out.join('\n');
  29143. };
  29144. /***/ }),
  29145. /* 221 */
  29146. /*!************************************************!*\
  29147. !*** ./node_modules/parse-asn1/certificate.js ***!
  29148. \************************************************/
  29149. /*! no static exports found */
  29150. /***/ (function(module, exports, __webpack_require__) {
  29151. "use strict";
  29152. // from https://github.com/Rantanen/node-dtls/blob/25a7dc861bda38cfeac93a723500eea4f0ac2e86/Certificate.js
  29153. // thanks to @Rantanen
  29154. var asn = __webpack_require__(/*! asn1.js */ 206)
  29155. var Time = asn.define('Time', function () {
  29156. this.choice({
  29157. utcTime: this.utctime(),
  29158. generalTime: this.gentime()
  29159. })
  29160. })
  29161. var AttributeTypeValue = asn.define('AttributeTypeValue', function () {
  29162. this.seq().obj(
  29163. this.key('type').objid(),
  29164. this.key('value').any()
  29165. )
  29166. })
  29167. var AlgorithmIdentifier = asn.define('AlgorithmIdentifier', function () {
  29168. this.seq().obj(
  29169. this.key('algorithm').objid(),
  29170. this.key('parameters').optional(),
  29171. this.key('curve').objid().optional()
  29172. )
  29173. })
  29174. var SubjectPublicKeyInfo = asn.define('SubjectPublicKeyInfo', function () {
  29175. this.seq().obj(
  29176. this.key('algorithm').use(AlgorithmIdentifier),
  29177. this.key('subjectPublicKey').bitstr()
  29178. )
  29179. })
  29180. var RelativeDistinguishedName = asn.define('RelativeDistinguishedName', function () {
  29181. this.setof(AttributeTypeValue)
  29182. })
  29183. var RDNSequence = asn.define('RDNSequence', function () {
  29184. this.seqof(RelativeDistinguishedName)
  29185. })
  29186. var Name = asn.define('Name', function () {
  29187. this.choice({
  29188. rdnSequence: this.use(RDNSequence)
  29189. })
  29190. })
  29191. var Validity = asn.define('Validity', function () {
  29192. this.seq().obj(
  29193. this.key('notBefore').use(Time),
  29194. this.key('notAfter').use(Time)
  29195. )
  29196. })
  29197. var Extension = asn.define('Extension', function () {
  29198. this.seq().obj(
  29199. this.key('extnID').objid(),
  29200. this.key('critical').bool().def(false),
  29201. this.key('extnValue').octstr()
  29202. )
  29203. })
  29204. var TBSCertificate = asn.define('TBSCertificate', function () {
  29205. this.seq().obj(
  29206. this.key('version').explicit(0).int().optional(),
  29207. this.key('serialNumber').int(),
  29208. this.key('signature').use(AlgorithmIdentifier),
  29209. this.key('issuer').use(Name),
  29210. this.key('validity').use(Validity),
  29211. this.key('subject').use(Name),
  29212. this.key('subjectPublicKeyInfo').use(SubjectPublicKeyInfo),
  29213. this.key('issuerUniqueID').implicit(1).bitstr().optional(),
  29214. this.key('subjectUniqueID').implicit(2).bitstr().optional(),
  29215. this.key('extensions').explicit(3).seqof(Extension).optional()
  29216. )
  29217. })
  29218. var X509Certificate = asn.define('X509Certificate', function () {
  29219. this.seq().obj(
  29220. this.key('tbsCertificate').use(TBSCertificate),
  29221. this.key('signatureAlgorithm').use(AlgorithmIdentifier),
  29222. this.key('signatureValue').bitstr()
  29223. )
  29224. })
  29225. module.exports = X509Certificate
  29226. /***/ }),
  29227. /* 222 */
  29228. /*!********************************************!*\
  29229. !*** ./node_modules/parse-asn1/aesid.json ***!
  29230. \********************************************/
  29231. /*! 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 */
  29232. /***/ (function(module) {
  29233. 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\"}");
  29234. /***/ }),
  29235. /* 223 */
  29236. /*!********************************************!*\
  29237. !*** ./node_modules/parse-asn1/fixProc.js ***!
  29238. \********************************************/
  29239. /*! no static exports found */
  29240. /***/ (function(module, exports, __webpack_require__) {
  29241. // adapted from https://github.com/apatil/pemstrip
  29242. 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
  29243. var startRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m
  29244. var fullRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m
  29245. var evp = __webpack_require__(/*! evp_bytestokey */ 158)
  29246. var ciphers = __webpack_require__(/*! browserify-aes */ 141)
  29247. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  29248. module.exports = function (okey, password) {
  29249. var key = okey.toString()
  29250. var match = key.match(findProc)
  29251. var decrypted
  29252. if (!match) {
  29253. var match2 = key.match(fullRegex)
  29254. decrypted = new Buffer(match2[2].replace(/[\r\n]/g, ''), 'base64')
  29255. } else {
  29256. var suite = 'aes' + match[1]
  29257. var iv = Buffer.from(match[2], 'hex')
  29258. var cipherText = Buffer.from(match[3].replace(/[\r\n]/g, ''), 'base64')
  29259. var cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key
  29260. var out = []
  29261. var cipher = ciphers.createDecipheriv(suite, cipherKey, iv)
  29262. out.push(cipher.update(cipherText))
  29263. out.push(cipher.final())
  29264. decrypted = Buffer.concat(out)
  29265. }
  29266. var tag = key.match(startRegex)[1]
  29267. return {
  29268. tag: tag,
  29269. data: decrypted
  29270. }
  29271. }
  29272. /***/ }),
  29273. /* 224 */
  29274. /*!**********************************************************!*\
  29275. !*** ./node_modules/browserify-sign/browser/curves.json ***!
  29276. \**********************************************************/
  29277. /*! 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 */
  29278. /***/ (function(module) {
  29279. 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\"}");
  29280. /***/ }),
  29281. /* 225 */
  29282. /*!********************************************************!*\
  29283. !*** ./node_modules/browserify-sign/browser/verify.js ***!
  29284. \********************************************************/
  29285. /*! no static exports found */
  29286. /***/ (function(module, exports, __webpack_require__) {
  29287. // much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js
  29288. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  29289. var BN = __webpack_require__(/*! bn.js */ 163)
  29290. var EC = __webpack_require__(/*! elliptic */ 174).ec
  29291. var parseKeys = __webpack_require__(/*! parse-asn1 */ 204)
  29292. var curves = __webpack_require__(/*! ./curves.json */ 224)
  29293. function verify (sig, hash, key, signType, tag) {
  29294. var pub = parseKeys(key)
  29295. if (pub.type === 'ec') {
  29296. // rsa keys can be interpreted as ecdsa ones in openssl
  29297. if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') throw new Error('wrong public key type')
  29298. return ecVerify(sig, hash, pub)
  29299. } else if (pub.type === 'dsa') {
  29300. if (signType !== 'dsa') throw new Error('wrong public key type')
  29301. return dsaVerify(sig, hash, pub)
  29302. } else {
  29303. if (signType !== 'rsa' && signType !== 'ecdsa/rsa') throw new Error('wrong public key type')
  29304. }
  29305. hash = Buffer.concat([tag, hash])
  29306. var len = pub.modulus.byteLength()
  29307. var pad = [1]
  29308. var padNum = 0
  29309. while (hash.length + pad.length + 2 < len) {
  29310. pad.push(0xff)
  29311. padNum++
  29312. }
  29313. pad.push(0x00)
  29314. var i = -1
  29315. while (++i < hash.length) {
  29316. pad.push(hash[i])
  29317. }
  29318. pad = Buffer.from(pad)
  29319. var red = BN.mont(pub.modulus)
  29320. sig = new BN(sig).toRed(red)
  29321. sig = sig.redPow(new BN(pub.publicExponent))
  29322. sig = Buffer.from(sig.fromRed().toArray())
  29323. var out = padNum < 8 ? 1 : 0
  29324. len = Math.min(sig.length, pad.length)
  29325. if (sig.length !== pad.length) out = 1
  29326. i = -1
  29327. while (++i < len) out |= sig[i] ^ pad[i]
  29328. return out === 0
  29329. }
  29330. function ecVerify (sig, hash, pub) {
  29331. var curveId = curves[pub.data.algorithm.curve.join('.')]
  29332. if (!curveId) throw new Error('unknown curve ' + pub.data.algorithm.curve.join('.'))
  29333. var curve = new EC(curveId)
  29334. var pubkey = pub.data.subjectPrivateKey.data
  29335. return curve.verify(hash, sig, pubkey)
  29336. }
  29337. function dsaVerify (sig, hash, pub) {
  29338. var p = pub.data.p
  29339. var q = pub.data.q
  29340. var g = pub.data.g
  29341. var y = pub.data.pub_key
  29342. var unpacked = parseKeys.signature.decode(sig, 'der')
  29343. var s = unpacked.s
  29344. var r = unpacked.r
  29345. checkValue(s, q)
  29346. checkValue(r, q)
  29347. var montp = BN.mont(p)
  29348. var w = s.invm(q)
  29349. var v = g.toRed(montp)
  29350. .redPow(new BN(hash).mul(w).mod(q))
  29351. .fromRed()
  29352. .mul(y.toRed(montp).redPow(r.mul(w).mod(q)).fromRed())
  29353. .mod(p)
  29354. .mod(q)
  29355. return v.cmp(r) === 0
  29356. }
  29357. function checkValue (b, q) {
  29358. if (b.cmpn(0) <= 0) throw new Error('invalid sig')
  29359. if (b.cmp(q) >= q) throw new Error('invalid sig')
  29360. }
  29361. module.exports = verify
  29362. /***/ }),
  29363. /* 226 */
  29364. /*!*********************************************!*\
  29365. !*** ./node_modules/create-ecdh/browser.js ***!
  29366. \*********************************************/
  29367. /*! no static exports found */
  29368. /***/ (function(module, exports, __webpack_require__) {
  29369. /* WEBPACK VAR INJECTION */(function(Buffer) {var elliptic = __webpack_require__(/*! elliptic */ 174)
  29370. var BN = __webpack_require__(/*! bn.js */ 163)
  29371. module.exports = function createECDH (curve) {
  29372. return new ECDH(curve)
  29373. }
  29374. var aliases = {
  29375. secp256k1: {
  29376. name: 'secp256k1',
  29377. byteLength: 32
  29378. },
  29379. secp224r1: {
  29380. name: 'p224',
  29381. byteLength: 28
  29382. },
  29383. prime256v1: {
  29384. name: 'p256',
  29385. byteLength: 32
  29386. },
  29387. prime192v1: {
  29388. name: 'p192',
  29389. byteLength: 24
  29390. },
  29391. ed25519: {
  29392. name: 'ed25519',
  29393. byteLength: 32
  29394. },
  29395. secp384r1: {
  29396. name: 'p384',
  29397. byteLength: 48
  29398. },
  29399. secp521r1: {
  29400. name: 'p521',
  29401. byteLength: 66
  29402. }
  29403. }
  29404. aliases.p224 = aliases.secp224r1
  29405. aliases.p256 = aliases.secp256r1 = aliases.prime256v1
  29406. aliases.p192 = aliases.secp192r1 = aliases.prime192v1
  29407. aliases.p384 = aliases.secp384r1
  29408. aliases.p521 = aliases.secp521r1
  29409. function ECDH (curve) {
  29410. this.curveType = aliases[curve]
  29411. if (!this.curveType) {
  29412. this.curveType = {
  29413. name: curve
  29414. }
  29415. }
  29416. this.curve = new elliptic.ec(this.curveType.name) // eslint-disable-line new-cap
  29417. this.keys = void 0
  29418. }
  29419. ECDH.prototype.generateKeys = function (enc, format) {
  29420. this.keys = this.curve.genKeyPair()
  29421. return this.getPublicKey(enc, format)
  29422. }
  29423. ECDH.prototype.computeSecret = function (other, inenc, enc) {
  29424. inenc = inenc || 'utf8'
  29425. if (!Buffer.isBuffer(other)) {
  29426. other = new Buffer(other, inenc)
  29427. }
  29428. var otherPub = this.curve.keyFromPublic(other).getPublic()
  29429. var out = otherPub.mul(this.keys.getPrivate()).getX()
  29430. return formatReturnValue(out, enc, this.curveType.byteLength)
  29431. }
  29432. ECDH.prototype.getPublicKey = function (enc, format) {
  29433. var key = this.keys.getPublic(format === 'compressed', true)
  29434. if (format === 'hybrid') {
  29435. if (key[key.length - 1] % 2) {
  29436. key[0] = 7
  29437. } else {
  29438. key[0] = 6
  29439. }
  29440. }
  29441. return formatReturnValue(key, enc)
  29442. }
  29443. ECDH.prototype.getPrivateKey = function (enc) {
  29444. return formatReturnValue(this.keys.getPrivate(), enc)
  29445. }
  29446. ECDH.prototype.setPublicKey = function (pub, enc) {
  29447. enc = enc || 'utf8'
  29448. if (!Buffer.isBuffer(pub)) {
  29449. pub = new Buffer(pub, enc)
  29450. }
  29451. this.keys._importPublic(pub)
  29452. return this
  29453. }
  29454. ECDH.prototype.setPrivateKey = function (priv, enc) {
  29455. enc = enc || 'utf8'
  29456. if (!Buffer.isBuffer(priv)) {
  29457. priv = new Buffer(priv, enc)
  29458. }
  29459. var _priv = new BN(priv)
  29460. _priv = _priv.toString(16)
  29461. this.keys = this.curve.genKeyPair()
  29462. this.keys._importPrivate(_priv)
  29463. return this
  29464. }
  29465. function formatReturnValue (bn, enc, len) {
  29466. if (!Array.isArray(bn)) {
  29467. bn = bn.toArray()
  29468. }
  29469. var buf = new Buffer(bn)
  29470. if (len && buf.length < len) {
  29471. var zeros = new Buffer(len - buf.length)
  29472. zeros.fill(0)
  29473. buf = Buffer.concat([zeros, buf])
  29474. }
  29475. if (!enc) {
  29476. return buf
  29477. } else {
  29478. return buf.toString(enc)
  29479. }
  29480. }
  29481. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ 82).Buffer))
  29482. /***/ }),
  29483. /* 227 */
  29484. /*!************************************************!*\
  29485. !*** ./node_modules/public-encrypt/browser.js ***!
  29486. \************************************************/
  29487. /*! no static exports found */
  29488. /***/ (function(module, exports, __webpack_require__) {
  29489. exports.publicEncrypt = __webpack_require__(/*! ./publicEncrypt */ 228)
  29490. exports.privateDecrypt = __webpack_require__(/*! ./privateDecrypt */ 232)
  29491. exports.privateEncrypt = function privateEncrypt (key, buf) {
  29492. return exports.publicEncrypt(key, buf, true)
  29493. }
  29494. exports.publicDecrypt = function publicDecrypt (key, buf) {
  29495. return exports.privateDecrypt(key, buf, true)
  29496. }
  29497. /***/ }),
  29498. /* 228 */
  29499. /*!******************************************************!*\
  29500. !*** ./node_modules/public-encrypt/publicEncrypt.js ***!
  29501. \******************************************************/
  29502. /*! no static exports found */
  29503. /***/ (function(module, exports, __webpack_require__) {
  29504. var parseKeys = __webpack_require__(/*! parse-asn1 */ 204)
  29505. var randomBytes = __webpack_require__(/*! randombytes */ 78)
  29506. var createHash = __webpack_require__(/*! create-hash */ 86)
  29507. var mgf = __webpack_require__(/*! ./mgf */ 229)
  29508. var xor = __webpack_require__(/*! ./xor */ 230)
  29509. var BN = __webpack_require__(/*! bn.js */ 163)
  29510. var withPublic = __webpack_require__(/*! ./withPublic */ 231)
  29511. var crt = __webpack_require__(/*! browserify-rsa */ 173)
  29512. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  29513. module.exports = function publicEncrypt (publicKey, msg, reverse) {
  29514. var padding
  29515. if (publicKey.padding) {
  29516. padding = publicKey.padding
  29517. } else if (reverse) {
  29518. padding = 1
  29519. } else {
  29520. padding = 4
  29521. }
  29522. var key = parseKeys(publicKey)
  29523. var paddedMsg
  29524. if (padding === 4) {
  29525. paddedMsg = oaep(key, msg)
  29526. } else if (padding === 1) {
  29527. paddedMsg = pkcs1(key, msg, reverse)
  29528. } else if (padding === 3) {
  29529. paddedMsg = new BN(msg)
  29530. if (paddedMsg.cmp(key.modulus) >= 0) {
  29531. throw new Error('data too long for modulus')
  29532. }
  29533. } else {
  29534. throw new Error('unknown padding')
  29535. }
  29536. if (reverse) {
  29537. return crt(paddedMsg, key)
  29538. } else {
  29539. return withPublic(paddedMsg, key)
  29540. }
  29541. }
  29542. function oaep (key, msg) {
  29543. var k = key.modulus.byteLength()
  29544. var mLen = msg.length
  29545. var iHash = createHash('sha1').update(Buffer.alloc(0)).digest()
  29546. var hLen = iHash.length
  29547. var hLen2 = 2 * hLen
  29548. if (mLen > k - hLen2 - 2) {
  29549. throw new Error('message too long')
  29550. }
  29551. var ps = Buffer.alloc(k - mLen - hLen2 - 2)
  29552. var dblen = k - hLen - 1
  29553. var seed = randomBytes(hLen)
  29554. var maskedDb = xor(Buffer.concat([iHash, ps, Buffer.alloc(1, 1), msg], dblen), mgf(seed, dblen))
  29555. var maskedSeed = xor(seed, mgf(maskedDb, hLen))
  29556. return new BN(Buffer.concat([Buffer.alloc(1), maskedSeed, maskedDb], k))
  29557. }
  29558. function pkcs1 (key, msg, reverse) {
  29559. var mLen = msg.length
  29560. var k = key.modulus.byteLength()
  29561. if (mLen > k - 11) {
  29562. throw new Error('message too long')
  29563. }
  29564. var ps
  29565. if (reverse) {
  29566. ps = Buffer.alloc(k - mLen - 3, 0xff)
  29567. } else {
  29568. ps = nonZero(k - mLen - 3)
  29569. }
  29570. return new BN(Buffer.concat([Buffer.from([0, reverse ? 1 : 2]), ps, Buffer.alloc(1), msg], k))
  29571. }
  29572. function nonZero (len) {
  29573. var out = Buffer.allocUnsafe(len)
  29574. var i = 0
  29575. var cache = randomBytes(len * 2)
  29576. var cur = 0
  29577. var num
  29578. while (i < len) {
  29579. if (cur === cache.length) {
  29580. cache = randomBytes(len * 2)
  29581. cur = 0
  29582. }
  29583. num = cache[cur++]
  29584. if (num) {
  29585. out[i++] = num
  29586. }
  29587. }
  29588. return out
  29589. }
  29590. /***/ }),
  29591. /* 229 */
  29592. /*!********************************************!*\
  29593. !*** ./node_modules/public-encrypt/mgf.js ***!
  29594. \********************************************/
  29595. /*! no static exports found */
  29596. /***/ (function(module, exports, __webpack_require__) {
  29597. var createHash = __webpack_require__(/*! create-hash */ 86)
  29598. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  29599. module.exports = function (seed, len) {
  29600. var t = Buffer.alloc(0)
  29601. var i = 0
  29602. var c
  29603. while (t.length < len) {
  29604. c = i2ops(i++)
  29605. t = Buffer.concat([t, createHash('sha1').update(seed).update(c).digest()])
  29606. }
  29607. return t.slice(0, len)
  29608. }
  29609. function i2ops (c) {
  29610. var out = Buffer.allocUnsafe(4)
  29611. out.writeUInt32BE(c, 0)
  29612. return out
  29613. }
  29614. /***/ }),
  29615. /* 230 */
  29616. /*!********************************************!*\
  29617. !*** ./node_modules/public-encrypt/xor.js ***!
  29618. \********************************************/
  29619. /*! no static exports found */
  29620. /***/ (function(module, exports) {
  29621. module.exports = function xor (a, b) {
  29622. var len = a.length
  29623. var i = -1
  29624. while (++i < len) {
  29625. a[i] ^= b[i]
  29626. }
  29627. return a
  29628. }
  29629. /***/ }),
  29630. /* 231 */
  29631. /*!***************************************************!*\
  29632. !*** ./node_modules/public-encrypt/withPublic.js ***!
  29633. \***************************************************/
  29634. /*! no static exports found */
  29635. /***/ (function(module, exports, __webpack_require__) {
  29636. var BN = __webpack_require__(/*! bn.js */ 163)
  29637. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  29638. function withPublic (paddedMsg, key) {
  29639. return Buffer.from(paddedMsg
  29640. .toRed(BN.mont(key.modulus))
  29641. .redPow(new BN(key.publicExponent))
  29642. .fromRed()
  29643. .toArray())
  29644. }
  29645. module.exports = withPublic
  29646. /***/ }),
  29647. /* 232 */
  29648. /*!*******************************************************!*\
  29649. !*** ./node_modules/public-encrypt/privateDecrypt.js ***!
  29650. \*******************************************************/
  29651. /*! no static exports found */
  29652. /***/ (function(module, exports, __webpack_require__) {
  29653. var parseKeys = __webpack_require__(/*! parse-asn1 */ 204)
  29654. var mgf = __webpack_require__(/*! ./mgf */ 229)
  29655. var xor = __webpack_require__(/*! ./xor */ 230)
  29656. var BN = __webpack_require__(/*! bn.js */ 163)
  29657. var crt = __webpack_require__(/*! browserify-rsa */ 173)
  29658. var createHash = __webpack_require__(/*! create-hash */ 86)
  29659. var withPublic = __webpack_require__(/*! ./withPublic */ 231)
  29660. var Buffer = __webpack_require__(/*! safe-buffer */ 81).Buffer
  29661. module.exports = function privateDecrypt (privateKey, enc, reverse) {
  29662. var padding
  29663. if (privateKey.padding) {
  29664. padding = privateKey.padding
  29665. } else if (reverse) {
  29666. padding = 1
  29667. } else {
  29668. padding = 4
  29669. }
  29670. var key = parseKeys(privateKey)
  29671. var k = key.modulus.byteLength()
  29672. if (enc.length > k || new BN(enc).cmp(key.modulus) >= 0) {
  29673. throw new Error('decryption error')
  29674. }
  29675. var msg
  29676. if (reverse) {
  29677. msg = withPublic(new BN(enc), key)
  29678. } else {
  29679. msg = crt(enc, key)
  29680. }
  29681. var zBuffer = Buffer.alloc(k - msg.length)
  29682. msg = Buffer.concat([zBuffer, msg], k)
  29683. if (padding === 4) {
  29684. return oaep(key, msg)
  29685. } else if (padding === 1) {
  29686. return pkcs1(key, msg, reverse)
  29687. } else if (padding === 3) {
  29688. return msg
  29689. } else {
  29690. throw new Error('unknown padding')
  29691. }
  29692. }
  29693. function oaep (key, msg) {
  29694. var k = key.modulus.byteLength()
  29695. var iHash = createHash('sha1').update(Buffer.alloc(0)).digest()
  29696. var hLen = iHash.length
  29697. if (msg[0] !== 0) {
  29698. throw new Error('decryption error')
  29699. }
  29700. var maskedSeed = msg.slice(1, hLen + 1)
  29701. var maskedDb = msg.slice(hLen + 1)
  29702. var seed = xor(maskedSeed, mgf(maskedDb, hLen))
  29703. var db = xor(maskedDb, mgf(seed, k - hLen - 1))
  29704. if (compare(iHash, db.slice(0, hLen))) {
  29705. throw new Error('decryption error')
  29706. }
  29707. var i = hLen
  29708. while (db[i] === 0) {
  29709. i++
  29710. }
  29711. if (db[i++] !== 1) {
  29712. throw new Error('decryption error')
  29713. }
  29714. return db.slice(i)
  29715. }
  29716. function pkcs1 (key, msg, reverse) {
  29717. var p1 = msg.slice(0, 2)
  29718. var i = 2
  29719. var status = 0
  29720. while (msg[i++] !== 0) {
  29721. if (i >= msg.length) {
  29722. status++
  29723. break
  29724. }
  29725. }
  29726. var ps = msg.slice(2, i - 1)
  29727. if ((p1.toString('hex') !== '0002' && !reverse) || (p1.toString('hex') !== '0001' && reverse)) {
  29728. status++
  29729. }
  29730. if (ps.length < 8) {
  29731. status++
  29732. }
  29733. if (status) {
  29734. throw new Error('decryption error')
  29735. }
  29736. return msg.slice(i)
  29737. }
  29738. function compare (a, b) {
  29739. a = Buffer.from(a)
  29740. b = Buffer.from(b)
  29741. var dif = 0
  29742. var len = a.length
  29743. if (a.length !== b.length) {
  29744. dif++
  29745. len = Math.min(a.length, b.length)
  29746. }
  29747. var i = -1
  29748. while (++i < len) {
  29749. dif += (a[i] ^ b[i])
  29750. }
  29751. return dif
  29752. }
  29753. /***/ }),
  29754. /* 233 */
  29755. /*!********************************************!*\
  29756. !*** ./node_modules/randomfill/browser.js ***!
  29757. \********************************************/
  29758. /*! no static exports found */
  29759. /***/ (function(module, exports, __webpack_require__) {
  29760. "use strict";
  29761. /* WEBPACK VAR INJECTION */(function(global, process) {
  29762. function oldBrowser () {
  29763. throw new Error('secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11')
  29764. }
  29765. var safeBuffer = __webpack_require__(/*! safe-buffer */ 81)
  29766. var randombytes = __webpack_require__(/*! randombytes */ 78)
  29767. var Buffer = safeBuffer.Buffer
  29768. var kBufferMaxLength = safeBuffer.kMaxLength
  29769. var crypto = global.crypto || global.msCrypto
  29770. var kMaxUint32 = Math.pow(2, 32) - 1
  29771. function assertOffset (offset, length) {
  29772. if (typeof offset !== 'number' || offset !== offset) { // eslint-disable-line no-self-compare
  29773. throw new TypeError('offset must be a number')
  29774. }
  29775. if (offset > kMaxUint32 || offset < 0) {
  29776. throw new TypeError('offset must be a uint32')
  29777. }
  29778. if (offset > kBufferMaxLength || offset > length) {
  29779. throw new RangeError('offset out of range')
  29780. }
  29781. }
  29782. function assertSize (size, offset, length) {
  29783. if (typeof size !== 'number' || size !== size) { // eslint-disable-line no-self-compare
  29784. throw new TypeError('size must be a number')
  29785. }
  29786. if (size > kMaxUint32 || size < 0) {
  29787. throw new TypeError('size must be a uint32')
  29788. }
  29789. if (size + offset > length || size > kBufferMaxLength) {
  29790. throw new RangeError('buffer too small')
  29791. }
  29792. }
  29793. if ((crypto && crypto.getRandomValues) || !process.browser) {
  29794. exports.randomFill = randomFill
  29795. exports.randomFillSync = randomFillSync
  29796. } else {
  29797. exports.randomFill = oldBrowser
  29798. exports.randomFillSync = oldBrowser
  29799. }
  29800. function randomFill (buf, offset, size, cb) {
  29801. if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) {
  29802. throw new TypeError('"buf" argument must be a Buffer or Uint8Array')
  29803. }
  29804. if (typeof offset === 'function') {
  29805. cb = offset
  29806. offset = 0
  29807. size = buf.length
  29808. } else if (typeof size === 'function') {
  29809. cb = size
  29810. size = buf.length - offset
  29811. } else if (typeof cb !== 'function') {
  29812. throw new TypeError('"cb" argument must be a function')
  29813. }
  29814. assertOffset(offset, buf.length)
  29815. assertSize(size, offset, buf.length)
  29816. return actualFill(buf, offset, size, cb)
  29817. }
  29818. function actualFill (buf, offset, size, cb) {
  29819. if (process.browser) {
  29820. var ourBuf = buf.buffer
  29821. var uint = new Uint8Array(ourBuf, offset, size)
  29822. crypto.getRandomValues(uint)
  29823. if (cb) {
  29824. process.nextTick(function () {
  29825. cb(null, buf)
  29826. })
  29827. return
  29828. }
  29829. return buf
  29830. }
  29831. if (cb) {
  29832. randombytes(size, function (err, bytes) {
  29833. if (err) {
  29834. return cb(err)
  29835. }
  29836. bytes.copy(buf, offset)
  29837. cb(null, buf)
  29838. })
  29839. return
  29840. }
  29841. var bytes = randombytes(size)
  29842. bytes.copy(buf, offset)
  29843. return buf
  29844. }
  29845. function randomFillSync (buf, offset, size) {
  29846. if (typeof offset === 'undefined') {
  29847. offset = 0
  29848. }
  29849. if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) {
  29850. throw new TypeError('"buf" argument must be a Buffer or Uint8Array')
  29851. }
  29852. assertOffset(offset, buf.length)
  29853. if (size === undefined) size = buf.length - offset
  29854. assertSize(size, offset, buf.length)
  29855. return actualFill(buf, offset, size)
  29856. }
  29857. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ 2), __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 79)))
  29858. /***/ }),
  29859. /* 234 */,
  29860. /* 235 */,
  29861. /* 236 */,
  29862. /* 237 */,
  29863. /* 238 */,
  29864. /* 239 */,
  29865. /* 240 */,
  29866. /* 241 */,
  29867. /* 242 */,
  29868. /* 243 */,
  29869. /* 244 */,
  29870. /* 245 */,
  29871. /* 246 */,
  29872. /* 247 */,
  29873. /* 248 */,
  29874. /* 249 */,
  29875. /* 250 */,
  29876. /* 251 */,
  29877. /* 252 */,
  29878. /* 253 */,
  29879. /* 254 */,
  29880. /* 255 */,
  29881. /* 256 */,
  29882. /* 257 */,
  29883. /* 258 */,
  29884. /* 259 */,
  29885. /* 260 */,
  29886. /* 261 */,
  29887. /* 262 */,
  29888. /* 263 */,
  29889. /* 264 */,
  29890. /* 265 */,
  29891. /* 266 */,
  29892. /* 267 */,
  29893. /* 268 */,
  29894. /* 269 */
  29895. /*!************************************************************************************************************************!*\
  29896. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/z-paging-main.js?vue&type=script&lang=js& ***!
  29897. \************************************************************************************************************************/
  29898. /*! no static exports found */
  29899. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  29900. "use strict";
  29901. __webpack_require__.r(__webpack_exports__);
  29902. /* harmony import */ var _tool_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_z_paging_main_js_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib!../../../../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--12-1!../../../../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./z-paging-main.js?vue&type=script&lang=js& */ 270);
  29903. /* harmony import */ var _tool_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_z_paging_main_js_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tool_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_z_paging_main_js_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__);
  29904. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _tool_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_z_paging_main_js_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _tool_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_z_paging_main_js_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  29905. /* harmony default export */ __webpack_exports__["default"] = (_tool_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_z_paging_main_js_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default.a);
  29906. /***/ }),
  29907. /* 270 */
  29908. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  29909. !*** ./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--12-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/z-paging-main.js?vue&type=script&lang=js& ***!
  29910. \***************************************************************************************************************************************************************************************************************************************************************************************************************/
  29911. /*! no static exports found */
  29912. /***/ (function(module, exports, __webpack_require__) {
  29913. "use strict";
  29914. /* 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 */ 22));
  29915. var _zPagingStatic = _interopRequireDefault(__webpack_require__(/*! ./z-paging-static */ 271));
  29916. var _zPagingConstant = _interopRequireDefault(__webpack_require__(/*! ./z-paging-constant */ 272));
  29917. var _zPagingUtils = _interopRequireDefault(__webpack_require__(/*! ./z-paging-utils */ 273));
  29918. var _dataHandle = _interopRequireDefault(__webpack_require__(/*! ./modules/data-handle */ 279));
  29919. var _i18n = _interopRequireDefault(__webpack_require__(/*! ./modules/i18n */ 281));
  29920. var _nvue = _interopRequireDefault(__webpack_require__(/*! ./modules/nvue */ 282));
  29921. var _empty = _interopRequireDefault(__webpack_require__(/*! ./modules/empty */ 283));
  29922. var _refresher = _interopRequireDefault(__webpack_require__(/*! ./modules/refresher */ 284));
  29923. var _loadMore = _interopRequireDefault(__webpack_require__(/*! ./modules/load-more */ 285));
  29924. var _scroller = _interopRequireDefault(__webpack_require__(/*! ./modules/scroller */ 286));
  29925. var _backToTop = _interopRequireDefault(__webpack_require__(/*! ./modules/back-to-top */ 287));
  29926. var _zPagingEnum = _interopRequireDefault(__webpack_require__(/*! ./z-paging-enum */ 280));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);});};}var zPagingRefresh = function zPagingRefresh() {__webpack_require__.e(/*! require.ensure | uni_modules/z-paging/components/z-paging/components/z-paging-refresh */ "uni_modules/z-paging/components/z-paging/components/z-paging-refresh").then((function () {return resolve(__webpack_require__(/*! ../components/z-paging-refresh */ 357));}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);};var zPagingLoadMore = function zPagingLoadMore() {__webpack_require__.e(/*! require.ensure | uni_modules/z-paging/components/z-paging/components/z-paging-load-more */ "uni_modules/z-paging/components/z-paging/components/z-paging-load-more").then((function () {return resolve(__webpack_require__(/*! ../components/z-paging-load-more */ 364));}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);};var zPagingEmptyView = function zPagingEmptyView() {__webpack_require__.e(/*! require.ensure | uni_modules/z-paging/components/z-paging-empty-view/z-paging-empty-view */ "uni_modules/z-paging/components/z-paging-empty-view/z-paging-empty-view").then((function () {return resolve(__webpack_require__(/*! ../../z-paging-empty-view/z-paging-empty-view */ 350));}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);};
  29927. var systemInfo = uni.getSystemInfoSync();var _default2 =
  29928. {
  29929. name: "z-paging",
  29930. components: {
  29931. zPagingRefresh: zPagingRefresh,
  29932. zPagingLoadMore: zPagingLoadMore,
  29933. zPagingEmptyView: zPagingEmptyView },
  29934. mixins: [
  29935. _dataHandle.default,
  29936. _i18n.default,
  29937. _nvue.default,
  29938. _empty.default,
  29939. _refresher.default,
  29940. _loadMore.default,
  29941. _scroller.default,
  29942. _backToTop.default],
  29943. data: function data() {
  29944. return {
  29945. //--------------静态资源---------------
  29946. base64Arrow: _zPagingStatic.default.base64Arrow,
  29947. base64Flower: _zPagingStatic.default.base64Flower,
  29948. base64BackToTop: _zPagingStatic.default.base64BackToTop,
  29949. //-------------全局数据相关--------------
  29950. //当前加载类型
  29951. loadingType: _zPagingEnum.default.LoadingType.Refresher,
  29952. requestTimeStamp: 0,
  29953. chatRecordLoadingMoreText: '',
  29954. wxsPropType: '',
  29955. renderPropScrollTop: -1,
  29956. renderPropUsePageScroll: -1,
  29957. checkScrolledToBottomTimeOut: null,
  29958. systemInfo: null,
  29959. cssSafeAreaInsetBottom: -1,
  29960. cacheTopHeight: 0,
  29961. //--------------状态&判断---------------
  29962. insideOfPaging: -1,
  29963. loading: false,
  29964. loadingForNow: false,
  29965. isLoadFailed: false,
  29966. isIos: systemInfo.platform === 'ios',
  29967. disabledBounce: false,
  29968. fromCompleteEmit: false,
  29969. disabledCompleteEmit: false,
  29970. //---------------wxs相关---------------
  29971. wxsIsScrollTopInTopRange: true,
  29972. wxsScrollTop: 0,
  29973. wxsPageScrollTop: 0,
  29974. wxsOnPullingDown: false };
  29975. },
  29976. props: {
  29977. //调用complete后延迟处理的时间,单位为毫秒,默认0毫秒,优先级高于minDelay
  29978. delay: {
  29979. type: [Number, String],
  29980. default: _zPagingUtils.default.gc('delay', 0) },
  29981. //触发@query后最小延迟处理的时间,单位为毫秒,默认0毫秒,优先级低于delay(假设设置为300毫秒,若分页请求时间小于300毫秒,则在调用complete后延迟[300毫秒-请求时长];若请求时长大于300毫秒,则不延迟),当show-refresher-when-reload为true或reload(true)时,其最小值为400
  29982. minDelay: {
  29983. type: [Number, String],
  29984. default: _zPagingUtils.default.gc('minDelay', 0) },
  29985. //设置z-paging的style,部分平台(如微信小程序)无法直接修改组件的style,可使用此属性代替
  29986. pagingStyle: {
  29987. type: Object,
  29988. default: function _default() {
  29989. return _zPagingUtils.default.gc('pagingStyle', {});
  29990. } },
  29991. //z-paging的高度,优先级低于pagingStyle中设置的height;传字符串,如100px、100rpx、100%
  29992. height: {
  29993. type: String,
  29994. default: _zPagingUtils.default.gc('height', '') },
  29995. //z-paging的宽度,优先级低于pagingStyle中设置的width;传字符串,如100px、100rpx、100%
  29996. width: {
  29997. type: String,
  29998. default: _zPagingUtils.default.gc('width', '') },
  29999. //z-paging的背景色,优先级低于pagingStyle中设置的background。传字符串,如"#ffffff"
  30000. bgColor: {
  30001. type: String,
  30002. default: _zPagingUtils.default.gc('bgColor', '') },
  30003. //设置z-paging的容器(插槽的父view)的style
  30004. pagingContentStyle: {
  30005. type: Object,
  30006. default: function _default() {
  30007. return _zPagingUtils.default.gc('pagingContentStyle', {});
  30008. } },
  30009. //z-paging是否自动高度,若自动高度则会自动铺满屏幕
  30010. autoHeight: {
  30011. type: Boolean,
  30012. default: _zPagingUtils.default.gc('autoHeight', false) },
  30013. //z-paging是否自动高度时,附加的高度,注意添加单位px或rpx,若需要减少高度,则传负数
  30014. autoHeightAddition: {
  30015. type: [Number, String],
  30016. default: _zPagingUtils.default.gc('autoHeightAddition', '0px') },
  30017. //loading(下拉刷新、上拉加载更多)的主题样式,支持black,white,默认black
  30018. defaultThemeStyle: {
  30019. type: String,
  30020. default: function _default() {
  30021. return _zPagingUtils.default.gc('defaultThemeStyle', 'black');
  30022. } },
  30023. //是否使用虚拟列表,默认为否
  30024. useVirtualList: {
  30025. type: Boolean,
  30026. default: _zPagingUtils.default.gc('useVirtualList', false) },
  30027. //z-paging是否使用fixed布局,若使用fixed布局,则z-paging的父view无需固定高度,z-paging高度默认为100%,默认为是(当使用内置scroll-view滚动时有效)
  30028. fixed: {
  30029. type: Boolean,
  30030. default: _zPagingUtils.default.gc('fixed', true) },
  30031. //是否开启底部安全区域适配
  30032. safeAreaInsetBottom: {
  30033. type: Boolean,
  30034. default: _zPagingUtils.default.gc('safeAreaInsetBottom', false) },
  30035. //第一次加载后自动隐藏loading slot,默认为是
  30036. autoHideLoadingAfterFirstLoaded: {
  30037. type: Boolean,
  30038. default: _zPagingUtils.default.gc('autoHideLoadingAfterFirstLoaded', true) },
  30039. //loading slot是否铺满屏幕并固定,默认为否
  30040. loadingFullFixed: {
  30041. type: Boolean,
  30042. default: _zPagingUtils.default.gc('loadingFullFixed', false) },
  30043. //slot="top"的view的z-index,默认为99,仅使用页面滚动时有效
  30044. topZIndex: {
  30045. type: Number,
  30046. default: _zPagingUtils.default.gc('topZIndex', 99) },
  30047. //z-paging内容容器父view的z-index,默认为1
  30048. superContentZIndex: {
  30049. type: Number,
  30050. default: _zPagingUtils.default.gc('superContentZIndex', 1) },
  30051. //z-paging内容容器部分的z-index,默认为10
  30052. contentZIndex: {
  30053. type: Number,
  30054. default: _zPagingUtils.default.gc('contentZIndex', 10) },
  30055. //使用页面滚动时,是否在不满屏时自动填充满屏幕,默认为是
  30056. autoFullHeight: {
  30057. type: Boolean,
  30058. default: _zPagingUtils.default.gc('autoFullHeight', true) },
  30059. //是否将错误信息打印至控制台,默认为是
  30060. showConsoleError: {
  30061. type: Boolean,
  30062. default: _zPagingUtils.default.gc('showConsoleError', true) } },
  30063. mounted: function mounted() {var _this = this;
  30064. this.wxsPropType = _zPagingUtils.default.getTime().toString();
  30065. this.renderJsIgnore;
  30066. if (!this.refresherOnly && this.mountedAutoCallReload && this.auto) {
  30067. this.$nextTick(function () {
  30068. _this._preReload();
  30069. });
  30070. }
  30071. var delay = 0;
  30072. delay = 100;
  30073. this.$nextTick(function () {
  30074. _this.systemInfo = uni.getSystemInfoSync();
  30075. if (!_this.usePageScroll && _this.autoHeight) {
  30076. _this._setAutoHeight();
  30077. }
  30078. _this.loaded = true;
  30079. });
  30080. this.updatePageScrollTopHeight();
  30081. this.updatePageScrollBottomHeight();
  30082. if (this.finalRefresherEnabled && this.useCustomRefresher) {
  30083. this.$nextTick(function () {
  30084. _this.isTouchmoving = true;
  30085. });
  30086. }
  30087. this._onEmit();
  30088. this.$nextTick(function () {
  30089. setTimeout(function () {
  30090. _this._getCssSafeAreaInsetBottom();
  30091. }, delay);
  30092. });
  30093. },
  30094. destroyed: function destroyed() {
  30095. this._offEmit();
  30096. },
  30097. watch: {
  30098. loadingStatus: function loadingStatus(newVal, oldVal) {var _this2 = this;
  30099. this.$emit('loadingStatusChange', newVal);
  30100. this.$nextTick(function () {
  30101. _this2.loadingStatusAfterRender = newVal;
  30102. });
  30103. },
  30104. loading: function loading(newVal) {
  30105. if (newVal) {
  30106. this.loadingForNow = newVal;
  30107. }
  30108. },
  30109. defaultThemeStyle: {
  30110. handler: function handler(newVal) {
  30111. if (newVal.length) {
  30112. this.finalRefresherDefaultStyle = newVal;
  30113. }
  30114. },
  30115. immediate: true },
  30116. autoHeight: function autoHeight(newVal, oldVal) {
  30117. if (this.loaded && !this.usePageScroll) {
  30118. this._setAutoHeight(newVal);
  30119. }
  30120. },
  30121. autoHeightAddition: function autoHeightAddition(newVal, oldVal) {
  30122. if (this.loaded && !this.usePageScroll && this.autoHeight) {
  30123. this._setAutoHeight(newVal);
  30124. }
  30125. } },
  30126. computed: {
  30127. zScopedSlots: function zScopedSlots() {
  30128. return this.$scopedSlots;
  30129. },
  30130. finalPagingStyle: function finalPagingStyle() {
  30131. var pagingStyle = this.pagingStyle;
  30132. if (!this.systemInfo) return pagingStyle;
  30133. var windowTop = this.systemInfo.windowTop;
  30134. var windowBottom = this.systemInfo.windowBottom;
  30135. if (!this.usePageScroll && this.fixed) {
  30136. if (windowTop && !pagingStyle.top) {
  30137. pagingStyle.top = windowTop + 'px';
  30138. }
  30139. if (!pagingStyle.bottom) {
  30140. var bottom = windowBottom ? windowBottom : 0;
  30141. if (this.safeAreaInsetBottom) {
  30142. bottom += this.safeAreaBottom;
  30143. }
  30144. if (bottom > 0) {
  30145. pagingStyle.bottom = bottom + 'px';
  30146. }
  30147. }
  30148. }
  30149. if (this.bgColor.length && !pagingStyle['background']) {
  30150. pagingStyle['background'] = this.bgColor;
  30151. }
  30152. if (this.height.length && !pagingStyle['height']) {
  30153. pagingStyle['height'] = this.height;
  30154. }
  30155. if (this.width.length && !pagingStyle['width']) {
  30156. pagingStyle['width'] = this.width;
  30157. }
  30158. return pagingStyle;
  30159. },
  30160. finalLowerThreshold: function finalLowerThreshold() {
  30161. return _zPagingUtils.default.convertTextToPx(this.lowerThreshold);
  30162. },
  30163. finalPagingContentStyle: function finalPagingContentStyle() {
  30164. if (this.contentZIndex != 1) {
  30165. this.pagingContentStyle['z-index'] = this.contentZIndex;
  30166. this.pagingContentStyle['position'] = 'relative';
  30167. }
  30168. return this.pagingContentStyle;
  30169. },
  30170. showLoading: function showLoading() {
  30171. if (this.firstPageLoaded || !this.loading || !this.loadingForNow) return false;
  30172. if (this.autoHideLoadingAfterFirstLoaded) {
  30173. return this.fromEmptyViewReload ? true : !this.pagingLoaded;
  30174. } else {
  30175. return this.loadingType === _zPagingEnum.default.LoadingType.Refresher;
  30176. }
  30177. },
  30178. safeAreaBottom: function safeAreaBottom() {
  30179. if (!this.systemInfo) return 0;
  30180. var safeAreaBottom = 0;
  30181. safeAreaBottom = this.cssSafeAreaInsetBottom === -1 ? 0 : this.cssSafeAreaInsetBottom;
  30182. return safeAreaBottom;
  30183. },
  30184. renderJsIgnore: function renderJsIgnore() {var _this3 = this;
  30185. if (this.usePageScroll && this.useChatRecordMode || !this.refresherEnabled || !this.useCustomRefresher) {
  30186. this.$nextTick(function () {
  30187. _this3.renderPropScrollTop = 10;
  30188. });
  30189. }
  30190. return 0;
  30191. },
  30192. windowHeight: function windowHeight() {
  30193. return !this.systemInfo ? 0 : this.systemInfo.windowHeight || 0;
  30194. },
  30195. windowTop: function windowTop() {
  30196. return !this.systemInfo ? 0 : this.systemInfo.windowTop || 0;
  30197. },
  30198. windowBottom: function windowBottom() {
  30199. if (!this.systemInfo) return 0;
  30200. var windowBottom = this.systemInfo.windowBottom || 0;
  30201. if (this.safeAreaInsetBottom) {
  30202. windowBottom += this.safeAreaBottom;
  30203. }
  30204. return windowBottom;
  30205. } },
  30206. methods: {
  30207. //当前版本号
  30208. getVersion: function getVersion() {
  30209. return "z-paging v".concat(zConstant.version);
  30210. },
  30211. //设置nvue List的specialEffects
  30212. setSpecialEffects: function setSpecialEffects(args) {
  30213. this.setListSpecialEffects(args);
  30214. },
  30215. //与setSpecialEffects等效,兼容旧版本
  30216. setListSpecialEffects: function setListSpecialEffects(args) {
  30217. this.nFixFreezing = args !== {};
  30218. if (this.isIos) {
  30219. this.privateRefresherEnabled = 0;
  30220. }
  30221. if (!this.usePageScroll) {
  30222. this.$refs['n-list'].setSpecialEffects(args);
  30223. }
  30224. },
  30225. //处理开始加载更多状态
  30226. _startLoading: function _startLoading() {var isReload = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  30227. if (this.showLoadingMoreWhenReload && !this.isUserPullDown || !isReload) {
  30228. this.loadingStatus = _zPagingEnum.default.More.Loading;
  30229. }
  30230. this.loading = true;
  30231. },
  30232. //检测scrollView是否要铺满屏幕
  30233. _doCheckScrollViewShouldFullHeight: function _doCheckScrollViewShouldFullHeight(totalData) {var _this4 = this;
  30234. if (this.autoFullHeight && this.usePageScroll && this.isTotalChangeFromAddData) {
  30235. this.$nextTick(function () {
  30236. _this4._checkScrollViewShouldFullHeight(function (scrollViewNode, pagingContainerNode) {
  30237. _this4._preCheckShowLoadingMoreWhenNoMoreAndInsideOfPaging(totalData, scrollViewNode, pagingContainerNode);
  30238. });
  30239. });
  30240. } else {
  30241. this._preCheckShowLoadingMoreWhenNoMoreAndInsideOfPaging(totalData);
  30242. }
  30243. },
  30244. //检测z-paging是否要全屏覆盖(当使用页面滚动并且不满全屏时,默认z-paging需要铺满全屏,避免数据过少时内部的empty-view无法正确展示)
  30245. _checkScrollViewShouldFullHeight: function _checkScrollViewShouldFullHeight(callback) {var _this5 = this;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee() {var scrollViewNode, pagingContainerNode, scrollViewHeight, scrollViewTop;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:_context.prev = 0;_context.next = 3;return (
  30246. _this5._getNodeClientRect('.zp-scroll-view'));case 3:scrollViewNode = _context.sent;_context.next = 6;return (
  30247. _this5._getNodeClientRect('.zp-paging-container-content'));case 6:pagingContainerNode = _context.sent;if (!(
  30248. !scrollViewNode || !pagingContainerNode)) {_context.next = 9;break;}return _context.abrupt("return");case 9:
  30249. scrollViewHeight = pagingContainerNode[0].height;
  30250. scrollViewTop = scrollViewNode[0].top;
  30251. if (_this5.isAddedData && scrollViewHeight + scrollViewTop <= _this5.windowHeight) {
  30252. _this5._setAutoHeight(true, scrollViewNode);
  30253. callback(scrollViewNode, pagingContainerNode);
  30254. } else {
  30255. _this5._setAutoHeight(false);
  30256. callback(null, null);
  30257. }_context.next = 17;break;case 14:_context.prev = 14;_context.t0 = _context["catch"](0);
  30258. callback(null, null);case 17:case "end":return _context.stop();}}}, _callee, null, [[0, 14]]);}))();
  30259. },
  30260. //设置z-paging高度
  30261. _setAutoHeight: function _setAutoHeight() {var _arguments = arguments,_this6 = this;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee2() {var shouldFullHeight, scrollViewNode, heightKey, finalScrollViewNode, finalScrollBottomNode, scrollViewTop, scrollViewHeight, additionHeight;return _regenerator.default.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:shouldFullHeight = _arguments.length > 0 && _arguments[0] !== undefined ? _arguments[0] : true;scrollViewNode = _arguments.length > 1 && _arguments[1] !== undefined ? _arguments[1] : null;
  30262. heightKey = 'height';
  30263. if (_this6.usePageScroll) {
  30264. heightKey = 'min-height';
  30265. }_context2.prev = 4;if (!
  30266. shouldFullHeight) {_context2.next = 20;break;}if (!
  30267. scrollViewNode) {_context2.next = 10;break;}_context2.t0 = scrollViewNode;_context2.next = 13;break;case 10:_context2.next = 12;return _this6._getNodeClientRect('.scroll-view');case 12:_context2.t0 = _context2.sent;case 13:finalScrollViewNode = _context2.t0;_context2.next = 16;return (
  30268. _this6._getNodeClientRect('.zp-page-scroll-bottom'));case 16:finalScrollBottomNode = _context2.sent;
  30269. if (finalScrollViewNode) {
  30270. scrollViewTop = finalScrollViewNode[0].top;
  30271. scrollViewHeight = _this6.windowHeight - scrollViewTop;
  30272. if (finalScrollBottomNode) {
  30273. scrollViewHeight -= finalScrollBottomNode[0].height;
  30274. }
  30275. additionHeight = _zPagingUtils.default.convertTextToPx(_this6.autoHeightAddition);
  30276. _this6.$set(_this6.scrollViewStyle, heightKey, scrollViewHeight + additionHeight - (_this6.insideMore ? 1 : 0) + 'px');
  30277. _this6.$set(_this6.scrollViewInStyle, heightKey, scrollViewHeight + additionHeight - (_this6.insideMore ? 1 : 0) + 'px');
  30278. }_context2.next = 22;break;case 20:
  30279. _this6.$delete(_this6.scrollViewStyle, heightKey);
  30280. _this6.$delete(_this6.scrollViewInStyle, heightKey);case 22:_context2.next = 26;break;case 24:_context2.prev = 24;_context2.t1 = _context2["catch"](4);case 26:case "end":return _context2.stop();}}}, _callee2, null, [[4, 24]]);}))();
  30281. },
  30282. //通过获取css设置的底部安全区域占位view高度设置bottom距离
  30283. _getCssSafeAreaInsetBottom: function _getCssSafeAreaInsetBottom() {var _this7 = this;
  30284. this._getNodeClientRect('.zp-safe-area-inset-bottom').then(function (res) {
  30285. if (res) {
  30286. _this7.cssSafeAreaInsetBottom = res[0].height;
  30287. if (_this7.safeAreaInsetBottom) {
  30288. _this7.updatePageScrollBottomHeight();
  30289. }
  30290. }
  30291. });
  30292. },
  30293. //触发更新是否超出页面状态
  30294. _updateInsideOfPaging: function _updateInsideOfPaging() {var _this8 = this;
  30295. if (this.insideMore && this.insideOfPaging === true) {
  30296. setTimeout(function () {
  30297. _this8.doLoadMore();
  30298. }, 200);
  30299. }
  30300. },
  30301. //获取节点尺寸
  30302. _getNodeClientRect: function _getNodeClientRect(select) {var inThis = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;var scrollOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  30303. var res = inThis ? uni.createSelectorQuery().in(this) : uni.createSelectorQuery();
  30304. if (scrollOffset) {
  30305. res.select(select).scrollOffset();
  30306. } else {
  30307. res.select(select).boundingClientRect();
  30308. }
  30309. return new Promise(function (resolve, reject) {
  30310. res.exec(function (data) {
  30311. resolve(data && data != '' && data != undefined && data.length ? data : false);
  30312. });
  30313. });
  30314. },
  30315. //清除timeout
  30316. _cleanTimeout: function _cleanTimeout(timeout) {
  30317. if (timeout) {
  30318. clearTimeout(timeout);
  30319. timeout = null;
  30320. }
  30321. return timeout;
  30322. },
  30323. //添加全局emit监听
  30324. _onEmit: function _onEmit() {var _this9 = this;
  30325. uni.$on(_zPagingConstant.default.i18nUpdateKey, function () {
  30326. _this9.tempLanguageUpdateKey = _zPagingUtils.default.getTime();
  30327. });
  30328. uni.$on(_zPagingConstant.default.errorUpdateKey, function () {
  30329. if (_this9.loading) {
  30330. _this9.complete(false);
  30331. }
  30332. });
  30333. uni.$on(_zPagingConstant.default.completeUpdateKey, function (data) {
  30334. setTimeout(function () {
  30335. if (_this9.loading) {
  30336. if (!_this9.disabledCompleteEmit) {
  30337. var type = data.type || 'normal';
  30338. var list = data.list || data;
  30339. var rule = data.rule;
  30340. _this9.fromCompleteEmit = true;
  30341. switch (type) {
  30342. case 'normal':
  30343. _this9.complete(list);
  30344. break;
  30345. case 'total':
  30346. _this9.completeByTotal(list, rule);
  30347. break;
  30348. case 'nomore':
  30349. _this9.completeByNoMore(list, rule);
  30350. break;
  30351. case 'key':
  30352. _this9.completeByKey(list, rule);
  30353. break;
  30354. default:
  30355. break;}
  30356. } else {
  30357. _this9.disabledCompleteEmit = false;
  30358. }
  30359. }
  30360. }, 1);
  30361. });
  30362. },
  30363. //销毁全局emit监听
  30364. _offEmit: function _offEmit() {
  30365. uni.$off(_zPagingConstant.default.i18nUpdateKey);
  30366. uni.$off(_zPagingConstant.default.errorUpdateKey);
  30367. uni.$off(_zPagingConstant.default.completeUpdateKey);
  30368. } } };exports.default = _default2;
  30369. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  30370. /***/ }),
  30371. /* 271 */
  30372. /*!*************************************************************************************************!*\
  30373. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/z-paging-static.js ***!
  30374. \*************************************************************************************************/
  30375. /*! no static exports found */
  30376. /***/ (function(module, exports, __webpack_require__) {
  30377. "use strict";
  30378. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // [z-paging]公用的静态图片资源
  30379. var base64Arrow = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkBAMAAACCzIhnAAAAD1BMVEVHcExRUVFMTExRUVFRUVE9CdWsAAAABHRSTlMAjjrY9ZnUjwAAAQFJREFUWMPt2MsNgzAMgGEEE1B1gKJmAIRYoCH7z9RCXrabh33iYktcIv35EEg5ZBh07pvxJU6MFSPOSRnjnBUjUsaciRUjMsb4xIoRCWNiYsUInzE5sWKEyxiYWDbyefqHx1zIeiYTk7mQYziTYecxHvEJjwmIT3hMQELCYSISEg4TkZj0mYTEpM8kJCU9JiMp6TEZyUmbAUhO2gxAQNJiIAKSFgMRmNQZhMCkziAEJTUGIyipMRjBSZkhCE7KDEFIUmTeGCHJxWz0zXaE0GTCG8ZFtEaS347r/1fe11YyHYVfubxayfjoHmc0YYwmmmiiiSaaaKLJ7ckyz5ve+dw3Xw2emdwm9xSbAAAAAElFTkSuQmCC';
  30380. var base64ArrowWhite = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkBAMAAACCzIhnAAAAElBMVEVHcEz///////////////////+IGTx/AAAABnRSTlMA/dAkXZOhASU/AAABYElEQVRYw+2YwXLCIBCGsdAHWGbyAKZ4zxi9O017rxLf/1UaWFAgA1m8dcpedNSPf/l/Vh0Ya/Wn6hN0JcGvoCqRM4C8VBFiDwBqqNuJKV0rAnCgy3AUqZE57x0iqTL8Br4U3WBf/YWaIlTKfAcELU/h9w72CSVPa3C3OCDvhpHbRp/s2vq4fHhCeiCl2A3m4Qd71DQR257mFBlMcTlbFnFWzNtHxewYEfSiaLS4el8d8nyhmKJd1CF4eOS0keLMAuSxubLBIeIGQW8YHCFFo7EH9+YDcQt9FMZEswTheaNxTHwHT8SZorJjMrEVwo4Zo0U8HSEyZvJMOg4RjnmmRr8nDYeIz3OMkbfE/QhBo+U9RnZJxjGCRh/WKmHEMWLNkfPKsGh/CWJk1JjG0kcuJggTt34VDP8aWAFhp4nybVb5+9qQhjSkIQ1pSEMa8k+Q5U9rV3dF8MpFBK+/7miVq1/HZ2qmo9D+pAAAAABJRU5ErkJggg==';
  30381. var base64Flower = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkBAMAAACCzIhnAAAAKlBMVEVHcEzDw8Ovr6+pqamUlJTCwsKenp61tbWxsbGysrLNzc2bm5u5ubmjo6MpovhuAAAACnRSTlMA/P79/sHDhiZS0DxZowAABBBJREFUWMPtl89rE0EUx7ctTXatB3MI1SWnDbUKPUgXqh4ED8Uf7KUVSm3ooVSpSii0Fn/gD4j4o+APiEoVmos9FO2celiqZVgwgaKHPQiCCkv+F99kM7Ozm5kxq1dfD91k9pPve9/3ZjbRNHHok/mKli4eIPNgSuRObuN9SqSEzM20iGnm0yIbqCuV7NSSSIV7uyPM6JMBYdeTOanh/QihJYZsUCSby+VkMj2AvOt0rAeQAwqE3lfKMZVlQCZk1QOCKkkVPadITCfIRNKxfoJI5+0OIFtJx14CMSg1mRSDko7VAfksRQzEbGYqxOJcVTWMCH2I1/IACNW0PWU2M8cmAVHtnH5mM1VRWtwKZjOd5JbF6s1IbaYqaotjNlPHgDAnlAizubTR6ovMYn052g/U5qcmOpi0WL8xTS/3IfSet5m8MEr5ajjF5le6dq/OJpobrdY0t3i9QgefWrxW9/1BLhk0E9m8FeUMhhXal499iD0eQRfDF+ts/tttORRerfp+oV7f4xJj82iUYm1Yzod+ZQEAlS/8mMBwKebVmCVp1f0JLS6zKd17+iwRKTARVg2SHtz3iEbBH+Q+U28zW2Jiza8Tjb1YFoYZMsJyjDqp3M9XBQdSdPLFdxEpvOB37JrHcmR/y9+LgoTlCFGZEa2sc6d4PGlweEa2JSVPoVm+IfGG3ZL037iV9oH+P+Jxc4HGVflNq1M0pivao/EopO4b/ojVCP9GjmiXOeS0DOn1o/iiccT4ORnyvBGF3yUywkQajW4Ti0SGuiy/wVSg/L8w+X/8Q+hvUx8Xd90z4oV5a1i88MbFWHz0WZZ1UrTwBGPX3Rat9AFiXRMRjoMdIdJLEOt2h7jrYOzgOamKZSWSNspOS0X8SAqRYmxRL7sg4eLzYmNehcxh3uoyud/BH2Udux4ywxFTc1xC7Mgf4vMhc5S+kSH3Y7yj+qpwIWSoPTVCOOPVthGx9FbGqrwFw6wSFxJr+17zeKcztt3u+2roAEVgUjDd+AHGuxHy2rZHaa8JMkTHEeyi85ANPO9j9BVuBRD2FY5LDMo/Sz/2hReqGIs/KiFin+CsPsYO/yvM3jL2vE8EbX7/Bf8ejtr2GLN65bioAdgLd8Bis/mD5GmP2qeqyo2ZwQEOtAjRIDH7mBKpUcMoApbZJ5UIxkEwxyMZyMxW/uKFvHCFR3SSmerHyDNQ2dF4JG6zIMpBgLfjSF9x1D6smFcYnGApjmSLICO3ecCDWrQ48geba9DI3STy2i7ax6WIB62fSyIZIiO3GFQqSURp8wCo7GhJBGwuSovJBNjb7kT6FPVnIa9qJ2Ko+l9mefGIdinaMp0yC1URYiwsdfNE45EuA5Cx9EhalfvN5s+UyItm81vaB3p4joniN+SCP7Qc1hblAAAAAElFTkSuQmCC';
  30382. var base64FlowerWhite = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkBAMAAACCzIhnAAAAElBMVEX///9HcEz///////////////84chYNAAAABnRSTlP/AGzCOYZj5g1nAAACfklEQVRYw+2YTVPDIBCGtza9Jw25a0bvcax30o73OOr//yvma2F3YWlpPTijXNpAHrK8LLALVPFium2vNIFSbwGKTGQA2GUiHcD29yDNy3sMIdUBQl7r2H8mOEVqAHgPkYZUS6Qc2zYhQqtjyDZEximCZwWZLIBeIgYShs2NzxKpSUehYpMJhURGb+O+w5BpMCAREKPnCDHbIY20SzhM5yxziAXpOiBXydrekT9i5XDEq4NIIHHgyU5mRGqviII4mREJJA4QJzMiILwlRJzpKxJKvCBm8OsBBbLux0tsPl4RKYm5aPu6jw1U4mGxEUR9g8M1PcqBEp/WJliNgYOXueBzS4jZSIcgY5lCtevgDSgyzE+rAfuOTQMq0yzvoGH18qju27Mayzs4fPyMziCx81NJa5RNfW7vPYK9KOfDiVkBxFHG8hAj9txuoBuSWORsFfkpBf7xKFLSeaOefEojh5jz22DJEqMP8fUyaKdQx+RnG+yXMpe8Aars8ueR1pVH/bW3FyyvPRw90upLDHwpgBDtg4aUBNkxRLXMAi03IhcZtr1m+FeI/O/JNyDmmL1djLOauSlNflBpW18RQ2bPqXI22MXXEk75KRHTnkPkYbESbdKP2ZFk0r5sIwffAjy1lx+vx7NLjB6/E7Jfv5ERKhzpN0w8IDE8IGFDv5dhz10s7GFiXRZcUeLCEG5P5nDq9k4PFDcoMpE3GY4OuxuCXhmuyNB6k0RsLIAvqp9NE5r8ZCSS8gxnUp7ODdYhZTqxuiJ9uyJJtPmpqJ7wVj+XVieS903iViHziqAhchLEJAyb7jWU647EpUofQ0ziUuXXXhDddtlllSwjgSQu7r4BRWhQqfDPMVwAAAAASUVORK5CYII=';
  30383. var base64Success = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkBAMAAACCzIhnAAAAElBMVEVRUVFHcExTU1NRUVFRUVFRUVFOSlSUAAAABnRSTlP/AI6+VySB3ZENAAACcElEQVRYw+2YyYKCMAyGI8hdpdxdZu7gcpdZ7jL6/s8yYheSNi0aPdqbwOffpGmaFOYPD3gj4bisN7vddv17N/JVgxn5x12IWgIaWTuO/IE3PseQbwjGPo2cgRmHFLJwdm/X643zwiqOKPPJ1nj3sjEP2iiifZWj5bhopSyGaEO2HX5fbQJzwJ+W7x/jw5ZFjsEU0PMph9xE8i5EqprKALW95eJQURkgzw98uJ/JvwGecR7bIjWWsUgVrrIfFZ2HlLy3sKETD1mmRLRMRhGVssRa0xJkdn3SpJBymBkM8+pSSDXMDNyDaToVHd2fgpNt0sjwiUZO19+jGQ+gQEg9Oq+bufmAVGihomNmjQG7UG3020vrlm7lkFnKFGU3kZ0KGAdmKe821pipQ+qEKcrZeTL2g5FsUks4cStjEZWwXg0b0n4GxmEpkWwIs5VBynjgK7xZaz1/0D7OxkVuLpsY5BQNFyLS84VBjjbg0iL2r2EQHBOxBhikuUOkdxODVF1cxHoWtPPsiyXO455Iv34hssCO8EV4ZIYTjS8SR4qYSHRiTiYQ4ZFbHi0iIhhBTi6dTCgSWRcnw4h4yGTuyTAiOGBIWGoZTgSHJQl+LcOJ4OCnW6yX2bMnJ9pidCOXtkTkTrIGpYuOynAiOF14SamMiOCk5Ke+mq8BcOrrvym8d0zKIQnWT+M1WwOQNO4fFiWb18hhERxJPx2fblbPHHyC41VyiAtKBUFBIih7JMWVoIQTFIr3lKPN80WvoLSWFPC653ioTZA0I0FrQ7qU6asaK0H7JmkSJa2ooOGVtNUsc3j9FYHkIkJy3SG6VHnfXKXGP9t4N9Q4Ye98AAAAAElFTkSuQmCC';
  30384. var base64SuccessWhite = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkBAMAAACCzIhnAAAAGFBMVEVHcEz///////////////////////////8dS1W+AAAAB3RSTlMAiVYk6KvDHLfaegAAAo1JREFUWMPtWEtzmzAQNhCTq910ytXpiyvxTNOr60zrayepx9d02gnX4sTm7xcEiJX2gdnkGJ1A4tOnfWqXyeR1vMRYzrcPD9v5h5MBl3/Ldvx4cxIg/FWC8X0xjLjalM54uhhCfCrRuJURX0pi3EmIqZV7O59vrRZmguStHL9b7S7ftfLwOtiZDw7AHMtmquAQ12b5Wwbnordm8g9zLLO49qc/m2n6aKnhwPOGZ08hAiNHhheiHae1lOUPGZpQkPKa3q0mOUjaRzSRaGUjpy/mmWSwySSpllcEteBKAT52KEnSbblA51pJEPxBQoiH1FP4E3s5+FJv07h6/ylD6ui7B+9fq/ehrFB98ghec9EoVtyjK8pqCHLmCBOwMWSCeWFNN4MbPAk55NhsvoFHSSVR0k5TCTTEzlUGcqV/nVp7n9oIVkmtaqbAEqEgfdgHJPwsEAyZ9r4VAZXFjpEwyaw3+H2v42KYxKhs1XvY/gSSGv+IHyUSuHXCeZhLAgVI3EjgSGo1Fb3xO0tGGU9S2/KAIbtjxpJASG73qox6w5LUq0cEOa+iIONIWIilQSQ0pPa2jgaRQAgQP7c0mITRWGxpMAmEQFN2NAQJNCV0mI6GIIEO47hlQ0ORQLd0nL+hoUjg1m6I1TRr8uYEAriBHLcVFQ5UEMiBe3XkTBEG04WXlGKGxPnMS305XQPA1Ocn2JiuAZwE66fxnKwBnDTuXxZTMq85lwW6kt5ndLqZPefiU1yvmktcUSooChJF2aMprhQlnKJQ5FxRKkcVRa+itNYU8Io2oVkY14w0NMWYlqft91Bj9VHq+ca3b43BxjWJmla0sfKohlfTVpPN+93L/yLQ/IjQ/O5Q/VR5HdL4D7mlxmjwVdELAAAAAElFTkSuQmCC';
  30385. var base64Empty = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADIBAMAAABfdrOtAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAbUExURdvc3EdwTMLBwcjIyLSzs/Hx8ff39////19dXXz7IJEAAAAFdFJOU/4A6J9QDyyutAAAB5VJREFUeNrtnM1z4jYYxhUHkR4hdu9eU7Z75Ct7jgPbs9ZZmSuTrUWPmXTA186e+LMrf0uWLMtf2WkHXQgzln88et5XeiVMwPQdGrhCrpAr5Aq5Qv4TkJ07OGQFMLp1B4VYCz+kDblDQhJGeH4eEDLBYdLOHwaDWNBPIeHLYJAJ3meQ83IoCMTHDBKOBoKYGOeM8G0gyD0LObnDQB5ZSCtTNCBfsM9AboaBPLCQcDAIM1zht/dQEkMsd1DjI4hpw2YzMtBJeBbydWpCTJs3YDKGX62YgfGoVwi9KwtZJAzcYHHRm7sYCKD390nQSIoO5JGZIEOYxNoZ4+deISYLyeL5hLHbJ2QK98W0kudMgJe9Qh73odhO+KZHyNYGvgQS9gmJKhUigwSj3iBPUhXxePWmxBqHw0Mej9WQ3qILVjLC177yxNxXQ/7uK+Mn1aNVLsGsBTaWrSAPobYl0aUHt2fIs2Rgz7c9QYL0pSTkSzILLFtAJMH1cidN998T9E0/Sg73/pEEwrgkYRh86wlC949gJsR6EobBcz8hHOVgKYi2m6kZtodIkjEQvF3QjbGpmplB4/lRgJhxgRS2N15iijAvPmByDtCxfQhPJ8J4CR82rgCCBILarScw6X0OcMUyYrFVmbxErl0ZacFIoloOLdJAO42qY+NMDss2kKS8xmiZxcCpFKXWvpRGbQqJp5ixyRfJMmR6x0Fk+z29kmgWDYI5ziFbdug/84HxvduhWhLOJ2StPDQrMJPSjNANklh8QhB7dBO0yTGRwn1fkOk8rbQjiB8Ymww+JuiuN0icmSccK4naLMWYa/euL0+m23GyM8kgAc6sYeL4z04Qa4WjGepcKIliO8EUGSk7d9OGWOsoK31OSdy8TQZ59Y/hWbaV1IVs5/Ed6UzGK4nANAJiyGhRsZPUg2yzLe9hLyiJIyCaDU7udC2uy9pnkKvidlBUEltzFAqxRhBrBZm7HfZnjEQI3boqTsJq15PUDEaKZLgiJYc8OZtCtnM/4G93OFYooXpvdy0guwWWNQkEHl/j7Jw1XRmtlS9HYJkSPjk1IUnyyRqUKQn45NSDlP1mcg9i6En1ZU2IADnEtHF1Q+JwIcS/d5YakPuDUamEShGUHHikAz9oQCaE0CsrpYjDBVkEHQYdyK+EkKPhVErxqh1xbJ/oQf4gEeVsOIEc41WJNAwcd9GBfCZJezXsJhAvH+ImEEIOzlwXgpw5wQ0gH3MIOcsiQAahZuSD69/UQyxcQEggiQARQseVFO/ASAMCgM9gjkHZmhLENzi1AOhA7ullkMWUrfHKfpMiDBHtDIx6yCS6jseEnDUe7zcT6DGCtnrIY3olZw1hrPHkfucIAJa1EDu/lsVEyVmGGA67coKijeogFnMxlEaAV5ghRdDm1kDuuatZTJBGgJdOthIzsvZbDWRRuh6ScgR4EQLgagQvRQIxxQ4sxqcR4GE+c4CkjZQQW9YF89Y4OFAjOCki5KmiDxsBL3PlSJWlAFVogaoIePlYi2ClCJAHRa/cmre5eqTii4uvisqQJxqnip6pNd68DhEvyEs5xIyHBNdh4thCKhU++10kD7Gy1Up1A/o56FKuRJQWSFCuf8dpbisxhqHSKlSSgvG7VTaFKO5TzYD5VMPUxEB2YJNiqq3xYJ0KrroH8mq7xpoXqEZgfgNRUQsDtTVvUOk3sLUKbqrBr7YGvkCkQNC/9SA+vTYtvERrxiKEmcogk4ZqCLUd59MIEiFYHlIoxelCaJWDMmtOPIa80XVLbkb6hzaEwwTcPEmV4AIRlBGNIEmuJBFwLAZoHClJ36J8h+wxihpCqJosAnJrSKwEcQOFAFeWN4RQMYc0Ao4Jhg5gpASzyWcDvjpuDIlTkrGGJEro1rHIjHKR3wJCAj+z5oyi11gJBkXy9QFJIiAu78d+pgSjuWhGN0gUAZAcEncSJf4LRrZ8I94WEmcNCJJqBWYjVbE9bg2JxiyrViBWty6QvO56D8jPVWLA4ZX8dfkxvJJPl8t8aCX+pU/Iz1SCf7lc4OBK0OWfQaKLP0TKjj96VvIp+/BDZjwNKF2ItV2vN7sWStAl87oWkm3dZ+k3lEMoYXe8cT1eq2TOePJDD8KfQdxu6iEPxanUZa4HmZRq3dunGsj3BzFq6yD3wnZNX4n2emI2hXyXQpi6RRZdfSgxHNuxVZBFdyVeBPDmCsiksxKUiDAUEKuzkvRUEs0V08pjVyU2/yqFmF2VZGYop3peitdUiQd1pnrL7qTE01tPzE6eaEKm23dQwh2jNlbiay+/245zl94abw45CzNPyqYQ2++kxHGV1crWzg4A2yvR+BY7wziwnRLN7+O36aA54+ZKGjxZYK3txJpxQyUNn5GwtquII4+ACiWtnvawduu1A3SVtH5uhTvAVSpBG7fDYz6RQ+M6JWjmKm6g+RvTla9UMtspu+s+37VbVCupNqPx43CsNawSb1PbtcmDfQWmUILW7rRXSPHtSq5k5ur0a/hb7DQCUiW3G71ejX/wvV1kSoyNbp8Wvyqn1lCIKvl6gNDkNBYzt0GHdr+Pt9xGl1//ncAVcoVcIVfIFXKFXCFXyP8I8i8SyTW4yTz2lwAAAABJRU5ErkJggg==';
  30386. var base64Error = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADIBAMAAABfdrOtAAAAJFBMVEVHcEzo6Oibm5ukpKSbm5uampqbm5ubm5u5ubnn5+fm5ub6+vpGpDPdAAAAC3RSTlMA/v4hb+u20dq8aQhnHL4AAATwSURBVHja7ZvNb+JGGMbdjjdVe3NPodzeMhj1ZMUGujkh28B9wKR7iwwBqafWSbPqsbm0uTWtVlrTS9v0Et9yqLQS/1zHNiTZMMB4bO92d+dRUITt8c/PvPPx2h4URUpKSkpKSkpK6m3K6lFN73Q+S/+es3W3fzabTh2Dl0FAXEM+BgrgeXxRsdILTDU9n7J0vz/+EsCYC9KEiSFc06pf5zouqAkjkGWo0OG5Fq6j2IwZ6I4/4DhyTxc20oUjAj5PRTTrwvGAZ9p+ADzlD4RDctCoLhb7JUP87xeLxS3BZUIQ+YNCFi8wRwc4GIqGRK/GkM+5ILV8kFflOmkkkH/LddJ4c05eSSfSyTvrZPEmnCw+UCeuk84QvTSnUF0uCL68fBle/swF+RL1QZ/EpU6gHtOsAM64pnjPwxgTLsjoBM58ODNaAXYBT5QeGdr0KwcEA8He0TkPBLCjUDNHpG4qlg8eTCzXht1FVd1MxTPHj5LTtUiSrKK+7iDf8wBGxk4If3arLv/HF4Tox0A2nlFIGp+CIA+LzSamgbp4TNvZjECtDAjyMcB5HybLO6NxsRA1vmFCNjguNXDGWygbRPXh/B+zn9zPWK5RCkT18QxA57YgAqE+HGS6/tAoD4JO0ts+M2tbyQJpc95a5oI0xXNhCZGQ/x8E0VSCkUZY6Z6CIE/qdO5eL+yPlW6tMMgefPs3o7Bdt8iguJj4DThlZSY/rJ0yB+RraLDK2jAQCHyr4zIhT9mQ7vowygMZjpgQG+CYUV2E1EWqixyzICr8eFFnBB5ba1Y4IIfeKQvysW7ssZrwQLEFmvCBM2U6oRkdI5Wgm1QnO8RUTDlASoiESIiESMh7BDHKhlhu/LbSNUuEqL3lu1p945vO3BArADiaum7vBGDUKQfSIjBykooyrRPQnTIglHFfSagHeqd4iErwa9duEebpckGQjx/VT4v5fC0XhJHAd1mPRvJAVMZiAeQzTpgHYrPKqkGnUEiX+dCoNS4UgniHMTnUS4iESIiE7IS0x+mnVAidglDwVcmQJpy2WQ8VC4UgogfbA1RE4Nuw3UghEBV2rKl7V5ygAJPSY9KGQbP01mVjA5Fa2f1kQN2U3k+M9POWB8gnJUNMZJioWTMzKwOklyxgDrCXVcMMEF90tXM9C2TiCqmfCdIRi/jeewNpyerKok9WkGuzfCdYC+fXRsmBxxpVGG2zY0ZBbieJKvPrDQce3lxppBhIjGFWGkVoxUEoZt0Mukn2XBQH0bTHZpaMIp2sU/6qasU70W6/eHjM09VmYSc6C6Jpvz+orKvVxot8kL3HkMr9IZ9qeZ2o6RrO9mOI9ufdIR9peZ2gNIW31yC/MpyI9ngUDNIsezPks3vIsWDGdYA7cZa9pbqUVeCr/neiaR3U3R4BfXPg75vwb8I/b7HjxChobDZCO+Ny4wuxxaVxPPowcoNnrzPmzGFlX3RJHz2FafbhJ41n8PLx2DCM7KkwQgpqka1DVzKdJNHfJwBe9l/n0eSZFsIPjVSY8xZKZpSXnogwled98wAx3xRcdBNq1f1fhFVdIcL5tvaDolC7XaqaWStEtLOJHkbhlSauMLrma4yHEa03AVUoIUs/M2NQFkchBZiGUPeKonAnqhLOo4hrKf0WTyZ1FcU0Ki0hVrSr+Mucnvya7jYUKSkpKSkpKSmpD0f/AXq+Umj5XnXDAAAAAElFTkSuQmCC';
  30387. var base64BackToTop = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADIBAMAAABfdrOtAAAAElBMVEVRUVH+/v5HcEyZmZlRUVFRUVGm1ByOAAAABnRSTlPMzADMTZAJBBGsAAAEnElEQVR42t2cS27jMAyGf7/2U+QCQeDsbeQCgZDujaC5/1UmkzaJn+JDFGcw3LdfflKibJkkDnxrL7dbg7sNt6+L4O8OYBM+B0ys+QrGkHZG+OEEQ8g6go8Bx1GIGMdpNOQyIG6XdMgnSPtKhLQDGEZFBgYMkhKFtGBb0EIEjDgFRowoBVaMGAWpMedEfxMiZtwpUsgZCqtlkCNUdpVAWigtCCCDFtLwIWeoreZCWiRYYEKGFEjDg+yRZCUH0iLRAgNyToXUNCRZyMqWhGnUN2IPm3wSlwJ7IUspyCBkIQUZhCykIIeQuRTkEDKXAuM9srrtYbrZN7Y98giZSoFd+t1OxmMITG0dcrSFXFchZ1tIvQZpYWxhBbK3hpQrkMEa0iwh5t4a+QvZvDXyF7J5a+Qv5PPW21/I5623v5DPW29/IaO3Xv5Clrw1y1/Ikrdm+Qs5svw83yNnSJ5BQb4F/F7EIEJSnThGBAXxkFQfLOviQUE8JAUPsosHBfGQfDAtHhREQ1JxIV00KIgmrnRI84S0yAd5BAXxxJUck0f6Qnwr9qmr6xF5xLMjcwn/iudIEAdWnyjkEXlQKZiRVzoqRyLbgeUKKR8Q4alY7cSnoxzSf2ggsqehKr6YVpcXpOd7H93f60cKhOd7Re2LteUF4eLqiVS1mr0ge4io6C2+soaFkJ7MuuuQs1yITEp9hwwKISIpzR2iESKSIoT0rLNwuVHQqoSIpAQJpGce60vIUSdEIuUqgPTsJ5QFZK8UIpBS8iG94GFrDjlrhfCl8CG96Llxmle4kEr6vKWBPIVo9kqDQSRk9/3cWoikcCFPAd33v4dIChPyEvLzBA6RlEYWke4JEUnhKXkLeUEKxRHJFfKCQHGucIW8IdZSRkLeEGMpYyEjiK2UsZARxFTKRMgYYillImQMMZQyFTKB2EmZCplAuFLIHT8TMoWwpQwiIVMIUwqpZP5bp5CCvCTiQKr5f5lCQN+tPCBn2ZvVDFJwIDUP0m1BYAfZYRNSsCB7BqTbhoARePIxtZ9tgwWkoJcwCalmv3MBAemtO4R6dah2HaKQqj8Zvp9sQDjvJ21+SPCBHPJDDk6QITekEV7gqCC19CpKAym9IMfckKv4olMBCeIrWwVEfvkshzQekO9r9P1/ALk+IG1eSPCDiCJfyG+FyU+A6ZCa/piZDinpz7LpkCv5gdkAEshP5emQhv7onw6pGeULyZCSUYiRDAmMkpJkCKs4JhFSq8p8hJBSVbAkhARV6ZUQoisik0FqXTmcDHLVFfbJIEFXoiiCNMpiSxGkVJaNiiBBWQArgTTaUl4JpNQWJUsgQVteXQg+AKkLxQWFGKW+5J2+eVp4S168X3CF1CltCKdTJ8lb84YK2bUBO+wZW0Pqv9nk4tKu49N45NJC5dMM5tLW5tOg59Jq6NM06dL+abFXwr/RkuvTXJwae1abtE/Dt0/ruksTvs84AZ/BCC4jHnyGVfiM3VBQFANEXEah+Ax18RlP4zNox2dkkM/wI58xTn8yDCXGYCDV3W5RGSajtXyGhG1jbpbjzpwGt/0MJft8jqC7iUbQ/QZaxdnKqcIftwAAAABJRU5ErkJggg==';var _default =
  30388. {
  30389. base64Arrow: base64Arrow,
  30390. base64ArrowWhite: base64ArrowWhite,
  30391. base64Flower: base64Flower,
  30392. base64FlowerWhite: base64FlowerWhite,
  30393. base64Success: base64Success,
  30394. base64SuccessWhite: base64SuccessWhite,
  30395. base64Empty: base64Empty,
  30396. base64Error: base64Error,
  30397. base64BackToTop: base64BackToTop };exports.default = _default;
  30398. /***/ }),
  30399. /* 272 */
  30400. /*!***************************************************************************************************!*\
  30401. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/z-paging-constant.js ***!
  30402. \***************************************************************************************************/
  30403. /*! no static exports found */
  30404. /***/ (function(module, exports, __webpack_require__) {
  30405. "use strict";
  30406. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // [z-paging]常量
  30407. var version = '2.2.1';
  30408. var delayTime = 100;
  30409. var i18nUpdateKey = 'z-paging-i18n-update';
  30410. var errorUpdateKey = 'z-paging-error-emit';
  30411. var completeUpdateKey = 'z-paging-complete-emit';var _default =
  30412. {
  30413. version: version,
  30414. delayTime: delayTime,
  30415. i18nUpdateKey: i18nUpdateKey,
  30416. errorUpdateKey: errorUpdateKey,
  30417. completeUpdateKey: completeUpdateKey };exports.default = _default;
  30418. /***/ }),
  30419. /* 273 */
  30420. /*!************************************************************************************************!*\
  30421. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/z-paging-utils.js ***!
  30422. \************************************************************************************************/
  30423. /*! no static exports found */
  30424. /***/ (function(module, exports, __webpack_require__) {
  30425. "use strict";
  30426. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  30427. var _zPagingI18n = _interopRequireDefault(__webpack_require__(/*! ./z-paging-i18n */ 274));
  30428. var _zPagingConfig = _interopRequireDefault(__webpack_require__(/*! ./z-paging-config */ 275));
  30429. var _index = _interopRequireDefault(__webpack_require__(/*! ../config/index */ 276));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} // [z-paging]工具类
  30430. var storageKey = 'Z-PAGING-REFRESHER-TIME-STORAGE-KEY';
  30431. var config = null;
  30432. /*
  30433. 当z-paging未使用uni_modules管理时,控制台会有警告:WARNING: Module not found: Error: Can't resolve '@/uni_modules/z-paging'...
  30434. 此时注释下方try中的代码即可
  30435. */
  30436. try {
  30437. var contextKeys = __webpack_require__(277).keys();
  30438. if (contextKeys.length) {
  30439. var suffix = '.js';
  30440. config = __webpack_require__(278)("./z-paging-config" + suffix);
  30441. }
  30442. } catch (e) {}
  30443. //获取默认配置信息
  30444. function gc(key, defaultValue) {
  30445. if (!config) {
  30446. if (_index.default && Object.keys(_index.default).length) {
  30447. config = _index.default;
  30448. } else {
  30449. var temConfig = _zPagingConfig.default.getConfig();
  30450. if (_zPagingConfig.default && temConfig) {
  30451. config = temConfig;
  30452. }
  30453. }
  30454. }
  30455. if (!config) {
  30456. return defaultValue;
  30457. }
  30458. var value = config[_toKebab(key)];
  30459. if (value === undefined) {
  30460. value = config[key];
  30461. } else {
  30462. return value;
  30463. }
  30464. return defaultValue;
  30465. }
  30466. //判断两个数组是否相等
  30467. function arrayIsEqual(arr1, arr2) {
  30468. if (arr1 === arr2) return true;
  30469. if (arr1.length !== arr2.length) return false;
  30470. for (var i = 0; i < arr1.length; i++) {
  30471. if (arr1[i] !== arr2[i]) return false;
  30472. }
  30473. return true;
  30474. }
  30475. //获取最终的touch位置
  30476. function getTouch(e) {
  30477. var touch = null;
  30478. if (e.touches && e.touches.length) {
  30479. touch = e.touches[0];
  30480. } else if (e.changedTouches && e.changedTouches.length) {
  30481. touch = e.changedTouches[0];
  30482. } else if (e.datail && e.datail != {}) {
  30483. touch = e.datail;
  30484. } else {
  30485. return {
  30486. touchX: 0,
  30487. touchY: 0 };
  30488. }
  30489. return {
  30490. touchX: touch.clientX,
  30491. touchY: touch.clientY };
  30492. }
  30493. //判断当前手势是否在z-paging内触发
  30494. function getTouchFromZPaging(target) {
  30495. if (target && target.tagName && target.tagName !== 'BODY' && target.tagName !== 'UNI-PAGE-BODY') {
  30496. var classList = target.classList;
  30497. if (classList && classList.contains('zp-paging-touch-view')) {
  30498. return true;
  30499. } else {
  30500. return getTouchFromZPaging(target.parentNode);
  30501. }
  30502. } else {
  30503. return false;
  30504. }
  30505. }
  30506. //获取z-paging所在的parent
  30507. function getParent(parent) {
  30508. if (!parent) return null;
  30509. if (parent.$refs.paging) return parent;
  30510. return getParent(parent.$parent);
  30511. }
  30512. //打印错误信息
  30513. function consoleErr(err) {
  30514. console.error("[z-paging]".concat(err));
  30515. }
  30516. //打印警告信息
  30517. function consoleWarn(warn) {
  30518. console.warn("[z-paging]".concat(warn));
  30519. }
  30520. //设置下拉刷新时间
  30521. function setRefesrherTime(time, key) {
  30522. try {
  30523. var datas = getRefesrherTime();
  30524. if (!datas) {
  30525. datas = {};
  30526. }
  30527. datas[key] = time;
  30528. uni.setStorageSync(storageKey, datas);
  30529. } catch (e) {}
  30530. }
  30531. //获取下拉刷新时间
  30532. function getRefesrherTime() {
  30533. try {
  30534. var datas = uni.getStorageSync(storageKey);
  30535. return datas;
  30536. } catch (e) {
  30537. return null;
  30538. }
  30539. }
  30540. //通过下拉刷新标识key获取下拉刷新时间
  30541. function getRefesrherTimeByKey(key) {
  30542. var datas = getRefesrherTime();
  30543. if (datas) {
  30544. var data = datas[key];
  30545. if (data) return data;
  30546. }
  30547. return null;
  30548. }
  30549. //通过下拉刷新标识key获取下拉刷新时间(格式化之后)
  30550. function getRefesrherFormatTimeByKey(key) {
  30551. var time = getRefesrherTimeByKey(key);
  30552. var timeText = _zPagingI18n.default.t['refresherUpdateTimeNoneText'][_zPagingI18n.default.getLanguage()];
  30553. if (time) {
  30554. timeText = _timeFormat(time);
  30555. }
  30556. return "".concat(_zPagingI18n.default.t['refresherUpdateTimeText'][_zPagingI18n.default.getLanguage()]).concat(timeText);
  30557. }
  30558. //将文本的px或者rpx转为px的值
  30559. function convertTextToPx(text) {
  30560. var dataType = Object.prototype.toString.call(text);
  30561. if (dataType === '[object Number]') {
  30562. return text;
  30563. }
  30564. var isRpx = false;
  30565. if (text.indexOf('rpx') !== -1 || text.indexOf('upx') !== -1) {
  30566. text = text.replace('rpx', '').replace('upx', '');
  30567. isRpx = true;
  30568. } else if (text.indexOf('px') !== -1) {
  30569. text = text.replace('px', '');
  30570. }
  30571. if (!isNaN(text)) {
  30572. if (isRpx) return Number(uni.upx2px(text));
  30573. return Number(text);
  30574. }
  30575. return 0;
  30576. }
  30577. //获取当前时间
  30578. function getTime() {
  30579. return new Date().getTime();
  30580. }
  30581. //------------------ 私有方法 ------------------------
  30582. function _timeFormat(time) {
  30583. var date = new Date(time);
  30584. var currentDate = new Date();
  30585. var dateDay = new Date(time).setHours(0, 0, 0, 0);
  30586. var currentDateDay = new Date().setHours(0, 0, 0, 0);
  30587. var disTime = dateDay - currentDateDay;
  30588. var dayStr = '';
  30589. var timeStr = _dateTimeFormat(date);
  30590. if (disTime === 0) {
  30591. dayStr = _zPagingI18n.default.t['refresherUpdateTimeTodayText'][_zPagingI18n.default.getLanguage()];
  30592. } else if (disTime === -86400000) {
  30593. dayStr = _zPagingI18n.default.t['refresherUpdateTimeYesterdayText'][_zPagingI18n.default.getLanguage()];
  30594. } else {
  30595. dayStr = _dateDayFormat(date, date.getFullYear() !== currentDate.getFullYear());
  30596. }
  30597. return "".concat(dayStr, " ").concat(timeStr);
  30598. }
  30599. function _dateDayFormat(date) {var showYear = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  30600. var year = date.getFullYear();
  30601. var month = date.getMonth() + 1;
  30602. var day = date.getDate();
  30603. if (showYear) {
  30604. return "".concat(year, "-").concat(_fullZeroToTwo(month), "-").concat(_fullZeroToTwo(day));
  30605. } else {
  30606. return "".concat(_fullZeroToTwo(month), "-").concat(_fullZeroToTwo(day));
  30607. }
  30608. }
  30609. function _dateTimeFormat(date) {
  30610. var hour = date.getHours();
  30611. var minute = date.getMinutes();
  30612. return "".concat(_fullZeroToTwo(hour), ":").concat(_fullZeroToTwo(minute));
  30613. }
  30614. function _fullZeroToTwo(str) {
  30615. str = str.toString();
  30616. if (str.length === 1) return '0' + str;
  30617. return str;
  30618. }
  30619. //驼峰转短横线
  30620. function _toKebab(value) {
  30621. return value.replace(/([A-Z])/g, "-$1").toLowerCase();
  30622. }var _default =
  30623. {
  30624. gc: gc,
  30625. setRefesrherTime: setRefesrherTime,
  30626. getRefesrherFormatTimeByKey: getRefesrherFormatTimeByKey,
  30627. arrayIsEqual: arrayIsEqual,
  30628. getTouch: getTouch,
  30629. getTouchFromZPaging: getTouchFromZPaging,
  30630. getParent: getParent,
  30631. convertTextToPx: convertTextToPx,
  30632. getTime: getTime,
  30633. consoleErr: consoleErr,
  30634. consoleWarn: consoleWarn };exports.default = _default;
  30635. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  30636. /***/ }),
  30637. /* 274 */
  30638. /*!***********************************************************************************************!*\
  30639. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/z-paging-i18n.js ***!
  30640. \***********************************************************************************************/
  30641. /*! no static exports found */
  30642. /***/ (function(module, exports, __webpack_require__) {
  30643. "use strict";
  30644. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // z-paging国际化(支持中文、中文繁体和英文)
  30645. var i18nUpdateKey = 'z-paging-i18n-update';
  30646. var t = {
  30647. refresherDefaultText: {
  30648. 'en': 'Pull down to refresh',
  30649. 'zh-cn': '继续下拉刷新',
  30650. 'zh-hant-cn': '繼續下拉重繪' },
  30651. refresherPullingText: {
  30652. 'en': 'Release to refresh',
  30653. 'zh-cn': '松开立即刷新',
  30654. 'zh-hant-cn': '鬆開立即重繪' },
  30655. refresherRefreshingText: {
  30656. 'en': 'Refreshing...',
  30657. 'zh-cn': '正在刷新...',
  30658. 'zh-hant-cn': '正在重繪...' },
  30659. refresherCompleteText: {
  30660. 'en': 'Refresh succeeded',
  30661. 'zh-cn': '刷新成功',
  30662. 'zh-hant-cn': '重繪成功' },
  30663. loadingMoreDefaultText: {
  30664. 'en': 'Click to load more',
  30665. 'zh-cn': '点击加载更多',
  30666. 'zh-hant-cn': '點擊加載更多' },
  30667. loadingMoreLoadingText: {
  30668. 'en': 'Loading...',
  30669. 'zh-cn': '正在加载...',
  30670. 'zh-hant-cn': '正在加載...' },
  30671. loadingMoreNoMoreText: {
  30672. 'en': 'No more data',
  30673. 'zh-cn': '没有更多了',
  30674. 'zh-hant-cn': '沒有更多了' },
  30675. loadingMoreFailText: {
  30676. 'en': 'Load failed,click to reload',
  30677. 'zh-cn': '加载失败,点击重新加载',
  30678. 'zh-hant-cn': '加載失敗,點擊重新加載' },
  30679. emptyViewText: {
  30680. 'en': 'No data',
  30681. 'zh-cn': '没有数据哦~',
  30682. 'zh-hant-cn': '沒有數據哦~' },
  30683. emptyViewReloadText: {
  30684. 'en': 'Reload',
  30685. 'zh-cn': '重新加载',
  30686. 'zh-hant-cn': '重新加載' },
  30687. emptyViewErrorText: {
  30688. 'en': 'Sorry,load failed',
  30689. 'zh-cn': '很抱歉,加载失败',
  30690. 'zh-hant-cn': '很抱歉,加載失敗' },
  30691. refresherUpdateTimeText: {
  30692. 'en': 'Last update: ',
  30693. 'zh-cn': '最后更新:',
  30694. 'zh-hant-cn': '最後更新:' },
  30695. refresherUpdateTimeNoneText: {
  30696. 'en': 'None',
  30697. 'zh-cn': '无',
  30698. 'zh-hant-cn': '無' },
  30699. refresherUpdateTimeTodayText: {
  30700. 'en': 'Today',
  30701. 'zh-cn': '今天',
  30702. 'zh-hant-cn': '今天' },
  30703. refresherUpdateTimeYesterdayText: {
  30704. 'en': 'Yesterday',
  30705. 'zh-cn': '昨天',
  30706. 'zh-hant-cn': '昨天' } };
  30707. // 获取当前语言,格式为:zh-cn、zh-hant-cn、en。followSystemLanguage:获取的结果是否是在不跟随系统语言下获取到的
  30708. function getLanguage() {var followSystemLanguage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
  30709. return _getPrivateLanguage(false, followSystemLanguage);
  30710. }
  30711. // 获取当前语言,格式为:简体中文、繁體中文、English。followSystemLanguage:获取的结果是否是在不跟随系统语言下获取到的
  30712. function getLanguageName() {var followSystemLanguage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
  30713. var language = getLanguage(followSystemLanguage);
  30714. var languageNameMap = {
  30715. 'zh-cn': '简体中文',
  30716. 'zh-hant-cn': '繁體中文',
  30717. 'en': 'English' };
  30718. return languageNameMap[language];
  30719. }
  30720. //设置当前语言,格式为:zh-cn、zh-hant-cn、en
  30721. function setLanguage(myLanguage) {
  30722. uni.setStorageSync(i18nUpdateKey, myLanguage);
  30723. uni.$emit(i18nUpdateKey, myLanguage);
  30724. }
  30725. // 插件内部使用,请勿直接调用
  30726. function _getPrivateLanguage(myLanguage) {var followSystemLanguage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  30727. var systemLanguage = '';
  30728. if (followSystemLanguage) {
  30729. systemLanguage = uni.getSystemInfoSync().language;
  30730. }
  30731. var language = myLanguage || uni.getStorageSync(i18nUpdateKey) || systemLanguage;
  30732. language = language.toLowerCase();
  30733. var reg = new RegExp('_', '');
  30734. language = language.replace(reg, '-');
  30735. if (language.indexOf('zh') !== -1) {
  30736. if (language === 'zh' || language === 'zh-cn' || language.indexOf('zh-hans') !== -1) {
  30737. return 'zh-cn';
  30738. }
  30739. return 'zh-hant-cn';
  30740. }
  30741. if (language.indexOf('en') !== -1) {
  30742. return 'en';
  30743. }
  30744. return 'zh-cn';
  30745. }var _default =
  30746. {
  30747. t: t,
  30748. getLanguage: getLanguage,
  30749. getLanguageName: getLanguageName,
  30750. setLanguage: setLanguage,
  30751. _getPrivateLanguage: _getPrivateLanguage };exports.default = _default;
  30752. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  30753. /***/ }),
  30754. /* 275 */
  30755. /*!*************************************************************************************************!*\
  30756. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/z-paging-config.js ***!
  30757. \*************************************************************************************************/
  30758. /*! no static exports found */
  30759. /***/ (function(module, exports, __webpack_require__) {
  30760. "use strict";
  30761. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // [z-paging]处理main.js中的配置信息工具
  30762. var config = null;
  30763. var getedStorage = false;
  30764. var storageKey = 'Z-PAGING-CONFIG-STORAGE-KEY';
  30765. function setConfig(value) {
  30766. try {
  30767. uni.setStorageSync(storageKey, value);
  30768. } catch (e) {}
  30769. }
  30770. function getConfig() {
  30771. try {
  30772. if (getedStorage) return config;
  30773. config = uni.getStorageSync(storageKey);
  30774. getedStorage = true;
  30775. } catch (e) {
  30776. return null;
  30777. }
  30778. }var _default =
  30779. {
  30780. setConfig: setConfig,
  30781. getConfig: getConfig };exports.default = _default;
  30782. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  30783. /***/ }),
  30784. /* 276 */
  30785. /*!*******************************************************************************************!*\
  30786. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/config/index.js ***!
  30787. \*******************************************************************************************/
  30788. /*! no static exports found */
  30789. /***/ (function(module, exports, __webpack_require__) {
  30790. "use strict";
  30791. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // z-paging全局配置文件,注意避免更新时此文件被覆盖,若被覆盖,可在此文件中右键->点击本地历史记录,找回覆盖前的配置
  30792. var _default =
  30793. {};exports.default = _default;
  30794. /***/ }),
  30795. /* 277 */
  30796. /*!*******************************************************************************************!*\
  30797. !*** D:/code/work/broke_news_wx/uni_modules/z-paging sync nonrecursive \z-paging-config$ ***!
  30798. \*******************************************************************************************/
  30799. /*! no static exports found */
  30800. /***/ (function(module, exports) {
  30801. function webpackEmptyContext(req) {
  30802. var e = new Error("Cannot find module '" + req + "'");
  30803. e.code = 'MODULE_NOT_FOUND';
  30804. throw e;
  30805. }
  30806. webpackEmptyContext.keys = function() { return []; };
  30807. webpackEmptyContext.resolve = webpackEmptyContext;
  30808. module.exports = webpackEmptyContext;
  30809. webpackEmptyContext.id = 277;
  30810. /***/ }),
  30811. /* 278 */
  30812. /*!**************************************************************************************!*\
  30813. !*** D:/code/work/broke_news_wx/uni_modules/z-paging sync ^\.\/z\-paging\-config.*$ ***!
  30814. \**************************************************************************************/
  30815. /*! no static exports found */
  30816. /***/ (function(module, exports) {
  30817. function webpackEmptyContext(req) {
  30818. var e = new Error("Cannot find module '" + req + "'");
  30819. e.code = 'MODULE_NOT_FOUND';
  30820. throw e;
  30821. }
  30822. webpackEmptyContext.keys = function() { return []; };
  30823. webpackEmptyContext.resolve = webpackEmptyContext;
  30824. module.exports = webpackEmptyContext;
  30825. webpackEmptyContext.id = 278;
  30826. /***/ }),
  30827. /* 279 */
  30828. /*!*****************************************************************************************************!*\
  30829. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/modules/data-handle.js ***!
  30830. \*****************************************************************************************************/
  30831. /*! no static exports found */
  30832. /***/ (function(module, exports, __webpack_require__) {
  30833. "use strict";
  30834. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  30835. var _zPagingUtils = _interopRequireDefault(__webpack_require__(/*! .././z-paging-utils */ 273));
  30836. var _zPagingConstant = _interopRequireDefault(__webpack_require__(/*! .././z-paging-constant */ 272));
  30837. var _zPagingEnum = _interopRequireDefault(__webpack_require__(/*! .././z-paging-enum */ 280));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: 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;}
  30838. var ZPData = {
  30839. props: {
  30840. //自定义初始的pageNo,默认为1
  30841. defaultPageNo: {
  30842. type: [Number, String],
  30843. default: _zPagingUtils.default.gc('defaultPageNo', 1),
  30844. observer: function observer(newVal, oldVal) {
  30845. this.pageNo = newVal;
  30846. } },
  30847. //自定义pageSize,默认为10
  30848. defaultPageSize: {
  30849. type: [Number, String],
  30850. default: _zPagingUtils.default.gc('defaultPageSize', 10) },
  30851. //为保证数据一致,设置当前tab切换时的标识key,并在complete中传递相同key,若二者不一致,则complete将不会生效
  30852. dataKey: {
  30853. type: [Number, String, Object],
  30854. default: function _default() {
  30855. return _zPagingUtils.default.gc('dataKey', null);
  30856. } },
  30857. //自动注入的list名,可自动修改父view(包含ref="paging")中对应name的list值
  30858. autowireListName: {
  30859. type: String,
  30860. default: function _default() {
  30861. return _zPagingUtils.default.gc('autowireListName', '');
  30862. } },
  30863. //自动注入的query名,可自动调用父view(包含ref="paging")中的query方法
  30864. autowireQueryName: {
  30865. type: String,
  30866. default: function _default() {
  30867. return _zPagingUtils.default.gc('autowireQueryName', '');
  30868. } },
  30869. //z-paging mounted后自动调用reload方法(mounted后自动调用接口),默认为是。请使用简便写法:auto
  30870. mountedAutoCallReload: {
  30871. type: Boolean,
  30872. default: _zPagingUtils.default.gc('mountedAutoCallReload', true) },
  30873. //z-paging mounted后自动调用reload方法(mounted后自动调用接口),默认为是
  30874. auto: {
  30875. type: Boolean,
  30876. default: _zPagingUtils.default.gc('auto', true) },
  30877. //用户下拉刷新时是否触发reload方法,默认为是
  30878. reloadWhenRefresh: {
  30879. type: Boolean,
  30880. default: _zPagingUtils.default.gc('reloadWhenRefresh', true) },
  30881. //reload时自动滚动到顶部,默认为是
  30882. autoScrollToTopWhenReload: {
  30883. type: Boolean,
  30884. default: _zPagingUtils.default.gc('autoScrollToTopWhenReload', true) },
  30885. //reload时立即自动清空原list,默认为是,若立即自动清空,则在reload之后、请求回调之前页面是空白的
  30886. autoCleanListWhenReload: {
  30887. type: Boolean,
  30888. default: _zPagingUtils.default.gc('autoCleanListWhenReload', true) },
  30889. //列表刷新时自动显示下拉刷新view,默认为否
  30890. showRefresherWhenReload: {
  30891. type: Boolean,
  30892. default: _zPagingUtils.default.gc('showRefresherWhenReload', false) },
  30893. //列表刷新时自动显示加载更多view,且为加载中状态,默认为否
  30894. showLoadingMoreWhenReload: {
  30895. type: Boolean,
  30896. default: _zPagingUtils.default.gc('showLoadingMoreWhenReload', false) },
  30897. //本地分页时上拉加载更多延迟时间,单位为毫秒,默认200毫秒
  30898. localPagingLoadingTime: {
  30899. type: [Number, String],
  30900. default: _zPagingUtils.default.gc('localPagingLoadingTime', 200) },
  30901. //当分页未满一屏时,是否自动加载更多,默认为否(nvue无效)
  30902. insideMore: {
  30903. type: Boolean,
  30904. default: _zPagingUtils.default.gc('insideMore', false) },
  30905. //使用聊天记录模式,默认为否
  30906. useChatRecordMode: {
  30907. type: Boolean,
  30908. default: _zPagingUtils.default.gc('useChatRecordMode', false) },
  30909. //自动拼接complete中传过来的数组(使用聊天记录模式时无效)
  30910. concat: {
  30911. type: Boolean,
  30912. default: _zPagingUtils.default.gc('concat', true) },
  30913. //父组件v-model所绑定的list的值
  30914. value: {
  30915. type: Array,
  30916. default: function _default() {
  30917. return [];
  30918. } } },
  30919. data: function data() {
  30920. return {
  30921. currentData: [],
  30922. totalData: [],
  30923. realTotalData: [],
  30924. totalLocalPagingList: [],
  30925. pageNo: 1,
  30926. isLocalPaging: false,
  30927. isAddedData: false,
  30928. isTotalChangeFromAddData: false,
  30929. privateConcat: true,
  30930. myParentQuery: -1,
  30931. firstPageLoaded: false,
  30932. pagingLoaded: false,
  30933. loaded: false,
  30934. isUserReload: true,
  30935. fromEmptyViewReload: false };
  30936. },
  30937. computed: {
  30938. pageSize: function pageSize() {
  30939. return this.defaultPageSize;
  30940. },
  30941. finalConcat: function finalConcat() {
  30942. return this.concat && this.privateConcat;
  30943. },
  30944. isFirstPage: function isFirstPage() {
  30945. return this.pageNo === this.defaultPageNo;
  30946. } },
  30947. watch: {
  30948. totalData: function totalData(newVal, oldVal) {
  30949. this._totalDataChange(newVal, oldVal);
  30950. },
  30951. currentData: function currentData(newVal, oldVal) {
  30952. this._currentDataChange(newVal, oldVal);
  30953. },
  30954. useChatRecordMode: function useChatRecordMode(newVal, oldVal) {
  30955. if (newVal) {
  30956. this.nLoadingMoreFixedHeight = false;
  30957. }
  30958. } },
  30959. methods: {
  30960. //请求结束(成功或者失败)调用此方法,将请求的结果传递给z-paging处理,第一个参数为请求结果数组,第二个参数为是否成功(默认是是)
  30961. complete: function complete(data) {var success = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  30962. this.customNoMore = -1;
  30963. this.addData(data, success);
  30964. },
  30965. //简写,与complete完全相同
  30966. end: function end(data) {var success = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  30967. this.complete(data, success);
  30968. },
  30969. //【保证数据一致】请求结束(成功或者失败)调用此方法,将请求的结果传递给z-paging处理,第一个参数为请求结果数组,第二个参数为dataKey,需与:data-key绑定的一致,第三个参数为是否成功(默认为是)
  30970. completeByKey: function completeByKey(data) {var dataKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;var success = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  30971. if (dataKey !== null && this.dataKey !== null && dataKey !== this.dataKey) {
  30972. if (this.isFirstPage) {
  30973. this.endRefresh();
  30974. }
  30975. return;
  30976. }
  30977. this.customNoMore = -1;
  30978. this.addData(data, success);
  30979. },
  30980. //简写,与completeByKey完全相同
  30981. endByKey: function endByKey(data) {var dataKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;var success = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  30982. this.completeByKey(data, dataKey, success);
  30983. },
  30984. //【通过totalCount判断是否有更多数据】请求结束(成功或者失败)调用此方法,将请求的结果传递给z-paging处理,第一个参数为请求结果数组,第二个参数为totalCount(列表总数),第三个参数为是否成功(默认为是)
  30985. completeByTotalCount: function completeByTotalCount(data, totalCount) {var _this = this;var success = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  30986. if (totalCount == 'undefined') {
  30987. this.customNoMore = -1;
  30988. } else {
  30989. var dataTypeRes = this._checkDataType(data, success, false);
  30990. data = dataTypeRes.data;
  30991. success = dataTypeRes.success;
  30992. if (totalCount >= 0 && success) {
  30993. this.$nextTick(function () {
  30994. var nomore = true;
  30995. var realTotalDataCount = _this.realTotalData.length;
  30996. if (_this.pageNo == _this.defaultPageNo) {
  30997. realTotalDataCount = 0;
  30998. }
  30999. var exceedCount = realTotalDataCount + data.length - totalCount;
  31000. if (exceedCount >= 0) {
  31001. nomore = false;
  31002. exceedCount = _this.defaultPageSize - exceedCount;
  31003. if (exceedCount > 0 && exceedCount < data.length) {
  31004. data = data.splice(0, exceedCount);
  31005. }
  31006. }
  31007. _this.completeByNoMore(data, nomore, success);
  31008. });
  31009. return;
  31010. }
  31011. }
  31012. this.addData(data, success);
  31013. },
  31014. //简写,与completeByTotalCount完全相同
  31015. completeByTotal: function completeByTotal(data, totalCount) {var success = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  31016. this.completeByTotalCount(data, totalCount, success);
  31017. },
  31018. //简写,与completeByTotalCount完全相同
  31019. endByTotalCount: function endByTotalCount(data, totalCount) {var success = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  31020. this.completeByTotalCount(data, totalCount, success);
  31021. },
  31022. //简写,与completeByTotalCount完全相同
  31023. endByTotal: function endByTotal(data, totalCount) {var success = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  31024. this.completeByTotalCount(data, totalCount, success);
  31025. },
  31026. //【自行判断是否有更多数据】请求结束(成功或者失败)调用此方法,将请求的结果传递给z-paging处理,第一个参数为请求结果数组,第二个参数为是否有更多数据,第三个参数为是否成功(默认是是)
  31027. completeByNoMore: function completeByNoMore(data, nomore) {var success = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  31028. if (nomore != 'undefined') {
  31029. this.customNoMore = nomore == true ? 1 : 0;
  31030. }
  31031. this.addData(data, success);
  31032. },
  31033. //简写,与completeByNoMore完全相同
  31034. endByNoMore: function endByNoMore(data, nomore) {var success = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  31035. this.completeByNoMore(data, nomore, success);
  31036. },
  31037. //与上方complete方法功能一致,新版本中设置服务端回调数组请使用complete方法
  31038. addData: function addData(data) {var _this2 = this;var success = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  31039. if (!this.fromCompleteEmit) {
  31040. this.disabledCompleteEmit = true;
  31041. this.fromCompleteEmit = false;
  31042. }
  31043. var currentTimeStamp = _zPagingUtils.default.getTime();
  31044. var addDataDalay = 0;
  31045. var disTime = currentTimeStamp - this.requestTimeStamp;
  31046. var minDelay = this.minDelay;
  31047. if (this.isFirstPage && this.finalShowRefresherWhenReload) {
  31048. minDelay = Math.max(400, minDelay);
  31049. }
  31050. if (this.requestTimeStamp > 0 && disTime < minDelay) {
  31051. addDataDalay = minDelay - disTime;
  31052. }
  31053. this.$nextTick(function () {
  31054. var delay = _this2.delay > 0 ? _this2.delay : addDataDalay;
  31055. setTimeout(function () {
  31056. _this2._addData(data, success, false);
  31057. }, delay);
  31058. });
  31059. },
  31060. //从顶部添加数据,不会影响分页的pageNo和pageSize
  31061. addDataFromTop: function addDataFromTop(data) {var _this3 = this;var toTop = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;var toTopWithAnimate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  31062. var dataType = Object.prototype.toString.call(data);
  31063. if (dataType !== '[object Array]') {
  31064. data = [data];
  31065. }
  31066. this.totalData = [].concat(_toConsumableArray(data), _toConsumableArray(this.totalData));
  31067. if (toTop) {
  31068. setTimeout(function () {
  31069. _this3._scrollToTop(toTopWithAnimate);
  31070. }, _zPagingConstant.default.delayTime);
  31071. }
  31072. },
  31073. //重新设置列表数据,调用此方法不会影响pageNo和pageSize,也不会触发请求。适用场景:当需要删除列表中某一项时,将删除对应项后的数组通过此方法传递给z-paging。(当出现类似的需要修改列表数组的场景时,请使用此方法,请勿直接修改page中:list.sync绑定的数组)
  31074. resetTotalData: function resetTotalData(data) {
  31075. if (data == undefined) {
  31076. if (this.showConsoleError) {
  31077. _zPagingUtils.default.consoleErr('方法resetTotalData参数缺失!');
  31078. }
  31079. return;
  31080. }
  31081. this.isTotalChangeFromAddData = true;
  31082. var dataType = Object.prototype.toString.call(data);
  31083. if (dataType !== '[object Array]') {
  31084. data = [data];
  31085. }
  31086. this.totalData = data;
  31087. },
  31088. //添加聊天记录
  31089. addChatRecordData: function addChatRecordData(data) {var _this4 = this;var toBottom = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;var toBottomWithAnimate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  31090. var dataType = Object.prototype.toString.call(data);
  31091. if (dataType !== '[object Array]') {
  31092. data = [data];
  31093. }
  31094. if (!this.useChatRecordMode) return;
  31095. this.isTotalChangeFromAddData = true;
  31096. this.totalData = [].concat(_toConsumableArray(this.totalData), _toConsumableArray(data));
  31097. if (toBottom) {
  31098. setTimeout(function () {
  31099. _this4._scrollToBottom(toBottomWithAnimate);
  31100. }, _zPagingConstant.default.delayTime);
  31101. }
  31102. },
  31103. //设置本地分页数据,请求结束(成功或者失败)调用此方法,将请求的结果传递给z-paging作分页处理(若调用了此方法,则上拉加载更多时内部会自动分页,不会触发@query所绑定的事件)
  31104. setLocalPaging: function setLocalPaging(data) {var _this5 = this;var success = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  31105. this.isLocalPaging = true;
  31106. this.$nextTick(function () {
  31107. _this5._addData(data, success, true);
  31108. });
  31109. },
  31110. //重新加载分页数据,pageNo会恢复为默认值,相当于下拉刷新的效果(animate为true时会展示下拉刷新动画,默认为false)
  31111. reload: function reload() {var animate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.showRefresherWhenReload;
  31112. if (animate) {
  31113. this.privateShowRefresherWhenReload = animate;
  31114. this.isUserPullDown = true;
  31115. }
  31116. this._preReload(animate, false);
  31117. },
  31118. //刷新列表数据,pageNo和pageSize不会重置,列表数据会重新从服务端获取。必须保证@query绑定的方法中的pageNo和pageSize和传给服务端的一致
  31119. refresh: function refresh() {
  31120. if (!this.realTotalData.length) {
  31121. this.reload();
  31122. return;
  31123. }
  31124. var disPageNo = this.pageNo - this.defaultPageNo + 1;
  31125. if (disPageNo >= 1) {
  31126. this.loading = true;
  31127. this.privateConcat = false;
  31128. var totalPageSize = disPageNo * this.pageSize;
  31129. this._emitQuery(this.defaultPageNo, totalPageSize, _zPagingEnum.default.QueryFrom.Refresh);
  31130. this._callMyParentQuery(this.defaultPageNo, totalPageSize);
  31131. }
  31132. },
  31133. //清空分页数据
  31134. clean: function clean() {
  31135. this._reload(true);
  31136. this._addData([], true, false);
  31137. },
  31138. //清空分页数据
  31139. clear: function clear() {
  31140. this.clean();
  31141. },
  31142. //手动触发滚动到顶部加载更多,聊天记录模式时有效
  31143. doChatRecordLoadMore: function doChatRecordLoadMore() {
  31144. this.useChatRecordMode && this._onLoadingMore('click');
  31145. },
  31146. //reload之前的一些处理
  31147. _preReload: function _preReload() {var animate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.showRefresherWhenReload;var isFromMounted = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  31148. this.isUserReload = true;
  31149. this.loadingType = _zPagingEnum.default.LoadingType.Refresher;
  31150. if (animate) {
  31151. this.privateShowRefresherWhenReload = animate;
  31152. if (this.useCustomRefresher) {
  31153. this._doRefresherRefreshAnimate();
  31154. } else {
  31155. this.refresherTriggered = true;
  31156. }
  31157. } else {
  31158. this._refresherEnd(false, false, false, false);
  31159. }
  31160. this._reload(false, isFromMounted);
  31161. },
  31162. //重新加载分页数据
  31163. _reload: function _reload() {var _this6 = this;var isClean = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;var isFromMounted = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var isUserPullDown = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  31164. this.isAddedData = false;
  31165. this.cacheScrollNodeHeight = -1;
  31166. this.insideOfPaging = -1;
  31167. this.pageNo = this.defaultPageNo;
  31168. this._cleanRefresherEndTimeout();
  31169. !this.privateShowRefresherWhenReload && !isClean && this._startLoading(true);
  31170. this.firstPageLoaded = true;
  31171. this.isTotalChangeFromAddData = false;
  31172. this.totalData = [];
  31173. if (!isClean) {
  31174. this._emitQuery(this.pageNo, this.defaultPageSize, isUserPullDown ? _zPagingEnum.default.QueryFrom.UserPullDown : _zPagingEnum.default.QueryFrom.Reload);
  31175. var delay = 0;
  31176. setTimeout(function () {
  31177. _this6._callMyParentQuery();
  31178. }, delay);
  31179. if (!isFromMounted && this.autoScrollToTopWhenReload) {
  31180. var checkedNRefresherLoading = true;
  31181. if (checkedNRefresherLoading) {
  31182. this._scrollToTop(false);
  31183. }
  31184. }
  31185. if (!this.usePageScroll && this.useChatRecordMode) {
  31186. if (this.showConsoleError) {
  31187. _zPagingUtils.default.consoleWarn('使用聊天记录模式时,建议使用页面滚动,可将usePageScroll设置为true以启用页面滚动!!');
  31188. }
  31189. }
  31190. }
  31191. this.$nextTick(function () {
  31192. });
  31193. },
  31194. //处理服务端返回的数组
  31195. _addData: function _addData(data, success, isLocal) {var _this7 = this;
  31196. this.isAddedData = true;
  31197. this.fromEmptyViewReload = false;
  31198. this.isTotalChangeFromAddData = true;
  31199. this.refresherTriggered = false;
  31200. !this.useCustomRefresher && uni.stopPullDownRefresh();
  31201. var tempIsUserPullDown = this.isUserPullDown;
  31202. if (this.showRefresherUpdateTime && this.isFirstPage) {
  31203. _zPagingUtils.default.setRefesrherTime(_zPagingUtils.default.getTime(), this.refresherUpdateTimeKey);
  31204. this.tempLanguageUpdateKey = _zPagingUtils.default.getTime();
  31205. this.$refs.refresh && this.$refs.refresh.updateTime();
  31206. }
  31207. if (tempIsUserPullDown && this.isFirstPage) {
  31208. this.isUserPullDown = false;
  31209. }
  31210. var dataTypeRes = this._checkDataType(data, success, isLocal);
  31211. data = dataTypeRes.data;
  31212. success = dataTypeRes.success;
  31213. var delayTime = _zPagingConstant.default.delayTime;
  31214. var shouldEndLoadingDelay = true;
  31215. this.loadingForNow = false;
  31216. setTimeout(function () {
  31217. _this7.pagingLoaded = true;
  31218. _this7.$nextTick(function () {
  31219. _this7._refresherEnd(shouldEndLoadingDelay, true, tempIsUserPullDown);
  31220. });
  31221. }, delayTime);
  31222. if (this.isFirstPage) {
  31223. this.isLoadFailed = !success;
  31224. }
  31225. if (success) {
  31226. if (!(this.privateConcat === false && this.loadingStatus === _zPagingEnum.default.More.NoMore)) {
  31227. this.loadingStatus = _zPagingEnum.default.More.Default;
  31228. }
  31229. if (isLocal) {
  31230. this.totalLocalPagingList = data;
  31231. this._localPagingQueryList(this.defaultPageNo, this.defaultPageSize, 0, function (res) {
  31232. _this7.complete(res);
  31233. });
  31234. } else {
  31235. var dataChangeDelayTime = 0;
  31236. setTimeout(function () {
  31237. _this7._currentDataChange(data, _this7.currentData);
  31238. }, dataChangeDelayTime);
  31239. }
  31240. } else {
  31241. this._currentDataChange(data, this.currentData);
  31242. this.loadingStatus = _zPagingEnum.default.More.Fail;
  31243. if (this.loadingType === _zPagingEnum.default.LoadingType.LoadingMore) {
  31244. this.pageNo--;
  31245. }
  31246. }
  31247. },
  31248. //所有数据改变时调用
  31249. _totalDataChange: function _totalDataChange(newVal, oldVal) {var _this8 = this;var eventThrow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  31250. if ((!this.isUserReload || !this.autoCleanListWhenReload) && this.firstPageLoaded && !newVal.length && oldVal.length) {
  31251. return;
  31252. }
  31253. this._doCheckScrollViewShouldFullHeight(newVal);
  31254. if (!this.realTotalData.length && !newVal.length) {
  31255. eventThrow = false;
  31256. }
  31257. this.realTotalData = newVal;
  31258. if (eventThrow) {
  31259. this.$emit('input', newVal);
  31260. this.$emit('update:list', newVal);
  31261. this.$emit('listChange', newVal);
  31262. this._callMyParentList(newVal);
  31263. }
  31264. this.firstPageLoaded = false;
  31265. this.isTotalChangeFromAddData = false;
  31266. this.$nextTick(function () {
  31267. setTimeout(function () {
  31268. _this8._getNodeClientRect('.zp-paging-container-content').then(function (res) {
  31269. if (res) {
  31270. _this8.$emit('contentHeightChanged', res[0].height);
  31271. }
  31272. });
  31273. }, _this8.isIos ? 100 : 300);
  31274. });
  31275. },
  31276. //当前数据改变时调用
  31277. _currentDataChange: function _currentDataChange(newVal, oldVal) {var _this9 = this;
  31278. newVal = _toConsumableArray(newVal);
  31279. this.useChatRecordMode && newVal.reverse();
  31280. if (this.isFirstPage && this.finalConcat) {
  31281. this.totalData = [];
  31282. }
  31283. if (this.customNoMore !== -1) {
  31284. if (this.customNoMore === 0 || !newVal.length) {
  31285. this.loadingStatus = _zPagingEnum.default.More.NoMore;
  31286. }
  31287. } else {
  31288. if (!newVal.length || newVal.length && newVal.length < this.defaultPageSize) {
  31289. this.loadingStatus = _zPagingEnum.default.More.NoMore;
  31290. }
  31291. }
  31292. if (!this.totalData.length) {
  31293. if (this.finalConcat) {
  31294. this.totalData = newVal;
  31295. }
  31296. if (this.useChatRecordMode) {
  31297. this.$nextTick(function () {
  31298. _this9._scrollToBottom(false);
  31299. });
  31300. }
  31301. } else {
  31302. if (this.useChatRecordMode) {
  31303. var idIndex = newVal.length;
  31304. var idIndexStr = "z-paging-".concat(idIndex);
  31305. this.totalData = [].concat(_toConsumableArray(newVal), _toConsumableArray(this.totalData));
  31306. if (this.pageNo !== this.defaultPageNo) {
  31307. this.privateScrollWithAnimation = 0;
  31308. var delayTime = 200;
  31309. this.$emit('update:chatIndex', idIndex);
  31310. setTimeout(function () {
  31311. _this9._scrollIntoView(idIndexStr, 30 + _this9.cacheTopHeight, false, function () {
  31312. _this9.$emit('update:chatIndex', 0);
  31313. });
  31314. }, this.usePageScroll ? 0 : delayTime);
  31315. } else {
  31316. this.$nextTick(function () {
  31317. _this9._scrollToBottom(false);
  31318. });
  31319. }
  31320. } else {
  31321. if (this.finalConcat) {
  31322. this.totalData = [].concat(_toConsumableArray(this.totalData), _toConsumableArray(newVal));
  31323. if (!this.isIos && !this.refresherOnly && !this.usePageScroll && newVal.length) {
  31324. this.loadingMoreTimeStamp = _zPagingUtils.default.getTime();
  31325. var currentScrollTop = this.oldScrollTop;
  31326. this.scrollToY(currentScrollTop);
  31327. }
  31328. } else {
  31329. this.totalData = _toConsumableArray(newVal);
  31330. }
  31331. }
  31332. }
  31333. this.privateConcat = true;
  31334. },
  31335. //本地分页请求
  31336. _localPagingQueryList: function _localPagingQueryList(pageNo, pageSize, localPagingLoadingTime, callback) {
  31337. pageNo = parseInt(pageNo);
  31338. pageSize = parseInt(pageSize);
  31339. if (pageNo < 0 || pageSize <= 0) {
  31340. callQueryResult(callback, []);
  31341. return;
  31342. }
  31343. pageNo = Math.max(1, pageNo);
  31344. var totalPagingList = _toConsumableArray(this.totalLocalPagingList);
  31345. var pageNoIndex = (pageNo - 1) * pageSize;
  31346. if (pageNoIndex + pageSize <= totalPagingList.length) {
  31347. this._localPagingQueryResult(callback, totalPagingList.splice(pageNoIndex, pageSize), localPagingLoadingTime);
  31348. } else if (pageNoIndex < totalPagingList.length) {
  31349. this._localPagingQueryResult(callback, totalPagingList.splice(pageNoIndex, totalPagingList.length - pageNoIndex), localPagingLoadingTime);
  31350. } else {
  31351. this._localPagingQueryResult(callback, [], localPagingLoadingTime);
  31352. }
  31353. },
  31354. //本地分页请求回调
  31355. _localPagingQueryResult: function _localPagingQueryResult(callback, arg, localPagingLoadingTime) {
  31356. setTimeout(function () {
  31357. callback(arg);
  31358. }, localPagingLoadingTime);
  31359. },
  31360. //修改父view的list
  31361. _callMyParentList: function _callMyParentList(newVal) {
  31362. if (this.autowireListName.length) {
  31363. var myParent = _zPagingUtils.default.getParent(this.$parent);
  31364. if (myParent && myParent[this.autowireListName]) {
  31365. myParent[this.autowireListName] = newVal;
  31366. }
  31367. }
  31368. },
  31369. //调用父view的query
  31370. _callMyParentQuery: function _callMyParentQuery() {var customPageNo = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;var customPageSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  31371. if (this.autowireQueryName) {
  31372. if (this.myParentQuery === -1) {
  31373. var myParent = _zPagingUtils.default.getParent(this.$parent);
  31374. if (myParent && myParent[this.autowireQueryName]) {
  31375. this.myParentQuery = myParent[this.autowireQueryName];
  31376. }
  31377. }
  31378. if (this.myParentQuery !== -1) {
  31379. if (customPageSize > 0) {
  31380. this.myParentQuery(customPageNo, customPageSize);
  31381. } else {
  31382. this.myParentQuery(this.pageNo, this.defaultPageSize);
  31383. }
  31384. }
  31385. }
  31386. },
  31387. //发射query事件
  31388. _emitQuery: function _emitQuery(pageNo, pageSize, from) {
  31389. this.requestTimeStamp = _zPagingUtils.default.getTime();
  31390. this.$emit('query', pageNo, pageSize, from);
  31391. },
  31392. //检查complete data的类型
  31393. _checkDataType: function _checkDataType(data, success, isLocal) {
  31394. var dataType = Object.prototype.toString.call(data);
  31395. if (dataType === '[object Boolean]') {
  31396. success = data;
  31397. data = [];
  31398. } else if (dataType !== '[object Array]') {
  31399. data = [];
  31400. var methodStr = isLocal ? 'setLocalPaging' : 'complete';
  31401. if (dataType !== '[object Undefined]') {
  31402. if (this.showConsoleError) {
  31403. _zPagingUtils.default.consoleErr("".concat(methodStr, "\u53C2\u6570\u7C7B\u578B\u4E0D\u6B63\u786E\uFF0C\u7B2C\u4E00\u4E2A\u53C2\u6570\u7C7B\u578B\u5FC5\u987B\u4E3AArray!"));
  31404. }
  31405. }
  31406. }
  31407. return { data: data, success: success };
  31408. } } };var _default2 =
  31409. ZPData;exports.default = _default2;
  31410. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  31411. /***/ }),
  31412. /* 280 */
  31413. /*!***********************************************************************************************!*\
  31414. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/z-paging-enum.js ***!
  31415. \***********************************************************************************************/
  31416. /*! no static exports found */
  31417. /***/ (function(module, exports, __webpack_require__) {
  31418. "use strict";
  31419. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // [z-paging]枚举
  31420. var Enum = {
  31421. //当前加载类型 0.下拉刷新 1.上拉加载更多
  31422. LoadingType: {
  31423. Refresher: 0,
  31424. LoadingMore: 1 },
  31425. //下拉刷新状态 0.默认状态 1.松手立即刷新 2.刷新中 3.刷新结束
  31426. Refresher: {
  31427. Default: 0,
  31428. ReleaseToRefresh: 1,
  31429. Loading: 2,
  31430. Complete: 3 },
  31431. //底部加载更多状态 0.默认状态 1.加载中 2.没有更多数据 3.加载失败
  31432. More: {
  31433. Default: 0,
  31434. Loading: 1,
  31435. NoMore: 2,
  31436. Fail: 3 },
  31437. //@query触发来源 0.用户主动下拉刷新 1.通过reload触发 2.通过refresh触发 3.通过滚动到底部加载更多或点击底部加载更多触发
  31438. QueryFrom: {
  31439. UserPullDown: 0,
  31440. Reload: 1,
  31441. Refresh: 2,
  31442. LoadingMore: 3 } };var _default =
  31443. Enum;exports.default = _default;
  31444. /***/ }),
  31445. /* 281 */
  31446. /*!**********************************************************************************************!*\
  31447. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/modules/i18n.js ***!
  31448. \**********************************************************************************************/
  31449. /*! no static exports found */
  31450. /***/ (function(module, exports, __webpack_require__) {
  31451. "use strict";
  31452. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  31453. var _zPagingUtils = _interopRequireDefault(__webpack_require__(/*! .././z-paging-utils */ 273));
  31454. var _zPagingConstant = _interopRequireDefault(__webpack_require__(/*! .././z-paging-constant */ 272));
  31455. var _zPagingI18n = _interopRequireDefault(__webpack_require__(/*! .././z-paging-i18n */ 274));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} // [z-paging]i18n模块
  31456. var systemInfo = uni.getSystemInfoSync();
  31457. var ZPI18n = {
  31458. props: {
  31459. //i18n国际化设置语言,支持简体中文(zh-cn)、繁体中文(zh-hant-cn)和英文(en)
  31460. language: {
  31461. type: String,
  31462. default: _zPagingUtils.default.gc('language', '') },
  31463. //i18n国际化默认是否跟随系统语言,默认为是
  31464. followSystemLanguage: {
  31465. type: Boolean,
  31466. default: _zPagingUtils.default.gc('followSystemLanguage', true) } },
  31467. data: function data() {
  31468. return {
  31469. tempLanguageUpdateKey: 0 };
  31470. },
  31471. computed: {
  31472. tempLanguage: function tempLanguage() {
  31473. var systemLanguage = false;
  31474. var temp = this.tempLanguageUpdateKey;
  31475. if (this.followSystemLanguage) {
  31476. systemLanguage = systemInfo.language;
  31477. }
  31478. return uni.getStorageSync(_zPagingConstant.default.i18nUpdateKey) || systemLanguage || 'zh-cn';
  31479. },
  31480. finalTempLanguage: function finalTempLanguage() {
  31481. return this.language.length ? this.language : this.tempLanguage;
  31482. },
  31483. finalLanguage: function finalLanguage() {
  31484. var language = this.finalTempLanguage.toLowerCase();
  31485. return _zPagingI18n.default._getPrivateLanguage(language, this.followSystemLanguage);
  31486. },
  31487. finalRefresherDefaultText: function finalRefresherDefaultText() {
  31488. return this._getI18nText('refresherDefaultText', this.refresherDefaultText);
  31489. },
  31490. finalRefresherPullingText: function finalRefresherPullingText() {
  31491. return this._getI18nText('refresherPullingText', this.refresherPullingText);
  31492. },
  31493. finalRefresherRefreshingText: function finalRefresherRefreshingText() {
  31494. return this._getI18nText('refresherRefreshingText', this.refresherRefreshingText);
  31495. },
  31496. finalRefresherCompleteText: function finalRefresherCompleteText() {
  31497. return this._getI18nText('refresherCompleteText', this.refresherCompleteText);
  31498. },
  31499. finalLoadingMoreDefaultText: function finalLoadingMoreDefaultText() {
  31500. return this._getI18nText('loadingMoreDefaultText', this.loadingMoreDefaultText);
  31501. },
  31502. finalLoadingMoreLoadingText: function finalLoadingMoreLoadingText() {
  31503. return this._getI18nText('loadingMoreLoadingText', this.loadingMoreLoadingText);
  31504. },
  31505. finalLoadingMoreNoMoreText: function finalLoadingMoreNoMoreText() {
  31506. return this._getI18nText('loadingMoreNoMoreText', this.loadingMoreNoMoreText);
  31507. },
  31508. finalLoadingMoreFailText: function finalLoadingMoreFailText() {
  31509. return this._getI18nText('loadingMoreFailText', this.loadingMoreFailText);
  31510. },
  31511. finalEmptyViewText: function finalEmptyViewText() {
  31512. return this.isLoadFailed ? this.finalEmptyViewErrorText : this._getI18nText('emptyViewText', this.emptyViewText);
  31513. },
  31514. finalEmptyViewReloadText: function finalEmptyViewReloadText() {
  31515. return this._getI18nText('emptyViewReloadText', this.emptyViewReloadText);
  31516. },
  31517. finalEmptyViewErrorText: function finalEmptyViewErrorText() {
  31518. return this._getI18nText('emptyViewErrorText', this.emptyViewErrorText);
  31519. } },
  31520. methods: {
  31521. //设置i18n国际化语言
  31522. setI18n: function setI18n(language) {
  31523. _zPagingI18n.default.setLanguage(language);
  31524. },
  31525. //获取当前z-paging的语言
  31526. getLanguage: function getLanguage() {
  31527. return this.finalLanguage;
  31528. },
  31529. //获取国际化转换后的文本
  31530. _getI18nText: function _getI18nText(key, value) {
  31531. var dataType = Object.prototype.toString.call(value);
  31532. if (dataType === '[object Object]') {
  31533. var nextValue = value[this.finalLanguage];
  31534. if (nextValue) return nextValue;
  31535. } else if (dataType === '[object String]') {
  31536. return value;
  31537. }
  31538. return _zPagingI18n.default.t[key][this.finalLanguage];
  31539. } } };var _default =
  31540. ZPI18n;exports.default = _default;
  31541. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  31542. /***/ }),
  31543. /* 282 */
  31544. /*!**********************************************************************************************!*\
  31545. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/modules/nvue.js ***!
  31546. \**********************************************************************************************/
  31547. /*! no static exports found */
  31548. /***/ (function(module, exports, __webpack_require__) {
  31549. "use strict";
  31550. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  31551. var _zPagingUtils = _interopRequireDefault(__webpack_require__(/*! .././z-paging-utils */ 273));
  31552. var _zPagingEnum = _interopRequireDefault(__webpack_require__(/*! .././z-paging-enum */ 280));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} // [z-paging]nvue独有部分模块
  31553. var ZPNvue = {
  31554. props: {
  31555. //nvue中修改列表类型,可选值有list、waterfall和scroller,默认为list
  31556. nvueListIs: {
  31557. type: String,
  31558. default: _zPagingUtils.default.gc('nvueListIs', 'list') },
  31559. //nvue waterfall配置,仅在nvue中且nvueListIs=waterfall时有效,配置参数详情参见:https://uniapp.dcloud.io/component/waterfall
  31560. nvueWaterfallConfig: {
  31561. type: Object,
  31562. default: function _default() {
  31563. return _zPagingUtils.default.gc('nvueWaterfallConfig', {});
  31564. } },
  31565. //nvue 控制是否回弹效果,iOS不支持动态修改
  31566. nvueBounce: {
  31567. type: Boolean,
  31568. default: _zPagingUtils.default.gc('nvueBounce', true) },
  31569. //nvue中通过代码滚动到顶部/底部时,是否加快动画效果(无滚动动画时无效),默认为否
  31570. nvueFastScroll: {
  31571. type: Boolean,
  31572. default: _zPagingUtils.default.gc('nvueFastScroll', false) },
  31573. //nvue中list的id
  31574. nvueListId: {
  31575. type: String,
  31576. default: _zPagingUtils.default.gc('nvueListId', '') },
  31577. //nvue中refresh组件的样式
  31578. nvueRefresherStyle: {
  31579. type: Object,
  31580. default: function _default() {
  31581. return _zPagingUtils.default.gc('nvueRefresherStyle', {});
  31582. } },
  31583. //是否隐藏nvue列表底部的tagView,此view用于标识滚动到底部位置,若隐藏则滚动到底部功能将失效,在nvue中实现吸顶+swiper功能时需将最外层z-paging的此属性设置为true。默认为否
  31584. hideNvueBottomTag: {
  31585. type: Boolean,
  31586. default: _zPagingUtils.default.gc('hideNvueBottomTag', false) } },
  31587. data: function data() {
  31588. return {
  31589. nRefresherLoading: false,
  31590. nListIsDragging: false,
  31591. nShowBottom: true,
  31592. nFixFreezing: false,
  31593. nShowRefresherReveal: false,
  31594. nIsFirstPageAndNoMore: false,
  31595. nFirstPageAndNoMoreChecked: false,
  31596. nLoadingMoreFixedHeight: false,
  31597. nShowRefresherRevealHeight: 0 };
  31598. },
  31599. watch: {
  31600. nIsFirstPageAndNoMore: {
  31601. handler: function handler(newVal) {
  31602. var cellStyle = !this.useChatRecordMode || newVal ? {} : { transform: 'rotate(180deg)' };
  31603. this.$emit('update:cellStyle', cellStyle);
  31604. },
  31605. immediate: true } },
  31606. computed: {},
  31607. methods: {} };var _default2 =
  31608. ZPNvue;exports.default = _default2;
  31609. /***/ }),
  31610. /* 283 */
  31611. /*!***********************************************************************************************!*\
  31612. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/modules/empty.js ***!
  31613. \***********************************************************************************************/
  31614. /*! no static exports found */
  31615. /***/ (function(module, exports, __webpack_require__) {
  31616. "use strict";
  31617. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  31618. var _zPagingUtils = _interopRequireDefault(__webpack_require__(/*! .././z-paging-utils */ 273));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} // [z-paging]空数据图view模块
  31619. var ZPEmptyView = {
  31620. props: {
  31621. //是否强制隐藏空数据图,默认为否
  31622. hideEmptyView: {
  31623. type: Boolean,
  31624. default: _zPagingUtils.default.gc('hideEmptyView', false) },
  31625. //空数据图描述文字,默认为“没有数据哦~”
  31626. emptyViewText: {
  31627. type: [String, Object],
  31628. default: _zPagingUtils.default.gc('emptyViewText', null) },
  31629. //是否显示空数据图重新加载按钮(无数据时),默认为否
  31630. showEmptyViewReload: {
  31631. type: Boolean,
  31632. default: _zPagingUtils.default.gc('showEmptyViewReload', false) },
  31633. //加载失败时是否显示空数据图重新加载按钮,默认为是
  31634. showEmptyViewReloadWhenError: {
  31635. type: Boolean,
  31636. default: _zPagingUtils.default.gc('showEmptyViewReloadWhenError', true) },
  31637. //空数据图点击重新加载文字,默认为“重新加载”
  31638. emptyViewReloadText: {
  31639. type: [String, Object],
  31640. default: _zPagingUtils.default.gc('emptyViewReloadText', null) },
  31641. //空数据图图片,默认使用z-paging内置的图片
  31642. emptyViewImg: {
  31643. type: String,
  31644. default: _zPagingUtils.default.gc('emptyViewImg', '') },
  31645. //空数据图“加载失败”描述文字,默认为“很抱歉,加载失败”
  31646. emptyViewErrorText: {
  31647. type: [String, Object],
  31648. default: _zPagingUtils.default.gc('emptyViewErrorText', null) },
  31649. //空数据图“加载失败”图片,默认使用z-paging内置的图片
  31650. emptyViewErrorImg: {
  31651. type: String,
  31652. default: _zPagingUtils.default.gc('emptyViewErrorImg', '') },
  31653. //空数据图样式
  31654. emptyViewStyle: {
  31655. type: Object,
  31656. default: function _default() {
  31657. return _zPagingUtils.default.gc('emptyViewStyle', {});
  31658. } },
  31659. //空数据图容器样式
  31660. emptyViewSuperStyle: {
  31661. type: Object,
  31662. default: function _default() {
  31663. return _zPagingUtils.default.gc('emptyViewSuperStyle', {});
  31664. } },
  31665. //空数据图img样式
  31666. emptyViewImgStyle: {
  31667. type: Object,
  31668. default: function _default() {
  31669. return _zPagingUtils.default.gc('emptyViewImgStyle', {});
  31670. } },
  31671. //空数据图描述文字样式
  31672. emptyViewTitleStyle: {
  31673. type: Object,
  31674. default: function _default() {
  31675. return _zPagingUtils.default.gc('emptyViewTitleStyle', {});
  31676. } },
  31677. //空数据图重新加载按钮样式
  31678. emptyViewReloadStyle: {
  31679. type: Object,
  31680. default: function _default() {
  31681. return _zPagingUtils.default.gc('emptyViewReloadStyle', {});
  31682. } },
  31683. //空数据图片是否铺满z-paging,默认为是。若设置为否,则为填充满z-paging的剩余部分
  31684. emptyViewFixed: {
  31685. type: Boolean,
  31686. default: function _default() {
  31687. return _zPagingUtils.default.gc('emptyViewFixed', false);
  31688. } },
  31689. //空数据图片是否垂直居中,默认为是。emptyViewFixed为false时有效
  31690. emptyViewCenter: {
  31691. type: Boolean,
  31692. default: function _default() {
  31693. return _zPagingUtils.default.gc('emptyViewCenter', true);
  31694. } },
  31695. //加载中时是否自动隐藏空数据图,默认为是
  31696. autoHideEmptyViewWhenLoading: {
  31697. type: Boolean,
  31698. default: _zPagingUtils.default.gc('autoHideEmptyViewWhenLoading', true) },
  31699. //用户下拉列表触发下拉刷新加载中时是否自动隐藏空数据图,默认为是
  31700. autoHideEmptyViewWhenPull: {
  31701. type: Boolean,
  31702. default: _zPagingUtils.default.gc('autoHideEmptyViewWhenPull', true) },
  31703. //空数据view的z-index,默认为9
  31704. emptyViewZIndex: {
  31705. type: Number,
  31706. default: _zPagingUtils.default.gc('emptyViewZIndex', 9) } },
  31707. computed: {
  31708. finalEmptyViewImg: function finalEmptyViewImg() {
  31709. return this.isLoadFailed ? this.emptyViewErrorImg : this.emptyViewImg;
  31710. },
  31711. finalShowEmptyViewReload: function finalShowEmptyViewReload() {
  31712. return this.isLoadFailed ? this.showEmptyViewReloadWhenError : this.showEmptyViewReload;
  31713. },
  31714. showEmpty: function showEmpty() {
  31715. if (this.refresherOnly || this.hideEmptyView || this.totalData.length) return false;
  31716. if (this.autoHideEmptyViewWhenLoading) {
  31717. if (this.isAddedData && !this.firstPageLoaded && !this.loading) return true;
  31718. } else {
  31719. return true;
  31720. }
  31721. if (!this.autoHideEmptyViewWhenPull && !this.isUserReload) return true;
  31722. return false;
  31723. } },
  31724. methods: {
  31725. //点击了空数据view重新加载按钮
  31726. _emptyViewReload: function _emptyViewReload() {var _this = this;
  31727. var callbacked = false;
  31728. this.$emit('emptyViewReload', function (reload) {
  31729. if (reload === undefined || reload === true) {
  31730. _this.fromEmptyViewReload = true;
  31731. _this.reload();
  31732. }
  31733. callbacked = true;
  31734. });
  31735. this.$nextTick(function () {
  31736. if (!callbacked) {
  31737. _this.fromEmptyViewReload = true;
  31738. _this.reload();
  31739. }
  31740. });
  31741. } } };var _default2 =
  31742. ZPEmptyView;exports.default = _default2;
  31743. /***/ }),
  31744. /* 284 */
  31745. /*!***************************************************************************************************!*\
  31746. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/modules/refresher.js ***!
  31747. \***************************************************************************************************/
  31748. /*! no static exports found */
  31749. /***/ (function(module, exports, __webpack_require__) {
  31750. "use strict";
  31751. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  31752. var _zPagingUtils = _interopRequireDefault(__webpack_require__(/*! .././z-paging-utils */ 273));
  31753. var _zPagingConstant = _interopRequireDefault(__webpack_require__(/*! .././z-paging-constant */ 272));
  31754. var _zPagingEnum = _interopRequireDefault(__webpack_require__(/*! .././z-paging-enum */ 280));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} // [z-paging]下拉刷新view模块
  31755. var ZPRefresher = {
  31756. props: {
  31757. //下拉刷新的主题样式,支持black,white,默认black
  31758. refresherThemeStyle: {
  31759. type: String,
  31760. default: function _default() {
  31761. return _zPagingUtils.default.gc('refresherThemeStyle', '');
  31762. } },
  31763. //自定义下拉刷新中左侧图标的样式
  31764. refresherImgStyle: {
  31765. type: Object,
  31766. default: function _default() {
  31767. return _zPagingUtils.default.gc('refresherImgStyle', {});
  31768. } },
  31769. //自定义下拉刷新中右侧状态描述文字的样式
  31770. refresherTitleStyle: {
  31771. type: Object,
  31772. default: function _default() {
  31773. return _zPagingUtils.default.gc('refresherTitleStyle', {});
  31774. } },
  31775. //自定义下拉刷新中右侧最后更新时间文字的样式(show-refresher-update-time为true时有效)
  31776. refresherUpdateTimeStyle: {
  31777. type: Object,
  31778. default: function _default() {
  31779. return _zPagingUtils.default.gc('refresherUpdateTimeStyle', {});
  31780. } },
  31781. //在微信小程序和QQ小程序中,是否实时监听下拉刷新中进度,默认为否
  31782. watchRefresherTouchmove: {
  31783. type: Boolean,
  31784. default: _zPagingUtils.default.gc('watchRefresherTouchmove', false) },
  31785. //底部加载更多的主题样式,支持black,white,默认black
  31786. loadingMoreThemeStyle: {
  31787. type: String,
  31788. default: function _default() {
  31789. return _zPagingUtils.default.gc('loadingMoreThemeStyle', '');
  31790. } },
  31791. //是否只使用下拉刷新,设置为true后将关闭mounted自动请求数据、关闭滚动到底部加载更多,强制隐藏空数据图。默认为否
  31792. refresherOnly: {
  31793. type: Boolean,
  31794. default: _zPagingUtils.default.gc('refresherOnly', false) },
  31795. //自定义下拉刷新结束以后延迟回弹的时间,单位为毫秒,默认为0
  31796. refresherCompleteDelay: {
  31797. type: [Number, String],
  31798. default: _zPagingUtils.default.gc('refresherCompleteDelay', 0) },
  31799. //自定义下拉刷新结束回弹动画时间,单位为毫秒,默认为300毫秒(refresherEndBounceEnabled为false时,refresherCompleteDuration为设定值的1/3),nvue无效
  31800. refresherCompleteDuration: {
  31801. type: [Number, String],
  31802. default: _zPagingUtils.default.gc('refresherCompleteDuration', 300) },
  31803. //自定义下拉刷新结束状态下是否允许列表滚动,默认为否
  31804. refresherCompleteScrollable: {
  31805. type: Boolean,
  31806. default: _zPagingUtils.default.gc('refresherCompleteScrollable', false) },
  31807. //是否使用自定义的下拉刷新,默认为是,即使用z-paging的下拉刷新。设置为false即代表使用uni scroll-view自带的下拉刷新,h5、App、微信小程序以外的平台不支持uni scroll-view自带的下拉刷新
  31808. useCustomRefresher: {
  31809. type: Boolean,
  31810. default: _zPagingUtils.default.gc('useCustomRefresher', true) },
  31811. //自定义下拉刷新下拉帧率,默认为40,过高可能会出现抖动问题
  31812. refresherFps: {
  31813. type: [Number, String],
  31814. default: _zPagingUtils.default.gc('refresherFps', 40) },
  31815. //自定义下拉刷新允许触发的最大下拉角度,默认为40度,当下拉角度小于设定值时,自定义下拉刷新动画不会被触发
  31816. refresherMaxAngle: {
  31817. type: [Number, String],
  31818. default: _zPagingUtils.default.gc('refresherMaxAngle', 40) },
  31819. //自定义下拉刷新的角度由未达到最大角度变到达到最大角度时,是否继续下拉刷新手势,默认为否
  31820. refresherAngleEnableChangeContinued: {
  31821. type: Boolean,
  31822. default: _zPagingUtils.default.gc('refresherAngleEnableChangeContinued', false) },
  31823. //自定义下拉刷新默认状态下的文字
  31824. refresherDefaultText: {
  31825. type: [String, Object],
  31826. default: _zPagingUtils.default.gc('refresherDefaultText', null) },
  31827. //自定义下拉刷新松手立即刷新状态下的文字
  31828. refresherPullingText: {
  31829. type: [String, Object],
  31830. default: _zPagingUtils.default.gc('refresherPullingText', null) },
  31831. //自定义下拉刷新刷新中状态下的文字
  31832. refresherRefreshingText: {
  31833. type: [String, Object],
  31834. default: _zPagingUtils.default.gc('refresherRefreshingText', null) },
  31835. //自定义下拉刷新刷新结束状态下的文字
  31836. refresherCompleteText: {
  31837. type: [String, Object],
  31838. default: _zPagingUtils.default.gc('refresherCompleteText', null) },
  31839. //是否开启自定义下拉刷新刷新结束回弹效果,默认为是
  31840. refresherEndBounceEnabled: {
  31841. type: Boolean,
  31842. default: _zPagingUtils.default.gc('refresherEndBounceEnabled', true) },
  31843. //是否开启自定义下拉刷新,默认为是
  31844. refresherEnabled: {
  31845. type: Boolean,
  31846. default: _zPagingUtils.default.gc('refresherEnabled', true) },
  31847. //设置自定义下拉刷新阈值,默认为80rpx
  31848. refresherThreshold: {
  31849. type: [Number, String],
  31850. default: _zPagingUtils.default.gc('refresherThreshold', '80rpx') },
  31851. //设置系统下拉刷新默认样式,支持设置 black,white,none,none 表示不使用默认样式,默认为black
  31852. refresherDefaultStyle: {
  31853. type: String,
  31854. default: _zPagingUtils.default.gc('refresherDefaultStyle', 'black') },
  31855. //设置自定义下拉刷新区域背景
  31856. refresherBackground: {
  31857. type: String,
  31858. default: _zPagingUtils.default.gc('refresherBackground', 'transparent') },
  31859. //设置固定的自定义下拉刷新区域背景
  31860. refresherFixedBackground: {
  31861. type: String,
  31862. default: _zPagingUtils.default.gc('refresherFixedBackground', 'transparent') },
  31863. //设置固定的自定义下拉刷新区域高度,默认为0
  31864. refresherFixedBacHeight: {
  31865. type: [Number, String],
  31866. default: _zPagingUtils.default.gc('refresherFixedBacHeight', 0) },
  31867. //设置自定义下拉刷新下拉超出阈值后继续下拉位移衰减的比例,范围0-1,值越大代表衰减越多。默认为0.7(nvue无效)
  31868. refresherOutRate: {
  31869. type: Number,
  31870. default: _zPagingUtils.default.gc('refresherOutRate', 0.7) },
  31871. //是否显示最后更新时间,默认为否
  31872. showRefresherUpdateTime: {
  31873. type: Boolean,
  31874. default: _zPagingUtils.default.gc('showRefresherUpdateTime', false) },
  31875. //如果需要区别不同页面的最后更新时间,请为不同页面的z-paging的`refresher-update-time-key`设置不同的字符串
  31876. refresherUpdateTimeKey: {
  31877. type: String,
  31878. default: _zPagingUtils.default.gc('refresherUpdateTimeKey', 'default') } },
  31879. data: function data() {
  31880. return {
  31881. //下拉刷新状态
  31882. refresherStatus: _zPagingEnum.default.Refresher.Default,
  31883. refresherTouchstartY: 0,
  31884. lastRefresherTouchmove: null,
  31885. refresherReachMaxAngle: true,
  31886. refresherTransform: 'translateY(0px)',
  31887. refresherTransition: '',
  31888. finalRefresherDefaultStyle: 'black',
  31889. refresherRevealStackCount: 0,
  31890. refresherCompleteTimeout: null,
  31891. refresherCompleteSubTimeout: null,
  31892. refresherEndTimeout: null,
  31893. refresherTriggered: false,
  31894. isTouchmoving: false,
  31895. isTouchEnded: false,
  31896. isUserPullDown: false,
  31897. privateRefresherEnabled: -1,
  31898. privateShowRefresherWhenReload: false,
  31899. customRefresherHeight: -1,
  31900. showCustomRefresher: false,
  31901. doRefreshAnimateAfter: false,
  31902. isRefresherInComplete: false,
  31903. pullDownTimeStamp: 0,
  31904. moveDis: 0,
  31905. oldMoveDis: 0 };
  31906. },
  31907. watch: {
  31908. refresherDefaultStyle: {
  31909. handler: function handler(newVal) {
  31910. if (newVal.length) {
  31911. this.finalRefresherDefaultStyle = newVal;
  31912. }
  31913. },
  31914. immediate: true },
  31915. refresherStatus: function refresherStatus(newVal, oldVal) {
  31916. if (newVal === _zPagingEnum.default.Refresher.Loading) {
  31917. this._cleanRefresherEndTimeout();
  31918. }
  31919. this.$emit('refresherStatusChange', newVal);
  31920. this.$emit('update:refresherStatus', newVal);
  31921. },
  31922. moveDis: function moveDis(newVal, oldVal) {
  31923. this.oldMoveDis = oldVal;
  31924. } },
  31925. computed: {
  31926. pullDownDisTimeStamp: function pullDownDisTimeStamp() {
  31927. return 1000 / this.refresherFps;
  31928. },
  31929. finalRefresherEnabled: function finalRefresherEnabled() {
  31930. if (this.useChatRecordMode) return false;
  31931. if (this.privateRefresherEnabled === -1) return this.refresherEnabled;
  31932. return this.privateRefresherEnabled === 1;
  31933. },
  31934. finalRefresherThreshold: function finalRefresherThreshold() {
  31935. var refresherThreshold = this.refresherThreshold;
  31936. var idDefault = false;
  31937. if (refresherThreshold === '80rpx') {
  31938. idDefault = true;
  31939. if (this.showRefresherUpdateTime) {
  31940. refresherThreshold = '120rpx';
  31941. }
  31942. }
  31943. if (idDefault && this.customRefresherHeight > 0) {
  31944. return this.customRefresherHeight;
  31945. }
  31946. return _zPagingUtils.default.convertTextToPx(refresherThreshold);
  31947. },
  31948. finalRefresherFixedBacHeight: function finalRefresherFixedBacHeight() {
  31949. return _zPagingUtils.default.convertTextToPx(this.refresherFixedBacHeight);
  31950. },
  31951. finalRefresherThemeStyle: function finalRefresherThemeStyle() {
  31952. return this.refresherThemeStyle.length ? this.refresherThemeStyle : this.defaultThemeStyle;
  31953. },
  31954. finalRefresherOutRate: function finalRefresherOutRate() {
  31955. var rate = this.refresherOutRate;
  31956. rate = Math.max(0, rate);
  31957. rate = Math.min(1, rate);
  31958. return rate;
  31959. },
  31960. finalRefresherTransform: function finalRefresherTransform() {
  31961. if (this.refresherTransform === 'translateY(0px)') return 'none';
  31962. return this.refresherTransform;
  31963. },
  31964. finalShowRefresherWhenReload: function finalShowRefresherWhenReload() {
  31965. return this.showRefresherWhenReload || this.privateShowRefresherWhenReload;
  31966. },
  31967. finalRefresherTriggered: function finalRefresherTriggered() {
  31968. if (!(this.finalRefresherEnabled && !this.useCustomRefresher)) return false;
  31969. return this.refresherTriggered;
  31970. },
  31971. showRefresher: function showRefresher() {var _this = this;
  31972. var showRefresher = this.finalRefresherEnabled && this.useCustomRefresher && this.isTouchmoving;
  31973. if (this.customRefresherHeight === -1 && showRefresher) {
  31974. setTimeout(function () {
  31975. _this.$nextTick(function () {
  31976. _this._updateCustomRefresherHeight();
  31977. });
  31978. }, 100);
  31979. }
  31980. return showRefresher;
  31981. },
  31982. hasTouchmove: function hasTouchmove() {
  31983. return this.watchRefresherTouchmove;
  31984. return true;
  31985. return this.watchRefresherTouchmove;
  31986. } },
  31987. methods: {
  31988. //终止下拉刷新状态
  31989. endRefresh: function endRefresh() {
  31990. this._refresherEnd();
  31991. },
  31992. handleRefresherStatusChanged: function handleRefresherStatusChanged(func) {
  31993. this.refresherStatusChangedFunc = func;
  31994. },
  31995. //自定义下拉刷新被触发
  31996. _onRefresh: function _onRefresh() {var fromScrollView = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;var isUserPullDown = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  31997. if (fromScrollView && !(this.finalRefresherEnabled && !this.useCustomRefresher)) return;
  31998. this.$emit('onRefresh');
  31999. this.$emit('Refresh');
  32000. if (this.loading || this.isRefresherInComplete) return;
  32001. this.loadingType = _zPagingEnum.default.LoadingType.Refresher;
  32002. if (this.nShowRefresherReveal) return;
  32003. this.isUserPullDown = isUserPullDown;
  32004. this.isUserReload = !isUserPullDown;
  32005. this._startLoading(true);
  32006. this.refresherTriggered = true;
  32007. if (this.reloadWhenRefresh && isUserPullDown) {
  32008. if (this.useChatRecordMode) {
  32009. this._onLoadingMore('click');
  32010. } else {
  32011. this._reload(false, false, isUserPullDown);
  32012. }
  32013. }
  32014. },
  32015. //自定义下拉刷新被复位
  32016. _onRestore: function _onRestore() {
  32017. this.refresherTriggered = 'restore';
  32018. this.$emit('onRestore');
  32019. this.$emit('Restore');
  32020. },
  32021. //进一步处理拖拽开始结果
  32022. _handleRefresherTouchstart: function _handleRefresherTouchstart(touch) {
  32023. if (!this.loading && this.isTouchEnded) {
  32024. this.isTouchmoving = false;
  32025. }
  32026. this.isTouchEnded = false;
  32027. this.refresherTransition = '';
  32028. this.refresherTouchstartY = touch.touchY;
  32029. this.$emit('refresherTouchstart', this.refresherTouchstartY);
  32030. this.lastRefresherTouchmove = touch;
  32031. this._cleanRefresherCompleteTimeout();
  32032. this._cleanRefresherEndTimeout();
  32033. },
  32034. //进一步处理拖拽中结果
  32035. _handleRefresherTouchmove: function _handleRefresherTouchmove(moveDis, touch) {
  32036. this.refresherReachMaxAngle = true;
  32037. this.isTouchmoving = true;
  32038. //this.refresherTransition = '';
  32039. this.isTouchEnded = false;
  32040. this.refresherStatus = moveDis >= this.finalRefresherThreshold ? _zPagingEnum.default.Refresher.ReleaseToRefresh : this.refresherStatus = _zPagingEnum.default.Refresher.Default;
  32041. this.moveDis = moveDis;
  32042. },
  32043. //进一步处理拖拽结束结果
  32044. _handleRefresherTouchend: function _handleRefresherTouchend(moveDis) {var _this2 = this;
  32045. this.refresherReachMaxAngle = true;
  32046. if (moveDis < 0 && this.usePageScroll && this.loadingMoreEnabled && this.useCustomRefresher && this.pageScrollTop === -1) {
  32047. if (this.showConsoleError) {
  32048. _zPagingUtils.default.consoleErr('usePageScroll为true并且自定义下拉刷新时必须引入mixin或在page滚动时通过调用z-paging组件的updatePageScrollTop方法设置当前的scrollTop');
  32049. }
  32050. }
  32051. this.isTouchEnded = true;
  32052. if (moveDis >= this.finalRefresherThreshold && this.refresherStatus === _zPagingEnum.default.Refresher.ReleaseToRefresh) {
  32053. this.moveDis = this.finalRefresherThreshold;
  32054. this.refresherStatus = _zPagingEnum.default.Refresher.Loading;
  32055. this._doRefresherLoad();
  32056. } else {
  32057. this._refresherEnd();
  32058. setTimeout(function () {
  32059. _this2.isTouchmoving = false;
  32060. }, _zPagingConstant.default.delayTime);
  32061. }
  32062. this.scrollEnable = true;
  32063. // this.refresherTransition = 'transform .1s linear';
  32064. this.$emit('refresherTouchend', moveDis);
  32065. },
  32066. //处理scroll-view bounce是否生效
  32067. _handleScrollViewDisableBounce: function _handleScrollViewDisableBounce(e) {
  32068. if (!this.usePageScroll && !this.scrollToTopBounceEnabled) {
  32069. this.refresherTransition = '';
  32070. this.scrollEnable = e.bounce;
  32071. }
  32072. },
  32073. //wxs正在下拉状态改变处理
  32074. _handleWxsPullingDownStatusChange: function _handleWxsPullingDownStatusChange(onPullingDown) {
  32075. this.wxsOnPullingDown = onPullingDown;
  32076. if (onPullingDown && !this.useChatRecordMode) {
  32077. this.renderPropScrollTop = 0;
  32078. }
  32079. },
  32080. //wxs正在下拉处理
  32081. _handleWxsPullingDown: function _handleWxsPullingDown(e) {
  32082. this._emitTouchmove({ pullingDistance: e.moveDis, dy: e.diffDis });
  32083. },
  32084. //wxs通知更新其props
  32085. _handlePropUpdate: function _handlePropUpdate(e) {
  32086. this.wxsPropType = _zPagingUtils.default.getTime().toString();
  32087. },
  32088. //下拉刷新结束
  32089. _refresherEnd: function _refresherEnd() {var _this3 = this;var shouldEndLoadingDelay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;var fromAddData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var isUserPullDown = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;var setLoading = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
  32090. if (this.loadingType === _zPagingEnum.default.LoadingType.Refresher) {
  32091. var refresherCompleteDelay = 0;
  32092. if (fromAddData && (isUserPullDown || this.showRefresherWhenReload)) {
  32093. refresherCompleteDelay = this.refresherCompleteDuration > 700 ? 1 : this.refresherCompleteDelay;
  32094. }
  32095. var refresherStatus = refresherCompleteDelay > 0 ? _zPagingEnum.default.Refresher.Complete : _zPagingEnum.default.Refresher.Default;
  32096. if (this.finalShowRefresherWhenReload) {
  32097. var stackCount = this.refresherRevealStackCount;
  32098. this.refresherRevealStackCount--;
  32099. if (stackCount > 1) return;
  32100. }
  32101. this._cleanRefresherEndTimeout();
  32102. this.refresherEndTimeout = setTimeout(function () {
  32103. _this3.refresherStatus = refresherStatus;
  32104. }, refresherStatus === _zPagingEnum.default.Refresher.Default ? this.refresherCompleteDuration : 0);
  32105. if (refresherCompleteDelay > 0) {
  32106. this.isRefresherInComplete = true;
  32107. }
  32108. this._cleanRefresherCompleteTimeout();
  32109. this.refresherCompleteTimeout = setTimeout(function () {
  32110. var animateDuration = 1;
  32111. var animateType = _this3.refresherEndBounceEnabled && fromAddData ? 'cubic-bezier(0.19,1.64,0.42,0.72)' : 'linear';
  32112. if (fromAddData) {
  32113. animateDuration = _this3.refresherEndBounceEnabled ? _this3.refresherCompleteDuration / 1000 : _this3.refresherCompleteDuration / 3000;
  32114. }
  32115. _this3.refresherTransition = "transform ".concat(fromAddData ? animateDuration : 0.1, "s ").concat(animateType);
  32116. _this3.wxsPropType = _this3.refresherTransition + 'end' + _zPagingUtils.default.getTime();
  32117. _this3.moveDis = 0;
  32118. if (refresherStatus === _zPagingEnum.default.Refresher.Complete) {
  32119. if (_this3.refresherCompleteSubTimeout) {
  32120. clearTimeout(_this3.refresherCompleteSubTimeout);
  32121. _this3.refresherCompleteSubTimeout = null;
  32122. }
  32123. _this3.refresherCompleteSubTimeout = setTimeout(function () {
  32124. _this3.$nextTick(function () {
  32125. _this3.refresherStatus = _zPagingEnum.default.Refresher.Default;
  32126. _this3.isRefresherInComplete = false;
  32127. });
  32128. }, animateDuration * 800);
  32129. }
  32130. }, refresherCompleteDelay);
  32131. }
  32132. if (setLoading) {
  32133. setTimeout(function () {
  32134. _this3.loading = false;
  32135. }, shouldEndLoadingDelay ? _zPagingConstant.default.delayTime : 0);
  32136. isUserPullDown && this._onRestore();
  32137. }
  32138. },
  32139. //模拟用户手动触发下拉刷新
  32140. _doRefresherRefreshAnimate: function _doRefresherRefreshAnimate() {
  32141. this._cleanRefresherCompleteTimeout();
  32142. var doRefreshAnimateAfter = !this.doRefreshAnimateAfter && this.finalShowRefresherWhenReload && this.
  32143. customRefresherHeight === -1 && this.refresherThreshold === '80rpx';
  32144. if (doRefreshAnimateAfter) {
  32145. this.doRefreshAnimateAfter = true;
  32146. return;
  32147. }
  32148. this.refresherRevealStackCount++;
  32149. this.wxsPropType = 'begin' + _zPagingUtils.default.getTime();
  32150. this.moveDis = this.finalRefresherThreshold;
  32151. this.refresherStatus = _zPagingEnum.default.Refresher.Loading;
  32152. this.isTouchmoving = true;
  32153. this._doRefresherLoad(false);
  32154. },
  32155. //触发下拉刷新
  32156. _doRefresherLoad: function _doRefresherLoad() {var isUserPullDown = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
  32157. this._onRefresh(false, isUserPullDown);
  32158. this.loading = true;
  32159. },
  32160. //获取处理后的moveDis
  32161. _getFinalRefresherMoveDis: function _getFinalRefresherMoveDis(moveDis) {
  32162. moveDis = moveDis * 0.85;
  32163. if (moveDis >= this.finalRefresherThreshold) {
  32164. moveDis = this.finalRefresherThreshold + (moveDis - this.finalRefresherThreshold) * (1 - this.finalRefresherOutRate);
  32165. }
  32166. return moveDis;
  32167. },
  32168. //更新自定义下拉刷新view高度
  32169. _updateCustomRefresherHeight: function _updateCustomRefresherHeight() {var _this4 = this;
  32170. this._getNodeClientRect('.zp-custom-refresher-slot-view').then(function (res) {
  32171. if (res) {
  32172. _this4.customRefresherHeight = res[0].height;
  32173. if (_this4.customRefresherHeight > 0) {
  32174. _this4.showCustomRefresher = true;
  32175. }
  32176. } else {
  32177. _this4.customRefresherHeight = 0;
  32178. }
  32179. if (_this4.doRefreshAnimateAfter) {
  32180. _this4.doRefreshAnimateAfter = false;
  32181. _this4._doRefresherRefreshAnimate();
  32182. }
  32183. });
  32184. },
  32185. //发射pullingDown事件
  32186. _emitTouchmove: function _emitTouchmove(e) {
  32187. e.viewHeight = this.finalRefresherThreshold;
  32188. e.rate = e.pullingDistance / e.viewHeight;
  32189. if (this.hasTouchmove) {
  32190. this.$emit('refresherTouchmove', e);
  32191. }
  32192. },
  32193. //清除refresherCompleteTimeout
  32194. _cleanRefresherCompleteTimeout: function _cleanRefresherCompleteTimeout() {
  32195. this.refresherCompleteTimeout = this._cleanTimeout(this.refresherCompleteTimeout);
  32196. },
  32197. //清除refresherEndTimeout
  32198. _cleanRefresherEndTimeout: function _cleanRefresherEndTimeout() {
  32199. this.refresherEndTimeout = this._cleanTimeout(this.refresherEndTimeout);
  32200. } } };var _default2 =
  32201. ZPRefresher;exports.default = _default2;
  32202. /***/ }),
  32203. /* 285 */
  32204. /*!***************************************************************************************************!*\
  32205. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/modules/load-more.js ***!
  32206. \***************************************************************************************************/
  32207. /*! no static exports found */
  32208. /***/ (function(module, exports, __webpack_require__) {
  32209. "use strict";
  32210. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 22));
  32211. var _zPagingUtils = _interopRequireDefault(__webpack_require__(/*! .././z-paging-utils */ 273));
  32212. var _zPagingEnum = _interopRequireDefault(__webpack_require__(/*! .././z-paging-enum */ 280));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);});};}
  32213. var ZPLoadMore = {
  32214. props: {
  32215. //自定义底部加载更多样式
  32216. loadingMoreCustomStyle: {
  32217. type: Object,
  32218. default: function _default() {
  32219. return _zPagingUtils.default.gc('loadingMoreCustomStyle', {});
  32220. } },
  32221. //自定义底部加载更多文字样式
  32222. loadingMoreTitleCustomStyle: {
  32223. type: Object,
  32224. default: function _default() {
  32225. return _zPagingUtils.default.gc('loadingMoreTitleCustomStyle', {});
  32226. } },
  32227. //自定义底部加载更多加载中动画样式
  32228. loadingMoreLoadingIconCustomStyle: {
  32229. type: Object,
  32230. default: function _default() {
  32231. return _zPagingUtils.default.gc('loadingMoreLoadingIconCustomStyle', {});
  32232. } },
  32233. //自定义底部加载更多加载中动画图标类型,可选flower或circle,默认为flower
  32234. loadingMoreLoadingIconType: {
  32235. type: String,
  32236. default: _zPagingUtils.default.gc('loadingMoreLoadingIconType', 'flower') },
  32237. //自定义底部加载更多加载中动画图标图片
  32238. loadingMoreLoadingIconCustomImage: {
  32239. type: String,
  32240. default: _zPagingUtils.default.gc('loadingMoreLoadingIconCustomImage', '') },
  32241. //底部加载更多加载中view是否展示旋转动画,默认为是
  32242. loadingMoreLoadingAnimated: {
  32243. type: Boolean,
  32244. default: _zPagingUtils.default.gc('loadingMoreLoadingAnimated', true) },
  32245. //是否启用加载更多数据(含滑动到底部加载更多数据和点击加载更多数据),默认为是
  32246. loadingMoreEnabled: {
  32247. type: Boolean,
  32248. default: _zPagingUtils.default.gc('loadingMoreEnabled', true) },
  32249. //是否启用滑动到底部加载更多数据,默认为是
  32250. toBottomLoadingMoreEnabled: {
  32251. type: Boolean,
  32252. default: _zPagingUtils.default.gc('toBottomLoadingMoreEnabled', true) },
  32253. //滑动到底部状态为默认状态时,以加载中的状态展示,默认为否。若设置为是,可避免滚动到底部看到默认状态然后立刻变为加载中状态的问题,但分页数量未超过一屏时,不会显示【点击加载更多】
  32254. loadingMoreDefaultAsLoading: {
  32255. type: [Boolean],
  32256. default: _zPagingUtils.default.gc('loadingMoreDefaultAsLoading', false) },
  32257. //滑动到底部"默认"文字,默认为【点击加载更多】
  32258. loadingMoreDefaultText: {
  32259. type: [String, Object],
  32260. default: _zPagingUtils.default.gc('loadingMoreDefaultText', null) },
  32261. //滑动到底部"加载中"文字,默认为【正在加载...】
  32262. loadingMoreLoadingText: {
  32263. type: [String, Object],
  32264. default: _zPagingUtils.default.gc('loadingMoreLoadingText', null) },
  32265. //滑动到底部"没有更多"文字,默认为【没有更多了】
  32266. loadingMoreNoMoreText: {
  32267. type: [String, Object],
  32268. default: _zPagingUtils.default.gc('loadingMoreNoMoreText', null) },
  32269. //滑动到底部"加载失败"文字,默认为【加载失败,点击重新加载】
  32270. loadingMoreFailText: {
  32271. type: [String, Object],
  32272. default: _zPagingUtils.default.gc('loadingMoreFailText', null) },
  32273. //当没有更多数据且分页内容未超出z-paging时是否隐藏没有更多数据的view,默认为否
  32274. hideLoadingMoreWhenNoMoreAndInsideOfPaging: {
  32275. type: Boolean,
  32276. default: _zPagingUtils.default.gc('hideLoadingMoreWhenNoMoreAndInsideOfPaging', false) },
  32277. //当没有更多数据且分页数组长度少于这个值时,隐藏没有更多数据的view,默认为0,代表不限制。
  32278. hideLoadingMoreWhenNoMoreByLimit: {
  32279. type: Number,
  32280. default: _zPagingUtils.default.gc('hideLoadingMoreWhenNoMoreByLimit', 0) },
  32281. //是否显示默认的加载更多text,默认为是
  32282. showDefaultLoadingMoreText: {
  32283. type: Boolean,
  32284. default: _zPagingUtils.default.gc('showDefaultLoadingMoreText', true) },
  32285. //是否显示没有更多数据的view
  32286. showLoadingMoreNoMoreView: {
  32287. type: Boolean,
  32288. default: _zPagingUtils.default.gc('showLoadingMoreNoMoreView', true) },
  32289. //是否显示没有更多数据的分割线,默认为是
  32290. showLoadingMoreNoMoreLine: {
  32291. type: Boolean,
  32292. default: _zPagingUtils.default.gc('showLoadingMoreNoMoreLine', true) },
  32293. //自定义底部没有更多数据的分割线样式
  32294. loadingMoreNoMoreLineCustomStyle: {
  32295. type: Object,
  32296. default: function _default() {
  32297. return _zPagingUtils.default.gc('loadingMoreNoMoreLineCustomStyle', {});
  32298. } },
  32299. //距底部/右边多远时(单位px),触发 scrolltolower 事件,默认为100rpx
  32300. lowerThreshold: {
  32301. type: [Number, String],
  32302. default: _zPagingUtils.default.gc('lowerThreshold', '100rpx') } },
  32303. data: function data() {
  32304. return {
  32305. //底部加载更多状态
  32306. loadingStatus: _zPagingEnum.default.More.Default,
  32307. loadingStatusAfterRender: _zPagingEnum.default.More.Default,
  32308. loadingMoreTimeStamp: 0,
  32309. loadingMoreDefaultSlot: null,
  32310. showLoadingMore: false,
  32311. customNoMore: -1 };
  32312. },
  32313. computed: {
  32314. zPagingLoadMoreConfig: function zPagingLoadMoreConfig() {
  32315. return {
  32316. status: this.loadingStatusAfterRender,
  32317. defaultAsLoading: this.loadingMoreDefaultAsLoading,
  32318. defaultThemeStyle: this.finalLoadingMoreThemeStyle,
  32319. customStyle: this.loadingMoreCustomStyle,
  32320. titleCustomStyle: this.loadingMoreTitleCustomStyle,
  32321. iconCustomStyle: this.loadingMoreLoadingIconCustomStyle,
  32322. loadingIconType: this.loadingMoreLoadingIconType,
  32323. loadingIconCustomImage: this.loadingMoreLoadingIconCustomImage,
  32324. loadingAnimated: this.loadingMoreLoadingAnimated,
  32325. showNoMoreLine: this.showLoadingMoreNoMoreLine,
  32326. noMoreLineCustomStyle: this.loadingMoreNoMoreLineCustomStyle,
  32327. defaultText: this.finalLoadingMoreDefaultText,
  32328. loadingText: this.finalLoadingMoreLoadingText,
  32329. noMoreText: this.finalLoadingMoreNoMoreText,
  32330. failText: this.finalLoadingMoreFailText };
  32331. },
  32332. finalLoadingMoreThemeStyle: function finalLoadingMoreThemeStyle() {
  32333. return this.loadingMoreThemeStyle.length ? this.loadingMoreThemeStyle : this.defaultThemeStyle;
  32334. } },
  32335. methods: {
  32336. //手动触发上拉加载更多(非必须,可依据具体需求使用)
  32337. doLoadMore: function doLoadMore() {
  32338. this._onLoadingMore('toBottom');
  32339. },
  32340. //通过@scroll事件检测是否滚动到了底部
  32341. _checkScrolledToBottom: function _checkScrolledToBottom(scrollDiff) {var _this = this;var checked = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  32342. if (this.checkScrolledToBottomTimeOut) {
  32343. clearTimeout(this.checkScrolledToBottomTimeOut);
  32344. this.checkScrolledToBottomTimeOut = null;
  32345. }
  32346. if (this.cacheScrollNodeHeight === -1) {
  32347. this._getNodeClientRect('.zp-scroll-view').then(function (res) {
  32348. if (res) {
  32349. var pageScrollNodeHeight = res[0].height;
  32350. _this.cacheScrollNodeHeight = pageScrollNodeHeight;
  32351. if (scrollDiff - pageScrollNodeHeight <= _this.finalLowerThreshold) {
  32352. _this._onLoadingMore('toBottom');
  32353. }
  32354. }
  32355. });
  32356. } else {
  32357. if (scrollDiff - this.cacheScrollNodeHeight <= this.finalLowerThreshold) {
  32358. this._onLoadingMore('toBottom');
  32359. } else if (scrollDiff - this.cacheScrollNodeHeight <= 500 && !checked) {
  32360. this.checkScrolledToBottomTimeOut = setTimeout(function () {
  32361. _this._getNodeClientRect('.zp-scroll-view', true, true).then(function (res) {
  32362. _this.oldScrollTop = res[0].scrollTop;
  32363. var newScrollDiff = res[0].scrollHeight - _this.oldScrollTop;
  32364. _this._checkScrolledToBottom(newScrollDiff, true);
  32365. });
  32366. }, 150);
  32367. }
  32368. }
  32369. },
  32370. //触发加载更多时调用,from:0-滑动到底部触发;1-点击加载更多触发
  32371. _onLoadingMore: function _onLoadingMore() {var _this2 = this;var from = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'click';
  32372. if (from === 'toBottom') {
  32373. if (!this.scrollToBottomBounceEnabled) {
  32374. if (this.scrollEnable) {
  32375. this.scrollEnable = false;
  32376. this.$nextTick(function () {
  32377. _this2.scrollEnable = true;
  32378. });
  32379. }
  32380. }
  32381. }
  32382. this.$emit('scrolltolower', from);
  32383. if (from === 'toBottom' && (!this.toBottomLoadingMoreEnabled || this.useChatRecordMode)) return;
  32384. if (this.refresherOnly || !this.loadingMoreEnabled || !(this.loadingStatus === _zPagingEnum.default.More.Default || this.loadingStatus === _zPagingEnum.default.More.Fail) || this.loading) return;
  32385. if (!this.isIos && !this.refresherOnly && !this.usePageScroll) {
  32386. var currentTimestamp = _zPagingUtils.default.getTime();
  32387. if (this.loadingMoreTimeStamp > 0 && currentTimestamp - this.loadingMoreTimeStamp < 100) {
  32388. this.loadingMoreTimeStamp = 0;
  32389. return;
  32390. }
  32391. }
  32392. this._doLoadingMore();
  32393. },
  32394. //处理开始加载更多
  32395. _doLoadingMore: function _doLoadingMore() {var _this3 = this;
  32396. if (this.pageNo >= this.defaultPageNo && this.loadingStatus !== _zPagingEnum.default.More.NoMore) {
  32397. this.pageNo++;
  32398. this._startLoading(false);
  32399. if (this.isLocalPaging) {
  32400. this._localPagingQueryList(this.pageNo, this.defaultPageSize, this.localPagingLoadingTime, function (res) {
  32401. _this3.addData(res);
  32402. });
  32403. } else {
  32404. this._emitQuery(this.pageNo, this.defaultPageSize, _zPagingEnum.default.QueryFrom.LoadingMore);
  32405. this._callMyParentQuery();
  32406. }
  32407. this.loadingType = _zPagingEnum.default.LoadingType.LoadingMore;
  32408. }
  32409. },
  32410. //(预处理)判断当没有更多数据且分页内容未超出z-paging时是否显示没有更多数据的view
  32411. _preCheckShowLoadingMoreWhenNoMoreAndInsideOfPaging: function _preCheckShowLoadingMoreWhenNoMoreAndInsideOfPaging(newVal, scrollViewNode, pagingContainerNode) {var _this4 = this;
  32412. if (this.loadingStatus === _zPagingEnum.default.More.NoMore && this.hideLoadingMoreWhenNoMoreByLimit > 0 && newVal.length) {
  32413. this.showLoadingMore = newVal.length > this.hideLoadingMoreWhenNoMoreByLimit;
  32414. } else if (this.loadingStatus === _zPagingEnum.default.More.NoMore && this.hideLoadingMoreWhenNoMoreAndInsideOfPaging && newVal.length || this.insideMore && this.insideOfPaging !== false && newVal.length) {
  32415. this.$nextTick(function () {
  32416. _this4._checkShowLoadingMoreWhenNoMoreAndInsideOfPaging(newVal, scrollViewNode, pagingContainerNode);
  32417. });
  32418. if (this.insideMore && this.insideOfPaging !== false && newVal.length) {
  32419. this.showLoadingMore = newVal.length;
  32420. }
  32421. } else {
  32422. this.showLoadingMore = newVal.length;
  32423. }
  32424. },
  32425. //判断当没有更多数据且分页内容未超出z-paging时是否显示没有更多数据的view
  32426. _checkShowLoadingMoreWhenNoMoreAndInsideOfPaging: function _checkShowLoadingMoreWhenNoMoreAndInsideOfPaging(totalData, oldScrollViewNode, oldPagingContainerNode) {var _this5 = this;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee() {var scrollViewNode, scrollViewTotalH, pagingContainerH, scrollViewH, pagingContainerNode;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:_context.prev = 0;_context.t0 =
  32427. oldScrollViewNode;if (_context.t0) {_context.next = 6;break;}_context.next = 5;return _this5._getNodeClientRect('.zp-scroll-view');case 5:_context.t0 = _context.sent;case 6:scrollViewNode = _context.t0;if (!
  32428. _this5.usePageScroll) {_context.next = 11;break;}
  32429. if (scrollViewNode) {
  32430. scrollViewTotalH = scrollViewNode[0].top + scrollViewNode[0].height;
  32431. _this5.insideOfPaging = scrollViewTotalH < _this5.windowHeight;
  32432. if (_this5.hideLoadingMoreWhenNoMoreAndInsideOfPaging) {
  32433. _this5.showLoadingMore = !_this5.insideOfPaging;
  32434. }
  32435. _this5._updateInsideOfPaging();
  32436. }_context.next = 24;break;case 11:
  32437. pagingContainerH = 0;
  32438. scrollViewH = 0;_context.t1 =
  32439. oldPagingContainerNode;if (_context.t1) {_context.next = 18;break;}_context.next = 17;return _this5._getNodeClientRect('.zp-paging-container-content');case 17:_context.t1 = _context.sent;case 18:pagingContainerNode = _context.t1;
  32440. if (pagingContainerNode) {
  32441. pagingContainerH = pagingContainerNode[0].height;
  32442. }
  32443. if (scrollViewNode) {
  32444. scrollViewH = scrollViewNode[0].height;
  32445. }
  32446. _this5.insideOfPaging = pagingContainerH < scrollViewH;
  32447. if (_this5.hideLoadingMoreWhenNoMoreAndInsideOfPaging) {
  32448. _this5.showLoadingMore = !_this5.insideOfPaging;
  32449. }
  32450. _this5._updateInsideOfPaging();case 24:_context.next = 31;break;case 26:_context.prev = 26;_context.t2 = _context["catch"](0);
  32451. _this5.insideOfPaging = !totalData.length;
  32452. if (_this5.hideLoadingMoreWhenNoMoreAndInsideOfPaging) {
  32453. _this5.showLoadingMore = !_this5.insideOfPaging;
  32454. }
  32455. _this5._updateInsideOfPaging();case 31:case "end":return _context.stop();}}}, _callee, null, [[0, 26]]);}))();
  32456. },
  32457. //是否要展示上拉加载更多view
  32458. _showLoadingMore: function _showLoadingMore(type) {
  32459. if (!(this.loadingStatus === _zPagingEnum.default.More.Default ? this.nShowBottom : true)) return false;
  32460. if ((!this.showLoadingMoreWhenReload || this.isUserPullDown || this.loadingStatus !== _zPagingEnum.default.More.Loading) && !this.showLoadingMore || !this.loadingMoreEnabled && (!this.showLoadingMoreWhenReload || this.
  32461. isUserPullDown || this.loadingStatus !== _zPagingEnum.default.More.Loading) || this.refresherOnly) return false;
  32462. if (this.useChatRecordMode && type !== 'Loading') return false;
  32463. if (!this.$slots) return false;
  32464. if (type === 'Custom') {
  32465. return this.showDefaultLoadingMoreText && !(this.loadingStatus === _zPagingEnum.default.More.NoMore && !this.showLoadingMoreNoMoreView);
  32466. }
  32467. var res = this.loadingStatus === _zPagingEnum.default.More[type] && this.$slots["loadingMore".concat(type)] && (type === 'NoMore' ? this.showLoadingMoreNoMoreView : true);
  32468. if (res) {
  32469. }
  32470. return res;
  32471. } } };var _default2 =
  32472. ZPLoadMore;exports.default = _default2;
  32473. /***/ }),
  32474. /* 286 */
  32475. /*!**************************************************************************************************!*\
  32476. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/modules/scroller.js ***!
  32477. \**************************************************************************************************/
  32478. /*! no static exports found */
  32479. /***/ (function(module, exports, __webpack_require__) {
  32480. "use strict";
  32481. /* 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 */ 22));
  32482. var _zPagingUtils = _interopRequireDefault(__webpack_require__(/*! .././z-paging-utils */ 273));
  32483. var _zPagingEnum = _interopRequireDefault(__webpack_require__(/*! .././z-paging-enum */ 280));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);});};}
  32484. var ZPScroller = {
  32485. props: {
  32486. //使用页面滚动,默认为否,当设置为是时则使用页面的滚动而非此组件内部的scroll-view的滚动,使用页面滚动时z-paging无需设置确定的高度且对于长列表展示性能更高,但配置会略微繁琐
  32487. usePageScroll: {
  32488. type: Boolean,
  32489. default: _zPagingUtils.default.gc('usePageScroll', false) },
  32490. //是否可以滚动,使用内置scroll-view和nvue时有效,默认为是
  32491. scrollable: {
  32492. type: Boolean,
  32493. default: _zPagingUtils.default.gc('scrollable', true) },
  32494. //控制是否出现滚动条,默认为是
  32495. showScrollbar: {
  32496. type: Boolean,
  32497. default: _zPagingUtils.default.gc('showScrollbar', true) },
  32498. //是否允许横向滚动,默认为否
  32499. scrollX: {
  32500. type: Boolean,
  32501. default: _zPagingUtils.default.gc('scrollX', false) },
  32502. //iOS设备上滚动到顶部时是否允许回弹效果,默认为否。关闭回弹效果后可使滚动到顶部与下拉刷新更连贯,但是有吸顶view时滚动到顶部时可能出现抖动。
  32503. scrollToTopBounceEnabled: {
  32504. type: Boolean,
  32505. default: _zPagingUtils.default.gc('scrollToTopBounceEnabled', false) },
  32506. //iOS设备上滚动到底部时是否允许回弹效果,默认为是。
  32507. scrollToBottomBounceEnabled: {
  32508. type: Boolean,
  32509. default: _zPagingUtils.default.gc('scrollToBottomBounceEnabled', true) },
  32510. //在设置滚动条位置时使用动画过渡,默认为否
  32511. scrollWithAnimation: {
  32512. type: Boolean,
  32513. default: _zPagingUtils.default.gc('scrollWithAnimation', false) },
  32514. //值应为某子元素id(id不能以数字开头)。设置哪个方向可滚动,则在哪个方向滚动到该元素
  32515. scrollIntoView: {
  32516. type: String,
  32517. default: _zPagingUtils.default.gc('scrollIntoView', '') } },
  32518. data: function data() {
  32519. return {
  32520. scrollTop: 0,
  32521. oldScrollTop: 0,
  32522. scrollViewStyle: {},
  32523. scrollViewInStyle: {},
  32524. pageScrollTop: -1,
  32525. scrollEnable: true,
  32526. privateScrollWithAnimation: -1,
  32527. cacheScrollNodeHeight: -1 };
  32528. },
  32529. watch: {
  32530. oldScrollTop: function oldScrollTop(newVal, oldVal) {
  32531. !this.usePageScroll && this._scrollTopChange(newVal, oldVal, false);
  32532. },
  32533. pageScrollTop: function pageScrollTop(newVal, oldVal) {
  32534. this.usePageScroll && this._scrollTopChange(newVal, oldVal, true);
  32535. },
  32536. usePageScroll: {
  32537. handler: function handler(newVal) {var _this = this;
  32538. this.$nextTick(function () {
  32539. _this.renderPropUsePageScroll = newVal;
  32540. });
  32541. if (this.loaded && this.autoHeight) {
  32542. this._setAutoHeight(!newVal);
  32543. }
  32544. },
  32545. immediate: true },
  32546. finalScrollTop: function finalScrollTop(newVal, oldVal) {
  32547. if (!this.useChatRecordMode) {
  32548. this.renderPropScrollTop = newVal < 6 ? 0 : 10;
  32549. }
  32550. } },
  32551. computed: {
  32552. finalScrollWithAnimation: function finalScrollWithAnimation() {
  32553. if (this.privateScrollWithAnimation !== -1) {
  32554. var scrollWithAnimation = this.privateScrollWithAnimation === 1;
  32555. this.privateScrollWithAnimation = -1;
  32556. return scrollWithAnimation;
  32557. }
  32558. return this.scrollWithAnimation;
  32559. },
  32560. finalScrollViewStyle: function finalScrollViewStyle() {
  32561. if (this.superContentZIndex != 1) {
  32562. this.scrollViewStyle['z-index'] = this.superContentZIndex;
  32563. this.scrollViewStyle['position'] = 'relative';
  32564. }
  32565. return this.scrollViewStyle;
  32566. },
  32567. finalScrollTop: function finalScrollTop() {
  32568. return this.usePageScroll ? this.pageScrollTop : this.oldScrollTop;
  32569. } },
  32570. methods: {
  32571. //滚动到顶部,animate为是否展示滚动动画,默认为是
  32572. scrollToTop: function scrollToTop(animate) {var _this2 = this;var checkReverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  32573. this.$nextTick(function () {
  32574. _this2._scrollToTop(animate, false);
  32575. });
  32576. },
  32577. //滚动到底部,animate为是否展示滚动动画,默认为是
  32578. scrollToBottom: function scrollToBottom(animate) {var _this3 = this;var checkReverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  32579. this.$nextTick(function () {
  32580. _this3._scrollToBottom(animate);
  32581. });
  32582. },
  32583. //滚动到指定view(vue中有效)。sel为需要滚动的view的id值,不包含"#";offset为偏移量,单位为px;animate为是否展示滚动动画,默认为否
  32584. scrollIntoViewById: function scrollIntoViewById(sel, offset, animate) {
  32585. this._scrollIntoView(sel, offset, animate);
  32586. },
  32587. //滚动到指定view(vue中有效)。nodeTop为需要滚动的view的top值(通过uni.createSelectorQuery()获取);offset为偏移量,单位为px;animate为是否展示滚动动画,默认为否
  32588. scrollIntoViewByNodeTop: function scrollIntoViewByNodeTop(nodeTop, offset, animate) {var _this4 = this;
  32589. this.scrollTop = this.oldScrollTop;
  32590. this.$nextTick(function () {
  32591. _this4._scrollIntoViewByNodeTop(nodeTop, offset, animate);
  32592. });
  32593. },
  32594. //滚动到指定位置(vue中有效)。y为与顶部的距离,单位为px;offset为偏移量,单位为px;animate为是否展示滚动动画,默认为否
  32595. scrollToY: function scrollToY(y, offset, animate) {var _this5 = this;
  32596. this.scrollTop = this.oldScrollTop;
  32597. this.$nextTick(function () {
  32598. _this5._scrollToY(y, offset, animate);
  32599. });
  32600. },
  32601. //滚动到指定view(nvue中有效)。index为需要滚动的view的index(第几个);offset为偏移量,单位为px;animate为是否展示滚动动画,默认为否
  32602. scrollIntoViewByIndex: function scrollIntoViewByIndex(index, offset, animate) {
  32603. this._scrollIntoView(index, offset, animate);
  32604. },
  32605. //滚动到指定view(nvue中有效)。view为需要滚动的view(通过`this.$refs.xxx`获取),不包含"#";offset为偏移量,单位为px;animate为是否展示滚动动画,默认为否
  32606. scrollIntoViewByView: function scrollIntoViewByView(view, offset, animate) {
  32607. this._scrollIntoView(view, offset, animate);
  32608. },
  32609. //当使用页面滚动并且自定义下拉刷新时,请在页面的onPageScroll中调用此方法,告知z-paging当前的pageScrollTop,否则会导致在任意位置都可以下拉刷新
  32610. updatePageScrollTop: function updatePageScrollTop(value) {
  32611. if (value == undefined) {
  32612. _zPagingUtils.default.consoleErr('updatePageScrollTop方法缺少参数,请将页面onPageScroll事件中的scrollTop传递给此方法');
  32613. return;
  32614. }
  32615. this.pageScrollTop = value;
  32616. },
  32617. //当使用页面滚动并且设置了slot="top"时,默认初次加载会自动获取其高度,并使内部容器下移,当slot="top"的view高度动态改变时,在其高度需要更新时调用此方法
  32618. updatePageScrollTopHeight: function updatePageScrollTopHeight() {
  32619. this._updatePageScrollTopOrBottomHeight('top');
  32620. },
  32621. //当使用页面滚动并且设置了slot="bottom"时,默认初次加载会自动获取其高度,并使内部容器下移,当slot="bottom"的view高度动态改变时,在其高度需要更新时调用此方法
  32622. updatePageScrollBottomHeight: function updatePageScrollBottomHeight() {
  32623. this._updatePageScrollTopOrBottomHeight('bottom');
  32624. },
  32625. //更新z-paging内置scroll-view的scrollTop
  32626. updateScrollViewScrollTop: function updateScrollViewScrollTop(scrollTop) {var _this6 = this;var animate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  32627. this.privateScrollWithAnimation = animate ? 1 : 0;
  32628. this.scrollTop = this.oldScrollTop;
  32629. this.$nextTick(function () {
  32630. _this6.scrollTop = scrollTop;
  32631. _this6.oldScrollTop = _this6.scrollTop;
  32632. });
  32633. },
  32634. //当滚动到顶部时
  32635. _scrollToUpper: function _scrollToUpper() {var _this7 = this;
  32636. this.$emit('scrolltoupper');
  32637. this.$emit('scrollTopChange', 0);
  32638. this.$nextTick(function () {
  32639. _this7.oldScrollTop = 0;
  32640. });
  32641. if (!this.useChatRecordMode) return;
  32642. if (this.loadingStatus === _zPagingEnum.default.More.NoMore) return;
  32643. this._onLoadingMore('click');
  32644. },
  32645. //滚动到顶部
  32646. _scrollToTop: function _scrollToTop() {var _this8 = this;var animate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;var isPrivate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  32647. if (this.usePageScroll) {
  32648. this.$nextTick(function () {
  32649. uni.pageScrollTo({
  32650. scrollTop: 0,
  32651. duration: animate ? 100 : 0 });
  32652. });
  32653. return;
  32654. }
  32655. this.privateScrollWithAnimation = animate ? 1 : 0;
  32656. this.scrollTop = this.oldScrollTop;
  32657. this.$nextTick(function () {
  32658. _this8.scrollTop = 0;
  32659. _this8.oldScrollTop = _this8.scrollTop;
  32660. });
  32661. },
  32662. //滚动到底部
  32663. _scrollToBottom: function _scrollToBottom() {var _arguments = arguments,_this9 = this;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee() {var animate, pagingContainerH, scrollViewH, pagingContainerNode, scrollViewNode;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:animate = _arguments.length > 0 && _arguments[0] !== undefined ? _arguments[0] : true;if (!
  32664. _this9.usePageScroll) {_context.next = 4;break;}
  32665. _this9.$nextTick(function () {
  32666. uni.pageScrollTo({
  32667. scrollTop: Number.MAX_VALUE,
  32668. duration: animate ? 100 : 0 });
  32669. });return _context.abrupt("return");case 4:_context.prev = 4;
  32670. _this9.privateScrollWithAnimation = animate ? 1 : 0;
  32671. pagingContainerH = 0;
  32672. scrollViewH = 0;_context.next = 10;return (
  32673. _this9._getNodeClientRect('.zp-paging-container'));case 10:pagingContainerNode = _context.sent;_context.next = 13;return (
  32674. _this9._getNodeClientRect('.zp-scroll-view'));case 13:scrollViewNode = _context.sent;
  32675. if (pagingContainerNode) {
  32676. pagingContainerH = pagingContainerNode[0].height;
  32677. }
  32678. if (scrollViewNode) {
  32679. scrollViewH = scrollViewNode[0].height;
  32680. }
  32681. if (pagingContainerH > scrollViewH) {
  32682. _this9.scrollTop = _this9.oldScrollTop;
  32683. _this9.$nextTick(function () {
  32684. _this9.scrollTop = pagingContainerH - scrollViewH;
  32685. _this9.oldScrollTop = _this9.scrollTop;
  32686. });
  32687. }_context.next = 21;break;case 19:_context.prev = 19;_context.t0 = _context["catch"](4);case 21:case "end":return _context.stop();}}}, _callee, null, [[4, 19]]);}))();
  32688. },
  32689. //滚动到指定view
  32690. _scrollIntoView: function _scrollIntoView(sel) {var _this10 = this;var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;var animate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;var finishCallback = arguments.length > 3 ? arguments[3] : undefined;
  32691. try {
  32692. this.scrollTop = this.oldScrollTop;
  32693. this.$nextTick(function () {
  32694. if (sel.indexOf('#') != -1) {
  32695. sel = sel.replace('#', '');
  32696. }
  32697. _this10._getNodeClientRect('#' + sel, false).then(function (node) {
  32698. if (node) {
  32699. var nodeTop = node[0].top;
  32700. _this10._scrollIntoViewByNodeTop(nodeTop, offset, animate);
  32701. if (finishCallback) {
  32702. finishCallback();
  32703. }
  32704. }
  32705. });
  32706. });
  32707. } catch (e) {}
  32708. },
  32709. //通过nodeTop滚动到指定view
  32710. _scrollIntoViewByNodeTop: function _scrollIntoViewByNodeTop(nodeTop) {var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;var animate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  32711. this._scrollToY(nodeTop, offset, animate, true);
  32712. },
  32713. //滚动到指定位置
  32714. _scrollToY: function _scrollToY(y) {var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;var animate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;var addScrollTop = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  32715. this.privateScrollWithAnimation = animate ? 1 : 0;
  32716. if (this.usePageScroll) {
  32717. uni.pageScrollTo({
  32718. scrollTop: y - offset,
  32719. duration: animate ? 100 : 0 });
  32720. } else {
  32721. if (addScrollTop) {
  32722. y += this.oldScrollTop;
  32723. }
  32724. this.scrollTop = y - offset;
  32725. this.oldScrollTop = this.scrollTop;
  32726. }
  32727. },
  32728. //scroll-view滚动中
  32729. _scroll: function _scroll(e) {
  32730. this.$emit('scroll', e);
  32731. this.oldScrollTop = e.detail.scrollTop;
  32732. var scrollDiff = e.detail.scrollHeight - this.oldScrollTop;
  32733. !this.isIos && this._checkScrolledToBottom(scrollDiff);
  32734. },
  32735. //scrollTop改变时触发
  32736. _scrollTopChange: function _scrollTopChange(newVal, oldVal, isPageScrollTop) {
  32737. this.$emit('scrollTopChange', newVal);
  32738. this.$emit('update:scrollTop', newVal);
  32739. this._checkShouldShowBackToTop(newVal, oldVal);
  32740. var scrollTop = this.isIos ? newVal > 5 ? 6 : 0 : newVal;
  32741. if (isPageScrollTop) {
  32742. this.wxsPageScrollTop = scrollTop;
  32743. } else {
  32744. this.wxsScrollTop = scrollTop;
  32745. }
  32746. },
  32747. //更新使用页面滚动时slot="top"或"bottom"插入view的高度
  32748. _updatePageScrollTopOrBottomHeight: function _updatePageScrollTopOrBottomHeight(type) {var _this11 = this;
  32749. if (!this.usePageScroll) return;
  32750. this._doCheckScrollViewShouldFullHeight(this.realTotalData);
  32751. var node = ".zp-page-scroll-".concat(type);
  32752. var marginText = "margin".concat(type.slice(0, 1).toUpperCase() + type.slice(1));
  32753. var safeAreaInsetBottomAdd = this.safeAreaInsetBottom;
  32754. this.$nextTick(function () {
  32755. var delayTime = 0;
  32756. setTimeout(function () {
  32757. _this11._getNodeClientRect(node).then(function (res) {
  32758. if (res) {
  32759. var pageScrollNodeHeight = res[0].height;
  32760. if (type === 'bottom') {
  32761. if (safeAreaInsetBottomAdd) {
  32762. pageScrollNodeHeight += _this11.safeAreaBottom;
  32763. }
  32764. } else {
  32765. _this11.cacheTopHeight = pageScrollNodeHeight;
  32766. }
  32767. _this11.$set(_this11.scrollViewStyle, marginText, "".concat(
  32768. pageScrollNodeHeight, "px"));
  32769. } else if (safeAreaInsetBottomAdd) {
  32770. _this11.$set(_this11.scrollViewStyle, marginText, "".concat(_this11.safeAreaBottom, "px"));
  32771. }
  32772. });
  32773. }, delayTime);
  32774. });
  32775. } } };var _default =
  32776. ZPScroller;exports.default = _default;
  32777. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  32778. /***/ }),
  32779. /* 287 */
  32780. /*!*****************************************************************************************************!*\
  32781. !*** D:/code/work/broke_news_wx/uni_modules/z-paging/components/z-paging/js/modules/back-to-top.js ***!
  32782. \*****************************************************************************************************/
  32783. /*! no static exports found */
  32784. /***/ (function(module, exports, __webpack_require__) {
  32785. "use strict";
  32786. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  32787. var _zPagingUtils = _interopRequireDefault(__webpack_require__(/*! .././z-paging-utils */ 273));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} // [z-paging]点击返回顶部view模块
  32788. var ZPBackToTop = {
  32789. props: {
  32790. //自动显示点击返回顶部按钮,默认为否
  32791. autoShowBackToTop: {
  32792. type: Boolean,
  32793. default: _zPagingUtils.default.gc('autoShowBackToTop', false) },
  32794. //点击返回顶部按钮显示/隐藏的阈值(滚动距离),单位为px,默认为400rpx
  32795. backToTopThreshold: {
  32796. type: [Number, String],
  32797. default: _zPagingUtils.default.gc('backToTopThreshold', '400rpx') },
  32798. //点击返回顶部按钮的自定义图片地址,默认使用z-paging内置的图片
  32799. backToTopImg: {
  32800. type: String,
  32801. default: _zPagingUtils.default.gc('backToTopImg', '') },
  32802. //点击返回顶部按钮返回到顶部时是否展示过渡动画,默认为是
  32803. backToTopWithAnimate: {
  32804. type: Boolean,
  32805. default: _zPagingUtils.default.gc('backToTopWithAnimate', true) },
  32806. //点击返回顶部按钮与底部的距离,注意添加单位px或rpx,默认为160rpx
  32807. backToTopBottom: {
  32808. type: [Number, String],
  32809. default: _zPagingUtils.default.gc('backToTopBottom', '160rpx') },
  32810. //点击返回顶部按钮的自定义样式
  32811. backToTopStyle: {
  32812. type: Object,
  32813. default: function _default() {
  32814. return _zPagingUtils.default.gc('backToTopStyle', {});
  32815. } },
  32816. //iOS点击顶部状态栏、安卓双击标题栏时,滚动条返回顶部,只支持竖向,默认为是
  32817. enableBackToTop: {
  32818. type: Boolean,
  32819. default: _zPagingUtils.default.gc('enableBackToTop', true) } },
  32820. data: function data() {
  32821. return {
  32822. backToTopClass: 'zp-back-to-top zp-back-to-top-hide',
  32823. lastBackToTopShowTime: 0,
  32824. showBackToTopClass: false };
  32825. },
  32826. computed: {
  32827. finalEnableBackToTop: function finalEnableBackToTop() {
  32828. return this.usePageScroll ? false : this.enableBackToTop;
  32829. },
  32830. finalBackToTopThreshold: function finalBackToTopThreshold() {
  32831. return _zPagingUtils.default.convertTextToPx(this.backToTopThreshold);
  32832. },
  32833. finalBackToTopStyle: function finalBackToTopStyle() {
  32834. var tempBackToTopStyle = this.backToTopStyle;
  32835. if (!tempBackToTopStyle.bottom) {
  32836. tempBackToTopStyle.bottom = this.windowBottom + _zPagingUtils.default.convertTextToPx(this.backToTopBottom) + 'px';
  32837. }
  32838. if (!tempBackToTopStyle.position) {
  32839. tempBackToTopStyle.position = this.usePageScroll ? 'fixed' : 'absolute';
  32840. }
  32841. return tempBackToTopStyle;
  32842. } },
  32843. methods: {
  32844. //点击返回顶部
  32845. _backToTopClick: function _backToTopClick() {
  32846. !this.backToTopWithAnimate && this._checkShouldShowBackToTop(1, 0);
  32847. this.scrollToTop(this.backToTopWithAnimate);
  32848. },
  32849. //判断是否要显示返回顶部按钮
  32850. _checkShouldShowBackToTop: function _checkShouldShowBackToTop(newVal, oldVal) {var _this = this;
  32851. if (!this.autoShowBackToTop) {
  32852. this.showBackToTopClass = false;
  32853. return;
  32854. }
  32855. if (newVal !== oldVal) {
  32856. if (newVal > this.finalBackToTopThreshold) {
  32857. if (!this.showBackToTopClass) {
  32858. this.showBackToTopClass = true;
  32859. this.lastBackToTopShowTime = new Date().getTime();
  32860. setTimeout(function () {
  32861. _this.backToTopClass = 'zp-back-to-top zp-back-to-top-show';
  32862. }, 300);
  32863. }
  32864. } else {
  32865. if (this.showBackToTopClass) {
  32866. var currentTime = new Date().getTime();
  32867. var dalayTime = 300;
  32868. if (currentTime - this.lastBackToTopShowTime < 500) {
  32869. dalayTime = 0;
  32870. }
  32871. this.backToTopClass = 'zp-back-to-top zp-back-to-top-hide';
  32872. setTimeout(function () {
  32873. _this.showBackToTopClass = false;
  32874. }, dalayTime);
  32875. }
  32876. }
  32877. }
  32878. } } };var _default2 =
  32879. ZPBackToTop;exports.default = _default2;
  32880. /***/ }),
  32881. /* 288 */,
  32882. /* 289 */,
  32883. /* 290 */,
  32884. /* 291 */,
  32885. /* 292 */,
  32886. /* 293 */,
  32887. /* 294 */,
  32888. /* 295 */,
  32889. /* 296 */,
  32890. /* 297 */,
  32891. /* 298 */,
  32892. /* 299 */,
  32893. /* 300 */,
  32894. /* 301 */,
  32895. /* 302 */,
  32896. /* 303 */,
  32897. /* 304 */,
  32898. /* 305 */,
  32899. /* 306 */,
  32900. /* 307 */,
  32901. /* 308 */,
  32902. /* 309 */,
  32903. /* 310 */,
  32904. /* 311 */,
  32905. /* 312 */,
  32906. /* 313 */,
  32907. /* 314 */,
  32908. /* 315 */,
  32909. /* 316 */,
  32910. /* 317 */,
  32911. /* 318 */
  32912. /*!*****************************************************************************************!*\
  32913. !*** D:/code/work/broke_news_wx/uni_modules/uni-forms/components/uni-forms/validate.js ***!
  32914. \*****************************************************************************************/
  32915. /*! no static exports found */
  32916. /***/ (function(module, exports, __webpack_require__) {
  32917. "use strict";
  32918. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 22));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}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 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;}var pattern = {
  32919. email: /^\S+?@\S+?\.\S+?$/,
  32920. idcard: /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
  32921. url: new RegExp(
  32922. "^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$",
  32923. 'i') };
  32924. var FORMAT_MAPPING = {
  32925. "int": 'integer',
  32926. "bool": 'boolean',
  32927. "double": 'number',
  32928. "long": 'number',
  32929. "password": 'string'
  32930. // "fileurls": 'array'
  32931. };
  32932. function formatMessage(args) {var resources = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  32933. var defaultMessage = ['label'];
  32934. defaultMessage.forEach(function (item) {
  32935. if (args[item] === undefined) {
  32936. args[item] = '';
  32937. }
  32938. });
  32939. var str = resources;
  32940. for (var key in args) {
  32941. var reg = new RegExp('{' + key + '}');
  32942. str = str.replace(reg, args[key]);
  32943. }
  32944. return str;
  32945. }
  32946. function isEmptyValue(value, type) {
  32947. if (value === undefined || value === null) {
  32948. return true;
  32949. }
  32950. if (typeof value === 'string' && !value) {
  32951. return true;
  32952. }
  32953. if (Array.isArray(value) && !value.length) {
  32954. return true;
  32955. }
  32956. if (type === 'object' && !Object.keys(value).length) {
  32957. return true;
  32958. }
  32959. return false;
  32960. }
  32961. var types = {
  32962. integer: function integer(value) {
  32963. return types.number(value) && parseInt(value, 10) === value;
  32964. },
  32965. string: function string(value) {
  32966. return typeof value === 'string';
  32967. },
  32968. number: function number(value) {
  32969. if (isNaN(value)) {
  32970. return false;
  32971. }
  32972. return typeof value === 'number';
  32973. },
  32974. "boolean": function boolean(value) {
  32975. return typeof value === 'boolean';
  32976. },
  32977. "float": function float(value) {
  32978. return types.number(value) && !types.integer(value);
  32979. },
  32980. array: function array(value) {
  32981. return Array.isArray(value);
  32982. },
  32983. object: function object(value) {
  32984. return typeof value === 'object' && !types.array(value);
  32985. },
  32986. date: function date(value) {
  32987. return value instanceof Date;
  32988. },
  32989. timestamp: function timestamp(value) {
  32990. if (!this.integer(value) || Math.abs(value).toString().length > 16) {
  32991. return false;
  32992. }
  32993. return true;
  32994. },
  32995. file: function file(value) {
  32996. return typeof value.url === 'string';
  32997. },
  32998. email: function email(value) {
  32999. return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
  33000. },
  33001. url: function url(value) {
  33002. return typeof value === 'string' && !!value.match(pattern.url);
  33003. },
  33004. pattern: function pattern(reg, value) {
  33005. try {
  33006. return new RegExp(reg).test(value);
  33007. } catch (e) {
  33008. return false;
  33009. }
  33010. },
  33011. method: function method(value) {
  33012. return typeof value === 'function';
  33013. },
  33014. idcard: function idcard(value) {
  33015. return typeof value === 'string' && !!value.match(pattern.idcard);
  33016. },
  33017. 'url-https': function urlHttps(value) {
  33018. return this.url(value) && value.startsWith('https://');
  33019. },
  33020. 'url-scheme': function urlScheme(value) {
  33021. return value.startsWith('://');
  33022. },
  33023. 'url-web': function urlWeb(value) {
  33024. return false;
  33025. } };var
  33026. RuleValidator = /*#__PURE__*/function () {
  33027. function RuleValidator(message) {_classCallCheck(this, RuleValidator);
  33028. this._message = message;
  33029. }_createClass(RuleValidator, [{ key: "validateRule", value: function () {var _validateRule = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee(
  33030. fieldKey, fieldValue, value, data, allData) {var result, rules, hasRequired, message, i, rule, vt, now, resultExpr;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:
  33031. result = null;
  33032. rules = fieldValue.rules;
  33033. hasRequired = rules.findIndex(function (item) {
  33034. return item.required;
  33035. });if (!(
  33036. hasRequired < 0)) {_context.next = 8;break;}if (!(
  33037. value === null || value === undefined)) {_context.next = 6;break;}return _context.abrupt("return",
  33038. result);case 6:if (!(
  33039. typeof value === 'string' && !value.length)) {_context.next = 8;break;}return _context.abrupt("return",
  33040. result);case 8:
  33041. message = this._message;if (!(
  33042. rules === undefined)) {_context.next = 11;break;}return _context.abrupt("return",
  33043. message['default']);case 11:
  33044. i = 0;case 12:if (!(i < rules.length)) {_context.next = 35;break;}
  33045. rule = rules[i];
  33046. vt = this._getValidateType(rule);
  33047. Object.assign(rule, {
  33048. label: fieldValue.label || "[\"".concat(fieldKey, "\"]") });if (!
  33049. RuleValidatorHelper[vt]) {_context.next = 20;break;}
  33050. result = RuleValidatorHelper[vt](rule, value, message);if (!(
  33051. result != null)) {_context.next = 20;break;}return _context.abrupt("break", 35);case 20:if (!
  33052. rule.validateExpr) {_context.next = 26;break;}
  33053. now = Date.now();
  33054. resultExpr = rule.validateExpr(value, allData, now);if (!(
  33055. resultExpr === false)) {_context.next = 26;break;}
  33056. result = this._getMessage(rule, rule.errorMessage || this._message['default']);return _context.abrupt("break", 35);case 26:if (!
  33057. rule.validateFunction) {_context.next = 32;break;}_context.next = 29;return (
  33058. this.validateFunction(rule, value, data, allData, vt));case 29:result = _context.sent;if (!(
  33059. result !== null)) {_context.next = 32;break;}return _context.abrupt("break", 35);case 32:i++;_context.next = 12;break;case 35:
  33060. if (result !== null) {
  33061. result = message.TAG + result;
  33062. }return _context.abrupt("return",
  33063. result);case 37:case "end":return _context.stop();}}}, _callee, this);}));function validateRule(_x, _x2, _x3, _x4, _x5) {return _validateRule.apply(this, arguments);}return validateRule;}() }, { key: "validateFunction", value: function () {var _validateFunction = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee2(
  33064. rule, value, data, allData, vt) {var result, callbackMessage, res;return _regenerator.default.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:
  33065. result = null;_context2.prev = 1;
  33066. callbackMessage = null;_context2.next = 5;return (
  33067. rule.validateFunction(rule, value, allData || data, function (message) {
  33068. callbackMessage = message;
  33069. }));case 5:res = _context2.sent;
  33070. if (callbackMessage || typeof res === 'string' && res || res === false) {
  33071. result = this._getMessage(rule, callbackMessage || res, vt);
  33072. }_context2.next = 12;break;case 9:_context2.prev = 9;_context2.t0 = _context2["catch"](1);
  33073. result = this._getMessage(rule, _context2.t0.message, vt);case 12:return _context2.abrupt("return",
  33074. result);case 13:case "end":return _context2.stop();}}}, _callee2, this, [[1, 9]]);}));function validateFunction(_x6, _x7, _x8, _x9, _x10) {return _validateFunction.apply(this, arguments);}return validateFunction;}() }, { key: "_getMessage", value: function _getMessage(
  33075. rule, message, vt) {
  33076. return formatMessage(rule, message || rule.errorMessage || this._message[vt] || message['default']);
  33077. } }, { key: "_getValidateType", value: function _getValidateType(
  33078. rule) {
  33079. var result = '';
  33080. if (rule.required) {
  33081. result = 'required';
  33082. } else if (rule.format) {
  33083. result = 'format';
  33084. } else if (rule.arrayType) {
  33085. result = 'arrayTypeFormat';
  33086. } else if (rule.range) {
  33087. result = 'range';
  33088. } else if (rule.maximum !== undefined || rule.minimum !== undefined) {
  33089. result = 'rangeNumber';
  33090. } else if (rule.maxLength !== undefined || rule.minLength !== undefined) {
  33091. result = 'rangeLength';
  33092. } else if (rule.pattern) {
  33093. result = 'pattern';
  33094. } else if (rule.validateFunction) {
  33095. result = 'validateFunction';
  33096. }
  33097. return result;
  33098. } }]);return RuleValidator;}();
  33099. var RuleValidatorHelper = {
  33100. required: function required(rule, value, message) {
  33101. if (rule.required && isEmptyValue(value, rule.format || typeof value)) {
  33102. return formatMessage(rule, rule.errorMessage || message.required);
  33103. }
  33104. return null;
  33105. },
  33106. range: function range(rule, value, message) {var
  33107. range =
  33108. rule.range,errorMessage = rule.errorMessage;
  33109. var list = new Array(range.length);
  33110. for (var i = 0; i < range.length; i++) {
  33111. var item = range[i];
  33112. if (types.object(item) && item.value !== undefined) {
  33113. list[i] = item.value;
  33114. } else {
  33115. list[i] = item;
  33116. }
  33117. }
  33118. var result = false;
  33119. if (Array.isArray(value)) {
  33120. result = new Set(value.concat(list)).size === list.length;
  33121. } else {
  33122. if (list.indexOf(value) > -1) {
  33123. result = true;
  33124. }
  33125. }
  33126. if (!result) {
  33127. return formatMessage(rule, errorMessage || message['enum']);
  33128. }
  33129. return null;
  33130. },
  33131. rangeNumber: function rangeNumber(rule, value, message) {
  33132. if (!types.number(value)) {
  33133. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  33134. }var
  33135. minimum =
  33136. rule.minimum,maximum = rule.maximum,exclusiveMinimum = rule.exclusiveMinimum,exclusiveMaximum = rule.exclusiveMaximum;
  33137. var min = exclusiveMinimum ? value <= minimum : value < minimum;
  33138. var max = exclusiveMaximum ? value >= maximum : value > maximum;
  33139. if (minimum !== undefined && min) {
  33140. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMinimum ?
  33141. 'exclusiveMinimum' : 'minimum']);
  33142. } else if (maximum !== undefined && max) {
  33143. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMaximum ?
  33144. 'exclusiveMaximum' : 'maximum']);
  33145. } else if (minimum !== undefined && maximum !== undefined && (min || max)) {
  33146. return formatMessage(rule, rule.errorMessage || message['number'].range);
  33147. }
  33148. return null;
  33149. },
  33150. rangeLength: function rangeLength(rule, value, message) {
  33151. if (!types.string(value) && !types.array(value)) {
  33152. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  33153. }
  33154. var min = rule.minLength;
  33155. var max = rule.maxLength;
  33156. var val = value.length;
  33157. if (min !== undefined && val < min) {
  33158. return formatMessage(rule, rule.errorMessage || message['length'].minLength);
  33159. } else if (max !== undefined && val > max) {
  33160. return formatMessage(rule, rule.errorMessage || message['length'].maxLength);
  33161. } else if (min !== undefined && max !== undefined && (val < min || val > max)) {
  33162. return formatMessage(rule, rule.errorMessage || message['length'].range);
  33163. }
  33164. return null;
  33165. },
  33166. pattern: function pattern(rule, value, message) {
  33167. if (!types['pattern'](rule.pattern, value)) {
  33168. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  33169. }
  33170. return null;
  33171. },
  33172. format: function format(rule, value, message) {
  33173. var customTypes = Object.keys(types);
  33174. var format = FORMAT_MAPPING[rule.format] ? FORMAT_MAPPING[rule.format] : rule.format || rule.arrayType;
  33175. if (customTypes.indexOf(format) > -1) {
  33176. if (!types[format](value)) {
  33177. return formatMessage(rule, rule.errorMessage || message.typeError);
  33178. }
  33179. }
  33180. return null;
  33181. },
  33182. arrayTypeFormat: function arrayTypeFormat(rule, value, message) {
  33183. if (!Array.isArray(value)) {
  33184. return formatMessage(rule, rule.errorMessage || message.typeError);
  33185. }
  33186. for (var i = 0; i < value.length; i++) {
  33187. var element = value[i];
  33188. var formatResult = this.format(rule, element, message);
  33189. if (formatResult !== null) {
  33190. return formatResult;
  33191. }
  33192. }
  33193. return null;
  33194. } };var
  33195. SchemaValidator = /*#__PURE__*/function (_RuleValidator) {_inherits(SchemaValidator, _RuleValidator);var _super = _createSuper(SchemaValidator);
  33196. function SchemaValidator(schema, options) {var _this;_classCallCheck(this, SchemaValidator);
  33197. _this = _super.call(this, SchemaValidator.message);
  33198. _this._schema = schema;
  33199. _this._options = options || null;return _this;
  33200. }_createClass(SchemaValidator, [{ key: "updateSchema", value: function updateSchema(
  33201. schema) {
  33202. this._schema = schema;
  33203. } }, { key: "validate", value: function () {var _validate = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee3(
  33204. data, allData) {var result;return _regenerator.default.wrap(function _callee3$(_context3) {while (1) {switch (_context3.prev = _context3.next) {case 0:
  33205. result = this._checkFieldInSchema(data);if (
  33206. result) {_context3.next = 5;break;}_context3.next = 4;return (
  33207. this.invokeValidate(data, false, allData));case 4:result = _context3.sent;case 5:return _context3.abrupt("return",
  33208. result.length ? result[0] : null);case 6:case "end":return _context3.stop();}}}, _callee3, this);}));function validate(_x11, _x12) {return _validate.apply(this, arguments);}return validate;}() }, { key: "validateAll", value: function () {var _validateAll = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee4(
  33209. data, allData) {var result;return _regenerator.default.wrap(function _callee4$(_context4) {while (1) {switch (_context4.prev = _context4.next) {case 0:
  33210. result = this._checkFieldInSchema(data);if (
  33211. result) {_context4.next = 5;break;}_context4.next = 4;return (
  33212. this.invokeValidate(data, true, allData));case 4:result = _context4.sent;case 5:return _context4.abrupt("return",
  33213. result);case 6:case "end":return _context4.stop();}}}, _callee4, this);}));function validateAll(_x13, _x14) {return _validateAll.apply(this, arguments);}return validateAll;}() }, { key: "validateUpdate", value: function () {var _validateUpdate = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee5(
  33214. data, allData) {var result;return _regenerator.default.wrap(function _callee5$(_context5) {while (1) {switch (_context5.prev = _context5.next) {case 0:
  33215. result = this._checkFieldInSchema(data);if (
  33216. result) {_context5.next = 5;break;}_context5.next = 4;return (
  33217. this.invokeValidateUpdate(data, false, allData));case 4:result = _context5.sent;case 5:return _context5.abrupt("return",
  33218. result.length ? result[0] : null);case 6:case "end":return _context5.stop();}}}, _callee5, this);}));function validateUpdate(_x15, _x16) {return _validateUpdate.apply(this, arguments);}return validateUpdate;}() }, { key: "invokeValidate", value: function () {var _invokeValidate = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee6(
  33219. data, all, allData) {var result, schema, key, value, errorMessage;return _regenerator.default.wrap(function _callee6$(_context6) {while (1) {switch (_context6.prev = _context6.next) {case 0:
  33220. result = [];
  33221. schema = this._schema;_context6.t0 = _regenerator.default.keys(
  33222. schema);case 3:if ((_context6.t1 = _context6.t0()).done) {_context6.next = 15;break;}key = _context6.t1.value;
  33223. value = schema[key];_context6.next = 8;return (
  33224. this.validateRule(key, value, data[key], data, allData));case 8:errorMessage = _context6.sent;if (!(
  33225. errorMessage != null)) {_context6.next = 13;break;}
  33226. result.push({
  33227. key: key,
  33228. errorMessage: errorMessage });if (
  33229. all) {_context6.next = 13;break;}return _context6.abrupt("break", 15);case 13:_context6.next = 3;break;case 15:return _context6.abrupt("return",
  33230. result);case 16:case "end":return _context6.stop();}}}, _callee6, this);}));function invokeValidate(_x17, _x18, _x19) {return _invokeValidate.apply(this, arguments);}return invokeValidate;}() }, { key: "invokeValidateUpdate", value: function () {var _invokeValidateUpdate = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee7(
  33231. data, all, allData) {var result, key, errorMessage;return _regenerator.default.wrap(function _callee7$(_context7) {while (1) {switch (_context7.prev = _context7.next) {case 0:
  33232. result = [];_context7.t0 = _regenerator.default.keys(
  33233. data);case 2:if ((_context7.t1 = _context7.t0()).done) {_context7.next = 13;break;}key = _context7.t1.value;_context7.next = 6;return (
  33234. this.validateRule(key, this._schema[key], data[key], data, allData));case 6:errorMessage = _context7.sent;if (!(
  33235. errorMessage != null)) {_context7.next = 11;break;}
  33236. result.push({
  33237. key: key,
  33238. errorMessage: errorMessage });if (
  33239. all) {_context7.next = 11;break;}return _context7.abrupt("break", 13);case 11:_context7.next = 2;break;case 13:return _context7.abrupt("return",
  33240. result);case 14:case "end":return _context7.stop();}}}, _callee7, this);}));function invokeValidateUpdate(_x20, _x21, _x22) {return _invokeValidateUpdate.apply(this, arguments);}return invokeValidateUpdate;}() }, { key: "_checkFieldInSchema", value: function _checkFieldInSchema(
  33241. data) {
  33242. var keys = Object.keys(data);
  33243. var keys2 = Object.keys(this._schema);
  33244. if (new Set(keys.concat(keys2)).size === keys2.length) {
  33245. return '';
  33246. }
  33247. var noExistFields = keys.filter(function (key) {
  33248. return keys2.indexOf(key) < 0;
  33249. });
  33250. var errorMessage = formatMessage({
  33251. field: JSON.stringify(noExistFields) },
  33252. SchemaValidator.message.TAG + SchemaValidator.message['defaultInvalid']);
  33253. return [{
  33254. key: 'invalid',
  33255. errorMessage: errorMessage }];
  33256. } }]);return SchemaValidator;}(RuleValidator);
  33257. function Message() {
  33258. return {
  33259. TAG: "",
  33260. default: '验证错误',
  33261. defaultInvalid: '提交的字段{field}在数据库中并不存在',
  33262. validateFunction: '验证无效',
  33263. required: '{label}必填',
  33264. 'enum': '{label}超出范围',
  33265. timestamp: '{label}格式无效',
  33266. whitespace: '{label}不能为空',
  33267. typeError: '{label}类型无效',
  33268. date: {
  33269. format: '{label}日期{value}格式无效',
  33270. parse: '{label}日期无法解析,{value}无效',
  33271. invalid: '{label}日期{value}无效' },
  33272. length: {
  33273. minLength: '{label}长度不能少于{minLength}',
  33274. maxLength: '{label}长度不能超过{maxLength}',
  33275. range: '{label}必须介于{minLength}和{maxLength}之间' },
  33276. number: {
  33277. minimum: '{label}不能小于{minimum}',
  33278. maximum: '{label}不能大于{maximum}',
  33279. exclusiveMinimum: '{label}不能小于等于{minimum}',
  33280. exclusiveMaximum: '{label}不能大于等于{maximum}',
  33281. range: '{label}必须介于{minimum}and{maximum}之间' },
  33282. pattern: {
  33283. mismatch: '{label}格式不匹配' } };
  33284. }
  33285. SchemaValidator.message = new Message();var _default =
  33286. SchemaValidator;exports.default = _default;
  33287. /***/ }),
  33288. /* 319 */,
  33289. /* 320 */,
  33290. /* 321 */,
  33291. /* 322 */,
  33292. /* 323 */,
  33293. /* 324 */,
  33294. /* 325 */,
  33295. /* 326 */,
  33296. /* 327 */,
  33297. /* 328 */,
  33298. /* 329 */,
  33299. /* 330 */,
  33300. /* 331 */,
  33301. /* 332 */,
  33302. /* 333 */,
  33303. /* 334 */,
  33304. /* 335 */,
  33305. /* 336 */,
  33306. /* 337 */,
  33307. /* 338 */,
  33308. /* 339 */,
  33309. /* 340 */
  33310. /*!***************************************************!*\
  33311. !*** D:/code/work/broke_news_wx/utils/bmap-wx.js ***!
  33312. \***************************************************/
  33313. /*! no static exports found */
  33314. /***/ (function(module, exports) {
  33315. 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;} /**
  33316. * @file 微信小程序JSAPI
  33317. * @author 崔健 cuijian03@baidu.com 2017.01.10
  33318. * @update 邓淑芳 623996689@qq.com 2019.07.03
  33319. */
  33320. /**
  33321. * 百度地图微信小程序API类
  33322. *
  33323. * @class
  33324. */var
  33325. BMapWX = /*#__PURE__*/function () {"use strict";
  33326. /**
  33327. * 百度地图微信小程序API类
  33328. *
  33329. * @constructor
  33330. */
  33331. function BMapWX(param) {_classCallCheck(this, BMapWX);
  33332. this.ak = param["ak"];
  33333. }
  33334. /**
  33335. * 使用微信接口进行定位
  33336. *
  33337. * @param {string} type 坐标类型
  33338. * @param {Function} success 成功执行
  33339. * @param {Function} fail 失败执行
  33340. * @param {Function} complete 完成后执行
  33341. */_createClass(BMapWX, [{ key: "getWXLocation", value: function getWXLocation(
  33342. type, success, fail, complete) {
  33343. type = type || 'gcj02',
  33344. success = success || function () {};
  33345. fail = fail || function () {};
  33346. complete = complete || function () {};
  33347. wx.getLocation({
  33348. type: type,
  33349. success: success,
  33350. fail: fail,
  33351. complete: complete });
  33352. }
  33353. /**
  33354. * POI周边检索
  33355. *
  33356. * @param {Object} param 检索配置
  33357. * 参数对象结构可以参考
  33358. * http://lbsyun.baidu.com/index.php?title=webapi/guide/webservice-placeapi
  33359. */ }, { key: "search", value: function search(
  33360. param) {
  33361. var that = this;
  33362. param = param || {};
  33363. var searchparam = {
  33364. query: param["query"] || '生活服务$美食&酒店',
  33365. scope: param["scope"] || 1,
  33366. filter: param["filter"] || '',
  33367. coord_type: param["coord_type"] || 2,
  33368. page_size: param["page_size"] || 10,
  33369. page_num: param["page_num"] || 0,
  33370. output: param["output"] || 'json',
  33371. ak: that.ak,
  33372. sn: param["sn"] || '',
  33373. timestamp: param["timestamp"] || '',
  33374. radius: param["radius"] || 2000,
  33375. ret_coordtype: 'gcj02ll' };
  33376. var otherparam = {
  33377. iconPath: param["iconPath"],
  33378. iconTapPath: param["iconTapPath"],
  33379. width: param["width"],
  33380. height: param["height"],
  33381. alpha: param["alpha"] || 1,
  33382. success: param["success"] || function () {},
  33383. fail: param["fail"] || function () {} };
  33384. var type = 'gcj02';
  33385. var locationsuccess = function locationsuccess(result) {
  33386. searchparam["location"] = result["latitude"] + ',' + result["longitude"];
  33387. wx.request({
  33388. url: 'https://api.map.baidu.com/place/v2/search',
  33389. data: searchparam,
  33390. header: {
  33391. "content-type": "application/json" },
  33392. method: 'GET',
  33393. success: function success(data) {
  33394. var res = data["data"];
  33395. if (res["status"] === 0) {
  33396. var poiArr = res["results"];
  33397. // outputRes 包含两个对象,
  33398. // originalData为百度接口返回的原始数据
  33399. // wxMarkerData为小程序规范的marker格式
  33400. var outputRes = {};
  33401. outputRes["originalData"] = res;
  33402. outputRes["wxMarkerData"] = [];
  33403. for (var i = 0; i < poiArr.length; i++) {
  33404. outputRes["wxMarkerData"][i] = {
  33405. id: i,
  33406. latitude: poiArr[i]["location"]["lat"],
  33407. longitude: poiArr[i]["location"]["lng"],
  33408. title: poiArr[i]["name"],
  33409. iconPath: otherparam["iconPath"],
  33410. iconTapPath: otherparam["iconTapPath"],
  33411. address: poiArr[i]["address"],
  33412. telephone: poiArr[i]["telephone"],
  33413. alpha: otherparam["alpha"],
  33414. width: otherparam["width"],
  33415. height: otherparam["height"] };
  33416. }
  33417. otherparam.success(outputRes);
  33418. } else {
  33419. otherparam.fail({
  33420. errMsg: res["message"],
  33421. statusCode: res["status"] });
  33422. }
  33423. },
  33424. fail: function fail(data) {
  33425. otherparam.fail(data);
  33426. } });
  33427. };
  33428. var locationfail = function locationfail(result) {
  33429. otherparam.fail(result);
  33430. };
  33431. var locationcomplete = function locationcomplete(result) {
  33432. };
  33433. if (!param["location"]) {
  33434. that.getWXLocation(type, locationsuccess, locationfail, locationcomplete);
  33435. } else {
  33436. var longitude = param.location.split(',')[1];
  33437. var latitude = param.location.split(',')[0];
  33438. var errMsg = 'input location';
  33439. var res = {
  33440. errMsg: errMsg,
  33441. latitude: latitude,
  33442. longitude: longitude };
  33443. locationsuccess(res);
  33444. }
  33445. }
  33446. /**
  33447. * sug模糊检索
  33448. *
  33449. * @param {Object} param 检索配置
  33450. * 参数对象结构可以参考
  33451. * http://lbsyun.baidu.com/index.php?title=webapi/place-suggestion-api
  33452. */ }, { key: "suggestion", value: function suggestion(
  33453. param) {
  33454. var that = this;
  33455. param = param || {};
  33456. var suggestionparam = {
  33457. query: param["query"] || '',
  33458. region: param["region"] || '全国',
  33459. city_limit: param["city_limit"] || false,
  33460. output: param["output"] || 'json',
  33461. ak: that.ak,
  33462. sn: param["sn"] || '',
  33463. timestamp: param["timestamp"] || '',
  33464. ret_coordtype: 'gcj02ll' };
  33465. var otherparam = {
  33466. success: param["success"] || function () {},
  33467. fail: param["fail"] || function () {} };
  33468. wx.request({
  33469. url: 'https://api.map.baidu.com/place/v2/suggestion',
  33470. data: suggestionparam,
  33471. header: {
  33472. "content-type": "application/json" },
  33473. method: 'GET',
  33474. success: function success(data) {
  33475. var res = data["data"];
  33476. if (res["status"] === 0) {
  33477. otherparam.success(res);
  33478. } else {
  33479. otherparam.fail({
  33480. errMsg: res["message"],
  33481. statusCode: res["status"] });
  33482. }
  33483. },
  33484. fail: function fail(data) {
  33485. otherparam.fail(data);
  33486. } });
  33487. }
  33488. /**
  33489. * rgc检索(逆地理编码:经纬度->地点描述)
  33490. *
  33491. * @param {Object} param 检索配置
  33492. * 参数对象结构可以参考
  33493. * https://lbs.baidu.com/index.php?title=webapi/guide/webservice-geocoding-abroad
  33494. *
  33495. */ }, { key: "regeocoding", value: function regeocoding(
  33496. param) {
  33497. var that = this;
  33498. param = param || {};
  33499. var regeocodingparam = {
  33500. coordtype: param["coordtype"] || 'gcj02ll',
  33501. ret_coordtype: 'gcj02ll',
  33502. radius: param["radius"] || 1000,
  33503. ak: that.ak,
  33504. sn: param["sn"] || '',
  33505. output: param["output"] || 'json',
  33506. callback: param["callback"] || function () {},
  33507. extensions_poi: param["extensions_poi"] || 1,
  33508. extensions_road: param["extensions_road"] || false,
  33509. extensions_town: param["extensions_town"] || false,
  33510. language: param["language"] || 'zh-CN',
  33511. language_auto: param["language_auto"] || 0 };
  33512. var otherparam = {
  33513. iconPath: param["iconPath"],
  33514. iconTapPath: param["iconTapPath"],
  33515. width: param["width"],
  33516. height: param["height"],
  33517. alpha: param["alpha"] || 1,
  33518. success: param["success"] || function () {},
  33519. fail: param["fail"] || function () {} };
  33520. var type = 'gcj02';
  33521. var locationsuccess = function locationsuccess(result) {
  33522. regeocodingparam["location"] = result["latitude"] + ',' + result["longitude"];
  33523. wx.request({
  33524. url: 'https://api.map.baidu.com/reverse_geocoding/v3',
  33525. data: regeocodingparam,
  33526. header: {
  33527. "content-type": "application/json" },
  33528. method: 'GET',
  33529. success: function success(data) {
  33530. var res = data["data"];
  33531. if (res["status"] === 0) {
  33532. var poiObj = res["result"];
  33533. // outputRes 包含两个对象:
  33534. // originalData为百度接口返回的原始数据
  33535. // wxMarkerData为小程序规范的marker格式
  33536. var outputRes = {};
  33537. outputRes["originalData"] = res;
  33538. outputRes["wxMarkerData"] = [];
  33539. outputRes["wxMarkerData"][0] = {
  33540. id: 0,
  33541. latitude: result["latitude"],
  33542. longitude: result["longitude"],
  33543. address: poiObj["formatted_address"],
  33544. iconPath: otherparam["iconPath"],
  33545. iconTapPath: otherparam["iconTapPath"],
  33546. desc: poiObj["sematic_description"],
  33547. business: poiObj["business"],
  33548. alpha: otherparam["alpha"],
  33549. width: otherparam["width"],
  33550. height: otherparam["height"] };
  33551. otherparam.success(outputRes);
  33552. } else {
  33553. otherparam.fail({
  33554. errMsg: res["message"],
  33555. statusCode: res["status"] });
  33556. }
  33557. },
  33558. fail: function fail(data) {
  33559. otherparam.fail(data);
  33560. } });
  33561. };
  33562. var locationfail = function locationfail(result) {
  33563. otherparam.fail(result);
  33564. };
  33565. var locationcomplete = function locationcomplete(result) {
  33566. };
  33567. if (!param["location"]) {
  33568. that.getWXLocation(type, locationsuccess, locationfail, locationcomplete);
  33569. } else {
  33570. var longitude = param.location.split(',')[1];
  33571. var latitude = param.location.split(',')[0];
  33572. var errMsg = 'input location';
  33573. var res = {
  33574. errMsg: errMsg,
  33575. latitude: latitude,
  33576. longitude: longitude };
  33577. locationsuccess(res);
  33578. }
  33579. }
  33580. /**
  33581. * gc检索(地理编码:地点->经纬度)
  33582. *
  33583. * @param {Object} param 检索配置
  33584. * 参数对象结构可以参考
  33585. * https://lbs.baidu.com/index.php?title=webapi/guide/webservice-geocoding
  33586. *
  33587. */ }, { key: "geocoding", value: function geocoding(
  33588. param) {
  33589. var that = this;
  33590. param = param || {};
  33591. var geocodingparam = {
  33592. address: param["address"] || '',
  33593. city: param["city"] || '',
  33594. ret_coordtype: param["coordtype"] || 'gcj02ll',
  33595. ak: that.ak,
  33596. sn: param["sn"] || '',
  33597. output: param["output"] || 'json',
  33598. callback: param["callback"] || function () {} };
  33599. var otherparam = {
  33600. iconPath: param["iconPath"],
  33601. iconTapPath: param["iconTapPath"],
  33602. width: param["width"],
  33603. height: param["height"],
  33604. alpha: param["alpha"] || 1,
  33605. success: param["success"] || function () {},
  33606. fail: param["fail"] || function () {} };
  33607. if (param["address"]) {
  33608. wx.request({
  33609. url: 'https://api.map.baidu.com/geocoding/v3',
  33610. data: geocodingparam,
  33611. header: {
  33612. "content-type": "application/json" },
  33613. method: 'GET',
  33614. success: function success(data) {
  33615. var res = data["data"];
  33616. if (res["status"] === 0) {
  33617. var poiObj = res["result"];
  33618. // outputRes 包含两个对象:
  33619. // originalData为百度接口返回的原始数据
  33620. // wxMarkerData为小程序规范的marker格式
  33621. var outputRes = res;
  33622. outputRes["originalData"] = res;
  33623. outputRes["wxMarkerData"] = [];
  33624. outputRes["wxMarkerData"][0] = {
  33625. id: 0,
  33626. latitude: poiObj["location"]["lat"],
  33627. longitude: poiObj["location"]["lng"],
  33628. iconPath: otherparam["iconPath"],
  33629. iconTapPath: otherparam["iconTapPath"],
  33630. alpha: otherparam["alpha"],
  33631. width: otherparam["width"],
  33632. height: otherparam["height"] };
  33633. otherparam.success(outputRes);
  33634. } else {
  33635. otherparam.fail({
  33636. errMsg: res["message"],
  33637. statusCode: res["status"] });
  33638. }
  33639. },
  33640. fail: function fail(data) {
  33641. otherparam.fail(data);
  33642. } });
  33643. } else {
  33644. var errMsg = 'input address!';
  33645. var res = {
  33646. errMsg: errMsg };
  33647. otherparam.fail(res);
  33648. }
  33649. }
  33650. /**
  33651. * 天气检索
  33652. *
  33653. * @param {Object} param 检索配置
  33654. */ }, { key: "weather", value: function weather(
  33655. param) {
  33656. var that = this;
  33657. param = param || {};
  33658. var weatherparam = {
  33659. coord_type: param["coord_type"] || 'gcj02',
  33660. output: param["output"] || 'json',
  33661. ak: that.ak,
  33662. sn: param["sn"] || '',
  33663. timestamp: param["timestamp"] || '' };
  33664. var otherparam = {
  33665. success: param["success"] || function () {},
  33666. fail: param["fail"] || function () {} };
  33667. var type = 'gcj02';
  33668. var locationsuccess = function locationsuccess(result) {
  33669. weatherparam["location"] = result["longitude"] + ',' + result["latitude"];
  33670. wx.request({
  33671. url: 'https://api.map.baidu.com/telematics/v3/weather',
  33672. data: weatherparam,
  33673. header: {
  33674. "content-type": "application/json" },
  33675. method: 'GET',
  33676. success: function success(data) {
  33677. var res = data["data"];
  33678. if (res["error"] === 0 && res["status"] === 'success') {
  33679. var weatherArr = res["results"];
  33680. // outputRes 包含两个对象,
  33681. // originalData为百度接口返回的原始数据
  33682. // wxMarkerData为小程序规范的marker格式
  33683. var outputRes = {};
  33684. outputRes["originalData"] = res;
  33685. outputRes["currentWeather"] = [];
  33686. outputRes["currentWeather"][0] = {
  33687. currentCity: weatherArr[0]["currentCity"],
  33688. pm25: weatherArr[0]["pm25"],
  33689. date: weatherArr[0]["weather_data"][0]["date"],
  33690. temperature: weatherArr[0]["weather_data"][0]["temperature"],
  33691. weatherDesc: weatherArr[0]["weather_data"][0]["weather"],
  33692. wind: weatherArr[0]["weather_data"][0]["wind"] };
  33693. otherparam.success(outputRes);
  33694. } else {
  33695. otherparam.fail({
  33696. errMsg: res["message"],
  33697. statusCode: res["status"] });
  33698. }
  33699. },
  33700. fail: function fail(data) {
  33701. otherparam.fail(data);
  33702. } });
  33703. };
  33704. var locationfail = function locationfail(result) {
  33705. otherparam.fail(result);
  33706. };
  33707. var locationcomplete = function locationcomplete(result) {
  33708. };
  33709. if (!param["location"]) {
  33710. that.getWXLocation(type, locationsuccess, locationfail, locationcomplete);
  33711. } else {
  33712. var longitude = param.location.split(',')[0];
  33713. var latitude = param.location.split(',')[1];
  33714. var errMsg = 'input location';
  33715. var res = {
  33716. errMsg: errMsg,
  33717. latitude: latitude,
  33718. longitude: longitude };
  33719. locationsuccess(res);
  33720. }
  33721. } }]);return BMapWX;}();
  33722. module.exports.BMapWX = BMapWX;
  33723. /***/ }),
  33724. /* 341 */,
  33725. /* 342 */,
  33726. /* 343 */,
  33727. /* 344 */,
  33728. /* 345 */,
  33729. /* 346 */,
  33730. /* 347 */,
  33731. /* 348 */,
  33732. /* 349 */,
  33733. /* 350 */,
  33734. /* 351 */,
  33735. /* 352 */,
  33736. /* 353 */,
  33737. /* 354 */,
  33738. /* 355 */,
  33739. /* 356 */,
  33740. /* 357 */,
  33741. /* 358 */,
  33742. /* 359 */,
  33743. /* 360 */,
  33744. /* 361 */,
  33745. /* 362 */,
  33746. /* 363 */,
  33747. /* 364 */,
  33748. /* 365 */,
  33749. /* 366 */,
  33750. /* 367 */,
  33751. /* 368 */,
  33752. /* 369 */,
  33753. /* 370 */,
  33754. /* 371 */,
  33755. /* 372 */,
  33756. /* 373 */,
  33757. /* 374 */,
  33758. /* 375 */,
  33759. /* 376 */
  33760. /*!**************************************************************************************!*\
  33761. !*** D:/code/work/broke_news_wx/uni_modules/uni-icons/components/uni-icons/icons.js ***!
  33762. \**************************************************************************************/
  33763. /*! no static exports found */
  33764. /***/ (function(module, exports, __webpack_require__) {
  33765. "use strict";
  33766. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  33767. "id": "2852637",
  33768. "name": "uniui图标库",
  33769. "font_family": "uniicons",
  33770. "css_prefix_text": "uniui-",
  33771. "description": "",
  33772. "glyphs": [
  33773. {
  33774. "icon_id": "25027049",
  33775. "name": "yanse",
  33776. "font_class": "color",
  33777. "unicode": "e6cf",
  33778. "unicode_decimal": 59087 },
  33779. {
  33780. "icon_id": "25027048",
  33781. "name": "wallet",
  33782. "font_class": "wallet",
  33783. "unicode": "e6b1",
  33784. "unicode_decimal": 59057 },
  33785. {
  33786. "icon_id": "25015720",
  33787. "name": "settings-filled",
  33788. "font_class": "settings-filled",
  33789. "unicode": "e6ce",
  33790. "unicode_decimal": 59086 },
  33791. {
  33792. "icon_id": "25015434",
  33793. "name": "shimingrenzheng-filled",
  33794. "font_class": "auth-filled",
  33795. "unicode": "e6cc",
  33796. "unicode_decimal": 59084 },
  33797. {
  33798. "icon_id": "24934246",
  33799. "name": "shop-filled",
  33800. "font_class": "shop-filled",
  33801. "unicode": "e6cd",
  33802. "unicode_decimal": 59085 },
  33803. {
  33804. "icon_id": "24934159",
  33805. "name": "staff-filled-01",
  33806. "font_class": "staff-filled",
  33807. "unicode": "e6cb",
  33808. "unicode_decimal": 59083 },
  33809. {
  33810. "icon_id": "24932461",
  33811. "name": "VIP-filled",
  33812. "font_class": "vip-filled",
  33813. "unicode": "e6c6",
  33814. "unicode_decimal": 59078 },
  33815. {
  33816. "icon_id": "24932462",
  33817. "name": "plus_circle_fill",
  33818. "font_class": "plus-filled",
  33819. "unicode": "e6c7",
  33820. "unicode_decimal": 59079 },
  33821. {
  33822. "icon_id": "24932463",
  33823. "name": "folder_add-filled",
  33824. "font_class": "folder-add-filled",
  33825. "unicode": "e6c8",
  33826. "unicode_decimal": 59080 },
  33827. {
  33828. "icon_id": "24932464",
  33829. "name": "yanse-filled",
  33830. "font_class": "color-filled",
  33831. "unicode": "e6c9",
  33832. "unicode_decimal": 59081 },
  33833. {
  33834. "icon_id": "24932465",
  33835. "name": "tune-filled",
  33836. "font_class": "tune-filled",
  33837. "unicode": "e6ca",
  33838. "unicode_decimal": 59082 },
  33839. {
  33840. "icon_id": "24932455",
  33841. "name": "a-rilidaka-filled",
  33842. "font_class": "calendar-filled",
  33843. "unicode": "e6c0",
  33844. "unicode_decimal": 59072 },
  33845. {
  33846. "icon_id": "24932456",
  33847. "name": "notification-filled",
  33848. "font_class": "notification-filled",
  33849. "unicode": "e6c1",
  33850. "unicode_decimal": 59073 },
  33851. {
  33852. "icon_id": "24932457",
  33853. "name": "wallet-filled",
  33854. "font_class": "wallet-filled",
  33855. "unicode": "e6c2",
  33856. "unicode_decimal": 59074 },
  33857. {
  33858. "icon_id": "24932458",
  33859. "name": "paihangbang-filled",
  33860. "font_class": "medal-filled",
  33861. "unicode": "e6c3",
  33862. "unicode_decimal": 59075 },
  33863. {
  33864. "icon_id": "24932459",
  33865. "name": "gift-filled",
  33866. "font_class": "gift-filled",
  33867. "unicode": "e6c4",
  33868. "unicode_decimal": 59076 },
  33869. {
  33870. "icon_id": "24932460",
  33871. "name": "fire-filled",
  33872. "font_class": "fire-filled",
  33873. "unicode": "e6c5",
  33874. "unicode_decimal": 59077 },
  33875. {
  33876. "icon_id": "24928001",
  33877. "name": "refreshempty",
  33878. "font_class": "refreshempty",
  33879. "unicode": "e6bf",
  33880. "unicode_decimal": 59071 },
  33881. {
  33882. "icon_id": "24926853",
  33883. "name": "location-ellipse",
  33884. "font_class": "location-filled",
  33885. "unicode": "e6af",
  33886. "unicode_decimal": 59055 },
  33887. {
  33888. "icon_id": "24926735",
  33889. "name": "person-filled",
  33890. "font_class": "person-filled",
  33891. "unicode": "e69d",
  33892. "unicode_decimal": 59037 },
  33893. {
  33894. "icon_id": "24926703",
  33895. "name": "personadd-filled",
  33896. "font_class": "personadd-filled",
  33897. "unicode": "e698",
  33898. "unicode_decimal": 59032 },
  33899. {
  33900. "icon_id": "24923351",
  33901. "name": "back",
  33902. "font_class": "back",
  33903. "unicode": "e6b9",
  33904. "unicode_decimal": 59065 },
  33905. {
  33906. "icon_id": "24923352",
  33907. "name": "forward",
  33908. "font_class": "forward",
  33909. "unicode": "e6ba",
  33910. "unicode_decimal": 59066 },
  33911. {
  33912. "icon_id": "24923353",
  33913. "name": "arrowthinright",
  33914. "font_class": "arrow-right",
  33915. "unicode": "e6bb",
  33916. "unicode_decimal": 59067 },
  33917. {
  33918. "icon_id": "24923353",
  33919. "name": "arrowthinright",
  33920. "font_class": "arrowthinright",
  33921. "unicode": "e6bb",
  33922. "unicode_decimal": 59067 },
  33923. {
  33924. "icon_id": "24923354",
  33925. "name": "arrowthinleft",
  33926. "font_class": "arrow-left",
  33927. "unicode": "e6bc",
  33928. "unicode_decimal": 59068 },
  33929. {
  33930. "icon_id": "24923354",
  33931. "name": "arrowthinleft",
  33932. "font_class": "arrowthinleft",
  33933. "unicode": "e6bc",
  33934. "unicode_decimal": 59068 },
  33935. {
  33936. "icon_id": "24923355",
  33937. "name": "arrowthinup",
  33938. "font_class": "arrow-up",
  33939. "unicode": "e6bd",
  33940. "unicode_decimal": 59069 },
  33941. {
  33942. "icon_id": "24923355",
  33943. "name": "arrowthinup",
  33944. "font_class": "arrowthinup",
  33945. "unicode": "e6bd",
  33946. "unicode_decimal": 59069 },
  33947. {
  33948. "icon_id": "24923356",
  33949. "name": "arrowthindown",
  33950. "font_class": "arrow-down",
  33951. "unicode": "e6be",
  33952. "unicode_decimal": 59070 },
  33953. {
  33954. "icon_id": "24923356",
  33955. "name": "arrowthindown",
  33956. "font_class": "arrowthindown",
  33957. "unicode": "e6be",
  33958. "unicode_decimal": 59070 },
  33959. {
  33960. "icon_id": "24923349",
  33961. "name": "arrowdown",
  33962. "font_class": "bottom",
  33963. "unicode": "e6b8",
  33964. "unicode_decimal": 59064 },
  33965. {
  33966. "icon_id": "24923349",
  33967. "name": "arrowdown",
  33968. "font_class": "arrowdown",
  33969. "unicode": "e6b8",
  33970. "unicode_decimal": 59064 },
  33971. {
  33972. "icon_id": "24923346",
  33973. "name": "arrowright",
  33974. "font_class": "right",
  33975. "unicode": "e6b5",
  33976. "unicode_decimal": 59061 },
  33977. {
  33978. "icon_id": "24923346",
  33979. "name": "arrowright",
  33980. "font_class": "arrowright",
  33981. "unicode": "e6b5",
  33982. "unicode_decimal": 59061 },
  33983. {
  33984. "icon_id": "24923347",
  33985. "name": "arrowup",
  33986. "font_class": "top",
  33987. "unicode": "e6b6",
  33988. "unicode_decimal": 59062 },
  33989. {
  33990. "icon_id": "24923347",
  33991. "name": "arrowup",
  33992. "font_class": "arrowup",
  33993. "unicode": "e6b6",
  33994. "unicode_decimal": 59062 },
  33995. {
  33996. "icon_id": "24923348",
  33997. "name": "arrowleft",
  33998. "font_class": "left",
  33999. "unicode": "e6b7",
  34000. "unicode_decimal": 59063 },
  34001. {
  34002. "icon_id": "24923348",
  34003. "name": "arrowleft",
  34004. "font_class": "arrowleft",
  34005. "unicode": "e6b7",
  34006. "unicode_decimal": 59063 },
  34007. {
  34008. "icon_id": "24923334",
  34009. "name": "eye",
  34010. "font_class": "eye",
  34011. "unicode": "e651",
  34012. "unicode_decimal": 58961 },
  34013. {
  34014. "icon_id": "24923335",
  34015. "name": "eye-filled",
  34016. "font_class": "eye-filled",
  34017. "unicode": "e66a",
  34018. "unicode_decimal": 58986 },
  34019. {
  34020. "icon_id": "24923336",
  34021. "name": "eye-slash",
  34022. "font_class": "eye-slash",
  34023. "unicode": "e6b3",
  34024. "unicode_decimal": 59059 },
  34025. {
  34026. "icon_id": "24923337",
  34027. "name": "eye-slash-filled",
  34028. "font_class": "eye-slash-filled",
  34029. "unicode": "e6b4",
  34030. "unicode_decimal": 59060 },
  34031. {
  34032. "icon_id": "24923305",
  34033. "name": "info-filled",
  34034. "font_class": "info-filled",
  34035. "unicode": "e649",
  34036. "unicode_decimal": 58953 },
  34037. {
  34038. "icon_id": "24923299",
  34039. "name": "reload-01",
  34040. "font_class": "reload",
  34041. "unicode": "e6b2",
  34042. "unicode_decimal": 59058 },
  34043. {
  34044. "icon_id": "24923195",
  34045. "name": "mic_slash_fill",
  34046. "font_class": "micoff-filled",
  34047. "unicode": "e6b0",
  34048. "unicode_decimal": 59056 },
  34049. {
  34050. "icon_id": "24923165",
  34051. "name": "map-pin-ellipse",
  34052. "font_class": "map-pin-ellipse",
  34053. "unicode": "e6ac",
  34054. "unicode_decimal": 59052 },
  34055. {
  34056. "icon_id": "24923166",
  34057. "name": "map-pin",
  34058. "font_class": "map-pin",
  34059. "unicode": "e6ad",
  34060. "unicode_decimal": 59053 },
  34061. {
  34062. "icon_id": "24923167",
  34063. "name": "location",
  34064. "font_class": "location",
  34065. "unicode": "e6ae",
  34066. "unicode_decimal": 59054 },
  34067. {
  34068. "icon_id": "24923064",
  34069. "name": "starhalf",
  34070. "font_class": "starhalf",
  34071. "unicode": "e683",
  34072. "unicode_decimal": 59011 },
  34073. {
  34074. "icon_id": "24923065",
  34075. "name": "star",
  34076. "font_class": "star",
  34077. "unicode": "e688",
  34078. "unicode_decimal": 59016 },
  34079. {
  34080. "icon_id": "24923066",
  34081. "name": "star-filled",
  34082. "font_class": "star-filled",
  34083. "unicode": "e68f",
  34084. "unicode_decimal": 59023 },
  34085. {
  34086. "icon_id": "24899646",
  34087. "name": "a-rilidaka",
  34088. "font_class": "calendar",
  34089. "unicode": "e6a0",
  34090. "unicode_decimal": 59040 },
  34091. {
  34092. "icon_id": "24899647",
  34093. "name": "fire",
  34094. "font_class": "fire",
  34095. "unicode": "e6a1",
  34096. "unicode_decimal": 59041 },
  34097. {
  34098. "icon_id": "24899648",
  34099. "name": "paihangbang",
  34100. "font_class": "medal",
  34101. "unicode": "e6a2",
  34102. "unicode_decimal": 59042 },
  34103. {
  34104. "icon_id": "24899649",
  34105. "name": "font",
  34106. "font_class": "font",
  34107. "unicode": "e6a3",
  34108. "unicode_decimal": 59043 },
  34109. {
  34110. "icon_id": "24899650",
  34111. "name": "gift",
  34112. "font_class": "gift",
  34113. "unicode": "e6a4",
  34114. "unicode_decimal": 59044 },
  34115. {
  34116. "icon_id": "24899651",
  34117. "name": "link",
  34118. "font_class": "link",
  34119. "unicode": "e6a5",
  34120. "unicode_decimal": 59045 },
  34121. {
  34122. "icon_id": "24899652",
  34123. "name": "notification",
  34124. "font_class": "notification",
  34125. "unicode": "e6a6",
  34126. "unicode_decimal": 59046 },
  34127. {
  34128. "icon_id": "24899653",
  34129. "name": "staff",
  34130. "font_class": "staff",
  34131. "unicode": "e6a7",
  34132. "unicode_decimal": 59047 },
  34133. {
  34134. "icon_id": "24899654",
  34135. "name": "VIP",
  34136. "font_class": "vip",
  34137. "unicode": "e6a8",
  34138. "unicode_decimal": 59048 },
  34139. {
  34140. "icon_id": "24899655",
  34141. "name": "folder_add",
  34142. "font_class": "folder-add",
  34143. "unicode": "e6a9",
  34144. "unicode_decimal": 59049 },
  34145. {
  34146. "icon_id": "24899656",
  34147. "name": "tune",
  34148. "font_class": "tune",
  34149. "unicode": "e6aa",
  34150. "unicode_decimal": 59050 },
  34151. {
  34152. "icon_id": "24899657",
  34153. "name": "shimingrenzheng",
  34154. "font_class": "auth",
  34155. "unicode": "e6ab",
  34156. "unicode_decimal": 59051 },
  34157. {
  34158. "icon_id": "24899565",
  34159. "name": "person",
  34160. "font_class": "person",
  34161. "unicode": "e699",
  34162. "unicode_decimal": 59033 },
  34163. {
  34164. "icon_id": "24899566",
  34165. "name": "email-filled",
  34166. "font_class": "email-filled",
  34167. "unicode": "e69a",
  34168. "unicode_decimal": 59034 },
  34169. {
  34170. "icon_id": "24899567",
  34171. "name": "phone-filled",
  34172. "font_class": "phone-filled",
  34173. "unicode": "e69b",
  34174. "unicode_decimal": 59035 },
  34175. {
  34176. "icon_id": "24899568",
  34177. "name": "phone",
  34178. "font_class": "phone",
  34179. "unicode": "e69c",
  34180. "unicode_decimal": 59036 },
  34181. {
  34182. "icon_id": "24899570",
  34183. "name": "email",
  34184. "font_class": "email",
  34185. "unicode": "e69e",
  34186. "unicode_decimal": 59038 },
  34187. {
  34188. "icon_id": "24899571",
  34189. "name": "personadd",
  34190. "font_class": "personadd",
  34191. "unicode": "e69f",
  34192. "unicode_decimal": 59039 },
  34193. {
  34194. "icon_id": "24899558",
  34195. "name": "chatboxes-filled",
  34196. "font_class": "chatboxes-filled",
  34197. "unicode": "e692",
  34198. "unicode_decimal": 59026 },
  34199. {
  34200. "icon_id": "24899559",
  34201. "name": "contact",
  34202. "font_class": "contact",
  34203. "unicode": "e693",
  34204. "unicode_decimal": 59027 },
  34205. {
  34206. "icon_id": "24899560",
  34207. "name": "chatbubble-filled",
  34208. "font_class": "chatbubble-filled",
  34209. "unicode": "e694",
  34210. "unicode_decimal": 59028 },
  34211. {
  34212. "icon_id": "24899561",
  34213. "name": "contact-filled",
  34214. "font_class": "contact-filled",
  34215. "unicode": "e695",
  34216. "unicode_decimal": 59029 },
  34217. {
  34218. "icon_id": "24899562",
  34219. "name": "chatboxes",
  34220. "font_class": "chatboxes",
  34221. "unicode": "e696",
  34222. "unicode_decimal": 59030 },
  34223. {
  34224. "icon_id": "24899563",
  34225. "name": "chatbubble",
  34226. "font_class": "chatbubble",
  34227. "unicode": "e697",
  34228. "unicode_decimal": 59031 },
  34229. {
  34230. "icon_id": "24881290",
  34231. "name": "upload-filled",
  34232. "font_class": "upload-filled",
  34233. "unicode": "e68e",
  34234. "unicode_decimal": 59022 },
  34235. {
  34236. "icon_id": "24881292",
  34237. "name": "upload",
  34238. "font_class": "upload",
  34239. "unicode": "e690",
  34240. "unicode_decimal": 59024 },
  34241. {
  34242. "icon_id": "24881293",
  34243. "name": "weixin",
  34244. "font_class": "weixin",
  34245. "unicode": "e691",
  34246. "unicode_decimal": 59025 },
  34247. {
  34248. "icon_id": "24881274",
  34249. "name": "compose",
  34250. "font_class": "compose",
  34251. "unicode": "e67f",
  34252. "unicode_decimal": 59007 },
  34253. {
  34254. "icon_id": "24881275",
  34255. "name": "qq",
  34256. "font_class": "qq",
  34257. "unicode": "e680",
  34258. "unicode_decimal": 59008 },
  34259. {
  34260. "icon_id": "24881276",
  34261. "name": "download-filled",
  34262. "font_class": "download-filled",
  34263. "unicode": "e681",
  34264. "unicode_decimal": 59009 },
  34265. {
  34266. "icon_id": "24881277",
  34267. "name": "pengyouquan",
  34268. "font_class": "pyq",
  34269. "unicode": "e682",
  34270. "unicode_decimal": 59010 },
  34271. {
  34272. "icon_id": "24881279",
  34273. "name": "sound",
  34274. "font_class": "sound",
  34275. "unicode": "e684",
  34276. "unicode_decimal": 59012 },
  34277. {
  34278. "icon_id": "24881280",
  34279. "name": "trash-filled",
  34280. "font_class": "trash-filled",
  34281. "unicode": "e685",
  34282. "unicode_decimal": 59013 },
  34283. {
  34284. "icon_id": "24881281",
  34285. "name": "sound-filled",
  34286. "font_class": "sound-filled",
  34287. "unicode": "e686",
  34288. "unicode_decimal": 59014 },
  34289. {
  34290. "icon_id": "24881282",
  34291. "name": "trash",
  34292. "font_class": "trash",
  34293. "unicode": "e687",
  34294. "unicode_decimal": 59015 },
  34295. {
  34296. "icon_id": "24881284",
  34297. "name": "videocam-filled",
  34298. "font_class": "videocam-filled",
  34299. "unicode": "e689",
  34300. "unicode_decimal": 59017 },
  34301. {
  34302. "icon_id": "24881285",
  34303. "name": "spinner-cycle",
  34304. "font_class": "spinner-cycle",
  34305. "unicode": "e68a",
  34306. "unicode_decimal": 59018 },
  34307. {
  34308. "icon_id": "24881286",
  34309. "name": "weibo",
  34310. "font_class": "weibo",
  34311. "unicode": "e68b",
  34312. "unicode_decimal": 59019 },
  34313. {
  34314. "icon_id": "24881288",
  34315. "name": "videocam",
  34316. "font_class": "videocam",
  34317. "unicode": "e68c",
  34318. "unicode_decimal": 59020 },
  34319. {
  34320. "icon_id": "24881289",
  34321. "name": "download",
  34322. "font_class": "download",
  34323. "unicode": "e68d",
  34324. "unicode_decimal": 59021 },
  34325. {
  34326. "icon_id": "24879601",
  34327. "name": "help",
  34328. "font_class": "help",
  34329. "unicode": "e679",
  34330. "unicode_decimal": 59001 },
  34331. {
  34332. "icon_id": "24879602",
  34333. "name": "navigate-filled",
  34334. "font_class": "navigate-filled",
  34335. "unicode": "e67a",
  34336. "unicode_decimal": 59002 },
  34337. {
  34338. "icon_id": "24879603",
  34339. "name": "plusempty",
  34340. "font_class": "plusempty",
  34341. "unicode": "e67b",
  34342. "unicode_decimal": 59003 },
  34343. {
  34344. "icon_id": "24879604",
  34345. "name": "smallcircle",
  34346. "font_class": "smallcircle",
  34347. "unicode": "e67c",
  34348. "unicode_decimal": 59004 },
  34349. {
  34350. "icon_id": "24879605",
  34351. "name": "minus-filled",
  34352. "font_class": "minus-filled",
  34353. "unicode": "e67d",
  34354. "unicode_decimal": 59005 },
  34355. {
  34356. "icon_id": "24879606",
  34357. "name": "micoff",
  34358. "font_class": "micoff",
  34359. "unicode": "e67e",
  34360. "unicode_decimal": 59006 },
  34361. {
  34362. "icon_id": "24879588",
  34363. "name": "closeempty",
  34364. "font_class": "closeempty",
  34365. "unicode": "e66c",
  34366. "unicode_decimal": 58988 },
  34367. {
  34368. "icon_id": "24879589",
  34369. "name": "clear",
  34370. "font_class": "clear",
  34371. "unicode": "e66d",
  34372. "unicode_decimal": 58989 },
  34373. {
  34374. "icon_id": "24879590",
  34375. "name": "navigate",
  34376. "font_class": "navigate",
  34377. "unicode": "e66e",
  34378. "unicode_decimal": 58990 },
  34379. {
  34380. "icon_id": "24879591",
  34381. "name": "minus",
  34382. "font_class": "minus",
  34383. "unicode": "e66f",
  34384. "unicode_decimal": 58991 },
  34385. {
  34386. "icon_id": "24879592",
  34387. "name": "image",
  34388. "font_class": "image",
  34389. "unicode": "e670",
  34390. "unicode_decimal": 58992 },
  34391. {
  34392. "icon_id": "24879593",
  34393. "name": "mic",
  34394. "font_class": "mic",
  34395. "unicode": "e671",
  34396. "unicode_decimal": 58993 },
  34397. {
  34398. "icon_id": "24879594",
  34399. "name": "paperplane",
  34400. "font_class": "paperplane",
  34401. "unicode": "e672",
  34402. "unicode_decimal": 58994 },
  34403. {
  34404. "icon_id": "24879595",
  34405. "name": "close",
  34406. "font_class": "close",
  34407. "unicode": "e673",
  34408. "unicode_decimal": 58995 },
  34409. {
  34410. "icon_id": "24879596",
  34411. "name": "help-filled",
  34412. "font_class": "help-filled",
  34413. "unicode": "e674",
  34414. "unicode_decimal": 58996 },
  34415. {
  34416. "icon_id": "24879597",
  34417. "name": "plus-filled",
  34418. "font_class": "paperplane-filled",
  34419. "unicode": "e675",
  34420. "unicode_decimal": 58997 },
  34421. {
  34422. "icon_id": "24879598",
  34423. "name": "plus",
  34424. "font_class": "plus",
  34425. "unicode": "e676",
  34426. "unicode_decimal": 58998 },
  34427. {
  34428. "icon_id": "24879599",
  34429. "name": "mic-filled",
  34430. "font_class": "mic-filled",
  34431. "unicode": "e677",
  34432. "unicode_decimal": 58999 },
  34433. {
  34434. "icon_id": "24879600",
  34435. "name": "image-filled",
  34436. "font_class": "image-filled",
  34437. "unicode": "e678",
  34438. "unicode_decimal": 59000 },
  34439. {
  34440. "icon_id": "24855900",
  34441. "name": "locked-filled",
  34442. "font_class": "locked-filled",
  34443. "unicode": "e668",
  34444. "unicode_decimal": 58984 },
  34445. {
  34446. "icon_id": "24855901",
  34447. "name": "info",
  34448. "font_class": "info",
  34449. "unicode": "e669",
  34450. "unicode_decimal": 58985 },
  34451. {
  34452. "icon_id": "24855903",
  34453. "name": "locked",
  34454. "font_class": "locked",
  34455. "unicode": "e66b",
  34456. "unicode_decimal": 58987 },
  34457. {
  34458. "icon_id": "24855884",
  34459. "name": "camera-filled",
  34460. "font_class": "camera-filled",
  34461. "unicode": "e658",
  34462. "unicode_decimal": 58968 },
  34463. {
  34464. "icon_id": "24855885",
  34465. "name": "chat-filled",
  34466. "font_class": "chat-filled",
  34467. "unicode": "e659",
  34468. "unicode_decimal": 58969 },
  34469. {
  34470. "icon_id": "24855886",
  34471. "name": "camera",
  34472. "font_class": "camera",
  34473. "unicode": "e65a",
  34474. "unicode_decimal": 58970 },
  34475. {
  34476. "icon_id": "24855887",
  34477. "name": "circle",
  34478. "font_class": "circle",
  34479. "unicode": "e65b",
  34480. "unicode_decimal": 58971 },
  34481. {
  34482. "icon_id": "24855888",
  34483. "name": "checkmarkempty",
  34484. "font_class": "checkmarkempty",
  34485. "unicode": "e65c",
  34486. "unicode_decimal": 58972 },
  34487. {
  34488. "icon_id": "24855889",
  34489. "name": "chat",
  34490. "font_class": "chat",
  34491. "unicode": "e65d",
  34492. "unicode_decimal": 58973 },
  34493. {
  34494. "icon_id": "24855890",
  34495. "name": "circle-filled",
  34496. "font_class": "circle-filled",
  34497. "unicode": "e65e",
  34498. "unicode_decimal": 58974 },
  34499. {
  34500. "icon_id": "24855891",
  34501. "name": "flag",
  34502. "font_class": "flag",
  34503. "unicode": "e65f",
  34504. "unicode_decimal": 58975 },
  34505. {
  34506. "icon_id": "24855892",
  34507. "name": "flag-filled",
  34508. "font_class": "flag-filled",
  34509. "unicode": "e660",
  34510. "unicode_decimal": 58976 },
  34511. {
  34512. "icon_id": "24855893",
  34513. "name": "gear-filled",
  34514. "font_class": "gear-filled",
  34515. "unicode": "e661",
  34516. "unicode_decimal": 58977 },
  34517. {
  34518. "icon_id": "24855894",
  34519. "name": "home",
  34520. "font_class": "home",
  34521. "unicode": "e662",
  34522. "unicode_decimal": 58978 },
  34523. {
  34524. "icon_id": "24855895",
  34525. "name": "home-filled",
  34526. "font_class": "home-filled",
  34527. "unicode": "e663",
  34528. "unicode_decimal": 58979 },
  34529. {
  34530. "icon_id": "24855896",
  34531. "name": "gear",
  34532. "font_class": "gear",
  34533. "unicode": "e664",
  34534. "unicode_decimal": 58980 },
  34535. {
  34536. "icon_id": "24855897",
  34537. "name": "smallcircle-filled",
  34538. "font_class": "smallcircle-filled",
  34539. "unicode": "e665",
  34540. "unicode_decimal": 58981 },
  34541. {
  34542. "icon_id": "24855898",
  34543. "name": "map-filled",
  34544. "font_class": "map-filled",
  34545. "unicode": "e666",
  34546. "unicode_decimal": 58982 },
  34547. {
  34548. "icon_id": "24855899",
  34549. "name": "map",
  34550. "font_class": "map",
  34551. "unicode": "e667",
  34552. "unicode_decimal": 58983 },
  34553. {
  34554. "icon_id": "24855825",
  34555. "name": "refresh-filled",
  34556. "font_class": "refresh-filled",
  34557. "unicode": "e656",
  34558. "unicode_decimal": 58966 },
  34559. {
  34560. "icon_id": "24855826",
  34561. "name": "refresh",
  34562. "font_class": "refresh",
  34563. "unicode": "e657",
  34564. "unicode_decimal": 58967 },
  34565. {
  34566. "icon_id": "24855808",
  34567. "name": "cloud-upload",
  34568. "font_class": "cloud-upload",
  34569. "unicode": "e645",
  34570. "unicode_decimal": 58949 },
  34571. {
  34572. "icon_id": "24855809",
  34573. "name": "cloud-download-filled",
  34574. "font_class": "cloud-download-filled",
  34575. "unicode": "e646",
  34576. "unicode_decimal": 58950 },
  34577. {
  34578. "icon_id": "24855810",
  34579. "name": "cloud-download",
  34580. "font_class": "cloud-download",
  34581. "unicode": "e647",
  34582. "unicode_decimal": 58951 },
  34583. {
  34584. "icon_id": "24855811",
  34585. "name": "cloud-upload-filled",
  34586. "font_class": "cloud-upload-filled",
  34587. "unicode": "e648",
  34588. "unicode_decimal": 58952 },
  34589. {
  34590. "icon_id": "24855813",
  34591. "name": "redo",
  34592. "font_class": "redo",
  34593. "unicode": "e64a",
  34594. "unicode_decimal": 58954 },
  34595. {
  34596. "icon_id": "24855814",
  34597. "name": "images-filled",
  34598. "font_class": "images-filled",
  34599. "unicode": "e64b",
  34600. "unicode_decimal": 58955 },
  34601. {
  34602. "icon_id": "24855815",
  34603. "name": "undo-filled",
  34604. "font_class": "undo-filled",
  34605. "unicode": "e64c",
  34606. "unicode_decimal": 58956 },
  34607. {
  34608. "icon_id": "24855816",
  34609. "name": "more",
  34610. "font_class": "more",
  34611. "unicode": "e64d",
  34612. "unicode_decimal": 58957 },
  34613. {
  34614. "icon_id": "24855817",
  34615. "name": "more-filled",
  34616. "font_class": "more-filled",
  34617. "unicode": "e64e",
  34618. "unicode_decimal": 58958 },
  34619. {
  34620. "icon_id": "24855818",
  34621. "name": "undo",
  34622. "font_class": "undo",
  34623. "unicode": "e64f",
  34624. "unicode_decimal": 58959 },
  34625. {
  34626. "icon_id": "24855819",
  34627. "name": "images",
  34628. "font_class": "images",
  34629. "unicode": "e650",
  34630. "unicode_decimal": 58960 },
  34631. {
  34632. "icon_id": "24855821",
  34633. "name": "paperclip",
  34634. "font_class": "paperclip",
  34635. "unicode": "e652",
  34636. "unicode_decimal": 58962 },
  34637. {
  34638. "icon_id": "24855822",
  34639. "name": "settings",
  34640. "font_class": "settings",
  34641. "unicode": "e653",
  34642. "unicode_decimal": 58963 },
  34643. {
  34644. "icon_id": "24855823",
  34645. "name": "search",
  34646. "font_class": "search",
  34647. "unicode": "e654",
  34648. "unicode_decimal": 58964 },
  34649. {
  34650. "icon_id": "24855824",
  34651. "name": "redo-filled",
  34652. "font_class": "redo-filled",
  34653. "unicode": "e655",
  34654. "unicode_decimal": 58965 },
  34655. {
  34656. "icon_id": "24841702",
  34657. "name": "list",
  34658. "font_class": "list",
  34659. "unicode": "e644",
  34660. "unicode_decimal": 58948 },
  34661. {
  34662. "icon_id": "24841489",
  34663. "name": "mail-open-filled",
  34664. "font_class": "mail-open-filled",
  34665. "unicode": "e63a",
  34666. "unicode_decimal": 58938 },
  34667. {
  34668. "icon_id": "24841491",
  34669. "name": "hand-thumbsdown-filled",
  34670. "font_class": "hand-down-filled",
  34671. "unicode": "e63c",
  34672. "unicode_decimal": 58940 },
  34673. {
  34674. "icon_id": "24841492",
  34675. "name": "hand-thumbsdown",
  34676. "font_class": "hand-down",
  34677. "unicode": "e63d",
  34678. "unicode_decimal": 58941 },
  34679. {
  34680. "icon_id": "24841493",
  34681. "name": "hand-thumbsup-filled",
  34682. "font_class": "hand-up-filled",
  34683. "unicode": "e63e",
  34684. "unicode_decimal": 58942 },
  34685. {
  34686. "icon_id": "24841494",
  34687. "name": "hand-thumbsup",
  34688. "font_class": "hand-up",
  34689. "unicode": "e63f",
  34690. "unicode_decimal": 58943 },
  34691. {
  34692. "icon_id": "24841496",
  34693. "name": "heart-filled",
  34694. "font_class": "heart-filled",
  34695. "unicode": "e641",
  34696. "unicode_decimal": 58945 },
  34697. {
  34698. "icon_id": "24841498",
  34699. "name": "mail-open",
  34700. "font_class": "mail-open",
  34701. "unicode": "e643",
  34702. "unicode_decimal": 58947 },
  34703. {
  34704. "icon_id": "24841488",
  34705. "name": "heart",
  34706. "font_class": "heart",
  34707. "unicode": "e639",
  34708. "unicode_decimal": 58937 },
  34709. {
  34710. "icon_id": "24839963",
  34711. "name": "loop",
  34712. "font_class": "loop",
  34713. "unicode": "e633",
  34714. "unicode_decimal": 58931 },
  34715. {
  34716. "icon_id": "24839866",
  34717. "name": "pulldown",
  34718. "font_class": "pulldown",
  34719. "unicode": "e632",
  34720. "unicode_decimal": 58930 },
  34721. {
  34722. "icon_id": "24813798",
  34723. "name": "scan",
  34724. "font_class": "scan",
  34725. "unicode": "e62a",
  34726. "unicode_decimal": 58922 },
  34727. {
  34728. "icon_id": "24813786",
  34729. "name": "bars",
  34730. "font_class": "bars",
  34731. "unicode": "e627",
  34732. "unicode_decimal": 58919 },
  34733. {
  34734. "icon_id": "24813788",
  34735. "name": "cart-filled",
  34736. "font_class": "cart-filled",
  34737. "unicode": "e629",
  34738. "unicode_decimal": 58921 },
  34739. {
  34740. "icon_id": "24813790",
  34741. "name": "checkbox",
  34742. "font_class": "checkbox",
  34743. "unicode": "e62b",
  34744. "unicode_decimal": 58923 },
  34745. {
  34746. "icon_id": "24813791",
  34747. "name": "checkbox-filled",
  34748. "font_class": "checkbox-filled",
  34749. "unicode": "e62c",
  34750. "unicode_decimal": 58924 },
  34751. {
  34752. "icon_id": "24813794",
  34753. "name": "shop",
  34754. "font_class": "shop",
  34755. "unicode": "e62f",
  34756. "unicode_decimal": 58927 },
  34757. {
  34758. "icon_id": "24813795",
  34759. "name": "headphones",
  34760. "font_class": "headphones",
  34761. "unicode": "e630",
  34762. "unicode_decimal": 58928 },
  34763. {
  34764. "icon_id": "24813796",
  34765. "name": "cart",
  34766. "font_class": "cart",
  34767. "unicode": "e631",
  34768. "unicode_decimal": 58929 }] };exports.default = _default;
  34769. /***/ })
  34770. ]]);
  34771. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map