vendor.js 259 KB

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