123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875 |
- !(function (e, t) {
- 'object' == typeof exports && 'undefined' != typeof module
- ? t(exports, require('vue'))
- : 'function' == typeof define && define.amd
- ? define(['exports', 'vue'], t)
- : t(((e = 'undefined' != typeof globalThis ? globalThis : e || self).vant = {}), e.Vue)
- })(this, function (e, t) {
- 'use strict'
- const o = (e) => null != e,
- n = (e) => 'function' == typeof e,
- a = (e) => null !== e && 'object' == typeof e,
- r = (e) => a(e) && n(e.then) && n(e.catch),
- l = (e) => '[object Date]' === Object.prototype.toString.call(e) && !Number.isNaN(e.getTime())
- function i(e) {
- return (
- (e = e.replace(/[^-|\d]/g, '')),
- /^((\+86)|(86))?(1)\d{10}$/.test(e) || /^0[0-9-]{10,13}$/.test(e)
- )
- }
- const s = (e) => 'number' == typeof e || /^\d+(\.\d+)?$/.test(e)
- function c() {}
- const d = Object.assign,
- u = 'undefined' != typeof window
- function p(e, t) {
- const o = t.split('.')
- let n = e
- return (
- o.forEach((e) => {
- var t
- n = a(n) && null != (t = n[e]) ? t : ''
- }),
- n
- )
- }
- function m(e, t, o) {
- return t.reduce((t, n) => ((o && void 0 === e[n]) || (t[n] = e[n]), t), {})
- }
- const f = (e, t) => JSON.stringify(e) === JSON.stringify(t),
- v = (e) => (Array.isArray(e) ? e : [e]),
- h = null,
- g = [Number, String],
- b = { type: Boolean, default: !0 },
- y = (e) => ({ type: e, required: !0 }),
- w = () => ({ type: Array, default: () => [] }),
- x = (e) => ({ type: Number, default: e }),
- V = (e) => ({ type: g, default: e }),
- N = (e) => ({ type: String, default: e })
- var k = 'undefined' != typeof window
- function C(e) {
- return k ? requestAnimationFrame(e) : -1
- }
- function S(e) {
- k && cancelAnimationFrame(e)
- }
- function T(e) {
- C(() => C(e))
- }
- var B = (e, t) => ({ top: 0, left: 0, right: e, bottom: t, width: e, height: t }),
- P = (e) => {
- const o = t.unref(e)
- if (o === window) {
- const e = o.innerWidth,
- t = o.innerHeight
- return B(e, t)
- }
- return (null == o ? void 0 : o.getBoundingClientRect) ? o.getBoundingClientRect() : B(0, 0)
- }
- function D(e) {
- const o = t.inject(e, null)
- if (o) {
- const e = t.getCurrentInstance(),
- { link: n, unlink: a, internalChildren: r } = o
- n(e), t.onUnmounted(() => a(e))
- return { parent: o, index: t.computed(() => r.indexOf(e)) }
- }
- return { parent: null, index: t.ref(-1) }
- }
- var O = (e, t) => {
- const o = e.indexOf(t)
- return -1 === o
- ? e.findIndex(
- (e) => void 0 !== t.key && null !== t.key && e.type === t.type && e.key === t.key
- )
- : o
- }
- function I(e, o, n) {
- const a = (function (e) {
- const o = [],
- n = (e) => {
- Array.isArray(e) &&
- e.forEach((e) => {
- var a
- t.isVNode(e) &&
- (o.push(e),
- (null == (a = e.component) ? void 0 : a.subTree) &&
- (o.push(e.component.subTree), n(e.component.subTree.children)),
- e.children && n(e.children))
- })
- }
- return n(e), o
- })(e.subTree.children)
- n.sort((e, t) => O(a, e.vnode) - O(a, t.vnode))
- const r = n.map((e) => e.proxy)
- o.sort((e, t) => r.indexOf(e) - r.indexOf(t))
- }
- function A(e) {
- const o = t.reactive([]),
- n = t.reactive([]),
- a = t.getCurrentInstance()
- return {
- children: o,
- linkChildren: (r) => {
- t.provide(
- e,
- Object.assign(
- {
- link: (e) => {
- e.proxy && (n.push(e), o.push(e.proxy), I(a, o, n))
- },
- unlink: (e) => {
- const t = n.indexOf(e)
- o.splice(t, 1), n.splice(t, 1)
- },
- children: o,
- internalChildren: n
- },
- r
- )
- )
- }
- }
- }
- var z,
- E,
- L = 1e3,
- $ = 6e4,
- M = 36e5,
- R = 24 * M
- function F(e) {
- let o, n, a, r
- const l = t.ref(e.time),
- i = t.computed(() => {
- return {
- total: (e = l.value),
- days: Math.floor(e / R),
- hours: Math.floor((e % R) / M),
- minutes: Math.floor((e % M) / $),
- seconds: Math.floor((e % $) / L),
- milliseconds: Math.floor(e % L)
- }
- var e
- }),
- s = () => {
- ;(a = !1), S(o)
- },
- c = () => Math.max(n - Date.now(), 0),
- d = (t) => {
- var o, n
- ;(l.value = t),
- null == (o = e.onChange) || o.call(e, i.value),
- 0 === t && (s(), null == (n = e.onFinish) || n.call(e))
- },
- u = () => {
- o = C(() => {
- a && (d(c()), l.value > 0 && u())
- })
- },
- p = () => {
- o = C(() => {
- if (a) {
- const o = c()
- ;(e = o),
- (t = l.value),
- (Math.floor(e / 1e3) !== Math.floor(t / 1e3) || 0 === o) && d(o),
- l.value > 0 && p()
- }
- var e, t
- })
- },
- m = () => {
- k && (e.millisecond ? u() : p())
- }
- return (
- t.onBeforeUnmount(s),
- t.onActivated(() => {
- r && ((a = !0), (r = !1), m())
- }),
- t.onDeactivated(() => {
- a && (s(), (r = !0))
- }),
- {
- start: () => {
- a || ((n = Date.now() + l.value), (a = !0), m())
- },
- pause: s,
- reset: (t = e.time) => {
- s(), (l.value = t)
- },
- current: i
- }
- )
- }
- function H(e) {
- let o
- t.onMounted(() => {
- e(),
- t.nextTick(() => {
- o = !0
- })
- }),
- t.onActivated(() => {
- o && e()
- })
- }
- function j(e, o, n = {}) {
- if (!k) return
- const { target: a = window, passive: r = !1, capture: l = !1 } = n
- let i,
- s = !1
- const c = (n) => {
- if (s) return
- const a = t.unref(n)
- a && !i && (a.addEventListener(e, o, { capture: l, passive: r }), (i = !0))
- },
- d = (n) => {
- if (s) return
- const a = t.unref(n)
- a && i && (a.removeEventListener(e, o, l), (i = !1))
- }
- let u
- return (
- t.onUnmounted(() => d(a)),
- t.onDeactivated(() => d(a)),
- H(() => c(a)),
- t.isRef(a) &&
- (u = t.watch(a, (e, t) => {
- d(t), c(e)
- })),
- () => {
- null == u || u(), d(a), (s = !0)
- }
- )
- }
- function W(e, o, n = {}) {
- if (!k) return
- const { eventName: a = 'click' } = n
- j(
- a,
- (n) => {
- ;(Array.isArray(e) ? e : [e]).every((e) => {
- const o = t.unref(e)
- return o && !o.contains(n.target)
- }) && o(n)
- },
- { target: document }
- )
- }
- var U,
- Y = /scroll|auto|overlay/i,
- q = k ? window : void 0
- function X(e) {
- return 'HTML' !== e.tagName && 'BODY' !== e.tagName && 1 === e.nodeType
- }
- function G(e, t = q) {
- let o = e
- for (; o && o !== t && X(o); ) {
- const { overflowY: e } = window.getComputedStyle(o)
- if (Y.test(e)) return o
- o = o.parentNode
- }
- return t
- }
- function Z(e, o = q) {
- const n = t.ref()
- return (
- t.onMounted(() => {
- e.value && (n.value = G(e.value, o))
- }),
- n
- )
- }
- var K = Symbol('van-field')
- function _(e) {
- const o = t.inject(K, null)
- o &&
- !o.customValue.value &&
- ((o.customValue.value = e),
- t.watch(e, () => {
- o.resetValidation(), o.validateWithTrigger('onChange')
- }))
- }
- function J(e) {
- const t = 'scrollTop' in e ? e.scrollTop : e.pageYOffset
- return Math.max(t, 0)
- }
- function Q(e, t) {
- 'scrollTop' in e ? (e.scrollTop = t) : e.scrollTo(e.scrollX, t)
- }
- function ee() {
- return window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0
- }
- function te(e) {
- Q(window, e), Q(document.body, e)
- }
- function oe(e, t) {
- if (e === window) return 0
- const o = t ? J(t) : ee()
- return P(e).top + o
- }
- const ne = !!u && /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase())
- function ae() {
- ne && te(ee())
- }
- const re = (e) => e.stopPropagation()
- function le(e, t) {
- ;('boolean' != typeof e.cancelable || e.cancelable) && e.preventDefault(), t && re(e)
- }
- function ie(e) {
- const o = t.unref(e)
- if (!o) return !1
- const n = window.getComputedStyle(o),
- a = 'none' === n.display,
- r = null === o.offsetParent && 'fixed' !== n.position
- return a || r
- }
- const { width: se, height: ce } = (function () {
- if (!z && ((z = t.ref(0)), (E = t.ref(0)), k)) {
- const e = () => {
- ;(z.value = window.innerWidth), (E.value = window.innerHeight)
- }
- e(),
- window.addEventListener('resize', e, { passive: !0 }),
- window.addEventListener('orientationchange', e, { passive: !0 })
- }
- return { width: z, height: E }
- })()
- function de(e) {
- if (o(e)) return s(e) ? `${e}px` : String(e)
- }
- function ue(e) {
- if (o(e)) {
- if (Array.isArray(e)) return { width: de(e[0]), height: de(e[1]) }
- const t = de(e)
- return { width: t, height: t }
- }
- }
- function pe(e) {
- const t = {}
- return void 0 !== e && (t.zIndex = +e), t
- }
- let me
- function fe(e) {
- return (
- +(e = e.replace(/rem/g, '')) *
- (function () {
- if (!me) {
- const e = document.documentElement,
- t = e.style.fontSize || window.getComputedStyle(e).fontSize
- me = parseFloat(t)
- }
- return me
- })()
- )
- }
- function ve(e) {
- if ('number' == typeof e) return e
- if (u) {
- if (e.includes('rem')) return fe(e)
- if (e.includes('vw'))
- return (function (e) {
- return (+(e = e.replace(/vw/g, '')) * se.value) / 100
- })(e)
- if (e.includes('vh'))
- return (function (e) {
- return (+(e = e.replace(/vh/g, '')) * ce.value) / 100
- })(e)
- }
- return parseFloat(e)
- }
- const he = /-(\w)/g,
- ge = (e) => e.replace(he, (e, t) => t.toUpperCase())
- function be(e, t = 2) {
- let o = e + ''
- for (; o.length < t; ) o = '0' + o
- return o
- }
- const ye = (e, t, o) => Math.min(Math.max(e, t), o)
- function we(e, t, o) {
- const n = e.indexOf(t)
- return -1 === n
- ? e
- : '-' === t && 0 !== n
- ? e.slice(0, n)
- : e.slice(0, n + 1) + e.slice(n).replace(o, '')
- }
- function xe(e, t = !0, o = !0) {
- e = t ? we(e, '.', /\./g) : e.split('.')[0]
- const n = t ? /[^-0-9.]/g : /[^-0-9]/g
- return (e = o ? we(e, '-', /-/g) : e.replace(/-/, '')).replace(n, '')
- }
- function Ve(e, t) {
- const o = 10 ** 10
- return Math.round((e + t) * o) / o
- }
- const { hasOwnProperty: Ne } = Object.prototype
- function ke(e, t) {
- return (
- Object.keys(t).forEach((n) => {
- !(function (e, t, n) {
- const r = t[n]
- o(r) && (Ne.call(e, n) && a(r) ? (e[n] = ke(Object(e[n]), r)) : (e[n] = r))
- })(e, t, n)
- }),
- e
- )
- }
- const Ce = t.ref('zh-CN'),
- Se = t.reactive({
- 'zh-CN': {
- name: '姓名',
- tel: '电话',
- save: '保存',
- clear: '清空',
- cancel: '取消',
- confirm: '确认',
- delete: '删除',
- loading: '加载中...',
- noCoupon: '暂无优惠券',
- nameEmpty: '请填写姓名',
- addContact: '添加联系人',
- telInvalid: '请填写正确的电话',
- vanCalendar: {
- end: '结束',
- start: '开始',
- title: '日期选择',
- weekdays: ['日', '一', '二', '三', '四', '五', '六'],
- monthTitle: (e, t) => `${e}年${t}月`,
- rangePrompt: (e) => `最多选择 ${e} 天`
- },
- vanCascader: { select: '请选择' },
- vanPagination: { prev: '上一页', next: '下一页' },
- vanPullRefresh: { pulling: '下拉即可刷新...', loosing: '释放即可刷新...' },
- vanSubmitBar: { label: '合计:' },
- vanCoupon: {
- unlimited: '无门槛',
- discount: (e) => `${e}折`,
- condition: (e) => `满${e}元可用`
- },
- vanCouponCell: { title: '优惠券', count: (e) => `${e}张可用` },
- vanCouponList: {
- exchange: '兑换',
- close: '不使用',
- enable: '可用',
- disabled: '不可用',
- placeholder: '输入优惠码'
- },
- vanAddressEdit: {
- area: '地区',
- areaEmpty: '请选择地区',
- addressEmpty: '请填写详细地址',
- addressDetail: '详细地址',
- defaultAddress: '设为默认收货地址'
- },
- vanAddressList: { add: '新增地址' }
- }
- }),
- Te = {
- messages: () => Se[Ce.value],
- use(e, t) {
- ;(Ce.value = e), this.add({ [e]: t })
- },
- add(e = {}) {
- ke(Se, e)
- }
- }
- var Be = Te
- function Pe(e) {
- const t = ge(e) + '.'
- return (e, ...o) => {
- const a = Be.messages(),
- r = p(a, t + e) || p(a, e)
- return n(r) ? r(...o) : r
- }
- }
- function De(e, t) {
- return t
- ? 'string' == typeof t
- ? ` ${e}--${t}`
- : Array.isArray(t)
- ? t.reduce((t, o) => t + De(e, o), '')
- : Object.keys(t).reduce((o, n) => o + (t[n] ? De(e, n) : ''), '')
- : ''
- }
- function Oe(e) {
- return (t, o) => (
- t && 'string' != typeof t && ((o = t), (t = '')), `${(t = t ? `${e}__${t}` : e)}${De(t, o)}`
- )
- }
- function Ie(e) {
- const t = `van-${e}`
- return [t, Oe(t), Pe(t)]
- }
- const Ae = 'van-hairline',
- ze = `${Ae}--top`,
- Ee = `${Ae}--left`,
- Le = `${Ae}--bottom`,
- $e = `${Ae}--surround`,
- Me = `${Ae}--top-bottom`,
- Re = `${Ae}-unset--top-bottom`,
- Fe = 'van-haptics-feedback',
- He = Symbol('van-form')
- function je(e, { args: t = [], done: o, canceled: n }) {
- if (e) {
- const a = e.apply(null, t)
- r(a)
- ? a
- .then((e) => {
- e ? o() : n && n()
- })
- .catch(c)
- : a
- ? o()
- : n && n()
- } else o()
- }
- function We(e) {
- return (
- (e.install = (t) => {
- const { name: o } = e
- o && (t.component(o, e), t.component(ge(`-${o}`), e))
- }),
- e
- )
- }
- const Ue = Symbol()
- function Ye(e) {
- const o = t.inject(Ue, null)
- o &&
- t.watch(o, (t) => {
- t && e()
- })
- }
- const qe = (e, o) => {
- const n = t.ref(),
- a = () => {
- n.value = P(e).height
- }
- return (
- t.onMounted(() => {
- if ((t.nextTick(a), o)) for (let e = 1; e <= 3; e++) setTimeout(a, 100 * e)
- }),
- Ye(() => t.nextTick(a)),
- t.watch([se, ce], a),
- n
- )
- }
- function Xe(e, o) {
- const n = qe(e, !0)
- return (e) =>
- t.createVNode(
- 'div',
- { class: o('placeholder'), style: { height: n.value ? `${n.value}px` : void 0 } },
- [e()]
- )
- }
- const [Ge, Ze] = Ie('action-bar'),
- Ke = Symbol(Ge),
- _e = { placeholder: Boolean, safeAreaInsetBottom: b }
- const Je = We(
- t.defineComponent({
- name: Ge,
- props: _e,
- setup(e, { slots: o }) {
- const n = t.ref(),
- a = Xe(n, Ze),
- { linkChildren: r } = A(Ke)
- r()
- const l = () => {
- var a
- return t.createVNode(
- 'div',
- { ref: n, class: [Ze(), { 'van-safe-area-bottom': e.safeAreaInsetBottom }] },
- [null == (a = o.default) ? void 0 : a.call(o)]
- )
- }
- return () => (e.placeholder ? a(l) : l())
- }
- })
- )
- function Qe(e) {
- const o = t.getCurrentInstance()
- o && d(o.proxy, e)
- }
- const et = { to: [String, Object], url: String, replace: Boolean }
- function tt({ to: e, url: t, replace: o, $router: n }) {
- e && n ? n[o ? 'replace' : 'push'](e) : t && (o ? location.replace(t) : (location.href = t))
- }
- function ot() {
- const e = t.getCurrentInstance().proxy
- return () => tt(e)
- }
- const [nt, at] = Ie('badge'),
- rt = {
- dot: Boolean,
- max: g,
- tag: N('div'),
- color: String,
- offset: Array,
- content: g,
- showZero: b,
- position: N('top-right')
- }
- const lt = We(
- t.defineComponent({
- name: nt,
- props: rt,
- setup(e, { slots: n }) {
- const a = () => {
- if (n.content) return !0
- const { content: t, showZero: a } = e
- return o(t) && '' !== t && (a || (0 !== t && '0' !== t))
- },
- r = () => {
- const { dot: t, max: r, content: l } = e
- if (!t && a()) return n.content ? n.content() : o(r) && s(l) && +l > +r ? `${r}+` : l
- },
- l = (e) => (e.startsWith('-') ? e.replace('-', '') : `-${e}`),
- i = t.computed(() => {
- const t = { background: e.color }
- if (e.offset) {
- const [o, a] = e.offset,
- { position: r } = e,
- [i, s] = r.split('-')
- n.default
- ? ((t[i] =
- 'number' == typeof a ? de('top' === i ? a : -a) : 'top' === i ? de(a) : l(a)),
- (t[s] =
- 'number' == typeof o ? de('left' === s ? o : -o) : 'left' === s ? de(o) : l(o)))
- : ((t.marginTop = de(a)), (t.marginLeft = de(o)))
- }
- return t
- }),
- c = () => {
- if (a() || e.dot)
- return t.createVNode(
- 'div',
- { class: at([e.position, { dot: e.dot, fixed: !!n.default }]), style: i.value },
- [r()]
- )
- }
- return () => {
- if (n.default) {
- const { tag: o } = e
- return t.createVNode(o, { class: at('wrapper') }, { default: () => [n.default(), c()] })
- }
- return c()
- }
- }
- })
- )
- let it = 2e3
- const [st, ct] = Ie('config-provider'),
- dt = Symbol(st),
- ut = {
- tag: N('div'),
- theme: N('light'),
- zIndex: Number,
- themeVars: Object,
- themeVarsDark: Object,
- themeVarsLight: Object,
- iconPrefix: String
- }
- var pt = t.defineComponent({
- name: st,
- props: ut,
- setup(e, { slots: o }) {
- const n = t.computed(() =>
- (function (e) {
- const t = {}
- return (
- Object.keys(e).forEach((o) => {
- var n
- t[
- `--van-${
- ((n = o),
- n
- .replace(/([A-Z])/g, '-$1')
- .toLowerCase()
- .replace(/^-/, ''))
- }`
- ] = e[o]
- }),
- t
- )
- })(d({}, e.themeVars, 'dark' === e.theme ? e.themeVarsDark : e.themeVarsLight))
- )
- if (u) {
- const o = () => {
- document.documentElement.classList.add(`van-theme-${e.theme}`)
- },
- n = (t = e.theme) => {
- document.documentElement.classList.remove(`van-theme-${t}`)
- }
- t.watch(
- () => e.theme,
- (e, t) => {
- t && n(t), o()
- },
- { immediate: !0 }
- ),
- t.onActivated(o),
- t.onDeactivated(n),
- t.onBeforeUnmount(n)
- }
- return (
- t.provide(dt, e),
- t.watchEffect(() => {
- var t
- void 0 !== e.zIndex && ((t = e.zIndex), (it = t))
- }),
- () =>
- t.createVNode(
- e.tag,
- { class: ct(), style: n.value },
- {
- default: () => {
- var e
- return [null == (e = o.default) ? void 0 : e.call(o)]
- }
- }
- )
- )
- }
- })
- const [mt, ft] = Ie('icon'),
- vt = {
- dot: Boolean,
- tag: N('i'),
- name: String,
- size: g,
- badge: g,
- color: String,
- badgeProps: Object,
- classPrefix: String
- }
- const ht = We(
- t.defineComponent({
- name: mt,
- props: vt,
- setup(e, { slots: o }) {
- const n = t.inject(dt, null),
- a = t.computed(() => e.classPrefix || (null == n ? void 0 : n.iconPrefix) || ft())
- return () => {
- const { tag: n, dot: r, name: l, size: i, badge: s, color: c } = e,
- d = ((e) => (null == e ? void 0 : e.includes('/')))(l)
- return t.createVNode(
- lt,
- t.mergeProps(
- {
- dot: r,
- tag: n,
- class: [a.value, d ? '' : `${a.value}-${l}`],
- style: { color: c, fontSize: de(i) },
- content: s
- },
- e.badgeProps
- ),
- {
- default: () => {
- var e
- return [
- null == (e = o.default) ? void 0 : e.call(o),
- d && t.createVNode('img', { class: ft('image'), src: l }, null)
- ]
- }
- }
- )
- }
- }
- })
- ),
- [gt, bt] = Ie('loading'),
- yt = Array(12)
- .fill(null)
- .map((e, o) => t.createVNode('i', { class: bt('line', String(o + 1)) }, null)),
- wt = t.createVNode('svg', { class: bt('circular'), viewBox: '25 25 50 50' }, [
- t.createVNode('circle', { cx: '50', cy: '50', r: '20', fill: 'none' }, null)
- ]),
- xt = {
- size: g,
- type: N('circular'),
- color: String,
- vertical: Boolean,
- textSize: g,
- textColor: String
- }
- const Vt = We(
- t.defineComponent({
- name: gt,
- props: xt,
- setup(e, { slots: o }) {
- const n = t.computed(() => d({ color: e.color }, ue(e.size))),
- a = () => {
- const a = 'spinner' === e.type ? yt : wt
- return t.createVNode('span', { class: bt('spinner', e.type), style: n.value }, [
- o.icon ? o.icon() : a
- ])
- },
- r = () => {
- var n
- if (o.default)
- return t.createVNode(
- 'span',
- {
- class: bt('text'),
- style: {
- fontSize: de(e.textSize),
- color: null != (n = e.textColor) ? n : e.color
- }
- },
- [o.default()]
- )
- }
- return () => {
- const { type: o, vertical: n } = e
- return t.createVNode(
- 'div',
- { class: bt([o, { vertical: n }]), 'aria-live': 'polite', 'aria-busy': !0 },
- [a(), r()]
- )
- }
- }
- })
- ),
- [Nt, kt] = Ie('button'),
- Ct = d({}, et, {
- tag: N('button'),
- text: String,
- icon: String,
- type: N('default'),
- size: N('normal'),
- color: String,
- block: Boolean,
- plain: Boolean,
- round: Boolean,
- square: Boolean,
- loading: Boolean,
- hairline: Boolean,
- disabled: Boolean,
- iconPrefix: String,
- nativeType: N('button'),
- loadingSize: g,
- loadingText: String,
- loadingType: String,
- iconPosition: N('left')
- })
- const St = We(
- t.defineComponent({
- name: Nt,
- props: Ct,
- emits: ['click'],
- setup(e, { emit: o, slots: n }) {
- const a = ot(),
- r = () =>
- e.loading
- ? n.loading
- ? n.loading()
- : t.createVNode(
- Vt,
- { size: e.loadingSize, type: e.loadingType, class: kt('loading') },
- null
- )
- : n.icon
- ? t.createVNode('div', { class: kt('icon') }, [n.icon()])
- : e.icon
- ? t.createVNode(
- ht,
- { name: e.icon, class: kt('icon'), classPrefix: e.iconPrefix },
- null
- )
- : void 0,
- l = () => {
- let o
- if (((o = e.loading ? e.loadingText : n.default ? n.default() : e.text), o))
- return t.createVNode('span', { class: kt('text') }, [o])
- },
- i = () => {
- const { color: t, plain: o } = e
- if (t) {
- const e = { color: o ? t : 'white' }
- return (
- o || (e.background = t),
- t.includes('gradient') ? (e.border = 0) : (e.borderColor = t),
- e
- )
- }
- },
- s = (t) => {
- e.loading ? le(t) : e.disabled || (o('click', t), a())
- }
- return () => {
- const {
- tag: o,
- type: n,
- size: a,
- block: c,
- round: d,
- plain: u,
- square: p,
- loading: m,
- disabled: f,
- hairline: v,
- nativeType: h,
- iconPosition: g
- } = e,
- b = [
- kt([
- n,
- a,
- { plain: u, block: c, round: d, square: p, loading: m, disabled: f, hairline: v }
- ]),
- { [$e]: v }
- ]
- return t.createVNode(
- o,
- { type: h, class: b, style: i(), disabled: f, onClick: s },
- {
- default: () => [
- t.createVNode('div', { class: kt('content') }, [
- 'left' === g && r(),
- l(),
- 'right' === g && r()
- ])
- ]
- }
- )
- }
- }
- })
- ),
- [Tt, Bt] = Ie('action-bar-button'),
- Pt = d({}, et, {
- type: String,
- text: String,
- icon: String,
- color: String,
- loading: Boolean,
- disabled: Boolean
- })
- const Dt = We(
- t.defineComponent({
- name: Tt,
- props: Pt,
- setup(e, { slots: o }) {
- const n = ot(),
- { parent: a, index: r } = D(Ke),
- l = t.computed(() => {
- if (a) {
- const e = a.children[r.value - 1]
- return !(e && 'isButton' in e)
- }
- }),
- i = t.computed(() => {
- if (a) {
- const e = a.children[r.value + 1]
- return !(e && 'isButton' in e)
- }
- })
- return (
- Qe({ isButton: !0 }),
- () => {
- const { type: a, icon: r, text: s, color: c, loading: d, disabled: u } = e
- return t.createVNode(
- St,
- {
- class: Bt([a, { last: i.value, first: l.value }]),
- size: 'large',
- type: a,
- icon: r,
- color: c,
- loading: d,
- disabled: u,
- onClick: n
- },
- { default: () => [o.default ? o.default() : s] }
- )
- }
- )
- }
- })
- ),
- [Ot, It] = Ie('action-bar-icon'),
- At = d({}, et, {
- dot: Boolean,
- text: String,
- icon: String,
- color: String,
- badge: g,
- iconClass: h,
- badgeProps: Object,
- iconPrefix: String
- })
- const zt = We(
- t.defineComponent({
- name: Ot,
- props: At,
- setup(e, { slots: o }) {
- const n = ot()
- D(Ke)
- const a = () => {
- const {
- dot: n,
- badge: a,
- icon: r,
- color: l,
- iconClass: i,
- badgeProps: s,
- iconPrefix: c
- } = e
- return o.icon
- ? t.createVNode(lt, t.mergeProps({ dot: n, class: It('icon'), content: a }, s), {
- default: o.icon
- })
- : t.createVNode(
- ht,
- {
- tag: 'div',
- dot: n,
- name: r,
- badge: a,
- color: l,
- class: [It('icon'), i],
- badgeProps: s,
- classPrefix: c
- },
- null
- )
- }
- return () =>
- t.createVNode('div', { role: 'button', class: It(), tabindex: 0, onClick: n }, [
- a(),
- o.default ? o.default() : e.text
- ])
- }
- })
- ),
- Et = {
- show: Boolean,
- zIndex: g,
- overlay: b,
- duration: g,
- teleport: [String, Object],
- lockScroll: b,
- lazyRender: b,
- beforeClose: Function,
- overlayStyle: Object,
- overlayClass: h,
- transitionAppear: Boolean,
- closeOnClickOverlay: b
- },
- Lt = Object.keys(Et)
- function $t() {
- const e = t.ref(0),
- o = t.ref(0),
- n = t.ref(0),
- a = t.ref(0),
- r = t.ref(0),
- l = t.ref(0),
- i = t.ref(''),
- s = () => {
- ;(n.value = 0), (a.value = 0), (r.value = 0), (l.value = 0), (i.value = '')
- }
- return {
- move: (t) => {
- const s = t.touches[0]
- ;(n.value = (s.clientX < 0 ? 0 : s.clientX) - e.value),
- (a.value = s.clientY - o.value),
- (r.value = Math.abs(n.value)),
- (l.value = Math.abs(a.value))
- var c, d
- ;(!i.value || (r.value < 10 && l.value < 10)) &&
- (i.value = ((c = r.value), (d = l.value), c > d ? 'horizontal' : d > c ? 'vertical' : ''))
- },
- start: (t) => {
- s(), (e.value = t.touches[0].clientX), (o.value = t.touches[0].clientY)
- },
- reset: s,
- startX: e,
- startY: o,
- deltaX: n,
- deltaY: a,
- offsetX: r,
- offsetY: l,
- direction: i,
- isVertical: () => 'vertical' === i.value,
- isHorizontal: () => 'horizontal' === i.value
- }
- }
- let Mt = 0
- const Rt = 'van-overflow-hidden'
- function Ft(e) {
- const o = t.ref(!1)
- return (
- t.watch(
- e,
- (e) => {
- e && (o.value = e)
- },
- { immediate: !0 }
- ),
- (e) => () => o.value ? e() : null
- )
- }
- const [Ht, jt] = Ie('overlay'),
- Wt = {
- show: Boolean,
- zIndex: g,
- duration: g,
- className: h,
- lockScroll: b,
- lazyRender: b,
- customStyle: Object
- }
- const Ut = We(
- t.defineComponent({
- name: Ht,
- props: Wt,
- setup(e, { slots: n }) {
- const a = t.ref(),
- r = Ft(() => e.show || !e.lazyRender)(() => {
- var r
- const l = d(pe(e.zIndex), e.customStyle)
- return (
- o(e.duration) && (l.animationDuration = `${e.duration}s`),
- t.withDirectives(
- t.createVNode('div', { ref: a, style: l, class: [jt(), e.className] }, [
- null == (r = n.default) ? void 0 : r.call(n)
- ]),
- [[t.vShow, e.show]]
- )
- )
- })
- return (
- j(
- 'touchmove',
- (t) => {
- e.lockScroll && le(t, !0)
- },
- { target: a }
- ),
- () => t.createVNode(t.Transition, { name: 'van-fade', appear: !0 }, { default: r })
- )
- }
- })
- ),
- Yt = d({}, Et, {
- round: Boolean,
- position: N('center'),
- closeIcon: N('cross'),
- closeable: Boolean,
- transition: String,
- iconPrefix: String,
- closeOnPopstate: Boolean,
- closeIconPosition: N('top-right'),
- safeAreaInsetTop: Boolean,
- safeAreaInsetBottom: Boolean
- }),
- [qt, Xt] = Ie('popup')
- const Gt = We(
- t.defineComponent({
- name: qt,
- inheritAttrs: !1,
- props: Yt,
- emits: [
- 'open',
- 'close',
- 'opened',
- 'closed',
- 'keydown',
- 'update:show',
- 'clickOverlay',
- 'clickCloseIcon'
- ],
- setup(e, { emit: n, attrs: a, slots: r }) {
- let l, i
- const s = t.ref(),
- c = t.ref(),
- d = Ft(() => e.show || !e.lazyRender),
- u = t.computed(() => {
- const t = { zIndex: s.value }
- if (o(e.duration)) {
- t[
- 'center' === e.position ? 'animationDuration' : 'transitionDuration'
- ] = `${e.duration}s`
- }
- return t
- }),
- p = () => {
- l || ((l = !0), (s.value = void 0 !== e.zIndex ? +e.zIndex : ++it), n('open'))
- },
- m = () => {
- l &&
- je(e.beforeClose, {
- done() {
- ;(l = !1), n('close'), n('update:show', !1)
- }
- })
- },
- f = (t) => {
- n('clickOverlay', t), e.closeOnClickOverlay && m()
- },
- v = () => {
- if (e.overlay)
- return t.createVNode(
- Ut,
- {
- show: e.show,
- class: e.overlayClass,
- zIndex: s.value,
- duration: e.duration,
- customStyle: e.overlayStyle,
- role: e.closeOnClickOverlay ? 'button' : void 0,
- tabindex: e.closeOnClickOverlay ? 0 : void 0,
- onClick: f
- },
- { default: r['overlay-content'] }
- )
- },
- h = (e) => {
- n('clickCloseIcon', e), m()
- },
- g = () => {
- if (e.closeable)
- return t.createVNode(
- ht,
- {
- role: 'button',
- tabindex: 0,
- name: e.closeIcon,
- class: [Xt('close-icon', e.closeIconPosition), Fe],
- classPrefix: e.iconPrefix,
- onClick: h
- },
- null
- )
- },
- b = () => n('opened'),
- y = () => n('closed'),
- w = (e) => n('keydown', e),
- x = d(() => {
- var o
- const { round: n, position: l, safeAreaInsetTop: i, safeAreaInsetBottom: s } = e
- return t.withDirectives(
- t.createVNode(
- 'div',
- t.mergeProps(
- {
- ref: c,
- style: u.value,
- role: 'dialog',
- tabindex: 0,
- class: [
- Xt({ round: n, [l]: l }),
- { 'van-safe-area-top': i, 'van-safe-area-bottom': s }
- ],
- onKeydown: w
- },
- a
- ),
- [null == (o = r.default) ? void 0 : o.call(r), g()]
- ),
- [[t.vShow, e.show]]
- )
- }),
- V = () => {
- const { position: o, transition: n, transitionAppear: a } = e,
- r = 'center' === o ? 'van-fade' : `van-popup-slide-${o}`
- return t.createVNode(
- t.Transition,
- { name: n || r, appear: a, onAfterEnter: b, onAfterLeave: y },
- { default: x }
- )
- }
- return (
- t.watch(
- () => e.show,
- (e) => {
- e &&
- !l &&
- (p(),
- 0 === a.tabindex &&
- t.nextTick(() => {
- var e
- null == (e = c.value) || e.focus()
- })),
- !e && l && ((l = !1), n('close'))
- }
- ),
- Qe({ popupRef: c }),
- (function (e, o) {
- const n = $t(),
- a = (t) => {
- n.move(t)
- const o = n.deltaY.value > 0 ? '10' : '01',
- a = G(t.target, e.value),
- { scrollHeight: r, offsetHeight: l, scrollTop: i } = a
- let s = '11'
- 0 === i ? (s = l >= r ? '00' : '01') : i + l >= r && (s = '10'),
- '11' === s || !n.isVertical() || parseInt(s, 2) & parseInt(o, 2) || le(t, !0)
- },
- r = () => {
- document.addEventListener('touchstart', n.start),
- document.addEventListener('touchmove', a, { passive: !1 }),
- Mt || document.body.classList.add(Rt),
- Mt++
- },
- l = () => {
- Mt &&
- (document.removeEventListener('touchstart', n.start),
- document.removeEventListener('touchmove', a),
- Mt--,
- Mt || document.body.classList.remove(Rt))
- },
- i = () => o() && l()
- H(() => o() && r()),
- t.onDeactivated(i),
- t.onBeforeUnmount(i),
- t.watch(o, (e) => {
- e ? r() : l()
- })
- })(c, () => e.show && e.lockScroll),
- j('popstate', () => {
- e.closeOnPopstate && (m(), (i = !1))
- }),
- t.onMounted(() => {
- e.show && p()
- }),
- t.onActivated(() => {
- i && (n('update:show', !0), (i = !1))
- }),
- t.onDeactivated(() => {
- e.show && e.teleport && (m(), (i = !0))
- }),
- t.provide(Ue, () => e.show),
- () =>
- e.teleport
- ? t.createVNode(t.Teleport, { to: e.teleport }, { default: () => [v(), V()] })
- : t.createVNode(t.Fragment, null, [v(), V()])
- )
- }
- })
- ),
- [Zt, Kt] = Ie('action-sheet'),
- _t = d({}, Et, {
- title: String,
- round: b,
- actions: w(),
- closeIcon: N('cross'),
- closeable: b,
- cancelText: String,
- description: String,
- closeOnPopstate: b,
- closeOnClickAction: Boolean,
- safeAreaInsetBottom: b
- }),
- Jt = [...Lt, 'round', 'closeOnPopstate', 'safeAreaInsetBottom']
- const Qt = We(
- t.defineComponent({
- name: Zt,
- props: _t,
- emits: ['select', 'cancel', 'update:show'],
- setup(e, { slots: o, emit: n }) {
- const a = (e) => n('update:show', e),
- r = () => {
- a(!1), n('cancel')
- },
- l = () => {
- if (e.title)
- return t.createVNode('div', { class: Kt('header') }, [
- e.title,
- e.closeable &&
- t.createVNode(
- ht,
- { name: e.closeIcon, class: [Kt('close'), Fe], onClick: r },
- null
- )
- ])
- },
- i = () => {
- if (o.cancel || e.cancelText)
- return [
- t.createVNode('div', { class: Kt('gap') }, null),
- t.createVNode('button', { type: 'button', class: Kt('cancel'), onClick: r }, [
- o.cancel ? o.cancel() : e.cancelText
- ])
- ]
- },
- s = (e, n) =>
- e.loading
- ? t.createVNode(Vt, { class: Kt('loading-icon') }, null)
- : o.action
- ? o.action({ action: e, index: n })
- : [
- t.createVNode('span', { class: Kt('name') }, [e.name]),
- e.subname && t.createVNode('div', { class: Kt('subname') }, [e.subname])
- ],
- c = (o, r) => {
- const { color: l, loading: i, callback: c, disabled: d, className: u } = o
- return t.createVNode(
- 'button',
- {
- type: 'button',
- style: { color: l },
- class: [Kt('item', { loading: i, disabled: d }), u],
- onClick: () => {
- d ||
- i ||
- (c && c(o),
- e.closeOnClickAction && a(!1),
- t.nextTick(() => n('select', o, r)))
- }
- },
- [s(o, r)]
- )
- },
- d = () => {
- if (e.description || o.description) {
- const n = o.description ? o.description() : e.description
- return t.createVNode('div', { class: Kt('description') }, [n])
- }
- }
- return () =>
- t.createVNode(
- Gt,
- t.mergeProps({ class: Kt(), position: 'bottom', 'onUpdate:show': a }, m(e, Jt)),
- {
- default: () => {
- var n
- return [
- l(),
- d(),
- t.createVNode('div', { class: Kt('content') }, [
- e.actions.map(c),
- null == (n = o.default) ? void 0 : n.call(o)
- ]),
- i()
- ]
- }
- }
- )
- }
- })
- ),
- [eo, to, oo] = Ie('picker'),
- no = (e) => e.find((e) => !e.disabled) || e[0]
- function ao(e, t) {
- for (let o = (t = ye(t, 0, e.length)); o < e.length; o++) if (!e[o].disabled) return o
- for (let o = t - 1; o >= 0; o--) if (!e[o].disabled) return o
- return 0
- }
- const ro = (e, t, o) => void 0 !== t && !!e.find((e) => e[o.value] === t)
- function lo(e, t, o) {
- const n = e.findIndex((e) => e[o.value] === t)
- return e[ao(e, n)]
- }
- const [io, so] = Ie('picker-column'),
- co = Symbol(io)
- var uo = t.defineComponent({
- name: io,
- props: {
- value: g,
- fields: y(Object),
- options: w(),
- readonly: Boolean,
- allowHtml: Boolean,
- optionHeight: y(Number),
- swipeDuration: y(g),
- visibleOptionNum: y(g)
- },
- emits: ['change', 'clickOption', 'scrollInto'],
- setup(e, { emit: o, slots: n }) {
- let a, r, l, i, s
- const c = t.ref(),
- d = t.ref(),
- u = t.ref(0),
- p = t.ref(0),
- m = $t(),
- f = () => e.options.length,
- v = () => (e.optionHeight * (+e.visibleOptionNum - 1)) / 2,
- h = (t) => {
- const n = ao(e.options, t),
- r = -n * e.optionHeight,
- l = () => {
- const t = e.options[n][e.fields.value]
- t !== e.value && o('change', t)
- }
- a && r !== u.value ? (s = l) : l(), (u.value = r)
- },
- g = () => e.readonly || !e.options.length,
- b = (t) => ye(Math.round(-t / e.optionHeight), 0, f() - 1),
- y = t.computed(() => b(u.value)),
- w = () => {
- ;(a = !1), (p.value = 0), s && (s(), (s = null))
- },
- x = (e) => {
- if (!g()) {
- if ((m.start(e), a)) {
- const e = (function (e) {
- const { transform: t } = window.getComputedStyle(e),
- o = t.slice(7, t.length - 1).split(', ')[5]
- return Number(o)
- })(d.value)
- u.value = Math.min(0, e - v())
- }
- ;(p.value = 0), (r = u.value), (l = Date.now()), (i = r), (s = null)
- }
- },
- V = () => {
- if (g()) return
- const t = u.value - i,
- o = Date.now() - l
- if (o < 300 && Math.abs(t) > 15)
- return void ((t, o) => {
- const n = Math.abs(t / o)
- t = u.value + (n / 0.003) * (t < 0 ? -1 : 1)
- const a = b(t)
- ;(p.value = +e.swipeDuration), h(a)
- })(t, o)
- const n = b(u.value)
- ;(p.value = 200),
- h(n),
- setTimeout(() => {
- a = !1
- }, 0)
- },
- N = () => {
- const r = { height: `${e.optionHeight}px` }
- return e.options.map((l, i) => {
- const c = l[e.fields.text],
- { disabled: d } = l,
- u = l[e.fields.value],
- m = {
- role: 'button',
- style: r,
- tabindex: d ? -1 : 0,
- class: [so('item', { disabled: d, selected: u === e.value }), l.className],
- onClick: () =>
- ((t) => {
- a || g() || ((s = null), (p.value = 200), h(t), o('clickOption', e.options[t]))
- })(i)
- },
- f = { class: 'van-ellipsis', [e.allowHtml ? 'innerHTML' : 'textContent']: c }
- return t.createVNode('li', m, [
- n.option ? n.option(l, i) : t.createVNode('div', f, null)
- ])
- })
- }
- return (
- D(co),
- Qe({ stopMomentum: w }),
- t.watchEffect(() => {
- const t = e.options.findIndex((t) => t[e.fields.value] === e.value),
- o = -ao(e.options, t) * e.optionHeight
- u.value = o
- }),
- j(
- 'touchmove',
- (t) => {
- if (g()) return
- m.move(t), m.isVertical() && ((a = !0), le(t, !0))
- const n = ye(r + m.deltaY.value, -f() * e.optionHeight, e.optionHeight),
- s = b(n)
- s !== y.value && o('scrollInto', e.options[s]), (u.value = n)
- const c = Date.now()
- c - l > 300 && ((l = c), (i = n))
- },
- { target: c }
- ),
- () =>
- t.createVNode(
- 'div',
- { ref: c, class: so(), onTouchstartPassive: x, onTouchend: V, onTouchcancel: V },
- [
- t.createVNode(
- 'ul',
- {
- ref: d,
- style: {
- transform: `translate3d(0, ${u.value + v()}px, 0)`,
- transitionDuration: `${p.value}ms`,
- transitionProperty: p.value ? 'all' : 'none'
- },
- class: so('wrapper'),
- onTransitionend: w
- },
- [N()]
- )
- ]
- )
- )
- }
- })
- const [po] = Ie('picker-toolbar'),
- mo = { title: String, cancelButtonText: String, confirmButtonText: String },
- fo = ['cancel', 'confirm', 'title', 'toolbar'],
- vo = Object.keys(mo)
- var ho = t.defineComponent({
- name: po,
- props: mo,
- emits: ['confirm', 'cancel'],
- setup(e, { emit: o, slots: n }) {
- const a = () => o('cancel'),
- r = () => o('confirm'),
- l = () => {
- const o = e.cancelButtonText || oo('cancel')
- return t.createVNode(
- 'button',
- { type: 'button', class: [to('cancel'), Fe], onClick: a },
- [n.cancel ? n.cancel() : o]
- )
- },
- i = () => {
- const o = e.confirmButtonText || oo('confirm')
- return t.createVNode(
- 'button',
- { type: 'button', class: [to('confirm'), Fe], onClick: r },
- [n.confirm ? n.confirm() : o]
- )
- }
- return () =>
- t.createVNode('div', { class: to('toolbar') }, [
- n.toolbar
- ? n.toolbar()
- : [
- l(),
- n.title
- ? n.title()
- : e.title
- ? t.createVNode('div', { class: [to('title'), 'van-ellipsis'] }, [e.title])
- : void 0,
- i()
- ]
- ])
- }
- })
- const go = (e, o) => {
- const n = t.ref(e())
- return (
- t.watch(e, (e) => {
- e !== n.value && (n.value = e)
- }),
- t.watch(n, (t) => {
- t !== e() && o(t)
- }),
- n
- )
- }
- let bo = 0
- function yo() {
- const e = t.getCurrentInstance(),
- { name: o = 'unknown' } = (null == e ? void 0 : e.type) || {}
- return `${o}-${++bo}`
- }
- function wo() {
- const e = t.ref([]),
- o = []
- t.onBeforeUpdate(() => {
- e.value = []
- })
- return [
- e,
- (t) => (
- o[t] ||
- (o[t] = (o) => {
- e.value[t] = o
- }),
- o[t]
- )
- ]
- }
- function xo(e, o) {
- if (!u || !window.IntersectionObserver) return
- const n = new IntersectionObserver(
- (e) => {
- o(e[0].intersectionRatio > 0)
- },
- { root: document.body }
- ),
- a = () => {
- e.value && n.unobserve(e.value)
- }
- t.onDeactivated(a),
- t.onBeforeUnmount(a),
- H(() => {
- e.value && n.observe(e.value)
- })
- }
- const [Vo, No] = Ie('sticky'),
- ko = { zIndex: g, position: N('top'), container: Object, offsetTop: V(0), offsetBottom: V(0) }
- const Co = We(
- t.defineComponent({
- name: Vo,
- props: ko,
- emits: ['scroll', 'change'],
- setup(e, { emit: o, slots: n }) {
- const a = t.ref(),
- r = Z(a),
- l = t.reactive({ fixed: !1, width: 0, height: 0, transform: 0 }),
- i = t.ref(!1),
- s = t.computed(() => ve('top' === e.position ? e.offsetTop : e.offsetBottom)),
- c = t.computed(() => {
- if (i.value) return
- const { fixed: e, height: t, width: o } = l
- return e ? { width: `${o}px`, height: `${t}px` } : void 0
- }),
- u = t.computed(() => {
- if (!l.fixed || i.value) return
- const t = d(pe(e.zIndex), {
- width: `${l.width}px`,
- height: `${l.height}px`,
- [e.position]: `${s.value}px`
- })
- return l.transform && (t.transform = `translate3d(0, ${l.transform}px, 0)`), t
- }),
- p = () => {
- if (!a.value || ie(a)) return
- const { container: t, position: n } = e,
- r = P(a),
- i = J(window)
- if (((l.width = r.width), (l.height = r.height), 'top' === n))
- if (t) {
- const e = P(t),
- o = e.bottom - s.value - l.height
- ;(l.fixed = s.value > r.top && e.bottom > 0), (l.transform = o < 0 ? o : 0)
- } else l.fixed = s.value > r.top
- else {
- const { clientHeight: e } = document.documentElement
- if (t) {
- const o = P(t),
- n = e - o.top - s.value - l.height
- ;(l.fixed = e - s.value < r.bottom && e > o.top), (l.transform = n < 0 ? -n : 0)
- } else l.fixed = e - s.value < r.bottom
- }
- ;((e) => {
- o('scroll', { scrollTop: e, isFixed: l.fixed })
- })(i)
- }
- return (
- t.watch(
- () => l.fixed,
- (e) => o('change', e)
- ),
- j('scroll', p, { target: r, passive: !0 }),
- xo(a, p),
- t.watch([se, ce], () => {
- a.value &&
- !ie(a) &&
- l.fixed &&
- ((i.value = !0),
- t.nextTick(() => {
- const e = P(a)
- ;(l.width = e.width), (l.height = e.height), (i.value = !1)
- }))
- }),
- () => {
- var e
- return t.createVNode('div', { ref: a, style: c.value }, [
- t.createVNode(
- 'div',
- { class: No({ fixed: l.fixed && !i.value }), style: u.value },
- [null == (e = n.default) ? void 0 : e.call(n)]
- )
- ])
- }
- )
- }
- })
- ),
- [So, To] = Ie('swipe'),
- Bo = {
- loop: b,
- width: g,
- height: g,
- vertical: Boolean,
- autoplay: V(0),
- duration: V(500),
- touchable: b,
- lazyRender: Boolean,
- initialSwipe: V(0),
- indicatorColor: String,
- showIndicators: b,
- stopPropagation: b
- },
- Po = Symbol(So)
- const Do = We(
- t.defineComponent({
- name: So,
- props: Bo,
- emits: ['change', 'dragStart', 'dragEnd'],
- setup(e, { emit: o, slots: n }) {
- const a = t.ref(),
- r = t.ref(),
- l = t.reactive({ rect: null, width: 0, height: 0, offset: 0, active: 0, swiping: !1 })
- let i = !1
- const s = $t(),
- { children: c, linkChildren: d } = A(Po),
- u = t.computed(() => c.length),
- p = t.computed(() => l[e.vertical ? 'height' : 'width']),
- m = t.computed(() => (e.vertical ? s.deltaY.value : s.deltaX.value)),
- f = t.computed(() => {
- if (l.rect) {
- return (e.vertical ? l.rect.height : l.rect.width) - p.value * u.value
- }
- return 0
- }),
- v = t.computed(() => (p.value ? Math.ceil(Math.abs(f.value) / p.value) : u.value)),
- h = t.computed(() => u.value * p.value),
- g = t.computed(() => (l.active + u.value) % u.value),
- b = t.computed(() => {
- const t = e.vertical ? 'vertical' : 'horizontal'
- return s.direction.value === t
- }),
- y = t.computed(() => {
- const t = {
- transitionDuration: `${l.swiping ? 0 : e.duration}ms`,
- transform: `translate${e.vertical ? 'Y' : 'X'}(${l.offset}px)`
- }
- if (p.value) {
- const o = e.vertical ? 'height' : 'width',
- n = e.vertical ? 'width' : 'height'
- ;(t[o] = `${h.value}px`), (t[n] = e[n] ? `${e[n]}px` : '')
- }
- return t
- }),
- w = (t, o = 0) => {
- let n = t * p.value
- e.loop || (n = Math.min(n, -f.value))
- let a = o - n
- return e.loop || (a = ye(a, f.value, 0)), a
- },
- x = ({ pace: t = 0, offset: n = 0, emitChange: a }) => {
- if (u.value <= 1) return
- const { active: r } = l,
- i = ((t) => {
- const { active: o } = l
- return t ? (e.loop ? ye(o + t, -1, u.value) : ye(o + t, 0, v.value)) : o
- })(t),
- s = w(i, n)
- if (e.loop) {
- if (c[0] && s !== f.value) {
- const e = s < f.value
- c[0].setOffset(e ? h.value : 0)
- }
- if (c[u.value - 1] && 0 !== s) {
- const e = s > 0
- c[u.value - 1].setOffset(e ? -h.value : 0)
- }
- }
- ;(l.active = i), (l.offset = s), a && i !== r && o('change', g.value)
- },
- V = () => {
- ;(l.swiping = !0),
- l.active <= -1 ? x({ pace: u.value }) : l.active >= u.value && x({ pace: -u.value })
- },
- N = () => {
- V(),
- s.reset(),
- T(() => {
- ;(l.swiping = !1), x({ pace: 1, emitChange: !0 })
- })
- }
- let C
- const S = () => clearTimeout(C),
- B = () => {
- S(),
- +e.autoplay > 0 &&
- u.value > 1 &&
- (C = setTimeout(() => {
- N(), B()
- }, +e.autoplay))
- },
- P = (o = +e.initialSwipe) => {
- if (!a.value) return
- const n = () => {
- var t, n
- if (!ie(a)) {
- const o = { width: a.value.offsetWidth, height: a.value.offsetHeight }
- ;(l.rect = o),
- (l.width = +(null != (t = e.width) ? t : o.width)),
- (l.height = +(null != (n = e.height) ? n : o.height))
- }
- u.value && -1 === (o = Math.min(u.value - 1, o)) && (o = u.value - 1),
- (l.active = o),
- (l.swiping = !0),
- (l.offset = w(o)),
- c.forEach((e) => {
- e.setOffset(0)
- }),
- B()
- }
- ie(a) ? t.nextTick().then(n) : n()
- },
- D = () => P(l.active)
- let O
- const I = (t) => {
- !e.touchable ||
- t.touches.length > 1 ||
- (s.start(t), (i = !1), (O = Date.now()), S(), V())
- },
- z = () => {
- if (!e.touchable || !l.swiping) return
- const t = Date.now() - O,
- n = m.value / t
- if ((Math.abs(n) > 0.25 || Math.abs(m.value) > p.value / 2) && b.value) {
- const t = e.vertical ? s.offsetY.value : s.offsetX.value
- let o = 0
- ;(o = e.loop
- ? t > 0
- ? m.value > 0
- ? -1
- : 1
- : 0
- : -Math[m.value > 0 ? 'ceil' : 'floor'](m.value / p.value)),
- x({ pace: o, emitChange: !0 })
- } else m.value && x({ pace: 0 })
- ;(i = !1), (l.swiping = !1), o('dragEnd', { index: g.value }), B()
- },
- E = (o, n) => {
- const a = n === g.value,
- r = a ? { backgroundColor: e.indicatorColor } : void 0
- return t.createVNode('i', { style: r, class: To('indicator', { active: a }) }, null)
- }
- return (
- Qe({
- prev: () => {
- V(),
- s.reset(),
- T(() => {
- ;(l.swiping = !1), x({ pace: -1, emitChange: !0 })
- })
- },
- next: N,
- state: l,
- resize: D,
- swipeTo: (t, o = {}) => {
- V(),
- s.reset(),
- T(() => {
- let n
- ;(n = e.loop && t === u.value ? (0 === l.active ? 0 : t) : t % u.value),
- o.immediate
- ? T(() => {
- l.swiping = !1
- })
- : (l.swiping = !1),
- x({ pace: n - l.active, emitChange: !0 })
- })
- }
- }),
- d({ size: p, props: e, count: u, activeIndicator: g }),
- t.watch(
- () => e.initialSwipe,
- (e) => P(+e)
- ),
- t.watch(u, () => P(l.active)),
- t.watch(() => e.autoplay, B),
- t.watch([se, ce, () => e.width, () => e.height], D),
- t.watch(
- (function () {
- if (!U && ((U = t.ref('visible')), k)) {
- const e = () => {
- U.value = document.hidden ? 'hidden' : 'visible'
- }
- e(), window.addEventListener('visibilitychange', e)
- }
- return U
- })(),
- (e) => {
- 'visible' === e ? B() : S()
- }
- ),
- t.onMounted(P),
- t.onActivated(() => P(l.active)),
- Ye(() => P(l.active)),
- t.onDeactivated(S),
- t.onBeforeUnmount(S),
- j(
- 'touchmove',
- (t) => {
- if (e.touchable && l.swiping && (s.move(t), b.value)) {
- ;(!e.loop &&
- ((0 === l.active && m.value > 0) ||
- (l.active === u.value - 1 && m.value < 0))) ||
- (le(t, e.stopPropagation),
- x({ offset: m.value }),
- i || (o('dragStart', { index: g.value }), (i = !0)))
- }
- },
- { target: r }
- ),
- () => {
- var o
- return t.createVNode('div', { ref: a, class: To() }, [
- t.createVNode(
- 'div',
- {
- ref: r,
- style: y.value,
- class: To('track', { vertical: e.vertical }),
- onTouchstartPassive: I,
- onTouchend: z,
- onTouchcancel: z
- },
- [null == (o = n.default) ? void 0 : o.call(n)]
- ),
- n.indicator
- ? n.indicator({ active: g.value, total: u.value })
- : e.showIndicators && u.value > 1
- ? t.createVNode('div', { class: To('indicators', { vertical: e.vertical }) }, [
- Array(u.value).fill('').map(E)
- ])
- : void 0
- ])
- }
- )
- }
- })
- ),
- [Oo, Io] = Ie('tabs')
- var Ao = t.defineComponent({
- name: Oo,
- props: {
- count: y(Number),
- inited: Boolean,
- animated: Boolean,
- duration: y(g),
- swipeable: Boolean,
- lazyRender: Boolean,
- currentIndex: y(Number)
- },
- emits: ['change'],
- setup(e, { emit: o, slots: n }) {
- const a = t.ref(),
- r = (e) => o('change', e),
- l = () => {
- var o
- const l = null == (o = n.default) ? void 0 : o.call(n)
- return e.animated || e.swipeable
- ? t.createVNode(
- Do,
- {
- ref: a,
- loop: !1,
- class: Io('track'),
- duration: 1e3 * +e.duration,
- touchable: e.swipeable,
- lazyRender: e.lazyRender,
- showIndicators: !1,
- onChange: r
- },
- { default: () => [l] }
- )
- : l
- },
- i = (t) => {
- const o = a.value
- o && o.state.active !== t && o.swipeTo(t, { immediate: !e.inited })
- }
- return (
- t.watch(() => e.currentIndex, i),
- t.onMounted(() => {
- i(e.currentIndex)
- }),
- Qe({ swipeRef: a }),
- () =>
- t.createVNode('div', { class: Io('content', { animated: e.animated || e.swipeable }) }, [
- l()
- ])
- )
- }
- })
- const [zo, Eo] = Ie('tabs'),
- Lo = {
- type: N('line'),
- color: String,
- border: Boolean,
- sticky: Boolean,
- shrink: Boolean,
- active: V(0),
- duration: V(0.3),
- animated: Boolean,
- ellipsis: b,
- swipeable: Boolean,
- scrollspy: Boolean,
- offsetTop: V(0),
- background: String,
- lazyRender: b,
- lineWidth: g,
- lineHeight: g,
- beforeChange: Function,
- swipeThreshold: V(5),
- titleActiveColor: String,
- titleInactiveColor: String
- },
- $o = Symbol(zo)
- var Mo = t.defineComponent({
- name: zo,
- props: Lo,
- emits: ['change', 'scroll', 'rendered', 'clickTab', 'update:active'],
- setup(e, { emit: n, slots: a }) {
- let r, l, i, s, c
- const d = t.ref(),
- u = t.ref(),
- p = t.ref(),
- m = t.ref(),
- f = yo(),
- v = Z(d),
- [h, g] = wo(),
- { children: b, linkChildren: y } = A($o),
- w = t.reactive({ inited: !1, position: '', lineStyle: {}, currentIndex: -1 }),
- x = t.computed(() => b.length > +e.swipeThreshold || !e.ellipsis || e.shrink),
- V = t.computed(() => ({ borderColor: e.color, background: e.background })),
- N = (e, t) => {
- var o
- return null != (o = e.name) ? o : t
- },
- k = t.computed(() => {
- const e = b[w.currentIndex]
- if (e) return N(e, w.currentIndex)
- }),
- T = t.computed(() => ve(e.offsetTop)),
- B = t.computed(() => (e.sticky ? T.value + r : 0)),
- D = (t) => {
- const o = u.value,
- n = h.value
- if (!(x.value && o && n && n[w.currentIndex])) return
- const a = n[w.currentIndex].$el,
- r = a.offsetLeft - (o.offsetWidth - a.offsetWidth) / 2
- s && s(),
- (s = (function (e, t, o) {
- let n,
- a = 0
- const r = e.scrollLeft,
- l = 0 === o ? 1 : Math.round((1e3 * o) / 16)
- return (
- (function o() {
- ;(e.scrollLeft += (t - r) / l), ++a < l && (n = C(o))
- })(),
- function () {
- S(n)
- }
- )
- })(o, r, t ? 0 : +e.duration))
- },
- O = () => {
- const n = w.inited
- t.nextTick(() => {
- const t = h.value
- if (!t || !t[w.currentIndex] || 'line' !== e.type || ie(d.value)) return
- const a = t[w.currentIndex].$el,
- { lineWidth: r, lineHeight: l } = e,
- i = a.offsetLeft + a.offsetWidth / 2,
- s = {
- width: de(r),
- backgroundColor: e.color,
- transform: `translateX(${i}px) translateX(-50%)`
- }
- if ((n && (s.transitionDuration = `${e.duration}s`), o(l))) {
- const e = de(l)
- ;(s.height = e), (s.borderRadius = e)
- }
- w.lineStyle = s
- })
- },
- I = (t, a) => {
- const r = ((e) => {
- const t = e < w.currentIndex ? -1 : 1
- for (; e >= 0 && e < b.length; ) {
- if (!b[e].disabled) return e
- e += t
- }
- })(t)
- if (!o(r)) return
- const l = b[r],
- s = N(l, r),
- c = null !== w.currentIndex
- w.currentIndex !== r && ((w.currentIndex = r), a || D(), O()),
- s !== e.active && (n('update:active', s), c && n('change', s, l.title)),
- i && !e.scrollspy && te(Math.ceil(oe(d.value) - T.value))
- },
- z = (e, t) => {
- const o = b.find((t, o) => N(t, o) === e),
- n = o ? b.indexOf(o) : 0
- I(n, t)
- },
- E = (t = !1) => {
- if (e.scrollspy) {
- const o = b[w.currentIndex].$el
- if (o && v.value) {
- const n = oe(o, v.value) - B.value
- ;(l = !0),
- c && c(),
- (c = (function (e, t, o, n) {
- let a,
- r = J(e)
- const l = r < t,
- i = 0 === o ? 1 : Math.round((1e3 * o) / 16),
- s = (t - r) / i
- return (
- (function o() {
- ;(r += s),
- ((l && r > t) || (!l && r < t)) && (r = t),
- Q(e, r),
- (l && r < t) || (!l && r > t) ? (a = C(o)) : n && (a = C(n))
- })(),
- function () {
- S(a)
- }
- )
- })(v.value, n, t ? 0 : +e.duration, () => {
- l = !1
- }))
- }
- }
- },
- L = (t, o, a) => {
- const { title: r, disabled: l } = b[o],
- i = N(b[o], o)
- l ||
- (je(e.beforeChange, {
- args: [i],
- done: () => {
- I(o), E()
- }
- }),
- tt(t)),
- n('clickTab', { name: i, title: r, event: a, disabled: l })
- },
- $ = (e) => {
- ;(i = e.isFixed), n('scroll', e)
- },
- M = () => {
- if ('line' === e.type && b.length)
- return t.createVNode('div', { class: Eo('line'), style: w.lineStyle }, null)
- },
- R = () => {
- var o, n, r
- const { type: l, border: i, sticky: s } = e,
- c = [
- t.createVNode(
- 'div',
- { ref: s ? void 0 : p, class: [Eo('wrap'), { [Me]: 'line' === l && i }] },
- [
- t.createVNode(
- 'div',
- {
- ref: u,
- role: 'tablist',
- class: Eo('nav', [l, { shrink: e.shrink, complete: x.value }]),
- style: V.value,
- 'aria-orientation': 'horizontal'
- },
- [
- null == (o = a['nav-left']) ? void 0 : o.call(a),
- b.map((e) => e.renderTitle(L)),
- M(),
- null == (n = a['nav-right']) ? void 0 : n.call(a)
- ]
- )
- ]
- ),
- null == (r = a['nav-bottom']) ? void 0 : r.call(a)
- ]
- return s ? t.createVNode('div', { ref: p }, [c]) : c
- },
- F = () => {
- O(),
- t.nextTick(() => {
- var e, t
- D(!0), null == (t = null == (e = m.value) ? void 0 : e.swipeRef.value) || t.resize()
- })
- }
- t.watch(() => [e.color, e.duration, e.lineWidth, e.lineHeight], O),
- t.watch(se, F),
- t.watch(
- () => e.active,
- (e) => {
- e !== k.value && z(e)
- }
- ),
- t.watch(
- () => b.length,
- () => {
- w.inited &&
- (z(e.active),
- O(),
- t.nextTick(() => {
- D(!0)
- }))
- }
- )
- return (
- Qe({
- resize: F,
- scrollTo: (e) => {
- t.nextTick(() => {
- z(e), E(!0)
- })
- }
- }),
- t.onActivated(O),
- Ye(O),
- H(() => {
- z(e.active, !0),
- t.nextTick(() => {
- ;(w.inited = !0), p.value && (r = P(p.value).height), D(!0)
- })
- }),
- xo(d, O),
- j(
- 'scroll',
- () => {
- if (e.scrollspy && !l) {
- const e = (() => {
- for (let e = 0; e < b.length; e++) {
- const { top: t } = P(b[e].$el)
- if (t > B.value) return 0 === e ? 0 : e - 1
- }
- return b.length - 1
- })()
- I(e)
- }
- },
- { target: v, passive: !0 }
- ),
- y({
- id: f,
- props: e,
- setLine: O,
- scrollable: x,
- onRendered: (e, t) => n('rendered', e, t),
- currentName: k,
- setTitleRefs: g,
- scrollIntoView: D
- }),
- () =>
- t.createVNode('div', { ref: d, class: Eo([e.type]) }, [
- e.sticky
- ? t.createVNode(
- Co,
- { container: d.value, offsetTop: T.value, onScroll: $ },
- { default: () => [R()] }
- )
- : R(),
- t.createVNode(
- Ao,
- {
- ref: m,
- count: b.length,
- inited: w.inited,
- animated: e.animated,
- duration: e.duration,
- swipeable: e.swipeable,
- lazyRender: e.lazyRender,
- currentIndex: w.currentIndex,
- onChange: I
- },
- {
- default: () => {
- var e
- return [null == (e = a.default) ? void 0 : e.call(a)]
- }
- }
- )
- ])
- )
- }
- })
- const Ro = Symbol(),
- [Fo, Ho] = Ie('tab'),
- jo = t.defineComponent({
- name: Fo,
- props: {
- id: String,
- dot: Boolean,
- type: String,
- color: String,
- title: String,
- badge: g,
- shrink: Boolean,
- isActive: Boolean,
- disabled: Boolean,
- controls: String,
- scrollable: Boolean,
- activeColor: String,
- inactiveColor: String,
- showZeroBadge: b
- },
- setup(e, { slots: n }) {
- const a = t.computed(() => {
- const t = {},
- { type: o, color: n, disabled: a, isActive: r, activeColor: l, inactiveColor: i } = e
- n &&
- 'card' === o &&
- ((t.borderColor = n), a || (r ? (t.backgroundColor = n) : (t.color = n)))
- const s = r ? l : i
- return s && (t.color = s), t
- }),
- r = () => {
- const a = t.createVNode('span', { class: Ho('text', { ellipsis: !e.scrollable }) }, [
- n.title ? n.title() : e.title
- ])
- return e.dot || (o(e.badge) && '' !== e.badge)
- ? t.createVNode(
- lt,
- { dot: e.dot, content: e.badge, showZero: e.showZeroBadge },
- { default: () => [a] }
- )
- : a
- }
- return () =>
- t.createVNode(
- 'div',
- {
- id: e.id,
- role: 'tab',
- class: [
- Ho([
- e.type,
- {
- grow: e.scrollable && !e.shrink,
- shrink: e.shrink,
- active: e.isActive,
- disabled: e.disabled
- }
- ])
- ],
- style: a.value,
- tabindex: e.disabled ? void 0 : e.isActive ? 0 : -1,
- 'aria-selected': e.isActive,
- 'aria-disabled': e.disabled || void 0,
- 'aria-controls': e.controls
- },
- [r()]
- )
- }
- }),
- [Wo, Uo] = Ie('swipe-item')
- const Yo = We(
- t.defineComponent({
- name: Wo,
- setup(e, { slots: o }) {
- let n
- const a = t.reactive({ offset: 0, inited: !1, mounted: !1 }),
- { parent: r, index: l } = D(Po)
- if (!r) return
- const i = t.computed(() => {
- const e = {},
- { vertical: t } = r.props
- return (
- r.size.value && (e[t ? 'height' : 'width'] = `${r.size.value}px`),
- a.offset && (e.transform = `translate${t ? 'Y' : 'X'}(${a.offset}px)`),
- e
- )
- }),
- s = t.computed(() => {
- const { loop: e, lazyRender: t } = r.props
- if (!t || n) return !0
- if (!a.mounted) return !1
- const o = r.activeIndicator.value,
- i = r.count.value - 1,
- s = 0 === o && e ? i : o - 1,
- c = o === i && e ? 0 : o + 1
- return (n = l.value === o || l.value === s || l.value === c), n
- })
- return (
- t.onMounted(() => {
- t.nextTick(() => {
- a.mounted = !0
- })
- }),
- Qe({
- setOffset: (e) => {
- a.offset = e
- }
- }),
- () => {
- var e
- return t.createVNode('div', { class: Uo(), style: i.value }, [
- s.value ? (null == (e = o.default) ? void 0 : e.call(o)) : null
- ])
- }
- )
- }
- })
- ),
- [qo, Xo] = Ie('tab'),
- Go = d({}, et, {
- dot: Boolean,
- name: g,
- badge: g,
- title: String,
- disabled: Boolean,
- titleClass: h,
- titleStyle: [String, Object],
- showZeroBadge: b
- })
- const Zo = We(
- t.defineComponent({
- name: qo,
- props: Go,
- setup(e, { slots: o }) {
- const n = yo(),
- a = t.ref(!1),
- r = t.getCurrentInstance(),
- { parent: l, index: i } = D($o)
- if (!l) return
- const s = () => {
- var t
- return null != (t = e.name) ? t : i.value
- },
- c = t.computed(() => {
- const o = s() === l.currentName.value
- return (
- o &&
- !a.value &&
- ((a.value = !0),
- l.props.lazyRender &&
- t.nextTick(() => {
- l.onRendered(s(), e.title)
- })),
- o
- )
- }),
- d = t.ref(!c.value)
- return (
- t.watch(c, (e) => {
- e
- ? (d.value = !1)
- : T(() => {
- d.value = !0
- })
- }),
- t.watch(
- () => e.title,
- () => {
- l.setLine(), l.scrollIntoView()
- }
- ),
- t.provide(Ro, c),
- Qe({
- id: n,
- renderTitle: (a) =>
- t.createVNode(
- jo,
- t.mergeProps(
- {
- key: n,
- id: `${l.id}-${i.value}`,
- ref: l.setTitleRefs(i.value),
- style: e.titleStyle,
- class: e.titleClass,
- isActive: c.value,
- controls: n,
- scrollable: l.scrollable.value,
- activeColor: l.props.titleActiveColor,
- inactiveColor: l.props.titleInactiveColor,
- onClick: (e) => a(r.proxy, i.value, e)
- },
- m(l.props, ['type', 'color', 'shrink']),
- m(e, ['dot', 'badge', 'title', 'disabled', 'showZeroBadge'])
- ),
- { title: o.title }
- )
- }),
- () => {
- var e
- const r = `${l.id}-${i.value}`,
- { animated: s, swipeable: u, scrollspy: p, lazyRender: m } = l.props
- if (!o.default && !s) return
- const f = p || c.value
- if (s || u)
- return t.createVNode(
- Yo,
- {
- id: n,
- role: 'tabpanel',
- class: Xo('panel-wrapper', { inactive: d.value }),
- tabindex: c.value ? 0 : -1,
- 'aria-hidden': !c.value,
- 'aria-labelledby': r
- },
- {
- default: () => {
- var e
- return [
- t.createVNode('div', { class: Xo('panel') }, [
- null == (e = o.default) ? void 0 : e.call(o)
- ])
- ]
- }
- }
- )
- const v = a.value || p || !m ? (null == (e = o.default) ? void 0 : e.call(o)) : null
- return t.withDirectives(
- t.createVNode(
- 'div',
- {
- id: n,
- role: 'tabpanel',
- class: Xo('panel'),
- tabindex: f ? 0 : -1,
- 'aria-labelledby': r
- },
- [v]
- ),
- [[t.vShow, f]]
- )
- }
- )
- }
- })
- ),
- Ko = We(Mo),
- [_o, Jo] = Ie('picker-group'),
- Qo = Symbol(_o),
- en = d({ tabs: w(), activeTab: V(0), nextStepText: String }, mo)
- var tn = t.defineComponent({
- name: _o,
- props: en,
- emits: ['confirm', 'cancel', 'update:activeTab'],
- setup(e, { emit: o, slots: n }) {
- const a = go(
- () => e.activeTab,
- (e) => o('update:activeTab', e)
- ),
- { children: r, linkChildren: l } = A(Qo)
- l()
- const i = () => +a.value < e.tabs.length - 1 && e.nextStepText,
- s = () => {
- i()
- ? (a.value = +a.value + 1)
- : o(
- 'confirm',
- r.map((e) => e.confirm())
- )
- },
- c = () => o('cancel')
- return () => {
- var o
- const r = null == (o = n.default) ? void 0 : o.call(n),
- l = i() ? e.nextStepText : e.confirmButtonText
- return t.createVNode('div', { class: Jo() }, [
- t.createVNode(
- ho,
- {
- title: e.title,
- cancelButtonText: e.cancelButtonText,
- confirmButtonText: l,
- onConfirm: s,
- onCancel: c
- },
- m(n, fo)
- ),
- t.createVNode(
- Ko,
- {
- active: a.value,
- 'onUpdate:active': (e) => (a.value = e),
- class: Jo('tabs'),
- shrink: !0,
- animated: !0,
- lazyRender: !1
- },
- {
- default: () => [
- e.tabs.map((e, o) =>
- t.createVNode(
- Zo,
- { title: e, titleClass: Jo('tab-title') },
- { default: () => [null == r ? void 0 : r[o]] }
- )
- )
- ]
- }
- )
- ])
- }
- }
- })
- const on = d(
- {
- loading: Boolean,
- readonly: Boolean,
- allowHtml: Boolean,
- optionHeight: V(44),
- showToolbar: b,
- swipeDuration: V(1e3),
- visibleOptionNum: V(6)
- },
- mo
- ),
- nn = d({}, on, {
- columns: w(),
- modelValue: w(),
- toolbarPosition: N('top'),
- columnsFieldNames: Object
- })
- var an = t.defineComponent({
- name: eo,
- props: nn,
- emits: ['confirm', 'cancel', 'change', 'scrollInto', 'clickOption', 'update:modelValue'],
- setup(e, { emit: n, slots: a }) {
- const r = t.ref(),
- l = t.ref(e.modelValue.slice(0)),
- { parent: i } = D(Qo),
- { children: s, linkChildren: c } = A(co)
- c()
- const u = t.computed(() =>
- (function (e) {
- return d({ text: 'text', value: 'value', children: 'children' }, e)
- })(e.columnsFieldNames)
- ),
- p = t.computed(() => ve(e.optionHeight)),
- v = t.computed(() =>
- (function (e, t) {
- const o = e[0]
- if (o) {
- if (Array.isArray(o)) return 'multiple'
- if (t.children in o) return 'cascade'
- }
- return 'default'
- })(e.columns, u.value)
- ),
- h = t.computed(() => {
- const { columns: t } = e
- switch (v.value) {
- case 'multiple':
- return t
- case 'cascade':
- return (function (e, t, n) {
- const a = []
- let r = { [t.children]: e },
- l = 0
- for (; r && r[t.children]; ) {
- const e = r[t.children],
- i = n.value[l]
- ;(r = o(i) ? lo(e, i, t) : void 0),
- !r && e.length && (r = lo(e, no(e)[t.value], t)),
- l++,
- a.push(e)
- }
- return a
- })(t, u.value, l)
- default:
- return [t]
- }
- }),
- g = t.computed(() => h.value.some((e) => e.length)),
- b = t.computed(() => h.value.map((e, t) => lo(e, l.value[t], u.value))),
- y = t.computed(() =>
- h.value.map((e, t) => e.findIndex((e) => e[u.value.value] === l.value[t]))
- ),
- w = (e, t) => {
- if (l.value[e] !== t) {
- const o = l.value.slice(0)
- ;(o[e] = t), (l.value = o)
- }
- },
- x = () => ({
- selectedValues: l.value.slice(0),
- selectedOptions: b.value,
- selectedIndexes: y.value
- }),
- V = () => {
- s.forEach((e) => e.stopMomentum())
- const e = x()
- return (
- t.nextTick(() => {
- n('confirm', e)
- }),
- e
- )
- },
- N = () => n('cancel', x()),
- k = () =>
- h.value.map((o, r) =>
- t.createVNode(
- uo,
- {
- value: l.value[r],
- fields: u.value,
- options: o,
- readonly: e.readonly,
- allowHtml: e.allowHtml,
- optionHeight: p.value,
- swipeDuration: e.swipeDuration,
- visibleOptionNum: e.visibleOptionNum,
- onChange: (e) =>
- ((e, o) => {
- w(o, e),
- 'cascade' === v.value &&
- l.value.forEach((e, t) => {
- const o = h.value[t]
- ro(o, e, u.value) || w(t, o.length ? o[0][u.value.value] : void 0)
- }),
- t.nextTick(() => {
- n('change', d({ columnIndex: o }, x()))
- })
- })(e, r),
- onClickOption: (e) =>
- ((e, t) => {
- const o = { columnIndex: t, currentOption: e }
- n('clickOption', d(x(), o)), n('scrollInto', o)
- })(e, r),
- onScrollInto: (e) => {
- n('scrollInto', { currentOption: e, columnIndex: r })
- }
- },
- { option: a.option }
- )
- ),
- C = (e) => {
- if (g.value) {
- const o = { height: `${p.value}px` },
- n = { backgroundSize: `100% ${(e - p.value) / 2}px` }
- return [
- t.createVNode('div', { class: to('mask'), style: n }, null),
- t.createVNode('div', { class: [Re, to('frame')], style: o }, null)
- ]
- }
- },
- S = () => {
- const o = p.value * +e.visibleOptionNum,
- n = { height: `${o}px` }
- return t.createVNode('div', { ref: r, class: to('columns'), style: n }, [k(), C(o)])
- },
- T = () => {
- if (e.showToolbar && !i)
- return t.createVNode(
- ho,
- t.mergeProps(m(e, vo), { onConfirm: V, onCancel: N }),
- m(a, fo)
- )
- }
- let B
- t.watch(
- h,
- (e) => {
- e.forEach((e, t) => {
- e.length && !ro(e, l.value[t], u.value) && w(t, no(e)[u.value.value])
- })
- },
- { immediate: !0 }
- ),
- t.watch(
- () => e.modelValue,
- (e) => {
- f(e, l.value) || f(e, B) || ((l.value = e.slice(0)), (B = e.slice(0)))
- },
- { deep: !0 }
- ),
- t.watch(
- l,
- (t) => {
- f(t, e.modelValue) || ((B = t.slice(0)), n('update:modelValue', B))
- },
- { immediate: !0 }
- ),
- j('touchmove', le, { target: r })
- return (
- Qe({ confirm: V, getSelectedOptions: () => b.value }),
- () => {
- var o, n
- return t.createVNode('div', { class: to() }, [
- 'top' === e.toolbarPosition ? T() : null,
- e.loading ? t.createVNode(Vt, { class: to('loading') }, null) : null,
- null == (o = a['columns-top']) ? void 0 : o.call(a),
- S(),
- null == (n = a['columns-bottom']) ? void 0 : n.call(a),
- 'bottom' === e.toolbarPosition ? T() : null
- ])
- }
- )
- }
- })
- const rn = '000000',
- ln = ['title', 'cancel', 'confirm', 'toolbar', 'columns-top', 'columns-bottom'],
- sn = [
- 'title',
- 'loading',
- 'readonly',
- 'optionHeight',
- 'swipeDuration',
- 'visibleOptionNum',
- 'cancelButtonText',
- 'confirmButtonText'
- ],
- cn = (e = '', t = rn, o) => ({ text: e, value: t, children: o })
- function dn({ areaList: e, columnsNum: t, columnsPlaceholder: o }) {
- const { city_list: n = {}, county_list: a = {}, province_list: r = {} } = e,
- l = +t > 1,
- i = +t > 2,
- s = new Map()
- Object.keys(r).forEach((e) => {
- s.set(
- e.slice(0, 2),
- cn(
- r[e],
- e,
- (() => {
- if (l) return o.length ? [cn(o[0], rn, i ? [] : void 0)] : []
- })()
- )
- )
- })
- const c = new Map()
- if (l) {
- const e = () => {
- if (i) return o.length ? [cn(o[1])] : []
- }
- Object.keys(n).forEach((t) => {
- const o = cn(n[t], t, e())
- c.set(t.slice(0, 4), o)
- const a = s.get(t.slice(0, 2))
- a && a.children.push(o)
- })
- }
- i &&
- Object.keys(a).forEach((e) => {
- const t = c.get(e.slice(0, 4))
- t && t.children.push(cn(a[e], e))
- })
- const d = Array.from(s.values())
- if (o.length) {
- const e = i ? [cn(o[2])] : void 0,
- t = l ? [cn(o[1], rn, e)] : void 0
- d.unshift(cn(o[0], rn, t))
- }
- return d
- }
- const un = We(an),
- [pn, mn] = Ie('area'),
- fn = d({}, m(on, sn), {
- modelValue: String,
- columnsNum: V(3),
- columnsPlaceholder: w(),
- areaList: { type: Object, default: () => ({}) }
- })
- const vn = We(
- t.defineComponent({
- name: pn,
- props: fn,
- emits: ['change', 'confirm', 'cancel', 'update:modelValue'],
- setup(e, { emit: o, slots: n }) {
- const a = t.ref([]),
- r = t.ref(),
- l = t.computed(() => dn(e)),
- i = (...e) => o('change', ...e),
- s = (...e) => o('cancel', ...e),
- c = (...e) => o('confirm', ...e)
- return (
- t.watch(
- a,
- (t) => {
- const n = t.length ? t[t.length - 1] : ''
- n && n !== e.modelValue && o('update:modelValue', n)
- },
- { deep: !0 }
- ),
- t.watch(
- () => e.modelValue,
- (t) => {
- if (t) {
- t !== (a.value.length ? a.value[a.value.length - 1] : '') &&
- (a.value = [`${t.slice(0, 2)}0000`, `${t.slice(0, 4)}00`, t].slice(
- 0,
- +e.columnsNum
- ))
- } else a.value = []
- },
- { immediate: !0 }
- ),
- Qe({
- confirm: () => {
- var e
- return null == (e = r.value) ? void 0 : e.confirm()
- },
- getSelectedOptions: () => {
- var e
- return (null == (e = r.value) ? void 0 : e.getSelectedOptions()) || []
- }
- }),
- () =>
- t.createVNode(
- un,
- t.mergeProps(
- {
- ref: r,
- modelValue: a.value,
- 'onUpdate:modelValue': (e) => (a.value = e),
- class: mn(),
- columns: l.value,
- onChange: i,
- onCancel: s,
- onConfirm: c
- },
- m(e, sn)
- ),
- m(n, ln)
- )
- )
- }
- })
- ),
- [hn, gn] = Ie('cell'),
- bn = {
- tag: N('div'),
- icon: String,
- size: String,
- title: g,
- value: g,
- label: g,
- center: Boolean,
- isLink: Boolean,
- border: b,
- required: Boolean,
- iconPrefix: String,
- valueClass: h,
- labelClass: h,
- titleClass: h,
- titleStyle: null,
- arrowDirection: String,
- clickable: { type: Boolean, default: null }
- },
- yn = d({}, bn, et)
- const wn = We(
- t.defineComponent({
- name: hn,
- props: yn,
- setup(e, { slots: n }) {
- const a = ot(),
- r = () => {
- if (n.label || o(e.label))
- return t.createVNode('div', { class: [gn('label'), e.labelClass] }, [
- n.label ? n.label() : e.label
- ])
- },
- l = () => {
- var a
- if (n.title || o(e.title)) {
- const o = null == (a = n.title) ? void 0 : a.call(n)
- if (Array.isArray(o) && 0 === o.length) return
- return t.createVNode(
- 'div',
- { class: [gn('title'), e.titleClass], style: e.titleStyle },
- [o || t.createVNode('span', null, [e.title]), r()]
- )
- }
- },
- i = () => {
- const a = n.value || n.default
- if (a || o(e.value))
- return t.createVNode('div', { class: [gn('value'), e.valueClass] }, [
- a ? a() : t.createVNode('span', null, [e.value])
- ])
- },
- s = () => {
- if (n['right-icon']) return n['right-icon']()
- if (e.isLink) {
- const o =
- e.arrowDirection && 'right' !== e.arrowDirection
- ? `arrow-${e.arrowDirection}`
- : 'arrow'
- return t.createVNode(ht, { name: o, class: gn('right-icon') }, null)
- }
- }
- return () => {
- var o
- const { tag: r, size: c, center: d, border: u, isLink: p, required: m } = e,
- f = null != (o = e.clickable) ? o : p,
- v = { center: d, required: m, clickable: f, borderless: !u }
- return (
- c && (v[c] = !!c),
- t.createVNode(
- r,
- { class: gn(v), role: f ? 'button' : void 0, tabindex: f ? 0 : void 0, onClick: a },
- {
- default: () => {
- var o
- return [
- n.icon
- ? n.icon()
- : e.icon
- ? t.createVNode(
- ht,
- { name: e.icon, class: gn('left-icon'), classPrefix: e.iconPrefix },
- null
- )
- : void 0,
- l(),
- i(),
- s(),
- null == (o = n.extra) ? void 0 : o.call(n)
- ]
- }
- }
- )
- )
- }
- }
- })
- ),
- [xn, Vn] = Ie('form'),
- Nn = {
- colon: Boolean,
- disabled: Boolean,
- readonly: Boolean,
- showError: Boolean,
- labelWidth: g,
- labelAlign: String,
- inputAlign: String,
- scrollToError: Boolean,
- validateFirst: Boolean,
- submitOnEnter: b,
- showErrorMessage: b,
- errorMessageAlign: String,
- validateTrigger: { type: [String, Array], default: 'onBlur' }
- }
- const kn = We(
- t.defineComponent({
- name: xn,
- props: Nn,
- emits: ['submit', 'failed'],
- setup(e, { emit: o, slots: n }) {
- const { children: a, linkChildren: r } = A(He),
- l = (e) => (e ? a.filter((t) => e.includes(t.name)) : a),
- i = (t) => {
- return 'string' == typeof t
- ? ((e) => {
- const t = a.find((t) => t.name === e)
- return t
- ? new Promise((e, o) => {
- t.validate().then((t) => {
- t ? o(t) : e()
- })
- })
- : Promise.reject()
- })(t)
- : e.validateFirst
- ? ((o = t),
- new Promise((e, t) => {
- const n = []
- l(o)
- .reduce(
- (e, t) =>
- e.then(() => {
- if (!n.length)
- return t.validate().then((e) => {
- e && n.push(e)
- })
- }),
- Promise.resolve()
- )
- .then(() => {
- n.length ? t(n) : e()
- })
- }))
- : ((e) =>
- new Promise((t, o) => {
- const n = l(e)
- Promise.all(n.map((e) => e.validate())).then((e) => {
- ;(e = e.filter(Boolean)).length ? o(e) : t()
- })
- }))(t)
- var o
- },
- s = (e, t) => {
- a.some((o) => o.name === e && (o.$el.scrollIntoView(t), !0))
- },
- c = () =>
- a.reduce((e, t) => (void 0 !== t.name && (e[t.name] = t.formValue.value), e), {}),
- d = () => {
- const t = c()
- i()
- .then(() => o('submit', t))
- .catch((n) => {
- o('failed', { values: t, errors: n }), e.scrollToError && n[0].name && s(n[0].name)
- })
- },
- u = (e) => {
- le(e), d()
- }
- return (
- r({ props: e }),
- Qe({
- submit: d,
- validate: i,
- getValues: c,
- scrollToField: s,
- resetValidation: (e) => {
- 'string' == typeof e && (e = [e])
- l(e).forEach((e) => {
- e.resetValidation()
- })
- },
- getValidationStatus: () =>
- a.reduce((e, t) => ((e[t.name] = t.getValidationStatus()), e), {})
- }),
- () => {
- var e
- return t.createVNode('form', { class: Vn(), onSubmit: u }, [
- null == (e = n.default) ? void 0 : e.call(n)
- ])
- }
- )
- }
- })
- )
- function Cn(e) {
- return Array.isArray(e) ? !e.length : 0 !== e && !e
- }
- function Sn(e, t) {
- const { message: o } = t
- return n(o) ? o(e, t) : o || ''
- }
- function Tn({ target: e }) {
- e.composing = !0
- }
- function Bn({ target: e }) {
- e.composing && ((e.composing = !1), e.dispatchEvent(new Event('input')))
- }
- function Pn(e) {
- return [...e].length
- }
- function Dn(e, t) {
- return [...e].slice(0, t).join('')
- }
- const [On, In] = Ie('field'),
- An = {
- id: String,
- name: String,
- leftIcon: String,
- rightIcon: String,
- autofocus: Boolean,
- clearable: Boolean,
- maxlength: g,
- formatter: Function,
- clearIcon: N('clear'),
- modelValue: V(''),
- inputAlign: String,
- placeholder: String,
- autocomplete: String,
- errorMessage: String,
- enterkeyhint: String,
- clearTrigger: N('focus'),
- formatTrigger: N('onChange'),
- error: { type: Boolean, default: null },
- disabled: { type: Boolean, default: null },
- readonly: { type: Boolean, default: null }
- },
- zn = d({}, bn, An, {
- rows: g,
- type: N('text'),
- rules: Array,
- autosize: [Boolean, Object],
- labelWidth: g,
- labelClass: h,
- labelAlign: String,
- showWordLimit: Boolean,
- errorMessageAlign: String,
- colon: { type: Boolean, default: null }
- })
- const En = We(
- t.defineComponent({
- name: On,
- props: zn,
- emits: [
- 'blur',
- 'focus',
- 'clear',
- 'keypress',
- 'clickInput',
- 'endValidate',
- 'startValidate',
- 'clickLeftIcon',
- 'clickRightIcon',
- 'update:modelValue'
- ],
- setup(e, { emit: n, slots: l }) {
- const i = yo(),
- s = t.reactive({ status: 'unvalidated', focused: !1, validateMessage: '' }),
- c = t.ref(),
- d = t.ref(),
- u = t.ref(),
- { parent: p } = D(He),
- m = () => {
- var t
- return String(null != (t = e.modelValue) ? t : '')
- },
- f = (t) => (o(e[t]) ? e[t] : p && o(p.props[t]) ? p.props[t] : void 0),
- h = t.computed(() => {
- const t = f('readonly')
- if (e.clearable && !t) {
- const t = '' !== m(),
- o = 'always' === e.clearTrigger || ('focus' === e.clearTrigger && s.focused)
- return t && o
- }
- return !1
- }),
- g = t.computed(() => (u.value && l.input ? u.value() : e.modelValue)),
- b = (e) =>
- e.reduce(
- (e, t) =>
- e.then(() => {
- if ('failed' === s.status) return
- let { value: e } = g
- if (
- (t.formatter && (e = t.formatter(e, t)),
- !(function (e, t) {
- if (Cn(e)) {
- if (t.required) return !1
- if (!1 === t.validateEmpty) return !0
- }
- return !(t.pattern && !t.pattern.test(String(e)))
- })(e, t))
- )
- return (s.status = 'failed'), void (s.validateMessage = Sn(e, t))
- if (t.validator) {
- if (Cn(e) && !1 === t.validateEmpty) return
- return (function (e, t) {
- return new Promise((o) => {
- const n = t.validator(e, t)
- r(n) ? n.then(o) : o(n)
- })
- })(e, t).then((o) => {
- o && 'string' == typeof o
- ? ((s.status = 'failed'), (s.validateMessage = o))
- : !1 === o && ((s.status = 'failed'), (s.validateMessage = Sn(e, t)))
- })
- }
- }),
- Promise.resolve()
- ),
- y = () => {
- ;(s.status = 'unvalidated'), (s.validateMessage = '')
- },
- w = () => n('endValidate', { status: s.status, message: s.validateMessage }),
- x = (t = e.rules) =>
- new Promise((o) => {
- y(),
- t
- ? (n('startValidate'),
- b(t).then(() => {
- 'failed' === s.status
- ? (o({ name: e.name, message: s.validateMessage }), w())
- : ((s.status = 'passed'), o(), w())
- }))
- : o()
- }),
- V = (t) => {
- if (p && e.rules) {
- const { validateTrigger: o } = p.props,
- n = v(o).includes(t),
- a = e.rules.filter((e) => (e.trigger ? v(e.trigger).includes(t) : n))
- a.length && x(a)
- }
- },
- N = (t, a = 'onChange') => {
- const r = t
- t = ((t) => {
- var n
- const { maxlength: a } = e
- if (o(a) && Pn(t) > +a) {
- const e = m()
- if (e && Pn(e) === +a) return e
- const o = null == (n = c.value) ? void 0 : n.selectionEnd
- if (s.focused && o) {
- const e = [...t],
- n = e.length - +a
- return e.splice(o - n, n), e.join('')
- }
- return Dn(t, +a)
- }
- return t
- })(t)
- const l = Pn(r) - Pn(t)
- if ('number' === e.type || 'digit' === e.type) {
- const o = 'number' === e.type
- t = xe(t, o, o)
- }
- let i = 0
- if (e.formatter && a === e.formatTrigger) {
- const { formatter: n, maxlength: a } = e
- if (((t = n(t)), o(a) && Pn(t) > +a && (t = Dn(t, +a)), c.value && s.focused)) {
- const { selectionEnd: e } = c.value,
- t = Dn(r, e)
- i = Pn(n(t)) - Pn(t)
- }
- }
- if (c.value && c.value.value !== t)
- if (s.focused) {
- let { selectionStart: e, selectionEnd: n } = c.value
- if (((c.value.value = t), o(e) && o(n))) {
- const o = Pn(t)
- l ? ((e -= l), (n -= l)) : i && ((e += i), (n += i)),
- c.value.setSelectionRange(Math.min(e, o), Math.min(n, o))
- }
- } else c.value.value = t
- t !== e.modelValue && n('update:modelValue', t)
- },
- k = (e) => {
- e.target.composing || N(e.target.value)
- },
- C = () => {
- var e
- return null == (e = c.value) ? void 0 : e.blur()
- },
- S = () => {
- var e
- return null == (e = c.value) ? void 0 : e.focus()
- },
- T = () => {
- const t = c.value
- 'textarea' === e.type &&
- e.autosize &&
- t &&
- (function (e, t) {
- const o = ee()
- e.style.height = 'auto'
- let n = e.scrollHeight
- if (a(t)) {
- const { maxHeight: e, minHeight: o } = t
- void 0 !== e && (n = Math.min(n, e)), void 0 !== o && (n = Math.max(n, o))
- }
- n && ((e.style.height = `${n}px`), te(o))
- })(t, e.autosize)
- },
- B = (e) => {
- ;(s.focused = !0), n('focus', e), t.nextTick(T), f('readonly') && C()
- },
- P = (e) => {
- ;(s.focused = !1),
- N(m(), 'onBlur'),
- n('blur', e),
- f('readonly') || (V('onBlur'), t.nextTick(T), ae())
- },
- O = (e) => n('clickInput', e),
- I = (e) => n('clickLeftIcon', e),
- A = (e) => n('clickRightIcon', e),
- z = t.computed(() =>
- 'boolean' == typeof e.error
- ? e.error
- : !(!p || !p.props.showError || 'failed' !== s.status) || void 0
- ),
- E = t.computed(() => {
- const e = f('labelWidth'),
- t = f('labelAlign')
- if (e && 'top' !== t) return { width: de(e) }
- }),
- L = (t) => {
- if (13 === t.keyCode) {
- ;(p && p.props.submitOnEnter) || 'textarea' === e.type || le(t),
- 'search' === e.type && C()
- }
- n('keypress', t)
- },
- $ = () => e.id || `${i}-input`,
- M = () => {
- const o = In('control', [
- f('inputAlign'),
- {
- error: z.value,
- custom: !!l.input,
- 'min-height': 'textarea' === e.type && !e.autosize
- }
- ])
- if (l.input) return t.createVNode('div', { class: o, onClick: O }, [l.input()])
- const n = {
- id: $(),
- ref: c,
- name: e.name,
- rows: void 0 !== e.rows ? +e.rows : void 0,
- class: o,
- disabled: f('disabled'),
- readonly: f('readonly'),
- autofocus: e.autofocus,
- placeholder: e.placeholder,
- autocomplete: e.autocomplete,
- enterkeyhint: e.enterkeyhint,
- 'aria-labelledby': e.label ? `${i}-label` : void 0,
- onBlur: P,
- onFocus: B,
- onInput: k,
- onClick: O,
- onChange: Bn,
- onKeypress: L,
- onCompositionend: Bn,
- onCompositionstart: Tn
- }
- return 'textarea' === e.type
- ? t.createVNode('textarea', n, null)
- : t.createVNode(
- 'input',
- t.mergeProps(
- 'number' === (a = e.type)
- ? { type: 'text', inputmode: 'decimal' }
- : 'digit' === a
- ? { type: 'tel', inputmode: 'numeric' }
- : { type: a },
- n
- ),
- null
- )
- var a
- },
- R = () => {
- const o = l['right-icon']
- if (e.rightIcon || o)
- return t.createVNode('div', { class: In('right-icon'), onClick: A }, [
- o ? o() : t.createVNode(ht, { name: e.rightIcon, classPrefix: e.iconPrefix }, null)
- ])
- },
- F = () => {
- if (e.showWordLimit && e.maxlength) {
- const o = Pn(m())
- return t.createVNode('div', { class: In('word-limit') }, [
- t.createVNode('span', { class: In('word-num') }, [o]),
- t.createTextVNode('/'),
- e.maxlength
- ])
- }
- },
- H = () => {
- if (p && !1 === p.props.showErrorMessage) return
- const o = e.errorMessage || s.validateMessage
- if (o) {
- const e = l['error-message'],
- n = f('errorMessageAlign')
- return t.createVNode('div', { class: In('error-message', n) }, [
- e ? e({ message: o }) : o
- ])
- }
- },
- W = () => [
- t.createVNode('div', { class: In('body') }, [
- M(),
- h.value && t.createVNode(ht, { ref: d, name: e.clearIcon, class: In('clear') }, null),
- R(),
- l.button && t.createVNode('div', { class: In('button') }, [l.button()])
- ]),
- F(),
- H()
- ]
- return (
- Qe({
- blur: C,
- focus: S,
- validate: x,
- formValue: g,
- resetValidation: y,
- getValidationStatus: () => s.status
- }),
- t.provide(K, { customValue: u, resetValidation: y, validateWithTrigger: V }),
- t.watch(
- () => e.modelValue,
- () => {
- N(m()), y(), V('onChange'), t.nextTick(T)
- }
- ),
- t.onMounted(() => {
- N(m(), e.formatTrigger), t.nextTick(T)
- }),
- j(
- 'touchstart',
- (e) => {
- le(e), n('update:modelValue', ''), n('clear', e)
- },
- {
- target: t.computed(() => {
- var e
- return null == (e = d.value) ? void 0 : e.$el
- })
- }
- ),
- () => {
- const o = f('disabled'),
- n = f('labelAlign'),
- a = (() => {
- const o = l['left-icon']
- if (e.leftIcon || o)
- return t.createVNode('div', { class: In('left-icon'), onClick: I }, [
- o
- ? o()
- : t.createVNode(ht, { name: e.leftIcon, classPrefix: e.iconPrefix }, null)
- ])
- })()
- return t.createVNode(
- wn,
- {
- size: e.size,
- class: In({ error: z.value, disabled: o, [`label-${n}`]: n }),
- center: e.center,
- border: e.border,
- isLink: e.isLink,
- clickable: e.clickable,
- titleStyle: E.value,
- valueClass: In('value'),
- titleClass: [In('label', [n, { required: e.required }]), e.labelClass],
- arrowDirection: e.arrowDirection
- },
- {
- icon: a && 'top' !== n ? () => a : null,
- title: () => {
- const o = (() => {
- const o = f('labelWidth'),
- n = f('labelAlign'),
- a = f('colon') ? ':' : ''
- return l.label
- ? [l.label(), a]
- : e.label
- ? t.createVNode(
- 'label',
- {
- id: `${i}-label`,
- for: $(),
- onClick: (e) => {
- le(e), S()
- },
- style: 'top' === n && o ? { width: de(o) } : void 0
- },
- [e.label + a]
- )
- : void 0
- })()
- return 'top' === n ? [a, o].filter(Boolean) : o || []
- },
- value: W,
- extra: l.extra
- }
- )
- }
- )
- }
- })
- )
- let Ln = 0
- const [$n, Mn] = Ie('toast'),
- Rn = [
- 'show',
- 'overlay',
- 'teleport',
- 'transition',
- 'overlayClass',
- 'overlayStyle',
- 'closeOnClickOverlay'
- ],
- Fn = {
- icon: String,
- show: Boolean,
- type: N('text'),
- overlay: Boolean,
- message: g,
- iconSize: g,
- duration: x(2e3),
- position: N('middle'),
- teleport: [String, Object],
- wordBreak: String,
- className: h,
- iconPrefix: String,
- transition: N('van-fade'),
- loadingType: String,
- forbidClick: Boolean,
- overlayClass: h,
- overlayStyle: Object,
- closeOnClick: Boolean,
- closeOnClickOverlay: Boolean
- }
- var Hn = t.defineComponent({
- name: $n,
- props: Fn,
- emits: ['update:show'],
- setup(e, { emit: n, slots: a }) {
- let r,
- l = !1
- const i = () => {
- const t = e.show && e.forbidClick
- l !== t &&
- ((l = t),
- l
- ? (Ln || document.body.classList.add('van-toast--unclickable'), Ln++)
- : Ln && (Ln--, Ln || document.body.classList.remove('van-toast--unclickable')))
- },
- s = (e) => n('update:show', e),
- c = () => {
- e.closeOnClick && s(!1)
- },
- d = () => clearTimeout(r),
- u = () => {
- const { icon: o, type: n, iconSize: a, iconPrefix: r, loadingType: l } = e
- return o || 'success' === n || 'fail' === n
- ? t.createVNode(ht, { name: o || n, size: a, class: Mn('icon'), classPrefix: r }, null)
- : 'loading' === n
- ? t.createVNode(Vt, { class: Mn('loading'), size: a, type: l }, null)
- : void 0
- },
- p = () => {
- const { type: n, message: r } = e
- return a.message
- ? t.createVNode('div', { class: Mn('text') }, [a.message()])
- : o(r) && '' !== r
- ? 'html' === n
- ? t.createVNode('div', { key: 0, class: Mn('text'), innerHTML: String(r) }, null)
- : t.createVNode('div', { class: Mn('text') }, [r])
- : void 0
- }
- return (
- t.watch(() => [e.show, e.forbidClick], i),
- t.watch(
- () => [e.show, e.type, e.message, e.duration],
- () => {
- d(),
- e.show &&
- e.duration > 0 &&
- (r = setTimeout(() => {
- s(!1)
- }, e.duration))
- }
- ),
- t.onMounted(i),
- t.onUnmounted(i),
- () =>
- t.createVNode(
- Gt,
- t.mergeProps(
- {
- class: [
- Mn([
- e.position,
- 'normal' === e.wordBreak ? 'break-normal' : e.wordBreak,
- { [e.type]: !e.icon }
- ]),
- e.className
- ],
- lockScroll: !1,
- onClick: c,
- onClosed: d,
- 'onUpdate:show': s
- },
- m(e, Rn)
- ),
- { default: () => [u(), p()] }
- )
- )
- }
- })
- function jn() {
- const e = t.reactive({ show: !1 }),
- o = (t) => {
- e.show = t
- },
- n = (t) => {
- d(e, t, { transitionAppear: !0 }), o(!0)
- },
- a = () => o(!1)
- return Qe({ open: n, close: a, toggle: o }), { open: n, close: a, state: e, toggle: o }
- }
- function Wn(e) {
- const o = t.createApp(e),
- n = document.createElement('div')
- return (
- document.body.appendChild(n),
- {
- instance: o.mount(n),
- unmount() {
- o.unmount(), document.body.removeChild(n)
- }
- }
- )
- }
- const Un = {
- icon: '',
- type: 'text',
- message: '',
- className: '',
- overlay: !1,
- onClose: void 0,
- onOpened: void 0,
- duration: 2e3,
- teleport: 'body',
- iconSize: void 0,
- iconPrefix: void 0,
- position: 'middle',
- transition: 'van-fade',
- forbidClick: !1,
- loadingType: void 0,
- overlayClass: '',
- overlayStyle: void 0,
- closeOnClick: !1,
- closeOnClickOverlay: !1
- }
- let Yn = [],
- qn = !1,
- Xn = d({}, Un)
- const Gn = new Map()
- function Zn(e) {
- return a(e) ? e : { message: e }
- }
- function Kn() {
- if (!Yn.length || qn) {
- const e = (function () {
- const { instance: e, unmount: o } = Wn({
- setup() {
- const n = t.ref(''),
- { open: a, state: r, close: l, toggle: i } = jn(),
- s = () => {
- qn && ((Yn = Yn.filter((t) => t !== e)), o())
- }
- return (
- t.watch(n, (e) => {
- r.message = e
- }),
- (t.getCurrentInstance().render = () => {
- const e = { onClosed: s, 'onUpdate:show': i }
- return t.createVNode(Hn, t.mergeProps(r, e), null)
- }),
- { open: a, close: l, message: n }
- )
- }
- })
- return e
- })()
- Yn.push(e)
- }
- return Yn[Yn.length - 1]
- }
- function _n(e = {}) {
- if (!u) return {}
- const t = Kn(),
- o = Zn(e)
- return t.open(d({}, Xn, Gn.get(o.type || Xn.type), o)), t
- }
- const Jn = (e) => (t) => _n(d({ type: e }, Zn(t))),
- Qn = Jn('loading'),
- ea = Jn('success'),
- ta = Jn('fail')
- const oa = We(Hn),
- [na, aa] = Ie('switch'),
- ra = {
- size: g,
- loading: Boolean,
- disabled: Boolean,
- modelValue: h,
- activeColor: String,
- inactiveColor: String,
- activeValue: { type: h, default: !0 },
- inactiveValue: { type: h, default: !1 }
- }
- const la = We(
- t.defineComponent({
- name: na,
- props: ra,
- emits: ['change', 'update:modelValue'],
- setup(e, { emit: o, slots: n }) {
- const a = () => e.modelValue === e.activeValue,
- r = () => {
- if (!e.disabled && !e.loading) {
- const t = a() ? e.inactiveValue : e.activeValue
- o('update:modelValue', t), o('change', t)
- }
- },
- l = () => {
- if (e.loading) {
- const o = a() ? e.activeColor : e.inactiveColor
- return t.createVNode(Vt, { class: aa('loading'), color: o }, null)
- }
- if (n.node) return n.node()
- }
- return (
- _(() => e.modelValue),
- () => {
- var o
- const { size: i, loading: s, disabled: c, activeColor: d, inactiveColor: u } = e,
- p = a(),
- m = { fontSize: de(i), backgroundColor: p ? d : u }
- return t.createVNode(
- 'div',
- {
- role: 'switch',
- class: aa({ on: p, loading: s, disabled: c }),
- style: m,
- tabindex: c ? void 0 : 0,
- 'aria-checked': p,
- onClick: r
- },
- [
- t.createVNode('div', { class: aa('node') }, [l()]),
- null == (o = n.background) ? void 0 : o.call(n)
- ]
- )
- }
- )
- }
- })
- ),
- [ia, sa] = Ie('address-edit-detail'),
- ca = Ie('address-edit')[2]
- var da = t.defineComponent({
- name: ia,
- props: {
- show: Boolean,
- rows: g,
- value: String,
- rules: Array,
- focused: Boolean,
- maxlength: g,
- searchResult: Array,
- showSearchResult: Boolean
- },
- emits: ['blur', 'focus', 'input', 'selectSearch'],
- setup(e, { emit: o }) {
- const n = t.ref(),
- a = () => e.focused && e.searchResult && e.showSearchResult,
- r = () => {
- if (!a()) return
- const { searchResult: n } = e
- return n.map((e) =>
- t.createVNode(
- wn,
- {
- clickable: !0,
- key: (e.name || '') + (e.address || ''),
- icon: 'location-o',
- title: e.name,
- label: e.address,
- class: sa('search-item'),
- border: !1,
- onClick: () =>
- ((e) => {
- o('selectSearch', e), o('input', `${e.address || ''} ${e.name || ''}`.trim())
- })(e)
- },
- null
- )
- )
- },
- l = (e) => o('blur', e),
- i = (e) => o('focus', e),
- s = (e) => o('input', e)
- return () => {
- if (e.show)
- return t.createVNode(t.Fragment, null, [
- t.createVNode(
- En,
- {
- autosize: !0,
- clearable: !0,
- ref: n,
- class: sa(),
- rows: e.rows,
- type: 'textarea',
- rules: e.rules,
- label: ca('addressDetail'),
- border: !a(),
- maxlength: e.maxlength,
- modelValue: e.value,
- placeholder: ca('addressDetail'),
- onBlur: l,
- onFocus: i,
- 'onUpdate:modelValue': s
- },
- null
- ),
- r()
- ])
- }
- }
- })
- const [ua, pa, ma] = Ie('address-edit'),
- fa = {
- name: '',
- tel: '',
- city: '',
- county: '',
- country: '',
- province: '',
- areaCode: '',
- isDefault: !1,
- addressDetail: ''
- },
- va = {
- areaList: Object,
- isSaving: Boolean,
- isDeleting: Boolean,
- validator: Function,
- showArea: b,
- showDetail: b,
- showDelete: Boolean,
- disableArea: Boolean,
- searchResult: Array,
- telMaxlength: g,
- showSetDefault: Boolean,
- saveButtonText: String,
- areaPlaceholder: String,
- deleteButtonText: String,
- showSearchResult: Boolean,
- detailRows: V(1),
- detailMaxlength: V(200),
- areaColumnsPlaceholder: w(),
- addressInfo: { type: Object, default: () => d({}, fa) },
- telValidator: { type: Function, default: i }
- }
- const ha = We(
- t.defineComponent({
- name: ua,
- props: va,
- emits: [
- 'save',
- 'focus',
- 'delete',
- 'clickArea',
- 'changeArea',
- 'changeDetail',
- 'selectSearch',
- 'changeDefault'
- ],
- setup(e, { emit: o, slots: n }) {
- const r = t.ref(),
- l = t.reactive({}),
- i = t.ref(!1),
- s = t.ref(!1),
- c = t.computed(() => a(e.areaList) && Object.keys(e.areaList).length),
- u = t.computed(() => {
- const { province: e, city: t, county: o, areaCode: n } = l
- if (n) {
- const n = [e, t, o]
- return e && e === t && n.splice(1, 1), n.filter(Boolean).join('/')
- }
- return ''
- }),
- p = t.computed(() => {
- var t
- return (null == (t = e.searchResult) ? void 0 : t.length) && s.value
- }),
- m = (e) => {
- ;(s.value = 'addressDetail' === e), o('focus', e)
- },
- f = t.computed(() => {
- const { validator: t, telValidator: o } = e,
- n = (e, o) => ({
- validator: (n) => {
- if (t) {
- const o = t(e, n)
- if (o) return o
- }
- return !!n || o
- }
- })
- return {
- name: [n('name', ma('nameEmpty'))],
- tel: [n('tel', ma('telInvalid')), { validator: o, message: ma('telInvalid') }],
- areaCode: [n('areaCode', ma('areaEmpty'))],
- addressDetail: [n('addressDetail', ma('addressEmpty'))]
- }
- }),
- v = () => o('save', l),
- h = (e) => {
- ;(l.addressDetail = e), o('changeDetail', e)
- },
- g = (e) => {
- ;(l.province = e[0].text), (l.city = e[1].text), (l.county = e[2].text)
- },
- b = ({ selectedValues: e, selectedOptions: t }) => {
- e.some((e) => e === rn)
- ? _n(ma('areaEmpty'))
- : ((i.value = !1), g(t), o('changeArea', t))
- },
- y = () => o('delete', l),
- w = () => {
- setTimeout(() => {
- s.value = !1
- })
- },
- x = () => {
- if (e.showSetDefault) {
- const e = {
- 'right-icon': () =>
- t.createVNode(
- la,
- {
- modelValue: l.isDefault,
- 'onUpdate:modelValue': (e) => (l.isDefault = e),
- onChange: (e) => o('changeDefault', e)
- },
- null
- )
- }
- return t.withDirectives(
- t.createVNode(
- wn,
- { center: !0, border: !1, title: ma('defaultAddress'), class: pa('default') },
- e
- ),
- [[t.vShow, !p.value]]
- )
- }
- }
- return (
- Qe({
- setAreaCode: (e) => {
- l.areaCode = e || ''
- },
- setAddressDetail: (e) => {
- l.addressDetail = e
- }
- }),
- t.watch(
- () => e.addressInfo,
- (e) => {
- d(l, fa, e),
- t.nextTick(() => {
- var e
- const t = null == (e = r.value) ? void 0 : e.getSelectedOptions()
- t && t.every((e) => e && e.value !== rn) && g(t)
- })
- },
- { deep: !0, immediate: !0 }
- ),
- () => {
- const { disableArea: a } = e
- return t.createVNode(
- kn,
- { class: pa(), onSubmit: v },
- {
- default: () => {
- var d
- return [
- t.createVNode('div', { class: pa('fields') }, [
- t.createVNode(
- En,
- {
- modelValue: l.name,
- 'onUpdate:modelValue': (e) => (l.name = e),
- clearable: !0,
- label: ma('name'),
- rules: f.value.name,
- placeholder: ma('name'),
- onFocus: () => m('name')
- },
- null
- ),
- t.createVNode(
- En,
- {
- modelValue: l.tel,
- 'onUpdate:modelValue': (e) => (l.tel = e),
- clearable: !0,
- type: 'tel',
- label: ma('tel'),
- rules: f.value.tel,
- maxlength: e.telMaxlength,
- placeholder: ma('tel'),
- onFocus: () => m('tel')
- },
- null
- ),
- t.withDirectives(
- t.createVNode(
- En,
- {
- readonly: !0,
- label: ma('area'),
- 'is-link': !a,
- modelValue: u.value,
- rules: f.value.areaCode,
- placeholder: e.areaPlaceholder || ma('area'),
- onFocus: () => m('areaCode'),
- onClick: () => {
- o('clickArea'), (i.value = !a)
- }
- },
- null
- ),
- [[t.vShow, e.showArea]]
- ),
- t.createVNode(
- da,
- {
- show: e.showDetail,
- rows: e.detailRows,
- rules: f.value.addressDetail,
- value: l.addressDetail,
- focused: s.value,
- maxlength: e.detailMaxlength,
- searchResult: e.searchResult,
- showSearchResult: e.showSearchResult,
- onBlur: w,
- onFocus: () => m('addressDetail'),
- onInput: h,
- onSelectSearch: (e) => o('selectSearch', e)
- },
- null
- ),
- null == (d = n.default) ? void 0 : d.call(n)
- ]),
- x(),
- t.withDirectives(
- t.createVNode('div', { class: pa('buttons') }, [
- t.createVNode(
- St,
- {
- block: !0,
- round: !0,
- type: 'primary',
- text: e.saveButtonText || ma('save'),
- class: pa('button'),
- loading: e.isSaving,
- nativeType: 'submit'
- },
- null
- ),
- e.showDelete &&
- t.createVNode(
- St,
- {
- block: !0,
- round: !0,
- class: pa('button'),
- loading: e.isDeleting,
- text: e.deleteButtonText || ma('delete'),
- onClick: y
- },
- null
- )
- ]),
- [[t.vShow, !p.value]]
- ),
- t.createVNode(
- Gt,
- {
- show: i.value,
- 'onUpdate:show': (e) => (i.value = e),
- round: !0,
- teleport: 'body',
- position: 'bottom',
- lazyRender: !1
- },
- {
- default: () => [
- t.createVNode(
- vn,
- {
- modelValue: l.areaCode,
- 'onUpdate:modelValue': (e) => (l.areaCode = e),
- ref: r,
- loading: !c.value,
- areaList: e.areaList,
- columnsPlaceholder: e.areaColumnsPlaceholder,
- onConfirm: b,
- onCancel: () => {
- i.value = !1
- }
- },
- null
- )
- ]
- }
- )
- ]
- }
- }
- )
- }
- )
- }
- })
- ),
- [ga, ba] = Ie('radio-group'),
- ya = { disabled: Boolean, iconSize: g, direction: String, modelValue: h, checkedColor: String },
- wa = Symbol(ga)
- const xa = We(
- t.defineComponent({
- name: ga,
- props: ya,
- emits: ['change', 'update:modelValue'],
- setup(e, { emit: o, slots: n }) {
- const { linkChildren: a } = A(wa)
- return (
- t.watch(
- () => e.modelValue,
- (e) => o('change', e)
- ),
- a({ props: e, updateValue: (e) => o('update:modelValue', e) }),
- _(() => e.modelValue),
- () => {
- var o
- return t.createVNode('div', { class: ba([e.direction]), role: 'radiogroup' }, [
- null == (o = n.default) ? void 0 : o.call(n)
- ])
- }
- )
- }
- })
- ),
- [Va, Na] = Ie('tag'),
- ka = {
- size: String,
- mark: Boolean,
- show: b,
- type: N('default'),
- color: String,
- plain: Boolean,
- round: Boolean,
- textColor: String,
- closeable: Boolean
- }
- const Ca = We(
- t.defineComponent({
- name: Va,
- props: ka,
- emits: ['close'],
- setup(e, { slots: o, emit: n }) {
- const a = (e) => {
- e.stopPropagation(), n('close', e)
- },
- r = () => {
- var n
- const { type: r, mark: l, plain: i, round: s, size: c, closeable: d } = e,
- u = { mark: l, plain: i, round: s }
- c && (u[c] = c)
- const p =
- d &&
- t.createVNode(ht, { name: 'cross', class: [Na('close'), Fe], onClick: a }, null)
- return t.createVNode(
- 'span',
- {
- style: e.plain
- ? { color: e.textColor || e.color, borderColor: e.color }
- : { color: e.textColor, background: e.color },
- class: Na([u, r])
- },
- [null == (n = o.default) ? void 0 : n.call(o), p]
- )
- }
- return () =>
- t.createVNode(
- t.Transition,
- { name: e.closeable ? 'van-fade' : void 0 },
- { default: () => [e.show ? r() : null] }
- )
- }
- })
- ),
- Sa = {
- name: h,
- shape: N('round'),
- disabled: Boolean,
- iconSize: g,
- modelValue: h,
- checkedColor: String,
- labelPosition: String,
- labelDisabled: Boolean
- }
- var Ta = t.defineComponent({
- props: d({}, Sa, {
- bem: y(Function),
- role: String,
- parent: Object,
- checked: Boolean,
- bindGroup: b
- }),
- emits: ['click', 'toggle'],
- setup(e, { emit: o, slots: n }) {
- const a = t.ref(),
- r = (t) => {
- if (e.parent && e.bindGroup) return e.parent.props[t]
- },
- l = t.computed(() => {
- if (e.parent && e.bindGroup) {
- const t = r('disabled') || e.disabled
- if ('checkbox' === e.role) {
- const o = r('modelValue').length,
- n = r('max')
- return t || (n && o >= +n && !e.checked)
- }
- return t
- }
- return e.disabled
- }),
- i = t.computed(() => r('direction')),
- s = t.computed(() => {
- const t = e.checkedColor || r('checkedColor')
- if (t && e.checked && !l.value) return { borderColor: t, backgroundColor: t }
- }),
- c = (t) => {
- const { target: n } = t,
- r = a.value,
- i = r === n || (null == r ? void 0 : r.contains(n))
- l.value || (!i && e.labelDisabled) || o('toggle'), o('click', t)
- },
- d = () => {
- const { bem: o, shape: i, checked: c } = e,
- d = e.iconSize || r('iconSize')
- return t.createVNode(
- 'div',
- {
- ref: a,
- class: o('icon', [i, { disabled: l.value, checked: c }]),
- style: { fontSize: de(d) }
- },
- [
- n.icon
- ? n.icon({ checked: c, disabled: l.value })
- : t.createVNode(ht, { name: 'success', style: s.value }, null)
- ]
- )
- },
- u = () => {
- if (n.default)
- return t.createVNode(
- 'span',
- { class: e.bem('label', [e.labelPosition, { disabled: l.value }]) },
- [n.default()]
- )
- }
- return () => {
- const o = 'left' === e.labelPosition ? [u(), d()] : [d(), u()]
- return t.createVNode(
- 'div',
- {
- role: e.role,
- class: e.bem([{ disabled: l.value, 'label-disabled': e.labelDisabled }, i.value]),
- tabindex: l.value ? void 0 : 0,
- 'aria-checked': e.checked,
- onClick: c
- },
- [o]
- )
- }
- }
- })
- const Ba = Sa,
- [Pa, Da] = Ie('radio')
- const Oa = We(
- t.defineComponent({
- name: Pa,
- props: Sa,
- emits: ['update:modelValue'],
- setup(e, { emit: o, slots: n }) {
- const { parent: a } = D(wa),
- r = () => {
- a ? a.updateValue(e.name) : o('update:modelValue', e.name)
- }
- return () =>
- t.createVNode(
- Ta,
- t.mergeProps(
- {
- bem: Da,
- role: 'radio',
- parent: a,
- checked: (a ? a.props.modelValue : e.modelValue) === e.name,
- onToggle: r
- },
- e
- ),
- m(n, ['default', 'icon'])
- )
- }
- })
- ),
- [Ia, Aa] = Ie('address-item')
- var za = t.defineComponent({
- name: Ia,
- props: { address: y(Object), disabled: Boolean, switchable: Boolean, defaultTagText: String },
- emits: ['edit', 'click', 'select'],
- setup(e, { slots: o, emit: n }) {
- const a = () => {
- e.switchable && n('select'), n('click')
- },
- r = () =>
- t.createVNode(
- ht,
- {
- name: 'edit',
- class: Aa('edit'),
- onClick: (e) => {
- e.stopPropagation(), n('edit'), n('click')
- }
- },
- null
- ),
- l = () => {
- const { address: n, disabled: a, switchable: r } = e,
- l = [
- t.createVNode('div', { class: Aa('name') }, [
- `${n.name} ${n.tel}`,
- o.tag
- ? o.tag(e.address)
- : e.address.isDefault && e.defaultTagText
- ? t.createVNode(
- Ca,
- { type: 'primary', round: !0, class: Aa('tag') },
- { default: () => [e.defaultTagText] }
- )
- : void 0
- ]),
- t.createVNode('div', { class: Aa('address') }, [n.address])
- ]
- return r && !a
- ? t.createVNode(Oa, { name: n.id, iconSize: 18 }, { default: () => [l] })
- : l
- }
- return () => {
- var n
- const { disabled: i } = e
- return t.createVNode('div', { class: Aa({ disabled: i }), onClick: a }, [
- t.createVNode(wn, { border: !1, titleClass: Aa('title') }, { title: l, 'right-icon': r }),
- null == (n = o.bottom) ? void 0 : n.call(o, d({}, e.address, { disabled: i }))
- ])
- }
- }
- })
- const [Ea, La, $a] = Ie('address-list'),
- Ma = {
- list: w(),
- modelValue: g,
- switchable: b,
- disabledText: String,
- disabledList: w(),
- addButtonText: String,
- defaultTagText: String
- }
- const Ra = We(
- t.defineComponent({
- name: Ea,
- props: Ma,
- emits: [
- 'add',
- 'edit',
- 'select',
- 'clickItem',
- 'editDisabled',
- 'selectDisabled',
- 'update:modelValue'
- ],
- setup(e, { slots: o, emit: n }) {
- const a = (a, r) => {
- if (a)
- return a.map((a, l) =>
- ((a, r, l) =>
- t.createVNode(
- za,
- {
- key: a.id,
- address: a,
- disabled: l,
- switchable: e.switchable,
- defaultTagText: e.defaultTagText,
- onEdit: () => n(l ? 'editDisabled' : 'edit', a, r),
- onClick: () => n('clickItem', a, r),
- onSelect: () => {
- n(l ? 'selectDisabled' : 'select', a, r), l || n('update:modelValue', a.id)
- }
- },
- { bottom: o['item-bottom'], tag: o.tag }
- ))(a, l, r)
- )
- }
- return () => {
- var r, l
- const i = a(e.list),
- s = a(e.disabledList, !0),
- c =
- e.disabledText &&
- t.createVNode('div', { class: La('disabled-text') }, [e.disabledText])
- return t.createVNode('div', { class: La() }, [
- null == (r = o.top) ? void 0 : r.call(o),
- t.createVNode(xa, { modelValue: e.modelValue }, { default: () => [i] }),
- c,
- s,
- null == (l = o.default) ? void 0 : l.call(o),
- t.createVNode('div', { class: [La('bottom'), 'van-safe-area-bottom'] }, [
- t.createVNode(
- St,
- {
- round: !0,
- block: !0,
- type: 'primary',
- text: e.addButtonText || $a('add'),
- class: La('add'),
- onClick: () => n('add')
- },
- null
- )
- ])
- ])
- }
- }
- })
- ),
- Fa =
- k &&
- 'IntersectionObserver' in window &&
- 'IntersectionObserverEntry' in window &&
- 'intersectionRatio' in window.IntersectionObserverEntry.prototype,
- Ha = 'event',
- ja = 'observer'
- function Wa(e, t) {
- if (!e.length) return
- const o = e.indexOf(t)
- return o > -1 ? e.splice(o, 1) : void 0
- }
- function Ua(e, t) {
- if ('IMG' !== e.tagName || !e.getAttribute('data-srcset')) return
- let o = e.getAttribute('data-srcset')
- const n = e.parentNode.offsetWidth * t
- let a, r, l
- o = o.trim().split(',')
- const i = o.map(
- (e) => (
- (e = e.trim()),
- (a = e.lastIndexOf(' ')),
- -1 === a
- ? ((r = e), (l = 999998))
- : ((r = e.substr(0, a)), (l = parseInt(e.substr(a + 1, e.length - a - 2), 10))),
- [l, r]
- )
- )
- i.sort((e, t) => {
- if (e[0] < t[0]) return 1
- if (e[0] > t[0]) return -1
- if (e[0] === t[0]) {
- if (-1 !== t[1].indexOf('.webp', t[1].length - 5)) return 1
- if (-1 !== e[1].indexOf('.webp', e[1].length - 5)) return -1
- }
- return 0
- })
- let s,
- c = ''
- for (let d = 0; d < i.length; d++) {
- ;(s = i[d]), (c = s[1])
- const e = i[d + 1]
- if (e && e[0] < n) {
- c = s[1]
- break
- }
- if (!e) {
- c = s[1]
- break
- }
- }
- return c
- }
- const Ya = (e = 1) => (k && window.devicePixelRatio) || e
- function qa() {
- if (!k) return !1
- let e = !0
- try {
- const t = document.createElement('canvas')
- t.getContext &&
- t.getContext('2d') &&
- (e = 0 === t.toDataURL('image/webp').indexOf('data:image/webp'))
- } catch (t) {
- e = !1
- }
- return e
- }
- function Xa(e, t) {
- let o = null,
- n = 0
- return function (...a) {
- if (o) return
- const r = () => {
- ;(n = Date.now()), (o = !1), e.apply(this, a)
- }
- Date.now() - n >= t ? r() : (o = setTimeout(r, t))
- }
- }
- function Ga(e, t, o) {
- e.addEventListener(t, o, { capture: !1, passive: !0 })
- }
- function Za(e, t, o) {
- e.removeEventListener(t, o, !1)
- }
- const Ka = (e, t, o) => {
- const n = new Image()
- if (!e || !e.src) return o(new Error('image src is required'))
- ;(n.src = e.src),
- e.cors && (n.crossOrigin = e.cors),
- (n.onload = () =>
- t({ naturalHeight: n.naturalHeight, naturalWidth: n.naturalWidth, src: n.src })),
- (n.onerror = (e) => o(e))
- }
- class _a {
- constructor({ max: e }) {
- ;(this.options = { max: e || 100 }), (this.caches = [])
- }
- has(e) {
- return this.caches.indexOf(e) > -1
- }
- add(e) {
- this.has(e) || (this.caches.push(e), this.caches.length > this.options.max && this.free())
- }
- free() {
- this.caches.shift()
- }
- }
- const [Ja, Qa] = Ie('back-top'),
- er = {
- right: g,
- bottom: g,
- zIndex: g,
- target: [String, Object],
- offset: V(200),
- immediate: Boolean,
- teleport: { type: [String, Object], default: 'body' }
- }
- const tr = We(
- t.defineComponent({
- name: Ja,
- inheritAttrs: !1,
- props: er,
- emits: ['click'],
- setup(e, { emit: o, slots: n, attrs: a }) {
- const r = t.ref(!1),
- l = t.ref(),
- i = t.ref(),
- s = t.computed(() => d(pe(e.zIndex), { right: de(e.right), bottom: de(e.bottom) })),
- c = (t) => {
- var n
- o('click', t),
- null == (n = i.value) ||
- n.scrollTo({ top: 0, behavior: e.immediate ? 'auto' : 'smooth' })
- },
- p = () => {
- r.value = !!i.value && J(i.value) >= +e.offset
- },
- m = () => {
- u &&
- t.nextTick(() => {
- ;(i.value = e.target
- ? (() => {
- const { target: t } = e
- if ('string' != typeof t) return t
- {
- const e = document.querySelector(t)
- if (e) return e
- }
- })()
- : G(l.value)),
- p()
- })
- }
- return (
- j('scroll', Xa(p, 100), { target: i }),
- t.onMounted(m),
- t.watch(() => e.target, m),
- () => {
- const o = t.createVNode(
- 'div',
- t.mergeProps(
- {
- ref: e.teleport ? void 0 : l,
- class: Qa({ active: r.value }),
- style: s.value,
- onClick: c
- },
- a
- ),
- [
- n.default
- ? n.default()
- : t.createVNode(ht, { name: 'back-top', class: Qa('icon') }, null)
- ]
- )
- return e.teleport
- ? [
- t.createVNode('div', { ref: l, class: Qa('placeholder') }, null),
- t.createVNode(t.Teleport, { to: e.teleport }, { default: () => [o] })
- ]
- : o
- }
- )
- }
- })
- )
- const or = {
- top: V(10),
- rows: V(4),
- duration: V(4e3),
- autoPlay: b,
- delay: x(300),
- modelValue: w()
- },
- [nr, ar] = Ie('barrage')
- const rr = We(
- t.defineComponent({
- name: nr,
- props: or,
- emits: ['update:modelValue'],
- setup(e, { emit: o, slots: n }) {
- const a = t.ref(),
- r = ar('item'),
- l = t.ref(0),
- i = [],
- s = t.ref(!0),
- c = t.ref(e.autoPlay),
- d = ({ id: t, text: n }, d) => {
- var u
- const p = ((t, o = e.delay) => {
- const n = document.createElement('span')
- return (
- (n.className = r),
- (n.innerText = String(t)),
- (n.style.animationDuration = `${e.duration}ms`),
- (n.style.animationDelay = `${o}ms`),
- (n.style.animationName = 'van-barrage'),
- (n.style.animationTimingFunction = 'linear'),
- n
- )
- })(n, s.value ? d * e.delay : void 0)
- e.autoPlay || !1 !== c.value || (p.style.animationPlayState = 'paused'),
- null == (u = a.value) || u.append(p),
- l.value++
- const m = ((l.value - 1) % +e.rows) * p.offsetHeight + +e.top
- ;(p.style.top = `${m}px`),
- (p.dataset.id = String(t)),
- i.push(p),
- p.addEventListener('animationend', () => {
- o(
- 'update:modelValue',
- [...e.modelValue].filter((e) => String(e.id) !== p.dataset.id)
- )
- })
- },
- u = (e, t) => {
- const o = new Map(t.map((e) => [e.id, e]))
- e.forEach((e, t) => {
- o.has(e.id) ? o.delete(e.id) : d(e, t)
- }),
- o.forEach((e) => {
- const t = i.findIndex((t) => t.dataset.id === String(e.id))
- t > -1 && (i[t].remove(), i.splice(t, 1))
- }),
- (s.value = !1)
- }
- t.watch(
- () => e.modelValue.slice(),
- (e, t) => u(null != e ? e : [], null != t ? t : []),
- { deep: !0 }
- )
- const p = t.ref({})
- t.onMounted(() => {
- return (
- (o = this),
- (n = null),
- (r = function* () {
- var o
- ;(p.value['--move-distance'] = `-${
- null == (o = a.value) ? void 0 : o.offsetWidth
- }px`),
- yield t.nextTick(),
- u(e.modelValue, [])
- }),
- new Promise((e, t) => {
- var a = (e) => {
- try {
- i(r.next(e))
- } catch (o) {
- t(o)
- }
- },
- l = (e) => {
- try {
- i(r.throw(e))
- } catch (o) {
- t(o)
- }
- },
- i = (t) => (t.done ? e(t.value) : Promise.resolve(t.value).then(a, l))
- i((r = r.apply(o, n)).next())
- })
- )
- var o, n, r
- })
- return (
- Qe({
- play: () => {
- ;(c.value = !0),
- i.forEach((e) => {
- e.style.animationPlayState = 'running'
- })
- },
- pause: () => {
- ;(c.value = !1),
- i.forEach((e) => {
- e.style.animationPlayState = 'paused'
- })
- }
- }),
- () => {
- var e
- return t.createVNode('div', { class: ar(), ref: a, style: p.value }, [
- null == (e = n.default) ? void 0 : e.call(n)
- ])
- }
- )
- }
- })
- ),
- [lr, ir, sr] = Ie('calendar')
- function cr(e, t) {
- const o = e.getFullYear(),
- n = t.getFullYear()
- if (o === n) {
- const o = e.getMonth(),
- n = t.getMonth()
- return o === n ? 0 : o > n ? 1 : -1
- }
- return o > n ? 1 : -1
- }
- function dr(e, t) {
- const o = cr(e, t)
- if (0 === o) {
- const o = e.getDate(),
- n = t.getDate()
- return o === n ? 0 : o > n ? 1 : -1
- }
- return o
- }
- const ur = (e) => new Date(e),
- pr = (e) => (Array.isArray(e) ? e.map(ur) : ur(e))
- function mr(e, t) {
- const o = ur(e)
- return o.setDate(o.getDate() + t), o
- }
- const fr = (e) => mr(e, -1),
- vr = (e) => mr(e, 1),
- hr = () => {
- const e = new Date()
- return e.setHours(0, 0, 0, 0), e
- }
- const gr = d({}, on, {
- modelValue: w(),
- filter: Function,
- formatter: { type: Function, default: (e, t) => t }
- }),
- br = Object.keys(on)
- const yr = (e, t) => 32 - new Date(e, t - 1, 32).getDate(),
- wr = (e, t, o, n, a) => {
- const r = (function (e, t) {
- if (e < 0) return []
- const o = Array(e)
- let n = -1
- for (; ++n < e; ) o[n] = t(n)
- return o
- })(t - e + 1, (t) => {
- const a = be(e + t)
- return n(o, { text: a, value: a })
- })
- return a ? a(o, r) : r
- },
- xr = (e, t) =>
- e.map((e, o) => {
- const n = t[o]
- if (n.length) {
- const t = +n[0].value,
- o = +n[n.length - 1].value
- return be(ye(+e, t, o))
- }
- return e
- }),
- [Vr] = Ie('calendar-day')
- var Nr = t.defineComponent({
- name: Vr,
- props: { item: y(Object), color: String, index: Number, offset: x(0), rowHeight: String },
- emits: ['click'],
- setup(e, { emit: o, slots: n }) {
- const a = t.computed(() => {
- var t
- const { item: o, index: n, color: a, offset: r, rowHeight: l } = e,
- i = { height: l }
- if ('placeholder' === o.type) return (i.width = '100%'), i
- if ((0 === n && (i.marginLeft = (100 * r) / 7 + '%'), a))
- switch (o.type) {
- case 'end':
- case 'start':
- case 'start-end':
- case 'multiple-middle':
- case 'multiple-selected':
- i.background = a
- break
- case 'middle':
- i.color = a
- }
- return (
- r + ((null == (t = o.date) ? void 0 : t.getDate()) || 1) > 28 && (i.marginBottom = 0), i
- )
- }),
- r = () => {
- 'disabled' !== e.item.type && o('click', e.item)
- },
- l = () => {
- const { topInfo: o } = e.item
- if (o || n['top-info'])
- return t.createVNode('div', { class: ir('top-info') }, [
- n['top-info'] ? n['top-info'](e.item) : o
- ])
- },
- i = () => {
- const { bottomInfo: o } = e.item
- if (o || n['bottom-info'])
- return t.createVNode('div', { class: ir('bottom-info') }, [
- n['bottom-info'] ? n['bottom-info'](e.item) : o
- ])
- },
- s = () => {
- const { item: o, color: n, rowHeight: a } = e,
- { type: r, text: s } = o,
- c = [l(), s, i()]
- return 'selected' === r
- ? t.createVNode(
- 'div',
- { class: ir('selected-day'), style: { width: a, height: a, background: n } },
- [c]
- )
- : c
- }
- return () => {
- const { type: o, className: n } = e.item
- return 'placeholder' === o
- ? t.createVNode('div', { class: ir('day'), style: a.value }, null)
- : t.createVNode(
- 'div',
- {
- role: 'gridcell',
- style: a.value,
- class: [ir('day', o), n],
- tabindex: 'disabled' === o ? void 0 : -1,
- onClick: r
- },
- [s()]
- )
- }
- }
- })
- const [kr] = Ie('calendar-month'),
- Cr = {
- date: y(Date),
- type: String,
- color: String,
- minDate: y(Date),
- maxDate: y(Date),
- showMark: Boolean,
- rowHeight: g,
- formatter: Function,
- lazyRender: Boolean,
- currentDate: [Date, Array],
- allowSameDay: Boolean,
- showSubtitle: Boolean,
- showMonthTitle: Boolean,
- firstDayOfWeek: Number
- }
- var Sr = t.defineComponent({
- name: kr,
- props: Cr,
- emits: ['click'],
- setup(e, { emit: o, slots: n }) {
- const [a, r] = (function (e = !1) {
- const o = t.ref(e)
- return [
- o,
- (e = !o.value) => {
- o.value = e
- }
- ]
- })(),
- l = t.ref(),
- i = t.ref(),
- s = qe(i),
- c = t.computed(() => {
- return (t = e.date), sr('monthTitle', t.getFullYear(), t.getMonth() + 1)
- var t
- }),
- d = t.computed(() => de(e.rowHeight)),
- u = t.computed(() => {
- const t = e.date.getDay()
- return e.firstDayOfWeek ? (t + 7 - e.firstDayOfWeek) % 7 : t
- }),
- p = t.computed(() => yr(e.date.getFullYear(), e.date.getMonth() + 1)),
- f = t.computed(() => a.value || !e.lazyRender),
- v = (t) => {
- const { type: o, minDate: n, maxDate: a, currentDate: r } = e
- if (dr(t, n) < 0 || dr(t, a) > 0) return 'disabled'
- if (null === r) return ''
- if (Array.isArray(r)) {
- if ('multiple' === o)
- return ((t) => {
- const o = (t) => e.currentDate.some((e) => 0 === dr(e, t))
- if (o(t)) {
- const e = fr(t),
- n = vr(t),
- a = o(e),
- r = o(n)
- return a && r ? 'multiple-middle' : a ? 'end' : r ? 'start' : 'multiple-selected'
- }
- return ''
- })(t)
- if ('range' === o)
- return ((t) => {
- const [o, n] = e.currentDate
- if (!o) return ''
- const a = dr(t, o)
- if (!n) return 0 === a ? 'start' : ''
- const r = dr(t, n)
- return e.allowSameDay && 0 === a && 0 === r
- ? 'start-end'
- : 0 === a
- ? 'start'
- : 0 === r
- ? 'end'
- : a > 0 && r < 0
- ? 'middle'
- : ''
- })(t)
- } else if ('single' === o) return 0 === dr(t, r) ? 'selected' : ''
- return ''
- },
- h = (t) => {
- if ('range' === e.type) {
- if ('start' === t || 'end' === t) return sr(t)
- if ('start-end' === t) return `${sr('start')}/${sr('end')}`
- }
- },
- g = () => {
- if (e.showMonthTitle)
- return t.createVNode('div', { class: ir('month-title') }, [
- n['month-title'] ? n['month-title']({ date: e.date, text: c.value }) : c.value
- ])
- },
- b = () => {
- if (e.showMark && f.value)
- return t.createVNode('div', { class: ir('month-mark') }, [e.date.getMonth() + 1])
- },
- y = t.computed(() => {
- const e = Math.ceil((p.value + u.value) / 7)
- return Array(e).fill({ type: 'placeholder' })
- }),
- w = t.computed(() => {
- const t = [],
- o = e.date.getFullYear(),
- n = e.date.getMonth()
- for (let a = 1; a <= p.value; a++) {
- const r = new Date(o, n, a),
- l = v(r)
- let i = { date: r, type: l, text: a, bottomInfo: h(l) }
- e.formatter && (i = e.formatter(i)), t.push(i)
- }
- return t
- }),
- x = t.computed(() => w.value.filter((e) => 'disabled' === e.type)),
- V = (a, r) =>
- t.createVNode(
- Nr,
- {
- item: a,
- index: r,
- color: e.color,
- offset: u.value,
- rowHeight: d.value,
- onClick: (e) => o('click', e)
- },
- m(n, ['top-info', 'bottom-info'])
- )
- return (
- Qe({
- getTitle: () => c.value,
- getHeight: () => s.value,
- setVisible: r,
- scrollToDate: (e, t) => {
- if (l.value) {
- const o = P(l.value),
- n = y.value.length,
- a = ((Math.ceil((t.getDate() + u.value) / 7) - 1) * o.height) / n
- Q(e, o.top + a + e.scrollTop - P(e).top)
- }
- },
- disabledDays: x
- }),
- () =>
- t.createVNode('div', { class: ir('month'), ref: i }, [
- g(),
- t.createVNode('div', { ref: l, role: 'grid', class: ir('days') }, [
- b(),
- (f.value ? w : y).value.map(V)
- ])
- ])
- )
- }
- })
- const [Tr] = Ie('calendar-header')
- var Br = t.defineComponent({
- name: Tr,
- props: {
- date: Date,
- title: String,
- subtitle: String,
- showTitle: Boolean,
- showSubtitle: Boolean,
- firstDayOfWeek: Number
- },
- emits: ['clickSubtitle'],
- setup(e, { slots: o, emit: n }) {
- const a = () => {
- if (e.showTitle) {
- const n = e.title || sr('title'),
- a = o.title ? o.title() : n
- return t.createVNode('div', { class: ir('header-title') }, [a])
- }
- },
- r = (e) => n('clickSubtitle', e),
- l = () => {
- if (e.showSubtitle) {
- const n = o.subtitle ? o.subtitle({ date: e.date, text: e.subtitle }) : e.subtitle
- return t.createVNode('div', { class: ir('header-subtitle'), onClick: r }, [n])
- }
- },
- i = () => {
- const { firstDayOfWeek: o } = e,
- n = sr('weekdays'),
- a = [...n.slice(o, 7), ...n.slice(0, o)]
- return t.createVNode('div', { class: ir('weekdays') }, [
- a.map((e) => t.createVNode('span', { class: ir('weekday') }, [e]))
- ])
- }
- return () => t.createVNode('div', { class: ir('header') }, [a(), l(), i()])
- }
- })
- const Pr = {
- show: Boolean,
- type: N('single'),
- title: String,
- color: String,
- round: b,
- readonly: Boolean,
- poppable: b,
- maxRange: V(null),
- position: N('bottom'),
- teleport: [String, Object],
- showMark: b,
- showTitle: b,
- formatter: Function,
- rowHeight: g,
- confirmText: String,
- rangePrompt: String,
- lazyRender: b,
- showConfirm: b,
- defaultDate: [Date, Array],
- allowSameDay: Boolean,
- showSubtitle: b,
- closeOnPopstate: b,
- showRangePrompt: b,
- confirmDisabledText: String,
- closeOnClickOverlay: b,
- safeAreaInsetTop: Boolean,
- safeAreaInsetBottom: b,
- minDate: { type: Date, validator: l, default: hr },
- maxDate: {
- type: Date,
- validator: l,
- default: () => {
- const e = hr()
- return new Date(e.getFullYear(), e.getMonth() + 6, e.getDate())
- }
- },
- firstDayOfWeek: { type: g, default: 0, validator: (e) => e >= 0 && e <= 6 }
- }
- const Dr = We(
- t.defineComponent({
- name: lr,
- props: Pr,
- emits: [
- 'select',
- 'confirm',
- 'unselect',
- 'monthShow',
- 'overRange',
- 'update:show',
- 'clickSubtitle'
- ],
- setup(e, { emit: o, slots: n }) {
- const a = (t, o = e.minDate, n = e.maxDate) =>
- -1 === dr(t, o) ? o : 1 === dr(t, n) ? n : t,
- r = (t = e.defaultDate) => {
- const { type: o, minDate: n, maxDate: r, allowSameDay: l } = e
- if (null === t) return t
- const i = hr()
- if ('range' === o) {
- Array.isArray(t) || (t = [])
- return [a(t[0] || i, n, l ? r : fr(r)), a(t[1] || i, l ? n : vr(n))]
- }
- return 'multiple' === o
- ? Array.isArray(t)
- ? t.map((e) => a(e))
- : [a(i)]
- : ((t && !Array.isArray(t)) || (t = i), a(t))
- }
- let i
- const s = t.ref(),
- c = t.ref({ text: '', date: void 0 }),
- d = t.ref(r()),
- [u, p] = wo(),
- f = t.computed(() => (e.firstDayOfWeek ? +e.firstDayOfWeek % 7 : 0)),
- v = t.computed(() => {
- const t = [],
- o = new Date(e.minDate)
- o.setDate(1)
- do {
- t.push(new Date(o)), o.setMonth(o.getMonth() + 1)
- } while (1 !== cr(o, e.maxDate))
- return t
- }),
- h = t.computed(() => {
- if (d.value) {
- if ('range' === e.type) return !d.value[0] || !d.value[1]
- if ('multiple' === e.type) return !d.value.length
- }
- return !d.value
- }),
- g = () => {
- const e = J(s.value),
- t = e + i,
- n = v.value.map((e, t) => u.value[t].getHeight())
- if (t > n.reduce((e, t) => e + t, 0) && e > 0) return
- let a,
- r = 0
- const l = [-1, -1]
- for (let i = 0; i < v.value.length; i++) {
- const s = u.value[i]
- r <= t &&
- r + n[i] >= e &&
- ((l[1] = i),
- a || ((a = s), (l[0] = i)),
- u.value[i].showed ||
- ((u.value[i].showed = !0),
- o('monthShow', { date: s.date, title: s.getTitle() }))),
- (r += n[i])
- }
- v.value.forEach((e, t) => {
- const o = t >= l[0] - 1 && t <= l[1] + 1
- u.value[t].setVisible(o)
- }),
- a && (c.value = { text: a.getTitle(), date: a.date })
- },
- b = (e) => {
- C(() => {
- v.value.some(
- (t, o) => 0 === cr(t, e) && (s.value && u.value[o].scrollToDate(s.value, e), !0)
- ),
- g()
- })
- },
- y = () => {
- if (!e.poppable || e.show)
- if (d.value) {
- const t = 'single' === e.type ? d.value : d.value[0]
- l(t) && b(t)
- } else C(g)
- },
- w = () => {
- ;(e.poppable && !e.show) ||
- (C(() => {
- i = Math.floor(P(s).height)
- }),
- y())
- },
- x = (e = r()) => {
- ;(d.value = e), y()
- },
- V = () => {
- var e
- return o('confirm', null != (e = d.value) ? e : pr(d.value))
- },
- N = (t, n) => {
- const a = (e) => {
- ;(d.value = e), o('select', pr(e))
- }
- if (n && 'range' === e.type) {
- const n = ((t) => {
- const { maxRange: n, rangePrompt: a, showRangePrompt: r } = e
- return !(
- n &&
- (function (e) {
- const t = e[0].getTime()
- return (e[1].getTime() - t) / 864e5 + 1
- })(t) > +n &&
- (r && _n(a || sr('rangePrompt', n)), o('overRange'), 1)
- )
- })(t)
- if (!n) return void a([t[0], mr(t[0], +e.maxRange - 1)])
- }
- a(t), n && !e.showConfirm && V()
- },
- k = t.computed(() =>
- u.value.reduce((e, t) => {
- var o, n
- return (
- e.push(
- ...(null != (n = null == (o = t.disabledDays) ? void 0 : o.value) ? n : [])
- ),
- e
- )
- }, [])
- ),
- S = (t) => {
- if (e.readonly || !t.date) return
- const { date: n } = t,
- { type: a } = e
- if ('range' === a) {
- if (!d.value) return void N([n])
- const [t, o] = d.value
- if (t && !o) {
- const o = dr(n, t)
- if (1 === o) {
- const e = ((e, t, o) => {
- var n
- return null ==
- (n = e.find((e) => -1 === dr(t, e.date) && -1 === dr(e.date, o)))
- ? void 0
- : n.date
- })(k.value, t, n)
- if (e) {
- const o = fr(e)
- ;-1 === dr(t, o) ? N([t, o]) : N([n])
- } else N([t, n], !0)
- } else -1 === o ? N([n]) : e.allowSameDay && N([n, n], !0)
- } else N([n])
- } else if ('multiple' === a) {
- if (!d.value) return void N([n])
- const t = d.value,
- a = t.findIndex((e) => 0 === dr(e, n))
- if (-1 !== a) {
- const [e] = t.splice(a, 1)
- o('unselect', ur(e))
- } else
- e.maxRange && t.length >= +e.maxRange
- ? _n(e.rangePrompt || sr('rangePrompt', e.maxRange))
- : N([...t, n])
- } else N(n, !0)
- },
- T = (e) => o('update:show', e),
- B = (o, a) => {
- const r = 0 !== a || !e.showSubtitle
- return t.createVNode(
- Sr,
- t.mergeProps(
- {
- ref: p(a),
- date: o,
- currentDate: d.value,
- showMonthTitle: r,
- firstDayOfWeek: f.value
- },
- m(e, [
- 'type',
- 'color',
- 'minDate',
- 'maxDate',
- 'showMark',
- 'formatter',
- 'rowHeight',
- 'lazyRender',
- 'showSubtitle',
- 'allowSameDay'
- ]),
- { onClick: S }
- ),
- m(n, ['top-info', 'bottom-info', 'month-title'])
- )
- },
- D = () => {
- if (n.footer) return n.footer()
- if (e.showConfirm) {
- const o = n['confirm-text'],
- a = h.value,
- r = a ? e.confirmDisabledText : e.confirmText
- return t.createVNode(
- St,
- {
- round: !0,
- block: !0,
- type: 'primary',
- color: e.color,
- class: ir('confirm'),
- disabled: a,
- nativeType: 'button',
- onClick: V
- },
- { default: () => [o ? o({ disabled: a }) : r || sr('confirm')] }
- )
- }
- },
- O = () =>
- t.createVNode('div', { class: ir() }, [
- t.createVNode(
- Br,
- {
- date: c.value.date,
- title: e.title,
- subtitle: c.value.text,
- showTitle: e.showTitle,
- showSubtitle: e.showSubtitle,
- firstDayOfWeek: f.value,
- onClickSubtitle: (e) => o('clickSubtitle', e)
- },
- m(n, ['title', 'subtitle'])
- ),
- t.createVNode('div', { ref: s, class: ir('body'), onScroll: g }, [v.value.map(B)]),
- t.createVNode(
- 'div',
- { class: [ir('footer'), { 'van-safe-area-bottom': e.safeAreaInsetBottom }] },
- [D()]
- )
- ])
- return (
- t.watch(() => e.show, w),
- t.watch(
- () => [e.type, e.minDate, e.maxDate],
- () => x(r(d.value))
- ),
- t.watch(
- () => e.defaultDate,
- (e = null) => {
- ;(d.value = e), y()
- }
- ),
- Qe({ reset: x, scrollToDate: b, getSelectedDate: () => d.value }),
- H(w),
- () =>
- e.poppable
- ? t.createVNode(
- Gt,
- {
- show: e.show,
- class: ir('popup'),
- round: e.round,
- position: e.position,
- closeable: e.showTitle || e.showSubtitle,
- teleport: e.teleport,
- closeOnPopstate: e.closeOnPopstate,
- safeAreaInsetTop: e.safeAreaInsetTop,
- closeOnClickOverlay: e.closeOnClickOverlay,
- 'onUpdate:show': T
- },
- { default: O }
- )
- : O()
- )
- }
- })
- ),
- [Or, Ir] = Ie('image'),
- Ar = {
- src: String,
- alt: String,
- fit: String,
- position: String,
- round: Boolean,
- block: Boolean,
- width: g,
- height: g,
- radius: g,
- lazyLoad: Boolean,
- iconSize: g,
- showError: b,
- errorIcon: N('photo-fail'),
- iconPrefix: String,
- showLoading: b,
- loadingIcon: N('photo')
- }
- const zr = We(
- t.defineComponent({
- name: Or,
- props: Ar,
- emits: ['load', 'error'],
- setup(e, { emit: n, slots: a }) {
- const r = t.ref(!1),
- l = t.ref(!0),
- i = t.ref(),
- { $Lazyload: s } = t.getCurrentInstance().proxy,
- c = t.computed(() => {
- const t = { width: de(e.width), height: de(e.height) }
- return o(e.radius) && ((t.overflow = 'hidden'), (t.borderRadius = de(e.radius))), t
- })
- t.watch(
- () => e.src,
- () => {
- ;(r.value = !1), (l.value = !0)
- }
- )
- const d = (e) => {
- l.value && ((l.value = !1), n('load', e))
- },
- p = () => {
- const e = new Event('load')
- Object.defineProperty(e, 'target', { value: i.value, enumerable: !0 }), d(e)
- },
- m = (e) => {
- ;(r.value = !0), (l.value = !1), n('error', e)
- },
- f = (o, n, a) =>
- a
- ? a()
- : t.createVNode(
- ht,
- { name: o, size: e.iconSize, class: n, classPrefix: e.iconPrefix },
- null
- ),
- v = () => {
- if (r.value || !e.src) return
- const o = {
- alt: e.alt,
- class: Ir('img'),
- style: { objectFit: e.fit, objectPosition: e.position }
- }
- return e.lazyLoad
- ? t.withDirectives(t.createVNode('img', t.mergeProps({ ref: i }, o), null), [
- [t.resolveDirective('lazy'), e.src]
- ])
- : t.createVNode(
- 'img',
- t.mergeProps({ ref: i, src: e.src, onLoad: d, onError: m }, o),
- null
- )
- },
- h = ({ el: e }) => {
- const o = () => {
- e === i.value && l.value && p()
- }
- i.value ? o() : t.nextTick(o)
- },
- g = ({ el: e }) => {
- e !== i.value || r.value || m()
- }
- return (
- s &&
- u &&
- (s.$on('loaded', h),
- s.$on('error', g),
- t.onBeforeUnmount(() => {
- s.$off('loaded', h), s.$off('error', g)
- })),
- t.onMounted(() => {
- t.nextTick(() => {
- var t
- ;(null == (t = i.value) ? void 0 : t.complete) && !e.lazyLoad && p()
- })
- }),
- () => {
- var o
- return t.createVNode(
- 'div',
- { class: Ir({ round: e.round, block: e.block }), style: c.value },
- [
- v(),
- l.value && e.showLoading
- ? t.createVNode('div', { class: Ir('loading') }, [
- f(e.loadingIcon, Ir('loading-icon'), a.loading)
- ])
- : r.value && e.showError
- ? t.createVNode('div', { class: Ir('error') }, [
- f(e.errorIcon, Ir('error-icon'), a.error)
- ])
- : void 0,
- null == (o = a.default) ? void 0 : o.call(a)
- ]
- )
- }
- )
- }
- })
- ),
- [Er, Lr] = Ie('card'),
- $r = {
- tag: String,
- num: g,
- desc: String,
- thumb: String,
- title: String,
- price: g,
- centered: Boolean,
- lazyLoad: Boolean,
- currency: N('¥'),
- thumbLink: String,
- originPrice: g
- }
- const Mr = We(
- t.defineComponent({
- name: Er,
- props: $r,
- emits: ['clickThumb'],
- setup(e, { slots: n, emit: a }) {
- const r = () => {
- if (n.tag || e.tag)
- return t.createVNode('div', { class: Lr('tag') }, [
- n.tag
- ? n.tag()
- : t.createVNode(Ca, { mark: !0, type: 'primary' }, { default: () => [e.tag] })
- ])
- },
- l = () => {
- if (n.thumb || e.thumb)
- return t.createVNode(
- 'a',
- { href: e.thumbLink, class: Lr('thumb'), onClick: (e) => a('clickThumb', e) },
- [
- n.thumb
- ? n.thumb()
- : t.createVNode(
- zr,
- {
- src: e.thumb,
- fit: 'cover',
- width: '100%',
- height: '100%',
- lazyLoad: e.lazyLoad
- },
- null
- ),
- r()
- ]
- )
- },
- i = () => {
- const o = e.price.toString().split('.')
- return t.createVNode('div', null, [
- t.createVNode('span', { class: Lr('price-currency') }, [e.currency]),
- t.createVNode('span', { class: Lr('price-integer') }, [o[0]]),
- t.createTextVNode('.'),
- t.createVNode('span', { class: Lr('price-decimal') }, [o[1]])
- ])
- }
- return () => {
- var a, r, s
- const c = n.num || o(e.num),
- d = n.price || o(e.price),
- u = n['origin-price'] || o(e.originPrice),
- p = c || d || u || n.bottom,
- m = d && t.createVNode('div', { class: Lr('price') }, [n.price ? n.price() : i()]),
- f =
- u &&
- t.createVNode('div', { class: Lr('origin-price') }, [
- n['origin-price'] ? n['origin-price']() : `${e.currency} ${e.originPrice}`
- ]),
- v = c && t.createVNode('div', { class: Lr('num') }, [n.num ? n.num() : `x${e.num}`]),
- h = n.footer && t.createVNode('div', { class: Lr('footer') }, [n.footer()]),
- g =
- p &&
- t.createVNode('div', { class: Lr('bottom') }, [
- null == (a = n['price-top']) ? void 0 : a.call(n),
- m,
- f,
- v,
- null == (r = n.bottom) ? void 0 : r.call(n)
- ])
- return t.createVNode('div', { class: Lr() }, [
- t.createVNode('div', { class: Lr('header') }, [
- l(),
- t.createVNode('div', { class: Lr('content', { centered: e.centered }) }, [
- t.createVNode('div', null, [
- n.title
- ? n.title()
- : e.title
- ? t.createVNode('div', { class: [Lr('title'), 'van-multi-ellipsis--l2'] }, [
- e.title
- ])
- : void 0,
- n.desc
- ? n.desc()
- : e.desc
- ? t.createVNode('div', { class: [Lr('desc'), 'van-ellipsis'] }, [e.desc])
- : void 0,
- null == (s = n.tags) ? void 0 : s.call(n)
- ]),
- g
- ])
- ]),
- h
- ])
- }
- }
- })
- ),
- [Rr, Fr, Hr] = Ie('cascader'),
- jr = {
- title: String,
- options: w(),
- closeable: b,
- swipeable: b,
- closeIcon: N('cross'),
- showHeader: b,
- modelValue: g,
- fieldNames: Object,
- placeholder: String,
- activeColor: String
- }
- const Wr = We(
- t.defineComponent({
- name: Rr,
- props: jr,
- emits: ['close', 'change', 'finish', 'clickTab', 'update:modelValue'],
- setup(e, { slots: o, emit: n }) {
- const a = t.ref([]),
- r = t.ref(0),
- [l, i] = wo(),
- {
- text: s,
- value: c,
- children: u
- } = d({ text: 'text', value: 'value', children: 'children' }, e.fieldNames),
- p = (e, t) => {
- for (const o of e) {
- if (o[c] === t) return [o]
- if (o[u]) {
- const e = p(o[u], t)
- if (e) return [o, ...e]
- }
- }
- },
- m = () => {
- const { options: o, modelValue: n } = e
- if (void 0 !== n) {
- const e = p(o, n)
- if (e) {
- let n = o
- return (
- (a.value = e.map((e) => {
- const t = { options: n, selected: e },
- o = n.find((t) => t[c] === e[c])
- return o && (n = o[u]), t
- })),
- n && a.value.push({ options: n, selected: null }),
- void t.nextTick(() => {
- r.value = a.value.length - 1
- })
- )
- }
- }
- a.value = [{ options: o, selected: null }]
- },
- f = () => n('close'),
- v = ({ name: e, title: t }) => n('clickTab', e, t),
- h = (l, d, p) => {
- const { disabled: m } = l,
- f = !(!d || l[c] !== d[c]),
- v = l.color || (f ? e.activeColor : void 0),
- h = o.option
- ? o.option({ option: l, selected: f })
- : t.createVNode('span', null, [l[s]])
- return t.createVNode(
- 'li',
- {
- ref: f ? i(p) : void 0,
- role: 'menuitemradio',
- class: [Fr('option', { selected: f, disabled: m }), l.className],
- style: { color: v },
- tabindex: m ? void 0 : f ? 0 : -1,
- 'aria-checked': f,
- 'aria-disabled': m || void 0,
- onClick: () =>
- ((e, o) => {
- if (e.disabled) return
- if (
- ((a.value[o].selected = e),
- a.value.length > o + 1 && (a.value = a.value.slice(0, o + 1)),
- e[u])
- ) {
- const n = { options: e[u], selected: null }
- a.value[o + 1] ? (a.value[o + 1] = n) : a.value.push(n),
- t.nextTick(() => {
- r.value++
- })
- }
- const l = a.value.map((e) => e.selected).filter(Boolean)
- n('update:modelValue', e[c])
- const i = { value: e[c], tabIndex: o, selectedOptions: l }
- n('change', i), e[u] || n('finish', i)
- })(l, p)
- },
- [
- h,
- f
- ? t.createVNode(ht, { name: 'success', class: Fr('selected-icon') }, null)
- : null
- ]
- )
- },
- g = (e, o, n) =>
- t.createVNode('ul', { role: 'menu', class: Fr('options') }, [
- e.map((e) => h(e, o, n))
- ]),
- b = (n, a) => {
- const { options: r, selected: l } = n,
- i = e.placeholder || Hr('select'),
- c = l ? l[s] : i
- return t.createVNode(
- Zo,
- { title: c, titleClass: Fr('tab', { unselected: !l }) },
- {
- default: () => {
- var e, t
- return [
- null == (e = o['options-top']) ? void 0 : e.call(o, { tabIndex: a }),
- g(r, l, a),
- null == (t = o['options-bottom']) ? void 0 : t.call(o, { tabIndex: a })
- ]
- }
- }
- )
- }
- return (
- m(),
- t.watch(r, (e) => {
- const t = l.value[e]
- t &&
- ((e) => {
- const t = e.parentElement
- t && (t.scrollTop = e.offsetTop - (t.offsetHeight - e.offsetHeight) / 2)
- })(t)
- }),
- t.watch(() => e.options, m, { deep: !0 }),
- t.watch(
- () => e.modelValue,
- (e) => {
- if (void 0 !== e) {
- if (
- a.value
- .map((e) => {
- var t
- return null == (t = e.selected) ? void 0 : t[c]
- })
- .includes(e)
- )
- return
- }
- m()
- }
- ),
- () =>
- t.createVNode('div', { class: Fr() }, [
- e.showHeader
- ? t.createVNode('div', { class: Fr('header') }, [
- t.createVNode('h2', { class: Fr('title') }, [o.title ? o.title() : e.title]),
- e.closeable
- ? t.createVNode(
- ht,
- { name: e.closeIcon, class: [Fr('close-icon'), Fe], onClick: f },
- null
- )
- : null
- ])
- : null,
- t.createVNode(
- Ko,
- {
- active: r.value,
- 'onUpdate:active': (e) => (r.value = e),
- shrink: !0,
- animated: !0,
- class: Fr('tabs'),
- color: e.activeColor,
- swipeable: e.swipeable,
- onClickTab: v
- },
- { default: () => [a.value.map(b)] }
- )
- ])
- )
- }
- })
- ),
- [Ur, Yr] = Ie('cell-group'),
- qr = { title: String, inset: Boolean, border: b }
- const Xr = We(
- t.defineComponent({
- name: Ur,
- inheritAttrs: !1,
- props: qr,
- setup(e, { slots: o, attrs: n }) {
- const a = () => {
- var a
- return t.createVNode(
- 'div',
- t.mergeProps({ class: [Yr({ inset: e.inset }), { [Me]: e.border && !e.inset }] }, n),
- [null == (a = o.default) ? void 0 : a.call(o)]
- )
- }
- return () =>
- e.title || o.title
- ? t.createVNode(t.Fragment, null, [
- t.createVNode('div', { class: Yr('title', { inset: e.inset }) }, [
- o.title ? o.title() : e.title
- ]),
- a()
- ])
- : a()
- }
- })
- ),
- [Gr, Zr] = Ie('checkbox-group'),
- Kr = {
- max: g,
- disabled: Boolean,
- iconSize: g,
- direction: String,
- modelValue: w(),
- checkedColor: String
- },
- _r = Symbol(Gr)
- var Jr = t.defineComponent({
- name: Gr,
- props: Kr,
- emits: ['change', 'update:modelValue'],
- setup(e, { emit: o, slots: n }) {
- const { children: a, linkChildren: r } = A(_r),
- l = (e) => o('update:modelValue', e)
- return (
- t.watch(
- () => e.modelValue,
- (e) => o('change', e)
- ),
- Qe({
- toggleAll: (e = {}) => {
- 'boolean' == typeof e && (e = { checked: e })
- const { checked: t, skipDisabled: o } = e,
- n = a
- .filter(
- (e) =>
- !!e.props.bindGroup &&
- (e.props.disabled && o ? e.checked.value : null != t ? t : !e.checked.value)
- )
- .map((e) => e.name)
- l(n)
- }
- }),
- _(() => e.modelValue),
- r({ props: e, updateValue: l }),
- () => {
- var o
- return t.createVNode('div', { class: Zr([e.direction]) }, [
- null == (o = n.default) ? void 0 : o.call(n)
- ])
- }
- )
- }
- })
- const [Qr, el] = Ie('checkbox'),
- tl = d({}, Sa, { bindGroup: b })
- const ol = We(
- t.defineComponent({
- name: Qr,
- props: tl,
- emits: ['change', 'update:modelValue'],
- setup(e, { emit: o, slots: n }) {
- const { parent: a } = D(_r),
- r = t.computed(() =>
- a && e.bindGroup ? -1 !== a.props.modelValue.indexOf(e.name) : !!e.modelValue
- ),
- l = (t = !r.value) => {
- a && e.bindGroup
- ? ((t) => {
- const { name: o } = e,
- { max: n, modelValue: r } = a.props,
- l = r.slice()
- if (t)
- (n && l.length >= +n) ||
- l.includes(o) ||
- (l.push(o), e.bindGroup && a.updateValue(l))
- else {
- const t = l.indexOf(o)
- ;-1 !== t && (l.splice(t, 1), e.bindGroup && a.updateValue(l))
- }
- })(t)
- : o('update:modelValue', t)
- }
- return (
- t.watch(
- () => e.modelValue,
- (e) => o('change', e)
- ),
- Qe({ toggle: l, props: e, checked: r }),
- _(() => e.modelValue),
- () =>
- t.createVNode(
- Ta,
- t.mergeProps(
- { bem: el, role: 'checkbox', parent: a, checked: r.value, onToggle: l },
- e
- ),
- m(n, ['default', 'icon'])
- )
- )
- }
- })
- ),
- nl = We(Jr),
- [al, rl] = Ie('circle')
- let ll = 0
- const il = (e) => Math.min(Math.max(+e, 0), 100)
- const sl = {
- text: String,
- size: g,
- fill: N('none'),
- rate: V(100),
- speed: V(0),
- color: [String, Object],
- clockwise: b,
- layerColor: String,
- currentRate: x(0),
- strokeWidth: V(40),
- strokeLinecap: String,
- startPosition: N('top')
- }
- const cl = We(
- t.defineComponent({
- name: al,
- props: sl,
- emits: ['update:currentRate'],
- setup(e, { emit: o, slots: n }) {
- const r = 'van-circle-' + ll++,
- l = t.computed(() => +e.strokeWidth + 1e3),
- i = t.computed(() =>
- (function (e, t) {
- const o = e ? 1 : 0
- return `M ${t / 2} ${
- t / 2
- } m 0, -500 a 500, 500 0 1, ${o} 0, 1000 a 500, 500 0 1, ${o} 0, -1000`
- })(e.clockwise, l.value)
- ),
- s = t.computed(() => {
- const t = { top: 0, right: 90, bottom: 180, left: 270 }[e.startPosition]
- if (t) return { transform: `rotate(${t}deg)` }
- })
- t.watch(
- () => e.rate,
- (t) => {
- let n
- const a = Date.now(),
- r = e.currentRate,
- l = il(t),
- i = Math.abs((1e3 * (r - l)) / +e.speed),
- s = () => {
- const e = Date.now(),
- t = Math.min((e - a) / i, 1) * (l - r) + r
- o('update:currentRate', il(parseFloat(t.toFixed(1)))),
- (l > r ? t < l : t > l) && (n = C(s))
- }
- e.speed ? (n && S(n), (n = C(s))) : o('update:currentRate', l)
- },
- { immediate: !0 }
- )
- const c = () => {
- const { strokeWidth: o, currentRate: n, strokeLinecap: l } = e,
- s = (3140 * n) / 100,
- c = a(e.color) ? `url(#${r})` : e.color,
- d = {
- stroke: c,
- strokeWidth: +o + 1 + 'px',
- strokeLinecap: l,
- strokeDasharray: `${s}px 3140px`
- }
- return t.createVNode(
- 'path',
- { d: i.value, style: d, class: rl('hover'), stroke: c },
- null
- )
- },
- d = () => {
- const o = { fill: e.fill, stroke: e.layerColor, strokeWidth: `${e.strokeWidth}px` }
- return t.createVNode('path', { class: rl('layer'), style: o, d: i.value }, null)
- },
- u = () => {
- const { color: o } = e
- if (!a(o)) return
- const n = Object.keys(o)
- .sort((e, t) => parseFloat(e) - parseFloat(t))
- .map((e, n) =>
- t.createVNode('stop', { key: n, offset: e, 'stop-color': o[e] }, null)
- )
- return t.createVNode('defs', null, [
- t.createVNode(
- 'linearGradient',
- { id: r, x1: '100%', y1: '0%', x2: '0%', y2: '0%' },
- [n]
- )
- ])
- }
- return () =>
- t.createVNode('div', { class: rl(), style: ue(e.size) }, [
- t.createVNode('svg', { viewBox: `0 0 ${l.value} ${l.value}`, style: s.value }, [
- u(),
- d(),
- c()
- ]),
- n.default
- ? n.default()
- : e.text
- ? t.createVNode('div', { class: rl('text') }, [e.text])
- : void 0
- ])
- }
- })
- ),
- [dl, ul] = Ie('row'),
- pl = Symbol(dl),
- ml = { tag: N('div'), wrap: b, align: String, gutter: V(0), justify: String }
- var fl = t.defineComponent({
- name: dl,
- props: ml,
- setup(e, { slots: o }) {
- const { children: n, linkChildren: a } = A(pl),
- r = t.computed(() => {
- const e = [[]]
- let t = 0
- return (
- n.forEach((o, n) => {
- ;(t += Number(o.span)), t > 24 ? (e.push([n]), (t -= 24)) : e[e.length - 1].push(n)
- }),
- e
- )
- })
- return (
- a({
- spaces: t.computed(() => {
- const t = Number(e.gutter),
- o = []
- return t
- ? (r.value.forEach((e) => {
- const n = (t * (e.length - 1)) / e.length
- e.forEach((e, a) => {
- if (0 === a) o.push({ right: n })
- else {
- const a = t - o[e - 1].right,
- r = n - a
- o.push({ left: a, right: r })
- }
- })
- }),
- o)
- : o
- })
- }),
- () => {
- const { tag: n, wrap: a, align: r, justify: l } = e
- return t.createVNode(
- n,
- { class: ul({ [`align-${r}`]: r, [`justify-${l}`]: l, nowrap: !a }) },
- {
- default: () => {
- var e
- return [null == (e = o.default) ? void 0 : e.call(o)]
- }
- }
- )
- }
- )
- }
- })
- const [vl, hl] = Ie('col'),
- gl = { tag: N('div'), span: V(0), offset: g }
- const bl = We(
- t.defineComponent({
- name: vl,
- props: gl,
- setup(e, { slots: o }) {
- const { parent: n, index: a } = D(pl),
- r = t.computed(() => {
- if (!n) return
- const { spaces: e } = n
- if (e && e.value && e.value[a.value]) {
- const { left: t, right: o } = e.value[a.value]
- return { paddingLeft: t ? `${t}px` : null, paddingRight: o ? `${o}px` : null }
- }
- })
- return () => {
- const { tag: n, span: a, offset: l } = e
- return t.createVNode(
- n,
- { style: r.value, class: hl({ [a]: a, [`offset-${l}`]: l }) },
- {
- default: () => {
- var e
- return [null == (e = o.default) ? void 0 : e.call(o)]
- }
- }
- )
- }
- }
- })
- ),
- [yl, wl] = Ie('collapse'),
- xl = Symbol(yl),
- Vl = {
- border: b,
- accordion: Boolean,
- modelValue: { type: [String, Number, Array], default: '' }
- }
- const Nl = We(
- t.defineComponent({
- name: yl,
- props: Vl,
- emits: ['change', 'update:modelValue'],
- setup(e, { emit: o, slots: n }) {
- const { linkChildren: a, children: r } = A(xl),
- l = (e) => {
- o('change', e), o('update:modelValue', e)
- }
- return (
- Qe({
- toggleAll: (t = {}) => {
- if (e.accordion) return
- 'boolean' == typeof t && (t = { expanded: t })
- const { expanded: o, skipDisabled: n } = t,
- a = r
- .filter((e) =>
- e.disabled && n ? e.expanded.value : null != o ? o : !e.expanded.value
- )
- .map((e) => e.itemName.value)
- l(a)
- }
- }),
- a({
- toggle: (t, o) => {
- const { accordion: n, modelValue: a } = e
- l(n ? (t === a ? '' : t) : o ? a.concat(t) : a.filter((e) => e !== t))
- },
- isExpanded: (t) => {
- const { accordion: o, modelValue: n } = e
- return o ? n === t : n.includes(t)
- }
- }),
- () => {
- var o
- return t.createVNode('div', { class: [wl(), { [Me]: e.border }] }, [
- null == (o = n.default) ? void 0 : o.call(n)
- ])
- }
- )
- }
- })
- ),
- [kl, Cl] = Ie('collapse-item'),
- Sl = ['icon', 'title', 'value', 'label', 'right-icon'],
- Tl = d({}, bn, { name: g, isLink: b, disabled: Boolean, readonly: Boolean, lazyRender: b })
- const Bl = We(
- t.defineComponent({
- name: kl,
- props: Tl,
- setup(e, { slots: o }) {
- const n = t.ref(),
- a = t.ref(),
- { parent: r, index: l } = D(xl)
- if (!r) return
- const i = t.computed(() => {
- var t
- return null != (t = e.name) ? t : l.value
- }),
- s = t.computed(() => r.isExpanded(i.value)),
- c = t.ref(s.value),
- d = Ft(() => c.value || !e.lazyRender),
- u = () => {
- s.value ? n.value && (n.value.style.height = '') : (c.value = !1)
- }
- t.watch(s, (e, o) => {
- if (null === o) return
- e && (c.value = !0)
- ;(e ? t.nextTick : C)(() => {
- if (!a.value || !n.value) return
- const { offsetHeight: t } = a.value
- if (t) {
- const o = `${t}px`
- ;(n.value.style.height = e ? '0' : o),
- T(() => {
- n.value && (n.value.style.height = e ? o : '0')
- })
- } else u()
- })
- })
- const p = (e = !s.value) => {
- r.toggle(i.value, e)
- },
- f = () => {
- e.disabled || e.readonly || p()
- },
- v = () => {
- const { border: n, disabled: a, readonly: r } = e,
- l = m(e, Object.keys(bn))
- return (
- r && (l.isLink = !1),
- (a || r) && (l.clickable = !1),
- t.createVNode(
- wn,
- t.mergeProps(
- {
- role: 'button',
- class: Cl('title', { disabled: a, expanded: s.value, borderless: !n }),
- 'aria-expanded': String(s.value),
- onClick: f
- },
- l
- ),
- m(o, Sl)
- )
- )
- },
- h = d(() => {
- var e
- return t.withDirectives(
- t.createVNode('div', { ref: n, class: Cl('wrapper'), onTransitionend: u }, [
- t.createVNode('div', { ref: a, class: Cl('content') }, [
- null == (e = o.default) ? void 0 : e.call(o)
- ])
- ]),
- [[t.vShow, c.value]]
- )
- })
- return (
- Qe({ toggle: p, expanded: s, itemName: i }),
- () => t.createVNode('div', { class: [Cl({ border: l.value && e.border })] }, [v(), h()])
- )
- }
- })
- ),
- Pl = We(pt),
- [Dl, Ol, Il] = Ie('contact-card'),
- Al = { tel: String, name: String, type: N('add'), addText: String, editable: b }
- const zl = We(
- t.defineComponent({
- name: Dl,
- props: Al,
- emits: ['click'],
- setup(e, { emit: o }) {
- const n = (t) => {
- e.editable && o('click', t)
- },
- a = () =>
- 'add' === e.type
- ? e.addText || Il('addContact')
- : [
- t.createVNode('div', null, [`${Il('name')}:${e.name}`]),
- t.createVNode('div', null, [`${Il('tel')}:${e.tel}`])
- ]
- return () =>
- t.createVNode(
- wn,
- {
- center: !0,
- icon: 'edit' === e.type ? 'contact' : 'add-square',
- class: Ol([e.type]),
- border: !1,
- isLink: e.editable,
- titleClass: Ol('title'),
- onClick: n
- },
- { title: a }
- )
- }
- })
- ),
- [El, Ll, $l] = Ie('contact-edit'),
- Ml = { tel: '', name: '' },
- Rl = {
- isEdit: Boolean,
- isSaving: Boolean,
- isDeleting: Boolean,
- showSetDefault: Boolean,
- setDefaultLabel: String,
- contactInfo: { type: Object, default: () => d({}, Ml) },
- telValidator: { type: Function, default: i }
- }
- const Fl = We(
- t.defineComponent({
- name: El,
- props: Rl,
- emits: ['save', 'delete', 'changeDefault'],
- setup(e, { emit: o }) {
- const n = t.reactive(d({}, Ml, e.contactInfo)),
- a = () => {
- e.isSaving || o('save', n)
- },
- r = () => o('delete', n),
- l = () =>
- t.createVNode(
- la,
- {
- modelValue: n.isDefault,
- 'onUpdate:modelValue': (e) => (n.isDefault = e),
- onChange: (e) => o('changeDefault', e)
- },
- null
- ),
- i = () => {
- if (e.showSetDefault)
- return t.createVNode(
- wn,
- { title: e.setDefaultLabel, class: Ll('switch-cell'), border: !1 },
- { 'right-icon': l }
- )
- }
- return (
- t.watch(
- () => e.contactInfo,
- (e) => d(n, Ml, e)
- ),
- () =>
- t.createVNode(
- kn,
- { class: Ll(), onSubmit: a },
- {
- default: () => [
- t.createVNode('div', { class: Ll('fields') }, [
- t.createVNode(
- En,
- {
- modelValue: n.name,
- 'onUpdate:modelValue': (e) => (n.name = e),
- clearable: !0,
- label: $l('name'),
- rules: [{ required: !0, message: $l('nameEmpty') }],
- maxlength: '30',
- placeholder: $l('name')
- },
- null
- ),
- t.createVNode(
- En,
- {
- modelValue: n.tel,
- 'onUpdate:modelValue': (e) => (n.tel = e),
- clearable: !0,
- type: 'tel',
- label: $l('tel'),
- rules: [{ validator: e.telValidator, message: $l('telInvalid') }],
- placeholder: $l('tel')
- },
- null
- )
- ]),
- i(),
- t.createVNode('div', { class: Ll('buttons') }, [
- t.createVNode(
- St,
- {
- block: !0,
- round: !0,
- type: 'primary',
- text: $l('save'),
- class: Ll('button'),
- loading: e.isSaving,
- nativeType: 'submit'
- },
- null
- ),
- e.isEdit &&
- t.createVNode(
- St,
- {
- block: !0,
- round: !0,
- text: $l('delete'),
- class: Ll('button'),
- loading: e.isDeleting,
- onClick: r
- },
- null
- )
- ])
- ]
- }
- )
- )
- }
- })
- ),
- [Hl, jl, Wl] = Ie('contact-list'),
- Ul = { list: Array, addText: String, modelValue: h, defaultTagText: String }
- const Yl = We(
- t.defineComponent({
- name: Hl,
- props: Ul,
- emits: ['add', 'edit', 'select', 'update:modelValue'],
- setup(e, { emit: o }) {
- const n = (n, a) =>
- t.createVNode(
- wn,
- {
- key: n.id,
- isLink: !0,
- center: !0,
- class: jl('item'),
- titleClass: jl('item-title'),
- onClick: () => {
- o('update:modelValue', n.id), o('select', n, a)
- }
- },
- {
- icon: () =>
- t.createVNode(
- ht,
- {
- name: 'edit',
- class: jl('edit'),
- onClick: (e) => {
- e.stopPropagation(), o('edit', n, a)
- }
- },
- null
- ),
- title: () => {
- const o = [`${n.name},${n.tel}`]
- return (
- n.isDefault &&
- e.defaultTagText &&
- o.push(
- t.createVNode(
- Ca,
- { type: 'primary', round: !0, class: jl('item-tag') },
- { default: () => [e.defaultTagText] }
- )
- ),
- o
- )
- },
- 'right-icon': () =>
- t.createVNode(Oa, { class: jl('radio'), name: n.id, iconSize: 18 }, null)
- }
- )
- return () =>
- t.createVNode('div', { class: jl() }, [
- t.createVNode(
- xa,
- { modelValue: e.modelValue, class: jl('group') },
- { default: () => [e.list && e.list.map(n)] }
- ),
- t.createVNode('div', { class: [jl('bottom'), 'van-safe-area-bottom'] }, [
- t.createVNode(
- St,
- {
- round: !0,
- block: !0,
- type: 'primary',
- class: jl('add'),
- text: e.addText || Wl('addContact'),
- onClick: () => o('add')
- },
- null
- )
- ])
- ])
- }
- })
- )
- const [ql, Xl] = Ie('count-down'),
- Gl = { time: V(0), format: N('HH:mm:ss'), autoStart: b, millisecond: Boolean }
- const Zl = We(
- t.defineComponent({
- name: ql,
- props: Gl,
- emits: ['change', 'finish'],
- setup(e, { emit: o, slots: n }) {
- const {
- start: a,
- pause: r,
- reset: l,
- current: i
- } = F({
- time: +e.time,
- millisecond: e.millisecond,
- onChange: (e) => o('change', e),
- onFinish: () => o('finish')
- }),
- s = t.computed(() =>
- (function (e, t) {
- const { days: o } = t
- let { hours: n, minutes: a, seconds: r, milliseconds: l } = t
- if (
- (e.includes('DD') ? (e = e.replace('DD', be(o))) : (n += 24 * o),
- e.includes('HH') ? (e = e.replace('HH', be(n))) : (a += 60 * n),
- e.includes('mm') ? (e = e.replace('mm', be(a))) : (r += 60 * a),
- e.includes('ss') ? (e = e.replace('ss', be(r))) : (l += 1e3 * r),
- e.includes('S'))
- ) {
- const t = be(l, 3)
- e = e.includes('SSS')
- ? e.replace('SSS', t)
- : e.includes('SS')
- ? e.replace('SS', t.slice(0, 2))
- : e.replace('S', t.charAt(0))
- }
- return e
- })(e.format, i.value)
- ),
- c = () => {
- l(+e.time), e.autoStart && a()
- }
- return (
- t.watch(() => e.time, c, { immediate: !0 }),
- Qe({ start: a, pause: r, reset: c }),
- () =>
- t.createVNode('div', { role: 'timer', class: Xl() }, [
- n.default ? n.default(i.value) : s.value
- ])
- )
- }
- })
- )
- function Kl(e) {
- const t = new Date(1e3 * e)
- return `${t.getFullYear()}.${be(t.getMonth() + 1)}.${be(t.getDate())}`
- }
- const _l = (e) => (e / 100).toFixed(e % 100 == 0 ? 0 : e % 10 == 0 ? 1 : 2),
- [Jl, Ql, ei] = Ie('coupon')
- const ti = We(
- t.defineComponent({
- name: Jl,
- props: { chosen: Boolean, coupon: y(Object), disabled: Boolean, currency: N('¥') },
- setup(e) {
- const o = t.computed(() => {
- const { startAt: t, endAt: o } = e.coupon
- return `${Kl(t)} - ${Kl(o)}`
- }),
- n = t.computed(() => {
- const { coupon: o, currency: n } = e
- if (o.valueDesc) return [o.valueDesc, t.createVNode('span', null, [o.unitDesc || ''])]
- if (o.denominations) {
- const e = _l(o.denominations)
- return [t.createVNode('span', null, [n]), ` ${e}`]
- }
- return o.discount
- ? ei('discount', ((a = o.discount) / 10).toFixed(a % 10 == 0 ? 0 : 1))
- : ''
- var a
- }),
- a = t.computed(() => {
- const t = _l(e.coupon.originCondition || 0)
- return '0' === t ? ei('unlimited') : ei('condition', t)
- })
- return () => {
- const { chosen: r, coupon: l, disabled: i } = e,
- s = (i && l.reason) || l.description
- return t.createVNode('div', { class: Ql({ disabled: i }) }, [
- t.createVNode('div', { class: Ql('content') }, [
- t.createVNode('div', { class: Ql('head') }, [
- t.createVNode('h2', { class: Ql('amount') }, [n.value]),
- t.createVNode('p', { class: Ql('condition') }, [l.condition || a.value])
- ]),
- t.createVNode('div', { class: Ql('body') }, [
- t.createVNode('p', { class: Ql('name') }, [l.name]),
- t.createVNode('p', { class: Ql('valid') }, [o.value]),
- !i && t.createVNode(ol, { class: Ql('corner'), modelValue: r }, null)
- ])
- ]),
- s && t.createVNode('p', { class: Ql('description') }, [s])
- ])
- }
- }
- })
- ),
- [oi, ni, ai] = Ie('coupon-cell'),
- ri = {
- title: String,
- border: b,
- editable: b,
- coupons: w(),
- currency: N('¥'),
- chosenCoupon: V(-1)
- }
- function li({ coupons: e, chosenCoupon: t, currency: n }) {
- const a = e[+t]
- if (a) {
- let e = 0
- return (
- o(a.value) ? ({ value: e } = a) : o(a.denominations) && (e = a.denominations),
- `-${n} ${(e / 100).toFixed(2)}`
- )
- }
- return 0 === e.length ? ai('noCoupon') : ai('count', e.length)
- }
- const ii = We(
- t.defineComponent({
- name: oi,
- props: ri,
- setup: (e) => () => {
- const o = e.coupons[+e.chosenCoupon]
- return t.createVNode(
- wn,
- {
- class: ni(),
- value: li(e),
- title: e.title || ai('title'),
- border: e.border,
- isLink: e.editable,
- valueClass: ni('value', { selected: o })
- },
- null
- )
- }
- })
- ),
- [si, ci] = Ie('empty'),
- di = { image: N('default'), imageSize: [Number, String, Array], description: String }
- const ui = We(
- t.defineComponent({
- name: si,
- props: di,
- setup(e, { slots: o }) {
- const n = () => {
- const n = o.description ? o.description() : e.description
- if (n) return t.createVNode('p', { class: ci('description') }, [n])
- },
- a = () => {
- if (o.default) return t.createVNode('div', { class: ci('bottom') }, [o.default()])
- },
- r = yo(),
- l = (e) => `${r}-${e}`,
- i = (e) => `url(#${l(e)})`,
- s = (e, o, n) =>
- t.createVNode('stop', { 'stop-color': e, offset: `${o}%`, 'stop-opacity': n }, null),
- c = (e, t) => [s(e, 0), s(t, 100)],
- d = (e) => [
- t.createVNode('defs', null, [
- t.createVNode(
- 'radialGradient',
- {
- id: l(e),
- cx: '50%',
- cy: '54%',
- fx: '50%',
- fy: '54%',
- r: '297%',
- gradientTransform: 'matrix(-.16 0 0 -.33 .58 .72)'
- },
- [s('#EBEDF0', 0), s('#F2F3F5', 100, 0.3)]
- )
- ]),
- t.createVNode(
- 'ellipse',
- { fill: i(e), opacity: '.8', cx: '80', cy: '140', rx: '46', ry: '8' },
- null
- )
- ],
- u = () => [
- t.createVNode('defs', null, [
- t.createVNode('linearGradient', { id: l('a'), x1: '64%', y1: '100%', x2: '64%' }, [
- s('#FFF', 0, 0.5),
- s('#F2F3F5', 100)
- ])
- ]),
- t.createVNode('g', { opacity: '.8' }, [
- t.createVNode('path', { d: 'M36 131V53H16v20H2v58h34z', fill: i('a') }, null),
- t.createVNode('path', { d: 'M123 15h22v14h9v77h-31V15z', fill: i('a') }, null)
- ])
- ],
- p = () => [
- t.createVNode('defs', null, [
- t.createVNode(
- 'linearGradient',
- { id: l('b'), x1: '64%', y1: '97%', x2: '64%', y2: '0%' },
- [s('#F2F3F5', 0, 0.3), s('#F2F3F5', 100)]
- )
- ]),
- t.createVNode('g', { opacity: '.8' }, [
- t.createVNode(
- 'path',
- {
- d: 'M87 6c3 0 7 3 8 6a8 8 0 1 1-1 16H80a7 7 0 0 1-8-6c0-4 3-7 6-7 0-5 4-9 9-9Z',
- fill: i('b')
- },
- null
- ),
- t.createVNode(
- 'path',
- {
- d: 'M19 23c2 0 3 1 4 3 2 0 4 2 4 4a4 4 0 0 1-4 3v1h-7v-1l-1 1c-2 0-3-2-3-4 0-1 1-3 3-3 0-2 2-4 4-4Z',
- fill: i('b')
- },
- null
- )
- ])
- ],
- m = () =>
- t.createVNode('svg', { viewBox: '0 0 160 160' }, [
- t.createVNode('defs', null, [
- t.createVNode('linearGradient', { id: l(1), x1: '64%', y1: '100%', x2: '64%' }, [
- s('#FFF', 0, 0.5),
- s('#F2F3F5', 100)
- ]),
- t.createVNode('linearGradient', { id: l(2), x1: '50%', x2: '50%', y2: '84%' }, [
- s('#EBEDF0', 0),
- s('#DCDEE0', 100, 0)
- ]),
- t.createVNode(
- 'linearGradient',
- { id: l(3), x1: '100%', x2: '100%', y2: '100%' },
- [c('#EAEDF0', '#DCDEE0')]
- ),
- t.createVNode(
- 'radialGradient',
- {
- id: l(4),
- cx: '50%',
- cy: '0%',
- fx: '50%',
- fy: '0%',
- r: '100%',
- gradientTransform: 'matrix(0 1 -.54 0 .5 -.5)'
- },
- [s('#EBEDF0', 0), s('#FFF', 100, 0)]
- )
- ]),
- t.createVNode('g', { fill: 'none' }, [
- u(),
- t.createVNode('path', { fill: i(4), d: 'M0 139h160v21H0z' }, null),
- t.createVNode(
- 'path',
- {
- d: 'M80 54a7 7 0 0 1 3 13v27l-2 2h-2a2 2 0 0 1-2-2V67a7 7 0 0 1 3-13z',
- fill: i(2)
- },
- null
- ),
- t.createVNode(
- 'g',
- { opacity: '.6', 'stroke-linecap': 'round', 'stroke-width': '7' },
- [
- t.createVNode(
- 'path',
- { d: 'M64 47a19 19 0 0 0-5 13c0 5 2 10 5 13', stroke: i(3) },
- null
- ),
- t.createVNode('path', { d: 'M53 36a34 34 0 0 0 0 48', stroke: i(3) }, null),
- t.createVNode(
- 'path',
- { d: 'M95 73a19 19 0 0 0 6-13c0-5-2-9-6-13', stroke: i(3) },
- null
- ),
- t.createVNode('path', { d: 'M106 84a34 34 0 0 0 0-48', stroke: i(3) }, null)
- ]
- ),
- t.createVNode('g', { transform: 'translate(31 105)' }, [
- t.createVNode(
- 'rect',
- { fill: '#EBEDF0', width: '98', height: '34', rx: '2' },
- null
- ),
- t.createVNode(
- 'rect',
- { fill: '#FFF', x: '9', y: '8', width: '80', height: '18', rx: '1.1' },
- null
- ),
- t.createVNode(
- 'rect',
- { fill: '#EBEDF0', x: '15', y: '12', width: '18', height: '6', rx: '1.1' },
- null
- )
- ])
- ])
- ]),
- f = () =>
- t.createVNode('svg', { viewBox: '0 0 160 160' }, [
- t.createVNode('defs', null, [
- t.createVNode('linearGradient', { x1: '50%', x2: '50%', y2: '100%', id: l(5) }, [
- c('#F2F3F5', '#DCDEE0')
- ]),
- t.createVNode(
- 'linearGradient',
- { x1: '95%', y1: '48%', x2: '5.5%', y2: '51%', id: l(6) },
- [c('#EAEDF1', '#DCDEE0')]
- ),
- t.createVNode('linearGradient', { y1: '45%', x2: '100%', y2: '54%', id: l(7) }, [
- c('#EAEDF1', '#DCDEE0')
- ])
- ]),
- u(),
- p(),
- t.createVNode('g', { transform: 'translate(36 50)', fill: 'none' }, [
- t.createVNode('g', { transform: 'translate(8)' }, [
- t.createVNode(
- 'rect',
- {
- fill: '#EBEDF0',
- opacity: '.6',
- x: '38',
- y: '13',
- width: '36',
- height: '53',
- rx: '2'
- },
- null
- ),
- t.createVNode('rect', { fill: i(5), width: '64', height: '66', rx: '2' }, null),
- t.createVNode(
- 'rect',
- { fill: '#FFF', x: '6', y: '6', width: '52', height: '55', rx: '1' },
- null
- ),
- t.createVNode('g', { transform: 'translate(15 17)', fill: i(6) }, [
- t.createVNode('rect', { width: '34', height: '6', rx: '1' }, null),
- t.createVNode('path', { d: 'M0 14h34v6H0z' }, null),
- t.createVNode('rect', { y: '28', width: '34', height: '6', rx: '1' }, null)
- ])
- ]),
- t.createVNode(
- 'rect',
- { fill: i(7), y: '61', width: '88', height: '28', rx: '1' },
- null
- ),
- t.createVNode(
- 'rect',
- { fill: '#F7F8FA', x: '29', y: '72', width: '30', height: '6', rx: '1' },
- null
- )
- ])
- ]),
- v = () =>
- t.createVNode('svg', { viewBox: '0 0 160 160' }, [
- t.createVNode('defs', null, [
- t.createVNode('linearGradient', { x1: '50%', x2: '50%', y2: '100%', id: l(8) }, [
- c('#EAEDF1', '#DCDEE0')
- ])
- ]),
- u(),
- p(),
- d('c'),
- t.createVNode(
- 'path',
- {
- d: 'm59 60 21 21 21-21h3l9 9v3L92 93l21 21v3l-9 9h-3l-21-21-21 21h-3l-9-9v-3l21-21-21-21v-3l9-9h3Z',
- fill: i(8)
- },
- null
- )
- ]),
- h = () =>
- t.createVNode('svg', { viewBox: '0 0 160 160' }, [
- t.createVNode('defs', null, [
- t.createVNode('linearGradient', { x1: '50%', y1: '100%', x2: '50%', id: l(9) }, [
- c('#EEE', '#D8D8D8')
- ]),
- t.createVNode('linearGradient', { x1: '100%', y1: '50%', y2: '50%', id: l(10) }, [
- c('#F2F3F5', '#DCDEE0')
- ]),
- t.createVNode('linearGradient', { x1: '50%', x2: '50%', y2: '100%', id: l(11) }, [
- c('#F2F3F5', '#DCDEE0')
- ]),
- t.createVNode('linearGradient', { x1: '50%', x2: '50%', y2: '100%', id: l(12) }, [
- c('#FFF', '#F7F8FA')
- ])
- ]),
- u(),
- p(),
- d('d'),
- t.createVNode('g', { transform: 'rotate(-45 113 -4)', fill: 'none' }, [
- t.createVNode(
- 'rect',
- { fill: i(9), x: '24', y: '52.8', width: '5.8', height: '19', rx: '1' },
- null
- ),
- t.createVNode(
- 'rect',
- { fill: i(10), x: '22.1', y: '67.3', width: '9.9', height: '28', rx: '1' },
- null
- ),
- t.createVNode(
- 'circle',
- { stroke: i(11), 'stroke-width': '8', cx: '27', cy: '27', r: '27' },
- null
- ),
- t.createVNode('circle', { fill: i(12), cx: '27', cy: '27', r: '16' }, null),
- t.createVNode(
- 'path',
- {
- d: 'M37 7c-8 0-15 5-16 12',
- stroke: i(11),
- 'stroke-width': '3',
- opacity: '.5',
- 'stroke-linecap': 'round',
- transform: 'rotate(45 29 13)'
- },
- null
- )
- ])
- ]),
- g = () => {
- var n
- if (o.image) return o.image()
- const a = { error: v, search: h, network: m, default: f }
- return (
- (null == (n = a[e.image]) ? void 0 : n.call(a)) ||
- t.createVNode('img', { src: e.image }, null)
- )
- }
- return () =>
- t.createVNode('div', { class: ci() }, [
- t.createVNode('div', { class: ci('image'), style: ue(e.imageSize) }, [g()]),
- n(),
- a()
- ])
- }
- })
- ),
- [pi, mi, fi] = Ie('coupon-list'),
- vi = {
- code: N(''),
- coupons: w(),
- currency: N('¥'),
- showCount: b,
- emptyImage: String,
- chosenCoupon: x(-1),
- enabledTitle: String,
- disabledTitle: String,
- disabledCoupons: w(),
- showExchangeBar: b,
- showCloseButton: b,
- closeButtonText: String,
- inputPlaceholder: String,
- exchangeMinLength: x(1),
- exchangeButtonText: String,
- displayedCouponIndex: x(-1),
- exchangeButtonLoading: Boolean,
- exchangeButtonDisabled: Boolean
- }
- const hi = We(
- t.defineComponent({
- name: pi,
- props: vi,
- emits: ['change', 'exchange', 'update:code'],
- setup(e, { emit: o, slots: n }) {
- const [a, r] = wo(),
- l = t.ref(),
- i = t.ref(),
- s = t.ref(0),
- c = t.ref(0),
- d = t.ref(e.code),
- u = t.computed(
- () =>
- !e.exchangeButtonLoading &&
- (e.exchangeButtonDisabled || !d.value || d.value.length < e.exchangeMinLength)
- ),
- p = () => {
- const e = P(l).height,
- t = P(i).height + 44
- c.value = (e > t ? e : ce.value) - t
- },
- m = () => {
- o('exchange', d.value), e.code || (d.value = '')
- },
- f = (e) => {
- t.nextTick(() => {
- var t
- return null == (t = a.value[e]) ? void 0 : t.scrollIntoView()
- })
- },
- v = () =>
- t.createVNode(
- ui,
- { image: e.emptyImage },
- {
- default: () => [t.createVNode('p', { class: mi('empty-tip') }, [fi('noCoupon')])]
- }
- ),
- h = () => {
- if (e.showExchangeBar)
- return t.createVNode('div', { ref: i, class: mi('exchange-bar') }, [
- t.createVNode(
- En,
- {
- modelValue: d.value,
- 'onUpdate:modelValue': (e) => (d.value = e),
- clearable: !0,
- border: !1,
- class: mi('field'),
- placeholder: e.inputPlaceholder || fi('placeholder'),
- maxlength: '20'
- },
- null
- ),
- t.createVNode(
- St,
- {
- plain: !0,
- type: 'primary',
- class: mi('exchange'),
- text: e.exchangeButtonText || fi('exchange'),
- loading: e.exchangeButtonLoading,
- disabled: u.value,
- onClick: m
- },
- null
- )
- ])
- },
- g = () => {
- const { coupons: a } = e,
- l = e.showCount ? ` (${a.length})` : '',
- i = (e.enabledTitle || fi('enable')) + l
- return t.createVNode(
- Zo,
- { title: i },
- {
- default: () => {
- var l
- return [
- t.createVNode(
- 'div',
- {
- class: mi('list', { 'with-bottom': e.showCloseButton }),
- style: { height: `${c.value}px` }
- },
- [
- a.map((n, a) =>
- t.createVNode(
- ti,
- {
- key: n.id,
- ref: r(a),
- coupon: n,
- chosen: a === e.chosenCoupon,
- currency: e.currency,
- onClick: () => o('change', a)
- },
- null
- )
- ),
- !a.length && v(),
- null == (l = n['list-footer']) ? void 0 : l.call(n)
- ]
- )
- ]
- }
- }
- )
- },
- b = () => {
- const { disabledCoupons: o } = e,
- a = e.showCount ? ` (${o.length})` : '',
- r = (e.disabledTitle || fi('disabled')) + a
- return t.createVNode(
- Zo,
- { title: r },
- {
- default: () => {
- var a
- return [
- t.createVNode(
- 'div',
- {
- class: mi('list', { 'with-bottom': e.showCloseButton }),
- style: { height: `${c.value}px` }
- },
- [
- o.map((o) =>
- t.createVNode(
- ti,
- { disabled: !0, key: o.id, coupon: o, currency: e.currency },
- null
- )
- ),
- !o.length && v(),
- null == (a = n['disabled-list-footer']) ? void 0 : a.call(n)
- ]
- )
- ]
- }
- }
- )
- }
- return (
- t.watch(
- () => e.code,
- (e) => {
- d.value = e
- }
- ),
- t.watch(ce, p),
- t.watch(d, (e) => o('update:code', e)),
- t.watch(() => e.displayedCouponIndex, f),
- t.onMounted(() => {
- p(), f(e.displayedCouponIndex)
- }),
- () =>
- t.createVNode('div', { ref: l, class: mi() }, [
- h(),
- t.createVNode(
- Ko,
- { active: s.value, 'onUpdate:active': (e) => (s.value = e), class: mi('tab') },
- { default: () => [g(), b()] }
- ),
- t.createVNode('div', { class: mi('bottom') }, [
- t.withDirectives(
- t.createVNode(
- St,
- {
- round: !0,
- block: !0,
- type: 'primary',
- class: mi('close'),
- text: e.closeButtonText || fi('close'),
- onClick: () => o('change', -1)
- },
- null
- ),
- [[t.vShow, e.showCloseButton]]
- )
- ])
- ])
- )
- }
- })
- ),
- gi = new Date().getFullYear(),
- [bi] = Ie('date-picker'),
- yi = d({}, gr, {
- columnsType: { type: Array, default: () => ['year', 'month', 'day'] },
- minDate: { type: Date, default: () => new Date(gi - 10, 0, 1), validator: l },
- maxDate: { type: Date, default: () => new Date(gi + 10, 11, 31), validator: l }
- })
- const wi = We(
- t.defineComponent({
- name: bi,
- props: yi,
- emits: ['confirm', 'cancel', 'change', 'update:modelValue'],
- setup(e, { emit: o, slots: n }) {
- const a = t.ref(e.modelValue),
- r = t.ref(!1),
- l = (t) => t === e.minDate.getFullYear(),
- i = (t) => t === e.maxDate.getFullYear(),
- s = (t) => {
- const { minDate: o, columnsType: n } = e,
- l = n.indexOf(t),
- i = r.value ? e.modelValue[l] : a.value[l]
- if (i) return +i
- switch (t) {
- case 'year':
- return o.getFullYear()
- case 'month':
- return o.getMonth() + 1
- case 'day':
- return o.getDate()
- }
- },
- c = () => {
- const t = s('year'),
- o = s('month'),
- n = l(t) && ((t) => t === e.minDate.getMonth() + 1)(o) ? e.minDate.getDate() : 1,
- a =
- i(t) && ((t) => t === e.maxDate.getMonth() + 1)(o)
- ? e.maxDate.getDate()
- : yr(t, o)
- return wr(n, a, 'day', e.formatter, e.filter)
- },
- d = t.computed(() =>
- e.columnsType.map((t) => {
- switch (t) {
- case 'year':
- return (() => {
- const t = e.minDate.getFullYear(),
- o = e.maxDate.getFullYear()
- return wr(t, o, 'year', e.formatter, e.filter)
- })()
- case 'month':
- return (() => {
- const t = s('year'),
- o = l(t) ? e.minDate.getMonth() + 1 : 1,
- n = i(t) ? e.maxDate.getMonth() + 1 : 12
- return wr(o, n, 'month', e.formatter, e.filter)
- })()
- case 'day':
- return c()
- default:
- return []
- }
- })
- )
- t.watch(a, (t) => {
- f(t, e.modelValue) || o('update:modelValue', t)
- }),
- t.watch(
- () => e.modelValue,
- (e, t) => {
- ;(r.value = f(t, a.value)),
- (e = xr(e, d.value)),
- f(e, a.value) || (a.value = e),
- (r.value = !1)
- },
- { immediate: !0 }
- )
- const u = (...e) => o('change', ...e),
- p = (...e) => o('cancel', ...e),
- v = (...e) => o('confirm', ...e)
- return () =>
- t.createVNode(
- un,
- t.mergeProps(
- {
- modelValue: a.value,
- 'onUpdate:modelValue': (e) => (a.value = e),
- columns: d.value,
- onChange: u,
- onCancel: p,
- onConfirm: v
- },
- m(e, br)
- ),
- n
- )
- }
- })
- ),
- [xi, Vi, Ni] = Ie('dialog'),
- ki = d({}, Et, {
- title: String,
- theme: String,
- width: g,
- message: [String, Function],
- callback: Function,
- allowHtml: Boolean,
- className: h,
- transition: N('van-dialog-bounce'),
- messageAlign: String,
- closeOnPopstate: b,
- showCancelButton: Boolean,
- cancelButtonText: String,
- cancelButtonColor: String,
- cancelButtonDisabled: Boolean,
- confirmButtonText: String,
- confirmButtonColor: String,
- confirmButtonDisabled: Boolean,
- showConfirmButton: b,
- closeOnClickOverlay: Boolean
- }),
- Ci = [...Lt, 'transition', 'closeOnPopstate']
- var Si = t.defineComponent({
- name: xi,
- props: ki,
- emits: ['confirm', 'cancel', 'keydown', 'update:show'],
- setup(e, { emit: o, slots: a }) {
- const r = t.ref(),
- l = t.reactive({ confirm: !1, cancel: !1 }),
- i = (e) => o('update:show', e),
- s = (t) => {
- var o
- i(!1), null == (o = e.callback) || o.call(e, t)
- },
- d = (t) => () => {
- e.show &&
- (o(t),
- e.beforeClose
- ? ((l[t] = !0),
- je(e.beforeClose, {
- args: [t],
- done() {
- s(t), (l[t] = !1)
- },
- canceled() {
- l[t] = !1
- }
- }))
- : s(t))
- },
- u = d('cancel'),
- p = d('confirm'),
- f = t.withKeys(
- (t) => {
- var n, a
- if (
- t.target !==
- (null == (a = null == (n = r.value) ? void 0 : n.popupRef) ? void 0 : a.value)
- )
- return
- ;({ Enter: e.showConfirmButton ? p : c, Escape: e.showCancelButton ? u : c }[t.key](),
- o('keydown', t))
- },
- ['enter', 'esc']
- ),
- v = () => {
- const o = a.title ? a.title() : e.title
- if (o)
- return t.createVNode(
- 'div',
- { class: Vi('header', { isolated: !e.message && !a.default }) },
- [o]
- )
- },
- h = (o) => {
- const { message: a, allowHtml: r, messageAlign: l } = e,
- i = Vi('message', { 'has-title': o, [l]: l }),
- s = n(a) ? a() : a
- return r && 'string' == typeof s
- ? t.createVNode('div', { class: i, innerHTML: s }, null)
- : t.createVNode('div', { class: i }, [s])
- },
- g = () => {
- if (a.default) return t.createVNode('div', { class: Vi('content') }, [a.default()])
- const { title: o, message: n, allowHtml: r } = e
- if (n) {
- const e = !(!o && !a.title)
- return t.createVNode(
- 'div',
- { key: r ? 1 : 0, class: Vi('content', { isolated: !e }) },
- [h(e)]
- )
- }
- },
- b = () =>
- a.footer
- ? a.footer()
- : 'round-button' === e.theme
- ? t.createVNode(
- Je,
- { class: Vi('footer') },
- {
- default: () => [
- e.showCancelButton &&
- t.createVNode(
- Dt,
- {
- type: 'warning',
- text: e.cancelButtonText || Ni('cancel'),
- class: Vi('cancel'),
- color: e.cancelButtonColor,
- loading: l.cancel,
- disabled: e.cancelButtonDisabled,
- onClick: u
- },
- null
- ),
- e.showConfirmButton &&
- t.createVNode(
- Dt,
- {
- type: 'danger',
- text: e.confirmButtonText || Ni('confirm'),
- class: Vi('confirm'),
- color: e.confirmButtonColor,
- loading: l.confirm,
- disabled: e.confirmButtonDisabled,
- onClick: p
- },
- null
- )
- ]
- }
- )
- : t.createVNode('div', { class: [ze, Vi('footer')] }, [
- e.showCancelButton &&
- t.createVNode(
- St,
- {
- size: 'large',
- text: e.cancelButtonText || Ni('cancel'),
- class: Vi('cancel'),
- style: { color: e.cancelButtonColor },
- loading: l.cancel,
- disabled: e.cancelButtonDisabled,
- onClick: u
- },
- null
- ),
- e.showConfirmButton &&
- t.createVNode(
- St,
- {
- size: 'large',
- text: e.confirmButtonText || Ni('confirm'),
- class: [Vi('confirm'), { [Ee]: e.showCancelButton }],
- style: { color: e.confirmButtonColor },
- loading: l.confirm,
- disabled: e.confirmButtonDisabled,
- onClick: p
- },
- null
- )
- ])
- return () => {
- const { width: o, title: n, theme: a, message: l, className: s } = e
- return t.createVNode(
- Gt,
- t.mergeProps(
- {
- ref: r,
- role: 'dialog',
- class: [Vi([a]), s],
- style: { width: de(o) },
- tabindex: 0,
- 'aria-labelledby': n || l,
- onKeydown: f,
- 'onUpdate:show': i
- },
- m(e, Ci)
- ),
- { default: () => [v(), g(), b()] }
- )
- }
- }
- })
- let Ti
- const Bi = {
- title: '',
- width: '',
- theme: null,
- message: '',
- overlay: !0,
- callback: null,
- teleport: 'body',
- className: '',
- allowHtml: !1,
- lockScroll: !0,
- transition: void 0,
- beforeClose: null,
- overlayClass: '',
- overlayStyle: void 0,
- messageAlign: '',
- cancelButtonText: '',
- cancelButtonColor: null,
- cancelButtonDisabled: !1,
- confirmButtonText: '',
- confirmButtonColor: null,
- confirmButtonDisabled: !1,
- showConfirmButton: !0,
- showCancelButton: !1,
- closeOnPopstate: !0,
- closeOnClickOverlay: !1
- }
- let Pi = d({}, Bi)
- function Di(e) {
- return u
- ? new Promise((o, n) => {
- Ti ||
- (function () {
- const e = {
- setup() {
- const { state: e, toggle: o } = jn()
- return () => t.createVNode(Si, t.mergeProps(e, { 'onUpdate:show': o }), null)
- }
- }
- ;({ instance: Ti } = Wn(e))
- })(),
- Ti.open(
- d({}, Pi, e, {
- callback: (e) => {
- ;('confirm' === e ? o : n)(e)
- }
- })
- )
- })
- : Promise.resolve()
- }
- const Oi = We(Si),
- [Ii, Ai] = Ie('divider'),
- zi = { dashed: Boolean, hairline: b, vertical: Boolean, contentPosition: N('center') }
- const Ei = We(
- t.defineComponent({
- name: Ii,
- props: zi,
- setup:
- (e, { slots: o }) =>
- () => {
- var n
- return t.createVNode(
- 'div',
- {
- role: 'separator',
- class: Ai({
- dashed: e.dashed,
- hairline: e.hairline,
- vertical: e.vertical,
- [`content-${e.contentPosition}`]: !!o.default && !e.vertical
- })
- },
- [!e.vertical && (null == (n = o.default) ? void 0 : n.call(o))]
- )
- }
- })
- ),
- [Li, $i] = Ie('dropdown-menu'),
- Mi = {
- overlay: b,
- zIndex: g,
- duration: V(0.2),
- direction: N('down'),
- activeColor: String,
- closeOnClickOutside: b,
- closeOnClickOverlay: b
- },
- Ri = Symbol(Li)
- var Fi = t.defineComponent({
- name: Li,
- props: Mi,
- setup(e, { slots: n }) {
- const a = yo(),
- r = t.ref(),
- l = t.ref(),
- i = t.ref(0),
- { children: s, linkChildren: c } = A(Ri),
- d = Z(r),
- u = t.computed(() => s.some((e) => e.state.showWrapper)),
- p = t.computed(() => {
- if (u.value && o(e.zIndex)) return { zIndex: +e.zIndex + 1 }
- }),
- m = () => {
- if (l.value) {
- const t = P(l)
- 'down' === e.direction ? (i.value = t.bottom) : (i.value = ce.value - t.top)
- }
- },
- f = (o, n) => {
- const { showPopup: r } = o.state,
- { disabled: l, titleClass: i } = o
- return t.createVNode(
- 'div',
- {
- id: `${a}-${n}`,
- role: 'button',
- tabindex: l ? void 0 : 0,
- class: [$i('item', { disabled: l }), { [Fe]: !l }],
- onClick: () => {
- var e
- l ||
- ((e = n),
- s.forEach((t, o) => {
- o === e ? t.toggle() : t.state.showPopup && t.toggle(!1, { immediate: !0 })
- }))
- }
- },
- [
- t.createVNode(
- 'span',
- {
- class: [$i('title', { down: r === ('down' === e.direction), active: r }), i],
- style: { color: r ? e.activeColor : '' }
- },
- [t.createVNode('div', { class: 'van-ellipsis' }, [o.renderTitle()])]
- )
- ]
- )
- }
- return (
- c({ id: a, props: e, offset: i, updateOffset: m }),
- W(r, () => {
- e.closeOnClickOutside &&
- s.forEach((e) => {
- e.toggle(!1)
- })
- }),
- j(
- 'scroll',
- () => {
- u.value && m()
- },
- { target: d, passive: !0 }
- ),
- () => {
- var e
- return t.createVNode('div', { ref: r, class: $i() }, [
- t.createVNode(
- 'div',
- { ref: l, style: p.value, class: $i('bar', { opened: u.value }) },
- [s.map(f)]
- ),
- null == (e = n.default) ? void 0 : e.call(n)
- ])
- }
- )
- }
- })
- const [Hi, ji] = Ie('dropdown-item'),
- Wi = {
- title: String,
- options: w(),
- disabled: Boolean,
- teleport: [String, Object],
- lazyRender: b,
- modelValue: h,
- titleClass: h
- }
- const Ui = We(
- t.defineComponent({
- name: Hi,
- inheritAttrs: !1,
- props: Wi,
- emits: ['open', 'opened', 'close', 'closed', 'change', 'update:modelValue'],
- setup(e, { emit: o, slots: n, attrs: a }) {
- const r = t.reactive({ showPopup: !1, transition: !0, showWrapper: !1 }),
- { parent: l, index: i } = D(Ri)
- if (!l) return
- const s = (e) => () => o(e),
- c = s('open'),
- d = s('close'),
- u = s('opened'),
- p = () => {
- ;(r.showWrapper = !1), o('closed')
- },
- m = (t) => {
- e.teleport && t.stopPropagation()
- },
- f = (n) => {
- const { activeColor: a } = l.props,
- i = n.value === e.modelValue
- return t.createVNode(
- wn,
- {
- role: 'menuitem',
- key: n.value,
- icon: n.icon,
- title: n.text,
- class: ji('option', { active: i }),
- style: { color: i ? a : '' },
- tabindex: i ? 0 : -1,
- clickable: !0,
- onClick: () => {
- ;(r.showPopup = !1),
- n.value !== e.modelValue &&
- (o('update:modelValue', n.value), o('change', n.value))
- }
- },
- {
- value: () => {
- if (i)
- return t.createVNode(
- ht,
- { class: ji('icon'), color: a, name: 'success' },
- null
- )
- }
- }
- )
- },
- v = () => {
- const { offset: o } = l,
- {
- zIndex: s,
- overlay: v,
- duration: h,
- direction: g,
- closeOnClickOverlay: b
- } = l.props,
- y = pe(s)
- return (
- 'down' === g ? (y.top = `${o.value}px`) : (y.bottom = `${o.value}px`),
- t.withDirectives(
- t.createVNode('div', t.mergeProps({ style: y, class: ji([g]), onClick: m }, a), [
- t.createVNode(
- Gt,
- {
- show: r.showPopup,
- 'onUpdate:show': (e) => (r.showPopup = e),
- role: 'menu',
- class: ji('content'),
- overlay: v,
- position: 'down' === g ? 'top' : 'bottom',
- duration: r.transition ? h : 0,
- lazyRender: e.lazyRender,
- overlayStyle: { position: 'absolute' },
- 'aria-labelledby': `${l.id}-${i.value}`,
- closeOnClickOverlay: b,
- onOpen: c,
- onClose: d,
- onOpened: u,
- onClosed: p
- },
- {
- default: () => {
- var t
- return [e.options.map(f), null == (t = n.default) ? void 0 : t.call(n)]
- }
- }
- )
- ]),
- [[t.vShow, r.showWrapper]]
- )
- )
- }
- return (
- Qe({
- state: r,
- toggle: (e = !r.showPopup, t = {}) => {
- e !== r.showPopup &&
- ((r.showPopup = e),
- (r.transition = !t.immediate),
- e && (l.updateOffset(), (r.showWrapper = !0)))
- },
- renderTitle: () => {
- if (n.title) return n.title()
- if (e.title) return e.title
- const t = e.options.find((t) => t.value === e.modelValue)
- return t ? t.text : ''
- }
- }),
- () =>
- e.teleport
- ? t.createVNode(t.Teleport, { to: e.teleport }, { default: () => [v()] })
- : v()
- )
- }
- })
- ),
- Yi = We(Fi),
- [qi, Xi] = Ie('grid'),
- Gi = {
- square: Boolean,
- center: b,
- border: b,
- gutter: g,
- reverse: Boolean,
- iconSize: g,
- direction: String,
- clickable: Boolean,
- columnNum: V(4)
- },
- Zi = Symbol(qi)
- const Ki = We(
- t.defineComponent({
- name: qi,
- props: Gi,
- setup(e, { slots: o }) {
- const { linkChildren: n } = A(Zi)
- return (
- n({ props: e }),
- () => {
- var n
- return t.createVNode(
- 'div',
- {
- style: { paddingLeft: de(e.gutter) },
- class: [Xi(), { [ze]: e.border && !e.gutter }]
- },
- [null == (n = o.default) ? void 0 : n.call(o)]
- )
- }
- )
- }
- })
- ),
- [_i, Ji] = Ie('grid-item'),
- Qi = d({}, et, {
- dot: Boolean,
- text: String,
- icon: String,
- badge: g,
- iconColor: String,
- iconPrefix: String,
- badgeProps: Object
- })
- const es = We(
- t.defineComponent({
- name: _i,
- props: Qi,
- setup(e, { slots: o }) {
- const { parent: n, index: a } = D(Zi),
- r = ot()
- if (!n) return
- const l = t.computed(() => {
- const { square: e, gutter: t, columnNum: o } = n.props,
- r = 100 / +o + '%',
- l = { flexBasis: r }
- if (e) l.paddingTop = r
- else if (t) {
- const e = de(t)
- ;(l.paddingRight = e), a.value >= +o && (l.marginTop = e)
- }
- return l
- }),
- i = t.computed(() => {
- const { square: e, gutter: t } = n.props
- if (e && t) {
- const e = de(t)
- return { right: e, bottom: e, height: 'auto' }
- }
- })
- return () => {
- const {
- center: a,
- border: s,
- square: c,
- gutter: d,
- reverse: u,
- direction: p,
- clickable: m
- } = n.props,
- f = [
- Ji('content', [
- p,
- { center: a, square: c, reverse: u, clickable: m, surround: s && d }
- ]),
- { [Ae]: s }
- ]
- return t.createVNode('div', { class: [Ji({ square: c })], style: l.value }, [
- t.createVNode(
- 'div',
- {
- role: m ? 'button' : void 0,
- class: f,
- style: i.value,
- tabindex: m ? 0 : void 0,
- onClick: r
- },
- [
- o.default
- ? o.default()
- : [
- o.icon
- ? t.createVNode(
- lt,
- t.mergeProps({ dot: e.dot, content: e.badge }, e.badgeProps),
- { default: o.icon }
- )
- : e.icon
- ? t.createVNode(
- ht,
- {
- dot: e.dot,
- name: e.icon,
- size: n.props.iconSize,
- badge: e.badge,
- class: Ji('icon'),
- color: e.iconColor,
- badgeProps: e.badgeProps,
- classPrefix: e.iconPrefix
- },
- null
- )
- : void 0,
- o.text
- ? o.text()
- : e.text
- ? t.createVNode('span', { class: Ji('text') }, [e.text])
- : void 0
- ]
- ]
- )
- ])
- }
- }
- })
- ),
- ts = (e) => Math.sqrt((e[0].clientX - e[1].clientX) ** 2 + (e[0].clientY - e[1].clientY) ** 2),
- os = Ie('image-preview')[1]
- var ns = t.defineComponent({
- props: {
- src: String,
- show: Boolean,
- active: Number,
- minZoom: y(g),
- maxZoom: y(g),
- rootWidth: y(Number),
- rootHeight: y(Number),
- disableZoom: Boolean
- },
- emits: ['scale', 'close', 'longPress'],
- setup(e, { emit: o, slots: n }) {
- const a = t.reactive({
- scale: 1,
- moveX: 0,
- moveY: 0,
- moving: !1,
- zooming: !1,
- imageRatio: 0
- }),
- r = $t(),
- l = t.ref(),
- i = t.ref(),
- s = t.ref(!1),
- c = t.ref(!1)
- let d = 0
- const u = t.computed(() => {
- const { scale: e, moveX: t, moveY: o, moving: n, zooming: r } = a,
- l = { transitionDuration: r || n ? '0s' : '.3s' }
- return (1 !== e || c.value) && (l.transform = `matrix(${e}, 0, 0, ${e}, ${t}, ${o})`), l
- }),
- p = t.computed(() => {
- if (a.imageRatio) {
- const { rootWidth: t, rootHeight: o } = e,
- n = s.value ? o / a.imageRatio : t
- return Math.max(0, (a.scale * n - t) / 2)
- }
- return 0
- }),
- m = t.computed(() => {
- if (a.imageRatio) {
- const { rootWidth: t, rootHeight: o } = e,
- n = s.value ? o : t * a.imageRatio
- return Math.max(0, (a.scale * n - o) / 2)
- }
- return 0
- }),
- f = (t, n) => {
- var r
- if ((t = ye(t, +e.minZoom, +e.maxZoom + 1)) !== a.scale) {
- const i = t / a.scale
- if (((a.scale = t), n)) {
- const e = P(null == (r = l.value) ? void 0 : r.$el),
- t = { x: 0.5 * e.width, y: 0.5 * e.height },
- o = a.moveX - (n.x - e.left - t.x) * (i - 1),
- s = a.moveY - (n.y - e.top - t.y) * (i - 1)
- ;(a.moveX = ye(o, -p.value, p.value)), (a.moveY = ye(s, -m.value, m.value))
- } else (a.moveX = 0), (a.moveY = c.value ? d : 0)
- o('scale', { scale: t, index: e.active })
- }
- },
- v = () => {
- f(1)
- }
- let h,
- g,
- b,
- y,
- w,
- x,
- V,
- N,
- k = !1
- const C = (t) => {
- const { touches: o } = t
- if (((h = o.length), 2 === h && e.disableZoom)) return
- const { offsetX: n } = r
- r.start(t),
- (g = a.moveX),
- (b = a.moveY),
- (N = Date.now()),
- (k = !1),
- (a.moving = 1 === h && (1 !== a.scale || c.value)),
- (a.zooming = 2 === h && !n.value),
- a.zooming && ((y = a.scale), (w = ts(o)))
- },
- S = () => {
- if (h > 1) return
- const { offsetX: e, offsetY: t } = r,
- n = Date.now() - N
- e.value < 5 &&
- t.value < 5 &&
- (n < 250
- ? V
- ? (clearTimeout(V),
- (V = null),
- (() => {
- const e = a.scale > 1 ? 1 : 2
- f(e, 2 === e || c.value ? { x: r.startX.value, y: r.startY.value } : void 0)
- })())
- : (V = setTimeout(() => {
- o('close'), (V = null)
- }, 250))
- : n > 500 && o('longPress'))
- },
- T = (t) => {
- let o = !1
- if (
- (a.moving || a.zooming) &&
- ((o = !0), a.moving && g === a.moveX && b === a.moveY && (o = !1), !t.touches.length)
- ) {
- a.zooming &&
- ((a.moveX = ye(a.moveX, -p.value, p.value)),
- (a.moveY = ye(a.moveY, -m.value, m.value)),
- (a.zooming = !1)),
- (a.moving = !1),
- (g = 0),
- (b = 0),
- (y = 1),
- a.scale < 1 && v()
- const t = +e.maxZoom
- a.scale > t && f(t, x)
- }
- le(t, o), S(), r.reset()
- },
- B = () => {
- const { rootWidth: t, rootHeight: o } = e,
- n = o / t,
- { imageRatio: r } = a
- ;(s.value = a.imageRatio > n && r < 2.6),
- (c.value = a.imageRatio > n && r >= 2.6),
- c.value && ((d = (r * t - o) / 2), (a.moveY = d)),
- v()
- },
- D = (e) => {
- const { naturalWidth: t, naturalHeight: o } = e.target
- ;(a.imageRatio = o / t), B()
- }
- return (
- t.watch(() => e.active, v),
- t.watch(
- () => e.show,
- (e) => {
- e || v()
- }
- ),
- t.watch(() => [e.rootWidth, e.rootHeight], B),
- j(
- 'touchmove',
- (e) => {
- const { touches: t } = e
- if ((r.move(e), a.moving)) {
- const { deltaX: t, deltaY: o } = r,
- n = t.value + g,
- l = o.value + b
- if ((n > p.value || n < -p.value) && !k && r.isHorizontal())
- return void (a.moving = !1)
- ;(k = !0),
- le(e, !0),
- (a.moveX = ye(n, -p.value, p.value)),
- (a.moveY = ye(l, -m.value, m.value))
- }
- if (a.zooming && (le(e, !0), 2 === t.length)) {
- const e = ts(t),
- o = (y * e) / w
- ;(x = ((e) => ({
- x: (e[0].clientX + e[1].clientX) / 2,
- y: (e[0].clientY + e[1].clientY) / 2
- }))(t)),
- f(o, x)
- }
- },
- {
- target: t.computed(() => {
- var e
- return null == (e = i.value) ? void 0 : e.$el
- })
- }
- ),
- () => {
- const o = { loading: () => t.createVNode(Vt, { type: 'spinner' }, null) }
- return t.createVNode(
- Yo,
- {
- ref: i,
- class: os('swipe-item'),
- onTouchstartPassive: C,
- onTouchend: T,
- onTouchcancel: T
- },
- {
- default: () => [
- n.image
- ? t.createVNode('div', { class: os('image-wrap') }, [n.image({ src: e.src })])
- : t.createVNode(
- zr,
- {
- ref: l,
- src: e.src,
- fit: 'contain',
- class: os('image', { vertical: s.value }),
- style: u.value,
- onLoad: D
- },
- o
- )
- ]
- }
- )
- }
- )
- }
- })
- const [as, rs] = Ie('image-preview'),
- ls = ['show', 'teleport', 'transition', 'overlayStyle', 'closeOnPopstate'],
- is = {
- show: Boolean,
- loop: b,
- images: w(),
- minZoom: V(1 / 3),
- maxZoom: V(3),
- overlay: b,
- closeable: Boolean,
- showIndex: b,
- className: h,
- closeIcon: N('clear'),
- transition: String,
- beforeClose: Function,
- overlayClass: h,
- overlayStyle: Object,
- swipeDuration: V(300),
- startPosition: V(0),
- showIndicators: Boolean,
- closeOnPopstate: b,
- closeIconPosition: N('top-right'),
- teleport: [String, Object]
- }
- var ss = t.defineComponent({
- name: as,
- props: is,
- emits: ['scale', 'close', 'closed', 'change', 'longPress', 'update:show'],
- setup(e, { emit: o, slots: n }) {
- const a = t.ref(),
- r = t.reactive({ active: 0, rootWidth: 0, rootHeight: 0, disableZoom: !1 }),
- l = () => {
- if (a.value) {
- const e = P(a.value.$el)
- ;(r.rootWidth = e.width), (r.rootHeight = e.height), a.value.resize()
- }
- },
- i = (e) => o('scale', e),
- s = (e) => o('update:show', e),
- c = () => {
- je(e.beforeClose, { args: [r.active], done: () => s(!1) })
- },
- d = (e) => {
- e !== r.active && ((r.active = e), o('change', e))
- },
- u = () => {
- if (e.showIndex)
- return t.createVNode('div', { class: rs('index') }, [
- n.index ? n.index({ index: r.active }) : `${r.active + 1} / ${e.images.length}`
- ])
- },
- p = () => {
- if (n.cover) return t.createVNode('div', { class: rs('cover') }, [n.cover()])
- },
- f = () => {
- r.disableZoom = !0
- },
- v = () => {
- r.disableZoom = !1
- },
- h = () => {
- if (e.closeable)
- return t.createVNode(
- ht,
- {
- role: 'button',
- name: e.closeIcon,
- class: [rs('close-icon', e.closeIconPosition), Fe],
- onClick: c
- },
- null
- )
- },
- g = () => o('closed'),
- b = (e, t) => {
- var o
- return null == (o = a.value) ? void 0 : o.swipeTo(e, t)
- }
- return (
- Qe({ swipeTo: b }),
- t.onMounted(l),
- t.watch([se, ce], l),
- t.watch(
- () => e.startPosition,
- (e) => d(+e)
- ),
- t.watch(
- () => e.show,
- (n) => {
- const { images: a, startPosition: i } = e
- n
- ? (d(+i),
- t.nextTick(() => {
- l(), b(+i, { immediate: !0 })
- }))
- : o('close', { index: r.active, url: a[r.active] })
- }
- ),
- () =>
- t.createVNode(
- Gt,
- t.mergeProps(
- {
- class: [rs(), e.className],
- overlayClass: [rs('overlay'), e.overlayClass],
- onClosed: g,
- 'onUpdate:show': s
- },
- m(e, ls)
- ),
- {
- default: () => [
- h(),
- t.createVNode(
- Do,
- {
- ref: a,
- lazyRender: !0,
- loop: e.loop,
- class: rs('swipe'),
- duration: e.swipeDuration,
- initialSwipe: e.startPosition,
- showIndicators: e.showIndicators,
- indicatorColor: 'white',
- onChange: d,
- onDragEnd: v,
- onDragStart: f
- },
- {
- default: () => [
- e.images.map((a, l) =>
- t.createVNode(
- ns,
- {
- src: a,
- show: e.show,
- active: r.active,
- maxZoom: e.maxZoom,
- minZoom: e.minZoom,
- rootWidth: r.rootWidth,
- rootHeight: r.rootHeight,
- disableZoom: r.disableZoom,
- onScale: i,
- onClose: c,
- onLongPress: () => o('longPress', { index: l })
- },
- { image: n.image }
- )
- )
- ]
- }
- ),
- u(),
- p()
- ]
- }
- )
- )
- }
- })
- let cs
- const ds = {
- loop: !0,
- images: [],
- maxZoom: 3,
- minZoom: 1 / 3,
- onScale: void 0,
- onClose: void 0,
- onChange: void 0,
- teleport: 'body',
- className: '',
- showIndex: !0,
- closeable: !1,
- closeIcon: 'clear',
- transition: void 0,
- beforeClose: void 0,
- overlayStyle: void 0,
- overlayClass: void 0,
- startPosition: 0,
- swipeDuration: 300,
- showIndicators: !1,
- closeOnPopstate: !0,
- closeIconPosition: 'top-right'
- }
- const us = (e, o = 0) => {
- if (u)
- return (
- cs ||
- ({ instance: cs } = Wn({
- setup() {
- const { state: e, toggle: o } = jn(),
- n = () => {
- e.images = []
- }
- return () =>
- t.createVNode(ss, t.mergeProps(e, { onClosed: n, 'onUpdate:show': o }), null)
- }
- })),
- (e = Array.isArray(e) ? { images: e, startPosition: o } : e),
- cs.open(d({}, ds, e)),
- cs
- )
- },
- ps = We(ss)
- const [ms, fs] = Ie('index-bar'),
- vs = {
- sticky: b,
- zIndex: g,
- teleport: [String, Object],
- highlightColor: String,
- stickyOffsetTop: x(0),
- indexList: {
- type: Array,
- default: function () {
- const e = 'A'.charCodeAt(0)
- return Array(26)
- .fill('')
- .map((t, o) => String.fromCharCode(e + o))
- }
- }
- },
- hs = Symbol(ms)
- var gs = t.defineComponent({
- name: ms,
- props: vs,
- emits: ['select', 'change'],
- setup(e, { emit: n, slots: a }) {
- const r = t.ref(),
- l = t.ref(),
- i = t.ref(''),
- s = $t(),
- c = Z(r),
- { children: d, linkChildren: u } = A(hs)
- let p
- u({ props: e })
- const m = t.computed(() => {
- if (o(e.zIndex)) return { zIndex: +e.zIndex + 1 }
- }),
- f = t.computed(() => {
- if (e.highlightColor) return { color: e.highlightColor }
- }),
- v = (t, o) => {
- for (let n = d.length - 1; n >= 0; n--) {
- const a = n > 0 ? o[n - 1].height : 0
- if (t + (e.sticky ? a + e.stickyOffsetTop : 0) >= o[n].top) return n
- }
- return -1
- },
- h = (e) => d.find((t) => String(t.index) === e),
- g = () => {
- if (ie(r)) return
- const { sticky: t, indexList: o } = e,
- n = J(c.value),
- a = P(c),
- l = d.map((e) => e.getRect(c.value, a))
- let s = -1
- if (p) {
- const e = h(p)
- if (e) {
- const t = e.getRect(c.value, a)
- s = v(t.top, l)
- }
- } else s = v(n, l)
- ;(i.value = o[s]),
- t &&
- d.forEach((t, o) => {
- const { state: r, $el: i } = t
- if (o === s || o === s - 1) {
- const e = i.getBoundingClientRect()
- ;(r.left = e.left), (r.width = e.width)
- } else (r.left = null), (r.width = null)
- if (o === s)
- (r.active = !0), (r.top = Math.max(e.stickyOffsetTop, l[o].top - n) + a.top)
- else if (o === s - 1 && '' === p) {
- const e = l[s].top - n
- ;(r.active = e > 0), (r.top = e + a.top - l[o].height)
- } else r.active = !1
- }),
- (p = '')
- },
- b = () => {
- t.nextTick(g)
- }
- j('scroll', g, { target: c, passive: !0 }),
- t.onMounted(b),
- t.watch(() => e.indexList, b),
- t.watch(i, (e) => {
- e && n('change', e)
- })
- const y = (t) => {
- p = String(t)
- const o = h(p)
- if (o) {
- const t = J(c.value),
- a = P(c),
- { offsetHeight: r } = document.documentElement
- if ((o.$el.scrollIntoView(), t === r - a.height)) return void g()
- e.sticky && e.stickyOffsetTop && te(ee() - e.stickyOffsetTop), n('select', o.index)
- }
- },
- w = (e) => {
- const { index: t } = e.dataset
- t && y(t)
- },
- x = (e) => {
- w(e.target)
- }
- let V
- const N = () =>
- t.createVNode(
- 'div',
- {
- ref: l,
- class: fs('sidebar'),
- style: m.value,
- onClick: x,
- onTouchstartPassive: s.start
- },
- [
- e.indexList.map((e) => {
- const o = e === i.value
- return t.createVNode(
- 'span',
- { class: fs('index', { active: o }), style: o ? f.value : void 0, 'data-index': e },
- [e]
- )
- })
- ]
- )
- return (
- Qe({ scrollTo: y }),
- j(
- 'touchmove',
- (e) => {
- if ((s.move(e), s.isVertical())) {
- le(e)
- const { clientX: t, clientY: o } = e.touches[0],
- n = document.elementFromPoint(t, o)
- if (n) {
- const { index: e } = n.dataset
- e && V !== e && ((V = e), w(n))
- }
- }
- },
- { target: l }
- ),
- () => {
- var o
- return t.createVNode('div', { ref: r, class: fs() }, [
- e.teleport
- ? t.createVNode(t.Teleport, { to: e.teleport }, { default: () => [N()] })
- : N(),
- null == (o = a.default) ? void 0 : o.call(a)
- ])
- }
- )
- }
- })
- const [bs, ys] = Ie('index-anchor'),
- ws = { index: g }
- const xs = We(
- t.defineComponent({
- name: bs,
- props: ws,
- setup(e, { slots: o }) {
- const n = t.reactive({
- top: 0,
- left: null,
- rect: { top: 0, height: 0 },
- width: null,
- active: !1
- }),
- a = t.ref(),
- { parent: r } = D(hs)
- if (!r) return
- const l = () => n.active && r.props.sticky,
- i = t.computed(() => {
- const { zIndex: e, highlightColor: t } = r.props
- if (l())
- return d(pe(e), {
- left: n.left ? `${n.left}px` : void 0,
- width: n.width ? `${n.width}px` : void 0,
- transform: n.top ? `translate3d(0, ${n.top}px, 0)` : void 0,
- color: t
- })
- })
- return (
- Qe({
- state: n,
- getRect: (e, t) => {
- const o = P(a)
- return (
- (n.rect.height = o.height),
- e === window || e === document.body
- ? (n.rect.top = o.top + ee())
- : (n.rect.top = o.top + J(e) - t.top),
- n.rect
- )
- }
- }),
- () => {
- const r = l()
- return t.createVNode(
- 'div',
- { ref: a, style: { height: r ? `${n.rect.height}px` : void 0 } },
- [
- t.createVNode(
- 'div',
- { style: i.value, class: [ys({ sticky: r }), { [Le]: r }] },
- [o.default ? o.default() : e.index]
- )
- ]
- )
- }
- )
- }
- })
- ),
- Vs = We(gs),
- [Ns, ks, Cs] = Ie('list'),
- Ss = {
- error: Boolean,
- offset: V(300),
- loading: Boolean,
- disabled: Boolean,
- finished: Boolean,
- errorText: String,
- direction: N('down'),
- loadingText: String,
- finishedText: String,
- immediateCheck: b
- }
- const Ts = We(
- t.defineComponent({
- name: Ns,
- props: Ss,
- emits: ['load', 'update:error', 'update:loading'],
- setup(e, { emit: o, slots: n }) {
- const a = t.ref(e.loading),
- r = t.ref(),
- l = t.ref(),
- i = t.inject(Ro, null),
- s = Z(r),
- c = () => {
- t.nextTick(() => {
- if (
- a.value ||
- e.finished ||
- e.disabled ||
- e.error ||
- !1 === (null == i ? void 0 : i.value)
- )
- return
- const { direction: t } = e,
- n = +e.offset,
- c = P(s)
- if (!c.height || ie(r)) return
- let d = !1
- const u = P(l)
- ;(d = 'up' === t ? c.top - u.top <= n : u.bottom - c.bottom <= n),
- d && ((a.value = !0), o('update:loading', !0), o('load'))
- })
- },
- d = () => {
- if (e.finished) {
- const o = n.finished ? n.finished() : e.finishedText
- if (o) return t.createVNode('div', { class: ks('finished-text') }, [o])
- }
- },
- u = () => {
- o('update:error', !1), c()
- },
- p = () => {
- if (e.error) {
- const o = n.error ? n.error() : e.errorText
- if (o)
- return t.createVNode(
- 'div',
- { role: 'button', class: ks('error-text'), tabindex: 0, onClick: u },
- [o]
- )
- }
- },
- m = () => {
- if (a.value && !e.finished && !e.disabled)
- return t.createVNode('div', { class: ks('loading') }, [
- n.loading
- ? n.loading()
- : t.createVNode(
- Vt,
- { class: ks('loading-icon') },
- { default: () => [e.loadingText || Cs('loading')] }
- )
- ])
- }
- return (
- t.watch(() => [e.loading, e.finished, e.error], c),
- i &&
- t.watch(i, (e) => {
- e && c()
- }),
- t.onUpdated(() => {
- a.value = e.loading
- }),
- t.onMounted(() => {
- e.immediateCheck && c()
- }),
- Qe({ check: c }),
- j('scroll', c, { target: s, passive: !0 }),
- () => {
- var o
- const i = null == (o = n.default) ? void 0 : o.call(n),
- s = t.createVNode('div', { ref: l, class: ks('placeholder') }, null)
- return t.createVNode(
- 'div',
- { ref: r, role: 'feed', class: ks(), 'aria-busy': a.value },
- ['down' === e.direction ? i : s, m(), d(), p(), 'up' === e.direction ? i : s]
- )
- }
- )
- }
- })
- ),
- [Bs, Ps] = Ie('nav-bar'),
- Ds = {
- title: String,
- fixed: Boolean,
- zIndex: g,
- border: b,
- leftText: String,
- rightText: String,
- leftArrow: Boolean,
- placeholder: Boolean,
- safeAreaInsetTop: Boolean,
- clickable: b
- }
- const Os = We(
- t.defineComponent({
- name: Bs,
- props: Ds,
- emits: ['clickLeft', 'clickRight'],
- setup(e, { emit: o, slots: n }) {
- const a = t.ref(),
- r = Xe(a, Ps),
- l = (e) => o('clickLeft', e),
- i = (e) => o('clickRight', e),
- s = () => {
- const { title: o, fixed: r, border: s, zIndex: c } = e,
- d = pe(c),
- u = e.leftArrow || e.leftText || n.left,
- p = e.rightText || n.right
- return t.createVNode(
- 'div',
- {
- ref: a,
- style: d,
- class: [Ps({ fixed: r }), { [Le]: s, 'van-safe-area-top': e.safeAreaInsetTop }]
- },
- [
- t.createVNode('div', { class: Ps('content') }, [
- u &&
- t.createVNode(
- 'div',
- { class: [Ps('left'), e.clickable ? Fe : ''], onClick: l },
- [
- n.left
- ? n.left()
- : [
- e.leftArrow &&
- t.createVNode(
- ht,
- { class: Ps('arrow'), name: 'arrow-left' },
- null
- ),
- e.leftText &&
- t.createVNode('span', { class: Ps('text') }, [e.leftText])
- ]
- ]
- ),
- t.createVNode('div', { class: [Ps('title'), 'van-ellipsis'] }, [
- n.title ? n.title() : o
- ]),
- p &&
- t.createVNode(
- 'div',
- { class: [Ps('right'), e.clickable ? Fe : ''], onClick: i },
- [
- n.right
- ? n.right()
- : t.createVNode('span', { class: Ps('text') }, [e.rightText])
- ]
- )
- ])
- ]
- )
- }
- return () => (e.fixed && e.placeholder ? r(s) : s())
- }
- })
- ),
- [Is, As] = Ie('notice-bar'),
- zs = {
- text: String,
- mode: String,
- color: String,
- delay: V(1),
- speed: V(60),
- leftIcon: String,
- wrapable: Boolean,
- background: String,
- scrollable: { type: Boolean, default: null }
- }
- const Es = We(
- t.defineComponent({
- name: Is,
- props: zs,
- emits: ['close', 'replay'],
- setup(e, { emit: n, slots: a }) {
- let r,
- l = 0,
- i = 0
- const s = t.ref(),
- c = t.ref(),
- d = t.reactive({ show: !0, offset: 0, duration: 0 }),
- u = (t) => {
- 'closeable' === e.mode && ((d.show = !1), n('close', t))
- },
- p = () => {
- if (a['right-icon']) return a['right-icon']()
- const o = 'closeable' === e.mode ? 'cross' : 'link' === e.mode ? 'arrow' : void 0
- return o
- ? t.createVNode(ht, { name: o, class: As('right-icon'), onClick: u }, null)
- : void 0
- },
- m = () => {
- ;(d.offset = l),
- (d.duration = 0),
- C(() => {
- T(() => {
- ;(d.offset = -i), (d.duration = (i + l) / +e.speed), n('replay')
- })
- })
- },
- f = () => {
- const o = !1 === e.scrollable && !e.wrapable,
- n = {
- transform: d.offset ? `translateX(${d.offset}px)` : '',
- transitionDuration: `${d.duration}s`
- }
- return t.createVNode('div', { ref: s, role: 'marquee', class: As('wrap') }, [
- t.createVNode(
- 'div',
- {
- ref: c,
- style: n,
- class: [As('content'), { 'van-ellipsis': o }],
- onTransitionend: m
- },
- [a.default ? a.default() : e.text]
- )
- ])
- },
- v = () => {
- const { delay: t, speed: n, scrollable: a } = e,
- u = o(t) ? 1e3 * +t : 0
- ;(l = 0),
- (i = 0),
- (d.offset = 0),
- (d.duration = 0),
- clearTimeout(r),
- (r = setTimeout(() => {
- if (!s.value || !c.value || !1 === a) return
- const e = P(s).width,
- t = P(c).width
- ;(a || t > e) &&
- T(() => {
- ;(l = e), (i = t), (d.offset = -i), (d.duration = i / +n)
- })
- }, u))
- }
- return (
- Ye(v),
- H(v),
- j('pageshow', v),
- Qe({ reset: v }),
- t.watch(() => [e.text, e.scrollable], v),
- () => {
- const { color: o, wrapable: n, background: r } = e
- return t.withDirectives(
- t.createVNode(
- 'div',
- { role: 'alert', class: As({ wrapable: n }), style: { color: o, background: r } },
- [
- a['left-icon']
- ? a['left-icon']()
- : e.leftIcon
- ? t.createVNode(ht, { class: As('left-icon'), name: e.leftIcon }, null)
- : void 0,
- f(),
- p()
- ]
- ),
- [[t.vShow, d.show]]
- )
- }
- )
- }
- })
- ),
- [Ls, $s] = Ie('notify'),
- Ms = d({}, Et, {
- type: N('danger'),
- color: String,
- message: g,
- position: N('top'),
- className: h,
- background: String,
- lockScroll: Boolean
- })
- var Rs = t.defineComponent({
- name: Ls,
- props: Ms,
- emits: ['update:show'],
- setup(e, { emit: o, slots: n }) {
- const a = (e) => o('update:show', e)
- return () =>
- t.createVNode(
- Gt,
- {
- show: e.show,
- class: [$s([e.type]), e.className],
- style: { color: e.color, background: e.background },
- overlay: !1,
- zIndex: e.zIndex,
- position: e.position,
- duration: 0.2,
- lockScroll: e.lockScroll,
- 'onUpdate:show': a
- },
- { default: () => [n.default ? n.default() : e.message] }
- )
- }
- })
- let Fs, Hs
- let js = {
- type: 'danger',
- color: void 0,
- message: '',
- onClose: void 0,
- onClick: void 0,
- onOpened: void 0,
- duration: 3e3,
- position: void 0,
- className: '',
- lockScroll: !1,
- background: void 0
- }
- const Ws = () => {
- Hs && Hs.toggle(!1)
- }
- const Us = We(Rs),
- [Ys, qs] = Ie('key'),
- Xs = t.createVNode('svg', { class: qs('collapse-icon'), viewBox: '0 0 30 24' }, [
- t.createVNode(
- 'path',
- {
- d: 'M26 13h-2v2h2v-2zm-8-3h2V8h-2v2zm2-4h2V4h-2v2zm2 4h4V4h-2v4h-2v2zm-7 14 3-3h-6l3 3zM6 13H4v2h2v-2zm16 0H8v2h14v-2zm-12-3h2V8h-2v2zM28 0l1 1 1 1v15l-1 2H1l-1-2V2l1-1 1-1zm0 2H2v15h26V2zM6 4v2H4V4zm10 2h2V4h-2v2zM8 9v1H4V8zm8 0v1h-2V8zm-6-5v2H8V4zm4 0v2h-2V4z',
- fill: 'currentColor'
- },
- null
- )
- ]),
- Gs = t.createVNode('svg', { class: qs('delete-icon'), viewBox: '0 0 32 22' }, [
- t.createVNode(
- 'path',
- {
- d: 'M28 0a4 4 0 0 1 4 4v14a4 4 0 0 1-4 4H10.4a2 2 0 0 1-1.4-.6L1 13.1c-.6-.5-.9-1.3-.9-2 0-1 .3-1.7.9-2.2L9 .6a2 2 0 0 1 1.4-.6zm0 2H10.4l-8.2 8.3a1 1 0 0 0-.3.7c0 .3.1.5.3.7l8.2 8.4H28a2 2 0 0 0 2-2V4c0-1.1-.9-2-2-2zm-5 4a1 1 0 0 1 .7.3 1 1 0 0 1 0 1.4L20.4 11l3.3 3.3c.2.2.3.5.3.7 0 .3-.1.5-.3.7a1 1 0 0 1-.7.3 1 1 0 0 1-.7-.3L19 12.4l-3.4 3.3a1 1 0 0 1-.6.3 1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.2.1-.5.3-.7l3.3-3.3-3.3-3.3A1 1 0 0 1 14 7c0-.3.1-.5.3-.7A1 1 0 0 1 15 6a1 1 0 0 1 .6.3L19 9.6l3.3-3.3A1 1 0 0 1 23 6z',
- fill: 'currentColor'
- },
- null
- )
- ])
- var Zs = t.defineComponent({
- name: Ys,
- props: {
- type: String,
- text: g,
- color: String,
- wider: Boolean,
- large: Boolean,
- loading: Boolean
- },
- emits: ['press'],
- setup(e, { emit: o, slots: n }) {
- const a = t.ref(!1),
- r = $t(),
- l = (e) => {
- r.start(e), (a.value = !0)
- },
- i = (e) => {
- r.move(e), r.direction.value && (a.value = !1)
- },
- s = (t) => {
- a.value && (n.default || le(t), (a.value = !1), o('press', e.text, e.type))
- },
- c = () => {
- if (e.loading) return t.createVNode(Vt, { class: qs('loading-icon') }, null)
- const o = n.default ? n.default() : e.text
- switch (e.type) {
- case 'delete':
- return o || Gs
- case 'extra':
- return o || Xs
- default:
- return o
- }
- }
- return () =>
- t.createVNode(
- 'div',
- {
- class: qs('wrapper', { wider: e.wider }),
- onTouchstartPassive: l,
- onTouchmovePassive: i,
- onTouchend: s,
- onTouchcancel: s
- },
- [
- t.createVNode(
- 'div',
- {
- role: 'button',
- tabindex: 0,
- class: qs([
- e.color,
- { large: e.large, active: a.value, delete: 'delete' === e.type }
- ])
- },
- [c()]
- )
- ]
- )
- }
- })
- const [Ks, _s] = Ie('number-keyboard'),
- Js = {
- show: Boolean,
- title: String,
- theme: N('default'),
- zIndex: g,
- teleport: [String, Object],
- maxlength: V(1 / 0),
- modelValue: N(''),
- transition: b,
- blurOnClose: b,
- showDeleteKey: b,
- randomKeyOrder: Boolean,
- closeButtonText: String,
- deleteButtonText: String,
- closeButtonLoading: Boolean,
- hideOnClickOutside: b,
- safeAreaInsetBottom: b,
- extraKey: { type: [String, Array], default: '' }
- }
- const Qs = We(
- t.defineComponent({
- name: Ks,
- inheritAttrs: !1,
- props: Js,
- emits: ['show', 'hide', 'blur', 'input', 'close', 'delete', 'update:modelValue'],
- setup(e, { emit: o, slots: n, attrs: a }) {
- const r = t.ref(),
- l = () => {
- const t = Array(9)
- .fill('')
- .map((e, t) => ({ text: t + 1 }))
- return (
- e.randomKeyOrder &&
- (function (e) {
- for (let t = e.length - 1; t > 0; t--) {
- const o = Math.floor(Math.random() * (t + 1)),
- n = e[t]
- ;(e[t] = e[o]), (e[o] = n)
- }
- })(t),
- t
- )
- },
- i = t.computed(() =>
- 'custom' === e.theme
- ? (() => {
- const t = l(),
- { extraKey: o } = e,
- n = Array.isArray(o) ? o : [o]
- return (
- 1 === n.length
- ? t.push({ text: 0, wider: !0 }, { text: n[0], type: 'extra' })
- : 2 === n.length &&
- t.push(
- { text: n[0], type: 'extra' },
- { text: 0 },
- { text: n[1], type: 'extra' }
- ),
- t
- )
- })()
- : [
- ...l(),
- { text: e.extraKey, type: 'extra' },
- { text: 0 },
- {
- text: e.showDeleteKey ? e.deleteButtonText : '',
- type: e.showDeleteKey ? 'delete' : ''
- }
- ]
- ),
- s = () => {
- e.show && o('blur')
- },
- c = () => {
- o('close'), e.blurOnClose && s()
- },
- d = () => o(e.show ? 'show' : 'hide'),
- u = (t, n) => {
- if ('' === t) return void ('extra' === n && s())
- const a = e.modelValue
- 'delete' === n
- ? (o('delete'), o('update:modelValue', a.slice(0, a.length - 1)))
- : 'close' === n
- ? c()
- : a.length < +e.maxlength && (o('input', t), o('update:modelValue', a + t))
- },
- p = () => {
- if ('custom' === e.theme)
- return t.createVNode('div', { class: _s('sidebar') }, [
- e.showDeleteKey &&
- t.createVNode(
- Zs,
- { large: !0, text: e.deleteButtonText, type: 'delete', onPress: u },
- { delete: n.delete }
- ),
- t.createVNode(
- Zs,
- {
- large: !0,
- text: e.closeButtonText,
- type: 'close',
- color: 'blue',
- loading: e.closeButtonLoading,
- onPress: u
- },
- null
- )
- ])
- }
- return (
- t.watch(
- () => e.show,
- (t) => {
- e.transition || o(t ? 'show' : 'hide')
- }
- ),
- e.hideOnClickOutside && W(r, s, { eventName: 'touchstart' }),
- () => {
- const o = (() => {
- const { title: o, theme: a, closeButtonText: r } = e,
- l = n['title-left'],
- i = r && 'default' === a
- if (o || i || l)
- return t.createVNode('div', { class: _s('header') }, [
- l && t.createVNode('span', { class: _s('title-left') }, [l()]),
- o && t.createVNode('h2', { class: _s('title') }, [o]),
- i &&
- t.createVNode(
- 'button',
- { type: 'button', class: [_s('close'), Fe], onClick: c },
- [r]
- )
- ])
- })(),
- l = t.createVNode(
- t.Transition,
- { name: e.transition ? 'van-slide-up' : '' },
- {
- default: () => [
- t.withDirectives(
- t.createVNode(
- 'div',
- t.mergeProps(
- {
- ref: r,
- style: pe(e.zIndex),
- class: _s({ unfit: !e.safeAreaInsetBottom, 'with-title': !!o }),
- onAnimationend: d,
- onTouchstartPassive: re
- },
- a
- ),
- [
- o,
- t.createVNode('div', { class: _s('body') }, [
- t.createVNode('div', { class: _s('keys') }, [
- i.value.map((e) => {
- const o = {}
- return (
- 'delete' === e.type && (o.default = n.delete),
- 'extra' === e.type && (o.default = n['extra-key']),
- t.createVNode(
- Zs,
- {
- key: e.text,
- text: e.text,
- type: e.type,
- wider: e.wider,
- color: e.color,
- onPress: u
- },
- o
- )
- )
- })
- ]),
- p()
- ])
- ]
- ),
- [[t.vShow, e.show]]
- )
- ]
- }
- )
- return e.teleport
- ? t.createVNode(t.Teleport, { to: e.teleport }, { default: () => [l] })
- : l
- }
- )
- }
- })
- ),
- [ec, tc, oc] = Ie('pagination'),
- nc = (e, t, o) => ({ number: e, text: t, active: o }),
- ac = {
- mode: N('multi'),
- prevText: String,
- nextText: String,
- pageCount: V(0),
- modelValue: x(0),
- totalItems: V(0),
- showPageSize: V(5),
- itemsPerPage: V(10),
- forceEllipses: Boolean,
- showPrevButton: b,
- showNextButton: b
- }
- const rc = We(
- t.defineComponent({
- name: ec,
- props: ac,
- emits: ['change', 'update:modelValue'],
- setup(e, { emit: o, slots: n }) {
- const a = t.computed(() => {
- const { pageCount: t, totalItems: o, itemsPerPage: n } = e,
- a = +t || Math.ceil(+o / +n)
- return Math.max(1, a)
- }),
- r = t.computed(() => {
- const t = [],
- o = a.value,
- n = +e.showPageSize,
- { modelValue: r, forceEllipses: l } = e
- let i = 1,
- s = o
- const c = n < o
- c &&
- ((i = Math.max(r - Math.floor(n / 2), 1)),
- (s = i + n - 1),
- s > o && ((s = o), (i = s - n + 1)))
- for (let e = i; e <= s; e++) {
- const o = nc(e, e, e === r)
- t.push(o)
- }
- if (c && n > 0 && l) {
- if (i > 1) {
- const e = nc(i - 1, '...')
- t.unshift(e)
- }
- if (s < o) {
- const e = nc(s + 1, '...')
- t.push(e)
- }
- }
- return t
- }),
- l = (t, n) => {
- ;(t = ye(t, 1, a.value)),
- e.modelValue !== t && (o('update:modelValue', t), n && o('change', t))
- }
- t.watchEffect(() => l(e.modelValue))
- const i = () => {
- const { mode: o, modelValue: a, showPrevButton: r } = e
- if (!r) return
- const i = n['prev-text'],
- s = 1 === a
- return t.createVNode(
- 'li',
- { class: [tc('item', { disabled: s, border: 'simple' === o, prev: !0 }), $e] },
- [
- t.createVNode(
- 'button',
- { type: 'button', disabled: s, onClick: () => l(a - 1, !0) },
- [i ? i() : e.prevText || oc('prev')]
- )
- ]
- )
- },
- s = () => {
- const { mode: o, modelValue: r, showNextButton: i } = e
- if (!i) return
- const s = n['next-text'],
- c = r === a.value
- return t.createVNode(
- 'li',
- { class: [tc('item', { disabled: c, border: 'simple' === o, next: !0 }), $e] },
- [
- t.createVNode(
- 'button',
- { type: 'button', disabled: c, onClick: () => l(r + 1, !0) },
- [s ? s() : e.nextText || oc('next')]
- )
- ]
- )
- }
- return () =>
- t.createVNode('nav', { role: 'navigation', class: tc() }, [
- t.createVNode('ul', { class: tc('items') }, [
- i(),
- 'simple' === e.mode
- ? t.createVNode('li', { class: tc('page-desc') }, [
- n.pageDesc ? n.pageDesc() : `${e.modelValue}/${a.value}`
- ])
- : r.value.map((e) =>
- t.createVNode(
- 'li',
- { class: [tc('item', { active: e.active, page: !0 }), $e] },
- [
- t.createVNode(
- 'button',
- {
- type: 'button',
- 'aria-current': e.active || void 0,
- onClick: () => l(e.number, !0)
- },
- [n.page ? n.page(e) : e.text]
- )
- ]
- )
- ),
- s()
- ])
- ])
- }
- })
- ),
- [lc, ic] = Ie('password-input'),
- sc = {
- info: String,
- mask: b,
- value: N(''),
- gutter: g,
- length: V(6),
- focused: Boolean,
- errorInfo: String
- }
- const cc = We(
- t.defineComponent({
- name: lc,
- props: sc,
- emits: ['focus'],
- setup(e, { emit: o }) {
- const n = (e) => {
- e.stopPropagation(), o('focus', e)
- },
- a = () => {
- const o = [],
- { mask: n, value: a, gutter: r, focused: l } = e,
- i = +e.length
- for (let e = 0; e < i; e++) {
- const i = a[e],
- s = 0 !== e && !r,
- c = l && e === a.length
- let d
- 0 !== e && r && (d = { marginLeft: de(r) }),
- o.push(
- t.createVNode(
- 'li',
- { class: [{ [Ee]: s }, ic('item', { focus: c })], style: d },
- [
- n
- ? t.createVNode(
- 'i',
- { style: { visibility: i ? 'visible' : 'hidden' } },
- null
- )
- : i,
- c && t.createVNode('div', { class: ic('cursor') }, null)
- ]
- )
- )
- }
- return o
- }
- return () => {
- const o = e.errorInfo || e.info
- return t.createVNode('div', { class: ic() }, [
- t.createVNode(
- 'ul',
- { class: [ic('security'), { [$e]: !e.gutter }], onTouchstartPassive: n },
- [a()]
- ),
- o && t.createVNode('div', { class: ic(e.errorInfo ? 'error-info' : 'info') }, [o])
- ])
- }
- }
- })
- ),
- dc = We(tn)
- function uc(e) {
- if (null == e) return window
- if ('[object Window]' !== e.toString()) {
- var t = e.ownerDocument
- return (t && t.defaultView) || window
- }
- return e
- }
- function pc(e) {
- return e instanceof uc(e).Element || e instanceof Element
- }
- function mc(e) {
- return e instanceof uc(e).HTMLElement || e instanceof HTMLElement
- }
- function fc(e) {
- return (
- 'undefined' != typeof ShadowRoot && (e instanceof uc(e).ShadowRoot || e instanceof ShadowRoot)
- )
- }
- var vc = Math.round
- function hc() {
- var e = navigator.userAgentData
- return null != e && e.brands
- ? e.brands
- .map(function (e) {
- return e.brand + '/' + e.version
- })
- .join(' ')
- : navigator.userAgent
- }
- function gc(e, t, o) {
- void 0 === t && (t = !1), void 0 === o && (o = !1)
- var n = e.getBoundingClientRect(),
- a = 1,
- r = 1
- t &&
- mc(e) &&
- ((a = (e.offsetWidth > 0 && vc(n.width) / e.offsetWidth) || 1),
- (r = (e.offsetHeight > 0 && vc(n.height) / e.offsetHeight) || 1))
- var l = (pc(e) ? uc(e) : window).visualViewport,
- i = !!/^((?!chrome|android).)*safari/i.test(hc()) && o,
- s = (n.left + (i && l ? l.offsetLeft : 0)) / a,
- c = (n.top + (i && l ? l.offsetTop : 0)) / r,
- d = n.width / a,
- u = n.height / r
- return { width: d, height: u, top: c, right: s + d, bottom: c + u, left: s, x: s, y: c }
- }
- function bc(e) {
- var t = uc(e)
- return { scrollLeft: t.pageXOffset, scrollTop: t.pageYOffset }
- }
- function yc(e) {
- return e ? (e.nodeName || '').toLowerCase() : null
- }
- function wc(e) {
- return ((pc(e) ? e.ownerDocument : e.document) || window.document).documentElement
- }
- function xc(e) {
- return uc(e).getComputedStyle(e)
- }
- function Vc(e) {
- var t = xc(e),
- o = t.overflow,
- n = t.overflowX,
- a = t.overflowY
- return /auto|scroll|overlay|hidden/.test(o + a + n)
- }
- function Nc(e, t, o) {
- void 0 === o && (o = !1)
- var n,
- a,
- r = mc(t),
- l =
- mc(t) &&
- (function (e) {
- var t = e.getBoundingClientRect(),
- o = vc(t.width) / e.offsetWidth || 1,
- n = vc(t.height) / e.offsetHeight || 1
- return 1 !== o || 1 !== n
- })(t),
- i = wc(t),
- s = gc(e, l, o),
- c = { scrollLeft: 0, scrollTop: 0 },
- d = { x: 0, y: 0 }
- return (
- (r || (!r && !o)) &&
- (('body' !== yc(t) || Vc(i)) &&
- (c =
- (n = t) !== uc(n) && mc(n)
- ? { scrollLeft: (a = n).scrollLeft, scrollTop: a.scrollTop }
- : bc(n)),
- mc(t)
- ? (((d = gc(t, !0)).x += t.clientLeft), (d.y += t.clientTop))
- : i &&
- (d.x = (function (e) {
- return gc(wc(e)).left + bc(e).scrollLeft
- })(i))),
- {
- x: s.left + c.scrollLeft - d.x,
- y: s.top + c.scrollTop - d.y,
- width: s.width,
- height: s.height
- }
- )
- }
- function kc(e) {
- return 'html' === yc(e) ? e : e.assignedSlot || e.parentNode || (fc(e) ? e.host : null) || wc(e)
- }
- function Cc(e) {
- return ['html', 'body', '#document'].indexOf(yc(e)) >= 0
- ? e.ownerDocument.body
- : mc(e) && Vc(e)
- ? e
- : Cc(kc(e))
- }
- function Sc(e, t) {
- var o
- void 0 === t && (t = [])
- var n = Cc(e),
- a = n === (null == (o = e.ownerDocument) ? void 0 : o.body),
- r = uc(n),
- l = a ? [r].concat(r.visualViewport || [], Vc(n) ? n : []) : n,
- i = t.concat(l)
- return a ? i : i.concat(Sc(kc(l)))
- }
- function Tc(e) {
- return ['table', 'td', 'th'].indexOf(yc(e)) >= 0
- }
- function Bc(e) {
- return mc(e) && 'fixed' !== xc(e).position ? e.offsetParent : null
- }
- function Pc(e) {
- for (var t = uc(e), o = Bc(e); o && Tc(o) && 'static' === xc(o).position; ) o = Bc(o)
- return o && ('html' === yc(o) || ('body' === yc(o) && 'static' === xc(o).position))
- ? t
- : o ||
- (function (e) {
- var t = /firefox/i.test(hc())
- if (/Trident/i.test(hc()) && mc(e) && 'fixed' === xc(e).position) return null
- var o = kc(e)
- for (fc(o) && (o = o.host); mc(o) && ['html', 'body'].indexOf(yc(o)) < 0; ) {
- var n = xc(o)
- if (
- 'none' !== n.transform ||
- 'none' !== n.perspective ||
- 'paint' === n.contain ||
- -1 !== ['transform', 'perspective'].indexOf(n.willChange) ||
- (t && 'filter' === n.willChange) ||
- (t && n.filter && 'none' !== n.filter)
- )
- return o
- o = o.parentNode
- }
- return null
- })(e) ||
- t
- }
- var Dc = 'top',
- Oc = 'bottom',
- Ic = 'right',
- Ac = 'left',
- zc = 'auto',
- Ec = 'start',
- Lc = 'end',
- $c = [].concat([Dc, Oc, Ic, Ac], [zc]).reduce(function (e, t) {
- return e.concat([t, t + '-' + Ec, t + '-' + Lc])
- }, []),
- Mc = [
- 'beforeRead',
- 'read',
- 'afterRead',
- 'beforeMain',
- 'main',
- 'afterMain',
- 'beforeWrite',
- 'write',
- 'afterWrite'
- ]
- function Rc(e) {
- var t = new Map(),
- o = new Set(),
- n = []
- function a(e) {
- o.add(e.name),
- [].concat(e.requires || [], e.requiresIfExists || []).forEach(function (e) {
- if (!o.has(e)) {
- var n = t.get(e)
- n && a(n)
- }
- }),
- n.push(e)
- }
- return (
- e.forEach(function (e) {
- t.set(e.name, e)
- }),
- e.forEach(function (e) {
- o.has(e.name) || a(e)
- }),
- n
- )
- }
- function Fc(e) {
- for (var t = arguments.length, o = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
- o[n - 1] = arguments[n]
- return [].concat(o).reduce(function (e, t) {
- return e.replace(/%s/, t)
- }, e)
- }
- var Hc = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s',
- jc = ['name', 'enabled', 'phase', 'fn', 'effect', 'requires', 'options']
- function Wc(e) {
- return e.split('-')[0]
- }
- function Uc(e) {
- return e.split('-')[1]
- }
- var Yc =
- 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.',
- qc = { placement: 'bottom', modifiers: [], strategy: 'absolute' }
- function Xc() {
- for (var e = arguments.length, t = new Array(e), o = 0; o < e; o++) t[o] = arguments[o]
- return !t.some(function (e) {
- return !(e && 'function' == typeof e.getBoundingClientRect)
- })
- }
- function Gc(e) {
- void 0 === e && (e = {})
- var t = e,
- o = t.defaultModifiers,
- n = void 0 === o ? [] : o,
- a = t.defaultOptions,
- r = void 0 === a ? qc : a
- return function (e, t, o) {
- void 0 === o && (o = r)
- var a,
- l,
- i = {
- placement: 'bottom',
- orderedModifiers: [],
- options: Object.assign({}, qc, r),
- modifiersData: {},
- elements: { reference: e, popper: t },
- attributes: {},
- styles: {}
- },
- s = [],
- c = !1,
- d = {
- state: i,
- setOptions: function (o) {
- var a = 'function' == typeof o ? o(i.options) : o
- u(),
- (i.options = Object.assign({}, r, i.options, a)),
- (i.scrollParents = {
- reference: pc(e) ? Sc(e) : e.contextElement ? Sc(e.contextElement) : [],
- popper: Sc(t)
- })
- var l = (function (e) {
- var t = Rc(e)
- return Mc.reduce(function (e, o) {
- return e.concat(
- t.filter(function (e) {
- return e.phase === o
- })
- )
- }, [])
- })(
- (function (e) {
- var t = e.reduce(function (e, t) {
- var o = e[t.name]
- return (
- (e[t.name] = o
- ? Object.assign({}, o, t, {
- options: Object.assign({}, o.options, t.options),
- data: Object.assign({}, o.data, t.data)
- })
- : t),
- e
- )
- }, {})
- return Object.keys(t).map(function (e) {
- return t[e]
- })
- })([].concat(n, i.options.modifiers))
- )
- ;((i.orderedModifiers = l.filter(function (e) {
- return e.enabled
- })),
- (function (e) {
- e.forEach(function (t) {
- ;[]
- .concat(Object.keys(t), jc)
- .filter(function (e, t, o) {
- return o.indexOf(e) === t
- })
- .forEach(function (o) {
- switch (o) {
- case 'name':
- 'string' != typeof t.name &&
- console.error(
- Fc(Hc, String(t.name), '"name"', '"string"', '"' + String(t.name) + '"')
- )
- break
- case 'enabled':
- 'boolean' != typeof t.enabled &&
- console.error(
- Fc(Hc, t.name, '"enabled"', '"boolean"', '"' + String(t.enabled) + '"')
- )
- break
- case 'phase':
- Mc.indexOf(t.phase) < 0 &&
- console.error(
- Fc(
- Hc,
- t.name,
- '"phase"',
- 'either ' + Mc.join(', '),
- '"' + String(t.phase) + '"'
- )
- )
- break
- case 'fn':
- 'function' != typeof t.fn &&
- console.error(
- Fc(Hc, t.name, '"fn"', '"function"', '"' + String(t.fn) + '"')
- )
- break
- case 'effect':
- null != t.effect &&
- 'function' != typeof t.effect &&
- console.error(
- Fc(Hc, t.name, '"effect"', '"function"', '"' + String(t.fn) + '"')
- )
- break
- case 'requires':
- null == t.requires ||
- Array.isArray(t.requires) ||
- console.error(
- Fc(Hc, t.name, '"requires"', '"array"', '"' + String(t.requires) + '"')
- )
- break
- case 'requiresIfExists':
- Array.isArray(t.requiresIfExists) ||
- console.error(
- Fc(
- Hc,
- t.name,
- '"requiresIfExists"',
- '"array"',
- '"' + String(t.requiresIfExists) + '"'
- )
- )
- break
- case 'options':
- case 'data':
- break
- default:
- console.error(
- 'PopperJS: an invalid property has been provided to the "' +
- t.name +
- '" modifier, valid properties are ' +
- jc
- .map(function (e) {
- return '"' + e + '"'
- })
- .join(', ') +
- '; but "' +
- o +
- '" was provided.'
- )
- }
- t.requires &&
- t.requires.forEach(function (o) {
- null ==
- e.find(function (e) {
- return e.name === o
- }) &&
- console.error(
- Fc(
- 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available',
- String(t.name),
- o,
- o
- )
- )
- })
- })
- })
- })(
- ((c = [].concat(l, i.options.modifiers)),
- (p = function (e) {
- return e.name
- }),
- (m = new Set()),
- c.filter(function (e) {
- var t = p(e)
- if (!m.has(t)) return m.add(t), !0
- }))
- ),
- Wc(i.options.placement) === zc) &&
- (i.orderedModifiers.find(function (e) {
- return 'flip' === e.name
- }) ||
- console.error(
- [
- 'Popper: "auto" placements require the "flip" modifier be',
- 'present and enabled to work.'
- ].join(' ')
- ))
- var c,
- p,
- m,
- f = xc(t)
- return (
- [f.marginTop, f.marginRight, f.marginBottom, f.marginLeft].some(function (e) {
- return parseFloat(e)
- }) &&
- console.warn(
- [
- 'Popper: CSS "margin" styles cannot be used to apply padding',
- 'between the popper and its reference element or boundary.',
- 'To replicate margin, use the `offset` modifier, as well as',
- 'the `padding` option in the `preventOverflow` and `flip`',
- 'modifiers.'
- ].join(' ')
- ),
- i.orderedModifiers.forEach(function (e) {
- var t = e.name,
- o = e.options,
- n = void 0 === o ? {} : o,
- a = e.effect
- if ('function' == typeof a) {
- var r = a({ state: i, name: t, instance: d, options: n }),
- l = function () {}
- s.push(r || l)
- }
- }),
- d.update()
- )
- },
- forceUpdate: function () {
- if (!c) {
- var e = i.elements,
- t = e.reference,
- o = e.popper
- if (Xc(t, o)) {
- var n, a, r, l
- ;(i.rects = {
- reference: Nc(t, Pc(o), 'fixed' === i.options.strategy),
- popper:
- ((n = o),
- (a = gc(n)),
- (r = n.offsetWidth),
- (l = n.offsetHeight),
- Math.abs(a.width - r) <= 1 && (r = a.width),
- Math.abs(a.height - l) <= 1 && (l = a.height),
- { x: n.offsetLeft, y: n.offsetTop, width: r, height: l })
- }),
- (i.reset = !1),
- (i.placement = i.options.placement),
- i.orderedModifiers.forEach(function (e) {
- return (i.modifiersData[e.name] = Object.assign({}, e.data))
- })
- for (var s = 0, u = 0; u < i.orderedModifiers.length; u++) {
- if ((s += 1) > 100) {
- console.error(
- 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.'
- )
- break
- }
- if (!0 !== i.reset) {
- var p = i.orderedModifiers[u],
- m = p.fn,
- f = p.options,
- v = void 0 === f ? {} : f,
- h = p.name
- 'function' == typeof m &&
- (i = m({ state: i, options: v, name: h, instance: d }) || i)
- } else (i.reset = !1), (u = -1)
- }
- } else console.error(Yc)
- }
- },
- update:
- ((a = function () {
- return new Promise(function (e) {
- d.forceUpdate(), e(i)
- })
- }),
- function () {
- return (
- l ||
- (l = new Promise(function (e) {
- Promise.resolve().then(function () {
- ;(l = void 0), e(a())
- })
- })),
- l
- )
- }),
- destroy: function () {
- u(), (c = !0)
- }
- }
- if (!Xc(e, t)) return console.error(Yc), d
- function u() {
- s.forEach(function (e) {
- return e()
- }),
- (s = [])
- }
- return (
- d.setOptions(o).then(function (e) {
- !c && o.onFirstUpdate && o.onFirstUpdate(e)
- }),
- d
- )
- }
- }
- var Zc = { passive: !0 }
- var Kc = { top: 'auto', right: 'auto', bottom: 'auto', left: 'auto' }
- function _c(e) {
- var t,
- o = e.popper,
- n = e.popperRect,
- a = e.placement,
- r = e.variation,
- l = e.offsets,
- i = e.position,
- s = e.gpuAcceleration,
- c = e.adaptive,
- d = e.roundOffsets,
- u = e.isFixed,
- p = l.x,
- m = void 0 === p ? 0 : p,
- f = l.y,
- v = void 0 === f ? 0 : f,
- h = 'function' == typeof d ? d({ x: m, y: v }) : { x: m, y: v }
- ;(m = h.x), (v = h.y)
- var g = l.hasOwnProperty('x'),
- b = l.hasOwnProperty('y'),
- y = Ac,
- w = Dc,
- x = window
- if (c) {
- var V = Pc(o),
- N = 'clientHeight',
- k = 'clientWidth'
- if (
- (V === uc(o) &&
- 'static' !== xc((V = wc(o))).position &&
- 'absolute' === i &&
- ((N = 'scrollHeight'), (k = 'scrollWidth')),
- a === Dc || ((a === Ac || a === Ic) && r === Lc))
- )
- (w = Oc),
- (v -= (u && V === x && x.visualViewport ? x.visualViewport.height : V[N]) - n.height),
- (v *= s ? 1 : -1)
- if (a === Ac || ((a === Dc || a === Oc) && r === Lc))
- (y = Ic),
- (m -= (u && V === x && x.visualViewport ? x.visualViewport.width : V[k]) - n.width),
- (m *= s ? 1 : -1)
- }
- var C,
- S = Object.assign({ position: i }, c && Kc),
- T =
- !0 === d
- ? (function (e) {
- var t = e.x,
- o = e.y,
- n = window.devicePixelRatio || 1
- return { x: vc(t * n) / n || 0, y: vc(o * n) / n || 0 }
- })({ x: m, y: v })
- : { x: m, y: v }
- return (
- (m = T.x),
- (v = T.y),
- s
- ? Object.assign(
- {},
- S,
- (((C = {})[w] = b ? '0' : ''),
- (C[y] = g ? '0' : ''),
- (C.transform =
- (x.devicePixelRatio || 1) <= 1
- ? 'translate(' + m + 'px, ' + v + 'px)'
- : 'translate3d(' + m + 'px, ' + v + 'px, 0)'),
- C)
- )
- : Object.assign(
- {},
- S,
- (((t = {})[w] = b ? v + 'px' : ''), (t[y] = g ? m + 'px' : ''), (t.transform = ''), t)
- )
- )
- }
- var Jc = Gc({
- defaultModifiers: [
- {
- name: 'eventListeners',
- enabled: !0,
- phase: 'write',
- fn: function () {},
- effect: function (e) {
- var t = e.state,
- o = e.instance,
- n = e.options,
- a = n.scroll,
- r = void 0 === a || a,
- l = n.resize,
- i = void 0 === l || l,
- s = uc(t.elements.popper),
- c = [].concat(t.scrollParents.reference, t.scrollParents.popper)
- return (
- r &&
- c.forEach(function (e) {
- e.addEventListener('scroll', o.update, Zc)
- }),
- i && s.addEventListener('resize', o.update, Zc),
- function () {
- r &&
- c.forEach(function (e) {
- e.removeEventListener('scroll', o.update, Zc)
- }),
- i && s.removeEventListener('resize', o.update, Zc)
- }
- )
- },
- data: {}
- },
- {
- name: 'popperOffsets',
- enabled: !0,
- phase: 'read',
- fn: function (e) {
- var t = e.state,
- o = e.name
- t.modifiersData[o] = (function (e) {
- var t,
- o = e.reference,
- n = e.element,
- a = e.placement,
- r = a ? Wc(a) : null,
- l = a ? Uc(a) : null,
- i = o.x + o.width / 2 - n.width / 2,
- s = o.y + o.height / 2 - n.height / 2
- switch (r) {
- case Dc:
- t = { x: i, y: o.y - n.height }
- break
- case Oc:
- t = { x: i, y: o.y + o.height }
- break
- case Ic:
- t = { x: o.x + o.width, y: s }
- break
- case Ac:
- t = { x: o.x - n.width, y: s }
- break
- default:
- t = { x: o.x, y: o.y }
- }
- var c = r
- ? (function (e) {
- return ['top', 'bottom'].indexOf(e) >= 0 ? 'x' : 'y'
- })(r)
- : null
- if (null != c) {
- var d = 'y' === c ? 'height' : 'width'
- switch (l) {
- case Ec:
- t[c] = t[c] - (o[d] / 2 - n[d] / 2)
- break
- case Lc:
- t[c] = t[c] + (o[d] / 2 - n[d] / 2)
- }
- }
- return t
- })({
- reference: t.rects.reference,
- element: t.rects.popper,
- strategy: 'absolute',
- placement: t.placement
- })
- },
- data: {}
- },
- {
- name: 'computeStyles',
- enabled: !0,
- phase: 'beforeWrite',
- fn: function (e) {
- var t = e.state,
- o = e.options,
- n = o.gpuAcceleration,
- a = void 0 === n || n,
- r = o.adaptive,
- l = void 0 === r || r,
- i = o.roundOffsets,
- s = void 0 === i || i,
- c = xc(t.elements.popper).transitionProperty || ''
- l &&
- ['transform', 'top', 'right', 'bottom', 'left'].some(function (e) {
- return c.indexOf(e) >= 0
- }) &&
- console.warn(
- [
- 'Popper: Detected CSS transitions on at least one of the following',
- 'CSS properties: "transform", "top", "right", "bottom", "left".',
- '\n\n',
- 'Disable the "computeStyles" modifier\'s `adaptive` option to allow',
- 'for smooth transitions, or remove these properties from the CSS',
- 'transition declaration on the popper element if only transitioning',
- 'opacity or background-color for example.',
- '\n\n',
- 'We recommend using the popper element as a wrapper around an inner',
- 'element that can have any CSS property transitioned for animations.'
- ].join(' ')
- )
- var d = {
- placement: Wc(t.placement),
- variation: Uc(t.placement),
- popper: t.elements.popper,
- popperRect: t.rects.popper,
- gpuAcceleration: a,
- isFixed: 'fixed' === t.options.strategy
- }
- null != t.modifiersData.popperOffsets &&
- (t.styles.popper = Object.assign(
- {},
- t.styles.popper,
- _c(
- Object.assign({}, d, {
- offsets: t.modifiersData.popperOffsets,
- position: t.options.strategy,
- adaptive: l,
- roundOffsets: s
- })
- )
- )),
- null != t.modifiersData.arrow &&
- (t.styles.arrow = Object.assign(
- {},
- t.styles.arrow,
- _c(
- Object.assign({}, d, {
- offsets: t.modifiersData.arrow,
- position: 'absolute',
- adaptive: !1,
- roundOffsets: s
- })
- )
- )),
- (t.attributes.popper = Object.assign({}, t.attributes.popper, {
- 'data-popper-placement': t.placement
- }))
- },
- data: {}
- },
- {
- name: 'applyStyles',
- enabled: !0,
- phase: 'write',
- fn: function (e) {
- var t = e.state
- Object.keys(t.elements).forEach(function (e) {
- var o = t.styles[e] || {},
- n = t.attributes[e] || {},
- a = t.elements[e]
- mc(a) &&
- yc(a) &&
- (Object.assign(a.style, o),
- Object.keys(n).forEach(function (e) {
- var t = n[e]
- !1 === t ? a.removeAttribute(e) : a.setAttribute(e, !0 === t ? '' : t)
- }))
- })
- },
- effect: function (e) {
- var t = e.state,
- o = {
- popper: { position: t.options.strategy, left: '0', top: '0', margin: '0' },
- arrow: { position: 'absolute' },
- reference: {}
- }
- return (
- Object.assign(t.elements.popper.style, o.popper),
- (t.styles = o),
- t.elements.arrow && Object.assign(t.elements.arrow.style, o.arrow),
- function () {
- Object.keys(t.elements).forEach(function (e) {
- var n = t.elements[e],
- a = t.attributes[e] || {},
- r = Object.keys(t.styles.hasOwnProperty(e) ? t.styles[e] : o[e]).reduce(function (
- e,
- t
- ) {
- return (e[t] = ''), e
- },
- {})
- mc(n) &&
- yc(n) &&
- (Object.assign(n.style, r),
- Object.keys(a).forEach(function (e) {
- n.removeAttribute(e)
- }))
- })
- }
- )
- },
- requires: ['computeStyles']
- }
- ]
- })
- var Qc = {
- name: 'offset',
- enabled: !0,
- phase: 'main',
- requires: ['popperOffsets'],
- fn: function (e) {
- var t = e.state,
- o = e.options,
- n = e.name,
- a = o.offset,
- r = void 0 === a ? [0, 0] : a,
- l = $c.reduce(function (e, o) {
- return (
- (e[o] = (function (e, t, o) {
- var n = Wc(e),
- a = [Ac, Dc].indexOf(n) >= 0 ? -1 : 1,
- r = 'function' == typeof o ? o(Object.assign({}, t, { placement: e })) : o,
- l = r[0],
- i = r[1]
- return (
- (l = l || 0),
- (i = (i || 0) * a),
- [Ac, Ic].indexOf(n) >= 0 ? { x: i, y: l } : { x: l, y: i }
- )
- })(o, t.rects, r)),
- e
- )
- }, {}),
- i = l[t.placement],
- s = i.x,
- c = i.y
- null != t.modifiersData.popperOffsets &&
- ((t.modifiersData.popperOffsets.x += s), (t.modifiersData.popperOffsets.y += c)),
- (t.modifiersData[n] = l)
- }
- }
- const [ed, td] = Ie('popover'),
- od = ['overlay', 'duration', 'teleport', 'overlayStyle', 'overlayClass', 'closeOnClickOverlay'],
- nd = {
- show: Boolean,
- theme: N('light'),
- overlay: Boolean,
- actions: w(),
- trigger: N('click'),
- duration: g,
- showArrow: b,
- placement: N('bottom'),
- iconPrefix: String,
- overlayClass: h,
- overlayStyle: Object,
- closeOnClickAction: b,
- closeOnClickOverlay: b,
- closeOnClickOutside: b,
- offset: { type: Array, default: () => [0, 8] },
- teleport: { type: [String, Object], default: 'body' }
- }
- const ad = We(
- t.defineComponent({
- name: ed,
- props: nd,
- emits: ['select', 'touchstart', 'update:show'],
- setup(e, { emit: o, slots: n, attrs: a }) {
- let r
- const l = t.ref(),
- i = t.ref(),
- s = t.ref(),
- c = go(
- () => e.show,
- (e) => o('update:show', e)
- ),
- p = () => ({
- placement: e.placement,
- modifiers: [
- { name: 'computeStyles', options: { adaptive: !1, gpuAcceleration: !1 } },
- d({}, Qc, { options: { offset: e.offset } })
- ]
- }),
- f = () => {
- t.nextTick(() => {
- c.value &&
- (r
- ? r.setOptions(p())
- : ((r = i.value && s.value ? Jc(i.value, s.value.popupRef.value, p()) : null),
- u &&
- (window.addEventListener('animationend', f),
- window.addEventListener('transitionend', f))))
- })
- },
- v = (e) => {
- c.value = e
- },
- h = () => {
- 'click' === e.trigger && (c.value = !c.value)
- },
- g = (o, a) =>
- n.action
- ? n.action({ action: o, index: a })
- : [
- o.icon &&
- t.createVNode(
- ht,
- { name: o.icon, classPrefix: e.iconPrefix, class: td('action-icon') },
- null
- ),
- t.createVNode('div', { class: [td('action-text'), Le] }, [o.text])
- ],
- b = (n, a) => {
- const { icon: r, color: l, disabled: i, className: s } = n
- return t.createVNode(
- 'div',
- {
- role: 'menuitem',
- class: [td('action', { disabled: i, 'with-icon': r }), s],
- style: { color: l },
- tabindex: i ? void 0 : 0,
- 'aria-disabled': i || void 0,
- onClick: () =>
- ((t, n) => {
- t.disabled || (o('select', t, n), e.closeOnClickAction && (c.value = !1))
- })(n, a)
- },
- [g(n, a)]
- )
- }
- return (
- t.onMounted(() => {
- f(),
- t.watchEffect(() => {
- var e
- l.value = null == (e = s.value) ? void 0 : e.popupRef.value
- })
- }),
- t.onBeforeUnmount(() => {
- r &&
- (u &&
- (window.removeEventListener('animationend', f),
- window.removeEventListener('transitionend', f)),
- r.destroy(),
- (r = null))
- }),
- t.watch(() => [c.value, e.offset, e.placement], f),
- W(
- [i, l],
- () => {
- c.value &&
- e.closeOnClickOutside &&
- (!e.overlay || e.closeOnClickOverlay) &&
- (c.value = !1)
- },
- { eventName: 'touchstart' }
- ),
- () => {
- var o
- return t.createVNode(t.Fragment, null, [
- t.createVNode('span', { ref: i, class: td('wrapper'), onClick: h }, [
- null == (o = n.reference) ? void 0 : o.call(n)
- ]),
- t.createVNode(
- Gt,
- t.mergeProps(
- {
- ref: s,
- show: c.value,
- class: td([e.theme]),
- position: '',
- transition: 'van-popover-zoom',
- lockScroll: !1,
- 'onUpdate:show': v
- },
- a,
- m(e, od)
- ),
- {
- default: () => [
- e.showArrow && t.createVNode('div', { class: td('arrow') }, null),
- t.createVNode('div', { role: 'menu', class: td('content') }, [
- n.default ? n.default() : e.actions.map(b)
- ])
- ]
- }
- )
- ])
- }
- )
- }
- })
- ),
- [rd, ld] = Ie('progress'),
- id = {
- color: String,
- inactive: Boolean,
- pivotText: String,
- textColor: String,
- showPivot: b,
- pivotColor: String,
- trackColor: String,
- strokeWidth: g,
- percentage: { type: g, default: 0, validator: (e) => +e >= 0 && +e <= 100 }
- }
- const sd = We(
- t.defineComponent({
- name: rd,
- props: id,
- setup(e) {
- const o = t.computed(() => (e.inactive ? void 0 : e.color)),
- n = () => {
- const { textColor: n, pivotText: a, pivotColor: r, percentage: l } = e,
- i = null != a ? a : `${l}%`
- if (e.showPivot && i) {
- const a = {
- color: n,
- left: +l + '%',
- transform: `translate(-${+l}%,-50%)`,
- background: r || o.value
- }
- return t.createVNode(
- 'span',
- { style: a, class: ld('pivot', { inactive: e.inactive }) },
- [i]
- )
- }
- }
- return () => {
- const { trackColor: a, percentage: r, strokeWidth: l } = e,
- i = { background: a, height: de(l) },
- s = { width: `${r}%`, background: o.value }
- return t.createVNode('div', { class: ld(), style: i }, [
- t.createVNode(
- 'span',
- { class: ld('portion', { inactive: e.inactive }), style: s },
- null
- ),
- n()
- ])
- }
- }
- })
- ),
- [cd, dd, ud] = Ie('pull-refresh'),
- pd = ['pulling', 'loosing', 'success'],
- md = {
- disabled: Boolean,
- modelValue: Boolean,
- headHeight: V(50),
- successText: String,
- pullingText: String,
- loosingText: String,
- loadingText: String,
- pullDistance: g,
- successDuration: V(500),
- animationDuration: V(300)
- }
- const fd = We(
- t.defineComponent({
- name: cd,
- props: md,
- emits: ['change', 'refresh', 'update:modelValue'],
- setup(e, { emit: o, slots: n }) {
- let a
- const r = t.ref(),
- l = t.ref(),
- i = Z(r),
- s = t.reactive({ status: 'normal', distance: 0, duration: 0 }),
- c = $t(),
- d = () => {
- if (50 !== e.headHeight) return { height: `${e.headHeight}px` }
- },
- u = () => 'loading' !== s.status && 'success' !== s.status && !e.disabled,
- p = (t, n) => {
- const a = +(e.pullDistance || e.headHeight)
- ;(s.distance = t),
- (s.status = n ? 'loading' : 0 === t ? 'normal' : t < a ? 'pulling' : 'loosing'),
- o('change', { status: s.status, distance: t })
- },
- m = () => {
- const { status: t } = s
- return 'normal' === t ? '' : e[`${t}Text`] || ud(t)
- },
- f = () => {
- const { status: e, distance: o } = s
- if (n[e]) return n[e]({ distance: o })
- const a = []
- return (
- pd.includes(e) && a.push(t.createVNode('div', { class: dd('text') }, [m()])),
- 'loading' === e &&
- a.push(t.createVNode(Vt, { class: dd('loading') }, { default: m })),
- a
- )
- },
- v = (e) => {
- ;(a = 0 === J(i.value)), a && ((s.duration = 0), c.start(e))
- },
- h = (e) => {
- u() && v(e)
- },
- g = () => {
- a &&
- c.deltaY.value &&
- u() &&
- ((s.duration = +e.animationDuration),
- 'loosing' === s.status
- ? (p(+e.headHeight, !0),
- o('update:modelValue', !0),
- t.nextTick(() => o('refresh')))
- : p(0))
- }
- return (
- t.watch(
- () => e.modelValue,
- (t) => {
- ;(s.duration = +e.animationDuration),
- t
- ? p(+e.headHeight, !0)
- : n.success || e.successText
- ? ((s.status = 'success'),
- setTimeout(() => {
- p(0)
- }, +e.successDuration))
- : p(0, !1)
- }
- ),
- j(
- 'touchmove',
- (t) => {
- if (u()) {
- a || v(t)
- const { deltaY: o } = c
- c.move(t),
- a &&
- o.value >= 0 &&
- c.isVertical() &&
- (le(t),
- p(
- ((t) => {
- const o = +(e.pullDistance || e.headHeight)
- return (
- t > o && (t = t < 2 * o ? o + (t - o) / 2 : 1.5 * o + (t - 2 * o) / 4),
- Math.round(t)
- )
- })(o.value)
- ))
- }
- },
- { target: l }
- ),
- () => {
- var e
- const o = {
- transitionDuration: `${s.duration}ms`,
- transform: s.distance ? `translate3d(0,${s.distance}px, 0)` : ''
- }
- return t.createVNode('div', { ref: r, class: dd() }, [
- t.createVNode(
- 'div',
- {
- ref: l,
- class: dd('track'),
- style: o,
- onTouchstartPassive: h,
- onTouchend: g,
- onTouchcancel: g
- },
- [
- t.createVNode('div', { class: dd('head'), style: d() }, [f()]),
- null == (e = n.default) ? void 0 : e.call(n)
- ]
- )
- ])
- }
- )
- }
- })
- ),
- [vd, hd] = Ie('rate')
- const gd = {
- size: g,
- icon: N('star'),
- color: String,
- count: V(5),
- gutter: g,
- readonly: Boolean,
- disabled: Boolean,
- voidIcon: N('star-o'),
- allowHalf: Boolean,
- voidColor: String,
- touchable: b,
- iconPrefix: String,
- modelValue: x(0),
- disabledColor: String
- }
- const bd = We(
- t.defineComponent({
- name: vd,
- props: gd,
- emits: ['change', 'update:modelValue'],
- setup(e, { emit: o }) {
- const n = $t(),
- [a, r] = wo(),
- l = t.ref(),
- i = () => e.readonly || e.disabled || !e.touchable,
- s = t.computed(() =>
- Array(+e.count)
- .fill('')
- .map((t, o) =>
- (function (e, t, o, n) {
- if (e >= t) return { status: 'full', value: 1 }
- if (e + 0.5 >= t && o && !n) return { status: 'half', value: 0.5 }
- if (e + 1 >= t && o && n) {
- const o = 10 ** 10
- return { status: 'half', value: Math.round((e - t + 1) * o) / o }
- }
- return { status: 'void', value: 0 }
- })(e.modelValue, o + 1, e.allowHalf, e.readonly)
- )
- )
- let c,
- d,
- u = Number.MAX_SAFE_INTEGER,
- p = Number.MIN_SAFE_INTEGER
- const m = () => {
- d = P(l)
- const t = a.value.map(P)
- ;(c = []),
- t.forEach((t, o) => {
- ;(u = Math.min(t.top, u)),
- (p = Math.max(t.top, p)),
- e.allowHalf
- ? c.push(
- { score: o + 0.5, left: t.left, top: t.top, height: t.height },
- { score: o + 1, left: t.left + t.width / 2, top: t.top, height: t.height }
- )
- : c.push({ score: o + 1, left: t.left, top: t.top, height: t.height })
- })
- },
- f = (t, o) => {
- for (let e = c.length - 1; e > 0; e--)
- if (o >= d.top && o <= d.bottom) {
- if (t > c[e].left && o >= c[e].top && o <= c[e].top + c[e].height)
- return c[e].score
- } else {
- const n = o < d.top ? u : p
- if (t > c[e].left && c[e].top === n) return c[e].score
- }
- return e.allowHalf ? 0.5 : 1
- },
- v = (t) => {
- e.disabled ||
- e.readonly ||
- t === e.modelValue ||
- (o('update:modelValue', t), o('change', t))
- },
- h = (e) => {
- i() || (n.start(e), m())
- },
- g = (o, n) => {
- const {
- icon: a,
- size: l,
- color: i,
- count: s,
- gutter: c,
- voidIcon: d,
- disabled: u,
- voidColor: p,
- allowHalf: h,
- iconPrefix: g,
- disabledColor: b
- } = e,
- y = n + 1,
- w = 'full' === o.status,
- x = 'void' === o.status,
- V = h && o.value > 0 && o.value < 1
- let N
- c && y !== +s && (N = { paddingRight: de(c) })
- return t.createVNode(
- 'div',
- {
- key: n,
- ref: r(n),
- role: 'radio',
- style: N,
- class: hd('item'),
- tabindex: u ? void 0 : 0,
- 'aria-setsize': s,
- 'aria-posinset': y,
- 'aria-checked': !x,
- onClick: (e) => {
- m(), v(h ? f(e.clientX, e.clientY) : y)
- }
- },
- [
- t.createVNode(
- ht,
- {
- size: l,
- name: w ? a : d,
- class: hd('icon', { disabled: u, full: w }),
- color: u ? b : w ? i : p,
- classPrefix: g
- },
- null
- ),
- V &&
- t.createVNode(
- ht,
- {
- size: l,
- style: { width: o.value + 'em' },
- name: x ? d : a,
- class: hd('icon', ['half', { disabled: u, full: !x }]),
- color: u ? b : x ? p : i,
- classPrefix: g
- },
- null
- )
- ]
- )
- }
- return (
- _(() => e.modelValue),
- j(
- 'touchmove',
- (e) => {
- if (!i() && (n.move(e), n.isHorizontal())) {
- const { clientX: t, clientY: o } = e.touches[0]
- le(e), v(f(t, o))
- }
- },
- { target: l }
- ),
- () =>
- t.createVNode(
- 'div',
- {
- ref: l,
- role: 'radiogroup',
- class: hd({ readonly: e.readonly, disabled: e.disabled }),
- tabindex: e.disabled ? void 0 : 0,
- 'aria-disabled': e.disabled,
- 'aria-readonly': e.readonly,
- onTouchstartPassive: h
- },
- [s.value.map(g)]
- )
- )
- }
- })
- ),
- yd = We(fl),
- [wd, xd, Vd] = Ie('search'),
- Nd = d({}, An, {
- label: String,
- shape: N('square'),
- leftIcon: N('search'),
- clearable: b,
- actionText: String,
- background: String,
- showAction: Boolean
- })
- const kd = We(
- t.defineComponent({
- name: wd,
- props: Nd,
- emits: [
- 'blur',
- 'focus',
- 'clear',
- 'search',
- 'cancel',
- 'clickInput',
- 'clickLeftIcon',
- 'clickRightIcon',
- 'update:modelValue'
- ],
- setup(e, { emit: o, slots: n, attrs: a }) {
- const r = yo(),
- l = t.ref(),
- i = () => {
- n.action || (o('update:modelValue', ''), o('cancel'))
- },
- s = (t) => {
- 13 === t.keyCode && (le(t), o('search', e.modelValue))
- },
- c = () => e.id || `${r}-input`,
- u = () => {
- if (n.label || e.label)
- return t.createVNode('label', { class: xd('label'), for: c() }, [
- n.label ? n.label() : e.label
- ])
- },
- p = () => {
- if (e.showAction) {
- const o = e.actionText || Vd('cancel')
- return t.createVNode(
- 'div',
- { class: xd('action'), role: 'button', tabindex: 0, onClick: i },
- [n.action ? n.action() : o]
- )
- }
- },
- f = (e) => o('blur', e),
- v = (e) => o('focus', e),
- h = (e) => o('clear', e),
- g = (e) => o('clickInput', e),
- b = (e) => o('clickLeftIcon', e),
- y = (e) => o('clickRightIcon', e),
- w = Object.keys(An),
- x = () => {
- const r = d({}, a, m(e, w), { id: c() })
- return t.createVNode(
- En,
- t.mergeProps(
- {
- ref: l,
- type: 'search',
- class: xd('field'),
- border: !1,
- onBlur: f,
- onFocus: v,
- onClear: h,
- onKeypress: s,
- onClickInput: g,
- onClickLeftIcon: b,
- onClickRightIcon: y,
- 'onUpdate:modelValue': (e) => o('update:modelValue', e)
- },
- r
- ),
- m(n, ['left-icon', 'right-icon'])
- )
- }
- return (
- Qe({
- focus: () => {
- var e
- return null == (e = l.value) ? void 0 : e.focus()
- },
- blur: () => {
- var e
- return null == (e = l.value) ? void 0 : e.blur()
- }
- }),
- () => {
- var o
- return t.createVNode(
- 'div',
- { class: xd({ 'show-action': e.showAction }), style: { background: e.background } },
- [
- null == (o = n.left) ? void 0 : o.call(n),
- t.createVNode('div', { class: xd('content', e.shape) }, [u(), x()]),
- p()
- ]
- )
- }
- )
- }
- })
- ),
- Cd = [...Lt, 'round', 'closeOnPopstate', 'safeAreaInsetBottom'],
- Sd = {
- qq: 'qq',
- link: 'link-o',
- weibo: 'weibo',
- qrcode: 'qr',
- poster: 'photo-o',
- wechat: 'wechat',
- 'weapp-qrcode': 'miniprogram-o',
- 'wechat-moments': 'wechat-moments'
- },
- [Td, Bd, Pd] = Ie('share-sheet'),
- Dd = d({}, Et, {
- title: String,
- round: b,
- options: w(),
- cancelText: String,
- description: String,
- closeOnPopstate: b,
- safeAreaInsetBottom: b
- })
- const Od = We(
- t.defineComponent({
- name: Td,
- props: Dd,
- emits: ['cancel', 'select', 'update:show'],
- setup(e, { emit: o, slots: n }) {
- const a = (e) => o('update:show', e),
- r = () => {
- a(!1), o('cancel')
- },
- l = () => {
- const o = n.title ? n.title() : e.title,
- a = n.description ? n.description() : e.description
- if (o || a)
- return t.createVNode('div', { class: Bd('header') }, [
- o && t.createVNode('h2', { class: Bd('title') }, [o]),
- a && t.createVNode('span', { class: Bd('description') }, [a])
- ])
- },
- i = (e) => {
- return (null == (o = e) ? void 0 : o.includes('/'))
- ? t.createVNode('img', { src: e, class: Bd('image-icon') }, null)
- : t.createVNode('div', { class: Bd('icon', [e]) }, [
- t.createVNode(ht, { name: Sd[e] || e }, null)
- ])
- var o
- },
- s = (e, n) => {
- const { name: a, icon: r, className: l, description: s } = e
- return t.createVNode(
- 'div',
- {
- role: 'button',
- tabindex: 0,
- class: [Bd('option'), l, Fe],
- onClick: () => ((e, t) => o('select', e, t))(e, n)
- },
- [
- i(r),
- a && t.createVNode('span', { class: Bd('name') }, [a]),
- s && t.createVNode('span', { class: Bd('option-description') }, [s])
- ]
- )
- },
- c = (e, o) => t.createVNode('div', { class: Bd('options', { border: o }) }, [e.map(s)]),
- d = () => {
- const { options: t } = e
- return Array.isArray(t[0]) ? t.map((e, t) => c(e, 0 !== t)) : c(t)
- },
- u = () => {
- var o
- const a = null != (o = e.cancelText) ? o : Pd('cancel')
- if (n.cancel || a)
- return t.createVNode(
- 'button',
- { type: 'button', class: Bd('cancel'), onClick: r },
- [n.cancel ? n.cancel() : a]
- )
- }
- return () =>
- t.createVNode(
- Gt,
- t.mergeProps({ class: Bd(), position: 'bottom', 'onUpdate:show': a }, m(e, Cd)),
- { default: () => [l(), d(), u()] }
- )
- }
- })
- ),
- [Id, Ad] = Ie('sidebar'),
- zd = Symbol(Id),
- Ed = { modelValue: V(0) }
- const Ld = We(
- t.defineComponent({
- name: Id,
- props: Ed,
- emits: ['change', 'update:modelValue'],
- setup(e, { emit: o, slots: n }) {
- const { linkChildren: a } = A(zd),
- r = () => +e.modelValue
- return (
- a({
- getActive: r,
- setActive: (e) => {
- e !== r() && (o('update:modelValue', e), o('change', e))
- }
- }),
- () => {
- var e
- return t.createVNode('div', { role: 'tablist', class: Ad() }, [
- null == (e = n.default) ? void 0 : e.call(n)
- ])
- }
- )
- }
- })
- ),
- [$d, Md] = Ie('sidebar-item'),
- Rd = d({}, et, { dot: Boolean, title: String, badge: g, disabled: Boolean, badgeProps: Object })
- const Fd = We(
- t.defineComponent({
- name: $d,
- props: Rd,
- emits: ['click'],
- setup(e, { emit: o, slots: n }) {
- const a = ot(),
- { parent: r, index: l } = D(zd)
- if (!r) return
- const i = () => {
- e.disabled || (o('click', l.value), r.setActive(l.value), a())
- }
- return () => {
- const { dot: o, badge: a, title: s, disabled: c } = e,
- d = l.value === r.getActive()
- return t.createVNode(
- 'div',
- {
- role: 'tab',
- class: Md({ select: d, disabled: c }),
- tabindex: c ? void 0 : 0,
- 'aria-selected': d,
- onClick: i
- },
- [
- t.createVNode(
- lt,
- t.mergeProps({ dot: o, class: Md('text'), content: a }, e.badgeProps),
- { default: () => [n.title ? n.title() : s] }
- )
- ]
- )
- }
- }
- })
- ),
- [Hd, jd, Wd] = Ie('signature'),
- Ud = {
- tips: String,
- type: N('png'),
- penColor: N('#000'),
- lineWidth: x(3),
- clearButtonText: String,
- backgroundColor: N(''),
- confirmButtonText: String
- }
- const Yd = We(
- t.defineComponent({
- name: Hd,
- props: Ud,
- emits: ['submit', 'clear', 'start', 'end', 'signing'],
- setup(e, { emit: o }) {
- const n = t.ref(),
- a = t.ref(),
- r = t.reactive({
- width: 0,
- height: 0,
- ctx: null,
- ratio: u ? window.devicePixelRatio : 1
- })
- let l
- const i =
- !u ||
- (() => {
- var e
- const t = document.createElement('canvas')
- return !!(null == (e = t.getContext) ? void 0 : e.call(t, '2d'))
- })(),
- s = () => {
- if (!r.ctx) return !1
- r.ctx.beginPath(),
- (r.ctx.lineWidth = e.lineWidth * r.ratio),
- (r.ctx.strokeStyle = e.penColor),
- (l = P(n)),
- o('start')
- },
- c = (e) => {
- var t, n
- if (!r.ctx) return !1
- le(e)
- const a = e.touches[0],
- i = (a.clientX - ((null == l ? void 0 : l.left) || 0)) * r.ratio,
- s = (a.clientY - ((null == l ? void 0 : l.top) || 0)) * r.ratio
- ;(r.ctx.lineCap = 'round'),
- (r.ctx.lineJoin = 'round'),
- null == (t = r.ctx) || t.lineTo(i, s),
- null == (n = r.ctx) || n.stroke(),
- o('signing', e)
- },
- d = (e) => {
- le(e), o('end')
- },
- p = () => {
- r.ctx &&
- e.backgroundColor &&
- ((r.ctx.fillStyle = e.backgroundColor), r.ctx.fillRect(0, 0, r.width, r.height))
- },
- m = () => {
- var t, a
- const r = n.value
- if (!r) return
- const l = ((e) => {
- const t = document.createElement('canvas')
- return (t.width = e.width), (t.height = e.height), e.toDataURL() === t.toDataURL()
- })(r),
- i = l
- ? ''
- : (null ==
- (a = (t = {
- jpg: () => r.toDataURL('image/jpeg', 0.8),
- jpeg: () => r.toDataURL('image/jpeg', 0.8)
- })[e.type])
- ? void 0
- : a.call(t)) || r.toDataURL(`image/${e.type}`)
- o('submit', { image: i, canvas: r })
- },
- f = () => {
- r.ctx && (r.ctx.clearRect(0, 0, r.width, r.height), r.ctx.closePath(), p()),
- o('clear')
- }
- return (
- t.onMounted(() => {
- var e, o, l
- i &&
- ((r.ctx = null == (e = n.value) ? void 0 : e.getContext('2d')),
- (r.width = ((null == (o = a.value) ? void 0 : o.offsetWidth) || 0) * r.ratio),
- (r.height = ((null == (l = a.value) ? void 0 : l.offsetHeight) || 0) * r.ratio),
- t.nextTick(() => {
- p()
- }))
- }),
- () =>
- t.createVNode('div', { class: jd() }, [
- t.createVNode('div', { class: jd('content'), ref: a }, [
- i
- ? t.createVNode(
- 'canvas',
- {
- ref: n,
- width: r.width,
- height: r.height,
- onTouchstartPassive: s,
- onTouchmove: c,
- onTouchend: d
- },
- null
- )
- : t.createVNode('p', null, [e.tips])
- ]),
- t.createVNode('div', { class: jd('footer') }, [
- t.createVNode(
- St,
- { size: 'small', onClick: f },
- { default: () => [e.clearButtonText || Wd('clear')] }
- ),
- t.createVNode(
- St,
- { type: 'primary', size: 'small', onClick: m },
- { default: () => [e.confirmButtonText || Wd('confirm')] }
- )
- ])
- ])
- )
- }
- })
- ),
- [qd, Xd] = Ie('skeleton-title'),
- Gd = { round: Boolean, titleWidth: g }
- const Zd = We(
- t.defineComponent({
- name: qd,
- props: Gd,
- setup: (e) => () =>
- t.createVNode(
- 'h3',
- { class: Xd([{ round: e.round }]), style: { width: de(e.titleWidth) } },
- null
- )
- })
- )
- var Kd = Zd
- const [_d, Jd] = Ie('skeleton-avatar'),
- Qd = { avatarSize: g, avatarShape: N('round') }
- const eu = We(
- t.defineComponent({
- name: _d,
- props: Qd,
- setup: (e) => () =>
- t.createVNode('div', { class: Jd([e.avatarShape]), style: ue(e.avatarSize) }, null)
- })
- )
- var tu = eu
- const ou = '100%',
- nu = { round: Boolean, rowWidth: { type: g, default: ou } },
- [au, ru] = Ie('skeleton-paragraph')
- const lu = We(
- t.defineComponent({
- name: au,
- props: nu,
- setup: (e) => () =>
- t.createVNode(
- 'div',
- { class: ru([{ round: e.round }]), style: { width: e.rowWidth } },
- null
- )
- })
- )
- var iu = lu
- const [su, cu] = Ie('skeleton'),
- du = {
- row: V(0),
- round: Boolean,
- title: Boolean,
- titleWidth: g,
- avatar: Boolean,
- avatarSize: g,
- avatarShape: N('round'),
- loading: b,
- animate: b,
- rowWidth: { type: [Number, String, Array], default: ou }
- }
- const uu = We(
- t.defineComponent({
- name: su,
- inheritAttrs: !1,
- props: du,
- setup(e, { slots: o, attrs: n }) {
- const a = () => {
- if (e.avatar)
- return t.createVNode(
- tu,
- { avatarShape: e.avatarShape, avatarSize: e.avatarSize },
- null
- )
- },
- r = () => {
- if (e.title)
- return t.createVNode(Kd, { round: e.round, titleWidth: e.titleWidth }, null)
- },
- l = (t) => {
- const { rowWidth: o } = e
- return o === ou && t === +e.row - 1 ? '60%' : Array.isArray(o) ? o[t] : o
- }
- return () => {
- var i
- return e.loading
- ? t.createVNode(
- 'div',
- t.mergeProps({ class: cu({ animate: e.animate, round: e.round }) }, n),
- [
- o.template
- ? o.template()
- : t.createVNode(t.Fragment, null, [
- a(),
- t.createVNode('div', { class: cu('content') }, [
- r(),
- Array(+e.row)
- .fill('')
- .map((o, n) =>
- t.createVNode(
- iu,
- { key: n, round: e.round, rowWidth: de(l(n)) },
- null
- )
- )
- ])
- ])
- ]
- )
- : null == (i = o.default)
- ? void 0
- : i.call(o)
- }
- }
- })
- ),
- [pu, mu] = Ie('skeleton-image'),
- fu = { imageSize: g, imageShape: N('square') }
- const vu = We(
- t.defineComponent({
- name: pu,
- props: fu,
- setup: (e) => () =>
- t.createVNode('div', { class: mu([e.imageShape]), style: ue(e.imageSize) }, [
- t.createVNode(ht, { name: 'photo', class: mu('icon') }, null)
- ])
- })
- ),
- [hu, gu] = Ie('slider'),
- bu = {
- min: V(0),
- max: V(100),
- step: V(1),
- range: Boolean,
- reverse: Boolean,
- disabled: Boolean,
- readonly: Boolean,
- vertical: Boolean,
- barHeight: g,
- buttonSize: g,
- activeColor: String,
- inactiveColor: String,
- modelValue: { type: [Number, Array], default: 0 }
- }
- const yu = We(
- t.defineComponent({
- name: hu,
- props: bu,
- emits: ['change', 'dragEnd', 'dragStart', 'update:modelValue'],
- setup(e, { emit: o, slots: n }) {
- let a, r, l
- const i = t.ref(),
- s = [t.ref(), t.ref()],
- c = t.ref(),
- d = $t(),
- u = t.computed(() => Number(e.max) - Number(e.min)),
- p = t.computed(() => {
- const t = e.vertical ? 'width' : 'height'
- return { background: e.inactiveColor, [t]: de(e.barHeight) }
- }),
- m = (t) => e.range && Array.isArray(t),
- v = () => {
- const { modelValue: t, min: o } = e
- return m(t)
- ? (100 * (t[1] - t[0])) / u.value + '%'
- : (100 * (t - Number(o))) / u.value + '%'
- },
- h = t.computed(() => {
- const t = { [e.vertical ? 'height' : 'width']: v(), background: e.activeColor }
- c.value && (t.transition = 'none')
- return (
- (t[e.vertical ? (e.reverse ? 'bottom' : 'top') : e.reverse ? 'right' : 'left'] =
- (() => {
- const { modelValue: t, min: o } = e
- return m(t) ? (100 * (t[0] - Number(o))) / u.value + '%' : '0%'
- })()),
- t
- )
- }),
- g = (t) => {
- const o = +e.min,
- n = +e.max,
- a = +e.step
- t = ye(t, o, n)
- return Ve(o, Math.round((t - o) / a) * a)
- },
- b = (t, n) => {
- ;(t = m(t)
- ? ((t) => {
- var o, n
- const a = null != (o = t[0]) ? o : Number(e.min),
- r = null != (n = t[1]) ? n : Number(e.max)
- return a > r ? [r, a] : [a, r]
- })(t).map(g)
- : g(t)),
- f(t, e.modelValue) || o('update:modelValue', t),
- n && !f(t, l) && o('change', t)
- },
- y = (t) => {
- if ((t.stopPropagation(), e.disabled || e.readonly)) return
- const { min: o, reverse: n, vertical: a, modelValue: r } = e,
- l = P(i),
- s = a ? l.height : l.width,
- c =
- Number(o) +
- ((a
- ? n
- ? l.bottom - t.clientY
- : t.clientY - l.top
- : n
- ? l.right - t.clientX
- : t.clientX - l.left) /
- s) *
- u.value
- if (m(r)) {
- const [e, t] = r
- b(c <= (e + t) / 2 ? [c, t] : [e, c], !0)
- } else b(c, !0)
- },
- w = (t) => {
- if (e.disabled || e.readonly) return
- 'start' === c.value && o('dragStart', t), le(t, !0), d.move(t), (c.value = 'dragging')
- const n = P(i)
- let s =
- ((e.vertical ? d.deltaY.value : d.deltaX.value) /
- (e.vertical ? n.height : n.width)) *
- u.value
- if ((e.reverse && (s = -s), m(l))) {
- const t = e.reverse ? 1 - a : a
- r[t] = l[t] + s
- } else r = l + s
- b(r)
- },
- x = (t) => {
- e.disabled ||
- e.readonly ||
- ('dragging' === c.value && (b(r, !0), o('dragEnd', t)), (c.value = ''))
- },
- V = (t) => {
- if ('number' == typeof t) {
- return gu('button-wrapper', ['left', 'right'][t])
- }
- return gu('button-wrapper', e.reverse ? 'left' : 'right')
- },
- N = (o, a) => {
- if ('number' == typeof a) {
- const e = n[0 === a ? 'left-button' : 'right-button']
- if (e) return e({ value: o })
- }
- return n.button
- ? n.button({ value: o })
- : t.createVNode('div', { class: gu('button'), style: ue(e.buttonSize) }, null)
- },
- k = (o) => {
- const n = 'number' == typeof o ? e.modelValue[o] : e.modelValue
- return t.createVNode(
- 'div',
- {
- ref: s[null != o ? o : 0],
- role: 'slider',
- class: V(o),
- tabindex: e.disabled ? void 0 : 0,
- 'aria-valuemin': e.min,
- 'aria-valuenow': n,
- 'aria-valuemax': e.max,
- 'aria-disabled': e.disabled || void 0,
- 'aria-readonly': e.readonly || void 0,
- 'aria-orientation': e.vertical ? 'vertical' : 'horizontal',
- onTouchstartPassive: (t) => {
- 'number' == typeof o && (a = o),
- ((t) => {
- e.disabled ||
- e.readonly ||
- (d.start(t),
- (r = e.modelValue),
- (l = m(r) ? r.map(g) : g(r)),
- (c.value = 'start'))
- })(t)
- },
- onTouchend: x,
- onTouchcancel: x,
- onClick: re
- },
- [N(n, o)]
- )
- }
- return (
- b(e.modelValue),
- _(() => e.modelValue),
- s.forEach((e) => {
- j('touchmove', w, { target: e })
- }),
- () =>
- t.createVNode(
- 'div',
- {
- ref: i,
- style: p.value,
- class: gu({ vertical: e.vertical, disabled: e.disabled }),
- onClick: y
- },
- [
- t.createVNode('div', { class: gu('bar'), style: h.value }, [
- e.range ? [k(0), k(1)] : k()
- ])
- ]
- )
- )
- }
- })
- ),
- [wu, xu] = Ie('space'),
- Vu = {
- align: String,
- direction: { type: String, default: 'horizontal' },
- size: { type: [Number, String, Array], default: 8 },
- wrap: Boolean,
- fill: Boolean
- }
- function Nu(e = []) {
- const o = []
- return (
- e.forEach((e) => {
- Array.isArray(e)
- ? o.push(...e)
- : e.type === t.Fragment
- ? o.push(...Nu(e.children))
- : o.push(e)
- }),
- o.filter((e) => {
- var o
- return !(
- e &&
- (e.type === t.Comment ||
- (e.type === t.Fragment && 0 === (null == (o = e.children) ? void 0 : o.length)) ||
- (e.type === t.Text && '' === e.children.trim()))
- )
- })
- )
- }
- const ku = We(
- t.defineComponent({
- name: wu,
- props: Vu,
- setup(e, { slots: o }) {
- const n = t.computed(() => {
- var t
- return null != (t = e.align) ? t : 'horizontal' === e.direction ? 'center' : ''
- }),
- a = (e) => ('number' == typeof e ? e + 'px' : e),
- r = (t) => {
- const o = {},
- n = `${a(Array.isArray(e.size) ? e.size[0] : e.size)}`,
- r = `${a(Array.isArray(e.size) ? e.size[1] : e.size)}`
- return t
- ? e.wrap
- ? { marginBottom: r }
- : {}
- : ('horizontal' === e.direction && (o.marginRight = n),
- ('vertical' === e.direction || e.wrap) && (o.marginBottom = r),
- o)
- }
- return () => {
- var a
- const l = Nu(null == (a = o.default) ? void 0 : a.call(o))
- return t.createVNode(
- 'div',
- {
- class: [
- xu({
- [e.direction]: e.direction,
- [`align-${n.value}`]: n.value,
- wrap: e.wrap,
- fill: e.fill
- })
- ]
- },
- [
- l.map((e, o) =>
- t.createVNode(
- 'div',
- { key: `item-${o}`, class: `${wu}-item`, style: r(o === l.length - 1) },
- [e]
- )
- )
- ]
- )
- }
- }
- })
- ),
- [Cu, Su] = Ie('steps'),
- Tu = {
- active: V(0),
- direction: N('horizontal'),
- activeIcon: N('checked'),
- iconPrefix: String,
- finishIcon: String,
- activeColor: String,
- inactiveIcon: String,
- inactiveColor: String
- },
- Bu = Symbol(Cu)
- var Pu = t.defineComponent({
- name: Cu,
- props: Tu,
- emits: ['clickStep'],
- setup(e, { emit: o, slots: n }) {
- const { linkChildren: a } = A(Bu)
- return (
- a({ props: e, onClickStep: (e) => o('clickStep', e) }),
- () => {
- var o
- return t.createVNode('div', { class: Su([e.direction]) }, [
- t.createVNode('div', { class: Su('items') }, [
- null == (o = n.default) ? void 0 : o.call(n)
- ])
- ])
- }
- )
- }
- })
- const [Du, Ou] = Ie('step')
- const Iu = We(
- t.defineComponent({
- name: Du,
- setup(e, { slots: o }) {
- const { parent: n, index: a } = D(Bu)
- if (!n) return
- const r = n.props,
- l = () => {
- const e = +r.active
- return a.value < e ? 'finish' : a.value === e ? 'process' : 'waiting'
- },
- i = () => 'process' === l(),
- s = t.computed(() => ({
- background: 'finish' === l() ? r.activeColor : r.inactiveColor
- })),
- c = t.computed(() =>
- i()
- ? { color: r.activeColor }
- : 'waiting' === l()
- ? { color: r.inactiveColor }
- : void 0
- ),
- d = () => n.onClickStep(a.value),
- u = () => {
- const {
- iconPrefix: e,
- finishIcon: n,
- activeIcon: a,
- activeColor: c,
- inactiveIcon: d
- } = r
- return i()
- ? o['active-icon']
- ? o['active-icon']()
- : t.createVNode(
- ht,
- { class: Ou('icon', 'active'), name: a, color: c, classPrefix: e },
- null
- )
- : 'finish' === l() && (n || o['finish-icon'])
- ? o['finish-icon']
- ? o['finish-icon']()
- : t.createVNode(
- ht,
- { class: Ou('icon', 'finish'), name: n, color: c, classPrefix: e },
- null
- )
- : o['inactive-icon']
- ? o['inactive-icon']()
- : d
- ? t.createVNode(ht, { class: Ou('icon'), name: d, classPrefix: e }, null)
- : t.createVNode('i', { class: Ou('circle'), style: s.value }, null)
- }
- return () => {
- var e
- const n = l()
- return t.createVNode('div', { class: [Ae, Ou([r.direction, { [n]: n }])] }, [
- t.createVNode(
- 'div',
- { class: Ou('title', { active: i() }), style: c.value, onClick: d },
- [null == (e = o.default) ? void 0 : e.call(o)]
- ),
- t.createVNode('div', { class: Ou('circle-container'), onClick: d }, [u()]),
- t.createVNode('div', { class: Ou('line'), style: s.value }, null)
- ])
- }
- }
- })
- ),
- [Au, zu] = Ie('stepper'),
- Eu = (e, t) => String(e) === String(t),
- Lu = {
- min: V(1),
- max: V(1 / 0),
- name: V(''),
- step: V(1),
- theme: String,
- integer: Boolean,
- disabled: Boolean,
- showPlus: b,
- showMinus: b,
- showInput: b,
- longPress: b,
- autoFixed: b,
- allowEmpty: Boolean,
- modelValue: g,
- inputWidth: g,
- buttonSize: g,
- placeholder: String,
- disablePlus: Boolean,
- disableMinus: Boolean,
- disableInput: Boolean,
- beforeChange: Function,
- defaultValue: V(1),
- decimalLength: g
- }
- const $u = We(
- t.defineComponent({
- name: Au,
- props: Lu,
- emits: ['plus', 'blur', 'minus', 'focus', 'change', 'overlimit', 'update:modelValue'],
- setup(e, { emit: n }) {
- const a = (t, n = !0) => {
- const { min: a, max: r, allowEmpty: l, decimalLength: i } = e
- return (
- (l && '' === t) ||
- ((t = '' === (t = xe(String(t), !e.integer)) ? 0 : +t),
- (t = Number.isNaN(t) ? +a : t),
- (t = n ? Math.max(Math.min(+r, t), +a) : t),
- o(i) && (t = t.toFixed(+i))),
- t
- )
- }
- let r
- const l = t.ref(),
- i = t.ref(
- (() => {
- var t
- const o = null != (t = e.modelValue) ? t : e.defaultValue,
- r = a(o)
- return Eu(r, e.modelValue) || n('update:modelValue', r), r
- })()
- ),
- s = t.computed(() => e.disabled || e.disableMinus || +i.value <= +e.min),
- c = t.computed(() => e.disabled || e.disablePlus || +i.value >= +e.max),
- d = t.computed(() => ({ width: de(e.inputWidth), height: de(e.buttonSize) })),
- u = t.computed(() => ue(e.buttonSize)),
- p = (t) => {
- e.beforeChange
- ? je(e.beforeChange, {
- args: [t],
- done() {
- i.value = t
- }
- })
- : (i.value = t)
- },
- m = () => {
- if (('plus' === r && c.value) || ('minus' === r && s.value))
- return void n('overlimit', r)
- const t = 'minus' === r ? -e.step : +e.step,
- o = a(Ve(+i.value, t))
- p(o), n(r)
- },
- f = (t) => {
- const n = t.target,
- { value: a } = n,
- { decimalLength: r } = e
- let l = xe(String(a), !e.integer)
- if (o(r) && l.includes('.')) {
- const e = l.split('.')
- l = `${e[0]}.${e[1].slice(0, +r)}`
- }
- e.beforeChange ? (n.value = String(i.value)) : Eu(a, l) || (n.value = l)
- const s = l === String(+l)
- p(s ? +l : l)
- },
- v = (t) => {
- var o
- e.disableInput ? null == (o = l.value) || o.blur() : n('focus', t)
- },
- h = (o) => {
- const r = o.target,
- l = a(r.value, e.autoFixed)
- ;(r.value = String(l)),
- (i.value = l),
- t.nextTick(() => {
- n('blur', o), ae()
- })
- }
- let g, b
- const y = () => {
- b = setTimeout(() => {
- m(), y()
- }, 200)
- },
- w = (t) => {
- e.longPress && (clearTimeout(b), g && le(t))
- },
- x = (t) => {
- e.disableInput && le(t)
- },
- V = (t) => ({
- onClick: (e) => {
- le(e), (r = t), m()
- },
- onTouchstartPassive: () => {
- ;(r = t),
- e.longPress &&
- ((g = !1),
- clearTimeout(b),
- (b = setTimeout(() => {
- ;(g = !0), m(), y()
- }, 500)))
- },
- onTouchend: w,
- onTouchcancel: w
- })
- return (
- t.watch(
- () => [e.max, e.min, e.integer, e.decimalLength],
- () => {
- const e = a(i.value)
- Eu(e, i.value) || (i.value = e)
- }
- ),
- t.watch(
- () => e.modelValue,
- (e) => {
- Eu(e, i.value) || (i.value = a(e))
- }
- ),
- t.watch(i, (t) => {
- n('update:modelValue', t), n('change', t, { name: e.name })
- }),
- _(() => e.modelValue),
- () =>
- t.createVNode('div', { role: 'group', class: zu([e.theme]) }, [
- t.withDirectives(
- t.createVNode(
- 'button',
- t.mergeProps(
- {
- type: 'button',
- style: u.value,
- class: [zu('minus', { disabled: s.value }), { [Fe]: !s.value }],
- 'aria-disabled': s.value || void 0
- },
- V('minus')
- ),
- null
- ),
- [[t.vShow, e.showMinus]]
- ),
- t.withDirectives(
- t.createVNode(
- 'input',
- {
- ref: l,
- type: e.integer ? 'tel' : 'text',
- role: 'spinbutton',
- class: zu('input'),
- value: i.value,
- style: d.value,
- disabled: e.disabled,
- readonly: e.disableInput,
- inputmode: e.integer ? 'numeric' : 'decimal',
- placeholder: e.placeholder,
- 'aria-valuemax': e.max,
- 'aria-valuemin': e.min,
- 'aria-valuenow': i.value,
- onBlur: h,
- onInput: f,
- onFocus: v,
- onMousedown: x
- },
- null
- ),
- [[t.vShow, e.showInput]]
- ),
- t.withDirectives(
- t.createVNode(
- 'button',
- t.mergeProps(
- {
- type: 'button',
- style: u.value,
- class: [zu('plus', { disabled: c.value }), { [Fe]: !c.value }],
- 'aria-disabled': c.value || void 0
- },
- V('plus')
- ),
- null
- ),
- [[t.vShow, e.showPlus]]
- )
- ])
- )
- }
- })
- ),
- Mu = We(Pu),
- [Ru, Fu, Hu] = Ie('submit-bar'),
- ju = {
- tip: String,
- label: String,
- price: Number,
- tipIcon: String,
- loading: Boolean,
- currency: N('¥'),
- disabled: Boolean,
- textAlign: String,
- buttonText: String,
- buttonType: N('danger'),
- buttonColor: String,
- suffixLabel: String,
- placeholder: Boolean,
- decimalLength: V(2),
- safeAreaInsetBottom: b
- }
- const Wu = We(
- t.defineComponent({
- name: Ru,
- props: ju,
- emits: ['submit'],
- setup(e, { emit: o, slots: n }) {
- const a = t.ref(),
- r = Xe(a, Fu),
- l = () => {
- const {
- price: o,
- label: n,
- currency: a,
- textAlign: r,
- suffixLabel: l,
- decimalLength: i
- } = e
- if ('number' == typeof o) {
- const e = (o / 100).toFixed(+i).split('.'),
- s = i ? `.${e[1]}` : ''
- return t.createVNode('div', { class: Fu('text'), style: { textAlign: r } }, [
- t.createVNode('span', null, [n || Hu('label')]),
- t.createVNode('span', { class: Fu('price') }, [
- a,
- t.createVNode('span', { class: Fu('price-integer') }, [e[0]]),
- s
- ]),
- l && t.createVNode('span', { class: Fu('suffix-label') }, [l])
- ])
- }
- },
- i = () => {
- var o
- const { tip: a, tipIcon: r } = e
- if (n.tip || a)
- return t.createVNode('div', { class: Fu('tip') }, [
- r && t.createVNode(ht, { class: Fu('tip-icon'), name: r }, null),
- a && t.createVNode('span', { class: Fu('tip-text') }, [a]),
- null == (o = n.tip) ? void 0 : o.call(n)
- ])
- },
- s = () => o('submit'),
- c = () => {
- var o, r
- return t.createVNode(
- 'div',
- { ref: a, class: [Fu(), { 'van-safe-area-bottom': e.safeAreaInsetBottom }] },
- [
- null == (o = n.top) ? void 0 : o.call(n),
- i(),
- t.createVNode('div', { class: Fu('bar') }, [
- null == (r = n.default) ? void 0 : r.call(n),
- l(),
- n.button
- ? n.button()
- : t.createVNode(
- St,
- {
- round: !0,
- type: e.buttonType,
- text: e.buttonText,
- class: Fu('button', e.buttonType),
- color: e.buttonColor,
- loading: e.loading,
- disabled: e.disabled,
- onClick: s
- },
- null
- )
- ])
- ]
- )
- }
- return () => (e.placeholder ? r(c) : c())
- }
- })
- ),
- [Uu, Yu] = Ie('swipe-cell'),
- qu = {
- name: V(''),
- disabled: Boolean,
- leftWidth: g,
- rightWidth: g,
- beforeClose: Function,
- stopPropagation: Boolean
- }
- const Xu = We(
- t.defineComponent({
- name: Uu,
- props: qu,
- emits: ['open', 'close', 'click'],
- setup(e, { emit: n, slots: a }) {
- let r, l, i
- const s = t.ref(),
- c = t.ref(),
- d = t.ref(),
- u = t.reactive({ offset: 0, dragging: !1 }),
- p = $t(),
- m = (e) => (e.value ? P(e).width : 0),
- f = t.computed(() => (o(e.leftWidth) ? +e.leftWidth : m(c))),
- v = t.computed(() => (o(e.rightWidth) ? +e.rightWidth : m(d))),
- h = (t) => {
- ;(u.offset = 'left' === t ? f.value : -v.value),
- r || ((r = !0), n('open', { name: e.name, position: t }))
- },
- g = (t) => {
- ;(u.offset = 0), r && ((r = !1), n('close', { name: e.name, position: t }))
- },
- b = (t) => {
- e.disabled || ((i = u.offset), p.start(t))
- },
- y = () => {
- u.dragging &&
- ((u.dragging = !1),
- ((e) => {
- const t = Math.abs(u.offset),
- o = r ? 0.85 : 0.15,
- n = 'left' === e ? f.value : v.value
- n && t > n * o ? h(e) : g(e)
- })(u.offset > 0 ? 'left' : 'right'),
- setTimeout(() => {
- l = !1
- }, 0))
- },
- w = (t = 'outside') => {
- n('click', t),
- r &&
- !l &&
- je(e.beforeClose, { args: [{ name: e.name, position: t }], done: () => g(t) })
- },
- x = (e, t) => (o) => {
- t && o.stopPropagation(), w(e)
- },
- V = (e, o) => {
- const n = a[e]
- if (n) return t.createVNode('div', { ref: o, class: Yu(e), onClick: x(e, !0) }, [n()])
- }
- return (
- Qe({ open: h, close: g }),
- W(s, () => w('outside'), { eventName: 'touchstart' }),
- j(
- 'touchmove',
- (t) => {
- if (e.disabled) return
- const { deltaX: o } = p
- if ((p.move(t), p.isHorizontal())) {
- ;(l = !0), (u.dragging = !0)
- ;(!r || o.value * i < 0) && le(t, e.stopPropagation),
- (u.offset = ye(o.value + i, -v.value, f.value))
- }
- },
- { target: s }
- ),
- () => {
- var e
- const o = {
- transform: `translate3d(${u.offset}px, 0, 0)`,
- transitionDuration: u.dragging ? '0s' : '.6s'
- }
- return t.createVNode(
- 'div',
- {
- ref: s,
- class: Yu(),
- onClick: x('cell', l),
- onTouchstartPassive: b,
- onTouchend: y,
- onTouchcancel: y
- },
- [
- t.createVNode('div', { class: Yu('wrapper'), style: o }, [
- V('left', c),
- null == (e = a.default) ? void 0 : e.call(a),
- V('right', d)
- ])
- ]
- )
- }
- )
- }
- })
- ),
- [Gu, Zu] = Ie('tabbar'),
- Ku = {
- route: Boolean,
- fixed: b,
- border: b,
- zIndex: g,
- placeholder: Boolean,
- activeColor: String,
- beforeChange: Function,
- inactiveColor: String,
- modelValue: V(0),
- safeAreaInsetBottom: { type: Boolean, default: null }
- },
- _u = Symbol(Gu)
- const Ju = We(
- t.defineComponent({
- name: Gu,
- props: Ku,
- emits: ['change', 'update:modelValue'],
- setup(e, { emit: o, slots: n }) {
- const a = t.ref(),
- { linkChildren: r } = A(_u),
- l = Xe(a, Zu),
- i = () => {
- var t
- return null != (t = e.safeAreaInsetBottom) ? t : e.fixed
- },
- s = () => {
- var o
- const { fixed: r, zIndex: l, border: s } = e
- return t.createVNode(
- 'div',
- {
- ref: a,
- role: 'tablist',
- style: pe(l),
- class: [Zu({ fixed: r }), { [Me]: s, 'van-safe-area-bottom': i() }]
- },
- [null == (o = n.default) ? void 0 : o.call(n)]
- )
- }
- return (
- r({
- props: e,
- setActive: (t, n) => {
- je(e.beforeChange, {
- args: [t],
- done() {
- o('update:modelValue', t), o('change', t), n()
- }
- })
- }
- }),
- () => (e.fixed && e.placeholder ? l(s) : s())
- )
- }
- })
- ),
- [Qu, ep] = Ie('tabbar-item'),
- tp = d({}, et, {
- dot: Boolean,
- icon: String,
- name: g,
- badge: g,
- badgeProps: Object,
- iconPrefix: String
- })
- const op = We(
- t.defineComponent({
- name: Qu,
- props: tp,
- emits: ['click'],
- setup(e, { emit: o, slots: n }) {
- const r = ot(),
- l = t.getCurrentInstance().proxy,
- { parent: i, index: s } = D(_u)
- if (!i) return
- const c = t.computed(() => {
- var t
- const { route: o, modelValue: n } = i.props
- if (o && '$route' in l) {
- const { $route: t } = l,
- { to: o } = e,
- n = a(o) ? o : { path: o }
- return !!t.matched.find((e) => {
- const t = 'path' in n && n.path === e.path,
- o = 'name' in n && n.name === e.name
- return t || o
- })
- }
- return (null != (t = e.name) ? t : s.value) === n
- }),
- d = (t) => {
- var n
- c.value || i.setActive(null != (n = e.name) ? n : s.value, r), o('click', t)
- },
- u = () =>
- n.icon
- ? n.icon({ active: c.value })
- : e.icon
- ? t.createVNode(ht, { name: e.icon, classPrefix: e.iconPrefix }, null)
- : void 0
- return () => {
- var o
- const { dot: a, badge: r } = e,
- { activeColor: l, inactiveColor: s } = i.props,
- p = c.value ? l : s
- return t.createVNode(
- 'div',
- {
- role: 'tab',
- class: ep({ active: c.value }),
- style: { color: p },
- tabindex: 0,
- 'aria-selected': c.value,
- onClick: d
- },
- [
- t.createVNode(
- lt,
- t.mergeProps({ dot: a, class: ep('icon'), content: r }, e.badgeProps),
- { default: u }
- ),
- t.createVNode('div', { class: ep('text') }, [
- null == (o = n.default) ? void 0 : o.call(n, { active: c.value })
- ])
- ]
- )
- }
- }
- })
- ),
- [np, ap] = Ie('text-ellipsis'),
- rp = { rows: V(1), dots: N('...'), content: N(''), expandText: N(''), collapseText: N('') }
- const lp = We(
- t.defineComponent({
- name: np,
- props: rp,
- emits: ['clickAction'],
- setup(e, { emit: o }) {
- const n = t.ref(''),
- a = t.ref(!1),
- r = t.ref(!1),
- l = t.ref(),
- i = (e) => {
- if (!e) return 0
- const t = e.match(/^\d*(\.\d*)?/)
- return t ? Number(t[0]) : 0
- },
- s = () => {
- const t = (() => {
- if (!l.value) return
- const t = window.getComputedStyle(l.value),
- o = document.createElement('div')
- return (
- Array.prototype.slice.apply(t).forEach((e) => {
- o.style.setProperty(e, t.getPropertyValue(e))
- }),
- (o.style.position = 'fixed'),
- (o.style.zIndex = '-9999'),
- (o.style.top = '-9999px'),
- (o.style.height = 'auto'),
- (o.style.minHeight = 'auto'),
- (o.style.maxHeight = 'auto'),
- (o.innerText = e.content),
- document.body.appendChild(o),
- o
- )
- })()
- if (!t) return
- const { paddingBottom: o, paddingTop: a, lineHeight: s } = t.style,
- c = (Number(e.rows) + 0.5) * i(s) + i(a) + i(o)
- c < t.offsetHeight
- ? ((r.value = !0),
- (n.value = ((t, o) => {
- const { dots: n, content: a, expandText: r } = e
- let l = 0,
- i = a.length,
- s = -1
- for (; l <= i; ) {
- const e = Math.floor((l + i) / 2)
- ;(t.innerText = a.slice(0, e) + n + r),
- t.offsetHeight <= o ? ((l = e + 1), (s = e)) : (i = e - 1)
- }
- return a.slice(0, s) + n
- })(t, c)))
- : ((r.value = !1), (n.value = e.content)),
- document.body.removeChild(t)
- },
- c = (e) => {
- ;(a.value = !a.value), o('clickAction', e)
- }
- return (
- t.onMounted(s),
- t.watch(() => [e.content, e.rows], s),
- j('resize', s),
- () =>
- t.createVNode('div', { ref: l, class: ap() }, [
- a.value ? e.content : n.value,
- r.value
- ? t.createVNode('span', { class: ap('action'), onClick: c }, [
- a.value ? e.collapseText : e.expandText
- ])
- : null
- ])
- )
- }
- })
- ),
- [ip] = Ie('time-picker'),
- sp = d({}, gr, {
- minHour: V(0),
- maxHour: V(23),
- minMinute: V(0),
- maxMinute: V(59),
- minSecond: V(0),
- maxSecond: V(59),
- columnsType: { type: Array, default: () => ['hour', 'minute'] }
- })
- const cp = We(
- t.defineComponent({
- name: ip,
- props: sp,
- emits: ['confirm', 'cancel', 'change', 'update:modelValue'],
- setup(e, { emit: o, slots: n }) {
- const a = t.ref(e.modelValue),
- r = t.computed(() =>
- e.columnsType.map((t) => {
- const { filter: o, formatter: n } = e
- switch (t) {
- case 'hour':
- return wr(+e.minHour, +e.maxHour, t, n, o)
- case 'minute':
- return wr(+e.minMinute, +e.maxMinute, t, n, o)
- case 'second':
- return wr(+e.minSecond, +e.maxSecond, t, n, o)
- default:
- return []
- }
- })
- )
- t.watch(a, (t) => {
- f(t, e.modelValue) || o('update:modelValue', t)
- }),
- t.watch(
- () => e.modelValue,
- (e) => {
- ;(e = xr(e, r.value)), f(e, a.value) || (a.value = e)
- },
- { immediate: !0 }
- )
- const l = (...e) => o('change', ...e),
- i = (...e) => o('cancel', ...e),
- s = (...e) => o('confirm', ...e)
- return () =>
- t.createVNode(
- un,
- t.mergeProps(
- {
- modelValue: a.value,
- 'onUpdate:modelValue': (e) => (a.value = e),
- columns: r.value,
- onChange: l,
- onCancel: i,
- onConfirm: s
- },
- m(e, br)
- ),
- n
- )
- }
- })
- ),
- [dp, up] = Ie('tree-select'),
- pp = {
- max: V(1 / 0),
- items: w(),
- height: V(300),
- selectedIcon: N('success'),
- mainActiveIndex: V(0),
- activeId: { type: [Number, String, Array], default: 0 }
- }
- const mp = We(
- t.defineComponent({
- name: dp,
- props: pp,
- emits: ['clickNav', 'clickItem', 'update:activeId', 'update:mainActiveIndex'],
- setup(e, { emit: o, slots: n }) {
- const a = (t) => (Array.isArray(e.activeId) ? e.activeId.includes(t) : e.activeId === t),
- r = (n) =>
- t.createVNode(
- 'div',
- {
- key: n.id,
- class: ['van-ellipsis', up('item', { active: a(n.id), disabled: n.disabled })],
- onClick: () => {
- if (n.disabled) return
- let t
- if (Array.isArray(e.activeId)) {
- t = e.activeId.slice()
- const o = t.indexOf(n.id)
- ;-1 !== o ? t.splice(o, 1) : t.length < +e.max && t.push(n.id)
- } else t = n.id
- o('update:activeId', t), o('clickItem', n)
- }
- },
- [
- n.text,
- a(n.id) &&
- t.createVNode(ht, { name: e.selectedIcon, class: up('selected') }, null)
- ]
- ),
- l = (e) => {
- o('update:mainActiveIndex', e)
- },
- i = (e) => o('clickNav', e),
- s = () => {
- const o = e.items.map((e) =>
- t.createVNode(
- Fd,
- {
- dot: e.dot,
- badge: e.badge,
- class: [up('nav-item'), e.className],
- disabled: e.disabled,
- onClick: i
- },
- { title: () => (n['nav-text'] ? n['nav-text'](e) : e.text) }
- )
- )
- return t.createVNode(
- Ld,
- { class: up('nav'), modelValue: e.mainActiveIndex, onChange: l },
- { default: () => [o] }
- )
- },
- c = () => {
- if (n.content) return n.content()
- const t = e.items[+e.mainActiveIndex] || {}
- return t.children ? t.children.map(r) : void 0
- }
- return () =>
- t.createVNode('div', { class: up(), style: { height: de(e.height) } }, [
- s(),
- t.createVNode('div', { class: up('content') }, [c()])
- ])
- }
- })
- ),
- [fp, vp, hp] = Ie('uploader')
- function gp(e, t) {
- return new Promise((o) => {
- if ('file' === t) return void o()
- const n = new FileReader()
- ;(n.onload = (e) => {
- o(e.target.result)
- }),
- 'dataUrl' === t ? n.readAsDataURL(e) : 'text' === t && n.readAsText(e)
- })
- }
- function bp(e, t) {
- return v(e).some((e) => !!e.file && (n(t) ? t(e.file) : e.file.size > +t))
- }
- const yp = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg|avif)/i
- function wp(e) {
- return (
- !!e.isImage ||
- (e.file && e.file.type
- ? 0 === e.file.type.indexOf('image')
- : e.url
- ? ((t = e.url), yp.test(t))
- : 'string' == typeof e.content && 0 === e.content.indexOf('data:image'))
- )
- var t
- }
- var xp = t.defineComponent({
- props: {
- name: g,
- item: y(Object),
- index: Number,
- imageFit: String,
- lazyLoad: Boolean,
- deletable: Boolean,
- reupload: Boolean,
- previewSize: [Number, String, Array],
- beforeDelete: Function
- },
- emits: ['delete', 'preview', 'reupload'],
- setup(e, { emit: n, slots: a }) {
- const r = () => {
- const { status: n, message: a } = e.item
- if ('uploading' === n || 'failed' === n) {
- const e =
- 'failed' === n
- ? t.createVNode(ht, { name: 'close', class: vp('mask-icon') }, null)
- : t.createVNode(Vt, { class: vp('loading') }, null),
- r = o(a) && '' !== a
- return t.createVNode('div', { class: vp('mask') }, [
- e,
- r && t.createVNode('div', { class: vp('mask-message') }, [a])
- ])
- }
- },
- l = (t) => {
- const { name: o, item: a, index: r, beforeDelete: l } = e
- t.stopPropagation(), je(l, { args: [a, { name: o, index: r }], done: () => n('delete') })
- },
- i = () => n('preview'),
- s = () => n('reupload'),
- c = () => {
- if (e.deletable && 'uploading' !== e.item.status) {
- const e = a['preview-delete']
- return t.createVNode(
- 'div',
- {
- role: 'button',
- class: vp('preview-delete', { shadow: !e }),
- tabindex: 0,
- 'aria-label': hp('delete'),
- onClick: l
- },
- [
- e
- ? e()
- : t.createVNode(ht, { name: 'cross', class: vp('preview-delete-icon') }, null)
- ]
- )
- }
- },
- u = () => {
- if (a['preview-cover']) {
- const { index: o, item: n } = e
- return t.createVNode('div', { class: vp('preview-cover') }, [
- a['preview-cover'](d({ index: o }, n))
- ])
- }
- },
- p = () => {
- const { item: o, lazyLoad: n, imageFit: a, previewSize: r, reupload: l } = e
- return wp(o)
- ? t.createVNode(
- zr,
- {
- fit: a,
- src: o.content || o.url,
- class: vp('preview-image'),
- width: Array.isArray(r) ? r[0] : r,
- height: Array.isArray(r) ? r[1] : r,
- lazyLoad: n,
- onClick: l ? s : i
- },
- { default: u }
- )
- : t.createVNode('div', { class: vp('file'), style: ue(e.previewSize) }, [
- t.createVNode(ht, { class: vp('file-icon'), name: 'description' }, null),
- t.createVNode('div', { class: [vp('file-name'), 'van-ellipsis'] }, [
- o.file ? o.file.name : o.url
- ]),
- u()
- ])
- }
- return () => t.createVNode('div', { class: vp('preview') }, [p(), r(), c()])
- }
- })
- const Vp = {
- name: V(''),
- accept: N('image/*'),
- capture: String,
- multiple: Boolean,
- disabled: Boolean,
- readonly: Boolean,
- lazyLoad: Boolean,
- maxCount: V(1 / 0),
- imageFit: N('cover'),
- resultType: N('dataUrl'),
- uploadIcon: N('photograph'),
- uploadText: String,
- deletable: b,
- reupload: Boolean,
- afterRead: Function,
- showUpload: b,
- modelValue: w(),
- beforeRead: Function,
- beforeDelete: Function,
- previewSize: [Number, String, Array],
- previewImage: b,
- previewOptions: Object,
- previewFullImage: b,
- maxSize: { type: [Number, String, Function], default: 1 / 0 }
- }
- const Np = We(
- t.defineComponent({
- name: fp,
- props: Vp,
- emits: [
- 'delete',
- 'oversize',
- 'clickUpload',
- 'closePreview',
- 'clickPreview',
- 'clickReupload',
- 'update:modelValue'
- ],
- setup(e, { emit: o, slots: n }) {
- const a = t.ref(),
- l = [],
- i = t.ref(-1),
- s = (t = e.modelValue.length) => ({ name: e.name, index: t }),
- c = () => {
- a.value && (a.value.value = '')
- },
- u = (n) => {
- if ((c(), bp(n, e.maxSize))) {
- if (!Array.isArray(n)) return void o('oversize', n, s())
- {
- const t = (function (e, t) {
- const o = [],
- n = []
- return (
- e.forEach((e) => {
- bp(e, t) ? n.push(e) : o.push(e)
- }),
- { valid: o, invalid: n }
- )
- })(n, e.maxSize)
- if (((n = t.valid), o('oversize', t.invalid, s()), !n.length)) return
- }
- }
- if (((n = t.reactive(n)), i.value > -1)) {
- const t = [...e.modelValue]
- t.splice(i.value, 1, n), o('update:modelValue', t), (i.value = -1)
- } else o('update:modelValue', [...e.modelValue, ...v(n)])
- e.afterRead && e.afterRead(n, s())
- },
- p = (t) => {
- const { maxCount: o, modelValue: n, resultType: a } = e
- if (Array.isArray(t)) {
- const e = +o - n.length
- t.length > e && (t = t.slice(0, e)),
- Promise.all(t.map((e) => gp(e, a))).then((e) => {
- const o = t.map((t, o) => {
- const n = { file: t, status: '', message: '' }
- return e[o] && (n.content = e[o]), n
- })
- u(o)
- })
- } else
- gp(t, a).then((e) => {
- const o = { file: t, status: '', message: '' }
- e && (o.content = e), u(o)
- })
- },
- f = (t) => {
- const { files: o } = t.target
- if (e.disabled || !o || !o.length) return
- const n = 1 === o.length ? o[0] : [].slice.call(o)
- if (e.beforeRead) {
- const t = e.beforeRead(n, s())
- if (!t) return void c()
- if (r(t))
- return void t
- .then((e) => {
- p(e || n)
- })
- .catch(c)
- }
- p(n)
- }
- let h
- const g = () => o('closePreview'),
- b = (a, r) => {
- const c = ['imageFit', 'deletable', 'reupload', 'previewSize', 'beforeDelete'],
- u = d(m(e, c), m(a, c, !0))
- return t.createVNode(
- xp,
- t.mergeProps(
- {
- item: a,
- index: r,
- onClick: () => o(e.reupload ? 'clickReupload' : 'clickPreview', a, s(r)),
- onDelete: () =>
- ((t, n) => {
- const a = e.modelValue.slice(0)
- a.splice(n, 1), o('update:modelValue', a), o('delete', t, s(n))
- })(a, r),
- onPreview: () =>
- ((t) => {
- if (e.previewFullImage) {
- const o = e.modelValue.filter(wp),
- n = o
- .map(
- (e) => (
- e.file &&
- !e.url &&
- 'failed' !== e.status &&
- ((e.url = URL.createObjectURL(e.file)), l.push(e.url)),
- e.url
- )
- )
- .filter(Boolean)
- h = us(
- d(
- { images: n, startPosition: o.indexOf(t), onClose: g },
- e.previewOptions
- )
- )
- }
- })(a),
- onReupload: () =>
- ((e) => {
- V(), (i.value = e)
- })(r)
- },
- m(e, ['name', 'lazyLoad']),
- u
- ),
- m(n, ['preview-cover', 'preview-delete'])
- )
- },
- y = () => {
- if (e.previewImage) return e.modelValue.map(b)
- },
- w = (e) => o('clickUpload', e),
- x = () => {
- if (e.modelValue.length >= +e.maxCount && !e.reupload) return
- const o = e.modelValue.length >= +e.maxCount && e.reupload,
- r = e.readonly
- ? null
- : t.createVNode(
- 'input',
- {
- ref: a,
- type: 'file',
- class: vp('input'),
- accept: e.accept,
- capture: e.capture,
- multiple: e.multiple && -1 === i.value,
- disabled: e.disabled,
- onChange: f
- },
- null
- )
- return n.default
- ? t.withDirectives(
- t.createVNode('div', { class: vp('input-wrapper'), onClick: w }, [
- n.default(),
- r
- ]),
- [[t.vShow, !o]]
- )
- : t.withDirectives(
- t.createVNode(
- 'div',
- {
- class: vp('upload', { readonly: e.readonly }),
- style: ue(e.previewSize),
- onClick: w
- },
- [
- t.createVNode(ht, { name: e.uploadIcon, class: vp('upload-icon') }, null),
- e.uploadText &&
- t.createVNode('span', { class: vp('upload-text') }, [e.uploadText]),
- r
- ]
- ),
- [[t.vShow, e.showUpload && !o]]
- )
- },
- V = () => {
- a.value && !e.disabled && a.value.click()
- }
- return (
- t.onBeforeUnmount(() => {
- l.forEach((e) => URL.revokeObjectURL(e))
- }),
- Qe({
- chooseFile: V,
- closeImagePreview: () => {
- h && h.close()
- }
- }),
- _(() => e.modelValue),
- () =>
- t.createVNode('div', { class: vp() }, [
- t.createVNode('div', { class: vp('wrapper', { disabled: e.disabled }) }, [y(), x()])
- ])
- )
- }
- })
- ),
- [kp, Cp] = Ie('watermark'),
- Sp = {
- gapX: x(0),
- gapY: x(0),
- image: String,
- width: x(100),
- height: x(100),
- rotate: V(-22),
- zIndex: g,
- content: String,
- opacity: g,
- fullPage: b,
- textColor: N('#dcdee0')
- }
- const Tp = We(
- t.defineComponent({
- name: kp,
- props: Sp,
- setup(e, { slots: o }) {
- const n = t.ref(),
- a = t.ref(''),
- r = t.ref(''),
- l = () => {
- const n = { transformOrigin: 'center', transform: `rotate(${e.rotate}deg)` },
- a = e.width + e.gapX,
- l = e.height + e.gapY
- return t.createVNode(
- 'svg',
- {
- viewBox: `0 0 ${a} ${l}`,
- width: a,
- height: l,
- xmlns: 'http://www.w3.org/2000/svg',
- 'xmlns:xlink': 'http://www.w3.org/1999/xlink',
- style: { padding: `0 ${e.gapX}px ${e.gapY}px 0`, opacity: e.opacity }
- },
- [
- e.image && !o.content
- ? t.createVNode(
- 'image',
- {
- href: r.value,
- 'xlink:href': r.value,
- x: '0',
- y: '0',
- width: e.width,
- height: e.height,
- style: n
- },
- null
- )
- : t.createVNode(
- 'foreignObject',
- { x: '0', y: '0', width: e.width, height: e.height },
- [
- t.createVNode('div', { xmlns: 'http://www.w3.org/1999/xhtml', style: n }, [
- o.content
- ? o.content()
- : t.createVNode('span', { style: { color: e.textColor } }, [e.content])
- ])
- ]
- )
- ]
- )
- }
- return (
- t.watchEffect(() => {
- e.image &&
- ((e) => {
- const t = document.createElement('canvas'),
- o = new Image()
- ;(o.crossOrigin = 'anonymous'),
- (o.referrerPolicy = 'no-referrer'),
- (o.onload = () => {
- ;(t.width = o.naturalWidth), (t.height = o.naturalHeight)
- const e = t.getContext('2d')
- null == e || e.drawImage(o, 0, 0), (r.value = t.toDataURL())
- }),
- (o.src = e)
- })(e.image)
- }),
- t.watch(
- () => [r.value, e.content, e.textColor, e.height, e.width, e.rotate, e.gapX, e.gapY],
- () => {
- t.nextTick(() => {
- n.value &&
- (a.value && URL.revokeObjectURL(a.value),
- (a.value = ((e) => {
- const t = new Blob([e], { type: 'image/svg+xml' })
- return URL.createObjectURL(t)
- })(n.value.innerHTML)))
- })
- },
- { immediate: !0 }
- ),
- t.onUnmounted(() => {
- a.value && URL.revokeObjectURL(a.value)
- }),
- () => {
- const o = d({ backgroundImage: `url(${a.value})` }, pe(e.zIndex))
- return t.createVNode('div', { class: Cp({ full: e.fullPage }), style: o }, [
- t.createVNode('div', { class: Cp('wrapper'), ref: n }, [l()])
- ])
- }
- )
- }
- })
- )
- class Bp {
- constructor({
- el: e,
- src: t,
- error: o,
- loading: n,
- bindType: a,
- $parent: r,
- options: l,
- cors: i,
- elRenderer: s,
- imageCache: c
- }) {
- ;(this.el = e),
- (this.src = t),
- (this.error = o),
- (this.loading = n),
- (this.bindType = a),
- (this.attempt = 0),
- (this.cors = i),
- (this.naturalHeight = 0),
- (this.naturalWidth = 0),
- (this.options = l),
- (this.$parent = r),
- (this.elRenderer = s),
- (this.imageCache = c),
- (this.performanceData = { loadStart: 0, loadEnd: 0 }),
- this.filter(),
- this.initState(),
- this.render('loading', !1)
- }
- initState() {
- 'dataset' in this.el
- ? (this.el.dataset.src = this.src)
- : this.el.setAttribute('data-src', this.src),
- (this.state = { loading: !1, error: !1, loaded: !1, rendered: !1 })
- }
- record(e) {
- this.performanceData[e] = Date.now()
- }
- update({ src: e, loading: t, error: o }) {
- const n = this.src
- ;(this.src = e),
- (this.loading = t),
- (this.error = o),
- this.filter(),
- n !== this.src && ((this.attempt = 0), this.initState())
- }
- checkInView() {
- const e = P(this.el)
- return (
- e.top < window.innerHeight * this.options.preLoad &&
- e.bottom > this.options.preLoadTop &&
- e.left < window.innerWidth * this.options.preLoad &&
- e.right > 0
- )
- }
- filter() {
- Object.keys(this.options.filter).forEach((e) => {
- this.options.filter[e](this, this.options)
- })
- }
- renderLoading(e) {
- ;(this.state.loading = !0),
- Ka(
- { src: this.loading, cors: this.cors },
- () => {
- this.render('loading', !1), (this.state.loading = !1), e()
- },
- () => {
- e(), (this.state.loading = !1)
- }
- )
- }
- load(e = c) {
- if (this.attempt > this.options.attempt - 1 && this.state.error) e()
- else if (!this.state.rendered || !this.state.loaded)
- return this.imageCache.has(this.src)
- ? ((this.state.loaded = !0), this.render('loaded', !0), (this.state.rendered = !0), e())
- : void this.renderLoading(() => {
- var t, o
- this.attempt++,
- null == (o = (t = this.options.adapter).beforeLoad) ||
- o.call(t, this, this.options),
- this.record('loadStart'),
- Ka(
- { src: this.src, cors: this.cors },
- (t) => {
- ;(this.naturalHeight = t.naturalHeight),
- (this.naturalWidth = t.naturalWidth),
- (this.state.loaded = !0),
- (this.state.error = !1),
- this.record('loadEnd'),
- this.render('loaded', !1),
- (this.state.rendered = !0),
- this.imageCache.add(this.src),
- e()
- },
- (e) => {
- !this.options.silent && console.error(e),
- (this.state.error = !0),
- (this.state.loaded = !1),
- this.render('error', !1)
- }
- )
- })
- }
- render(e, t) {
- this.elRenderer(this, e, t)
- }
- performance() {
- let e = 'loading',
- t = 0
- return (
- this.state.loaded &&
- ((e = 'loaded'),
- (t = (this.performanceData.loadEnd - this.performanceData.loadStart) / 1e3)),
- this.state.error && (e = 'error'),
- { src: this.src, state: e, time: t }
- )
- }
- $destroy() {
- ;(this.el = null),
- (this.src = null),
- (this.error = null),
- (this.loading = null),
- (this.bindType = null),
- (this.attempt = 0)
- }
- }
- const Pp = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7',
- Dp = ['scroll', 'wheel', 'mousewheel', 'resize', 'animationend', 'transitionend', 'touchmove'],
- Op = { rootMargin: '0px', threshold: 0 }
- var Ip = (e) => ({
- props: { tag: { type: String, default: 'div' } },
- emits: ['show'],
- render() {
- return t.h(this.tag, this.show && this.$slots.default ? this.$slots.default() : null)
- },
- data: () => ({ el: null, state: { loaded: !1 }, show: !1 }),
- mounted() {
- ;(this.el = this.$el), e.addLazyBox(this), e.lazyLoadHandler()
- },
- beforeUnmount() {
- e.removeComponent(this)
- },
- methods: {
- checkInView() {
- const t = P(this.$el)
- return (
- k &&
- t.top < window.innerHeight * e.options.preLoad &&
- t.bottom > 0 &&
- t.left < window.innerWidth * e.options.preLoad &&
- t.right > 0
- )
- },
- load() {
- ;(this.show = !0), (this.state.loaded = !0), this.$emit('show', this)
- },
- destroy() {
- return this.$destroy
- }
- }
- })
- const Ap = { selector: 'img' }
- class zp {
- constructor({ el: e, binding: t, vnode: o, lazy: n }) {
- ;(this.el = null),
- (this.vnode = o),
- (this.binding = t),
- (this.options = {}),
- (this.lazy = n),
- (this.queue = []),
- this.update({ el: e, binding: t })
- }
- update({ el: e, binding: t }) {
- ;(this.el = e), (this.options = Object.assign({}, Ap, t.value))
- this.getImgs().forEach((e) => {
- this.lazy.add(
- e,
- Object.assign({}, this.binding, {
- value: {
- src: 'dataset' in e ? e.dataset.src : e.getAttribute('data-src'),
- error:
- ('dataset' in e ? e.dataset.error : e.getAttribute('data-error')) ||
- this.options.error,
- loading:
- ('dataset' in e ? e.dataset.loading : e.getAttribute('data-loading')) ||
- this.options.loading
- }
- }),
- this.vnode
- )
- })
- }
- getImgs() {
- return Array.from(this.el.querySelectorAll(this.options.selector))
- }
- clear() {
- this.getImgs().forEach((e) => this.lazy.remove(e)),
- (this.vnode = null),
- (this.binding = null),
- (this.lazy = null)
- }
- }
- class Ep {
- constructor({ lazy: e }) {
- ;(this.lazy = e), (this.queue = [])
- }
- bind(e, t, o) {
- const n = new zp({ el: e, binding: t, vnode: o, lazy: this.lazy })
- this.queue.push(n)
- }
- update(e, t, o) {
- const n = this.queue.find((t) => t.el === e)
- n && n.update({ el: e, binding: t, vnode: o })
- }
- unbind(e) {
- const t = this.queue.find((t) => t.el === e)
- t && (t.clear(), Wa(this.queue, t))
- }
- }
- var Lp = (e) => ({
- props: { src: [String, Object], tag: { type: String, default: 'img' } },
- render() {
- var e, o
- return t.h(
- this.tag,
- { src: this.renderSrc },
- null == (o = (e = this.$slots).default) ? void 0 : o.call(e)
- )
- },
- data: () => ({
- el: null,
- options: { src: '', error: '', loading: '', attempt: e.options.attempt },
- state: { loaded: !1, error: !1, attempt: 0 },
- renderSrc: ''
- }),
- watch: {
- src() {
- this.init(), e.addLazyBox(this), e.lazyLoadHandler()
- }
- },
- created() {
- this.init()
- },
- mounted() {
- ;(this.el = this.$el), e.addLazyBox(this), e.lazyLoadHandler()
- },
- beforeUnmount() {
- e.removeComponent(this)
- },
- methods: {
- init() {
- const { src: t, loading: o, error: n } = e.valueFormatter(this.src)
- ;(this.state.loaded = !1),
- (this.options.src = t),
- (this.options.error = n),
- (this.options.loading = o),
- (this.renderSrc = this.options.loading)
- },
- checkInView() {
- const t = P(this.$el)
- return (
- t.top < window.innerHeight * e.options.preLoad &&
- t.bottom > 0 &&
- t.left < window.innerWidth * e.options.preLoad &&
- t.right > 0
- )
- },
- load(e = c) {
- if (this.state.attempt > this.options.attempt - 1 && this.state.error) return void e()
- const { src: t } = this.options
- Ka(
- { src: t },
- ({ src: e }) => {
- ;(this.renderSrc = e), (this.state.loaded = !0)
- },
- () => {
- this.state.attempt++, (this.renderSrc = this.options.error), (this.state.error = !0)
- }
- )
- }
- }
- })
- const $p = {
- install(e, o = {}) {
- const n = class {
- constructor({
- preLoad: e,
- error: t,
- throttleWait: o,
- preLoadTop: n,
- dispatchEvent: a,
- loading: r,
- attempt: l,
- silent: i = !0,
- scale: s,
- listenEvents: c,
- filter: d,
- adapter: u,
- observer: p,
- observerOptions: m
- }) {
- ;(this.mode = Ha),
- (this.listeners = []),
- (this.targetIndex = 0),
- (this.targets = []),
- (this.options = {
- silent: i,
- dispatchEvent: !!a,
- throttleWait: o || 200,
- preLoad: e || 1.3,
- preLoadTop: n || 0,
- error: t || Pp,
- loading: r || Pp,
- attempt: l || 3,
- scale: s || Ya(s),
- ListenEvents: c || Dp,
- supportWebp: qa(),
- filter: d || {},
- adapter: u || {},
- observer: !!p,
- observerOptions: m || Op
- }),
- this.initEvent(),
- (this.imageCache = new _a({ max: 200 })),
- (this.lazyLoadHandler = Xa(
- this.lazyLoadHandler.bind(this),
- this.options.throttleWait
- )),
- this.setMode(this.options.observer ? ja : Ha)
- }
- config(e = {}) {
- Object.assign(this.options, e)
- }
- performance() {
- return this.listeners.map((e) => e.performance())
- }
- addLazyBox(e) {
- this.listeners.push(e),
- k &&
- (this.addListenerTarget(window),
- this.observer && this.observer.observe(e.el),
- e.$el && e.$el.parentNode && this.addListenerTarget(e.$el.parentNode))
- }
- add(e, o, n) {
- if (this.listeners.some((t) => t.el === e))
- return this.update(e, o), t.nextTick(this.lazyLoadHandler)
- const a = this.valueFormatter(o.value)
- let { src: r } = a
- t.nextTick(() => {
- ;(r = Ua(e, this.options.scale) || r), this.observer && this.observer.observe(e)
- const l = Object.keys(o.modifiers)[0]
- let i
- l && ((i = n.context.$refs[l]), (i = i ? i.$el || i : document.getElementById(l))),
- i || (i = G(e))
- const s = new Bp({
- bindType: o.arg,
- $parent: i,
- el: e,
- src: r,
- loading: a.loading,
- error: a.error,
- cors: a.cors,
- elRenderer: this.elRenderer.bind(this),
- options: this.options,
- imageCache: this.imageCache
- })
- this.listeners.push(s),
- k && (this.addListenerTarget(window), this.addListenerTarget(i)),
- this.lazyLoadHandler(),
- t.nextTick(() => this.lazyLoadHandler())
- })
- }
- update(e, o, n) {
- const a = this.valueFormatter(o.value)
- let { src: r } = a
- r = Ua(e, this.options.scale) || r
- const l = this.listeners.find((t) => t.el === e)
- l ? l.update({ src: r, error: a.error, loading: a.loading }) : this.add(e, o, n),
- this.observer && (this.observer.unobserve(e), this.observer.observe(e)),
- this.lazyLoadHandler(),
- t.nextTick(() => this.lazyLoadHandler())
- }
- remove(e) {
- if (!e) return
- this.observer && this.observer.unobserve(e)
- const t = this.listeners.find((t) => t.el === e)
- t &&
- (this.removeListenerTarget(t.$parent),
- this.removeListenerTarget(window),
- Wa(this.listeners, t),
- t.$destroy())
- }
- removeComponent(e) {
- e &&
- (Wa(this.listeners, e),
- this.observer && this.observer.unobserve(e.el),
- e.$parent && e.$el.parentNode && this.removeListenerTarget(e.$el.parentNode),
- this.removeListenerTarget(window))
- }
- setMode(e) {
- Fa || e !== ja || (e = Ha),
- (this.mode = e),
- e === Ha
- ? (this.observer &&
- (this.listeners.forEach((e) => {
- this.observer.unobserve(e.el)
- }),
- (this.observer = null)),
- this.targets.forEach((e) => {
- this.initListen(e.el, !0)
- }))
- : (this.targets.forEach((e) => {
- this.initListen(e.el, !1)
- }),
- this.initIntersectionObserver())
- }
- addListenerTarget(e) {
- if (!e) return
- let t = this.targets.find((t) => t.el === e)
- return (
- t
- ? t.childrenCount++
- : ((t = { el: e, id: ++this.targetIndex, childrenCount: 1, listened: !0 }),
- this.mode === Ha && this.initListen(t.el, !0),
- this.targets.push(t)),
- this.targetIndex
- )
- }
- removeListenerTarget(e) {
- this.targets.forEach((t, o) => {
- t.el === e &&
- (t.childrenCount--,
- t.childrenCount ||
- (this.initListen(t.el, !1), this.targets.splice(o, 1), (t = null)))
- })
- }
- initListen(e, t) {
- this.options.ListenEvents.forEach((o) => (t ? Ga : Za)(e, o, this.lazyLoadHandler))
- }
- initEvent() {
- ;(this.Event = { listeners: { loading: [], loaded: [], error: [] } }),
- (this.$on = (e, t) => {
- this.Event.listeners[e] || (this.Event.listeners[e] = []),
- this.Event.listeners[e].push(t)
- }),
- (this.$once = (e, t) => {
- const o = (...n) => {
- this.$off(e, o), t.apply(this, n)
- }
- this.$on(e, o)
- }),
- (this.$off = (e, t) => {
- if (t) Wa(this.Event.listeners[e], t)
- else {
- if (!this.Event.listeners[e]) return
- this.Event.listeners[e].length = 0
- }
- }),
- (this.$emit = (e, t, o) => {
- this.Event.listeners[e] && this.Event.listeners[e].forEach((e) => e(t, o))
- })
- }
- lazyLoadHandler() {
- const e = []
- this.listeners.forEach((t) => {
- ;(t.el && t.el.parentNode) || e.push(t), t.checkInView() && t.load()
- }),
- e.forEach((e) => {
- Wa(this.listeners, e), e.$destroy()
- })
- }
- initIntersectionObserver() {
- Fa &&
- ((this.observer = new IntersectionObserver(
- this.observerHandler.bind(this),
- this.options.observerOptions
- )),
- this.listeners.length &&
- this.listeners.forEach((e) => {
- this.observer.observe(e.el)
- }))
- }
- observerHandler(e) {
- e.forEach((e) => {
- e.isIntersecting &&
- this.listeners.forEach((t) => {
- if (t.el === e.target) {
- if (t.state.loaded) return this.observer.unobserve(t.el)
- t.load()
- }
- })
- })
- }
- elRenderer(e, t, o) {
- if (!e.el) return
- const { el: n, bindType: a } = e
- let r
- switch (t) {
- case 'loading':
- r = e.loading
- break
- case 'error':
- r = e.error
- break
- default:
- ;({ src: r } = e)
- }
- if (
- (a
- ? (n.style[a] = 'url("' + r + '")')
- : n.getAttribute('src') !== r && n.setAttribute('src', r),
- n.setAttribute('lazy', t),
- this.$emit(t, e, o),
- this.options.adapter[t] && this.options.adapter[t](e, this.options),
- this.options.dispatchEvent)
- ) {
- const o = new CustomEvent(t, { detail: e })
- n.dispatchEvent(o)
- }
- }
- valueFormatter(e) {
- let t = e,
- { loading: o, error: n } = this.options
- return (
- a(e) &&
- (({ src: t } = e),
- (o = e.loading || this.options.loading),
- (n = e.error || this.options.error)),
- { src: t, loading: o, error: n }
- )
- }
- },
- r = new n(o),
- l = new Ep({ lazy: r })
- ;(e.config.globalProperties.$Lazyload = r),
- o.lazyComponent && e.component('LazyComponent', Ip(r)),
- o.lazyImage && e.component('LazyImage', Lp(r)),
- e.directive('lazy', {
- beforeMount: r.add.bind(r),
- updated: r.update.bind(r),
- unmounted: r.remove.bind(r)
- }),
- e.directive('lazy-container', {
- beforeMount: l.bind.bind(l),
- updated: l.update.bind(l),
- unmounted: l.unbind.bind(l)
- })
- }
- },
- Mp = '4.4.0'
- function Rp(e) {
- ;[
- Je,
- Dt,
- zt,
- Qt,
- ha,
- Ra,
- vn,
- tr,
- lt,
- rr,
- St,
- Dr,
- Mr,
- Wr,
- wn,
- Xr,
- ol,
- nl,
- cl,
- bl,
- Nl,
- Bl,
- Pl,
- zl,
- Fl,
- Yl,
- Zl,
- ti,
- ii,
- hi,
- wi,
- Oi,
- Ei,
- Ui,
- Yi,
- ui,
- En,
- kn,
- Ki,
- es,
- ht,
- zr,
- ps,
- xs,
- Vs,
- Ts,
- Vt,
- Te,
- Os,
- Es,
- Us,
- Qs,
- Ut,
- rc,
- cc,
- un,
- dc,
- ad,
- Gt,
- sd,
- fd,
- Oa,
- xa,
- bd,
- yd,
- kd,
- Od,
- Ld,
- Fd,
- Yd,
- uu,
- eu,
- vu,
- lu,
- Zd,
- yu,
- ku,
- Iu,
- $u,
- Mu,
- Co,
- Wu,
- Do,
- Xu,
- Yo,
- la,
- Zo,
- Ju,
- op,
- Ko,
- Ca,
- lp,
- cp,
- oa,
- mp,
- Np,
- Tp
- ].forEach((t) => {
- t.install ? e.use(t) : t.name && e.component(t.name, t)
- })
- }
- var Fp = { install: Rp, version: Mp }
- ;(e.ActionBar = Je),
- (e.ActionBarButton = Dt),
- (e.ActionBarIcon = zt),
- (e.ActionSheet = Qt),
- (e.AddressEdit = ha),
- (e.AddressList = Ra),
- (e.Area = vn),
- (e.BackTop = tr),
- (e.Badge = lt),
- (e.Barrage = rr),
- (e.Button = St),
- (e.Calendar = Dr),
- (e.Card = Mr),
- (e.Cascader = Wr),
- (e.Cell = wn),
- (e.CellGroup = Xr),
- (e.Checkbox = ol),
- (e.CheckboxGroup = nl),
- (e.Circle = cl),
- (e.Col = bl),
- (e.Collapse = Nl),
- (e.CollapseItem = Bl),
- (e.ConfigProvider = Pl),
- (e.ContactCard = zl),
- (e.ContactEdit = Fl),
- (e.ContactList = Yl),
- (e.CountDown = Zl),
- (e.Coupon = ti),
- (e.CouponCell = ii),
- (e.CouponList = hi),
- (e.DEFAULT_ROW_WIDTH = ou),
- (e.DatePicker = wi),
- (e.Dialog = Oi),
- (e.Divider = Ei),
- (e.DropdownItem = Ui),
- (e.DropdownMenu = Yi),
- (e.Empty = ui),
- (e.Field = En),
- (e.Form = kn),
- (e.Grid = Ki),
- (e.GridItem = es),
- (e.Icon = ht),
- (e.Image = zr),
- (e.ImagePreview = ps),
- (e.IndexAnchor = xs),
- (e.IndexBar = Vs),
- (e.Lazyload = $p),
- (e.List = Ts),
- (e.Loading = Vt),
- (e.Locale = Te),
- (e.NavBar = Os),
- (e.NoticeBar = Es),
- (e.Notify = Us),
- (e.NumberKeyboard = Qs),
- (e.Overlay = Ut),
- (e.Pagination = rc),
- (e.PasswordInput = cc),
- (e.Picker = un),
- (e.PickerGroup = dc),
- (e.Popover = ad),
- (e.Popup = Gt),
- (e.Progress = sd),
- (e.PullRefresh = fd),
- (e.Radio = Oa),
- (e.RadioGroup = xa),
- (e.Rate = bd),
- (e.Row = yd),
- (e.Search = kd),
- (e.ShareSheet = Od),
- (e.Sidebar = Ld),
- (e.SidebarItem = Fd),
- (e.Signature = Yd),
- (e.Skeleton = uu),
- (e.SkeletonAvatar = eu),
- (e.SkeletonImage = vu),
- (e.SkeletonParagraph = lu),
- (e.SkeletonTitle = Zd),
- (e.Slider = yu),
- (e.Space = ku),
- (e.Step = Iu),
- (e.Stepper = $u),
- (e.Steps = Mu),
- (e.Sticky = Co),
- (e.SubmitBar = Wu),
- (e.Swipe = Do),
- (e.SwipeCell = Xu),
- (e.SwipeItem = Yo),
- (e.Switch = la),
- (e.Tab = Zo),
- (e.Tabbar = Ju),
- (e.TabbarItem = op),
- (e.Tabs = Ko),
- (e.Tag = Ca),
- (e.TextEllipsis = lp),
- (e.TimePicker = cp),
- (e.Toast = oa),
- (e.TreeSelect = mp),
- (e.Uploader = Np),
- (e.Watermark = Tp),
- (e.actionBarButtonProps = Pt),
- (e.actionBarIconProps = At),
- (e.actionBarProps = _e),
- (e.actionSheetProps = _t),
- (e.addressEditProps = va),
- (e.addressListProps = Ma),
- (e.allowMultipleToast = (e = !0) => {
- qn = e
- }),
- (e.areaProps = fn),
- (e.backTopProps = er),
- (e.badgeProps = rt),
- (e.barrageProps = or),
- (e.buttonProps = Ct),
- (e.calendarProps = Pr),
- (e.cardProps = $r),
- (e.cascaderProps = jr),
- (e.cellGroupProps = qr),
- (e.cellProps = yn),
- (e.checkboxGroupProps = Kr),
- (e.checkboxProps = tl),
- (e.circleProps = sl),
- (e.closeDialog = () => {
- Ti && Ti.toggle(!1)
- }),
- (e.closeNotify = Ws),
- (e.closeToast = (e) => {
- var t
- Yn.length &&
- (e
- ? (Yn.forEach((e) => {
- e.close()
- }),
- (Yn = []))
- : qn
- ? null == (t = Yn.shift()) || t.close()
- : Yn[0].close())
- }),
- (e.colProps = gl),
- (e.collapseItemProps = Tl),
- (e.collapseProps = Vl),
- (e.configProviderProps = ut),
- (e.contactCardProps = Al),
- (e.contactEditProps = Rl),
- (e.contactListProps = Ul),
- (e.countDownProps = Gl),
- (e.couponCellProps = ri),
- (e.couponListProps = vi),
- (e.datePickerProps = yi),
- (e.default = Fp),
- (e.dialogProps = ki),
- (e.dividerProps = zi),
- (e.dropdownItemProps = Wi),
- (e.dropdownMenuProps = Mi),
- (e.emptyProps = di),
- (e.fieldProps = zn),
- (e.formProps = Nn),
- (e.gridItemProps = Qi),
- (e.gridProps = Gi),
- (e.iconProps = vt),
- (e.imagePreviewProps = is),
- (e.imageProps = Ar),
- (e.indexAnchorProps = ws),
- (e.indexBarProps = vs),
- (e.install = Rp),
- (e.listProps = Ss),
- (e.loadingProps = xt),
- (e.navBarProps = Ds),
- (e.noticeBarProps = zs),
- (e.notifyProps = Ms),
- (e.numberKeyboardProps = Js),
- (e.overlayProps = Wt),
- (e.paginationProps = ac),
- (e.passwordInputProps = sc),
- (e.pickerGroupProps = en),
- (e.pickerProps = nn),
- (e.popoverProps = nd),
- (e.popupProps = Yt),
- (e.progressProps = id),
- (e.pullRefreshProps = md),
- (e.radioGroupProps = ya),
- (e.radioProps = Ba),
- (e.rateProps = gd),
- (e.resetDialogDefaultOptions = () => {
- Pi = d({}, Bi)
- }),
- (e.resetNotifyDefaultOptions = () => {
- js = {
- type: 'danger',
- color: void 0,
- message: '',
- onClose: void 0,
- onClick: void 0,
- onOpened: void 0,
- duration: 3e3,
- position: void 0,
- className: '',
- lockScroll: !1,
- background: void 0
- }
- }),
- (e.resetToastDefaultOptions = (e) => {
- 'string' == typeof e ? Gn.delete(e) : ((Xn = d({}, Un)), Gn.clear())
- }),
- (e.rowProps = ml),
- (e.searchProps = Nd),
- (e.setDialogDefaultOptions = (e) => {
- d(Pi, e)
- }),
- (e.setNotifyDefaultOptions = (e) => d(js, e)),
- (e.setToastDefaultOptions = function (e, t) {
- 'string' == typeof e ? Gn.set(e, t) : d(Xn, e)
- }),
- (e.shareSheetProps = Dd),
- (e.showConfirmDialog = (e) => Di(d({ showCancelButton: !0 }, e))),
- (e.showDialog = Di),
- (e.showFailToast = ta),
- (e.showImagePreview = us),
- (e.showLoadingToast = Qn),
- (e.showNotify = function (e) {
- var o
- if (u)
- return (
- Hs ||
- ({ instance: Hs } = Wn({
- setup() {
- const { state: e, toggle: o } = jn()
- return () => t.createVNode(Rs, t.mergeProps(e, { 'onUpdate:show': o }), null)
- }
- })),
- (e = d({}, js, a((o = e)) ? o : { message: o })),
- Hs.open(e),
- clearTimeout(Fs),
- e.duration > 0 && (Fs = setTimeout(Ws, e.duration)),
- Hs
- )
- }),
- (e.showSuccessToast = ea),
- (e.showToast = _n),
- (e.sidebarItemProps = Rd),
- (e.sidebarProps = Ed),
- (e.skeletonAvatarProps = Qd),
- (e.skeletonImageProps = fu),
- (e.skeletonParagraphProps = nu),
- (e.skeletonProps = du),
- (e.skeletonTitleProps = Gd),
- (e.sliderProps = bu),
- (e.spaceProps = Vu),
- (e.stepperProps = Lu),
- (e.stepsProps = Tu),
- (e.stickyProps = ko),
- (e.submitBarProps = ju),
- (e.swipeCellProps = qu),
- (e.swipeProps = Bo),
- (e.switchProps = ra),
- (e.tabProps = Go),
- (e.tabbarItemProps = tp),
- (e.tabbarProps = Ku),
- (e.tabsProps = Lo),
- (e.tagProps = ka),
- (e.textEllipsisProps = rp),
- (e.timePickerProps = sp),
- (e.toastProps = Fn),
- (e.treeSelectProps = pp),
- (e.uploaderProps = Vp),
- (e.useCurrentLang = () => Ce),
- (e.version = Mp),
- (e.watermarkProps = Sp),
- Object.defineProperties(e, {
- __esModule: { value: !0 },
- [Symbol.toStringTag]: { value: 'Module' }
- })
- })
|