vendor.js 239 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762
  1. "use strict";
  2. /**
  3. * @vue/shared v3.4.21
  4. * (c) 2018-present Yuxi (Evan) You and Vue contributors
  5. * @license MIT
  6. **/
  7. function makeMap(str, expectsLowerCase) {
  8. const set2 = new Set(str.split(","));
  9. return expectsLowerCase ? (val) => set2.has(val.toLowerCase()) : (val) => set2.has(val);
  10. }
  11. const EMPTY_OBJ = Object.freeze({});
  12. const EMPTY_ARR = Object.freeze([]);
  13. const NOOP = () => {
  14. };
  15. const NO = () => false;
  16. const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
  17. (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
  18. const isModelListener = (key) => key.startsWith("onUpdate:");
  19. const extend = Object.assign;
  20. const remove = (arr, el) => {
  21. const i = arr.indexOf(el);
  22. if (i > -1) {
  23. arr.splice(i, 1);
  24. }
  25. };
  26. const hasOwnProperty$2 = Object.prototype.hasOwnProperty;
  27. const hasOwn$1 = (val, key) => hasOwnProperty$2.call(val, key);
  28. const isArray = Array.isArray;
  29. const isMap = (val) => toTypeString(val) === "[object Map]";
  30. const isSet = (val) => toTypeString(val) === "[object Set]";
  31. const isFunction = (val) => typeof val === "function";
  32. const isString = (val) => typeof val === "string";
  33. const isSymbol = (val) => typeof val === "symbol";
  34. const isObject$1 = (val) => val !== null && typeof val === "object";
  35. const isPromise = (val) => {
  36. return (isObject$1(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
  37. };
  38. const objectToString = Object.prototype.toString;
  39. const toTypeString = (value) => objectToString.call(value);
  40. const toRawType = (value) => {
  41. return toTypeString(value).slice(8, -1);
  42. };
  43. const isPlainObject = (val) => toTypeString(val) === "[object Object]";
  44. const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
  45. const isReservedProp = /* @__PURE__ */ makeMap(
  46. // the leading comma is intentional so empty string "" is also included
  47. ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
  48. );
  49. const isBuiltInDirective = /* @__PURE__ */ makeMap(
  50. "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
  51. );
  52. const cacheStringFunction = (fn) => {
  53. const cache = /* @__PURE__ */ Object.create(null);
  54. return (str) => {
  55. const hit = cache[str];
  56. return hit || (cache[str] = fn(str));
  57. };
  58. };
  59. const camelizeRE = /-(\w)/g;
  60. const camelize = cacheStringFunction((str) => {
  61. return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
  62. });
  63. const hyphenateRE = /\B([A-Z])/g;
  64. const hyphenate = cacheStringFunction(
  65. (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
  66. );
  67. const capitalize = cacheStringFunction((str) => {
  68. return str.charAt(0).toUpperCase() + str.slice(1);
  69. });
  70. const toHandlerKey = cacheStringFunction((str) => {
  71. const s2 = str ? `on${capitalize(str)}` : ``;
  72. return s2;
  73. });
  74. const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
  75. const invokeArrayFns$1 = (fns, arg) => {
  76. for (let i = 0; i < fns.length; i++) {
  77. fns[i](arg);
  78. }
  79. };
  80. const def = (obj, key, value) => {
  81. Object.defineProperty(obj, key, {
  82. configurable: true,
  83. enumerable: false,
  84. value
  85. });
  86. };
  87. const looseToNumber = (val) => {
  88. const n2 = parseFloat(val);
  89. return isNaN(n2) ? val : n2;
  90. };
  91. function normalizeStyle(value) {
  92. if (isArray(value)) {
  93. const res = {};
  94. for (let i = 0; i < value.length; i++) {
  95. const item = value[i];
  96. const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
  97. if (normalized) {
  98. for (const key in normalized) {
  99. res[key] = normalized[key];
  100. }
  101. }
  102. }
  103. return res;
  104. } else if (isString(value) || isObject$1(value)) {
  105. return value;
  106. }
  107. }
  108. const listDelimiterRE = /;(?![^(]*\))/g;
  109. const propertyDelimiterRE = /:([^]+)/;
  110. const styleCommentRE = /\/\*[^]*?\*\//g;
  111. function parseStringStyle(cssText) {
  112. const ret = {};
  113. cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
  114. if (item) {
  115. const tmp = item.split(propertyDelimiterRE);
  116. tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
  117. }
  118. });
  119. return ret;
  120. }
  121. function normalizeClass(value) {
  122. let res = "";
  123. if (isString(value)) {
  124. res = value;
  125. } else if (isArray(value)) {
  126. for (let i = 0; i < value.length; i++) {
  127. const normalized = normalizeClass(value[i]);
  128. if (normalized) {
  129. res += normalized + " ";
  130. }
  131. }
  132. } else if (isObject$1(value)) {
  133. for (const name in value) {
  134. if (value[name]) {
  135. res += name + " ";
  136. }
  137. }
  138. }
  139. return res.trim();
  140. }
  141. const toDisplayString = (val) => {
  142. return isString(val) ? val : val == null ? "" : isArray(val) || isObject$1(val) && (val.toString === objectToString || !isFunction(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val);
  143. };
  144. const replacer = (_key, val) => {
  145. if (val && val.__v_isRef) {
  146. return replacer(_key, val.value);
  147. } else if (isMap(val)) {
  148. return {
  149. [`Map(${val.size})`]: [...val.entries()].reduce(
  150. (entries, [key, val2], i) => {
  151. entries[stringifySymbol(key, i) + " =>"] = val2;
  152. return entries;
  153. },
  154. {}
  155. )
  156. };
  157. } else if (isSet(val)) {
  158. return {
  159. [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
  160. };
  161. } else if (isSymbol(val)) {
  162. return stringifySymbol(val);
  163. } else if (isObject$1(val) && !isArray(val) && !isPlainObject(val)) {
  164. return String(val);
  165. }
  166. return val;
  167. };
  168. const stringifySymbol = (v, i = "") => {
  169. var _a;
  170. return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;
  171. };
  172. const SLOT_DEFAULT_NAME = "d";
  173. const ON_SHOW = "onShow";
  174. const ON_HIDE = "onHide";
  175. const ON_LAUNCH = "onLaunch";
  176. const ON_ERROR = "onError";
  177. const ON_THEME_CHANGE = "onThemeChange";
  178. const ON_PAGE_NOT_FOUND = "onPageNotFound";
  179. const ON_UNHANDLE_REJECTION = "onUnhandledRejection";
  180. const ON_EXIT = "onExit";
  181. const ON_LOAD = "onLoad";
  182. const ON_READY = "onReady";
  183. const ON_UNLOAD = "onUnload";
  184. const ON_INIT = "onInit";
  185. const ON_SAVE_EXIT_STATE = "onSaveExitState";
  186. const ON_RESIZE = "onResize";
  187. const ON_BACK_PRESS = "onBackPress";
  188. const ON_PAGE_SCROLL = "onPageScroll";
  189. const ON_TAB_ITEM_TAP = "onTabItemTap";
  190. const ON_REACH_BOTTOM = "onReachBottom";
  191. const ON_PULL_DOWN_REFRESH = "onPullDownRefresh";
  192. const ON_SHARE_TIMELINE = "onShareTimeline";
  193. const ON_SHARE_CHAT = "onShareChat";
  194. const ON_ADD_TO_FAVORITES = "onAddToFavorites";
  195. const ON_SHARE_APP_MESSAGE = "onShareAppMessage";
  196. const ON_NAVIGATION_BAR_BUTTON_TAP = "onNavigationBarButtonTap";
  197. const ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED = "onNavigationBarSearchInputClicked";
  198. const ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED = "onNavigationBarSearchInputChanged";
  199. const ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED = "onNavigationBarSearchInputConfirmed";
  200. const ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED = "onNavigationBarSearchInputFocusChanged";
  201. const VIRTUAL_HOST_STYLE = "virtualHostStyle";
  202. const VIRTUAL_HOST_CLASS = "virtualHostClass";
  203. const VIRTUAL_HOST_HIDDEN = "virtualHostHidden";
  204. const VIRTUAL_HOST_ID = "virtualHostId";
  205. function hasLeadingSlash(str) {
  206. return str.indexOf("/") === 0;
  207. }
  208. function addLeadingSlash(str) {
  209. return hasLeadingSlash(str) ? str : "/" + str;
  210. }
  211. const invokeArrayFns = (fns, arg) => {
  212. let ret;
  213. for (let i = 0; i < fns.length; i++) {
  214. ret = fns[i](arg);
  215. }
  216. return ret;
  217. };
  218. function once(fn, ctx = null) {
  219. let res;
  220. return (...args) => {
  221. if (fn) {
  222. res = fn.apply(ctx, args);
  223. fn = null;
  224. }
  225. return res;
  226. };
  227. }
  228. function getValueByDataPath(obj, path) {
  229. if (!isString(path)) {
  230. return;
  231. }
  232. path = path.replace(/\[(\d+)\]/g, ".$1");
  233. const parts = path.split(".");
  234. let key = parts[0];
  235. if (!obj) {
  236. obj = {};
  237. }
  238. if (parts.length === 1) {
  239. return obj[key];
  240. }
  241. return getValueByDataPath(obj[key], parts.slice(1).join("."));
  242. }
  243. const customizeRE = /:/g;
  244. function customizeEvent(str) {
  245. return camelize(str.replace(customizeRE, "-"));
  246. }
  247. const encode = encodeURIComponent;
  248. function stringifyQuery(obj, encodeStr = encode) {
  249. const res = obj ? Object.keys(obj).map((key) => {
  250. let val = obj[key];
  251. if (typeof val === void 0 || val === null) {
  252. val = "";
  253. } else if (isPlainObject(val)) {
  254. val = JSON.stringify(val);
  255. }
  256. return encodeStr(key) + "=" + encodeStr(val);
  257. }).filter((x) => x.length > 0).join("&") : null;
  258. return res ? `?${res}` : "";
  259. }
  260. class EventChannel {
  261. constructor(id2, events) {
  262. this.id = id2;
  263. this.listener = {};
  264. this.emitCache = [];
  265. if (events) {
  266. Object.keys(events).forEach((name) => {
  267. this.on(name, events[name]);
  268. });
  269. }
  270. }
  271. emit(eventName, ...args) {
  272. const fns = this.listener[eventName];
  273. if (!fns) {
  274. return this.emitCache.push({
  275. eventName,
  276. args
  277. });
  278. }
  279. fns.forEach((opt) => {
  280. opt.fn.apply(opt.fn, args);
  281. });
  282. this.listener[eventName] = fns.filter((opt) => opt.type !== "once");
  283. }
  284. on(eventName, fn) {
  285. this._addListener(eventName, "on", fn);
  286. this._clearCache(eventName);
  287. }
  288. once(eventName, fn) {
  289. this._addListener(eventName, "once", fn);
  290. this._clearCache(eventName);
  291. }
  292. off(eventName, fn) {
  293. const fns = this.listener[eventName];
  294. if (!fns) {
  295. return;
  296. }
  297. if (fn) {
  298. for (let i = 0; i < fns.length; ) {
  299. if (fns[i].fn === fn) {
  300. fns.splice(i, 1);
  301. i--;
  302. }
  303. i++;
  304. }
  305. } else {
  306. delete this.listener[eventName];
  307. }
  308. }
  309. _clearCache(eventName) {
  310. for (let index2 = 0; index2 < this.emitCache.length; index2++) {
  311. const cache2 = this.emitCache[index2];
  312. const _name = eventName ? cache2.eventName === eventName ? eventName : null : cache2.eventName;
  313. if (!_name)
  314. continue;
  315. const location = this.emit.apply(this, [_name, ...cache2.args]);
  316. if (typeof location === "number") {
  317. this.emitCache.pop();
  318. continue;
  319. }
  320. this.emitCache.splice(index2, 1);
  321. index2--;
  322. }
  323. }
  324. _addListener(eventName, type, fn) {
  325. (this.listener[eventName] || (this.listener[eventName] = [])).push({
  326. fn,
  327. type
  328. });
  329. }
  330. }
  331. const PAGE_HOOKS = [
  332. ON_INIT,
  333. ON_LOAD,
  334. ON_SHOW,
  335. ON_HIDE,
  336. ON_UNLOAD,
  337. ON_BACK_PRESS,
  338. ON_PAGE_SCROLL,
  339. ON_TAB_ITEM_TAP,
  340. ON_REACH_BOTTOM,
  341. ON_PULL_DOWN_REFRESH,
  342. ON_SHARE_TIMELINE,
  343. ON_SHARE_APP_MESSAGE,
  344. ON_SHARE_CHAT,
  345. ON_ADD_TO_FAVORITES,
  346. ON_SAVE_EXIT_STATE,
  347. ON_NAVIGATION_BAR_BUTTON_TAP,
  348. ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED,
  349. ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED,
  350. ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED,
  351. ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
  352. ];
  353. function isRootHook(name) {
  354. return PAGE_HOOKS.indexOf(name) > -1;
  355. }
  356. const UniLifecycleHooks = [
  357. ON_SHOW,
  358. ON_HIDE,
  359. ON_LAUNCH,
  360. ON_ERROR,
  361. ON_THEME_CHANGE,
  362. ON_PAGE_NOT_FOUND,
  363. ON_UNHANDLE_REJECTION,
  364. ON_EXIT,
  365. ON_INIT,
  366. ON_LOAD,
  367. ON_READY,
  368. ON_UNLOAD,
  369. ON_RESIZE,
  370. ON_BACK_PRESS,
  371. ON_PAGE_SCROLL,
  372. ON_TAB_ITEM_TAP,
  373. ON_REACH_BOTTOM,
  374. ON_PULL_DOWN_REFRESH,
  375. ON_SHARE_TIMELINE,
  376. ON_ADD_TO_FAVORITES,
  377. ON_SHARE_APP_MESSAGE,
  378. ON_SHARE_CHAT,
  379. ON_SAVE_EXIT_STATE,
  380. ON_NAVIGATION_BAR_BUTTON_TAP,
  381. ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED,
  382. ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED,
  383. ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED,
  384. ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
  385. ];
  386. const MINI_PROGRAM_PAGE_RUNTIME_HOOKS = /* @__PURE__ */ (() => {
  387. return {
  388. onPageScroll: 1,
  389. onShareAppMessage: 1 << 1,
  390. onShareTimeline: 1 << 2
  391. };
  392. })();
  393. function isUniLifecycleHook(name, value, checkType = true) {
  394. if (checkType && !isFunction(value)) {
  395. return false;
  396. }
  397. if (UniLifecycleHooks.indexOf(name) > -1) {
  398. return true;
  399. } else if (name.indexOf("on") === 0) {
  400. return true;
  401. }
  402. return false;
  403. }
  404. let vueApp;
  405. const createVueAppHooks = [];
  406. function onCreateVueApp(hook) {
  407. if (vueApp) {
  408. return hook(vueApp);
  409. }
  410. createVueAppHooks.push(hook);
  411. }
  412. function invokeCreateVueAppHook(app) {
  413. vueApp = app;
  414. createVueAppHooks.forEach((hook) => hook(app));
  415. }
  416. const invokeCreateErrorHandler = once((app, createErrorHandler2) => {
  417. return createErrorHandler2(app);
  418. });
  419. const E = function() {
  420. };
  421. E.prototype = {
  422. _id: 1,
  423. on: function(name, callback, ctx) {
  424. var e2 = this.e || (this.e = {});
  425. (e2[name] || (e2[name] = [])).push({
  426. fn: callback,
  427. ctx,
  428. _id: this._id
  429. });
  430. return this._id++;
  431. },
  432. once: function(name, callback, ctx) {
  433. var self2 = this;
  434. function listener() {
  435. self2.off(name, listener);
  436. callback.apply(ctx, arguments);
  437. }
  438. listener._ = callback;
  439. return this.on(name, listener, ctx);
  440. },
  441. emit: function(name) {
  442. var data = [].slice.call(arguments, 1);
  443. var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
  444. var i = 0;
  445. var len = evtArr.length;
  446. for (i; i < len; i++) {
  447. evtArr[i].fn.apply(evtArr[i].ctx, data);
  448. }
  449. return this;
  450. },
  451. off: function(name, event) {
  452. var e2 = this.e || (this.e = {});
  453. var evts = e2[name];
  454. var liveEvents = [];
  455. if (evts && event) {
  456. for (var i = evts.length - 1; i >= 0; i--) {
  457. if (evts[i].fn === event || evts[i].fn._ === event || evts[i]._id === event) {
  458. evts.splice(i, 1);
  459. break;
  460. }
  461. }
  462. liveEvents = evts;
  463. }
  464. liveEvents.length ? e2[name] = liveEvents : delete e2[name];
  465. return this;
  466. }
  467. };
  468. var E$1 = E;
  469. const isObject = (val) => val !== null && typeof val === "object";
  470. const defaultDelimiters = ["{", "}"];
  471. class BaseFormatter {
  472. constructor() {
  473. this._caches = /* @__PURE__ */ Object.create(null);
  474. }
  475. interpolate(message, values, delimiters = defaultDelimiters) {
  476. if (!values) {
  477. return [message];
  478. }
  479. let tokens = this._caches[message];
  480. if (!tokens) {
  481. tokens = parse$1(message, delimiters);
  482. this._caches[message] = tokens;
  483. }
  484. return compile$1(tokens, values);
  485. }
  486. }
  487. const RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  488. const RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  489. function parse$1(format, [startDelimiter, endDelimiter]) {
  490. const tokens = [];
  491. let position = 0;
  492. let text = "";
  493. while (position < format.length) {
  494. let char = format[position++];
  495. if (char === startDelimiter) {
  496. if (text) {
  497. tokens.push({ type: "text", value: text });
  498. }
  499. text = "";
  500. let sub = "";
  501. char = format[position++];
  502. while (char !== void 0 && char !== endDelimiter) {
  503. sub += char;
  504. char = format[position++];
  505. }
  506. const isClosed = char === endDelimiter;
  507. const type = RE_TOKEN_LIST_VALUE.test(sub) ? "list" : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? "named" : "unknown";
  508. tokens.push({ value: sub, type });
  509. } else {
  510. text += char;
  511. }
  512. }
  513. text && tokens.push({ type: "text", value: text });
  514. return tokens;
  515. }
  516. function compile$1(tokens, values) {
  517. const compiled = [];
  518. let index2 = 0;
  519. const mode = Array.isArray(values) ? "list" : isObject(values) ? "named" : "unknown";
  520. if (mode === "unknown") {
  521. return compiled;
  522. }
  523. while (index2 < tokens.length) {
  524. const token = tokens[index2];
  525. switch (token.type) {
  526. case "text":
  527. compiled.push(token.value);
  528. break;
  529. case "list":
  530. compiled.push(values[parseInt(token.value, 10)]);
  531. break;
  532. case "named":
  533. if (mode === "named") {
  534. compiled.push(values[token.value]);
  535. } else {
  536. {
  537. console.warn(`Type of token '${token.type}' and format of value '${mode}' don't match!`);
  538. }
  539. }
  540. break;
  541. case "unknown":
  542. {
  543. console.warn(`Detect 'unknown' type of token!`);
  544. }
  545. break;
  546. }
  547. index2++;
  548. }
  549. return compiled;
  550. }
  551. const LOCALE_ZH_HANS = "zh-Hans";
  552. const LOCALE_ZH_HANT = "zh-Hant";
  553. const LOCALE_EN = "en";
  554. const LOCALE_FR = "fr";
  555. const LOCALE_ES = "es";
  556. const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
  557. const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
  558. const defaultFormatter = new BaseFormatter();
  559. function include(str, parts) {
  560. return !!parts.find((part) => str.indexOf(part) !== -1);
  561. }
  562. function startsWith(str, parts) {
  563. return parts.find((part) => str.indexOf(part) === 0);
  564. }
  565. function normalizeLocale(locale, messages) {
  566. if (!locale) {
  567. return;
  568. }
  569. locale = locale.trim().replace(/_/g, "-");
  570. if (messages && messages[locale]) {
  571. return locale;
  572. }
  573. locale = locale.toLowerCase();
  574. if (locale === "chinese") {
  575. return LOCALE_ZH_HANS;
  576. }
  577. if (locale.indexOf("zh") === 0) {
  578. if (locale.indexOf("-hans") > -1) {
  579. return LOCALE_ZH_HANS;
  580. }
  581. if (locale.indexOf("-hant") > -1) {
  582. return LOCALE_ZH_HANT;
  583. }
  584. if (include(locale, ["-tw", "-hk", "-mo", "-cht"])) {
  585. return LOCALE_ZH_HANT;
  586. }
  587. return LOCALE_ZH_HANS;
  588. }
  589. let locales = [LOCALE_EN, LOCALE_FR, LOCALE_ES];
  590. if (messages && Object.keys(messages).length > 0) {
  591. locales = Object.keys(messages);
  592. }
  593. const lang = startsWith(locale, locales);
  594. if (lang) {
  595. return lang;
  596. }
  597. }
  598. class I18n {
  599. constructor({ locale, fallbackLocale, messages, watcher, formater: formater2 }) {
  600. this.locale = LOCALE_EN;
  601. this.fallbackLocale = LOCALE_EN;
  602. this.message = {};
  603. this.messages = {};
  604. this.watchers = [];
  605. if (fallbackLocale) {
  606. this.fallbackLocale = fallbackLocale;
  607. }
  608. this.formater = formater2 || defaultFormatter;
  609. this.messages = messages || {};
  610. this.setLocale(locale || LOCALE_EN);
  611. if (watcher) {
  612. this.watchLocale(watcher);
  613. }
  614. }
  615. setLocale(locale) {
  616. const oldLocale = this.locale;
  617. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  618. if (!this.messages[this.locale]) {
  619. this.messages[this.locale] = {};
  620. }
  621. this.message = this.messages[this.locale];
  622. if (oldLocale !== this.locale) {
  623. this.watchers.forEach((watcher) => {
  624. watcher(this.locale, oldLocale);
  625. });
  626. }
  627. }
  628. getLocale() {
  629. return this.locale;
  630. }
  631. watchLocale(fn) {
  632. const index2 = this.watchers.push(fn) - 1;
  633. return () => {
  634. this.watchers.splice(index2, 1);
  635. };
  636. }
  637. add(locale, message, override = true) {
  638. const curMessages = this.messages[locale];
  639. if (curMessages) {
  640. if (override) {
  641. Object.assign(curMessages, message);
  642. } else {
  643. Object.keys(message).forEach((key) => {
  644. if (!hasOwn(curMessages, key)) {
  645. curMessages[key] = message[key];
  646. }
  647. });
  648. }
  649. } else {
  650. this.messages[locale] = message;
  651. }
  652. }
  653. f(message, values, delimiters) {
  654. return this.formater.interpolate(message, values, delimiters).join("");
  655. }
  656. t(key, locale, values) {
  657. let message = this.message;
  658. if (typeof locale === "string") {
  659. locale = normalizeLocale(locale, this.messages);
  660. locale && (message = this.messages[locale]);
  661. } else {
  662. values = locale;
  663. }
  664. if (!hasOwn(message, key)) {
  665. console.warn(`Cannot translate the value of keypath ${key}. Use the value of keypath as default.`);
  666. return key;
  667. }
  668. return this.formater.interpolate(message[key], values).join("");
  669. }
  670. }
  671. function watchAppLocale(appVm, i18n) {
  672. if (appVm.$watchLocale) {
  673. appVm.$watchLocale((newLocale) => {
  674. i18n.setLocale(newLocale);
  675. });
  676. } else {
  677. appVm.$watch(() => appVm.$locale, (newLocale) => {
  678. i18n.setLocale(newLocale);
  679. });
  680. }
  681. }
  682. function getDefaultLocale() {
  683. if (typeof index !== "undefined" && index.getLocale) {
  684. return index.getLocale();
  685. }
  686. if (typeof global !== "undefined" && global.getLocale) {
  687. return global.getLocale();
  688. }
  689. return LOCALE_EN;
  690. }
  691. function initVueI18n(locale, messages = {}, fallbackLocale, watcher) {
  692. if (typeof locale !== "string") {
  693. const options = [
  694. messages,
  695. locale
  696. ];
  697. locale = options[0];
  698. messages = options[1];
  699. }
  700. if (typeof locale !== "string") {
  701. locale = getDefaultLocale();
  702. }
  703. if (typeof fallbackLocale !== "string") {
  704. fallbackLocale = typeof __uniConfig !== "undefined" && __uniConfig.fallbackLocale || LOCALE_EN;
  705. }
  706. const i18n = new I18n({
  707. locale,
  708. fallbackLocale,
  709. messages,
  710. watcher
  711. });
  712. let t2 = (key, values) => {
  713. if (typeof getApp !== "function") {
  714. t2 = function(key2, values2) {
  715. return i18n.t(key2, values2);
  716. };
  717. } else {
  718. let isWatchedAppLocale = false;
  719. t2 = function(key2, values2) {
  720. const appVm = getApp().$vm;
  721. if (appVm) {
  722. appVm.$locale;
  723. if (!isWatchedAppLocale) {
  724. isWatchedAppLocale = true;
  725. watchAppLocale(appVm, i18n);
  726. }
  727. }
  728. return i18n.t(key2, values2);
  729. };
  730. }
  731. return t2(key, values);
  732. };
  733. return {
  734. i18n,
  735. f(message, values, delimiters) {
  736. return i18n.f(message, values, delimiters);
  737. },
  738. t(key, values) {
  739. return t2(key, values);
  740. },
  741. add(locale2, message, override = true) {
  742. return i18n.add(locale2, message, override);
  743. },
  744. watch(fn) {
  745. return i18n.watchLocale(fn);
  746. },
  747. getLocale() {
  748. return i18n.getLocale();
  749. },
  750. setLocale(newLocale) {
  751. return i18n.setLocale(newLocale);
  752. }
  753. };
  754. }
  755. /**
  756. * @dcloudio/uni-mp-vue v3.4.21
  757. * (c) 2018-present Yuxi (Evan) You and Vue contributors
  758. * @license MIT
  759. **/
  760. function warn$2(msg, ...args) {
  761. console.warn(`[Vue warn] ${msg}`, ...args);
  762. }
  763. let activeEffectScope;
  764. class EffectScope {
  765. constructor(detached = false) {
  766. this.detached = detached;
  767. this._active = true;
  768. this.effects = [];
  769. this.cleanups = [];
  770. this.parent = activeEffectScope;
  771. if (!detached && activeEffectScope) {
  772. this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
  773. this
  774. ) - 1;
  775. }
  776. }
  777. get active() {
  778. return this._active;
  779. }
  780. run(fn) {
  781. if (this._active) {
  782. const currentEffectScope = activeEffectScope;
  783. try {
  784. activeEffectScope = this;
  785. return fn();
  786. } finally {
  787. activeEffectScope = currentEffectScope;
  788. }
  789. } else {
  790. warn$2(`cannot run an inactive effect scope.`);
  791. }
  792. }
  793. /**
  794. * This should only be called on non-detached scopes
  795. * @internal
  796. */
  797. on() {
  798. activeEffectScope = this;
  799. }
  800. /**
  801. * This should only be called on non-detached scopes
  802. * @internal
  803. */
  804. off() {
  805. activeEffectScope = this.parent;
  806. }
  807. stop(fromParent) {
  808. if (this._active) {
  809. let i, l;
  810. for (i = 0, l = this.effects.length; i < l; i++) {
  811. this.effects[i].stop();
  812. }
  813. for (i = 0, l = this.cleanups.length; i < l; i++) {
  814. this.cleanups[i]();
  815. }
  816. if (this.scopes) {
  817. for (i = 0, l = this.scopes.length; i < l; i++) {
  818. this.scopes[i].stop(true);
  819. }
  820. }
  821. if (!this.detached && this.parent && !fromParent) {
  822. const last = this.parent.scopes.pop();
  823. if (last && last !== this) {
  824. this.parent.scopes[this.index] = last;
  825. last.index = this.index;
  826. }
  827. }
  828. this.parent = void 0;
  829. this._active = false;
  830. }
  831. }
  832. }
  833. function recordEffectScope(effect2, scope = activeEffectScope) {
  834. if (scope && scope.active) {
  835. scope.effects.push(effect2);
  836. }
  837. }
  838. function getCurrentScope() {
  839. return activeEffectScope;
  840. }
  841. let activeEffect;
  842. class ReactiveEffect {
  843. constructor(fn, trigger2, scheduler, scope) {
  844. this.fn = fn;
  845. this.trigger = trigger2;
  846. this.scheduler = scheduler;
  847. this.active = true;
  848. this.deps = [];
  849. this._dirtyLevel = 4;
  850. this._trackId = 0;
  851. this._runnings = 0;
  852. this._shouldSchedule = false;
  853. this._depsLength = 0;
  854. recordEffectScope(this, scope);
  855. }
  856. get dirty() {
  857. if (this._dirtyLevel === 2 || this._dirtyLevel === 3) {
  858. this._dirtyLevel = 1;
  859. pauseTracking();
  860. for (let i = 0; i < this._depsLength; i++) {
  861. const dep = this.deps[i];
  862. if (dep.computed) {
  863. triggerComputed(dep.computed);
  864. if (this._dirtyLevel >= 4) {
  865. break;
  866. }
  867. }
  868. }
  869. if (this._dirtyLevel === 1) {
  870. this._dirtyLevel = 0;
  871. }
  872. resetTracking();
  873. }
  874. return this._dirtyLevel >= 4;
  875. }
  876. set dirty(v) {
  877. this._dirtyLevel = v ? 4 : 0;
  878. }
  879. run() {
  880. this._dirtyLevel = 0;
  881. if (!this.active) {
  882. return this.fn();
  883. }
  884. let lastShouldTrack = shouldTrack;
  885. let lastEffect = activeEffect;
  886. try {
  887. shouldTrack = true;
  888. activeEffect = this;
  889. this._runnings++;
  890. preCleanupEffect(this);
  891. return this.fn();
  892. } finally {
  893. postCleanupEffect(this);
  894. this._runnings--;
  895. activeEffect = lastEffect;
  896. shouldTrack = lastShouldTrack;
  897. }
  898. }
  899. stop() {
  900. var _a;
  901. if (this.active) {
  902. preCleanupEffect(this);
  903. postCleanupEffect(this);
  904. (_a = this.onStop) == null ? void 0 : _a.call(this);
  905. this.active = false;
  906. }
  907. }
  908. }
  909. function triggerComputed(computed2) {
  910. return computed2.value;
  911. }
  912. function preCleanupEffect(effect2) {
  913. effect2._trackId++;
  914. effect2._depsLength = 0;
  915. }
  916. function postCleanupEffect(effect2) {
  917. if (effect2.deps.length > effect2._depsLength) {
  918. for (let i = effect2._depsLength; i < effect2.deps.length; i++) {
  919. cleanupDepEffect(effect2.deps[i], effect2);
  920. }
  921. effect2.deps.length = effect2._depsLength;
  922. }
  923. }
  924. function cleanupDepEffect(dep, effect2) {
  925. const trackId = dep.get(effect2);
  926. if (trackId !== void 0 && effect2._trackId !== trackId) {
  927. dep.delete(effect2);
  928. if (dep.size === 0) {
  929. dep.cleanup();
  930. }
  931. }
  932. }
  933. let shouldTrack = true;
  934. let pauseScheduleStack = 0;
  935. const trackStack = [];
  936. function pauseTracking() {
  937. trackStack.push(shouldTrack);
  938. shouldTrack = false;
  939. }
  940. function resetTracking() {
  941. const last = trackStack.pop();
  942. shouldTrack = last === void 0 ? true : last;
  943. }
  944. function pauseScheduling() {
  945. pauseScheduleStack++;
  946. }
  947. function resetScheduling() {
  948. pauseScheduleStack--;
  949. while (!pauseScheduleStack && queueEffectSchedulers.length) {
  950. queueEffectSchedulers.shift()();
  951. }
  952. }
  953. function trackEffect(effect2, dep, debuggerEventExtraInfo) {
  954. var _a;
  955. if (dep.get(effect2) !== effect2._trackId) {
  956. dep.set(effect2, effect2._trackId);
  957. const oldDep = effect2.deps[effect2._depsLength];
  958. if (oldDep !== dep) {
  959. if (oldDep) {
  960. cleanupDepEffect(oldDep, effect2);
  961. }
  962. effect2.deps[effect2._depsLength++] = dep;
  963. } else {
  964. effect2._depsLength++;
  965. }
  966. {
  967. (_a = effect2.onTrack) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
  968. }
  969. }
  970. }
  971. const queueEffectSchedulers = [];
  972. function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
  973. var _a;
  974. pauseScheduling();
  975. for (const effect2 of dep.keys()) {
  976. let tracking;
  977. if (effect2._dirtyLevel < dirtyLevel && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
  978. effect2._shouldSchedule || (effect2._shouldSchedule = effect2._dirtyLevel === 0);
  979. effect2._dirtyLevel = dirtyLevel;
  980. }
  981. if (effect2._shouldSchedule && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
  982. {
  983. (_a = effect2.onTrigger) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
  984. }
  985. effect2.trigger();
  986. if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 2) {
  987. effect2._shouldSchedule = false;
  988. if (effect2.scheduler) {
  989. queueEffectSchedulers.push(effect2.scheduler);
  990. }
  991. }
  992. }
  993. }
  994. resetScheduling();
  995. }
  996. const createDep = (cleanup, computed2) => {
  997. const dep = /* @__PURE__ */ new Map();
  998. dep.cleanup = cleanup;
  999. dep.computed = computed2;
  1000. return dep;
  1001. };
  1002. const targetMap = /* @__PURE__ */ new WeakMap();
  1003. const ITERATE_KEY = Symbol("iterate");
  1004. const MAP_KEY_ITERATE_KEY = Symbol("Map key iterate");
  1005. function track(target, type, key) {
  1006. if (shouldTrack && activeEffect) {
  1007. let depsMap = targetMap.get(target);
  1008. if (!depsMap) {
  1009. targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
  1010. }
  1011. let dep = depsMap.get(key);
  1012. if (!dep) {
  1013. depsMap.set(key, dep = createDep(() => depsMap.delete(key)));
  1014. }
  1015. trackEffect(
  1016. activeEffect,
  1017. dep,
  1018. {
  1019. target,
  1020. type,
  1021. key
  1022. }
  1023. );
  1024. }
  1025. }
  1026. function trigger(target, type, key, newValue, oldValue, oldTarget) {
  1027. const depsMap = targetMap.get(target);
  1028. if (!depsMap) {
  1029. return;
  1030. }
  1031. let deps = [];
  1032. if (type === "clear") {
  1033. deps = [...depsMap.values()];
  1034. } else if (key === "length" && isArray(target)) {
  1035. const newLength = Number(newValue);
  1036. depsMap.forEach((dep, key2) => {
  1037. if (key2 === "length" || !isSymbol(key2) && key2 >= newLength) {
  1038. deps.push(dep);
  1039. }
  1040. });
  1041. } else {
  1042. if (key !== void 0) {
  1043. deps.push(depsMap.get(key));
  1044. }
  1045. switch (type) {
  1046. case "add":
  1047. if (!isArray(target)) {
  1048. deps.push(depsMap.get(ITERATE_KEY));
  1049. if (isMap(target)) {
  1050. deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
  1051. }
  1052. } else if (isIntegerKey(key)) {
  1053. deps.push(depsMap.get("length"));
  1054. }
  1055. break;
  1056. case "delete":
  1057. if (!isArray(target)) {
  1058. deps.push(depsMap.get(ITERATE_KEY));
  1059. if (isMap(target)) {
  1060. deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
  1061. }
  1062. }
  1063. break;
  1064. case "set":
  1065. if (isMap(target)) {
  1066. deps.push(depsMap.get(ITERATE_KEY));
  1067. }
  1068. break;
  1069. }
  1070. }
  1071. pauseScheduling();
  1072. for (const dep of deps) {
  1073. if (dep) {
  1074. triggerEffects(
  1075. dep,
  1076. 4,
  1077. {
  1078. target,
  1079. type,
  1080. key,
  1081. newValue,
  1082. oldValue,
  1083. oldTarget
  1084. }
  1085. );
  1086. }
  1087. }
  1088. resetScheduling();
  1089. }
  1090. const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
  1091. const builtInSymbols = new Set(
  1092. /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
  1093. );
  1094. const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
  1095. function createArrayInstrumentations() {
  1096. const instrumentations = {};
  1097. ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
  1098. instrumentations[key] = function(...args) {
  1099. const arr = toRaw(this);
  1100. for (let i = 0, l = this.length; i < l; i++) {
  1101. track(arr, "get", i + "");
  1102. }
  1103. const res = arr[key](...args);
  1104. if (res === -1 || res === false) {
  1105. return arr[key](...args.map(toRaw));
  1106. } else {
  1107. return res;
  1108. }
  1109. };
  1110. });
  1111. ["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
  1112. instrumentations[key] = function(...args) {
  1113. pauseTracking();
  1114. pauseScheduling();
  1115. const res = toRaw(this)[key].apply(this, args);
  1116. resetScheduling();
  1117. resetTracking();
  1118. return res;
  1119. };
  1120. });
  1121. return instrumentations;
  1122. }
  1123. function hasOwnProperty(key) {
  1124. const obj = toRaw(this);
  1125. track(obj, "has", key);
  1126. return obj.hasOwnProperty(key);
  1127. }
  1128. class BaseReactiveHandler {
  1129. constructor(_isReadonly = false, _isShallow = false) {
  1130. this._isReadonly = _isReadonly;
  1131. this._isShallow = _isShallow;
  1132. }
  1133. get(target, key, receiver) {
  1134. const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
  1135. if (key === "__v_isReactive") {
  1136. return !isReadonly2;
  1137. } else if (key === "__v_isReadonly") {
  1138. return isReadonly2;
  1139. } else if (key === "__v_isShallow") {
  1140. return isShallow2;
  1141. } else if (key === "__v_raw") {
  1142. if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
  1143. // this means the reciever is a user proxy of the reactive proxy
  1144. Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
  1145. return target;
  1146. }
  1147. return;
  1148. }
  1149. const targetIsArray = isArray(target);
  1150. if (!isReadonly2) {
  1151. if (targetIsArray && hasOwn$1(arrayInstrumentations, key)) {
  1152. return Reflect.get(arrayInstrumentations, key, receiver);
  1153. }
  1154. if (key === "hasOwnProperty") {
  1155. return hasOwnProperty;
  1156. }
  1157. }
  1158. const res = Reflect.get(target, key, receiver);
  1159. if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
  1160. return res;
  1161. }
  1162. if (!isReadonly2) {
  1163. track(target, "get", key);
  1164. }
  1165. if (isShallow2) {
  1166. return res;
  1167. }
  1168. if (isRef(res)) {
  1169. return targetIsArray && isIntegerKey(key) ? res : res.value;
  1170. }
  1171. if (isObject$1(res)) {
  1172. return isReadonly2 ? readonly(res) : reactive(res);
  1173. }
  1174. return res;
  1175. }
  1176. }
  1177. class MutableReactiveHandler extends BaseReactiveHandler {
  1178. constructor(isShallow2 = false) {
  1179. super(false, isShallow2);
  1180. }
  1181. set(target, key, value, receiver) {
  1182. let oldValue = target[key];
  1183. if (!this._isShallow) {
  1184. const isOldValueReadonly = isReadonly(oldValue);
  1185. if (!isShallow(value) && !isReadonly(value)) {
  1186. oldValue = toRaw(oldValue);
  1187. value = toRaw(value);
  1188. }
  1189. if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
  1190. if (isOldValueReadonly) {
  1191. return false;
  1192. } else {
  1193. oldValue.value = value;
  1194. return true;
  1195. }
  1196. }
  1197. }
  1198. const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn$1(target, key);
  1199. const result = Reflect.set(target, key, value, receiver);
  1200. if (target === toRaw(receiver)) {
  1201. if (!hadKey) {
  1202. trigger(target, "add", key, value);
  1203. } else if (hasChanged(value, oldValue)) {
  1204. trigger(target, "set", key, value, oldValue);
  1205. }
  1206. }
  1207. return result;
  1208. }
  1209. deleteProperty(target, key) {
  1210. const hadKey = hasOwn$1(target, key);
  1211. const oldValue = target[key];
  1212. const result = Reflect.deleteProperty(target, key);
  1213. if (result && hadKey) {
  1214. trigger(target, "delete", key, void 0, oldValue);
  1215. }
  1216. return result;
  1217. }
  1218. has(target, key) {
  1219. const result = Reflect.has(target, key);
  1220. if (!isSymbol(key) || !builtInSymbols.has(key)) {
  1221. track(target, "has", key);
  1222. }
  1223. return result;
  1224. }
  1225. ownKeys(target) {
  1226. track(
  1227. target,
  1228. "iterate",
  1229. isArray(target) ? "length" : ITERATE_KEY
  1230. );
  1231. return Reflect.ownKeys(target);
  1232. }
  1233. }
  1234. class ReadonlyReactiveHandler extends BaseReactiveHandler {
  1235. constructor(isShallow2 = false) {
  1236. super(true, isShallow2);
  1237. }
  1238. set(target, key) {
  1239. {
  1240. warn$2(
  1241. `Set operation on key "${String(key)}" failed: target is readonly.`,
  1242. target
  1243. );
  1244. }
  1245. return true;
  1246. }
  1247. deleteProperty(target, key) {
  1248. {
  1249. warn$2(
  1250. `Delete operation on key "${String(key)}" failed: target is readonly.`,
  1251. target
  1252. );
  1253. }
  1254. return true;
  1255. }
  1256. }
  1257. const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
  1258. const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
  1259. const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(
  1260. true
  1261. );
  1262. const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
  1263. const toShallow = (value) => value;
  1264. const getProto = (v) => Reflect.getPrototypeOf(v);
  1265. function get(target, key, isReadonly2 = false, isShallow2 = false) {
  1266. target = target["__v_raw"];
  1267. const rawTarget = toRaw(target);
  1268. const rawKey = toRaw(key);
  1269. if (!isReadonly2) {
  1270. if (hasChanged(key, rawKey)) {
  1271. track(rawTarget, "get", key);
  1272. }
  1273. track(rawTarget, "get", rawKey);
  1274. }
  1275. const { has: has2 } = getProto(rawTarget);
  1276. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  1277. if (has2.call(rawTarget, key)) {
  1278. return wrap(target.get(key));
  1279. } else if (has2.call(rawTarget, rawKey)) {
  1280. return wrap(target.get(rawKey));
  1281. } else if (target !== rawTarget) {
  1282. target.get(key);
  1283. }
  1284. }
  1285. function has$1(key, isReadonly2 = false) {
  1286. const target = this["__v_raw"];
  1287. const rawTarget = toRaw(target);
  1288. const rawKey = toRaw(key);
  1289. if (!isReadonly2) {
  1290. if (hasChanged(key, rawKey)) {
  1291. track(rawTarget, "has", key);
  1292. }
  1293. track(rawTarget, "has", rawKey);
  1294. }
  1295. return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
  1296. }
  1297. function size(target, isReadonly2 = false) {
  1298. target = target["__v_raw"];
  1299. !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
  1300. return Reflect.get(target, "size", target);
  1301. }
  1302. function add(value) {
  1303. value = toRaw(value);
  1304. const target = toRaw(this);
  1305. const proto = getProto(target);
  1306. const hadKey = proto.has.call(target, value);
  1307. if (!hadKey) {
  1308. target.add(value);
  1309. trigger(target, "add", value, value);
  1310. }
  1311. return this;
  1312. }
  1313. function set$1(key, value) {
  1314. value = toRaw(value);
  1315. const target = toRaw(this);
  1316. const { has: has2, get: get2 } = getProto(target);
  1317. let hadKey = has2.call(target, key);
  1318. if (!hadKey) {
  1319. key = toRaw(key);
  1320. hadKey = has2.call(target, key);
  1321. } else {
  1322. checkIdentityKeys(target, has2, key);
  1323. }
  1324. const oldValue = get2.call(target, key);
  1325. target.set(key, value);
  1326. if (!hadKey) {
  1327. trigger(target, "add", key, value);
  1328. } else if (hasChanged(value, oldValue)) {
  1329. trigger(target, "set", key, value, oldValue);
  1330. }
  1331. return this;
  1332. }
  1333. function deleteEntry(key) {
  1334. const target = toRaw(this);
  1335. const { has: has2, get: get2 } = getProto(target);
  1336. let hadKey = has2.call(target, key);
  1337. if (!hadKey) {
  1338. key = toRaw(key);
  1339. hadKey = has2.call(target, key);
  1340. } else {
  1341. checkIdentityKeys(target, has2, key);
  1342. }
  1343. const oldValue = get2 ? get2.call(target, key) : void 0;
  1344. const result = target.delete(key);
  1345. if (hadKey) {
  1346. trigger(target, "delete", key, void 0, oldValue);
  1347. }
  1348. return result;
  1349. }
  1350. function clear() {
  1351. const target = toRaw(this);
  1352. const hadItems = target.size !== 0;
  1353. const oldTarget = isMap(target) ? new Map(target) : new Set(target);
  1354. const result = target.clear();
  1355. if (hadItems) {
  1356. trigger(target, "clear", void 0, void 0, oldTarget);
  1357. }
  1358. return result;
  1359. }
  1360. function createForEach(isReadonly2, isShallow2) {
  1361. return function forEach(callback, thisArg) {
  1362. const observed = this;
  1363. const target = observed["__v_raw"];
  1364. const rawTarget = toRaw(target);
  1365. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  1366. !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
  1367. return target.forEach((value, key) => {
  1368. return callback.call(thisArg, wrap(value), wrap(key), observed);
  1369. });
  1370. };
  1371. }
  1372. function createIterableMethod(method, isReadonly2, isShallow2) {
  1373. return function(...args) {
  1374. const target = this["__v_raw"];
  1375. const rawTarget = toRaw(target);
  1376. const targetIsMap = isMap(rawTarget);
  1377. const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
  1378. const isKeyOnly = method === "keys" && targetIsMap;
  1379. const innerIterator = target[method](...args);
  1380. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  1381. !isReadonly2 && track(
  1382. rawTarget,
  1383. "iterate",
  1384. isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
  1385. );
  1386. return {
  1387. // iterator protocol
  1388. next() {
  1389. const { value, done } = innerIterator.next();
  1390. return done ? { value, done } : {
  1391. value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
  1392. done
  1393. };
  1394. },
  1395. // iterable protocol
  1396. [Symbol.iterator]() {
  1397. return this;
  1398. }
  1399. };
  1400. };
  1401. }
  1402. function createReadonlyMethod(type) {
  1403. return function(...args) {
  1404. {
  1405. const key = args[0] ? `on key "${args[0]}" ` : ``;
  1406. warn$2(
  1407. `${capitalize(type)} operation ${key}failed: target is readonly.`,
  1408. toRaw(this)
  1409. );
  1410. }
  1411. return type === "delete" ? false : type === "clear" ? void 0 : this;
  1412. };
  1413. }
  1414. function createInstrumentations() {
  1415. const mutableInstrumentations2 = {
  1416. get(key) {
  1417. return get(this, key);
  1418. },
  1419. get size() {
  1420. return size(this);
  1421. },
  1422. has: has$1,
  1423. add,
  1424. set: set$1,
  1425. delete: deleteEntry,
  1426. clear,
  1427. forEach: createForEach(false, false)
  1428. };
  1429. const shallowInstrumentations2 = {
  1430. get(key) {
  1431. return get(this, key, false, true);
  1432. },
  1433. get size() {
  1434. return size(this);
  1435. },
  1436. has: has$1,
  1437. add,
  1438. set: set$1,
  1439. delete: deleteEntry,
  1440. clear,
  1441. forEach: createForEach(false, true)
  1442. };
  1443. const readonlyInstrumentations2 = {
  1444. get(key) {
  1445. return get(this, key, true);
  1446. },
  1447. get size() {
  1448. return size(this, true);
  1449. },
  1450. has(key) {
  1451. return has$1.call(this, key, true);
  1452. },
  1453. add: createReadonlyMethod("add"),
  1454. set: createReadonlyMethod("set"),
  1455. delete: createReadonlyMethod("delete"),
  1456. clear: createReadonlyMethod("clear"),
  1457. forEach: createForEach(true, false)
  1458. };
  1459. const shallowReadonlyInstrumentations2 = {
  1460. get(key) {
  1461. return get(this, key, true, true);
  1462. },
  1463. get size() {
  1464. return size(this, true);
  1465. },
  1466. has(key) {
  1467. return has$1.call(this, key, true);
  1468. },
  1469. add: createReadonlyMethod("add"),
  1470. set: createReadonlyMethod("set"),
  1471. delete: createReadonlyMethod("delete"),
  1472. clear: createReadonlyMethod("clear"),
  1473. forEach: createForEach(true, true)
  1474. };
  1475. const iteratorMethods = [
  1476. "keys",
  1477. "values",
  1478. "entries",
  1479. Symbol.iterator
  1480. ];
  1481. iteratorMethods.forEach((method) => {
  1482. mutableInstrumentations2[method] = createIterableMethod(method, false, false);
  1483. readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
  1484. shallowInstrumentations2[method] = createIterableMethod(method, false, true);
  1485. shallowReadonlyInstrumentations2[method] = createIterableMethod(
  1486. method,
  1487. true,
  1488. true
  1489. );
  1490. });
  1491. return [
  1492. mutableInstrumentations2,
  1493. readonlyInstrumentations2,
  1494. shallowInstrumentations2,
  1495. shallowReadonlyInstrumentations2
  1496. ];
  1497. }
  1498. const [
  1499. mutableInstrumentations,
  1500. readonlyInstrumentations,
  1501. shallowInstrumentations,
  1502. shallowReadonlyInstrumentations
  1503. ] = /* @__PURE__ */ createInstrumentations();
  1504. function createInstrumentationGetter(isReadonly2, shallow) {
  1505. const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
  1506. return (target, key, receiver) => {
  1507. if (key === "__v_isReactive") {
  1508. return !isReadonly2;
  1509. } else if (key === "__v_isReadonly") {
  1510. return isReadonly2;
  1511. } else if (key === "__v_raw") {
  1512. return target;
  1513. }
  1514. return Reflect.get(
  1515. hasOwn$1(instrumentations, key) && key in target ? instrumentations : target,
  1516. key,
  1517. receiver
  1518. );
  1519. };
  1520. }
  1521. const mutableCollectionHandlers = {
  1522. get: /* @__PURE__ */ createInstrumentationGetter(false, false)
  1523. };
  1524. const shallowCollectionHandlers = {
  1525. get: /* @__PURE__ */ createInstrumentationGetter(false, true)
  1526. };
  1527. const readonlyCollectionHandlers = {
  1528. get: /* @__PURE__ */ createInstrumentationGetter(true, false)
  1529. };
  1530. const shallowReadonlyCollectionHandlers = {
  1531. get: /* @__PURE__ */ createInstrumentationGetter(true, true)
  1532. };
  1533. function checkIdentityKeys(target, has2, key) {
  1534. const rawKey = toRaw(key);
  1535. if (rawKey !== key && has2.call(target, rawKey)) {
  1536. const type = toRawType(target);
  1537. warn$2(
  1538. `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`
  1539. );
  1540. }
  1541. }
  1542. const reactiveMap = /* @__PURE__ */ new WeakMap();
  1543. const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
  1544. const readonlyMap = /* @__PURE__ */ new WeakMap();
  1545. const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
  1546. function targetTypeMap(rawType) {
  1547. switch (rawType) {
  1548. case "Object":
  1549. case "Array":
  1550. return 1;
  1551. case "Map":
  1552. case "Set":
  1553. case "WeakMap":
  1554. case "WeakSet":
  1555. return 2;
  1556. default:
  1557. return 0;
  1558. }
  1559. }
  1560. function getTargetType(value) {
  1561. return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
  1562. }
  1563. function reactive(target) {
  1564. if (isReadonly(target)) {
  1565. return target;
  1566. }
  1567. return createReactiveObject(
  1568. target,
  1569. false,
  1570. mutableHandlers,
  1571. mutableCollectionHandlers,
  1572. reactiveMap
  1573. );
  1574. }
  1575. function shallowReactive(target) {
  1576. return createReactiveObject(
  1577. target,
  1578. false,
  1579. shallowReactiveHandlers,
  1580. shallowCollectionHandlers,
  1581. shallowReactiveMap
  1582. );
  1583. }
  1584. function readonly(target) {
  1585. return createReactiveObject(
  1586. target,
  1587. true,
  1588. readonlyHandlers,
  1589. readonlyCollectionHandlers,
  1590. readonlyMap
  1591. );
  1592. }
  1593. function shallowReadonly(target) {
  1594. return createReactiveObject(
  1595. target,
  1596. true,
  1597. shallowReadonlyHandlers,
  1598. shallowReadonlyCollectionHandlers,
  1599. shallowReadonlyMap
  1600. );
  1601. }
  1602. function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
  1603. if (!isObject$1(target)) {
  1604. {
  1605. warn$2(`value cannot be made reactive: ${String(target)}`);
  1606. }
  1607. return target;
  1608. }
  1609. if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
  1610. return target;
  1611. }
  1612. const existingProxy = proxyMap.get(target);
  1613. if (existingProxy) {
  1614. return existingProxy;
  1615. }
  1616. const targetType = getTargetType(target);
  1617. if (targetType === 0) {
  1618. return target;
  1619. }
  1620. const proxy = new Proxy(
  1621. target,
  1622. targetType === 2 ? collectionHandlers : baseHandlers
  1623. );
  1624. proxyMap.set(target, proxy);
  1625. return proxy;
  1626. }
  1627. function isReactive(value) {
  1628. if (isReadonly(value)) {
  1629. return isReactive(value["__v_raw"]);
  1630. }
  1631. return !!(value && value["__v_isReactive"]);
  1632. }
  1633. function isReadonly(value) {
  1634. return !!(value && value["__v_isReadonly"]);
  1635. }
  1636. function isShallow(value) {
  1637. return !!(value && value["__v_isShallow"]);
  1638. }
  1639. function isProxy(value) {
  1640. return isReactive(value) || isReadonly(value);
  1641. }
  1642. function toRaw(observed) {
  1643. const raw = observed && observed["__v_raw"];
  1644. return raw ? toRaw(raw) : observed;
  1645. }
  1646. function markRaw(value) {
  1647. if (Object.isExtensible(value)) {
  1648. def(value, "__v_skip", true);
  1649. }
  1650. return value;
  1651. }
  1652. const toReactive = (value) => isObject$1(value) ? reactive(value) : value;
  1653. const toReadonly = (value) => isObject$1(value) ? readonly(value) : value;
  1654. const COMPUTED_SIDE_EFFECT_WARN = `Computed is still dirty after getter evaluation, likely because a computed is mutating its own dependency in its getter. State mutations in computed getters should be avoided. Check the docs for more details: https://vuejs.org/guide/essentials/computed.html#getters-should-be-side-effect-free`;
  1655. class ComputedRefImpl {
  1656. constructor(getter, _setter, isReadonly2, isSSR) {
  1657. this.getter = getter;
  1658. this._setter = _setter;
  1659. this.dep = void 0;
  1660. this.__v_isRef = true;
  1661. this["__v_isReadonly"] = false;
  1662. this.effect = new ReactiveEffect(
  1663. () => getter(this._value),
  1664. () => triggerRefValue(
  1665. this,
  1666. this.effect._dirtyLevel === 2 ? 2 : 3
  1667. )
  1668. );
  1669. this.effect.computed = this;
  1670. this.effect.active = this._cacheable = !isSSR;
  1671. this["__v_isReadonly"] = isReadonly2;
  1672. }
  1673. get value() {
  1674. const self = toRaw(this);
  1675. if ((!self._cacheable || self.effect.dirty) && hasChanged(self._value, self._value = self.effect.run())) {
  1676. triggerRefValue(self, 4);
  1677. }
  1678. trackRefValue(self);
  1679. if (self.effect._dirtyLevel >= 2) {
  1680. if (this._warnRecursive) {
  1681. warn$2(COMPUTED_SIDE_EFFECT_WARN, `
  1682. getter: `, this.getter);
  1683. }
  1684. triggerRefValue(self, 2);
  1685. }
  1686. return self._value;
  1687. }
  1688. set value(newValue) {
  1689. this._setter(newValue);
  1690. }
  1691. // #region polyfill _dirty for backward compatibility third party code for Vue <= 3.3.x
  1692. get _dirty() {
  1693. return this.effect.dirty;
  1694. }
  1695. set _dirty(v) {
  1696. this.effect.dirty = v;
  1697. }
  1698. // #endregion
  1699. }
  1700. function computed$1(getterOrOptions, debugOptions, isSSR = false) {
  1701. let getter;
  1702. let setter;
  1703. const onlyGetter = isFunction(getterOrOptions);
  1704. if (onlyGetter) {
  1705. getter = getterOrOptions;
  1706. setter = () => {
  1707. warn$2("Write operation failed: computed value is readonly");
  1708. };
  1709. } else {
  1710. getter = getterOrOptions.get;
  1711. setter = getterOrOptions.set;
  1712. }
  1713. const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
  1714. if (debugOptions && !isSSR) {
  1715. cRef.effect.onTrack = debugOptions.onTrack;
  1716. cRef.effect.onTrigger = debugOptions.onTrigger;
  1717. }
  1718. return cRef;
  1719. }
  1720. function trackRefValue(ref2) {
  1721. var _a;
  1722. if (shouldTrack && activeEffect) {
  1723. ref2 = toRaw(ref2);
  1724. trackEffect(
  1725. activeEffect,
  1726. (_a = ref2.dep) != null ? _a : ref2.dep = createDep(
  1727. () => ref2.dep = void 0,
  1728. ref2 instanceof ComputedRefImpl ? ref2 : void 0
  1729. ),
  1730. {
  1731. target: ref2,
  1732. type: "get",
  1733. key: "value"
  1734. }
  1735. );
  1736. }
  1737. }
  1738. function triggerRefValue(ref2, dirtyLevel = 4, newVal) {
  1739. ref2 = toRaw(ref2);
  1740. const dep = ref2.dep;
  1741. if (dep) {
  1742. triggerEffects(
  1743. dep,
  1744. dirtyLevel,
  1745. {
  1746. target: ref2,
  1747. type: "set",
  1748. key: "value",
  1749. newValue: newVal
  1750. }
  1751. );
  1752. }
  1753. }
  1754. function isRef(r2) {
  1755. return !!(r2 && r2.__v_isRef === true);
  1756. }
  1757. function ref(value) {
  1758. return createRef(value, false);
  1759. }
  1760. function createRef(rawValue, shallow) {
  1761. if (isRef(rawValue)) {
  1762. return rawValue;
  1763. }
  1764. return new RefImpl(rawValue, shallow);
  1765. }
  1766. class RefImpl {
  1767. constructor(value, __v_isShallow) {
  1768. this.__v_isShallow = __v_isShallow;
  1769. this.dep = void 0;
  1770. this.__v_isRef = true;
  1771. this._rawValue = __v_isShallow ? value : toRaw(value);
  1772. this._value = __v_isShallow ? value : toReactive(value);
  1773. }
  1774. get value() {
  1775. trackRefValue(this);
  1776. return this._value;
  1777. }
  1778. set value(newVal) {
  1779. const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal);
  1780. newVal = useDirectValue ? newVal : toRaw(newVal);
  1781. if (hasChanged(newVal, this._rawValue)) {
  1782. this._rawValue = newVal;
  1783. this._value = useDirectValue ? newVal : toReactive(newVal);
  1784. triggerRefValue(this, 4, newVal);
  1785. }
  1786. }
  1787. }
  1788. function unref(ref2) {
  1789. return isRef(ref2) ? ref2.value : ref2;
  1790. }
  1791. const shallowUnwrapHandlers = {
  1792. get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
  1793. set: (target, key, value, receiver) => {
  1794. const oldValue = target[key];
  1795. if (isRef(oldValue) && !isRef(value)) {
  1796. oldValue.value = value;
  1797. return true;
  1798. } else {
  1799. return Reflect.set(target, key, value, receiver);
  1800. }
  1801. }
  1802. };
  1803. function proxyRefs(objectWithRefs) {
  1804. return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
  1805. }
  1806. const stack = [];
  1807. function pushWarningContext(vnode) {
  1808. stack.push(vnode);
  1809. }
  1810. function popWarningContext() {
  1811. stack.pop();
  1812. }
  1813. function warn$1(msg, ...args) {
  1814. pauseTracking();
  1815. const instance = stack.length ? stack[stack.length - 1].component : null;
  1816. const appWarnHandler = instance && instance.appContext.config.warnHandler;
  1817. const trace = getComponentTrace();
  1818. if (appWarnHandler) {
  1819. callWithErrorHandling(
  1820. appWarnHandler,
  1821. instance,
  1822. 11,
  1823. [
  1824. msg + args.map((a) => {
  1825. var _a, _b;
  1826. return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
  1827. }).join(""),
  1828. instance && instance.proxy,
  1829. trace.map(
  1830. ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
  1831. ).join("\n"),
  1832. trace
  1833. ]
  1834. );
  1835. } else {
  1836. const warnArgs = [`[Vue warn]: ${msg}`, ...args];
  1837. if (trace.length && // avoid spamming console during tests
  1838. true) {
  1839. warnArgs.push(`
  1840. `, ...formatTrace(trace));
  1841. }
  1842. console.warn(...warnArgs);
  1843. }
  1844. resetTracking();
  1845. }
  1846. function getComponentTrace() {
  1847. let currentVNode = stack[stack.length - 1];
  1848. if (!currentVNode) {
  1849. return [];
  1850. }
  1851. const normalizedStack = [];
  1852. while (currentVNode) {
  1853. const last = normalizedStack[0];
  1854. if (last && last.vnode === currentVNode) {
  1855. last.recurseCount++;
  1856. } else {
  1857. normalizedStack.push({
  1858. vnode: currentVNode,
  1859. recurseCount: 0
  1860. });
  1861. }
  1862. const parentInstance = currentVNode.component && currentVNode.component.parent;
  1863. currentVNode = parentInstance && parentInstance.vnode;
  1864. }
  1865. return normalizedStack;
  1866. }
  1867. function formatTrace(trace) {
  1868. const logs = [];
  1869. trace.forEach((entry, i) => {
  1870. logs.push(...i === 0 ? [] : [`
  1871. `], ...formatTraceEntry(entry));
  1872. });
  1873. return logs;
  1874. }
  1875. function formatTraceEntry({ vnode, recurseCount }) {
  1876. const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
  1877. const isRoot = vnode.component ? vnode.component.parent == null : false;
  1878. const open = ` at <${formatComponentName(
  1879. vnode.component,
  1880. vnode.type,
  1881. isRoot
  1882. )}`;
  1883. const close = `>` + postfix;
  1884. return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
  1885. }
  1886. function formatProps(props) {
  1887. const res = [];
  1888. const keys = Object.keys(props);
  1889. keys.slice(0, 3).forEach((key) => {
  1890. res.push(...formatProp(key, props[key]));
  1891. });
  1892. if (keys.length > 3) {
  1893. res.push(` ...`);
  1894. }
  1895. return res;
  1896. }
  1897. function formatProp(key, value, raw) {
  1898. if (isString(value)) {
  1899. value = JSON.stringify(value);
  1900. return raw ? value : [`${key}=${value}`];
  1901. } else if (typeof value === "number" || typeof value === "boolean" || value == null) {
  1902. return raw ? value : [`${key}=${value}`];
  1903. } else if (isRef(value)) {
  1904. value = formatProp(key, toRaw(value.value), true);
  1905. return raw ? value : [`${key}=Ref<`, value, `>`];
  1906. } else if (isFunction(value)) {
  1907. return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
  1908. } else {
  1909. value = toRaw(value);
  1910. return raw ? value : [`${key}=`, value];
  1911. }
  1912. }
  1913. const ErrorTypeStrings = {
  1914. ["sp"]: "serverPrefetch hook",
  1915. ["bc"]: "beforeCreate hook",
  1916. ["c"]: "created hook",
  1917. ["bm"]: "beforeMount hook",
  1918. ["m"]: "mounted hook",
  1919. ["bu"]: "beforeUpdate hook",
  1920. ["u"]: "updated",
  1921. ["bum"]: "beforeUnmount hook",
  1922. ["um"]: "unmounted hook",
  1923. ["a"]: "activated hook",
  1924. ["da"]: "deactivated hook",
  1925. ["ec"]: "errorCaptured hook",
  1926. ["rtc"]: "renderTracked hook",
  1927. ["rtg"]: "renderTriggered hook",
  1928. [0]: "setup function",
  1929. [1]: "render function",
  1930. [2]: "watcher getter",
  1931. [3]: "watcher callback",
  1932. [4]: "watcher cleanup function",
  1933. [5]: "native event handler",
  1934. [6]: "component event handler",
  1935. [7]: "vnode hook",
  1936. [8]: "directive hook",
  1937. [9]: "transition hook",
  1938. [10]: "app errorHandler",
  1939. [11]: "app warnHandler",
  1940. [12]: "ref function",
  1941. [13]: "async component loader",
  1942. [14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ."
  1943. };
  1944. function callWithErrorHandling(fn, instance, type, args) {
  1945. try {
  1946. return args ? fn(...args) : fn();
  1947. } catch (err) {
  1948. handleError(err, instance, type);
  1949. }
  1950. }
  1951. function callWithAsyncErrorHandling(fn, instance, type, args) {
  1952. if (isFunction(fn)) {
  1953. const res = callWithErrorHandling(fn, instance, type, args);
  1954. if (res && isPromise(res)) {
  1955. res.catch((err) => {
  1956. handleError(err, instance, type);
  1957. });
  1958. }
  1959. return res;
  1960. }
  1961. const values = [];
  1962. for (let i = 0; i < fn.length; i++) {
  1963. values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
  1964. }
  1965. return values;
  1966. }
  1967. function handleError(err, instance, type, throwInDev = true) {
  1968. const contextVNode = instance ? instance.vnode : null;
  1969. if (instance) {
  1970. let cur = instance.parent;
  1971. const exposedInstance = instance.proxy;
  1972. const errorInfo = ErrorTypeStrings[type] || type;
  1973. while (cur) {
  1974. const errorCapturedHooks = cur.ec;
  1975. if (errorCapturedHooks) {
  1976. for (let i = 0; i < errorCapturedHooks.length; i++) {
  1977. if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
  1978. return;
  1979. }
  1980. }
  1981. }
  1982. cur = cur.parent;
  1983. }
  1984. const appErrorHandler = instance.appContext.config.errorHandler;
  1985. if (appErrorHandler) {
  1986. callWithErrorHandling(
  1987. appErrorHandler,
  1988. null,
  1989. 10,
  1990. [err, exposedInstance, errorInfo]
  1991. );
  1992. return;
  1993. }
  1994. }
  1995. logError(err, type, contextVNode, throwInDev);
  1996. }
  1997. function logError(err, type, contextVNode, throwInDev = true) {
  1998. {
  1999. const info = ErrorTypeStrings[type] || type;
  2000. if (contextVNode) {
  2001. pushWarningContext(contextVNode);
  2002. }
  2003. warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
  2004. if (contextVNode) {
  2005. popWarningContext();
  2006. }
  2007. if (throwInDev) {
  2008. console.error(err);
  2009. } else {
  2010. console.error(err);
  2011. }
  2012. }
  2013. }
  2014. let isFlushing = false;
  2015. let isFlushPending = false;
  2016. const queue$1 = [];
  2017. let flushIndex = 0;
  2018. const pendingPostFlushCbs = [];
  2019. let activePostFlushCbs = null;
  2020. let postFlushIndex = 0;
  2021. const resolvedPromise = /* @__PURE__ */ Promise.resolve();
  2022. let currentFlushPromise = null;
  2023. const RECURSION_LIMIT = 100;
  2024. function nextTick$1(fn) {
  2025. const p2 = currentFlushPromise || resolvedPromise;
  2026. return fn ? p2.then(this ? fn.bind(this) : fn) : p2;
  2027. }
  2028. function findInsertionIndex(id2) {
  2029. let start = flushIndex + 1;
  2030. let end = queue$1.length;
  2031. while (start < end) {
  2032. const middle = start + end >>> 1;
  2033. const middleJob = queue$1[middle];
  2034. const middleJobId = getId(middleJob);
  2035. if (middleJobId < id2 || middleJobId === id2 && middleJob.pre) {
  2036. start = middle + 1;
  2037. } else {
  2038. end = middle;
  2039. }
  2040. }
  2041. return start;
  2042. }
  2043. function queueJob(job) {
  2044. if (!queue$1.length || !queue$1.includes(
  2045. job,
  2046. isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex
  2047. )) {
  2048. if (job.id == null) {
  2049. queue$1.push(job);
  2050. } else {
  2051. queue$1.splice(findInsertionIndex(job.id), 0, job);
  2052. }
  2053. queueFlush();
  2054. }
  2055. }
  2056. function queueFlush() {
  2057. if (!isFlushing && !isFlushPending) {
  2058. isFlushPending = true;
  2059. currentFlushPromise = resolvedPromise.then(flushJobs);
  2060. }
  2061. }
  2062. function hasQueueJob(job) {
  2063. return queue$1.indexOf(job) > -1;
  2064. }
  2065. function invalidateJob(job) {
  2066. const i = queue$1.indexOf(job);
  2067. if (i > flushIndex) {
  2068. queue$1.splice(i, 1);
  2069. }
  2070. }
  2071. function queuePostFlushCb(cb) {
  2072. if (!isArray(cb)) {
  2073. if (!activePostFlushCbs || !activePostFlushCbs.includes(
  2074. cb,
  2075. cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex
  2076. )) {
  2077. pendingPostFlushCbs.push(cb);
  2078. }
  2079. } else {
  2080. pendingPostFlushCbs.push(...cb);
  2081. }
  2082. queueFlush();
  2083. }
  2084. function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
  2085. {
  2086. seen = seen || /* @__PURE__ */ new Map();
  2087. }
  2088. for (; i < queue$1.length; i++) {
  2089. const cb = queue$1[i];
  2090. if (cb && cb.pre) {
  2091. if (checkRecursiveUpdates(seen, cb)) {
  2092. continue;
  2093. }
  2094. queue$1.splice(i, 1);
  2095. i--;
  2096. cb();
  2097. }
  2098. }
  2099. }
  2100. function flushPostFlushCbs(seen) {
  2101. if (pendingPostFlushCbs.length) {
  2102. const deduped = [...new Set(pendingPostFlushCbs)].sort(
  2103. (a, b) => getId(a) - getId(b)
  2104. );
  2105. pendingPostFlushCbs.length = 0;
  2106. if (activePostFlushCbs) {
  2107. activePostFlushCbs.push(...deduped);
  2108. return;
  2109. }
  2110. activePostFlushCbs = deduped;
  2111. {
  2112. seen = seen || /* @__PURE__ */ new Map();
  2113. }
  2114. for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
  2115. if (checkRecursiveUpdates(seen, activePostFlushCbs[postFlushIndex])) {
  2116. continue;
  2117. }
  2118. activePostFlushCbs[postFlushIndex]();
  2119. }
  2120. activePostFlushCbs = null;
  2121. postFlushIndex = 0;
  2122. }
  2123. }
  2124. const getId = (job) => job.id == null ? Infinity : job.id;
  2125. const comparator = (a, b) => {
  2126. const diff2 = getId(a) - getId(b);
  2127. if (diff2 === 0) {
  2128. if (a.pre && !b.pre)
  2129. return -1;
  2130. if (b.pre && !a.pre)
  2131. return 1;
  2132. }
  2133. return diff2;
  2134. };
  2135. function flushJobs(seen) {
  2136. isFlushPending = false;
  2137. isFlushing = true;
  2138. {
  2139. seen = seen || /* @__PURE__ */ new Map();
  2140. }
  2141. queue$1.sort(comparator);
  2142. const check = (job) => checkRecursiveUpdates(seen, job);
  2143. try {
  2144. for (flushIndex = 0; flushIndex < queue$1.length; flushIndex++) {
  2145. const job = queue$1[flushIndex];
  2146. if (job && job.active !== false) {
  2147. if (check(job)) {
  2148. continue;
  2149. }
  2150. callWithErrorHandling(job, null, 14);
  2151. }
  2152. }
  2153. } finally {
  2154. flushIndex = 0;
  2155. queue$1.length = 0;
  2156. flushPostFlushCbs(seen);
  2157. isFlushing = false;
  2158. currentFlushPromise = null;
  2159. if (queue$1.length || pendingPostFlushCbs.length) {
  2160. flushJobs(seen);
  2161. }
  2162. }
  2163. }
  2164. function checkRecursiveUpdates(seen, fn) {
  2165. if (!seen.has(fn)) {
  2166. seen.set(fn, 1);
  2167. } else {
  2168. const count = seen.get(fn);
  2169. if (count > RECURSION_LIMIT) {
  2170. const instance = fn.ownerInstance;
  2171. const componentName = instance && getComponentName(instance.type);
  2172. handleError(
  2173. `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
  2174. null,
  2175. 10
  2176. );
  2177. return true;
  2178. } else {
  2179. seen.set(fn, count + 1);
  2180. }
  2181. }
  2182. }
  2183. let devtools;
  2184. let buffer = [];
  2185. let devtoolsNotInstalled = false;
  2186. function emit$1(event, ...args) {
  2187. if (devtools) {
  2188. devtools.emit(event, ...args);
  2189. } else if (!devtoolsNotInstalled) {
  2190. buffer.push({ event, args });
  2191. }
  2192. }
  2193. function setDevtoolsHook(hook, target) {
  2194. var _a, _b;
  2195. devtools = hook;
  2196. if (devtools) {
  2197. devtools.enabled = true;
  2198. buffer.forEach(({ event, args }) => devtools.emit(event, ...args));
  2199. buffer = [];
  2200. } else if (
  2201. // handle late devtools injection - only do this if we are in an actual
  2202. // browser environment to avoid the timer handle stalling test runner exit
  2203. // (#4815)
  2204. typeof window !== "undefined" && // some envs mock window but not fully
  2205. window.HTMLElement && // also exclude jsdom
  2206. !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom"))
  2207. ) {
  2208. const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];
  2209. replay.push((newHook) => {
  2210. setDevtoolsHook(newHook, target);
  2211. });
  2212. setTimeout(() => {
  2213. if (!devtools) {
  2214. target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
  2215. devtoolsNotInstalled = true;
  2216. buffer = [];
  2217. }
  2218. }, 3e3);
  2219. } else {
  2220. devtoolsNotInstalled = true;
  2221. buffer = [];
  2222. }
  2223. }
  2224. function devtoolsInitApp(app, version2) {
  2225. emit$1("app:init", app, version2, {
  2226. Fragment,
  2227. Text,
  2228. Comment,
  2229. Static
  2230. });
  2231. }
  2232. const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook(
  2233. "component:added"
  2234. /* COMPONENT_ADDED */
  2235. );
  2236. const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook(
  2237. "component:updated"
  2238. /* COMPONENT_UPDATED */
  2239. );
  2240. const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook(
  2241. "component:removed"
  2242. /* COMPONENT_REMOVED */
  2243. );
  2244. const devtoolsComponentRemoved = (component) => {
  2245. if (devtools && typeof devtools.cleanupBuffer === "function" && // remove the component if it wasn't buffered
  2246. !devtools.cleanupBuffer(component)) {
  2247. _devtoolsComponentRemoved(component);
  2248. }
  2249. };
  2250. /*! #__NO_SIDE_EFFECTS__ */
  2251. // @__NO_SIDE_EFFECTS__
  2252. function createDevtoolsComponentHook(hook) {
  2253. return (component) => {
  2254. emit$1(
  2255. hook,
  2256. component.appContext.app,
  2257. component.uid,
  2258. // fixed by xxxxxx
  2259. // 为 0 是 App,无 parent 是 Page 指向 App
  2260. component.uid === 0 ? void 0 : component.parent ? component.parent.uid : 0,
  2261. component
  2262. );
  2263. };
  2264. }
  2265. const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook(
  2266. "perf:start"
  2267. /* PERFORMANCE_START */
  2268. );
  2269. const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook(
  2270. "perf:end"
  2271. /* PERFORMANCE_END */
  2272. );
  2273. function createDevtoolsPerformanceHook(hook) {
  2274. return (component, type, time) => {
  2275. emit$1(hook, component.appContext.app, component.uid, component, type, time);
  2276. };
  2277. }
  2278. function devtoolsComponentEmit(component, event, params) {
  2279. emit$1(
  2280. "component:emit",
  2281. component.appContext.app,
  2282. component,
  2283. event,
  2284. params
  2285. );
  2286. }
  2287. function emit(instance, event, ...rawArgs) {
  2288. if (instance.isUnmounted)
  2289. return;
  2290. const props = instance.vnode.props || EMPTY_OBJ;
  2291. {
  2292. const {
  2293. emitsOptions,
  2294. propsOptions: [propsOptions]
  2295. } = instance;
  2296. if (emitsOptions) {
  2297. if (!(event in emitsOptions) && true) {
  2298. if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
  2299. warn$1(
  2300. `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(event)}" prop.`
  2301. );
  2302. }
  2303. } else {
  2304. const validator = emitsOptions[event];
  2305. if (isFunction(validator)) {
  2306. const isValid = validator(...rawArgs);
  2307. if (!isValid) {
  2308. warn$1(
  2309. `Invalid event arguments: event validation failed for event "${event}".`
  2310. );
  2311. }
  2312. }
  2313. }
  2314. }
  2315. }
  2316. let args = rawArgs;
  2317. const isModelListener2 = event.startsWith("update:");
  2318. const modelArg = isModelListener2 && event.slice(7);
  2319. if (modelArg && modelArg in props) {
  2320. const modifiersKey = `${modelArg === "modelValue" ? "model" : modelArg}Modifiers`;
  2321. const { number, trim } = props[modifiersKey] || EMPTY_OBJ;
  2322. if (trim) {
  2323. args = rawArgs.map((a) => isString(a) ? a.trim() : a);
  2324. }
  2325. if (number) {
  2326. args = rawArgs.map(looseToNumber);
  2327. }
  2328. }
  2329. {
  2330. devtoolsComponentEmit(instance, event, args);
  2331. }
  2332. {
  2333. const lowerCaseEvent = event.toLowerCase();
  2334. if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
  2335. warn$1(
  2336. `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
  2337. instance,
  2338. instance.type
  2339. )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate(
  2340. event
  2341. )}" instead of "${event}".`
  2342. );
  2343. }
  2344. }
  2345. let handlerName;
  2346. let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
  2347. props[handlerName = toHandlerKey(camelize(event))];
  2348. if (!handler && isModelListener2) {
  2349. handler = props[handlerName = toHandlerKey(hyphenate(event))];
  2350. }
  2351. if (handler) {
  2352. callWithAsyncErrorHandling(
  2353. handler,
  2354. instance,
  2355. 6,
  2356. args
  2357. );
  2358. }
  2359. const onceHandler = props[handlerName + `Once`];
  2360. if (onceHandler) {
  2361. if (!instance.emitted) {
  2362. instance.emitted = {};
  2363. } else if (instance.emitted[handlerName]) {
  2364. return;
  2365. }
  2366. instance.emitted[handlerName] = true;
  2367. callWithAsyncErrorHandling(
  2368. onceHandler,
  2369. instance,
  2370. 6,
  2371. args
  2372. );
  2373. }
  2374. }
  2375. function normalizeEmitsOptions(comp, appContext, asMixin = false) {
  2376. const cache = appContext.emitsCache;
  2377. const cached = cache.get(comp);
  2378. if (cached !== void 0) {
  2379. return cached;
  2380. }
  2381. const raw = comp.emits;
  2382. let normalized = {};
  2383. let hasExtends = false;
  2384. if (!isFunction(comp)) {
  2385. const extendEmits = (raw2) => {
  2386. const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
  2387. if (normalizedFromExtend) {
  2388. hasExtends = true;
  2389. extend(normalized, normalizedFromExtend);
  2390. }
  2391. };
  2392. if (!asMixin && appContext.mixins.length) {
  2393. appContext.mixins.forEach(extendEmits);
  2394. }
  2395. if (comp.extends) {
  2396. extendEmits(comp.extends);
  2397. }
  2398. if (comp.mixins) {
  2399. comp.mixins.forEach(extendEmits);
  2400. }
  2401. }
  2402. if (!raw && !hasExtends) {
  2403. if (isObject$1(comp)) {
  2404. cache.set(comp, null);
  2405. }
  2406. return null;
  2407. }
  2408. if (isArray(raw)) {
  2409. raw.forEach((key) => normalized[key] = null);
  2410. } else {
  2411. extend(normalized, raw);
  2412. }
  2413. if (isObject$1(comp)) {
  2414. cache.set(comp, normalized);
  2415. }
  2416. return normalized;
  2417. }
  2418. function isEmitListener(options, key) {
  2419. if (!options || !isOn(key)) {
  2420. return false;
  2421. }
  2422. key = key.slice(2).replace(/Once$/, "");
  2423. return hasOwn$1(options, key[0].toLowerCase() + key.slice(1)) || hasOwn$1(options, hyphenate(key)) || hasOwn$1(options, key);
  2424. }
  2425. let currentRenderingInstance = null;
  2426. function setCurrentRenderingInstance(instance) {
  2427. const prev = currentRenderingInstance;
  2428. currentRenderingInstance = instance;
  2429. instance && instance.type.__scopeId || null;
  2430. return prev;
  2431. }
  2432. const COMPONENTS = "components";
  2433. function resolveComponent(name, maybeSelfReference) {
  2434. return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
  2435. }
  2436. function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
  2437. const instance = currentRenderingInstance || currentInstance;
  2438. if (instance) {
  2439. const Component2 = instance.type;
  2440. if (type === COMPONENTS) {
  2441. const selfName = getComponentName(
  2442. Component2,
  2443. false
  2444. );
  2445. if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
  2446. return Component2;
  2447. }
  2448. }
  2449. const res = (
  2450. // local registration
  2451. // check instance[type] first which is resolved for options API
  2452. resolve(instance[type] || Component2[type], name) || // global registration
  2453. resolve(instance.appContext[type], name)
  2454. );
  2455. if (!res && maybeSelfReference) {
  2456. return Component2;
  2457. }
  2458. if (warnMissing && !res) {
  2459. const extra = type === COMPONENTS ? `
  2460. If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
  2461. warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
  2462. }
  2463. return res;
  2464. } else {
  2465. warn$1(
  2466. `resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`
  2467. );
  2468. }
  2469. }
  2470. function resolve(registry, name) {
  2471. return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
  2472. }
  2473. const INITIAL_WATCHER_VALUE = {};
  2474. function watch(source, cb, options) {
  2475. if (!isFunction(cb)) {
  2476. warn$1(
  2477. `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`
  2478. );
  2479. }
  2480. return doWatch(source, cb, options);
  2481. }
  2482. function doWatch(source, cb, {
  2483. immediate,
  2484. deep,
  2485. flush,
  2486. once: once2,
  2487. onTrack,
  2488. onTrigger
  2489. } = EMPTY_OBJ) {
  2490. if (cb && once2) {
  2491. const _cb = cb;
  2492. cb = (...args) => {
  2493. _cb(...args);
  2494. unwatch();
  2495. };
  2496. }
  2497. if (deep !== void 0 && typeof deep === "number") {
  2498. warn$1(
  2499. `watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.`
  2500. );
  2501. }
  2502. if (!cb) {
  2503. if (immediate !== void 0) {
  2504. warn$1(
  2505. `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
  2506. );
  2507. }
  2508. if (deep !== void 0) {
  2509. warn$1(
  2510. `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
  2511. );
  2512. }
  2513. if (once2 !== void 0) {
  2514. warn$1(
  2515. `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
  2516. );
  2517. }
  2518. }
  2519. const warnInvalidSource = (s2) => {
  2520. warn$1(
  2521. `Invalid watch source: `,
  2522. s2,
  2523. `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`
  2524. );
  2525. };
  2526. const instance = currentInstance;
  2527. const reactiveGetter = (source2) => deep === true ? source2 : (
  2528. // for deep: false, only traverse root-level properties
  2529. traverse(source2, deep === false ? 1 : void 0)
  2530. );
  2531. let getter;
  2532. let forceTrigger = false;
  2533. let isMultiSource = false;
  2534. if (isRef(source)) {
  2535. getter = () => source.value;
  2536. forceTrigger = isShallow(source);
  2537. } else if (isReactive(source)) {
  2538. getter = () => reactiveGetter(source);
  2539. forceTrigger = true;
  2540. } else if (isArray(source)) {
  2541. isMultiSource = true;
  2542. forceTrigger = source.some((s2) => isReactive(s2) || isShallow(s2));
  2543. getter = () => source.map((s2) => {
  2544. if (isRef(s2)) {
  2545. return s2.value;
  2546. } else if (isReactive(s2)) {
  2547. return reactiveGetter(s2);
  2548. } else if (isFunction(s2)) {
  2549. return callWithErrorHandling(s2, instance, 2);
  2550. } else {
  2551. warnInvalidSource(s2);
  2552. }
  2553. });
  2554. } else if (isFunction(source)) {
  2555. if (cb) {
  2556. getter = () => callWithErrorHandling(source, instance, 2);
  2557. } else {
  2558. getter = () => {
  2559. if (cleanup) {
  2560. cleanup();
  2561. }
  2562. return callWithAsyncErrorHandling(
  2563. source,
  2564. instance,
  2565. 3,
  2566. [onCleanup]
  2567. );
  2568. };
  2569. }
  2570. } else {
  2571. getter = NOOP;
  2572. warnInvalidSource(source);
  2573. }
  2574. if (cb && deep) {
  2575. const baseGetter = getter;
  2576. getter = () => traverse(baseGetter());
  2577. }
  2578. let cleanup;
  2579. let onCleanup = (fn) => {
  2580. cleanup = effect2.onStop = () => {
  2581. callWithErrorHandling(fn, instance, 4);
  2582. cleanup = effect2.onStop = void 0;
  2583. };
  2584. };
  2585. let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
  2586. const job = () => {
  2587. if (!effect2.active || !effect2.dirty) {
  2588. return;
  2589. }
  2590. if (cb) {
  2591. const newValue = effect2.run();
  2592. if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || false) {
  2593. if (cleanup) {
  2594. cleanup();
  2595. }
  2596. callWithAsyncErrorHandling(cb, instance, 3, [
  2597. newValue,
  2598. // pass undefined as the old value when it's changed for the first time
  2599. oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
  2600. onCleanup
  2601. ]);
  2602. oldValue = newValue;
  2603. }
  2604. } else {
  2605. effect2.run();
  2606. }
  2607. };
  2608. job.allowRecurse = !!cb;
  2609. let scheduler;
  2610. if (flush === "sync") {
  2611. scheduler = job;
  2612. } else if (flush === "post") {
  2613. scheduler = () => queuePostRenderEffect$1(job, instance && instance.suspense);
  2614. } else {
  2615. job.pre = true;
  2616. if (instance)
  2617. job.id = instance.uid;
  2618. scheduler = () => queueJob(job);
  2619. }
  2620. const effect2 = new ReactiveEffect(getter, NOOP, scheduler);
  2621. const scope = getCurrentScope();
  2622. const unwatch = () => {
  2623. effect2.stop();
  2624. if (scope) {
  2625. remove(scope.effects, effect2);
  2626. }
  2627. };
  2628. {
  2629. effect2.onTrack = onTrack;
  2630. effect2.onTrigger = onTrigger;
  2631. }
  2632. if (cb) {
  2633. if (immediate) {
  2634. job();
  2635. } else {
  2636. oldValue = effect2.run();
  2637. }
  2638. } else if (flush === "post") {
  2639. queuePostRenderEffect$1(
  2640. effect2.run.bind(effect2),
  2641. instance && instance.suspense
  2642. );
  2643. } else {
  2644. effect2.run();
  2645. }
  2646. return unwatch;
  2647. }
  2648. function instanceWatch(source, value, options) {
  2649. const publicThis = this.proxy;
  2650. const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
  2651. let cb;
  2652. if (isFunction(value)) {
  2653. cb = value;
  2654. } else {
  2655. cb = value.handler;
  2656. options = value;
  2657. }
  2658. const reset = setCurrentInstance(this);
  2659. const res = doWatch(getter, cb.bind(publicThis), options);
  2660. reset();
  2661. return res;
  2662. }
  2663. function createPathGetter(ctx, path) {
  2664. const segments = path.split(".");
  2665. return () => {
  2666. let cur = ctx;
  2667. for (let i = 0; i < segments.length && cur; i++) {
  2668. cur = cur[segments[i]];
  2669. }
  2670. return cur;
  2671. };
  2672. }
  2673. function traverse(value, depth, currentDepth = 0, seen) {
  2674. if (!isObject$1(value) || value["__v_skip"]) {
  2675. return value;
  2676. }
  2677. if (depth && depth > 0) {
  2678. if (currentDepth >= depth) {
  2679. return value;
  2680. }
  2681. currentDepth++;
  2682. }
  2683. seen = seen || /* @__PURE__ */ new Set();
  2684. if (seen.has(value)) {
  2685. return value;
  2686. }
  2687. seen.add(value);
  2688. if (isRef(value)) {
  2689. traverse(value.value, depth, currentDepth, seen);
  2690. } else if (isArray(value)) {
  2691. for (let i = 0; i < value.length; i++) {
  2692. traverse(value[i], depth, currentDepth, seen);
  2693. }
  2694. } else if (isSet(value) || isMap(value)) {
  2695. value.forEach((v) => {
  2696. traverse(v, depth, currentDepth, seen);
  2697. });
  2698. } else if (isPlainObject(value)) {
  2699. for (const key in value) {
  2700. traverse(value[key], depth, currentDepth, seen);
  2701. }
  2702. }
  2703. return value;
  2704. }
  2705. function validateDirectiveName(name) {
  2706. if (isBuiltInDirective(name)) {
  2707. warn$1("Do not use built-in directive ids as custom directive id: " + name);
  2708. }
  2709. }
  2710. function createAppContext() {
  2711. return {
  2712. app: null,
  2713. config: {
  2714. isNativeTag: NO,
  2715. performance: false,
  2716. globalProperties: {},
  2717. optionMergeStrategies: {},
  2718. errorHandler: void 0,
  2719. warnHandler: void 0,
  2720. compilerOptions: {}
  2721. },
  2722. mixins: [],
  2723. components: {},
  2724. directives: {},
  2725. provides: /* @__PURE__ */ Object.create(null),
  2726. optionsCache: /* @__PURE__ */ new WeakMap(),
  2727. propsCache: /* @__PURE__ */ new WeakMap(),
  2728. emitsCache: /* @__PURE__ */ new WeakMap()
  2729. };
  2730. }
  2731. let uid$1 = 0;
  2732. function createAppAPI(render, hydrate) {
  2733. return function createApp2(rootComponent, rootProps = null) {
  2734. if (!isFunction(rootComponent)) {
  2735. rootComponent = extend({}, rootComponent);
  2736. }
  2737. if (rootProps != null && !isObject$1(rootProps)) {
  2738. warn$1(`root props passed to app.mount() must be an object.`);
  2739. rootProps = null;
  2740. }
  2741. const context = createAppContext();
  2742. const installedPlugins = /* @__PURE__ */ new WeakSet();
  2743. const app = context.app = {
  2744. _uid: uid$1++,
  2745. _component: rootComponent,
  2746. _props: rootProps,
  2747. _container: null,
  2748. _context: context,
  2749. _instance: null,
  2750. version,
  2751. get config() {
  2752. return context.config;
  2753. },
  2754. set config(v) {
  2755. {
  2756. warn$1(
  2757. `app.config cannot be replaced. Modify individual options instead.`
  2758. );
  2759. }
  2760. },
  2761. use(plugin2, ...options) {
  2762. if (installedPlugins.has(plugin2)) {
  2763. warn$1(`Plugin has already been applied to target app.`);
  2764. } else if (plugin2 && isFunction(plugin2.install)) {
  2765. installedPlugins.add(plugin2);
  2766. plugin2.install(app, ...options);
  2767. } else if (isFunction(plugin2)) {
  2768. installedPlugins.add(plugin2);
  2769. plugin2(app, ...options);
  2770. } else {
  2771. warn$1(
  2772. `A plugin must either be a function or an object with an "install" function.`
  2773. );
  2774. }
  2775. return app;
  2776. },
  2777. mixin(mixin) {
  2778. {
  2779. if (!context.mixins.includes(mixin)) {
  2780. context.mixins.push(mixin);
  2781. } else {
  2782. warn$1(
  2783. "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "")
  2784. );
  2785. }
  2786. }
  2787. return app;
  2788. },
  2789. component(name, component) {
  2790. {
  2791. validateComponentName(name, context.config);
  2792. }
  2793. if (!component) {
  2794. return context.components[name];
  2795. }
  2796. if (context.components[name]) {
  2797. warn$1(`Component "${name}" has already been registered in target app.`);
  2798. }
  2799. context.components[name] = component;
  2800. return app;
  2801. },
  2802. directive(name, directive) {
  2803. {
  2804. validateDirectiveName(name);
  2805. }
  2806. if (!directive) {
  2807. return context.directives[name];
  2808. }
  2809. if (context.directives[name]) {
  2810. warn$1(`Directive "${name}" has already been registered in target app.`);
  2811. }
  2812. context.directives[name] = directive;
  2813. return app;
  2814. },
  2815. // fixed by xxxxxx
  2816. mount() {
  2817. },
  2818. // fixed by xxxxxx
  2819. unmount() {
  2820. },
  2821. provide(key, value) {
  2822. if (key in context.provides) {
  2823. warn$1(
  2824. `App already provides property with key "${String(key)}". It will be overwritten with the new value.`
  2825. );
  2826. }
  2827. context.provides[key] = value;
  2828. return app;
  2829. },
  2830. runWithContext(fn) {
  2831. const lastApp = currentApp;
  2832. currentApp = app;
  2833. try {
  2834. return fn();
  2835. } finally {
  2836. currentApp = lastApp;
  2837. }
  2838. }
  2839. };
  2840. return app;
  2841. };
  2842. }
  2843. let currentApp = null;
  2844. function provide(key, value) {
  2845. if (!currentInstance) {
  2846. {
  2847. warn$1(`provide() can only be used inside setup().`);
  2848. }
  2849. } else {
  2850. let provides = currentInstance.provides;
  2851. const parentProvides = currentInstance.parent && currentInstance.parent.provides;
  2852. if (parentProvides === provides) {
  2853. provides = currentInstance.provides = Object.create(parentProvides);
  2854. }
  2855. provides[key] = value;
  2856. if (currentInstance.type.mpType === "app") {
  2857. currentInstance.appContext.app.provide(key, value);
  2858. }
  2859. }
  2860. }
  2861. function inject(key, defaultValue, treatDefaultAsFactory = false) {
  2862. const instance = currentInstance || currentRenderingInstance;
  2863. if (instance || currentApp) {
  2864. const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides;
  2865. if (provides && key in provides) {
  2866. return provides[key];
  2867. } else if (arguments.length > 1) {
  2868. return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
  2869. } else {
  2870. warn$1(`injection "${String(key)}" not found.`);
  2871. }
  2872. } else {
  2873. warn$1(`inject() can only be used inside setup() or functional components.`);
  2874. }
  2875. }
  2876. /*! #__NO_SIDE_EFFECTS__ */
  2877. // @__NO_SIDE_EFFECTS__
  2878. function defineComponent(options, extraOptions) {
  2879. return isFunction(options) ? (
  2880. // #8326: extend call and options.name access are considered side-effects
  2881. // by Rollup, so we have to wrap it in a pure-annotated IIFE.
  2882. /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()
  2883. ) : options;
  2884. }
  2885. const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
  2886. function onActivated(hook, target) {
  2887. registerKeepAliveHook(hook, "a", target);
  2888. }
  2889. function onDeactivated(hook, target) {
  2890. registerKeepAliveHook(hook, "da", target);
  2891. }
  2892. function registerKeepAliveHook(hook, type, target = currentInstance) {
  2893. const wrappedHook = hook.__wdc || (hook.__wdc = () => {
  2894. let current = target;
  2895. while (current) {
  2896. if (current.isDeactivated) {
  2897. return;
  2898. }
  2899. current = current.parent;
  2900. }
  2901. return hook();
  2902. });
  2903. injectHook(type, wrappedHook, target);
  2904. if (target) {
  2905. let current = target.parent;
  2906. while (current && current.parent) {
  2907. if (isKeepAlive(current.parent.vnode)) {
  2908. injectToKeepAliveRoot(wrappedHook, type, target, current);
  2909. }
  2910. current = current.parent;
  2911. }
  2912. }
  2913. }
  2914. function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
  2915. const injected = injectHook(
  2916. type,
  2917. hook,
  2918. keepAliveRoot,
  2919. true
  2920. /* prepend */
  2921. );
  2922. onUnmounted(() => {
  2923. remove(keepAliveRoot[type], injected);
  2924. }, target);
  2925. }
  2926. function injectHook(type, hook, target = currentInstance, prepend = false) {
  2927. if (target) {
  2928. if (isRootHook(type)) {
  2929. target = target.root;
  2930. }
  2931. const hooks = target[type] || (target[type] = []);
  2932. const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
  2933. if (target.isUnmounted) {
  2934. return;
  2935. }
  2936. pauseTracking();
  2937. const reset = setCurrentInstance(target);
  2938. const res = callWithAsyncErrorHandling(hook, target, type, args);
  2939. reset();
  2940. resetTracking();
  2941. return res;
  2942. });
  2943. if (prepend) {
  2944. hooks.unshift(wrappedHook);
  2945. } else {
  2946. hooks.push(wrappedHook);
  2947. }
  2948. return wrappedHook;
  2949. } else {
  2950. const apiName = toHandlerKey(
  2951. (ErrorTypeStrings[type] || type.replace(/^on/, "")).replace(/ hook$/, "")
  2952. );
  2953. warn$1(
  2954. `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().`
  2955. );
  2956. }
  2957. }
  2958. const createHook = (lifecycle) => (hook, target = currentInstance) => (
  2959. // post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
  2960. (!isInSSRComponentSetup || lifecycle === "sp") && injectHook(lifecycle, (...args) => hook(...args), target)
  2961. );
  2962. const onBeforeMount = createHook("bm");
  2963. const onMounted = createHook("m");
  2964. const onBeforeUpdate = createHook("bu");
  2965. const onUpdated = createHook("u");
  2966. const onBeforeUnmount = createHook("bum");
  2967. const onUnmounted = createHook("um");
  2968. const onServerPrefetch = createHook("sp");
  2969. const onRenderTriggered = createHook(
  2970. "rtg"
  2971. );
  2972. const onRenderTracked = createHook(
  2973. "rtc"
  2974. );
  2975. function onErrorCaptured(hook, target = currentInstance) {
  2976. injectHook("ec", hook, target);
  2977. }
  2978. const getPublicInstance = (i) => {
  2979. if (!i)
  2980. return null;
  2981. if (isStatefulComponent(i))
  2982. return getExposeProxy(i) || i.proxy;
  2983. return getPublicInstance(i.parent);
  2984. };
  2985. function getComponentInternalInstance(i) {
  2986. return i;
  2987. }
  2988. const publicPropertiesMap = (
  2989. // Move PURE marker to new line to workaround compiler discarding it
  2990. // due to type annotation
  2991. /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
  2992. // fixed by xxxxxx
  2993. $: getComponentInternalInstance,
  2994. // fixed by xxxxxx vue-i18n 在 dev 模式,访问了 $el,故模拟一个假的
  2995. // $el: i => i.vnode.el,
  2996. $el: (i) => i.__$el || (i.__$el = {}),
  2997. $data: (i) => i.data,
  2998. $props: (i) => shallowReadonly(i.props),
  2999. $attrs: (i) => shallowReadonly(i.attrs),
  3000. $slots: (i) => shallowReadonly(i.slots),
  3001. $refs: (i) => shallowReadonly(i.refs),
  3002. $parent: (i) => getPublicInstance(i.parent),
  3003. $root: (i) => getPublicInstance(i.root),
  3004. $emit: (i) => i.emit,
  3005. $options: (i) => resolveMergedOptions(i),
  3006. $forceUpdate: (i) => i.f || (i.f = () => {
  3007. i.effect.dirty = true;
  3008. queueJob(i.update);
  3009. }),
  3010. // $nextTick: i => i.n || (i.n = nextTick.bind(i.proxy!)),// fixed by xxxxxx
  3011. $watch: (i) => instanceWatch.bind(i)
  3012. })
  3013. );
  3014. const isReservedPrefix = (key) => key === "_" || key === "$";
  3015. const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn$1(state, key);
  3016. const PublicInstanceProxyHandlers = {
  3017. get({ _: instance }, key) {
  3018. const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
  3019. if (key === "__isVue") {
  3020. return true;
  3021. }
  3022. let normalizedProps;
  3023. if (key[0] !== "$") {
  3024. const n2 = accessCache[key];
  3025. if (n2 !== void 0) {
  3026. switch (n2) {
  3027. case 1:
  3028. return setupState[key];
  3029. case 2:
  3030. return data[key];
  3031. case 4:
  3032. return ctx[key];
  3033. case 3:
  3034. return props[key];
  3035. }
  3036. } else if (hasSetupBinding(setupState, key)) {
  3037. accessCache[key] = 1;
  3038. return setupState[key];
  3039. } else if (data !== EMPTY_OBJ && hasOwn$1(data, key)) {
  3040. accessCache[key] = 2;
  3041. return data[key];
  3042. } else if (
  3043. // only cache other properties when instance has declared (thus stable)
  3044. // props
  3045. (normalizedProps = instance.propsOptions[0]) && hasOwn$1(normalizedProps, key)
  3046. ) {
  3047. accessCache[key] = 3;
  3048. return props[key];
  3049. } else if (ctx !== EMPTY_OBJ && hasOwn$1(ctx, key)) {
  3050. accessCache[key] = 4;
  3051. return ctx[key];
  3052. } else if (shouldCacheAccess) {
  3053. accessCache[key] = 0;
  3054. }
  3055. }
  3056. const publicGetter = publicPropertiesMap[key];
  3057. let cssModule, globalProperties;
  3058. if (publicGetter) {
  3059. if (key === "$attrs") {
  3060. track(instance, "get", key);
  3061. } else if (key === "$slots") {
  3062. track(instance, "get", key);
  3063. }
  3064. return publicGetter(instance);
  3065. } else if (
  3066. // css module (injected by vue-loader)
  3067. (cssModule = type.__cssModules) && (cssModule = cssModule[key])
  3068. ) {
  3069. return cssModule;
  3070. } else if (ctx !== EMPTY_OBJ && hasOwn$1(ctx, key)) {
  3071. accessCache[key] = 4;
  3072. return ctx[key];
  3073. } else if (
  3074. // global properties
  3075. globalProperties = appContext.config.globalProperties, hasOwn$1(globalProperties, key)
  3076. ) {
  3077. {
  3078. return globalProperties[key];
  3079. }
  3080. } else if (currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading
  3081. // to infinite warning loop
  3082. key.indexOf("__v") !== 0)) {
  3083. if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn$1(data, key)) {
  3084. warn$1(
  3085. `Property ${JSON.stringify(
  3086. key
  3087. )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`
  3088. );
  3089. } else if (instance === currentRenderingInstance) {
  3090. warn$1(
  3091. `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`
  3092. );
  3093. }
  3094. }
  3095. },
  3096. set({ _: instance }, key, value) {
  3097. const { data, setupState, ctx } = instance;
  3098. if (hasSetupBinding(setupState, key)) {
  3099. setupState[key] = value;
  3100. return true;
  3101. } else if (setupState.__isScriptSetup && hasOwn$1(setupState, key)) {
  3102. warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`);
  3103. return false;
  3104. } else if (data !== EMPTY_OBJ && hasOwn$1(data, key)) {
  3105. data[key] = value;
  3106. return true;
  3107. } else if (hasOwn$1(instance.props, key)) {
  3108. warn$1(`Attempting to mutate prop "${key}". Props are readonly.`);
  3109. return false;
  3110. }
  3111. if (key[0] === "$" && key.slice(1) in instance) {
  3112. warn$1(
  3113. `Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.`
  3114. );
  3115. return false;
  3116. } else {
  3117. if (key in instance.appContext.config.globalProperties) {
  3118. Object.defineProperty(ctx, key, {
  3119. enumerable: true,
  3120. configurable: true,
  3121. value
  3122. });
  3123. } else {
  3124. ctx[key] = value;
  3125. }
  3126. }
  3127. return true;
  3128. },
  3129. has({
  3130. _: { data, setupState, accessCache, ctx, appContext, propsOptions }
  3131. }, key) {
  3132. let normalizedProps;
  3133. return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn$1(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn$1(normalizedProps, key) || hasOwn$1(ctx, key) || hasOwn$1(publicPropertiesMap, key) || hasOwn$1(appContext.config.globalProperties, key);
  3134. },
  3135. defineProperty(target, key, descriptor) {
  3136. if (descriptor.get != null) {
  3137. target._.accessCache[key] = 0;
  3138. } else if (hasOwn$1(descriptor, "value")) {
  3139. this.set(target, key, descriptor.value, null);
  3140. }
  3141. return Reflect.defineProperty(target, key, descriptor);
  3142. }
  3143. };
  3144. {
  3145. PublicInstanceProxyHandlers.ownKeys = (target) => {
  3146. warn$1(
  3147. `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`
  3148. );
  3149. return Reflect.ownKeys(target);
  3150. };
  3151. }
  3152. function createDevRenderContext(instance) {
  3153. const target = {};
  3154. Object.defineProperty(target, `_`, {
  3155. configurable: true,
  3156. enumerable: false,
  3157. get: () => instance
  3158. });
  3159. Object.keys(publicPropertiesMap).forEach((key) => {
  3160. Object.defineProperty(target, key, {
  3161. configurable: true,
  3162. enumerable: false,
  3163. get: () => publicPropertiesMap[key](instance),
  3164. // intercepted by the proxy so no need for implementation,
  3165. // but needed to prevent set errors
  3166. set: NOOP
  3167. });
  3168. });
  3169. return target;
  3170. }
  3171. function exposePropsOnRenderContext(instance) {
  3172. const {
  3173. ctx,
  3174. propsOptions: [propsOptions]
  3175. } = instance;
  3176. if (propsOptions) {
  3177. Object.keys(propsOptions).forEach((key) => {
  3178. Object.defineProperty(ctx, key, {
  3179. enumerable: true,
  3180. configurable: true,
  3181. get: () => instance.props[key],
  3182. set: NOOP
  3183. });
  3184. });
  3185. }
  3186. }
  3187. function exposeSetupStateOnRenderContext(instance) {
  3188. const { ctx, setupState } = instance;
  3189. Object.keys(toRaw(setupState)).forEach((key) => {
  3190. if (!setupState.__isScriptSetup) {
  3191. if (isReservedPrefix(key[0])) {
  3192. warn$1(
  3193. `setup() return property ${JSON.stringify(
  3194. key
  3195. )} should not start with "$" or "_" which are reserved prefixes for Vue internals.`
  3196. );
  3197. return;
  3198. }
  3199. Object.defineProperty(ctx, key, {
  3200. enumerable: true,
  3201. configurable: true,
  3202. get: () => setupState[key],
  3203. set: NOOP
  3204. });
  3205. }
  3206. });
  3207. }
  3208. function normalizePropsOrEmits(props) {
  3209. return isArray(props) ? props.reduce(
  3210. (normalized, p2) => (normalized[p2] = null, normalized),
  3211. {}
  3212. ) : props;
  3213. }
  3214. function createDuplicateChecker() {
  3215. const cache = /* @__PURE__ */ Object.create(null);
  3216. return (type, key) => {
  3217. if (cache[key]) {
  3218. warn$1(`${type} property "${key}" is already defined in ${cache[key]}.`);
  3219. } else {
  3220. cache[key] = type;
  3221. }
  3222. };
  3223. }
  3224. let shouldCacheAccess = true;
  3225. function applyOptions$1(instance) {
  3226. const options = resolveMergedOptions(instance);
  3227. const publicThis = instance.proxy;
  3228. const ctx = instance.ctx;
  3229. shouldCacheAccess = false;
  3230. if (options.beforeCreate) {
  3231. callHook$1(options.beforeCreate, instance, "bc");
  3232. }
  3233. const {
  3234. // state
  3235. data: dataOptions,
  3236. computed: computedOptions,
  3237. methods,
  3238. watch: watchOptions,
  3239. provide: provideOptions,
  3240. inject: injectOptions,
  3241. // lifecycle
  3242. created,
  3243. beforeMount,
  3244. mounted,
  3245. beforeUpdate,
  3246. updated,
  3247. activated,
  3248. deactivated,
  3249. beforeDestroy,
  3250. beforeUnmount,
  3251. destroyed,
  3252. unmounted,
  3253. render,
  3254. renderTracked,
  3255. renderTriggered,
  3256. errorCaptured,
  3257. serverPrefetch,
  3258. // public API
  3259. expose,
  3260. inheritAttrs,
  3261. // assets
  3262. components,
  3263. directives,
  3264. filters
  3265. } = options;
  3266. const checkDuplicateProperties = createDuplicateChecker();
  3267. {
  3268. const [propsOptions] = instance.propsOptions;
  3269. if (propsOptions) {
  3270. for (const key in propsOptions) {
  3271. checkDuplicateProperties("Props", key);
  3272. }
  3273. }
  3274. }
  3275. function initInjections() {
  3276. if (injectOptions) {
  3277. resolveInjections(injectOptions, ctx, checkDuplicateProperties);
  3278. }
  3279. }
  3280. {
  3281. initInjections();
  3282. }
  3283. if (methods) {
  3284. for (const key in methods) {
  3285. const methodHandler = methods[key];
  3286. if (isFunction(methodHandler)) {
  3287. {
  3288. Object.defineProperty(ctx, key, {
  3289. value: methodHandler.bind(publicThis),
  3290. configurable: true,
  3291. enumerable: true,
  3292. writable: true
  3293. });
  3294. }
  3295. {
  3296. checkDuplicateProperties("Methods", key);
  3297. }
  3298. } else {
  3299. warn$1(
  3300. `Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?`
  3301. );
  3302. }
  3303. }
  3304. }
  3305. if (dataOptions) {
  3306. if (!isFunction(dataOptions)) {
  3307. warn$1(
  3308. `The data option must be a function. Plain object usage is no longer supported.`
  3309. );
  3310. }
  3311. const data = dataOptions.call(publicThis, publicThis);
  3312. if (isPromise(data)) {
  3313. warn$1(
  3314. `data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.`
  3315. );
  3316. }
  3317. if (!isObject$1(data)) {
  3318. warn$1(`data() should return an object.`);
  3319. } else {
  3320. instance.data = reactive(data);
  3321. {
  3322. for (const key in data) {
  3323. checkDuplicateProperties("Data", key);
  3324. if (!isReservedPrefix(key[0])) {
  3325. Object.defineProperty(ctx, key, {
  3326. configurable: true,
  3327. enumerable: true,
  3328. get: () => data[key],
  3329. set: NOOP
  3330. });
  3331. }
  3332. }
  3333. }
  3334. }
  3335. }
  3336. shouldCacheAccess = true;
  3337. if (computedOptions) {
  3338. for (const key in computedOptions) {
  3339. const opt = computedOptions[key];
  3340. const get2 = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
  3341. if (get2 === NOOP) {
  3342. warn$1(`Computed property "${key}" has no getter.`);
  3343. }
  3344. const set2 = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
  3345. warn$1(
  3346. `Write operation failed: computed property "${key}" is readonly.`
  3347. );
  3348. };
  3349. const c2 = computed({
  3350. get: get2,
  3351. set: set2
  3352. });
  3353. Object.defineProperty(ctx, key, {
  3354. enumerable: true,
  3355. configurable: true,
  3356. get: () => c2.value,
  3357. set: (v) => c2.value = v
  3358. });
  3359. {
  3360. checkDuplicateProperties("Computed", key);
  3361. }
  3362. }
  3363. }
  3364. if (watchOptions) {
  3365. for (const key in watchOptions) {
  3366. createWatcher(watchOptions[key], ctx, publicThis, key);
  3367. }
  3368. }
  3369. function initProvides() {
  3370. if (provideOptions) {
  3371. const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
  3372. Reflect.ownKeys(provides).forEach((key) => {
  3373. provide(key, provides[key]);
  3374. });
  3375. }
  3376. }
  3377. {
  3378. initProvides();
  3379. }
  3380. {
  3381. if (created) {
  3382. callHook$1(created, instance, "c");
  3383. }
  3384. }
  3385. function registerLifecycleHook(register, hook) {
  3386. if (isArray(hook)) {
  3387. hook.forEach((_hook) => register(_hook.bind(publicThis)));
  3388. } else if (hook) {
  3389. register(hook.bind(publicThis));
  3390. }
  3391. }
  3392. registerLifecycleHook(onBeforeMount, beforeMount);
  3393. registerLifecycleHook(onMounted, mounted);
  3394. registerLifecycleHook(onBeforeUpdate, beforeUpdate);
  3395. registerLifecycleHook(onUpdated, updated);
  3396. registerLifecycleHook(onActivated, activated);
  3397. registerLifecycleHook(onDeactivated, deactivated);
  3398. registerLifecycleHook(onErrorCaptured, errorCaptured);
  3399. registerLifecycleHook(onRenderTracked, renderTracked);
  3400. registerLifecycleHook(onRenderTriggered, renderTriggered);
  3401. registerLifecycleHook(onBeforeUnmount, beforeUnmount);
  3402. registerLifecycleHook(onUnmounted, unmounted);
  3403. registerLifecycleHook(onServerPrefetch, serverPrefetch);
  3404. if (isArray(expose)) {
  3405. if (expose.length) {
  3406. const exposed = instance.exposed || (instance.exposed = {});
  3407. expose.forEach((key) => {
  3408. Object.defineProperty(exposed, key, {
  3409. get: () => publicThis[key],
  3410. set: (val) => publicThis[key] = val
  3411. });
  3412. });
  3413. } else if (!instance.exposed) {
  3414. instance.exposed = {};
  3415. }
  3416. }
  3417. if (render && instance.render === NOOP) {
  3418. instance.render = render;
  3419. }
  3420. if (inheritAttrs != null) {
  3421. instance.inheritAttrs = inheritAttrs;
  3422. }
  3423. if (components)
  3424. instance.components = components;
  3425. if (directives)
  3426. instance.directives = directives;
  3427. if (instance.ctx.$onApplyOptions) {
  3428. instance.ctx.$onApplyOptions(options, instance, publicThis);
  3429. }
  3430. }
  3431. function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) {
  3432. if (isArray(injectOptions)) {
  3433. injectOptions = normalizeInject(injectOptions);
  3434. }
  3435. for (const key in injectOptions) {
  3436. const opt = injectOptions[key];
  3437. let injected;
  3438. if (isObject$1(opt)) {
  3439. if ("default" in opt) {
  3440. injected = inject(
  3441. opt.from || key,
  3442. opt.default,
  3443. true
  3444. );
  3445. } else {
  3446. injected = inject(opt.from || key);
  3447. }
  3448. } else {
  3449. injected = inject(opt);
  3450. }
  3451. if (isRef(injected)) {
  3452. Object.defineProperty(ctx, key, {
  3453. enumerable: true,
  3454. configurable: true,
  3455. get: () => injected.value,
  3456. set: (v) => injected.value = v
  3457. });
  3458. } else {
  3459. ctx[key] = injected;
  3460. }
  3461. {
  3462. checkDuplicateProperties("Inject", key);
  3463. }
  3464. }
  3465. }
  3466. function callHook$1(hook, instance, type) {
  3467. callWithAsyncErrorHandling(
  3468. isArray(hook) ? hook.map((h2) => h2.bind(instance.proxy)) : hook.bind(instance.proxy),
  3469. instance,
  3470. type
  3471. );
  3472. }
  3473. function createWatcher(raw, ctx, publicThis, key) {
  3474. const getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
  3475. if (isString(raw)) {
  3476. const handler = ctx[raw];
  3477. if (isFunction(handler)) {
  3478. watch(getter, handler);
  3479. } else {
  3480. warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
  3481. }
  3482. } else if (isFunction(raw)) {
  3483. watch(getter, raw.bind(publicThis));
  3484. } else if (isObject$1(raw)) {
  3485. if (isArray(raw)) {
  3486. raw.forEach((r2) => createWatcher(r2, ctx, publicThis, key));
  3487. } else {
  3488. const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
  3489. if (isFunction(handler)) {
  3490. watch(getter, handler, raw);
  3491. } else {
  3492. warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
  3493. }
  3494. }
  3495. } else {
  3496. warn$1(`Invalid watch option: "${key}"`, raw);
  3497. }
  3498. }
  3499. function resolveMergedOptions(instance) {
  3500. const base = instance.type;
  3501. const { mixins, extends: extendsOptions } = base;
  3502. const {
  3503. mixins: globalMixins,
  3504. optionsCache: cache,
  3505. config: { optionMergeStrategies }
  3506. } = instance.appContext;
  3507. const cached = cache.get(base);
  3508. let resolved;
  3509. if (cached) {
  3510. resolved = cached;
  3511. } else if (!globalMixins.length && !mixins && !extendsOptions) {
  3512. {
  3513. resolved = base;
  3514. }
  3515. } else {
  3516. resolved = {};
  3517. if (globalMixins.length) {
  3518. globalMixins.forEach(
  3519. (m2) => mergeOptions(resolved, m2, optionMergeStrategies, true)
  3520. );
  3521. }
  3522. mergeOptions(resolved, base, optionMergeStrategies);
  3523. }
  3524. if (isObject$1(base)) {
  3525. cache.set(base, resolved);
  3526. }
  3527. return resolved;
  3528. }
  3529. function mergeOptions(to, from, strats, asMixin = false) {
  3530. const { mixins, extends: extendsOptions } = from;
  3531. if (extendsOptions) {
  3532. mergeOptions(to, extendsOptions, strats, true);
  3533. }
  3534. if (mixins) {
  3535. mixins.forEach(
  3536. (m2) => mergeOptions(to, m2, strats, true)
  3537. );
  3538. }
  3539. for (const key in from) {
  3540. if (asMixin && key === "expose") {
  3541. warn$1(
  3542. `"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`
  3543. );
  3544. } else {
  3545. const strat = internalOptionMergeStrats[key] || strats && strats[key];
  3546. to[key] = strat ? strat(to[key], from[key]) : from[key];
  3547. }
  3548. }
  3549. return to;
  3550. }
  3551. const internalOptionMergeStrats = {
  3552. data: mergeDataFn,
  3553. props: mergeEmitsOrPropsOptions,
  3554. emits: mergeEmitsOrPropsOptions,
  3555. // objects
  3556. methods: mergeObjectOptions,
  3557. computed: mergeObjectOptions,
  3558. // lifecycle
  3559. beforeCreate: mergeAsArray$1,
  3560. created: mergeAsArray$1,
  3561. beforeMount: mergeAsArray$1,
  3562. mounted: mergeAsArray$1,
  3563. beforeUpdate: mergeAsArray$1,
  3564. updated: mergeAsArray$1,
  3565. beforeDestroy: mergeAsArray$1,
  3566. beforeUnmount: mergeAsArray$1,
  3567. destroyed: mergeAsArray$1,
  3568. unmounted: mergeAsArray$1,
  3569. activated: mergeAsArray$1,
  3570. deactivated: mergeAsArray$1,
  3571. errorCaptured: mergeAsArray$1,
  3572. serverPrefetch: mergeAsArray$1,
  3573. // assets
  3574. components: mergeObjectOptions,
  3575. directives: mergeObjectOptions,
  3576. // watch
  3577. watch: mergeWatchOptions,
  3578. // provide / inject
  3579. provide: mergeDataFn,
  3580. inject: mergeInject
  3581. };
  3582. function mergeDataFn(to, from) {
  3583. if (!from) {
  3584. return to;
  3585. }
  3586. if (!to) {
  3587. return from;
  3588. }
  3589. return function mergedDataFn() {
  3590. return extend(
  3591. isFunction(to) ? to.call(this, this) : to,
  3592. isFunction(from) ? from.call(this, this) : from
  3593. );
  3594. };
  3595. }
  3596. function mergeInject(to, from) {
  3597. return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
  3598. }
  3599. function normalizeInject(raw) {
  3600. if (isArray(raw)) {
  3601. const res = {};
  3602. for (let i = 0; i < raw.length; i++) {
  3603. res[raw[i]] = raw[i];
  3604. }
  3605. return res;
  3606. }
  3607. return raw;
  3608. }
  3609. function mergeAsArray$1(to, from) {
  3610. return to ? [...new Set([].concat(to, from))] : from;
  3611. }
  3612. function mergeObjectOptions(to, from) {
  3613. return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from;
  3614. }
  3615. function mergeEmitsOrPropsOptions(to, from) {
  3616. if (to) {
  3617. if (isArray(to) && isArray(from)) {
  3618. return [.../* @__PURE__ */ new Set([...to, ...from])];
  3619. }
  3620. return extend(
  3621. /* @__PURE__ */ Object.create(null),
  3622. normalizePropsOrEmits(to),
  3623. normalizePropsOrEmits(from != null ? from : {})
  3624. );
  3625. } else {
  3626. return from;
  3627. }
  3628. }
  3629. function mergeWatchOptions(to, from) {
  3630. if (!to)
  3631. return from;
  3632. if (!from)
  3633. return to;
  3634. const merged = extend(/* @__PURE__ */ Object.create(null), to);
  3635. for (const key in from) {
  3636. merged[key] = mergeAsArray$1(to[key], from[key]);
  3637. }
  3638. return merged;
  3639. }
  3640. function initProps$1(instance, rawProps, isStateful, isSSR = false) {
  3641. const props = {};
  3642. const attrs = {};
  3643. instance.propsDefaults = /* @__PURE__ */ Object.create(null);
  3644. setFullProps(instance, rawProps, props, attrs);
  3645. for (const key in instance.propsOptions[0]) {
  3646. if (!(key in props)) {
  3647. props[key] = void 0;
  3648. }
  3649. }
  3650. {
  3651. validateProps(rawProps || {}, props, instance);
  3652. }
  3653. if (isStateful) {
  3654. instance.props = isSSR ? props : shallowReactive(props);
  3655. } else {
  3656. if (!instance.type.props) {
  3657. instance.props = attrs;
  3658. } else {
  3659. instance.props = props;
  3660. }
  3661. }
  3662. instance.attrs = attrs;
  3663. }
  3664. function isInHmrContext(instance) {
  3665. }
  3666. function updateProps(instance, rawProps, rawPrevProps, optimized) {
  3667. const {
  3668. props,
  3669. attrs,
  3670. vnode: { patchFlag }
  3671. } = instance;
  3672. const rawCurrentProps = toRaw(props);
  3673. const [options] = instance.propsOptions;
  3674. let hasAttrsChanged = false;
  3675. if (
  3676. // always force full diff in dev
  3677. // - #1942 if hmr is enabled with sfc component
  3678. // - vite#872 non-sfc component used by sfc component
  3679. !isInHmrContext() && (optimized || patchFlag > 0) && !(patchFlag & 16)
  3680. ) {
  3681. if (patchFlag & 8) {
  3682. const propsToUpdate = instance.vnode.dynamicProps;
  3683. for (let i = 0; i < propsToUpdate.length; i++) {
  3684. let key = propsToUpdate[i];
  3685. if (isEmitListener(instance.emitsOptions, key)) {
  3686. continue;
  3687. }
  3688. const value = rawProps[key];
  3689. if (options) {
  3690. if (hasOwn$1(attrs, key)) {
  3691. if (value !== attrs[key]) {
  3692. attrs[key] = value;
  3693. hasAttrsChanged = true;
  3694. }
  3695. } else {
  3696. const camelizedKey = camelize(key);
  3697. props[camelizedKey] = resolvePropValue$1(
  3698. options,
  3699. rawCurrentProps,
  3700. camelizedKey,
  3701. value,
  3702. instance,
  3703. false
  3704. );
  3705. }
  3706. } else {
  3707. if (value !== attrs[key]) {
  3708. attrs[key] = value;
  3709. hasAttrsChanged = true;
  3710. }
  3711. }
  3712. }
  3713. }
  3714. } else {
  3715. if (setFullProps(instance, rawProps, props, attrs)) {
  3716. hasAttrsChanged = true;
  3717. }
  3718. let kebabKey;
  3719. for (const key in rawCurrentProps) {
  3720. if (!rawProps || // for camelCase
  3721. !hasOwn$1(rawProps, key) && // it's possible the original props was passed in as kebab-case
  3722. // and converted to camelCase (#955)
  3723. ((kebabKey = hyphenate(key)) === key || !hasOwn$1(rawProps, kebabKey))) {
  3724. if (options) {
  3725. if (rawPrevProps && // for camelCase
  3726. (rawPrevProps[key] !== void 0 || // for kebab-case
  3727. rawPrevProps[kebabKey] !== void 0)) {
  3728. props[key] = resolvePropValue$1(
  3729. options,
  3730. rawCurrentProps,
  3731. key,
  3732. void 0,
  3733. instance,
  3734. true
  3735. );
  3736. }
  3737. } else {
  3738. delete props[key];
  3739. }
  3740. }
  3741. }
  3742. if (attrs !== rawCurrentProps) {
  3743. for (const key in attrs) {
  3744. if (!rawProps || !hasOwn$1(rawProps, key) && true) {
  3745. delete attrs[key];
  3746. hasAttrsChanged = true;
  3747. }
  3748. }
  3749. }
  3750. }
  3751. if (hasAttrsChanged) {
  3752. trigger(instance, "set", "$attrs");
  3753. }
  3754. {
  3755. validateProps(rawProps || {}, props, instance);
  3756. }
  3757. }
  3758. function setFullProps(instance, rawProps, props, attrs) {
  3759. const [options, needCastKeys] = instance.propsOptions;
  3760. let hasAttrsChanged = false;
  3761. let rawCastValues;
  3762. if (rawProps) {
  3763. for (let key in rawProps) {
  3764. if (isReservedProp(key)) {
  3765. continue;
  3766. }
  3767. const value = rawProps[key];
  3768. let camelKey;
  3769. if (options && hasOwn$1(options, camelKey = camelize(key))) {
  3770. if (!needCastKeys || !needCastKeys.includes(camelKey)) {
  3771. props[camelKey] = value;
  3772. } else {
  3773. (rawCastValues || (rawCastValues = {}))[camelKey] = value;
  3774. }
  3775. } else if (!isEmitListener(instance.emitsOptions, key)) {
  3776. if (!(key in attrs) || value !== attrs[key]) {
  3777. attrs[key] = value;
  3778. hasAttrsChanged = true;
  3779. }
  3780. }
  3781. }
  3782. }
  3783. if (needCastKeys) {
  3784. const rawCurrentProps = toRaw(props);
  3785. const castValues = rawCastValues || EMPTY_OBJ;
  3786. for (let i = 0; i < needCastKeys.length; i++) {
  3787. const key = needCastKeys[i];
  3788. props[key] = resolvePropValue$1(
  3789. options,
  3790. rawCurrentProps,
  3791. key,
  3792. castValues[key],
  3793. instance,
  3794. !hasOwn$1(castValues, key)
  3795. );
  3796. }
  3797. }
  3798. return hasAttrsChanged;
  3799. }
  3800. function resolvePropValue$1(options, props, key, value, instance, isAbsent) {
  3801. const opt = options[key];
  3802. if (opt != null) {
  3803. const hasDefault = hasOwn$1(opt, "default");
  3804. if (hasDefault && value === void 0) {
  3805. const defaultValue = opt.default;
  3806. if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
  3807. const { propsDefaults } = instance;
  3808. if (key in propsDefaults) {
  3809. value = propsDefaults[key];
  3810. } else {
  3811. const reset = setCurrentInstance(instance);
  3812. value = propsDefaults[key] = defaultValue.call(
  3813. null,
  3814. props
  3815. );
  3816. reset();
  3817. }
  3818. } else {
  3819. value = defaultValue;
  3820. }
  3821. }
  3822. if (opt[
  3823. 0
  3824. /* shouldCast */
  3825. ]) {
  3826. if (isAbsent && !hasDefault) {
  3827. value = false;
  3828. } else if (opt[
  3829. 1
  3830. /* shouldCastTrue */
  3831. ] && (value === "" || value === hyphenate(key))) {
  3832. value = true;
  3833. }
  3834. }
  3835. }
  3836. return value;
  3837. }
  3838. function normalizePropsOptions(comp, appContext, asMixin = false) {
  3839. const cache = appContext.propsCache;
  3840. const cached = cache.get(comp);
  3841. if (cached) {
  3842. return cached;
  3843. }
  3844. const raw = comp.props;
  3845. const normalized = {};
  3846. const needCastKeys = [];
  3847. let hasExtends = false;
  3848. if (!isFunction(comp)) {
  3849. const extendProps = (raw2) => {
  3850. hasExtends = true;
  3851. const [props, keys] = normalizePropsOptions(raw2, appContext, true);
  3852. extend(normalized, props);
  3853. if (keys)
  3854. needCastKeys.push(...keys);
  3855. };
  3856. if (!asMixin && appContext.mixins.length) {
  3857. appContext.mixins.forEach(extendProps);
  3858. }
  3859. if (comp.extends) {
  3860. extendProps(comp.extends);
  3861. }
  3862. if (comp.mixins) {
  3863. comp.mixins.forEach(extendProps);
  3864. }
  3865. }
  3866. if (!raw && !hasExtends) {
  3867. if (isObject$1(comp)) {
  3868. cache.set(comp, EMPTY_ARR);
  3869. }
  3870. return EMPTY_ARR;
  3871. }
  3872. if (isArray(raw)) {
  3873. for (let i = 0; i < raw.length; i++) {
  3874. if (!isString(raw[i])) {
  3875. warn$1(`props must be strings when using array syntax.`, raw[i]);
  3876. }
  3877. const normalizedKey = camelize(raw[i]);
  3878. if (validatePropName(normalizedKey)) {
  3879. normalized[normalizedKey] = EMPTY_OBJ;
  3880. }
  3881. }
  3882. } else if (raw) {
  3883. if (!isObject$1(raw)) {
  3884. warn$1(`invalid props options`, raw);
  3885. }
  3886. for (const key in raw) {
  3887. const normalizedKey = camelize(key);
  3888. if (validatePropName(normalizedKey)) {
  3889. const opt = raw[key];
  3890. const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
  3891. if (prop) {
  3892. const booleanIndex = getTypeIndex(Boolean, prop.type);
  3893. const stringIndex = getTypeIndex(String, prop.type);
  3894. prop[
  3895. 0
  3896. /* shouldCast */
  3897. ] = booleanIndex > -1;
  3898. prop[
  3899. 1
  3900. /* shouldCastTrue */
  3901. ] = stringIndex < 0 || booleanIndex < stringIndex;
  3902. if (booleanIndex > -1 || hasOwn$1(prop, "default")) {
  3903. needCastKeys.push(normalizedKey);
  3904. }
  3905. }
  3906. }
  3907. }
  3908. }
  3909. const res = [normalized, needCastKeys];
  3910. if (isObject$1(comp)) {
  3911. cache.set(comp, res);
  3912. }
  3913. return res;
  3914. }
  3915. function validatePropName(key) {
  3916. if (key[0] !== "$" && !isReservedProp(key)) {
  3917. return true;
  3918. } else {
  3919. warn$1(`Invalid prop name: "${key}" is a reserved property.`);
  3920. }
  3921. return false;
  3922. }
  3923. function getType$1(ctor) {
  3924. if (ctor === null) {
  3925. return "null";
  3926. }
  3927. if (typeof ctor === "function") {
  3928. return ctor.name || "";
  3929. } else if (typeof ctor === "object") {
  3930. const name = ctor.constructor && ctor.constructor.name;
  3931. return name || "";
  3932. }
  3933. return "";
  3934. }
  3935. function isSameType(a, b) {
  3936. return getType$1(a) === getType$1(b);
  3937. }
  3938. function getTypeIndex(type, expectedTypes) {
  3939. if (isArray(expectedTypes)) {
  3940. return expectedTypes.findIndex((t2) => isSameType(t2, type));
  3941. } else if (isFunction(expectedTypes)) {
  3942. return isSameType(expectedTypes, type) ? 0 : -1;
  3943. }
  3944. return -1;
  3945. }
  3946. function validateProps(rawProps, props, instance) {
  3947. const resolvedValues = toRaw(props);
  3948. const options = instance.propsOptions[0];
  3949. for (const key in options) {
  3950. let opt = options[key];
  3951. if (opt == null)
  3952. continue;
  3953. validateProp$1(
  3954. key,
  3955. resolvedValues[key],
  3956. opt,
  3957. shallowReadonly(resolvedValues),
  3958. !hasOwn$1(rawProps, key) && !hasOwn$1(rawProps, hyphenate(key))
  3959. );
  3960. }
  3961. }
  3962. function validateProp$1(name, value, prop, props, isAbsent) {
  3963. const { type, required, validator, skipCheck } = prop;
  3964. if (required && isAbsent) {
  3965. warn$1('Missing required prop: "' + name + '"');
  3966. return;
  3967. }
  3968. if (value == null && !required) {
  3969. return;
  3970. }
  3971. if (type != null && type !== true && !skipCheck) {
  3972. let isValid = false;
  3973. const types = isArray(type) ? type : [type];
  3974. const expectedTypes = [];
  3975. for (let i = 0; i < types.length && !isValid; i++) {
  3976. const { valid, expectedType } = assertType$1(value, types[i]);
  3977. expectedTypes.push(expectedType || "");
  3978. isValid = valid;
  3979. }
  3980. if (!isValid) {
  3981. warn$1(getInvalidTypeMessage$1(name, value, expectedTypes));
  3982. return;
  3983. }
  3984. }
  3985. if (validator && !validator(value, props)) {
  3986. warn$1('Invalid prop: custom validator check failed for prop "' + name + '".');
  3987. }
  3988. }
  3989. const isSimpleType$1 = /* @__PURE__ */ makeMap(
  3990. "String,Number,Boolean,Function,Symbol,BigInt"
  3991. );
  3992. function assertType$1(value, type) {
  3993. let valid;
  3994. const expectedType = getType$1(type);
  3995. if (isSimpleType$1(expectedType)) {
  3996. const t2 = typeof value;
  3997. valid = t2 === expectedType.toLowerCase();
  3998. if (!valid && t2 === "object") {
  3999. valid = value instanceof type;
  4000. }
  4001. } else if (expectedType === "Object") {
  4002. valid = isObject$1(value);
  4003. } else if (expectedType === "Array") {
  4004. valid = isArray(value);
  4005. } else if (expectedType === "null") {
  4006. valid = value === null;
  4007. } else {
  4008. valid = value instanceof type;
  4009. }
  4010. return {
  4011. valid,
  4012. expectedType
  4013. };
  4014. }
  4015. function getInvalidTypeMessage$1(name, value, expectedTypes) {
  4016. if (expectedTypes.length === 0) {
  4017. return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`;
  4018. }
  4019. let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
  4020. const expectedType = expectedTypes[0];
  4021. const receivedType = toRawType(value);
  4022. const expectedValue = styleValue$1(value, expectedType);
  4023. const receivedValue = styleValue$1(value, receivedType);
  4024. if (expectedTypes.length === 1 && isExplicable$1(expectedType) && !isBoolean$1(expectedType, receivedType)) {
  4025. message += ` with value ${expectedValue}`;
  4026. }
  4027. message += `, got ${receivedType} `;
  4028. if (isExplicable$1(receivedType)) {
  4029. message += `with value ${receivedValue}.`;
  4030. }
  4031. return message;
  4032. }
  4033. function styleValue$1(value, type) {
  4034. if (type === "String") {
  4035. return `"${value}"`;
  4036. } else if (type === "Number") {
  4037. return `${Number(value)}`;
  4038. } else {
  4039. return `${value}`;
  4040. }
  4041. }
  4042. function isExplicable$1(type) {
  4043. const explicitTypes = ["string", "number", "boolean"];
  4044. return explicitTypes.some((elem) => type.toLowerCase() === elem);
  4045. }
  4046. function isBoolean$1(...args) {
  4047. return args.some((elem) => elem.toLowerCase() === "boolean");
  4048. }
  4049. let supported;
  4050. let perf;
  4051. function startMeasure(instance, type) {
  4052. if (instance.appContext.config.performance && isSupported()) {
  4053. perf.mark(`vue-${type}-${instance.uid}`);
  4054. }
  4055. {
  4056. devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
  4057. }
  4058. }
  4059. function endMeasure(instance, type) {
  4060. if (instance.appContext.config.performance && isSupported()) {
  4061. const startTag = `vue-${type}-${instance.uid}`;
  4062. const endTag = startTag + `:end`;
  4063. perf.mark(endTag);
  4064. perf.measure(
  4065. `<${formatComponentName(instance, instance.type)}> ${type}`,
  4066. startTag,
  4067. endTag
  4068. );
  4069. perf.clearMarks(startTag);
  4070. perf.clearMarks(endTag);
  4071. }
  4072. {
  4073. devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
  4074. }
  4075. }
  4076. function isSupported() {
  4077. if (supported !== void 0) {
  4078. return supported;
  4079. }
  4080. if (typeof window !== "undefined" && window.performance) {
  4081. supported = true;
  4082. perf = window.performance;
  4083. } else {
  4084. supported = false;
  4085. }
  4086. return supported;
  4087. }
  4088. const queuePostRenderEffect$1 = queuePostFlushCb;
  4089. const Fragment = Symbol.for("v-fgt");
  4090. const Text = Symbol.for("v-txt");
  4091. const Comment = Symbol.for("v-cmt");
  4092. const Static = Symbol.for("v-stc");
  4093. function isVNode(value) {
  4094. return value ? value.__v_isVNode === true : false;
  4095. }
  4096. const InternalObjectKey = `__vInternal`;
  4097. function guardReactiveProps(props) {
  4098. if (!props)
  4099. return null;
  4100. return isProxy(props) || InternalObjectKey in props ? extend({}, props) : props;
  4101. }
  4102. const emptyAppContext = createAppContext();
  4103. let uid = 0;
  4104. function createComponentInstance(vnode, parent, suspense) {
  4105. const type = vnode.type;
  4106. const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
  4107. const instance = {
  4108. uid: uid++,
  4109. vnode,
  4110. type,
  4111. parent,
  4112. appContext,
  4113. root: null,
  4114. // to be immediately set
  4115. next: null,
  4116. subTree: null,
  4117. // will be set synchronously right after creation
  4118. effect: null,
  4119. update: null,
  4120. // will be set synchronously right after creation
  4121. scope: new EffectScope(
  4122. true
  4123. /* detached */
  4124. ),
  4125. render: null,
  4126. proxy: null,
  4127. exposed: null,
  4128. exposeProxy: null,
  4129. withProxy: null,
  4130. provides: parent ? parent.provides : Object.create(appContext.provides),
  4131. accessCache: null,
  4132. renderCache: [],
  4133. // local resolved assets
  4134. components: null,
  4135. directives: null,
  4136. // resolved props and emits options
  4137. propsOptions: normalizePropsOptions(type, appContext),
  4138. emitsOptions: normalizeEmitsOptions(type, appContext),
  4139. // emit
  4140. emit: null,
  4141. // to be set immediately
  4142. emitted: null,
  4143. // props default value
  4144. propsDefaults: EMPTY_OBJ,
  4145. // inheritAttrs
  4146. inheritAttrs: type.inheritAttrs,
  4147. // state
  4148. ctx: EMPTY_OBJ,
  4149. data: EMPTY_OBJ,
  4150. props: EMPTY_OBJ,
  4151. attrs: EMPTY_OBJ,
  4152. slots: EMPTY_OBJ,
  4153. refs: EMPTY_OBJ,
  4154. setupState: EMPTY_OBJ,
  4155. setupContext: null,
  4156. attrsProxy: null,
  4157. slotsProxy: null,
  4158. // suspense related
  4159. suspense,
  4160. suspenseId: suspense ? suspense.pendingId : 0,
  4161. asyncDep: null,
  4162. asyncResolved: false,
  4163. // lifecycle hooks
  4164. // not using enums here because it results in computed properties
  4165. isMounted: false,
  4166. isUnmounted: false,
  4167. isDeactivated: false,
  4168. bc: null,
  4169. c: null,
  4170. bm: null,
  4171. m: null,
  4172. bu: null,
  4173. u: null,
  4174. um: null,
  4175. bum: null,
  4176. da: null,
  4177. a: null,
  4178. rtg: null,
  4179. rtc: null,
  4180. ec: null,
  4181. sp: null,
  4182. // fixed by xxxxxx 用于存储uni-app的元素缓存
  4183. $uniElements: /* @__PURE__ */ new Map(),
  4184. $templateUniElementRefs: [],
  4185. $templateUniElementStyles: {},
  4186. $eS: {},
  4187. $eA: {}
  4188. };
  4189. {
  4190. instance.ctx = createDevRenderContext(instance);
  4191. }
  4192. instance.root = parent ? parent.root : instance;
  4193. instance.emit = emit.bind(null, instance);
  4194. if (vnode.ce) {
  4195. vnode.ce(instance);
  4196. }
  4197. return instance;
  4198. }
  4199. let currentInstance = null;
  4200. const getCurrentInstance = () => currentInstance || currentRenderingInstance;
  4201. let internalSetCurrentInstance;
  4202. let setInSSRSetupState;
  4203. {
  4204. internalSetCurrentInstance = (i) => {
  4205. currentInstance = i;
  4206. };
  4207. setInSSRSetupState = (v) => {
  4208. isInSSRComponentSetup = v;
  4209. };
  4210. }
  4211. const setCurrentInstance = (instance) => {
  4212. const prev = currentInstance;
  4213. internalSetCurrentInstance(instance);
  4214. instance.scope.on();
  4215. return () => {
  4216. instance.scope.off();
  4217. internalSetCurrentInstance(prev);
  4218. };
  4219. };
  4220. const unsetCurrentInstance = () => {
  4221. currentInstance && currentInstance.scope.off();
  4222. internalSetCurrentInstance(null);
  4223. };
  4224. const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
  4225. function validateComponentName(name, { isNativeTag }) {
  4226. if (isBuiltInTag(name) || isNativeTag(name)) {
  4227. warn$1(
  4228. "Do not use built-in or reserved HTML elements as component id: " + name
  4229. );
  4230. }
  4231. }
  4232. function isStatefulComponent(instance) {
  4233. return instance.vnode.shapeFlag & 4;
  4234. }
  4235. let isInSSRComponentSetup = false;
  4236. function setupComponent(instance, isSSR = false) {
  4237. isSSR && setInSSRSetupState(isSSR);
  4238. const {
  4239. props
  4240. /*, children*/
  4241. } = instance.vnode;
  4242. const isStateful = isStatefulComponent(instance);
  4243. initProps$1(instance, props, isStateful, isSSR);
  4244. const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
  4245. isSSR && setInSSRSetupState(false);
  4246. return setupResult;
  4247. }
  4248. function setupStatefulComponent(instance, isSSR) {
  4249. const Component2 = instance.type;
  4250. {
  4251. if (Component2.name) {
  4252. validateComponentName(Component2.name, instance.appContext.config);
  4253. }
  4254. if (Component2.components) {
  4255. const names = Object.keys(Component2.components);
  4256. for (let i = 0; i < names.length; i++) {
  4257. validateComponentName(names[i], instance.appContext.config);
  4258. }
  4259. }
  4260. if (Component2.directives) {
  4261. const names = Object.keys(Component2.directives);
  4262. for (let i = 0; i < names.length; i++) {
  4263. validateDirectiveName(names[i]);
  4264. }
  4265. }
  4266. if (Component2.compilerOptions && isRuntimeOnly()) {
  4267. warn$1(
  4268. `"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.`
  4269. );
  4270. }
  4271. }
  4272. instance.accessCache = /* @__PURE__ */ Object.create(null);
  4273. instance.proxy = markRaw(new Proxy(instance.ctx, PublicInstanceProxyHandlers));
  4274. {
  4275. exposePropsOnRenderContext(instance);
  4276. }
  4277. const { setup } = Component2;
  4278. if (setup) {
  4279. const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
  4280. const reset = setCurrentInstance(instance);
  4281. pauseTracking();
  4282. const setupResult = callWithErrorHandling(
  4283. setup,
  4284. instance,
  4285. 0,
  4286. [
  4287. shallowReadonly(instance.props),
  4288. setupContext
  4289. ]
  4290. );
  4291. resetTracking();
  4292. reset();
  4293. if (isPromise(setupResult)) {
  4294. setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
  4295. {
  4296. warn$1(
  4297. `setup() returned a Promise, but the version of Vue you are using does not support it yet.`
  4298. );
  4299. }
  4300. } else {
  4301. handleSetupResult(instance, setupResult, isSSR);
  4302. }
  4303. } else {
  4304. finishComponentSetup(instance, isSSR);
  4305. }
  4306. }
  4307. function handleSetupResult(instance, setupResult, isSSR) {
  4308. if (isFunction(setupResult)) {
  4309. {
  4310. instance.render = setupResult;
  4311. }
  4312. } else if (isObject$1(setupResult)) {
  4313. if (isVNode(setupResult)) {
  4314. warn$1(
  4315. `setup() should not return VNodes directly - return a render function instead.`
  4316. );
  4317. }
  4318. {
  4319. instance.devtoolsRawSetupState = setupResult;
  4320. }
  4321. instance.setupState = proxyRefs(setupResult);
  4322. {
  4323. exposeSetupStateOnRenderContext(instance);
  4324. }
  4325. } else if (setupResult !== void 0) {
  4326. warn$1(
  4327. `setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}`
  4328. );
  4329. }
  4330. finishComponentSetup(instance, isSSR);
  4331. }
  4332. let compile;
  4333. const isRuntimeOnly = () => !compile;
  4334. function finishComponentSetup(instance, isSSR, skipOptions) {
  4335. const Component2 = instance.type;
  4336. if (!instance.render) {
  4337. instance.render = Component2.render || NOOP;
  4338. }
  4339. {
  4340. const reset = setCurrentInstance(instance);
  4341. pauseTracking();
  4342. try {
  4343. applyOptions$1(instance);
  4344. } finally {
  4345. resetTracking();
  4346. reset();
  4347. }
  4348. }
  4349. if (!Component2.render && instance.render === NOOP && !isSSR) {
  4350. if (Component2.template) {
  4351. warn$1(
  4352. `Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".`
  4353. );
  4354. } else {
  4355. warn$1(`Component is missing template or render function.`);
  4356. }
  4357. }
  4358. }
  4359. function getAttrsProxy(instance) {
  4360. return instance.attrsProxy || (instance.attrsProxy = new Proxy(
  4361. instance.attrs,
  4362. {
  4363. get(target, key) {
  4364. track(instance, "get", "$attrs");
  4365. return target[key];
  4366. },
  4367. set() {
  4368. warn$1(`setupContext.attrs is readonly.`);
  4369. return false;
  4370. },
  4371. deleteProperty() {
  4372. warn$1(`setupContext.attrs is readonly.`);
  4373. return false;
  4374. }
  4375. }
  4376. ));
  4377. }
  4378. function getSlotsProxy(instance) {
  4379. return instance.slotsProxy || (instance.slotsProxy = new Proxy(instance.slots, {
  4380. get(target, key) {
  4381. track(instance, "get", "$slots");
  4382. return target[key];
  4383. }
  4384. }));
  4385. }
  4386. function createSetupContext(instance) {
  4387. const expose = (exposed) => {
  4388. {
  4389. if (instance.exposed) {
  4390. warn$1(`expose() should be called only once per setup().`);
  4391. }
  4392. if (exposed != null) {
  4393. let exposedType = typeof exposed;
  4394. if (exposedType === "object") {
  4395. if (isArray(exposed)) {
  4396. exposedType = "array";
  4397. } else if (isRef(exposed)) {
  4398. exposedType = "ref";
  4399. }
  4400. }
  4401. if (exposedType !== "object") {
  4402. warn$1(
  4403. `expose() should be passed a plain object, received ${exposedType}.`
  4404. );
  4405. }
  4406. }
  4407. }
  4408. instance.exposed = exposed || {};
  4409. };
  4410. {
  4411. return Object.freeze({
  4412. get attrs() {
  4413. return getAttrsProxy(instance);
  4414. },
  4415. get slots() {
  4416. return getSlotsProxy(instance);
  4417. },
  4418. get emit() {
  4419. return (event, ...args) => instance.emit(event, ...args);
  4420. },
  4421. expose
  4422. });
  4423. }
  4424. }
  4425. function getExposeProxy(instance) {
  4426. if (instance.exposed) {
  4427. return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
  4428. get(target, key) {
  4429. if (key in target) {
  4430. return target[key];
  4431. }
  4432. return instance.proxy[key];
  4433. },
  4434. has(target, key) {
  4435. return key in target || key in publicPropertiesMap;
  4436. }
  4437. }));
  4438. }
  4439. }
  4440. const classifyRE = /(?:^|[-_])(\w)/g;
  4441. const classify = (str) => str.replace(classifyRE, (c2) => c2.toUpperCase()).replace(/[-_]/g, "");
  4442. function getComponentName(Component2, includeInferred = true) {
  4443. return isFunction(Component2) ? Component2.displayName || Component2.name : Component2.name || includeInferred && Component2.__name;
  4444. }
  4445. function formatComponentName(instance, Component2, isRoot = false) {
  4446. let name = getComponentName(Component2);
  4447. if (!name && Component2.__file) {
  4448. const match = Component2.__file.match(/([^/\\]+)\.\w+$/);
  4449. if (match) {
  4450. name = match[1];
  4451. }
  4452. }
  4453. if (!name && instance && instance.parent) {
  4454. const inferFromRegistry = (registry) => {
  4455. for (const key in registry) {
  4456. if (registry[key] === Component2) {
  4457. return key;
  4458. }
  4459. }
  4460. };
  4461. name = inferFromRegistry(
  4462. instance.components || instance.parent.type.components
  4463. ) || inferFromRegistry(instance.appContext.components);
  4464. }
  4465. return name ? classify(name) : isRoot ? `App` : `Anonymous`;
  4466. }
  4467. const computed = (getterOrOptions, debugOptions) => {
  4468. const c2 = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
  4469. {
  4470. const i = getCurrentInstance();
  4471. if (i && i.appContext.config.warnRecursiveComputed) {
  4472. c2._warnRecursive = true;
  4473. }
  4474. }
  4475. return c2;
  4476. };
  4477. const version = "3.4.21";
  4478. const warn = warn$1;
  4479. function unwrapper(target) {
  4480. return unref(target);
  4481. }
  4482. const ARRAYTYPE = "[object Array]";
  4483. const OBJECTTYPE = "[object Object]";
  4484. function diff(current, pre) {
  4485. const result = {};
  4486. syncKeys(current, pre);
  4487. _diff(current, pre, "", result);
  4488. return result;
  4489. }
  4490. function syncKeys(current, pre) {
  4491. current = unwrapper(current);
  4492. if (current === pre)
  4493. return;
  4494. const rootCurrentType = toTypeString(current);
  4495. const rootPreType = toTypeString(pre);
  4496. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  4497. for (let key in pre) {
  4498. const currentValue = current[key];
  4499. if (currentValue === void 0) {
  4500. current[key] = null;
  4501. } else {
  4502. syncKeys(currentValue, pre[key]);
  4503. }
  4504. }
  4505. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  4506. if (current.length >= pre.length) {
  4507. pre.forEach((item, index2) => {
  4508. syncKeys(current[index2], item);
  4509. });
  4510. }
  4511. }
  4512. }
  4513. function _diff(current, pre, path, result) {
  4514. current = unwrapper(current);
  4515. if (current === pre)
  4516. return;
  4517. const rootCurrentType = toTypeString(current);
  4518. const rootPreType = toTypeString(pre);
  4519. if (rootCurrentType == OBJECTTYPE) {
  4520. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  4521. setResult(result, path, current);
  4522. } else {
  4523. for (let key in current) {
  4524. const currentValue = unwrapper(current[key]);
  4525. const preValue = pre[key];
  4526. const currentType = toTypeString(currentValue);
  4527. const preType = toTypeString(preValue);
  4528. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  4529. if (currentValue != preValue) {
  4530. setResult(
  4531. result,
  4532. (path == "" ? "" : path + ".") + key,
  4533. currentValue
  4534. );
  4535. }
  4536. } else if (currentType == ARRAYTYPE) {
  4537. if (preType != ARRAYTYPE) {
  4538. setResult(
  4539. result,
  4540. (path == "" ? "" : path + ".") + key,
  4541. currentValue
  4542. );
  4543. } else {
  4544. if (currentValue.length < preValue.length) {
  4545. setResult(
  4546. result,
  4547. (path == "" ? "" : path + ".") + key,
  4548. currentValue
  4549. );
  4550. } else {
  4551. currentValue.forEach((item, index2) => {
  4552. _diff(
  4553. item,
  4554. preValue[index2],
  4555. (path == "" ? "" : path + ".") + key + "[" + index2 + "]",
  4556. result
  4557. );
  4558. });
  4559. }
  4560. }
  4561. } else if (currentType == OBJECTTYPE) {
  4562. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  4563. setResult(
  4564. result,
  4565. (path == "" ? "" : path + ".") + key,
  4566. currentValue
  4567. );
  4568. } else {
  4569. for (let subKey in currentValue) {
  4570. _diff(
  4571. currentValue[subKey],
  4572. preValue[subKey],
  4573. (path == "" ? "" : path + ".") + key + "." + subKey,
  4574. result
  4575. );
  4576. }
  4577. }
  4578. }
  4579. }
  4580. }
  4581. } else if (rootCurrentType == ARRAYTYPE) {
  4582. if (rootPreType != ARRAYTYPE) {
  4583. setResult(result, path, current);
  4584. } else {
  4585. if (current.length < pre.length) {
  4586. setResult(result, path, current);
  4587. } else {
  4588. current.forEach((item, index2) => {
  4589. _diff(item, pre[index2], path + "[" + index2 + "]", result);
  4590. });
  4591. }
  4592. }
  4593. } else {
  4594. setResult(result, path, current);
  4595. }
  4596. }
  4597. function setResult(result, k, v) {
  4598. result[k] = v;
  4599. }
  4600. function hasComponentEffect(instance) {
  4601. return queue$1.includes(instance.update);
  4602. }
  4603. function flushCallbacks(instance) {
  4604. const ctx = instance.ctx;
  4605. const callbacks = ctx.__next_tick_callbacks;
  4606. if (callbacks && callbacks.length) {
  4607. const copies = callbacks.slice(0);
  4608. callbacks.length = 0;
  4609. for (let i = 0; i < copies.length; i++) {
  4610. copies[i]();
  4611. }
  4612. }
  4613. }
  4614. function nextTick(instance, fn) {
  4615. const ctx = instance.ctx;
  4616. if (!ctx.__next_tick_pending && !hasComponentEffect(instance)) {
  4617. return nextTick$1(fn && fn.bind(instance.proxy));
  4618. }
  4619. let _resolve;
  4620. if (!ctx.__next_tick_callbacks) {
  4621. ctx.__next_tick_callbacks = [];
  4622. }
  4623. ctx.__next_tick_callbacks.push(() => {
  4624. if (fn) {
  4625. callWithErrorHandling(
  4626. fn.bind(instance.proxy),
  4627. instance,
  4628. 14
  4629. );
  4630. } else if (_resolve) {
  4631. _resolve(instance.proxy);
  4632. }
  4633. });
  4634. return new Promise((resolve2) => {
  4635. _resolve = resolve2;
  4636. });
  4637. }
  4638. function clone(src, seen) {
  4639. src = unwrapper(src);
  4640. const type = typeof src;
  4641. if (type === "object" && src !== null) {
  4642. let copy = seen.get(src);
  4643. if (typeof copy !== "undefined") {
  4644. return copy;
  4645. }
  4646. if (isArray(src)) {
  4647. const len = src.length;
  4648. copy = new Array(len);
  4649. seen.set(src, copy);
  4650. for (let i = 0; i < len; i++) {
  4651. copy[i] = clone(src[i], seen);
  4652. }
  4653. } else {
  4654. copy = {};
  4655. seen.set(src, copy);
  4656. for (const name in src) {
  4657. if (hasOwn$1(src, name)) {
  4658. copy[name] = clone(src[name], seen);
  4659. }
  4660. }
  4661. }
  4662. return copy;
  4663. }
  4664. if (type !== "symbol") {
  4665. return src;
  4666. }
  4667. }
  4668. function deepCopy(src) {
  4669. return clone(src, typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : /* @__PURE__ */ new Map());
  4670. }
  4671. function getMPInstanceData(instance, keys) {
  4672. const data = instance.data;
  4673. const ret = /* @__PURE__ */ Object.create(null);
  4674. keys.forEach((key) => {
  4675. ret[key] = data[key];
  4676. });
  4677. return ret;
  4678. }
  4679. function patch(instance, data, oldData) {
  4680. if (!data) {
  4681. return;
  4682. }
  4683. data = deepCopy(data);
  4684. data.$eS = instance.$eS || {};
  4685. data.$eA = instance.$eA || {};
  4686. const ctx = instance.ctx;
  4687. const mpType = ctx.mpType;
  4688. if (mpType === "page" || mpType === "component") {
  4689. data.r0 = 1;
  4690. const mpInstance = ctx.$scope;
  4691. const keys = Object.keys(data);
  4692. const diffData = diff(data, oldData || getMPInstanceData(mpInstance, keys));
  4693. if (Object.keys(diffData).length) {
  4694. ctx.__next_tick_pending = true;
  4695. mpInstance.setData(diffData, () => {
  4696. ctx.__next_tick_pending = false;
  4697. flushCallbacks(instance);
  4698. });
  4699. flushPreFlushCbs();
  4700. } else {
  4701. flushCallbacks(instance);
  4702. }
  4703. }
  4704. }
  4705. function initAppConfig(appConfig) {
  4706. appConfig.globalProperties.$nextTick = function $nextTick(fn) {
  4707. return nextTick(this.$, fn);
  4708. };
  4709. }
  4710. function onApplyOptions(options, instance, publicThis) {
  4711. instance.appContext.config.globalProperties.$applyOptions(
  4712. options,
  4713. instance,
  4714. publicThis
  4715. );
  4716. const computedOptions = options.computed;
  4717. if (computedOptions) {
  4718. const keys = Object.keys(computedOptions);
  4719. if (keys.length) {
  4720. const ctx = instance.ctx;
  4721. if (!ctx.$computedKeys) {
  4722. ctx.$computedKeys = [];
  4723. }
  4724. ctx.$computedKeys.push(...keys);
  4725. }
  4726. }
  4727. delete instance.ctx.$onApplyOptions;
  4728. }
  4729. function setRef$1(instance, isUnmount = false) {
  4730. const {
  4731. setupState,
  4732. $templateRefs,
  4733. $templateUniElementRefs,
  4734. ctx: { $scope, $mpPlatform }
  4735. } = instance;
  4736. if ($mpPlatform === "mp-alipay") {
  4737. return;
  4738. }
  4739. if (!$scope || !$templateRefs && !$templateUniElementRefs) {
  4740. return;
  4741. }
  4742. if (isUnmount) {
  4743. $templateRefs && $templateRefs.forEach(
  4744. (templateRef) => setTemplateRef(templateRef, null, setupState)
  4745. );
  4746. $templateUniElementRefs && $templateUniElementRefs.forEach(
  4747. (templateRef) => setTemplateRef(templateRef, null, setupState)
  4748. );
  4749. return;
  4750. }
  4751. const check = $mpPlatform === "mp-baidu" || $mpPlatform === "mp-toutiao";
  4752. const doSetByRefs = (refs) => {
  4753. if (refs.length === 0) {
  4754. return [];
  4755. }
  4756. const mpComponents = (
  4757. // 字节小程序 selectAllComponents 可能返回 null
  4758. // https://github.com/dcloudio/uni-app/issues/3954
  4759. ($scope.selectAllComponents(".r") || []).concat(
  4760. $scope.selectAllComponents(".r-i-f") || []
  4761. )
  4762. );
  4763. return refs.filter((templateRef) => {
  4764. const refValue = findComponentPublicInstance(mpComponents, templateRef.i);
  4765. if (check && refValue === null) {
  4766. return true;
  4767. }
  4768. setTemplateRef(templateRef, refValue, setupState);
  4769. return false;
  4770. });
  4771. };
  4772. const doSet = () => {
  4773. if ($templateRefs) {
  4774. const refs = doSetByRefs($templateRefs);
  4775. if (refs.length && instance.proxy && instance.proxy.$scope) {
  4776. instance.proxy.$scope.setData({ r1: 1 }, () => {
  4777. doSetByRefs(refs);
  4778. });
  4779. }
  4780. }
  4781. };
  4782. if ($templateUniElementRefs && $templateUniElementRefs.length) {
  4783. nextTick(instance, () => {
  4784. $templateUniElementRefs.forEach((templateRef) => {
  4785. if (isArray(templateRef.v)) {
  4786. templateRef.v.forEach((v) => {
  4787. setTemplateRef(templateRef, v, setupState);
  4788. });
  4789. } else {
  4790. setTemplateRef(templateRef, templateRef.v, setupState);
  4791. }
  4792. });
  4793. });
  4794. }
  4795. if ($scope._$setRef) {
  4796. $scope._$setRef(doSet);
  4797. } else {
  4798. nextTick(instance, doSet);
  4799. }
  4800. }
  4801. function toSkip(value) {
  4802. if (isObject$1(value)) {
  4803. markRaw(value);
  4804. }
  4805. return value;
  4806. }
  4807. function findComponentPublicInstance(mpComponents, id2) {
  4808. const mpInstance = mpComponents.find(
  4809. (com) => com && (com.properties || com.props).uI === id2
  4810. );
  4811. if (mpInstance) {
  4812. const vm = mpInstance.$vm;
  4813. if (vm) {
  4814. return getExposeProxy(vm.$) || vm;
  4815. }
  4816. return toSkip(mpInstance);
  4817. }
  4818. return null;
  4819. }
  4820. function setTemplateRef({ r: r2, f: f2 }, refValue, setupState) {
  4821. if (isFunction(r2)) {
  4822. r2(refValue, {});
  4823. } else {
  4824. const _isString = isString(r2);
  4825. const _isRef = isRef(r2);
  4826. if (_isString || _isRef) {
  4827. if (f2) {
  4828. if (!_isRef) {
  4829. return;
  4830. }
  4831. if (!isArray(r2.value)) {
  4832. r2.value = [];
  4833. }
  4834. const existing = r2.value;
  4835. if (existing.indexOf(refValue) === -1) {
  4836. existing.push(refValue);
  4837. if (!refValue) {
  4838. return;
  4839. }
  4840. if (refValue.$) {
  4841. onBeforeUnmount(() => remove(existing, refValue), refValue.$);
  4842. }
  4843. }
  4844. } else if (_isString) {
  4845. if (hasOwn$1(setupState, r2)) {
  4846. setupState[r2] = refValue;
  4847. }
  4848. } else if (isRef(r2)) {
  4849. r2.value = refValue;
  4850. } else {
  4851. warnRef(r2);
  4852. }
  4853. } else {
  4854. warnRef(r2);
  4855. }
  4856. }
  4857. }
  4858. function warnRef(ref2) {
  4859. warn("Invalid template ref type:", ref2, `(${typeof ref2})`);
  4860. }
  4861. const queuePostRenderEffect = queuePostFlushCb;
  4862. function mountComponent(initialVNode, options) {
  4863. const instance = initialVNode.component = createComponentInstance(initialVNode, options.parentComponent, null);
  4864. instance.renderer = options.mpType ? options.mpType : "component";
  4865. {
  4866. instance.ctx.$onApplyOptions = onApplyOptions;
  4867. instance.ctx.$children = [];
  4868. }
  4869. if (options.mpType === "app") {
  4870. instance.render = NOOP;
  4871. }
  4872. if (options.onBeforeSetup) {
  4873. options.onBeforeSetup(instance, options);
  4874. }
  4875. {
  4876. pushWarningContext(initialVNode);
  4877. startMeasure(instance, `mount`);
  4878. }
  4879. {
  4880. startMeasure(instance, `init`);
  4881. }
  4882. setupComponent(instance);
  4883. {
  4884. endMeasure(instance, `init`);
  4885. }
  4886. {
  4887. if (options.parentComponent && instance.proxy) {
  4888. options.parentComponent.ctx.$children.push(getExposeProxy(instance) || instance.proxy);
  4889. }
  4890. }
  4891. setupRenderEffect(instance);
  4892. {
  4893. popWarningContext();
  4894. endMeasure(instance, `mount`);
  4895. }
  4896. return instance.proxy;
  4897. }
  4898. const getFunctionalFallthrough = (attrs) => {
  4899. let res;
  4900. for (const key in attrs) {
  4901. if (key === "class" || key === "style" || isOn(key)) {
  4902. (res || (res = {}))[key] = attrs[key];
  4903. }
  4904. }
  4905. return res;
  4906. };
  4907. function renderComponentRoot(instance) {
  4908. const {
  4909. type: Component2,
  4910. vnode,
  4911. proxy,
  4912. withProxy,
  4913. props,
  4914. propsOptions: [propsOptions],
  4915. slots,
  4916. attrs,
  4917. emit: emit2,
  4918. render,
  4919. renderCache,
  4920. data,
  4921. setupState,
  4922. ctx,
  4923. uid: uid2,
  4924. appContext: {
  4925. app: {
  4926. config: {
  4927. globalProperties: { pruneComponentPropsCache: pruneComponentPropsCache2 }
  4928. }
  4929. }
  4930. },
  4931. inheritAttrs
  4932. } = instance;
  4933. instance.$uniElementIds = /* @__PURE__ */ new Map();
  4934. instance.$templateRefs = [];
  4935. instance.$templateUniElementRefs = [];
  4936. instance.$templateUniElementStyles = {};
  4937. instance.$ei = 0;
  4938. pruneComponentPropsCache2(uid2);
  4939. instance.__counter = instance.__counter === 0 ? 1 : 0;
  4940. let result;
  4941. const prev = setCurrentRenderingInstance(instance);
  4942. try {
  4943. if (vnode.shapeFlag & 4) {
  4944. fallthroughAttrs(inheritAttrs, props, propsOptions, attrs);
  4945. const proxyToUse = withProxy || proxy;
  4946. result = render.call(
  4947. proxyToUse,
  4948. proxyToUse,
  4949. renderCache,
  4950. props,
  4951. setupState,
  4952. data,
  4953. ctx
  4954. );
  4955. } else {
  4956. fallthroughAttrs(
  4957. inheritAttrs,
  4958. props,
  4959. propsOptions,
  4960. Component2.props ? attrs : getFunctionalFallthrough(attrs)
  4961. );
  4962. const render2 = Component2;
  4963. result = render2.length > 1 ? render2(props, { attrs, slots, emit: emit2 }) : render2(
  4964. props,
  4965. null
  4966. /* we know it doesn't need it */
  4967. );
  4968. }
  4969. } catch (err) {
  4970. handleError(err, instance, 1);
  4971. result = false;
  4972. }
  4973. setRef$1(instance);
  4974. setCurrentRenderingInstance(prev);
  4975. return result;
  4976. }
  4977. function fallthroughAttrs(inheritAttrs, props, propsOptions, fallthroughAttrs2) {
  4978. if (props && fallthroughAttrs2 && inheritAttrs !== false) {
  4979. const keys = Object.keys(fallthroughAttrs2).filter(
  4980. (key) => key !== "class" && key !== "style"
  4981. );
  4982. if (!keys.length) {
  4983. return;
  4984. }
  4985. if (propsOptions && keys.some(isModelListener)) {
  4986. keys.forEach((key) => {
  4987. if (!isModelListener(key) || !(key.slice(9) in propsOptions)) {
  4988. props[key] = fallthroughAttrs2[key];
  4989. }
  4990. });
  4991. } else {
  4992. keys.forEach((key) => props[key] = fallthroughAttrs2[key]);
  4993. }
  4994. }
  4995. }
  4996. const updateComponentPreRender = (instance) => {
  4997. pauseTracking();
  4998. flushPreFlushCbs();
  4999. resetTracking();
  5000. };
  5001. function componentUpdateScopedSlotsFn() {
  5002. const scopedSlotsData = this.$scopedSlotsData;
  5003. if (!scopedSlotsData || scopedSlotsData.length === 0) {
  5004. return;
  5005. }
  5006. const mpInstance = this.ctx.$scope;
  5007. const oldData = mpInstance.data;
  5008. const diffData = /* @__PURE__ */ Object.create(null);
  5009. scopedSlotsData.forEach(({ path, index: index2, data }) => {
  5010. const oldScopedSlotData = getValueByDataPath(oldData, path);
  5011. const diffPath = isString(index2) ? `${path}.${index2}` : `${path}[${index2}]`;
  5012. if (typeof oldScopedSlotData === "undefined" || typeof oldScopedSlotData[index2] === "undefined") {
  5013. diffData[diffPath] = data;
  5014. } else {
  5015. const diffScopedSlotData = diff(
  5016. data,
  5017. oldScopedSlotData[index2]
  5018. );
  5019. Object.keys(diffScopedSlotData).forEach((name) => {
  5020. diffData[diffPath + "." + name] = diffScopedSlotData[name];
  5021. });
  5022. }
  5023. });
  5024. scopedSlotsData.length = 0;
  5025. if (Object.keys(diffData).length) {
  5026. mpInstance.setData(diffData);
  5027. }
  5028. }
  5029. function toggleRecurse({ effect: effect2, update }, allowed) {
  5030. effect2.allowRecurse = update.allowRecurse = allowed;
  5031. }
  5032. function setupRenderEffect(instance) {
  5033. const updateScopedSlots = componentUpdateScopedSlotsFn.bind(
  5034. instance
  5035. );
  5036. instance.$updateScopedSlots = () => nextTick$1(() => queueJob(updateScopedSlots));
  5037. const componentUpdateFn = () => {
  5038. if (!instance.isMounted) {
  5039. onBeforeUnmount(() => {
  5040. setRef$1(instance, true);
  5041. }, instance);
  5042. {
  5043. startMeasure(instance, `patch`);
  5044. }
  5045. patch(instance, renderComponentRoot(instance));
  5046. {
  5047. endMeasure(instance, `patch`);
  5048. }
  5049. {
  5050. devtoolsComponentAdded(instance);
  5051. }
  5052. } else {
  5053. const { next, bu, u } = instance;
  5054. {
  5055. pushWarningContext(next || instance.vnode);
  5056. }
  5057. toggleRecurse(instance, false);
  5058. updateComponentPreRender();
  5059. if (bu) {
  5060. invokeArrayFns$1(bu);
  5061. }
  5062. toggleRecurse(instance, true);
  5063. {
  5064. startMeasure(instance, `patch`);
  5065. }
  5066. patch(instance, renderComponentRoot(instance));
  5067. {
  5068. endMeasure(instance, `patch`);
  5069. }
  5070. if (u) {
  5071. queuePostRenderEffect(u);
  5072. }
  5073. {
  5074. devtoolsComponentUpdated(instance);
  5075. }
  5076. {
  5077. popWarningContext();
  5078. }
  5079. }
  5080. };
  5081. const effect2 = instance.effect = new ReactiveEffect(
  5082. componentUpdateFn,
  5083. NOOP,
  5084. () => queueJob(update),
  5085. instance.scope
  5086. // track it in component's effect scope
  5087. );
  5088. const update = instance.update = () => {
  5089. if (effect2.dirty) {
  5090. effect2.run();
  5091. }
  5092. };
  5093. update.id = instance.uid;
  5094. toggleRecurse(instance, true);
  5095. {
  5096. effect2.onTrack = instance.rtc ? (e2) => invokeArrayFns$1(instance.rtc, e2) : void 0;
  5097. effect2.onTrigger = instance.rtg ? (e2) => invokeArrayFns$1(instance.rtg, e2) : void 0;
  5098. update.ownerInstance = instance;
  5099. }
  5100. {
  5101. update();
  5102. }
  5103. }
  5104. function unmountComponent(instance) {
  5105. const { bum, scope, update, um } = instance;
  5106. if (bum) {
  5107. invokeArrayFns$1(bum);
  5108. }
  5109. {
  5110. const parentInstance = instance.parent;
  5111. if (parentInstance) {
  5112. const $children = parentInstance.ctx.$children;
  5113. const target = getExposeProxy(instance) || instance.proxy;
  5114. const index2 = $children.indexOf(target);
  5115. if (index2 > -1) {
  5116. $children.splice(index2, 1);
  5117. }
  5118. }
  5119. }
  5120. scope.stop();
  5121. if (update) {
  5122. update.active = false;
  5123. }
  5124. if (um) {
  5125. queuePostRenderEffect(um);
  5126. }
  5127. queuePostRenderEffect(() => {
  5128. instance.isUnmounted = true;
  5129. });
  5130. {
  5131. devtoolsComponentRemoved(instance);
  5132. }
  5133. }
  5134. const oldCreateApp = createAppAPI();
  5135. function getTarget() {
  5136. if (typeof window !== "undefined") {
  5137. return window;
  5138. }
  5139. if (typeof globalThis !== "undefined") {
  5140. return globalThis;
  5141. }
  5142. if (typeof global !== "undefined") {
  5143. return global;
  5144. }
  5145. if (typeof my !== "undefined") {
  5146. return my;
  5147. }
  5148. }
  5149. function createVueApp(rootComponent, rootProps = null) {
  5150. const target = getTarget();
  5151. target.__VUE__ = true;
  5152. {
  5153. setDevtoolsHook(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
  5154. }
  5155. const app = oldCreateApp(rootComponent, rootProps);
  5156. const appContext = app._context;
  5157. initAppConfig(appContext.config);
  5158. const createVNode2 = (initialVNode) => {
  5159. initialVNode.appContext = appContext;
  5160. initialVNode.shapeFlag = 6;
  5161. return initialVNode;
  5162. };
  5163. const createComponent2 = function createComponent22(initialVNode, options) {
  5164. return mountComponent(createVNode2(initialVNode), options);
  5165. };
  5166. const destroyComponent = function destroyComponent2(component) {
  5167. return component && unmountComponent(component.$);
  5168. };
  5169. app.mount = function mount() {
  5170. rootComponent.render = NOOP;
  5171. const instance = mountComponent(
  5172. createVNode2({ type: rootComponent }),
  5173. {
  5174. mpType: "app",
  5175. mpInstance: null,
  5176. parentComponent: null,
  5177. slots: [],
  5178. props: null
  5179. }
  5180. );
  5181. app._instance = instance.$;
  5182. {
  5183. devtoolsInitApp(app, version);
  5184. }
  5185. instance.$app = app;
  5186. instance.$createComponent = createComponent2;
  5187. instance.$destroyComponent = destroyComponent;
  5188. appContext.$appInstance = instance;
  5189. return instance;
  5190. };
  5191. app.unmount = function unmount() {
  5192. warn(`Cannot unmount an app.`);
  5193. };
  5194. return app;
  5195. }
  5196. function injectLifecycleHook(name, hook, publicThis, instance) {
  5197. if (isFunction(hook)) {
  5198. injectHook(name, hook.bind(publicThis), instance);
  5199. }
  5200. }
  5201. function initHooks$1(options, instance, publicThis) {
  5202. const mpType = options.mpType || publicThis.$mpType;
  5203. if (!mpType || mpType === "component" || // instance.renderer 标识页面是否作为组件渲染
  5204. mpType === "page" && instance.renderer === "component") {
  5205. return;
  5206. }
  5207. Object.keys(options).forEach((name) => {
  5208. if (isUniLifecycleHook(name, options[name], false)) {
  5209. const hooks = options[name];
  5210. if (isArray(hooks)) {
  5211. hooks.forEach((hook) => injectLifecycleHook(name, hook, publicThis, instance));
  5212. } else {
  5213. injectLifecycleHook(name, hooks, publicThis, instance);
  5214. }
  5215. }
  5216. });
  5217. }
  5218. function applyOptions(options, instance, publicThis) {
  5219. initHooks$1(options, instance, publicThis);
  5220. }
  5221. function set(target, key, val) {
  5222. return target[key] = val;
  5223. }
  5224. function $callMethod(method, ...args) {
  5225. const fn = this[method];
  5226. if (fn) {
  5227. return fn(...args);
  5228. }
  5229. console.error(`method ${method} not found`);
  5230. return null;
  5231. }
  5232. function createErrorHandler(app) {
  5233. const userErrorHandler = app.config.errorHandler;
  5234. return function errorHandler(err, instance, info) {
  5235. if (userErrorHandler) {
  5236. userErrorHandler(err, instance, info);
  5237. }
  5238. const appInstance = app._instance;
  5239. if (!appInstance || !appInstance.proxy) {
  5240. throw err;
  5241. }
  5242. if (appInstance[ON_ERROR]) {
  5243. {
  5244. appInstance.proxy.$callHook(ON_ERROR, err);
  5245. }
  5246. } else {
  5247. logError(err, info, instance ? instance.$.vnode : null, false);
  5248. }
  5249. };
  5250. }
  5251. function mergeAsArray(to, from) {
  5252. return to ? [...new Set([].concat(to, from))] : from;
  5253. }
  5254. function initOptionMergeStrategies(optionMergeStrategies) {
  5255. UniLifecycleHooks.forEach((name) => {
  5256. optionMergeStrategies[name] = mergeAsArray;
  5257. });
  5258. }
  5259. let realAtob;
  5260. const b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
  5261. const b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  5262. if (typeof atob !== "function") {
  5263. realAtob = function(str) {
  5264. str = String(str).replace(/[\t\n\f\r ]+/g, "");
  5265. if (!b64re.test(str)) {
  5266. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  5267. }
  5268. str += "==".slice(2 - (str.length & 3));
  5269. var bitmap;
  5270. var result = "";
  5271. var r1;
  5272. var r2;
  5273. var i = 0;
  5274. for (; i < str.length; ) {
  5275. bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 | (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
  5276. result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) : r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) : String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  5277. }
  5278. return result;
  5279. };
  5280. } else {
  5281. realAtob = atob;
  5282. }
  5283. function b64DecodeUnicode(str) {
  5284. return decodeURIComponent(realAtob(str).split("").map(function(c2) {
  5285. return "%" + ("00" + c2.charCodeAt(0).toString(16)).slice(-2);
  5286. }).join(""));
  5287. }
  5288. function getCurrentUserInfo() {
  5289. const token = index.getStorageSync("uni_id_token") || "";
  5290. const tokenArr = token.split(".");
  5291. if (!token || tokenArr.length !== 3) {
  5292. return {
  5293. uid: null,
  5294. role: [],
  5295. permission: [],
  5296. tokenExpired: 0
  5297. };
  5298. }
  5299. let userInfo;
  5300. try {
  5301. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  5302. } catch (error) {
  5303. throw new Error("获取当前用户信息出错,详细错误信息为:" + error.message);
  5304. }
  5305. userInfo.tokenExpired = userInfo.exp * 1e3;
  5306. delete userInfo.exp;
  5307. delete userInfo.iat;
  5308. return userInfo;
  5309. }
  5310. function uniIdMixin(globalProperties) {
  5311. globalProperties.uniIDHasRole = function(roleId) {
  5312. const { role } = getCurrentUserInfo();
  5313. return role.indexOf(roleId) > -1;
  5314. };
  5315. globalProperties.uniIDHasPermission = function(permissionId) {
  5316. const { permission } = getCurrentUserInfo();
  5317. return this.uniIDHasRole("admin") || permission.indexOf(permissionId) > -1;
  5318. };
  5319. globalProperties.uniIDTokenValid = function() {
  5320. const { tokenExpired } = getCurrentUserInfo();
  5321. return tokenExpired > Date.now();
  5322. };
  5323. }
  5324. function initApp(app) {
  5325. const appConfig = app.config;
  5326. appConfig.errorHandler = invokeCreateErrorHandler(app, createErrorHandler);
  5327. initOptionMergeStrategies(appConfig.optionMergeStrategies);
  5328. const globalProperties = appConfig.globalProperties;
  5329. {
  5330. uniIdMixin(globalProperties);
  5331. }
  5332. {
  5333. globalProperties.$set = set;
  5334. globalProperties.$applyOptions = applyOptions;
  5335. globalProperties.$callMethod = $callMethod;
  5336. }
  5337. {
  5338. index.invokeCreateVueAppHook(app);
  5339. }
  5340. }
  5341. const propsCaches = /* @__PURE__ */ Object.create(null);
  5342. function renderProps(props) {
  5343. const { uid: uid2, __counter } = getCurrentInstance();
  5344. const propsId = (propsCaches[uid2] || (propsCaches[uid2] = [])).push(guardReactiveProps(props)) - 1;
  5345. return uid2 + "," + propsId + "," + __counter;
  5346. }
  5347. function pruneComponentPropsCache(uid2) {
  5348. delete propsCaches[uid2];
  5349. }
  5350. function findComponentPropsData(up) {
  5351. if (!up) {
  5352. return;
  5353. }
  5354. const [uid2, propsId] = up.split(",");
  5355. if (!propsCaches[uid2]) {
  5356. return;
  5357. }
  5358. return propsCaches[uid2][parseInt(propsId)];
  5359. }
  5360. var plugin = {
  5361. install(app) {
  5362. initApp(app);
  5363. app.config.globalProperties.pruneComponentPropsCache = pruneComponentPropsCache;
  5364. const oldMount = app.mount;
  5365. app.mount = function mount(rootContainer) {
  5366. const instance = oldMount.call(app, rootContainer);
  5367. const createApp2 = getCreateApp();
  5368. if (createApp2) {
  5369. createApp2(instance);
  5370. } else {
  5371. if (typeof createMiniProgramApp !== "undefined") {
  5372. createMiniProgramApp(instance);
  5373. }
  5374. }
  5375. return instance;
  5376. };
  5377. }
  5378. };
  5379. function getCreateApp() {
  5380. const method = "createApp";
  5381. if (typeof global !== "undefined" && typeof global[method] !== "undefined") {
  5382. return global[method];
  5383. } else if (typeof my !== "undefined") {
  5384. return my[method];
  5385. }
  5386. }
  5387. function stringifyStyle(value) {
  5388. if (isString(value)) {
  5389. return value;
  5390. }
  5391. return stringify(normalizeStyle(value));
  5392. }
  5393. function stringify(styles) {
  5394. let ret = "";
  5395. if (!styles || isString(styles)) {
  5396. return ret;
  5397. }
  5398. for (const key in styles) {
  5399. ret += `${key.startsWith(`--`) ? key : hyphenate(key)}:${styles[key]};`;
  5400. }
  5401. return ret;
  5402. }
  5403. function vOn(value, key) {
  5404. const instance = getCurrentInstance();
  5405. const ctx = instance.ctx;
  5406. const extraKey = typeof key !== "undefined" && (ctx.$mpPlatform === "mp-weixin" || ctx.$mpPlatform === "mp-qq" || ctx.$mpPlatform === "mp-xhs") && (isString(key) || typeof key === "number") ? "_" + key : "";
  5407. const name = "e" + instance.$ei++ + extraKey;
  5408. const mpInstance = ctx.$scope;
  5409. if (!value) {
  5410. delete mpInstance[name];
  5411. return name;
  5412. }
  5413. const existingInvoker = mpInstance[name];
  5414. if (existingInvoker) {
  5415. existingInvoker.value = value;
  5416. } else {
  5417. mpInstance[name] = createInvoker(value, instance);
  5418. }
  5419. return name;
  5420. }
  5421. function createInvoker(initialValue, instance) {
  5422. const invoker = (e2) => {
  5423. patchMPEvent(e2);
  5424. let args = [e2];
  5425. if (instance && instance.ctx.$getTriggerEventDetail) {
  5426. if (typeof e2.detail === "number") {
  5427. e2.detail = instance.ctx.$getTriggerEventDetail(e2.detail);
  5428. }
  5429. }
  5430. if (e2.detail && e2.detail.__args__) {
  5431. args = e2.detail.__args__;
  5432. }
  5433. const eventValue = invoker.value;
  5434. const invoke = () => callWithAsyncErrorHandling(patchStopImmediatePropagation(e2, eventValue), instance, 5, args);
  5435. const eventTarget = e2.target;
  5436. const eventSync = eventTarget ? eventTarget.dataset ? String(eventTarget.dataset.eventsync) === "true" : false : false;
  5437. if (bubbles.includes(e2.type) && !eventSync) {
  5438. setTimeout(invoke);
  5439. } else {
  5440. const res = invoke();
  5441. if (e2.type === "input" && (isArray(res) || isPromise(res))) {
  5442. return;
  5443. }
  5444. return res;
  5445. }
  5446. };
  5447. invoker.value = initialValue;
  5448. return invoker;
  5449. }
  5450. const bubbles = [
  5451. // touch事件暂不做延迟,否则在 Android 上会影响性能,比如一些拖拽跟手手势等
  5452. // 'touchstart',
  5453. // 'touchmove',
  5454. // 'touchcancel',
  5455. // 'touchend',
  5456. "tap",
  5457. "longpress",
  5458. "longtap",
  5459. "transitionend",
  5460. "animationstart",
  5461. "animationiteration",
  5462. "animationend",
  5463. "touchforcechange"
  5464. ];
  5465. function patchMPEvent(event, instance) {
  5466. if (event.type && event.target) {
  5467. event.preventDefault = NOOP;
  5468. event.stopPropagation = NOOP;
  5469. event.stopImmediatePropagation = NOOP;
  5470. if (!hasOwn$1(event, "detail")) {
  5471. event.detail = {};
  5472. }
  5473. if (hasOwn$1(event, "markerId")) {
  5474. event.detail = typeof event.detail === "object" ? event.detail : {};
  5475. event.detail.markerId = event.markerId;
  5476. }
  5477. if (isPlainObject(event.detail) && hasOwn$1(event.detail, "checked") && !hasOwn$1(event.detail, "value")) {
  5478. event.detail.value = event.detail.checked;
  5479. }
  5480. if (isPlainObject(event.detail)) {
  5481. event.target = extend({}, event.target, event.detail);
  5482. }
  5483. }
  5484. }
  5485. function patchStopImmediatePropagation(e2, value) {
  5486. if (isArray(value)) {
  5487. const originalStop = e2.stopImmediatePropagation;
  5488. e2.stopImmediatePropagation = () => {
  5489. originalStop && originalStop.call(e2);
  5490. e2._stopped = true;
  5491. };
  5492. return value.map((fn) => (e3) => !e3._stopped && fn(e3));
  5493. } else {
  5494. return value;
  5495. }
  5496. }
  5497. const o = (value, key) => vOn(value, key);
  5498. const s = (value) => stringifyStyle(value);
  5499. const e = (target, ...sources) => extend(target, ...sources);
  5500. const n = (value) => normalizeClass(value);
  5501. const t = (val) => toDisplayString(val);
  5502. const p = (props) => renderProps(props);
  5503. function createApp$1(rootComponent, rootProps = null) {
  5504. rootComponent && (rootComponent.mpType = "app");
  5505. return createVueApp(rootComponent, rootProps).use(plugin);
  5506. }
  5507. const createSSRApp = createApp$1;
  5508. function getLocaleLanguage$1() {
  5509. let localeLanguage = "";
  5510. {
  5511. localeLanguage = normalizeLocale(my.getSystemInfoSync().language) || LOCALE_EN;
  5512. }
  5513. return localeLanguage;
  5514. }
  5515. function getBaseSystemInfo() {
  5516. return my.getSystemInfoSync();
  5517. }
  5518. function validateProtocolFail(name, msg) {
  5519. console.warn(`${name}: ${msg}`);
  5520. }
  5521. function validateProtocol(name, data, protocol, onFail) {
  5522. if (!onFail) {
  5523. onFail = validateProtocolFail;
  5524. }
  5525. for (const key in protocol) {
  5526. const errMsg = validateProp(key, data[key], protocol[key], !hasOwn$1(data, key));
  5527. if (isString(errMsg)) {
  5528. onFail(name, errMsg);
  5529. }
  5530. }
  5531. }
  5532. function validateProtocols(name, args, protocol, onFail) {
  5533. if (!protocol) {
  5534. return;
  5535. }
  5536. if (!isArray(protocol)) {
  5537. return validateProtocol(name, args[0] || /* @__PURE__ */ Object.create(null), protocol, onFail);
  5538. }
  5539. const len = protocol.length;
  5540. const argsLen = args.length;
  5541. for (let i = 0; i < len; i++) {
  5542. const opts = protocol[i];
  5543. const data = /* @__PURE__ */ Object.create(null);
  5544. if (argsLen > i) {
  5545. data[opts.name] = args[i];
  5546. }
  5547. validateProtocol(name, data, { [opts.name]: opts }, onFail);
  5548. }
  5549. }
  5550. function validateProp(name, value, prop, isAbsent) {
  5551. if (!isPlainObject(prop)) {
  5552. prop = { type: prop };
  5553. }
  5554. const { type, required, validator } = prop;
  5555. if (required && isAbsent) {
  5556. return 'Missing required args: "' + name + '"';
  5557. }
  5558. if (value == null && !required) {
  5559. return;
  5560. }
  5561. if (type != null) {
  5562. let isValid = false;
  5563. const types = isArray(type) ? type : [type];
  5564. const expectedTypes = [];
  5565. for (let i = 0; i < types.length && !isValid; i++) {
  5566. const { valid, expectedType } = assertType(value, types[i]);
  5567. expectedTypes.push(expectedType || "");
  5568. isValid = valid;
  5569. }
  5570. if (!isValid) {
  5571. return getInvalidTypeMessage(name, value, expectedTypes);
  5572. }
  5573. }
  5574. if (validator) {
  5575. return validator(value);
  5576. }
  5577. }
  5578. const isSimpleType = /* @__PURE__ */ makeMap("String,Number,Boolean,Function,Symbol");
  5579. function assertType(value, type) {
  5580. let valid;
  5581. const expectedType = getType(type);
  5582. if (isSimpleType(expectedType)) {
  5583. const t2 = typeof value;
  5584. valid = t2 === expectedType.toLowerCase();
  5585. if (!valid && t2 === "object") {
  5586. valid = value instanceof type;
  5587. }
  5588. } else if (expectedType === "Object") {
  5589. valid = isObject$1(value);
  5590. } else if (expectedType === "Array") {
  5591. valid = isArray(value);
  5592. } else {
  5593. {
  5594. valid = value instanceof type;
  5595. }
  5596. }
  5597. return {
  5598. valid,
  5599. expectedType
  5600. };
  5601. }
  5602. function getInvalidTypeMessage(name, value, expectedTypes) {
  5603. let message = `Invalid args: type check failed for args "${name}". Expected ${expectedTypes.map(capitalize).join(", ")}`;
  5604. const expectedType = expectedTypes[0];
  5605. const receivedType = toRawType(value);
  5606. const expectedValue = styleValue(value, expectedType);
  5607. const receivedValue = styleValue(value, receivedType);
  5608. if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
  5609. message += ` with value ${expectedValue}`;
  5610. }
  5611. message += `, got ${receivedType} `;
  5612. if (isExplicable(receivedType)) {
  5613. message += `with value ${receivedValue}.`;
  5614. }
  5615. return message;
  5616. }
  5617. function getType(ctor) {
  5618. const match = ctor && ctor.toString().match(/^\s*function (\w+)/);
  5619. return match ? match[1] : "";
  5620. }
  5621. function styleValue(value, type) {
  5622. if (type === "String") {
  5623. return `"${value}"`;
  5624. } else if (type === "Number") {
  5625. return `${Number(value)}`;
  5626. } else {
  5627. return `${value}`;
  5628. }
  5629. }
  5630. function isExplicable(type) {
  5631. const explicitTypes = ["string", "number", "boolean"];
  5632. return explicitTypes.some((elem) => type.toLowerCase() === elem);
  5633. }
  5634. function isBoolean(...args) {
  5635. return args.some((elem) => elem.toLowerCase() === "boolean");
  5636. }
  5637. function tryCatch(fn) {
  5638. return function() {
  5639. try {
  5640. return fn.apply(fn, arguments);
  5641. } catch (e2) {
  5642. console.error(e2);
  5643. }
  5644. };
  5645. }
  5646. let invokeCallbackId = 1;
  5647. const invokeCallbacks = {};
  5648. function addInvokeCallback(id2, name, callback, keepAlive = false) {
  5649. invokeCallbacks[id2] = {
  5650. name,
  5651. keepAlive,
  5652. callback
  5653. };
  5654. return id2;
  5655. }
  5656. function invokeCallback(id2, res, extras) {
  5657. if (typeof id2 === "number") {
  5658. const opts = invokeCallbacks[id2];
  5659. if (opts) {
  5660. if (!opts.keepAlive) {
  5661. delete invokeCallbacks[id2];
  5662. }
  5663. return opts.callback(res, extras);
  5664. }
  5665. }
  5666. return res;
  5667. }
  5668. const API_SUCCESS = "success";
  5669. const API_FAIL = "fail";
  5670. const API_COMPLETE = "complete";
  5671. function getApiCallbacks(args) {
  5672. const apiCallbacks = {};
  5673. for (const name in args) {
  5674. const fn = args[name];
  5675. if (isFunction(fn)) {
  5676. apiCallbacks[name] = tryCatch(fn);
  5677. delete args[name];
  5678. }
  5679. }
  5680. return apiCallbacks;
  5681. }
  5682. function normalizeErrMsg(errMsg, name) {
  5683. if (!errMsg || errMsg.indexOf(":fail") === -1) {
  5684. return name + ":ok";
  5685. }
  5686. return name + errMsg.substring(errMsg.indexOf(":fail"));
  5687. }
  5688. function createAsyncApiCallback(name, args = {}, { beforeAll, beforeSuccess } = {}) {
  5689. if (!isPlainObject(args)) {
  5690. args = {};
  5691. }
  5692. const { success, fail, complete } = getApiCallbacks(args);
  5693. const hasSuccess = isFunction(success);
  5694. const hasFail = isFunction(fail);
  5695. const hasComplete = isFunction(complete);
  5696. const callbackId = invokeCallbackId++;
  5697. addInvokeCallback(callbackId, name, (res) => {
  5698. res = res || {};
  5699. res.errMsg = normalizeErrMsg(res.errMsg, name);
  5700. isFunction(beforeAll) && beforeAll(res);
  5701. if (res.errMsg === name + ":ok") {
  5702. isFunction(beforeSuccess) && beforeSuccess(res, args);
  5703. hasSuccess && success(res);
  5704. } else {
  5705. hasFail && fail(res);
  5706. }
  5707. hasComplete && complete(res);
  5708. });
  5709. return callbackId;
  5710. }
  5711. const HOOK_SUCCESS = "success";
  5712. const HOOK_FAIL = "fail";
  5713. const HOOK_COMPLETE = "complete";
  5714. const globalInterceptors = {};
  5715. const scopedInterceptors = {};
  5716. function wrapperHook(hook, params) {
  5717. return function(data) {
  5718. return hook(data, params) || data;
  5719. };
  5720. }
  5721. function queue(hooks, data, params) {
  5722. let promise = false;
  5723. for (let i = 0; i < hooks.length; i++) {
  5724. const hook = hooks[i];
  5725. if (promise) {
  5726. promise = Promise.resolve(wrapperHook(hook, params));
  5727. } else {
  5728. const res = hook(data, params);
  5729. if (isPromise(res)) {
  5730. promise = Promise.resolve(res);
  5731. }
  5732. if (res === false) {
  5733. return {
  5734. then() {
  5735. },
  5736. catch() {
  5737. }
  5738. };
  5739. }
  5740. }
  5741. }
  5742. return promise || {
  5743. then(callback) {
  5744. return callback(data);
  5745. },
  5746. catch() {
  5747. }
  5748. };
  5749. }
  5750. function wrapperOptions(interceptors2, options = {}) {
  5751. [HOOK_SUCCESS, HOOK_FAIL, HOOK_COMPLETE].forEach((name) => {
  5752. const hooks = interceptors2[name];
  5753. if (!isArray(hooks)) {
  5754. return;
  5755. }
  5756. const oldCallback = options[name];
  5757. options[name] = function callbackInterceptor(res) {
  5758. queue(hooks, res, options).then((res2) => {
  5759. return isFunction(oldCallback) && oldCallback(res2) || res2;
  5760. });
  5761. };
  5762. });
  5763. return options;
  5764. }
  5765. function wrapperReturnValue(method, returnValue2) {
  5766. const returnValueHooks = [];
  5767. if (isArray(globalInterceptors.returnValue)) {
  5768. returnValueHooks.push(...globalInterceptors.returnValue);
  5769. }
  5770. const interceptor = scopedInterceptors[method];
  5771. if (interceptor && isArray(interceptor.returnValue)) {
  5772. returnValueHooks.push(...interceptor.returnValue);
  5773. }
  5774. returnValueHooks.forEach((hook) => {
  5775. returnValue2 = hook(returnValue2) || returnValue2;
  5776. });
  5777. return returnValue2;
  5778. }
  5779. function getApiInterceptorHooks(method) {
  5780. const interceptor = /* @__PURE__ */ Object.create(null);
  5781. Object.keys(globalInterceptors).forEach((hook) => {
  5782. if (hook !== "returnValue") {
  5783. interceptor[hook] = globalInterceptors[hook].slice();
  5784. }
  5785. });
  5786. const scopedInterceptor = scopedInterceptors[method];
  5787. if (scopedInterceptor) {
  5788. Object.keys(scopedInterceptor).forEach((hook) => {
  5789. if (hook !== "returnValue") {
  5790. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  5791. }
  5792. });
  5793. }
  5794. return interceptor;
  5795. }
  5796. function invokeApi(method, api, options, params) {
  5797. const interceptor = getApiInterceptorHooks(method);
  5798. if (interceptor && Object.keys(interceptor).length) {
  5799. if (isArray(interceptor.invoke)) {
  5800. const res = queue(interceptor.invoke, options);
  5801. return res.then((options2) => {
  5802. return api(wrapperOptions(getApiInterceptorHooks(method), options2), ...params);
  5803. });
  5804. } else {
  5805. return api(wrapperOptions(interceptor, options), ...params);
  5806. }
  5807. }
  5808. return api(options, ...params);
  5809. }
  5810. function hasCallback(args) {
  5811. if (isPlainObject(args) && [API_SUCCESS, API_FAIL, API_COMPLETE].find((cb) => isFunction(args[cb]))) {
  5812. return true;
  5813. }
  5814. return false;
  5815. }
  5816. function handlePromise(promise) {
  5817. return promise;
  5818. }
  5819. function promisify$1(name, fn) {
  5820. return (args = {}, ...rest) => {
  5821. if (hasCallback(args)) {
  5822. return wrapperReturnValue(name, invokeApi(name, fn, extend({}, args), rest));
  5823. }
  5824. return wrapperReturnValue(name, handlePromise(new Promise((resolve2, reject) => {
  5825. invokeApi(name, fn, extend({}, args, { success: resolve2, fail: reject }), rest);
  5826. })));
  5827. };
  5828. }
  5829. function formatApiArgs(args, options) {
  5830. args[0];
  5831. {
  5832. return;
  5833. }
  5834. }
  5835. function invokeSuccess(id2, name, res) {
  5836. const result = {
  5837. errMsg: name + ":ok"
  5838. };
  5839. return invokeCallback(id2, extend(res || {}, result));
  5840. }
  5841. function invokeFail(id2, name, errMsg, errRes = {}) {
  5842. const errMsgPrefix = name + ":fail";
  5843. let apiErrMsg = "";
  5844. if (!errMsg) {
  5845. apiErrMsg = errMsgPrefix;
  5846. } else if (errMsg.indexOf(errMsgPrefix) === 0) {
  5847. apiErrMsg = errMsg;
  5848. } else {
  5849. apiErrMsg = errMsgPrefix + " " + errMsg;
  5850. }
  5851. {
  5852. delete errRes.errCode;
  5853. }
  5854. let res = extend({ errMsg: apiErrMsg }, errRes);
  5855. return invokeCallback(id2, res);
  5856. }
  5857. function beforeInvokeApi(name, args, protocol, options) {
  5858. {
  5859. validateProtocols(name, args, protocol);
  5860. }
  5861. const errMsg = formatApiArgs(args);
  5862. if (errMsg) {
  5863. return errMsg;
  5864. }
  5865. }
  5866. function parseErrMsg(errMsg) {
  5867. if (!errMsg || isString(errMsg)) {
  5868. return errMsg;
  5869. }
  5870. if (errMsg.stack) {
  5871. if (typeof globalThis === "undefined" || !globalThis.harmonyChannel) {
  5872. console.error(errMsg.message + "\n" + errMsg.stack);
  5873. }
  5874. return errMsg.message;
  5875. }
  5876. return errMsg;
  5877. }
  5878. function wrapperTaskApi(name, fn, protocol, options) {
  5879. return (args) => {
  5880. const id2 = createAsyncApiCallback(name, args, options);
  5881. const errMsg = beforeInvokeApi(name, [args], protocol);
  5882. if (errMsg) {
  5883. return invokeFail(id2, name, errMsg);
  5884. }
  5885. return fn(args, {
  5886. resolve: (res) => invokeSuccess(id2, name, res),
  5887. reject: (errMsg2, errRes) => invokeFail(id2, name, parseErrMsg(errMsg2), errRes)
  5888. });
  5889. };
  5890. }
  5891. function wrapperSyncApi(name, fn, protocol, options) {
  5892. return (...args) => {
  5893. const errMsg = beforeInvokeApi(name, args, protocol);
  5894. if (errMsg) {
  5895. throw new Error(errMsg);
  5896. }
  5897. return fn.apply(null, args);
  5898. };
  5899. }
  5900. function wrapperAsyncApi(name, fn, protocol, options) {
  5901. return wrapperTaskApi(name, fn, protocol, options);
  5902. }
  5903. function defineSyncApi(name, fn, protocol, options) {
  5904. return wrapperSyncApi(name, fn, protocol);
  5905. }
  5906. function defineAsyncApi(name, fn, protocol, options) {
  5907. return promisify$1(name, wrapperAsyncApi(name, fn, protocol, options));
  5908. }
  5909. const API_UPX2PX = "upx2px";
  5910. const Upx2pxProtocol = [
  5911. {
  5912. name: "upx",
  5913. type: [Number, String],
  5914. required: true
  5915. }
  5916. ];
  5917. const EPS = 1e-4;
  5918. const BASE_DEVICE_WIDTH = 750;
  5919. let isIOS = false;
  5920. let deviceWidth = 0;
  5921. let deviceDPR = 0;
  5922. function checkDeviceWidth() {
  5923. let windowWidth, pixelRatio, platform;
  5924. {
  5925. const { windowWidth: w, pixelRatio: p2, platform: pf } = getBaseSystemInfo();
  5926. windowWidth = w;
  5927. pixelRatio = p2;
  5928. platform = pf;
  5929. }
  5930. deviceWidth = windowWidth;
  5931. deviceDPR = pixelRatio;
  5932. isIOS = platform === "ios";
  5933. }
  5934. const upx2px = defineSyncApi(API_UPX2PX, (number, newDeviceWidth) => {
  5935. if (deviceWidth === 0) {
  5936. checkDeviceWidth();
  5937. }
  5938. number = Number(number);
  5939. if (number === 0) {
  5940. return 0;
  5941. }
  5942. let width = newDeviceWidth || deviceWidth;
  5943. let result = number / BASE_DEVICE_WIDTH * width;
  5944. if (result < 0) {
  5945. result = -result;
  5946. }
  5947. result = Math.floor(result + EPS);
  5948. if (result === 0) {
  5949. if (deviceDPR === 1 || !isIOS) {
  5950. result = 1;
  5951. } else {
  5952. result = 0.5;
  5953. }
  5954. }
  5955. return number < 0 ? -result : result;
  5956. }, Upx2pxProtocol);
  5957. function __f__(type, filename, ...args) {
  5958. if (filename) {
  5959. args.push(filename);
  5960. }
  5961. console[type].apply(console, args);
  5962. }
  5963. const API_ADD_INTERCEPTOR = "addInterceptor";
  5964. const API_REMOVE_INTERCEPTOR = "removeInterceptor";
  5965. const AddInterceptorProtocol = [
  5966. {
  5967. name: "method",
  5968. type: [String, Object],
  5969. required: true
  5970. }
  5971. ];
  5972. const RemoveInterceptorProtocol = AddInterceptorProtocol;
  5973. function mergeInterceptorHook(interceptors2, interceptor) {
  5974. Object.keys(interceptor).forEach((hook) => {
  5975. if (isFunction(interceptor[hook])) {
  5976. interceptors2[hook] = mergeHook(interceptors2[hook], interceptor[hook]);
  5977. }
  5978. });
  5979. }
  5980. function removeInterceptorHook(interceptors2, interceptor) {
  5981. if (!interceptors2 || !interceptor) {
  5982. return;
  5983. }
  5984. Object.keys(interceptor).forEach((name) => {
  5985. const hooks = interceptors2[name];
  5986. const hook = interceptor[name];
  5987. if (isArray(hooks) && isFunction(hook)) {
  5988. remove(hooks, hook);
  5989. }
  5990. });
  5991. }
  5992. function mergeHook(parentVal, childVal) {
  5993. const res = childVal ? parentVal ? parentVal.concat(childVal) : isArray(childVal) ? childVal : [childVal] : parentVal;
  5994. return res ? dedupeHooks(res) : res;
  5995. }
  5996. function dedupeHooks(hooks) {
  5997. const res = [];
  5998. for (let i = 0; i < hooks.length; i++) {
  5999. if (res.indexOf(hooks[i]) === -1) {
  6000. res.push(hooks[i]);
  6001. }
  6002. }
  6003. return res;
  6004. }
  6005. const addInterceptor = defineSyncApi(API_ADD_INTERCEPTOR, (method, interceptor) => {
  6006. if (isString(method) && isPlainObject(interceptor)) {
  6007. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), interceptor);
  6008. } else if (isPlainObject(method)) {
  6009. mergeInterceptorHook(globalInterceptors, method);
  6010. }
  6011. }, AddInterceptorProtocol);
  6012. const removeInterceptor = defineSyncApi(API_REMOVE_INTERCEPTOR, (method, interceptor) => {
  6013. if (isString(method)) {
  6014. if (isPlainObject(interceptor)) {
  6015. removeInterceptorHook(scopedInterceptors[method], interceptor);
  6016. } else {
  6017. delete scopedInterceptors[method];
  6018. }
  6019. } else if (isPlainObject(method)) {
  6020. removeInterceptorHook(globalInterceptors, method);
  6021. }
  6022. }, RemoveInterceptorProtocol);
  6023. const interceptors = {};
  6024. const API_ON = "$on";
  6025. const OnProtocol = [
  6026. {
  6027. name: "event",
  6028. type: String,
  6029. required: true
  6030. },
  6031. {
  6032. name: "callback",
  6033. type: Function,
  6034. required: true
  6035. }
  6036. ];
  6037. const API_ONCE = "$once";
  6038. const OnceProtocol = OnProtocol;
  6039. const API_OFF = "$off";
  6040. const OffProtocol = [
  6041. {
  6042. name: "event",
  6043. type: [String, Array]
  6044. },
  6045. {
  6046. name: "callback",
  6047. type: [Function, Number]
  6048. }
  6049. ];
  6050. const API_EMIT = "$emit";
  6051. const EmitProtocol = [
  6052. {
  6053. name: "event",
  6054. type: String,
  6055. required: true
  6056. }
  6057. ];
  6058. class EventBus {
  6059. constructor() {
  6060. this.$emitter = new E$1();
  6061. }
  6062. on(name, callback) {
  6063. return this.$emitter.on(name, callback);
  6064. }
  6065. once(name, callback) {
  6066. return this.$emitter.once(name, callback);
  6067. }
  6068. off(name, callback) {
  6069. if (!name) {
  6070. this.$emitter.e = {};
  6071. return;
  6072. }
  6073. this.$emitter.off(name, callback);
  6074. }
  6075. emit(name, ...args) {
  6076. this.$emitter.emit(name, ...args);
  6077. }
  6078. }
  6079. const eventBus = new EventBus();
  6080. const $on = defineSyncApi(API_ON, (name, callback) => {
  6081. eventBus.on(name, callback);
  6082. return () => eventBus.off(name, callback);
  6083. }, OnProtocol);
  6084. const $once = defineSyncApi(API_ONCE, (name, callback) => {
  6085. eventBus.once(name, callback);
  6086. return () => eventBus.off(name, callback);
  6087. }, OnceProtocol);
  6088. const $off = defineSyncApi(API_OFF, (name, callback) => {
  6089. if (!isArray(name))
  6090. name = name ? [name] : [];
  6091. name.forEach((n2) => {
  6092. eventBus.off(n2, callback);
  6093. });
  6094. }, OffProtocol);
  6095. const $emit = defineSyncApi(API_EMIT, (name, ...args) => {
  6096. eventBus.emit(name, ...args);
  6097. }, EmitProtocol);
  6098. let cid;
  6099. let cidErrMsg;
  6100. let enabled;
  6101. function normalizePushMessage(message) {
  6102. try {
  6103. return JSON.parse(message);
  6104. } catch (e2) {
  6105. }
  6106. return message;
  6107. }
  6108. function invokePushCallback(args) {
  6109. if (args.type === "enabled") {
  6110. enabled = true;
  6111. } else if (args.type === "clientId") {
  6112. cid = args.cid;
  6113. cidErrMsg = args.errMsg;
  6114. invokeGetPushCidCallbacks(cid, args.errMsg);
  6115. } else if (args.type === "pushMsg") {
  6116. const message = {
  6117. type: "receive",
  6118. data: normalizePushMessage(args.message)
  6119. };
  6120. for (let i = 0; i < onPushMessageCallbacks.length; i++) {
  6121. const callback = onPushMessageCallbacks[i];
  6122. callback(message);
  6123. if (message.stopped) {
  6124. break;
  6125. }
  6126. }
  6127. } else if (args.type === "click") {
  6128. onPushMessageCallbacks.forEach((callback) => {
  6129. callback({
  6130. type: "click",
  6131. data: normalizePushMessage(args.message)
  6132. });
  6133. });
  6134. }
  6135. }
  6136. const getPushCidCallbacks = [];
  6137. function invokeGetPushCidCallbacks(cid2, errMsg) {
  6138. getPushCidCallbacks.forEach((callback) => {
  6139. callback(cid2, errMsg);
  6140. });
  6141. getPushCidCallbacks.length = 0;
  6142. }
  6143. const API_GET_PUSH_CLIENT_ID = "getPushClientId";
  6144. const getPushClientId = defineAsyncApi(API_GET_PUSH_CLIENT_ID, (_, { resolve: resolve2, reject }) => {
  6145. Promise.resolve().then(() => {
  6146. if (typeof enabled === "undefined") {
  6147. enabled = false;
  6148. cid = "";
  6149. cidErrMsg = "uniPush is not enabled";
  6150. }
  6151. getPushCidCallbacks.push((cid2, errMsg) => {
  6152. if (cid2) {
  6153. resolve2({ cid: cid2 });
  6154. } else {
  6155. reject(errMsg);
  6156. }
  6157. });
  6158. if (typeof cid !== "undefined") {
  6159. invokeGetPushCidCallbacks(cid, cidErrMsg);
  6160. }
  6161. });
  6162. });
  6163. const onPushMessageCallbacks = [];
  6164. const onPushMessage = (fn) => {
  6165. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  6166. onPushMessageCallbacks.push(fn);
  6167. }
  6168. };
  6169. const offPushMessage = (fn) => {
  6170. if (!fn) {
  6171. onPushMessageCallbacks.length = 0;
  6172. } else {
  6173. const index2 = onPushMessageCallbacks.indexOf(fn);
  6174. if (index2 > -1) {
  6175. onPushMessageCallbacks.splice(index2, 1);
  6176. }
  6177. }
  6178. };
  6179. const SYNC_API_RE = /^\$|__f__|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|rpx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getDeviceInfo|getAppBaseInfo|getWindowInfo|getSystemSetting|getAppAuthorizeSetting/;
  6180. const CONTEXT_API_RE = /^create|Manager$/;
  6181. const CONTEXT_API_RE_EXC = ["createBLEConnection"];
  6182. const TASK_APIS = ["request", "downloadFile", "uploadFile", "connectSocket"];
  6183. const ASYNC_API = ["createBLEConnection"];
  6184. const CALLBACK_API_RE = /^on|^off/;
  6185. function isContextApi(name) {
  6186. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  6187. }
  6188. function isSyncApi(name) {
  6189. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  6190. }
  6191. function isCallbackApi(name) {
  6192. return CALLBACK_API_RE.test(name) && name !== "onPush";
  6193. }
  6194. function isTaskApi(name) {
  6195. return TASK_APIS.indexOf(name) !== -1;
  6196. }
  6197. function shouldPromise(name) {
  6198. if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
  6199. return false;
  6200. }
  6201. return true;
  6202. }
  6203. if (!Promise.prototype.finally) {
  6204. Promise.prototype.finally = function(onfinally) {
  6205. const promise = this.constructor;
  6206. return this.then((value) => promise.resolve(onfinally && onfinally()).then(() => value), (reason) => promise.resolve(onfinally && onfinally()).then(() => {
  6207. throw reason;
  6208. }));
  6209. };
  6210. }
  6211. function promisify(name, api) {
  6212. if (!shouldPromise(name)) {
  6213. return api;
  6214. }
  6215. if (!isFunction(api)) {
  6216. return api;
  6217. }
  6218. return function promiseApi(options = {}, ...rest) {
  6219. if (isFunction(options.success) || isFunction(options.fail) || isFunction(options.complete)) {
  6220. return wrapperReturnValue(name, invokeApi(name, api, extend({}, options), rest));
  6221. }
  6222. return wrapperReturnValue(name, handlePromise(new Promise((resolve2, reject) => {
  6223. invokeApi(name, api, extend({}, options, {
  6224. success: resolve2,
  6225. fail: reject
  6226. }), rest);
  6227. })));
  6228. };
  6229. }
  6230. const CALLBACKS = ["success", "fail", "cancel", "complete"];
  6231. function initWrapper(protocols2) {
  6232. function processCallback(methodName, method, returnValue2) {
  6233. return function(res) {
  6234. return method(processReturnValue(methodName, res, returnValue2));
  6235. };
  6236. }
  6237. function processArgs(methodName, fromArgs, argsOption = {}, returnValue2 = {}, keepFromArgs = false) {
  6238. if (isPlainObject(fromArgs)) {
  6239. const toArgs = keepFromArgs === true ? fromArgs : {};
  6240. if (isFunction(argsOption)) {
  6241. argsOption = argsOption(fromArgs, toArgs) || {};
  6242. }
  6243. for (const key in fromArgs) {
  6244. if (hasOwn$1(argsOption, key)) {
  6245. let keyOption = argsOption[key];
  6246. if (isFunction(keyOption)) {
  6247. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  6248. }
  6249. if (!keyOption) {
  6250. console.warn(`支付宝小程序 ${methodName} 暂不支持 ${key}`);
  6251. } else if (isString(keyOption)) {
  6252. toArgs[keyOption] = fromArgs[key];
  6253. } else if (isPlainObject(keyOption)) {
  6254. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  6255. }
  6256. } else if (CALLBACKS.indexOf(key) !== -1) {
  6257. const callback = fromArgs[key];
  6258. if (isFunction(callback)) {
  6259. toArgs[key] = processCallback(methodName, callback, returnValue2);
  6260. }
  6261. } else {
  6262. if (!keepFromArgs && !hasOwn$1(toArgs, key)) {
  6263. toArgs[key] = fromArgs[key];
  6264. }
  6265. }
  6266. }
  6267. return toArgs;
  6268. } else if (isFunction(fromArgs)) {
  6269. if (isFunction(argsOption)) {
  6270. argsOption(fromArgs, {});
  6271. }
  6272. fromArgs = processCallback(methodName, fromArgs, returnValue2);
  6273. }
  6274. return fromArgs;
  6275. }
  6276. function processReturnValue(methodName, res, returnValue2, keepReturnValue = false) {
  6277. if (isFunction(protocols2.returnValue)) {
  6278. res = protocols2.returnValue(methodName, res);
  6279. }
  6280. const realKeepReturnValue = keepReturnValue || false;
  6281. return processArgs(methodName, res, returnValue2, {}, realKeepReturnValue);
  6282. }
  6283. return function wrapper(methodName, method) {
  6284. const hasProtocol = hasOwn$1(protocols2, methodName);
  6285. if (!hasProtocol && typeof my[methodName] !== "function") {
  6286. return method;
  6287. }
  6288. const needWrapper = hasProtocol || isFunction(protocols2.returnValue) || isContextApi(methodName) || isTaskApi(methodName);
  6289. const hasMethod = hasProtocol || isFunction(method);
  6290. if (!hasProtocol && !method) {
  6291. return function() {
  6292. console.error(`支付宝小程序 暂不支持${methodName}`);
  6293. };
  6294. }
  6295. if (!needWrapper || !hasMethod) {
  6296. return method;
  6297. }
  6298. const protocol = protocols2[methodName];
  6299. return function(arg1, arg2) {
  6300. let options = protocol || {};
  6301. if (isFunction(protocol)) {
  6302. options = protocol(arg1);
  6303. }
  6304. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  6305. const args = [arg1];
  6306. if (typeof arg2 !== "undefined") {
  6307. args.push(arg2);
  6308. }
  6309. const returnValue2 = my[options.name || methodName].apply(my, args);
  6310. if (isContextApi(methodName) || isTaskApi(methodName)) {
  6311. if (returnValue2 && !returnValue2.__v_skip) {
  6312. returnValue2.__v_skip = true;
  6313. }
  6314. }
  6315. if (isSyncApi(methodName)) {
  6316. return processReturnValue(methodName, returnValue2, options.returnValue, isContextApi(methodName));
  6317. }
  6318. return returnValue2;
  6319. };
  6320. };
  6321. }
  6322. const getLocale = () => {
  6323. const app = isFunction(getApp) && getApp({ allowDefault: true });
  6324. if (app && app.$vm) {
  6325. return app.$vm.$locale;
  6326. }
  6327. return getLocaleLanguage$1();
  6328. };
  6329. const setLocale = (locale) => {
  6330. const app = isFunction(getApp) && getApp();
  6331. if (!app) {
  6332. return false;
  6333. }
  6334. const oldLocale = app.$vm.$locale;
  6335. if (oldLocale !== locale) {
  6336. app.$vm.$locale = locale;
  6337. onLocaleChangeCallbacks.forEach((fn) => fn({ locale }));
  6338. return true;
  6339. }
  6340. return false;
  6341. };
  6342. const onLocaleChangeCallbacks = [];
  6343. const onLocaleChange = (fn) => {
  6344. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  6345. onLocaleChangeCallbacks.push(fn);
  6346. }
  6347. };
  6348. if (typeof global !== "undefined") {
  6349. global.getLocale = getLocale;
  6350. }
  6351. const UUID_KEY = "__DC_STAT_UUID";
  6352. let deviceId;
  6353. function useDeviceId(global2 = my) {
  6354. return function addDeviceId(_, toRes) {
  6355. deviceId = deviceId || global2.getStorageSync(UUID_KEY);
  6356. if (!deviceId) {
  6357. deviceId = Date.now() + "" + Math.floor(Math.random() * 1e7);
  6358. my.setStorage({
  6359. key: UUID_KEY,
  6360. data: deviceId
  6361. });
  6362. }
  6363. toRes.deviceId = deviceId;
  6364. };
  6365. }
  6366. function addSafeAreaInsets(fromRes, toRes) {
  6367. if (fromRes.safeArea) {
  6368. const safeArea = fromRes.safeArea;
  6369. toRes.safeAreaInsets = {
  6370. top: safeArea.top,
  6371. left: safeArea.left,
  6372. right: fromRes.windowWidth - safeArea.right,
  6373. bottom: fromRes.screenHeight - safeArea.bottom
  6374. };
  6375. }
  6376. }
  6377. function getOSInfo(system, platform) {
  6378. let osName = "";
  6379. let osVersion = "";
  6380. if (platform && true) {
  6381. osName = platform;
  6382. osVersion = system;
  6383. } else {
  6384. osName = system.split(" ")[0] || platform;
  6385. osVersion = system.split(" ")[1] || "";
  6386. }
  6387. osName = osName.toLowerCase();
  6388. switch (osName) {
  6389. case "harmony":
  6390. case "ohos":
  6391. case "openharmony":
  6392. osName = "harmonyos";
  6393. break;
  6394. case "iphone os":
  6395. osName = "ios";
  6396. break;
  6397. case "mac":
  6398. case "darwin":
  6399. osName = "macos";
  6400. break;
  6401. case "windows_nt":
  6402. osName = "windows";
  6403. break;
  6404. }
  6405. return {
  6406. osName,
  6407. osVersion
  6408. };
  6409. }
  6410. function populateParameters(fromRes, toRes) {
  6411. const { brand = "", model = "", system = "", language = "", theme, version: version2, platform, fontSizeSetting, SDKVersion, pixelRatio, deviceOrientation } = fromRes;
  6412. const { osName, osVersion } = getOSInfo(system, platform);
  6413. let hostVersion = version2;
  6414. let deviceType = getGetDeviceType(fromRes, model);
  6415. let deviceBrand = getDeviceBrand(brand);
  6416. let _hostName = getHostName(fromRes);
  6417. let _deviceOrientation = deviceOrientation;
  6418. let _devicePixelRatio = pixelRatio;
  6419. let _SDKVersion = SDKVersion;
  6420. {
  6421. _SDKVersion = my.SDKVersion;
  6422. }
  6423. const hostLanguage = (language || "").replace(/_/g, "-");
  6424. const parameters = {
  6425. appId: "__UNI__2391417",
  6426. appName: "uni-app-demo",
  6427. appVersion: "1.0.0",
  6428. appVersionCode: "100",
  6429. appLanguage: getAppLanguage(hostLanguage),
  6430. uniCompileVersion: "4.76",
  6431. uniCompilerVersion: "4.76",
  6432. uniRuntimeVersion: "4.76",
  6433. uniPlatform: "mp-alipay",
  6434. deviceBrand,
  6435. deviceModel: model,
  6436. deviceType,
  6437. devicePixelRatio: _devicePixelRatio,
  6438. deviceOrientation: _deviceOrientation,
  6439. osName,
  6440. osVersion,
  6441. hostTheme: theme,
  6442. hostVersion,
  6443. hostLanguage,
  6444. hostName: _hostName,
  6445. hostSDKVersion: _SDKVersion,
  6446. hostFontSizeSetting: fontSizeSetting,
  6447. windowTop: 0,
  6448. windowBottom: 0,
  6449. // TODO
  6450. osLanguage: void 0,
  6451. osTheme: void 0,
  6452. ua: void 0,
  6453. hostPackageName: void 0,
  6454. browserName: void 0,
  6455. browserVersion: void 0,
  6456. isUniAppX: false
  6457. };
  6458. extend(toRes, parameters);
  6459. }
  6460. function getGetDeviceType(fromRes, model) {
  6461. let deviceType = fromRes.deviceType || "phone";
  6462. {
  6463. const deviceTypeMaps = {
  6464. ipad: "pad",
  6465. windows: "pc",
  6466. mac: "pc"
  6467. };
  6468. const deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  6469. const _model = model.toLowerCase();
  6470. for (let index2 = 0; index2 < deviceTypeMapsKeys.length; index2++) {
  6471. const _m = deviceTypeMapsKeys[index2];
  6472. if (_model.indexOf(_m) !== -1) {
  6473. deviceType = deviceTypeMaps[_m];
  6474. break;
  6475. }
  6476. }
  6477. }
  6478. return deviceType;
  6479. }
  6480. function getDeviceBrand(brand) {
  6481. let deviceBrand = brand;
  6482. if (deviceBrand) {
  6483. deviceBrand = deviceBrand.toLowerCase();
  6484. }
  6485. return deviceBrand;
  6486. }
  6487. function getAppLanguage(defaultLanguage) {
  6488. return getLocale ? getLocale() : defaultLanguage;
  6489. }
  6490. function getHostName(fromRes) {
  6491. const _platform = "mp-alipay".split("-")[1];
  6492. let _hostName = fromRes.hostName || _platform;
  6493. _hostName = fromRes.app;
  6494. return _hostName;
  6495. }
  6496. const redirectTo = {};
  6497. const eventChannels = {};
  6498. let id = 0;
  6499. function initEventChannel(events, cache = true) {
  6500. id++;
  6501. const eventChannel = new my.EventChannel(id, events);
  6502. if (cache) {
  6503. eventChannels[id] = eventChannel;
  6504. }
  6505. return eventChannel;
  6506. }
  6507. function getEventChannel(id2) {
  6508. const eventChannel = eventChannels[id2];
  6509. delete eventChannels[id2];
  6510. return eventChannel;
  6511. }
  6512. const navigateTo$1 = () => {
  6513. let eventChannel;
  6514. return {
  6515. args(fromArgs) {
  6516. eventChannel = initEventChannel(fromArgs.events);
  6517. if (fromArgs.url) {
  6518. fromArgs.url = fromArgs.url + (fromArgs.url.indexOf("?") === -1 ? "?" : "&") + "__id__=" + eventChannel.id;
  6519. }
  6520. },
  6521. returnValue(fromRes) {
  6522. fromRes.eventChannel = eventChannel;
  6523. }
  6524. };
  6525. };
  6526. const onError = {
  6527. args(fromArgs) {
  6528. const app = getApp({ allowDefault: true }) || {};
  6529. if (!app.$vm) {
  6530. if (!my.$onErrorHandlers) {
  6531. my.$onErrorHandlers = [];
  6532. }
  6533. my.$onErrorHandlers.push(fromArgs);
  6534. } else {
  6535. injectHook(ON_ERROR, fromArgs, app.$vm.$);
  6536. }
  6537. }
  6538. };
  6539. const offError = {
  6540. args(fromArgs) {
  6541. const app = getApp({ allowDefault: true }) || {};
  6542. if (!app.$vm) {
  6543. if (!my.$onErrorHandlers) {
  6544. return;
  6545. }
  6546. const index2 = my.$onErrorHandlers.findIndex((fn) => fn === fromArgs);
  6547. if (index2 !== -1) {
  6548. my.$onErrorHandlers.splice(index2, 1);
  6549. }
  6550. } else if (fromArgs.__weh) {
  6551. const onErrors = app.$vm.$[ON_ERROR];
  6552. if (onErrors) {
  6553. const index2 = onErrors.indexOf(fromArgs.__weh);
  6554. if (index2 > -1) {
  6555. onErrors.splice(index2, 1);
  6556. }
  6557. }
  6558. }
  6559. }
  6560. };
  6561. const onSocketOpen = {
  6562. args() {
  6563. if (my.__uni_console__) {
  6564. if (my.__uni_console_warned__) {
  6565. return;
  6566. }
  6567. my.__uni_console_warned__ = true;
  6568. console.warn(`开发模式下小程序日志回显会使用 socket 连接,为了避免冲突,建议使用 SocketTask 的方式去管理 WebSocket 或手动关闭日志回显功能。[详情](https://uniapp.dcloud.net.cn/tutorial/run/mp-log.html)`);
  6569. }
  6570. }
  6571. };
  6572. const onSocketMessage = onSocketOpen;
  6573. const baseApis = {
  6574. $on,
  6575. $off,
  6576. $once,
  6577. $emit,
  6578. upx2px,
  6579. rpx2px: upx2px,
  6580. interceptors,
  6581. addInterceptor,
  6582. removeInterceptor,
  6583. onCreateVueApp,
  6584. invokeCreateVueAppHook,
  6585. getLocale,
  6586. setLocale,
  6587. onLocaleChange,
  6588. getPushClientId,
  6589. onPushMessage,
  6590. offPushMessage,
  6591. invokePushCallback,
  6592. __f__
  6593. };
  6594. function initUni(api, protocols2, platform = my) {
  6595. const wrapper = initWrapper(protocols2);
  6596. const UniProxyHandlers = {
  6597. get(target, key) {
  6598. if (hasOwn$1(target, key)) {
  6599. return target[key];
  6600. }
  6601. if (hasOwn$1(api, key)) {
  6602. return promisify(key, api[key]);
  6603. }
  6604. if (hasOwn$1(baseApis, key)) {
  6605. return promisify(key, baseApis[key]);
  6606. }
  6607. return promisify(key, wrapper(key, platform[key]));
  6608. }
  6609. };
  6610. {
  6611. platform.$emit = $emit;
  6612. if (!my.canIUse("getOpenerEventChannel"))
  6613. platform.getEventChannel = getEventChannel;
  6614. }
  6615. return new Proxy({}, UniProxyHandlers);
  6616. }
  6617. function initGetProvider(providers) {
  6618. return function getProvider2({ service, success, fail, complete }) {
  6619. let res;
  6620. if (providers[service]) {
  6621. res = {
  6622. errMsg: "getProvider:ok",
  6623. service,
  6624. provider: providers[service]
  6625. };
  6626. isFunction(success) && success(res);
  6627. } else {
  6628. res = {
  6629. errMsg: "getProvider:fail:服务[" + service + "]不存在"
  6630. };
  6631. isFunction(fail) && fail(res);
  6632. }
  6633. isFunction(complete) && complete(res);
  6634. };
  6635. }
  6636. let onKeyboardHeightChangeCallback;
  6637. const getProvider = initGetProvider({
  6638. oauth: ["alipay"],
  6639. share: ["alipay"],
  6640. payment: ["alipay"],
  6641. push: ["alipay"]
  6642. });
  6643. function setStorageSync(key, data) {
  6644. return my.setStorageSync({
  6645. key,
  6646. data
  6647. });
  6648. }
  6649. function getStorageSync(key) {
  6650. const result = my.getStorageSync({
  6651. key
  6652. });
  6653. return result.data !== null ? result.data : "";
  6654. }
  6655. function removeStorageSync(key) {
  6656. return my.removeStorageSync({
  6657. key
  6658. });
  6659. }
  6660. function startGyroscope(args) {
  6661. if (hasOwn$1(args, "interval")) {
  6662. console.warn("支付宝小程序 startGyroscope暂不支持interval");
  6663. }
  6664. args.success && args.success({
  6665. errMsg: "startGyroscope:ok"
  6666. });
  6667. args.complete && args.complete({
  6668. errMsg: "startGyroscope:ok"
  6669. });
  6670. }
  6671. function createExecCallback(execCallback) {
  6672. return function wrapperExecCallback(res) {
  6673. this.actions.forEach((action, index2) => {
  6674. (action._$callbacks || []).forEach((callback) => {
  6675. callback(res[index2]);
  6676. });
  6677. });
  6678. if (isFunction(execCallback)) {
  6679. execCallback(res);
  6680. }
  6681. };
  6682. }
  6683. function addCallback(callback) {
  6684. if (isFunction(callback)) {
  6685. const action = this.actions[this.actions.length - 1];
  6686. if (action) {
  6687. (action._$callbacks || (action._$callbacks = [])).push(callback);
  6688. }
  6689. }
  6690. }
  6691. function createSelectorQuery() {
  6692. const query = my.createSelectorQuery();
  6693. const oldExec = query.exec;
  6694. const oldScrollOffset = query.scrollOffset;
  6695. const oldBoundingClientRect = query.boundingClientRect;
  6696. query.exec = function exec(callback) {
  6697. return oldExec.call(this, createExecCallback(callback).bind(this));
  6698. };
  6699. query.scrollOffset = function scrollOffset(callback) {
  6700. const ret = oldScrollOffset.call(this);
  6701. addCallback.call(this, callback);
  6702. return ret;
  6703. };
  6704. query.boundingClientRect = function boundingClientRect(callback) {
  6705. const ret = oldBoundingClientRect.call(this);
  6706. addCallback.call(this, callback);
  6707. return ret;
  6708. };
  6709. if (!query.fields) {
  6710. query.fields = function({ rect, size: size2, scrollOffset }, callback) {
  6711. if (rect || size2) {
  6712. this.boundingClientRect();
  6713. }
  6714. if (scrollOffset) {
  6715. this.scrollOffset();
  6716. }
  6717. addCallback.call(this, callback);
  6718. return this;
  6719. };
  6720. }
  6721. if (!query.in) {
  6722. query.in = function() {
  6723. return this;
  6724. };
  6725. }
  6726. return query;
  6727. }
  6728. function createIntersectionObserver(component, options) {
  6729. if (options && options.observeAll) {
  6730. options.selectAll = options.observeAll;
  6731. delete options.observeAll;
  6732. }
  6733. return my.createIntersectionObserver(options);
  6734. }
  6735. function onKeyboardHeightChange(callback) {
  6736. if (onKeyboardHeightChangeCallback) {
  6737. $off("uni:keyboardHeightChange", onKeyboardHeightChangeCallback);
  6738. }
  6739. onKeyboardHeightChangeCallback = callback;
  6740. $on("uni:keyboardHeightChange", onKeyboardHeightChangeCallback);
  6741. }
  6742. function offKeyboardHeightChange() {
  6743. $off("uni:keyboardHeightChange", onKeyboardHeightChangeCallback);
  6744. onKeyboardHeightChangeCallback = void 0;
  6745. }
  6746. var shims = /* @__PURE__ */ Object.freeze({
  6747. __proto__: null,
  6748. createIntersectionObserver,
  6749. createSelectorQuery,
  6750. getProvider,
  6751. getStorageSync,
  6752. offKeyboardHeightChange,
  6753. onKeyboardHeightChange,
  6754. removeStorageSync,
  6755. setStorageSync,
  6756. startGyroscope
  6757. });
  6758. function handleNetworkInfo(fromRes, toRes) {
  6759. const nextworkType = fromRes.networkType;
  6760. switch (nextworkType) {
  6761. case "NOTREACHABLE":
  6762. toRes.networkType = "none";
  6763. break;
  6764. case "WWAN":
  6765. toRes.networkType = "3g";
  6766. break;
  6767. default:
  6768. toRes.networkType = fromRes.networkType.toLowerCase();
  6769. break;
  6770. }
  6771. }
  6772. function reviseScreenSize(fromRes, toRes) {
  6773. if (fromRes.screen) {
  6774. toRes.screenWidth = fromRes.screen.width;
  6775. toRes.screenHeight = fromRes.screen.height;
  6776. }
  6777. }
  6778. function handleSystemInfo(fromRes, toRes) {
  6779. reviseScreenSize(fromRes, toRes);
  6780. addSafeAreaInsets(fromRes, toRes);
  6781. useDeviceId({
  6782. getStorageSync
  6783. })(fromRes, toRes);
  6784. populateParameters(fromRes, toRes);
  6785. let platform = fromRes.platform ? fromRes.platform.toLowerCase() : "devtools";
  6786. if (my.canIUse("isIDE")) {
  6787. platform = my.isIDE ? "devtools" : platform;
  6788. }
  6789. toRes.platform = platform;
  6790. }
  6791. function returnValue(methodName, res = {}) {
  6792. if (isSyncApi(methodName)) {
  6793. return res;
  6794. }
  6795. if (res.error || res.errorMessage) {
  6796. res.errMsg = `${methodName}:fail ${res.errorMessage || res.error}`;
  6797. delete res.error;
  6798. delete res.errorMessage;
  6799. } else {
  6800. res.errMsg = `${methodName}:ok`;
  6801. }
  6802. return res;
  6803. }
  6804. const request = {
  6805. name: my.canIUse("request") ? "request" : "httpRequest",
  6806. args(fromArgs) {
  6807. const isDingDing = my.canIUse("saveFileToDingTalk");
  6808. const method = fromArgs.method || "GET";
  6809. if (!fromArgs.header) {
  6810. fromArgs.header = {};
  6811. }
  6812. const headers = {
  6813. "content-type": "application/json"
  6814. };
  6815. Object.keys(fromArgs.header).forEach((key) => {
  6816. headers[key.toLowerCase()] = fromArgs.header[key];
  6817. });
  6818. return {
  6819. header() {
  6820. return {
  6821. name: "headers",
  6822. value: headers
  6823. };
  6824. },
  6825. data(data) {
  6826. if (isDingDing && method.toUpperCase() === "POST" && headers["content-type"].indexOf("application/json") === 0) {
  6827. const _data = isPlainObject(data) ? JSON.stringify(data) : "{}";
  6828. return {
  6829. name: "data",
  6830. value: _data
  6831. };
  6832. }
  6833. return {
  6834. name: "data",
  6835. value: data
  6836. };
  6837. },
  6838. method: "method",
  6839. // TODO 支付宝小程序仅支持 get,post
  6840. responseType: false
  6841. };
  6842. },
  6843. returnValue: {
  6844. status: "statusCode",
  6845. headers: "header"
  6846. }
  6847. };
  6848. const setNavigationBarColor = {
  6849. name: "setNavigationBar",
  6850. args: {
  6851. frontColor: false,
  6852. animation: false
  6853. }
  6854. };
  6855. const setNavigationBarTitle = {
  6856. name: "setNavigationBar"
  6857. };
  6858. function showModal({ showCancel = true } = {}) {
  6859. if (my.canIUse("showModal")) {
  6860. return {
  6861. name: "showModal"
  6862. };
  6863. }
  6864. if (showCancel) {
  6865. return {
  6866. name: "confirm",
  6867. args: {
  6868. confirmColor: false,
  6869. cancelColor: false,
  6870. cancelText: "cancelButtonText",
  6871. confirmText: "confirmButtonText"
  6872. },
  6873. returnValue(fromRes, toRes) {
  6874. toRes.confirm = fromRes.confirm;
  6875. toRes.cancel = !fromRes.confirm;
  6876. }
  6877. };
  6878. }
  6879. return {
  6880. name: "alert",
  6881. args: {
  6882. confirmColor: false,
  6883. confirmText: "buttonText"
  6884. },
  6885. returnValue(fromRes, toRes) {
  6886. toRes.confirm = true;
  6887. toRes.cancel = false;
  6888. }
  6889. };
  6890. }
  6891. function showToast({ icon = "success" } = {}) {
  6892. const args = {
  6893. title: "content"
  6894. };
  6895. if (icon === "loading") {
  6896. return {
  6897. name: "showLoading",
  6898. args
  6899. };
  6900. }
  6901. return {
  6902. name: "showToast",
  6903. args: extend({ icon: "type" }, args)
  6904. };
  6905. }
  6906. const showActionSheet = {
  6907. name: "showActionSheet",
  6908. args: {
  6909. itemList: "items"
  6910. },
  6911. returnValue: {
  6912. index: "tapIndex"
  6913. }
  6914. };
  6915. const showLoading = {
  6916. args: {
  6917. title: "content"
  6918. }
  6919. };
  6920. const uploadFile = {
  6921. args: {
  6922. name: "fileName"
  6923. }
  6924. // 从测试结果看,是有返回对象的,文档上没有说明。
  6925. };
  6926. const downloadFile = {
  6927. returnValue: {
  6928. apFilePath: "tempFilePath"
  6929. }
  6930. };
  6931. const getFileInfo = {
  6932. args: {
  6933. filePath: "apFilePath"
  6934. }
  6935. };
  6936. const compressImage = {
  6937. args(fromArgs, toArgs) {
  6938. toArgs.compressLevel = 4;
  6939. if (fromArgs && fromArgs.quality) {
  6940. toArgs.compressLevel = Math.floor(fromArgs.quality / 26);
  6941. }
  6942. if (fromArgs.src) {
  6943. toArgs.apFilePaths = [fromArgs.src];
  6944. }
  6945. },
  6946. returnValue(fromRes, toRes) {
  6947. const apFilePaths = fromRes.apFilePaths;
  6948. if (apFilePaths && apFilePaths.length) {
  6949. toRes.tempFilePath = apFilePaths[0];
  6950. }
  6951. }
  6952. };
  6953. const chooseVideo = {
  6954. // 支付宝小程序文档中未找到(仅在getSetting处提及),但实际可用
  6955. returnValue: {
  6956. apFilePath: "tempFilePath"
  6957. }
  6958. };
  6959. const connectSocket = {
  6960. args: {
  6961. method: false,
  6962. protocols: false
  6963. }
  6964. // TODO 有没有返回值还需要测试下
  6965. };
  6966. const chooseImage = {
  6967. returnValue(result) {
  6968. var _a, _b;
  6969. const hasTempFilePaths = hasOwn$1(result, "tempFilePaths") && result.tempFilePaths;
  6970. if (hasOwn$1(result, "apFilePaths") && !hasTempFilePaths) {
  6971. result.tempFilePaths = [];
  6972. (_a = result.apFilePaths) === null || _a === void 0 ? void 0 : _a.forEach((apFilePath) => {
  6973. var _a2;
  6974. return (_a2 = result.tempFilePaths) === null || _a2 === void 0 ? void 0 : _a2.push(apFilePath);
  6975. });
  6976. }
  6977. if (!hasOwn$1(result, "tempFiles") && hasTempFilePaths) {
  6978. result.tempFiles = [];
  6979. (_b = result.tempFilePaths) === null || _b === void 0 ? void 0 : _b.forEach((tempFilePath) => {
  6980. var _a2;
  6981. return (_a2 = result.tempFiles) === null || _a2 === void 0 ? void 0 : _a2.push({ path: tempFilePath });
  6982. });
  6983. }
  6984. return {};
  6985. }
  6986. };
  6987. const previewImage = {
  6988. args(fromArgs, toArgs) {
  6989. const currentIndex = Number(fromArgs.current);
  6990. if (isNaN(currentIndex)) {
  6991. if (fromArgs.current && isArray(fromArgs.urls)) {
  6992. const index2 = fromArgs.urls.indexOf(fromArgs.current);
  6993. toArgs.current = ~index2 ? index2 : 0;
  6994. }
  6995. } else {
  6996. toArgs.current = currentIndex;
  6997. }
  6998. return {
  6999. indicator: false,
  7000. loop: false
  7001. };
  7002. }
  7003. };
  7004. const saveFile = {
  7005. args: {
  7006. tempFilePath: "apFilePath"
  7007. },
  7008. returnValue: {
  7009. apFilePath: "savedFilePath"
  7010. }
  7011. };
  7012. const getSavedFileInfo = {
  7013. args: {
  7014. filePath: "apFilePath"
  7015. }
  7016. };
  7017. const getSavedFileList = {
  7018. returnValue(fromRes, toRes) {
  7019. toRes.fileList = fromRes.fileList.map((file) => {
  7020. return {
  7021. filePath: file.apFilePath,
  7022. // mini-types file.d.ts 不正确
  7023. createTime: file.createTime,
  7024. size: file.size
  7025. };
  7026. });
  7027. }
  7028. };
  7029. const removeSavedFile = {
  7030. args: {
  7031. filePath: "apFilePath"
  7032. }
  7033. };
  7034. const getLocation = {
  7035. args: {
  7036. type: false,
  7037. altitude: false
  7038. }
  7039. };
  7040. const openLocation = {
  7041. args: {
  7042. // TODO address 参数在阿里上是必传的
  7043. }
  7044. };
  7045. const getNetworkType = {
  7046. returnValue: handleNetworkInfo
  7047. };
  7048. const onNetworkStatusChange = {
  7049. returnValue: handleNetworkInfo
  7050. };
  7051. const stopAccelerometer = {
  7052. name: "offAccelerometerChange"
  7053. };
  7054. const stopCompass = {
  7055. name: "offCompassChange"
  7056. };
  7057. const scanCode = {
  7058. name: "scan",
  7059. args: {
  7060. onlyFromCamera: "hideAlbum"
  7061. },
  7062. returnValue: {
  7063. code: "result"
  7064. }
  7065. };
  7066. const setClipboardData = {
  7067. name: "setClipboard",
  7068. args: {
  7069. data: "text"
  7070. }
  7071. };
  7072. const getClipboardData = {
  7073. name: "getClipboard",
  7074. returnValue: {
  7075. text: "data"
  7076. }
  7077. };
  7078. const pageScrollTo = {
  7079. args: {
  7080. duration: false
  7081. }
  7082. };
  7083. const login = {
  7084. name: "getAuthCode",
  7085. returnValue: {
  7086. authCode: "code"
  7087. }
  7088. };
  7089. const getUserInfo = {
  7090. name: my.canIUse("getOpenUserInfo") ? "getOpenUserInfo" : "getAuthUserInfo",
  7091. returnValue(fromRes, toRes) {
  7092. if (my.canIUse("getOpenUserInfo")) {
  7093. let response;
  7094. try {
  7095. response = JSON.parse(fromRes.response).response;
  7096. } catch (e2) {
  7097. }
  7098. if (response) {
  7099. toRes.userInfo = response;
  7100. toRes.userInfo.avatarUrl = response.avatar;
  7101. delete response.avatar;
  7102. }
  7103. } else {
  7104. toRes.userInfo = {
  7105. openId: "",
  7106. nickName: fromRes.nickName,
  7107. avatarUrl: fromRes.avatar
  7108. };
  7109. }
  7110. }
  7111. };
  7112. const requestPayment = {
  7113. name: "tradePay",
  7114. args: {
  7115. orderInfo: "tradeNO"
  7116. }
  7117. };
  7118. const getBLEDeviceServices = {
  7119. returnValue(fromRes, toRes) {
  7120. toRes.services = fromRes.services.map((item) => {
  7121. return {
  7122. uuid: item.serviceId,
  7123. isPrimary: item.isPrimary
  7124. };
  7125. });
  7126. }
  7127. };
  7128. const createBLEConnection = {
  7129. name: "connectBLEDevice",
  7130. args: {
  7131. timeout: false
  7132. }
  7133. };
  7134. const closeBLEConnection = {
  7135. name: "disconnectBLEDevice"
  7136. };
  7137. const onBLEConnectionStateChange = {
  7138. name: "onBLEConnectionStateChanged"
  7139. };
  7140. const makePhoneCall = {
  7141. args: {
  7142. phoneNumber: "number"
  7143. }
  7144. };
  7145. const stopGyroscope = {
  7146. name: "offGyroscopeChange"
  7147. };
  7148. const getSystemInfo = {
  7149. returnValue: handleSystemInfo
  7150. };
  7151. const getSystemInfoSync = {
  7152. returnValue: handleSystemInfo
  7153. };
  7154. const canvasToTempFilePath = {
  7155. returnValue(fromRes, toRes) {
  7156. toRes.tempFilePath = fromRes.apFilePath;
  7157. }
  7158. };
  7159. const setScreenBrightness = {
  7160. args: {
  7161. value: "brightness"
  7162. }
  7163. };
  7164. const getScreenBrightness = {
  7165. returnValue: {
  7166. brightness: "value"
  7167. }
  7168. };
  7169. const showShareMenu = {
  7170. name: "showSharePanel"
  7171. };
  7172. const hideHomeButton = {
  7173. name: "hideBackHome"
  7174. };
  7175. const saveImageToPhotosAlbum = my.canIUse("saveImageToPhotosAlbum") ? {} : {
  7176. name: "saveImage",
  7177. args: {
  7178. filePath: "url"
  7179. }
  7180. };
  7181. const saveVideoToPhotosAlbum = {
  7182. args: {
  7183. filePath: "src"
  7184. }
  7185. };
  7186. const chooseAddress = {
  7187. name: "getAddress",
  7188. returnValue(fromRes, toRes) {
  7189. const info = fromRes.result || {};
  7190. toRes.userName = info.fullname;
  7191. toRes.countyName = info.country;
  7192. toRes.provinceName = info.prov;
  7193. toRes.cityName = info.city;
  7194. toRes.detailInfo = info.address;
  7195. toRes.telNumber = info.mobilePhone;
  7196. toRes.errMsg = toRes.errMsg + " " + fromRes.resultStatus;
  7197. }
  7198. };
  7199. const navigateTo = my.canIUse("getOpenerEventChannel") ? {} : navigateTo$1();
  7200. var protocols = /* @__PURE__ */ Object.freeze({
  7201. __proto__: null,
  7202. canvasToTempFilePath,
  7203. chooseAddress,
  7204. chooseImage,
  7205. chooseVideo,
  7206. closeBLEConnection,
  7207. compressImage,
  7208. connectSocket,
  7209. createBLEConnection,
  7210. downloadFile,
  7211. getBLEDeviceServices,
  7212. getClipboardData,
  7213. getFileInfo,
  7214. getLocation,
  7215. getNetworkType,
  7216. getSavedFileInfo,
  7217. getSavedFileList,
  7218. getScreenBrightness,
  7219. getSystemInfo,
  7220. getSystemInfoSync,
  7221. getUserInfo,
  7222. hideHomeButton,
  7223. login,
  7224. makePhoneCall,
  7225. navigateTo,
  7226. offError,
  7227. onBLEConnectionStateChange,
  7228. onError,
  7229. onNetworkStatusChange,
  7230. onSocketMessage,
  7231. onSocketOpen,
  7232. openLocation,
  7233. pageScrollTo,
  7234. previewImage,
  7235. redirectTo,
  7236. removeSavedFile,
  7237. request,
  7238. requestPayment,
  7239. returnValue,
  7240. saveFile,
  7241. saveImageToPhotosAlbum,
  7242. saveVideoToPhotosAlbum,
  7243. scanCode,
  7244. setClipboardData,
  7245. setNavigationBarColor,
  7246. setNavigationBarTitle,
  7247. setScreenBrightness,
  7248. showActionSheet,
  7249. showLoading,
  7250. showModal,
  7251. showShareMenu,
  7252. showToast,
  7253. stopAccelerometer,
  7254. stopCompass,
  7255. stopGyroscope,
  7256. uploadFile
  7257. });
  7258. var index = initUni(shims, protocols);
  7259. function initRuntimeSocket(hosts, port, id2) {
  7260. if (hosts == "" || port == "" || id2 == "")
  7261. return Promise.resolve(null);
  7262. return hosts.split(",").reduce((promise, host) => {
  7263. return promise.then((socket) => {
  7264. if (socket != null)
  7265. return Promise.resolve(socket);
  7266. return tryConnectSocket(host, port, id2);
  7267. });
  7268. }, Promise.resolve(null));
  7269. }
  7270. const SOCKET_TIMEOUT = 500;
  7271. function tryConnectSocket(host, port, id2) {
  7272. return new Promise((resolve2, reject) => {
  7273. const socket = index.connectSocket({
  7274. url: `ws://${host}:${port}/${id2}`,
  7275. multiple: true,
  7276. // 支付宝小程序 是否开启多实例
  7277. fail() {
  7278. resolve2(null);
  7279. }
  7280. });
  7281. const timer = setTimeout(() => {
  7282. socket.close({
  7283. code: 1006,
  7284. reason: "connect timeout"
  7285. });
  7286. resolve2(null);
  7287. }, SOCKET_TIMEOUT);
  7288. socket.onOpen((e2) => {
  7289. clearTimeout(timer);
  7290. resolve2(socket);
  7291. });
  7292. socket.onClose((e2) => {
  7293. clearTimeout(timer);
  7294. resolve2(null);
  7295. });
  7296. socket.onError((e2) => {
  7297. clearTimeout(timer);
  7298. resolve2(null);
  7299. });
  7300. });
  7301. }
  7302. const CONSOLE_TYPES = ["log", "warn", "error", "info", "debug"];
  7303. const originalConsole = /* @__PURE__ */ CONSOLE_TYPES.reduce((methods, type) => {
  7304. methods[type] = console[type].bind(console);
  7305. return methods;
  7306. }, {});
  7307. let sendError = null;
  7308. const errorQueue = /* @__PURE__ */ new Set();
  7309. const errorExtra = {};
  7310. function sendErrorMessages(errors) {
  7311. if (sendError == null) {
  7312. errors.forEach((error) => {
  7313. errorQueue.add(error);
  7314. });
  7315. return;
  7316. }
  7317. const data = errors.map((err) => {
  7318. if (typeof err === "string") {
  7319. return err;
  7320. }
  7321. const isPromiseRejection = err && "promise" in err && "reason" in err;
  7322. const prefix = isPromiseRejection ? "UnhandledPromiseRejection: " : "";
  7323. if (isPromiseRejection) {
  7324. err = err.reason;
  7325. }
  7326. if (err instanceof Error && err.stack) {
  7327. if (err.message && !err.stack.includes(err.message)) {
  7328. return `${prefix}${err.message}
  7329. ${err.stack}`;
  7330. }
  7331. return `${prefix}${err.stack}`;
  7332. }
  7333. if (typeof err === "object" && err !== null) {
  7334. try {
  7335. return prefix + JSON.stringify(err);
  7336. } catch (err2) {
  7337. return prefix + String(err2);
  7338. }
  7339. }
  7340. return prefix + String(err);
  7341. }).filter(Boolean);
  7342. if (data.length > 0) {
  7343. sendError(JSON.stringify(Object.assign({
  7344. type: "error",
  7345. data
  7346. }, errorExtra)));
  7347. }
  7348. }
  7349. function setSendError(value, extra = {}) {
  7350. sendError = value;
  7351. Object.assign(errorExtra, extra);
  7352. if (value != null && errorQueue.size > 0) {
  7353. const errors = Array.from(errorQueue);
  7354. errorQueue.clear();
  7355. sendErrorMessages(errors);
  7356. }
  7357. }
  7358. function initOnError() {
  7359. function onError2(error) {
  7360. try {
  7361. if (typeof PromiseRejectionEvent !== "undefined" && error instanceof PromiseRejectionEvent && error.reason instanceof Error && error.reason.message && error.reason.message.includes(`Cannot create property 'errMsg' on string 'taskId`)) {
  7362. return;
  7363. }
  7364. if (true) {
  7365. originalConsole.error(error);
  7366. }
  7367. sendErrorMessages([error]);
  7368. } catch (err) {
  7369. originalConsole.error(err);
  7370. }
  7371. }
  7372. if (typeof index.onError === "function") {
  7373. index.onError(onError2);
  7374. }
  7375. if (typeof index.onUnhandledRejection === "function") {
  7376. index.onUnhandledRejection(onError2);
  7377. }
  7378. return function offError2() {
  7379. if (typeof index.offError === "function") {
  7380. index.offError(onError2);
  7381. }
  7382. if (typeof index.offUnhandledRejection === "function") {
  7383. index.offUnhandledRejection(onError2);
  7384. }
  7385. };
  7386. }
  7387. function formatMessage(type, args) {
  7388. try {
  7389. return {
  7390. type,
  7391. args: formatArgs(args)
  7392. };
  7393. } catch (e2) {
  7394. }
  7395. return {
  7396. type,
  7397. args: []
  7398. };
  7399. }
  7400. function formatArgs(args) {
  7401. return args.map((arg) => formatArg(arg));
  7402. }
  7403. function formatArg(arg, depth = 0) {
  7404. if (depth >= 7) {
  7405. return {
  7406. type: "object",
  7407. value: "[Maximum depth reached]"
  7408. };
  7409. }
  7410. const type = typeof arg;
  7411. switch (type) {
  7412. case "string":
  7413. return formatString(arg);
  7414. case "number":
  7415. return formatNumber(arg);
  7416. case "boolean":
  7417. return formatBoolean(arg);
  7418. case "object":
  7419. try {
  7420. return formatObject(arg, depth);
  7421. } catch (e2) {
  7422. return {
  7423. type: "object",
  7424. value: {
  7425. properties: []
  7426. }
  7427. };
  7428. }
  7429. case "undefined":
  7430. return formatUndefined();
  7431. case "function":
  7432. return formatFunction(arg);
  7433. case "symbol": {
  7434. return formatSymbol(arg);
  7435. }
  7436. case "bigint":
  7437. return formatBigInt(arg);
  7438. }
  7439. }
  7440. function formatFunction(value) {
  7441. return {
  7442. type: "function",
  7443. value: `function ${value.name}() {}`
  7444. };
  7445. }
  7446. function formatUndefined() {
  7447. return {
  7448. type: "undefined"
  7449. };
  7450. }
  7451. function formatBoolean(value) {
  7452. return {
  7453. type: "boolean",
  7454. value: String(value)
  7455. };
  7456. }
  7457. function formatNumber(value) {
  7458. return {
  7459. type: "number",
  7460. value: String(value)
  7461. };
  7462. }
  7463. function formatBigInt(value) {
  7464. return {
  7465. type: "bigint",
  7466. value: String(value)
  7467. };
  7468. }
  7469. function formatString(value) {
  7470. return {
  7471. type: "string",
  7472. value
  7473. };
  7474. }
  7475. function formatSymbol(value) {
  7476. return {
  7477. type: "symbol",
  7478. value: value.description
  7479. };
  7480. }
  7481. function formatObject(value, depth) {
  7482. if (value === null) {
  7483. return {
  7484. type: "null"
  7485. };
  7486. }
  7487. {
  7488. if (isComponentPublicInstance(value)) {
  7489. return formatComponentPublicInstance(value, depth);
  7490. }
  7491. if (isComponentInternalInstance(value)) {
  7492. return formatComponentInternalInstance(value, depth);
  7493. }
  7494. if (isUniElement(value)) {
  7495. return formatUniElement(value, depth);
  7496. }
  7497. if (isCSSStyleDeclaration(value)) {
  7498. return formatCSSStyleDeclaration(value, depth);
  7499. }
  7500. }
  7501. if (Array.isArray(value)) {
  7502. return {
  7503. type: "object",
  7504. subType: "array",
  7505. value: {
  7506. properties: value.map((v, i) => formatArrayElement(v, i, depth + 1))
  7507. }
  7508. };
  7509. }
  7510. if (value instanceof Set) {
  7511. return {
  7512. type: "object",
  7513. subType: "set",
  7514. className: "Set",
  7515. description: `Set(${value.size})`,
  7516. value: {
  7517. entries: Array.from(value).map((v) => formatSetEntry(v, depth + 1))
  7518. }
  7519. };
  7520. }
  7521. if (value instanceof Map) {
  7522. return {
  7523. type: "object",
  7524. subType: "map",
  7525. className: "Map",
  7526. description: `Map(${value.size})`,
  7527. value: {
  7528. entries: Array.from(value.entries()).map((v) => formatMapEntry(v, depth + 1))
  7529. }
  7530. };
  7531. }
  7532. if (value instanceof Promise) {
  7533. return {
  7534. type: "object",
  7535. subType: "promise",
  7536. value: {
  7537. properties: []
  7538. }
  7539. };
  7540. }
  7541. if (value instanceof RegExp) {
  7542. return {
  7543. type: "object",
  7544. subType: "regexp",
  7545. value: String(value),
  7546. className: "Regexp"
  7547. };
  7548. }
  7549. if (value instanceof Date) {
  7550. return {
  7551. type: "object",
  7552. subType: "date",
  7553. value: String(value),
  7554. className: "Date"
  7555. };
  7556. }
  7557. if (value instanceof Error) {
  7558. return {
  7559. type: "object",
  7560. subType: "error",
  7561. value: value.message || String(value),
  7562. className: value.name || "Error"
  7563. };
  7564. }
  7565. let className = void 0;
  7566. {
  7567. const constructor = value.constructor;
  7568. if (constructor) {
  7569. if (constructor.get$UTSMetadata$) {
  7570. className = constructor.get$UTSMetadata$().name;
  7571. }
  7572. }
  7573. }
  7574. let entries = Object.entries(value);
  7575. if (isHarmonyBuilderParams(value)) {
  7576. entries = entries.filter(([key]) => key !== "modifier" && key !== "nodeContent");
  7577. }
  7578. return {
  7579. type: "object",
  7580. className,
  7581. value: {
  7582. properties: entries.map((entry) => formatObjectProperty(entry[0], entry[1], depth + 1))
  7583. }
  7584. };
  7585. }
  7586. function isHarmonyBuilderParams(value) {
  7587. return value.modifier && value.modifier._attribute && value.nodeContent;
  7588. }
  7589. function isComponentPublicInstance(value) {
  7590. return value.$ && isComponentInternalInstance(value.$);
  7591. }
  7592. function isComponentInternalInstance(value) {
  7593. return value.type && value.uid != null && value.appContext;
  7594. }
  7595. function formatComponentPublicInstance(value, depth) {
  7596. return {
  7597. type: "object",
  7598. className: "ComponentPublicInstance",
  7599. value: {
  7600. properties: Object.entries(value.$.type).map(([name, value2]) => formatObjectProperty(name, value2, depth + 1))
  7601. }
  7602. };
  7603. }
  7604. function formatComponentInternalInstance(value, depth) {
  7605. return {
  7606. type: "object",
  7607. className: "ComponentInternalInstance",
  7608. value: {
  7609. properties: Object.entries(value.type).map(([name, value2]) => formatObjectProperty(name, value2, depth + 1))
  7610. }
  7611. };
  7612. }
  7613. function isUniElement(value) {
  7614. return value.style && value.tagName != null && value.nodeName != null;
  7615. }
  7616. function formatUniElement(value, depth) {
  7617. return {
  7618. type: "object",
  7619. // 非 x 没有 UniElement 的概念
  7620. // className: 'UniElement',
  7621. value: {
  7622. properties: Object.entries(value).filter(([name]) => [
  7623. "id",
  7624. "tagName",
  7625. "nodeName",
  7626. "dataset",
  7627. "offsetTop",
  7628. "offsetLeft",
  7629. "style"
  7630. ].includes(name)).map(([name, value2]) => formatObjectProperty(name, value2, depth + 1))
  7631. }
  7632. };
  7633. }
  7634. function isCSSStyleDeclaration(value) {
  7635. return typeof value.getPropertyValue === "function" && typeof value.setProperty === "function" && value.$styles;
  7636. }
  7637. function formatCSSStyleDeclaration(style, depth) {
  7638. return {
  7639. type: "object",
  7640. value: {
  7641. properties: Object.entries(style.$styles).map(([name, value]) => formatObjectProperty(name, value, depth + 1))
  7642. }
  7643. };
  7644. }
  7645. function formatObjectProperty(name, value, depth) {
  7646. const result = formatArg(value, depth);
  7647. result.name = name;
  7648. return result;
  7649. }
  7650. function formatArrayElement(value, index2, depth) {
  7651. const result = formatArg(value, depth);
  7652. result.name = `${index2}`;
  7653. return result;
  7654. }
  7655. function formatSetEntry(value, depth) {
  7656. return {
  7657. value: formatArg(value, depth)
  7658. };
  7659. }
  7660. function formatMapEntry(value, depth) {
  7661. return {
  7662. key: formatArg(value[0], depth),
  7663. value: formatArg(value[1], depth)
  7664. };
  7665. }
  7666. let sendConsole = null;
  7667. const messageQueue = [];
  7668. const messageExtra = {};
  7669. const EXCEPTION_BEGIN_MARK = "---BEGIN:EXCEPTION---";
  7670. const EXCEPTION_END_MARK = "---END:EXCEPTION---";
  7671. function sendConsoleMessages(messages) {
  7672. if (sendConsole == null) {
  7673. messageQueue.push(...messages);
  7674. return;
  7675. }
  7676. sendConsole(JSON.stringify(Object.assign({
  7677. type: "console",
  7678. data: messages
  7679. }, messageExtra)));
  7680. }
  7681. function setSendConsole(value, extra = {}) {
  7682. sendConsole = value;
  7683. Object.assign(messageExtra, extra);
  7684. if (value != null && messageQueue.length > 0) {
  7685. const messages = messageQueue.slice();
  7686. messageQueue.length = 0;
  7687. sendConsoleMessages(messages);
  7688. }
  7689. }
  7690. const atFileRegex = /^\s*at\s+[\w/./-]+:\d+$/;
  7691. function rewriteConsole() {
  7692. function wrapConsole(type) {
  7693. return function(...args) {
  7694. {
  7695. const originalArgs = [...args];
  7696. if (originalArgs.length) {
  7697. const maybeAtFile = originalArgs[originalArgs.length - 1];
  7698. if (typeof maybeAtFile === "string" && atFileRegex.test(maybeAtFile)) {
  7699. originalArgs.pop();
  7700. }
  7701. }
  7702. originalConsole[type](...originalArgs);
  7703. }
  7704. if (type === "error" && args.length === 1) {
  7705. const arg = args[0];
  7706. if (typeof arg === "string" && arg.startsWith(EXCEPTION_BEGIN_MARK)) {
  7707. const startIndex = EXCEPTION_BEGIN_MARK.length;
  7708. const endIndex = arg.length - EXCEPTION_END_MARK.length;
  7709. sendErrorMessages([arg.slice(startIndex, endIndex)]);
  7710. return;
  7711. } else if (arg instanceof Error) {
  7712. sendErrorMessages([arg]);
  7713. return;
  7714. }
  7715. }
  7716. sendConsoleMessages([formatMessage(type, args)]);
  7717. };
  7718. }
  7719. if (isConsoleWritable()) {
  7720. CONSOLE_TYPES.forEach((type) => {
  7721. console[type] = wrapConsole(type);
  7722. });
  7723. return function restoreConsole() {
  7724. CONSOLE_TYPES.forEach((type) => {
  7725. console[type] = originalConsole[type];
  7726. });
  7727. };
  7728. } else {
  7729. {
  7730. if (typeof index !== "undefined" && index.__f__) {
  7731. const oldLog = index.__f__;
  7732. if (oldLog) {
  7733. index.__f__ = function(...args) {
  7734. const [type, filename, ...rest] = args;
  7735. oldLog(type, "", ...rest);
  7736. sendConsoleMessages([formatMessage(type, [...rest, filename])]);
  7737. };
  7738. return function restoreConsole() {
  7739. index.__f__ = oldLog;
  7740. };
  7741. }
  7742. }
  7743. }
  7744. }
  7745. return function restoreConsole() {
  7746. };
  7747. }
  7748. function isConsoleWritable() {
  7749. const value = console.log;
  7750. const sym = Symbol();
  7751. try {
  7752. console.log = sym;
  7753. } catch (ex) {
  7754. return false;
  7755. }
  7756. const isWritable = console.log === sym;
  7757. console.log = value;
  7758. return isWritable;
  7759. }
  7760. function initRuntimeSocketService() {
  7761. const hosts = "192.168.202.254,127.0.0.1";
  7762. const port = "8090";
  7763. const id2 = "mp-alipay_TaGUSH";
  7764. const lazy = typeof swan !== "undefined";
  7765. let restoreError = lazy ? () => {
  7766. } : initOnError();
  7767. let restoreConsole = lazy ? () => {
  7768. } : rewriteConsole();
  7769. return Promise.resolve().then(() => {
  7770. if (lazy) {
  7771. restoreError = initOnError();
  7772. restoreConsole = rewriteConsole();
  7773. }
  7774. return initRuntimeSocket(hosts, port, id2).then((socket) => {
  7775. if (!socket) {
  7776. restoreError();
  7777. restoreConsole();
  7778. originalConsole.error(wrapError("开发模式下日志通道建立 socket 连接失败。"));
  7779. {
  7780. originalConsole.error(wrapError("小程序平台,请勾选不校验合法域名配置。"));
  7781. }
  7782. originalConsole.error(wrapError("如果是运行到真机,请确认手机与电脑处于同一网络。"));
  7783. return false;
  7784. }
  7785. {
  7786. initMiniProgramGlobalFlag();
  7787. }
  7788. socket.onClose(() => {
  7789. {
  7790. originalConsole.error(wrapError("开发模式下日志通道 socket 连接关闭,请在 HBuilderX 中重新运行。"));
  7791. }
  7792. restoreError();
  7793. restoreConsole();
  7794. });
  7795. setSendConsole((data) => {
  7796. socket.send({
  7797. data
  7798. });
  7799. });
  7800. setSendError((data) => {
  7801. socket.send({
  7802. data
  7803. });
  7804. });
  7805. return true;
  7806. });
  7807. });
  7808. }
  7809. const ERROR_CHAR = "‌";
  7810. function wrapError(error) {
  7811. return `${ERROR_CHAR}${error}${ERROR_CHAR}`;
  7812. }
  7813. function initMiniProgramGlobalFlag() {
  7814. if (typeof wx !== "undefined") {
  7815. wx.__uni_console__ = true;
  7816. } else if (typeof my !== "undefined") {
  7817. my.__uni_console__ = true;
  7818. } else if (typeof tt !== "undefined") {
  7819. tt.__uni_console__ = true;
  7820. } else if (typeof swan !== "undefined") {
  7821. swan.__uni_console__ = true;
  7822. } else if (typeof qq !== "undefined") {
  7823. qq.__uni_console__ = true;
  7824. } else if (typeof ks !== "undefined") {
  7825. ks.__uni_console__ = true;
  7826. } else if (typeof jd !== "undefined") {
  7827. jd.__uni_console__ = true;
  7828. } else if (typeof xhs !== "undefined") {
  7829. xhs.__uni_console__ = true;
  7830. } else if (typeof has !== "undefined") {
  7831. has.__uni_console__ = true;
  7832. } else if (typeof qa !== "undefined") {
  7833. qa.__uni_console__ = true;
  7834. }
  7835. }
  7836. initRuntimeSocketService();
  7837. const _export_sfc = (sfc, props) => {
  7838. const target = sfc.__vccOpts || sfc;
  7839. for (const [key, val] of props) {
  7840. target[key] = val;
  7841. }
  7842. return target;
  7843. };
  7844. function initVueIds(vueIds, mpInstance) {
  7845. if (!vueIds) {
  7846. return;
  7847. }
  7848. const ids = vueIds.split(",");
  7849. const len = ids.length;
  7850. if (len === 1) {
  7851. mpInstance._$vueId = ids[0];
  7852. } else if (len === 2) {
  7853. mpInstance._$vueId = ids[0];
  7854. mpInstance._$vuePid = ids[1];
  7855. }
  7856. }
  7857. function initWxsCallMethods(methods, wxsCallMethods) {
  7858. if (!isArray(wxsCallMethods)) {
  7859. return;
  7860. }
  7861. wxsCallMethods.forEach((callMethod) => {
  7862. methods[callMethod] = function(args) {
  7863. return this.$vm[callMethod](args);
  7864. };
  7865. });
  7866. }
  7867. function findVmByVueId(instance, vuePid) {
  7868. const $children = instance.$children;
  7869. for (let i = $children.length - 1; i >= 0; i--) {
  7870. const childVm = $children[i];
  7871. if (childVm.$scope._$vueId === vuePid) {
  7872. return childVm;
  7873. }
  7874. }
  7875. let parentVm;
  7876. for (let i = $children.length - 1; i >= 0; i--) {
  7877. parentVm = findVmByVueId($children[i], vuePid);
  7878. if (parentVm) {
  7879. return parentVm;
  7880. }
  7881. }
  7882. }
  7883. function getLocaleLanguage() {
  7884. let localeLanguage = "";
  7885. {
  7886. localeLanguage = normalizeLocale(my.getSystemInfoSync().language) || LOCALE_EN;
  7887. }
  7888. return localeLanguage;
  7889. }
  7890. const MP_METHODS = [
  7891. "createSelectorQuery",
  7892. "createIntersectionObserver",
  7893. "selectAllComponents",
  7894. "selectComponent"
  7895. ];
  7896. function createEmitFn(oldEmit, ctx) {
  7897. return function emit2(event, ...args) {
  7898. const scope = ctx.$scope;
  7899. if (scope && event) {
  7900. const detail = { __args__: args };
  7901. {
  7902. scope.triggerEvent(event, detail);
  7903. }
  7904. }
  7905. {
  7906. const props = scope.props;
  7907. if (props && props[`on${capitalize(event)}`]) {
  7908. return;
  7909. }
  7910. }
  7911. return oldEmit.apply(this, [event, ...args]);
  7912. };
  7913. }
  7914. function initBaseInstance(instance, options) {
  7915. const ctx = instance.ctx;
  7916. ctx.mpType = options.mpType;
  7917. ctx.$mpType = options.mpType;
  7918. ctx.$mpPlatform = "mp-alipay";
  7919. ctx.$scope = options.mpInstance;
  7920. {
  7921. Object.defineProperties(ctx, {
  7922. // only id
  7923. [VIRTUAL_HOST_ID]: {
  7924. get() {
  7925. const id2 = this.$scope.data[VIRTUAL_HOST_ID];
  7926. return id2 === void 0 ? "" : id2;
  7927. }
  7928. }
  7929. });
  7930. }
  7931. ctx.$mp = {};
  7932. {
  7933. ctx._self = {};
  7934. }
  7935. instance.slots = {};
  7936. if (isArray(options.slots) && options.slots.length) {
  7937. options.slots.forEach((name) => {
  7938. instance.slots[name] = true;
  7939. });
  7940. if (instance.slots[SLOT_DEFAULT_NAME]) {
  7941. instance.slots.default = true;
  7942. }
  7943. }
  7944. ctx.getOpenerEventChannel = function() {
  7945. {
  7946. if (my.canIUse("getOpenerEventChannel"))
  7947. return options.mpInstance.getOpenerEventChannel();
  7948. }
  7949. if (!this.__eventChannel__) {
  7950. this.__eventChannel__ = new EventChannel();
  7951. }
  7952. return this.__eventChannel__;
  7953. };
  7954. ctx.$hasHook = hasHook;
  7955. ctx.$callHook = callHook;
  7956. instance.emit = createEmitFn(instance.emit, ctx);
  7957. }
  7958. function initComponentInstance(instance, options) {
  7959. initBaseInstance(instance, options);
  7960. const ctx = instance.ctx;
  7961. MP_METHODS.forEach((method) => {
  7962. ctx[method] = function(...args) {
  7963. const mpInstance = ctx.$scope;
  7964. if (mpInstance && mpInstance[method]) {
  7965. return mpInstance[method].apply(mpInstance, args);
  7966. }
  7967. {
  7968. return my[method] && my[method].apply(my, args);
  7969. }
  7970. };
  7971. });
  7972. }
  7973. function initMocks(instance, mpInstance, mocks2) {
  7974. const ctx = instance.ctx;
  7975. mocks2.forEach((mock) => {
  7976. if (hasOwn$1(mpInstance, mock)) {
  7977. instance[mock] = ctx[mock] = mpInstance[mock];
  7978. }
  7979. });
  7980. }
  7981. function hasHook(name) {
  7982. const hooks = this.$[name];
  7983. if (hooks && hooks.length) {
  7984. return true;
  7985. }
  7986. return false;
  7987. }
  7988. function callHook(name, args) {
  7989. if (name === "mounted") {
  7990. callHook.call(this, "bm");
  7991. this.$.isMounted = true;
  7992. name = "m";
  7993. }
  7994. {
  7995. if (name === "onLoad" && args && args.__id__ && isFunction(my.getEventChannel)) {
  7996. this.__eventChannel__ = my.getEventChannel(args.__id__);
  7997. delete args.__id__;
  7998. }
  7999. }
  8000. const hooks = this.$[name];
  8001. return hooks && invokeArrayFns(hooks, args);
  8002. }
  8003. const PAGE_INIT_HOOKS = [
  8004. ON_LOAD,
  8005. ON_SHOW,
  8006. ON_HIDE,
  8007. ON_UNLOAD,
  8008. ON_RESIZE,
  8009. ON_TAB_ITEM_TAP,
  8010. ON_REACH_BOTTOM,
  8011. ON_PULL_DOWN_REFRESH,
  8012. ON_ADD_TO_FAVORITES
  8013. // 'onReady', // lifetimes.ready
  8014. // 'onPageScroll', // 影响性能,开发者手动注册
  8015. // 'onShareTimeline', // 右上角菜单,开发者手动注册
  8016. // 'onShareAppMessage' // 右上角菜单,开发者手动注册
  8017. ];
  8018. function findHooks(vueOptions, hooks = /* @__PURE__ */ new Set()) {
  8019. if (vueOptions) {
  8020. Object.keys(vueOptions).forEach((name) => {
  8021. if (isUniLifecycleHook(name, vueOptions[name])) {
  8022. hooks.add(name);
  8023. }
  8024. });
  8025. {
  8026. const { extends: extendsOptions, mixins } = vueOptions;
  8027. if (mixins) {
  8028. mixins.forEach((mixin) => findHooks(mixin, hooks));
  8029. }
  8030. if (extendsOptions) {
  8031. findHooks(extendsOptions, hooks);
  8032. }
  8033. }
  8034. }
  8035. return hooks;
  8036. }
  8037. function initHook(mpOptions, hook, excludes) {
  8038. if (excludes.indexOf(hook) === -1 && !hasOwn$1(mpOptions, hook)) {
  8039. mpOptions[hook] = function(args) {
  8040. return this.$vm && this.$vm.$callHook(hook, args);
  8041. };
  8042. }
  8043. }
  8044. const EXCLUDE_HOOKS = [ON_READY];
  8045. function initHooks(mpOptions, hooks, excludes = EXCLUDE_HOOKS) {
  8046. hooks.forEach((hook) => initHook(mpOptions, hook, excludes));
  8047. }
  8048. function initUnknownHooks(mpOptions, vueOptions, excludes = EXCLUDE_HOOKS) {
  8049. findHooks(vueOptions).forEach((hook) => initHook(mpOptions, hook, excludes));
  8050. }
  8051. function initRuntimeHooks(mpOptions, runtimeHooks) {
  8052. if (!runtimeHooks) {
  8053. return;
  8054. }
  8055. const hooks = Object.keys(MINI_PROGRAM_PAGE_RUNTIME_HOOKS);
  8056. hooks.forEach((hook) => {
  8057. if (runtimeHooks & MINI_PROGRAM_PAGE_RUNTIME_HOOKS[hook]) {
  8058. initHook(mpOptions, hook, []);
  8059. }
  8060. });
  8061. }
  8062. const HOOKS = [
  8063. ON_SHOW,
  8064. ON_HIDE,
  8065. ON_ERROR,
  8066. ON_THEME_CHANGE,
  8067. ON_PAGE_NOT_FOUND,
  8068. ON_UNHANDLE_REJECTION
  8069. ];
  8070. function parseApp(instance, parseAppOptions2) {
  8071. const internalInstance = instance.$;
  8072. const appOptions = {
  8073. globalData: instance.$options && instance.$options.globalData || {},
  8074. $vm: instance,
  8075. // mp-alipay 组件 data 初始化比 onLaunch 早,提前挂载
  8076. onLaunch(options) {
  8077. this.$vm = instance;
  8078. const ctx = internalInstance.ctx;
  8079. if (this.$vm && ctx.$scope && ctx.$callHook) {
  8080. return;
  8081. }
  8082. initBaseInstance(internalInstance, {
  8083. mpType: "app",
  8084. mpInstance: this,
  8085. slots: []
  8086. });
  8087. ctx.globalData = this.globalData;
  8088. instance.$callHook(ON_LAUNCH, options);
  8089. }
  8090. };
  8091. const onErrorHandlers = my.$onErrorHandlers;
  8092. if (onErrorHandlers) {
  8093. onErrorHandlers.forEach((fn) => {
  8094. injectHook(ON_ERROR, fn, internalInstance);
  8095. });
  8096. onErrorHandlers.length = 0;
  8097. }
  8098. initLocale(instance);
  8099. const vueOptions = instance.$.type;
  8100. initHooks(appOptions, HOOKS);
  8101. initUnknownHooks(appOptions, vueOptions);
  8102. {
  8103. const methods = vueOptions.methods;
  8104. methods && extend(appOptions, methods);
  8105. }
  8106. if (parseAppOptions2) {
  8107. parseAppOptions2.parse(appOptions);
  8108. }
  8109. return appOptions;
  8110. }
  8111. function initCreateApp(parseAppOptions2) {
  8112. return function createApp2(vm) {
  8113. return App(parseApp(vm, parseAppOptions2));
  8114. };
  8115. }
  8116. function initCreateSubpackageApp(parseAppOptions2) {
  8117. return function createApp2(vm) {
  8118. const appOptions = parseApp(vm, parseAppOptions2);
  8119. const app = isFunction(getApp) && getApp({
  8120. allowDefault: true
  8121. });
  8122. if (!app)
  8123. return;
  8124. vm.$.ctx.$scope = app;
  8125. const globalData = app.globalData;
  8126. if (globalData) {
  8127. Object.keys(appOptions.globalData).forEach((name) => {
  8128. if (!hasOwn$1(globalData, name)) {
  8129. globalData[name] = appOptions.globalData[name];
  8130. }
  8131. });
  8132. }
  8133. Object.keys(appOptions).forEach((name) => {
  8134. if (!hasOwn$1(app, name)) {
  8135. app[name] = appOptions[name];
  8136. }
  8137. });
  8138. initAppLifecycle(appOptions, vm);
  8139. };
  8140. }
  8141. function initAppLifecycle(appOptions, vm) {
  8142. if (isFunction(appOptions.onLaunch)) {
  8143. const args = my.getLaunchOptionsSync && my.getLaunchOptionsSync();
  8144. appOptions.onLaunch(args);
  8145. }
  8146. if (isFunction(appOptions.onShow) && my.onAppShow) {
  8147. my.onAppShow((args) => {
  8148. vm.$callHook("onShow", args);
  8149. });
  8150. }
  8151. if (isFunction(appOptions.onHide) && my.onAppHide) {
  8152. my.onAppHide((args) => {
  8153. vm.$callHook("onHide", args);
  8154. });
  8155. }
  8156. }
  8157. function initLocale(appVm) {
  8158. const locale = ref(getLocaleLanguage());
  8159. Object.defineProperty(appVm, "$locale", {
  8160. get() {
  8161. return locale.value;
  8162. },
  8163. set(v) {
  8164. locale.value = v;
  8165. }
  8166. });
  8167. }
  8168. const builtInProps = [
  8169. // 百度小程序,快手小程序自定义组件不支持绑定动态事件,动态dataset,故通过props传递事件信息
  8170. // event-opts
  8171. "eO",
  8172. // 组件 ref
  8173. "uR",
  8174. // 组件 ref-in-for
  8175. "uRIF",
  8176. // 组件 id
  8177. "uI",
  8178. // 组件类型 m: 小程序组件
  8179. "uT",
  8180. // 组件 props
  8181. "uP",
  8182. // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  8183. "uS"
  8184. ];
  8185. function initDefaultProps(options, isBehavior = false) {
  8186. const properties = {};
  8187. if (!isBehavior) {
  8188. let observerSlots = function(newVal) {
  8189. const $slots = /* @__PURE__ */ Object.create(null);
  8190. newVal && newVal.forEach((slotName) => {
  8191. $slots[slotName] = true;
  8192. });
  8193. this.setData({
  8194. $slots
  8195. });
  8196. };
  8197. builtInProps.forEach((name) => {
  8198. properties[name] = {
  8199. type: null,
  8200. value: ""
  8201. };
  8202. });
  8203. properties.uS = {
  8204. type: null,
  8205. value: []
  8206. };
  8207. {
  8208. properties.uS.observer = observerSlots;
  8209. }
  8210. }
  8211. if (options.behaviors) {
  8212. if (options.behaviors.includes("my://form-field")) {
  8213. if (!options.properties || !options.properties.name) {
  8214. properties.name = {
  8215. type: null,
  8216. value: ""
  8217. };
  8218. }
  8219. if (!options.properties || !options.properties.value) {
  8220. properties.value = {
  8221. type: null,
  8222. value: ""
  8223. };
  8224. }
  8225. }
  8226. }
  8227. return properties;
  8228. }
  8229. function initVirtualHostProps(options) {
  8230. const properties = {};
  8231. {
  8232. {
  8233. properties[VIRTUAL_HOST_STYLE] = {
  8234. type: null,
  8235. value: ""
  8236. };
  8237. properties[VIRTUAL_HOST_CLASS] = {
  8238. type: null,
  8239. value: ""
  8240. };
  8241. properties[VIRTUAL_HOST_HIDDEN] = {
  8242. type: null,
  8243. value: ""
  8244. };
  8245. properties[VIRTUAL_HOST_ID] = {
  8246. type: null,
  8247. value: ""
  8248. };
  8249. }
  8250. }
  8251. return properties;
  8252. }
  8253. function initProps(mpComponentOptions) {
  8254. if (!mpComponentOptions.properties) {
  8255. mpComponentOptions.properties = {};
  8256. }
  8257. extend(mpComponentOptions.properties, initDefaultProps(mpComponentOptions), initVirtualHostProps());
  8258. }
  8259. function findPropsData(properties, isPage) {
  8260. return (isPage ? findPagePropsData(properties) : findComponentPropsData(resolvePropValue(properties.uP))) || {};
  8261. }
  8262. function findPagePropsData(properties) {
  8263. const propsData = {};
  8264. if (isPlainObject(properties)) {
  8265. Object.keys(properties).forEach((name) => {
  8266. if (builtInProps.indexOf(name) === -1) {
  8267. propsData[name] = resolvePropValue(properties[name]);
  8268. }
  8269. });
  8270. }
  8271. return propsData;
  8272. }
  8273. function resolvePropValue(prop) {
  8274. return prop;
  8275. }
  8276. function initData(_) {
  8277. return {};
  8278. }
  8279. function updateMiniProgramComponentProperties(up, mpInstance) {
  8280. const prevProps = mpInstance.props;
  8281. const nextProps = findComponentPropsData(up) || {};
  8282. if (hasPropsChanged(prevProps, nextProps, false)) {
  8283. mpInstance.setData(nextProps);
  8284. }
  8285. }
  8286. function updateComponentProps(up, instance) {
  8287. const prevProps = toRaw(instance.props);
  8288. const nextProps = findComponentPropsData(up) || {};
  8289. if (hasPropsChanged(prevProps, nextProps)) {
  8290. updateProps(instance, nextProps, prevProps, false);
  8291. if (hasQueueJob(instance.update)) {
  8292. invalidateJob(instance.update);
  8293. }
  8294. {
  8295. instance.update();
  8296. }
  8297. }
  8298. }
  8299. function hasPropsChanged(prevProps, nextProps, checkLen = true) {
  8300. const nextKeys = Object.keys(nextProps);
  8301. if (checkLen && nextKeys.length !== Object.keys(prevProps).length) {
  8302. return true;
  8303. }
  8304. for (let i = 0; i < nextKeys.length; i++) {
  8305. const key = nextKeys[i];
  8306. if (nextProps[key] !== prevProps[key]) {
  8307. return true;
  8308. }
  8309. }
  8310. return false;
  8311. }
  8312. function initBehaviors(vueOptions) {
  8313. const vueBehaviors = vueOptions.behaviors;
  8314. let vueProps = vueOptions.props;
  8315. if (!vueProps) {
  8316. vueOptions.props = vueProps = [];
  8317. }
  8318. const behaviors = [];
  8319. if (isArray(vueBehaviors)) {
  8320. vueBehaviors.forEach((behavior) => {
  8321. behaviors.push(behavior.replace("uni://", "my://"));
  8322. if (behavior === "uni://form-field") {
  8323. if (isArray(vueProps)) {
  8324. vueProps.push("name");
  8325. vueProps.push("modelValue");
  8326. } else {
  8327. vueProps.name = {
  8328. type: String,
  8329. default: ""
  8330. };
  8331. vueProps.modelValue = {
  8332. type: [String, Number, Boolean, Array, Object, Date],
  8333. default: ""
  8334. };
  8335. }
  8336. }
  8337. });
  8338. }
  8339. return behaviors;
  8340. }
  8341. let $createComponentFn;
  8342. let $destroyComponentFn;
  8343. function getAppVm() {
  8344. return getApp().$vm;
  8345. }
  8346. function $createComponent(initialVNode, options) {
  8347. if (!$createComponentFn) {
  8348. $createComponentFn = getAppVm().$createComponent;
  8349. }
  8350. const proxy = $createComponentFn(initialVNode, options);
  8351. return getExposeProxy(proxy.$) || proxy;
  8352. }
  8353. function $destroyComponent(instance) {
  8354. if (!$destroyComponentFn) {
  8355. $destroyComponentFn = getAppVm().$destroyComponent;
  8356. }
  8357. return $destroyComponentFn(instance);
  8358. }
  8359. function initCreatePluginApp(parseAppOptions2) {
  8360. return function createApp2(vm) {
  8361. initAppLifecycle(parseApp(vm, parseAppOptions2), vm);
  8362. };
  8363. }
  8364. function handleLink$1(event) {
  8365. const detail = event.detail || event.value;
  8366. const vuePid = detail.vuePid;
  8367. let parentVm;
  8368. if (vuePid) {
  8369. parentVm = findVmByVueId(this.$vm, vuePid);
  8370. }
  8371. if (!parentVm) {
  8372. parentVm = this.$vm;
  8373. }
  8374. detail.parent = parentVm;
  8375. }
  8376. const isComponent2 = my.canIUse("component2");
  8377. const mocks = ["$id"];
  8378. function initRelation(mpInstance, detail) {
  8379. mpInstance.props.onVI(detail);
  8380. }
  8381. function initSpecialMethods(mpInstance) {
  8382. if (!mpInstance.$vm) {
  8383. return;
  8384. }
  8385. let path = mpInstance.is || mpInstance.route;
  8386. if (!path) {
  8387. return;
  8388. }
  8389. if (path.indexOf("/") === 0) {
  8390. path = path.slice(1);
  8391. }
  8392. const specialMethods = my.specialMethods && my.specialMethods[path];
  8393. if (specialMethods) {
  8394. specialMethods.forEach((method) => {
  8395. if (isFunction(mpInstance.$vm[method])) {
  8396. mpInstance[method] = function(event) {
  8397. if (hasOwn$1(event, "markerId")) {
  8398. event.detail = typeof event.detail === "object" ? event.detail : {};
  8399. event.detail.markerId = event.markerId;
  8400. }
  8401. mpInstance.$vm[method](event);
  8402. };
  8403. }
  8404. });
  8405. }
  8406. }
  8407. function initChildVues(mpInstance) {
  8408. if (!mpInstance.$vm) {
  8409. return;
  8410. }
  8411. const childVues = mpInstance._$childVues;
  8412. if (childVues) {
  8413. childVues.forEach((relationOptions) => {
  8414. handleLink$1.call(mpInstance, {
  8415. detail: relationOptions
  8416. });
  8417. const { mpInstance: childMPInstance, createComponent: createComponent2 } = relationOptions;
  8418. childMPInstance.$vm = createComponent2(relationOptions.parent);
  8419. initSpecialMethods(childMPInstance);
  8420. if (relationOptions.parent) {
  8421. handleRef.call(relationOptions.parent.$scope, childMPInstance);
  8422. }
  8423. initChildVues(childMPInstance);
  8424. childMPInstance.$vm.$callHook("mounted");
  8425. childMPInstance.$vm.$callHook(ON_READY);
  8426. });
  8427. }
  8428. delete mpInstance._$childVues;
  8429. }
  8430. function handleRef(ref2) {
  8431. if (!ref2) {
  8432. return;
  8433. }
  8434. const refName = ref2.props.uR;
  8435. const refInForName = ref2.props.uRIF;
  8436. if (!refName && !refInForName) {
  8437. return;
  8438. }
  8439. const instance = this.$vm.$;
  8440. const refs = instance.refs === EMPTY_OBJ ? instance.refs = {} : instance.refs;
  8441. const { setupState } = instance;
  8442. const refValue = ref2.$vm;
  8443. if (refName) {
  8444. if (isString(refName)) {
  8445. refs[refName] = refValue;
  8446. if (hasOwn$1(setupState, refName)) {
  8447. setupState[refName] = refValue;
  8448. }
  8449. } else {
  8450. setRef(refName, refValue, refs, setupState);
  8451. }
  8452. } else if (refInForName) {
  8453. if (isString(refInForName)) {
  8454. (refs[refInForName] || (refs[refInForName] = [])).push(refValue);
  8455. } else {
  8456. setRef(refInForName, refValue, refs, setupState);
  8457. }
  8458. }
  8459. }
  8460. function isTemplateRef(opts) {
  8461. return !!(opts && opts.r);
  8462. }
  8463. function setRef(ref2, refValue, refs, setupState) {
  8464. if (isRef(ref2)) {
  8465. ref2.value = refValue;
  8466. } else if (isFunction(ref2)) {
  8467. const templateRef = ref2(refValue, refs);
  8468. if (isTemplateRef(templateRef)) {
  8469. setTemplateRef(templateRef, refValue, setupState);
  8470. }
  8471. }
  8472. }
  8473. function triggerEvent(type, detail) {
  8474. const handler = this.props[customizeEvent("on-" + type)];
  8475. if (!handler) {
  8476. return;
  8477. }
  8478. const target = {
  8479. dataset: {}
  8480. };
  8481. handler({
  8482. type: customizeEvent(type),
  8483. target,
  8484. currentTarget: target,
  8485. detail
  8486. });
  8487. }
  8488. function initPropsObserver(componentOptions) {
  8489. const observe = function observe2(props) {
  8490. const nextProps = isComponent2 ? props : this.props;
  8491. const up = nextProps.uP;
  8492. if (!up) {
  8493. return;
  8494. }
  8495. if (this.$vm) {
  8496. updateComponentProps(up, this.$vm.$);
  8497. } else if (this.props.uT === "m") {
  8498. updateMiniProgramComponentProperties(up, this);
  8499. }
  8500. };
  8501. if (isComponent2) {
  8502. componentOptions.deriveDataFromProps = observe;
  8503. } else {
  8504. componentOptions.didUpdate = observe;
  8505. }
  8506. }
  8507. const handleLink = function() {
  8508. if (isComponent2) {
  8509. return function handleLink2(detail) {
  8510. return handleLink$1.call(this, {
  8511. detail
  8512. });
  8513. };
  8514. }
  8515. return function handleLink2(detail) {
  8516. if (this.$vm && this.$vm.$.isMounted) {
  8517. return handleLink$1.call(this, {
  8518. detail
  8519. });
  8520. }
  8521. (this._$childVues || (this._$childVues = [])).unshift(detail);
  8522. };
  8523. }();
  8524. function createVueComponent(mpType, mpInstance, vueOptions, parent) {
  8525. return $createComponent({
  8526. type: vueOptions,
  8527. props: findPropsData(mpInstance.props, mpType === "page")
  8528. }, {
  8529. mpType,
  8530. mpInstance,
  8531. slots: mpInstance.props.uS || {},
  8532. // vueSlots
  8533. parentComponent: parent && parent.$,
  8534. onBeforeSetup(instance, options) {
  8535. initMocks(instance, mpInstance, mocks);
  8536. initComponentInstance(instance, options);
  8537. }
  8538. });
  8539. }
  8540. const MPComponent = Component;
  8541. Component = function(options) {
  8542. const isVueComponent = options.props && typeof options.props.uP !== "undefined";
  8543. if (!isVueComponent) {
  8544. initPropsObserver(options);
  8545. }
  8546. return MPComponent(options);
  8547. };
  8548. function onAliAuthError(method, $event) {
  8549. $event.type = "getphonenumber";
  8550. $event.detail.errMsg = "getPhoneNumber:fail Error: " + $event.detail.errorMessage;
  8551. method($event);
  8552. }
  8553. function onAliGetAuthorize(method, $event) {
  8554. my.getPhoneNumber({
  8555. success: (res) => {
  8556. $event.type = "getphonenumber";
  8557. const response = JSON.parse(res.response);
  8558. $event.detail.errMsg = "getPhoneNumber:ok";
  8559. $event.detail.encryptedData = response.response;
  8560. $event.detail.sign = response.sign;
  8561. method($event);
  8562. },
  8563. fail: (res) => {
  8564. $event.type = "getphonenumber";
  8565. $event.detail.errMsg = "getPhoneNumber:fail Error: " + JSON.stringify(res);
  8566. method($event);
  8567. }
  8568. });
  8569. }
  8570. function parse(appOptions) {
  8571. const oldOnLaunch = appOptions.onLaunch;
  8572. appOptions.onLaunch = function onLaunch(options) {
  8573. oldOnLaunch.call(this, options);
  8574. if (!this.$vm) {
  8575. return;
  8576. }
  8577. const globalProperties = this.$vm.$app.config.globalProperties;
  8578. if (!globalProperties.$onAliAuthError) {
  8579. globalProperties.$onAliAuthError = onAliAuthError;
  8580. globalProperties.$onAliGetAuthorize = onAliGetAuthorize;
  8581. }
  8582. };
  8583. }
  8584. var parseAppOptions = /* @__PURE__ */ Object.freeze({
  8585. __proto__: null,
  8586. parse
  8587. });
  8588. function initCreatePage() {
  8589. return function createPage2(vueOptions) {
  8590. vueOptions = vueOptions.default || vueOptions;
  8591. const pageOptions = {
  8592. onLoad(query) {
  8593. {
  8594. this.options = query;
  8595. }
  8596. this.$page = {
  8597. fullPath: addLeadingSlash(this.route + stringifyQuery(query))
  8598. };
  8599. this.props = query;
  8600. this.$vm = createVueComponent("page", this, vueOptions);
  8601. initSpecialMethods(this);
  8602. this.$vm.$callHook(ON_LOAD, query);
  8603. },
  8604. onShow() {
  8605. this.$vm.$callHook(ON_SHOW);
  8606. },
  8607. onReady() {
  8608. initChildVues(this);
  8609. this.$vm.$callHook("mounted");
  8610. this.$vm.$callHook(ON_READY);
  8611. },
  8612. onUnload() {
  8613. if (this.$vm) {
  8614. this.$vm.$callHook(ON_UNLOAD);
  8615. $destroyComponent(this.$vm);
  8616. }
  8617. },
  8618. events: {
  8619. // 支付宝小程序有些页面事件只能放在events下
  8620. onBack() {
  8621. this.$vm.$callHook(ON_BACK_PRESS);
  8622. },
  8623. onKeyboardHeight: (res) => {
  8624. my.$emit("uni:keyboardHeightChange", res);
  8625. }
  8626. },
  8627. __r: handleRef,
  8628. __l: handleLink
  8629. };
  8630. if (isPlainObject(vueOptions.events)) {
  8631. extend(pageOptions.events, vueOptions.events);
  8632. }
  8633. {
  8634. pageOptions.data = initData();
  8635. }
  8636. initHooks(pageOptions, PAGE_INIT_HOOKS);
  8637. initUnknownHooks(pageOptions, vueOptions);
  8638. initRuntimeHooks(pageOptions, vueOptions.__runtimeHooks);
  8639. initWxsCallMethods(pageOptions, vueOptions.wxsCallMethods);
  8640. return Page(pageOptions);
  8641. };
  8642. }
  8643. function initComponentProps(_rawProps) {
  8644. const propertiesOptions = {
  8645. properties: {}
  8646. };
  8647. initProps(propertiesOptions);
  8648. const properties = propertiesOptions.properties;
  8649. const props = {
  8650. // onVueInit
  8651. onVI: function() {
  8652. }
  8653. };
  8654. Object.keys(properties).forEach((key) => {
  8655. if (key !== "uS") {
  8656. props[key] = properties[key].value;
  8657. }
  8658. });
  8659. return props;
  8660. }
  8661. function initVm(mpInstance, createComponent2) {
  8662. if (mpInstance.$vm) {
  8663. return;
  8664. }
  8665. const properties = mpInstance.props;
  8666. initVueIds(properties.uI, mpInstance);
  8667. const relationOptions = {
  8668. vuePid: mpInstance._$vuePid,
  8669. mpInstance,
  8670. createComponent: createComponent2
  8671. };
  8672. if (isComponent2) {
  8673. initRelation(mpInstance, relationOptions);
  8674. mpInstance.$vm = createComponent2(relationOptions.parent);
  8675. } else {
  8676. initRelation(mpInstance, relationOptions);
  8677. if (relationOptions.parent) {
  8678. mpInstance.$vm = createComponent2(relationOptions.parent);
  8679. handleRef.call(relationOptions.parent.$scope, mpInstance);
  8680. initChildVues(mpInstance);
  8681. mpInstance.$vm.$callHook("mounted");
  8682. }
  8683. }
  8684. }
  8685. function initCreateComponent() {
  8686. return function createComponent2(vueOptions) {
  8687. vueOptions = vueOptions.default || vueOptions;
  8688. const mpComponentOptions = {
  8689. props: initComponentProps(vueOptions.props),
  8690. didMount() {
  8691. const createComponent3 = (parent) => {
  8692. return createVueComponent("component", this, vueOptions, parent);
  8693. };
  8694. if (my.dd) {
  8695. setTimeout(() => {
  8696. initVm(this, createComponent3);
  8697. }, 4);
  8698. } else {
  8699. initVm(this, createComponent3);
  8700. }
  8701. initSpecialMethods(this);
  8702. if (isComponent2) {
  8703. this.$vm.$callHook("mounted");
  8704. }
  8705. },
  8706. didUnmount() {
  8707. if (this.$vm) {
  8708. pruneComponentPropsCache(this.$vm.$.uid);
  8709. $destroyComponent(this.$vm);
  8710. }
  8711. },
  8712. methods: {
  8713. __r: handleRef,
  8714. __l: handleLink,
  8715. triggerEvent
  8716. }
  8717. };
  8718. if (vueOptions.options) {
  8719. mpComponentOptions.options = vueOptions.options;
  8720. }
  8721. {
  8722. mpComponentOptions.data = initData();
  8723. mpComponentOptions.mixins = initBehaviors(vueOptions);
  8724. }
  8725. if (isComponent2) {
  8726. mpComponentOptions.onInit = function onInit() {
  8727. initVm(this, (parent) => {
  8728. return createVueComponent("component", this, vueOptions, parent);
  8729. });
  8730. };
  8731. }
  8732. initPropsObserver(mpComponentOptions);
  8733. initWxsCallMethods(mpComponentOptions.methods, vueOptions.wxsCallMethods);
  8734. return Component(mpComponentOptions);
  8735. };
  8736. }
  8737. const createApp = initCreateApp(parseAppOptions);
  8738. const createPage = initCreatePage();
  8739. const createComponent = initCreateComponent();
  8740. const createPluginApp = initCreatePluginApp(parseAppOptions);
  8741. const createSubpackageApp = initCreateSubpackageApp(parseAppOptions);
  8742. my.EventChannel = EventChannel;
  8743. my.createApp = createApp;
  8744. my.createPage = createPage;
  8745. my.createComponent = createComponent;
  8746. my.createPluginApp = createPluginApp;
  8747. my.createSubpackageApp = createSubpackageApp;
  8748. exports._export_sfc = _export_sfc;
  8749. exports.createSSRApp = createSSRApp;
  8750. exports.defineComponent = defineComponent;
  8751. exports.e = e;
  8752. exports.index = index;
  8753. exports.initVueI18n = initVueI18n;
  8754. exports.n = n;
  8755. exports.o = o;
  8756. exports.p = p;
  8757. exports.ref = ref;
  8758. exports.resolveComponent = resolveComponent;
  8759. exports.s = s;
  8760. exports.t = t;
  8761. //# sourceMappingURL=../../.sourcemap/mp-alipay/common/vendor.js.map