vendor.js 479 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
  2. /***/ 1:
  3. /*!************************************************************!*\
  4. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  5. \************************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. /* 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);
  10. 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;}
  11. var realAtob;
  12. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  13. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  14. if (typeof atob !== 'function') {
  15. realAtob = function realAtob(str) {
  16. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  17. if (!b64re.test(str)) {throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");}
  18. // Adding the padding if missing, for semplicity
  19. str += '=='.slice(2 - (str.length & 3));
  20. var bitmap;var result = '';var r1;var r2;var i = 0;
  21. for (; i < str.length;) {
  22. bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 |
  23. (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
  24. result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) :
  25. r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) :
  26. String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  27. }
  28. return result;
  29. };
  30. } else {
  31. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  32. realAtob = atob;
  33. }
  34. function b64DecodeUnicode(str) {
  35. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  36. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  37. }).join(''));
  38. }
  39. function getCurrentUserInfo() {
  40. var token = wx.getStorageSync('uni_id_token') || '';
  41. var tokenArr = token.split('.');
  42. if (!token || tokenArr.length !== 3) {
  43. return {
  44. uid: null,
  45. role: [],
  46. permission: [],
  47. tokenExpired: 0 };
  48. }
  49. var userInfo;
  50. try {
  51. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  52. } catch (error) {
  53. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  54. }
  55. userInfo.tokenExpired = userInfo.exp * 1000;
  56. delete userInfo.exp;
  57. delete userInfo.iat;
  58. return userInfo;
  59. }
  60. function uniIdMixin(Vue) {
  61. Vue.prototype.uniIDHasRole = function (roleId) {var _getCurrentUserInfo =
  62. getCurrentUserInfo(),role = _getCurrentUserInfo.role;
  63. return role.indexOf(roleId) > -1;
  64. };
  65. Vue.prototype.uniIDHasPermission = function (permissionId) {var _getCurrentUserInfo2 =
  66. getCurrentUserInfo(),permission = _getCurrentUserInfo2.permission;
  67. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  68. };
  69. Vue.prototype.uniIDTokenValid = function () {var _getCurrentUserInfo3 =
  70. getCurrentUserInfo(),tokenExpired = _getCurrentUserInfo3.tokenExpired;
  71. return tokenExpired > Date.now();
  72. };
  73. }
  74. var _toString = Object.prototype.toString;
  75. var hasOwnProperty = Object.prototype.hasOwnProperty;
  76. function isFn(fn) {
  77. return typeof fn === 'function';
  78. }
  79. function isStr(str) {
  80. return typeof str === 'string';
  81. }
  82. function isPlainObject(obj) {
  83. return _toString.call(obj) === '[object Object]';
  84. }
  85. function hasOwn(obj, key) {
  86. return hasOwnProperty.call(obj, key);
  87. }
  88. function noop() {}
  89. /**
  90. * Create a cached version of a pure function.
  91. */
  92. function cached(fn) {
  93. var cache = Object.create(null);
  94. return function cachedFn(str) {
  95. var hit = cache[str];
  96. return hit || (cache[str] = fn(str));
  97. };
  98. }
  99. /**
  100. * Camelize a hyphen-delimited string.
  101. */
  102. var camelizeRE = /-(\w)/g;
  103. var camelize = cached(function (str) {
  104. return str.replace(camelizeRE, function (_, c) {return c ? c.toUpperCase() : '';});
  105. });
  106. function sortObject(obj) {
  107. var sortObj = {};
  108. if (isPlainObject(obj)) {
  109. Object.keys(obj).sort().forEach(function (key) {
  110. sortObj[key] = obj[key];
  111. });
  112. }
  113. return !Object.keys(sortObj) ? obj : sortObj;
  114. }
  115. var HOOKS = [
  116. 'invoke',
  117. 'success',
  118. 'fail',
  119. 'complete',
  120. 'returnValue'];
  121. var globalInterceptors = {};
  122. var scopedInterceptors = {};
  123. function mergeHook(parentVal, childVal) {
  124. var res = childVal ?
  125. parentVal ?
  126. parentVal.concat(childVal) :
  127. Array.isArray(childVal) ?
  128. childVal : [childVal] :
  129. parentVal;
  130. return res ?
  131. dedupeHooks(res) :
  132. res;
  133. }
  134. function dedupeHooks(hooks) {
  135. var res = [];
  136. for (var i = 0; i < hooks.length; i++) {
  137. if (res.indexOf(hooks[i]) === -1) {
  138. res.push(hooks[i]);
  139. }
  140. }
  141. return res;
  142. }
  143. function removeHook(hooks, hook) {
  144. var index = hooks.indexOf(hook);
  145. if (index !== -1) {
  146. hooks.splice(index, 1);
  147. }
  148. }
  149. function mergeInterceptorHook(interceptor, option) {
  150. Object.keys(option).forEach(function (hook) {
  151. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  152. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  153. }
  154. });
  155. }
  156. function removeInterceptorHook(interceptor, option) {
  157. if (!interceptor || !option) {
  158. return;
  159. }
  160. Object.keys(option).forEach(function (hook) {
  161. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  162. removeHook(interceptor[hook], option[hook]);
  163. }
  164. });
  165. }
  166. function addInterceptor(method, option) {
  167. if (typeof method === 'string' && isPlainObject(option)) {
  168. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  169. } else if (isPlainObject(method)) {
  170. mergeInterceptorHook(globalInterceptors, method);
  171. }
  172. }
  173. function removeInterceptor(method, option) {
  174. if (typeof method === 'string') {
  175. if (isPlainObject(option)) {
  176. removeInterceptorHook(scopedInterceptors[method], option);
  177. } else {
  178. delete scopedInterceptors[method];
  179. }
  180. } else if (isPlainObject(method)) {
  181. removeInterceptorHook(globalInterceptors, method);
  182. }
  183. }
  184. function wrapperHook(hook) {
  185. return function (data) {
  186. return hook(data) || data;
  187. };
  188. }
  189. function isPromise(obj) {
  190. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  191. }
  192. function queue(hooks, data) {
  193. var promise = false;
  194. for (var i = 0; i < hooks.length; i++) {
  195. var hook = hooks[i];
  196. if (promise) {
  197. promise = Promise.resolve(wrapperHook(hook));
  198. } else {
  199. var res = hook(data);
  200. if (isPromise(res)) {
  201. promise = Promise.resolve(res);
  202. }
  203. if (res === false) {
  204. return {
  205. then: function then() {} };
  206. }
  207. }
  208. }
  209. return promise || {
  210. then: function then(callback) {
  211. return callback(data);
  212. } };
  213. }
  214. function wrapperOptions(interceptor) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  215. ['success', 'fail', 'complete'].forEach(function (name) {
  216. if (Array.isArray(interceptor[name])) {
  217. var oldCallback = options[name];
  218. options[name] = function callbackInterceptor(res) {
  219. queue(interceptor[name], res).then(function (res) {
  220. /* eslint-disable no-mixed-operators */
  221. return isFn(oldCallback) && oldCallback(res) || res;
  222. });
  223. };
  224. }
  225. });
  226. return options;
  227. }
  228. function wrapperReturnValue(method, returnValue) {
  229. var returnValueHooks = [];
  230. if (Array.isArray(globalInterceptors.returnValue)) {
  231. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(globalInterceptors.returnValue));
  232. }
  233. var interceptor = scopedInterceptors[method];
  234. if (interceptor && Array.isArray(interceptor.returnValue)) {
  235. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(interceptor.returnValue));
  236. }
  237. returnValueHooks.forEach(function (hook) {
  238. returnValue = hook(returnValue) || returnValue;
  239. });
  240. return returnValue;
  241. }
  242. function getApiInterceptorHooks(method) {
  243. var interceptor = Object.create(null);
  244. Object.keys(globalInterceptors).forEach(function (hook) {
  245. if (hook !== 'returnValue') {
  246. interceptor[hook] = globalInterceptors[hook].slice();
  247. }
  248. });
  249. var scopedInterceptor = scopedInterceptors[method];
  250. if (scopedInterceptor) {
  251. Object.keys(scopedInterceptor).forEach(function (hook) {
  252. if (hook !== 'returnValue') {
  253. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  254. }
  255. });
  256. }
  257. return interceptor;
  258. }
  259. 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];}
  260. var interceptor = getApiInterceptorHooks(method);
  261. if (interceptor && Object.keys(interceptor).length) {
  262. if (Array.isArray(interceptor.invoke)) {
  263. var res = queue(interceptor.invoke, options);
  264. return res.then(function (options) {
  265. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  266. });
  267. } else {
  268. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  269. }
  270. }
  271. return api.apply(void 0, [options].concat(params));
  272. }
  273. var promiseInterceptor = {
  274. returnValue: function returnValue(res) {
  275. if (!isPromise(res)) {
  276. return res;
  277. }
  278. return new Promise(function (resolve, reject) {
  279. res.then(function (res) {
  280. if (res[0]) {
  281. reject(res[0]);
  282. } else {
  283. resolve(res[1]);
  284. }
  285. });
  286. });
  287. } };
  288. var SYNC_API_RE =
  289. /^\$|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|getSystemSetting|getAppAuthorizeSetting/;
  290. var CONTEXT_API_RE = /^create|Manager$/;
  291. // Context例外情况
  292. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  293. // 同步例外情况
  294. var ASYNC_API = ['createBLEConnection', 'createPushMessage'];
  295. var CALLBACK_API_RE = /^on|^off/;
  296. function isContextApi(name) {
  297. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  298. }
  299. function isSyncApi(name) {
  300. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  301. }
  302. function isCallbackApi(name) {
  303. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  304. }
  305. function handlePromise(promise) {
  306. return promise.then(function (data) {
  307. return [null, data];
  308. }).
  309. catch(function (err) {return [err];});
  310. }
  311. function shouldPromise(name) {
  312. if (
  313. isContextApi(name) ||
  314. isSyncApi(name) ||
  315. isCallbackApi(name))
  316. {
  317. return false;
  318. }
  319. return true;
  320. }
  321. /* eslint-disable no-extend-native */
  322. if (!Promise.prototype.finally) {
  323. Promise.prototype.finally = function (callback) {
  324. var promise = this.constructor;
  325. return this.then(
  326. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  327. function (reason) {return promise.resolve(callback()).then(function () {
  328. throw reason;
  329. });});
  330. };
  331. }
  332. function promisify(name, api) {
  333. if (!shouldPromise(name)) {
  334. return api;
  335. }
  336. 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];}
  337. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  338. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  339. }
  340. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  341. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  342. success: resolve,
  343. fail: reject })].concat(
  344. params));
  345. })));
  346. };
  347. }
  348. var EPS = 1e-4;
  349. var BASE_DEVICE_WIDTH = 750;
  350. var isIOS = false;
  351. var deviceWidth = 0;
  352. var deviceDPR = 0;
  353. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  354. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  355. deviceWidth = windowWidth;
  356. deviceDPR = pixelRatio;
  357. isIOS = platform === 'ios';
  358. }
  359. function upx2px(number, newDeviceWidth) {
  360. if (deviceWidth === 0) {
  361. checkDeviceWidth();
  362. }
  363. number = Number(number);
  364. if (number === 0) {
  365. return 0;
  366. }
  367. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  368. if (result < 0) {
  369. result = -result;
  370. }
  371. result = Math.floor(result + EPS);
  372. if (result === 0) {
  373. if (deviceDPR === 1 || !isIOS) {
  374. result = 1;
  375. } else {
  376. result = 0.5;
  377. }
  378. }
  379. return number < 0 ? -result : result;
  380. }
  381. var LOCALE_ZH_HANS = 'zh-Hans';
  382. var LOCALE_ZH_HANT = 'zh-Hant';
  383. var LOCALE_EN = 'en';
  384. var LOCALE_FR = 'fr';
  385. var LOCALE_ES = 'es';
  386. var messages = {};
  387. var locale;
  388. {
  389. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  390. }
  391. function initI18nMessages() {
  392. if (!isEnableLocale()) {
  393. return;
  394. }
  395. var localeKeys = Object.keys(__uniConfig.locales);
  396. if (localeKeys.length) {
  397. localeKeys.forEach(function (locale) {
  398. var curMessages = messages[locale];
  399. var userMessages = __uniConfig.locales[locale];
  400. if (curMessages) {
  401. Object.assign(curMessages, userMessages);
  402. } else {
  403. messages[locale] = userMessages;
  404. }
  405. });
  406. }
  407. }
  408. initI18nMessages();
  409. var i18n = (0, _uniI18n.initVueI18n)(
  410. locale,
  411. {});
  412. var t = i18n.t;
  413. var i18nMixin = i18n.mixin = {
  414. beforeCreate: function beforeCreate() {var _this = this;
  415. var unwatch = i18n.i18n.watchLocale(function () {
  416. _this.$forceUpdate();
  417. });
  418. this.$once('hook:beforeDestroy', function () {
  419. unwatch();
  420. });
  421. },
  422. methods: {
  423. $$t: function $$t(key, values) {
  424. return t(key, values);
  425. } } };
  426. var setLocale = i18n.setLocale;
  427. var getLocale = i18n.getLocale;
  428. function initAppLocale(Vue, appVm, locale) {
  429. var state = Vue.observable({
  430. locale: locale || i18n.getLocale() });
  431. var localeWatchers = [];
  432. appVm.$watchLocale = function (fn) {
  433. localeWatchers.push(fn);
  434. };
  435. Object.defineProperty(appVm, '$locale', {
  436. get: function get() {
  437. return state.locale;
  438. },
  439. set: function set(v) {
  440. state.locale = v;
  441. localeWatchers.forEach(function (watch) {return watch(v);});
  442. } });
  443. }
  444. function isEnableLocale() {
  445. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  446. }
  447. function include(str, parts) {
  448. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  449. }
  450. function startsWith(str, parts) {
  451. return parts.find(function (part) {return str.indexOf(part) === 0;});
  452. }
  453. function normalizeLocale(locale, messages) {
  454. if (!locale) {
  455. return;
  456. }
  457. locale = locale.trim().replace(/_/g, '-');
  458. if (messages && messages[locale]) {
  459. return locale;
  460. }
  461. locale = locale.toLowerCase();
  462. if (locale === 'chinese') {
  463. // 支付宝
  464. return LOCALE_ZH_HANS;
  465. }
  466. if (locale.indexOf('zh') === 0) {
  467. if (locale.indexOf('-hans') > -1) {
  468. return LOCALE_ZH_HANS;
  469. }
  470. if (locale.indexOf('-hant') > -1) {
  471. return LOCALE_ZH_HANT;
  472. }
  473. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  474. return LOCALE_ZH_HANT;
  475. }
  476. return LOCALE_ZH_HANS;
  477. }
  478. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  479. if (lang) {
  480. return lang;
  481. }
  482. }
  483. // export function initI18n() {
  484. // const localeKeys = Object.keys(__uniConfig.locales || {})
  485. // if (localeKeys.length) {
  486. // localeKeys.forEach((locale) =>
  487. // i18n.add(locale, __uniConfig.locales[locale])
  488. // )
  489. // }
  490. // }
  491. function getLocale$1() {
  492. // 优先使用 $locale
  493. var app = getApp({
  494. allowDefault: true });
  495. if (app && app.$vm) {
  496. return app.$vm.$locale;
  497. }
  498. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  499. }
  500. function setLocale$1(locale) {
  501. var app = getApp();
  502. if (!app) {
  503. return false;
  504. }
  505. var oldLocale = app.$vm.$locale;
  506. if (oldLocale !== locale) {
  507. app.$vm.$locale = locale;
  508. onLocaleChangeCallbacks.forEach(function (fn) {return fn({
  509. locale: locale });});
  510. return true;
  511. }
  512. return false;
  513. }
  514. var onLocaleChangeCallbacks = [];
  515. function onLocaleChange(fn) {
  516. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  517. onLocaleChangeCallbacks.push(fn);
  518. }
  519. }
  520. if (typeof global !== 'undefined') {
  521. global.getLocale = getLocale$1;
  522. }
  523. var interceptors = {
  524. promiseInterceptor: promiseInterceptor };
  525. var baseApi = /*#__PURE__*/Object.freeze({
  526. __proto__: null,
  527. upx2px: upx2px,
  528. getLocale: getLocale$1,
  529. setLocale: setLocale$1,
  530. onLocaleChange: onLocaleChange,
  531. addInterceptor: addInterceptor,
  532. removeInterceptor: removeInterceptor,
  533. interceptors: interceptors });
  534. function findExistsPageIndex(url) {
  535. var pages = getCurrentPages();
  536. var len = pages.length;
  537. while (len--) {
  538. var page = pages[len];
  539. if (page.$page && page.$page.fullPath === url) {
  540. return len;
  541. }
  542. }
  543. return -1;
  544. }
  545. var redirectTo = {
  546. name: function name(fromArgs) {
  547. if (fromArgs.exists === 'back' && fromArgs.delta) {
  548. return 'navigateBack';
  549. }
  550. return 'redirectTo';
  551. },
  552. args: function args(fromArgs) {
  553. if (fromArgs.exists === 'back' && fromArgs.url) {
  554. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  555. if (existsPageIndex !== -1) {
  556. var delta = getCurrentPages().length - 1 - existsPageIndex;
  557. if (delta > 0) {
  558. fromArgs.delta = delta;
  559. }
  560. }
  561. }
  562. } };
  563. var previewImage = {
  564. args: function args(fromArgs) {
  565. var currentIndex = parseInt(fromArgs.current);
  566. if (isNaN(currentIndex)) {
  567. return;
  568. }
  569. var urls = fromArgs.urls;
  570. if (!Array.isArray(urls)) {
  571. return;
  572. }
  573. var len = urls.length;
  574. if (!len) {
  575. return;
  576. }
  577. if (currentIndex < 0) {
  578. currentIndex = 0;
  579. } else if (currentIndex >= len) {
  580. currentIndex = len - 1;
  581. }
  582. if (currentIndex > 0) {
  583. fromArgs.current = urls[currentIndex];
  584. fromArgs.urls = urls.filter(
  585. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  586. } else {
  587. fromArgs.current = urls[0];
  588. }
  589. return {
  590. indicator: false,
  591. loop: false };
  592. } };
  593. var UUID_KEY = '__DC_STAT_UUID';
  594. var deviceId;
  595. function useDeviceId(result) {
  596. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  597. if (!deviceId) {
  598. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  599. wx.setStorage({
  600. key: UUID_KEY,
  601. data: deviceId });
  602. }
  603. result.deviceId = deviceId;
  604. }
  605. function addSafeAreaInsets(result) {
  606. if (result.safeArea) {
  607. var safeArea = result.safeArea;
  608. result.safeAreaInsets = {
  609. top: safeArea.top,
  610. left: safeArea.left,
  611. right: result.windowWidth - safeArea.right,
  612. bottom: result.screenHeight - safeArea.bottom };
  613. }
  614. }
  615. function populateParameters(result) {var _result$brand =
  616. 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;
  617. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  618. // osName osVersion
  619. var osName = '';
  620. var osVersion = '';
  621. {
  622. osName = system.split(' ')[0] || '';
  623. osVersion = system.split(' ')[1] || '';
  624. }
  625. var hostVersion = version;
  626. // deviceType
  627. var deviceType = getGetDeviceType(result, model);
  628. // deviceModel
  629. var deviceBrand = getDeviceBrand(brand);
  630. // hostName
  631. var _hostName = getHostName(result);
  632. // deviceOrientation
  633. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  634. // devicePixelRatio
  635. var _devicePixelRatio = pixelRatio;
  636. // SDKVersion
  637. var _SDKVersion = SDKVersion;
  638. // hostLanguage
  639. var hostLanguage = language.replace(/_/g, '-');
  640. // wx.getAccountInfoSync
  641. var parameters = {
  642. appId: "__UNI__2080341",
  643. appName: "扫码点餐",
  644. appVersion: "1.0.8",
  645. appVersionCode: "108",
  646. appLanguage: getAppLanguage(hostLanguage),
  647. uniCompileVersion: "3.6.4",
  648. uniRuntimeVersion: "3.6.4",
  649. uniPlatform: undefined || "mp-weixin",
  650. deviceBrand: deviceBrand,
  651. deviceModel: model,
  652. deviceType: deviceType,
  653. devicePixelRatio: _devicePixelRatio,
  654. deviceOrientation: _deviceOrientation,
  655. osName: osName.toLocaleLowerCase(),
  656. osVersion: osVersion,
  657. hostTheme: theme,
  658. hostVersion: hostVersion,
  659. hostLanguage: hostLanguage,
  660. hostName: _hostName,
  661. hostSDKVersion: _SDKVersion,
  662. hostFontSizeSetting: fontSizeSetting,
  663. windowTop: 0,
  664. windowBottom: 0,
  665. // TODO
  666. osLanguage: undefined,
  667. osTheme: undefined,
  668. ua: undefined,
  669. hostPackageName: undefined,
  670. browserName: undefined,
  671. browserVersion: undefined };
  672. Object.assign(result, parameters);
  673. }
  674. function getGetDeviceType(result, model) {
  675. var deviceType = result.deviceType || 'phone';
  676. {
  677. var deviceTypeMaps = {
  678. ipad: 'pad',
  679. windows: 'pc',
  680. mac: 'pc' };
  681. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  682. var _model = model.toLocaleLowerCase();
  683. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  684. var _m = deviceTypeMapsKeys[index];
  685. if (_model.indexOf(_m) !== -1) {
  686. deviceType = deviceTypeMaps[_m];
  687. break;
  688. }
  689. }
  690. }
  691. return deviceType;
  692. }
  693. function getDeviceBrand(brand) {
  694. var deviceBrand = brand;
  695. if (deviceBrand) {
  696. deviceBrand = brand.toLocaleLowerCase();
  697. }
  698. return deviceBrand;
  699. }
  700. function getAppLanguage(defaultLanguage) {
  701. return getLocale$1 ?
  702. getLocale$1() :
  703. defaultLanguage;
  704. }
  705. function getHostName(result) {
  706. var _platform = 'WeChat';
  707. var _hostName = result.hostName || _platform; // mp-jd
  708. {
  709. if (result.environment) {
  710. _hostName = result.environment;
  711. } else if (result.host && result.host.env) {
  712. _hostName = result.host.env;
  713. }
  714. }
  715. return _hostName;
  716. }
  717. var getSystemInfo = {
  718. returnValue: function returnValue(result) {
  719. useDeviceId(result);
  720. addSafeAreaInsets(result);
  721. populateParameters(result);
  722. } };
  723. var showActionSheet = {
  724. args: function args(fromArgs) {
  725. if (typeof fromArgs === 'object') {
  726. fromArgs.alertText = fromArgs.title;
  727. }
  728. } };
  729. var getAppBaseInfo = {
  730. returnValue: function returnValue(result) {var _result =
  731. result,version = _result.version,language = _result.language,SDKVersion = _result.SDKVersion,theme = _result.theme;
  732. var _hostName = getHostName(result);
  733. var hostLanguage = language.replace('_', '-');
  734. result = sortObject(Object.assign(result, {
  735. appId: "__UNI__2080341",
  736. appName: "扫码点餐",
  737. appVersion: "1.0.8",
  738. appVersionCode: "108",
  739. appLanguage: getAppLanguage(hostLanguage),
  740. hostVersion: version,
  741. hostLanguage: hostLanguage,
  742. hostName: _hostName,
  743. hostSDKVersion: SDKVersion,
  744. hostTheme: theme }));
  745. } };
  746. var getDeviceInfo = {
  747. returnValue: function returnValue(result) {var _result2 =
  748. result,brand = _result2.brand,model = _result2.model;
  749. var deviceType = getGetDeviceType(result, model);
  750. var deviceBrand = getDeviceBrand(brand);
  751. useDeviceId(result);
  752. result = sortObject(Object.assign(result, {
  753. deviceType: deviceType,
  754. deviceBrand: deviceBrand,
  755. deviceModel: model }));
  756. } };
  757. var getWindowInfo = {
  758. returnValue: function returnValue(result) {
  759. addSafeAreaInsets(result);
  760. result = sortObject(Object.assign(result, {
  761. windowTop: 0,
  762. windowBottom: 0 }));
  763. } };
  764. var getAppAuthorizeSetting = {
  765. returnValue: function returnValue(result) {var
  766. locationReducedAccuracy = result.locationReducedAccuracy;
  767. result.locationAccuracy = 'unsupported';
  768. if (locationReducedAccuracy === true) {
  769. result.locationAccuracy = 'reduced';
  770. } else if (locationReducedAccuracy === false) {
  771. result.locationAccuracy = 'full';
  772. }
  773. } };
  774. // import navigateTo from 'uni-helpers/navigate-to'
  775. var protocols = {
  776. redirectTo: redirectTo,
  777. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  778. previewImage: previewImage,
  779. getSystemInfo: getSystemInfo,
  780. getSystemInfoSync: getSystemInfo,
  781. showActionSheet: showActionSheet,
  782. getAppBaseInfo: getAppBaseInfo,
  783. getDeviceInfo: getDeviceInfo,
  784. getWindowInfo: getWindowInfo,
  785. getAppAuthorizeSetting: getAppAuthorizeSetting };
  786. var todos = [
  787. 'vibrate',
  788. 'preloadPage',
  789. 'unPreloadPage',
  790. 'loadSubPackage'];
  791. var canIUses = [];
  792. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  793. function processCallback(methodName, method, returnValue) {
  794. return function (res) {
  795. return method(processReturnValue(methodName, res, returnValue));
  796. };
  797. }
  798. 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;
  799. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  800. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  801. if (isFn(argsOption)) {
  802. argsOption = argsOption(fromArgs, toArgs) || {};
  803. }
  804. for (var key in fromArgs) {
  805. if (hasOwn(argsOption, key)) {
  806. var keyOption = argsOption[key];
  807. if (isFn(keyOption)) {
  808. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  809. }
  810. if (!keyOption) {// 不支持的参数
  811. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  812. } else if (isStr(keyOption)) {// 重写参数 key
  813. toArgs[keyOption] = fromArgs[key];
  814. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  815. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  816. }
  817. } else if (CALLBACKS.indexOf(key) !== -1) {
  818. if (isFn(fromArgs[key])) {
  819. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  820. }
  821. } else {
  822. if (!keepFromArgs) {
  823. toArgs[key] = fromArgs[key];
  824. }
  825. }
  826. }
  827. return toArgs;
  828. } else if (isFn(fromArgs)) {
  829. fromArgs = processCallback(methodName, fromArgs, returnValue);
  830. }
  831. return fromArgs;
  832. }
  833. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  834. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  835. res = protocols.returnValue(methodName, res);
  836. }
  837. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  838. }
  839. function wrapper(methodName, method) {
  840. if (hasOwn(protocols, methodName)) {
  841. var protocol = protocols[methodName];
  842. if (!protocol) {// 暂不支持的 api
  843. return function () {
  844. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  845. };
  846. }
  847. return function (arg1, arg2) {// 目前 api 最多两个参数
  848. var options = protocol;
  849. if (isFn(protocol)) {
  850. options = protocol(arg1);
  851. }
  852. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  853. var args = [arg1];
  854. if (typeof arg2 !== 'undefined') {
  855. args.push(arg2);
  856. }
  857. if (isFn(options.name)) {
  858. methodName = options.name(arg1);
  859. } else if (isStr(options.name)) {
  860. methodName = options.name;
  861. }
  862. var returnValue = wx[methodName].apply(wx, args);
  863. if (isSyncApi(methodName)) {// 同步 api
  864. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  865. }
  866. return returnValue;
  867. };
  868. }
  869. return method;
  870. }
  871. var todoApis = Object.create(null);
  872. var TODOS = [
  873. 'onTabBarMidButtonTap',
  874. 'subscribePush',
  875. 'unsubscribePush',
  876. 'onPush',
  877. 'offPush',
  878. 'share'];
  879. function createTodoApi(name) {
  880. return function todoApi(_ref)
  881. {var fail = _ref.fail,complete = _ref.complete;
  882. var res = {
  883. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported") };
  884. isFn(fail) && fail(res);
  885. isFn(complete) && complete(res);
  886. };
  887. }
  888. TODOS.forEach(function (name) {
  889. todoApis[name] = createTodoApi(name);
  890. });
  891. var providers = {
  892. oauth: ['weixin'],
  893. share: ['weixin'],
  894. payment: ['wxpay'],
  895. push: ['weixin'] };
  896. function getProvider(_ref2)
  897. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  898. var res = false;
  899. if (providers[service]) {
  900. res = {
  901. errMsg: 'getProvider:ok',
  902. service: service,
  903. provider: providers[service] };
  904. isFn(success) && success(res);
  905. } else {
  906. res = {
  907. errMsg: 'getProvider:fail service not found' };
  908. isFn(fail) && fail(res);
  909. }
  910. isFn(complete) && complete(res);
  911. }
  912. var extraApi = /*#__PURE__*/Object.freeze({
  913. __proto__: null,
  914. getProvider: getProvider });
  915. var getEmitter = function () {
  916. var Emitter;
  917. return function getUniEmitter() {
  918. if (!Emitter) {
  919. Emitter = new _vue.default();
  920. }
  921. return Emitter;
  922. };
  923. }();
  924. function apply(ctx, method, args) {
  925. return ctx[method].apply(ctx, args);
  926. }
  927. function $on() {
  928. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  929. }
  930. function $off() {
  931. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  932. }
  933. function $once() {
  934. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  935. }
  936. function $emit() {
  937. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  938. }
  939. var eventApi = /*#__PURE__*/Object.freeze({
  940. __proto__: null,
  941. $on: $on,
  942. $off: $off,
  943. $once: $once,
  944. $emit: $emit });
  945. /**
  946. * 框架内 try-catch
  947. */
  948. /**
  949. * 开发者 try-catch
  950. */
  951. function tryCatch(fn) {
  952. return function () {
  953. try {
  954. return fn.apply(fn, arguments);
  955. } catch (e) {
  956. // TODO
  957. console.error(e);
  958. }
  959. };
  960. }
  961. function getApiCallbacks(params) {
  962. var apiCallbacks = {};
  963. for (var name in params) {
  964. var param = params[name];
  965. if (isFn(param)) {
  966. apiCallbacks[name] = tryCatch(param);
  967. delete params[name];
  968. }
  969. }
  970. return apiCallbacks;
  971. }
  972. var cid;
  973. var cidErrMsg;
  974. var enabled;
  975. function normalizePushMessage(message) {
  976. try {
  977. return JSON.parse(message);
  978. } catch (e) {}
  979. return message;
  980. }
  981. function invokePushCallback(
  982. args)
  983. {
  984. if (args.type === 'enabled') {
  985. enabled = true;
  986. } else if (args.type === 'clientId') {
  987. cid = args.cid;
  988. cidErrMsg = args.errMsg;
  989. invokeGetPushCidCallbacks(cid, args.errMsg);
  990. } else if (args.type === 'pushMsg') {
  991. var message = {
  992. type: 'receive',
  993. data: normalizePushMessage(args.message) };
  994. for (var i = 0; i < onPushMessageCallbacks.length; i++) {
  995. var callback = onPushMessageCallbacks[i];
  996. callback(message);
  997. // 该消息已被阻止
  998. if (message.stopped) {
  999. break;
  1000. }
  1001. }
  1002. } else if (args.type === 'click') {
  1003. onPushMessageCallbacks.forEach(function (callback) {
  1004. callback({
  1005. type: 'click',
  1006. data: normalizePushMessage(args.message) });
  1007. });
  1008. }
  1009. }
  1010. var getPushCidCallbacks = [];
  1011. function invokeGetPushCidCallbacks(cid, errMsg) {
  1012. getPushCidCallbacks.forEach(function (callback) {
  1013. callback(cid, errMsg);
  1014. });
  1015. getPushCidCallbacks.length = 0;
  1016. }
  1017. function getPushClientId(args) {
  1018. if (!isPlainObject(args)) {
  1019. args = {};
  1020. }var _getApiCallbacks =
  1021. getApiCallbacks(args),success = _getApiCallbacks.success,fail = _getApiCallbacks.fail,complete = _getApiCallbacks.complete;
  1022. var hasSuccess = isFn(success);
  1023. var hasFail = isFn(fail);
  1024. var hasComplete = isFn(complete);
  1025. Promise.resolve().then(function () {
  1026. if (typeof enabled === 'undefined') {
  1027. enabled = false;
  1028. cid = '';
  1029. cidErrMsg = 'uniPush is not enabled';
  1030. }
  1031. getPushCidCallbacks.push(function (cid, errMsg) {
  1032. var res;
  1033. if (cid) {
  1034. res = {
  1035. errMsg: 'getPushClientId:ok',
  1036. cid: cid };
  1037. hasSuccess && success(res);
  1038. } else {
  1039. res = {
  1040. errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '') };
  1041. hasFail && fail(res);
  1042. }
  1043. hasComplete && complete(res);
  1044. });
  1045. if (typeof cid !== 'undefined') {
  1046. invokeGetPushCidCallbacks(cid, cidErrMsg);
  1047. }
  1048. });
  1049. }
  1050. var onPushMessageCallbacks = [];
  1051. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  1052. var onPushMessage = function onPushMessage(fn) {
  1053. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  1054. onPushMessageCallbacks.push(fn);
  1055. }
  1056. };
  1057. var offPushMessage = function offPushMessage(fn) {
  1058. if (!fn) {
  1059. onPushMessageCallbacks.length = 0;
  1060. } else {
  1061. var index = onPushMessageCallbacks.indexOf(fn);
  1062. if (index > -1) {
  1063. onPushMessageCallbacks.splice(index, 1);
  1064. }
  1065. }
  1066. };
  1067. var api = /*#__PURE__*/Object.freeze({
  1068. __proto__: null,
  1069. getPushClientId: getPushClientId,
  1070. onPushMessage: onPushMessage,
  1071. offPushMessage: offPushMessage,
  1072. invokePushCallback: invokePushCallback });
  1073. var MPPage = Page;
  1074. var MPComponent = Component;
  1075. var customizeRE = /:/g;
  1076. var customize = cached(function (str) {
  1077. return camelize(str.replace(customizeRE, '-'));
  1078. });
  1079. function initTriggerEvent(mpInstance) {
  1080. var oldTriggerEvent = mpInstance.triggerEvent;
  1081. 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];}
  1082. // 事件名统一转驼峰格式,仅处理:当前组件为 vue 组件、当前组件为 vue 组件子组件
  1083. if (this.$vm || this.dataset && this.dataset.comType) {
  1084. event = customize(event);
  1085. } else {
  1086. // 针对微信/QQ小程序单独补充驼峰格式事件,以兼容历史项目
  1087. var newEvent = customize(event);
  1088. if (newEvent !== event) {
  1089. oldTriggerEvent.apply(this, [newEvent].concat(args));
  1090. }
  1091. }
  1092. return oldTriggerEvent.apply(this, [event].concat(args));
  1093. };
  1094. try {
  1095. // 京东小程序 triggerEvent 为只读
  1096. mpInstance.triggerEvent = newTriggerEvent;
  1097. } catch (error) {
  1098. mpInstance._triggerEvent = newTriggerEvent;
  1099. }
  1100. }
  1101. function initHook(name, options, isComponent) {
  1102. var oldHook = options[name];
  1103. if (!oldHook) {
  1104. options[name] = function () {
  1105. initTriggerEvent(this);
  1106. };
  1107. } else {
  1108. options[name] = function () {
  1109. initTriggerEvent(this);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}
  1110. return oldHook.apply(this, args);
  1111. };
  1112. }
  1113. }
  1114. if (!MPPage.__$wrappered) {
  1115. MPPage.__$wrappered = true;
  1116. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1117. initHook('onLoad', options);
  1118. return MPPage(options);
  1119. };
  1120. Page.after = MPPage.after;
  1121. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1122. initHook('created', options);
  1123. return MPComponent(options);
  1124. };
  1125. }
  1126. var PAGE_EVENT_HOOKS = [
  1127. 'onPullDownRefresh',
  1128. 'onReachBottom',
  1129. 'onAddToFavorites',
  1130. 'onShareTimeline',
  1131. 'onShareAppMessage',
  1132. 'onPageScroll',
  1133. 'onResize',
  1134. 'onTabItemTap'];
  1135. function initMocks(vm, mocks) {
  1136. var mpInstance = vm.$mp[vm.mpType];
  1137. mocks.forEach(function (mock) {
  1138. if (hasOwn(mpInstance, mock)) {
  1139. vm[mock] = mpInstance[mock];
  1140. }
  1141. });
  1142. }
  1143. function hasHook(hook, vueOptions) {
  1144. if (!vueOptions) {
  1145. return true;
  1146. }
  1147. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  1148. return true;
  1149. }
  1150. vueOptions = vueOptions.default || vueOptions;
  1151. if (isFn(vueOptions)) {
  1152. if (isFn(vueOptions.extendOptions[hook])) {
  1153. return true;
  1154. }
  1155. if (vueOptions.super &&
  1156. vueOptions.super.options &&
  1157. Array.isArray(vueOptions.super.options[hook])) {
  1158. return true;
  1159. }
  1160. return false;
  1161. }
  1162. if (isFn(vueOptions[hook])) {
  1163. return true;
  1164. }
  1165. var mixins = vueOptions.mixins;
  1166. if (Array.isArray(mixins)) {
  1167. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  1168. }
  1169. }
  1170. function initHooks(mpOptions, hooks, vueOptions) {
  1171. hooks.forEach(function (hook) {
  1172. if (hasHook(hook, vueOptions)) {
  1173. mpOptions[hook] = function (args) {
  1174. return this.$vm && this.$vm.__call_hook(hook, args);
  1175. };
  1176. }
  1177. });
  1178. }
  1179. function initUnknownHooks(mpOptions, vueOptions) {var excludes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  1180. findHooks(vueOptions).forEach(function (hook) {return initHook$1(mpOptions, hook, excludes);});
  1181. }
  1182. function findHooks(vueOptions) {var hooks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  1183. if (vueOptions) {
  1184. Object.keys(vueOptions).forEach(function (name) {
  1185. if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
  1186. hooks.push(name);
  1187. }
  1188. });
  1189. }
  1190. return hooks;
  1191. }
  1192. function initHook$1(mpOptions, hook, excludes) {
  1193. if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
  1194. mpOptions[hook] = function (args) {
  1195. return this.$vm && this.$vm.__call_hook(hook, args);
  1196. };
  1197. }
  1198. }
  1199. function initVueComponent(Vue, vueOptions) {
  1200. vueOptions = vueOptions.default || vueOptions;
  1201. var VueComponent;
  1202. if (isFn(vueOptions)) {
  1203. VueComponent = vueOptions;
  1204. } else {
  1205. VueComponent = Vue.extend(vueOptions);
  1206. }
  1207. vueOptions = VueComponent.options;
  1208. return [VueComponent, vueOptions];
  1209. }
  1210. function initSlots(vm, vueSlots) {
  1211. if (Array.isArray(vueSlots) && vueSlots.length) {
  1212. var $slots = Object.create(null);
  1213. vueSlots.forEach(function (slotName) {
  1214. $slots[slotName] = true;
  1215. });
  1216. vm.$scopedSlots = vm.$slots = $slots;
  1217. }
  1218. }
  1219. function initVueIds(vueIds, mpInstance) {
  1220. vueIds = (vueIds || '').split(',');
  1221. var len = vueIds.length;
  1222. if (len === 1) {
  1223. mpInstance._$vueId = vueIds[0];
  1224. } else if (len === 2) {
  1225. mpInstance._$vueId = vueIds[0];
  1226. mpInstance._$vuePid = vueIds[1];
  1227. }
  1228. }
  1229. function initData(vueOptions, context) {
  1230. var data = vueOptions.data || {};
  1231. var methods = vueOptions.methods || {};
  1232. if (typeof data === 'function') {
  1233. try {
  1234. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  1235. } catch (e) {
  1236. if (Object({"VUE_APP_NAME":"扫码点餐","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  1237. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  1238. }
  1239. }
  1240. } else {
  1241. try {
  1242. // 对 data 格式化
  1243. data = JSON.parse(JSON.stringify(data));
  1244. } catch (e) {}
  1245. }
  1246. if (!isPlainObject(data)) {
  1247. data = {};
  1248. }
  1249. Object.keys(methods).forEach(function (methodName) {
  1250. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  1251. data[methodName] = methods[methodName];
  1252. }
  1253. });
  1254. return data;
  1255. }
  1256. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  1257. function createObserver(name) {
  1258. return function observer(newVal, oldVal) {
  1259. if (this.$vm) {
  1260. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  1261. }
  1262. };
  1263. }
  1264. function initBehaviors(vueOptions, initBehavior) {
  1265. var vueBehaviors = vueOptions.behaviors;
  1266. var vueExtends = vueOptions.extends;
  1267. var vueMixins = vueOptions.mixins;
  1268. var vueProps = vueOptions.props;
  1269. if (!vueProps) {
  1270. vueOptions.props = vueProps = [];
  1271. }
  1272. var behaviors = [];
  1273. if (Array.isArray(vueBehaviors)) {
  1274. vueBehaviors.forEach(function (behavior) {
  1275. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  1276. if (behavior === 'uni://form-field') {
  1277. if (Array.isArray(vueProps)) {
  1278. vueProps.push('name');
  1279. vueProps.push('value');
  1280. } else {
  1281. vueProps.name = {
  1282. type: String,
  1283. default: '' };
  1284. vueProps.value = {
  1285. type: [String, Number, Boolean, Array, Object, Date],
  1286. default: '' };
  1287. }
  1288. }
  1289. });
  1290. }
  1291. if (isPlainObject(vueExtends) && vueExtends.props) {
  1292. behaviors.push(
  1293. initBehavior({
  1294. properties: initProperties(vueExtends.props, true) }));
  1295. }
  1296. if (Array.isArray(vueMixins)) {
  1297. vueMixins.forEach(function (vueMixin) {
  1298. if (isPlainObject(vueMixin) && vueMixin.props) {
  1299. behaviors.push(
  1300. initBehavior({
  1301. properties: initProperties(vueMixin.props, true) }));
  1302. }
  1303. });
  1304. }
  1305. return behaviors;
  1306. }
  1307. function parsePropType(key, type, defaultValue, file) {
  1308. // [String]=>String
  1309. if (Array.isArray(type) && type.length === 1) {
  1310. return type[0];
  1311. }
  1312. return type;
  1313. }
  1314. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';var options = arguments.length > 3 ? arguments[3] : undefined;
  1315. var properties = {};
  1316. if (!isBehavior) {
  1317. properties.vueId = {
  1318. type: String,
  1319. value: '' };
  1320. {
  1321. if (options.virtualHost) {
  1322. properties.virtualHostStyle = {
  1323. type: null,
  1324. value: '' };
  1325. properties.virtualHostClass = {
  1326. type: null,
  1327. value: '' };
  1328. }
  1329. }
  1330. // scopedSlotsCompiler auto
  1331. properties.scopedSlotsCompiler = {
  1332. type: String,
  1333. value: '' };
  1334. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  1335. type: null,
  1336. value: [],
  1337. observer: function observer(newVal, oldVal) {
  1338. var $slots = Object.create(null);
  1339. newVal.forEach(function (slotName) {
  1340. $slots[slotName] = true;
  1341. });
  1342. this.setData({
  1343. $slots: $slots });
  1344. } };
  1345. }
  1346. if (Array.isArray(props)) {// ['title']
  1347. props.forEach(function (key) {
  1348. properties[key] = {
  1349. type: null,
  1350. observer: createObserver(key) };
  1351. });
  1352. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  1353. Object.keys(props).forEach(function (key) {
  1354. var opts = props[key];
  1355. if (isPlainObject(opts)) {// title:{type:String,default:''}
  1356. var value = opts.default;
  1357. if (isFn(value)) {
  1358. value = value();
  1359. }
  1360. opts.type = parsePropType(key, opts.type);
  1361. properties[key] = {
  1362. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  1363. value: value,
  1364. observer: createObserver(key) };
  1365. } else {// content:String
  1366. var type = parsePropType(key, opts);
  1367. properties[key] = {
  1368. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  1369. observer: createObserver(key) };
  1370. }
  1371. });
  1372. }
  1373. return properties;
  1374. }
  1375. function wrapper$1(event) {
  1376. // TODO 又得兼容 mpvue 的 mp 对象
  1377. try {
  1378. event.mp = JSON.parse(JSON.stringify(event));
  1379. } catch (e) {}
  1380. event.stopPropagation = noop;
  1381. event.preventDefault = noop;
  1382. event.target = event.target || {};
  1383. if (!hasOwn(event, 'detail')) {
  1384. event.detail = {};
  1385. }
  1386. if (hasOwn(event, 'markerId')) {
  1387. event.detail = typeof event.detail === 'object' ? event.detail : {};
  1388. event.detail.markerId = event.markerId;
  1389. }
  1390. if (isPlainObject(event.detail)) {
  1391. event.target = Object.assign({}, event.target, event.detail);
  1392. }
  1393. return event;
  1394. }
  1395. function getExtraValue(vm, dataPathsArray) {
  1396. var context = vm;
  1397. dataPathsArray.forEach(function (dataPathArray) {
  1398. var dataPath = dataPathArray[0];
  1399. var value = dataPathArray[2];
  1400. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  1401. var propPath = dataPathArray[1];
  1402. var valuePath = dataPathArray[3];
  1403. var vFor;
  1404. if (Number.isInteger(dataPath)) {
  1405. vFor = dataPath;
  1406. } else if (!dataPath) {
  1407. vFor = context;
  1408. } else if (typeof dataPath === 'string' && dataPath) {
  1409. if (dataPath.indexOf('#s#') === 0) {
  1410. vFor = dataPath.substr(3);
  1411. } else {
  1412. vFor = vm.__get_value(dataPath, context);
  1413. }
  1414. }
  1415. if (Number.isInteger(vFor)) {
  1416. context = value;
  1417. } else if (!propPath) {
  1418. context = vFor[value];
  1419. } else {
  1420. if (Array.isArray(vFor)) {
  1421. context = vFor.find(function (vForItem) {
  1422. return vm.__get_value(propPath, vForItem) === value;
  1423. });
  1424. } else if (isPlainObject(vFor)) {
  1425. context = Object.keys(vFor).find(function (vForKey) {
  1426. return vm.__get_value(propPath, vFor[vForKey]) === value;
  1427. });
  1428. } else {
  1429. console.error('v-for 暂不支持循环数据:', vFor);
  1430. }
  1431. }
  1432. if (valuePath) {
  1433. context = vm.__get_value(valuePath, context);
  1434. }
  1435. }
  1436. });
  1437. return context;
  1438. }
  1439. function processEventExtra(vm, extra, event, __args__) {
  1440. var extraObj = {};
  1441. if (Array.isArray(extra) && extra.length) {
  1442. /**
  1443. *[
  1444. * ['data.items', 'data.id', item.data.id],
  1445. * ['metas', 'id', meta.id]
  1446. *],
  1447. *[
  1448. * ['data.items', 'data.id', item.data.id],
  1449. * ['metas', 'id', meta.id]
  1450. *],
  1451. *'test'
  1452. */
  1453. extra.forEach(function (dataPath, index) {
  1454. if (typeof dataPath === 'string') {
  1455. if (!dataPath) {// model,prop.sync
  1456. extraObj['$' + index] = vm;
  1457. } else {
  1458. if (dataPath === '$event') {// $event
  1459. extraObj['$' + index] = event;
  1460. } else if (dataPath === 'arguments') {
  1461. extraObj['$' + index] = event.detail ? event.detail.__args__ || __args__ : __args__;
  1462. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  1463. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  1464. } else {
  1465. extraObj['$' + index] = vm.__get_value(dataPath);
  1466. }
  1467. }
  1468. } else {
  1469. extraObj['$' + index] = getExtraValue(vm, dataPath);
  1470. }
  1471. });
  1472. }
  1473. return extraObj;
  1474. }
  1475. function getObjByArray(arr) {
  1476. var obj = {};
  1477. for (var i = 1; i < arr.length; i++) {
  1478. var element = arr[i];
  1479. obj[element[0]] = element[1];
  1480. }
  1481. return obj;
  1482. }
  1483. 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;
  1484. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1485. // fixed 用户直接触发 mpInstance.triggerEvent
  1486. var __args__ = isPlainObject(event.detail) ?
  1487. event.detail.__args__ || [event.detail] :
  1488. [event.detail];
  1489. if (isCustom) {// 自定义事件
  1490. isCustomMPEvent = event.currentTarget &&
  1491. event.currentTarget.dataset &&
  1492. event.currentTarget.dataset.comType === 'wx';
  1493. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  1494. if (isCustomMPEvent) {
  1495. return [event];
  1496. }
  1497. return __args__;
  1498. }
  1499. }
  1500. var extraObj = processEventExtra(vm, extra, event, __args__);
  1501. var ret = [];
  1502. args.forEach(function (arg) {
  1503. if (arg === '$event') {
  1504. if (methodName === '__set_model' && !isCustom) {// input v-model value
  1505. ret.push(event.target.value);
  1506. } else {
  1507. if (isCustom && !isCustomMPEvent) {
  1508. ret.push(__args__[0]);
  1509. } else {// wxcomponent 组件或内置组件
  1510. ret.push(event);
  1511. }
  1512. }
  1513. } else {
  1514. if (Array.isArray(arg) && arg[0] === 'o') {
  1515. ret.push(getObjByArray(arg));
  1516. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1517. ret.push(extraObj[arg]);
  1518. } else {
  1519. ret.push(arg);
  1520. }
  1521. }
  1522. });
  1523. return ret;
  1524. }
  1525. var ONCE = '~';
  1526. var CUSTOM = '^';
  1527. function isMatchEventType(eventType, optType) {
  1528. return eventType === optType ||
  1529. optType === 'regionchange' && (
  1530. eventType === 'begin' ||
  1531. eventType === 'end');
  1532. }
  1533. function getContextVm(vm) {
  1534. var $parent = vm.$parent;
  1535. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1536. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1537. $parent = $parent.$parent;
  1538. }
  1539. return $parent && $parent.$parent;
  1540. }
  1541. function handleEvent(event) {var _this2 = this;
  1542. event = wrapper$1(event);
  1543. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1544. var dataset = (event.currentTarget || event.target).dataset;
  1545. if (!dataset) {
  1546. return console.warn('事件信息不存在');
  1547. }
  1548. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1549. if (!eventOpts) {
  1550. return console.warn('事件信息不存在');
  1551. }
  1552. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1553. var eventType = event.type;
  1554. var ret = [];
  1555. eventOpts.forEach(function (eventOpt) {
  1556. var type = eventOpt[0];
  1557. var eventsArray = eventOpt[1];
  1558. var isCustom = type.charAt(0) === CUSTOM;
  1559. type = isCustom ? type.slice(1) : type;
  1560. var isOnce = type.charAt(0) === ONCE;
  1561. type = isOnce ? type.slice(1) : type;
  1562. if (eventsArray && isMatchEventType(eventType, type)) {
  1563. eventsArray.forEach(function (eventArray) {
  1564. var methodName = eventArray[0];
  1565. if (methodName) {
  1566. var handlerCtx = _this2.$vm;
  1567. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1568. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1569. }
  1570. if (methodName === '$emit') {
  1571. handlerCtx.$emit.apply(handlerCtx,
  1572. processEventArgs(
  1573. _this2.$vm,
  1574. event,
  1575. eventArray[1],
  1576. eventArray[2],
  1577. isCustom,
  1578. methodName));
  1579. return;
  1580. }
  1581. var handler = handlerCtx[methodName];
  1582. if (!isFn(handler)) {
  1583. var _type = _this2.$vm.mpType === 'page' ? 'Page' : 'Component';
  1584. var path = _this2.route || _this2.is;
  1585. throw new Error("".concat(_type, " \"").concat(path, "\" does not have a method \"").concat(methodName, "\""));
  1586. }
  1587. if (isOnce) {
  1588. if (handler.once) {
  1589. return;
  1590. }
  1591. handler.once = true;
  1592. }
  1593. var params = processEventArgs(
  1594. _this2.$vm,
  1595. event,
  1596. eventArray[1],
  1597. eventArray[2],
  1598. isCustom,
  1599. methodName);
  1600. params = Array.isArray(params) ? params : [];
  1601. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1602. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1603. // eslint-disable-next-line no-sparse-arrays
  1604. params = params.concat([,,,,,,,,,, event]);
  1605. }
  1606. ret.push(handler.apply(handlerCtx, params));
  1607. }
  1608. });
  1609. }
  1610. });
  1611. if (
  1612. eventType === 'input' &&
  1613. ret.length === 1 &&
  1614. typeof ret[0] !== 'undefined')
  1615. {
  1616. return ret[0];
  1617. }
  1618. }
  1619. var eventChannels = {};
  1620. var eventChannelStack = [];
  1621. function getEventChannel(id) {
  1622. if (id) {
  1623. var eventChannel = eventChannels[id];
  1624. delete eventChannels[id];
  1625. return eventChannel;
  1626. }
  1627. return eventChannelStack.shift();
  1628. }
  1629. var hooks = [
  1630. 'onShow',
  1631. 'onHide',
  1632. 'onError',
  1633. 'onPageNotFound',
  1634. 'onThemeChange',
  1635. 'onUnhandledRejection'];
  1636. function initEventChannel() {
  1637. _vue.default.prototype.getOpenerEventChannel = function () {
  1638. // 微信小程序使用自身getOpenerEventChannel
  1639. {
  1640. return this.$scope.getOpenerEventChannel();
  1641. }
  1642. };
  1643. var callHook = _vue.default.prototype.__call_hook;
  1644. _vue.default.prototype.__call_hook = function (hook, args) {
  1645. if (hook === 'onLoad' && args && args.__id__) {
  1646. this.__eventChannel__ = getEventChannel(args.__id__);
  1647. delete args.__id__;
  1648. }
  1649. return callHook.call(this, hook, args);
  1650. };
  1651. }
  1652. function initScopedSlotsParams() {
  1653. var center = {};
  1654. var parents = {};
  1655. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1656. var has = center[vueId];
  1657. if (!has) {
  1658. parents[vueId] = this;
  1659. this.$on('hook:destroyed', function () {
  1660. delete parents[vueId];
  1661. });
  1662. }
  1663. return has;
  1664. };
  1665. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1666. var data = center[vueId];
  1667. if (data) {
  1668. var object = data[name] || {};
  1669. return key ? object[key] : object;
  1670. } else {
  1671. parents[vueId] = this;
  1672. this.$on('hook:destroyed', function () {
  1673. delete parents[vueId];
  1674. });
  1675. }
  1676. };
  1677. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1678. var vueIds = this.$options.propsData.vueId;
  1679. if (vueIds) {
  1680. var vueId = vueIds.split(',')[0];
  1681. var object = center[vueId] = center[vueId] || {};
  1682. object[name] = value;
  1683. if (parents[vueId]) {
  1684. parents[vueId].$forceUpdate();
  1685. }
  1686. }
  1687. };
  1688. _vue.default.mixin({
  1689. destroyed: function destroyed() {
  1690. var propsData = this.$options.propsData;
  1691. var vueId = propsData && propsData.vueId;
  1692. if (vueId) {
  1693. delete center[vueId];
  1694. delete parents[vueId];
  1695. }
  1696. } });
  1697. }
  1698. function parseBaseApp(vm, _ref3)
  1699. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1700. initEventChannel();
  1701. {
  1702. initScopedSlotsParams();
  1703. }
  1704. if (vm.$options.store) {
  1705. _vue.default.prototype.$store = vm.$options.store;
  1706. }
  1707. uniIdMixin(_vue.default);
  1708. _vue.default.prototype.mpHost = "mp-weixin";
  1709. _vue.default.mixin({
  1710. beforeCreate: function beforeCreate() {
  1711. if (!this.$options.mpType) {
  1712. return;
  1713. }
  1714. this.mpType = this.$options.mpType;
  1715. this.$mp = _defineProperty({
  1716. data: {} },
  1717. this.mpType, this.$options.mpInstance);
  1718. this.$scope = this.$options.mpInstance;
  1719. delete this.$options.mpType;
  1720. delete this.$options.mpInstance;
  1721. if (this.mpType === 'page' && typeof getApp === 'function') {// hack vue-i18n
  1722. var app = getApp();
  1723. if (app.$vm && app.$vm.$i18n) {
  1724. this._i18n = app.$vm.$i18n;
  1725. }
  1726. }
  1727. if (this.mpType !== 'app') {
  1728. initRefs(this);
  1729. initMocks(this, mocks);
  1730. }
  1731. } });
  1732. var appOptions = {
  1733. onLaunch: function onLaunch(args) {
  1734. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1735. return;
  1736. }
  1737. {
  1738. if (wx.canIUse && !wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1739. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1740. }
  1741. }
  1742. this.$vm = vm;
  1743. this.$vm.$mp = {
  1744. app: this };
  1745. this.$vm.$scope = this;
  1746. // vm 上也挂载 globalData
  1747. this.$vm.globalData = this.globalData;
  1748. this.$vm._isMounted = true;
  1749. this.$vm.__call_hook('mounted', args);
  1750. this.$vm.__call_hook('onLaunch', args);
  1751. } };
  1752. // 兼容旧版本 globalData
  1753. appOptions.globalData = vm.$options.globalData || {};
  1754. // 将 methods 中的方法挂在 getApp() 中
  1755. var methods = vm.$options.methods;
  1756. if (methods) {
  1757. Object.keys(methods).forEach(function (name) {
  1758. appOptions[name] = methods[name];
  1759. });
  1760. }
  1761. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  1762. initHooks(appOptions, hooks);
  1763. initUnknownHooks(appOptions, vm.$options);
  1764. return appOptions;
  1765. }
  1766. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1767. function findVmByVueId(vm, vuePid) {
  1768. var $children = vm.$children;
  1769. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1770. for (var i = $children.length - 1; i >= 0; i--) {
  1771. var childVm = $children[i];
  1772. if (childVm.$scope._$vueId === vuePid) {
  1773. return childVm;
  1774. }
  1775. }
  1776. // 反向递归查找
  1777. var parentVm;
  1778. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1779. parentVm = findVmByVueId($children[_i], vuePid);
  1780. if (parentVm) {
  1781. return parentVm;
  1782. }
  1783. }
  1784. }
  1785. function initBehavior(options) {
  1786. return Behavior(options);
  1787. }
  1788. function isPage() {
  1789. return !!this.route;
  1790. }
  1791. function initRelation(detail) {
  1792. this.triggerEvent('__l', detail);
  1793. }
  1794. function selectAllComponents(mpInstance, selector, $refs) {
  1795. var components = mpInstance.selectAllComponents(selector);
  1796. components.forEach(function (component) {
  1797. var ref = component.dataset.ref;
  1798. $refs[ref] = component.$vm || component;
  1799. {
  1800. if (component.dataset.vueGeneric === 'scoped') {
  1801. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1802. selectAllComponents(scopedComponent, selector, $refs);
  1803. });
  1804. }
  1805. }
  1806. });
  1807. }
  1808. function initRefs(vm) {
  1809. var mpInstance = vm.$scope;
  1810. Object.defineProperty(vm, '$refs', {
  1811. get: function get() {
  1812. var $refs = {};
  1813. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1814. // TODO 暂不考虑 for 中的 scoped
  1815. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1816. forComponents.forEach(function (component) {
  1817. var ref = component.dataset.ref;
  1818. if (!$refs[ref]) {
  1819. $refs[ref] = [];
  1820. }
  1821. $refs[ref].push(component.$vm || component);
  1822. });
  1823. return $refs;
  1824. } });
  1825. }
  1826. function handleLink(event) {var _ref4 =
  1827. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1828. var parentVm;
  1829. if (vuePid) {
  1830. parentVm = findVmByVueId(this.$vm, vuePid);
  1831. }
  1832. if (!parentVm) {
  1833. parentVm = this.$vm;
  1834. }
  1835. vueOptions.parent = parentVm;
  1836. }
  1837. function parseApp(vm) {
  1838. return parseBaseApp(vm, {
  1839. mocks: mocks,
  1840. initRefs: initRefs });
  1841. }
  1842. function createApp(vm) {
  1843. App(parseApp(vm));
  1844. return vm;
  1845. }
  1846. var encodeReserveRE = /[!'()*]/g;
  1847. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  1848. var commaRE = /%2C/g;
  1849. // fixed encodeURIComponent which is more conformant to RFC3986:
  1850. // - escapes [!'()*]
  1851. // - preserve commas
  1852. var encode = function encode(str) {return encodeURIComponent(str).
  1853. replace(encodeReserveRE, encodeReserveReplacer).
  1854. replace(commaRE, ',');};
  1855. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  1856. var res = obj ? Object.keys(obj).map(function (key) {
  1857. var val = obj[key];
  1858. if (val === undefined) {
  1859. return '';
  1860. }
  1861. if (val === null) {
  1862. return encodeStr(key);
  1863. }
  1864. if (Array.isArray(val)) {
  1865. var result = [];
  1866. val.forEach(function (val2) {
  1867. if (val2 === undefined) {
  1868. return;
  1869. }
  1870. if (val2 === null) {
  1871. result.push(encodeStr(key));
  1872. } else {
  1873. result.push(encodeStr(key) + '=' + encodeStr(val2));
  1874. }
  1875. });
  1876. return result.join('&');
  1877. }
  1878. return encodeStr(key) + '=' + encodeStr(val);
  1879. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  1880. return res ? "?".concat(res) : '';
  1881. }
  1882. function parseBaseComponent(vueComponentOptions)
  1883. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1884. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1885. var options = _objectSpread({
  1886. multipleSlots: true,
  1887. addGlobalClass: true },
  1888. vueOptions.options || {});
  1889. {
  1890. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1891. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1892. Object.assign(options, vueOptions['mp-weixin'].options);
  1893. }
  1894. }
  1895. var componentOptions = {
  1896. options: options,
  1897. data: initData(vueOptions, _vue.default.prototype),
  1898. behaviors: initBehaviors(vueOptions, initBehavior),
  1899. properties: initProperties(vueOptions.props, false, vueOptions.__file, options),
  1900. lifetimes: {
  1901. attached: function attached() {
  1902. var properties = this.properties;
  1903. var options = {
  1904. mpType: isPage.call(this) ? 'page' : 'component',
  1905. mpInstance: this,
  1906. propsData: properties };
  1907. initVueIds(properties.vueId, this);
  1908. // 处理父子关系
  1909. initRelation.call(this, {
  1910. vuePid: this._$vuePid,
  1911. vueOptions: options });
  1912. // 初始化 vue 实例
  1913. this.$vm = new VueComponent(options);
  1914. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1915. initSlots(this.$vm, properties.vueSlots);
  1916. // 触发首次 setData
  1917. this.$vm.$mount();
  1918. },
  1919. ready: function ready() {
  1920. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1921. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1922. if (this.$vm) {
  1923. this.$vm._isMounted = true;
  1924. this.$vm.__call_hook('mounted');
  1925. this.$vm.__call_hook('onReady');
  1926. }
  1927. },
  1928. detached: function detached() {
  1929. this.$vm && this.$vm.$destroy();
  1930. } },
  1931. pageLifetimes: {
  1932. show: function show(args) {
  1933. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1934. },
  1935. hide: function hide() {
  1936. this.$vm && this.$vm.__call_hook('onPageHide');
  1937. },
  1938. resize: function resize(size) {
  1939. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1940. } },
  1941. methods: {
  1942. __l: handleLink,
  1943. __e: handleEvent } };
  1944. // externalClasses
  1945. if (vueOptions.externalClasses) {
  1946. componentOptions.externalClasses = vueOptions.externalClasses;
  1947. }
  1948. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1949. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1950. componentOptions.methods[callMethod] = function (args) {
  1951. return this.$vm[callMethod](args);
  1952. };
  1953. });
  1954. }
  1955. if (isPage) {
  1956. return componentOptions;
  1957. }
  1958. return [componentOptions, VueComponent];
  1959. }
  1960. function parseComponent(vueComponentOptions) {
  1961. return parseBaseComponent(vueComponentOptions, {
  1962. isPage: isPage,
  1963. initRelation: initRelation });
  1964. }
  1965. var hooks$1 = [
  1966. 'onShow',
  1967. 'onHide',
  1968. 'onUnload'];
  1969. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1970. function parseBasePage(vuePageOptions, _ref6)
  1971. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1972. var pageOptions = parseComponent(vuePageOptions);
  1973. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1974. pageOptions.methods.onLoad = function (query) {
  1975. this.options = query;
  1976. var copyQuery = Object.assign({}, query);
  1977. delete copyQuery.__id__;
  1978. this.$page = {
  1979. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery) };
  1980. this.$vm.$mp.query = query; // 兼容 mpvue
  1981. this.$vm.__call_hook('onLoad', query);
  1982. };
  1983. initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']);
  1984. return pageOptions;
  1985. }
  1986. function parsePage(vuePageOptions) {
  1987. return parseBasePage(vuePageOptions, {
  1988. isPage: isPage,
  1989. initRelation: initRelation });
  1990. }
  1991. function createPage(vuePageOptions) {
  1992. {
  1993. return Component(parsePage(vuePageOptions));
  1994. }
  1995. }
  1996. function createComponent(vueOptions) {
  1997. {
  1998. return Component(parseComponent(vueOptions));
  1999. }
  2000. }
  2001. function createSubpackageApp(vm) {
  2002. var appOptions = parseApp(vm);
  2003. var app = getApp({
  2004. allowDefault: true });
  2005. vm.$scope = app;
  2006. var globalData = app.globalData;
  2007. if (globalData) {
  2008. Object.keys(appOptions.globalData).forEach(function (name) {
  2009. if (!hasOwn(globalData, name)) {
  2010. globalData[name] = appOptions.globalData[name];
  2011. }
  2012. });
  2013. }
  2014. Object.keys(appOptions).forEach(function (name) {
  2015. if (!hasOwn(app, name)) {
  2016. app[name] = appOptions[name];
  2017. }
  2018. });
  2019. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2020. wx.onAppShow(function () {for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  2021. vm.__call_hook('onShow', args);
  2022. });
  2023. }
  2024. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2025. wx.onAppHide(function () {for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {args[_key6] = arguments[_key6];}
  2026. vm.__call_hook('onHide', args);
  2027. });
  2028. }
  2029. if (isFn(appOptions.onLaunch)) {
  2030. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2031. vm.__call_hook('onLaunch', args);
  2032. }
  2033. return vm;
  2034. }
  2035. function createPlugin(vm) {
  2036. var appOptions = parseApp(vm);
  2037. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2038. wx.onAppShow(function () {for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {args[_key7] = arguments[_key7];}
  2039. vm.__call_hook('onShow', args);
  2040. });
  2041. }
  2042. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2043. wx.onAppHide(function () {for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {args[_key8] = arguments[_key8];}
  2044. vm.__call_hook('onHide', args);
  2045. });
  2046. }
  2047. if (isFn(appOptions.onLaunch)) {
  2048. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2049. vm.__call_hook('onLaunch', args);
  2050. }
  2051. return vm;
  2052. }
  2053. todos.forEach(function (todoApi) {
  2054. protocols[todoApi] = false;
  2055. });
  2056. canIUses.forEach(function (canIUseApi) {
  2057. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  2058. canIUseApi;
  2059. if (!wx.canIUse(apiName)) {
  2060. protocols[canIUseApi] = false;
  2061. }
  2062. });
  2063. var uni = {};
  2064. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  2065. uni = new Proxy({}, {
  2066. get: function get(target, name) {
  2067. if (hasOwn(target, name)) {
  2068. return target[name];
  2069. }
  2070. if (baseApi[name]) {
  2071. return baseApi[name];
  2072. }
  2073. if (api[name]) {
  2074. return promisify(name, api[name]);
  2075. }
  2076. {
  2077. if (extraApi[name]) {
  2078. return promisify(name, extraApi[name]);
  2079. }
  2080. if (todoApis[name]) {
  2081. return promisify(name, todoApis[name]);
  2082. }
  2083. }
  2084. if (eventApi[name]) {
  2085. return eventApi[name];
  2086. }
  2087. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  2088. return;
  2089. }
  2090. return promisify(name, wrapper(name, wx[name]));
  2091. },
  2092. set: function set(target, name, value) {
  2093. target[name] = value;
  2094. return true;
  2095. } });
  2096. } else {
  2097. Object.keys(baseApi).forEach(function (name) {
  2098. uni[name] = baseApi[name];
  2099. });
  2100. {
  2101. Object.keys(todoApis).forEach(function (name) {
  2102. uni[name] = promisify(name, todoApis[name]);
  2103. });
  2104. Object.keys(extraApi).forEach(function (name) {
  2105. uni[name] = promisify(name, todoApis[name]);
  2106. });
  2107. }
  2108. Object.keys(eventApi).forEach(function (name) {
  2109. uni[name] = eventApi[name];
  2110. });
  2111. Object.keys(api).forEach(function (name) {
  2112. uni[name] = promisify(name, api[name]);
  2113. });
  2114. Object.keys(wx).forEach(function (name) {
  2115. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  2116. uni[name] = promisify(name, wrapper(name, wx[name]));
  2117. }
  2118. });
  2119. }
  2120. wx.createApp = createApp;
  2121. wx.createPage = createPage;
  2122. wx.createComponent = createComponent;
  2123. wx.createSubpackageApp = createSubpackageApp;
  2124. wx.createPlugin = createPlugin;
  2125. var uni$1 = uni;var _default =
  2126. uni$1;exports.default = _default;
  2127. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  2128. /***/ }),
  2129. /***/ 11:
  2130. /*!**********************************************************************************************************!*\
  2131. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  2132. \**********************************************************************************************************/
  2133. /*! exports provided: default */
  2134. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2135. "use strict";
  2136. __webpack_require__.r(__webpack_exports__);
  2137. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  2138. /* globals __VUE_SSR_CONTEXT__ */
  2139. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  2140. // This module is a runtime utility for cleaner component module output and will
  2141. // be included in the final webpack user bundle.
  2142. function normalizeComponent (
  2143. scriptExports,
  2144. render,
  2145. staticRenderFns,
  2146. functionalTemplate,
  2147. injectStyles,
  2148. scopeId,
  2149. moduleIdentifier, /* server only */
  2150. shadowMode, /* vue-cli only */
  2151. components, // fixed by xxxxxx auto components
  2152. renderjs // fixed by xxxxxx renderjs
  2153. ) {
  2154. // Vue.extend constructor export interop
  2155. var options = typeof scriptExports === 'function'
  2156. ? scriptExports.options
  2157. : scriptExports
  2158. // fixed by xxxxxx auto components
  2159. if (components) {
  2160. if (!options.components) {
  2161. options.components = {}
  2162. }
  2163. var hasOwn = Object.prototype.hasOwnProperty
  2164. for (var name in components) {
  2165. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  2166. options.components[name] = components[name]
  2167. }
  2168. }
  2169. }
  2170. // fixed by xxxxxx renderjs
  2171. if (renderjs) {
  2172. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  2173. this[renderjs.__module] = this
  2174. });
  2175. (options.mixins || (options.mixins = [])).push(renderjs)
  2176. }
  2177. // render functions
  2178. if (render) {
  2179. options.render = render
  2180. options.staticRenderFns = staticRenderFns
  2181. options._compiled = true
  2182. }
  2183. // functional template
  2184. if (functionalTemplate) {
  2185. options.functional = true
  2186. }
  2187. // scopedId
  2188. if (scopeId) {
  2189. options._scopeId = 'data-v-' + scopeId
  2190. }
  2191. var hook
  2192. if (moduleIdentifier) { // server build
  2193. hook = function (context) {
  2194. // 2.3 injection
  2195. context =
  2196. context || // cached call
  2197. (this.$vnode && this.$vnode.ssrContext) || // stateful
  2198. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  2199. // 2.2 with runInNewContext: true
  2200. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  2201. context = __VUE_SSR_CONTEXT__
  2202. }
  2203. // inject component styles
  2204. if (injectStyles) {
  2205. injectStyles.call(this, context)
  2206. }
  2207. // register component module identifier for async chunk inferrence
  2208. if (context && context._registeredComponents) {
  2209. context._registeredComponents.add(moduleIdentifier)
  2210. }
  2211. }
  2212. // used by ssr in case component is cached and beforeCreate
  2213. // never gets called
  2214. options._ssrRegister = hook
  2215. } else if (injectStyles) {
  2216. hook = shadowMode
  2217. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  2218. : injectStyles
  2219. }
  2220. if (hook) {
  2221. if (options.functional) {
  2222. // for template-only hot-reload because in that case the render fn doesn't
  2223. // go through the normalizer
  2224. options._injectStyles = hook
  2225. // register for functioal component in vue file
  2226. var originalRender = options.render
  2227. options.render = function renderWithStyleInjection (h, context) {
  2228. hook.call(context)
  2229. return originalRender(h, context)
  2230. }
  2231. } else {
  2232. // inject component registration as beforeCreate hook
  2233. var existing = options.beforeCreate
  2234. options.beforeCreate = existing
  2235. ? [].concat(existing, hook)
  2236. : [hook]
  2237. }
  2238. }
  2239. return {
  2240. exports: scriptExports,
  2241. options: options
  2242. }
  2243. }
  2244. /***/ }),
  2245. /***/ 12:
  2246. /*!*************************************************!*\
  2247. !*** D:/wxproject/项目模板/uniapp/common/config.js ***!
  2248. \*************************************************/
  2249. /*! no static exports found */
  2250. /***/ (function(module, exports, __webpack_require__) {
  2251. "use strict";
  2252. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  2253. // 接口地址
  2254. serverUrl: "https://broadcast.waityou24.cn",
  2255. wechatUrl: "https://broadcast.waityou24.cn",
  2256. // 设备信息
  2257. system: uni.getSystemInfoSync(),
  2258. // 节目类型
  2259. pro_type: [//
  2260. {
  2261. dict_label: '电视节目',
  2262. dict_value: '0' },
  2263. {
  2264. dict_label: '电影节目',
  2265. dict_value: '1' }] };exports.default = _default;
  2266. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  2267. /***/ }),
  2268. /***/ 13:
  2269. /*!**********************************************!*\
  2270. !*** D:/wxproject/项目模板/uniapp/common/api.js ***!
  2271. \**********************************************/
  2272. /*! no static exports found */
  2273. /***/ (function(module, exports, __webpack_require__) {
  2274. "use strict";
  2275. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.requestFile = exports.requestBase = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 14));var _config = _interopRequireDefault(__webpack_require__(/*! ../common/config */ 12));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);});};}
  2276. var getDomain = function getDomain(uri, type) {var
  2277. serverUrl =
  2278. _config.default.serverUrl,wechatUrl = _config.default.wechatUrl;
  2279. // 自定义
  2280. if (uri.includes("http")) return uri;
  2281. // 微信
  2282. if (uri.startsWith("/wechat/api")) return wechatUrl + uri;
  2283. // 地址前缀
  2284. else if (type) return serverUrl + "/projectadmin/".concat(type, "/api/") + uri;
  2285. // 常规
  2286. return serverUrl + "/projectadmin/api/" + uri;
  2287. };
  2288. // 常规请求
  2289. var requestBase = /*#__PURE__*/function () {var _ref = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee(uri) {var method,data,type,baseUrl,header,token,_args = arguments;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:method = _args.length > 1 && _args[1] !== undefined ? _args[1] : "GET";data = _args.length > 2 ? _args[2] : undefined;type = _args.length > 3 ? _args[3] : undefined;
  2290. // 请求地址
  2291. baseUrl = getDomain(uri, type);
  2292. // 请求头
  2293. header = {};
  2294. // 用户信息
  2295. token = "";
  2296. if (token) header.token = token;return _context.abrupt("return",
  2297. new Promise(function (resolve, reject) {
  2298. uni.request({
  2299. url: baseUrl,
  2300. method: method,
  2301. data: data,
  2302. header: header,
  2303. success: function success(res) {return toResolve(resolve, res);},
  2304. fail: function fail(err) {
  2305. console.log(err);
  2306. } });
  2307. }));case 8:case "end":return _context.stop();}}}, _callee);}));return function requestBase(_x) {return _ref.apply(this, arguments);};}();
  2308. // 图片请求
  2309. exports.requestBase = requestBase;var requestFile = function requestFile(uri, method, data, type) {
  2310. // 请求地址
  2311. var baseUrl = getDomain(uri, type);
  2312. return new Promise(function (resolve, reject) {
  2313. uni.uploadFile({
  2314. url: "https://broadcast.waityou24.cn/".concat(uri),
  2315. filePath: data,
  2316. name: 'file',
  2317. formData: {},
  2318. success: function success(res) {return toResolve(resolve, res);},
  2319. error: function error(e) {return toReject(reject, e);} });
  2320. });
  2321. };exports.requestFile = requestFile;
  2322. var toResolve = function toResolve(resolve, result) {
  2323. if (result.statusCode === 200) resolve(result.data);
  2324. };
  2325. var toReject = function toReject(reject, result) {
  2326. reject(result);
  2327. };
  2328. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  2329. /***/ }),
  2330. /***/ 14:
  2331. /*!**********************************************************!*\
  2332. !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
  2333. \**********************************************************/
  2334. /*! no static exports found */
  2335. /***/ (function(module, exports, __webpack_require__) {
  2336. module.exports = __webpack_require__(/*! regenerator-runtime */ 15);
  2337. /***/ }),
  2338. /***/ 15:
  2339. /*!************************************************************!*\
  2340. !*** ./node_modules/regenerator-runtime/runtime-module.js ***!
  2341. \************************************************************/
  2342. /*! no static exports found */
  2343. /***/ (function(module, exports, __webpack_require__) {
  2344. /**
  2345. * Copyright (c) 2014-present, Facebook, Inc.
  2346. *
  2347. * This source code is licensed under the MIT license found in the
  2348. * LICENSE file in the root directory of this source tree.
  2349. */
  2350. // This method of obtaining a reference to the global object needs to be
  2351. // kept identical to the way it is obtained in runtime.js
  2352. var g = (function() {
  2353. return this || (typeof self === "object" && self);
  2354. })() || Function("return this")();
  2355. // Use `getOwnPropertyNames` because not all browsers support calling
  2356. // `hasOwnProperty` on the global `self` object in a worker. See #183.
  2357. var hadRuntime = g.regeneratorRuntime &&
  2358. Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
  2359. // Save the old regeneratorRuntime in case it needs to be restored later.
  2360. var oldRuntime = hadRuntime && g.regeneratorRuntime;
  2361. // Force reevalutation of runtime.js.
  2362. g.regeneratorRuntime = undefined;
  2363. module.exports = __webpack_require__(/*! ./runtime */ 16);
  2364. if (hadRuntime) {
  2365. // Restore the original runtime.
  2366. g.regeneratorRuntime = oldRuntime;
  2367. } else {
  2368. // Remove the global property added by runtime.js.
  2369. try {
  2370. delete g.regeneratorRuntime;
  2371. } catch(e) {
  2372. g.regeneratorRuntime = undefined;
  2373. }
  2374. }
  2375. /***/ }),
  2376. /***/ 16:
  2377. /*!*****************************************************!*\
  2378. !*** ./node_modules/regenerator-runtime/runtime.js ***!
  2379. \*****************************************************/
  2380. /*! no static exports found */
  2381. /***/ (function(module, exports) {
  2382. /**
  2383. * Copyright (c) 2014-present, Facebook, Inc.
  2384. *
  2385. * This source code is licensed under the MIT license found in the
  2386. * LICENSE file in the root directory of this source tree.
  2387. */
  2388. !(function(global) {
  2389. "use strict";
  2390. var Op = Object.prototype;
  2391. var hasOwn = Op.hasOwnProperty;
  2392. var undefined; // More compressible than void 0.
  2393. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  2394. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  2395. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  2396. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  2397. var inModule = typeof module === "object";
  2398. var runtime = global.regeneratorRuntime;
  2399. if (runtime) {
  2400. if (inModule) {
  2401. // If regeneratorRuntime is defined globally and we're in a module,
  2402. // make the exports object identical to regeneratorRuntime.
  2403. module.exports = runtime;
  2404. }
  2405. // Don't bother evaluating the rest of this file if the runtime was
  2406. // already defined globally.
  2407. return;
  2408. }
  2409. // Define the runtime globally (as expected by generated code) as either
  2410. // module.exports (if we're in a module) or a new, empty object.
  2411. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  2412. function wrap(innerFn, outerFn, self, tryLocsList) {
  2413. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  2414. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  2415. var generator = Object.create(protoGenerator.prototype);
  2416. var context = new Context(tryLocsList || []);
  2417. // The ._invoke method unifies the implementations of the .next,
  2418. // .throw, and .return methods.
  2419. generator._invoke = makeInvokeMethod(innerFn, self, context);
  2420. return generator;
  2421. }
  2422. runtime.wrap = wrap;
  2423. // Try/catch helper to minimize deoptimizations. Returns a completion
  2424. // record like context.tryEntries[i].completion. This interface could
  2425. // have been (and was previously) designed to take a closure to be
  2426. // invoked without arguments, but in all the cases we care about we
  2427. // already have an existing method we want to call, so there's no need
  2428. // to create a new function object. We can even get away with assuming
  2429. // the method takes exactly one argument, since that happens to be true
  2430. // in every case, so we don't have to touch the arguments object. The
  2431. // only additional allocation required is the completion record, which
  2432. // has a stable shape and so hopefully should be cheap to allocate.
  2433. function tryCatch(fn, obj, arg) {
  2434. try {
  2435. return { type: "normal", arg: fn.call(obj, arg) };
  2436. } catch (err) {
  2437. return { type: "throw", arg: err };
  2438. }
  2439. }
  2440. var GenStateSuspendedStart = "suspendedStart";
  2441. var GenStateSuspendedYield = "suspendedYield";
  2442. var GenStateExecuting = "executing";
  2443. var GenStateCompleted = "completed";
  2444. // Returning this object from the innerFn has the same effect as
  2445. // breaking out of the dispatch switch statement.
  2446. var ContinueSentinel = {};
  2447. // Dummy constructor functions that we use as the .constructor and
  2448. // .constructor.prototype properties for functions that return Generator
  2449. // objects. For full spec compliance, you may wish to configure your
  2450. // minifier not to mangle the names of these two functions.
  2451. function Generator() {}
  2452. function GeneratorFunction() {}
  2453. function GeneratorFunctionPrototype() {}
  2454. // This is a polyfill for %IteratorPrototype% for environments that
  2455. // don't natively support it.
  2456. var IteratorPrototype = {};
  2457. IteratorPrototype[iteratorSymbol] = function () {
  2458. return this;
  2459. };
  2460. var getProto = Object.getPrototypeOf;
  2461. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  2462. if (NativeIteratorPrototype &&
  2463. NativeIteratorPrototype !== Op &&
  2464. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  2465. // This environment has a native %IteratorPrototype%; use it instead
  2466. // of the polyfill.
  2467. IteratorPrototype = NativeIteratorPrototype;
  2468. }
  2469. var Gp = GeneratorFunctionPrototype.prototype =
  2470. Generator.prototype = Object.create(IteratorPrototype);
  2471. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  2472. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  2473. GeneratorFunctionPrototype[toStringTagSymbol] =
  2474. GeneratorFunction.displayName = "GeneratorFunction";
  2475. // Helper for defining the .next, .throw, and .return methods of the
  2476. // Iterator interface in terms of a single ._invoke method.
  2477. function defineIteratorMethods(prototype) {
  2478. ["next", "throw", "return"].forEach(function(method) {
  2479. prototype[method] = function(arg) {
  2480. return this._invoke(method, arg);
  2481. };
  2482. });
  2483. }
  2484. runtime.isGeneratorFunction = function(genFun) {
  2485. var ctor = typeof genFun === "function" && genFun.constructor;
  2486. return ctor
  2487. ? ctor === GeneratorFunction ||
  2488. // For the native GeneratorFunction constructor, the best we can
  2489. // do is to check its .name property.
  2490. (ctor.displayName || ctor.name) === "GeneratorFunction"
  2491. : false;
  2492. };
  2493. runtime.mark = function(genFun) {
  2494. if (Object.setPrototypeOf) {
  2495. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  2496. } else {
  2497. genFun.__proto__ = GeneratorFunctionPrototype;
  2498. if (!(toStringTagSymbol in genFun)) {
  2499. genFun[toStringTagSymbol] = "GeneratorFunction";
  2500. }
  2501. }
  2502. genFun.prototype = Object.create(Gp);
  2503. return genFun;
  2504. };
  2505. // Within the body of any async function, `await x` is transformed to
  2506. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  2507. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  2508. // meant to be awaited.
  2509. runtime.awrap = function(arg) {
  2510. return { __await: arg };
  2511. };
  2512. function AsyncIterator(generator) {
  2513. function invoke(method, arg, resolve, reject) {
  2514. var record = tryCatch(generator[method], generator, arg);
  2515. if (record.type === "throw") {
  2516. reject(record.arg);
  2517. } else {
  2518. var result = record.arg;
  2519. var value = result.value;
  2520. if (value &&
  2521. typeof value === "object" &&
  2522. hasOwn.call(value, "__await")) {
  2523. return Promise.resolve(value.__await).then(function(value) {
  2524. invoke("next", value, resolve, reject);
  2525. }, function(err) {
  2526. invoke("throw", err, resolve, reject);
  2527. });
  2528. }
  2529. return Promise.resolve(value).then(function(unwrapped) {
  2530. // When a yielded Promise is resolved, its final value becomes
  2531. // the .value of the Promise<{value,done}> result for the
  2532. // current iteration.
  2533. result.value = unwrapped;
  2534. resolve(result);
  2535. }, function(error) {
  2536. // If a rejected Promise was yielded, throw the rejection back
  2537. // into the async generator function so it can be handled there.
  2538. return invoke("throw", error, resolve, reject);
  2539. });
  2540. }
  2541. }
  2542. var previousPromise;
  2543. function enqueue(method, arg) {
  2544. function callInvokeWithMethodAndArg() {
  2545. return new Promise(function(resolve, reject) {
  2546. invoke(method, arg, resolve, reject);
  2547. });
  2548. }
  2549. return previousPromise =
  2550. // If enqueue has been called before, then we want to wait until
  2551. // all previous Promises have been resolved before calling invoke,
  2552. // so that results are always delivered in the correct order. If
  2553. // enqueue has not been called before, then it is important to
  2554. // call invoke immediately, without waiting on a callback to fire,
  2555. // so that the async generator function has the opportunity to do
  2556. // any necessary setup in a predictable way. This predictability
  2557. // is why the Promise constructor synchronously invokes its
  2558. // executor callback, and why async functions synchronously
  2559. // execute code before the first await. Since we implement simple
  2560. // async functions in terms of async generators, it is especially
  2561. // important to get this right, even though it requires care.
  2562. previousPromise ? previousPromise.then(
  2563. callInvokeWithMethodAndArg,
  2564. // Avoid propagating failures to Promises returned by later
  2565. // invocations of the iterator.
  2566. callInvokeWithMethodAndArg
  2567. ) : callInvokeWithMethodAndArg();
  2568. }
  2569. // Define the unified helper method that is used to implement .next,
  2570. // .throw, and .return (see defineIteratorMethods).
  2571. this._invoke = enqueue;
  2572. }
  2573. defineIteratorMethods(AsyncIterator.prototype);
  2574. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  2575. return this;
  2576. };
  2577. runtime.AsyncIterator = AsyncIterator;
  2578. // Note that simple async functions are implemented on top of
  2579. // AsyncIterator objects; they just return a Promise for the value of
  2580. // the final result produced by the iterator.
  2581. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  2582. var iter = new AsyncIterator(
  2583. wrap(innerFn, outerFn, self, tryLocsList)
  2584. );
  2585. return runtime.isGeneratorFunction(outerFn)
  2586. ? iter // If outerFn is a generator, return the full iterator.
  2587. : iter.next().then(function(result) {
  2588. return result.done ? result.value : iter.next();
  2589. });
  2590. };
  2591. function makeInvokeMethod(innerFn, self, context) {
  2592. var state = GenStateSuspendedStart;
  2593. return function invoke(method, arg) {
  2594. if (state === GenStateExecuting) {
  2595. throw new Error("Generator is already running");
  2596. }
  2597. if (state === GenStateCompleted) {
  2598. if (method === "throw") {
  2599. throw arg;
  2600. }
  2601. // Be forgiving, per 25.3.3.3.3 of the spec:
  2602. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  2603. return doneResult();
  2604. }
  2605. context.method = method;
  2606. context.arg = arg;
  2607. while (true) {
  2608. var delegate = context.delegate;
  2609. if (delegate) {
  2610. var delegateResult = maybeInvokeDelegate(delegate, context);
  2611. if (delegateResult) {
  2612. if (delegateResult === ContinueSentinel) continue;
  2613. return delegateResult;
  2614. }
  2615. }
  2616. if (context.method === "next") {
  2617. // Setting context._sent for legacy support of Babel's
  2618. // function.sent implementation.
  2619. context.sent = context._sent = context.arg;
  2620. } else if (context.method === "throw") {
  2621. if (state === GenStateSuspendedStart) {
  2622. state = GenStateCompleted;
  2623. throw context.arg;
  2624. }
  2625. context.dispatchException(context.arg);
  2626. } else if (context.method === "return") {
  2627. context.abrupt("return", context.arg);
  2628. }
  2629. state = GenStateExecuting;
  2630. var record = tryCatch(innerFn, self, context);
  2631. if (record.type === "normal") {
  2632. // If an exception is thrown from innerFn, we leave state ===
  2633. // GenStateExecuting and loop back for another invocation.
  2634. state = context.done
  2635. ? GenStateCompleted
  2636. : GenStateSuspendedYield;
  2637. if (record.arg === ContinueSentinel) {
  2638. continue;
  2639. }
  2640. return {
  2641. value: record.arg,
  2642. done: context.done
  2643. };
  2644. } else if (record.type === "throw") {
  2645. state = GenStateCompleted;
  2646. // Dispatch the exception by looping back around to the
  2647. // context.dispatchException(context.arg) call above.
  2648. context.method = "throw";
  2649. context.arg = record.arg;
  2650. }
  2651. }
  2652. };
  2653. }
  2654. // Call delegate.iterator[context.method](context.arg) and handle the
  2655. // result, either by returning a { value, done } result from the
  2656. // delegate iterator, or by modifying context.method and context.arg,
  2657. // setting context.delegate to null, and returning the ContinueSentinel.
  2658. function maybeInvokeDelegate(delegate, context) {
  2659. var method = delegate.iterator[context.method];
  2660. if (method === undefined) {
  2661. // A .throw or .return when the delegate iterator has no .throw
  2662. // method always terminates the yield* loop.
  2663. context.delegate = null;
  2664. if (context.method === "throw") {
  2665. if (delegate.iterator.return) {
  2666. // If the delegate iterator has a return method, give it a
  2667. // chance to clean up.
  2668. context.method = "return";
  2669. context.arg = undefined;
  2670. maybeInvokeDelegate(delegate, context);
  2671. if (context.method === "throw") {
  2672. // If maybeInvokeDelegate(context) changed context.method from
  2673. // "return" to "throw", let that override the TypeError below.
  2674. return ContinueSentinel;
  2675. }
  2676. }
  2677. context.method = "throw";
  2678. context.arg = new TypeError(
  2679. "The iterator does not provide a 'throw' method");
  2680. }
  2681. return ContinueSentinel;
  2682. }
  2683. var record = tryCatch(method, delegate.iterator, context.arg);
  2684. if (record.type === "throw") {
  2685. context.method = "throw";
  2686. context.arg = record.arg;
  2687. context.delegate = null;
  2688. return ContinueSentinel;
  2689. }
  2690. var info = record.arg;
  2691. if (! info) {
  2692. context.method = "throw";
  2693. context.arg = new TypeError("iterator result is not an object");
  2694. context.delegate = null;
  2695. return ContinueSentinel;
  2696. }
  2697. if (info.done) {
  2698. // Assign the result of the finished delegate to the temporary
  2699. // variable specified by delegate.resultName (see delegateYield).
  2700. context[delegate.resultName] = info.value;
  2701. // Resume execution at the desired location (see delegateYield).
  2702. context.next = delegate.nextLoc;
  2703. // If context.method was "throw" but the delegate handled the
  2704. // exception, let the outer generator proceed normally. If
  2705. // context.method was "next", forget context.arg since it has been
  2706. // "consumed" by the delegate iterator. If context.method was
  2707. // "return", allow the original .return call to continue in the
  2708. // outer generator.
  2709. if (context.method !== "return") {
  2710. context.method = "next";
  2711. context.arg = undefined;
  2712. }
  2713. } else {
  2714. // Re-yield the result returned by the delegate method.
  2715. return info;
  2716. }
  2717. // The delegate iterator is finished, so forget it and continue with
  2718. // the outer generator.
  2719. context.delegate = null;
  2720. return ContinueSentinel;
  2721. }
  2722. // Define Generator.prototype.{next,throw,return} in terms of the
  2723. // unified ._invoke helper method.
  2724. defineIteratorMethods(Gp);
  2725. Gp[toStringTagSymbol] = "Generator";
  2726. // A Generator should always return itself as the iterator object when the
  2727. // @@iterator function is called on it. Some browsers' implementations of the
  2728. // iterator prototype chain incorrectly implement this, causing the Generator
  2729. // object to not be returned from this call. This ensures that doesn't happen.
  2730. // See https://github.com/facebook/regenerator/issues/274 for more details.
  2731. Gp[iteratorSymbol] = function() {
  2732. return this;
  2733. };
  2734. Gp.toString = function() {
  2735. return "[object Generator]";
  2736. };
  2737. function pushTryEntry(locs) {
  2738. var entry = { tryLoc: locs[0] };
  2739. if (1 in locs) {
  2740. entry.catchLoc = locs[1];
  2741. }
  2742. if (2 in locs) {
  2743. entry.finallyLoc = locs[2];
  2744. entry.afterLoc = locs[3];
  2745. }
  2746. this.tryEntries.push(entry);
  2747. }
  2748. function resetTryEntry(entry) {
  2749. var record = entry.completion || {};
  2750. record.type = "normal";
  2751. delete record.arg;
  2752. entry.completion = record;
  2753. }
  2754. function Context(tryLocsList) {
  2755. // The root entry object (effectively a try statement without a catch
  2756. // or a finally block) gives us a place to store values thrown from
  2757. // locations where there is no enclosing try statement.
  2758. this.tryEntries = [{ tryLoc: "root" }];
  2759. tryLocsList.forEach(pushTryEntry, this);
  2760. this.reset(true);
  2761. }
  2762. runtime.keys = function(object) {
  2763. var keys = [];
  2764. for (var key in object) {
  2765. keys.push(key);
  2766. }
  2767. keys.reverse();
  2768. // Rather than returning an object with a next method, we keep
  2769. // things simple and return the next function itself.
  2770. return function next() {
  2771. while (keys.length) {
  2772. var key = keys.pop();
  2773. if (key in object) {
  2774. next.value = key;
  2775. next.done = false;
  2776. return next;
  2777. }
  2778. }
  2779. // To avoid creating an additional object, we just hang the .value
  2780. // and .done properties off the next function object itself. This
  2781. // also ensures that the minifier will not anonymize the function.
  2782. next.done = true;
  2783. return next;
  2784. };
  2785. };
  2786. function values(iterable) {
  2787. if (iterable) {
  2788. var iteratorMethod = iterable[iteratorSymbol];
  2789. if (iteratorMethod) {
  2790. return iteratorMethod.call(iterable);
  2791. }
  2792. if (typeof iterable.next === "function") {
  2793. return iterable;
  2794. }
  2795. if (!isNaN(iterable.length)) {
  2796. var i = -1, next = function next() {
  2797. while (++i < iterable.length) {
  2798. if (hasOwn.call(iterable, i)) {
  2799. next.value = iterable[i];
  2800. next.done = false;
  2801. return next;
  2802. }
  2803. }
  2804. next.value = undefined;
  2805. next.done = true;
  2806. return next;
  2807. };
  2808. return next.next = next;
  2809. }
  2810. }
  2811. // Return an iterator with no values.
  2812. return { next: doneResult };
  2813. }
  2814. runtime.values = values;
  2815. function doneResult() {
  2816. return { value: undefined, done: true };
  2817. }
  2818. Context.prototype = {
  2819. constructor: Context,
  2820. reset: function(skipTempReset) {
  2821. this.prev = 0;
  2822. this.next = 0;
  2823. // Resetting context._sent for legacy support of Babel's
  2824. // function.sent implementation.
  2825. this.sent = this._sent = undefined;
  2826. this.done = false;
  2827. this.delegate = null;
  2828. this.method = "next";
  2829. this.arg = undefined;
  2830. this.tryEntries.forEach(resetTryEntry);
  2831. if (!skipTempReset) {
  2832. for (var name in this) {
  2833. // Not sure about the optimal order of these conditions:
  2834. if (name.charAt(0) === "t" &&
  2835. hasOwn.call(this, name) &&
  2836. !isNaN(+name.slice(1))) {
  2837. this[name] = undefined;
  2838. }
  2839. }
  2840. }
  2841. },
  2842. stop: function() {
  2843. this.done = true;
  2844. var rootEntry = this.tryEntries[0];
  2845. var rootRecord = rootEntry.completion;
  2846. if (rootRecord.type === "throw") {
  2847. throw rootRecord.arg;
  2848. }
  2849. return this.rval;
  2850. },
  2851. dispatchException: function(exception) {
  2852. if (this.done) {
  2853. throw exception;
  2854. }
  2855. var context = this;
  2856. function handle(loc, caught) {
  2857. record.type = "throw";
  2858. record.arg = exception;
  2859. context.next = loc;
  2860. if (caught) {
  2861. // If the dispatched exception was caught by a catch block,
  2862. // then let that catch block handle the exception normally.
  2863. context.method = "next";
  2864. context.arg = undefined;
  2865. }
  2866. return !! caught;
  2867. }
  2868. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  2869. var entry = this.tryEntries[i];
  2870. var record = entry.completion;
  2871. if (entry.tryLoc === "root") {
  2872. // Exception thrown outside of any try block that could handle
  2873. // it, so set the completion value of the entire function to
  2874. // throw the exception.
  2875. return handle("end");
  2876. }
  2877. if (entry.tryLoc <= this.prev) {
  2878. var hasCatch = hasOwn.call(entry, "catchLoc");
  2879. var hasFinally = hasOwn.call(entry, "finallyLoc");
  2880. if (hasCatch && hasFinally) {
  2881. if (this.prev < entry.catchLoc) {
  2882. return handle(entry.catchLoc, true);
  2883. } else if (this.prev < entry.finallyLoc) {
  2884. return handle(entry.finallyLoc);
  2885. }
  2886. } else if (hasCatch) {
  2887. if (this.prev < entry.catchLoc) {
  2888. return handle(entry.catchLoc, true);
  2889. }
  2890. } else if (hasFinally) {
  2891. if (this.prev < entry.finallyLoc) {
  2892. return handle(entry.finallyLoc);
  2893. }
  2894. } else {
  2895. throw new Error("try statement without catch or finally");
  2896. }
  2897. }
  2898. }
  2899. },
  2900. abrupt: function(type, arg) {
  2901. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  2902. var entry = this.tryEntries[i];
  2903. if (entry.tryLoc <= this.prev &&
  2904. hasOwn.call(entry, "finallyLoc") &&
  2905. this.prev < entry.finallyLoc) {
  2906. var finallyEntry = entry;
  2907. break;
  2908. }
  2909. }
  2910. if (finallyEntry &&
  2911. (type === "break" ||
  2912. type === "continue") &&
  2913. finallyEntry.tryLoc <= arg &&
  2914. arg <= finallyEntry.finallyLoc) {
  2915. // Ignore the finally entry if control is not jumping to a
  2916. // location outside the try/catch block.
  2917. finallyEntry = null;
  2918. }
  2919. var record = finallyEntry ? finallyEntry.completion : {};
  2920. record.type = type;
  2921. record.arg = arg;
  2922. if (finallyEntry) {
  2923. this.method = "next";
  2924. this.next = finallyEntry.finallyLoc;
  2925. return ContinueSentinel;
  2926. }
  2927. return this.complete(record);
  2928. },
  2929. complete: function(record, afterLoc) {
  2930. if (record.type === "throw") {
  2931. throw record.arg;
  2932. }
  2933. if (record.type === "break" ||
  2934. record.type === "continue") {
  2935. this.next = record.arg;
  2936. } else if (record.type === "return") {
  2937. this.rval = this.arg = record.arg;
  2938. this.method = "return";
  2939. this.next = "end";
  2940. } else if (record.type === "normal" && afterLoc) {
  2941. this.next = afterLoc;
  2942. }
  2943. return ContinueSentinel;
  2944. },
  2945. finish: function(finallyLoc) {
  2946. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  2947. var entry = this.tryEntries[i];
  2948. if (entry.finallyLoc === finallyLoc) {
  2949. this.complete(entry.completion, entry.afterLoc);
  2950. resetTryEntry(entry);
  2951. return ContinueSentinel;
  2952. }
  2953. }
  2954. },
  2955. "catch": function(tryLoc) {
  2956. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  2957. var entry = this.tryEntries[i];
  2958. if (entry.tryLoc === tryLoc) {
  2959. var record = entry.completion;
  2960. if (record.type === "throw") {
  2961. var thrown = record.arg;
  2962. resetTryEntry(entry);
  2963. }
  2964. return thrown;
  2965. }
  2966. }
  2967. // The context.catch method must only be called with a location
  2968. // argument that corresponds to a known catch block.
  2969. throw new Error("illegal catch attempt");
  2970. },
  2971. delegateYield: function(iterable, resultName, nextLoc) {
  2972. this.delegate = {
  2973. iterator: values(iterable),
  2974. resultName: resultName,
  2975. nextLoc: nextLoc
  2976. };
  2977. if (this.method === "next") {
  2978. // Deliberately forget the last sent value so that we don't
  2979. // accidentally pass it on to the delegate.
  2980. this.arg = undefined;
  2981. }
  2982. return ContinueSentinel;
  2983. }
  2984. };
  2985. })(
  2986. // In sloppy mode, unbound `this` refers to the global object, fallback to
  2987. // Function constructor if we're in global strict mode. That is sadly a form
  2988. // of indirect eval which violates Content Security Policy.
  2989. (function() {
  2990. return this || (typeof self === "object" && self);
  2991. })() || Function("return this")()
  2992. );
  2993. /***/ }),
  2994. /***/ 17:
  2995. /*!***************************************************!*\
  2996. !*** D:/wxproject/项目模板/uniapp/common/computed.js ***!
  2997. \***************************************************/
  2998. /*! no static exports found */
  2999. /***/ (function(module, exports, __webpack_require__) {
  3000. "use strict";
  3001. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 4));
  3002. var _decimal = _interopRequireDefault(__webpack_require__(/*! decimal.js */ 18));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  3003. var toNumber = function toNumber(num) {
  3004. return new _decimal.default(num).toNumber();
  3005. };
  3006. var plus = function plus() {var n1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;var n2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  3007. var number1 = new _decimal.default(n1);
  3008. var number2 = new _decimal.default(n2);
  3009. var result = number1.add(number2);
  3010. result = result.toFixed(2, _decimal.default.ROUND_DOWN);
  3011. return toNumber(result);
  3012. };
  3013. var minus = function minus() {var n1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;var n2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  3014. var number1 = new _decimal.default(n1);
  3015. var number2 = new _decimal.default(n2);
  3016. var result = number1.minus(number2);
  3017. result = result.toFixed(2, _decimal.default.ROUND_DOWN);
  3018. return toNumber(result);
  3019. };
  3020. var multiply = function multiply() {var n1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;var n2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  3021. var number1 = new _decimal.default(n1);
  3022. var number2 = new _decimal.default(n2);
  3023. var result = number1.mul(number2);
  3024. result = result.toFixed(2, _decimal.default.ROUND_DOWN);
  3025. return toNumber(result);
  3026. };
  3027. var divide = function divide() {var n1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;var n2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  3028. var number1 = new _decimal.default(n1);
  3029. var number2 = new _decimal.default(n2);
  3030. var result = number1.div(number2);
  3031. result = result.toFixed(2, _decimal.default.ROUND_DOWN);
  3032. return toNumber(result);
  3033. };
  3034. _vue.default.prototype.$plus = plus;
  3035. _vue.default.prototype.$minus = minus;
  3036. _vue.default.prototype.$multiply = multiply;
  3037. _vue.default.prototype.$divide = divide;
  3038. /***/ }),
  3039. /***/ 18:
  3040. /*!*******************************************************************!*\
  3041. !*** D:/wxproject/项目模板/uniapp/node_modules/decimal.js/decimal.js ***!
  3042. \*******************************************************************/
  3043. /*! no static exports found */
  3044. /***/ (function(module, exports, __webpack_require__) {
  3045. var __WEBPACK_AMD_DEFINE_RESULT__;;(function (globalScope) {
  3046. 'use strict';
  3047. /*!
  3048. * decimal.js v10.4.1
  3049. * An arbitrary-precision Decimal type for JavaScript.
  3050. * https://github.com/MikeMcl/decimal.js
  3051. * Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
  3052. * MIT Licence
  3053. */
  3054. // ----------------------------------- EDITABLE DEFAULTS ------------------------------------ //
  3055. // The maximum exponent magnitude.
  3056. // The limit on the value of `toExpNeg`, `toExpPos`, `minE` and `maxE`.
  3057. var EXP_LIMIT = 9e15, // 0 to 9e15
  3058. // The limit on the value of `precision`, and on the value of the first argument to
  3059. // `toDecimalPlaces`, `toExponential`, `toFixed`, `toPrecision` and `toSignificantDigits`.
  3060. MAX_DIGITS = 1e9, // 0 to 1e9
  3061. // Base conversion alphabet.
  3062. NUMERALS = '0123456789abcdef',
  3063. // The natural logarithm of 10 (1025 digits).
  3064. LN10 = '2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058',
  3065. // Pi (1025 digits).
  3066. PI = '3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789',
  3067. // The initial configuration properties of the Decimal constructor.
  3068. DEFAULTS = {
  3069. // These values must be integers within the stated ranges (inclusive).
  3070. // Most of these values can be changed at run-time using the `Decimal.config` method.
  3071. // The maximum number of significant digits of the result of a calculation or base conversion.
  3072. // E.g. `Decimal.config({ precision: 20 });`
  3073. precision: 20, // 1 to MAX_DIGITS
  3074. // The rounding mode used when rounding to `precision`.
  3075. //
  3076. // ROUND_UP 0 Away from zero.
  3077. // ROUND_DOWN 1 Towards zero.
  3078. // ROUND_CEIL 2 Towards +Infinity.
  3079. // ROUND_FLOOR 3 Towards -Infinity.
  3080. // ROUND_HALF_UP 4 Towards nearest neighbour. If equidistant, up.
  3081. // ROUND_HALF_DOWN 5 Towards nearest neighbour. If equidistant, down.
  3082. // ROUND_HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour.
  3083. // ROUND_HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity.
  3084. // ROUND_HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.
  3085. //
  3086. // E.g.
  3087. // `Decimal.rounding = 4;`
  3088. // `Decimal.rounding = Decimal.ROUND_HALF_UP;`
  3089. rounding: 4, // 0 to 8
  3090. // The modulo mode used when calculating the modulus: a mod n.
  3091. // The quotient (q = a / n) is calculated according to the corresponding rounding mode.
  3092. // The remainder (r) is calculated as: r = a - n * q.
  3093. //
  3094. // UP 0 The remainder is positive if the dividend is negative, else is negative.
  3095. // DOWN 1 The remainder has the same sign as the dividend (JavaScript %).
  3096. // FLOOR 3 The remainder has the same sign as the divisor (Python %).
  3097. // HALF_EVEN 6 The IEEE 754 remainder function.
  3098. // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). Always positive.
  3099. //
  3100. // Truncated division (1), floored division (3), the IEEE 754 remainder (6), and Euclidian
  3101. // division (9) are commonly used for the modulus operation. The other rounding modes can also
  3102. // be used, but they may not give useful results.
  3103. modulo: 1, // 0 to 9
  3104. // The exponent value at and beneath which `toString` returns exponential notation.
  3105. // JavaScript numbers: -7
  3106. toExpNeg: -7, // 0 to -EXP_LIMIT
  3107. // The exponent value at and above which `toString` returns exponential notation.
  3108. // JavaScript numbers: 21
  3109. toExpPos: 21, // 0 to EXP_LIMIT
  3110. // The minimum exponent value, beneath which underflow to zero occurs.
  3111. // JavaScript numbers: -324 (5e-324)
  3112. minE: -EXP_LIMIT, // -1 to -EXP_LIMIT
  3113. // The maximum exponent value, above which overflow to Infinity occurs.
  3114. // JavaScript numbers: 308 (1.7976931348623157e+308)
  3115. maxE: EXP_LIMIT, // 1 to EXP_LIMIT
  3116. // Whether to use cryptographically-secure random number generation, if available.
  3117. crypto: false // true/false
  3118. },
  3119. // ----------------------------------- END OF EDITABLE DEFAULTS ------------------------------- //
  3120. Decimal,inexact,noConflict,quadrant,
  3121. external = true,
  3122. decimalError = '[DecimalError] ',
  3123. invalidArgument = decimalError + 'Invalid argument: ',
  3124. precisionLimitExceeded = decimalError + 'Precision limit exceeded',
  3125. cryptoUnavailable = decimalError + 'crypto unavailable',
  3126. tag = '[object Decimal]',
  3127. mathfloor = Math.floor,
  3128. mathpow = Math.pow,
  3129. isBinary = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,
  3130. isHex = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,
  3131. isOctal = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,
  3132. isDecimal = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,
  3133. BASE = 1e7,
  3134. LOG_BASE = 7,
  3135. MAX_SAFE_INTEGER = 9007199254740991,
  3136. LN10_PRECISION = LN10.length - 1,
  3137. PI_PRECISION = PI.length - 1,
  3138. // Decimal.prototype object
  3139. P = { toStringTag: tag };
  3140. // Decimal prototype methods
  3141. /*
  3142. * absoluteValue abs
  3143. * ceil
  3144. * clampedTo clamp
  3145. * comparedTo cmp
  3146. * cosine cos
  3147. * cubeRoot cbrt
  3148. * decimalPlaces dp
  3149. * dividedBy div
  3150. * dividedToIntegerBy divToInt
  3151. * equals eq
  3152. * floor
  3153. * greaterThan gt
  3154. * greaterThanOrEqualTo gte
  3155. * hyperbolicCosine cosh
  3156. * hyperbolicSine sinh
  3157. * hyperbolicTangent tanh
  3158. * inverseCosine acos
  3159. * inverseHyperbolicCosine acosh
  3160. * inverseHyperbolicSine asinh
  3161. * inverseHyperbolicTangent atanh
  3162. * inverseSine asin
  3163. * inverseTangent atan
  3164. * isFinite
  3165. * isInteger isInt
  3166. * isNaN
  3167. * isNegative isNeg
  3168. * isPositive isPos
  3169. * isZero
  3170. * lessThan lt
  3171. * lessThanOrEqualTo lte
  3172. * logarithm log
  3173. * [maximum] [max]
  3174. * [minimum] [min]
  3175. * minus sub
  3176. * modulo mod
  3177. * naturalExponential exp
  3178. * naturalLogarithm ln
  3179. * negated neg
  3180. * plus add
  3181. * precision sd
  3182. * round
  3183. * sine sin
  3184. * squareRoot sqrt
  3185. * tangent tan
  3186. * times mul
  3187. * toBinary
  3188. * toDecimalPlaces toDP
  3189. * toExponential
  3190. * toFixed
  3191. * toFraction
  3192. * toHexadecimal toHex
  3193. * toNearest
  3194. * toNumber
  3195. * toOctal
  3196. * toPower pow
  3197. * toPrecision
  3198. * toSignificantDigits toSD
  3199. * toString
  3200. * truncated trunc
  3201. * valueOf toJSON
  3202. */
  3203. /*
  3204. * Return a new Decimal whose value is the absolute value of this Decimal.
  3205. *
  3206. */
  3207. P.absoluteValue = P.abs = function () {
  3208. var x = new this.constructor(this);
  3209. if (x.s < 0) x.s = 1;
  3210. return finalise(x);
  3211. };
  3212. /*
  3213. * Return a new Decimal whose value is the value of this Decimal rounded to a whole number in the
  3214. * direction of positive Infinity.
  3215. *
  3216. */
  3217. P.ceil = function () {
  3218. return finalise(new this.constructor(this), this.e + 1, 2);
  3219. };
  3220. /*
  3221. * Return a new Decimal whose value is the value of this Decimal clamped to the range
  3222. * delineated by `min` and `max`.
  3223. *
  3224. * min {number|string|Decimal}
  3225. * max {number|string|Decimal}
  3226. *
  3227. */
  3228. P.clampedTo = P.clamp = function (min, max) {
  3229. var k,
  3230. x = this,
  3231. Ctor = x.constructor;
  3232. min = new Ctor(min);
  3233. max = new Ctor(max);
  3234. if (!min.s || !max.s) return new Ctor(NaN);
  3235. if (min.gt(max)) throw Error(invalidArgument + max);
  3236. k = x.cmp(min);
  3237. return k < 0 ? min : x.cmp(max) > 0 ? max : new Ctor(x);
  3238. };
  3239. /*
  3240. * Return
  3241. * 1 if the value of this Decimal is greater than the value of `y`,
  3242. * -1 if the value of this Decimal is less than the value of `y`,
  3243. * 0 if they have the same value,
  3244. * NaN if the value of either Decimal is NaN.
  3245. *
  3246. */
  3247. P.comparedTo = P.cmp = function (y) {
  3248. var i,j,xdL,ydL,
  3249. x = this,
  3250. xd = x.d,
  3251. yd = (y = new x.constructor(y)).d,
  3252. xs = x.s,
  3253. ys = y.s;
  3254. // Either NaN or ±Infinity?
  3255. if (!xd || !yd) {
  3256. return !xs || !ys ? NaN : xs !== ys ? xs : xd === yd ? 0 : !xd ^ xs < 0 ? 1 : -1;
  3257. }
  3258. // Either zero?
  3259. if (!xd[0] || !yd[0]) return xd[0] ? xs : yd[0] ? -ys : 0;
  3260. // Signs differ?
  3261. if (xs !== ys) return xs;
  3262. // Compare exponents.
  3263. if (x.e !== y.e) return x.e > y.e ^ xs < 0 ? 1 : -1;
  3264. xdL = xd.length;
  3265. ydL = yd.length;
  3266. // Compare digit by digit.
  3267. for (i = 0, j = xdL < ydL ? xdL : ydL; i < j; ++i) {
  3268. if (xd[i] !== yd[i]) return xd[i] > yd[i] ^ xs < 0 ? 1 : -1;
  3269. }
  3270. // Compare lengths.
  3271. return xdL === ydL ? 0 : xdL > ydL ^ xs < 0 ? 1 : -1;
  3272. };
  3273. /*
  3274. * Return a new Decimal whose value is the cosine of the value in radians of this Decimal.
  3275. *
  3276. * Domain: [-Infinity, Infinity]
  3277. * Range: [-1, 1]
  3278. *
  3279. * cos(0) = 1
  3280. * cos(-0) = 1
  3281. * cos(Infinity) = NaN
  3282. * cos(-Infinity) = NaN
  3283. * cos(NaN) = NaN
  3284. *
  3285. */
  3286. P.cosine = P.cos = function () {
  3287. var pr,rm,
  3288. x = this,
  3289. Ctor = x.constructor;
  3290. if (!x.d) return new Ctor(NaN);
  3291. // cos(0) = cos(-0) = 1
  3292. if (!x.d[0]) return new Ctor(1);
  3293. pr = Ctor.precision;
  3294. rm = Ctor.rounding;
  3295. Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE;
  3296. Ctor.rounding = 1;
  3297. x = cosine(Ctor, toLessThanHalfPi(Ctor, x));
  3298. Ctor.precision = pr;
  3299. Ctor.rounding = rm;
  3300. return finalise(quadrant == 2 || quadrant == 3 ? x.neg() : x, pr, rm, true);
  3301. };
  3302. /*
  3303. *
  3304. * Return a new Decimal whose value is the cube root of the value of this Decimal, rounded to
  3305. * `precision` significant digits using rounding mode `rounding`.
  3306. *
  3307. * cbrt(0) = 0
  3308. * cbrt(-0) = -0
  3309. * cbrt(1) = 1
  3310. * cbrt(-1) = -1
  3311. * cbrt(N) = N
  3312. * cbrt(-I) = -I
  3313. * cbrt(I) = I
  3314. *
  3315. * Math.cbrt(x) = (x < 0 ? -Math.pow(-x, 1/3) : Math.pow(x, 1/3))
  3316. *
  3317. */
  3318. P.cubeRoot = P.cbrt = function () {
  3319. var e,m,n,r,rep,s,sd,t,t3,t3plusx,
  3320. x = this,
  3321. Ctor = x.constructor;
  3322. if (!x.isFinite() || x.isZero()) return new Ctor(x);
  3323. external = false;
  3324. // Initial estimate.
  3325. s = x.s * mathpow(x.s * x, 1 / 3);
  3326. // Math.cbrt underflow/overflow?
  3327. // Pass x to Math.pow as integer, then adjust the exponent of the result.
  3328. if (!s || Math.abs(s) == 1 / 0) {
  3329. n = digitsToString(x.d);
  3330. e = x.e;
  3331. // Adjust n exponent so it is a multiple of 3 away from x exponent.
  3332. if (s = (e - n.length + 1) % 3) n += s == 1 || s == -2 ? '0' : '00';
  3333. s = mathpow(n, 1 / 3);
  3334. // Rarely, e may be one less than the result exponent value.
  3335. e = mathfloor((e + 1) / 3) - (e % 3 == (e < 0 ? -1 : 2));
  3336. if (s == 1 / 0) {
  3337. n = '5e' + e;
  3338. } else {
  3339. n = s.toExponential();
  3340. n = n.slice(0, n.indexOf('e') + 1) + e;
  3341. }
  3342. r = new Ctor(n);
  3343. r.s = x.s;
  3344. } else {
  3345. r = new Ctor(s.toString());
  3346. }
  3347. sd = (e = Ctor.precision) + 3;
  3348. // Halley's method.
  3349. // TODO? Compare Newton's method.
  3350. for (;;) {
  3351. t = r;
  3352. t3 = t.times(t).times(t);
  3353. t3plusx = t3.plus(x);
  3354. r = divide(t3plusx.plus(x).times(t), t3plusx.plus(t3), sd + 2, 1);
  3355. // TODO? Replace with for-loop and checkRoundingDigits.
  3356. if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) {
  3357. n = n.slice(sd - 3, sd + 1);
  3358. // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or 4999
  3359. // , i.e. approaching a rounding boundary, continue the iteration.
  3360. if (n == '9999' || !rep && n == '4999') {
  3361. // On the first iteration only, check to see if rounding up gives the exact result as the
  3362. // nines may infinitely repeat.
  3363. if (!rep) {
  3364. finalise(t, e + 1, 0);
  3365. if (t.times(t).times(t).eq(x)) {
  3366. r = t;
  3367. break;
  3368. }
  3369. }
  3370. sd += 4;
  3371. rep = 1;
  3372. } else {
  3373. // If the rounding digits are null, 0{0,4} or 50{0,3}, check for an exact result.
  3374. // If not, then there are further digits and m will be truthy.
  3375. if (!+n || !+n.slice(1) && n.charAt(0) == '5') {
  3376. // Truncate to the first rounding digit.
  3377. finalise(r, e + 1, 1);
  3378. m = !r.times(r).times(r).eq(x);
  3379. }
  3380. break;
  3381. }
  3382. }
  3383. }
  3384. external = true;
  3385. return finalise(r, e, Ctor.rounding, m);
  3386. };
  3387. /*
  3388. * Return the number of decimal places of the value of this Decimal.
  3389. *
  3390. */
  3391. P.decimalPlaces = P.dp = function () {
  3392. var w,
  3393. d = this.d,
  3394. n = NaN;
  3395. if (d) {
  3396. w = d.length - 1;
  3397. n = (w - mathfloor(this.e / LOG_BASE)) * LOG_BASE;
  3398. // Subtract the number of trailing zeros of the last word.
  3399. w = d[w];
  3400. if (w) for (; w % 10 == 0; w /= 10) {n--;}
  3401. if (n < 0) n = 0;
  3402. }
  3403. return n;
  3404. };
  3405. /*
  3406. * n / 0 = I
  3407. * n / N = N
  3408. * n / I = 0
  3409. * 0 / n = 0
  3410. * 0 / 0 = N
  3411. * 0 / N = N
  3412. * 0 / I = 0
  3413. * N / n = N
  3414. * N / 0 = N
  3415. * N / N = N
  3416. * N / I = N
  3417. * I / n = I
  3418. * I / 0 = I
  3419. * I / N = N
  3420. * I / I = N
  3421. *
  3422. * Return a new Decimal whose value is the value of this Decimal divided by `y`, rounded to
  3423. * `precision` significant digits using rounding mode `rounding`.
  3424. *
  3425. */
  3426. P.dividedBy = P.div = function (y) {
  3427. return divide(this, new this.constructor(y));
  3428. };
  3429. /*
  3430. * Return a new Decimal whose value is the integer part of dividing the value of this Decimal
  3431. * by the value of `y`, rounded to `precision` significant digits using rounding mode `rounding`.
  3432. *
  3433. */
  3434. P.dividedToIntegerBy = P.divToInt = function (y) {
  3435. var x = this,
  3436. Ctor = x.constructor;
  3437. return finalise(divide(x, new Ctor(y), 0, 1, 1), Ctor.precision, Ctor.rounding);
  3438. };
  3439. /*
  3440. * Return true if the value of this Decimal is equal to the value of `y`, otherwise return false.
  3441. *
  3442. */
  3443. P.equals = P.eq = function (y) {
  3444. return this.cmp(y) === 0;
  3445. };
  3446. /*
  3447. * Return a new Decimal whose value is the value of this Decimal rounded to a whole number in the
  3448. * direction of negative Infinity.
  3449. *
  3450. */
  3451. P.floor = function () {
  3452. return finalise(new this.constructor(this), this.e + 1, 3);
  3453. };
  3454. /*
  3455. * Return true if the value of this Decimal is greater than the value of `y`, otherwise return
  3456. * false.
  3457. *
  3458. */
  3459. P.greaterThan = P.gt = function (y) {
  3460. return this.cmp(y) > 0;
  3461. };
  3462. /*
  3463. * Return true if the value of this Decimal is greater than or equal to the value of `y`,
  3464. * otherwise return false.
  3465. *
  3466. */
  3467. P.greaterThanOrEqualTo = P.gte = function (y) {
  3468. var k = this.cmp(y);
  3469. return k == 1 || k === 0;
  3470. };
  3471. /*
  3472. * Return a new Decimal whose value is the hyperbolic cosine of the value in radians of this
  3473. * Decimal.
  3474. *
  3475. * Domain: [-Infinity, Infinity]
  3476. * Range: [1, Infinity]
  3477. *
  3478. * cosh(x) = 1 + x^2/2! + x^4/4! + x^6/6! + ...
  3479. *
  3480. * cosh(0) = 1
  3481. * cosh(-0) = 1
  3482. * cosh(Infinity) = Infinity
  3483. * cosh(-Infinity) = Infinity
  3484. * cosh(NaN) = NaN
  3485. *
  3486. * x time taken (ms) result
  3487. * 1000 9 9.8503555700852349694e+433
  3488. * 10000 25 4.4034091128314607936e+4342
  3489. * 100000 171 1.4033316802130615897e+43429
  3490. * 1000000 3817 1.5166076984010437725e+434294
  3491. * 10000000 abandoned after 2 minute wait
  3492. *
  3493. * TODO? Compare performance of cosh(x) = 0.5 * (exp(x) + exp(-x))
  3494. *
  3495. */
  3496. P.hyperbolicCosine = P.cosh = function () {
  3497. var k,n,pr,rm,len,
  3498. x = this,
  3499. Ctor = x.constructor,
  3500. one = new Ctor(1);
  3501. if (!x.isFinite()) return new Ctor(x.s ? 1 / 0 : NaN);
  3502. if (x.isZero()) return one;
  3503. pr = Ctor.precision;
  3504. rm = Ctor.rounding;
  3505. Ctor.precision = pr + Math.max(x.e, x.sd()) + 4;
  3506. Ctor.rounding = 1;
  3507. len = x.d.length;
  3508. // Argument reduction: cos(4x) = 1 - 8cos^2(x) + 8cos^4(x) + 1
  3509. // i.e. cos(x) = 1 - cos^2(x/4)(8 - 8cos^2(x/4))
  3510. // Estimate the optimum number of times to use the argument reduction.
  3511. // TODO? Estimation reused from cosine() and may not be optimal here.
  3512. if (len < 32) {
  3513. k = Math.ceil(len / 3);
  3514. n = (1 / tinyPow(4, k)).toString();
  3515. } else {
  3516. k = 16;
  3517. n = '2.3283064365386962890625e-10';
  3518. }
  3519. x = taylorSeries(Ctor, 1, x.times(n), new Ctor(1), true);
  3520. // Reverse argument reduction
  3521. var cosh2_x,
  3522. i = k,
  3523. d8 = new Ctor(8);
  3524. for (; i--;) {
  3525. cosh2_x = x.times(x);
  3526. x = one.minus(cosh2_x.times(d8.minus(cosh2_x.times(d8))));
  3527. }
  3528. return finalise(x, Ctor.precision = pr, Ctor.rounding = rm, true);
  3529. };
  3530. /*
  3531. * Return a new Decimal whose value is the hyperbolic sine of the value in radians of this
  3532. * Decimal.
  3533. *
  3534. * Domain: [-Infinity, Infinity]
  3535. * Range: [-Infinity, Infinity]
  3536. *
  3537. * sinh(x) = x + x^3/3! + x^5/5! + x^7/7! + ...
  3538. *
  3539. * sinh(0) = 0
  3540. * sinh(-0) = -0
  3541. * sinh(Infinity) = Infinity
  3542. * sinh(-Infinity) = -Infinity
  3543. * sinh(NaN) = NaN
  3544. *
  3545. * x time taken (ms)
  3546. * 10 2 ms
  3547. * 100 5 ms
  3548. * 1000 14 ms
  3549. * 10000 82 ms
  3550. * 100000 886 ms 1.4033316802130615897e+43429
  3551. * 200000 2613 ms
  3552. * 300000 5407 ms
  3553. * 400000 8824 ms
  3554. * 500000 13026 ms 8.7080643612718084129e+217146
  3555. * 1000000 48543 ms
  3556. *
  3557. * TODO? Compare performance of sinh(x) = 0.5 * (exp(x) - exp(-x))
  3558. *
  3559. */
  3560. P.hyperbolicSine = P.sinh = function () {
  3561. var k,pr,rm,len,
  3562. x = this,
  3563. Ctor = x.constructor;
  3564. if (!x.isFinite() || x.isZero()) return new Ctor(x);
  3565. pr = Ctor.precision;
  3566. rm = Ctor.rounding;
  3567. Ctor.precision = pr + Math.max(x.e, x.sd()) + 4;
  3568. Ctor.rounding = 1;
  3569. len = x.d.length;
  3570. if (len < 3) {
  3571. x = taylorSeries(Ctor, 2, x, x, true);
  3572. } else {
  3573. // Alternative argument reduction: sinh(3x) = sinh(x)(3 + 4sinh^2(x))
  3574. // i.e. sinh(x) = sinh(x/3)(3 + 4sinh^2(x/3))
  3575. // 3 multiplications and 1 addition
  3576. // Argument reduction: sinh(5x) = sinh(x)(5 + sinh^2(x)(20 + 16sinh^2(x)))
  3577. // i.e. sinh(x) = sinh(x/5)(5 + sinh^2(x/5)(20 + 16sinh^2(x/5)))
  3578. // 4 multiplications and 2 additions
  3579. // Estimate the optimum number of times to use the argument reduction.
  3580. k = 1.4 * Math.sqrt(len);
  3581. k = k > 16 ? 16 : k | 0;
  3582. x = x.times(1 / tinyPow(5, k));
  3583. x = taylorSeries(Ctor, 2, x, x, true);
  3584. // Reverse argument reduction
  3585. var sinh2_x,
  3586. d5 = new Ctor(5),
  3587. d16 = new Ctor(16),
  3588. d20 = new Ctor(20);
  3589. for (; k--;) {
  3590. sinh2_x = x.times(x);
  3591. x = x.times(d5.plus(sinh2_x.times(d16.times(sinh2_x).plus(d20))));
  3592. }
  3593. }
  3594. Ctor.precision = pr;
  3595. Ctor.rounding = rm;
  3596. return finalise(x, pr, rm, true);
  3597. };
  3598. /*
  3599. * Return a new Decimal whose value is the hyperbolic tangent of the value in radians of this
  3600. * Decimal.
  3601. *
  3602. * Domain: [-Infinity, Infinity]
  3603. * Range: [-1, 1]
  3604. *
  3605. * tanh(x) = sinh(x) / cosh(x)
  3606. *
  3607. * tanh(0) = 0
  3608. * tanh(-0) = -0
  3609. * tanh(Infinity) = 1
  3610. * tanh(-Infinity) = -1
  3611. * tanh(NaN) = NaN
  3612. *
  3613. */
  3614. P.hyperbolicTangent = P.tanh = function () {
  3615. var pr,rm,
  3616. x = this,
  3617. Ctor = x.constructor;
  3618. if (!x.isFinite()) return new Ctor(x.s);
  3619. if (x.isZero()) return new Ctor(x);
  3620. pr = Ctor.precision;
  3621. rm = Ctor.rounding;
  3622. Ctor.precision = pr + 7;
  3623. Ctor.rounding = 1;
  3624. return divide(x.sinh(), x.cosh(), Ctor.precision = pr, Ctor.rounding = rm);
  3625. };
  3626. /*
  3627. * Return a new Decimal whose value is the arccosine (inverse cosine) in radians of the value of
  3628. * this Decimal.
  3629. *
  3630. * Domain: [-1, 1]
  3631. * Range: [0, pi]
  3632. *
  3633. * acos(x) = pi/2 - asin(x)
  3634. *
  3635. * acos(0) = pi/2
  3636. * acos(-0) = pi/2
  3637. * acos(1) = 0
  3638. * acos(-1) = pi
  3639. * acos(1/2) = pi/3
  3640. * acos(-1/2) = 2*pi/3
  3641. * acos(|x| > 1) = NaN
  3642. * acos(NaN) = NaN
  3643. *
  3644. */
  3645. P.inverseCosine = P.acos = function () {
  3646. var halfPi,
  3647. x = this,
  3648. Ctor = x.constructor,
  3649. k = x.abs().cmp(1),
  3650. pr = Ctor.precision,
  3651. rm = Ctor.rounding;
  3652. if (k !== -1) {
  3653. return k === 0
  3654. // |x| is 1
  3655. ? x.isNeg() ? getPi(Ctor, pr, rm) : new Ctor(0)
  3656. // |x| > 1 or x is NaN
  3657. : new Ctor(NaN);
  3658. }
  3659. if (x.isZero()) return getPi(Ctor, pr + 4, rm).times(0.5);
  3660. // TODO? Special case acos(0.5) = pi/3 and acos(-0.5) = 2*pi/3
  3661. Ctor.precision = pr + 6;
  3662. Ctor.rounding = 1;
  3663. x = x.asin();
  3664. halfPi = getPi(Ctor, pr + 4, rm).times(0.5);
  3665. Ctor.precision = pr;
  3666. Ctor.rounding = rm;
  3667. return halfPi.minus(x);
  3668. };
  3669. /*
  3670. * Return a new Decimal whose value is the inverse of the hyperbolic cosine in radians of the
  3671. * value of this Decimal.
  3672. *
  3673. * Domain: [1, Infinity]
  3674. * Range: [0, Infinity]
  3675. *
  3676. * acosh(x) = ln(x + sqrt(x^2 - 1))
  3677. *
  3678. * acosh(x < 1) = NaN
  3679. * acosh(NaN) = NaN
  3680. * acosh(Infinity) = Infinity
  3681. * acosh(-Infinity) = NaN
  3682. * acosh(0) = NaN
  3683. * acosh(-0) = NaN
  3684. * acosh(1) = 0
  3685. * acosh(-1) = NaN
  3686. *
  3687. */
  3688. P.inverseHyperbolicCosine = P.acosh = function () {
  3689. var pr,rm,
  3690. x = this,
  3691. Ctor = x.constructor;
  3692. if (x.lte(1)) return new Ctor(x.eq(1) ? 0 : NaN);
  3693. if (!x.isFinite()) return new Ctor(x);
  3694. pr = Ctor.precision;
  3695. rm = Ctor.rounding;
  3696. Ctor.precision = pr + Math.max(Math.abs(x.e), x.sd()) + 4;
  3697. Ctor.rounding = 1;
  3698. external = false;
  3699. x = x.times(x).minus(1).sqrt().plus(x);
  3700. external = true;
  3701. Ctor.precision = pr;
  3702. Ctor.rounding = rm;
  3703. return x.ln();
  3704. };
  3705. /*
  3706. * Return a new Decimal whose value is the inverse of the hyperbolic sine in radians of the value
  3707. * of this Decimal.
  3708. *
  3709. * Domain: [-Infinity, Infinity]
  3710. * Range: [-Infinity, Infinity]
  3711. *
  3712. * asinh(x) = ln(x + sqrt(x^2 + 1))
  3713. *
  3714. * asinh(NaN) = NaN
  3715. * asinh(Infinity) = Infinity
  3716. * asinh(-Infinity) = -Infinity
  3717. * asinh(0) = 0
  3718. * asinh(-0) = -0
  3719. *
  3720. */
  3721. P.inverseHyperbolicSine = P.asinh = function () {
  3722. var pr,rm,
  3723. x = this,
  3724. Ctor = x.constructor;
  3725. if (!x.isFinite() || x.isZero()) return new Ctor(x);
  3726. pr = Ctor.precision;
  3727. rm = Ctor.rounding;
  3728. Ctor.precision = pr + 2 * Math.max(Math.abs(x.e), x.sd()) + 6;
  3729. Ctor.rounding = 1;
  3730. external = false;
  3731. x = x.times(x).plus(1).sqrt().plus(x);
  3732. external = true;
  3733. Ctor.precision = pr;
  3734. Ctor.rounding = rm;
  3735. return x.ln();
  3736. };
  3737. /*
  3738. * Return a new Decimal whose value is the inverse of the hyperbolic tangent in radians of the
  3739. * value of this Decimal.
  3740. *
  3741. * Domain: [-1, 1]
  3742. * Range: [-Infinity, Infinity]
  3743. *
  3744. * atanh(x) = 0.5 * ln((1 + x) / (1 - x))
  3745. *
  3746. * atanh(|x| > 1) = NaN
  3747. * atanh(NaN) = NaN
  3748. * atanh(Infinity) = NaN
  3749. * atanh(-Infinity) = NaN
  3750. * atanh(0) = 0
  3751. * atanh(-0) = -0
  3752. * atanh(1) = Infinity
  3753. * atanh(-1) = -Infinity
  3754. *
  3755. */
  3756. P.inverseHyperbolicTangent = P.atanh = function () {
  3757. var pr,rm,wpr,xsd,
  3758. x = this,
  3759. Ctor = x.constructor;
  3760. if (!x.isFinite()) return new Ctor(NaN);
  3761. if (x.e >= 0) return new Ctor(x.abs().eq(1) ? x.s / 0 : x.isZero() ? x : NaN);
  3762. pr = Ctor.precision;
  3763. rm = Ctor.rounding;
  3764. xsd = x.sd();
  3765. if (Math.max(xsd, pr) < 2 * -x.e - 1) return finalise(new Ctor(x), pr, rm, true);
  3766. Ctor.precision = wpr = xsd - x.e;
  3767. x = divide(x.plus(1), new Ctor(1).minus(x), wpr + pr, 1);
  3768. Ctor.precision = pr + 4;
  3769. Ctor.rounding = 1;
  3770. x = x.ln();
  3771. Ctor.precision = pr;
  3772. Ctor.rounding = rm;
  3773. return x.times(0.5);
  3774. };
  3775. /*
  3776. * Return a new Decimal whose value is the arcsine (inverse sine) in radians of the value of this
  3777. * Decimal.
  3778. *
  3779. * Domain: [-Infinity, Infinity]
  3780. * Range: [-pi/2, pi/2]
  3781. *
  3782. * asin(x) = 2*atan(x/(1 + sqrt(1 - x^2)))
  3783. *
  3784. * asin(0) = 0
  3785. * asin(-0) = -0
  3786. * asin(1/2) = pi/6
  3787. * asin(-1/2) = -pi/6
  3788. * asin(1) = pi/2
  3789. * asin(-1) = -pi/2
  3790. * asin(|x| > 1) = NaN
  3791. * asin(NaN) = NaN
  3792. *
  3793. * TODO? Compare performance of Taylor series.
  3794. *
  3795. */
  3796. P.inverseSine = P.asin = function () {
  3797. var halfPi,k,
  3798. pr,rm,
  3799. x = this,
  3800. Ctor = x.constructor;
  3801. if (x.isZero()) return new Ctor(x);
  3802. k = x.abs().cmp(1);
  3803. pr = Ctor.precision;
  3804. rm = Ctor.rounding;
  3805. if (k !== -1) {
  3806. // |x| is 1
  3807. if (k === 0) {
  3808. halfPi = getPi(Ctor, pr + 4, rm).times(0.5);
  3809. halfPi.s = x.s;
  3810. return halfPi;
  3811. }
  3812. // |x| > 1 or x is NaN
  3813. return new Ctor(NaN);
  3814. }
  3815. // TODO? Special case asin(1/2) = pi/6 and asin(-1/2) = -pi/6
  3816. Ctor.precision = pr + 6;
  3817. Ctor.rounding = 1;
  3818. x = x.div(new Ctor(1).minus(x.times(x)).sqrt().plus(1)).atan();
  3819. Ctor.precision = pr;
  3820. Ctor.rounding = rm;
  3821. return x.times(2);
  3822. };
  3823. /*
  3824. * Return a new Decimal whose value is the arctangent (inverse tangent) in radians of the value
  3825. * of this Decimal.
  3826. *
  3827. * Domain: [-Infinity, Infinity]
  3828. * Range: [-pi/2, pi/2]
  3829. *
  3830. * atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ...
  3831. *
  3832. * atan(0) = 0
  3833. * atan(-0) = -0
  3834. * atan(1) = pi/4
  3835. * atan(-1) = -pi/4
  3836. * atan(Infinity) = pi/2
  3837. * atan(-Infinity) = -pi/2
  3838. * atan(NaN) = NaN
  3839. *
  3840. */
  3841. P.inverseTangent = P.atan = function () {
  3842. var i,j,k,n,px,t,r,wpr,x2,
  3843. x = this,
  3844. Ctor = x.constructor,
  3845. pr = Ctor.precision,
  3846. rm = Ctor.rounding;
  3847. if (!x.isFinite()) {
  3848. if (!x.s) return new Ctor(NaN);
  3849. if (pr + 4 <= PI_PRECISION) {
  3850. r = getPi(Ctor, pr + 4, rm).times(0.5);
  3851. r.s = x.s;
  3852. return r;
  3853. }
  3854. } else if (x.isZero()) {
  3855. return new Ctor(x);
  3856. } else if (x.abs().eq(1) && pr + 4 <= PI_PRECISION) {
  3857. r = getPi(Ctor, pr + 4, rm).times(0.25);
  3858. r.s = x.s;
  3859. return r;
  3860. }
  3861. Ctor.precision = wpr = pr + 10;
  3862. Ctor.rounding = 1;
  3863. // TODO? if (x >= 1 && pr <= PI_PRECISION) atan(x) = halfPi * x.s - atan(1 / x);
  3864. // Argument reduction
  3865. // Ensure |x| < 0.42
  3866. // atan(x) = 2 * atan(x / (1 + sqrt(1 + x^2)))
  3867. k = Math.min(28, wpr / LOG_BASE + 2 | 0);
  3868. for (i = k; i; --i) {x = x.div(x.times(x).plus(1).sqrt().plus(1));}
  3869. external = false;
  3870. j = Math.ceil(wpr / LOG_BASE);
  3871. n = 1;
  3872. x2 = x.times(x);
  3873. r = new Ctor(x);
  3874. px = x;
  3875. // atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ...
  3876. for (; i !== -1;) {
  3877. px = px.times(x2);
  3878. t = r.minus(px.div(n += 2));
  3879. px = px.times(x2);
  3880. r = t.plus(px.div(n += 2));
  3881. if (r.d[j] !== void 0) for (i = j; r.d[i] === t.d[i] && i--;) {;}
  3882. }
  3883. if (k) r = r.times(2 << k - 1);
  3884. external = true;
  3885. return finalise(r, Ctor.precision = pr, Ctor.rounding = rm, true);
  3886. };
  3887. /*
  3888. * Return true if the value of this Decimal is a finite number, otherwise return false.
  3889. *
  3890. */
  3891. P.isFinite = function () {
  3892. return !!this.d;
  3893. };
  3894. /*
  3895. * Return true if the value of this Decimal is an integer, otherwise return false.
  3896. *
  3897. */
  3898. P.isInteger = P.isInt = function () {
  3899. return !!this.d && mathfloor(this.e / LOG_BASE) > this.d.length - 2;
  3900. };
  3901. /*
  3902. * Return true if the value of this Decimal is NaN, otherwise return false.
  3903. *
  3904. */
  3905. P.isNaN = function () {
  3906. return !this.s;
  3907. };
  3908. /*
  3909. * Return true if the value of this Decimal is negative, otherwise return false.
  3910. *
  3911. */
  3912. P.isNegative = P.isNeg = function () {
  3913. return this.s < 0;
  3914. };
  3915. /*
  3916. * Return true if the value of this Decimal is positive, otherwise return false.
  3917. *
  3918. */
  3919. P.isPositive = P.isPos = function () {
  3920. return this.s > 0;
  3921. };
  3922. /*
  3923. * Return true if the value of this Decimal is 0 or -0, otherwise return false.
  3924. *
  3925. */
  3926. P.isZero = function () {
  3927. return !!this.d && this.d[0] === 0;
  3928. };
  3929. /*
  3930. * Return true if the value of this Decimal is less than `y`, otherwise return false.
  3931. *
  3932. */
  3933. P.lessThan = P.lt = function (y) {
  3934. return this.cmp(y) < 0;
  3935. };
  3936. /*
  3937. * Return true if the value of this Decimal is less than or equal to `y`, otherwise return false.
  3938. *
  3939. */
  3940. P.lessThanOrEqualTo = P.lte = function (y) {
  3941. return this.cmp(y) < 1;
  3942. };
  3943. /*
  3944. * Return the logarithm of the value of this Decimal to the specified base, rounded to `precision`
  3945. * significant digits using rounding mode `rounding`.
  3946. *
  3947. * If no base is specified, return log[10](arg).
  3948. *
  3949. * log[base](arg) = ln(arg) / ln(base)
  3950. *
  3951. * The result will always be correctly rounded if the base of the log is 10, and 'almost always'
  3952. * otherwise:
  3953. *
  3954. * Depending on the rounding mode, the result may be incorrectly rounded if the first fifteen
  3955. * rounding digits are [49]99999999999999 or [50]00000000000000. In that case, the maximum error
  3956. * between the result and the correctly rounded result will be one ulp (unit in the last place).
  3957. *
  3958. * log[-b](a) = NaN
  3959. * log[0](a) = NaN
  3960. * log[1](a) = NaN
  3961. * log[NaN](a) = NaN
  3962. * log[Infinity](a) = NaN
  3963. * log[b](0) = -Infinity
  3964. * log[b](-0) = -Infinity
  3965. * log[b](-a) = NaN
  3966. * log[b](1) = 0
  3967. * log[b](Infinity) = Infinity
  3968. * log[b](NaN) = NaN
  3969. *
  3970. * [base] {number|string|Decimal} The base of the logarithm.
  3971. *
  3972. */
  3973. P.logarithm = P.log = function (base) {
  3974. var isBase10,d,denominator,k,inf,num,sd,r,
  3975. arg = this,
  3976. Ctor = arg.constructor,
  3977. pr = Ctor.precision,
  3978. rm = Ctor.rounding,
  3979. guard = 5;
  3980. // Default base is 10.
  3981. if (base == null) {
  3982. base = new Ctor(10);
  3983. isBase10 = true;
  3984. } else {
  3985. base = new Ctor(base);
  3986. d = base.d;
  3987. // Return NaN if base is negative, or non-finite, or is 0 or 1.
  3988. if (base.s < 0 || !d || !d[0] || base.eq(1)) return new Ctor(NaN);
  3989. isBase10 = base.eq(10);
  3990. }
  3991. d = arg.d;
  3992. // Is arg negative, non-finite, 0 or 1?
  3993. if (arg.s < 0 || !d || !d[0] || arg.eq(1)) {
  3994. return new Ctor(d && !d[0] ? -1 / 0 : arg.s != 1 ? NaN : d ? 0 : 1 / 0);
  3995. }
  3996. // The result will have a non-terminating decimal expansion if base is 10 and arg is not an
  3997. // integer power of 10.
  3998. if (isBase10) {
  3999. if (d.length > 1) {
  4000. inf = true;
  4001. } else {
  4002. for (k = d[0]; k % 10 === 0;) {k /= 10;}
  4003. inf = k !== 1;
  4004. }
  4005. }
  4006. external = false;
  4007. sd = pr + guard;
  4008. num = naturalLogarithm(arg, sd);
  4009. denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd);
  4010. // The result will have 5 rounding digits.
  4011. r = divide(num, denominator, sd, 1);
  4012. // If at a rounding boundary, i.e. the result's rounding digits are [49]9999 or [50]0000,
  4013. // calculate 10 further digits.
  4014. //
  4015. // If the result is known to have an infinite decimal expansion, repeat this until it is clear
  4016. // that the result is above or below the boundary. Otherwise, if after calculating the 10
  4017. // further digits, the last 14 are nines, round up and assume the result is exact.
  4018. // Also assume the result is exact if the last 14 are zero.
  4019. //
  4020. // Example of a result that will be incorrectly rounded:
  4021. // log[1048576](4503599627370502) = 2.60000000000000009610279511444746...
  4022. // The above result correctly rounded using ROUND_CEIL to 1 decimal place should be 2.7, but it
  4023. // will be given as 2.6 as there are 15 zeros immediately after the requested decimal place, so
  4024. // the exact result would be assumed to be 2.6, which rounded using ROUND_CEIL to 1 decimal
  4025. // place is still 2.6.
  4026. if (checkRoundingDigits(r.d, k = pr, rm)) {
  4027. do {
  4028. sd += 10;
  4029. num = naturalLogarithm(arg, sd);
  4030. denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd);
  4031. r = divide(num, denominator, sd, 1);
  4032. if (!inf) {
  4033. // Check for 14 nines from the 2nd rounding digit, as the first may be 4.
  4034. if (+digitsToString(r.d).slice(k + 1, k + 15) + 1 == 1e14) {
  4035. r = finalise(r, pr + 1, 0);
  4036. }
  4037. break;
  4038. }
  4039. } while (checkRoundingDigits(r.d, k += 10, rm));
  4040. }
  4041. external = true;
  4042. return finalise(r, pr, rm);
  4043. };
  4044. /*
  4045. * Return a new Decimal whose value is the maximum of the arguments and the value of this Decimal.
  4046. *
  4047. * arguments {number|string|Decimal}
  4048. *
  4049. P.max = function () {
  4050. Array.prototype.push.call(arguments, this);
  4051. return maxOrMin(this.constructor, arguments, 'lt');
  4052. };
  4053. */
  4054. /*
  4055. * Return a new Decimal whose value is the minimum of the arguments and the value of this Decimal.
  4056. *
  4057. * arguments {number|string|Decimal}
  4058. *
  4059. P.min = function () {
  4060. Array.prototype.push.call(arguments, this);
  4061. return maxOrMin(this.constructor, arguments, 'gt');
  4062. };
  4063. */
  4064. /*
  4065. * n - 0 = n
  4066. * n - N = N
  4067. * n - I = -I
  4068. * 0 - n = -n
  4069. * 0 - 0 = 0
  4070. * 0 - N = N
  4071. * 0 - I = -I
  4072. * N - n = N
  4073. * N - 0 = N
  4074. * N - N = N
  4075. * N - I = N
  4076. * I - n = I
  4077. * I - 0 = I
  4078. * I - N = N
  4079. * I - I = N
  4080. *
  4081. * Return a new Decimal whose value is the value of this Decimal minus `y`, rounded to `precision`
  4082. * significant digits using rounding mode `rounding`.
  4083. *
  4084. */
  4085. P.minus = P.sub = function (y) {
  4086. var d,e,i,j,k,len,pr,rm,xd,xe,xLTy,yd,
  4087. x = this,
  4088. Ctor = x.constructor;
  4089. y = new Ctor(y);
  4090. // If either is not finite...
  4091. if (!x.d || !y.d) {
  4092. // Return NaN if either is NaN.
  4093. if (!x.s || !y.s) y = new Ctor(NaN);
  4094. // Return y negated if x is finite and y is ±Infinity.
  4095. else if (x.d) y.s = -y.s;
  4096. // Return x if y is finite and x is ±Infinity.
  4097. // Return x if both are ±Infinity with different signs.
  4098. // Return NaN if both are ±Infinity with the same sign.
  4099. else y = new Ctor(y.d || x.s !== y.s ? x : NaN);
  4100. return y;
  4101. }
  4102. // If signs differ...
  4103. if (x.s != y.s) {
  4104. y.s = -y.s;
  4105. return x.plus(y);
  4106. }
  4107. xd = x.d;
  4108. yd = y.d;
  4109. pr = Ctor.precision;
  4110. rm = Ctor.rounding;
  4111. // If either is zero...
  4112. if (!xd[0] || !yd[0]) {
  4113. // Return y negated if x is zero and y is non-zero.
  4114. if (yd[0]) y.s = -y.s;
  4115. // Return x if y is zero and x is non-zero.
  4116. else if (xd[0]) y = new Ctor(x);
  4117. // Return zero if both are zero.
  4118. // From IEEE 754 (2008) 6.3: 0 - 0 = -0 - -0 = -0 when rounding to -Infinity.
  4119. else return new Ctor(rm === 3 ? -0 : 0);
  4120. return external ? finalise(y, pr, rm) : y;
  4121. }
  4122. // x and y are finite, non-zero numbers with the same sign.
  4123. // Calculate base 1e7 exponents.
  4124. e = mathfloor(y.e / LOG_BASE);
  4125. xe = mathfloor(x.e / LOG_BASE);
  4126. xd = xd.slice();
  4127. k = xe - e;
  4128. // If base 1e7 exponents differ...
  4129. if (k) {
  4130. xLTy = k < 0;
  4131. if (xLTy) {
  4132. d = xd;
  4133. k = -k;
  4134. len = yd.length;
  4135. } else {
  4136. d = yd;
  4137. e = xe;
  4138. len = xd.length;
  4139. }
  4140. // Numbers with massively different exponents would result in a very high number of
  4141. // zeros needing to be prepended, but this can be avoided while still ensuring correct
  4142. // rounding by limiting the number of zeros to `Math.ceil(pr / LOG_BASE) + 2`.
  4143. i = Math.max(Math.ceil(pr / LOG_BASE), len) + 2;
  4144. if (k > i) {
  4145. k = i;
  4146. d.length = 1;
  4147. }
  4148. // Prepend zeros to equalise exponents.
  4149. d.reverse();
  4150. for (i = k; i--;) {d.push(0);}
  4151. d.reverse();
  4152. // Base 1e7 exponents equal.
  4153. } else {
  4154. // Check digits to determine which is the bigger number.
  4155. i = xd.length;
  4156. len = yd.length;
  4157. xLTy = i < len;
  4158. if (xLTy) len = i;
  4159. for (i = 0; i < len; i++) {
  4160. if (xd[i] != yd[i]) {
  4161. xLTy = xd[i] < yd[i];
  4162. break;
  4163. }
  4164. }
  4165. k = 0;
  4166. }
  4167. if (xLTy) {
  4168. d = xd;
  4169. xd = yd;
  4170. yd = d;
  4171. y.s = -y.s;
  4172. }
  4173. len = xd.length;
  4174. // Append zeros to `xd` if shorter.
  4175. // Don't add zeros to `yd` if shorter as subtraction only needs to start at `yd` length.
  4176. for (i = yd.length - len; i > 0; --i) {xd[len++] = 0;}
  4177. // Subtract yd from xd.
  4178. for (i = yd.length; i > k;) {
  4179. if (xd[--i] < yd[i]) {
  4180. for (j = i; j && xd[--j] === 0;) {xd[j] = BASE - 1;}
  4181. --xd[j];
  4182. xd[i] += BASE;
  4183. }
  4184. xd[i] -= yd[i];
  4185. }
  4186. // Remove trailing zeros.
  4187. for (; xd[--len] === 0;) {xd.pop();}
  4188. // Remove leading zeros and adjust exponent accordingly.
  4189. for (; xd[0] === 0; xd.shift()) {--e;}
  4190. // Zero?
  4191. if (!xd[0]) return new Ctor(rm === 3 ? -0 : 0);
  4192. y.d = xd;
  4193. y.e = getBase10Exponent(xd, e);
  4194. return external ? finalise(y, pr, rm) : y;
  4195. };
  4196. /*
  4197. * n % 0 = N
  4198. * n % N = N
  4199. * n % I = n
  4200. * 0 % n = 0
  4201. * -0 % n = -0
  4202. * 0 % 0 = N
  4203. * 0 % N = N
  4204. * 0 % I = 0
  4205. * N % n = N
  4206. * N % 0 = N
  4207. * N % N = N
  4208. * N % I = N
  4209. * I % n = N
  4210. * I % 0 = N
  4211. * I % N = N
  4212. * I % I = N
  4213. *
  4214. * Return a new Decimal whose value is the value of this Decimal modulo `y`, rounded to
  4215. * `precision` significant digits using rounding mode `rounding`.
  4216. *
  4217. * The result depends on the modulo mode.
  4218. *
  4219. */
  4220. P.modulo = P.mod = function (y) {
  4221. var q,
  4222. x = this,
  4223. Ctor = x.constructor;
  4224. y = new Ctor(y);
  4225. // Return NaN if x is ±Infinity or NaN, or y is NaN or ±0.
  4226. if (!x.d || !y.s || y.d && !y.d[0]) return new Ctor(NaN);
  4227. // Return x if y is ±Infinity or x is ±0.
  4228. if (!y.d || x.d && !x.d[0]) {
  4229. return finalise(new Ctor(x), Ctor.precision, Ctor.rounding);
  4230. }
  4231. // Prevent rounding of intermediate calculations.
  4232. external = false;
  4233. if (Ctor.modulo == 9) {
  4234. // Euclidian division: q = sign(y) * floor(x / abs(y))
  4235. // result = x - q * y where 0 <= result < abs(y)
  4236. q = divide(x, y.abs(), 0, 3, 1);
  4237. q.s *= y.s;
  4238. } else {
  4239. q = divide(x, y, 0, Ctor.modulo, 1);
  4240. }
  4241. q = q.times(y);
  4242. external = true;
  4243. return x.minus(q);
  4244. };
  4245. /*
  4246. * Return a new Decimal whose value is the natural exponential of the value of this Decimal,
  4247. * i.e. the base e raised to the power the value of this Decimal, rounded to `precision`
  4248. * significant digits using rounding mode `rounding`.
  4249. *
  4250. */
  4251. P.naturalExponential = P.exp = function () {
  4252. return naturalExponential(this);
  4253. };
  4254. /*
  4255. * Return a new Decimal whose value is the natural logarithm of the value of this Decimal,
  4256. * rounded to `precision` significant digits using rounding mode `rounding`.
  4257. *
  4258. */
  4259. P.naturalLogarithm = P.ln = function () {
  4260. return naturalLogarithm(this);
  4261. };
  4262. /*
  4263. * Return a new Decimal whose value is the value of this Decimal negated, i.e. as if multiplied by
  4264. * -1.
  4265. *
  4266. */
  4267. P.negated = P.neg = function () {
  4268. var x = new this.constructor(this);
  4269. x.s = -x.s;
  4270. return finalise(x);
  4271. };
  4272. /*
  4273. * n + 0 = n
  4274. * n + N = N
  4275. * n + I = I
  4276. * 0 + n = n
  4277. * 0 + 0 = 0
  4278. * 0 + N = N
  4279. * 0 + I = I
  4280. * N + n = N
  4281. * N + 0 = N
  4282. * N + N = N
  4283. * N + I = N
  4284. * I + n = I
  4285. * I + 0 = I
  4286. * I + N = N
  4287. * I + I = I
  4288. *
  4289. * Return a new Decimal whose value is the value of this Decimal plus `y`, rounded to `precision`
  4290. * significant digits using rounding mode `rounding`.
  4291. *
  4292. */
  4293. P.plus = P.add = function (y) {
  4294. var carry,d,e,i,k,len,pr,rm,xd,yd,
  4295. x = this,
  4296. Ctor = x.constructor;
  4297. y = new Ctor(y);
  4298. // If either is not finite...
  4299. if (!x.d || !y.d) {
  4300. // Return NaN if either is NaN.
  4301. if (!x.s || !y.s) y = new Ctor(NaN);
  4302. // Return x if y is finite and x is ±Infinity.
  4303. // Return x if both are ±Infinity with the same sign.
  4304. // Return NaN if both are ±Infinity with different signs.
  4305. // Return y if x is finite and y is ±Infinity.
  4306. else if (!x.d) y = new Ctor(y.d || x.s === y.s ? x : NaN);
  4307. return y;
  4308. }
  4309. // If signs differ...
  4310. if (x.s != y.s) {
  4311. y.s = -y.s;
  4312. return x.minus(y);
  4313. }
  4314. xd = x.d;
  4315. yd = y.d;
  4316. pr = Ctor.precision;
  4317. rm = Ctor.rounding;
  4318. // If either is zero...
  4319. if (!xd[0] || !yd[0]) {
  4320. // Return x if y is zero.
  4321. // Return y if y is non-zero.
  4322. if (!yd[0]) y = new Ctor(x);
  4323. return external ? finalise(y, pr, rm) : y;
  4324. }
  4325. // x and y are finite, non-zero numbers with the same sign.
  4326. // Calculate base 1e7 exponents.
  4327. k = mathfloor(x.e / LOG_BASE);
  4328. e = mathfloor(y.e / LOG_BASE);
  4329. xd = xd.slice();
  4330. i = k - e;
  4331. // If base 1e7 exponents differ...
  4332. if (i) {
  4333. if (i < 0) {
  4334. d = xd;
  4335. i = -i;
  4336. len = yd.length;
  4337. } else {
  4338. d = yd;
  4339. e = k;
  4340. len = xd.length;
  4341. }
  4342. // Limit number of zeros prepended to max(ceil(pr / LOG_BASE), len) + 1.
  4343. k = Math.ceil(pr / LOG_BASE);
  4344. len = k > len ? k + 1 : len + 1;
  4345. if (i > len) {
  4346. i = len;
  4347. d.length = 1;
  4348. }
  4349. // Prepend zeros to equalise exponents. Note: Faster to use reverse then do unshifts.
  4350. d.reverse();
  4351. for (; i--;) {d.push(0);}
  4352. d.reverse();
  4353. }
  4354. len = xd.length;
  4355. i = yd.length;
  4356. // If yd is longer than xd, swap xd and yd so xd points to the longer array.
  4357. if (len - i < 0) {
  4358. i = len;
  4359. d = yd;
  4360. yd = xd;
  4361. xd = d;
  4362. }
  4363. // Only start adding at yd.length - 1 as the further digits of xd can be left as they are.
  4364. for (carry = 0; i;) {
  4365. carry = (xd[--i] = xd[i] + yd[i] + carry) / BASE | 0;
  4366. xd[i] %= BASE;
  4367. }
  4368. if (carry) {
  4369. xd.unshift(carry);
  4370. ++e;
  4371. }
  4372. // Remove trailing zeros.
  4373. // No need to check for zero, as +x + +y != 0 && -x + -y != 0
  4374. for (len = xd.length; xd[--len] == 0;) {xd.pop();}
  4375. y.d = xd;
  4376. y.e = getBase10Exponent(xd, e);
  4377. return external ? finalise(y, pr, rm) : y;
  4378. };
  4379. /*
  4380. * Return the number of significant digits of the value of this Decimal.
  4381. *
  4382. * [z] {boolean|number} Whether to count integer-part trailing zeros: true, false, 1 or 0.
  4383. *
  4384. */
  4385. P.precision = P.sd = function (z) {
  4386. var k,
  4387. x = this;
  4388. if (z !== void 0 && z !== !!z && z !== 1 && z !== 0) throw Error(invalidArgument + z);
  4389. if (x.d) {
  4390. k = getPrecision(x.d);
  4391. if (z && x.e + 1 > k) k = x.e + 1;
  4392. } else {
  4393. k = NaN;
  4394. }
  4395. return k;
  4396. };
  4397. /*
  4398. * Return a new Decimal whose value is the value of this Decimal rounded to a whole number using
  4399. * rounding mode `rounding`.
  4400. *
  4401. */
  4402. P.round = function () {
  4403. var x = this,
  4404. Ctor = x.constructor;
  4405. return finalise(new Ctor(x), x.e + 1, Ctor.rounding);
  4406. };
  4407. /*
  4408. * Return a new Decimal whose value is the sine of the value in radians of this Decimal.
  4409. *
  4410. * Domain: [-Infinity, Infinity]
  4411. * Range: [-1, 1]
  4412. *
  4413. * sin(x) = x - x^3/3! + x^5/5! - ...
  4414. *
  4415. * sin(0) = 0
  4416. * sin(-0) = -0
  4417. * sin(Infinity) = NaN
  4418. * sin(-Infinity) = NaN
  4419. * sin(NaN) = NaN
  4420. *
  4421. */
  4422. P.sine = P.sin = function () {
  4423. var pr,rm,
  4424. x = this,
  4425. Ctor = x.constructor;
  4426. if (!x.isFinite()) return new Ctor(NaN);
  4427. if (x.isZero()) return new Ctor(x);
  4428. pr = Ctor.precision;
  4429. rm = Ctor.rounding;
  4430. Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE;
  4431. Ctor.rounding = 1;
  4432. x = sine(Ctor, toLessThanHalfPi(Ctor, x));
  4433. Ctor.precision = pr;
  4434. Ctor.rounding = rm;
  4435. return finalise(quadrant > 2 ? x.neg() : x, pr, rm, true);
  4436. };
  4437. /*
  4438. * Return a new Decimal whose value is the square root of this Decimal, rounded to `precision`
  4439. * significant digits using rounding mode `rounding`.
  4440. *
  4441. * sqrt(-n) = N
  4442. * sqrt(N) = N
  4443. * sqrt(-I) = N
  4444. * sqrt(I) = I
  4445. * sqrt(0) = 0
  4446. * sqrt(-0) = -0
  4447. *
  4448. */
  4449. P.squareRoot = P.sqrt = function () {
  4450. var m,n,sd,r,rep,t,
  4451. x = this,
  4452. d = x.d,
  4453. e = x.e,
  4454. s = x.s,
  4455. Ctor = x.constructor;
  4456. // Negative/NaN/Infinity/zero?
  4457. if (s !== 1 || !d || !d[0]) {
  4458. return new Ctor(!s || s < 0 && (!d || d[0]) ? NaN : d ? x : 1 / 0);
  4459. }
  4460. external = false;
  4461. // Initial estimate.
  4462. s = Math.sqrt(+x);
  4463. // Math.sqrt underflow/overflow?
  4464. // Pass x to Math.sqrt as integer, then adjust the exponent of the result.
  4465. if (s == 0 || s == 1 / 0) {
  4466. n = digitsToString(d);
  4467. if ((n.length + e) % 2 == 0) n += '0';
  4468. s = Math.sqrt(n);
  4469. e = mathfloor((e + 1) / 2) - (e < 0 || e % 2);
  4470. if (s == 1 / 0) {
  4471. n = '5e' + e;
  4472. } else {
  4473. n = s.toExponential();
  4474. n = n.slice(0, n.indexOf('e') + 1) + e;
  4475. }
  4476. r = new Ctor(n);
  4477. } else {
  4478. r = new Ctor(s.toString());
  4479. }
  4480. sd = (e = Ctor.precision) + 3;
  4481. // Newton-Raphson iteration.
  4482. for (;;) {
  4483. t = r;
  4484. r = t.plus(divide(x, t, sd + 2, 1)).times(0.5);
  4485. // TODO? Replace with for-loop and checkRoundingDigits.
  4486. if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) {
  4487. n = n.slice(sd - 3, sd + 1);
  4488. // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or
  4489. // 4999, i.e. approaching a rounding boundary, continue the iteration.
  4490. if (n == '9999' || !rep && n == '4999') {
  4491. // On the first iteration only, check to see if rounding up gives the exact result as the
  4492. // nines may infinitely repeat.
  4493. if (!rep) {
  4494. finalise(t, e + 1, 0);
  4495. if (t.times(t).eq(x)) {
  4496. r = t;
  4497. break;
  4498. }
  4499. }
  4500. sd += 4;
  4501. rep = 1;
  4502. } else {
  4503. // If the rounding digits are null, 0{0,4} or 50{0,3}, check for an exact result.
  4504. // If not, then there are further digits and m will be truthy.
  4505. if (!+n || !+n.slice(1) && n.charAt(0) == '5') {
  4506. // Truncate to the first rounding digit.
  4507. finalise(r, e + 1, 1);
  4508. m = !r.times(r).eq(x);
  4509. }
  4510. break;
  4511. }
  4512. }
  4513. }
  4514. external = true;
  4515. return finalise(r, e, Ctor.rounding, m);
  4516. };
  4517. /*
  4518. * Return a new Decimal whose value is the tangent of the value in radians of this Decimal.
  4519. *
  4520. * Domain: [-Infinity, Infinity]
  4521. * Range: [-Infinity, Infinity]
  4522. *
  4523. * tan(0) = 0
  4524. * tan(-0) = -0
  4525. * tan(Infinity) = NaN
  4526. * tan(-Infinity) = NaN
  4527. * tan(NaN) = NaN
  4528. *
  4529. */
  4530. P.tangent = P.tan = function () {
  4531. var pr,rm,
  4532. x = this,
  4533. Ctor = x.constructor;
  4534. if (!x.isFinite()) return new Ctor(NaN);
  4535. if (x.isZero()) return new Ctor(x);
  4536. pr = Ctor.precision;
  4537. rm = Ctor.rounding;
  4538. Ctor.precision = pr + 10;
  4539. Ctor.rounding = 1;
  4540. x = x.sin();
  4541. x.s = 1;
  4542. x = divide(x, new Ctor(1).minus(x.times(x)).sqrt(), pr + 10, 0);
  4543. Ctor.precision = pr;
  4544. Ctor.rounding = rm;
  4545. return finalise(quadrant == 2 || quadrant == 4 ? x.neg() : x, pr, rm, true);
  4546. };
  4547. /*
  4548. * n * 0 = 0
  4549. * n * N = N
  4550. * n * I = I
  4551. * 0 * n = 0
  4552. * 0 * 0 = 0
  4553. * 0 * N = N
  4554. * 0 * I = N
  4555. * N * n = N
  4556. * N * 0 = N
  4557. * N * N = N
  4558. * N * I = N
  4559. * I * n = I
  4560. * I * 0 = N
  4561. * I * N = N
  4562. * I * I = I
  4563. *
  4564. * Return a new Decimal whose value is this Decimal times `y`, rounded to `precision` significant
  4565. * digits using rounding mode `rounding`.
  4566. *
  4567. */
  4568. P.times = P.mul = function (y) {
  4569. var carry,e,i,k,r,rL,t,xdL,ydL,
  4570. x = this,
  4571. Ctor = x.constructor,
  4572. xd = x.d,
  4573. yd = (y = new Ctor(y)).d;
  4574. y.s *= x.s;
  4575. // If either is NaN, ±Infinity or ±0...
  4576. if (!xd || !xd[0] || !yd || !yd[0]) {
  4577. return new Ctor(!y.s || xd && !xd[0] && !yd || yd && !yd[0] && !xd
  4578. // Return NaN if either is NaN.
  4579. // Return NaN if x is ±0 and y is ±Infinity, or y is ±0 and x is ±Infinity.
  4580. ? NaN
  4581. // Return ±Infinity if either is ±Infinity.
  4582. // Return ±0 if either is ±0.
  4583. : !xd || !yd ? y.s / 0 : y.s * 0);
  4584. }
  4585. e = mathfloor(x.e / LOG_BASE) + mathfloor(y.e / LOG_BASE);
  4586. xdL = xd.length;
  4587. ydL = yd.length;
  4588. // Ensure xd points to the longer array.
  4589. if (xdL < ydL) {
  4590. r = xd;
  4591. xd = yd;
  4592. yd = r;
  4593. rL = xdL;
  4594. xdL = ydL;
  4595. ydL = rL;
  4596. }
  4597. // Initialise the result array with zeros.
  4598. r = [];
  4599. rL = xdL + ydL;
  4600. for (i = rL; i--;) {r.push(0);}
  4601. // Multiply!
  4602. for (i = ydL; --i >= 0;) {
  4603. carry = 0;
  4604. for (k = xdL + i; k > i;) {
  4605. t = r[k] + yd[i] * xd[k - i - 1] + carry;
  4606. r[k--] = t % BASE | 0;
  4607. carry = t / BASE | 0;
  4608. }
  4609. r[k] = (r[k] + carry) % BASE | 0;
  4610. }
  4611. // Remove trailing zeros.
  4612. for (; !r[--rL];) {r.pop();}
  4613. if (carry) ++e;else
  4614. r.shift();
  4615. y.d = r;
  4616. y.e = getBase10Exponent(r, e);
  4617. return external ? finalise(y, Ctor.precision, Ctor.rounding) : y;
  4618. };
  4619. /*
  4620. * Return a string representing the value of this Decimal in base 2, round to `sd` significant
  4621. * digits using rounding mode `rm`.
  4622. *
  4623. * If the optional `sd` argument is present then return binary exponential notation.
  4624. *
  4625. * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.
  4626. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
  4627. *
  4628. */
  4629. P.toBinary = function (sd, rm) {
  4630. return toStringBinary(this, 2, sd, rm);
  4631. };
  4632. /*
  4633. * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `dp`
  4634. * decimal places using rounding mode `rm` or `rounding` if `rm` is omitted.
  4635. *
  4636. * If `dp` is omitted, return a new Decimal whose value is the value of this Decimal.
  4637. *
  4638. * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.
  4639. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
  4640. *
  4641. */
  4642. P.toDecimalPlaces = P.toDP = function (dp, rm) {
  4643. var x = this,
  4644. Ctor = x.constructor;
  4645. x = new Ctor(x);
  4646. if (dp === void 0) return x;
  4647. checkInt32(dp, 0, MAX_DIGITS);
  4648. if (rm === void 0) rm = Ctor.rounding;else
  4649. checkInt32(rm, 0, 8);
  4650. return finalise(x, dp + x.e + 1, rm);
  4651. };
  4652. /*
  4653. * Return a string representing the value of this Decimal in exponential notation rounded to
  4654. * `dp` fixed decimal places using rounding mode `rounding`.
  4655. *
  4656. * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.
  4657. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
  4658. *
  4659. */
  4660. P.toExponential = function (dp, rm) {
  4661. var str,
  4662. x = this,
  4663. Ctor = x.constructor;
  4664. if (dp === void 0) {
  4665. str = finiteToString(x, true);
  4666. } else {
  4667. checkInt32(dp, 0, MAX_DIGITS);
  4668. if (rm === void 0) rm = Ctor.rounding;else
  4669. checkInt32(rm, 0, 8);
  4670. x = finalise(new Ctor(x), dp + 1, rm);
  4671. str = finiteToString(x, true, dp + 1);
  4672. }
  4673. return x.isNeg() && !x.isZero() ? '-' + str : str;
  4674. };
  4675. /*
  4676. * Return a string representing the value of this Decimal in normal (fixed-point) notation to
  4677. * `dp` fixed decimal places and rounded using rounding mode `rm` or `rounding` if `rm` is
  4678. * omitted.
  4679. *
  4680. * As with JavaScript numbers, (-0).toFixed(0) is '0', but e.g. (-0.00001).toFixed(0) is '-0'.
  4681. *
  4682. * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.
  4683. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
  4684. *
  4685. * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.
  4686. * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.
  4687. * (-0).toFixed(3) is '0.000'.
  4688. * (-0.5).toFixed(0) is '-0'.
  4689. *
  4690. */
  4691. P.toFixed = function (dp, rm) {
  4692. var str,y,
  4693. x = this,
  4694. Ctor = x.constructor;
  4695. if (dp === void 0) {
  4696. str = finiteToString(x);
  4697. } else {
  4698. checkInt32(dp, 0, MAX_DIGITS);
  4699. if (rm === void 0) rm = Ctor.rounding;else
  4700. checkInt32(rm, 0, 8);
  4701. y = finalise(new Ctor(x), dp + x.e + 1, rm);
  4702. str = finiteToString(y, false, dp + y.e + 1);
  4703. }
  4704. // To determine whether to add the minus sign look at the value before it was rounded,
  4705. // i.e. look at `x` rather than `y`.
  4706. return x.isNeg() && !x.isZero() ? '-' + str : str;
  4707. };
  4708. /*
  4709. * Return an array representing the value of this Decimal as a simple fraction with an integer
  4710. * numerator and an integer denominator.
  4711. *
  4712. * The denominator will be a positive non-zero value less than or equal to the specified maximum
  4713. * denominator. If a maximum denominator is not specified, the denominator will be the lowest
  4714. * value necessary to represent the number exactly.
  4715. *
  4716. * [maxD] {number|string|Decimal} Maximum denominator. Integer >= 1 and < Infinity.
  4717. *
  4718. */
  4719. P.toFraction = function (maxD) {
  4720. var d,d0,d1,d2,e,k,n,n0,n1,pr,q,r,
  4721. x = this,
  4722. xd = x.d,
  4723. Ctor = x.constructor;
  4724. if (!xd) return new Ctor(x);
  4725. n1 = d0 = new Ctor(1);
  4726. d1 = n0 = new Ctor(0);
  4727. d = new Ctor(d1);
  4728. e = d.e = getPrecision(xd) - x.e - 1;
  4729. k = e % LOG_BASE;
  4730. d.d[0] = mathpow(10, k < 0 ? LOG_BASE + k : k);
  4731. if (maxD == null) {
  4732. // d is 10**e, the minimum max-denominator needed.
  4733. maxD = e > 0 ? d : n1;
  4734. } else {
  4735. n = new Ctor(maxD);
  4736. if (!n.isInt() || n.lt(n1)) throw Error(invalidArgument + n);
  4737. maxD = n.gt(d) ? e > 0 ? d : n1 : n;
  4738. }
  4739. external = false;
  4740. n = new Ctor(digitsToString(xd));
  4741. pr = Ctor.precision;
  4742. Ctor.precision = e = xd.length * LOG_BASE * 2;
  4743. for (;;) {
  4744. q = divide(n, d, 0, 1, 1);
  4745. d2 = d0.plus(q.times(d1));
  4746. if (d2.cmp(maxD) == 1) break;
  4747. d0 = d1;
  4748. d1 = d2;
  4749. d2 = n1;
  4750. n1 = n0.plus(q.times(d2));
  4751. n0 = d2;
  4752. d2 = d;
  4753. d = n.minus(q.times(d2));
  4754. n = d2;
  4755. }
  4756. d2 = divide(maxD.minus(d0), d1, 0, 1, 1);
  4757. n0 = n0.plus(d2.times(n1));
  4758. d0 = d0.plus(d2.times(d1));
  4759. n0.s = n1.s = x.s;
  4760. // Determine which fraction is closer to x, n0/d0 or n1/d1?
  4761. r = divide(n1, d1, e, 1).minus(x).abs().cmp(divide(n0, d0, e, 1).minus(x).abs()) < 1 ?
  4762. [n1, d1] : [n0, d0];
  4763. Ctor.precision = pr;
  4764. external = true;
  4765. return r;
  4766. };
  4767. /*
  4768. * Return a string representing the value of this Decimal in base 16, round to `sd` significant
  4769. * digits using rounding mode `rm`.
  4770. *
  4771. * If the optional `sd` argument is present then return binary exponential notation.
  4772. *
  4773. * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.
  4774. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
  4775. *
  4776. */
  4777. P.toHexadecimal = P.toHex = function (sd, rm) {
  4778. return toStringBinary(this, 16, sd, rm);
  4779. };
  4780. /*
  4781. * Returns a new Decimal whose value is the nearest multiple of `y` in the direction of rounding
  4782. * mode `rm`, or `Decimal.rounding` if `rm` is omitted, to the value of this Decimal.
  4783. *
  4784. * The return value will always have the same sign as this Decimal, unless either this Decimal
  4785. * or `y` is NaN, in which case the return value will be also be NaN.
  4786. *
  4787. * The return value is not affected by the value of `precision`.
  4788. *
  4789. * y {number|string|Decimal} The magnitude to round to a multiple of.
  4790. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
  4791. *
  4792. * 'toNearest() rounding mode not an integer: {rm}'
  4793. * 'toNearest() rounding mode out of range: {rm}'
  4794. *
  4795. */
  4796. P.toNearest = function (y, rm) {
  4797. var x = this,
  4798. Ctor = x.constructor;
  4799. x = new Ctor(x);
  4800. if (y == null) {
  4801. // If x is not finite, return x.
  4802. if (!x.d) return x;
  4803. y = new Ctor(1);
  4804. rm = Ctor.rounding;
  4805. } else {
  4806. y = new Ctor(y);
  4807. if (rm === void 0) {
  4808. rm = Ctor.rounding;
  4809. } else {
  4810. checkInt32(rm, 0, 8);
  4811. }
  4812. // If x is not finite, return x if y is not NaN, else NaN.
  4813. if (!x.d) return y.s ? x : y;
  4814. // If y is not finite, return Infinity with the sign of x if y is Infinity, else NaN.
  4815. if (!y.d) {
  4816. if (y.s) y.s = x.s;
  4817. return y;
  4818. }
  4819. }
  4820. // If y is not zero, calculate the nearest multiple of y to x.
  4821. if (y.d[0]) {
  4822. external = false;
  4823. x = divide(x, y, 0, rm, 1).times(y);
  4824. external = true;
  4825. finalise(x);
  4826. // If y is zero, return zero with the sign of x.
  4827. } else {
  4828. y.s = x.s;
  4829. x = y;
  4830. }
  4831. return x;
  4832. };
  4833. /*
  4834. * Return the value of this Decimal converted to a number primitive.
  4835. * Zero keeps its sign.
  4836. *
  4837. */
  4838. P.toNumber = function () {
  4839. return +this;
  4840. };
  4841. /*
  4842. * Return a string representing the value of this Decimal in base 8, round to `sd` significant
  4843. * digits using rounding mode `rm`.
  4844. *
  4845. * If the optional `sd` argument is present then return binary exponential notation.
  4846. *
  4847. * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.
  4848. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
  4849. *
  4850. */
  4851. P.toOctal = function (sd, rm) {
  4852. return toStringBinary(this, 8, sd, rm);
  4853. };
  4854. /*
  4855. * Return a new Decimal whose value is the value of this Decimal raised to the power `y`, rounded
  4856. * to `precision` significant digits using rounding mode `rounding`.
  4857. *
  4858. * ECMAScript compliant.
  4859. *
  4860. * pow(x, NaN) = NaN
  4861. * pow(x, ±0) = 1
  4862. * pow(NaN, non-zero) = NaN
  4863. * pow(abs(x) > 1, +Infinity) = +Infinity
  4864. * pow(abs(x) > 1, -Infinity) = +0
  4865. * pow(abs(x) == 1, ±Infinity) = NaN
  4866. * pow(abs(x) < 1, +Infinity) = +0
  4867. * pow(abs(x) < 1, -Infinity) = +Infinity
  4868. * pow(+Infinity, y > 0) = +Infinity
  4869. * pow(+Infinity, y < 0) = +0
  4870. * pow(-Infinity, odd integer > 0) = -Infinity
  4871. * pow(-Infinity, even integer > 0) = +Infinity
  4872. * pow(-Infinity, odd integer < 0) = -0
  4873. * pow(-Infinity, even integer < 0) = +0
  4874. * pow(+0, y > 0) = +0
  4875. * pow(+0, y < 0) = +Infinity
  4876. * pow(-0, odd integer > 0) = -0
  4877. * pow(-0, even integer > 0) = +0
  4878. * pow(-0, odd integer < 0) = -Infinity
  4879. * pow(-0, even integer < 0) = +Infinity
  4880. * pow(finite x < 0, finite non-integer) = NaN
  4881. *
  4882. * For non-integer or very large exponents pow(x, y) is calculated using
  4883. *
  4884. * x^y = exp(y*ln(x))
  4885. *
  4886. * Assuming the first 15 rounding digits are each equally likely to be any digit 0-9, the
  4887. * probability of an incorrectly rounded result
  4888. * P([49]9{14} | [50]0{14}) = 2 * 0.2 * 10^-14 = 4e-15 = 1/2.5e+14
  4889. * i.e. 1 in 250,000,000,000,000
  4890. *
  4891. * If a result is incorrectly rounded the maximum error will be 1 ulp (unit in last place).
  4892. *
  4893. * y {number|string|Decimal} The power to which to raise this Decimal.
  4894. *
  4895. */
  4896. P.toPower = P.pow = function (y) {
  4897. var e,k,pr,r,rm,s,
  4898. x = this,
  4899. Ctor = x.constructor,
  4900. yn = +(y = new Ctor(y));
  4901. // Either ±Infinity, NaN or ±0?
  4902. if (!x.d || !y.d || !x.d[0] || !y.d[0]) return new Ctor(mathpow(+x, yn));
  4903. x = new Ctor(x);
  4904. if (x.eq(1)) return x;
  4905. pr = Ctor.precision;
  4906. rm = Ctor.rounding;
  4907. if (y.eq(1)) return finalise(x, pr, rm);
  4908. // y exponent
  4909. e = mathfloor(y.e / LOG_BASE);
  4910. // If y is a small integer use the 'exponentiation by squaring' algorithm.
  4911. if (e >= y.d.length - 1 && (k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) {
  4912. r = intPow(Ctor, x, k, pr);
  4913. return y.s < 0 ? new Ctor(1).div(r) : finalise(r, pr, rm);
  4914. }
  4915. s = x.s;
  4916. // if x is negative
  4917. if (s < 0) {
  4918. // if y is not an integer
  4919. if (e < y.d.length - 1) return new Ctor(NaN);
  4920. // Result is positive if x is negative and the last digit of integer y is even.
  4921. if ((y.d[e] & 1) == 0) s = 1;
  4922. // if x.eq(-1)
  4923. if (x.e == 0 && x.d[0] == 1 && x.d.length == 1) {
  4924. x.s = s;
  4925. return x;
  4926. }
  4927. }
  4928. // Estimate result exponent.
  4929. // x^y = 10^e, where e = y * log10(x)
  4930. // log10(x) = log10(x_significand) + x_exponent
  4931. // log10(x_significand) = ln(x_significand) / ln(10)
  4932. k = mathpow(+x, yn);
  4933. e = k == 0 || !isFinite(k) ?
  4934. mathfloor(yn * (Math.log('0.' + digitsToString(x.d)) / Math.LN10 + x.e + 1)) :
  4935. new Ctor(k + '').e;
  4936. // Exponent estimate may be incorrect e.g. x: 0.999999999999999999, y: 2.29, e: 0, r.e: -1.
  4937. // Overflow/underflow?
  4938. if (e > Ctor.maxE + 1 || e < Ctor.minE - 1) return new Ctor(e > 0 ? s / 0 : 0);
  4939. external = false;
  4940. Ctor.rounding = x.s = 1;
  4941. // Estimate the extra guard digits needed to ensure five correct rounding digits from
  4942. // naturalLogarithm(x). Example of failure without these extra digits (precision: 10):
  4943. // new Decimal(2.32456).pow('2087987436534566.46411')
  4944. // should be 1.162377823e+764914905173815, but is 1.162355823e+764914905173815
  4945. k = Math.min(12, (e + '').length);
  4946. // r = x^y = exp(y*ln(x))
  4947. r = naturalExponential(y.times(naturalLogarithm(x, pr + k)), pr);
  4948. // r may be Infinity, e.g. (0.9999999999999999).pow(-1e+40)
  4949. if (r.d) {
  4950. // Truncate to the required precision plus five rounding digits.
  4951. r = finalise(r, pr + 5, 1);
  4952. // If the rounding digits are [49]9999 or [50]0000 increase the precision by 10 and recalculate
  4953. // the result.
  4954. if (checkRoundingDigits(r.d, pr, rm)) {
  4955. e = pr + 10;
  4956. // Truncate to the increased precision plus five rounding digits.
  4957. r = finalise(naturalExponential(y.times(naturalLogarithm(x, e + k)), e), e + 5, 1);
  4958. // Check for 14 nines from the 2nd rounding digit (the first rounding digit may be 4 or 9).
  4959. if (+digitsToString(r.d).slice(pr + 1, pr + 15) + 1 == 1e14) {
  4960. r = finalise(r, pr + 1, 0);
  4961. }
  4962. }
  4963. }
  4964. r.s = s;
  4965. external = true;
  4966. Ctor.rounding = rm;
  4967. return finalise(r, pr, rm);
  4968. };
  4969. /*
  4970. * Return a string representing the value of this Decimal rounded to `sd` significant digits
  4971. * using rounding mode `rounding`.
  4972. *
  4973. * Return exponential notation if `sd` is less than the number of digits necessary to represent
  4974. * the integer part of the value in normal notation.
  4975. *
  4976. * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.
  4977. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
  4978. *
  4979. */
  4980. P.toPrecision = function (sd, rm) {
  4981. var str,
  4982. x = this,
  4983. Ctor = x.constructor;
  4984. if (sd === void 0) {
  4985. str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);
  4986. } else {
  4987. checkInt32(sd, 1, MAX_DIGITS);
  4988. if (rm === void 0) rm = Ctor.rounding;else
  4989. checkInt32(rm, 0, 8);
  4990. x = finalise(new Ctor(x), sd, rm);
  4991. str = finiteToString(x, sd <= x.e || x.e <= Ctor.toExpNeg, sd);
  4992. }
  4993. return x.isNeg() && !x.isZero() ? '-' + str : str;
  4994. };
  4995. /*
  4996. * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `sd`
  4997. * significant digits using rounding mode `rm`, or to `precision` and `rounding` respectively if
  4998. * omitted.
  4999. *
  5000. * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.
  5001. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
  5002. *
  5003. * 'toSD() digits out of range: {sd}'
  5004. * 'toSD() digits not an integer: {sd}'
  5005. * 'toSD() rounding mode not an integer: {rm}'
  5006. * 'toSD() rounding mode out of range: {rm}'
  5007. *
  5008. */
  5009. P.toSignificantDigits = P.toSD = function (sd, rm) {
  5010. var x = this,
  5011. Ctor = x.constructor;
  5012. if (sd === void 0) {
  5013. sd = Ctor.precision;
  5014. rm = Ctor.rounding;
  5015. } else {
  5016. checkInt32(sd, 1, MAX_DIGITS);
  5017. if (rm === void 0) rm = Ctor.rounding;else
  5018. checkInt32(rm, 0, 8);
  5019. }
  5020. return finalise(new Ctor(x), sd, rm);
  5021. };
  5022. /*
  5023. * Return a string representing the value of this Decimal.
  5024. *
  5025. * Return exponential notation if this Decimal has a positive exponent equal to or greater than
  5026. * `toExpPos`, or a negative exponent equal to or less than `toExpNeg`.
  5027. *
  5028. */
  5029. P.toString = function () {
  5030. var x = this,
  5031. Ctor = x.constructor,
  5032. str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);
  5033. return x.isNeg() && !x.isZero() ? '-' + str : str;
  5034. };
  5035. /*
  5036. * Return a new Decimal whose value is the value of this Decimal truncated to a whole number.
  5037. *
  5038. */
  5039. P.truncated = P.trunc = function () {
  5040. return finalise(new this.constructor(this), this.e + 1, 1);
  5041. };
  5042. /*
  5043. * Return a string representing the value of this Decimal.
  5044. * Unlike `toString`, negative zero will include the minus sign.
  5045. *
  5046. */
  5047. P.valueOf = P.toJSON = function () {
  5048. var x = this,
  5049. Ctor = x.constructor,
  5050. str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);
  5051. return x.isNeg() ? '-' + str : str;
  5052. };
  5053. // Helper functions for Decimal.prototype (P) and/or Decimal methods, and their callers.
  5054. /*
  5055. * digitsToString P.cubeRoot, P.logarithm, P.squareRoot, P.toFraction, P.toPower,
  5056. * finiteToString, naturalExponential, naturalLogarithm
  5057. * checkInt32 P.toDecimalPlaces, P.toExponential, P.toFixed, P.toNearest,
  5058. * P.toPrecision, P.toSignificantDigits, toStringBinary, random
  5059. * checkRoundingDigits P.logarithm, P.toPower, naturalExponential, naturalLogarithm
  5060. * convertBase toStringBinary, parseOther
  5061. * cos P.cos
  5062. * divide P.atanh, P.cubeRoot, P.dividedBy, P.dividedToIntegerBy,
  5063. * P.logarithm, P.modulo, P.squareRoot, P.tan, P.tanh, P.toFraction,
  5064. * P.toNearest, toStringBinary, naturalExponential, naturalLogarithm,
  5065. * taylorSeries, atan2, parseOther
  5066. * finalise P.absoluteValue, P.atan, P.atanh, P.ceil, P.cos, P.cosh,
  5067. * P.cubeRoot, P.dividedToIntegerBy, P.floor, P.logarithm, P.minus,
  5068. * P.modulo, P.negated, P.plus, P.round, P.sin, P.sinh, P.squareRoot,
  5069. * P.tan, P.times, P.toDecimalPlaces, P.toExponential, P.toFixed,
  5070. * P.toNearest, P.toPower, P.toPrecision, P.toSignificantDigits,
  5071. * P.truncated, divide, getLn10, getPi, naturalExponential,
  5072. * naturalLogarithm, ceil, floor, round, trunc
  5073. * finiteToString P.toExponential, P.toFixed, P.toPrecision, P.toString, P.valueOf,
  5074. * toStringBinary
  5075. * getBase10Exponent P.minus, P.plus, P.times, parseOther
  5076. * getLn10 P.logarithm, naturalLogarithm
  5077. * getPi P.acos, P.asin, P.atan, toLessThanHalfPi, atan2
  5078. * getPrecision P.precision, P.toFraction
  5079. * getZeroString digitsToString, finiteToString
  5080. * intPow P.toPower, parseOther
  5081. * isOdd toLessThanHalfPi
  5082. * maxOrMin max, min
  5083. * naturalExponential P.naturalExponential, P.toPower
  5084. * naturalLogarithm P.acosh, P.asinh, P.atanh, P.logarithm, P.naturalLogarithm,
  5085. * P.toPower, naturalExponential
  5086. * nonFiniteToString finiteToString, toStringBinary
  5087. * parseDecimal Decimal
  5088. * parseOther Decimal
  5089. * sin P.sin
  5090. * taylorSeries P.cosh, P.sinh, cos, sin
  5091. * toLessThanHalfPi P.cos, P.sin
  5092. * toStringBinary P.toBinary, P.toHexadecimal, P.toOctal
  5093. * truncate intPow
  5094. *
  5095. * Throws: P.logarithm, P.precision, P.toFraction, checkInt32, getLn10, getPi,
  5096. * naturalLogarithm, config, parseOther, random, Decimal
  5097. */
  5098. function digitsToString(d) {
  5099. var i,k,ws,
  5100. indexOfLastWord = d.length - 1,
  5101. str = '',
  5102. w = d[0];
  5103. if (indexOfLastWord > 0) {
  5104. str += w;
  5105. for (i = 1; i < indexOfLastWord; i++) {
  5106. ws = d[i] + '';
  5107. k = LOG_BASE - ws.length;
  5108. if (k) str += getZeroString(k);
  5109. str += ws;
  5110. }
  5111. w = d[i];
  5112. ws = w + '';
  5113. k = LOG_BASE - ws.length;
  5114. if (k) str += getZeroString(k);
  5115. } else if (w === 0) {
  5116. return '0';
  5117. }
  5118. // Remove trailing zeros of last w.
  5119. for (; w % 10 === 0;) {w /= 10;}
  5120. return str + w;
  5121. }
  5122. function checkInt32(i, min, max) {
  5123. if (i !== ~~i || i < min || i > max) {
  5124. throw Error(invalidArgument + i);
  5125. }
  5126. }
  5127. /*
  5128. * Check 5 rounding digits if `repeating` is null, 4 otherwise.
  5129. * `repeating == null` if caller is `log` or `pow`,
  5130. * `repeating != null` if caller is `naturalLogarithm` or `naturalExponential`.
  5131. */
  5132. function checkRoundingDigits(d, i, rm, repeating) {
  5133. var di, k, r, rd;
  5134. // Get the length of the first word of the array d.
  5135. for (k = d[0]; k >= 10; k /= 10) {--i;}
  5136. // Is the rounding digit in the first word of d?
  5137. if (--i < 0) {
  5138. i += LOG_BASE;
  5139. di = 0;
  5140. } else {
  5141. di = Math.ceil((i + 1) / LOG_BASE);
  5142. i %= LOG_BASE;
  5143. }
  5144. // i is the index (0 - 6) of the rounding digit.
  5145. // E.g. if within the word 3487563 the first rounding digit is 5,
  5146. // then i = 4, k = 1000, rd = 3487563 % 1000 = 563
  5147. k = mathpow(10, LOG_BASE - i);
  5148. rd = d[di] % k | 0;
  5149. if (repeating == null) {
  5150. if (i < 3) {
  5151. if (i == 0) rd = rd / 100 | 0;else
  5152. if (i == 1) rd = rd / 10 | 0;
  5153. r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 50000 || rd == 0;
  5154. } else {
  5155. r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) &&
  5156. (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 ||
  5157. (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0;
  5158. }
  5159. } else {
  5160. if (i < 4) {
  5161. if (i == 0) rd = rd / 1000 | 0;else
  5162. if (i == 1) rd = rd / 100 | 0;else
  5163. if (i == 2) rd = rd / 10 | 0;
  5164. r = (repeating || rm < 4) && rd == 9999 || !repeating && rm > 3 && rd == 4999;
  5165. } else {
  5166. r = ((repeating || rm < 4) && rd + 1 == k ||
  5167. !repeating && rm > 3 && rd + 1 == k / 2) &&
  5168. (d[di + 1] / k / 1000 | 0) == mathpow(10, i - 3) - 1;
  5169. }
  5170. }
  5171. return r;
  5172. }
  5173. // Convert string of `baseIn` to an array of numbers of `baseOut`.
  5174. // Eg. convertBase('255', 10, 16) returns [15, 15].
  5175. // Eg. convertBase('ff', 16, 10) returns [2, 5, 5].
  5176. function convertBase(str, baseIn, baseOut) {
  5177. var j,
  5178. arr = [0],
  5179. arrL,
  5180. i = 0,
  5181. strL = str.length;
  5182. for (; i < strL;) {
  5183. for (arrL = arr.length; arrL--;) {arr[arrL] *= baseIn;}
  5184. arr[0] += NUMERALS.indexOf(str.charAt(i++));
  5185. for (j = 0; j < arr.length; j++) {
  5186. if (arr[j] > baseOut - 1) {
  5187. if (arr[j + 1] === void 0) arr[j + 1] = 0;
  5188. arr[j + 1] += arr[j] / baseOut | 0;
  5189. arr[j] %= baseOut;
  5190. }
  5191. }
  5192. }
  5193. return arr.reverse();
  5194. }
  5195. /*
  5196. * cos(x) = 1 - x^2/2! + x^4/4! - ...
  5197. * |x| < pi/2
  5198. *
  5199. */
  5200. function cosine(Ctor, x) {
  5201. var k, len, y;
  5202. if (x.isZero()) return x;
  5203. // Argument reduction: cos(4x) = 8*(cos^4(x) - cos^2(x)) + 1
  5204. // i.e. cos(x) = 8*(cos^4(x/4) - cos^2(x/4)) + 1
  5205. // Estimate the optimum number of times to use the argument reduction.
  5206. len = x.d.length;
  5207. if (len < 32) {
  5208. k = Math.ceil(len / 3);
  5209. y = (1 / tinyPow(4, k)).toString();
  5210. } else {
  5211. k = 16;
  5212. y = '2.3283064365386962890625e-10';
  5213. }
  5214. Ctor.precision += k;
  5215. x = taylorSeries(Ctor, 1, x.times(y), new Ctor(1));
  5216. // Reverse argument reduction
  5217. for (var i = k; i--;) {
  5218. var cos2x = x.times(x);
  5219. x = cos2x.times(cos2x).minus(cos2x).times(8).plus(1);
  5220. }
  5221. Ctor.precision -= k;
  5222. return x;
  5223. }
  5224. /*
  5225. * Perform division in the specified base.
  5226. */
  5227. var divide = function () {
  5228. // Assumes non-zero x and k, and hence non-zero result.
  5229. function multiplyInteger(x, k, base) {
  5230. var temp,
  5231. carry = 0,
  5232. i = x.length;
  5233. for (x = x.slice(); i--;) {
  5234. temp = x[i] * k + carry;
  5235. x[i] = temp % base | 0;
  5236. carry = temp / base | 0;
  5237. }
  5238. if (carry) x.unshift(carry);
  5239. return x;
  5240. }
  5241. function compare(a, b, aL, bL) {
  5242. var i, r;
  5243. if (aL != bL) {
  5244. r = aL > bL ? 1 : -1;
  5245. } else {
  5246. for (i = r = 0; i < aL; i++) {
  5247. if (a[i] != b[i]) {
  5248. r = a[i] > b[i] ? 1 : -1;
  5249. break;
  5250. }
  5251. }
  5252. }
  5253. return r;
  5254. }
  5255. function subtract(a, b, aL, base) {
  5256. var i = 0;
  5257. // Subtract b from a.
  5258. for (; aL--;) {
  5259. a[aL] -= i;
  5260. i = a[aL] < b[aL] ? 1 : 0;
  5261. a[aL] = i * base + a[aL] - b[aL];
  5262. }
  5263. // Remove leading zeros.
  5264. for (; !a[0] && a.length > 1;) {a.shift();}
  5265. }
  5266. return function (x, y, pr, rm, dp, base) {
  5267. var cmp,e,i,k,logBase,more,prod,prodL,q,qd,rem,remL,rem0,sd,t,xi,xL,yd0,
  5268. yL,yz,
  5269. Ctor = x.constructor,
  5270. sign = x.s == y.s ? 1 : -1,
  5271. xd = x.d,
  5272. yd = y.d;
  5273. // Either NaN, Infinity or 0?
  5274. if (!xd || !xd[0] || !yd || !yd[0]) {
  5275. return new Ctor( // Return NaN if either NaN, or both Infinity or 0.
  5276. !x.s || !y.s || (xd ? yd && xd[0] == yd[0] : !yd) ? NaN :
  5277. // Return ±0 if x is 0 or y is ±Infinity, or return ±Infinity as y is 0.
  5278. xd && xd[0] == 0 || !yd ? sign * 0 : sign / 0);
  5279. }
  5280. if (base) {
  5281. logBase = 1;
  5282. e = x.e - y.e;
  5283. } else {
  5284. base = BASE;
  5285. logBase = LOG_BASE;
  5286. e = mathfloor(x.e / logBase) - mathfloor(y.e / logBase);
  5287. }
  5288. yL = yd.length;
  5289. xL = xd.length;
  5290. q = new Ctor(sign);
  5291. qd = q.d = [];
  5292. // Result exponent may be one less than e.
  5293. // The digit array of a Decimal from toStringBinary may have trailing zeros.
  5294. for (i = 0; yd[i] == (xd[i] || 0); i++) {;}
  5295. if (yd[i] > (xd[i] || 0)) e--;
  5296. if (pr == null) {
  5297. sd = pr = Ctor.precision;
  5298. rm = Ctor.rounding;
  5299. } else if (dp) {
  5300. sd = pr + (x.e - y.e) + 1;
  5301. } else {
  5302. sd = pr;
  5303. }
  5304. if (sd < 0) {
  5305. qd.push(1);
  5306. more = true;
  5307. } else {
  5308. // Convert precision in number of base 10 digits to base 1e7 digits.
  5309. sd = sd / logBase + 2 | 0;
  5310. i = 0;
  5311. // divisor < 1e7
  5312. if (yL == 1) {
  5313. k = 0;
  5314. yd = yd[0];
  5315. sd++;
  5316. // k is the carry.
  5317. for (; (i < xL || k) && sd--; i++) {
  5318. t = k * base + (xd[i] || 0);
  5319. qd[i] = t / yd | 0;
  5320. k = t % yd | 0;
  5321. }
  5322. more = k || i < xL;
  5323. // divisor >= 1e7
  5324. } else {
  5325. // Normalise xd and yd so highest order digit of yd is >= base/2
  5326. k = base / (yd[0] + 1) | 0;
  5327. if (k > 1) {
  5328. yd = multiplyInteger(yd, k, base);
  5329. xd = multiplyInteger(xd, k, base);
  5330. yL = yd.length;
  5331. xL = xd.length;
  5332. }
  5333. xi = yL;
  5334. rem = xd.slice(0, yL);
  5335. remL = rem.length;
  5336. // Add zeros to make remainder as long as divisor.
  5337. for (; remL < yL;) {rem[remL++] = 0;}
  5338. yz = yd.slice();
  5339. yz.unshift(0);
  5340. yd0 = yd[0];
  5341. if (yd[1] >= base / 2) ++yd0;
  5342. do {
  5343. k = 0;
  5344. // Compare divisor and remainder.
  5345. cmp = compare(yd, rem, yL, remL);
  5346. // If divisor < remainder.
  5347. if (cmp < 0) {
  5348. // Calculate trial digit, k.
  5349. rem0 = rem[0];
  5350. if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);
  5351. // k will be how many times the divisor goes into the current remainder.
  5352. k = rem0 / yd0 | 0;
  5353. // Algorithm:
  5354. // 1. product = divisor * trial digit (k)
  5355. // 2. if product > remainder: product -= divisor, k--
  5356. // 3. remainder -= product
  5357. // 4. if product was < remainder at 2:
  5358. // 5. compare new remainder and divisor
  5359. // 6. If remainder > divisor: remainder -= divisor, k++
  5360. if (k > 1) {
  5361. if (k >= base) k = base - 1;
  5362. // product = divisor * trial digit.
  5363. prod = multiplyInteger(yd, k, base);
  5364. prodL = prod.length;
  5365. remL = rem.length;
  5366. // Compare product and remainder.
  5367. cmp = compare(prod, rem, prodL, remL);
  5368. // product > remainder.
  5369. if (cmp == 1) {
  5370. k--;
  5371. // Subtract divisor from product.
  5372. subtract(prod, yL < prodL ? yz : yd, prodL, base);
  5373. }
  5374. } else {
  5375. // cmp is -1.
  5376. // If k is 0, there is no need to compare yd and rem again below, so change cmp to 1
  5377. // to avoid it. If k is 1 there is a need to compare yd and rem again below.
  5378. if (k == 0) cmp = k = 1;
  5379. prod = yd.slice();
  5380. }
  5381. prodL = prod.length;
  5382. if (prodL < remL) prod.unshift(0);
  5383. // Subtract product from remainder.
  5384. subtract(rem, prod, remL, base);
  5385. // If product was < previous remainder.
  5386. if (cmp == -1) {
  5387. remL = rem.length;
  5388. // Compare divisor and new remainder.
  5389. cmp = compare(yd, rem, yL, remL);
  5390. // If divisor < new remainder, subtract divisor from remainder.
  5391. if (cmp < 1) {
  5392. k++;
  5393. // Subtract divisor from remainder.
  5394. subtract(rem, yL < remL ? yz : yd, remL, base);
  5395. }
  5396. }
  5397. remL = rem.length;
  5398. } else if (cmp === 0) {
  5399. k++;
  5400. rem = [0];
  5401. } // if cmp === 1, k will be 0
  5402. // Add the next digit, k, to the result array.
  5403. qd[i++] = k;
  5404. // Update the remainder.
  5405. if (cmp && rem[0]) {
  5406. rem[remL++] = xd[xi] || 0;
  5407. } else {
  5408. rem = [xd[xi]];
  5409. remL = 1;
  5410. }
  5411. } while ((xi++ < xL || rem[0] !== void 0) && sd--);
  5412. more = rem[0] !== void 0;
  5413. }
  5414. // Leading zero?
  5415. if (!qd[0]) qd.shift();
  5416. }
  5417. // logBase is 1 when divide is being used for base conversion.
  5418. if (logBase == 1) {
  5419. q.e = e;
  5420. inexact = more;
  5421. } else {
  5422. // To calculate q.e, first get the number of digits of qd[0].
  5423. for (i = 1, k = qd[0]; k >= 10; k /= 10) {i++;}
  5424. q.e = i + e * logBase - 1;
  5425. finalise(q, dp ? pr + q.e + 1 : pr, rm, more);
  5426. }
  5427. return q;
  5428. };
  5429. }();
  5430. /*
  5431. * Round `x` to `sd` significant digits using rounding mode `rm`.
  5432. * Check for over/under-flow.
  5433. */
  5434. function finalise(x, sd, rm, isTruncated) {
  5435. var digits,i,j,k,rd,roundUp,w,xd,xdi,
  5436. Ctor = x.constructor;
  5437. // Don't round if sd is null or undefined.
  5438. out: if (sd != null) {
  5439. xd = x.d;
  5440. // Infinity/NaN.
  5441. if (!xd) return x;
  5442. // rd: the rounding digit, i.e. the digit after the digit that may be rounded up.
  5443. // w: the word of xd containing rd, a base 1e7 number.
  5444. // xdi: the index of w within xd.
  5445. // digits: the number of digits of w.
  5446. // i: what would be the index of rd within w if all the numbers were 7 digits long (i.e. if
  5447. // they had leading zeros)
  5448. // j: if > 0, the actual index of rd within w (if < 0, rd is a leading zero).
  5449. // Get the length of the first word of the digits array xd.
  5450. for (digits = 1, k = xd[0]; k >= 10; k /= 10) {digits++;}
  5451. i = sd - digits;
  5452. // Is the rounding digit in the first word of xd?
  5453. if (i < 0) {
  5454. i += LOG_BASE;
  5455. j = sd;
  5456. w = xd[xdi = 0];
  5457. // Get the rounding digit at index j of w.
  5458. rd = w / mathpow(10, digits - j - 1) % 10 | 0;
  5459. } else {
  5460. xdi = Math.ceil((i + 1) / LOG_BASE);
  5461. k = xd.length;
  5462. if (xdi >= k) {
  5463. if (isTruncated) {
  5464. // Needed by `naturalExponential`, `naturalLogarithm` and `squareRoot`.
  5465. for (; k++ <= xdi;) {xd.push(0);}
  5466. w = rd = 0;
  5467. digits = 1;
  5468. i %= LOG_BASE;
  5469. j = i - LOG_BASE + 1;
  5470. } else {
  5471. break out;
  5472. }
  5473. } else {
  5474. w = k = xd[xdi];
  5475. // Get the number of digits of w.
  5476. for (digits = 1; k >= 10; k /= 10) {digits++;}
  5477. // Get the index of rd within w.
  5478. i %= LOG_BASE;
  5479. // Get the index of rd within w, adjusted for leading zeros.
  5480. // The number of leading zeros of w is given by LOG_BASE - digits.
  5481. j = i - LOG_BASE + digits;
  5482. // Get the rounding digit at index j of w.
  5483. rd = j < 0 ? 0 : w / mathpow(10, digits - j - 1) % 10 | 0;
  5484. }
  5485. }
  5486. // Are there any non-zero digits after the rounding digit?
  5487. isTruncated = isTruncated || sd < 0 ||
  5488. xd[xdi + 1] !== void 0 || (j < 0 ? w : w % mathpow(10, digits - j - 1));
  5489. // The expression `w % mathpow(10, digits - j - 1)` returns all the digits of w to the right
  5490. // of the digit at (left-to-right) index j, e.g. if w is 908714 and j is 2, the expression
  5491. // will give 714.
  5492. roundUp = rm < 4 ?
  5493. (rd || isTruncated) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) :
  5494. rd > 5 || rd == 5 && (rm == 4 || isTruncated || rm == 6 &&
  5495. // Check whether the digit to the left of the rounding digit is odd.
  5496. (i > 0 ? j > 0 ? w / mathpow(10, digits - j) : 0 : xd[xdi - 1]) % 10 & 1 ||
  5497. rm == (x.s < 0 ? 8 : 7));
  5498. if (sd < 1 || !xd[0]) {
  5499. xd.length = 0;
  5500. if (roundUp) {
  5501. // Convert sd to decimal places.
  5502. sd -= x.e + 1;
  5503. // 1, 0.1, 0.01, 0.001, 0.0001 etc.
  5504. xd[0] = mathpow(10, (LOG_BASE - sd % LOG_BASE) % LOG_BASE);
  5505. x.e = -sd || 0;
  5506. } else {
  5507. // Zero.
  5508. xd[0] = x.e = 0;
  5509. }
  5510. return x;
  5511. }
  5512. // Remove excess digits.
  5513. if (i == 0) {
  5514. xd.length = xdi;
  5515. k = 1;
  5516. xdi--;
  5517. } else {
  5518. xd.length = xdi + 1;
  5519. k = mathpow(10, LOG_BASE - i);
  5520. // E.g. 56700 becomes 56000 if 7 is the rounding digit.
  5521. // j > 0 means i > number of leading zeros of w.
  5522. xd[xdi] = j > 0 ? (w / mathpow(10, digits - j) % mathpow(10, j) | 0) * k : 0;
  5523. }
  5524. if (roundUp) {
  5525. for (;;) {
  5526. // Is the digit to be rounded up in the first word of xd?
  5527. if (xdi == 0) {
  5528. // i will be the length of xd[0] before k is added.
  5529. for (i = 1, j = xd[0]; j >= 10; j /= 10) {i++;}
  5530. j = xd[0] += k;
  5531. for (k = 1; j >= 10; j /= 10) {k++;}
  5532. // if i != k the length has increased.
  5533. if (i != k) {
  5534. x.e++;
  5535. if (xd[0] == BASE) xd[0] = 1;
  5536. }
  5537. break;
  5538. } else {
  5539. xd[xdi] += k;
  5540. if (xd[xdi] != BASE) break;
  5541. xd[xdi--] = 0;
  5542. k = 1;
  5543. }
  5544. }
  5545. }
  5546. // Remove trailing zeros.
  5547. for (i = xd.length; xd[--i] === 0;) {xd.pop();}
  5548. }
  5549. if (external) {
  5550. // Overflow?
  5551. if (x.e > Ctor.maxE) {
  5552. // Infinity.
  5553. x.d = null;
  5554. x.e = NaN;
  5555. // Underflow?
  5556. } else if (x.e < Ctor.minE) {
  5557. // Zero.
  5558. x.e = 0;
  5559. x.d = [0];
  5560. // Ctor.underflow = true;
  5561. } // else Ctor.underflow = false;
  5562. }
  5563. return x;
  5564. }
  5565. function finiteToString(x, isExp, sd) {
  5566. if (!x.isFinite()) return nonFiniteToString(x);
  5567. var k,
  5568. e = x.e,
  5569. str = digitsToString(x.d),
  5570. len = str.length;
  5571. if (isExp) {
  5572. if (sd && (k = sd - len) > 0) {
  5573. str = str.charAt(0) + '.' + str.slice(1) + getZeroString(k);
  5574. } else if (len > 1) {
  5575. str = str.charAt(0) + '.' + str.slice(1);
  5576. }
  5577. str = str + (x.e < 0 ? 'e' : 'e+') + x.e;
  5578. } else if (e < 0) {
  5579. str = '0.' + getZeroString(-e - 1) + str;
  5580. if (sd && (k = sd - len) > 0) str += getZeroString(k);
  5581. } else if (e >= len) {
  5582. str += getZeroString(e + 1 - len);
  5583. if (sd && (k = sd - e - 1) > 0) str = str + '.' + getZeroString(k);
  5584. } else {
  5585. if ((k = e + 1) < len) str = str.slice(0, k) + '.' + str.slice(k);
  5586. if (sd && (k = sd - len) > 0) {
  5587. if (e + 1 === len) str += '.';
  5588. str += getZeroString(k);
  5589. }
  5590. }
  5591. return str;
  5592. }
  5593. // Calculate the base 10 exponent from the base 1e7 exponent.
  5594. function getBase10Exponent(digits, e) {
  5595. var w = digits[0];
  5596. // Add the number of digits of the first word of the digits array.
  5597. for (e *= LOG_BASE; w >= 10; w /= 10) {e++;}
  5598. return e;
  5599. }
  5600. function getLn10(Ctor, sd, pr) {
  5601. if (sd > LN10_PRECISION) {
  5602. // Reset global state in case the exception is caught.
  5603. external = true;
  5604. if (pr) Ctor.precision = pr;
  5605. throw Error(precisionLimitExceeded);
  5606. }
  5607. return finalise(new Ctor(LN10), sd, 1, true);
  5608. }
  5609. function getPi(Ctor, sd, rm) {
  5610. if (sd > PI_PRECISION) throw Error(precisionLimitExceeded);
  5611. return finalise(new Ctor(PI), sd, rm, true);
  5612. }
  5613. function getPrecision(digits) {
  5614. var w = digits.length - 1,
  5615. len = w * LOG_BASE + 1;
  5616. w = digits[w];
  5617. // If non-zero...
  5618. if (w) {
  5619. // Subtract the number of trailing zeros of the last word.
  5620. for (; w % 10 == 0; w /= 10) {len--;}
  5621. // Add the number of digits of the first word.
  5622. for (w = digits[0]; w >= 10; w /= 10) {len++;}
  5623. }
  5624. return len;
  5625. }
  5626. function getZeroString(k) {
  5627. var zs = '';
  5628. for (; k--;) {zs += '0';}
  5629. return zs;
  5630. }
  5631. /*
  5632. * Return a new Decimal whose value is the value of Decimal `x` to the power `n`, where `n` is an
  5633. * integer of type number.
  5634. *
  5635. * Implements 'exponentiation by squaring'. Called by `pow` and `parseOther`.
  5636. *
  5637. */
  5638. function intPow(Ctor, x, n, pr) {
  5639. var isTruncated,
  5640. r = new Ctor(1),
  5641. // Max n of 9007199254740991 takes 53 loop iterations.
  5642. // Maximum digits array length; leaves [28, 34] guard digits.
  5643. k = Math.ceil(pr / LOG_BASE + 4);
  5644. external = false;
  5645. for (;;) {
  5646. if (n % 2) {
  5647. r = r.times(x);
  5648. if (truncate(r.d, k)) isTruncated = true;
  5649. }
  5650. n = mathfloor(n / 2);
  5651. if (n === 0) {
  5652. // To ensure correct rounding when r.d is truncated, increment the last word if it is zero.
  5653. n = r.d.length - 1;
  5654. if (isTruncated && r.d[n] === 0) ++r.d[n];
  5655. break;
  5656. }
  5657. x = x.times(x);
  5658. truncate(x.d, k);
  5659. }
  5660. external = true;
  5661. return r;
  5662. }
  5663. function isOdd(n) {
  5664. return n.d[n.d.length - 1] & 1;
  5665. }
  5666. /*
  5667. * Handle `max` and `min`. `ltgt` is 'lt' or 'gt'.
  5668. */
  5669. function maxOrMin(Ctor, args, ltgt) {
  5670. var y,
  5671. x = new Ctor(args[0]),
  5672. i = 0;
  5673. for (; ++i < args.length;) {
  5674. y = new Ctor(args[i]);
  5675. if (!y.s) {
  5676. x = y;
  5677. break;
  5678. } else if (x[ltgt](y)) {
  5679. x = y;
  5680. }
  5681. }
  5682. return x;
  5683. }
  5684. /*
  5685. * Return a new Decimal whose value is the natural exponential of `x` rounded to `sd` significant
  5686. * digits.
  5687. *
  5688. * Taylor/Maclaurin series.
  5689. *
  5690. * exp(x) = x^0/0! + x^1/1! + x^2/2! + x^3/3! + ...
  5691. *
  5692. * Argument reduction:
  5693. * Repeat x = x / 32, k += 5, until |x| < 0.1
  5694. * exp(x) = exp(x / 2^k)^(2^k)
  5695. *
  5696. * Previously, the argument was initially reduced by
  5697. * exp(x) = exp(r) * 10^k where r = x - k * ln10, k = floor(x / ln10)
  5698. * to first put r in the range [0, ln10], before dividing by 32 until |x| < 0.1, but this was
  5699. * found to be slower than just dividing repeatedly by 32 as above.
  5700. *
  5701. * Max integer argument: exp('20723265836946413') = 6.3e+9000000000000000
  5702. * Min integer argument: exp('-20723265836946411') = 1.2e-9000000000000000
  5703. * (Math object integer min/max: Math.exp(709) = 8.2e+307, Math.exp(-745) = 5e-324)
  5704. *
  5705. * exp(Infinity) = Infinity
  5706. * exp(-Infinity) = 0
  5707. * exp(NaN) = NaN
  5708. * exp(±0) = 1
  5709. *
  5710. * exp(x) is non-terminating for any finite, non-zero x.
  5711. *
  5712. * The result will always be correctly rounded.
  5713. *
  5714. */
  5715. function naturalExponential(x, sd) {
  5716. var denominator,guard,j,pow,sum,t,wpr,
  5717. rep = 0,
  5718. i = 0,
  5719. k = 0,
  5720. Ctor = x.constructor,
  5721. rm = Ctor.rounding,
  5722. pr = Ctor.precision;
  5723. // 0/NaN/Infinity?
  5724. if (!x.d || !x.d[0] || x.e > 17) {
  5725. return new Ctor(x.d ?
  5726. !x.d[0] ? 1 : x.s < 0 ? 0 : 1 / 0 :
  5727. x.s ? x.s < 0 ? 0 : x : 0 / 0);
  5728. }
  5729. if (sd == null) {
  5730. external = false;
  5731. wpr = pr;
  5732. } else {
  5733. wpr = sd;
  5734. }
  5735. t = new Ctor(0.03125);
  5736. // while abs(x) >= 0.1
  5737. while (x.e > -2) {
  5738. // x = x / 2^5
  5739. x = x.times(t);
  5740. k += 5;
  5741. }
  5742. // Use 2 * log10(2^k) + 5 (empirically derived) to estimate the increase in precision
  5743. // necessary to ensure the first 4 rounding digits are correct.
  5744. guard = Math.log(mathpow(2, k)) / Math.LN10 * 2 + 5 | 0;
  5745. wpr += guard;
  5746. denominator = pow = sum = new Ctor(1);
  5747. Ctor.precision = wpr;
  5748. for (;;) {
  5749. pow = finalise(pow.times(x), wpr, 1);
  5750. denominator = denominator.times(++i);
  5751. t = sum.plus(divide(pow, denominator, wpr, 1));
  5752. if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {
  5753. j = k;
  5754. while (j--) {sum = finalise(sum.times(sum), wpr, 1);}
  5755. // Check to see if the first 4 rounding digits are [49]999.
  5756. // If so, repeat the summation with a higher precision, otherwise
  5757. // e.g. with precision: 18, rounding: 1
  5758. // exp(18.404272462595034083567793919843761) = 98372560.1229999999 (should be 98372560.123)
  5759. // `wpr - guard` is the index of first rounding digit.
  5760. if (sd == null) {
  5761. if (rep < 3 && checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {
  5762. Ctor.precision = wpr += 10;
  5763. denominator = pow = t = new Ctor(1);
  5764. i = 0;
  5765. rep++;
  5766. } else {
  5767. return finalise(sum, Ctor.precision = pr, rm, external = true);
  5768. }
  5769. } else {
  5770. Ctor.precision = pr;
  5771. return sum;
  5772. }
  5773. }
  5774. sum = t;
  5775. }
  5776. }
  5777. /*
  5778. * Return a new Decimal whose value is the natural logarithm of `x` rounded to `sd` significant
  5779. * digits.
  5780. *
  5781. * ln(-n) = NaN
  5782. * ln(0) = -Infinity
  5783. * ln(-0) = -Infinity
  5784. * ln(1) = 0
  5785. * ln(Infinity) = Infinity
  5786. * ln(-Infinity) = NaN
  5787. * ln(NaN) = NaN
  5788. *
  5789. * ln(n) (n != 1) is non-terminating.
  5790. *
  5791. */
  5792. function naturalLogarithm(y, sd) {
  5793. var c,c0,denominator,e,numerator,rep,sum,t,wpr,x1,x2,
  5794. n = 1,
  5795. guard = 10,
  5796. x = y,
  5797. xd = x.d,
  5798. Ctor = x.constructor,
  5799. rm = Ctor.rounding,
  5800. pr = Ctor.precision;
  5801. // Is x negative or Infinity, NaN, 0 or 1?
  5802. if (x.s < 0 || !xd || !xd[0] || !x.e && xd[0] == 1 && xd.length == 1) {
  5803. return new Ctor(xd && !xd[0] ? -1 / 0 : x.s != 1 ? NaN : xd ? 0 : x);
  5804. }
  5805. if (sd == null) {
  5806. external = false;
  5807. wpr = pr;
  5808. } else {
  5809. wpr = sd;
  5810. }
  5811. Ctor.precision = wpr += guard;
  5812. c = digitsToString(xd);
  5813. c0 = c.charAt(0);
  5814. if (Math.abs(e = x.e) < 1.5e15) {
  5815. // Argument reduction.
  5816. // The series converges faster the closer the argument is to 1, so using
  5817. // ln(a^b) = b * ln(a), ln(a) = ln(a^b) / b
  5818. // multiply the argument by itself until the leading digits of the significand are 7, 8, 9,
  5819. // 10, 11, 12 or 13, recording the number of multiplications so the sum of the series can
  5820. // later be divided by this number, then separate out the power of 10 using
  5821. // ln(a*10^b) = ln(a) + b*ln(10).
  5822. // max n is 21 (gives 0.9, 1.0 or 1.1) (9e15 / 21 = 4.2e14).
  5823. //while (c0 < 9 && c0 != 1 || c0 == 1 && c.charAt(1) > 1) {
  5824. // max n is 6 (gives 0.7 - 1.3)
  5825. while (c0 < 7 && c0 != 1 || c0 == 1 && c.charAt(1) > 3) {
  5826. x = x.times(y);
  5827. c = digitsToString(x.d);
  5828. c0 = c.charAt(0);
  5829. n++;
  5830. }
  5831. e = x.e;
  5832. if (c0 > 1) {
  5833. x = new Ctor('0.' + c);
  5834. e++;
  5835. } else {
  5836. x = new Ctor(c0 + '.' + c.slice(1));
  5837. }
  5838. } else {
  5839. // The argument reduction method above may result in overflow if the argument y is a massive
  5840. // number with exponent >= 1500000000000000 (9e15 / 6 = 1.5e15), so instead recall this
  5841. // function using ln(x*10^e) = ln(x) + e*ln(10).
  5842. t = getLn10(Ctor, wpr + 2, pr).times(e + '');
  5843. x = naturalLogarithm(new Ctor(c0 + '.' + c.slice(1)), wpr - guard).plus(t);
  5844. Ctor.precision = pr;
  5845. return sd == null ? finalise(x, pr, rm, external = true) : x;
  5846. }
  5847. // x1 is x reduced to a value near 1.
  5848. x1 = x;
  5849. // Taylor series.
  5850. // ln(y) = ln((1 + x)/(1 - x)) = 2(x + x^3/3 + x^5/5 + x^7/7 + ...)
  5851. // where x = (y - 1)/(y + 1) (|x| < 1)
  5852. sum = numerator = x = divide(x.minus(1), x.plus(1), wpr, 1);
  5853. x2 = finalise(x.times(x), wpr, 1);
  5854. denominator = 3;
  5855. for (;;) {
  5856. numerator = finalise(numerator.times(x2), wpr, 1);
  5857. t = sum.plus(divide(numerator, new Ctor(denominator), wpr, 1));
  5858. if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {
  5859. sum = sum.times(2);
  5860. // Reverse the argument reduction. Check that e is not 0 because, besides preventing an
  5861. // unnecessary calculation, -0 + 0 = +0 and to ensure correct rounding -0 needs to stay -0.
  5862. if (e !== 0) sum = sum.plus(getLn10(Ctor, wpr + 2, pr).times(e + ''));
  5863. sum = divide(sum, new Ctor(n), wpr, 1);
  5864. // Is rm > 3 and the first 4 rounding digits 4999, or rm < 4 (or the summation has
  5865. // been repeated previously) and the first 4 rounding digits 9999?
  5866. // If so, restart the summation with a higher precision, otherwise
  5867. // e.g. with precision: 12, rounding: 1
  5868. // ln(135520028.6126091714265381533) = 18.7246299999 when it should be 18.72463.
  5869. // `wpr - guard` is the index of first rounding digit.
  5870. if (sd == null) {
  5871. if (checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {
  5872. Ctor.precision = wpr += guard;
  5873. t = numerator = x = divide(x1.minus(1), x1.plus(1), wpr, 1);
  5874. x2 = finalise(x.times(x), wpr, 1);
  5875. denominator = rep = 1;
  5876. } else {
  5877. return finalise(sum, Ctor.precision = pr, rm, external = true);
  5878. }
  5879. } else {
  5880. Ctor.precision = pr;
  5881. return sum;
  5882. }
  5883. }
  5884. sum = t;
  5885. denominator += 2;
  5886. }
  5887. }
  5888. // ±Infinity, NaN.
  5889. function nonFiniteToString(x) {
  5890. // Unsigned.
  5891. return String(x.s * x.s / 0);
  5892. }
  5893. /*
  5894. * Parse the value of a new Decimal `x` from string `str`.
  5895. */
  5896. function parseDecimal(x, str) {
  5897. var e, i, len;
  5898. // Decimal point?
  5899. if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');
  5900. // Exponential form?
  5901. if ((i = str.search(/e/i)) > 0) {
  5902. // Determine exponent.
  5903. if (e < 0) e = i;
  5904. e += +str.slice(i + 1);
  5905. str = str.substring(0, i);
  5906. } else if (e < 0) {
  5907. // Integer.
  5908. e = str.length;
  5909. }
  5910. // Determine leading zeros.
  5911. for (i = 0; str.charCodeAt(i) === 48; i++) {;}
  5912. // Determine trailing zeros.
  5913. for (len = str.length; str.charCodeAt(len - 1) === 48; --len) {;}
  5914. str = str.slice(i, len);
  5915. if (str) {
  5916. len -= i;
  5917. x.e = e = e - i - 1;
  5918. x.d = [];
  5919. // Transform base
  5920. // e is the base 10 exponent.
  5921. // i is where to slice str to get the first word of the digits array.
  5922. i = (e + 1) % LOG_BASE;
  5923. if (e < 0) i += LOG_BASE;
  5924. if (i < len) {
  5925. if (i) x.d.push(+str.slice(0, i));
  5926. for (len -= LOG_BASE; i < len;) {x.d.push(+str.slice(i, i += LOG_BASE));}
  5927. str = str.slice(i);
  5928. i = LOG_BASE - str.length;
  5929. } else {
  5930. i -= len;
  5931. }
  5932. for (; i--;) {str += '0';}
  5933. x.d.push(+str);
  5934. if (external) {
  5935. // Overflow?
  5936. if (x.e > x.constructor.maxE) {
  5937. // Infinity.
  5938. x.d = null;
  5939. x.e = NaN;
  5940. // Underflow?
  5941. } else if (x.e < x.constructor.minE) {
  5942. // Zero.
  5943. x.e = 0;
  5944. x.d = [0];
  5945. // x.constructor.underflow = true;
  5946. } // else x.constructor.underflow = false;
  5947. }
  5948. } else {
  5949. // Zero.
  5950. x.e = 0;
  5951. x.d = [0];
  5952. }
  5953. return x;
  5954. }
  5955. /*
  5956. * Parse the value of a new Decimal `x` from a string `str`, which is not a decimal value.
  5957. */
  5958. function parseOther(x, str) {
  5959. var base, Ctor, divisor, i, isFloat, len, p, xd, xe;
  5960. if (str.indexOf('_') > -1) {
  5961. str = str.replace(/(\d)_(?=\d)/g, '$1');
  5962. if (isDecimal.test(str)) return parseDecimal(x, str);
  5963. } else if (str === 'Infinity' || str === 'NaN') {
  5964. if (!+str) x.s = NaN;
  5965. x.e = NaN;
  5966. x.d = null;
  5967. return x;
  5968. }
  5969. if (isHex.test(str)) {
  5970. base = 16;
  5971. str = str.toLowerCase();
  5972. } else if (isBinary.test(str)) {
  5973. base = 2;
  5974. } else if (isOctal.test(str)) {
  5975. base = 8;
  5976. } else {
  5977. throw Error(invalidArgument + str);
  5978. }
  5979. // Is there a binary exponent part?
  5980. i = str.search(/p/i);
  5981. if (i > 0) {
  5982. p = +str.slice(i + 1);
  5983. str = str.substring(2, i);
  5984. } else {
  5985. str = str.slice(2);
  5986. }
  5987. // Convert `str` as an integer then divide the result by `base` raised to a power such that the
  5988. // fraction part will be restored.
  5989. i = str.indexOf('.');
  5990. isFloat = i >= 0;
  5991. Ctor = x.constructor;
  5992. if (isFloat) {
  5993. str = str.replace('.', '');
  5994. len = str.length;
  5995. i = len - i;
  5996. // log[10](16) = 1.2041... , log[10](88) = 1.9444....
  5997. divisor = intPow(Ctor, new Ctor(base), i, i * 2);
  5998. }
  5999. xd = convertBase(str, base, BASE);
  6000. xe = xd.length - 1;
  6001. // Remove trailing zeros.
  6002. for (i = xe; xd[i] === 0; --i) {xd.pop();}
  6003. if (i < 0) return new Ctor(x.s * 0);
  6004. x.e = getBase10Exponent(xd, xe);
  6005. x.d = xd;
  6006. external = false;
  6007. // At what precision to perform the division to ensure exact conversion?
  6008. // maxDecimalIntegerPartDigitCount = ceil(log[10](b) * otherBaseIntegerPartDigitCount)
  6009. // log[10](2) = 0.30103, log[10](8) = 0.90309, log[10](16) = 1.20412
  6010. // E.g. ceil(1.2 * 3) = 4, so up to 4 decimal digits are needed to represent 3 hex int digits.
  6011. // maxDecimalFractionPartDigitCount = {Hex:4|Oct:3|Bin:1} * otherBaseFractionPartDigitCount
  6012. // Therefore using 4 * the number of digits of str will always be enough.
  6013. if (isFloat) x = divide(x, divisor, len * 4);
  6014. // Multiply by the binary exponent part if present.
  6015. if (p) x = x.times(Math.abs(p) < 54 ? mathpow(2, p) : Decimal.pow(2, p));
  6016. external = true;
  6017. return x;
  6018. }
  6019. /*
  6020. * sin(x) = x - x^3/3! + x^5/5! - ...
  6021. * |x| < pi/2
  6022. *
  6023. */
  6024. function sine(Ctor, x) {
  6025. var k,
  6026. len = x.d.length;
  6027. if (len < 3) {
  6028. return x.isZero() ? x : taylorSeries(Ctor, 2, x, x);
  6029. }
  6030. // Argument reduction: sin(5x) = 16*sin^5(x) - 20*sin^3(x) + 5*sin(x)
  6031. // i.e. sin(x) = 16*sin^5(x/5) - 20*sin^3(x/5) + 5*sin(x/5)
  6032. // and sin(x) = sin(x/5)(5 + sin^2(x/5)(16sin^2(x/5) - 20))
  6033. // Estimate the optimum number of times to use the argument reduction.
  6034. k = 1.4 * Math.sqrt(len);
  6035. k = k > 16 ? 16 : k | 0;
  6036. x = x.times(1 / tinyPow(5, k));
  6037. x = taylorSeries(Ctor, 2, x, x);
  6038. // Reverse argument reduction
  6039. var sin2_x,
  6040. d5 = new Ctor(5),
  6041. d16 = new Ctor(16),
  6042. d20 = new Ctor(20);
  6043. for (; k--;) {
  6044. sin2_x = x.times(x);
  6045. x = x.times(d5.plus(sin2_x.times(d16.times(sin2_x).minus(d20))));
  6046. }
  6047. return x;
  6048. }
  6049. // Calculate Taylor series for `cos`, `cosh`, `sin` and `sinh`.
  6050. function taylorSeries(Ctor, n, x, y, isHyperbolic) {
  6051. var j,t,u,x2,
  6052. i = 1,
  6053. pr = Ctor.precision,
  6054. k = Math.ceil(pr / LOG_BASE);
  6055. external = false;
  6056. x2 = x.times(x);
  6057. u = new Ctor(y);
  6058. for (;;) {
  6059. t = divide(u.times(x2), new Ctor(n++ * n++), pr, 1);
  6060. u = isHyperbolic ? y.plus(t) : y.minus(t);
  6061. y = divide(t.times(x2), new Ctor(n++ * n++), pr, 1);
  6062. t = u.plus(y);
  6063. if (t.d[k] !== void 0) {
  6064. for (j = k; t.d[j] === u.d[j] && j--;) {;}
  6065. if (j == -1) break;
  6066. }
  6067. j = u;
  6068. u = y;
  6069. y = t;
  6070. t = j;
  6071. i++;
  6072. }
  6073. external = true;
  6074. t.d.length = k + 1;
  6075. return t;
  6076. }
  6077. // Exponent e must be positive and non-zero.
  6078. function tinyPow(b, e) {
  6079. var n = b;
  6080. while (--e) {n *= b;}
  6081. return n;
  6082. }
  6083. // Return the absolute value of `x` reduced to less than or equal to half pi.
  6084. function toLessThanHalfPi(Ctor, x) {
  6085. var t,
  6086. isNeg = x.s < 0,
  6087. pi = getPi(Ctor, Ctor.precision, 1),
  6088. halfPi = pi.times(0.5);
  6089. x = x.abs();
  6090. if (x.lte(halfPi)) {
  6091. quadrant = isNeg ? 4 : 1;
  6092. return x;
  6093. }
  6094. t = x.divToInt(pi);
  6095. if (t.isZero()) {
  6096. quadrant = isNeg ? 3 : 2;
  6097. } else {
  6098. x = x.minus(t.times(pi));
  6099. // 0 <= x < pi
  6100. if (x.lte(halfPi)) {
  6101. quadrant = isOdd(t) ? isNeg ? 2 : 3 : isNeg ? 4 : 1;
  6102. return x;
  6103. }
  6104. quadrant = isOdd(t) ? isNeg ? 1 : 4 : isNeg ? 3 : 2;
  6105. }
  6106. return x.minus(pi).abs();
  6107. }
  6108. /*
  6109. * Return the value of Decimal `x` as a string in base `baseOut`.
  6110. *
  6111. * If the optional `sd` argument is present include a binary exponent suffix.
  6112. */
  6113. function toStringBinary(x, baseOut, sd, rm) {
  6114. var base,e,i,k,len,roundUp,str,xd,y,
  6115. Ctor = x.constructor,
  6116. isExp = sd !== void 0;
  6117. if (isExp) {
  6118. checkInt32(sd, 1, MAX_DIGITS);
  6119. if (rm === void 0) rm = Ctor.rounding;else
  6120. checkInt32(rm, 0, 8);
  6121. } else {
  6122. sd = Ctor.precision;
  6123. rm = Ctor.rounding;
  6124. }
  6125. if (!x.isFinite()) {
  6126. str = nonFiniteToString(x);
  6127. } else {
  6128. str = finiteToString(x);
  6129. i = str.indexOf('.');
  6130. // Use exponential notation according to `toExpPos` and `toExpNeg`? No, but if required:
  6131. // maxBinaryExponent = floor((decimalExponent + 1) * log[2](10))
  6132. // minBinaryExponent = floor(decimalExponent * log[2](10))
  6133. // log[2](10) = 3.321928094887362347870319429489390175864
  6134. if (isExp) {
  6135. base = 2;
  6136. if (baseOut == 16) {
  6137. sd = sd * 4 - 3;
  6138. } else if (baseOut == 8) {
  6139. sd = sd * 3 - 2;
  6140. }
  6141. } else {
  6142. base = baseOut;
  6143. }
  6144. // Convert the number as an integer then divide the result by its base raised to a power such
  6145. // that the fraction part will be restored.
  6146. // Non-integer.
  6147. if (i >= 0) {
  6148. str = str.replace('.', '');
  6149. y = new Ctor(1);
  6150. y.e = str.length - i;
  6151. y.d = convertBase(finiteToString(y), 10, base);
  6152. y.e = y.d.length;
  6153. }
  6154. xd = convertBase(str, 10, base);
  6155. e = len = xd.length;
  6156. // Remove trailing zeros.
  6157. for (; xd[--len] == 0;) {xd.pop();}
  6158. if (!xd[0]) {
  6159. str = isExp ? '0p+0' : '0';
  6160. } else {
  6161. if (i < 0) {
  6162. e--;
  6163. } else {
  6164. x = new Ctor(x);
  6165. x.d = xd;
  6166. x.e = e;
  6167. x = divide(x, y, sd, rm, 0, base);
  6168. xd = x.d;
  6169. e = x.e;
  6170. roundUp = inexact;
  6171. }
  6172. // The rounding digit, i.e. the digit after the digit that may be rounded up.
  6173. i = xd[sd];
  6174. k = base / 2;
  6175. roundUp = roundUp || xd[sd + 1] !== void 0;
  6176. roundUp = rm < 4 ?
  6177. (i !== void 0 || roundUp) && (rm === 0 || rm === (x.s < 0 ? 3 : 2)) :
  6178. i > k || i === k && (rm === 4 || roundUp || rm === 6 && xd[sd - 1] & 1 ||
  6179. rm === (x.s < 0 ? 8 : 7));
  6180. xd.length = sd;
  6181. if (roundUp) {
  6182. // Rounding up may mean the previous digit has to be rounded up and so on.
  6183. for (; ++xd[--sd] > base - 1;) {
  6184. xd[sd] = 0;
  6185. if (!sd) {
  6186. ++e;
  6187. xd.unshift(1);
  6188. }
  6189. }
  6190. }
  6191. // Determine trailing zeros.
  6192. for (len = xd.length; !xd[len - 1]; --len) {;}
  6193. // E.g. [4, 11, 15] becomes 4bf.
  6194. for (i = 0, str = ''; i < len; i++) {str += NUMERALS.charAt(xd[i]);}
  6195. // Add binary exponent suffix?
  6196. if (isExp) {
  6197. if (len > 1) {
  6198. if (baseOut == 16 || baseOut == 8) {
  6199. i = baseOut == 16 ? 4 : 3;
  6200. for (--len; len % i; len++) {str += '0';}
  6201. xd = convertBase(str, base, baseOut);
  6202. for (len = xd.length; !xd[len - 1]; --len) {;}
  6203. // xd[0] will always be be 1
  6204. for (i = 1, str = '1.'; i < len; i++) {str += NUMERALS.charAt(xd[i]);}
  6205. } else {
  6206. str = str.charAt(0) + '.' + str.slice(1);
  6207. }
  6208. }
  6209. str = str + (e < 0 ? 'p' : 'p+') + e;
  6210. } else if (e < 0) {
  6211. for (; ++e;) {str = '0' + str;}
  6212. str = '0.' + str;
  6213. } else {
  6214. if (++e > len) for (e -= len; e--;) {str += '0';} else
  6215. if (e < len) str = str.slice(0, e) + '.' + str.slice(e);
  6216. }
  6217. }
  6218. str = (baseOut == 16 ? '0x' : baseOut == 2 ? '0b' : baseOut == 8 ? '0o' : '') + str;
  6219. }
  6220. return x.s < 0 ? '-' + str : str;
  6221. }
  6222. // Does not strip trailing zeros.
  6223. function truncate(arr, len) {
  6224. if (arr.length > len) {
  6225. arr.length = len;
  6226. return true;
  6227. }
  6228. }
  6229. // Decimal methods
  6230. /*
  6231. * abs
  6232. * acos
  6233. * acosh
  6234. * add
  6235. * asin
  6236. * asinh
  6237. * atan
  6238. * atanh
  6239. * atan2
  6240. * cbrt
  6241. * ceil
  6242. * clamp
  6243. * clone
  6244. * config
  6245. * cos
  6246. * cosh
  6247. * div
  6248. * exp
  6249. * floor
  6250. * hypot
  6251. * ln
  6252. * log
  6253. * log2
  6254. * log10
  6255. * max
  6256. * min
  6257. * mod
  6258. * mul
  6259. * pow
  6260. * random
  6261. * round
  6262. * set
  6263. * sign
  6264. * sin
  6265. * sinh
  6266. * sqrt
  6267. * sub
  6268. * sum
  6269. * tan
  6270. * tanh
  6271. * trunc
  6272. */
  6273. /*
  6274. * Return a new Decimal whose value is the absolute value of `x`.
  6275. *
  6276. * x {number|string|Decimal}
  6277. *
  6278. */
  6279. function abs(x) {
  6280. return new this(x).abs();
  6281. }
  6282. /*
  6283. * Return a new Decimal whose value is the arccosine in radians of `x`.
  6284. *
  6285. * x {number|string|Decimal}
  6286. *
  6287. */
  6288. function acos(x) {
  6289. return new this(x).acos();
  6290. }
  6291. /*
  6292. * Return a new Decimal whose value is the inverse of the hyperbolic cosine of `x`, rounded to
  6293. * `precision` significant digits using rounding mode `rounding`.
  6294. *
  6295. * x {number|string|Decimal} A value in radians.
  6296. *
  6297. */
  6298. function acosh(x) {
  6299. return new this(x).acosh();
  6300. }
  6301. /*
  6302. * Return a new Decimal whose value is the sum of `x` and `y`, rounded to `precision` significant
  6303. * digits using rounding mode `rounding`.
  6304. *
  6305. * x {number|string|Decimal}
  6306. * y {number|string|Decimal}
  6307. *
  6308. */
  6309. function add(x, y) {
  6310. return new this(x).plus(y);
  6311. }
  6312. /*
  6313. * Return a new Decimal whose value is the arcsine in radians of `x`, rounded to `precision`
  6314. * significant digits using rounding mode `rounding`.
  6315. *
  6316. * x {number|string|Decimal}
  6317. *
  6318. */
  6319. function asin(x) {
  6320. return new this(x).asin();
  6321. }
  6322. /*
  6323. * Return a new Decimal whose value is the inverse of the hyperbolic sine of `x`, rounded to
  6324. * `precision` significant digits using rounding mode `rounding`.
  6325. *
  6326. * x {number|string|Decimal} A value in radians.
  6327. *
  6328. */
  6329. function asinh(x) {
  6330. return new this(x).asinh();
  6331. }
  6332. /*
  6333. * Return a new Decimal whose value is the arctangent in radians of `x`, rounded to `precision`
  6334. * significant digits using rounding mode `rounding`.
  6335. *
  6336. * x {number|string|Decimal}
  6337. *
  6338. */
  6339. function atan(x) {
  6340. return new this(x).atan();
  6341. }
  6342. /*
  6343. * Return a new Decimal whose value is the inverse of the hyperbolic tangent of `x`, rounded to
  6344. * `precision` significant digits using rounding mode `rounding`.
  6345. *
  6346. * x {number|string|Decimal} A value in radians.
  6347. *
  6348. */
  6349. function atanh(x) {
  6350. return new this(x).atanh();
  6351. }
  6352. /*
  6353. * Return a new Decimal whose value is the arctangent in radians of `y/x` in the range -pi to pi
  6354. * (inclusive), rounded to `precision` significant digits using rounding mode `rounding`.
  6355. *
  6356. * Domain: [-Infinity, Infinity]
  6357. * Range: [-pi, pi]
  6358. *
  6359. * y {number|string|Decimal} The y-coordinate.
  6360. * x {number|string|Decimal} The x-coordinate.
  6361. *
  6362. * atan2(±0, -0) = ±pi
  6363. * atan2(±0, +0) = ±0
  6364. * atan2(±0, -x) = ±pi for x > 0
  6365. * atan2(±0, x) = ±0 for x > 0
  6366. * atan2(-y, ±0) = -pi/2 for y > 0
  6367. * atan2(y, ±0) = pi/2 for y > 0
  6368. * atan2(±y, -Infinity) = ±pi for finite y > 0
  6369. * atan2(±y, +Infinity) = ±0 for finite y > 0
  6370. * atan2(±Infinity, x) = ±pi/2 for finite x
  6371. * atan2(±Infinity, -Infinity) = ±3*pi/4
  6372. * atan2(±Infinity, +Infinity) = ±pi/4
  6373. * atan2(NaN, x) = NaN
  6374. * atan2(y, NaN) = NaN
  6375. *
  6376. */
  6377. function atan2(y, x) {
  6378. y = new this(y);
  6379. x = new this(x);
  6380. var r,
  6381. pr = this.precision,
  6382. rm = this.rounding,
  6383. wpr = pr + 4;
  6384. // Either NaN
  6385. if (!y.s || !x.s) {
  6386. r = new this(NaN);
  6387. // Both ±Infinity
  6388. } else if (!y.d && !x.d) {
  6389. r = getPi(this, wpr, 1).times(x.s > 0 ? 0.25 : 0.75);
  6390. r.s = y.s;
  6391. // x is ±Infinity or y is ±0
  6392. } else if (!x.d || y.isZero()) {
  6393. r = x.s < 0 ? getPi(this, pr, rm) : new this(0);
  6394. r.s = y.s;
  6395. // y is ±Infinity or x is ±0
  6396. } else if (!y.d || x.isZero()) {
  6397. r = getPi(this, wpr, 1).times(0.5);
  6398. r.s = y.s;
  6399. // Both non-zero and finite
  6400. } else if (x.s < 0) {
  6401. this.precision = wpr;
  6402. this.rounding = 1;
  6403. r = this.atan(divide(y, x, wpr, 1));
  6404. x = getPi(this, wpr, 1);
  6405. this.precision = pr;
  6406. this.rounding = rm;
  6407. r = y.s < 0 ? r.minus(x) : r.plus(x);
  6408. } else {
  6409. r = this.atan(divide(y, x, wpr, 1));
  6410. }
  6411. return r;
  6412. }
  6413. /*
  6414. * Return a new Decimal whose value is the cube root of `x`, rounded to `precision` significant
  6415. * digits using rounding mode `rounding`.
  6416. *
  6417. * x {number|string|Decimal}
  6418. *
  6419. */
  6420. function cbrt(x) {
  6421. return new this(x).cbrt();
  6422. }
  6423. /*
  6424. * Return a new Decimal whose value is `x` rounded to an integer using `ROUND_CEIL`.
  6425. *
  6426. * x {number|string|Decimal}
  6427. *
  6428. */
  6429. function ceil(x) {
  6430. return finalise(x = new this(x), x.e + 1, 2);
  6431. }
  6432. /*
  6433. * Return a new Decimal whose value is `x` clamped to the range delineated by `min` and `max`.
  6434. *
  6435. * x {number|string|Decimal}
  6436. * min {number|string|Decimal}
  6437. * max {number|string|Decimal}
  6438. *
  6439. */
  6440. function clamp(x, min, max) {
  6441. return new this(x).clamp(min, max);
  6442. }
  6443. /*
  6444. * Configure global settings for a Decimal constructor.
  6445. *
  6446. * `obj` is an object with one or more of the following properties,
  6447. *
  6448. * precision {number}
  6449. * rounding {number}
  6450. * toExpNeg {number}
  6451. * toExpPos {number}
  6452. * maxE {number}
  6453. * minE {number}
  6454. * modulo {number}
  6455. * crypto {boolean|number}
  6456. * defaults {true}
  6457. *
  6458. * E.g. Decimal.config({ precision: 20, rounding: 4 })
  6459. *
  6460. */
  6461. function config(obj) {
  6462. if (!obj || typeof obj !== 'object') throw Error(decimalError + 'Object expected');
  6463. var i,p,v,
  6464. useDefaults = obj.defaults === true,
  6465. ps = [
  6466. 'precision', 1, MAX_DIGITS,
  6467. 'rounding', 0, 8,
  6468. 'toExpNeg', -EXP_LIMIT, 0,
  6469. 'toExpPos', 0, EXP_LIMIT,
  6470. 'maxE', 0, EXP_LIMIT,
  6471. 'minE', -EXP_LIMIT, 0,
  6472. 'modulo', 0, 9];
  6473. for (i = 0; i < ps.length; i += 3) {
  6474. if (p = ps[i], useDefaults) this[p] = DEFAULTS[p];
  6475. if ((v = obj[p]) !== void 0) {
  6476. if (mathfloor(v) === v && v >= ps[i + 1] && v <= ps[i + 2]) this[p] = v;else
  6477. throw Error(invalidArgument + p + ': ' + v);
  6478. }
  6479. }
  6480. if (p = 'crypto', useDefaults) this[p] = DEFAULTS[p];
  6481. if ((v = obj[p]) !== void 0) {
  6482. if (v === true || v === false || v === 0 || v === 1) {
  6483. if (v) {
  6484. if (typeof crypto != 'undefined' && crypto && (
  6485. crypto.getRandomValues || crypto.randomBytes)) {
  6486. this[p] = true;
  6487. } else {
  6488. throw Error(cryptoUnavailable);
  6489. }
  6490. } else {
  6491. this[p] = false;
  6492. }
  6493. } else {
  6494. throw Error(invalidArgument + p + ': ' + v);
  6495. }
  6496. }
  6497. return this;
  6498. }
  6499. /*
  6500. * Return a new Decimal whose value is the cosine of `x`, rounded to `precision` significant
  6501. * digits using rounding mode `rounding`.
  6502. *
  6503. * x {number|string|Decimal} A value in radians.
  6504. *
  6505. */
  6506. function cos(x) {
  6507. return new this(x).cos();
  6508. }
  6509. /*
  6510. * Return a new Decimal whose value is the hyperbolic cosine of `x`, rounded to precision
  6511. * significant digits using rounding mode `rounding`.
  6512. *
  6513. * x {number|string|Decimal} A value in radians.
  6514. *
  6515. */
  6516. function cosh(x) {
  6517. return new this(x).cosh();
  6518. }
  6519. /*
  6520. * Create and return a Decimal constructor with the same configuration properties as this Decimal
  6521. * constructor.
  6522. *
  6523. */
  6524. function clone(obj) {
  6525. var i, p, ps;
  6526. /*
  6527. * The Decimal constructor and exported function.
  6528. * Return a new Decimal instance.
  6529. *
  6530. * v {number|string|Decimal} A numeric value.
  6531. *
  6532. */
  6533. function Decimal(v) {
  6534. var e,i,t,
  6535. x = this;
  6536. // Decimal called without new.
  6537. if (!(x instanceof Decimal)) return new Decimal(v);
  6538. // Retain a reference to this Decimal constructor, and shadow Decimal.prototype.constructor
  6539. // which points to Object.
  6540. x.constructor = Decimal;
  6541. // Duplicate.
  6542. if (isDecimalInstance(v)) {
  6543. x.s = v.s;
  6544. if (external) {
  6545. if (!v.d || v.e > Decimal.maxE) {
  6546. // Infinity.
  6547. x.e = NaN;
  6548. x.d = null;
  6549. } else if (v.e < Decimal.minE) {
  6550. // Zero.
  6551. x.e = 0;
  6552. x.d = [0];
  6553. } else {
  6554. x.e = v.e;
  6555. x.d = v.d.slice();
  6556. }
  6557. } else {
  6558. x.e = v.e;
  6559. x.d = v.d ? v.d.slice() : v.d;
  6560. }
  6561. return;
  6562. }
  6563. t = typeof v;
  6564. if (t === 'number') {
  6565. if (v === 0) {
  6566. x.s = 1 / v < 0 ? -1 : 1;
  6567. x.e = 0;
  6568. x.d = [0];
  6569. return;
  6570. }
  6571. if (v < 0) {
  6572. v = -v;
  6573. x.s = -1;
  6574. } else {
  6575. x.s = 1;
  6576. }
  6577. // Fast path for small integers.
  6578. if (v === ~~v && v < 1e7) {
  6579. for (e = 0, i = v; i >= 10; i /= 10) {e++;}
  6580. if (external) {
  6581. if (e > Decimal.maxE) {
  6582. x.e = NaN;
  6583. x.d = null;
  6584. } else if (e < Decimal.minE) {
  6585. x.e = 0;
  6586. x.d = [0];
  6587. } else {
  6588. x.e = e;
  6589. x.d = [v];
  6590. }
  6591. } else {
  6592. x.e = e;
  6593. x.d = [v];
  6594. }
  6595. return;
  6596. // Infinity, NaN.
  6597. } else if (v * 0 !== 0) {
  6598. if (!v) x.s = NaN;
  6599. x.e = NaN;
  6600. x.d = null;
  6601. return;
  6602. }
  6603. return parseDecimal(x, v.toString());
  6604. } else if (t !== 'string') {
  6605. throw Error(invalidArgument + v);
  6606. }
  6607. // Minus sign?
  6608. if ((i = v.charCodeAt(0)) === 45) {
  6609. v = v.slice(1);
  6610. x.s = -1;
  6611. } else {
  6612. // Plus sign?
  6613. if (i === 43) v = v.slice(1);
  6614. x.s = 1;
  6615. }
  6616. return isDecimal.test(v) ? parseDecimal(x, v) : parseOther(x, v);
  6617. }
  6618. Decimal.prototype = P;
  6619. Decimal.ROUND_UP = 0;
  6620. Decimal.ROUND_DOWN = 1;
  6621. Decimal.ROUND_CEIL = 2;
  6622. Decimal.ROUND_FLOOR = 3;
  6623. Decimal.ROUND_HALF_UP = 4;
  6624. Decimal.ROUND_HALF_DOWN = 5;
  6625. Decimal.ROUND_HALF_EVEN = 6;
  6626. Decimal.ROUND_HALF_CEIL = 7;
  6627. Decimal.ROUND_HALF_FLOOR = 8;
  6628. Decimal.EUCLID = 9;
  6629. Decimal.config = Decimal.set = config;
  6630. Decimal.clone = clone;
  6631. Decimal.isDecimal = isDecimalInstance;
  6632. Decimal.abs = abs;
  6633. Decimal.acos = acos;
  6634. Decimal.acosh = acosh; // ES6
  6635. Decimal.add = add;
  6636. Decimal.asin = asin;
  6637. Decimal.asinh = asinh; // ES6
  6638. Decimal.atan = atan;
  6639. Decimal.atanh = atanh; // ES6
  6640. Decimal.atan2 = atan2;
  6641. Decimal.cbrt = cbrt; // ES6
  6642. Decimal.ceil = ceil;
  6643. Decimal.clamp = clamp;
  6644. Decimal.cos = cos;
  6645. Decimal.cosh = cosh; // ES6
  6646. Decimal.div = div;
  6647. Decimal.exp = exp;
  6648. Decimal.floor = floor;
  6649. Decimal.hypot = hypot; // ES6
  6650. Decimal.ln = ln;
  6651. Decimal.log = log;
  6652. Decimal.log10 = log10; // ES6
  6653. Decimal.log2 = log2; // ES6
  6654. Decimal.max = max;
  6655. Decimal.min = min;
  6656. Decimal.mod = mod;
  6657. Decimal.mul = mul;
  6658. Decimal.pow = pow;
  6659. Decimal.random = random;
  6660. Decimal.round = round;
  6661. Decimal.sign = sign; // ES6
  6662. Decimal.sin = sin;
  6663. Decimal.sinh = sinh; // ES6
  6664. Decimal.sqrt = sqrt;
  6665. Decimal.sub = sub;
  6666. Decimal.sum = sum;
  6667. Decimal.tan = tan;
  6668. Decimal.tanh = tanh; // ES6
  6669. Decimal.trunc = trunc; // ES6
  6670. if (obj === void 0) obj = {};
  6671. if (obj) {
  6672. if (obj.defaults !== true) {
  6673. ps = ['precision', 'rounding', 'toExpNeg', 'toExpPos', 'maxE', 'minE', 'modulo', 'crypto'];
  6674. for (i = 0; i < ps.length;) {if (!obj.hasOwnProperty(p = ps[i++])) obj[p] = this[p];}
  6675. }
  6676. }
  6677. Decimal.config(obj);
  6678. return Decimal;
  6679. }
  6680. /*
  6681. * Return a new Decimal whose value is `x` divided by `y`, rounded to `precision` significant
  6682. * digits using rounding mode `rounding`.
  6683. *
  6684. * x {number|string|Decimal}
  6685. * y {number|string|Decimal}
  6686. *
  6687. */
  6688. function div(x, y) {
  6689. return new this(x).div(y);
  6690. }
  6691. /*
  6692. * Return a new Decimal whose value is the natural exponential of `x`, rounded to `precision`
  6693. * significant digits using rounding mode `rounding`.
  6694. *
  6695. * x {number|string|Decimal} The power to which to raise the base of the natural log.
  6696. *
  6697. */
  6698. function exp(x) {
  6699. return new this(x).exp();
  6700. }
  6701. /*
  6702. * Return a new Decimal whose value is `x` round to an integer using `ROUND_FLOOR`.
  6703. *
  6704. * x {number|string|Decimal}
  6705. *
  6706. */
  6707. function floor(x) {
  6708. return finalise(x = new this(x), x.e + 1, 3);
  6709. }
  6710. /*
  6711. * Return a new Decimal whose value is the square root of the sum of the squares of the arguments,
  6712. * rounded to `precision` significant digits using rounding mode `rounding`.
  6713. *
  6714. * hypot(a, b, ...) = sqrt(a^2 + b^2 + ...)
  6715. *
  6716. * arguments {number|string|Decimal}
  6717. *
  6718. */
  6719. function hypot() {
  6720. var i,n,
  6721. t = new this(0);
  6722. external = false;
  6723. for (i = 0; i < arguments.length;) {
  6724. n = new this(arguments[i++]);
  6725. if (!n.d) {
  6726. if (n.s) {
  6727. external = true;
  6728. return new this(1 / 0);
  6729. }
  6730. t = n;
  6731. } else if (t.d) {
  6732. t = t.plus(n.times(n));
  6733. }
  6734. }
  6735. external = true;
  6736. return t.sqrt();
  6737. }
  6738. /*
  6739. * Return true if object is a Decimal instance (where Decimal is any Decimal constructor),
  6740. * otherwise return false.
  6741. *
  6742. */
  6743. function isDecimalInstance(obj) {
  6744. return obj instanceof Decimal || obj && obj.toStringTag === tag || false;
  6745. }
  6746. /*
  6747. * Return a new Decimal whose value is the natural logarithm of `x`, rounded to `precision`
  6748. * significant digits using rounding mode `rounding`.
  6749. *
  6750. * x {number|string|Decimal}
  6751. *
  6752. */
  6753. function ln(x) {
  6754. return new this(x).ln();
  6755. }
  6756. /*
  6757. * Return a new Decimal whose value is the log of `x` to the base `y`, or to base 10 if no base
  6758. * is specified, rounded to `precision` significant digits using rounding mode `rounding`.
  6759. *
  6760. * log[y](x)
  6761. *
  6762. * x {number|string|Decimal} The argument of the logarithm.
  6763. * y {number|string|Decimal} The base of the logarithm.
  6764. *
  6765. */
  6766. function log(x, y) {
  6767. return new this(x).log(y);
  6768. }
  6769. /*
  6770. * Return a new Decimal whose value is the base 2 logarithm of `x`, rounded to `precision`
  6771. * significant digits using rounding mode `rounding`.
  6772. *
  6773. * x {number|string|Decimal}
  6774. *
  6775. */
  6776. function log2(x) {
  6777. return new this(x).log(2);
  6778. }
  6779. /*
  6780. * Return a new Decimal whose value is the base 10 logarithm of `x`, rounded to `precision`
  6781. * significant digits using rounding mode `rounding`.
  6782. *
  6783. * x {number|string|Decimal}
  6784. *
  6785. */
  6786. function log10(x) {
  6787. return new this(x).log(10);
  6788. }
  6789. /*
  6790. * Return a new Decimal whose value is the maximum of the arguments.
  6791. *
  6792. * arguments {number|string|Decimal}
  6793. *
  6794. */
  6795. function max() {
  6796. return maxOrMin(this, arguments, 'lt');
  6797. }
  6798. /*
  6799. * Return a new Decimal whose value is the minimum of the arguments.
  6800. *
  6801. * arguments {number|string|Decimal}
  6802. *
  6803. */
  6804. function min() {
  6805. return maxOrMin(this, arguments, 'gt');
  6806. }
  6807. /*
  6808. * Return a new Decimal whose value is `x` modulo `y`, rounded to `precision` significant digits
  6809. * using rounding mode `rounding`.
  6810. *
  6811. * x {number|string|Decimal}
  6812. * y {number|string|Decimal}
  6813. *
  6814. */
  6815. function mod(x, y) {
  6816. return new this(x).mod(y);
  6817. }
  6818. /*
  6819. * Return a new Decimal whose value is `x` multiplied by `y`, rounded to `precision` significant
  6820. * digits using rounding mode `rounding`.
  6821. *
  6822. * x {number|string|Decimal}
  6823. * y {number|string|Decimal}
  6824. *
  6825. */
  6826. function mul(x, y) {
  6827. return new this(x).mul(y);
  6828. }
  6829. /*
  6830. * Return a new Decimal whose value is `x` raised to the power `y`, rounded to precision
  6831. * significant digits using rounding mode `rounding`.
  6832. *
  6833. * x {number|string|Decimal} The base.
  6834. * y {number|string|Decimal} The exponent.
  6835. *
  6836. */
  6837. function pow(x, y) {
  6838. return new this(x).pow(y);
  6839. }
  6840. /*
  6841. * Returns a new Decimal with a random value equal to or greater than 0 and less than 1, and with
  6842. * `sd`, or `Decimal.precision` if `sd` is omitted, significant digits (or less if trailing zeros
  6843. * are produced).
  6844. *
  6845. * [sd] {number} Significant digits. Integer, 0 to MAX_DIGITS inclusive.
  6846. *
  6847. */
  6848. function random(sd) {
  6849. var d,e,k,n,
  6850. i = 0,
  6851. r = new this(1),
  6852. rd = [];
  6853. if (sd === void 0) sd = this.precision;else
  6854. checkInt32(sd, 1, MAX_DIGITS);
  6855. k = Math.ceil(sd / LOG_BASE);
  6856. if (!this.crypto) {
  6857. for (; i < k;) {rd[i++] = Math.random() * 1e7 | 0;}
  6858. // Browsers supporting crypto.getRandomValues.
  6859. } else if (crypto.getRandomValues) {
  6860. d = crypto.getRandomValues(new Uint32Array(k));
  6861. for (; i < k;) {
  6862. n = d[i];
  6863. // 0 <= n < 4294967296
  6864. // Probability n >= 4.29e9, is 4967296 / 4294967296 = 0.00116 (1 in 865).
  6865. if (n >= 4.29e9) {
  6866. d[i] = crypto.getRandomValues(new Uint32Array(1))[0];
  6867. } else {
  6868. // 0 <= n <= 4289999999
  6869. // 0 <= (n % 1e7) <= 9999999
  6870. rd[i++] = n % 1e7;
  6871. }
  6872. }
  6873. // Node.js supporting crypto.randomBytes.
  6874. } else if (crypto.randomBytes) {
  6875. // buffer
  6876. d = crypto.randomBytes(k *= 4);
  6877. for (; i < k;) {
  6878. // 0 <= n < 2147483648
  6879. n = d[i] + (d[i + 1] << 8) + (d[i + 2] << 16) + ((d[i + 3] & 0x7f) << 24);
  6880. // Probability n >= 2.14e9, is 7483648 / 2147483648 = 0.0035 (1 in 286).
  6881. if (n >= 2.14e9) {
  6882. crypto.randomBytes(4).copy(d, i);
  6883. } else {
  6884. // 0 <= n <= 2139999999
  6885. // 0 <= (n % 1e7) <= 9999999
  6886. rd.push(n % 1e7);
  6887. i += 4;
  6888. }
  6889. }
  6890. i = k / 4;
  6891. } else {
  6892. throw Error(cryptoUnavailable);
  6893. }
  6894. k = rd[--i];
  6895. sd %= LOG_BASE;
  6896. // Convert trailing digits to zeros according to sd.
  6897. if (k && sd) {
  6898. n = mathpow(10, LOG_BASE - sd);
  6899. rd[i] = (k / n | 0) * n;
  6900. }
  6901. // Remove trailing words which are zero.
  6902. for (; rd[i] === 0; i--) {rd.pop();}
  6903. // Zero?
  6904. if (i < 0) {
  6905. e = 0;
  6906. rd = [0];
  6907. } else {
  6908. e = -1;
  6909. // Remove leading words which are zero and adjust exponent accordingly.
  6910. for (; rd[0] === 0; e -= LOG_BASE) {rd.shift();}
  6911. // Count the digits of the first word of rd to determine leading zeros.
  6912. for (k = 1, n = rd[0]; n >= 10; n /= 10) {k++;}
  6913. // Adjust the exponent for leading zeros of the first word of rd.
  6914. if (k < LOG_BASE) e -= LOG_BASE - k;
  6915. }
  6916. r.e = e;
  6917. r.d = rd;
  6918. return r;
  6919. }
  6920. /*
  6921. * Return a new Decimal whose value is `x` rounded to an integer using rounding mode `rounding`.
  6922. *
  6923. * To emulate `Math.round`, set rounding to 7 (ROUND_HALF_CEIL).
  6924. *
  6925. * x {number|string|Decimal}
  6926. *
  6927. */
  6928. function round(x) {
  6929. return finalise(x = new this(x), x.e + 1, this.rounding);
  6930. }
  6931. /*
  6932. * Return
  6933. * 1 if x > 0,
  6934. * -1 if x < 0,
  6935. * 0 if x is 0,
  6936. * -0 if x is -0,
  6937. * NaN otherwise
  6938. *
  6939. * x {number|string|Decimal}
  6940. *
  6941. */
  6942. function sign(x) {
  6943. x = new this(x);
  6944. return x.d ? x.d[0] ? x.s : 0 * x.s : x.s || NaN;
  6945. }
  6946. /*
  6947. * Return a new Decimal whose value is the sine of `x`, rounded to `precision` significant digits
  6948. * using rounding mode `rounding`.
  6949. *
  6950. * x {number|string|Decimal} A value in radians.
  6951. *
  6952. */
  6953. function sin(x) {
  6954. return new this(x).sin();
  6955. }
  6956. /*
  6957. * Return a new Decimal whose value is the hyperbolic sine of `x`, rounded to `precision`
  6958. * significant digits using rounding mode `rounding`.
  6959. *
  6960. * x {number|string|Decimal} A value in radians.
  6961. *
  6962. */
  6963. function sinh(x) {
  6964. return new this(x).sinh();
  6965. }
  6966. /*
  6967. * Return a new Decimal whose value is the square root of `x`, rounded to `precision` significant
  6968. * digits using rounding mode `rounding`.
  6969. *
  6970. * x {number|string|Decimal}
  6971. *
  6972. */
  6973. function sqrt(x) {
  6974. return new this(x).sqrt();
  6975. }
  6976. /*
  6977. * Return a new Decimal whose value is `x` minus `y`, rounded to `precision` significant digits
  6978. * using rounding mode `rounding`.
  6979. *
  6980. * x {number|string|Decimal}
  6981. * y {number|string|Decimal}
  6982. *
  6983. */
  6984. function sub(x, y) {
  6985. return new this(x).sub(y);
  6986. }
  6987. /*
  6988. * Return a new Decimal whose value is the sum of the arguments, rounded to `precision`
  6989. * significant digits using rounding mode `rounding`.
  6990. *
  6991. * Only the result is rounded, not the intermediate calculations.
  6992. *
  6993. * arguments {number|string|Decimal}
  6994. *
  6995. */
  6996. function sum() {
  6997. var i = 0,
  6998. args = arguments,
  6999. x = new this(args[i]);
  7000. external = false;
  7001. for (; x.s && ++i < args.length;) {x = x.plus(args[i]);}
  7002. external = true;
  7003. return finalise(x, this.precision, this.rounding);
  7004. }
  7005. /*
  7006. * Return a new Decimal whose value is the tangent of `x`, rounded to `precision` significant
  7007. * digits using rounding mode `rounding`.
  7008. *
  7009. * x {number|string|Decimal} A value in radians.
  7010. *
  7011. */
  7012. function tan(x) {
  7013. return new this(x).tan();
  7014. }
  7015. /*
  7016. * Return a new Decimal whose value is the hyperbolic tangent of `x`, rounded to `precision`
  7017. * significant digits using rounding mode `rounding`.
  7018. *
  7019. * x {number|string|Decimal} A value in radians.
  7020. *
  7021. */
  7022. function tanh(x) {
  7023. return new this(x).tanh();
  7024. }
  7025. /*
  7026. * Return a new Decimal whose value is `x` truncated to an integer.
  7027. *
  7028. * x {number|string|Decimal}
  7029. *
  7030. */
  7031. function trunc(x) {
  7032. return finalise(x = new this(x), x.e + 1, 1);
  7033. }
  7034. // Create and configure initial Decimal constructor.
  7035. Decimal = clone(DEFAULTS);
  7036. Decimal.prototype.constructor = Decimal;
  7037. Decimal['default'] = Decimal.Decimal = Decimal;
  7038. // Create the internal constants from their string values.
  7039. LN10 = new Decimal(LN10);
  7040. PI = new Decimal(PI);
  7041. // Export.
  7042. // AMD.
  7043. if (true) {
  7044. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {
  7045. return Decimal;
  7046. }).call(exports, __webpack_require__, exports, module),
  7047. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  7048. // Node and other environments that support module.exports.
  7049. } else {}
  7050. })(this);
  7051. /***/ }),
  7052. /***/ 2:
  7053. /*!***********************************!*\
  7054. !*** (webpack)/buildin/global.js ***!
  7055. \***********************************/
  7056. /*! no static exports found */
  7057. /***/ (function(module, exports) {
  7058. var g;
  7059. // This works in non-strict mode
  7060. g = (function() {
  7061. return this;
  7062. })();
  7063. try {
  7064. // This works if eval is allowed (see CSP)
  7065. g = g || new Function("return this")();
  7066. } catch (e) {
  7067. // This works if the window reference is available
  7068. if (typeof window === "object") g = window;
  7069. }
  7070. // g can still be undefined, but nothing to do about it...
  7071. // We return undefined, instead of nothing here, so it's
  7072. // easier to handle this case. if(!global) { ...}
  7073. module.exports = g;
  7074. /***/ }),
  7075. /***/ 25:
  7076. /*!****************************************************!*\
  7077. !*** D:/wxproject/项目模板/uniapp/static/foods_2.webp ***!
  7078. \****************************************************/
  7079. /*! no static exports found */
  7080. /***/ (function(module, exports) {
  7081. module.exports = "/static/foods_2.webp";
  7082. /***/ }),
  7083. /***/ 3:
  7084. /*!*************************************************************!*\
  7085. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  7086. \*************************************************************/
  7087. /*! no static exports found */
  7088. /***/ (function(module, exports, __webpack_require__) {
  7089. "use strict";
  7090. /* 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;
  7091. var isObject = function isObject(val) {return val !== null && typeof val === 'object';};
  7092. var defaultDelimiters = ['{', '}'];var
  7093. BaseFormatter = /*#__PURE__*/function () {
  7094. function BaseFormatter() {_classCallCheck(this, BaseFormatter);
  7095. this._caches = Object.create(null);
  7096. }_createClass(BaseFormatter, [{ key: "interpolate", value: function interpolate(
  7097. message, values) {var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  7098. if (!values) {
  7099. return [message];
  7100. }
  7101. var tokens = this._caches[message];
  7102. if (!tokens) {
  7103. tokens = parse(message, delimiters);
  7104. this._caches[message] = tokens;
  7105. }
  7106. return compile(tokens, values);
  7107. } }]);return BaseFormatter;}();exports.Formatter = BaseFormatter;
  7108. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  7109. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  7110. function parse(format, _ref) {var _ref2 = _slicedToArray(_ref, 2),startDelimiter = _ref2[0],endDelimiter = _ref2[1];
  7111. var tokens = [];
  7112. var position = 0;
  7113. var text = '';
  7114. while (position < format.length) {
  7115. var char = format[position++];
  7116. if (char === startDelimiter) {
  7117. if (text) {
  7118. tokens.push({ type: 'text', value: text });
  7119. }
  7120. text = '';
  7121. var sub = '';
  7122. char = format[position++];
  7123. while (char !== undefined && char !== endDelimiter) {
  7124. sub += char;
  7125. char = format[position++];
  7126. }
  7127. var isClosed = char === endDelimiter;
  7128. var type = RE_TOKEN_LIST_VALUE.test(sub) ?
  7129. 'list' :
  7130. isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ?
  7131. 'named' :
  7132. 'unknown';
  7133. tokens.push({ value: sub, type: type });
  7134. }
  7135. // else if (char === '%') {
  7136. // // when found rails i18n syntax, skip text capture
  7137. // if (format[position] !== '{') {
  7138. // text += char
  7139. // }
  7140. // }
  7141. else {
  7142. text += char;
  7143. }
  7144. }
  7145. text && tokens.push({ type: 'text', value: text });
  7146. return tokens;
  7147. }
  7148. function compile(tokens, values) {
  7149. var compiled = [];
  7150. var index = 0;
  7151. var mode = isArray(values) ?
  7152. 'list' :
  7153. isObject(values) ?
  7154. 'named' :
  7155. 'unknown';
  7156. if (mode === 'unknown') {
  7157. return compiled;
  7158. }
  7159. while (index < tokens.length) {
  7160. var token = tokens[index];
  7161. switch (token.type) {
  7162. case 'text':
  7163. compiled.push(token.value);
  7164. break;
  7165. case 'list':
  7166. compiled.push(values[parseInt(token.value, 10)]);
  7167. break;
  7168. case 'named':
  7169. if (mode === 'named') {
  7170. compiled.push(values[token.value]);
  7171. } else
  7172. {
  7173. if (true) {
  7174. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  7175. }
  7176. }
  7177. break;
  7178. case 'unknown':
  7179. if (true) {
  7180. console.warn("Detect 'unknown' type of token!");
  7181. }
  7182. break;}
  7183. index++;
  7184. }
  7185. return compiled;
  7186. }
  7187. var LOCALE_ZH_HANS = 'zh-Hans';exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  7188. var LOCALE_ZH_HANT = 'zh-Hant';exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  7189. var LOCALE_EN = 'en';exports.LOCALE_EN = LOCALE_EN;
  7190. var LOCALE_FR = 'fr';exports.LOCALE_FR = LOCALE_FR;
  7191. var LOCALE_ES = 'es';exports.LOCALE_ES = LOCALE_ES;
  7192. var hasOwnProperty = Object.prototype.hasOwnProperty;
  7193. var hasOwn = function hasOwn(val, key) {return hasOwnProperty.call(val, key);};
  7194. var defaultFormatter = new BaseFormatter();
  7195. function include(str, parts) {
  7196. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  7197. }
  7198. function startsWith(str, parts) {
  7199. return parts.find(function (part) {return str.indexOf(part) === 0;});
  7200. }
  7201. function normalizeLocale(locale, messages) {
  7202. if (!locale) {
  7203. return;
  7204. }
  7205. locale = locale.trim().replace(/_/g, '-');
  7206. if (messages && messages[locale]) {
  7207. return locale;
  7208. }
  7209. locale = locale.toLowerCase();
  7210. if (locale.indexOf('zh') === 0) {
  7211. if (locale.indexOf('-hans') > -1) {
  7212. return LOCALE_ZH_HANS;
  7213. }
  7214. if (locale.indexOf('-hant') > -1) {
  7215. return LOCALE_ZH_HANT;
  7216. }
  7217. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  7218. return LOCALE_ZH_HANT;
  7219. }
  7220. return LOCALE_ZH_HANS;
  7221. }
  7222. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  7223. if (lang) {
  7224. return lang;
  7225. }
  7226. }var
  7227. I18n = /*#__PURE__*/function () {
  7228. function I18n(_ref3) {var locale = _ref3.locale,fallbackLocale = _ref3.fallbackLocale,messages = _ref3.messages,watcher = _ref3.watcher,formater = _ref3.formater;_classCallCheck(this, I18n);
  7229. this.locale = LOCALE_EN;
  7230. this.fallbackLocale = LOCALE_EN;
  7231. this.message = {};
  7232. this.messages = {};
  7233. this.watchers = [];
  7234. if (fallbackLocale) {
  7235. this.fallbackLocale = fallbackLocale;
  7236. }
  7237. this.formater = formater || defaultFormatter;
  7238. this.messages = messages || {};
  7239. this.setLocale(locale || LOCALE_EN);
  7240. if (watcher) {
  7241. this.watchLocale(watcher);
  7242. }
  7243. }_createClass(I18n, [{ key: "setLocale", value: function setLocale(
  7244. locale) {var _this = this;
  7245. var oldLocale = this.locale;
  7246. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  7247. if (!this.messages[this.locale]) {
  7248. // 可能初始化时不存在
  7249. this.messages[this.locale] = {};
  7250. }
  7251. this.message = this.messages[this.locale];
  7252. // 仅发生变化时,通知
  7253. if (oldLocale !== this.locale) {
  7254. this.watchers.forEach(function (watcher) {
  7255. watcher(_this.locale, oldLocale);
  7256. });
  7257. }
  7258. } }, { key: "getLocale", value: function getLocale()
  7259. {
  7260. return this.locale;
  7261. } }, { key: "watchLocale", value: function watchLocale(
  7262. fn) {var _this2 = this;
  7263. var index = this.watchers.push(fn) - 1;
  7264. return function () {
  7265. _this2.watchers.splice(index, 1);
  7266. };
  7267. } }, { key: "add", value: function add(
  7268. locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  7269. var curMessages = this.messages[locale];
  7270. if (curMessages) {
  7271. if (override) {
  7272. Object.assign(curMessages, message);
  7273. } else
  7274. {
  7275. Object.keys(message).forEach(function (key) {
  7276. if (!hasOwn(curMessages, key)) {
  7277. curMessages[key] = message[key];
  7278. }
  7279. });
  7280. }
  7281. } else
  7282. {
  7283. this.messages[locale] = message;
  7284. }
  7285. } }, { key: "f", value: function f(
  7286. message, values, delimiters) {
  7287. return this.formater.interpolate(message, values, delimiters).join('');
  7288. } }, { key: "t", value: function t(
  7289. key, locale, values) {
  7290. var message = this.message;
  7291. if (typeof locale === 'string') {
  7292. locale = normalizeLocale(locale, this.messages);
  7293. locale && (message = this.messages[locale]);
  7294. } else
  7295. {
  7296. values = locale;
  7297. }
  7298. if (!hasOwn(message, key)) {
  7299. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  7300. return key;
  7301. }
  7302. return this.formater.interpolate(message[key], values).join('');
  7303. } }]);return I18n;}();exports.I18n = I18n;
  7304. function watchAppLocale(appVm, i18n) {
  7305. // 需要保证 watch 的触发在组件渲染之前
  7306. if (appVm.$watchLocale) {
  7307. // vue2
  7308. appVm.$watchLocale(function (newLocale) {
  7309. i18n.setLocale(newLocale);
  7310. });
  7311. } else
  7312. {
  7313. appVm.$watch(function () {return appVm.$locale;}, function (newLocale) {
  7314. i18n.setLocale(newLocale);
  7315. });
  7316. }
  7317. }
  7318. function getDefaultLocale() {
  7319. if (typeof uni !== 'undefined' && uni.getLocale) {
  7320. return uni.getLocale();
  7321. }
  7322. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  7323. if (typeof global !== 'undefined' && global.getLocale) {
  7324. return global.getLocale();
  7325. }
  7326. return LOCALE_EN;
  7327. }
  7328. 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;
  7329. // 兼容旧版本入参
  7330. if (typeof locale !== 'string') {var _ref4 =
  7331. [
  7332. messages,
  7333. locale];locale = _ref4[0];messages = _ref4[1];
  7334. }
  7335. if (typeof locale !== 'string') {
  7336. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  7337. locale = getDefaultLocale();
  7338. }
  7339. if (typeof fallbackLocale !== 'string') {
  7340. fallbackLocale =
  7341. typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale ||
  7342. LOCALE_EN;
  7343. }
  7344. var i18n = new I18n({
  7345. locale: locale,
  7346. fallbackLocale: fallbackLocale,
  7347. messages: messages,
  7348. watcher: watcher });
  7349. var _t = function t(key, values) {
  7350. if (typeof getApp !== 'function') {
  7351. // app view
  7352. /* eslint-disable no-func-assign */
  7353. _t = function t(key, values) {
  7354. return i18n.t(key, values);
  7355. };
  7356. } else
  7357. {
  7358. var isWatchedAppLocale = false;
  7359. _t = function t(key, values) {
  7360. var appVm = getApp().$vm;
  7361. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  7362. // options: {
  7363. // type: Array,
  7364. // default () {
  7365. // return [{
  7366. // icon: 'shop',
  7367. // text: t("uni-goods-nav.options.shop"),
  7368. // }, {
  7369. // icon: 'cart',
  7370. // text: t("uni-goods-nav.options.cart")
  7371. // }]
  7372. // }
  7373. // },
  7374. if (appVm) {
  7375. // 触发响应式
  7376. appVm.$locale;
  7377. if (!isWatchedAppLocale) {
  7378. isWatchedAppLocale = true;
  7379. watchAppLocale(appVm, i18n);
  7380. }
  7381. }
  7382. return i18n.t(key, values);
  7383. };
  7384. }
  7385. return _t(key, values);
  7386. };
  7387. return {
  7388. i18n: i18n,
  7389. f: function f(message, values, delimiters) {
  7390. return i18n.f(message, values, delimiters);
  7391. },
  7392. t: function t(key, values) {
  7393. return _t(key, values);
  7394. },
  7395. add: function add(locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  7396. return i18n.add(locale, message, override);
  7397. },
  7398. watch: function watch(fn) {
  7399. return i18n.watchLocale(fn);
  7400. },
  7401. getLocale: function getLocale() {
  7402. return i18n.getLocale();
  7403. },
  7404. setLocale: function setLocale(newLocale) {
  7405. return i18n.setLocale(newLocale);
  7406. } };
  7407. }
  7408. var isString = function isString(val) {return typeof val === 'string';};exports.isString = isString;
  7409. var formater;
  7410. function hasI18nJson(jsonObj, delimiters) {
  7411. if (!formater) {
  7412. formater = new BaseFormatter();
  7413. }
  7414. return walkJsonObj(jsonObj, function (jsonObj, key) {
  7415. var value = jsonObj[key];
  7416. if (isString(value)) {
  7417. if (isI18nStr(value, delimiters)) {
  7418. return true;
  7419. }
  7420. } else
  7421. {
  7422. return hasI18nJson(value, delimiters);
  7423. }
  7424. });
  7425. }
  7426. function parseI18nJson(jsonObj, values, delimiters) {
  7427. if (!formater) {
  7428. formater = new BaseFormatter();
  7429. }
  7430. walkJsonObj(jsonObj, function (jsonObj, key) {
  7431. var value = jsonObj[key];
  7432. if (isString(value)) {
  7433. if (isI18nStr(value, delimiters)) {
  7434. jsonObj[key] = compileStr(value, values, delimiters);
  7435. }
  7436. } else
  7437. {
  7438. parseI18nJson(value, values, delimiters);
  7439. }
  7440. });
  7441. return jsonObj;
  7442. }
  7443. function compileI18nJsonStr(jsonStr, _ref5) {var locale = _ref5.locale,locales = _ref5.locales,delimiters = _ref5.delimiters;
  7444. if (!isI18nStr(jsonStr, delimiters)) {
  7445. return jsonStr;
  7446. }
  7447. if (!formater) {
  7448. formater = new BaseFormatter();
  7449. }
  7450. var localeValues = [];
  7451. Object.keys(locales).forEach(function (name) {
  7452. if (name !== locale) {
  7453. localeValues.push({
  7454. locale: name,
  7455. values: locales[name] });
  7456. }
  7457. });
  7458. localeValues.unshift({ locale: locale, values: locales[locale] });
  7459. try {
  7460. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  7461. }
  7462. catch (e) {}
  7463. return jsonStr;
  7464. }
  7465. function isI18nStr(value, delimiters) {
  7466. return value.indexOf(delimiters[0]) > -1;
  7467. }
  7468. function compileStr(value, values, delimiters) {
  7469. return formater.interpolate(value, values, delimiters).join('');
  7470. }
  7471. function compileValue(jsonObj, key, localeValues, delimiters) {
  7472. var value = jsonObj[key];
  7473. if (isString(value)) {
  7474. // 存在国际化
  7475. if (isI18nStr(value, delimiters)) {
  7476. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  7477. if (localeValues.length > 1) {
  7478. // 格式化国际化语言
  7479. var valueLocales = jsonObj[key + 'Locales'] = {};
  7480. localeValues.forEach(function (localValue) {
  7481. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  7482. });
  7483. }
  7484. }
  7485. } else
  7486. {
  7487. compileJsonObj(value, localeValues, delimiters);
  7488. }
  7489. }
  7490. function compileJsonObj(jsonObj, localeValues, delimiters) {
  7491. walkJsonObj(jsonObj, function (jsonObj, key) {
  7492. compileValue(jsonObj, key, localeValues, delimiters);
  7493. });
  7494. return jsonObj;
  7495. }
  7496. function walkJsonObj(jsonObj, walk) {
  7497. if (isArray(jsonObj)) {
  7498. for (var i = 0; i < jsonObj.length; i++) {
  7499. if (walk(jsonObj, i)) {
  7500. return true;
  7501. }
  7502. }
  7503. } else
  7504. if (isObject(jsonObj)) {
  7505. for (var key in jsonObj) {
  7506. if (walk(jsonObj, key)) {
  7507. return true;
  7508. }
  7509. }
  7510. }
  7511. return false;
  7512. }
  7513. function resolveLocale(locales) {
  7514. return function (locale) {
  7515. if (!locale) {
  7516. return locale;
  7517. }
  7518. locale = normalizeLocale(locale) || locale;
  7519. return resolveLocaleChain(locale).find(function (locale) {return locales.indexOf(locale) > -1;});
  7520. };
  7521. }
  7522. function resolveLocaleChain(locale) {
  7523. var chain = [];
  7524. var tokens = locale.split('-');
  7525. while (tokens.length) {
  7526. chain.push(tokens.join('-'));
  7527. tokens.pop();
  7528. }
  7529. return chain;
  7530. }
  7531. /* 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)))
  7532. /***/ }),
  7533. /***/ 34:
  7534. /*!****************************************************!*\
  7535. !*** D:/wxproject/项目模板/uniapp/static/foods_1.webp ***!
  7536. \****************************************************/
  7537. /*! no static exports found */
  7538. /***/ (function(module, exports) {
  7539. module.exports = "data:image/webp;base64,UklGRlR0AABXRUJQVlA4IEh0AABwXgKdASp5A/QBPpFEnEulo7IxoveKwkASCWNulpU6Ffj51M00q+CRZoR9fl/9QGN/FP7BfsFtW9AfzCc3qjbtVum+Xdb2hBKfxz448I+tNmfdO53/snILls3oQvWuwQ3/4egL5D/m+C/pGcueK8NPAX9x+g/JcYG5g+HniCeWH/n8SX83/1fYF8nX/c8pH7H/zPYT8u72hfux///eD/d0kZdLI2VJAtAmnHA3PYPZP0BaZ/ZR2p6QJLQ/fzzW31K8IDYVmAMEVXndAImqt0rIOLFi551pQ9k3PT02WyIMZ3GGFFaIJ2fPBg6A246yKmNSd7TM+eXP23eFiJL2R7/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BCO6jetHzHjVaGYZTOixiFE8qpPEpNF2hcD1Fjtb5GcuuIoZhiVBqduXu6NM9ullXyXxsXx4gN6OZ5yaZd9O5f6tVDD0mNo6w8Ksl3xRmOmYCsB0Xd3JC7SzUIbqHPXGGA6sCHl7TJSQ0JJwJbsiPqtB+6EwTQ2a4w3+k5fJE6KQcFW/kUiLNwCnXieqVyzAce46R49N4B+iQwI4BrcUiVrg0Wz0XWKVziIO1RcmSHQNGGPC4ogEnFXFdYt4UtcK0eROcEm1MXoNsu34LnRQ9QBWI+OLWpxeDqW2u3CV8TXFbzXKkdwtQrzYUo0+AdUHUHIC2nVKGdg8WGXSKDKbE9sRX832U7V2hOzsFIuzZlRXGVqifKRCZcZI2T/MvBklWdDF1APAAAN2Ed+fCIT0B56SNgFjaPBQqMOFKMoRHS2G7WdiJj7X0HD7yZqypqndqdIsD/6SAAAA=="
  7540. /***/ }),
  7541. /***/ 35:
  7542. /*!****************************************************!*\
  7543. !*** D:/wxproject/项目模板/uniapp/static/foods_3.webp ***!
  7544. \****************************************************/
  7545. /*! no static exports found */
  7546. /***/ (function(module, exports) {
  7547. module.exports = "/static/foods_3.webp";
  7548. /***/ }),
  7549. /***/ 36:
  7550. /*!****************************************************!*\
  7551. !*** D:/wxproject/项目模板/uniapp/static/foods_4.webp ***!
  7552. \****************************************************/
  7553. /*! no static exports found */
  7554. /***/ (function(module, exports) {
  7555. module.exports = "/static/foods_4.webp";
  7556. /***/ }),
  7557. /***/ 4:
  7558. /*!******************************************************************************************!*\
  7559. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  7560. \******************************************************************************************/
  7561. /*! exports provided: default */
  7562. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7563. "use strict";
  7564. __webpack_require__.r(__webpack_exports__);
  7565. /* WEBPACK VAR INJECTION */(function(global) {/*!
  7566. * Vue.js v2.6.11
  7567. * (c) 2014-2022 Evan You
  7568. * Released under the MIT License.
  7569. */
  7570. /* */
  7571. var emptyObject = Object.freeze({});
  7572. // These helpers produce better VM code in JS engines due to their
  7573. // explicitness and function inlining.
  7574. function isUndef (v) {
  7575. return v === undefined || v === null
  7576. }
  7577. function isDef (v) {
  7578. return v !== undefined && v !== null
  7579. }
  7580. function isTrue (v) {
  7581. return v === true
  7582. }
  7583. function isFalse (v) {
  7584. return v === false
  7585. }
  7586. /**
  7587. * Check if value is primitive.
  7588. */
  7589. function isPrimitive (value) {
  7590. return (
  7591. typeof value === 'string' ||
  7592. typeof value === 'number' ||
  7593. // $flow-disable-line
  7594. typeof value === 'symbol' ||
  7595. typeof value === 'boolean'
  7596. )
  7597. }
  7598. /**
  7599. * Quick object check - this is primarily used to tell
  7600. * Objects from primitive values when we know the value
  7601. * is a JSON-compliant type.
  7602. */
  7603. function isObject (obj) {
  7604. return obj !== null && typeof obj === 'object'
  7605. }
  7606. /**
  7607. * Get the raw type string of a value, e.g., [object Object].
  7608. */
  7609. var _toString = Object.prototype.toString;
  7610. function toRawType (value) {
  7611. return _toString.call(value).slice(8, -1)
  7612. }
  7613. /**
  7614. * Strict object type check. Only returns true
  7615. * for plain JavaScript objects.
  7616. */
  7617. function isPlainObject (obj) {
  7618. return _toString.call(obj) === '[object Object]'
  7619. }
  7620. function isRegExp (v) {
  7621. return _toString.call(v) === '[object RegExp]'
  7622. }
  7623. /**
  7624. * Check if val is a valid array index.
  7625. */
  7626. function isValidArrayIndex (val) {
  7627. var n = parseFloat(String(val));
  7628. return n >= 0 && Math.floor(n) === n && isFinite(val)
  7629. }
  7630. function isPromise (val) {
  7631. return (
  7632. isDef(val) &&
  7633. typeof val.then === 'function' &&
  7634. typeof val.catch === 'function'
  7635. )
  7636. }
  7637. /**
  7638. * Convert a value to a string that is actually rendered.
  7639. */
  7640. function toString (val) {
  7641. return val == null
  7642. ? ''
  7643. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  7644. ? JSON.stringify(val, null, 2)
  7645. : String(val)
  7646. }
  7647. /**
  7648. * Convert an input value to a number for persistence.
  7649. * If the conversion fails, return original string.
  7650. */
  7651. function toNumber (val) {
  7652. var n = parseFloat(val);
  7653. return isNaN(n) ? val : n
  7654. }
  7655. /**
  7656. * Make a map and return a function for checking if a key
  7657. * is in that map.
  7658. */
  7659. function makeMap (
  7660. str,
  7661. expectsLowerCase
  7662. ) {
  7663. var map = Object.create(null);
  7664. var list = str.split(',');
  7665. for (var i = 0; i < list.length; i++) {
  7666. map[list[i]] = true;
  7667. }
  7668. return expectsLowerCase
  7669. ? function (val) { return map[val.toLowerCase()]; }
  7670. : function (val) { return map[val]; }
  7671. }
  7672. /**
  7673. * Check if a tag is a built-in tag.
  7674. */
  7675. var isBuiltInTag = makeMap('slot,component', true);
  7676. /**
  7677. * Check if an attribute is a reserved attribute.
  7678. */
  7679. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  7680. /**
  7681. * Remove an item from an array.
  7682. */
  7683. function remove (arr, item) {
  7684. if (arr.length) {
  7685. var index = arr.indexOf(item);
  7686. if (index > -1) {
  7687. return arr.splice(index, 1)
  7688. }
  7689. }
  7690. }
  7691. /**
  7692. * Check whether an object has the property.
  7693. */
  7694. var hasOwnProperty = Object.prototype.hasOwnProperty;
  7695. function hasOwn (obj, key) {
  7696. return hasOwnProperty.call(obj, key)
  7697. }
  7698. /**
  7699. * Create a cached version of a pure function.
  7700. */
  7701. function cached (fn) {
  7702. var cache = Object.create(null);
  7703. return (function cachedFn (str) {
  7704. var hit = cache[str];
  7705. return hit || (cache[str] = fn(str))
  7706. })
  7707. }
  7708. /**
  7709. * Camelize a hyphen-delimited string.
  7710. */
  7711. var camelizeRE = /-(\w)/g;
  7712. var camelize = cached(function (str) {
  7713. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  7714. });
  7715. /**
  7716. * Capitalize a string.
  7717. */
  7718. var capitalize = cached(function (str) {
  7719. return str.charAt(0).toUpperCase() + str.slice(1)
  7720. });
  7721. /**
  7722. * Hyphenate a camelCase string.
  7723. */
  7724. var hyphenateRE = /\B([A-Z])/g;
  7725. var hyphenate = cached(function (str) {
  7726. return str.replace(hyphenateRE, '-$1').toLowerCase()
  7727. });
  7728. /**
  7729. * Simple bind polyfill for environments that do not support it,
  7730. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  7731. * since native bind is now performant enough in most browsers.
  7732. * But removing it would mean breaking code that was able to run in
  7733. * PhantomJS 1.x, so this must be kept for backward compatibility.
  7734. */
  7735. /* istanbul ignore next */
  7736. function polyfillBind (fn, ctx) {
  7737. function boundFn (a) {
  7738. var l = arguments.length;
  7739. return l
  7740. ? l > 1
  7741. ? fn.apply(ctx, arguments)
  7742. : fn.call(ctx, a)
  7743. : fn.call(ctx)
  7744. }
  7745. boundFn._length = fn.length;
  7746. return boundFn
  7747. }
  7748. function nativeBind (fn, ctx) {
  7749. return fn.bind(ctx)
  7750. }
  7751. var bind = Function.prototype.bind
  7752. ? nativeBind
  7753. : polyfillBind;
  7754. /**
  7755. * Convert an Array-like object to a real Array.
  7756. */
  7757. function toArray (list, start) {
  7758. start = start || 0;
  7759. var i = list.length - start;
  7760. var ret = new Array(i);
  7761. while (i--) {
  7762. ret[i] = list[i + start];
  7763. }
  7764. return ret
  7765. }
  7766. /**
  7767. * Mix properties into target object.
  7768. */
  7769. function extend (to, _from) {
  7770. for (var key in _from) {
  7771. to[key] = _from[key];
  7772. }
  7773. return to
  7774. }
  7775. /**
  7776. * Merge an Array of Objects into a single Object.
  7777. */
  7778. function toObject (arr) {
  7779. var res = {};
  7780. for (var i = 0; i < arr.length; i++) {
  7781. if (arr[i]) {
  7782. extend(res, arr[i]);
  7783. }
  7784. }
  7785. return res
  7786. }
  7787. /* eslint-disable no-unused-vars */
  7788. /**
  7789. * Perform no operation.
  7790. * Stubbing args to make Flow happy without leaving useless transpiled code
  7791. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  7792. */
  7793. function noop (a, b, c) {}
  7794. /**
  7795. * Always return false.
  7796. */
  7797. var no = function (a, b, c) { return false; };
  7798. /* eslint-enable no-unused-vars */
  7799. /**
  7800. * Return the same value.
  7801. */
  7802. var identity = function (_) { return _; };
  7803. /**
  7804. * Check if two values are loosely equal - that is,
  7805. * if they are plain objects, do they have the same shape?
  7806. */
  7807. function looseEqual (a, b) {
  7808. if (a === b) { return true }
  7809. var isObjectA = isObject(a);
  7810. var isObjectB = isObject(b);
  7811. if (isObjectA && isObjectB) {
  7812. try {
  7813. var isArrayA = Array.isArray(a);
  7814. var isArrayB = Array.isArray(b);
  7815. if (isArrayA && isArrayB) {
  7816. return a.length === b.length && a.every(function (e, i) {
  7817. return looseEqual(e, b[i])
  7818. })
  7819. } else if (a instanceof Date && b instanceof Date) {
  7820. return a.getTime() === b.getTime()
  7821. } else if (!isArrayA && !isArrayB) {
  7822. var keysA = Object.keys(a);
  7823. var keysB = Object.keys(b);
  7824. return keysA.length === keysB.length && keysA.every(function (key) {
  7825. return looseEqual(a[key], b[key])
  7826. })
  7827. } else {
  7828. /* istanbul ignore next */
  7829. return false
  7830. }
  7831. } catch (e) {
  7832. /* istanbul ignore next */
  7833. return false
  7834. }
  7835. } else if (!isObjectA && !isObjectB) {
  7836. return String(a) === String(b)
  7837. } else {
  7838. return false
  7839. }
  7840. }
  7841. /**
  7842. * Return the first index at which a loosely equal value can be
  7843. * found in the array (if value is a plain object, the array must
  7844. * contain an object of the same shape), or -1 if it is not present.
  7845. */
  7846. function looseIndexOf (arr, val) {
  7847. for (var i = 0; i < arr.length; i++) {
  7848. if (looseEqual(arr[i], val)) { return i }
  7849. }
  7850. return -1
  7851. }
  7852. /**
  7853. * Ensure a function is called only once.
  7854. */
  7855. function once (fn) {
  7856. var called = false;
  7857. return function () {
  7858. if (!called) {
  7859. called = true;
  7860. fn.apply(this, arguments);
  7861. }
  7862. }
  7863. }
  7864. var ASSET_TYPES = [
  7865. 'component',
  7866. 'directive',
  7867. 'filter'
  7868. ];
  7869. var LIFECYCLE_HOOKS = [
  7870. 'beforeCreate',
  7871. 'created',
  7872. 'beforeMount',
  7873. 'mounted',
  7874. 'beforeUpdate',
  7875. 'updated',
  7876. 'beforeDestroy',
  7877. 'destroyed',
  7878. 'activated',
  7879. 'deactivated',
  7880. 'errorCaptured',
  7881. 'serverPrefetch'
  7882. ];
  7883. /* */
  7884. var config = ({
  7885. /**
  7886. * Option merge strategies (used in core/util/options)
  7887. */
  7888. // $flow-disable-line
  7889. optionMergeStrategies: Object.create(null),
  7890. /**
  7891. * Whether to suppress warnings.
  7892. */
  7893. silent: false,
  7894. /**
  7895. * Show production mode tip message on boot?
  7896. */
  7897. productionTip: "development" !== 'production',
  7898. /**
  7899. * Whether to enable devtools
  7900. */
  7901. devtools: "development" !== 'production',
  7902. /**
  7903. * Whether to record perf
  7904. */
  7905. performance: false,
  7906. /**
  7907. * Error handler for watcher errors
  7908. */
  7909. errorHandler: null,
  7910. /**
  7911. * Warn handler for watcher warns
  7912. */
  7913. warnHandler: null,
  7914. /**
  7915. * Ignore certain custom elements
  7916. */
  7917. ignoredElements: [],
  7918. /**
  7919. * Custom user key aliases for v-on
  7920. */
  7921. // $flow-disable-line
  7922. keyCodes: Object.create(null),
  7923. /**
  7924. * Check if a tag is reserved so that it cannot be registered as a
  7925. * component. This is platform-dependent and may be overwritten.
  7926. */
  7927. isReservedTag: no,
  7928. /**
  7929. * Check if an attribute is reserved so that it cannot be used as a component
  7930. * prop. This is platform-dependent and may be overwritten.
  7931. */
  7932. isReservedAttr: no,
  7933. /**
  7934. * Check if a tag is an unknown element.
  7935. * Platform-dependent.
  7936. */
  7937. isUnknownElement: no,
  7938. /**
  7939. * Get the namespace of an element
  7940. */
  7941. getTagNamespace: noop,
  7942. /**
  7943. * Parse the real tag name for the specific platform.
  7944. */
  7945. parsePlatformTagName: identity,
  7946. /**
  7947. * Check if an attribute must be bound using property, e.g. value
  7948. * Platform-dependent.
  7949. */
  7950. mustUseProp: no,
  7951. /**
  7952. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  7953. * This will significantly reduce performance if set to false.
  7954. */
  7955. async: true,
  7956. /**
  7957. * Exposed for legacy reasons
  7958. */
  7959. _lifecycleHooks: LIFECYCLE_HOOKS
  7960. });
  7961. /* */
  7962. /**
  7963. * unicode letters used for parsing html tags, component names and property paths.
  7964. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  7965. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  7966. */
  7967. 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/;
  7968. /**
  7969. * Check if a string starts with $ or _
  7970. */
  7971. function isReserved (str) {
  7972. var c = (str + '').charCodeAt(0);
  7973. return c === 0x24 || c === 0x5F
  7974. }
  7975. /**
  7976. * Define a property.
  7977. */
  7978. function def (obj, key, val, enumerable) {
  7979. Object.defineProperty(obj, key, {
  7980. value: val,
  7981. enumerable: !!enumerable,
  7982. writable: true,
  7983. configurable: true
  7984. });
  7985. }
  7986. /**
  7987. * Parse simple path.
  7988. */
  7989. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  7990. function parsePath (path) {
  7991. if (bailRE.test(path)) {
  7992. return
  7993. }
  7994. var segments = path.split('.');
  7995. return function (obj) {
  7996. for (var i = 0; i < segments.length; i++) {
  7997. if (!obj) { return }
  7998. obj = obj[segments[i]];
  7999. }
  8000. return obj
  8001. }
  8002. }
  8003. /* */
  8004. // can we use __proto__?
  8005. var hasProto = '__proto__' in {};
  8006. // Browser environment sniffing
  8007. var inBrowser = typeof window !== 'undefined';
  8008. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  8009. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  8010. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  8011. var isIE = UA && /msie|trident/.test(UA);
  8012. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  8013. var isEdge = UA && UA.indexOf('edge/') > 0;
  8014. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  8015. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  8016. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  8017. var isPhantomJS = UA && /phantomjs/.test(UA);
  8018. var isFF = UA && UA.match(/firefox\/(\d+)/);
  8019. // Firefox has a "watch" function on Object.prototype...
  8020. var nativeWatch = ({}).watch;
  8021. if (inBrowser) {
  8022. try {
  8023. var opts = {};
  8024. Object.defineProperty(opts, 'passive', ({
  8025. get: function get () {
  8026. }
  8027. })); // https://github.com/facebook/flow/issues/285
  8028. window.addEventListener('test-passive', null, opts);
  8029. } catch (e) {}
  8030. }
  8031. // this needs to be lazy-evaled because vue may be required before
  8032. // vue-server-renderer can set VUE_ENV
  8033. var _isServer;
  8034. var isServerRendering = function () {
  8035. if (_isServer === undefined) {
  8036. /* istanbul ignore if */
  8037. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  8038. // detect presence of vue-server-renderer and avoid
  8039. // Webpack shimming the process
  8040. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  8041. } else {
  8042. _isServer = false;
  8043. }
  8044. }
  8045. return _isServer
  8046. };
  8047. // detect devtools
  8048. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  8049. /* istanbul ignore next */
  8050. function isNative (Ctor) {
  8051. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  8052. }
  8053. var hasSymbol =
  8054. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  8055. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  8056. var _Set;
  8057. /* istanbul ignore if */ // $flow-disable-line
  8058. if (typeof Set !== 'undefined' && isNative(Set)) {
  8059. // use native Set when available.
  8060. _Set = Set;
  8061. } else {
  8062. // a non-standard Set polyfill that only works with primitive keys.
  8063. _Set = /*@__PURE__*/(function () {
  8064. function Set () {
  8065. this.set = Object.create(null);
  8066. }
  8067. Set.prototype.has = function has (key) {
  8068. return this.set[key] === true
  8069. };
  8070. Set.prototype.add = function add (key) {
  8071. this.set[key] = true;
  8072. };
  8073. Set.prototype.clear = function clear () {
  8074. this.set = Object.create(null);
  8075. };
  8076. return Set;
  8077. }());
  8078. }
  8079. /* */
  8080. var warn = noop;
  8081. var tip = noop;
  8082. var generateComponentTrace = (noop); // work around flow check
  8083. var formatComponentName = (noop);
  8084. if (true) {
  8085. var hasConsole = typeof console !== 'undefined';
  8086. var classifyRE = /(?:^|[-_])(\w)/g;
  8087. var classify = function (str) { return str
  8088. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  8089. .replace(/[-_]/g, ''); };
  8090. warn = function (msg, vm) {
  8091. var trace = vm ? generateComponentTrace(vm) : '';
  8092. if (config.warnHandler) {
  8093. config.warnHandler.call(null, msg, vm, trace);
  8094. } else if (hasConsole && (!config.silent)) {
  8095. console.error(("[Vue warn]: " + msg + trace));
  8096. }
  8097. };
  8098. tip = function (msg, vm) {
  8099. if (hasConsole && (!config.silent)) {
  8100. console.warn("[Vue tip]: " + msg + (
  8101. vm ? generateComponentTrace(vm) : ''
  8102. ));
  8103. }
  8104. };
  8105. formatComponentName = function (vm, includeFile) {
  8106. if (vm.$root === vm) {
  8107. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  8108. return ('') + vm.$options.__file
  8109. }
  8110. return '<Root>'
  8111. }
  8112. var options = typeof vm === 'function' && vm.cid != null
  8113. ? vm.options
  8114. : vm._isVue
  8115. ? vm.$options || vm.constructor.options
  8116. : vm;
  8117. var name = options.name || options._componentTag;
  8118. var file = options.__file;
  8119. if (!name && file) {
  8120. var match = file.match(/([^/\\]+)\.vue$/);
  8121. name = match && match[1];
  8122. }
  8123. return (
  8124. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  8125. (file && includeFile !== false ? (" at " + file) : '')
  8126. )
  8127. };
  8128. var repeat = function (str, n) {
  8129. var res = '';
  8130. while (n) {
  8131. if (n % 2 === 1) { res += str; }
  8132. if (n > 1) { str += str; }
  8133. n >>= 1;
  8134. }
  8135. return res
  8136. };
  8137. generateComponentTrace = function (vm) {
  8138. if (vm._isVue && vm.$parent) {
  8139. var tree = [];
  8140. var currentRecursiveSequence = 0;
  8141. while (vm && vm.$options.name !== 'PageBody') {
  8142. if (tree.length > 0) {
  8143. var last = tree[tree.length - 1];
  8144. if (last.constructor === vm.constructor) {
  8145. currentRecursiveSequence++;
  8146. vm = vm.$parent;
  8147. continue
  8148. } else if (currentRecursiveSequence > 0) {
  8149. tree[tree.length - 1] = [last, currentRecursiveSequence];
  8150. currentRecursiveSequence = 0;
  8151. }
  8152. }
  8153. !vm.$options.isReserved && tree.push(vm);
  8154. vm = vm.$parent;
  8155. }
  8156. return '\n\nfound in\n\n' + tree
  8157. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  8158. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  8159. : formatComponentName(vm))); })
  8160. .join('\n')
  8161. } else {
  8162. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  8163. }
  8164. };
  8165. }
  8166. /* */
  8167. var uid = 0;
  8168. /**
  8169. * A dep is an observable that can have multiple
  8170. * directives subscribing to it.
  8171. */
  8172. var Dep = function Dep () {
  8173. this.id = uid++;
  8174. this.subs = [];
  8175. };
  8176. Dep.prototype.addSub = function addSub (sub) {
  8177. this.subs.push(sub);
  8178. };
  8179. Dep.prototype.removeSub = function removeSub (sub) {
  8180. remove(this.subs, sub);
  8181. };
  8182. Dep.prototype.depend = function depend () {
  8183. if (Dep.SharedObject.target) {
  8184. Dep.SharedObject.target.addDep(this);
  8185. }
  8186. };
  8187. Dep.prototype.notify = function notify () {
  8188. // stabilize the subscriber list first
  8189. var subs = this.subs.slice();
  8190. if ( true && !config.async) {
  8191. // subs aren't sorted in scheduler if not running async
  8192. // we need to sort them now to make sure they fire in correct
  8193. // order
  8194. subs.sort(function (a, b) { return a.id - b.id; });
  8195. }
  8196. for (var i = 0, l = subs.length; i < l; i++) {
  8197. subs[i].update();
  8198. }
  8199. };
  8200. // The current target watcher being evaluated.
  8201. // This is globally unique because only one watcher
  8202. // can be evaluated at a time.
  8203. // fixed by xxxxxx (nvue shared vuex)
  8204. /* eslint-disable no-undef */
  8205. Dep.SharedObject = {};
  8206. Dep.SharedObject.target = null;
  8207. Dep.SharedObject.targetStack = [];
  8208. function pushTarget (target) {
  8209. Dep.SharedObject.targetStack.push(target);
  8210. Dep.SharedObject.target = target;
  8211. Dep.target = target;
  8212. }
  8213. function popTarget () {
  8214. Dep.SharedObject.targetStack.pop();
  8215. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  8216. Dep.target = Dep.SharedObject.target;
  8217. }
  8218. /* */
  8219. var VNode = function VNode (
  8220. tag,
  8221. data,
  8222. children,
  8223. text,
  8224. elm,
  8225. context,
  8226. componentOptions,
  8227. asyncFactory
  8228. ) {
  8229. this.tag = tag;
  8230. this.data = data;
  8231. this.children = children;
  8232. this.text = text;
  8233. this.elm = elm;
  8234. this.ns = undefined;
  8235. this.context = context;
  8236. this.fnContext = undefined;
  8237. this.fnOptions = undefined;
  8238. this.fnScopeId = undefined;
  8239. this.key = data && data.key;
  8240. this.componentOptions = componentOptions;
  8241. this.componentInstance = undefined;
  8242. this.parent = undefined;
  8243. this.raw = false;
  8244. this.isStatic = false;
  8245. this.isRootInsert = true;
  8246. this.isComment = false;
  8247. this.isCloned = false;
  8248. this.isOnce = false;
  8249. this.asyncFactory = asyncFactory;
  8250. this.asyncMeta = undefined;
  8251. this.isAsyncPlaceholder = false;
  8252. };
  8253. var prototypeAccessors = { child: { configurable: true } };
  8254. // DEPRECATED: alias for componentInstance for backwards compat.
  8255. /* istanbul ignore next */
  8256. prototypeAccessors.child.get = function () {
  8257. return this.componentInstance
  8258. };
  8259. Object.defineProperties( VNode.prototype, prototypeAccessors );
  8260. var createEmptyVNode = function (text) {
  8261. if ( text === void 0 ) text = '';
  8262. var node = new VNode();
  8263. node.text = text;
  8264. node.isComment = true;
  8265. return node
  8266. };
  8267. function createTextVNode (val) {
  8268. return new VNode(undefined, undefined, undefined, String(val))
  8269. }
  8270. // optimized shallow clone
  8271. // used for static nodes and slot nodes because they may be reused across
  8272. // multiple renders, cloning them avoids errors when DOM manipulations rely
  8273. // on their elm reference.
  8274. function cloneVNode (vnode) {
  8275. var cloned = new VNode(
  8276. vnode.tag,
  8277. vnode.data,
  8278. // #7975
  8279. // clone children array to avoid mutating original in case of cloning
  8280. // a child.
  8281. vnode.children && vnode.children.slice(),
  8282. vnode.text,
  8283. vnode.elm,
  8284. vnode.context,
  8285. vnode.componentOptions,
  8286. vnode.asyncFactory
  8287. );
  8288. cloned.ns = vnode.ns;
  8289. cloned.isStatic = vnode.isStatic;
  8290. cloned.key = vnode.key;
  8291. cloned.isComment = vnode.isComment;
  8292. cloned.fnContext = vnode.fnContext;
  8293. cloned.fnOptions = vnode.fnOptions;
  8294. cloned.fnScopeId = vnode.fnScopeId;
  8295. cloned.asyncMeta = vnode.asyncMeta;
  8296. cloned.isCloned = true;
  8297. return cloned
  8298. }
  8299. /*
  8300. * not type checking this file because flow doesn't play well with
  8301. * dynamically accessing methods on Array prototype
  8302. */
  8303. var arrayProto = Array.prototype;
  8304. var arrayMethods = Object.create(arrayProto);
  8305. var methodsToPatch = [
  8306. 'push',
  8307. 'pop',
  8308. 'shift',
  8309. 'unshift',
  8310. 'splice',
  8311. 'sort',
  8312. 'reverse'
  8313. ];
  8314. /**
  8315. * Intercept mutating methods and emit events
  8316. */
  8317. methodsToPatch.forEach(function (method) {
  8318. // cache original method
  8319. var original = arrayProto[method];
  8320. def(arrayMethods, method, function mutator () {
  8321. var args = [], len = arguments.length;
  8322. while ( len-- ) args[ len ] = arguments[ len ];
  8323. var result = original.apply(this, args);
  8324. var ob = this.__ob__;
  8325. var inserted;
  8326. switch (method) {
  8327. case 'push':
  8328. case 'unshift':
  8329. inserted = args;
  8330. break
  8331. case 'splice':
  8332. inserted = args.slice(2);
  8333. break
  8334. }
  8335. if (inserted) { ob.observeArray(inserted); }
  8336. // notify change
  8337. ob.dep.notify();
  8338. return result
  8339. });
  8340. });
  8341. /* */
  8342. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  8343. /**
  8344. * In some cases we may want to disable observation inside a component's
  8345. * update computation.
  8346. */
  8347. var shouldObserve = true;
  8348. function toggleObserving (value) {
  8349. shouldObserve = value;
  8350. }
  8351. /**
  8352. * Observer class that is attached to each observed
  8353. * object. Once attached, the observer converts the target
  8354. * object's property keys into getter/setters that
  8355. * collect dependencies and dispatch updates.
  8356. */
  8357. var Observer = function Observer (value) {
  8358. this.value = value;
  8359. this.dep = new Dep();
  8360. this.vmCount = 0;
  8361. def(value, '__ob__', this);
  8362. if (Array.isArray(value)) {
  8363. if (hasProto) {
  8364. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  8365. if(value.push !== value.__proto__.push){
  8366. copyAugment(value, arrayMethods, arrayKeys);
  8367. } else {
  8368. protoAugment(value, arrayMethods);
  8369. }
  8370. }
  8371. } else {
  8372. copyAugment(value, arrayMethods, arrayKeys);
  8373. }
  8374. this.observeArray(value);
  8375. } else {
  8376. this.walk(value);
  8377. }
  8378. };
  8379. /**
  8380. * Walk through all properties and convert them into
  8381. * getter/setters. This method should only be called when
  8382. * value type is Object.
  8383. */
  8384. Observer.prototype.walk = function walk (obj) {
  8385. var keys = Object.keys(obj);
  8386. for (var i = 0; i < keys.length; i++) {
  8387. defineReactive$$1(obj, keys[i]);
  8388. }
  8389. };
  8390. /**
  8391. * Observe a list of Array items.
  8392. */
  8393. Observer.prototype.observeArray = function observeArray (items) {
  8394. for (var i = 0, l = items.length; i < l; i++) {
  8395. observe(items[i]);
  8396. }
  8397. };
  8398. // helpers
  8399. /**
  8400. * Augment a target Object or Array by intercepting
  8401. * the prototype chain using __proto__
  8402. */
  8403. function protoAugment (target, src) {
  8404. /* eslint-disable no-proto */
  8405. target.__proto__ = src;
  8406. /* eslint-enable no-proto */
  8407. }
  8408. /**
  8409. * Augment a target Object or Array by defining
  8410. * hidden properties.
  8411. */
  8412. /* istanbul ignore next */
  8413. function copyAugment (target, src, keys) {
  8414. for (var i = 0, l = keys.length; i < l; i++) {
  8415. var key = keys[i];
  8416. def(target, key, src[key]);
  8417. }
  8418. }
  8419. /**
  8420. * Attempt to create an observer instance for a value,
  8421. * returns the new observer if successfully observed,
  8422. * or the existing observer if the value already has one.
  8423. */
  8424. function observe (value, asRootData) {
  8425. if (!isObject(value) || value instanceof VNode) {
  8426. return
  8427. }
  8428. var ob;
  8429. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  8430. ob = value.__ob__;
  8431. } else if (
  8432. shouldObserve &&
  8433. !isServerRendering() &&
  8434. (Array.isArray(value) || isPlainObject(value)) &&
  8435. Object.isExtensible(value) &&
  8436. !value._isVue
  8437. ) {
  8438. ob = new Observer(value);
  8439. }
  8440. if (asRootData && ob) {
  8441. ob.vmCount++;
  8442. }
  8443. return ob
  8444. }
  8445. /**
  8446. * Define a reactive property on an Object.
  8447. */
  8448. function defineReactive$$1 (
  8449. obj,
  8450. key,
  8451. val,
  8452. customSetter,
  8453. shallow
  8454. ) {
  8455. var dep = new Dep();
  8456. var property = Object.getOwnPropertyDescriptor(obj, key);
  8457. if (property && property.configurable === false) {
  8458. return
  8459. }
  8460. // cater for pre-defined getter/setters
  8461. var getter = property && property.get;
  8462. var setter = property && property.set;
  8463. if ((!getter || setter) && arguments.length === 2) {
  8464. val = obj[key];
  8465. }
  8466. var childOb = !shallow && observe(val);
  8467. Object.defineProperty(obj, key, {
  8468. enumerable: true,
  8469. configurable: true,
  8470. get: function reactiveGetter () {
  8471. var value = getter ? getter.call(obj) : val;
  8472. if (Dep.SharedObject.target) { // fixed by xxxxxx
  8473. dep.depend();
  8474. if (childOb) {
  8475. childOb.dep.depend();
  8476. if (Array.isArray(value)) {
  8477. dependArray(value);
  8478. }
  8479. }
  8480. }
  8481. return value
  8482. },
  8483. set: function reactiveSetter (newVal) {
  8484. var value = getter ? getter.call(obj) : val;
  8485. /* eslint-disable no-self-compare */
  8486. if (newVal === value || (newVal !== newVal && value !== value)) {
  8487. return
  8488. }
  8489. /* eslint-enable no-self-compare */
  8490. if ( true && customSetter) {
  8491. customSetter();
  8492. }
  8493. // #7981: for accessor properties without setter
  8494. if (getter && !setter) { return }
  8495. if (setter) {
  8496. setter.call(obj, newVal);
  8497. } else {
  8498. val = newVal;
  8499. }
  8500. childOb = !shallow && observe(newVal);
  8501. dep.notify();
  8502. }
  8503. });
  8504. }
  8505. /**
  8506. * Set a property on an object. Adds the new property and
  8507. * triggers change notification if the property doesn't
  8508. * already exist.
  8509. */
  8510. function set (target, key, val) {
  8511. if ( true &&
  8512. (isUndef(target) || isPrimitive(target))
  8513. ) {
  8514. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  8515. }
  8516. if (Array.isArray(target) && isValidArrayIndex(key)) {
  8517. target.length = Math.max(target.length, key);
  8518. target.splice(key, 1, val);
  8519. return val
  8520. }
  8521. if (key in target && !(key in Object.prototype)) {
  8522. target[key] = val;
  8523. return val
  8524. }
  8525. var ob = (target).__ob__;
  8526. if (target._isVue || (ob && ob.vmCount)) {
  8527. true && warn(
  8528. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  8529. 'at runtime - declare it upfront in the data option.'
  8530. );
  8531. return val
  8532. }
  8533. if (!ob) {
  8534. target[key] = val;
  8535. return val
  8536. }
  8537. defineReactive$$1(ob.value, key, val);
  8538. ob.dep.notify();
  8539. return val
  8540. }
  8541. /**
  8542. * Delete a property and trigger change if necessary.
  8543. */
  8544. function del (target, key) {
  8545. if ( true &&
  8546. (isUndef(target) || isPrimitive(target))
  8547. ) {
  8548. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  8549. }
  8550. if (Array.isArray(target) && isValidArrayIndex(key)) {
  8551. target.splice(key, 1);
  8552. return
  8553. }
  8554. var ob = (target).__ob__;
  8555. if (target._isVue || (ob && ob.vmCount)) {
  8556. true && warn(
  8557. 'Avoid deleting properties on a Vue instance or its root $data ' +
  8558. '- just set it to null.'
  8559. );
  8560. return
  8561. }
  8562. if (!hasOwn(target, key)) {
  8563. return
  8564. }
  8565. delete target[key];
  8566. if (!ob) {
  8567. return
  8568. }
  8569. ob.dep.notify();
  8570. }
  8571. /**
  8572. * Collect dependencies on array elements when the array is touched, since
  8573. * we cannot intercept array element access like property getters.
  8574. */
  8575. function dependArray (value) {
  8576. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  8577. e = value[i];
  8578. e && e.__ob__ && e.__ob__.dep.depend();
  8579. if (Array.isArray(e)) {
  8580. dependArray(e);
  8581. }
  8582. }
  8583. }
  8584. /* */
  8585. /**
  8586. * Option overwriting strategies are functions that handle
  8587. * how to merge a parent option value and a child option
  8588. * value into the final value.
  8589. */
  8590. var strats = config.optionMergeStrategies;
  8591. /**
  8592. * Options with restrictions
  8593. */
  8594. if (true) {
  8595. strats.el = strats.propsData = function (parent, child, vm, key) {
  8596. if (!vm) {
  8597. warn(
  8598. "option \"" + key + "\" can only be used during instance " +
  8599. 'creation with the `new` keyword.'
  8600. );
  8601. }
  8602. return defaultStrat(parent, child)
  8603. };
  8604. }
  8605. /**
  8606. * Helper that recursively merges two data objects together.
  8607. */
  8608. function mergeData (to, from) {
  8609. if (!from) { return to }
  8610. var key, toVal, fromVal;
  8611. var keys = hasSymbol
  8612. ? Reflect.ownKeys(from)
  8613. : Object.keys(from);
  8614. for (var i = 0; i < keys.length; i++) {
  8615. key = keys[i];
  8616. // in case the object is already observed...
  8617. if (key === '__ob__') { continue }
  8618. toVal = to[key];
  8619. fromVal = from[key];
  8620. if (!hasOwn(to, key)) {
  8621. set(to, key, fromVal);
  8622. } else if (
  8623. toVal !== fromVal &&
  8624. isPlainObject(toVal) &&
  8625. isPlainObject(fromVal)
  8626. ) {
  8627. mergeData(toVal, fromVal);
  8628. }
  8629. }
  8630. return to
  8631. }
  8632. /**
  8633. * Data
  8634. */
  8635. function mergeDataOrFn (
  8636. parentVal,
  8637. childVal,
  8638. vm
  8639. ) {
  8640. if (!vm) {
  8641. // in a Vue.extend merge, both should be functions
  8642. if (!childVal) {
  8643. return parentVal
  8644. }
  8645. if (!parentVal) {
  8646. return childVal
  8647. }
  8648. // when parentVal & childVal are both present,
  8649. // we need to return a function that returns the
  8650. // merged result of both functions... no need to
  8651. // check if parentVal is a function here because
  8652. // it has to be a function to pass previous merges.
  8653. return function mergedDataFn () {
  8654. return mergeData(
  8655. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  8656. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  8657. )
  8658. }
  8659. } else {
  8660. return function mergedInstanceDataFn () {
  8661. // instance merge
  8662. var instanceData = typeof childVal === 'function'
  8663. ? childVal.call(vm, vm)
  8664. : childVal;
  8665. var defaultData = typeof parentVal === 'function'
  8666. ? parentVal.call(vm, vm)
  8667. : parentVal;
  8668. if (instanceData) {
  8669. return mergeData(instanceData, defaultData)
  8670. } else {
  8671. return defaultData
  8672. }
  8673. }
  8674. }
  8675. }
  8676. strats.data = function (
  8677. parentVal,
  8678. childVal,
  8679. vm
  8680. ) {
  8681. if (!vm) {
  8682. if (childVal && typeof childVal !== 'function') {
  8683. true && warn(
  8684. 'The "data" option should be a function ' +
  8685. 'that returns a per-instance value in component ' +
  8686. 'definitions.',
  8687. vm
  8688. );
  8689. return parentVal
  8690. }
  8691. return mergeDataOrFn(parentVal, childVal)
  8692. }
  8693. return mergeDataOrFn(parentVal, childVal, vm)
  8694. };
  8695. /**
  8696. * Hooks and props are merged as arrays.
  8697. */
  8698. function mergeHook (
  8699. parentVal,
  8700. childVal
  8701. ) {
  8702. var res = childVal
  8703. ? parentVal
  8704. ? parentVal.concat(childVal)
  8705. : Array.isArray(childVal)
  8706. ? childVal
  8707. : [childVal]
  8708. : parentVal;
  8709. return res
  8710. ? dedupeHooks(res)
  8711. : res
  8712. }
  8713. function dedupeHooks (hooks) {
  8714. var res = [];
  8715. for (var i = 0; i < hooks.length; i++) {
  8716. if (res.indexOf(hooks[i]) === -1) {
  8717. res.push(hooks[i]);
  8718. }
  8719. }
  8720. return res
  8721. }
  8722. LIFECYCLE_HOOKS.forEach(function (hook) {
  8723. strats[hook] = mergeHook;
  8724. });
  8725. /**
  8726. * Assets
  8727. *
  8728. * When a vm is present (instance creation), we need to do
  8729. * a three-way merge between constructor options, instance
  8730. * options and parent options.
  8731. */
  8732. function mergeAssets (
  8733. parentVal,
  8734. childVal,
  8735. vm,
  8736. key
  8737. ) {
  8738. var res = Object.create(parentVal || null);
  8739. if (childVal) {
  8740. true && assertObjectType(key, childVal, vm);
  8741. return extend(res, childVal)
  8742. } else {
  8743. return res
  8744. }
  8745. }
  8746. ASSET_TYPES.forEach(function (type) {
  8747. strats[type + 's'] = mergeAssets;
  8748. });
  8749. /**
  8750. * Watchers.
  8751. *
  8752. * Watchers hashes should not overwrite one
  8753. * another, so we merge them as arrays.
  8754. */
  8755. strats.watch = function (
  8756. parentVal,
  8757. childVal,
  8758. vm,
  8759. key
  8760. ) {
  8761. // work around Firefox's Object.prototype.watch...
  8762. if (parentVal === nativeWatch) { parentVal = undefined; }
  8763. if (childVal === nativeWatch) { childVal = undefined; }
  8764. /* istanbul ignore if */
  8765. if (!childVal) { return Object.create(parentVal || null) }
  8766. if (true) {
  8767. assertObjectType(key, childVal, vm);
  8768. }
  8769. if (!parentVal) { return childVal }
  8770. var ret = {};
  8771. extend(ret, parentVal);
  8772. for (var key$1 in childVal) {
  8773. var parent = ret[key$1];
  8774. var child = childVal[key$1];
  8775. if (parent && !Array.isArray(parent)) {
  8776. parent = [parent];
  8777. }
  8778. ret[key$1] = parent
  8779. ? parent.concat(child)
  8780. : Array.isArray(child) ? child : [child];
  8781. }
  8782. return ret
  8783. };
  8784. /**
  8785. * Other object hashes.
  8786. */
  8787. strats.props =
  8788. strats.methods =
  8789. strats.inject =
  8790. strats.computed = function (
  8791. parentVal,
  8792. childVal,
  8793. vm,
  8794. key
  8795. ) {
  8796. if (childVal && "development" !== 'production') {
  8797. assertObjectType(key, childVal, vm);
  8798. }
  8799. if (!parentVal) { return childVal }
  8800. var ret = Object.create(null);
  8801. extend(ret, parentVal);
  8802. if (childVal) { extend(ret, childVal); }
  8803. return ret
  8804. };
  8805. strats.provide = mergeDataOrFn;
  8806. /**
  8807. * Default strategy.
  8808. */
  8809. var defaultStrat = function (parentVal, childVal) {
  8810. return childVal === undefined
  8811. ? parentVal
  8812. : childVal
  8813. };
  8814. /**
  8815. * Validate component names
  8816. */
  8817. function checkComponents (options) {
  8818. for (var key in options.components) {
  8819. validateComponentName(key);
  8820. }
  8821. }
  8822. function validateComponentName (name) {
  8823. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  8824. warn(
  8825. 'Invalid component name: "' + name + '". Component names ' +
  8826. 'should conform to valid custom element name in html5 specification.'
  8827. );
  8828. }
  8829. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  8830. warn(
  8831. 'Do not use built-in or reserved HTML elements as component ' +
  8832. 'id: ' + name
  8833. );
  8834. }
  8835. }
  8836. /**
  8837. * Ensure all props option syntax are normalized into the
  8838. * Object-based format.
  8839. */
  8840. function normalizeProps (options, vm) {
  8841. var props = options.props;
  8842. if (!props) { return }
  8843. var res = {};
  8844. var i, val, name;
  8845. if (Array.isArray(props)) {
  8846. i = props.length;
  8847. while (i--) {
  8848. val = props[i];
  8849. if (typeof val === 'string') {
  8850. name = camelize(val);
  8851. res[name] = { type: null };
  8852. } else if (true) {
  8853. warn('props must be strings when using array syntax.');
  8854. }
  8855. }
  8856. } else if (isPlainObject(props)) {
  8857. for (var key in props) {
  8858. val = props[key];
  8859. name = camelize(key);
  8860. res[name] = isPlainObject(val)
  8861. ? val
  8862. : { type: val };
  8863. }
  8864. } else if (true) {
  8865. warn(
  8866. "Invalid value for option \"props\": expected an Array or an Object, " +
  8867. "but got " + (toRawType(props)) + ".",
  8868. vm
  8869. );
  8870. }
  8871. options.props = res;
  8872. }
  8873. /**
  8874. * Normalize all injections into Object-based format
  8875. */
  8876. function normalizeInject (options, vm) {
  8877. var inject = options.inject;
  8878. if (!inject) { return }
  8879. var normalized = options.inject = {};
  8880. if (Array.isArray(inject)) {
  8881. for (var i = 0; i < inject.length; i++) {
  8882. normalized[inject[i]] = { from: inject[i] };
  8883. }
  8884. } else if (isPlainObject(inject)) {
  8885. for (var key in inject) {
  8886. var val = inject[key];
  8887. normalized[key] = isPlainObject(val)
  8888. ? extend({ from: key }, val)
  8889. : { from: val };
  8890. }
  8891. } else if (true) {
  8892. warn(
  8893. "Invalid value for option \"inject\": expected an Array or an Object, " +
  8894. "but got " + (toRawType(inject)) + ".",
  8895. vm
  8896. );
  8897. }
  8898. }
  8899. /**
  8900. * Normalize raw function directives into object format.
  8901. */
  8902. function normalizeDirectives (options) {
  8903. var dirs = options.directives;
  8904. if (dirs) {
  8905. for (var key in dirs) {
  8906. var def$$1 = dirs[key];
  8907. if (typeof def$$1 === 'function') {
  8908. dirs[key] = { bind: def$$1, update: def$$1 };
  8909. }
  8910. }
  8911. }
  8912. }
  8913. function assertObjectType (name, value, vm) {
  8914. if (!isPlainObject(value)) {
  8915. warn(
  8916. "Invalid value for option \"" + name + "\": expected an Object, " +
  8917. "but got " + (toRawType(value)) + ".",
  8918. vm
  8919. );
  8920. }
  8921. }
  8922. /**
  8923. * Merge two option objects into a new one.
  8924. * Core utility used in both instantiation and inheritance.
  8925. */
  8926. function mergeOptions (
  8927. parent,
  8928. child,
  8929. vm
  8930. ) {
  8931. if (true) {
  8932. checkComponents(child);
  8933. }
  8934. if (typeof child === 'function') {
  8935. child = child.options;
  8936. }
  8937. normalizeProps(child, vm);
  8938. normalizeInject(child, vm);
  8939. normalizeDirectives(child);
  8940. // Apply extends and mixins on the child options,
  8941. // but only if it is a raw options object that isn't
  8942. // the result of another mergeOptions call.
  8943. // Only merged options has the _base property.
  8944. if (!child._base) {
  8945. if (child.extends) {
  8946. parent = mergeOptions(parent, child.extends, vm);
  8947. }
  8948. if (child.mixins) {
  8949. for (var i = 0, l = child.mixins.length; i < l; i++) {
  8950. parent = mergeOptions(parent, child.mixins[i], vm);
  8951. }
  8952. }
  8953. }
  8954. var options = {};
  8955. var key;
  8956. for (key in parent) {
  8957. mergeField(key);
  8958. }
  8959. for (key in child) {
  8960. if (!hasOwn(parent, key)) {
  8961. mergeField(key);
  8962. }
  8963. }
  8964. function mergeField (key) {
  8965. var strat = strats[key] || defaultStrat;
  8966. options[key] = strat(parent[key], child[key], vm, key);
  8967. }
  8968. return options
  8969. }
  8970. /**
  8971. * Resolve an asset.
  8972. * This function is used because child instances need access
  8973. * to assets defined in its ancestor chain.
  8974. */
  8975. function resolveAsset (
  8976. options,
  8977. type,
  8978. id,
  8979. warnMissing
  8980. ) {
  8981. /* istanbul ignore if */
  8982. if (typeof id !== 'string') {
  8983. return
  8984. }
  8985. var assets = options[type];
  8986. // check local registration variations first
  8987. if (hasOwn(assets, id)) { return assets[id] }
  8988. var camelizedId = camelize(id);
  8989. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  8990. var PascalCaseId = capitalize(camelizedId);
  8991. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  8992. // fallback to prototype chain
  8993. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  8994. if ( true && warnMissing && !res) {
  8995. warn(
  8996. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  8997. options
  8998. );
  8999. }
  9000. return res
  9001. }
  9002. /* */
  9003. function validateProp (
  9004. key,
  9005. propOptions,
  9006. propsData,
  9007. vm
  9008. ) {
  9009. var prop = propOptions[key];
  9010. var absent = !hasOwn(propsData, key);
  9011. var value = propsData[key];
  9012. // boolean casting
  9013. var booleanIndex = getTypeIndex(Boolean, prop.type);
  9014. if (booleanIndex > -1) {
  9015. if (absent && !hasOwn(prop, 'default')) {
  9016. value = false;
  9017. } else if (value === '' || value === hyphenate(key)) {
  9018. // only cast empty string / same name to boolean if
  9019. // boolean has higher priority
  9020. var stringIndex = getTypeIndex(String, prop.type);
  9021. if (stringIndex < 0 || booleanIndex < stringIndex) {
  9022. value = true;
  9023. }
  9024. }
  9025. }
  9026. // check default value
  9027. if (value === undefined) {
  9028. value = getPropDefaultValue(vm, prop, key);
  9029. // since the default value is a fresh copy,
  9030. // make sure to observe it.
  9031. var prevShouldObserve = shouldObserve;
  9032. toggleObserving(true);
  9033. observe(value);
  9034. toggleObserving(prevShouldObserve);
  9035. }
  9036. if (
  9037. true
  9038. ) {
  9039. assertProp(prop, key, value, vm, absent);
  9040. }
  9041. return value
  9042. }
  9043. /**
  9044. * Get the default value of a prop.
  9045. */
  9046. function getPropDefaultValue (vm, prop, key) {
  9047. // no default, return undefined
  9048. if (!hasOwn(prop, 'default')) {
  9049. return undefined
  9050. }
  9051. var def = prop.default;
  9052. // warn against non-factory defaults for Object & Array
  9053. if ( true && isObject(def)) {
  9054. warn(
  9055. 'Invalid default value for prop "' + key + '": ' +
  9056. 'Props with type Object/Array must use a factory function ' +
  9057. 'to return the default value.',
  9058. vm
  9059. );
  9060. }
  9061. // the raw prop value was also undefined from previous render,
  9062. // return previous default value to avoid unnecessary watcher trigger
  9063. if (vm && vm.$options.propsData &&
  9064. vm.$options.propsData[key] === undefined &&
  9065. vm._props[key] !== undefined
  9066. ) {
  9067. return vm._props[key]
  9068. }
  9069. // call factory function for non-Function types
  9070. // a value is Function if its prototype is function even across different execution context
  9071. return typeof def === 'function' && getType(prop.type) !== 'Function'
  9072. ? def.call(vm)
  9073. : def
  9074. }
  9075. /**
  9076. * Assert whether a prop is valid.
  9077. */
  9078. function assertProp (
  9079. prop,
  9080. name,
  9081. value,
  9082. vm,
  9083. absent
  9084. ) {
  9085. if (prop.required && absent) {
  9086. warn(
  9087. 'Missing required prop: "' + name + '"',
  9088. vm
  9089. );
  9090. return
  9091. }
  9092. if (value == null && !prop.required) {
  9093. return
  9094. }
  9095. var type = prop.type;
  9096. var valid = !type || type === true;
  9097. var expectedTypes = [];
  9098. if (type) {
  9099. if (!Array.isArray(type)) {
  9100. type = [type];
  9101. }
  9102. for (var i = 0; i < type.length && !valid; i++) {
  9103. var assertedType = assertType(value, type[i]);
  9104. expectedTypes.push(assertedType.expectedType || '');
  9105. valid = assertedType.valid;
  9106. }
  9107. }
  9108. if (!valid) {
  9109. warn(
  9110. getInvalidTypeMessage(name, value, expectedTypes),
  9111. vm
  9112. );
  9113. return
  9114. }
  9115. var validator = prop.validator;
  9116. if (validator) {
  9117. if (!validator(value)) {
  9118. warn(
  9119. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  9120. vm
  9121. );
  9122. }
  9123. }
  9124. }
  9125. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  9126. function assertType (value, type) {
  9127. var valid;
  9128. var expectedType = getType(type);
  9129. if (simpleCheckRE.test(expectedType)) {
  9130. var t = typeof value;
  9131. valid = t === expectedType.toLowerCase();
  9132. // for primitive wrapper objects
  9133. if (!valid && t === 'object') {
  9134. valid = value instanceof type;
  9135. }
  9136. } else if (expectedType === 'Object') {
  9137. valid = isPlainObject(value);
  9138. } else if (expectedType === 'Array') {
  9139. valid = Array.isArray(value);
  9140. } else {
  9141. valid = value instanceof type;
  9142. }
  9143. return {
  9144. valid: valid,
  9145. expectedType: expectedType
  9146. }
  9147. }
  9148. /**
  9149. * Use function string name to check built-in types,
  9150. * because a simple equality check will fail when running
  9151. * across different vms / iframes.
  9152. */
  9153. function getType (fn) {
  9154. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  9155. return match ? match[1] : ''
  9156. }
  9157. function isSameType (a, b) {
  9158. return getType(a) === getType(b)
  9159. }
  9160. function getTypeIndex (type, expectedTypes) {
  9161. if (!Array.isArray(expectedTypes)) {
  9162. return isSameType(expectedTypes, type) ? 0 : -1
  9163. }
  9164. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  9165. if (isSameType(expectedTypes[i], type)) {
  9166. return i
  9167. }
  9168. }
  9169. return -1
  9170. }
  9171. function getInvalidTypeMessage (name, value, expectedTypes) {
  9172. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  9173. " Expected " + (expectedTypes.map(capitalize).join(', '));
  9174. var expectedType = expectedTypes[0];
  9175. var receivedType = toRawType(value);
  9176. var expectedValue = styleValue(value, expectedType);
  9177. var receivedValue = styleValue(value, receivedType);
  9178. // check if we need to specify expected value
  9179. if (expectedTypes.length === 1 &&
  9180. isExplicable(expectedType) &&
  9181. !isBoolean(expectedType, receivedType)) {
  9182. message += " with value " + expectedValue;
  9183. }
  9184. message += ", got " + receivedType + " ";
  9185. // check if we need to specify received value
  9186. if (isExplicable(receivedType)) {
  9187. message += "with value " + receivedValue + ".";
  9188. }
  9189. return message
  9190. }
  9191. function styleValue (value, type) {
  9192. if (type === 'String') {
  9193. return ("\"" + value + "\"")
  9194. } else if (type === 'Number') {
  9195. return ("" + (Number(value)))
  9196. } else {
  9197. return ("" + value)
  9198. }
  9199. }
  9200. function isExplicable (value) {
  9201. var explicitTypes = ['string', 'number', 'boolean'];
  9202. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  9203. }
  9204. function isBoolean () {
  9205. var args = [], len = arguments.length;
  9206. while ( len-- ) args[ len ] = arguments[ len ];
  9207. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  9208. }
  9209. /* */
  9210. function handleError (err, vm, info) {
  9211. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  9212. // See: https://github.com/vuejs/vuex/issues/1505
  9213. pushTarget();
  9214. try {
  9215. if (vm) {
  9216. var cur = vm;
  9217. while ((cur = cur.$parent)) {
  9218. var hooks = cur.$options.errorCaptured;
  9219. if (hooks) {
  9220. for (var i = 0; i < hooks.length; i++) {
  9221. try {
  9222. var capture = hooks[i].call(cur, err, vm, info) === false;
  9223. if (capture) { return }
  9224. } catch (e) {
  9225. globalHandleError(e, cur, 'errorCaptured hook');
  9226. }
  9227. }
  9228. }
  9229. }
  9230. }
  9231. globalHandleError(err, vm, info);
  9232. } finally {
  9233. popTarget();
  9234. }
  9235. }
  9236. function invokeWithErrorHandling (
  9237. handler,
  9238. context,
  9239. args,
  9240. vm,
  9241. info
  9242. ) {
  9243. var res;
  9244. try {
  9245. res = args ? handler.apply(context, args) : handler.call(context);
  9246. if (res && !res._isVue && isPromise(res) && !res._handled) {
  9247. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  9248. // issue #9511
  9249. // avoid catch triggering multiple times when nested calls
  9250. res._handled = true;
  9251. }
  9252. } catch (e) {
  9253. handleError(e, vm, info);
  9254. }
  9255. return res
  9256. }
  9257. function globalHandleError (err, vm, info) {
  9258. if (config.errorHandler) {
  9259. try {
  9260. return config.errorHandler.call(null, err, vm, info)
  9261. } catch (e) {
  9262. // if the user intentionally throws the original error in the handler,
  9263. // do not log it twice
  9264. if (e !== err) {
  9265. logError(e, null, 'config.errorHandler');
  9266. }
  9267. }
  9268. }
  9269. logError(err, vm, info);
  9270. }
  9271. function logError (err, vm, info) {
  9272. if (true) {
  9273. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  9274. }
  9275. /* istanbul ignore else */
  9276. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  9277. console.error(err);
  9278. } else {
  9279. throw err
  9280. }
  9281. }
  9282. /* */
  9283. var callbacks = [];
  9284. var pending = false;
  9285. function flushCallbacks () {
  9286. pending = false;
  9287. var copies = callbacks.slice(0);
  9288. callbacks.length = 0;
  9289. for (var i = 0; i < copies.length; i++) {
  9290. copies[i]();
  9291. }
  9292. }
  9293. // Here we have async deferring wrappers using microtasks.
  9294. // In 2.5 we used (macro) tasks (in combination with microtasks).
  9295. // However, it has subtle problems when state is changed right before repaint
  9296. // (e.g. #6813, out-in transitions).
  9297. // Also, using (macro) tasks in event handler would cause some weird behaviors
  9298. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  9299. // So we now use microtasks everywhere, again.
  9300. // A major drawback of this tradeoff is that there are some scenarios
  9301. // where microtasks have too high a priority and fire in between supposedly
  9302. // sequential events (e.g. #4521, #6690, which have workarounds)
  9303. // or even between bubbling of the same event (#6566).
  9304. var timerFunc;
  9305. // The nextTick behavior leverages the microtask queue, which can be accessed
  9306. // via either native Promise.then or MutationObserver.
  9307. // MutationObserver has wider support, however it is seriously bugged in
  9308. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  9309. // completely stops working after triggering a few times... so, if native
  9310. // Promise is available, we will use it:
  9311. /* istanbul ignore next, $flow-disable-line */
  9312. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  9313. var p = Promise.resolve();
  9314. timerFunc = function () {
  9315. p.then(flushCallbacks);
  9316. // In problematic UIWebViews, Promise.then doesn't completely break, but
  9317. // it can get stuck in a weird state where callbacks are pushed into the
  9318. // microtask queue but the queue isn't being flushed, until the browser
  9319. // needs to do some other work, e.g. handle a timer. Therefore we can
  9320. // "force" the microtask queue to be flushed by adding an empty timer.
  9321. if (isIOS) { setTimeout(noop); }
  9322. };
  9323. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  9324. isNative(MutationObserver) ||
  9325. // PhantomJS and iOS 7.x
  9326. MutationObserver.toString() === '[object MutationObserverConstructor]'
  9327. )) {
  9328. // Use MutationObserver where native Promise is not available,
  9329. // e.g. PhantomJS, iOS7, Android 4.4
  9330. // (#6466 MutationObserver is unreliable in IE11)
  9331. var counter = 1;
  9332. var observer = new MutationObserver(flushCallbacks);
  9333. var textNode = document.createTextNode(String(counter));
  9334. observer.observe(textNode, {
  9335. characterData: true
  9336. });
  9337. timerFunc = function () {
  9338. counter = (counter + 1) % 2;
  9339. textNode.data = String(counter);
  9340. };
  9341. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  9342. // Fallback to setImmediate.
  9343. // Technically it leverages the (macro) task queue,
  9344. // but it is still a better choice than setTimeout.
  9345. timerFunc = function () {
  9346. setImmediate(flushCallbacks);
  9347. };
  9348. } else {
  9349. // Fallback to setTimeout.
  9350. timerFunc = function () {
  9351. setTimeout(flushCallbacks, 0);
  9352. };
  9353. }
  9354. function nextTick (cb, ctx) {
  9355. var _resolve;
  9356. callbacks.push(function () {
  9357. if (cb) {
  9358. try {
  9359. cb.call(ctx);
  9360. } catch (e) {
  9361. handleError(e, ctx, 'nextTick');
  9362. }
  9363. } else if (_resolve) {
  9364. _resolve(ctx);
  9365. }
  9366. });
  9367. if (!pending) {
  9368. pending = true;
  9369. timerFunc();
  9370. }
  9371. // $flow-disable-line
  9372. if (!cb && typeof Promise !== 'undefined') {
  9373. return new Promise(function (resolve) {
  9374. _resolve = resolve;
  9375. })
  9376. }
  9377. }
  9378. /* */
  9379. /* not type checking this file because flow doesn't play well with Proxy */
  9380. var initProxy;
  9381. if (true) {
  9382. var allowedGlobals = makeMap(
  9383. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  9384. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  9385. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  9386. 'require' // for Webpack/Browserify
  9387. );
  9388. var warnNonPresent = function (target, key) {
  9389. warn(
  9390. "Property or method \"" + key + "\" is not defined on the instance but " +
  9391. 'referenced during render. Make sure that this property is reactive, ' +
  9392. 'either in the data option, or for class-based components, by ' +
  9393. 'initializing the property. ' +
  9394. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  9395. target
  9396. );
  9397. };
  9398. var warnReservedPrefix = function (target, key) {
  9399. warn(
  9400. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  9401. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  9402. 'prevent conflicts with Vue internals. ' +
  9403. 'See: https://vuejs.org/v2/api/#data',
  9404. target
  9405. );
  9406. };
  9407. var hasProxy =
  9408. typeof Proxy !== 'undefined' && isNative(Proxy);
  9409. if (hasProxy) {
  9410. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  9411. config.keyCodes = new Proxy(config.keyCodes, {
  9412. set: function set (target, key, value) {
  9413. if (isBuiltInModifier(key)) {
  9414. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  9415. return false
  9416. } else {
  9417. target[key] = value;
  9418. return true
  9419. }
  9420. }
  9421. });
  9422. }
  9423. var hasHandler = {
  9424. has: function has (target, key) {
  9425. var has = key in target;
  9426. var isAllowed = allowedGlobals(key) ||
  9427. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  9428. if (!has && !isAllowed) {
  9429. if (key in target.$data) { warnReservedPrefix(target, key); }
  9430. else { warnNonPresent(target, key); }
  9431. }
  9432. return has || !isAllowed
  9433. }
  9434. };
  9435. var getHandler = {
  9436. get: function get (target, key) {
  9437. if (typeof key === 'string' && !(key in target)) {
  9438. if (key in target.$data) { warnReservedPrefix(target, key); }
  9439. else { warnNonPresent(target, key); }
  9440. }
  9441. return target[key]
  9442. }
  9443. };
  9444. initProxy = function initProxy (vm) {
  9445. if (hasProxy) {
  9446. // determine which proxy handler to use
  9447. var options = vm.$options;
  9448. var handlers = options.render && options.render._withStripped
  9449. ? getHandler
  9450. : hasHandler;
  9451. vm._renderProxy = new Proxy(vm, handlers);
  9452. } else {
  9453. vm._renderProxy = vm;
  9454. }
  9455. };
  9456. }
  9457. /* */
  9458. var seenObjects = new _Set();
  9459. /**
  9460. * Recursively traverse an object to evoke all converted
  9461. * getters, so that every nested property inside the object
  9462. * is collected as a "deep" dependency.
  9463. */
  9464. function traverse (val) {
  9465. _traverse(val, seenObjects);
  9466. seenObjects.clear();
  9467. }
  9468. function _traverse (val, seen) {
  9469. var i, keys;
  9470. var isA = Array.isArray(val);
  9471. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  9472. return
  9473. }
  9474. if (val.__ob__) {
  9475. var depId = val.__ob__.dep.id;
  9476. if (seen.has(depId)) {
  9477. return
  9478. }
  9479. seen.add(depId);
  9480. }
  9481. if (isA) {
  9482. i = val.length;
  9483. while (i--) { _traverse(val[i], seen); }
  9484. } else {
  9485. keys = Object.keys(val);
  9486. i = keys.length;
  9487. while (i--) { _traverse(val[keys[i]], seen); }
  9488. }
  9489. }
  9490. var mark;
  9491. var measure;
  9492. if (true) {
  9493. var perf = inBrowser && window.performance;
  9494. /* istanbul ignore if */
  9495. if (
  9496. perf &&
  9497. perf.mark &&
  9498. perf.measure &&
  9499. perf.clearMarks &&
  9500. perf.clearMeasures
  9501. ) {
  9502. mark = function (tag) { return perf.mark(tag); };
  9503. measure = function (name, startTag, endTag) {
  9504. perf.measure(name, startTag, endTag);
  9505. perf.clearMarks(startTag);
  9506. perf.clearMarks(endTag);
  9507. // perf.clearMeasures(name)
  9508. };
  9509. }
  9510. }
  9511. /* */
  9512. var normalizeEvent = cached(function (name) {
  9513. var passive = name.charAt(0) === '&';
  9514. name = passive ? name.slice(1) : name;
  9515. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  9516. name = once$$1 ? name.slice(1) : name;
  9517. var capture = name.charAt(0) === '!';
  9518. name = capture ? name.slice(1) : name;
  9519. return {
  9520. name: name,
  9521. once: once$$1,
  9522. capture: capture,
  9523. passive: passive
  9524. }
  9525. });
  9526. function createFnInvoker (fns, vm) {
  9527. function invoker () {
  9528. var arguments$1 = arguments;
  9529. var fns = invoker.fns;
  9530. if (Array.isArray(fns)) {
  9531. var cloned = fns.slice();
  9532. for (var i = 0; i < cloned.length; i++) {
  9533. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  9534. }
  9535. } else {
  9536. // return handler return value for single handlers
  9537. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  9538. }
  9539. }
  9540. invoker.fns = fns;
  9541. return invoker
  9542. }
  9543. function updateListeners (
  9544. on,
  9545. oldOn,
  9546. add,
  9547. remove$$1,
  9548. createOnceHandler,
  9549. vm
  9550. ) {
  9551. var name, def$$1, cur, old, event;
  9552. for (name in on) {
  9553. def$$1 = cur = on[name];
  9554. old = oldOn[name];
  9555. event = normalizeEvent(name);
  9556. if (isUndef(cur)) {
  9557. true && warn(
  9558. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  9559. vm
  9560. );
  9561. } else if (isUndef(old)) {
  9562. if (isUndef(cur.fns)) {
  9563. cur = on[name] = createFnInvoker(cur, vm);
  9564. }
  9565. if (isTrue(event.once)) {
  9566. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  9567. }
  9568. add(event.name, cur, event.capture, event.passive, event.params);
  9569. } else if (cur !== old) {
  9570. old.fns = cur;
  9571. on[name] = old;
  9572. }
  9573. }
  9574. for (name in oldOn) {
  9575. if (isUndef(on[name])) {
  9576. event = normalizeEvent(name);
  9577. remove$$1(event.name, oldOn[name], event.capture);
  9578. }
  9579. }
  9580. }
  9581. /* */
  9582. /* */
  9583. // fixed by xxxxxx (mp properties)
  9584. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  9585. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  9586. if (isUndef(propOptions)) {
  9587. return res
  9588. }
  9589. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  9590. var attrs = data.attrs;
  9591. var props = data.props;
  9592. if (isDef(attrs) || isDef(props)) {
  9593. for (var key in propOptions) {
  9594. var altKey = hyphenate(key);
  9595. var result = checkProp(res, props, key, altKey, true) ||
  9596. checkProp(res, attrs, key, altKey, false);
  9597. // externalClass
  9598. if (
  9599. result &&
  9600. res[key] &&
  9601. externalClasses.indexOf(altKey) !== -1 &&
  9602. context[camelize(res[key])]
  9603. ) {
  9604. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  9605. res[key] = context[camelize(res[key])];
  9606. }
  9607. }
  9608. }
  9609. return res
  9610. }
  9611. function extractPropsFromVNodeData (
  9612. data,
  9613. Ctor,
  9614. tag,
  9615. context// fixed by xxxxxx
  9616. ) {
  9617. // we are only extracting raw values here.
  9618. // validation and default values are handled in the child
  9619. // component itself.
  9620. var propOptions = Ctor.options.props;
  9621. if (isUndef(propOptions)) {
  9622. // fixed by xxxxxx
  9623. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  9624. }
  9625. var res = {};
  9626. var attrs = data.attrs;
  9627. var props = data.props;
  9628. if (isDef(attrs) || isDef(props)) {
  9629. for (var key in propOptions) {
  9630. var altKey = hyphenate(key);
  9631. if (true) {
  9632. var keyInLowerCase = key.toLowerCase();
  9633. if (
  9634. key !== keyInLowerCase &&
  9635. attrs && hasOwn(attrs, keyInLowerCase)
  9636. ) {
  9637. tip(
  9638. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  9639. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  9640. " \"" + key + "\". " +
  9641. "Note that HTML attributes are case-insensitive and camelCased " +
  9642. "props need to use their kebab-case equivalents when using in-DOM " +
  9643. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  9644. );
  9645. }
  9646. }
  9647. checkProp(res, props, key, altKey, true) ||
  9648. checkProp(res, attrs, key, altKey, false);
  9649. }
  9650. }
  9651. // fixed by xxxxxx
  9652. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  9653. }
  9654. function checkProp (
  9655. res,
  9656. hash,
  9657. key,
  9658. altKey,
  9659. preserve
  9660. ) {
  9661. if (isDef(hash)) {
  9662. if (hasOwn(hash, key)) {
  9663. res[key] = hash[key];
  9664. if (!preserve) {
  9665. delete hash[key];
  9666. }
  9667. return true
  9668. } else if (hasOwn(hash, altKey)) {
  9669. res[key] = hash[altKey];
  9670. if (!preserve) {
  9671. delete hash[altKey];
  9672. }
  9673. return true
  9674. }
  9675. }
  9676. return false
  9677. }
  9678. /* */
  9679. // The template compiler attempts to minimize the need for normalization by
  9680. // statically analyzing the template at compile time.
  9681. //
  9682. // For plain HTML markup, normalization can be completely skipped because the
  9683. // generated render function is guaranteed to return Array<VNode>. There are
  9684. // two cases where extra normalization is needed:
  9685. // 1. When the children contains components - because a functional component
  9686. // may return an Array instead of a single root. In this case, just a simple
  9687. // normalization is needed - if any child is an Array, we flatten the whole
  9688. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  9689. // because functional components already normalize their own children.
  9690. function simpleNormalizeChildren (children) {
  9691. for (var i = 0; i < children.length; i++) {
  9692. if (Array.isArray(children[i])) {
  9693. return Array.prototype.concat.apply([], children)
  9694. }
  9695. }
  9696. return children
  9697. }
  9698. // 2. When the children contains constructs that always generated nested Arrays,
  9699. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  9700. // with hand-written render functions / JSX. In such cases a full normalization
  9701. // is needed to cater to all possible types of children values.
  9702. function normalizeChildren (children) {
  9703. return isPrimitive(children)
  9704. ? [createTextVNode(children)]
  9705. : Array.isArray(children)
  9706. ? normalizeArrayChildren(children)
  9707. : undefined
  9708. }
  9709. function isTextNode (node) {
  9710. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  9711. }
  9712. function normalizeArrayChildren (children, nestedIndex) {
  9713. var res = [];
  9714. var i, c, lastIndex, last;
  9715. for (i = 0; i < children.length; i++) {
  9716. c = children[i];
  9717. if (isUndef(c) || typeof c === 'boolean') { continue }
  9718. lastIndex = res.length - 1;
  9719. last = res[lastIndex];
  9720. // nested
  9721. if (Array.isArray(c)) {
  9722. if (c.length > 0) {
  9723. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  9724. // merge adjacent text nodes
  9725. if (isTextNode(c[0]) && isTextNode(last)) {
  9726. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  9727. c.shift();
  9728. }
  9729. res.push.apply(res, c);
  9730. }
  9731. } else if (isPrimitive(c)) {
  9732. if (isTextNode(last)) {
  9733. // merge adjacent text nodes
  9734. // this is necessary for SSR hydration because text nodes are
  9735. // essentially merged when rendered to HTML strings
  9736. res[lastIndex] = createTextVNode(last.text + c);
  9737. } else if (c !== '') {
  9738. // convert primitive to vnode
  9739. res.push(createTextVNode(c));
  9740. }
  9741. } else {
  9742. if (isTextNode(c) && isTextNode(last)) {
  9743. // merge adjacent text nodes
  9744. res[lastIndex] = createTextVNode(last.text + c.text);
  9745. } else {
  9746. // default key for nested array children (likely generated by v-for)
  9747. if (isTrue(children._isVList) &&
  9748. isDef(c.tag) &&
  9749. isUndef(c.key) &&
  9750. isDef(nestedIndex)) {
  9751. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  9752. }
  9753. res.push(c);
  9754. }
  9755. }
  9756. }
  9757. return res
  9758. }
  9759. /* */
  9760. function initProvide (vm) {
  9761. var provide = vm.$options.provide;
  9762. if (provide) {
  9763. vm._provided = typeof provide === 'function'
  9764. ? provide.call(vm)
  9765. : provide;
  9766. }
  9767. }
  9768. function initInjections (vm) {
  9769. var result = resolveInject(vm.$options.inject, vm);
  9770. if (result) {
  9771. toggleObserving(false);
  9772. Object.keys(result).forEach(function (key) {
  9773. /* istanbul ignore else */
  9774. if (true) {
  9775. defineReactive$$1(vm, key, result[key], function () {
  9776. warn(
  9777. "Avoid mutating an injected value directly since the changes will be " +
  9778. "overwritten whenever the provided component re-renders. " +
  9779. "injection being mutated: \"" + key + "\"",
  9780. vm
  9781. );
  9782. });
  9783. } else {}
  9784. });
  9785. toggleObserving(true);
  9786. }
  9787. }
  9788. function resolveInject (inject, vm) {
  9789. if (inject) {
  9790. // inject is :any because flow is not smart enough to figure out cached
  9791. var result = Object.create(null);
  9792. var keys = hasSymbol
  9793. ? Reflect.ownKeys(inject)
  9794. : Object.keys(inject);
  9795. for (var i = 0; i < keys.length; i++) {
  9796. var key = keys[i];
  9797. // #6574 in case the inject object is observed...
  9798. if (key === '__ob__') { continue }
  9799. var provideKey = inject[key].from;
  9800. var source = vm;
  9801. while (source) {
  9802. if (source._provided && hasOwn(source._provided, provideKey)) {
  9803. result[key] = source._provided[provideKey];
  9804. break
  9805. }
  9806. source = source.$parent;
  9807. }
  9808. if (!source) {
  9809. if ('default' in inject[key]) {
  9810. var provideDefault = inject[key].default;
  9811. result[key] = typeof provideDefault === 'function'
  9812. ? provideDefault.call(vm)
  9813. : provideDefault;
  9814. } else if (true) {
  9815. warn(("Injection \"" + key + "\" not found"), vm);
  9816. }
  9817. }
  9818. }
  9819. return result
  9820. }
  9821. }
  9822. /* */
  9823. /**
  9824. * Runtime helper for resolving raw children VNodes into a slot object.
  9825. */
  9826. function resolveSlots (
  9827. children,
  9828. context
  9829. ) {
  9830. if (!children || !children.length) {
  9831. return {}
  9832. }
  9833. var slots = {};
  9834. for (var i = 0, l = children.length; i < l; i++) {
  9835. var child = children[i];
  9836. var data = child.data;
  9837. // remove slot attribute if the node is resolved as a Vue slot node
  9838. if (data && data.attrs && data.attrs.slot) {
  9839. delete data.attrs.slot;
  9840. }
  9841. // named slots should only be respected if the vnode was rendered in the
  9842. // same context.
  9843. if ((child.context === context || child.fnContext === context) &&
  9844. data && data.slot != null
  9845. ) {
  9846. var name = data.slot;
  9847. var slot = (slots[name] || (slots[name] = []));
  9848. if (child.tag === 'template') {
  9849. slot.push.apply(slot, child.children || []);
  9850. } else {
  9851. slot.push(child);
  9852. }
  9853. } else {
  9854. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  9855. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  9856. (slots['page'] || (slots['page'] = [])).push(child);
  9857. }else{
  9858. (slots.default || (slots.default = [])).push(child);
  9859. }
  9860. }
  9861. }
  9862. // ignore slots that contains only whitespace
  9863. for (var name$1 in slots) {
  9864. if (slots[name$1].every(isWhitespace)) {
  9865. delete slots[name$1];
  9866. }
  9867. }
  9868. return slots
  9869. }
  9870. function isWhitespace (node) {
  9871. return (node.isComment && !node.asyncFactory) || node.text === ' '
  9872. }
  9873. /* */
  9874. function normalizeScopedSlots (
  9875. slots,
  9876. normalSlots,
  9877. prevSlots
  9878. ) {
  9879. var res;
  9880. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  9881. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  9882. var key = slots && slots.$key;
  9883. if (!slots) {
  9884. res = {};
  9885. } else if (slots._normalized) {
  9886. // fast path 1: child component re-render only, parent did not change
  9887. return slots._normalized
  9888. } else if (
  9889. isStable &&
  9890. prevSlots &&
  9891. prevSlots !== emptyObject &&
  9892. key === prevSlots.$key &&
  9893. !hasNormalSlots &&
  9894. !prevSlots.$hasNormal
  9895. ) {
  9896. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  9897. // only need to normalize once
  9898. return prevSlots
  9899. } else {
  9900. res = {};
  9901. for (var key$1 in slots) {
  9902. if (slots[key$1] && key$1[0] !== '$') {
  9903. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  9904. }
  9905. }
  9906. }
  9907. // expose normal slots on scopedSlots
  9908. for (var key$2 in normalSlots) {
  9909. if (!(key$2 in res)) {
  9910. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  9911. }
  9912. }
  9913. // avoriaz seems to mock a non-extensible $scopedSlots object
  9914. // and when that is passed down this would cause an error
  9915. if (slots && Object.isExtensible(slots)) {
  9916. (slots)._normalized = res;
  9917. }
  9918. def(res, '$stable', isStable);
  9919. def(res, '$key', key);
  9920. def(res, '$hasNormal', hasNormalSlots);
  9921. return res
  9922. }
  9923. function normalizeScopedSlot(normalSlots, key, fn) {
  9924. var normalized = function () {
  9925. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  9926. res = res && typeof res === 'object' && !Array.isArray(res)
  9927. ? [res] // single vnode
  9928. : normalizeChildren(res);
  9929. return res && (
  9930. res.length === 0 ||
  9931. (res.length === 1 && res[0].isComment) // #9658
  9932. ) ? undefined
  9933. : res
  9934. };
  9935. // this is a slot using the new v-slot syntax without scope. although it is
  9936. // compiled as a scoped slot, render fn users would expect it to be present
  9937. // on this.$slots because the usage is semantically a normal slot.
  9938. if (fn.proxy) {
  9939. Object.defineProperty(normalSlots, key, {
  9940. get: normalized,
  9941. enumerable: true,
  9942. configurable: true
  9943. });
  9944. }
  9945. return normalized
  9946. }
  9947. function proxyNormalSlot(slots, key) {
  9948. return function () { return slots[key]; }
  9949. }
  9950. /* */
  9951. /**
  9952. * Runtime helper for rendering v-for lists.
  9953. */
  9954. function renderList (
  9955. val,
  9956. render
  9957. ) {
  9958. var ret, i, l, keys, key;
  9959. if (Array.isArray(val) || typeof val === 'string') {
  9960. ret = new Array(val.length);
  9961. for (i = 0, l = val.length; i < l; i++) {
  9962. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  9963. }
  9964. } else if (typeof val === 'number') {
  9965. ret = new Array(val);
  9966. for (i = 0; i < val; i++) {
  9967. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  9968. }
  9969. } else if (isObject(val)) {
  9970. if (hasSymbol && val[Symbol.iterator]) {
  9971. ret = [];
  9972. var iterator = val[Symbol.iterator]();
  9973. var result = iterator.next();
  9974. while (!result.done) {
  9975. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  9976. result = iterator.next();
  9977. }
  9978. } else {
  9979. keys = Object.keys(val);
  9980. ret = new Array(keys.length);
  9981. for (i = 0, l = keys.length; i < l; i++) {
  9982. key = keys[i];
  9983. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  9984. }
  9985. }
  9986. }
  9987. if (!isDef(ret)) {
  9988. ret = [];
  9989. }
  9990. (ret)._isVList = true;
  9991. return ret
  9992. }
  9993. /* */
  9994. /**
  9995. * Runtime helper for rendering <slot>
  9996. */
  9997. function renderSlot (
  9998. name,
  9999. fallback,
  10000. props,
  10001. bindObject
  10002. ) {
  10003. var scopedSlotFn = this.$scopedSlots[name];
  10004. var nodes;
  10005. if (scopedSlotFn) { // scoped slot
  10006. props = props || {};
  10007. if (bindObject) {
  10008. if ( true && !isObject(bindObject)) {
  10009. warn(
  10010. 'slot v-bind without argument expects an Object',
  10011. this
  10012. );
  10013. }
  10014. props = extend(extend({}, bindObject), props);
  10015. }
  10016. // fixed by xxxxxx app-plus scopedSlot
  10017. nodes = scopedSlotFn(props, this, props._i) || fallback;
  10018. } else {
  10019. nodes = this.$slots[name] || fallback;
  10020. }
  10021. var target = props && props.slot;
  10022. if (target) {
  10023. return this.$createElement('template', { slot: target }, nodes)
  10024. } else {
  10025. return nodes
  10026. }
  10027. }
  10028. /* */
  10029. /**
  10030. * Runtime helper for resolving filters
  10031. */
  10032. function resolveFilter (id) {
  10033. return resolveAsset(this.$options, 'filters', id, true) || identity
  10034. }
  10035. /* */
  10036. function isKeyNotMatch (expect, actual) {
  10037. if (Array.isArray(expect)) {
  10038. return expect.indexOf(actual) === -1
  10039. } else {
  10040. return expect !== actual
  10041. }
  10042. }
  10043. /**
  10044. * Runtime helper for checking keyCodes from config.
  10045. * exposed as Vue.prototype._k
  10046. * passing in eventKeyName as last argument separately for backwards compat
  10047. */
  10048. function checkKeyCodes (
  10049. eventKeyCode,
  10050. key,
  10051. builtInKeyCode,
  10052. eventKeyName,
  10053. builtInKeyName
  10054. ) {
  10055. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  10056. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  10057. return isKeyNotMatch(builtInKeyName, eventKeyName)
  10058. } else if (mappedKeyCode) {
  10059. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  10060. } else if (eventKeyName) {
  10061. return hyphenate(eventKeyName) !== key
  10062. }
  10063. }
  10064. /* */
  10065. /**
  10066. * Runtime helper for merging v-bind="object" into a VNode's data.
  10067. */
  10068. function bindObjectProps (
  10069. data,
  10070. tag,
  10071. value,
  10072. asProp,
  10073. isSync
  10074. ) {
  10075. if (value) {
  10076. if (!isObject(value)) {
  10077. true && warn(
  10078. 'v-bind without argument expects an Object or Array value',
  10079. this
  10080. );
  10081. } else {
  10082. if (Array.isArray(value)) {
  10083. value = toObject(value);
  10084. }
  10085. var hash;
  10086. var loop = function ( key ) {
  10087. if (
  10088. key === 'class' ||
  10089. key === 'style' ||
  10090. isReservedAttribute(key)
  10091. ) {
  10092. hash = data;
  10093. } else {
  10094. var type = data.attrs && data.attrs.type;
  10095. hash = asProp || config.mustUseProp(tag, type, key)
  10096. ? data.domProps || (data.domProps = {})
  10097. : data.attrs || (data.attrs = {});
  10098. }
  10099. var camelizedKey = camelize(key);
  10100. var hyphenatedKey = hyphenate(key);
  10101. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  10102. hash[key] = value[key];
  10103. if (isSync) {
  10104. var on = data.on || (data.on = {});
  10105. on[("update:" + key)] = function ($event) {
  10106. value[key] = $event;
  10107. };
  10108. }
  10109. }
  10110. };
  10111. for (var key in value) loop( key );
  10112. }
  10113. }
  10114. return data
  10115. }
  10116. /* */
  10117. /**
  10118. * Runtime helper for rendering static trees.
  10119. */
  10120. function renderStatic (
  10121. index,
  10122. isInFor
  10123. ) {
  10124. var cached = this._staticTrees || (this._staticTrees = []);
  10125. var tree = cached[index];
  10126. // if has already-rendered static tree and not inside v-for,
  10127. // we can reuse the same tree.
  10128. if (tree && !isInFor) {
  10129. return tree
  10130. }
  10131. // otherwise, render a fresh tree.
  10132. tree = cached[index] = this.$options.staticRenderFns[index].call(
  10133. this._renderProxy,
  10134. null,
  10135. this // for render fns generated for functional component templates
  10136. );
  10137. markStatic(tree, ("__static__" + index), false);
  10138. return tree
  10139. }
  10140. /**
  10141. * Runtime helper for v-once.
  10142. * Effectively it means marking the node as static with a unique key.
  10143. */
  10144. function markOnce (
  10145. tree,
  10146. index,
  10147. key
  10148. ) {
  10149. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  10150. return tree
  10151. }
  10152. function markStatic (
  10153. tree,
  10154. key,
  10155. isOnce
  10156. ) {
  10157. if (Array.isArray(tree)) {
  10158. for (var i = 0; i < tree.length; i++) {
  10159. if (tree[i] && typeof tree[i] !== 'string') {
  10160. markStaticNode(tree[i], (key + "_" + i), isOnce);
  10161. }
  10162. }
  10163. } else {
  10164. markStaticNode(tree, key, isOnce);
  10165. }
  10166. }
  10167. function markStaticNode (node, key, isOnce) {
  10168. node.isStatic = true;
  10169. node.key = key;
  10170. node.isOnce = isOnce;
  10171. }
  10172. /* */
  10173. function bindObjectListeners (data, value) {
  10174. if (value) {
  10175. if (!isPlainObject(value)) {
  10176. true && warn(
  10177. 'v-on without argument expects an Object value',
  10178. this
  10179. );
  10180. } else {
  10181. var on = data.on = data.on ? extend({}, data.on) : {};
  10182. for (var key in value) {
  10183. var existing = on[key];
  10184. var ours = value[key];
  10185. on[key] = existing ? [].concat(existing, ours) : ours;
  10186. }
  10187. }
  10188. }
  10189. return data
  10190. }
  10191. /* */
  10192. function resolveScopedSlots (
  10193. fns, // see flow/vnode
  10194. res,
  10195. // the following are added in 2.6
  10196. hasDynamicKeys,
  10197. contentHashKey
  10198. ) {
  10199. res = res || { $stable: !hasDynamicKeys };
  10200. for (var i = 0; i < fns.length; i++) {
  10201. var slot = fns[i];
  10202. if (Array.isArray(slot)) {
  10203. resolveScopedSlots(slot, res, hasDynamicKeys);
  10204. } else if (slot) {
  10205. // marker for reverse proxying v-slot without scope on this.$slots
  10206. if (slot.proxy) {
  10207. slot.fn.proxy = true;
  10208. }
  10209. res[slot.key] = slot.fn;
  10210. }
  10211. }
  10212. if (contentHashKey) {
  10213. (res).$key = contentHashKey;
  10214. }
  10215. return res
  10216. }
  10217. /* */
  10218. function bindDynamicKeys (baseObj, values) {
  10219. for (var i = 0; i < values.length; i += 2) {
  10220. var key = values[i];
  10221. if (typeof key === 'string' && key) {
  10222. baseObj[values[i]] = values[i + 1];
  10223. } else if ( true && key !== '' && key !== null) {
  10224. // null is a special value for explicitly removing a binding
  10225. warn(
  10226. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  10227. this
  10228. );
  10229. }
  10230. }
  10231. return baseObj
  10232. }
  10233. // helper to dynamically append modifier runtime markers to event names.
  10234. // ensure only append when value is already string, otherwise it will be cast
  10235. // to string and cause the type check to miss.
  10236. function prependModifier (value, symbol) {
  10237. return typeof value === 'string' ? symbol + value : value
  10238. }
  10239. /* */
  10240. function installRenderHelpers (target) {
  10241. target._o = markOnce;
  10242. target._n = toNumber;
  10243. target._s = toString;
  10244. target._l = renderList;
  10245. target._t = renderSlot;
  10246. target._q = looseEqual;
  10247. target._i = looseIndexOf;
  10248. target._m = renderStatic;
  10249. target._f = resolveFilter;
  10250. target._k = checkKeyCodes;
  10251. target._b = bindObjectProps;
  10252. target._v = createTextVNode;
  10253. target._e = createEmptyVNode;
  10254. target._u = resolveScopedSlots;
  10255. target._g = bindObjectListeners;
  10256. target._d = bindDynamicKeys;
  10257. target._p = prependModifier;
  10258. }
  10259. /* */
  10260. function FunctionalRenderContext (
  10261. data,
  10262. props,
  10263. children,
  10264. parent,
  10265. Ctor
  10266. ) {
  10267. var this$1 = this;
  10268. var options = Ctor.options;
  10269. // ensure the createElement function in functional components
  10270. // gets a unique context - this is necessary for correct named slot check
  10271. var contextVm;
  10272. if (hasOwn(parent, '_uid')) {
  10273. contextVm = Object.create(parent);
  10274. // $flow-disable-line
  10275. contextVm._original = parent;
  10276. } else {
  10277. // the context vm passed in is a functional context as well.
  10278. // in this case we want to make sure we are able to get a hold to the
  10279. // real context instance.
  10280. contextVm = parent;
  10281. // $flow-disable-line
  10282. parent = parent._original;
  10283. }
  10284. var isCompiled = isTrue(options._compiled);
  10285. var needNormalization = !isCompiled;
  10286. this.data = data;
  10287. this.props = props;
  10288. this.children = children;
  10289. this.parent = parent;
  10290. this.listeners = data.on || emptyObject;
  10291. this.injections = resolveInject(options.inject, parent);
  10292. this.slots = function () {
  10293. if (!this$1.$slots) {
  10294. normalizeScopedSlots(
  10295. data.scopedSlots,
  10296. this$1.$slots = resolveSlots(children, parent)
  10297. );
  10298. }
  10299. return this$1.$slots
  10300. };
  10301. Object.defineProperty(this, 'scopedSlots', ({
  10302. enumerable: true,
  10303. get: function get () {
  10304. return normalizeScopedSlots(data.scopedSlots, this.slots())
  10305. }
  10306. }));
  10307. // support for compiled functional template
  10308. if (isCompiled) {
  10309. // exposing $options for renderStatic()
  10310. this.$options = options;
  10311. // pre-resolve slots for renderSlot()
  10312. this.$slots = this.slots();
  10313. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  10314. }
  10315. if (options._scopeId) {
  10316. this._c = function (a, b, c, d) {
  10317. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  10318. if (vnode && !Array.isArray(vnode)) {
  10319. vnode.fnScopeId = options._scopeId;
  10320. vnode.fnContext = parent;
  10321. }
  10322. return vnode
  10323. };
  10324. } else {
  10325. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  10326. }
  10327. }
  10328. installRenderHelpers(FunctionalRenderContext.prototype);
  10329. function createFunctionalComponent (
  10330. Ctor,
  10331. propsData,
  10332. data,
  10333. contextVm,
  10334. children
  10335. ) {
  10336. var options = Ctor.options;
  10337. var props = {};
  10338. var propOptions = options.props;
  10339. if (isDef(propOptions)) {
  10340. for (var key in propOptions) {
  10341. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  10342. }
  10343. } else {
  10344. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  10345. if (isDef(data.props)) { mergeProps(props, data.props); }
  10346. }
  10347. var renderContext = new FunctionalRenderContext(
  10348. data,
  10349. props,
  10350. children,
  10351. contextVm,
  10352. Ctor
  10353. );
  10354. var vnode = options.render.call(null, renderContext._c, renderContext);
  10355. if (vnode instanceof VNode) {
  10356. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  10357. } else if (Array.isArray(vnode)) {
  10358. var vnodes = normalizeChildren(vnode) || [];
  10359. var res = new Array(vnodes.length);
  10360. for (var i = 0; i < vnodes.length; i++) {
  10361. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  10362. }
  10363. return res
  10364. }
  10365. }
  10366. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  10367. // #7817 clone node before setting fnContext, otherwise if the node is reused
  10368. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  10369. // that should not be matched to match.
  10370. var clone = cloneVNode(vnode);
  10371. clone.fnContext = contextVm;
  10372. clone.fnOptions = options;
  10373. if (true) {
  10374. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  10375. }
  10376. if (data.slot) {
  10377. (clone.data || (clone.data = {})).slot = data.slot;
  10378. }
  10379. return clone
  10380. }
  10381. function mergeProps (to, from) {
  10382. for (var key in from) {
  10383. to[camelize(key)] = from[key];
  10384. }
  10385. }
  10386. /* */
  10387. /* */
  10388. /* */
  10389. /* */
  10390. // inline hooks to be invoked on component VNodes during patch
  10391. var componentVNodeHooks = {
  10392. init: function init (vnode, hydrating) {
  10393. if (
  10394. vnode.componentInstance &&
  10395. !vnode.componentInstance._isDestroyed &&
  10396. vnode.data.keepAlive
  10397. ) {
  10398. // kept-alive components, treat as a patch
  10399. var mountedNode = vnode; // work around flow
  10400. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  10401. } else {
  10402. var child = vnode.componentInstance = createComponentInstanceForVnode(
  10403. vnode,
  10404. activeInstance
  10405. );
  10406. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  10407. }
  10408. },
  10409. prepatch: function prepatch (oldVnode, vnode) {
  10410. var options = vnode.componentOptions;
  10411. var child = vnode.componentInstance = oldVnode.componentInstance;
  10412. updateChildComponent(
  10413. child,
  10414. options.propsData, // updated props
  10415. options.listeners, // updated listeners
  10416. vnode, // new parent vnode
  10417. options.children // new children
  10418. );
  10419. },
  10420. insert: function insert (vnode) {
  10421. var context = vnode.context;
  10422. var componentInstance = vnode.componentInstance;
  10423. if (!componentInstance._isMounted) {
  10424. callHook(componentInstance, 'onServiceCreated');
  10425. callHook(componentInstance, 'onServiceAttached');
  10426. componentInstance._isMounted = true;
  10427. callHook(componentInstance, 'mounted');
  10428. }
  10429. if (vnode.data.keepAlive) {
  10430. if (context._isMounted) {
  10431. // vue-router#1212
  10432. // During updates, a kept-alive component's child components may
  10433. // change, so directly walking the tree here may call activated hooks
  10434. // on incorrect children. Instead we push them into a queue which will
  10435. // be processed after the whole patch process ended.
  10436. queueActivatedComponent(componentInstance);
  10437. } else {
  10438. activateChildComponent(componentInstance, true /* direct */);
  10439. }
  10440. }
  10441. },
  10442. destroy: function destroy (vnode) {
  10443. var componentInstance = vnode.componentInstance;
  10444. if (!componentInstance._isDestroyed) {
  10445. if (!vnode.data.keepAlive) {
  10446. componentInstance.$destroy();
  10447. } else {
  10448. deactivateChildComponent(componentInstance, true /* direct */);
  10449. }
  10450. }
  10451. }
  10452. };
  10453. var hooksToMerge = Object.keys(componentVNodeHooks);
  10454. function createComponent (
  10455. Ctor,
  10456. data,
  10457. context,
  10458. children,
  10459. tag
  10460. ) {
  10461. if (isUndef(Ctor)) {
  10462. return
  10463. }
  10464. var baseCtor = context.$options._base;
  10465. // plain options object: turn it into a constructor
  10466. if (isObject(Ctor)) {
  10467. Ctor = baseCtor.extend(Ctor);
  10468. }
  10469. // if at this stage it's not a constructor or an async component factory,
  10470. // reject.
  10471. if (typeof Ctor !== 'function') {
  10472. if (true) {
  10473. warn(("Invalid Component definition: " + (String(Ctor))), context);
  10474. }
  10475. return
  10476. }
  10477. // async component
  10478. var asyncFactory;
  10479. if (isUndef(Ctor.cid)) {
  10480. asyncFactory = Ctor;
  10481. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  10482. if (Ctor === undefined) {
  10483. // return a placeholder node for async component, which is rendered
  10484. // as a comment node but preserves all the raw information for the node.
  10485. // the information will be used for async server-rendering and hydration.
  10486. return createAsyncPlaceholder(
  10487. asyncFactory,
  10488. data,
  10489. context,
  10490. children,
  10491. tag
  10492. )
  10493. }
  10494. }
  10495. data = data || {};
  10496. // resolve constructor options in case global mixins are applied after
  10497. // component constructor creation
  10498. resolveConstructorOptions(Ctor);
  10499. // transform component v-model data into props & events
  10500. if (isDef(data.model)) {
  10501. transformModel(Ctor.options, data);
  10502. }
  10503. // extract props
  10504. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  10505. // functional component
  10506. if (isTrue(Ctor.options.functional)) {
  10507. return createFunctionalComponent(Ctor, propsData, data, context, children)
  10508. }
  10509. // extract listeners, since these needs to be treated as
  10510. // child component listeners instead of DOM listeners
  10511. var listeners = data.on;
  10512. // replace with listeners with .native modifier
  10513. // so it gets processed during parent component patch.
  10514. data.on = data.nativeOn;
  10515. if (isTrue(Ctor.options.abstract)) {
  10516. // abstract components do not keep anything
  10517. // other than props & listeners & slot
  10518. // work around flow
  10519. var slot = data.slot;
  10520. data = {};
  10521. if (slot) {
  10522. data.slot = slot;
  10523. }
  10524. }
  10525. // install component management hooks onto the placeholder node
  10526. installComponentHooks(data);
  10527. // return a placeholder vnode
  10528. var name = Ctor.options.name || tag;
  10529. var vnode = new VNode(
  10530. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  10531. data, undefined, undefined, undefined, context,
  10532. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  10533. asyncFactory
  10534. );
  10535. return vnode
  10536. }
  10537. function createComponentInstanceForVnode (
  10538. vnode, // we know it's MountedComponentVNode but flow doesn't
  10539. parent // activeInstance in lifecycle state
  10540. ) {
  10541. var options = {
  10542. _isComponent: true,
  10543. _parentVnode: vnode,
  10544. parent: parent
  10545. };
  10546. // check inline-template render functions
  10547. var inlineTemplate = vnode.data.inlineTemplate;
  10548. if (isDef(inlineTemplate)) {
  10549. options.render = inlineTemplate.render;
  10550. options.staticRenderFns = inlineTemplate.staticRenderFns;
  10551. }
  10552. return new vnode.componentOptions.Ctor(options)
  10553. }
  10554. function installComponentHooks (data) {
  10555. var hooks = data.hook || (data.hook = {});
  10556. for (var i = 0; i < hooksToMerge.length; i++) {
  10557. var key = hooksToMerge[i];
  10558. var existing = hooks[key];
  10559. var toMerge = componentVNodeHooks[key];
  10560. if (existing !== toMerge && !(existing && existing._merged)) {
  10561. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  10562. }
  10563. }
  10564. }
  10565. function mergeHook$1 (f1, f2) {
  10566. var merged = function (a, b) {
  10567. // flow complains about extra args which is why we use any
  10568. f1(a, b);
  10569. f2(a, b);
  10570. };
  10571. merged._merged = true;
  10572. return merged
  10573. }
  10574. // transform component v-model info (value and callback) into
  10575. // prop and event handler respectively.
  10576. function transformModel (options, data) {
  10577. var prop = (options.model && options.model.prop) || 'value';
  10578. var event = (options.model && options.model.event) || 'input'
  10579. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  10580. var on = data.on || (data.on = {});
  10581. var existing = on[event];
  10582. var callback = data.model.callback;
  10583. if (isDef(existing)) {
  10584. if (
  10585. Array.isArray(existing)
  10586. ? existing.indexOf(callback) === -1
  10587. : existing !== callback
  10588. ) {
  10589. on[event] = [callback].concat(existing);
  10590. }
  10591. } else {
  10592. on[event] = callback;
  10593. }
  10594. }
  10595. /* */
  10596. var SIMPLE_NORMALIZE = 1;
  10597. var ALWAYS_NORMALIZE = 2;
  10598. // wrapper function for providing a more flexible interface
  10599. // without getting yelled at by flow
  10600. function createElement (
  10601. context,
  10602. tag,
  10603. data,
  10604. children,
  10605. normalizationType,
  10606. alwaysNormalize
  10607. ) {
  10608. if (Array.isArray(data) || isPrimitive(data)) {
  10609. normalizationType = children;
  10610. children = data;
  10611. data = undefined;
  10612. }
  10613. if (isTrue(alwaysNormalize)) {
  10614. normalizationType = ALWAYS_NORMALIZE;
  10615. }
  10616. return _createElement(context, tag, data, children, normalizationType)
  10617. }
  10618. function _createElement (
  10619. context,
  10620. tag,
  10621. data,
  10622. children,
  10623. normalizationType
  10624. ) {
  10625. if (isDef(data) && isDef((data).__ob__)) {
  10626. true && warn(
  10627. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  10628. 'Always create fresh vnode data objects in each render!',
  10629. context
  10630. );
  10631. return createEmptyVNode()
  10632. }
  10633. // object syntax in v-bind
  10634. if (isDef(data) && isDef(data.is)) {
  10635. tag = data.is;
  10636. }
  10637. if (!tag) {
  10638. // in case of component :is set to falsy value
  10639. return createEmptyVNode()
  10640. }
  10641. // warn against non-primitive key
  10642. if ( true &&
  10643. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  10644. ) {
  10645. {
  10646. warn(
  10647. 'Avoid using non-primitive value as key, ' +
  10648. 'use string/number value instead.',
  10649. context
  10650. );
  10651. }
  10652. }
  10653. // support single function children as default scoped slot
  10654. if (Array.isArray(children) &&
  10655. typeof children[0] === 'function'
  10656. ) {
  10657. data = data || {};
  10658. data.scopedSlots = { default: children[0] };
  10659. children.length = 0;
  10660. }
  10661. if (normalizationType === ALWAYS_NORMALIZE) {
  10662. children = normalizeChildren(children);
  10663. } else if (normalizationType === SIMPLE_NORMALIZE) {
  10664. children = simpleNormalizeChildren(children);
  10665. }
  10666. var vnode, ns;
  10667. if (typeof tag === 'string') {
  10668. var Ctor;
  10669. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  10670. if (config.isReservedTag(tag)) {
  10671. // platform built-in elements
  10672. if ( true && isDef(data) && isDef(data.nativeOn)) {
  10673. warn(
  10674. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  10675. context
  10676. );
  10677. }
  10678. vnode = new VNode(
  10679. config.parsePlatformTagName(tag), data, children,
  10680. undefined, undefined, context
  10681. );
  10682. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  10683. // component
  10684. vnode = createComponent(Ctor, data, context, children, tag);
  10685. } else {
  10686. // unknown or unlisted namespaced elements
  10687. // check at runtime because it may get assigned a namespace when its
  10688. // parent normalizes children
  10689. vnode = new VNode(
  10690. tag, data, children,
  10691. undefined, undefined, context
  10692. );
  10693. }
  10694. } else {
  10695. // direct component options / constructor
  10696. vnode = createComponent(tag, data, context, children);
  10697. }
  10698. if (Array.isArray(vnode)) {
  10699. return vnode
  10700. } else if (isDef(vnode)) {
  10701. if (isDef(ns)) { applyNS(vnode, ns); }
  10702. if (isDef(data)) { registerDeepBindings(data); }
  10703. return vnode
  10704. } else {
  10705. return createEmptyVNode()
  10706. }
  10707. }
  10708. function applyNS (vnode, ns, force) {
  10709. vnode.ns = ns;
  10710. if (vnode.tag === 'foreignObject') {
  10711. // use default namespace inside foreignObject
  10712. ns = undefined;
  10713. force = true;
  10714. }
  10715. if (isDef(vnode.children)) {
  10716. for (var i = 0, l = vnode.children.length; i < l; i++) {
  10717. var child = vnode.children[i];
  10718. if (isDef(child.tag) && (
  10719. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  10720. applyNS(child, ns, force);
  10721. }
  10722. }
  10723. }
  10724. }
  10725. // ref #5318
  10726. // necessary to ensure parent re-render when deep bindings like :style and
  10727. // :class are used on slot nodes
  10728. function registerDeepBindings (data) {
  10729. if (isObject(data.style)) {
  10730. traverse(data.style);
  10731. }
  10732. if (isObject(data.class)) {
  10733. traverse(data.class);
  10734. }
  10735. }
  10736. /* */
  10737. function initRender (vm) {
  10738. vm._vnode = null; // the root of the child tree
  10739. vm._staticTrees = null; // v-once cached trees
  10740. var options = vm.$options;
  10741. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  10742. var renderContext = parentVnode && parentVnode.context;
  10743. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  10744. vm.$scopedSlots = emptyObject;
  10745. // bind the createElement fn to this instance
  10746. // so that we get proper render context inside it.
  10747. // args order: tag, data, children, normalizationType, alwaysNormalize
  10748. // internal version is used by render functions compiled from templates
  10749. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  10750. // normalization is always applied for the public version, used in
  10751. // user-written render functions.
  10752. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  10753. // $attrs & $listeners are exposed for easier HOC creation.
  10754. // they need to be reactive so that HOCs using them are always updated
  10755. var parentData = parentVnode && parentVnode.data;
  10756. /* istanbul ignore else */
  10757. if (true) {
  10758. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  10759. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  10760. }, true);
  10761. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  10762. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  10763. }, true);
  10764. } else {}
  10765. }
  10766. var currentRenderingInstance = null;
  10767. function renderMixin (Vue) {
  10768. // install runtime convenience helpers
  10769. installRenderHelpers(Vue.prototype);
  10770. Vue.prototype.$nextTick = function (fn) {
  10771. return nextTick(fn, this)
  10772. };
  10773. Vue.prototype._render = function () {
  10774. var vm = this;
  10775. var ref = vm.$options;
  10776. var render = ref.render;
  10777. var _parentVnode = ref._parentVnode;
  10778. if (_parentVnode) {
  10779. vm.$scopedSlots = normalizeScopedSlots(
  10780. _parentVnode.data.scopedSlots,
  10781. vm.$slots,
  10782. vm.$scopedSlots
  10783. );
  10784. }
  10785. // set parent vnode. this allows render functions to have access
  10786. // to the data on the placeholder node.
  10787. vm.$vnode = _parentVnode;
  10788. // render self
  10789. var vnode;
  10790. try {
  10791. // There's no need to maintain a stack because all render fns are called
  10792. // separately from one another. Nested component's render fns are called
  10793. // when parent component is patched.
  10794. currentRenderingInstance = vm;
  10795. vnode = render.call(vm._renderProxy, vm.$createElement);
  10796. } catch (e) {
  10797. handleError(e, vm, "render");
  10798. // return error render result,
  10799. // or previous vnode to prevent render error causing blank component
  10800. /* istanbul ignore else */
  10801. if ( true && vm.$options.renderError) {
  10802. try {
  10803. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  10804. } catch (e) {
  10805. handleError(e, vm, "renderError");
  10806. vnode = vm._vnode;
  10807. }
  10808. } else {
  10809. vnode = vm._vnode;
  10810. }
  10811. } finally {
  10812. currentRenderingInstance = null;
  10813. }
  10814. // if the returned array contains only a single node, allow it
  10815. if (Array.isArray(vnode) && vnode.length === 1) {
  10816. vnode = vnode[0];
  10817. }
  10818. // return empty vnode in case the render function errored out
  10819. if (!(vnode instanceof VNode)) {
  10820. if ( true && Array.isArray(vnode)) {
  10821. warn(
  10822. 'Multiple root nodes returned from render function. Render function ' +
  10823. 'should return a single root node.',
  10824. vm
  10825. );
  10826. }
  10827. vnode = createEmptyVNode();
  10828. }
  10829. // set parent
  10830. vnode.parent = _parentVnode;
  10831. return vnode
  10832. };
  10833. }
  10834. /* */
  10835. function ensureCtor (comp, base) {
  10836. if (
  10837. comp.__esModule ||
  10838. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  10839. ) {
  10840. comp = comp.default;
  10841. }
  10842. return isObject(comp)
  10843. ? base.extend(comp)
  10844. : comp
  10845. }
  10846. function createAsyncPlaceholder (
  10847. factory,
  10848. data,
  10849. context,
  10850. children,
  10851. tag
  10852. ) {
  10853. var node = createEmptyVNode();
  10854. node.asyncFactory = factory;
  10855. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  10856. return node
  10857. }
  10858. function resolveAsyncComponent (
  10859. factory,
  10860. baseCtor
  10861. ) {
  10862. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  10863. return factory.errorComp
  10864. }
  10865. if (isDef(factory.resolved)) {
  10866. return factory.resolved
  10867. }
  10868. var owner = currentRenderingInstance;
  10869. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  10870. // already pending
  10871. factory.owners.push(owner);
  10872. }
  10873. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  10874. return factory.loadingComp
  10875. }
  10876. if (owner && !isDef(factory.owners)) {
  10877. var owners = factory.owners = [owner];
  10878. var sync = true;
  10879. var timerLoading = null;
  10880. var timerTimeout = null
  10881. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  10882. var forceRender = function (renderCompleted) {
  10883. for (var i = 0, l = owners.length; i < l; i++) {
  10884. (owners[i]).$forceUpdate();
  10885. }
  10886. if (renderCompleted) {
  10887. owners.length = 0;
  10888. if (timerLoading !== null) {
  10889. clearTimeout(timerLoading);
  10890. timerLoading = null;
  10891. }
  10892. if (timerTimeout !== null) {
  10893. clearTimeout(timerTimeout);
  10894. timerTimeout = null;
  10895. }
  10896. }
  10897. };
  10898. var resolve = once(function (res) {
  10899. // cache resolved
  10900. factory.resolved = ensureCtor(res, baseCtor);
  10901. // invoke callbacks only if this is not a synchronous resolve
  10902. // (async resolves are shimmed as synchronous during SSR)
  10903. if (!sync) {
  10904. forceRender(true);
  10905. } else {
  10906. owners.length = 0;
  10907. }
  10908. });
  10909. var reject = once(function (reason) {
  10910. true && warn(
  10911. "Failed to resolve async component: " + (String(factory)) +
  10912. (reason ? ("\nReason: " + reason) : '')
  10913. );
  10914. if (isDef(factory.errorComp)) {
  10915. factory.error = true;
  10916. forceRender(true);
  10917. }
  10918. });
  10919. var res = factory(resolve, reject);
  10920. if (isObject(res)) {
  10921. if (isPromise(res)) {
  10922. // () => Promise
  10923. if (isUndef(factory.resolved)) {
  10924. res.then(resolve, reject);
  10925. }
  10926. } else if (isPromise(res.component)) {
  10927. res.component.then(resolve, reject);
  10928. if (isDef(res.error)) {
  10929. factory.errorComp = ensureCtor(res.error, baseCtor);
  10930. }
  10931. if (isDef(res.loading)) {
  10932. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  10933. if (res.delay === 0) {
  10934. factory.loading = true;
  10935. } else {
  10936. timerLoading = setTimeout(function () {
  10937. timerLoading = null;
  10938. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  10939. factory.loading = true;
  10940. forceRender(false);
  10941. }
  10942. }, res.delay || 200);
  10943. }
  10944. }
  10945. if (isDef(res.timeout)) {
  10946. timerTimeout = setTimeout(function () {
  10947. timerTimeout = null;
  10948. if (isUndef(factory.resolved)) {
  10949. reject(
  10950. true
  10951. ? ("timeout (" + (res.timeout) + "ms)")
  10952. : undefined
  10953. );
  10954. }
  10955. }, res.timeout);
  10956. }
  10957. }
  10958. }
  10959. sync = false;
  10960. // return in case resolved synchronously
  10961. return factory.loading
  10962. ? factory.loadingComp
  10963. : factory.resolved
  10964. }
  10965. }
  10966. /* */
  10967. function isAsyncPlaceholder (node) {
  10968. return node.isComment && node.asyncFactory
  10969. }
  10970. /* */
  10971. function getFirstComponentChild (children) {
  10972. if (Array.isArray(children)) {
  10973. for (var i = 0; i < children.length; i++) {
  10974. var c = children[i];
  10975. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  10976. return c
  10977. }
  10978. }
  10979. }
  10980. }
  10981. /* */
  10982. /* */
  10983. function initEvents (vm) {
  10984. vm._events = Object.create(null);
  10985. vm._hasHookEvent = false;
  10986. // init parent attached events
  10987. var listeners = vm.$options._parentListeners;
  10988. if (listeners) {
  10989. updateComponentListeners(vm, listeners);
  10990. }
  10991. }
  10992. var target;
  10993. function add (event, fn) {
  10994. target.$on(event, fn);
  10995. }
  10996. function remove$1 (event, fn) {
  10997. target.$off(event, fn);
  10998. }
  10999. function createOnceHandler (event, fn) {
  11000. var _target = target;
  11001. return function onceHandler () {
  11002. var res = fn.apply(null, arguments);
  11003. if (res !== null) {
  11004. _target.$off(event, onceHandler);
  11005. }
  11006. }
  11007. }
  11008. function updateComponentListeners (
  11009. vm,
  11010. listeners,
  11011. oldListeners
  11012. ) {
  11013. target = vm;
  11014. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  11015. target = undefined;
  11016. }
  11017. function eventsMixin (Vue) {
  11018. var hookRE = /^hook:/;
  11019. Vue.prototype.$on = function (event, fn) {
  11020. var vm = this;
  11021. if (Array.isArray(event)) {
  11022. for (var i = 0, l = event.length; i < l; i++) {
  11023. vm.$on(event[i], fn);
  11024. }
  11025. } else {
  11026. (vm._events[event] || (vm._events[event] = [])).push(fn);
  11027. // optimize hook:event cost by using a boolean flag marked at registration
  11028. // instead of a hash lookup
  11029. if (hookRE.test(event)) {
  11030. vm._hasHookEvent = true;
  11031. }
  11032. }
  11033. return vm
  11034. };
  11035. Vue.prototype.$once = function (event, fn) {
  11036. var vm = this;
  11037. function on () {
  11038. vm.$off(event, on);
  11039. fn.apply(vm, arguments);
  11040. }
  11041. on.fn = fn;
  11042. vm.$on(event, on);
  11043. return vm
  11044. };
  11045. Vue.prototype.$off = function (event, fn) {
  11046. var vm = this;
  11047. // all
  11048. if (!arguments.length) {
  11049. vm._events = Object.create(null);
  11050. return vm
  11051. }
  11052. // array of events
  11053. if (Array.isArray(event)) {
  11054. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  11055. vm.$off(event[i$1], fn);
  11056. }
  11057. return vm
  11058. }
  11059. // specific event
  11060. var cbs = vm._events[event];
  11061. if (!cbs) {
  11062. return vm
  11063. }
  11064. if (!fn) {
  11065. vm._events[event] = null;
  11066. return vm
  11067. }
  11068. // specific handler
  11069. var cb;
  11070. var i = cbs.length;
  11071. while (i--) {
  11072. cb = cbs[i];
  11073. if (cb === fn || cb.fn === fn) {
  11074. cbs.splice(i, 1);
  11075. break
  11076. }
  11077. }
  11078. return vm
  11079. };
  11080. Vue.prototype.$emit = function (event) {
  11081. var vm = this;
  11082. if (true) {
  11083. var lowerCaseEvent = event.toLowerCase();
  11084. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  11085. tip(
  11086. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  11087. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  11088. "Note that HTML attributes are case-insensitive and you cannot use " +
  11089. "v-on to listen to camelCase events when using in-DOM templates. " +
  11090. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  11091. );
  11092. }
  11093. }
  11094. var cbs = vm._events[event];
  11095. if (cbs) {
  11096. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  11097. var args = toArray(arguments, 1);
  11098. var info = "event handler for \"" + event + "\"";
  11099. for (var i = 0, l = cbs.length; i < l; i++) {
  11100. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  11101. }
  11102. }
  11103. return vm
  11104. };
  11105. }
  11106. /* */
  11107. var activeInstance = null;
  11108. var isUpdatingChildComponent = false;
  11109. function setActiveInstance(vm) {
  11110. var prevActiveInstance = activeInstance;
  11111. activeInstance = vm;
  11112. return function () {
  11113. activeInstance = prevActiveInstance;
  11114. }
  11115. }
  11116. function initLifecycle (vm) {
  11117. var options = vm.$options;
  11118. // locate first non-abstract parent
  11119. var parent = options.parent;
  11120. if (parent && !options.abstract) {
  11121. while (parent.$options.abstract && parent.$parent) {
  11122. parent = parent.$parent;
  11123. }
  11124. parent.$children.push(vm);
  11125. }
  11126. vm.$parent = parent;
  11127. vm.$root = parent ? parent.$root : vm;
  11128. vm.$children = [];
  11129. vm.$refs = {};
  11130. vm._watcher = null;
  11131. vm._inactive = null;
  11132. vm._directInactive = false;
  11133. vm._isMounted = false;
  11134. vm._isDestroyed = false;
  11135. vm._isBeingDestroyed = false;
  11136. }
  11137. function lifecycleMixin (Vue) {
  11138. Vue.prototype._update = function (vnode, hydrating) {
  11139. var vm = this;
  11140. var prevEl = vm.$el;
  11141. var prevVnode = vm._vnode;
  11142. var restoreActiveInstance = setActiveInstance(vm);
  11143. vm._vnode = vnode;
  11144. // Vue.prototype.__patch__ is injected in entry points
  11145. // based on the rendering backend used.
  11146. if (!prevVnode) {
  11147. // initial render
  11148. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  11149. } else {
  11150. // updates
  11151. vm.$el = vm.__patch__(prevVnode, vnode);
  11152. }
  11153. restoreActiveInstance();
  11154. // update __vue__ reference
  11155. if (prevEl) {
  11156. prevEl.__vue__ = null;
  11157. }
  11158. if (vm.$el) {
  11159. vm.$el.__vue__ = vm;
  11160. }
  11161. // if parent is an HOC, update its $el as well
  11162. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  11163. vm.$parent.$el = vm.$el;
  11164. }
  11165. // updated hook is called by the scheduler to ensure that children are
  11166. // updated in a parent's updated hook.
  11167. };
  11168. Vue.prototype.$forceUpdate = function () {
  11169. var vm = this;
  11170. if (vm._watcher) {
  11171. vm._watcher.update();
  11172. }
  11173. };
  11174. Vue.prototype.$destroy = function () {
  11175. var vm = this;
  11176. if (vm._isBeingDestroyed) {
  11177. return
  11178. }
  11179. callHook(vm, 'beforeDestroy');
  11180. vm._isBeingDestroyed = true;
  11181. // remove self from parent
  11182. var parent = vm.$parent;
  11183. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  11184. remove(parent.$children, vm);
  11185. }
  11186. // teardown watchers
  11187. if (vm._watcher) {
  11188. vm._watcher.teardown();
  11189. }
  11190. var i = vm._watchers.length;
  11191. while (i--) {
  11192. vm._watchers[i].teardown();
  11193. }
  11194. // remove reference from data ob
  11195. // frozen object may not have observer.
  11196. if (vm._data.__ob__) {
  11197. vm._data.__ob__.vmCount--;
  11198. }
  11199. // call the last hook...
  11200. vm._isDestroyed = true;
  11201. // invoke destroy hooks on current rendered tree
  11202. vm.__patch__(vm._vnode, null);
  11203. // fire destroyed hook
  11204. callHook(vm, 'destroyed');
  11205. // turn off all instance listeners.
  11206. vm.$off();
  11207. // remove __vue__ reference
  11208. if (vm.$el) {
  11209. vm.$el.__vue__ = null;
  11210. }
  11211. // release circular reference (#6759)
  11212. if (vm.$vnode) {
  11213. vm.$vnode.parent = null;
  11214. }
  11215. };
  11216. }
  11217. function updateChildComponent (
  11218. vm,
  11219. propsData,
  11220. listeners,
  11221. parentVnode,
  11222. renderChildren
  11223. ) {
  11224. if (true) {
  11225. isUpdatingChildComponent = true;
  11226. }
  11227. // determine whether component has slot children
  11228. // we need to do this before overwriting $options._renderChildren.
  11229. // check if there are dynamic scopedSlots (hand-written or compiled but with
  11230. // dynamic slot names). Static scoped slots compiled from template has the
  11231. // "$stable" marker.
  11232. var newScopedSlots = parentVnode.data.scopedSlots;
  11233. var oldScopedSlots = vm.$scopedSlots;
  11234. var hasDynamicScopedSlot = !!(
  11235. (newScopedSlots && !newScopedSlots.$stable) ||
  11236. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  11237. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  11238. );
  11239. // Any static slot children from the parent may have changed during parent's
  11240. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  11241. // update is necessary to ensure correctness.
  11242. var needsForceUpdate = !!(
  11243. renderChildren || // has new static slots
  11244. vm.$options._renderChildren || // has old static slots
  11245. hasDynamicScopedSlot
  11246. );
  11247. vm.$options._parentVnode = parentVnode;
  11248. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  11249. if (vm._vnode) { // update child tree's parent
  11250. vm._vnode.parent = parentVnode;
  11251. }
  11252. vm.$options._renderChildren = renderChildren;
  11253. // update $attrs and $listeners hash
  11254. // these are also reactive so they may trigger child update if the child
  11255. // used them during render
  11256. vm.$attrs = parentVnode.data.attrs || emptyObject;
  11257. vm.$listeners = listeners || emptyObject;
  11258. // update props
  11259. if (propsData && vm.$options.props) {
  11260. toggleObserving(false);
  11261. var props = vm._props;
  11262. var propKeys = vm.$options._propKeys || [];
  11263. for (var i = 0; i < propKeys.length; i++) {
  11264. var key = propKeys[i];
  11265. var propOptions = vm.$options.props; // wtf flow?
  11266. props[key] = validateProp(key, propOptions, propsData, vm);
  11267. }
  11268. toggleObserving(true);
  11269. // keep a copy of raw propsData
  11270. vm.$options.propsData = propsData;
  11271. }
  11272. // fixed by xxxxxx update properties(mp runtime)
  11273. vm._$updateProperties && vm._$updateProperties(vm);
  11274. // update listeners
  11275. listeners = listeners || emptyObject;
  11276. var oldListeners = vm.$options._parentListeners;
  11277. vm.$options._parentListeners = listeners;
  11278. updateComponentListeners(vm, listeners, oldListeners);
  11279. // resolve slots + force update if has children
  11280. if (needsForceUpdate) {
  11281. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  11282. vm.$forceUpdate();
  11283. }
  11284. if (true) {
  11285. isUpdatingChildComponent = false;
  11286. }
  11287. }
  11288. function isInInactiveTree (vm) {
  11289. while (vm && (vm = vm.$parent)) {
  11290. if (vm._inactive) { return true }
  11291. }
  11292. return false
  11293. }
  11294. function activateChildComponent (vm, direct) {
  11295. if (direct) {
  11296. vm._directInactive = false;
  11297. if (isInInactiveTree(vm)) {
  11298. return
  11299. }
  11300. } else if (vm._directInactive) {
  11301. return
  11302. }
  11303. if (vm._inactive || vm._inactive === null) {
  11304. vm._inactive = false;
  11305. for (var i = 0; i < vm.$children.length; i++) {
  11306. activateChildComponent(vm.$children[i]);
  11307. }
  11308. callHook(vm, 'activated');
  11309. }
  11310. }
  11311. function deactivateChildComponent (vm, direct) {
  11312. if (direct) {
  11313. vm._directInactive = true;
  11314. if (isInInactiveTree(vm)) {
  11315. return
  11316. }
  11317. }
  11318. if (!vm._inactive) {
  11319. vm._inactive = true;
  11320. for (var i = 0; i < vm.$children.length; i++) {
  11321. deactivateChildComponent(vm.$children[i]);
  11322. }
  11323. callHook(vm, 'deactivated');
  11324. }
  11325. }
  11326. function callHook (vm, hook) {
  11327. // #7573 disable dep collection when invoking lifecycle hooks
  11328. pushTarget();
  11329. var handlers = vm.$options[hook];
  11330. var info = hook + " hook";
  11331. if (handlers) {
  11332. for (var i = 0, j = handlers.length; i < j; i++) {
  11333. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  11334. }
  11335. }
  11336. if (vm._hasHookEvent) {
  11337. vm.$emit('hook:' + hook);
  11338. }
  11339. popTarget();
  11340. }
  11341. /* */
  11342. var MAX_UPDATE_COUNT = 100;
  11343. var queue = [];
  11344. var activatedChildren = [];
  11345. var has = {};
  11346. var circular = {};
  11347. var waiting = false;
  11348. var flushing = false;
  11349. var index = 0;
  11350. /**
  11351. * Reset the scheduler's state.
  11352. */
  11353. function resetSchedulerState () {
  11354. index = queue.length = activatedChildren.length = 0;
  11355. has = {};
  11356. if (true) {
  11357. circular = {};
  11358. }
  11359. waiting = flushing = false;
  11360. }
  11361. // Async edge case #6566 requires saving the timestamp when event listeners are
  11362. // attached. However, calling performance.now() has a perf overhead especially
  11363. // if the page has thousands of event listeners. Instead, we take a timestamp
  11364. // every time the scheduler flushes and use that for all event listeners
  11365. // attached during that flush.
  11366. var currentFlushTimestamp = 0;
  11367. // Async edge case fix requires storing an event listener's attach timestamp.
  11368. var getNow = Date.now;
  11369. // Determine what event timestamp the browser is using. Annoyingly, the
  11370. // timestamp can either be hi-res (relative to page load) or low-res
  11371. // (relative to UNIX epoch), so in order to compare time we have to use the
  11372. // same timestamp type when saving the flush timestamp.
  11373. // All IE versions use low-res event timestamps, and have problematic clock
  11374. // implementations (#9632)
  11375. if (inBrowser && !isIE) {
  11376. var performance = window.performance;
  11377. if (
  11378. performance &&
  11379. typeof performance.now === 'function' &&
  11380. getNow() > document.createEvent('Event').timeStamp
  11381. ) {
  11382. // if the event timestamp, although evaluated AFTER the Date.now(), is
  11383. // smaller than it, it means the event is using a hi-res timestamp,
  11384. // and we need to use the hi-res version for event listener timestamps as
  11385. // well.
  11386. getNow = function () { return performance.now(); };
  11387. }
  11388. }
  11389. /**
  11390. * Flush both queues and run the watchers.
  11391. */
  11392. function flushSchedulerQueue () {
  11393. currentFlushTimestamp = getNow();
  11394. flushing = true;
  11395. var watcher, id;
  11396. // Sort queue before flush.
  11397. // This ensures that:
  11398. // 1. Components are updated from parent to child. (because parent is always
  11399. // created before the child)
  11400. // 2. A component's user watchers are run before its render watcher (because
  11401. // user watchers are created before the render watcher)
  11402. // 3. If a component is destroyed during a parent component's watcher run,
  11403. // its watchers can be skipped.
  11404. queue.sort(function (a, b) { return a.id - b.id; });
  11405. // do not cache length because more watchers might be pushed
  11406. // as we run existing watchers
  11407. for (index = 0; index < queue.length; index++) {
  11408. watcher = queue[index];
  11409. if (watcher.before) {
  11410. watcher.before();
  11411. }
  11412. id = watcher.id;
  11413. has[id] = null;
  11414. watcher.run();
  11415. // in dev build, check and stop circular updates.
  11416. if ( true && has[id] != null) {
  11417. circular[id] = (circular[id] || 0) + 1;
  11418. if (circular[id] > MAX_UPDATE_COUNT) {
  11419. warn(
  11420. 'You may have an infinite update loop ' + (
  11421. watcher.user
  11422. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  11423. : "in a component render function."
  11424. ),
  11425. watcher.vm
  11426. );
  11427. break
  11428. }
  11429. }
  11430. }
  11431. // keep copies of post queues before resetting state
  11432. var activatedQueue = activatedChildren.slice();
  11433. var updatedQueue = queue.slice();
  11434. resetSchedulerState();
  11435. // call component updated and activated hooks
  11436. callActivatedHooks(activatedQueue);
  11437. callUpdatedHooks(updatedQueue);
  11438. // devtool hook
  11439. /* istanbul ignore if */
  11440. if (devtools && config.devtools) {
  11441. devtools.emit('flush');
  11442. }
  11443. }
  11444. function callUpdatedHooks (queue) {
  11445. var i = queue.length;
  11446. while (i--) {
  11447. var watcher = queue[i];
  11448. var vm = watcher.vm;
  11449. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  11450. callHook(vm, 'updated');
  11451. }
  11452. }
  11453. }
  11454. /**
  11455. * Queue a kept-alive component that was activated during patch.
  11456. * The queue will be processed after the entire tree has been patched.
  11457. */
  11458. function queueActivatedComponent (vm) {
  11459. // setting _inactive to false here so that a render function can
  11460. // rely on checking whether it's in an inactive tree (e.g. router-view)
  11461. vm._inactive = false;
  11462. activatedChildren.push(vm);
  11463. }
  11464. function callActivatedHooks (queue) {
  11465. for (var i = 0; i < queue.length; i++) {
  11466. queue[i]._inactive = true;
  11467. activateChildComponent(queue[i], true /* true */);
  11468. }
  11469. }
  11470. /**
  11471. * Push a watcher into the watcher queue.
  11472. * Jobs with duplicate IDs will be skipped unless it's
  11473. * pushed when the queue is being flushed.
  11474. */
  11475. function queueWatcher (watcher) {
  11476. var id = watcher.id;
  11477. if (has[id] == null) {
  11478. has[id] = true;
  11479. if (!flushing) {
  11480. queue.push(watcher);
  11481. } else {
  11482. // if already flushing, splice the watcher based on its id
  11483. // if already past its id, it will be run next immediately.
  11484. var i = queue.length - 1;
  11485. while (i > index && queue[i].id > watcher.id) {
  11486. i--;
  11487. }
  11488. queue.splice(i + 1, 0, watcher);
  11489. }
  11490. // queue the flush
  11491. if (!waiting) {
  11492. waiting = true;
  11493. if ( true && !config.async) {
  11494. flushSchedulerQueue();
  11495. return
  11496. }
  11497. nextTick(flushSchedulerQueue);
  11498. }
  11499. }
  11500. }
  11501. /* */
  11502. var uid$2 = 0;
  11503. /**
  11504. * A watcher parses an expression, collects dependencies,
  11505. * and fires callback when the expression value changes.
  11506. * This is used for both the $watch() api and directives.
  11507. */
  11508. var Watcher = function Watcher (
  11509. vm,
  11510. expOrFn,
  11511. cb,
  11512. options,
  11513. isRenderWatcher
  11514. ) {
  11515. this.vm = vm;
  11516. if (isRenderWatcher) {
  11517. vm._watcher = this;
  11518. }
  11519. vm._watchers.push(this);
  11520. // options
  11521. if (options) {
  11522. this.deep = !!options.deep;
  11523. this.user = !!options.user;
  11524. this.lazy = !!options.lazy;
  11525. this.sync = !!options.sync;
  11526. this.before = options.before;
  11527. } else {
  11528. this.deep = this.user = this.lazy = this.sync = false;
  11529. }
  11530. this.cb = cb;
  11531. this.id = ++uid$2; // uid for batching
  11532. this.active = true;
  11533. this.dirty = this.lazy; // for lazy watchers
  11534. this.deps = [];
  11535. this.newDeps = [];
  11536. this.depIds = new _Set();
  11537. this.newDepIds = new _Set();
  11538. this.expression = true
  11539. ? expOrFn.toString()
  11540. : undefined;
  11541. // parse expression for getter
  11542. if (typeof expOrFn === 'function') {
  11543. this.getter = expOrFn;
  11544. } else {
  11545. this.getter = parsePath(expOrFn);
  11546. if (!this.getter) {
  11547. this.getter = noop;
  11548. true && warn(
  11549. "Failed watching path: \"" + expOrFn + "\" " +
  11550. 'Watcher only accepts simple dot-delimited paths. ' +
  11551. 'For full control, use a function instead.',
  11552. vm
  11553. );
  11554. }
  11555. }
  11556. this.value = this.lazy
  11557. ? undefined
  11558. : this.get();
  11559. };
  11560. /**
  11561. * Evaluate the getter, and re-collect dependencies.
  11562. */
  11563. Watcher.prototype.get = function get () {
  11564. pushTarget(this);
  11565. var value;
  11566. var vm = this.vm;
  11567. try {
  11568. value = this.getter.call(vm, vm);
  11569. } catch (e) {
  11570. if (this.user) {
  11571. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  11572. } else {
  11573. throw e
  11574. }
  11575. } finally {
  11576. // "touch" every property so they are all tracked as
  11577. // dependencies for deep watching
  11578. if (this.deep) {
  11579. traverse(value);
  11580. }
  11581. popTarget();
  11582. this.cleanupDeps();
  11583. }
  11584. return value
  11585. };
  11586. /**
  11587. * Add a dependency to this directive.
  11588. */
  11589. Watcher.prototype.addDep = function addDep (dep) {
  11590. var id = dep.id;
  11591. if (!this.newDepIds.has(id)) {
  11592. this.newDepIds.add(id);
  11593. this.newDeps.push(dep);
  11594. if (!this.depIds.has(id)) {
  11595. dep.addSub(this);
  11596. }
  11597. }
  11598. };
  11599. /**
  11600. * Clean up for dependency collection.
  11601. */
  11602. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  11603. var i = this.deps.length;
  11604. while (i--) {
  11605. var dep = this.deps[i];
  11606. if (!this.newDepIds.has(dep.id)) {
  11607. dep.removeSub(this);
  11608. }
  11609. }
  11610. var tmp = this.depIds;
  11611. this.depIds = this.newDepIds;
  11612. this.newDepIds = tmp;
  11613. this.newDepIds.clear();
  11614. tmp = this.deps;
  11615. this.deps = this.newDeps;
  11616. this.newDeps = tmp;
  11617. this.newDeps.length = 0;
  11618. };
  11619. /**
  11620. * Subscriber interface.
  11621. * Will be called when a dependency changes.
  11622. */
  11623. Watcher.prototype.update = function update () {
  11624. /* istanbul ignore else */
  11625. if (this.lazy) {
  11626. this.dirty = true;
  11627. } else if (this.sync) {
  11628. this.run();
  11629. } else {
  11630. queueWatcher(this);
  11631. }
  11632. };
  11633. /**
  11634. * Scheduler job interface.
  11635. * Will be called by the scheduler.
  11636. */
  11637. Watcher.prototype.run = function run () {
  11638. if (this.active) {
  11639. var value = this.get();
  11640. if (
  11641. value !== this.value ||
  11642. // Deep watchers and watchers on Object/Arrays should fire even
  11643. // when the value is the same, because the value may
  11644. // have mutated.
  11645. isObject(value) ||
  11646. this.deep
  11647. ) {
  11648. // set new value
  11649. var oldValue = this.value;
  11650. this.value = value;
  11651. if (this.user) {
  11652. try {
  11653. this.cb.call(this.vm, value, oldValue);
  11654. } catch (e) {
  11655. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  11656. }
  11657. } else {
  11658. this.cb.call(this.vm, value, oldValue);
  11659. }
  11660. }
  11661. }
  11662. };
  11663. /**
  11664. * Evaluate the value of the watcher.
  11665. * This only gets called for lazy watchers.
  11666. */
  11667. Watcher.prototype.evaluate = function evaluate () {
  11668. this.value = this.get();
  11669. this.dirty = false;
  11670. };
  11671. /**
  11672. * Depend on all deps collected by this watcher.
  11673. */
  11674. Watcher.prototype.depend = function depend () {
  11675. var i = this.deps.length;
  11676. while (i--) {
  11677. this.deps[i].depend();
  11678. }
  11679. };
  11680. /**
  11681. * Remove self from all dependencies' subscriber list.
  11682. */
  11683. Watcher.prototype.teardown = function teardown () {
  11684. if (this.active) {
  11685. // remove self from vm's watcher list
  11686. // this is a somewhat expensive operation so we skip it
  11687. // if the vm is being destroyed.
  11688. if (!this.vm._isBeingDestroyed) {
  11689. remove(this.vm._watchers, this);
  11690. }
  11691. var i = this.deps.length;
  11692. while (i--) {
  11693. this.deps[i].removeSub(this);
  11694. }
  11695. this.active = false;
  11696. }
  11697. };
  11698. /* */
  11699. var sharedPropertyDefinition = {
  11700. enumerable: true,
  11701. configurable: true,
  11702. get: noop,
  11703. set: noop
  11704. };
  11705. function proxy (target, sourceKey, key) {
  11706. sharedPropertyDefinition.get = function proxyGetter () {
  11707. return this[sourceKey][key]
  11708. };
  11709. sharedPropertyDefinition.set = function proxySetter (val) {
  11710. this[sourceKey][key] = val;
  11711. };
  11712. Object.defineProperty(target, key, sharedPropertyDefinition);
  11713. }
  11714. function initState (vm) {
  11715. vm._watchers = [];
  11716. var opts = vm.$options;
  11717. if (opts.props) { initProps(vm, opts.props); }
  11718. if (opts.methods) { initMethods(vm, opts.methods); }
  11719. if (opts.data) {
  11720. initData(vm);
  11721. } else {
  11722. observe(vm._data = {}, true /* asRootData */);
  11723. }
  11724. if (opts.computed) { initComputed(vm, opts.computed); }
  11725. if (opts.watch && opts.watch !== nativeWatch) {
  11726. initWatch(vm, opts.watch);
  11727. }
  11728. }
  11729. function initProps (vm, propsOptions) {
  11730. var propsData = vm.$options.propsData || {};
  11731. var props = vm._props = {};
  11732. // cache prop keys so that future props updates can iterate using Array
  11733. // instead of dynamic object key enumeration.
  11734. var keys = vm.$options._propKeys = [];
  11735. var isRoot = !vm.$parent;
  11736. // root instance props should be converted
  11737. if (!isRoot) {
  11738. toggleObserving(false);
  11739. }
  11740. var loop = function ( key ) {
  11741. keys.push(key);
  11742. var value = validateProp(key, propsOptions, propsData, vm);
  11743. /* istanbul ignore else */
  11744. if (true) {
  11745. var hyphenatedKey = hyphenate(key);
  11746. if (isReservedAttribute(hyphenatedKey) ||
  11747. config.isReservedAttr(hyphenatedKey)) {
  11748. warn(
  11749. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  11750. vm
  11751. );
  11752. }
  11753. defineReactive$$1(props, key, value, function () {
  11754. if (!isRoot && !isUpdatingChildComponent) {
  11755. {
  11756. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  11757. return
  11758. }
  11759. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  11760. if(
  11761. key === 'value' &&
  11762. Array.isArray(vm.$options.behaviors) &&
  11763. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  11764. ){
  11765. return
  11766. }
  11767. if(vm._getFormData){
  11768. return
  11769. }
  11770. var $parent = vm.$parent;
  11771. while($parent){
  11772. if($parent.__next_tick_pending){
  11773. return
  11774. }
  11775. $parent = $parent.$parent;
  11776. }
  11777. }
  11778. warn(
  11779. "Avoid mutating a prop directly since the value will be " +
  11780. "overwritten whenever the parent component re-renders. " +
  11781. "Instead, use a data or computed property based on the prop's " +
  11782. "value. Prop being mutated: \"" + key + "\"",
  11783. vm
  11784. );
  11785. }
  11786. });
  11787. } else {}
  11788. // static props are already proxied on the component's prototype
  11789. // during Vue.extend(). We only need to proxy props defined at
  11790. // instantiation here.
  11791. if (!(key in vm)) {
  11792. proxy(vm, "_props", key);
  11793. }
  11794. };
  11795. for (var key in propsOptions) loop( key );
  11796. toggleObserving(true);
  11797. }
  11798. function initData (vm) {
  11799. var data = vm.$options.data;
  11800. data = vm._data = typeof data === 'function'
  11801. ? getData(data, vm)
  11802. : data || {};
  11803. if (!isPlainObject(data)) {
  11804. data = {};
  11805. true && warn(
  11806. 'data functions should return an object:\n' +
  11807. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  11808. vm
  11809. );
  11810. }
  11811. // proxy data on instance
  11812. var keys = Object.keys(data);
  11813. var props = vm.$options.props;
  11814. var methods = vm.$options.methods;
  11815. var i = keys.length;
  11816. while (i--) {
  11817. var key = keys[i];
  11818. if (true) {
  11819. if (methods && hasOwn(methods, key)) {
  11820. warn(
  11821. ("Method \"" + key + "\" has already been defined as a data property."),
  11822. vm
  11823. );
  11824. }
  11825. }
  11826. if (props && hasOwn(props, key)) {
  11827. true && warn(
  11828. "The data property \"" + key + "\" is already declared as a prop. " +
  11829. "Use prop default value instead.",
  11830. vm
  11831. );
  11832. } else if (!isReserved(key)) {
  11833. proxy(vm, "_data", key);
  11834. }
  11835. }
  11836. // observe data
  11837. observe(data, true /* asRootData */);
  11838. }
  11839. function getData (data, vm) {
  11840. // #7573 disable dep collection when invoking data getters
  11841. pushTarget();
  11842. try {
  11843. return data.call(vm, vm)
  11844. } catch (e) {
  11845. handleError(e, vm, "data()");
  11846. return {}
  11847. } finally {
  11848. popTarget();
  11849. }
  11850. }
  11851. var computedWatcherOptions = { lazy: true };
  11852. function initComputed (vm, computed) {
  11853. // $flow-disable-line
  11854. var watchers = vm._computedWatchers = Object.create(null);
  11855. // computed properties are just getters during SSR
  11856. var isSSR = isServerRendering();
  11857. for (var key in computed) {
  11858. var userDef = computed[key];
  11859. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  11860. if ( true && getter == null) {
  11861. warn(
  11862. ("Getter is missing for computed property \"" + key + "\"."),
  11863. vm
  11864. );
  11865. }
  11866. if (!isSSR) {
  11867. // create internal watcher for the computed property.
  11868. watchers[key] = new Watcher(
  11869. vm,
  11870. getter || noop,
  11871. noop,
  11872. computedWatcherOptions
  11873. );
  11874. }
  11875. // component-defined computed properties are already defined on the
  11876. // component prototype. We only need to define computed properties defined
  11877. // at instantiation here.
  11878. if (!(key in vm)) {
  11879. defineComputed(vm, key, userDef);
  11880. } else if (true) {
  11881. if (key in vm.$data) {
  11882. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  11883. } else if (vm.$options.props && key in vm.$options.props) {
  11884. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  11885. }
  11886. }
  11887. }
  11888. }
  11889. function defineComputed (
  11890. target,
  11891. key,
  11892. userDef
  11893. ) {
  11894. var shouldCache = !isServerRendering();
  11895. if (typeof userDef === 'function') {
  11896. sharedPropertyDefinition.get = shouldCache
  11897. ? createComputedGetter(key)
  11898. : createGetterInvoker(userDef);
  11899. sharedPropertyDefinition.set = noop;
  11900. } else {
  11901. sharedPropertyDefinition.get = userDef.get
  11902. ? shouldCache && userDef.cache !== false
  11903. ? createComputedGetter(key)
  11904. : createGetterInvoker(userDef.get)
  11905. : noop;
  11906. sharedPropertyDefinition.set = userDef.set || noop;
  11907. }
  11908. if ( true &&
  11909. sharedPropertyDefinition.set === noop) {
  11910. sharedPropertyDefinition.set = function () {
  11911. warn(
  11912. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  11913. this
  11914. );
  11915. };
  11916. }
  11917. Object.defineProperty(target, key, sharedPropertyDefinition);
  11918. }
  11919. function createComputedGetter (key) {
  11920. return function computedGetter () {
  11921. var watcher = this._computedWatchers && this._computedWatchers[key];
  11922. if (watcher) {
  11923. if (watcher.dirty) {
  11924. watcher.evaluate();
  11925. }
  11926. if (Dep.SharedObject.target) {// fixed by xxxxxx
  11927. watcher.depend();
  11928. }
  11929. return watcher.value
  11930. }
  11931. }
  11932. }
  11933. function createGetterInvoker(fn) {
  11934. return function computedGetter () {
  11935. return fn.call(this, this)
  11936. }
  11937. }
  11938. function initMethods (vm, methods) {
  11939. var props = vm.$options.props;
  11940. for (var key in methods) {
  11941. if (true) {
  11942. if (typeof methods[key] !== 'function') {
  11943. warn(
  11944. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  11945. "Did you reference the function correctly?",
  11946. vm
  11947. );
  11948. }
  11949. if (props && hasOwn(props, key)) {
  11950. warn(
  11951. ("Method \"" + key + "\" has already been defined as a prop."),
  11952. vm
  11953. );
  11954. }
  11955. if ((key in vm) && isReserved(key)) {
  11956. warn(
  11957. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  11958. "Avoid defining component methods that start with _ or $."
  11959. );
  11960. }
  11961. }
  11962. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  11963. }
  11964. }
  11965. function initWatch (vm, watch) {
  11966. for (var key in watch) {
  11967. var handler = watch[key];
  11968. if (Array.isArray(handler)) {
  11969. for (var i = 0; i < handler.length; i++) {
  11970. createWatcher(vm, key, handler[i]);
  11971. }
  11972. } else {
  11973. createWatcher(vm, key, handler);
  11974. }
  11975. }
  11976. }
  11977. function createWatcher (
  11978. vm,
  11979. expOrFn,
  11980. handler,
  11981. options
  11982. ) {
  11983. if (isPlainObject(handler)) {
  11984. options = handler;
  11985. handler = handler.handler;
  11986. }
  11987. if (typeof handler === 'string') {
  11988. handler = vm[handler];
  11989. }
  11990. return vm.$watch(expOrFn, handler, options)
  11991. }
  11992. function stateMixin (Vue) {
  11993. // flow somehow has problems with directly declared definition object
  11994. // when using Object.defineProperty, so we have to procedurally build up
  11995. // the object here.
  11996. var dataDef = {};
  11997. dataDef.get = function () { return this._data };
  11998. var propsDef = {};
  11999. propsDef.get = function () { return this._props };
  12000. if (true) {
  12001. dataDef.set = function () {
  12002. warn(
  12003. 'Avoid replacing instance root $data. ' +
  12004. 'Use nested data properties instead.',
  12005. this
  12006. );
  12007. };
  12008. propsDef.set = function () {
  12009. warn("$props is readonly.", this);
  12010. };
  12011. }
  12012. Object.defineProperty(Vue.prototype, '$data', dataDef);
  12013. Object.defineProperty(Vue.prototype, '$props', propsDef);
  12014. Vue.prototype.$set = set;
  12015. Vue.prototype.$delete = del;
  12016. Vue.prototype.$watch = function (
  12017. expOrFn,
  12018. cb,
  12019. options
  12020. ) {
  12021. var vm = this;
  12022. if (isPlainObject(cb)) {
  12023. return createWatcher(vm, expOrFn, cb, options)
  12024. }
  12025. options = options || {};
  12026. options.user = true;
  12027. var watcher = new Watcher(vm, expOrFn, cb, options);
  12028. if (options.immediate) {
  12029. try {
  12030. cb.call(vm, watcher.value);
  12031. } catch (error) {
  12032. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  12033. }
  12034. }
  12035. return function unwatchFn () {
  12036. watcher.teardown();
  12037. }
  12038. };
  12039. }
  12040. /* */
  12041. var uid$3 = 0;
  12042. function initMixin (Vue) {
  12043. Vue.prototype._init = function (options) {
  12044. var vm = this;
  12045. // a uid
  12046. vm._uid = uid$3++;
  12047. var startTag, endTag;
  12048. /* istanbul ignore if */
  12049. if ( true && config.performance && mark) {
  12050. startTag = "vue-perf-start:" + (vm._uid);
  12051. endTag = "vue-perf-end:" + (vm._uid);
  12052. mark(startTag);
  12053. }
  12054. // a flag to avoid this being observed
  12055. vm._isVue = true;
  12056. // merge options
  12057. if (options && options._isComponent) {
  12058. // optimize internal component instantiation
  12059. // since dynamic options merging is pretty slow, and none of the
  12060. // internal component options needs special treatment.
  12061. initInternalComponent(vm, options);
  12062. } else {
  12063. vm.$options = mergeOptions(
  12064. resolveConstructorOptions(vm.constructor),
  12065. options || {},
  12066. vm
  12067. );
  12068. }
  12069. /* istanbul ignore else */
  12070. if (true) {
  12071. initProxy(vm);
  12072. } else {}
  12073. // expose real self
  12074. vm._self = vm;
  12075. initLifecycle(vm);
  12076. initEvents(vm);
  12077. initRender(vm);
  12078. callHook(vm, 'beforeCreate');
  12079. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  12080. initState(vm);
  12081. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  12082. !vm._$fallback && callHook(vm, 'created');
  12083. /* istanbul ignore if */
  12084. if ( true && config.performance && mark) {
  12085. vm._name = formatComponentName(vm, false);
  12086. mark(endTag);
  12087. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  12088. }
  12089. if (vm.$options.el) {
  12090. vm.$mount(vm.$options.el);
  12091. }
  12092. };
  12093. }
  12094. function initInternalComponent (vm, options) {
  12095. var opts = vm.$options = Object.create(vm.constructor.options);
  12096. // doing this because it's faster than dynamic enumeration.
  12097. var parentVnode = options._parentVnode;
  12098. opts.parent = options.parent;
  12099. opts._parentVnode = parentVnode;
  12100. var vnodeComponentOptions = parentVnode.componentOptions;
  12101. opts.propsData = vnodeComponentOptions.propsData;
  12102. opts._parentListeners = vnodeComponentOptions.listeners;
  12103. opts._renderChildren = vnodeComponentOptions.children;
  12104. opts._componentTag = vnodeComponentOptions.tag;
  12105. if (options.render) {
  12106. opts.render = options.render;
  12107. opts.staticRenderFns = options.staticRenderFns;
  12108. }
  12109. }
  12110. function resolveConstructorOptions (Ctor) {
  12111. var options = Ctor.options;
  12112. if (Ctor.super) {
  12113. var superOptions = resolveConstructorOptions(Ctor.super);
  12114. var cachedSuperOptions = Ctor.superOptions;
  12115. if (superOptions !== cachedSuperOptions) {
  12116. // super option changed,
  12117. // need to resolve new options.
  12118. Ctor.superOptions = superOptions;
  12119. // check if there are any late-modified/attached options (#4976)
  12120. var modifiedOptions = resolveModifiedOptions(Ctor);
  12121. // update base extend options
  12122. if (modifiedOptions) {
  12123. extend(Ctor.extendOptions, modifiedOptions);
  12124. }
  12125. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  12126. if (options.name) {
  12127. options.components[options.name] = Ctor;
  12128. }
  12129. }
  12130. }
  12131. return options
  12132. }
  12133. function resolveModifiedOptions (Ctor) {
  12134. var modified;
  12135. var latest = Ctor.options;
  12136. var sealed = Ctor.sealedOptions;
  12137. for (var key in latest) {
  12138. if (latest[key] !== sealed[key]) {
  12139. if (!modified) { modified = {}; }
  12140. modified[key] = latest[key];
  12141. }
  12142. }
  12143. return modified
  12144. }
  12145. function Vue (options) {
  12146. if ( true &&
  12147. !(this instanceof Vue)
  12148. ) {
  12149. warn('Vue is a constructor and should be called with the `new` keyword');
  12150. }
  12151. this._init(options);
  12152. }
  12153. initMixin(Vue);
  12154. stateMixin(Vue);
  12155. eventsMixin(Vue);
  12156. lifecycleMixin(Vue);
  12157. renderMixin(Vue);
  12158. /* */
  12159. function initUse (Vue) {
  12160. Vue.use = function (plugin) {
  12161. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  12162. if (installedPlugins.indexOf(plugin) > -1) {
  12163. return this
  12164. }
  12165. // additional parameters
  12166. var args = toArray(arguments, 1);
  12167. args.unshift(this);
  12168. if (typeof plugin.install === 'function') {
  12169. plugin.install.apply(plugin, args);
  12170. } else if (typeof plugin === 'function') {
  12171. plugin.apply(null, args);
  12172. }
  12173. installedPlugins.push(plugin);
  12174. return this
  12175. };
  12176. }
  12177. /* */
  12178. function initMixin$1 (Vue) {
  12179. Vue.mixin = function (mixin) {
  12180. this.options = mergeOptions(this.options, mixin);
  12181. return this
  12182. };
  12183. }
  12184. /* */
  12185. function initExtend (Vue) {
  12186. /**
  12187. * Each instance constructor, including Vue, has a unique
  12188. * cid. This enables us to create wrapped "child
  12189. * constructors" for prototypal inheritance and cache them.
  12190. */
  12191. Vue.cid = 0;
  12192. var cid = 1;
  12193. /**
  12194. * Class inheritance
  12195. */
  12196. Vue.extend = function (extendOptions) {
  12197. extendOptions = extendOptions || {};
  12198. var Super = this;
  12199. var SuperId = Super.cid;
  12200. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  12201. if (cachedCtors[SuperId]) {
  12202. return cachedCtors[SuperId]
  12203. }
  12204. var name = extendOptions.name || Super.options.name;
  12205. if ( true && name) {
  12206. validateComponentName(name);
  12207. }
  12208. var Sub = function VueComponent (options) {
  12209. this._init(options);
  12210. };
  12211. Sub.prototype = Object.create(Super.prototype);
  12212. Sub.prototype.constructor = Sub;
  12213. Sub.cid = cid++;
  12214. Sub.options = mergeOptions(
  12215. Super.options,
  12216. extendOptions
  12217. );
  12218. Sub['super'] = Super;
  12219. // For props and computed properties, we define the proxy getters on
  12220. // the Vue instances at extension time, on the extended prototype. This
  12221. // avoids Object.defineProperty calls for each instance created.
  12222. if (Sub.options.props) {
  12223. initProps$1(Sub);
  12224. }
  12225. if (Sub.options.computed) {
  12226. initComputed$1(Sub);
  12227. }
  12228. // allow further extension/mixin/plugin usage
  12229. Sub.extend = Super.extend;
  12230. Sub.mixin = Super.mixin;
  12231. Sub.use = Super.use;
  12232. // create asset registers, so extended classes
  12233. // can have their private assets too.
  12234. ASSET_TYPES.forEach(function (type) {
  12235. Sub[type] = Super[type];
  12236. });
  12237. // enable recursive self-lookup
  12238. if (name) {
  12239. Sub.options.components[name] = Sub;
  12240. }
  12241. // keep a reference to the super options at extension time.
  12242. // later at instantiation we can check if Super's options have
  12243. // been updated.
  12244. Sub.superOptions = Super.options;
  12245. Sub.extendOptions = extendOptions;
  12246. Sub.sealedOptions = extend({}, Sub.options);
  12247. // cache constructor
  12248. cachedCtors[SuperId] = Sub;
  12249. return Sub
  12250. };
  12251. }
  12252. function initProps$1 (Comp) {
  12253. var props = Comp.options.props;
  12254. for (var key in props) {
  12255. proxy(Comp.prototype, "_props", key);
  12256. }
  12257. }
  12258. function initComputed$1 (Comp) {
  12259. var computed = Comp.options.computed;
  12260. for (var key in computed) {
  12261. defineComputed(Comp.prototype, key, computed[key]);
  12262. }
  12263. }
  12264. /* */
  12265. function initAssetRegisters (Vue) {
  12266. /**
  12267. * Create asset registration methods.
  12268. */
  12269. ASSET_TYPES.forEach(function (type) {
  12270. Vue[type] = function (
  12271. id,
  12272. definition
  12273. ) {
  12274. if (!definition) {
  12275. return this.options[type + 's'][id]
  12276. } else {
  12277. /* istanbul ignore if */
  12278. if ( true && type === 'component') {
  12279. validateComponentName(id);
  12280. }
  12281. if (type === 'component' && isPlainObject(definition)) {
  12282. definition.name = definition.name || id;
  12283. definition = this.options._base.extend(definition);
  12284. }
  12285. if (type === 'directive' && typeof definition === 'function') {
  12286. definition = { bind: definition, update: definition };
  12287. }
  12288. this.options[type + 's'][id] = definition;
  12289. return definition
  12290. }
  12291. };
  12292. });
  12293. }
  12294. /* */
  12295. function getComponentName (opts) {
  12296. return opts && (opts.Ctor.options.name || opts.tag)
  12297. }
  12298. function matches (pattern, name) {
  12299. if (Array.isArray(pattern)) {
  12300. return pattern.indexOf(name) > -1
  12301. } else if (typeof pattern === 'string') {
  12302. return pattern.split(',').indexOf(name) > -1
  12303. } else if (isRegExp(pattern)) {
  12304. return pattern.test(name)
  12305. }
  12306. /* istanbul ignore next */
  12307. return false
  12308. }
  12309. function pruneCache (keepAliveInstance, filter) {
  12310. var cache = keepAliveInstance.cache;
  12311. var keys = keepAliveInstance.keys;
  12312. var _vnode = keepAliveInstance._vnode;
  12313. for (var key in cache) {
  12314. var cachedNode = cache[key];
  12315. if (cachedNode) {
  12316. var name = getComponentName(cachedNode.componentOptions);
  12317. if (name && !filter(name)) {
  12318. pruneCacheEntry(cache, key, keys, _vnode);
  12319. }
  12320. }
  12321. }
  12322. }
  12323. function pruneCacheEntry (
  12324. cache,
  12325. key,
  12326. keys,
  12327. current
  12328. ) {
  12329. var cached$$1 = cache[key];
  12330. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  12331. cached$$1.componentInstance.$destroy();
  12332. }
  12333. cache[key] = null;
  12334. remove(keys, key);
  12335. }
  12336. var patternTypes = [String, RegExp, Array];
  12337. var KeepAlive = {
  12338. name: 'keep-alive',
  12339. abstract: true,
  12340. props: {
  12341. include: patternTypes,
  12342. exclude: patternTypes,
  12343. max: [String, Number]
  12344. },
  12345. created: function created () {
  12346. this.cache = Object.create(null);
  12347. this.keys = [];
  12348. },
  12349. destroyed: function destroyed () {
  12350. for (var key in this.cache) {
  12351. pruneCacheEntry(this.cache, key, this.keys);
  12352. }
  12353. },
  12354. mounted: function mounted () {
  12355. var this$1 = this;
  12356. this.$watch('include', function (val) {
  12357. pruneCache(this$1, function (name) { return matches(val, name); });
  12358. });
  12359. this.$watch('exclude', function (val) {
  12360. pruneCache(this$1, function (name) { return !matches(val, name); });
  12361. });
  12362. },
  12363. render: function render () {
  12364. var slot = this.$slots.default;
  12365. var vnode = getFirstComponentChild(slot);
  12366. var componentOptions = vnode && vnode.componentOptions;
  12367. if (componentOptions) {
  12368. // check pattern
  12369. var name = getComponentName(componentOptions);
  12370. var ref = this;
  12371. var include = ref.include;
  12372. var exclude = ref.exclude;
  12373. if (
  12374. // not included
  12375. (include && (!name || !matches(include, name))) ||
  12376. // excluded
  12377. (exclude && name && matches(exclude, name))
  12378. ) {
  12379. return vnode
  12380. }
  12381. var ref$1 = this;
  12382. var cache = ref$1.cache;
  12383. var keys = ref$1.keys;
  12384. var key = vnode.key == null
  12385. // same constructor may get registered as different local components
  12386. // so cid alone is not enough (#3269)
  12387. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  12388. : vnode.key;
  12389. if (cache[key]) {
  12390. vnode.componentInstance = cache[key].componentInstance;
  12391. // make current key freshest
  12392. remove(keys, key);
  12393. keys.push(key);
  12394. } else {
  12395. cache[key] = vnode;
  12396. keys.push(key);
  12397. // prune oldest entry
  12398. if (this.max && keys.length > parseInt(this.max)) {
  12399. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  12400. }
  12401. }
  12402. vnode.data.keepAlive = true;
  12403. }
  12404. return vnode || (slot && slot[0])
  12405. }
  12406. };
  12407. var builtInComponents = {
  12408. KeepAlive: KeepAlive
  12409. };
  12410. /* */
  12411. function initGlobalAPI (Vue) {
  12412. // config
  12413. var configDef = {};
  12414. configDef.get = function () { return config; };
  12415. if (true) {
  12416. configDef.set = function () {
  12417. warn(
  12418. 'Do not replace the Vue.config object, set individual fields instead.'
  12419. );
  12420. };
  12421. }
  12422. Object.defineProperty(Vue, 'config', configDef);
  12423. // exposed util methods.
  12424. // NOTE: these are not considered part of the public API - avoid relying on
  12425. // them unless you are aware of the risk.
  12426. Vue.util = {
  12427. warn: warn,
  12428. extend: extend,
  12429. mergeOptions: mergeOptions,
  12430. defineReactive: defineReactive$$1
  12431. };
  12432. Vue.set = set;
  12433. Vue.delete = del;
  12434. Vue.nextTick = nextTick;
  12435. // 2.6 explicit observable API
  12436. Vue.observable = function (obj) {
  12437. observe(obj);
  12438. return obj
  12439. };
  12440. Vue.options = Object.create(null);
  12441. ASSET_TYPES.forEach(function (type) {
  12442. Vue.options[type + 's'] = Object.create(null);
  12443. });
  12444. // this is used to identify the "base" constructor to extend all plain-object
  12445. // components with in Weex's multi-instance scenarios.
  12446. Vue.options._base = Vue;
  12447. extend(Vue.options.components, builtInComponents);
  12448. initUse(Vue);
  12449. initMixin$1(Vue);
  12450. initExtend(Vue);
  12451. initAssetRegisters(Vue);
  12452. }
  12453. initGlobalAPI(Vue);
  12454. Object.defineProperty(Vue.prototype, '$isServer', {
  12455. get: isServerRendering
  12456. });
  12457. Object.defineProperty(Vue.prototype, '$ssrContext', {
  12458. get: function get () {
  12459. /* istanbul ignore next */
  12460. return this.$vnode && this.$vnode.ssrContext
  12461. }
  12462. });
  12463. // expose FunctionalRenderContext for ssr runtime helper installation
  12464. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  12465. value: FunctionalRenderContext
  12466. });
  12467. Vue.version = '2.6.11';
  12468. /**
  12469. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  12470. */
  12471. var ARRAYTYPE = '[object Array]';
  12472. var OBJECTTYPE = '[object Object]';
  12473. // const FUNCTIONTYPE = '[object Function]'
  12474. function diff(current, pre) {
  12475. var result = {};
  12476. syncKeys(current, pre);
  12477. _diff(current, pre, '', result);
  12478. return result
  12479. }
  12480. function syncKeys(current, pre) {
  12481. if (current === pre) { return }
  12482. var rootCurrentType = type(current);
  12483. var rootPreType = type(pre);
  12484. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  12485. if(Object.keys(current).length >= Object.keys(pre).length){
  12486. for (var key in pre) {
  12487. var currentValue = current[key];
  12488. if (currentValue === undefined) {
  12489. current[key] = null;
  12490. } else {
  12491. syncKeys(currentValue, pre[key]);
  12492. }
  12493. }
  12494. }
  12495. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  12496. if (current.length >= pre.length) {
  12497. pre.forEach(function (item, index) {
  12498. syncKeys(current[index], item);
  12499. });
  12500. }
  12501. }
  12502. }
  12503. function _diff(current, pre, path, result) {
  12504. if (current === pre) { return }
  12505. var rootCurrentType = type(current);
  12506. var rootPreType = type(pre);
  12507. if (rootCurrentType == OBJECTTYPE) {
  12508. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  12509. setResult(result, path, current);
  12510. } else {
  12511. var loop = function ( key ) {
  12512. var currentValue = current[key];
  12513. var preValue = pre[key];
  12514. var currentType = type(currentValue);
  12515. var preType = type(preValue);
  12516. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  12517. if (currentValue !== pre[key]) {
  12518. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  12519. }
  12520. } else if (currentType == ARRAYTYPE) {
  12521. if (preType != ARRAYTYPE) {
  12522. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  12523. } else {
  12524. if (currentValue.length < preValue.length) {
  12525. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  12526. } else {
  12527. currentValue.forEach(function (item, index) {
  12528. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  12529. });
  12530. }
  12531. }
  12532. } else if (currentType == OBJECTTYPE) {
  12533. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  12534. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  12535. } else {
  12536. for (var subKey in currentValue) {
  12537. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  12538. }
  12539. }
  12540. }
  12541. };
  12542. for (var key in current) loop( key );
  12543. }
  12544. } else if (rootCurrentType == ARRAYTYPE) {
  12545. if (rootPreType != ARRAYTYPE) {
  12546. setResult(result, path, current);
  12547. } else {
  12548. if (current.length < pre.length) {
  12549. setResult(result, path, current);
  12550. } else {
  12551. current.forEach(function (item, index) {
  12552. _diff(item, pre[index], path + '[' + index + ']', result);
  12553. });
  12554. }
  12555. }
  12556. } else {
  12557. setResult(result, path, current);
  12558. }
  12559. }
  12560. function setResult(result, k, v) {
  12561. // if (type(v) != FUNCTIONTYPE) {
  12562. result[k] = v;
  12563. // }
  12564. }
  12565. function type(obj) {
  12566. return Object.prototype.toString.call(obj)
  12567. }
  12568. /* */
  12569. function flushCallbacks$1(vm) {
  12570. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  12571. if (Object({"VUE_APP_NAME":"扫码点餐","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  12572. var mpInstance = vm.$scope;
  12573. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  12574. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  12575. }
  12576. var copies = vm.__next_tick_callbacks.slice(0);
  12577. vm.__next_tick_callbacks.length = 0;
  12578. for (var i = 0; i < copies.length; i++) {
  12579. copies[i]();
  12580. }
  12581. }
  12582. }
  12583. function hasRenderWatcher(vm) {
  12584. return queue.find(function (watcher) { return vm._watcher === watcher; })
  12585. }
  12586. function nextTick$1(vm, cb) {
  12587. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  12588. //2.nextTick 之前存在 render watcher
  12589. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  12590. if(Object({"VUE_APP_NAME":"扫码点餐","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  12591. var mpInstance = vm.$scope;
  12592. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  12593. ']:nextVueTick');
  12594. }
  12595. return nextTick(cb, vm)
  12596. }else{
  12597. if(Object({"VUE_APP_NAME":"扫码点餐","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  12598. var mpInstance$1 = vm.$scope;
  12599. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  12600. ']:nextMPTick');
  12601. }
  12602. }
  12603. var _resolve;
  12604. if (!vm.__next_tick_callbacks) {
  12605. vm.__next_tick_callbacks = [];
  12606. }
  12607. vm.__next_tick_callbacks.push(function () {
  12608. if (cb) {
  12609. try {
  12610. cb.call(vm);
  12611. } catch (e) {
  12612. handleError(e, vm, 'nextTick');
  12613. }
  12614. } else if (_resolve) {
  12615. _resolve(vm);
  12616. }
  12617. });
  12618. // $flow-disable-line
  12619. if (!cb && typeof Promise !== 'undefined') {
  12620. return new Promise(function (resolve) {
  12621. _resolve = resolve;
  12622. })
  12623. }
  12624. }
  12625. /* */
  12626. function cloneWithData(vm) {
  12627. // 确保当前 vm 所有数据被同步
  12628. var ret = Object.create(null);
  12629. var dataKeys = [].concat(
  12630. Object.keys(vm._data || {}),
  12631. Object.keys(vm._computedWatchers || {}));
  12632. dataKeys.reduce(function(ret, key) {
  12633. ret[key] = vm[key];
  12634. return ret
  12635. }, ret);
  12636. // vue-composition-api
  12637. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  12638. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  12639. if (rawBindings) {
  12640. Object.keys(rawBindings).forEach(function (key) {
  12641. ret[key] = vm[key];
  12642. });
  12643. }
  12644. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  12645. Object.assign(ret, vm.$mp.data || {});
  12646. if (
  12647. Array.isArray(vm.$options.behaviors) &&
  12648. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  12649. ) { //form-field
  12650. ret['name'] = vm.name;
  12651. ret['value'] = vm.value;
  12652. }
  12653. return JSON.parse(JSON.stringify(ret))
  12654. }
  12655. var patch = function(oldVnode, vnode) {
  12656. var this$1 = this;
  12657. if (vnode === null) { //destroy
  12658. return
  12659. }
  12660. if (this.mpType === 'page' || this.mpType === 'component') {
  12661. var mpInstance = this.$scope;
  12662. var data = Object.create(null);
  12663. try {
  12664. data = cloneWithData(this);
  12665. } catch (err) {
  12666. console.error(err);
  12667. }
  12668. data.__webviewId__ = mpInstance.data.__webviewId__;
  12669. var mpData = Object.create(null);
  12670. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  12671. mpData[key] = mpInstance.data[key];
  12672. });
  12673. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  12674. if (Object.keys(diffData).length) {
  12675. if (Object({"VUE_APP_NAME":"扫码点餐","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  12676. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  12677. ']差量更新',
  12678. JSON.stringify(diffData));
  12679. }
  12680. this.__next_tick_pending = true;
  12681. mpInstance.setData(diffData, function () {
  12682. this$1.__next_tick_pending = false;
  12683. flushCallbacks$1(this$1);
  12684. });
  12685. } else {
  12686. flushCallbacks$1(this);
  12687. }
  12688. }
  12689. };
  12690. /* */
  12691. function createEmptyRender() {
  12692. }
  12693. function mountComponent$1(
  12694. vm,
  12695. el,
  12696. hydrating
  12697. ) {
  12698. if (!vm.mpType) {//main.js 中的 new Vue
  12699. return vm
  12700. }
  12701. if (vm.mpType === 'app') {
  12702. vm.$options.render = createEmptyRender;
  12703. }
  12704. if (!vm.$options.render) {
  12705. vm.$options.render = createEmptyRender;
  12706. if (true) {
  12707. /* istanbul ignore if */
  12708. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  12709. vm.$options.el || el) {
  12710. warn(
  12711. 'You are using the runtime-only build of Vue where the template ' +
  12712. 'compiler is not available. Either pre-compile the templates into ' +
  12713. 'render functions, or use the compiler-included build.',
  12714. vm
  12715. );
  12716. } else {
  12717. warn(
  12718. 'Failed to mount component: template or render function not defined.',
  12719. vm
  12720. );
  12721. }
  12722. }
  12723. }
  12724. !vm._$fallback && callHook(vm, 'beforeMount');
  12725. var updateComponent = function () {
  12726. vm._update(vm._render(), hydrating);
  12727. };
  12728. // we set this to vm._watcher inside the watcher's constructor
  12729. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  12730. // component's mounted hook), which relies on vm._watcher being already defined
  12731. new Watcher(vm, updateComponent, noop, {
  12732. before: function before() {
  12733. if (vm._isMounted && !vm._isDestroyed) {
  12734. callHook(vm, 'beforeUpdate');
  12735. }
  12736. }
  12737. }, true /* isRenderWatcher */);
  12738. hydrating = false;
  12739. return vm
  12740. }
  12741. /* */
  12742. function renderClass (
  12743. staticClass,
  12744. dynamicClass
  12745. ) {
  12746. if (isDef(staticClass) || isDef(dynamicClass)) {
  12747. return concat(staticClass, stringifyClass(dynamicClass))
  12748. }
  12749. /* istanbul ignore next */
  12750. return ''
  12751. }
  12752. function concat (a, b) {
  12753. return a ? b ? (a + ' ' + b) : a : (b || '')
  12754. }
  12755. function stringifyClass (value) {
  12756. if (Array.isArray(value)) {
  12757. return stringifyArray(value)
  12758. }
  12759. if (isObject(value)) {
  12760. return stringifyObject(value)
  12761. }
  12762. if (typeof value === 'string') {
  12763. return value
  12764. }
  12765. /* istanbul ignore next */
  12766. return ''
  12767. }
  12768. function stringifyArray (value) {
  12769. var res = '';
  12770. var stringified;
  12771. for (var i = 0, l = value.length; i < l; i++) {
  12772. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  12773. if (res) { res += ' '; }
  12774. res += stringified;
  12775. }
  12776. }
  12777. return res
  12778. }
  12779. function stringifyObject (value) {
  12780. var res = '';
  12781. for (var key in value) {
  12782. if (value[key]) {
  12783. if (res) { res += ' '; }
  12784. res += key;
  12785. }
  12786. }
  12787. return res
  12788. }
  12789. /* */
  12790. var parseStyleText = cached(function (cssText) {
  12791. var res = {};
  12792. var listDelimiter = /;(?![^(]*\))/g;
  12793. var propertyDelimiter = /:(.+)/;
  12794. cssText.split(listDelimiter).forEach(function (item) {
  12795. if (item) {
  12796. var tmp = item.split(propertyDelimiter);
  12797. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  12798. }
  12799. });
  12800. return res
  12801. });
  12802. // normalize possible array / string values into Object
  12803. function normalizeStyleBinding (bindingStyle) {
  12804. if (Array.isArray(bindingStyle)) {
  12805. return toObject(bindingStyle)
  12806. }
  12807. if (typeof bindingStyle === 'string') {
  12808. return parseStyleText(bindingStyle)
  12809. }
  12810. return bindingStyle
  12811. }
  12812. /* */
  12813. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  12814. function getTarget(obj, path) {
  12815. var parts = path.split('.');
  12816. var key = parts[0];
  12817. if (key.indexOf('__$n') === 0) { //number index
  12818. key = parseInt(key.replace('__$n', ''));
  12819. }
  12820. if (parts.length === 1) {
  12821. return obj[key]
  12822. }
  12823. return getTarget(obj[key], parts.slice(1).join('.'))
  12824. }
  12825. function internalMixin(Vue) {
  12826. Vue.config.errorHandler = function(err, vm, info) {
  12827. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  12828. console.error(err);
  12829. /* eslint-disable no-undef */
  12830. var app = typeof getApp === 'function' && getApp();
  12831. if (app && app.onError) {
  12832. app.onError(err);
  12833. }
  12834. };
  12835. var oldEmit = Vue.prototype.$emit;
  12836. Vue.prototype.$emit = function(event) {
  12837. if (this.$scope && event) {
  12838. var triggerEvent = this.$scope['_triggerEvent'] || this.$scope['triggerEvent'];
  12839. if (triggerEvent) {
  12840. triggerEvent.call(this.$scope, event, {
  12841. __args__: toArray(arguments, 1)
  12842. });
  12843. }
  12844. }
  12845. return oldEmit.apply(this, arguments)
  12846. };
  12847. Vue.prototype.$nextTick = function(fn) {
  12848. return nextTick$1(this, fn)
  12849. };
  12850. MP_METHODS.forEach(function (method) {
  12851. Vue.prototype[method] = function(args) {
  12852. if (this.$scope && this.$scope[method]) {
  12853. return this.$scope[method](args)
  12854. }
  12855. // mp-alipay
  12856. if (typeof my === 'undefined') {
  12857. return
  12858. }
  12859. if (method === 'createSelectorQuery') {
  12860. /* eslint-disable no-undef */
  12861. return my.createSelectorQuery(args)
  12862. } else if (method === 'createIntersectionObserver') {
  12863. /* eslint-disable no-undef */
  12864. return my.createIntersectionObserver(args)
  12865. }
  12866. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  12867. };
  12868. });
  12869. Vue.prototype.__init_provide = initProvide;
  12870. Vue.prototype.__init_injections = initInjections;
  12871. Vue.prototype.__call_hook = function(hook, args) {
  12872. var vm = this;
  12873. // #7573 disable dep collection when invoking lifecycle hooks
  12874. pushTarget();
  12875. var handlers = vm.$options[hook];
  12876. var info = hook + " hook";
  12877. var ret;
  12878. if (handlers) {
  12879. for (var i = 0, j = handlers.length; i < j; i++) {
  12880. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  12881. }
  12882. }
  12883. if (vm._hasHookEvent) {
  12884. vm.$emit('hook:' + hook, args);
  12885. }
  12886. popTarget();
  12887. return ret
  12888. };
  12889. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  12890. if (Array.isArray(modifiers)) {
  12891. if (modifiers.indexOf('trim') !== -1) {
  12892. value = value.trim();
  12893. }
  12894. if (modifiers.indexOf('number') !== -1) {
  12895. value = this._n(value);
  12896. }
  12897. }
  12898. if (!target) {
  12899. target = this;
  12900. }
  12901. // 解决动态属性添加
  12902. Vue.set(target, key, value);
  12903. };
  12904. Vue.prototype.__set_sync = function(target, key, value) {
  12905. if (!target) {
  12906. target = this;
  12907. }
  12908. // 解决动态属性添加
  12909. Vue.set(target, key, value);
  12910. };
  12911. Vue.prototype.__get_orig = function(item) {
  12912. if (isPlainObject(item)) {
  12913. return item['$orig'] || item
  12914. }
  12915. return item
  12916. };
  12917. Vue.prototype.__get_value = function(dataPath, target) {
  12918. return getTarget(target || this, dataPath)
  12919. };
  12920. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  12921. return renderClass(staticClass, dynamicClass)
  12922. };
  12923. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  12924. if (!dynamicStyle && !staticStyle) {
  12925. return ''
  12926. }
  12927. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  12928. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  12929. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  12930. };
  12931. Vue.prototype.__map = function(val, iteratee) {
  12932. //TODO 暂不考虑 string
  12933. var ret, i, l, keys, key;
  12934. if (Array.isArray(val)) {
  12935. ret = new Array(val.length);
  12936. for (i = 0, l = val.length; i < l; i++) {
  12937. ret[i] = iteratee(val[i], i);
  12938. }
  12939. return ret
  12940. } else if (isObject(val)) {
  12941. keys = Object.keys(val);
  12942. ret = Object.create(null);
  12943. for (i = 0, l = keys.length; i < l; i++) {
  12944. key = keys[i];
  12945. ret[key] = iteratee(val[key], key, i);
  12946. }
  12947. return ret
  12948. } else if (typeof val === 'number') {
  12949. ret = new Array(val);
  12950. for (i = 0, l = val; i < l; i++) {
  12951. // 第一个参数暂时仍和小程序一致
  12952. ret[i] = iteratee(i, i);
  12953. }
  12954. return ret
  12955. }
  12956. return []
  12957. };
  12958. }
  12959. /* */
  12960. var LIFECYCLE_HOOKS$1 = [
  12961. //App
  12962. 'onLaunch',
  12963. 'onShow',
  12964. 'onHide',
  12965. 'onUniNViewMessage',
  12966. 'onPageNotFound',
  12967. 'onThemeChange',
  12968. 'onError',
  12969. 'onUnhandledRejection',
  12970. //Page
  12971. 'onInit',
  12972. 'onLoad',
  12973. // 'onShow',
  12974. 'onReady',
  12975. // 'onHide',
  12976. 'onUnload',
  12977. 'onPullDownRefresh',
  12978. 'onReachBottom',
  12979. 'onTabItemTap',
  12980. 'onAddToFavorites',
  12981. 'onShareTimeline',
  12982. 'onShareAppMessage',
  12983. 'onResize',
  12984. 'onPageScroll',
  12985. 'onNavigationBarButtonTap',
  12986. 'onBackPress',
  12987. 'onNavigationBarSearchInputChanged',
  12988. 'onNavigationBarSearchInputConfirmed',
  12989. 'onNavigationBarSearchInputClicked',
  12990. //Component
  12991. // 'onReady', // 兼容旧版本,应该移除该事件
  12992. 'onPageShow',
  12993. 'onPageHide',
  12994. 'onPageResize',
  12995. 'onUploadDouyinVideo'
  12996. ];
  12997. function lifecycleMixin$1(Vue) {
  12998. //fixed vue-class-component
  12999. var oldExtend = Vue.extend;
  13000. Vue.extend = function(extendOptions) {
  13001. extendOptions = extendOptions || {};
  13002. var methods = extendOptions.methods;
  13003. if (methods) {
  13004. Object.keys(methods).forEach(function (methodName) {
  13005. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  13006. extendOptions[methodName] = methods[methodName];
  13007. delete methods[methodName];
  13008. }
  13009. });
  13010. }
  13011. return oldExtend.call(this, extendOptions)
  13012. };
  13013. var strategies = Vue.config.optionMergeStrategies;
  13014. var mergeHook = strategies.created;
  13015. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  13016. strategies[hook] = mergeHook;
  13017. });
  13018. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  13019. }
  13020. /* */
  13021. // install platform patch function
  13022. Vue.prototype.__patch__ = patch;
  13023. // public mount method
  13024. Vue.prototype.$mount = function(
  13025. el ,
  13026. hydrating
  13027. ) {
  13028. return mountComponent$1(this, el, hydrating)
  13029. };
  13030. lifecycleMixin$1(Vue);
  13031. internalMixin(Vue);
  13032. /* */
  13033. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  13034. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2)))
  13035. /***/ }),
  13036. /***/ 5:
  13037. /*!*******************************************!*\
  13038. !*** D:/wxproject/项目模板/uniapp/pages.json ***!
  13039. \*******************************************/
  13040. /*! no static exports found */
  13041. /***/ (function(module, exports) {
  13042. /***/ }),
  13043. /***/ 75:
  13044. /*!************************************************************************************!*\
  13045. !*** D:/wxproject/项目模板/uniapp/uni_modules/uni-icons/components/uni-icons/icons.js ***!
  13046. \************************************************************************************/
  13047. /*! no static exports found */
  13048. /***/ (function(module, exports, __webpack_require__) {
  13049. "use strict";
  13050. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  13051. "id": "2852637",
  13052. "name": "uniui图标库",
  13053. "font_family": "uniicons",
  13054. "css_prefix_text": "uniui-",
  13055. "description": "",
  13056. "glyphs": [
  13057. {
  13058. "icon_id": "25027049",
  13059. "name": "yanse",
  13060. "font_class": "color",
  13061. "unicode": "e6cf",
  13062. "unicode_decimal": 59087 },
  13063. {
  13064. "icon_id": "25027048",
  13065. "name": "wallet",
  13066. "font_class": "wallet",
  13067. "unicode": "e6b1",
  13068. "unicode_decimal": 59057 },
  13069. {
  13070. "icon_id": "25015720",
  13071. "name": "settings-filled",
  13072. "font_class": "settings-filled",
  13073. "unicode": "e6ce",
  13074. "unicode_decimal": 59086 },
  13075. {
  13076. "icon_id": "25015434",
  13077. "name": "shimingrenzheng-filled",
  13078. "font_class": "auth-filled",
  13079. "unicode": "e6cc",
  13080. "unicode_decimal": 59084 },
  13081. {
  13082. "icon_id": "24934246",
  13083. "name": "shop-filled",
  13084. "font_class": "shop-filled",
  13085. "unicode": "e6cd",
  13086. "unicode_decimal": 59085 },
  13087. {
  13088. "icon_id": "24934159",
  13089. "name": "staff-filled-01",
  13090. "font_class": "staff-filled",
  13091. "unicode": "e6cb",
  13092. "unicode_decimal": 59083 },
  13093. {
  13094. "icon_id": "24932461",
  13095. "name": "VIP-filled",
  13096. "font_class": "vip-filled",
  13097. "unicode": "e6c6",
  13098. "unicode_decimal": 59078 },
  13099. {
  13100. "icon_id": "24932462",
  13101. "name": "plus_circle_fill",
  13102. "font_class": "plus-filled",
  13103. "unicode": "e6c7",
  13104. "unicode_decimal": 59079 },
  13105. {
  13106. "icon_id": "24932463",
  13107. "name": "folder_add-filled",
  13108. "font_class": "folder-add-filled",
  13109. "unicode": "e6c8",
  13110. "unicode_decimal": 59080 },
  13111. {
  13112. "icon_id": "24932464",
  13113. "name": "yanse-filled",
  13114. "font_class": "color-filled",
  13115. "unicode": "e6c9",
  13116. "unicode_decimal": 59081 },
  13117. {
  13118. "icon_id": "24932465",
  13119. "name": "tune-filled",
  13120. "font_class": "tune-filled",
  13121. "unicode": "e6ca",
  13122. "unicode_decimal": 59082 },
  13123. {
  13124. "icon_id": "24932455",
  13125. "name": "a-rilidaka-filled",
  13126. "font_class": "calendar-filled",
  13127. "unicode": "e6c0",
  13128. "unicode_decimal": 59072 },
  13129. {
  13130. "icon_id": "24932456",
  13131. "name": "notification-filled",
  13132. "font_class": "notification-filled",
  13133. "unicode": "e6c1",
  13134. "unicode_decimal": 59073 },
  13135. {
  13136. "icon_id": "24932457",
  13137. "name": "wallet-filled",
  13138. "font_class": "wallet-filled",
  13139. "unicode": "e6c2",
  13140. "unicode_decimal": 59074 },
  13141. {
  13142. "icon_id": "24932458",
  13143. "name": "paihangbang-filled",
  13144. "font_class": "medal-filled",
  13145. "unicode": "e6c3",
  13146. "unicode_decimal": 59075 },
  13147. {
  13148. "icon_id": "24932459",
  13149. "name": "gift-filled",
  13150. "font_class": "gift-filled",
  13151. "unicode": "e6c4",
  13152. "unicode_decimal": 59076 },
  13153. {
  13154. "icon_id": "24932460",
  13155. "name": "fire-filled",
  13156. "font_class": "fire-filled",
  13157. "unicode": "e6c5",
  13158. "unicode_decimal": 59077 },
  13159. {
  13160. "icon_id": "24928001",
  13161. "name": "refreshempty",
  13162. "font_class": "refreshempty",
  13163. "unicode": "e6bf",
  13164. "unicode_decimal": 59071 },
  13165. {
  13166. "icon_id": "24926853",
  13167. "name": "location-ellipse",
  13168. "font_class": "location-filled",
  13169. "unicode": "e6af",
  13170. "unicode_decimal": 59055 },
  13171. {
  13172. "icon_id": "24926735",
  13173. "name": "person-filled",
  13174. "font_class": "person-filled",
  13175. "unicode": "e69d",
  13176. "unicode_decimal": 59037 },
  13177. {
  13178. "icon_id": "24926703",
  13179. "name": "personadd-filled",
  13180. "font_class": "personadd-filled",
  13181. "unicode": "e698",
  13182. "unicode_decimal": 59032 },
  13183. {
  13184. "icon_id": "24923351",
  13185. "name": "back",
  13186. "font_class": "back",
  13187. "unicode": "e6b9",
  13188. "unicode_decimal": 59065 },
  13189. {
  13190. "icon_id": "24923352",
  13191. "name": "forward",
  13192. "font_class": "forward",
  13193. "unicode": "e6ba",
  13194. "unicode_decimal": 59066 },
  13195. {
  13196. "icon_id": "24923353",
  13197. "name": "arrowthinright",
  13198. "font_class": "arrow-right",
  13199. "unicode": "e6bb",
  13200. "unicode_decimal": 59067 },
  13201. {
  13202. "icon_id": "24923353",
  13203. "name": "arrowthinright",
  13204. "font_class": "arrowthinright",
  13205. "unicode": "e6bb",
  13206. "unicode_decimal": 59067 },
  13207. {
  13208. "icon_id": "24923354",
  13209. "name": "arrowthinleft",
  13210. "font_class": "arrow-left",
  13211. "unicode": "e6bc",
  13212. "unicode_decimal": 59068 },
  13213. {
  13214. "icon_id": "24923354",
  13215. "name": "arrowthinleft",
  13216. "font_class": "arrowthinleft",
  13217. "unicode": "e6bc",
  13218. "unicode_decimal": 59068 },
  13219. {
  13220. "icon_id": "24923355",
  13221. "name": "arrowthinup",
  13222. "font_class": "arrow-up",
  13223. "unicode": "e6bd",
  13224. "unicode_decimal": 59069 },
  13225. {
  13226. "icon_id": "24923355",
  13227. "name": "arrowthinup",
  13228. "font_class": "arrowthinup",
  13229. "unicode": "e6bd",
  13230. "unicode_decimal": 59069 },
  13231. {
  13232. "icon_id": "24923356",
  13233. "name": "arrowthindown",
  13234. "font_class": "arrow-down",
  13235. "unicode": "e6be",
  13236. "unicode_decimal": 59070 },
  13237. {
  13238. "icon_id": "24923356",
  13239. "name": "arrowthindown",
  13240. "font_class": "arrowthindown",
  13241. "unicode": "e6be",
  13242. "unicode_decimal": 59070 },
  13243. {
  13244. "icon_id": "24923349",
  13245. "name": "arrowdown",
  13246. "font_class": "bottom",
  13247. "unicode": "e6b8",
  13248. "unicode_decimal": 59064 },
  13249. {
  13250. "icon_id": "24923349",
  13251. "name": "arrowdown",
  13252. "font_class": "arrowdown",
  13253. "unicode": "e6b8",
  13254. "unicode_decimal": 59064 },
  13255. {
  13256. "icon_id": "24923346",
  13257. "name": "arrowright",
  13258. "font_class": "right",
  13259. "unicode": "e6b5",
  13260. "unicode_decimal": 59061 },
  13261. {
  13262. "icon_id": "24923346",
  13263. "name": "arrowright",
  13264. "font_class": "arrowright",
  13265. "unicode": "e6b5",
  13266. "unicode_decimal": 59061 },
  13267. {
  13268. "icon_id": "24923347",
  13269. "name": "arrowup",
  13270. "font_class": "top",
  13271. "unicode": "e6b6",
  13272. "unicode_decimal": 59062 },
  13273. {
  13274. "icon_id": "24923347",
  13275. "name": "arrowup",
  13276. "font_class": "arrowup",
  13277. "unicode": "e6b6",
  13278. "unicode_decimal": 59062 },
  13279. {
  13280. "icon_id": "24923348",
  13281. "name": "arrowleft",
  13282. "font_class": "left",
  13283. "unicode": "e6b7",
  13284. "unicode_decimal": 59063 },
  13285. {
  13286. "icon_id": "24923348",
  13287. "name": "arrowleft",
  13288. "font_class": "arrowleft",
  13289. "unicode": "e6b7",
  13290. "unicode_decimal": 59063 },
  13291. {
  13292. "icon_id": "24923334",
  13293. "name": "eye",
  13294. "font_class": "eye",
  13295. "unicode": "e651",
  13296. "unicode_decimal": 58961 },
  13297. {
  13298. "icon_id": "24923335",
  13299. "name": "eye-filled",
  13300. "font_class": "eye-filled",
  13301. "unicode": "e66a",
  13302. "unicode_decimal": 58986 },
  13303. {
  13304. "icon_id": "24923336",
  13305. "name": "eye-slash",
  13306. "font_class": "eye-slash",
  13307. "unicode": "e6b3",
  13308. "unicode_decimal": 59059 },
  13309. {
  13310. "icon_id": "24923337",
  13311. "name": "eye-slash-filled",
  13312. "font_class": "eye-slash-filled",
  13313. "unicode": "e6b4",
  13314. "unicode_decimal": 59060 },
  13315. {
  13316. "icon_id": "24923305",
  13317. "name": "info-filled",
  13318. "font_class": "info-filled",
  13319. "unicode": "e649",
  13320. "unicode_decimal": 58953 },
  13321. {
  13322. "icon_id": "24923299",
  13323. "name": "reload-01",
  13324. "font_class": "reload",
  13325. "unicode": "e6b2",
  13326. "unicode_decimal": 59058 },
  13327. {
  13328. "icon_id": "24923195",
  13329. "name": "mic_slash_fill",
  13330. "font_class": "micoff-filled",
  13331. "unicode": "e6b0",
  13332. "unicode_decimal": 59056 },
  13333. {
  13334. "icon_id": "24923165",
  13335. "name": "map-pin-ellipse",
  13336. "font_class": "map-pin-ellipse",
  13337. "unicode": "e6ac",
  13338. "unicode_decimal": 59052 },
  13339. {
  13340. "icon_id": "24923166",
  13341. "name": "map-pin",
  13342. "font_class": "map-pin",
  13343. "unicode": "e6ad",
  13344. "unicode_decimal": 59053 },
  13345. {
  13346. "icon_id": "24923167",
  13347. "name": "location",
  13348. "font_class": "location",
  13349. "unicode": "e6ae",
  13350. "unicode_decimal": 59054 },
  13351. {
  13352. "icon_id": "24923064",
  13353. "name": "starhalf",
  13354. "font_class": "starhalf",
  13355. "unicode": "e683",
  13356. "unicode_decimal": 59011 },
  13357. {
  13358. "icon_id": "24923065",
  13359. "name": "star",
  13360. "font_class": "star",
  13361. "unicode": "e688",
  13362. "unicode_decimal": 59016 },
  13363. {
  13364. "icon_id": "24923066",
  13365. "name": "star-filled",
  13366. "font_class": "star-filled",
  13367. "unicode": "e68f",
  13368. "unicode_decimal": 59023 },
  13369. {
  13370. "icon_id": "24899646",
  13371. "name": "a-rilidaka",
  13372. "font_class": "calendar",
  13373. "unicode": "e6a0",
  13374. "unicode_decimal": 59040 },
  13375. {
  13376. "icon_id": "24899647",
  13377. "name": "fire",
  13378. "font_class": "fire",
  13379. "unicode": "e6a1",
  13380. "unicode_decimal": 59041 },
  13381. {
  13382. "icon_id": "24899648",
  13383. "name": "paihangbang",
  13384. "font_class": "medal",
  13385. "unicode": "e6a2",
  13386. "unicode_decimal": 59042 },
  13387. {
  13388. "icon_id": "24899649",
  13389. "name": "font",
  13390. "font_class": "font",
  13391. "unicode": "e6a3",
  13392. "unicode_decimal": 59043 },
  13393. {
  13394. "icon_id": "24899650",
  13395. "name": "gift",
  13396. "font_class": "gift",
  13397. "unicode": "e6a4",
  13398. "unicode_decimal": 59044 },
  13399. {
  13400. "icon_id": "24899651",
  13401. "name": "link",
  13402. "font_class": "link",
  13403. "unicode": "e6a5",
  13404. "unicode_decimal": 59045 },
  13405. {
  13406. "icon_id": "24899652",
  13407. "name": "notification",
  13408. "font_class": "notification",
  13409. "unicode": "e6a6",
  13410. "unicode_decimal": 59046 },
  13411. {
  13412. "icon_id": "24899653",
  13413. "name": "staff",
  13414. "font_class": "staff",
  13415. "unicode": "e6a7",
  13416. "unicode_decimal": 59047 },
  13417. {
  13418. "icon_id": "24899654",
  13419. "name": "VIP",
  13420. "font_class": "vip",
  13421. "unicode": "e6a8",
  13422. "unicode_decimal": 59048 },
  13423. {
  13424. "icon_id": "24899655",
  13425. "name": "folder_add",
  13426. "font_class": "folder-add",
  13427. "unicode": "e6a9",
  13428. "unicode_decimal": 59049 },
  13429. {
  13430. "icon_id": "24899656",
  13431. "name": "tune",
  13432. "font_class": "tune",
  13433. "unicode": "e6aa",
  13434. "unicode_decimal": 59050 },
  13435. {
  13436. "icon_id": "24899657",
  13437. "name": "shimingrenzheng",
  13438. "font_class": "auth",
  13439. "unicode": "e6ab",
  13440. "unicode_decimal": 59051 },
  13441. {
  13442. "icon_id": "24899565",
  13443. "name": "person",
  13444. "font_class": "person",
  13445. "unicode": "e699",
  13446. "unicode_decimal": 59033 },
  13447. {
  13448. "icon_id": "24899566",
  13449. "name": "email-filled",
  13450. "font_class": "email-filled",
  13451. "unicode": "e69a",
  13452. "unicode_decimal": 59034 },
  13453. {
  13454. "icon_id": "24899567",
  13455. "name": "phone-filled",
  13456. "font_class": "phone-filled",
  13457. "unicode": "e69b",
  13458. "unicode_decimal": 59035 },
  13459. {
  13460. "icon_id": "24899568",
  13461. "name": "phone",
  13462. "font_class": "phone",
  13463. "unicode": "e69c",
  13464. "unicode_decimal": 59036 },
  13465. {
  13466. "icon_id": "24899570",
  13467. "name": "email",
  13468. "font_class": "email",
  13469. "unicode": "e69e",
  13470. "unicode_decimal": 59038 },
  13471. {
  13472. "icon_id": "24899571",
  13473. "name": "personadd",
  13474. "font_class": "personadd",
  13475. "unicode": "e69f",
  13476. "unicode_decimal": 59039 },
  13477. {
  13478. "icon_id": "24899558",
  13479. "name": "chatboxes-filled",
  13480. "font_class": "chatboxes-filled",
  13481. "unicode": "e692",
  13482. "unicode_decimal": 59026 },
  13483. {
  13484. "icon_id": "24899559",
  13485. "name": "contact",
  13486. "font_class": "contact",
  13487. "unicode": "e693",
  13488. "unicode_decimal": 59027 },
  13489. {
  13490. "icon_id": "24899560",
  13491. "name": "chatbubble-filled",
  13492. "font_class": "chatbubble-filled",
  13493. "unicode": "e694",
  13494. "unicode_decimal": 59028 },
  13495. {
  13496. "icon_id": "24899561",
  13497. "name": "contact-filled",
  13498. "font_class": "contact-filled",
  13499. "unicode": "e695",
  13500. "unicode_decimal": 59029 },
  13501. {
  13502. "icon_id": "24899562",
  13503. "name": "chatboxes",
  13504. "font_class": "chatboxes",
  13505. "unicode": "e696",
  13506. "unicode_decimal": 59030 },
  13507. {
  13508. "icon_id": "24899563",
  13509. "name": "chatbubble",
  13510. "font_class": "chatbubble",
  13511. "unicode": "e697",
  13512. "unicode_decimal": 59031 },
  13513. {
  13514. "icon_id": "24881290",
  13515. "name": "upload-filled",
  13516. "font_class": "upload-filled",
  13517. "unicode": "e68e",
  13518. "unicode_decimal": 59022 },
  13519. {
  13520. "icon_id": "24881292",
  13521. "name": "upload",
  13522. "font_class": "upload",
  13523. "unicode": "e690",
  13524. "unicode_decimal": 59024 },
  13525. {
  13526. "icon_id": "24881293",
  13527. "name": "weixin",
  13528. "font_class": "weixin",
  13529. "unicode": "e691",
  13530. "unicode_decimal": 59025 },
  13531. {
  13532. "icon_id": "24881274",
  13533. "name": "compose",
  13534. "font_class": "compose",
  13535. "unicode": "e67f",
  13536. "unicode_decimal": 59007 },
  13537. {
  13538. "icon_id": "24881275",
  13539. "name": "qq",
  13540. "font_class": "qq",
  13541. "unicode": "e680",
  13542. "unicode_decimal": 59008 },
  13543. {
  13544. "icon_id": "24881276",
  13545. "name": "download-filled",
  13546. "font_class": "download-filled",
  13547. "unicode": "e681",
  13548. "unicode_decimal": 59009 },
  13549. {
  13550. "icon_id": "24881277",
  13551. "name": "pengyouquan",
  13552. "font_class": "pyq",
  13553. "unicode": "e682",
  13554. "unicode_decimal": 59010 },
  13555. {
  13556. "icon_id": "24881279",
  13557. "name": "sound",
  13558. "font_class": "sound",
  13559. "unicode": "e684",
  13560. "unicode_decimal": 59012 },
  13561. {
  13562. "icon_id": "24881280",
  13563. "name": "trash-filled",
  13564. "font_class": "trash-filled",
  13565. "unicode": "e685",
  13566. "unicode_decimal": 59013 },
  13567. {
  13568. "icon_id": "24881281",
  13569. "name": "sound-filled",
  13570. "font_class": "sound-filled",
  13571. "unicode": "e686",
  13572. "unicode_decimal": 59014 },
  13573. {
  13574. "icon_id": "24881282",
  13575. "name": "trash",
  13576. "font_class": "trash",
  13577. "unicode": "e687",
  13578. "unicode_decimal": 59015 },
  13579. {
  13580. "icon_id": "24881284",
  13581. "name": "videocam-filled",
  13582. "font_class": "videocam-filled",
  13583. "unicode": "e689",
  13584. "unicode_decimal": 59017 },
  13585. {
  13586. "icon_id": "24881285",
  13587. "name": "spinner-cycle",
  13588. "font_class": "spinner-cycle",
  13589. "unicode": "e68a",
  13590. "unicode_decimal": 59018 },
  13591. {
  13592. "icon_id": "24881286",
  13593. "name": "weibo",
  13594. "font_class": "weibo",
  13595. "unicode": "e68b",
  13596. "unicode_decimal": 59019 },
  13597. {
  13598. "icon_id": "24881288",
  13599. "name": "videocam",
  13600. "font_class": "videocam",
  13601. "unicode": "e68c",
  13602. "unicode_decimal": 59020 },
  13603. {
  13604. "icon_id": "24881289",
  13605. "name": "download",
  13606. "font_class": "download",
  13607. "unicode": "e68d",
  13608. "unicode_decimal": 59021 },
  13609. {
  13610. "icon_id": "24879601",
  13611. "name": "help",
  13612. "font_class": "help",
  13613. "unicode": "e679",
  13614. "unicode_decimal": 59001 },
  13615. {
  13616. "icon_id": "24879602",
  13617. "name": "navigate-filled",
  13618. "font_class": "navigate-filled",
  13619. "unicode": "e67a",
  13620. "unicode_decimal": 59002 },
  13621. {
  13622. "icon_id": "24879603",
  13623. "name": "plusempty",
  13624. "font_class": "plusempty",
  13625. "unicode": "e67b",
  13626. "unicode_decimal": 59003 },
  13627. {
  13628. "icon_id": "24879604",
  13629. "name": "smallcircle",
  13630. "font_class": "smallcircle",
  13631. "unicode": "e67c",
  13632. "unicode_decimal": 59004 },
  13633. {
  13634. "icon_id": "24879605",
  13635. "name": "minus-filled",
  13636. "font_class": "minus-filled",
  13637. "unicode": "e67d",
  13638. "unicode_decimal": 59005 },
  13639. {
  13640. "icon_id": "24879606",
  13641. "name": "micoff",
  13642. "font_class": "micoff",
  13643. "unicode": "e67e",
  13644. "unicode_decimal": 59006 },
  13645. {
  13646. "icon_id": "24879588",
  13647. "name": "closeempty",
  13648. "font_class": "closeempty",
  13649. "unicode": "e66c",
  13650. "unicode_decimal": 58988 },
  13651. {
  13652. "icon_id": "24879589",
  13653. "name": "clear",
  13654. "font_class": "clear",
  13655. "unicode": "e66d",
  13656. "unicode_decimal": 58989 },
  13657. {
  13658. "icon_id": "24879590",
  13659. "name": "navigate",
  13660. "font_class": "navigate",
  13661. "unicode": "e66e",
  13662. "unicode_decimal": 58990 },
  13663. {
  13664. "icon_id": "24879591",
  13665. "name": "minus",
  13666. "font_class": "minus",
  13667. "unicode": "e66f",
  13668. "unicode_decimal": 58991 },
  13669. {
  13670. "icon_id": "24879592",
  13671. "name": "image",
  13672. "font_class": "image",
  13673. "unicode": "e670",
  13674. "unicode_decimal": 58992 },
  13675. {
  13676. "icon_id": "24879593",
  13677. "name": "mic",
  13678. "font_class": "mic",
  13679. "unicode": "e671",
  13680. "unicode_decimal": 58993 },
  13681. {
  13682. "icon_id": "24879594",
  13683. "name": "paperplane",
  13684. "font_class": "paperplane",
  13685. "unicode": "e672",
  13686. "unicode_decimal": 58994 },
  13687. {
  13688. "icon_id": "24879595",
  13689. "name": "close",
  13690. "font_class": "close",
  13691. "unicode": "e673",
  13692. "unicode_decimal": 58995 },
  13693. {
  13694. "icon_id": "24879596",
  13695. "name": "help-filled",
  13696. "font_class": "help-filled",
  13697. "unicode": "e674",
  13698. "unicode_decimal": 58996 },
  13699. {
  13700. "icon_id": "24879597",
  13701. "name": "plus-filled",
  13702. "font_class": "paperplane-filled",
  13703. "unicode": "e675",
  13704. "unicode_decimal": 58997 },
  13705. {
  13706. "icon_id": "24879598",
  13707. "name": "plus",
  13708. "font_class": "plus",
  13709. "unicode": "e676",
  13710. "unicode_decimal": 58998 },
  13711. {
  13712. "icon_id": "24879599",
  13713. "name": "mic-filled",
  13714. "font_class": "mic-filled",
  13715. "unicode": "e677",
  13716. "unicode_decimal": 58999 },
  13717. {
  13718. "icon_id": "24879600",
  13719. "name": "image-filled",
  13720. "font_class": "image-filled",
  13721. "unicode": "e678",
  13722. "unicode_decimal": 59000 },
  13723. {
  13724. "icon_id": "24855900",
  13725. "name": "locked-filled",
  13726. "font_class": "locked-filled",
  13727. "unicode": "e668",
  13728. "unicode_decimal": 58984 },
  13729. {
  13730. "icon_id": "24855901",
  13731. "name": "info",
  13732. "font_class": "info",
  13733. "unicode": "e669",
  13734. "unicode_decimal": 58985 },
  13735. {
  13736. "icon_id": "24855903",
  13737. "name": "locked",
  13738. "font_class": "locked",
  13739. "unicode": "e66b",
  13740. "unicode_decimal": 58987 },
  13741. {
  13742. "icon_id": "24855884",
  13743. "name": "camera-filled",
  13744. "font_class": "camera-filled",
  13745. "unicode": "e658",
  13746. "unicode_decimal": 58968 },
  13747. {
  13748. "icon_id": "24855885",
  13749. "name": "chat-filled",
  13750. "font_class": "chat-filled",
  13751. "unicode": "e659",
  13752. "unicode_decimal": 58969 },
  13753. {
  13754. "icon_id": "24855886",
  13755. "name": "camera",
  13756. "font_class": "camera",
  13757. "unicode": "e65a",
  13758. "unicode_decimal": 58970 },
  13759. {
  13760. "icon_id": "24855887",
  13761. "name": "circle",
  13762. "font_class": "circle",
  13763. "unicode": "e65b",
  13764. "unicode_decimal": 58971 },
  13765. {
  13766. "icon_id": "24855888",
  13767. "name": "checkmarkempty",
  13768. "font_class": "checkmarkempty",
  13769. "unicode": "e65c",
  13770. "unicode_decimal": 58972 },
  13771. {
  13772. "icon_id": "24855889",
  13773. "name": "chat",
  13774. "font_class": "chat",
  13775. "unicode": "e65d",
  13776. "unicode_decimal": 58973 },
  13777. {
  13778. "icon_id": "24855890",
  13779. "name": "circle-filled",
  13780. "font_class": "circle-filled",
  13781. "unicode": "e65e",
  13782. "unicode_decimal": 58974 },
  13783. {
  13784. "icon_id": "24855891",
  13785. "name": "flag",
  13786. "font_class": "flag",
  13787. "unicode": "e65f",
  13788. "unicode_decimal": 58975 },
  13789. {
  13790. "icon_id": "24855892",
  13791. "name": "flag-filled",
  13792. "font_class": "flag-filled",
  13793. "unicode": "e660",
  13794. "unicode_decimal": 58976 },
  13795. {
  13796. "icon_id": "24855893",
  13797. "name": "gear-filled",
  13798. "font_class": "gear-filled",
  13799. "unicode": "e661",
  13800. "unicode_decimal": 58977 },
  13801. {
  13802. "icon_id": "24855894",
  13803. "name": "home",
  13804. "font_class": "home",
  13805. "unicode": "e662",
  13806. "unicode_decimal": 58978 },
  13807. {
  13808. "icon_id": "24855895",
  13809. "name": "home-filled",
  13810. "font_class": "home-filled",
  13811. "unicode": "e663",
  13812. "unicode_decimal": 58979 },
  13813. {
  13814. "icon_id": "24855896",
  13815. "name": "gear",
  13816. "font_class": "gear",
  13817. "unicode": "e664",
  13818. "unicode_decimal": 58980 },
  13819. {
  13820. "icon_id": "24855897",
  13821. "name": "smallcircle-filled",
  13822. "font_class": "smallcircle-filled",
  13823. "unicode": "e665",
  13824. "unicode_decimal": 58981 },
  13825. {
  13826. "icon_id": "24855898",
  13827. "name": "map-filled",
  13828. "font_class": "map-filled",
  13829. "unicode": "e666",
  13830. "unicode_decimal": 58982 },
  13831. {
  13832. "icon_id": "24855899",
  13833. "name": "map",
  13834. "font_class": "map",
  13835. "unicode": "e667",
  13836. "unicode_decimal": 58983 },
  13837. {
  13838. "icon_id": "24855825",
  13839. "name": "refresh-filled",
  13840. "font_class": "refresh-filled",
  13841. "unicode": "e656",
  13842. "unicode_decimal": 58966 },
  13843. {
  13844. "icon_id": "24855826",
  13845. "name": "refresh",
  13846. "font_class": "refresh",
  13847. "unicode": "e657",
  13848. "unicode_decimal": 58967 },
  13849. {
  13850. "icon_id": "24855808",
  13851. "name": "cloud-upload",
  13852. "font_class": "cloud-upload",
  13853. "unicode": "e645",
  13854. "unicode_decimal": 58949 },
  13855. {
  13856. "icon_id": "24855809",
  13857. "name": "cloud-download-filled",
  13858. "font_class": "cloud-download-filled",
  13859. "unicode": "e646",
  13860. "unicode_decimal": 58950 },
  13861. {
  13862. "icon_id": "24855810",
  13863. "name": "cloud-download",
  13864. "font_class": "cloud-download",
  13865. "unicode": "e647",
  13866. "unicode_decimal": 58951 },
  13867. {
  13868. "icon_id": "24855811",
  13869. "name": "cloud-upload-filled",
  13870. "font_class": "cloud-upload-filled",
  13871. "unicode": "e648",
  13872. "unicode_decimal": 58952 },
  13873. {
  13874. "icon_id": "24855813",
  13875. "name": "redo",
  13876. "font_class": "redo",
  13877. "unicode": "e64a",
  13878. "unicode_decimal": 58954 },
  13879. {
  13880. "icon_id": "24855814",
  13881. "name": "images-filled",
  13882. "font_class": "images-filled",
  13883. "unicode": "e64b",
  13884. "unicode_decimal": 58955 },
  13885. {
  13886. "icon_id": "24855815",
  13887. "name": "undo-filled",
  13888. "font_class": "undo-filled",
  13889. "unicode": "e64c",
  13890. "unicode_decimal": 58956 },
  13891. {
  13892. "icon_id": "24855816",
  13893. "name": "more",
  13894. "font_class": "more",
  13895. "unicode": "e64d",
  13896. "unicode_decimal": 58957 },
  13897. {
  13898. "icon_id": "24855817",
  13899. "name": "more-filled",
  13900. "font_class": "more-filled",
  13901. "unicode": "e64e",
  13902. "unicode_decimal": 58958 },
  13903. {
  13904. "icon_id": "24855818",
  13905. "name": "undo",
  13906. "font_class": "undo",
  13907. "unicode": "e64f",
  13908. "unicode_decimal": 58959 },
  13909. {
  13910. "icon_id": "24855819",
  13911. "name": "images",
  13912. "font_class": "images",
  13913. "unicode": "e650",
  13914. "unicode_decimal": 58960 },
  13915. {
  13916. "icon_id": "24855821",
  13917. "name": "paperclip",
  13918. "font_class": "paperclip",
  13919. "unicode": "e652",
  13920. "unicode_decimal": 58962 },
  13921. {
  13922. "icon_id": "24855822",
  13923. "name": "settings",
  13924. "font_class": "settings",
  13925. "unicode": "e653",
  13926. "unicode_decimal": 58963 },
  13927. {
  13928. "icon_id": "24855823",
  13929. "name": "search",
  13930. "font_class": "search",
  13931. "unicode": "e654",
  13932. "unicode_decimal": 58964 },
  13933. {
  13934. "icon_id": "24855824",
  13935. "name": "redo-filled",
  13936. "font_class": "redo-filled",
  13937. "unicode": "e655",
  13938. "unicode_decimal": 58965 },
  13939. {
  13940. "icon_id": "24841702",
  13941. "name": "list",
  13942. "font_class": "list",
  13943. "unicode": "e644",
  13944. "unicode_decimal": 58948 },
  13945. {
  13946. "icon_id": "24841489",
  13947. "name": "mail-open-filled",
  13948. "font_class": "mail-open-filled",
  13949. "unicode": "e63a",
  13950. "unicode_decimal": 58938 },
  13951. {
  13952. "icon_id": "24841491",
  13953. "name": "hand-thumbsdown-filled",
  13954. "font_class": "hand-down-filled",
  13955. "unicode": "e63c",
  13956. "unicode_decimal": 58940 },
  13957. {
  13958. "icon_id": "24841492",
  13959. "name": "hand-thumbsdown",
  13960. "font_class": "hand-down",
  13961. "unicode": "e63d",
  13962. "unicode_decimal": 58941 },
  13963. {
  13964. "icon_id": "24841493",
  13965. "name": "hand-thumbsup-filled",
  13966. "font_class": "hand-up-filled",
  13967. "unicode": "e63e",
  13968. "unicode_decimal": 58942 },
  13969. {
  13970. "icon_id": "24841494",
  13971. "name": "hand-thumbsup",
  13972. "font_class": "hand-up",
  13973. "unicode": "e63f",
  13974. "unicode_decimal": 58943 },
  13975. {
  13976. "icon_id": "24841496",
  13977. "name": "heart-filled",
  13978. "font_class": "heart-filled",
  13979. "unicode": "e641",
  13980. "unicode_decimal": 58945 },
  13981. {
  13982. "icon_id": "24841498",
  13983. "name": "mail-open",
  13984. "font_class": "mail-open",
  13985. "unicode": "e643",
  13986. "unicode_decimal": 58947 },
  13987. {
  13988. "icon_id": "24841488",
  13989. "name": "heart",
  13990. "font_class": "heart",
  13991. "unicode": "e639",
  13992. "unicode_decimal": 58937 },
  13993. {
  13994. "icon_id": "24839963",
  13995. "name": "loop",
  13996. "font_class": "loop",
  13997. "unicode": "e633",
  13998. "unicode_decimal": 58931 },
  13999. {
  14000. "icon_id": "24839866",
  14001. "name": "pulldown",
  14002. "font_class": "pulldown",
  14003. "unicode": "e632",
  14004. "unicode_decimal": 58930 },
  14005. {
  14006. "icon_id": "24813798",
  14007. "name": "scan",
  14008. "font_class": "scan",
  14009. "unicode": "e62a",
  14010. "unicode_decimal": 58922 },
  14011. {
  14012. "icon_id": "24813786",
  14013. "name": "bars",
  14014. "font_class": "bars",
  14015. "unicode": "e627",
  14016. "unicode_decimal": 58919 },
  14017. {
  14018. "icon_id": "24813788",
  14019. "name": "cart-filled",
  14020. "font_class": "cart-filled",
  14021. "unicode": "e629",
  14022. "unicode_decimal": 58921 },
  14023. {
  14024. "icon_id": "24813790",
  14025. "name": "checkbox",
  14026. "font_class": "checkbox",
  14027. "unicode": "e62b",
  14028. "unicode_decimal": 58923 },
  14029. {
  14030. "icon_id": "24813791",
  14031. "name": "checkbox-filled",
  14032. "font_class": "checkbox-filled",
  14033. "unicode": "e62c",
  14034. "unicode_decimal": 58924 },
  14035. {
  14036. "icon_id": "24813794",
  14037. "name": "shop",
  14038. "font_class": "shop",
  14039. "unicode": "e62f",
  14040. "unicode_decimal": 58927 },
  14041. {
  14042. "icon_id": "24813795",
  14043. "name": "headphones",
  14044. "font_class": "headphones",
  14045. "unicode": "e630",
  14046. "unicode_decimal": 58928 },
  14047. {
  14048. "icon_id": "24813796",
  14049. "name": "cart",
  14050. "font_class": "cart",
  14051. "unicode": "e631",
  14052. "unicode_decimal": 58929 }] };exports.default = _default;
  14053. /***/ }),
  14054. /***/ 97:
  14055. /*!********************************************************************************************************!*\
  14056. !*** D:/wxproject/项目模板/uniapp/uni_modules/uni-transition/components/uni-transition/createAnimation.js ***!
  14057. \********************************************************************************************************/
  14058. /*! no static exports found */
  14059. /***/ (function(module, exports, __webpack_require__) {
  14060. "use strict";
  14061. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.createAnimation = createAnimation;function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;} // const defaultOption = {
  14062. // duration: 300,
  14063. // timingFunction: 'linear',
  14064. // delay: 0,
  14065. // transformOrigin: '50% 50% 0'
  14066. // }
  14067. var
  14068. MPAnimation = /*#__PURE__*/function () {
  14069. function MPAnimation(options, _this) {_classCallCheck(this, MPAnimation);
  14070. this.options = options;
  14071. this.animation = uni.createAnimation(options);
  14072. this.currentStepAnimates = {};
  14073. this.next = 0;
  14074. this.$ = _this;
  14075. }_createClass(MPAnimation, [{ key: "_nvuePushAnimates", value: function _nvuePushAnimates(
  14076. type, args) {
  14077. var aniObj = this.currentStepAnimates[this.next];
  14078. var styles = {};
  14079. if (!aniObj) {
  14080. styles = {
  14081. styles: {},
  14082. config: {} };
  14083. } else {
  14084. styles = aniObj;
  14085. }
  14086. if (animateTypes1.includes(type)) {
  14087. if (!styles.styles.transform) {
  14088. styles.styles.transform = '';
  14089. }
  14090. var unit = '';
  14091. if (type === 'rotate') {
  14092. unit = 'deg';
  14093. }
  14094. styles.styles.transform += "".concat(type, "(").concat(args + unit, ") ");
  14095. } else {
  14096. styles.styles[type] = "".concat(args);
  14097. }
  14098. this.currentStepAnimates[this.next] = styles;
  14099. } }, { key: "_animateRun", value: function _animateRun()
  14100. {var styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  14101. var ref = this.$.$refs['ani'].ref;
  14102. if (!ref) return;
  14103. return new Promise(function (resolve, reject) {
  14104. nvueAnimation.transition(ref, _objectSpread({
  14105. styles: styles },
  14106. config),
  14107. function (res) {
  14108. resolve();
  14109. });
  14110. });
  14111. } }, { key: "_nvueNextAnimate", value: function _nvueNextAnimate(
  14112. animates) {var _this2 = this;var step = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;var fn = arguments.length > 2 ? arguments[2] : undefined;
  14113. var obj = animates[step];
  14114. if (obj) {var
  14115. styles =
  14116. obj.styles,config = obj.config;
  14117. this._animateRun(styles, config).then(function () {
  14118. step += 1;
  14119. _this2._nvueNextAnimate(animates, step, fn);
  14120. });
  14121. } else {
  14122. this.currentStepAnimates = {};
  14123. typeof fn === 'function' && fn();
  14124. this.isEnd = true;
  14125. }
  14126. } }, { key: "step", value: function step()
  14127. {var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  14128. this.animation.step(config);
  14129. return this;
  14130. } }, { key: "run", value: function run(
  14131. fn) {
  14132. this.$.animationData = this.animation.export();
  14133. this.$.timer = setTimeout(function () {
  14134. typeof fn === 'function' && fn();
  14135. }, this.$.durationTime);
  14136. } }]);return MPAnimation;}();
  14137. var animateTypes1 = ['matrix', 'matrix3d', 'rotate', 'rotate3d', 'rotateX', 'rotateY', 'rotateZ', 'scale', 'scale3d',
  14138. 'scaleX', 'scaleY', 'scaleZ', 'skew', 'skewX', 'skewY', 'translate', 'translate3d', 'translateX', 'translateY',
  14139. 'translateZ'];
  14140. var animateTypes2 = ['opacity', 'backgroundColor'];
  14141. var animateTypes3 = ['width', 'height', 'left', 'right', 'top', 'bottom'];
  14142. animateTypes1.concat(animateTypes2, animateTypes3).forEach(function (type) {
  14143. MPAnimation.prototype[type] = function () {var _this$animation;
  14144. (_this$animation = this.animation)[type].apply(_this$animation, arguments);
  14145. return this;
  14146. };
  14147. });
  14148. function createAnimation(option, _this) {
  14149. if (!_this) return;
  14150. clearTimeout(_this.timer);
  14151. return new MPAnimation(option, _this);
  14152. }
  14153. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  14154. /***/ })
  14155. }]);
  14156. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map